-
{#if showSend}
@@ -371,10 +247,6 @@
diff --git a/packages/text-editor/src/components/StyledTextEditor.svelte b/packages/text-editor/src/components/StyledTextEditor.svelte
index 5f6248740b..608319b82d 100644
--- a/packages/text-editor/src/components/StyledTextEditor.svelte
+++ b/packages/text-editor/src/components/StyledTextEditor.svelte
@@ -13,46 +13,14 @@
// limitations under the License.
-->
+
+ {
+ needFocus = true
+ }}
+ />
+
diff --git a/packages/text-editor/src/components/TextEditorStyleToolbar.svelte b/packages/text-editor/src/components/TextEditorStyleToolbar.svelte
new file mode 100644
index 0000000000..a2297bf631
--- /dev/null
+++ b/packages/text-editor/src/components/TextEditorStyleToolbar.svelte
@@ -0,0 +1,321 @@
+
+
+
+{#if textEditor}
+ {#each textFormatCategories as category, index}
+ {#if category === TextFormatCategory.Heading}
+
+
+ {/if}
+ {#if category === TextFormatCategory.TextDecoration}
+
+
+
+
+ {/if}
+ {#if category === TextFormatCategory.Link}
+
+ {/if}
+ {#if category === TextFormatCategory.List}
+
+
+ {/if}
+ {#if category === TextFormatCategory.Quote}
+
+ {/if}
+ {#if category === TextFormatCategory.Code}
+
+
+ {/if}
+ {#if category === TextFormatCategory.Table}
+
+ {#if textEditor.isActive('table')}
+
+ {/if}
+ {/if}
+ {#if index < textFormatCategories.length - 1}
+
+ {/if}
+ {/each}
+{/if}
diff --git a/packages/text-editor/src/components/extensions.ts b/packages/text-editor/src/components/extensions.ts
index f125f20fdc..bb69621035 100644
--- a/packages/text-editor/src/components/extensions.ts
+++ b/packages/text-editor/src/components/extensions.ts
@@ -42,7 +42,7 @@ export const taskListExtensions = [
})
]
-export const headingLevels: Level[] = [1, 2, 3, 4, 5, 6]
+export const supportedHeadingLevels: Level[] = [1, 2]
export const defaultExtensions: AnyExtension[] = [
StarterKit.configure({
@@ -60,7 +60,7 @@ export const defaultExtensions: AnyExtension[] = [
}
},
heading: {
- levels: headingLevels
+ levels: supportedHeadingLevels
}
}),
Highlight.configure({
diff --git a/packages/text-editor/src/types.ts b/packages/text-editor/src/types.ts
index 21eedd9a39..424e18536b 100644
--- a/packages/text-editor/src/types.ts
+++ b/packages/text-editor/src/types.ts
@@ -30,27 +30,15 @@ export interface RefInputActionItem extends Doc {
/**
* @public
*/
-export const FORMAT_MODES = [
- 'bold',
- 'italic',
- 'strike',
- 'link',
- 'orderedList',
- 'bulletList',
- 'blockquote',
- 'code',
- 'codeBlock',
- 'heading',
- 'heading1',
- 'heading2',
- 'table',
- 'underline'
-] as const
-
-/**
- * @public
- */
-export type FormatMode = (typeof FORMAT_MODES)[number]
+export enum TextFormatCategory {
+ Heading = 'heading',
+ TextDecoration = 'text-decoration', // bold, italic, strike, underline
+ Link = 'link',
+ List = 'list', // orderedList, bulletList,
+ Quote = 'quote', // blockquote
+ Code = 'code', // code, codeBlock
+ Table = 'table'
+}
/**
* @public
diff --git a/packages/theme/styles/_text-editor.scss b/packages/theme/styles/_text-editor.scss
index c7011ac284..cf018a6cff 100644
--- a/packages/theme/styles/_text-editor.scss
+++ b/packages/theme/styles/_text-editor.scss
@@ -2,9 +2,3 @@
cursor: pointer;
object-fit: contain;
}
-
-// need to override editor's bubble max-width
-// due to https://github.com/atomiks/tippyjs/issues/451
-.tippy-box {
- max-width: 450px !important;
-}
\ No newline at end of file