@multiplatform.one/rich-text 6.0.4 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/cjs/RichEditor.cjs +84 -9
- package/dist/cjs/RichEditor.native.js +422 -35
- package/dist/cjs/RichEditor.native.js.map +1 -1
- package/dist/cjs/RichTextEditor/index.cjs +18 -2
- package/dist/cjs/RichTextEditor/index.native.js +18 -2
- package/dist/cjs/RichTextEditor/index.native.js.map +1 -1
- package/dist/cjs/constants.cjs +52 -29
- package/dist/cjs/constants.native.js +59 -29
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/editor/BlockDragHandle.cjs +22 -7
- package/dist/cjs/editor/BlockDragHandle.native.js +41 -7
- package/dist/cjs/editor/BlockDragHandle.native.js.map +1 -1
- package/dist/cjs/editor/SlashCommands.cjs +249 -293
- package/dist/cjs/editor/SlashCommands.native.js +306 -340
- package/dist/cjs/editor/SlashCommands.native.js.map +1 -1
- package/dist/cjs/editor/TentapEditor.native.js +44 -12
- package/dist/cjs/editor/TentapEditor.native.js.map +1 -1
- package/dist/cjs/editor/TiptapEditor.cjs +140 -33
- package/dist/cjs/editor/TiptapEditor.native.js +153 -33
- package/dist/cjs/editor/TiptapEditor.native.js.map +1 -1
- package/dist/cjs/editor/blockAnchor.cjs +43 -0
- package/dist/cjs/editor/blockAnchor.native.js +68 -0
- package/dist/cjs/editor/blockAnchor.native.js.map +1 -0
- package/dist/cjs/editor/codeBlockPreview.cjs +230 -0
- package/dist/cjs/editor/codeBlockPreview.native.js +265 -0
- package/dist/cjs/editor/codeBlockPreview.native.js.map +1 -0
- package/dist/cjs/editor/editorStyles.cjs +203 -34
- package/dist/cjs/editor/editorStyles.native.js +203 -34
- package/dist/cjs/editor/editorStyles.native.js.map +1 -1
- package/dist/cjs/editor/emoji.cjs +128 -0
- package/dist/cjs/editor/emoji.native.js +184 -0
- package/dist/cjs/editor/emoji.native.js.map +1 -0
- package/dist/cjs/editor/lazyKatex.cjs +78 -0
- package/dist/cjs/editor/lazyKatex.native.js +117 -0
- package/dist/cjs/editor/lazyKatex.native.js.map +1 -0
- package/dist/cjs/editor/markdown.cjs +216 -0
- package/dist/cjs/editor/markdown.native.js +278 -0
- package/dist/cjs/editor/markdown.native.js.map +1 -0
- package/dist/cjs/editor/mathematics.cjs +168 -0
- package/dist/cjs/editor/mathematics.native.js +202 -0
- package/dist/cjs/editor/mathematics.native.js.map +1 -0
- package/dist/cjs/editor/media.cjs +138 -0
- package/dist/cjs/editor/media.native.js +172 -0
- package/dist/cjs/editor/media.native.js.map +1 -0
- package/dist/cjs/editor/mentions.cjs +73 -0
- package/dist/cjs/editor/mentions.native.js +84 -0
- package/dist/cjs/editor/mentions.native.js.map +1 -0
- package/dist/cjs/editor/pasteCleanup.cjs +83 -0
- package/dist/cjs/editor/pasteCleanup.native.js +175 -0
- package/dist/cjs/editor/pasteCleanup.native.js.map +1 -0
- package/dist/cjs/editor/suggestionPopup.cjs +297 -0
- package/dist/cjs/editor/suggestionPopup.native.js +327 -0
- package/dist/cjs/editor/suggestionPopup.native.js.map +1 -0
- package/dist/cjs/preview.cjs +263 -0
- package/dist/cjs/preview.native.js +294 -0
- package/dist/cjs/preview.native.js.map +1 -0
- package/dist/cjs/shared/t.cjs +53 -0
- package/dist/cjs/shared/t.native.js +56 -0
- package/dist/cjs/shared/t.native.js.map +1 -0
- package/dist/cjs/shared/url.cjs +35 -0
- package/dist/cjs/shared/url.native.js +38 -0
- package/dist/cjs/shared/url.native.js.map +1 -0
- package/dist/cjs/styled.cjs +13 -6
- package/dist/cjs/styled.native.js +13 -6
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/toolbar/BubbleToolbar.cjs +10 -8
- package/dist/cjs/toolbar/BubbleToolbar.native.js +10 -8
- package/dist/cjs/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/cjs/toolbar/CodeBlockBubble.cjs +59 -23
- package/dist/cjs/toolbar/CodeBlockBubble.native.js +71 -25
- package/dist/cjs/toolbar/CodeBlockBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/ColorPicker.cjs +19 -54
- package/dist/cjs/toolbar/ColorPicker.native.js +81 -179
- package/dist/cjs/toolbar/ColorPicker.native.js.map +1 -1
- package/dist/cjs/toolbar/FixedToolbar.cjs +33 -10
- package/dist/cjs/toolbar/FixedToolbar.native.js +46 -54
- package/dist/cjs/toolbar/FixedToolbar.native.js.map +1 -1
- package/dist/cjs/toolbar/HeadingPicker.cjs +32 -39
- package/dist/cjs/toolbar/HeadingPicker.native.js +61 -51
- package/dist/cjs/toolbar/HeadingPicker.native.js.map +1 -1
- package/dist/cjs/toolbar/ImageBubble.cjs +20 -43
- package/dist/cjs/toolbar/ImageBubble.native.js +20 -43
- package/dist/cjs/toolbar/ImageBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/ImageDialog.cjs +5 -4
- package/dist/cjs/toolbar/ImageDialog.native.js +76 -65
- package/dist/cjs/toolbar/ImageDialog.native.js.map +1 -1
- package/dist/cjs/toolbar/LinkBubble.cjs +23 -70
- package/dist/cjs/toolbar/LinkBubble.native.js +23 -70
- package/dist/cjs/toolbar/LinkBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/LinkDialog.cjs +19 -18
- package/dist/cjs/toolbar/LinkDialog.native.js +86 -83
- package/dist/cjs/toolbar/LinkDialog.native.js.map +1 -1
- package/dist/cjs/toolbar/ListPicker.cjs +32 -43
- package/dist/cjs/toolbar/ListPicker.native.js +43 -44
- package/dist/cjs/toolbar/ListPicker.native.js.map +1 -1
- package/dist/cjs/toolbar/MathBubble.cjs +159 -0
- package/dist/cjs/toolbar/MathBubble.native.js +169 -0
- package/dist/cjs/toolbar/MathBubble.native.js.map +1 -0
- package/dist/cjs/toolbar/MoreDropdown.cjs +51 -98
- package/dist/cjs/toolbar/MoreDropdown.native.js +73 -98
- package/dist/cjs/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/cjs/toolbar/StatusBar.cjs +19 -10
- package/dist/cjs/toolbar/StatusBar.native.js +19 -10
- package/dist/cjs/toolbar/StatusBar.native.js.map +1 -1
- package/dist/cjs/toolbar/TableBubble.cjs +77 -95
- package/dist/cjs/toolbar/TableBubble.native.js +73 -71
- package/dist/cjs/toolbar/TableBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarButton.cjs +86 -21
- package/dist/cjs/toolbar/ToolbarButton.native.js +14 -4
- package/dist/cjs/toolbar/ToolbarButton.native.js.map +1 -1
- package/dist/cjs/toolbar/icons.cjs +111 -468
- package/dist/cjs/toolbar/shortcuts.cjs +73 -24
- package/dist/cjs/toolbar/shortcuts.native.js +73 -24
- package/dist/cjs/toolbar/shortcuts.native.js.map +1 -1
- package/dist/cjs/toolbar/useHorizontalScroll.cjs +25 -5
- package/dist/cjs/toolbar/useHorizontalScroll.native.js +25 -5
- package/dist/cjs/toolbar/useHorizontalScroll.native.js.map +1 -1
- package/dist/cjs/toolbar/useRovingFocus.cjs +80 -0
- package/dist/cjs/toolbar/useRovingFocus.native.js +113 -0
- package/dist/cjs/toolbar/useRovingFocus.native.js.map +1 -0
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/RichEditor.mjs +85 -10
- package/dist/esm/RichEditor.mjs.map +1 -1
- package/dist/esm/RichEditor.native.js +425 -38
- package/dist/esm/RichEditor.native.js.map +1 -1
- package/dist/esm/RichTextEditor/index.mjs +18 -2
- package/dist/esm/RichTextEditor/index.mjs.map +1 -1
- package/dist/esm/RichTextEditor/index.native.js +18 -2
- package/dist/esm/RichTextEditor/index.native.js.map +1 -1
- package/dist/esm/constants.mjs +47 -29
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +54 -29
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/editor/BlockDragHandle.mjs +22 -7
- package/dist/esm/editor/BlockDragHandle.mjs.map +1 -1
- package/dist/esm/editor/BlockDragHandle.native.js +41 -7
- package/dist/esm/editor/BlockDragHandle.native.js.map +1 -1
- package/dist/esm/editor/SlashCommands.mjs +250 -294
- package/dist/esm/editor/SlashCommands.mjs.map +1 -1
- package/dist/esm/editor/SlashCommands.native.js +307 -341
- package/dist/esm/editor/SlashCommands.native.js.map +1 -1
- package/dist/esm/editor/TentapEditor.native.js +45 -13
- package/dist/esm/editor/TentapEditor.native.js.map +1 -1
- package/dist/esm/editor/TiptapEditor.mjs +142 -35
- package/dist/esm/editor/TiptapEditor.mjs.map +1 -1
- package/dist/esm/editor/TiptapEditor.native.js +155 -35
- package/dist/esm/editor/TiptapEditor.native.js.map +1 -1
- package/dist/esm/editor/blockAnchor.mjs +18 -0
- package/dist/esm/editor/blockAnchor.mjs.map +1 -0
- package/dist/esm/editor/blockAnchor.native.js +40 -0
- package/dist/esm/editor/blockAnchor.native.js.map +1 -0
- package/dist/esm/editor/codeBlockPreview.mjs +190 -0
- package/dist/esm/editor/codeBlockPreview.mjs.map +1 -0
- package/dist/esm/editor/codeBlockPreview.native.js +222 -0
- package/dist/esm/editor/codeBlockPreview.native.js.map +1 -0
- package/dist/esm/editor/editorStyles.mjs +203 -34
- package/dist/esm/editor/editorStyles.mjs.map +1 -1
- package/dist/esm/editor/editorStyles.native.js +203 -34
- package/dist/esm/editor/editorStyles.native.js.map +1 -1
- package/dist/esm/editor/emoji.mjs +88 -0
- package/dist/esm/editor/emoji.mjs.map +1 -0
- package/dist/esm/editor/emoji.native.js +141 -0
- package/dist/esm/editor/emoji.native.js.map +1 -0
- package/dist/esm/editor/lazyKatex.mjs +40 -0
- package/dist/esm/editor/lazyKatex.mjs.map +1 -0
- package/dist/esm/editor/lazyKatex.native.js +76 -0
- package/dist/esm/editor/lazyKatex.native.js.map +1 -0
- package/dist/esm/editor/markdown.mjs +179 -0
- package/dist/esm/editor/markdown.mjs.map +1 -0
- package/dist/esm/editor/markdown.native.js +238 -0
- package/dist/esm/editor/markdown.native.js.map +1 -0
- package/dist/esm/editor/mathematics.mjs +142 -0
- package/dist/esm/editor/mathematics.mjs.map +1 -0
- package/dist/esm/editor/mathematics.native.js +173 -0
- package/dist/esm/editor/mathematics.native.js.map +1 -0
- package/dist/esm/editor/media.mjs +113 -0
- package/dist/esm/editor/media.mjs.map +1 -0
- package/dist/esm/editor/media.native.js +144 -0
- package/dist/esm/editor/media.native.js.map +1 -0
- package/dist/esm/editor/mentions.mjs +37 -0
- package/dist/esm/editor/mentions.mjs.map +1 -0
- package/dist/esm/editor/mentions.native.js +45 -0
- package/dist/esm/editor/mentions.native.js.map +1 -0
- package/dist/esm/editor/pasteCleanup.mjs +57 -0
- package/dist/esm/editor/pasteCleanup.mjs.map +1 -0
- package/dist/esm/editor/pasteCleanup.native.js +146 -0
- package/dist/esm/editor/pasteCleanup.native.js.map +1 -0
- package/dist/esm/editor/suggestionPopup.mjs +268 -0
- package/dist/esm/editor/suggestionPopup.mjs.map +1 -0
- package/dist/esm/editor/suggestionPopup.native.js +295 -0
- package/dist/esm/editor/suggestionPopup.native.js.map +1 -0
- package/dist/esm/preview.mjs +236 -0
- package/dist/esm/preview.mjs.map +1 -0
- package/dist/esm/preview.native.js +264 -0
- package/dist/esm/preview.native.js.map +1 -0
- package/dist/esm/shared/t.mjs +17 -0
- package/dist/esm/shared/t.mjs.map +1 -0
- package/dist/esm/shared/t.native.js +17 -0
- package/dist/esm/shared/t.native.js.map +1 -0
- package/dist/esm/shared/url.mjs +10 -0
- package/dist/esm/shared/url.mjs.map +1 -0
- package/dist/esm/shared/url.native.js +10 -0
- package/dist/esm/shared/url.native.js.map +1 -0
- package/dist/esm/styled.mjs +13 -6
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +13 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/toolbar/BubbleToolbar.mjs +11 -9
- package/dist/esm/toolbar/BubbleToolbar.mjs.map +1 -1
- package/dist/esm/toolbar/BubbleToolbar.native.js +11 -9
- package/dist/esm/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/esm/toolbar/CodeBlockBubble.mjs +60 -24
- package/dist/esm/toolbar/CodeBlockBubble.mjs.map +1 -1
- package/dist/esm/toolbar/CodeBlockBubble.native.js +72 -26
- package/dist/esm/toolbar/CodeBlockBubble.native.js.map +1 -1
- package/dist/esm/toolbar/ColorPicker.mjs +21 -56
- package/dist/esm/toolbar/ColorPicker.mjs.map +1 -1
- package/dist/esm/toolbar/ColorPicker.native.js +82 -180
- package/dist/esm/toolbar/ColorPicker.native.js.map +1 -1
- package/dist/esm/toolbar/FixedToolbar.mjs +34 -11
- package/dist/esm/toolbar/FixedToolbar.mjs.map +1 -1
- package/dist/esm/toolbar/FixedToolbar.native.js +47 -55
- package/dist/esm/toolbar/FixedToolbar.native.js.map +1 -1
- package/dist/esm/toolbar/HeadingPicker.mjs +34 -41
- package/dist/esm/toolbar/HeadingPicker.mjs.map +1 -1
- package/dist/esm/toolbar/HeadingPicker.native.js +63 -53
- package/dist/esm/toolbar/HeadingPicker.native.js.map +1 -1
- package/dist/esm/toolbar/ImageBubble.mjs +20 -43
- package/dist/esm/toolbar/ImageBubble.mjs.map +1 -1
- package/dist/esm/toolbar/ImageBubble.native.js +20 -43
- package/dist/esm/toolbar/ImageBubble.native.js.map +1 -1
- package/dist/esm/toolbar/ImageDialog.mjs +5 -4
- package/dist/esm/toolbar/ImageDialog.mjs.map +1 -1
- package/dist/esm/toolbar/ImageDialog.native.js +75 -64
- package/dist/esm/toolbar/ImageDialog.native.js.map +1 -1
- package/dist/esm/toolbar/LinkBubble.mjs +23 -70
- package/dist/esm/toolbar/LinkBubble.mjs.map +1 -1
- package/dist/esm/toolbar/LinkBubble.native.js +23 -70
- package/dist/esm/toolbar/LinkBubble.native.js.map +1 -1
- package/dist/esm/toolbar/LinkDialog.mjs +17 -16
- package/dist/esm/toolbar/LinkDialog.mjs.map +1 -1
- package/dist/esm/toolbar/LinkDialog.native.js +84 -80
- package/dist/esm/toolbar/LinkDialog.native.js.map +1 -1
- package/dist/esm/toolbar/ListPicker.mjs +33 -44
- package/dist/esm/toolbar/ListPicker.mjs.map +1 -1
- package/dist/esm/toolbar/ListPicker.native.js +44 -45
- package/dist/esm/toolbar/ListPicker.native.js.map +1 -1
- package/dist/esm/toolbar/MathBubble.mjs +134 -0
- package/dist/esm/toolbar/MathBubble.mjs.map +1 -0
- package/dist/esm/toolbar/MathBubble.native.js +141 -0
- package/dist/esm/toolbar/MathBubble.native.js.map +1 -0
- package/dist/esm/toolbar/MoreDropdown.mjs +50 -97
- package/dist/esm/toolbar/MoreDropdown.mjs.map +1 -1
- package/dist/esm/toolbar/MoreDropdown.native.js +72 -97
- package/dist/esm/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/esm/toolbar/StatusBar.mjs +19 -10
- package/dist/esm/toolbar/StatusBar.mjs.map +1 -1
- package/dist/esm/toolbar/StatusBar.native.js +19 -10
- package/dist/esm/toolbar/StatusBar.native.js.map +1 -1
- package/dist/esm/toolbar/TableBubble.mjs +77 -95
- package/dist/esm/toolbar/TableBubble.mjs.map +1 -1
- package/dist/esm/toolbar/TableBubble.native.js +73 -71
- package/dist/esm/toolbar/TableBubble.native.js.map +1 -1
- package/dist/esm/toolbar/ToolbarButton.mjs +87 -22
- package/dist/esm/toolbar/ToolbarButton.mjs.map +1 -1
- package/dist/esm/toolbar/ToolbarButton.native.js +14 -4
- package/dist/esm/toolbar/ToolbarButton.native.js.map +1 -1
- package/dist/esm/toolbar/icons.mjs +109 -469
- package/dist/esm/toolbar/icons.mjs.map +1 -1
- package/dist/esm/toolbar/shortcuts.mjs +73 -24
- package/dist/esm/toolbar/shortcuts.mjs.map +1 -1
- package/dist/esm/toolbar/shortcuts.native.js +73 -24
- package/dist/esm/toolbar/shortcuts.native.js.map +1 -1
- package/dist/esm/toolbar/useHorizontalScroll.mjs +25 -6
- package/dist/esm/toolbar/useHorizontalScroll.mjs.map +1 -1
- package/dist/esm/toolbar/useHorizontalScroll.native.js +25 -6
- package/dist/esm/toolbar/useHorizontalScroll.native.js.map +1 -1
- package/dist/esm/toolbar/useRovingFocus.mjs +55 -0
- package/dist/esm/toolbar/useRovingFocus.mjs.map +1 -0
- package/dist/esm/toolbar/useRovingFocus.native.js +85 -0
- package/dist/esm/toolbar/useRovingFocus.native.js.map +1 -0
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/jsx/RichEditor.mjs +85 -10
- package/dist/jsx/RichEditor.mjs.map +1 -1
- package/dist/jsx/RichEditor.native.js +422 -35
- package/dist/jsx/RichEditor.native.js.map +1 -1
- package/dist/jsx/RichTextEditor/index.mjs +18 -2
- package/dist/jsx/RichTextEditor/index.mjs.map +1 -1
- package/dist/jsx/RichTextEditor/index.native.js +18 -2
- package/dist/jsx/RichTextEditor/index.native.js.map +1 -1
- package/dist/jsx/constants.mjs +47 -29
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.js +59 -29
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/editor/BlockDragHandle.mjs +22 -7
- package/dist/jsx/editor/BlockDragHandle.mjs.map +1 -1
- package/dist/jsx/editor/BlockDragHandle.native.js +41 -7
- package/dist/jsx/editor/BlockDragHandle.native.js.map +1 -1
- package/dist/jsx/editor/SlashCommands.mjs +250 -294
- package/dist/jsx/editor/SlashCommands.mjs.map +1 -1
- package/dist/jsx/editor/SlashCommands.native.js +306 -340
- package/dist/jsx/editor/SlashCommands.native.js.map +1 -1
- package/dist/jsx/editor/TentapEditor.native.js +44 -12
- package/dist/jsx/editor/TentapEditor.native.js.map +1 -1
- package/dist/jsx/editor/TiptapEditor.mjs +142 -35
- package/dist/jsx/editor/TiptapEditor.mjs.map +1 -1
- package/dist/jsx/editor/TiptapEditor.native.js +153 -33
- package/dist/jsx/editor/TiptapEditor.native.js.map +1 -1
- package/dist/jsx/editor/blockAnchor.mjs +18 -0
- package/dist/jsx/editor/blockAnchor.mjs.map +1 -0
- package/dist/jsx/editor/blockAnchor.native.js +68 -0
- package/dist/jsx/editor/blockAnchor.native.js.map +1 -0
- package/dist/jsx/editor/codeBlockPreview.mjs +190 -0
- package/dist/jsx/editor/codeBlockPreview.mjs.map +1 -0
- package/dist/jsx/editor/codeBlockPreview.native.js +265 -0
- package/dist/jsx/editor/codeBlockPreview.native.js.map +1 -0
- package/dist/jsx/editor/editorStyles.mjs +203 -34
- package/dist/jsx/editor/editorStyles.mjs.map +1 -1
- package/dist/jsx/editor/editorStyles.native.js +203 -34
- package/dist/jsx/editor/editorStyles.native.js.map +1 -1
- package/dist/jsx/editor/emoji.mjs +88 -0
- package/dist/jsx/editor/emoji.mjs.map +1 -0
- package/dist/jsx/editor/emoji.native.js +184 -0
- package/dist/jsx/editor/emoji.native.js.map +1 -0
- package/dist/jsx/editor/lazyKatex.mjs +40 -0
- package/dist/jsx/editor/lazyKatex.mjs.map +1 -0
- package/dist/jsx/editor/lazyKatex.native.js +117 -0
- package/dist/jsx/editor/lazyKatex.native.js.map +1 -0
- package/dist/jsx/editor/markdown.mjs +179 -0
- package/dist/jsx/editor/markdown.mjs.map +1 -0
- package/dist/jsx/editor/markdown.native.js +278 -0
- package/dist/jsx/editor/markdown.native.js.map +1 -0
- package/dist/jsx/editor/mathematics.mjs +142 -0
- package/dist/jsx/editor/mathematics.mjs.map +1 -0
- package/dist/jsx/editor/mathematics.native.js +202 -0
- package/dist/jsx/editor/mathematics.native.js.map +1 -0
- package/dist/jsx/editor/media.mjs +113 -0
- package/dist/jsx/editor/media.mjs.map +1 -0
- package/dist/jsx/editor/media.native.js +172 -0
- package/dist/jsx/editor/media.native.js.map +1 -0
- package/dist/jsx/editor/mentions.mjs +37 -0
- package/dist/jsx/editor/mentions.mjs.map +1 -0
- package/dist/jsx/editor/mentions.native.js +84 -0
- package/dist/jsx/editor/mentions.native.js.map +1 -0
- package/dist/jsx/editor/pasteCleanup.mjs +57 -0
- package/dist/jsx/editor/pasteCleanup.mjs.map +1 -0
- package/dist/jsx/editor/pasteCleanup.native.js +175 -0
- package/dist/jsx/editor/pasteCleanup.native.js.map +1 -0
- package/dist/jsx/editor/suggestionPopup.mjs +268 -0
- package/dist/jsx/editor/suggestionPopup.mjs.map +1 -0
- package/dist/jsx/editor/suggestionPopup.native.js +327 -0
- package/dist/jsx/editor/suggestionPopup.native.js.map +1 -0
- package/dist/jsx/preview.mjs +236 -0
- package/dist/jsx/preview.mjs.map +1 -0
- package/dist/jsx/preview.native.js +294 -0
- package/dist/jsx/preview.native.js.map +1 -0
- package/dist/jsx/shared/t.mjs +17 -0
- package/dist/jsx/shared/t.mjs.map +1 -0
- package/dist/jsx/shared/t.native.js +56 -0
- package/dist/jsx/shared/t.native.js.map +1 -0
- package/dist/jsx/shared/url.mjs +10 -0
- package/dist/jsx/shared/url.mjs.map +1 -0
- package/dist/jsx/shared/url.native.js +38 -0
- package/dist/jsx/shared/url.native.js.map +1 -0
- package/dist/jsx/styled.mjs +13 -6
- package/dist/jsx/styled.mjs.map +1 -1
- package/dist/jsx/styled.native.js +13 -6
- package/dist/jsx/styled.native.js.map +1 -1
- package/dist/jsx/toolbar/BubbleToolbar.mjs +11 -9
- package/dist/jsx/toolbar/BubbleToolbar.mjs.map +1 -1
- package/dist/jsx/toolbar/BubbleToolbar.native.js +10 -8
- package/dist/jsx/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/jsx/toolbar/CodeBlockBubble.mjs +60 -24
- package/dist/jsx/toolbar/CodeBlockBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/CodeBlockBubble.native.js +71 -25
- package/dist/jsx/toolbar/CodeBlockBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/ColorPicker.mjs +21 -56
- package/dist/jsx/toolbar/ColorPicker.mjs.map +1 -1
- package/dist/jsx/toolbar/ColorPicker.native.js +81 -179
- package/dist/jsx/toolbar/ColorPicker.native.js.map +1 -1
- package/dist/jsx/toolbar/FixedToolbar.mjs +34 -11
- package/dist/jsx/toolbar/FixedToolbar.mjs.map +1 -1
- package/dist/jsx/toolbar/FixedToolbar.native.js +46 -54
- package/dist/jsx/toolbar/FixedToolbar.native.js.map +1 -1
- package/dist/jsx/toolbar/HeadingPicker.mjs +34 -41
- package/dist/jsx/toolbar/HeadingPicker.mjs.map +1 -1
- package/dist/jsx/toolbar/HeadingPicker.native.js +61 -51
- package/dist/jsx/toolbar/HeadingPicker.native.js.map +1 -1
- package/dist/jsx/toolbar/ImageBubble.mjs +20 -43
- package/dist/jsx/toolbar/ImageBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/ImageBubble.native.js +20 -43
- package/dist/jsx/toolbar/ImageBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/ImageDialog.mjs +5 -4
- package/dist/jsx/toolbar/ImageDialog.mjs.map +1 -1
- package/dist/jsx/toolbar/ImageDialog.native.js +76 -65
- package/dist/jsx/toolbar/ImageDialog.native.js.map +1 -1
- package/dist/jsx/toolbar/LinkBubble.mjs +23 -70
- package/dist/jsx/toolbar/LinkBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/LinkBubble.native.js +23 -70
- package/dist/jsx/toolbar/LinkBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/LinkDialog.mjs +17 -16
- package/dist/jsx/toolbar/LinkDialog.mjs.map +1 -1
- package/dist/jsx/toolbar/LinkDialog.native.js +86 -83
- package/dist/jsx/toolbar/LinkDialog.native.js.map +1 -1
- package/dist/jsx/toolbar/ListPicker.mjs +33 -44
- package/dist/jsx/toolbar/ListPicker.mjs.map +1 -1
- package/dist/jsx/toolbar/ListPicker.native.js +43 -44
- package/dist/jsx/toolbar/ListPicker.native.js.map +1 -1
- package/dist/jsx/toolbar/MathBubble.mjs +134 -0
- package/dist/jsx/toolbar/MathBubble.mjs.map +1 -0
- package/dist/jsx/toolbar/MathBubble.native.js +169 -0
- package/dist/jsx/toolbar/MathBubble.native.js.map +1 -0
- package/dist/jsx/toolbar/MoreDropdown.mjs +50 -97
- package/dist/jsx/toolbar/MoreDropdown.mjs.map +1 -1
- package/dist/jsx/toolbar/MoreDropdown.native.js +73 -98
- package/dist/jsx/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/jsx/toolbar/StatusBar.mjs +19 -10
- package/dist/jsx/toolbar/StatusBar.mjs.map +1 -1
- package/dist/jsx/toolbar/StatusBar.native.js +19 -10
- package/dist/jsx/toolbar/StatusBar.native.js.map +1 -1
- package/dist/jsx/toolbar/TableBubble.mjs +77 -95
- package/dist/jsx/toolbar/TableBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/TableBubble.native.js +73 -71
- package/dist/jsx/toolbar/TableBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/ToolbarButton.mjs +87 -22
- package/dist/jsx/toolbar/ToolbarButton.mjs.map +1 -1
- package/dist/jsx/toolbar/ToolbarButton.native.js +14 -4
- package/dist/jsx/toolbar/ToolbarButton.native.js.map +1 -1
- package/dist/jsx/toolbar/icons.mjs +109 -469
- package/dist/jsx/toolbar/icons.mjs.map +1 -1
- package/dist/jsx/toolbar/shortcuts.mjs +73 -24
- package/dist/jsx/toolbar/shortcuts.mjs.map +1 -1
- package/dist/jsx/toolbar/shortcuts.native.js +73 -24
- package/dist/jsx/toolbar/shortcuts.native.js.map +1 -1
- package/dist/jsx/toolbar/useHorizontalScroll.mjs +25 -6
- package/dist/jsx/toolbar/useHorizontalScroll.mjs.map +1 -1
- package/dist/jsx/toolbar/useHorizontalScroll.native.js +25 -5
- package/dist/jsx/toolbar/useHorizontalScroll.native.js.map +1 -1
- package/dist/jsx/toolbar/useRovingFocus.mjs +55 -0
- package/dist/jsx/toolbar/useRovingFocus.mjs.map +1 -0
- package/dist/jsx/toolbar/useRovingFocus.native.js +113 -0
- package/dist/jsx/toolbar/useRovingFocus.native.js.map +1 -0
- package/dist/jsx/types.mjs.map +1 -1
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +28 -13
- package/src/RichEditor.native.tsx +451 -49
- package/src/RichEditor.stories.tsx +158 -0
- package/src/RichEditor.tsx +121 -7
- package/src/RichTextEditor/index.tsx +41 -3
- package/src/RichTextEditor/richTextEditor.spec.tsx +11 -4
- package/src/constants.ts +86 -24
- package/src/editor/BlockDragHandle.ts +30 -5
- package/src/editor/SlashCommands.tsx +228 -293
- package/src/editor/TentapEditor.native.tsx +68 -17
- package/src/editor/TiptapEditor.tsx +187 -22
- package/src/editor/blockAnchor.spec.ts +70 -0
- package/src/editor/blockAnchor.ts +42 -0
- package/src/editor/codeBlockPreview.spec.ts +144 -0
- package/src/editor/codeBlockPreview.ts +266 -0
- package/src/editor/css.d.ts +2 -0
- package/src/editor/details.spec.ts +48 -0
- package/src/editor/editorStyles.spec.ts +25 -0
- package/src/editor/editorStyles.ts +218 -34
- package/src/editor/emoji.spec.ts +88 -0
- package/src/editor/emoji.ts +147 -0
- package/src/editor/emojilib.d.ts +16 -0
- package/src/editor/lazyKatex.spec.ts +38 -0
- package/src/editor/lazyKatex.ts +68 -0
- package/src/editor/markdown.spec.ts +196 -0
- package/src/editor/markdown.ts +249 -0
- package/src/editor/mathematics.spec.ts +97 -0
- package/src/editor/mathematics.ts +179 -0
- package/src/editor/media.spec.ts +121 -0
- package/src/editor/media.ts +133 -0
- package/src/editor/mentions.spec.ts +41 -0
- package/src/editor/mentions.ts +55 -0
- package/src/editor/pasteCleanup.spec.ts +84 -0
- package/src/editor/pasteCleanup.ts +124 -0
- package/src/editor/suggestionPopup.spec.tsx +105 -0
- package/src/editor/suggestionPopup.tsx +414 -0
- package/src/editor/tiptapEditor.spec.tsx +15 -8
- package/src/exports.spec.ts +4 -2
- package/src/index.ts +7 -1
- package/src/integration.spec.tsx +38 -9
- package/src/preview.spec.ts +130 -0
- package/src/preview.ts +287 -0
- package/src/richEditor.spec.tsx +10 -3
- package/src/shared/t.ts +25 -0
- package/src/shared/url.ts +16 -0
- package/src/styled.ts +13 -6
- package/src/toolbar/BubbleToolbar.tsx +11 -8
- package/src/toolbar/CodeBlockBubble.tsx +66 -28
- package/src/toolbar/ColorPicker.native.tsx +126 -0
- package/src/toolbar/ColorPicker.tsx +23 -67
- package/src/toolbar/FixedToolbar.native.tsx +51 -51
- package/src/toolbar/FixedToolbar.tsx +54 -10
- package/src/toolbar/HeadingPicker.tsx +46 -38
- package/src/toolbar/ImageBubble.tsx +26 -44
- package/src/toolbar/ImageDialog.native.tsx +97 -0
- package/src/toolbar/ImageDialog.tsx +5 -4
- package/src/toolbar/LinkBubble.tsx +27 -64
- package/src/toolbar/LinkDialog.native.tsx +117 -0
- package/src/toolbar/LinkDialog.tsx +28 -24
- package/src/toolbar/ListPicker.tsx +47 -43
- package/src/toolbar/MathBubble.tsx +140 -0
- package/src/toolbar/MoreDropdown.tsx +53 -60
- package/src/toolbar/StatusBar.tsx +13 -8
- package/src/toolbar/TableBubble.tsx +82 -94
- package/src/toolbar/ToolbarButton.native.tsx +14 -4
- package/src/toolbar/ToolbarButton.tsx +98 -19
- package/src/toolbar/bubbleToolbar.spec.tsx +2 -1
- package/src/toolbar/fixedToolbar.spec.tsx +4 -2
- package/src/toolbar/icons.tsx +113 -323
- package/src/toolbar/shortcuts.ts +77 -24
- package/src/toolbar/toolbarPrimitives.spec.tsx +29 -1
- package/src/toolbar/toolbarSubComponents.spec.tsx +4 -2
- package/src/toolbar/useHorizontalScroll.spec.ts +67 -0
- package/src/toolbar/useHorizontalScroll.tsx +39 -12
- package/src/toolbar/useRovingFocus.spec.tsx +100 -0
- package/src/toolbar/useRovingFocus.ts +82 -0
- package/src/types.spec.ts +40 -1
- package/src/types.ts +28 -0
- package/types/RichEditor.d.ts +51 -0
- package/types/RichEditor.d.ts.map +1 -0
- package/types/RichEditor.native.d.ts +59 -0
- package/types/RichEditor.native.d.ts.map +1 -0
- package/types/RichTextEditor/index.d.ts +71 -0
- package/types/RichTextEditor/index.d.ts.map +1 -0
- package/types/constants.d.ts +49 -0
- package/types/constants.d.ts.map +1 -0
- package/types/context.d.ts +10 -0
- package/types/context.d.ts.map +1 -0
- package/types/editor/BlockDragHandle.d.ts +8 -0
- package/types/editor/BlockDragHandle.d.ts.map +1 -0
- package/types/editor/MarkdownPaste.d.ts +8 -0
- package/types/editor/MarkdownPaste.d.ts.map +1 -0
- package/types/editor/SlashCommands.d.ts +24 -0
- package/types/editor/SlashCommands.d.ts.map +1 -0
- package/types/editor/TentapEditor.native.d.ts +21 -0
- package/types/editor/TentapEditor.native.d.ts.map +1 -0
- package/types/editor/TiptapEditor.d.ts +24 -0
- package/types/editor/TiptapEditor.d.ts.map +1 -0
- package/types/editor/blockAnchor.d.ts +25 -0
- package/types/editor/blockAnchor.d.ts.map +1 -0
- package/types/editor/codeBlockPreview.d.ts +51 -0
- package/types/editor/codeBlockPreview.d.ts.map +1 -0
- package/types/editor/editorStyles.d.ts +25 -0
- package/types/editor/editorStyles.d.ts.map +1 -0
- package/types/editor/emoji.d.ts +45 -0
- package/types/editor/emoji.d.ts.map +1 -0
- package/types/editor/index.d.ts +11 -0
- package/types/editor/index.d.ts.map +1 -0
- package/types/editor/lazyKatex.d.ts +33 -0
- package/types/editor/lazyKatex.d.ts.map +1 -0
- package/types/editor/markdown.d.ts +24 -0
- package/types/editor/markdown.d.ts.map +1 -0
- package/types/editor/mathematics.d.ts +44 -0
- package/types/editor/mathematics.d.ts.map +1 -0
- package/types/editor/media.d.ts +32 -0
- package/types/editor/media.d.ts.map +1 -0
- package/types/editor/mentions.d.ts +15 -0
- package/types/editor/mentions.d.ts.map +1 -0
- package/types/editor/pasteCleanup.d.ts +24 -0
- package/types/editor/pasteCleanup.d.ts.map +1 -0
- package/types/editor/suggestionPopup.d.ts +113 -0
- package/types/editor/suggestionPopup.d.ts.map +1 -0
- package/types/editor/types.d.ts +80 -0
- package/types/editor/types.d.ts.map +1 -0
- package/types/editor/useEditorState.d.ts +19 -0
- package/types/editor/useEditorState.d.ts.map +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
- package/types/preview.d.ts +44 -0
- package/types/preview.d.ts.map +1 -0
- package/types/shared/t.d.ts +10 -0
- package/types/shared/t.d.ts.map +1 -0
- package/types/shared/url.d.ts +9 -0
- package/types/shared/url.d.ts.map +1 -0
- package/types/styled.d.ts +40 -0
- package/types/styled.d.ts.map +1 -0
- package/types/toolbar/BubbleToolbar.d.ts +23 -0
- package/types/toolbar/BubbleToolbar.d.ts.map +1 -0
- package/types/toolbar/CodeBlockBubble.d.ts +10 -0
- package/types/toolbar/CodeBlockBubble.d.ts.map +1 -0
- package/types/toolbar/ColorPicker.d.ts +15 -0
- package/types/toolbar/ColorPicker.d.ts.map +1 -0
- package/types/toolbar/ColorPicker.native.d.ts +20 -0
- package/types/toolbar/ColorPicker.native.d.ts.map +1 -0
- package/types/toolbar/FixedToolbar.d.ts +32 -0
- package/types/toolbar/FixedToolbar.d.ts.map +1 -0
- package/types/toolbar/FixedToolbar.native.d.ts +30 -0
- package/types/toolbar/FixedToolbar.native.d.ts.map +1 -0
- package/types/toolbar/HeadingPicker.d.ts +14 -0
- package/types/toolbar/HeadingPicker.d.ts.map +1 -0
- package/types/toolbar/ImageBubble.d.ts +10 -0
- package/types/toolbar/ImageBubble.d.ts.map +1 -0
- package/types/toolbar/ImageDialog.d.ts +12 -0
- package/types/toolbar/ImageDialog.d.ts.map +1 -0
- package/types/toolbar/ImageDialog.native.d.ts +15 -0
- package/types/toolbar/ImageDialog.native.d.ts.map +1 -0
- package/types/toolbar/LinkBubble.d.ts +10 -0
- package/types/toolbar/LinkBubble.d.ts.map +1 -0
- package/types/toolbar/LinkDialog.d.ts +20 -0
- package/types/toolbar/LinkDialog.d.ts.map +1 -0
- package/types/toolbar/LinkDialog.native.d.ts +18 -0
- package/types/toolbar/LinkDialog.native.d.ts.map +1 -0
- package/types/toolbar/ListPicker.d.ts +14 -0
- package/types/toolbar/ListPicker.d.ts.map +1 -0
- package/types/toolbar/MathBubble.d.ts +11 -0
- package/types/toolbar/MathBubble.d.ts.map +1 -0
- package/types/toolbar/MoreDropdown.d.ts +13 -0
- package/types/toolbar/MoreDropdown.d.ts.map +1 -0
- package/types/toolbar/ResizeHandle.d.ts +11 -0
- package/types/toolbar/ResizeHandle.d.ts.map +1 -0
- package/types/toolbar/StatusBar.d.ts +11 -0
- package/types/toolbar/StatusBar.d.ts.map +1 -0
- package/types/toolbar/TableBubble.d.ts +10 -0
- package/types/toolbar/TableBubble.d.ts.map +1 -0
- package/types/toolbar/ToolbarButton.d.ts +35 -0
- package/types/toolbar/ToolbarButton.d.ts.map +1 -0
- package/types/toolbar/ToolbarButton.native.d.ts +30 -0
- package/types/toolbar/ToolbarButton.native.d.ts.map +1 -0
- package/types/toolbar/ToolbarGroup.d.ts +14 -0
- package/types/toolbar/ToolbarGroup.d.ts.map +1 -0
- package/types/toolbar/icons.d.ts +52 -0
- package/types/toolbar/icons.d.ts.map +1 -0
- package/types/toolbar/icons.native.d.ts +41 -0
- package/types/toolbar/icons.native.d.ts.map +1 -0
- package/types/toolbar/shortcuts.d.ts +34 -0
- package/types/toolbar/shortcuts.d.ts.map +1 -0
- package/types/toolbar/useHorizontalScroll.d.ts +43 -0
- package/types/toolbar/useHorizontalScroll.d.ts.map +1 -0
- package/types/toolbar/useRovingFocus.d.ts +10 -0
- package/types/toolbar/useRovingFocus.d.ts.map +1 -0
- package/types/types.d.ts +125 -0
- package/types/types.d.ts.map +1 -0
- package/dist/cjs/RichEditor.stories.cjs +0 -327
- package/dist/cjs/RichEditor.stories.native.js +0 -342
- package/dist/cjs/RichEditor.stories.native.js.map +0 -1
- package/dist/esm/RichEditor.stories.mjs +0 -291
- package/dist/esm/RichEditor.stories.mjs.map +0 -1
- package/dist/esm/RichEditor.stories.native.js +0 -303
- package/dist/esm/RichEditor.stories.native.js.map +0 -1
- package/dist/jsx/RichEditor.stories.mjs +0 -291
- package/dist/jsx/RichEditor.stories.mjs.map +0 -1
- package/dist/jsx/RichEditor.stories.native.js +0 -342
- package/dist/jsx/RichEditor.stories.native.js.map +0 -1
package/src/toolbar/icons.tsx
CHANGED
|
@@ -1,13 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Icon components for the rich text editor toolbar (web).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* LC-16 / census #20: glyphs come from `@phosphor-icons/react` — the house
|
|
5
|
+
* icon standard — so toolbar icons share stroke weight and optical size with
|
|
6
|
+
* every other surface. Only the color-state icons (TextColorIcon /
|
|
7
|
+
* HighlightIcon) stay hand-rolled: they render the currently selected color
|
|
8
|
+
* as a functional swatch bar, which no static icon set provides.
|
|
9
|
+
*
|
|
10
|
+
* Native uses `icons.native.tsx` (text glyphs; phosphor stays out of the
|
|
11
|
+
* native bundle).
|
|
5
12
|
*/
|
|
6
13
|
|
|
14
|
+
import {
|
|
15
|
+
ArrowsInSimpleIcon,
|
|
16
|
+
ArrowsOutSimpleIcon,
|
|
17
|
+
ArrowUUpLeftIcon,
|
|
18
|
+
ArrowUUpRightIcon,
|
|
19
|
+
CodeIcon,
|
|
20
|
+
CodeSimpleIcon,
|
|
21
|
+
ImageIcon as PhosphorImageIcon,
|
|
22
|
+
LinkIcon as PhosphorLinkIcon,
|
|
23
|
+
ListBulletsIcon,
|
|
24
|
+
ListChecksIcon,
|
|
25
|
+
ListNumbersIcon,
|
|
26
|
+
MinusIcon,
|
|
27
|
+
QuotesIcon,
|
|
28
|
+
TextAlignCenterIcon,
|
|
29
|
+
TextAlignJustifyIcon,
|
|
30
|
+
TextAlignLeftIcon,
|
|
31
|
+
TextAlignRightIcon,
|
|
32
|
+
TextBIcon,
|
|
33
|
+
TextItalicIcon,
|
|
34
|
+
TextStrikethroughIcon,
|
|
35
|
+
TextSubscriptIcon,
|
|
36
|
+
TextSuperscriptIcon,
|
|
37
|
+
TextTSlashIcon,
|
|
38
|
+
TextUnderlineIcon,
|
|
39
|
+
} from "@phosphor-icons/react";
|
|
40
|
+
import { useDirection } from "@multiplatform.one/components";
|
|
41
|
+
import type { ReactNode } from "react";
|
|
7
42
|
import { Text, styled } from "tamagui";
|
|
8
43
|
|
|
44
|
+
const ICON_SIZE = 16;
|
|
45
|
+
|
|
9
46
|
// ===========================================================================
|
|
10
|
-
// SVG Wrapper
|
|
47
|
+
// SVG Wrapper (used by the color-state icons below)
|
|
11
48
|
// ===========================================================================
|
|
12
49
|
|
|
13
50
|
const SvgWrapper = styled(Text, {
|
|
@@ -21,384 +58,136 @@ const SvgWrapper = styled(Text, {
|
|
|
21
58
|
// Text Style Icons
|
|
22
59
|
// ===========================================================================
|
|
23
60
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
61
|
+
// These historically rendered a styled letter child (`<BoldIcon>B</BoldIcon>`);
|
|
62
|
+
// the phosphor glyphs replace the letter, so children are accepted and ignored.
|
|
27
63
|
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
}
|
|
64
|
+
export function BoldIcon(_props: { children?: ReactNode }) {
|
|
65
|
+
return <TextBIcon size={ICON_SIZE} />;
|
|
66
|
+
}
|
|
31
67
|
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
}
|
|
68
|
+
export function ItalicIcon(_props: { children?: ReactNode }) {
|
|
69
|
+
return <TextItalicIcon size={ICON_SIZE} />;
|
|
70
|
+
}
|
|
35
71
|
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
}
|
|
72
|
+
export function UnderlineIcon(_props: { children?: ReactNode }) {
|
|
73
|
+
return <TextUnderlineIcon size={ICON_SIZE} />;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function StrikeIcon(_props: { children?: ReactNode }) {
|
|
77
|
+
return <TextStrikethroughIcon size={ICON_SIZE} />;
|
|
78
|
+
}
|
|
39
79
|
|
|
40
80
|
// ===========================================================================
|
|
41
|
-
//
|
|
81
|
+
// Toolbar Icons (phosphor)
|
|
42
82
|
// ===========================================================================
|
|
43
83
|
|
|
84
|
+
// Undo/redo arrows encode travel through history (back/forward), so the
|
|
85
|
+
// glyph pair swaps under RTL (useDirection pattern); alignment icons below
|
|
86
|
+
// stay physical — they depict the literal alignment they produce.
|
|
44
87
|
export function UndoIcon() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<svg
|
|
48
|
-
width="16"
|
|
49
|
-
height="16"
|
|
50
|
-
viewBox="0 0 24 24"
|
|
51
|
-
fill="none"
|
|
52
|
-
stroke="currentColor"
|
|
53
|
-
strokeWidth="2"
|
|
54
|
-
strokeLinecap="round"
|
|
55
|
-
strokeLinejoin="round"
|
|
56
|
-
>
|
|
57
|
-
<polyline points="1 4 1 10 7 10" />
|
|
58
|
-
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10" />
|
|
59
|
-
</svg>
|
|
60
|
-
</SvgWrapper>
|
|
61
|
-
);
|
|
88
|
+
const isRTL = useDirection() === "rtl";
|
|
89
|
+
return isRTL ? <ArrowUUpRightIcon size={ICON_SIZE} /> : <ArrowUUpLeftIcon size={ICON_SIZE} />;
|
|
62
90
|
}
|
|
63
91
|
|
|
64
92
|
export function RedoIcon() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<svg
|
|
68
|
-
width="16"
|
|
69
|
-
height="16"
|
|
70
|
-
viewBox="0 0 24 24"
|
|
71
|
-
fill="none"
|
|
72
|
-
stroke="currentColor"
|
|
73
|
-
strokeWidth="2"
|
|
74
|
-
strokeLinecap="round"
|
|
75
|
-
strokeLinejoin="round"
|
|
76
|
-
>
|
|
77
|
-
<polyline points="23 4 23 10 17 10" />
|
|
78
|
-
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" />
|
|
79
|
-
</svg>
|
|
80
|
-
</SvgWrapper>
|
|
81
|
-
);
|
|
93
|
+
const isRTL = useDirection() === "rtl";
|
|
94
|
+
return isRTL ? <ArrowUUpLeftIcon size={ICON_SIZE} /> : <ArrowUUpRightIcon size={ICON_SIZE} />;
|
|
82
95
|
}
|
|
83
96
|
|
|
84
97
|
export function AlignLeftIcon() {
|
|
85
|
-
return
|
|
86
|
-
<SvgWrapper>
|
|
87
|
-
<svg
|
|
88
|
-
width="16"
|
|
89
|
-
height="16"
|
|
90
|
-
viewBox="0 0 24 24"
|
|
91
|
-
fill="none"
|
|
92
|
-
stroke="currentColor"
|
|
93
|
-
strokeWidth="2"
|
|
94
|
-
>
|
|
95
|
-
<line x1="3" y1="6" x2="21" y2="6" />
|
|
96
|
-
<line x1="3" y1="12" x2="15" y2="12" />
|
|
97
|
-
<line x1="3" y1="18" x2="21" y2="18" />
|
|
98
|
-
</svg>
|
|
99
|
-
</SvgWrapper>
|
|
100
|
-
);
|
|
98
|
+
return <TextAlignLeftIcon size={ICON_SIZE} />;
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
export function AlignCenterIcon() {
|
|
104
|
-
return
|
|
105
|
-
<SvgWrapper>
|
|
106
|
-
<svg
|
|
107
|
-
width="16"
|
|
108
|
-
height="16"
|
|
109
|
-
viewBox="0 0 24 24"
|
|
110
|
-
fill="none"
|
|
111
|
-
stroke="currentColor"
|
|
112
|
-
strokeWidth="2"
|
|
113
|
-
>
|
|
114
|
-
<line x1="3" y1="6" x2="21" y2="6" />
|
|
115
|
-
<line x1="6" y1="12" x2="18" y2="12" />
|
|
116
|
-
<line x1="3" y1="18" x2="21" y2="18" />
|
|
117
|
-
</svg>
|
|
118
|
-
</SvgWrapper>
|
|
119
|
-
);
|
|
102
|
+
return <TextAlignCenterIcon size={ICON_SIZE} />;
|
|
120
103
|
}
|
|
121
104
|
|
|
122
105
|
export function AlignRightIcon() {
|
|
123
|
-
return
|
|
124
|
-
<SvgWrapper>
|
|
125
|
-
<svg
|
|
126
|
-
width="16"
|
|
127
|
-
height="16"
|
|
128
|
-
viewBox="0 0 24 24"
|
|
129
|
-
fill="none"
|
|
130
|
-
stroke="currentColor"
|
|
131
|
-
strokeWidth="2"
|
|
132
|
-
>
|
|
133
|
-
<line x1="3" y1="6" x2="21" y2="6" />
|
|
134
|
-
<line x1="9" y1="12" x2="21" y2="12" />
|
|
135
|
-
<line x1="3" y1="18" x2="21" y2="18" />
|
|
136
|
-
</svg>
|
|
137
|
-
</SvgWrapper>
|
|
138
|
-
);
|
|
106
|
+
return <TextAlignRightIcon size={ICON_SIZE} />;
|
|
139
107
|
}
|
|
140
108
|
|
|
141
109
|
export function AlignJustifyIcon() {
|
|
142
|
-
return
|
|
143
|
-
<SvgWrapper>
|
|
144
|
-
<svg
|
|
145
|
-
width="16"
|
|
146
|
-
height="16"
|
|
147
|
-
viewBox="0 0 24 24"
|
|
148
|
-
fill="none"
|
|
149
|
-
stroke="currentColor"
|
|
150
|
-
strokeWidth="2"
|
|
151
|
-
>
|
|
152
|
-
<line x1="3" y1="6" x2="21" y2="6" />
|
|
153
|
-
<line x1="3" y1="12" x2="21" y2="12" />
|
|
154
|
-
<line x1="3" y1="18" x2="21" y2="18" />
|
|
155
|
-
</svg>
|
|
156
|
-
</SvgWrapper>
|
|
157
|
-
);
|
|
110
|
+
return <TextAlignJustifyIcon size={ICON_SIZE} />;
|
|
158
111
|
}
|
|
159
112
|
|
|
160
113
|
export function LinkIcon() {
|
|
161
|
-
return
|
|
162
|
-
<SvgWrapper>
|
|
163
|
-
<svg
|
|
164
|
-
width="16"
|
|
165
|
-
height="16"
|
|
166
|
-
viewBox="0 0 24 24"
|
|
167
|
-
fill="none"
|
|
168
|
-
stroke="currentColor"
|
|
169
|
-
strokeWidth="2"
|
|
170
|
-
>
|
|
171
|
-
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
|
172
|
-
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
|
173
|
-
</svg>
|
|
174
|
-
</SvgWrapper>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export function TextColorIcon({ color }: { color?: string | null }) {
|
|
179
|
-
return (
|
|
180
|
-
<SvgWrapper>
|
|
181
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
|
|
182
|
-
<text x="12" y="14" textAnchor="middle" fontSize="14" fontWeight="bold" fill="currentColor">
|
|
183
|
-
A
|
|
184
|
-
</text>
|
|
185
|
-
<rect x="4" y="18" width="16" height="3" rx="1" fill={color || "currentColor"} />
|
|
186
|
-
</svg>
|
|
187
|
-
</SvgWrapper>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function HighlightIcon({ color }: { color?: string | null }) {
|
|
192
|
-
return (
|
|
193
|
-
<SvgWrapper>
|
|
194
|
-
<svg
|
|
195
|
-
width="16"
|
|
196
|
-
height="16"
|
|
197
|
-
viewBox="0 0 24 24"
|
|
198
|
-
fill="none"
|
|
199
|
-
stroke="currentColor"
|
|
200
|
-
strokeWidth="2"
|
|
201
|
-
>
|
|
202
|
-
<path d="M12 20h9" />
|
|
203
|
-
<path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" />
|
|
204
|
-
{color && <rect x="2" y="18" width="8" height="4" rx="1" fill={color} stroke="none" />}
|
|
205
|
-
</svg>
|
|
206
|
-
</SvgWrapper>
|
|
207
|
-
);
|
|
114
|
+
return <PhosphorLinkIcon size={ICON_SIZE} />;
|
|
208
115
|
}
|
|
209
116
|
|
|
210
117
|
export function HorizontalRuleIcon() {
|
|
211
|
-
return
|
|
212
|
-
<SvgWrapper>
|
|
213
|
-
<svg
|
|
214
|
-
width="16"
|
|
215
|
-
height="16"
|
|
216
|
-
viewBox="0 0 24 24"
|
|
217
|
-
fill="none"
|
|
218
|
-
stroke="currentColor"
|
|
219
|
-
strokeWidth="2"
|
|
220
|
-
>
|
|
221
|
-
<line x1="3" y1="12" x2="21" y2="12" />
|
|
222
|
-
</svg>
|
|
223
|
-
</SvgWrapper>
|
|
224
|
-
);
|
|
118
|
+
return <MinusIcon size={ICON_SIZE} />;
|
|
225
119
|
}
|
|
226
120
|
|
|
227
121
|
export function ClearFormattingIcon() {
|
|
228
|
-
return
|
|
229
|
-
<SvgWrapper>
|
|
230
|
-
<svg
|
|
231
|
-
width="16"
|
|
232
|
-
height="16"
|
|
233
|
-
viewBox="0 0 24 24"
|
|
234
|
-
fill="none"
|
|
235
|
-
stroke="currentColor"
|
|
236
|
-
strokeWidth="2"
|
|
237
|
-
>
|
|
238
|
-
<path d="M4 7h6.5l-2.5 9h-4" />
|
|
239
|
-
<path d="M13.5 7l-2.5 9" />
|
|
240
|
-
<path d="M17 7h3" />
|
|
241
|
-
<line x1="4" y1="20" x2="20" y2="4" strokeWidth="2.5" />
|
|
242
|
-
</svg>
|
|
243
|
-
</SvgWrapper>
|
|
244
|
-
);
|
|
122
|
+
return <TextTSlashIcon size={ICON_SIZE} />;
|
|
245
123
|
}
|
|
246
124
|
|
|
247
125
|
export function SubscriptIcon() {
|
|
248
|
-
return
|
|
249
|
-
<SvgWrapper>
|
|
250
|
-
<svg
|
|
251
|
-
width="16"
|
|
252
|
-
height="16"
|
|
253
|
-
viewBox="0 0 24 24"
|
|
254
|
-
fill="none"
|
|
255
|
-
stroke="currentColor"
|
|
256
|
-
strokeWidth="2"
|
|
257
|
-
>
|
|
258
|
-
<path d="M4 5l8 8" />
|
|
259
|
-
<path d="M12 5l-8 8" />
|
|
260
|
-
<text x="18" y="20" fontSize="10" fontWeight="bold" fill="currentColor" stroke="none">
|
|
261
|
-
2
|
|
262
|
-
</text>
|
|
263
|
-
</svg>
|
|
264
|
-
</SvgWrapper>
|
|
265
|
-
);
|
|
126
|
+
return <TextSubscriptIcon size={ICON_SIZE} />;
|
|
266
127
|
}
|
|
267
128
|
|
|
268
129
|
export function SuperscriptIcon() {
|
|
269
|
-
return
|
|
270
|
-
<SvgWrapper>
|
|
271
|
-
<svg
|
|
272
|
-
width="16"
|
|
273
|
-
height="16"
|
|
274
|
-
viewBox="0 0 24 24"
|
|
275
|
-
fill="none"
|
|
276
|
-
stroke="currentColor"
|
|
277
|
-
strokeWidth="2"
|
|
278
|
-
>
|
|
279
|
-
<path d="M4 11l8 8" />
|
|
280
|
-
<path d="M12 11l-8 8" />
|
|
281
|
-
<text x="18" y="10" fontSize="10" fontWeight="bold" fill="currentColor" stroke="none">
|
|
282
|
-
2
|
|
283
|
-
</text>
|
|
284
|
-
</svg>
|
|
285
|
-
</SvgWrapper>
|
|
286
|
-
);
|
|
130
|
+
return <TextSuperscriptIcon size={ICON_SIZE} />;
|
|
287
131
|
}
|
|
288
132
|
|
|
289
133
|
export function BulletListIcon() {
|
|
290
|
-
return
|
|
291
|
-
<SvgWrapper>
|
|
292
|
-
<svg
|
|
293
|
-
width="16"
|
|
294
|
-
height="16"
|
|
295
|
-
viewBox="0 0 24 24"
|
|
296
|
-
fill="none"
|
|
297
|
-
stroke="currentColor"
|
|
298
|
-
strokeWidth="2"
|
|
299
|
-
>
|
|
300
|
-
<line x1="9" y1="6" x2="20" y2="6" />
|
|
301
|
-
<line x1="9" y1="12" x2="20" y2="12" />
|
|
302
|
-
<line x1="9" y1="18" x2="20" y2="18" />
|
|
303
|
-
<circle cx="4" cy="6" r="1.5" fill="currentColor" stroke="none" />
|
|
304
|
-
<circle cx="4" cy="12" r="1.5" fill="currentColor" stroke="none" />
|
|
305
|
-
<circle cx="4" cy="18" r="1.5" fill="currentColor" stroke="none" />
|
|
306
|
-
</svg>
|
|
307
|
-
</SvgWrapper>
|
|
308
|
-
);
|
|
134
|
+
return <ListBulletsIcon size={ICON_SIZE} />;
|
|
309
135
|
}
|
|
310
136
|
|
|
311
137
|
export function OrderedListIcon() {
|
|
312
|
-
return
|
|
313
|
-
<SvgWrapper>
|
|
314
|
-
<svg
|
|
315
|
-
width="16"
|
|
316
|
-
height="16"
|
|
317
|
-
viewBox="0 0 24 24"
|
|
318
|
-
fill="none"
|
|
319
|
-
stroke="currentColor"
|
|
320
|
-
strokeWidth="2"
|
|
321
|
-
>
|
|
322
|
-
<line x1="10" y1="6" x2="20" y2="6" />
|
|
323
|
-
<line x1="10" y1="12" x2="20" y2="12" />
|
|
324
|
-
<line x1="10" y1="18" x2="20" y2="18" />
|
|
325
|
-
<text x="4" y="8" fontSize="8" fontWeight="bold" fill="currentColor" stroke="none">
|
|
326
|
-
1
|
|
327
|
-
</text>
|
|
328
|
-
<text x="4" y="14" fontSize="8" fontWeight="bold" fill="currentColor" stroke="none">
|
|
329
|
-
2
|
|
330
|
-
</text>
|
|
331
|
-
<text x="4" y="20" fontSize="8" fontWeight="bold" fill="currentColor" stroke="none">
|
|
332
|
-
3
|
|
333
|
-
</text>
|
|
334
|
-
</svg>
|
|
335
|
-
</SvgWrapper>
|
|
336
|
-
);
|
|
138
|
+
return <ListNumbersIcon size={ICON_SIZE} />;
|
|
337
139
|
}
|
|
338
140
|
|
|
339
141
|
export function TaskListIcon() {
|
|
340
|
-
return
|
|
341
|
-
<SvgWrapper>
|
|
342
|
-
<svg
|
|
343
|
-
width="16"
|
|
344
|
-
height="16"
|
|
345
|
-
viewBox="0 0 24 24"
|
|
346
|
-
fill="none"
|
|
347
|
-
stroke="currentColor"
|
|
348
|
-
strokeWidth="2"
|
|
349
|
-
>
|
|
350
|
-
<line x1="10" y1="6" x2="20" y2="6" />
|
|
351
|
-
<line x1="10" y1="12" x2="20" y2="12" />
|
|
352
|
-
<line x1="10" y1="18" x2="20" y2="18" />
|
|
353
|
-
<rect x="3" y="4" width="4" height="4" rx="0.5" />
|
|
354
|
-
<rect x="3" y="10" width="4" height="4" rx="0.5" />
|
|
355
|
-
<rect x="3" y="16" width="4" height="4" rx="0.5" />
|
|
356
|
-
<path d="M4 12l1 1 2-2" strokeWidth="1.5" />
|
|
357
|
-
</svg>
|
|
358
|
-
</SvgWrapper>
|
|
359
|
-
);
|
|
142
|
+
return <ListChecksIcon size={ICON_SIZE} />;
|
|
360
143
|
}
|
|
361
144
|
|
|
362
145
|
export function ImageIcon() {
|
|
363
|
-
return
|
|
364
|
-
<SvgWrapper>
|
|
365
|
-
<svg
|
|
366
|
-
width="16"
|
|
367
|
-
height="16"
|
|
368
|
-
viewBox="0 0 24 24"
|
|
369
|
-
fill="none"
|
|
370
|
-
stroke="currentColor"
|
|
371
|
-
strokeWidth="2"
|
|
372
|
-
>
|
|
373
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
374
|
-
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
375
|
-
<polyline points="21 15 16 10 5 21" />
|
|
376
|
-
</svg>
|
|
377
|
-
</SvgWrapper>
|
|
378
|
-
);
|
|
146
|
+
return <PhosphorImageIcon size={ICON_SIZE} />;
|
|
379
147
|
}
|
|
380
148
|
|
|
381
149
|
export function BlockquoteIcon() {
|
|
150
|
+
return <QuotesIcon size={ICON_SIZE} />;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function CodeBlockIcon() {
|
|
154
|
+
return <CodeIcon size={ICON_SIZE} />;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function InlineCodeIcon() {
|
|
158
|
+
return <CodeSimpleIcon size={ICON_SIZE} />;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function ExpandIcon() {
|
|
162
|
+
return <ArrowsOutSimpleIcon size={ICON_SIZE} />;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function CompressIcon() {
|
|
166
|
+
return <ArrowsInSimpleIcon size={ICON_SIZE} />;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// ===========================================================================
|
|
170
|
+
// Color-state icons — genuinely custom (LC-16 kept-with-reason)
|
|
171
|
+
//
|
|
172
|
+
// Both render the CURRENT color as a swatch bar under the glyph, a functional
|
|
173
|
+
// state display no static icon set carries. currentColor keeps the glyph on
|
|
174
|
+
// the text color; the bar takes the live selection.
|
|
175
|
+
// ===========================================================================
|
|
176
|
+
|
|
177
|
+
export function TextColorIcon({ color }: { color?: string | null }) {
|
|
382
178
|
return (
|
|
383
179
|
<SvgWrapper>
|
|
384
|
-
<svg
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
fill="
|
|
389
|
-
stroke="currentColor"
|
|
390
|
-
strokeWidth="2"
|
|
391
|
-
>
|
|
392
|
-
<path d="M3 6h18" />
|
|
393
|
-
<path d="M3 12h18" />
|
|
394
|
-
<path d="M3 18h18" />
|
|
395
|
-
<rect x="2" y="4" width="2" height="16" rx="1" fill="currentColor" stroke="none" />
|
|
180
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
|
|
181
|
+
<text x="12" y="14" textAnchor="middle" fontSize="14" fontWeight="bold" fill="currentColor">
|
|
182
|
+
A
|
|
183
|
+
</text>
|
|
184
|
+
<rect x="4" y="18" width="16" height="3" rx="1" fill={color || "currentColor"} />
|
|
396
185
|
</svg>
|
|
397
186
|
</SvgWrapper>
|
|
398
187
|
);
|
|
399
188
|
}
|
|
400
189
|
|
|
401
|
-
export function
|
|
190
|
+
export function HighlightIcon({ color }: { color?: string | null }) {
|
|
402
191
|
return (
|
|
403
192
|
<SvgWrapper>
|
|
404
193
|
<svg
|
|
@@ -409,8 +198,9 @@ export function CodeBlockIcon() {
|
|
|
409
198
|
stroke="currentColor"
|
|
410
199
|
strokeWidth="2"
|
|
411
200
|
>
|
|
412
|
-
<
|
|
413
|
-
<
|
|
201
|
+
<path d="M12 20h9" />
|
|
202
|
+
<path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" />
|
|
203
|
+
{color && <rect x="2" y="18" width="8" height="4" rx="1" fill={color} stroke="none" />}
|
|
414
204
|
</svg>
|
|
415
205
|
</SvgWrapper>
|
|
416
206
|
);
|
package/src/toolbar/shortcuts.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Platform-aware keyboard shortcut labels for toolbar tooltips.
|
|
3
|
+
*
|
|
4
|
+
* Properties are getters so `t()` resolves at access (render) time -- a
|
|
5
|
+
* locale catalog loaded after module import still applies.
|
|
3
6
|
*/
|
|
4
7
|
|
|
8
|
+
import { t } from "../shared/t";
|
|
9
|
+
|
|
5
10
|
const isMac =
|
|
6
11
|
typeof navigator !== "undefined" && /Mac|iPod|iPhone|iPad/.test(navigator.platform ?? "");
|
|
7
12
|
|
|
@@ -15,28 +20,76 @@ export function shortcut(label: string, keys?: string): string {
|
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export const SHORTCUTS = {
|
|
18
|
-
bold
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
23
|
+
get bold() {
|
|
24
|
+
return shortcut(t("Bold"), `${MOD}B`);
|
|
25
|
+
},
|
|
26
|
+
get italic() {
|
|
27
|
+
return shortcut(t("Italic"), `${MOD}I`);
|
|
28
|
+
},
|
|
29
|
+
get underline() {
|
|
30
|
+
return shortcut(t("Underline"), `${MOD}U`);
|
|
31
|
+
},
|
|
32
|
+
get strike() {
|
|
33
|
+
return shortcut(t("Strikethrough"), `${MOD}${SHIFT}X`);
|
|
34
|
+
},
|
|
35
|
+
get code() {
|
|
36
|
+
return shortcut(t("Code"), `${MOD}E`);
|
|
37
|
+
},
|
|
38
|
+
get subscript() {
|
|
39
|
+
return t("Subscript");
|
|
40
|
+
},
|
|
41
|
+
get superscript() {
|
|
42
|
+
return t("Superscript");
|
|
43
|
+
},
|
|
44
|
+
get undo() {
|
|
45
|
+
return shortcut(t("Undo"), `${MOD}Z`);
|
|
46
|
+
},
|
|
47
|
+
get redo() {
|
|
48
|
+
return shortcut(t("Redo"), `${MOD}${SHIFT}Z`);
|
|
49
|
+
},
|
|
50
|
+
get alignLeft() {
|
|
51
|
+
return shortcut(t("Align Left"), `${MOD}${SHIFT}L`);
|
|
52
|
+
},
|
|
53
|
+
get alignCenter() {
|
|
54
|
+
return shortcut(t("Align Center"), `${MOD}${SHIFT}E`);
|
|
55
|
+
},
|
|
56
|
+
get alignRight() {
|
|
57
|
+
return shortcut(t("Align Right"), `${MOD}${SHIFT}R`);
|
|
58
|
+
},
|
|
59
|
+
get alignJustify() {
|
|
60
|
+
return shortcut(t("Justify"), `${MOD}${SHIFT}J`);
|
|
61
|
+
},
|
|
62
|
+
get blockquote() {
|
|
63
|
+
return shortcut(t("Blockquote"), `${MOD}${SHIFT}B`);
|
|
64
|
+
},
|
|
65
|
+
get codeBlock() {
|
|
66
|
+
return shortcut(t("Code Block"), `${MOD}${ALT}C`);
|
|
67
|
+
},
|
|
68
|
+
get bulletList() {
|
|
69
|
+
return shortcut(t("Bullet List"), `${MOD}${SHIFT}8`);
|
|
70
|
+
},
|
|
71
|
+
get orderedList() {
|
|
72
|
+
return shortcut(t("Ordered List"), `${MOD}${SHIFT}7`);
|
|
73
|
+
},
|
|
74
|
+
get taskList() {
|
|
75
|
+
return shortcut(t("Task List"), `${MOD}${SHIFT}9`);
|
|
76
|
+
},
|
|
77
|
+
get link() {
|
|
78
|
+
return shortcut(t("Link"), `${MOD}K`);
|
|
79
|
+
},
|
|
80
|
+
get horizontalRule() {
|
|
81
|
+
return t("Horizontal Rule");
|
|
82
|
+
},
|
|
83
|
+
get image() {
|
|
84
|
+
return t("Image");
|
|
85
|
+
},
|
|
86
|
+
get textColor() {
|
|
87
|
+
return t("Text Color");
|
|
88
|
+
},
|
|
89
|
+
get highlight() {
|
|
90
|
+
return t("Highlight");
|
|
91
|
+
},
|
|
92
|
+
get clearFormatting() {
|
|
93
|
+
return t("Clear Formatting");
|
|
94
|
+
},
|
|
42
95
|
} as const;
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
ImageIcon,
|
|
15
15
|
} from "./icons";
|
|
16
16
|
|
|
17
|
-
vi.mock("@multiplatform.one/forms", () => ({
|
|
17
|
+
vi.mock("@multiplatform.one/forms", async (importOriginal) => ({
|
|
18
|
+
...(await importOriginal<Record<string, unknown>>()),
|
|
18
19
|
Button: (props: any) => (
|
|
19
20
|
<button
|
|
20
21
|
role="button"
|
|
@@ -30,6 +31,8 @@ vi.mock("@multiplatform.one/forms", () => ({
|
|
|
30
31
|
|
|
31
32
|
vi.mock("@multiplatform.one/components", () => ({
|
|
32
33
|
Tooltip: ({ children }: any) => children,
|
|
34
|
+
// UndoIcon/RedoIcon mirror through the direction source (RTL glyph swap).
|
|
35
|
+
useDirection: () => "ltr",
|
|
33
36
|
}));
|
|
34
37
|
|
|
35
38
|
// Import after mocks
|
|
@@ -115,4 +118,29 @@ describe("icons", () => {
|
|
|
115
118
|
const svgs = container.querySelectorAll("svg");
|
|
116
119
|
expect(svgs.length).toBeGreaterThanOrEqual(8);
|
|
117
120
|
});
|
|
121
|
+
|
|
122
|
+
it("mechanical icons render phosphor glyphs (LC-16 census #20)", () => {
|
|
123
|
+
const { container } = renderWithProviders(<UndoIcon />);
|
|
124
|
+
// Phosphor icons render a 256-grid viewBox; the old hand-rolled set was 24.
|
|
125
|
+
const svg = container.querySelector("svg");
|
|
126
|
+
expect(svg).toBeTruthy();
|
|
127
|
+
expect(svg!.getAttribute("viewBox")).toBe("0 0 256 256");
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("text-style icons accept (and ignore) legacy letter children", () => {
|
|
131
|
+
const { container } = renderWithProviders(<BoldIcon>B</BoldIcon>);
|
|
132
|
+
expect(container.querySelector("svg")).toBeTruthy();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("color-state icons stay custom and render the current color swatch", () => {
|
|
136
|
+
const { container } = renderWithProviders(
|
|
137
|
+
<>
|
|
138
|
+
<TextColorIcon color="#ff0000" />
|
|
139
|
+
<HighlightIcon color="#00ff00" />
|
|
140
|
+
</>,
|
|
141
|
+
);
|
|
142
|
+
const rects = Array.from(container.querySelectorAll("rect"));
|
|
143
|
+
expect(rects.some((r) => r.getAttribute("fill") === "#ff0000")).toBe(true);
|
|
144
|
+
expect(rects.some((r) => r.getAttribute("fill") === "#00ff00")).toBe(true);
|
|
145
|
+
});
|
|
118
146
|
});
|