@uzum-tech/ui 2.3.8 → 2.4.1
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/dist/index.js +63596 -32483
- package/dist/index.mjs +64978 -33874
- package/dist/index.prod.js +3 -3
- package/dist/index.prod.mjs +3 -3
- package/es/_internal/icons/Bold.d.ts +2 -0
- package/es/_internal/icons/Bold.mjs +29 -0
- package/es/_internal/icons/BulletList.d.ts +2 -0
- package/es/_internal/icons/BulletList.mjs +23 -0
- package/es/_internal/icons/HorizontalRule.d.ts +2 -0
- package/es/_internal/icons/HorizontalRule.mjs +14 -0
- package/es/_internal/icons/Italic.d.ts +2 -0
- package/es/_internal/icons/Italic.mjs +19 -0
- package/es/_internal/icons/NumberedList.d.ts +2 -0
- package/es/_internal/icons/NumberedList.mjs +23 -0
- package/es/_internal/icons/Quote.d.ts +2 -0
- package/es/_internal/icons/Quote.mjs +23 -0
- package/es/_internal/icons/SettingsLine.d.ts +2 -0
- package/es/_internal/icons/SettingsLine.mjs +19 -0
- package/es/_internal/icons/Strikethrough.d.ts +2 -0
- package/es/_internal/icons/Strikethrough.mjs +14 -0
- package/es/_internal/icons/index.d.ts +8 -0
- package/es/_internal/icons/index.mjs +8 -0
- package/es/_styles/markdown/markdown-content.cssr.d.ts +6 -0
- package/es/_styles/markdown/markdown-content.cssr.mjs +22 -0
- package/es/_utils/markdown/index.d.ts +3 -2
- package/es/_utils/markdown/index.mjs +2 -1
- package/es/_utils/markdown/render-markdown.d.ts +2 -1
- package/es/_utils/markdown/render-markdown.mjs +1 -1
- package/es/chat/src/Chat.d.ts +261 -24
- package/es/chat/src/Chat.mjs +2 -0
- package/es/chat/src/ChatMainArea.d.ts +81 -8
- package/es/chat/src/ChatMainArea.mjs +111 -355
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +9084 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.mjs +70 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/interface.d.ts +2645 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/interface.mjs +19 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.d.ts +9070 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.mjs +78 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/interface.d.ts +2637 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/interface.mjs +15 -0
- package/es/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.d.ts +89 -0
- package/es/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.mjs +63 -0
- package/es/chat/src/ChatParts/ChatEditorInput/interface.d.ts +42 -0
- package/es/chat/src/ChatParts/ChatEditorInput/interface.mjs +34 -0
- package/es/chat/src/ChatParts/ChatFooter/ChatFooter.d.ts +115 -0
- package/es/chat/src/ChatParts/ChatFooter/ChatFooter.mjs +99 -0
- package/es/chat/src/ChatParts/ChatFooter/interface.d.ts +56 -0
- package/es/chat/src/ChatParts/ChatFooter/interface.mjs +46 -0
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +9205 -0
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.mjs +219 -0
- package/es/chat/src/ChatParts/ChatHeader/interface.d.ts +2694 -0
- package/es/chat/src/ChatParts/ChatHeader/interface.mjs +67 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.d.ts +9142 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.mjs +130 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/interface.d.ts +2654 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/interface.mjs +27 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.d.ts +148 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.mjs +92 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/interface.d.ts +72 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/interface.mjs +58 -0
- package/es/chat/src/interface.d.ts +7 -0
- package/es/chat/src/interface.mjs +4 -0
- package/es/chat/src/styles/index.cssr.mjs +11 -12
- package/es/chat/styles/light.d.ts +4 -0
- package/es/chat/styles/light.mjs +20 -1
- package/es/components.d.ts +13087 -103
- package/es/components.mjs +5 -0
- package/es/config-provider/src/ConfigProvider.mjs +6 -2
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/index.d.ts +1 -1
- package/es/data-table/src/ColumnSettings/ColumnSettingsDrawer.d.ts +156 -0
- package/es/data-table/src/ColumnSettings/ColumnSettingsDrawer.mjs +220 -0
- package/es/data-table/src/ColumnSettings/styles.cssr.d.ts +2 -0
- package/es/data-table/src/ColumnSettings/styles.cssr.mjs +25 -0
- package/es/data-table/src/DataTable.d.ts +60 -2
- package/es/data-table/src/DataTable.mjs +99 -23
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/es/data-table/src/interface.d.ts +53 -1
- package/es/data-table/src/interface.mjs +18 -1
- package/es/data-table/src/styles/index.cssr.mjs +17 -1
- package/es/data-table/src/use-column-settings.d.ts +2 -0
- package/es/data-table/src/use-column-settings.mjs +124 -0
- package/es/data-table/src/utils/column-utils.d.ts +2 -1
- package/es/data-table/src/utils/column-utils.mjs +6 -0
- package/es/editor/index.d.ts +10 -0
- package/es/editor/index.mjs +5 -0
- package/es/editor/src/Editor.d.ts +3922 -0
- package/es/editor/src/Editor.mjs +230 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.d.ts +37 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.mjs +63 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/interface.d.ts +21 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/interface.mjs +14 -0
- package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +4102 -0
- package/es/editor/src/EditorParts/EditorContent/EditorContent.mjs +154 -0
- package/es/editor/src/EditorParts/EditorContent/index.d.ts +2 -0
- package/es/editor/src/EditorParts/EditorContent/index.mjs +2 -0
- package/es/editor/src/EditorParts/EditorContent/interface.d.ts +1918 -0
- package/es/editor/src/EditorParts/EditorContent/interface.mjs +17 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +4606 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.mjs +170 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts +11 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.mjs +56 -0
- package/es/editor/src/EditorParts/EditorToolbar/index.d.ts +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/index.mjs +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.d.ts +1924 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.mjs +18 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.d.ts +23 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.mjs +44 -0
- package/es/editor/src/EditorParts/SendButton/interface.d.ts +18 -0
- package/es/editor/src/EditorParts/SendButton/interface.mjs +8 -0
- package/es/editor/src/EditorParts/ToolbarButton/ToolbarButton.d.ts +32 -0
- package/es/editor/src/EditorParts/ToolbarButton/ToolbarButton.mjs +44 -0
- package/es/editor/src/EditorParts/ToolbarButton/interface.d.ts +20 -0
- package/es/editor/src/EditorParts/ToolbarButton/interface.mjs +13 -0
- package/es/editor/src/composables/use-editor-commands.d.ts +8 -0
- package/es/editor/src/composables/use-editor-commands.mjs +69 -0
- package/es/editor/src/composables/use-editor-css-vars.d.ts +4 -0
- package/es/editor/src/composables/use-editor-css-vars.mjs +89 -0
- package/es/editor/src/constants.d.ts +12 -0
- package/es/editor/src/constants.mjs +25 -0
- package/es/editor/src/extensions.d.ts +7 -0
- package/es/editor/src/extensions.mjs +135 -0
- package/es/editor/src/interface.d.ts +2037 -0
- package/es/editor/src/interface.mjs +53 -0
- package/es/editor/src/markdown/constants.d.ts +8 -0
- package/es/editor/src/markdown/constants.mjs +206 -0
- package/es/editor/src/markdown/editor-serializer.d.ts +9 -0
- package/es/editor/src/markdown/editor-serializer.mjs +18 -0
- package/es/editor/src/markdown/escape.d.ts +2 -0
- package/es/editor/src/markdown/escape.mjs +24 -0
- package/es/editor/src/markdown/html.d.ts +1 -0
- package/es/editor/src/markdown/html.mjs +4 -0
- package/es/editor/src/markdown/parser.d.ts +4 -0
- package/es/editor/src/markdown/parser.mjs +36 -0
- package/es/editor/src/markdown/serializer-state.d.ts +10 -0
- package/es/editor/src/markdown/serializer-state.mjs +12 -0
- package/es/editor/src/markdown/serializer.d.ts +3 -0
- package/es/editor/src/markdown/serializer.mjs +8 -0
- package/es/editor/src/styles/index.cssr.d.ts +2 -0
- package/es/editor/src/styles/index.cssr.mjs +131 -0
- package/es/editor/styles/dark.d.ts +634 -0
- package/es/editor/styles/dark.mjs +21 -0
- package/es/editor/styles/index.d.ts +3 -0
- package/es/editor/styles/index.mjs +2 -0
- package/es/editor/styles/light.d.ts +685 -0
- package/es/editor/styles/light.mjs +91 -0
- package/es/editor/tests/fixtures/round-trip.d.ts +12 -0
- package/es/editor/tests/fixtures/round-trip.mjs +98 -0
- package/es/editor/tests/utils.d.ts +7 -0
- package/es/editor/tests/utils.mjs +27 -0
- package/es/locales/common/enUS.d.ts +22 -0
- package/es/locales/common/enUS.mjs +23 -1
- package/es/locales/common/ruRU.mjs +28 -8
- package/es/locales/common/uzUZ.mjs +23 -1
- package/es/locales/common/zhCN.mjs +23 -1
- package/es/locales/utils/date-locale.d.ts +2 -0
- package/es/locales/utils/date-locale.mjs +8 -0
- package/es/message-bubble/src/MessageBubble.d.ts +9 -0
- package/es/message-bubble/src/MessageBubble.mjs +9 -8
- package/es/message-bubble/src/interface.d.ts +5 -1
- package/es/message-bubble/src/interface.mjs +4 -0
- package/es/message-bubble/src/styles/index.cssr.mjs +4 -17
- package/es/styles.d.ts +1 -0
- package/es/styles.mjs +1 -0
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icons/Bold.d.ts +2 -0
- package/lib/_internal/icons/Bold.js +13 -0
- package/lib/_internal/icons/BulletList.d.ts +2 -0
- package/lib/_internal/icons/BulletList.js +13 -0
- package/lib/_internal/icons/HorizontalRule.d.ts +2 -0
- package/lib/_internal/icons/HorizontalRule.js +10 -0
- package/lib/_internal/icons/Italic.d.ts +2 -0
- package/lib/_internal/icons/Italic.js +11 -0
- package/lib/_internal/icons/NumberedList.d.ts +2 -0
- package/lib/_internal/icons/NumberedList.js +13 -0
- package/lib/_internal/icons/Quote.d.ts +2 -0
- package/lib/_internal/icons/Quote.js +13 -0
- package/lib/_internal/icons/SettingsLine.d.ts +2 -0
- package/lib/_internal/icons/SettingsLine.js +11 -0
- package/lib/_internal/icons/Strikethrough.d.ts +2 -0
- package/lib/_internal/icons/Strikethrough.js +10 -0
- package/lib/_internal/icons/index.d.ts +8 -0
- package/lib/_internal/icons/index.js +18 -2
- package/lib/_styles/markdown/markdown-content.cssr.d.ts +6 -0
- package/lib/_styles/markdown/markdown-content.cssr.js +28 -0
- package/lib/_utils/markdown/index.d.ts +3 -2
- package/lib/_utils/markdown/index.js +4 -1
- package/lib/_utils/markdown/render-markdown.d.ts +2 -1
- package/lib/_utils/markdown/render-markdown.js +1 -0
- package/lib/chat/src/Chat.d.ts +261 -24
- package/lib/chat/src/Chat.js +2 -0
- package/lib/chat/src/ChatMainArea.d.ts +81 -8
- package/lib/chat/src/ChatMainArea.js +93 -223
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +9084 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.js +52 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/interface.d.ts +2645 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/interface.js +17 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.d.ts +9070 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.js +55 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/interface.d.ts +2637 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/interface.js +14 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.d.ts +89 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.js +45 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/interface.d.ts +42 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/interface.js +37 -0
- package/lib/chat/src/ChatParts/ChatFooter/ChatFooter.d.ts +115 -0
- package/lib/chat/src/ChatParts/ChatFooter/ChatFooter.js +66 -0
- package/lib/chat/src/ChatParts/ChatFooter/interface.d.ts +56 -0
- package/lib/chat/src/ChatParts/ChatFooter/interface.js +49 -0
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +9205 -0
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.js +164 -0
- package/lib/chat/src/ChatParts/ChatHeader/interface.d.ts +2694 -0
- package/lib/chat/src/ChatParts/ChatHeader/interface.js +53 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.d.ts +9142 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.js +98 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/interface.d.ts +2654 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/interface.js +23 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.d.ts +148 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.js +49 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/interface.d.ts +72 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/interface.js +61 -0
- package/lib/chat/src/interface.d.ts +7 -0
- package/lib/chat/src/interface.js +3 -0
- package/lib/chat/src/styles/index.cssr.js +11 -12
- package/lib/chat/styles/light.d.ts +4 -0
- package/lib/chat/styles/light.js +22 -1
- package/lib/components.d.ts +13087 -103
- package/lib/components.js +17 -7
- package/lib/config-provider/src/ConfigProvider.js +7 -4
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/index.d.ts +1 -1
- package/lib/data-table/src/ColumnSettings/ColumnSettingsDrawer.d.ts +156 -0
- package/lib/data-table/src/ColumnSettings/ColumnSettingsDrawer.js +181 -0
- package/lib/data-table/src/ColumnSettings/styles.cssr.d.ts +2 -0
- package/lib/data-table/src/ColumnSettings/styles.cssr.js +30 -0
- package/lib/data-table/src/DataTable.d.ts +60 -2
- package/lib/data-table/src/DataTable.js +65 -23
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/lib/data-table/src/interface.d.ts +53 -1
- package/lib/data-table/src/interface.js +17 -2
- package/lib/data-table/src/styles/index.cssr.js +17 -1
- package/lib/data-table/src/use-column-settings.d.ts +2 -0
- package/lib/data-table/src/use-column-settings.js +144 -0
- package/lib/data-table/src/utils/column-utils.d.ts +2 -1
- package/lib/data-table/src/utils/column-utils.js +5 -0
- package/lib/editor/index.d.ts +10 -0
- package/lib/editor/index.js +19 -0
- package/lib/editor/src/Editor.d.ts +3922 -0
- package/lib/editor/src/Editor.js +224 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.d.ts +37 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.js +47 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/interface.d.ts +21 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/interface.js +17 -0
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +4102 -0
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.js +121 -0
- package/lib/editor/src/EditorParts/EditorContent/index.d.ts +2 -0
- package/lib/editor/src/EditorParts/EditorContent/index.js +10 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.d.ts +1918 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.js +8 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +4606 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.js +126 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts +11 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.js +52 -0
- package/lib/editor/src/EditorParts/EditorToolbar/index.d.ts +2 -0
- package/lib/editor/src/EditorParts/EditorToolbar/index.js +10 -0
- package/lib/editor/src/EditorParts/EditorToolbar/interface.d.ts +1924 -0
- package/lib/editor/src/EditorParts/EditorToolbar/interface.js +11 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.d.ts +23 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.js +31 -0
- package/lib/editor/src/EditorParts/SendButton/interface.d.ts +18 -0
- package/lib/editor/src/EditorParts/SendButton/interface.js +11 -0
- package/lib/editor/src/EditorParts/ToolbarButton/ToolbarButton.d.ts +32 -0
- package/lib/editor/src/EditorParts/ToolbarButton/ToolbarButton.js +34 -0
- package/lib/editor/src/EditorParts/ToolbarButton/interface.d.ts +20 -0
- package/lib/editor/src/EditorParts/ToolbarButton/interface.js +16 -0
- package/lib/editor/src/composables/use-editor-commands.d.ts +8 -0
- package/lib/editor/src/composables/use-editor-commands.js +70 -0
- package/lib/editor/src/composables/use-editor-css-vars.d.ts +4 -0
- package/lib/editor/src/composables/use-editor-css-vars.js +50 -0
- package/lib/editor/src/constants.d.ts +12 -0
- package/lib/editor/src/constants.js +56 -0
- package/lib/editor/src/extensions.d.ts +7 -0
- package/lib/editor/src/extensions.js +141 -0
- package/lib/editor/src/interface.d.ts +2037 -0
- package/lib/editor/src/interface.js +22 -0
- package/lib/editor/src/markdown/constants.d.ts +8 -0
- package/lib/editor/src/markdown/constants.js +201 -0
- package/lib/editor/src/markdown/editor-serializer.d.ts +9 -0
- package/lib/editor/src/markdown/editor-serializer.js +20 -0
- package/lib/editor/src/markdown/escape.d.ts +2 -0
- package/lib/editor/src/markdown/escape.js +31 -0
- package/lib/editor/src/markdown/html.d.ts +1 -0
- package/lib/editor/src/markdown/html.js +9 -0
- package/lib/editor/src/markdown/parser.d.ts +4 -0
- package/lib/editor/src/markdown/parser.js +42 -0
- package/lib/editor/src/markdown/serializer-state.d.ts +10 -0
- package/lib/editor/src/markdown/serializer-state.js +16 -0
- package/lib/editor/src/markdown/serializer.d.ts +3 -0
- package/lib/editor/src/markdown/serializer.js +9 -0
- package/lib/editor/src/styles/index.cssr.d.ts +2 -0
- package/lib/editor/src/styles/index.cssr.js +136 -0
- package/lib/editor/styles/dark.d.ts +634 -0
- package/lib/editor/styles/dark.js +23 -0
- package/lib/editor/styles/index.d.ts +3 -0
- package/lib/editor/styles/index.js +10 -0
- package/lib/editor/styles/light.d.ts +685 -0
- package/lib/editor/styles/light.js +75 -0
- package/lib/editor/tests/fixtures/round-trip.d.ts +12 -0
- package/lib/editor/tests/fixtures/round-trip.js +125 -0
- package/lib/editor/tests/utils.d.ts +7 -0
- package/lib/editor/tests/utils.js +26 -0
- package/lib/locales/common/enUS.d.ts +22 -0
- package/lib/locales/common/enUS.js +23 -1
- package/lib/locales/common/ruRU.js +28 -8
- package/lib/locales/common/uzUZ.js +23 -1
- package/lib/locales/common/zhCN.js +23 -1
- package/lib/locales/utils/date-locale.d.ts +2 -0
- package/lib/locales/utils/date-locale.js +14 -0
- package/lib/message-bubble/src/MessageBubble.d.ts +9 -0
- package/lib/message-bubble/src/MessageBubble.js +12 -7
- package/lib/message-bubble/src/interface.d.ts +5 -1
- package/lib/message-bubble/src/interface.js +3 -0
- package/lib/message-bubble/src/styles/index.cssr.js +4 -17
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +127 -125
- package/lib/themes/dark.js +136 -134
- package/lib/themes/light.js +136 -134
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -1
- package/volar.d.ts +3 -0
- package/web-types.json +454 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editorProps = exports.editorInjectionKey = void 0;
|
|
4
|
+
const _mixins_1 = require("../../_mixins");
|
|
5
|
+
const _utils_1 = require("../../_utils");
|
|
6
|
+
exports.editorInjectionKey = (0, _utils_1.createInjectionKey)('u-editor');
|
|
7
|
+
exports.editorProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { value: String, defaultValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ''
|
|
10
|
+
}, placeholder: String, markdownOptions: Object, toolbar: {
|
|
11
|
+
type: [Array, Boolean],
|
|
12
|
+
default: true
|
|
13
|
+
}, sendTooltip: String, boldTooltip: String, strikethroughTooltip: String, italicTooltip: String, blockquoteTooltip: String, dividerTooltip: String, bulletListTooltip: String, orderedListTooltip: String, showSendButton: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
}, sendOnEnter: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true
|
|
19
|
+
}, disabled: Boolean, readonly: Boolean, autofocus: Boolean, maxLength: Number, maxRows: Number, toolbarButtonProps: Object, toolbarIconProps: Object, toolbarDropdownProps: Object, sendButtonProps: Object, sendIconProps: Object, contentProps: Object, extensions: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
22
|
+
}, nodeProps: Object, onSend: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array], 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array] });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorToolbarItemKey } from '@uzum-tech/ui';
|
|
2
|
+
import type { MarkdownSerializer, ParseSpec } from 'prosemirror-markdown';
|
|
3
|
+
import type { EditorCommandSpec } from '../interface';
|
|
4
|
+
export declare const markdownEditorEscapeRegex: Record<string, RegExp>;
|
|
5
|
+
export declare const MARKDOWN_EDITOR_TOKEN_PARSE_SPECS: Record<string, ParseSpec>;
|
|
6
|
+
export declare const MARKDOWN_EDITOR_NODE_SERIALIZERS: MarkdownSerializer['nodes'];
|
|
7
|
+
export declare const MARKDOWN_EDITOR_MARK_SERIALIZERS: MarkdownSerializer['marks'];
|
|
8
|
+
export declare const EDITOR_COMMAND_SPECS: Record<EditorToolbarItemKey, EditorCommandSpec>;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EDITOR_COMMAND_SPECS = exports.MARKDOWN_EDITOR_MARK_SERIALIZERS = exports.MARKDOWN_EDITOR_NODE_SERIALIZERS = exports.MARKDOWN_EDITOR_TOKEN_PARSE_SPECS = exports.markdownEditorEscapeRegex = void 0;
|
|
4
|
+
const markdownSourceOf = (token) => token.markup || null;
|
|
5
|
+
function markdownSourceOrDefault(node, fallback) {
|
|
6
|
+
const source = node.attrs.markdownSource;
|
|
7
|
+
return typeof source === 'string' && source ? source : fallback;
|
|
8
|
+
}
|
|
9
|
+
exports.markdownEditorEscapeRegex = {
|
|
10
|
+
BULLET_MARKER_REGEX: /^[-*+](?=\s)/,
|
|
11
|
+
ORDERED_MARKER_REGEX: /^(\d+)([.)])(?=\s)/,
|
|
12
|
+
BLOCKQUOTE_MARKER_REGEX: /^>/,
|
|
13
|
+
DIVIDER_LINE_REGEX: /^([-*_=])\1{2,}\s*$/
|
|
14
|
+
};
|
|
15
|
+
exports.MARKDOWN_EDITOR_TOKEN_PARSE_SPECS = {
|
|
16
|
+
paragraph: { block: 'paragraph' },
|
|
17
|
+
heading: {
|
|
18
|
+
block: 'heading',
|
|
19
|
+
getAttrs: token => ({
|
|
20
|
+
level: Number(token.tag.slice(1)),
|
|
21
|
+
markdownSource: markdownSourceOf(token)
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
blockquote: {
|
|
25
|
+
block: 'blockquote',
|
|
26
|
+
getAttrs: token => ({
|
|
27
|
+
markdownSource: markdownSourceOf(token)
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
bullet_list: {
|
|
31
|
+
block: 'bulletList',
|
|
32
|
+
getAttrs: token => ({
|
|
33
|
+
markdownSource: markdownSourceOf(token)
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
ordered_list: {
|
|
37
|
+
block: 'orderedList',
|
|
38
|
+
getAttrs: token => {
|
|
39
|
+
var _a;
|
|
40
|
+
return ({
|
|
41
|
+
start: Number((_a = token.attrGet('start')) !== null && _a !== void 0 ? _a : 1),
|
|
42
|
+
markdownSource: markdownSourceOf(token)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
list_item: { block: 'listItem' },
|
|
47
|
+
hr: {
|
|
48
|
+
node: 'horizontalRule',
|
|
49
|
+
getAttrs: token => ({
|
|
50
|
+
markdownSource: markdownSourceOf(token)
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
hardbreak: { node: 'hardBreak' },
|
|
54
|
+
softbreak: { node: 'hardBreak' },
|
|
55
|
+
strong: {
|
|
56
|
+
mark: 'bold',
|
|
57
|
+
getAttrs: token => ({
|
|
58
|
+
markdownSource: markdownSourceOf(token)
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
em: {
|
|
62
|
+
mark: 'italic',
|
|
63
|
+
getAttrs: token => ({
|
|
64
|
+
markdownSource: markdownSourceOf(token)
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
s: {
|
|
68
|
+
mark: 'strike',
|
|
69
|
+
getAttrs: token => ({
|
|
70
|
+
markdownSource: markdownSourceOf(token)
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
link: {
|
|
74
|
+
mark: 'link',
|
|
75
|
+
getAttrs: token => ({
|
|
76
|
+
href: token.attrGet('href'),
|
|
77
|
+
title: token.attrGet('title'),
|
|
78
|
+
markdownSource: markdownSourceOf(token)
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.MARKDOWN_EDITOR_NODE_SERIALIZERS = {
|
|
83
|
+
paragraph(state, node) {
|
|
84
|
+
state.renderInline(node);
|
|
85
|
+
state.closeBlock(node);
|
|
86
|
+
},
|
|
87
|
+
heading(state, node) {
|
|
88
|
+
const marker = markdownSourceOrDefault(node, '#'.repeat(node.attrs.level));
|
|
89
|
+
state.write(`${marker} `);
|
|
90
|
+
state.renderInline(node);
|
|
91
|
+
state.closeBlock(node);
|
|
92
|
+
},
|
|
93
|
+
blockquote(state, node) {
|
|
94
|
+
const marker = markdownSourceOrDefault(node, '>');
|
|
95
|
+
state.wrapBlock(`${marker} `, null, node, () => state.renderContent(node));
|
|
96
|
+
},
|
|
97
|
+
bulletList(state, node) {
|
|
98
|
+
const marker = markdownSourceOrDefault(node, '-');
|
|
99
|
+
state.renderList(node, ' ', () => `${marker} `);
|
|
100
|
+
},
|
|
101
|
+
orderedList(state, node) {
|
|
102
|
+
var _a;
|
|
103
|
+
const delimiter = markdownSourceOrDefault(node, '.');
|
|
104
|
+
const start = Number((_a = node.attrs.start) !== null && _a !== void 0 ? _a : 1);
|
|
105
|
+
const maxWidth = String(start + node.childCount - 1).length;
|
|
106
|
+
const space = state.repeat(' ', maxWidth + 2);
|
|
107
|
+
state.renderList(node, space, (index) => {
|
|
108
|
+
const label = String(start + index);
|
|
109
|
+
return `${state.repeat(' ', maxWidth - label.length)}${label}${delimiter} `;
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
listItem(state, node) {
|
|
113
|
+
state.renderContent(node);
|
|
114
|
+
},
|
|
115
|
+
horizontalRule(state, node) {
|
|
116
|
+
state.write(markdownSourceOrDefault(node, '---'));
|
|
117
|
+
state.closeBlock(node);
|
|
118
|
+
},
|
|
119
|
+
hardBreak(state, node, parent, index) {
|
|
120
|
+
for (let next = index + 1; next < parent.childCount; next++) {
|
|
121
|
+
if (parent.child(next).type !== node.type) {
|
|
122
|
+
state.write('\n');
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
text(state, node) {
|
|
128
|
+
var _a;
|
|
129
|
+
state.text((_a = node.text) !== null && _a !== void 0 ? _a : '');
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
exports.MARKDOWN_EDITOR_MARK_SERIALIZERS = {
|
|
133
|
+
bold: {
|
|
134
|
+
open: (_state, mark) => markdownSourceOrDefault(mark, '**'),
|
|
135
|
+
close: (_state, mark) => markdownSourceOrDefault(mark, '**'),
|
|
136
|
+
mixable: true,
|
|
137
|
+
expelEnclosingWhitespace: true
|
|
138
|
+
},
|
|
139
|
+
italic: {
|
|
140
|
+
open: (_state, mark) => markdownSourceOrDefault(mark, '*'),
|
|
141
|
+
close: (_state, mark) => markdownSourceOrDefault(mark, '*'),
|
|
142
|
+
mixable: true,
|
|
143
|
+
expelEnclosingWhitespace: true
|
|
144
|
+
},
|
|
145
|
+
strike: {
|
|
146
|
+
open: (_state, mark) => markdownSourceOrDefault(mark, '~~'),
|
|
147
|
+
close: (_state, mark) => markdownSourceOrDefault(mark, '~~'),
|
|
148
|
+
mixable: true,
|
|
149
|
+
expelEnclosingWhitespace: true
|
|
150
|
+
},
|
|
151
|
+
link: {
|
|
152
|
+
open: '[',
|
|
153
|
+
close: (_state, mark) => {
|
|
154
|
+
var _a;
|
|
155
|
+
const title = mark.attrs.title ? ` "${mark.attrs.title}"` : '';
|
|
156
|
+
return `](${(_a = mark.attrs.href) !== null && _a !== void 0 ? _a : ''}${title})`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
exports.EDITOR_COMMAND_SPECS = {
|
|
161
|
+
blockType: {
|
|
162
|
+
run: editor => editor.chain().focus().setParagraph().run(),
|
|
163
|
+
active: editor => editor.isActive('heading'),
|
|
164
|
+
enabled: editor => editor.can().chain().focus().setParagraph().run()
|
|
165
|
+
},
|
|
166
|
+
bold: {
|
|
167
|
+
run: editor => editor.chain().focus().toggleBold().run(),
|
|
168
|
+
active: editor => editor.isActive('bold'),
|
|
169
|
+
enabled: editor => editor.can().chain().focus().toggleBold().run()
|
|
170
|
+
},
|
|
171
|
+
strikethrough: {
|
|
172
|
+
run: editor => editor.chain().focus().toggleStrike().run(),
|
|
173
|
+
active: editor => editor.isActive('strike'),
|
|
174
|
+
enabled: editor => editor.can().chain().focus().toggleStrike().run()
|
|
175
|
+
},
|
|
176
|
+
italic: {
|
|
177
|
+
run: editor => editor.chain().focus().toggleItalic().run(),
|
|
178
|
+
active: editor => editor.isActive('italic'),
|
|
179
|
+
enabled: editor => editor.can().chain().focus().toggleItalic().run()
|
|
180
|
+
},
|
|
181
|
+
blockquote: {
|
|
182
|
+
run: editor => editor.chain().focus().toggleBlockquote().run(),
|
|
183
|
+
active: editor => editor.isActive('blockquote'),
|
|
184
|
+
enabled: editor => editor.can().chain().focus().toggleBlockquote().run()
|
|
185
|
+
},
|
|
186
|
+
divider: {
|
|
187
|
+
run: editor => editor.chain().focus().setHorizontalRule().run(),
|
|
188
|
+
active: editor => editor.isActive('horizontalRule'),
|
|
189
|
+
enabled: editor => editor.can().chain().focus().setHorizontalRule().run()
|
|
190
|
+
},
|
|
191
|
+
bulletList: {
|
|
192
|
+
run: editor => editor.chain().focus().toggleBulletList().run(),
|
|
193
|
+
active: editor => editor.isActive('bulletList'),
|
|
194
|
+
enabled: editor => editor.can().chain().focus().toggleBulletList().run()
|
|
195
|
+
},
|
|
196
|
+
orderedList: {
|
|
197
|
+
run: editor => editor.chain().focus().toggleOrderedList().run(),
|
|
198
|
+
active: editor => editor.isActive('orderedList'),
|
|
199
|
+
enabled: editor => editor.can().chain().focus().toggleOrderedList().run()
|
|
200
|
+
}
|
|
201
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from '@tiptap/pm/model';
|
|
2
|
+
import type { NormalizedMarkdownOptions } from '../../../_utils/markdown';
|
|
3
|
+
import type { MarkdownSerializerStateOptions } from '../interface';
|
|
4
|
+
import { MarkdownSerializer } from 'prosemirror-markdown';
|
|
5
|
+
export declare class EditorMarkdownSerializer extends MarkdownSerializer {
|
|
6
|
+
private readonly markdownOptions;
|
|
7
|
+
constructor(nodes: MarkdownSerializer['nodes'], marks: MarkdownSerializer['marks'], options: MarkdownSerializer['options'], markdownOptions: NormalizedMarkdownOptions);
|
|
8
|
+
serialize(content: Node, options?: MarkdownSerializerStateOptions): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditorMarkdownSerializer = void 0;
|
|
4
|
+
const prosemirror_markdown_1 = require("prosemirror-markdown");
|
|
5
|
+
const serializer_state_1 = require("./serializer-state");
|
|
6
|
+
class EditorMarkdownSerializer extends prosemirror_markdown_1.MarkdownSerializer {
|
|
7
|
+
constructor(nodes, marks, options, markdownOptions) {
|
|
8
|
+
super(nodes, marks, options);
|
|
9
|
+
this.markdownOptions = markdownOptions;
|
|
10
|
+
}
|
|
11
|
+
serialize(content, options) {
|
|
12
|
+
const state = new serializer_state_1.EditorMarkdownSerializerState(this.nodes, this.marks, Object.assign(Object.assign(Object.assign({}, this.options), { tightLists: true }), options), this.markdownOptions);
|
|
13
|
+
state.renderContent(content);
|
|
14
|
+
if ('out' in state && typeof state.out === 'string') {
|
|
15
|
+
return state.out;
|
|
16
|
+
}
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.EditorMarkdownSerializer = EditorMarkdownSerializer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.escapeLineStart = escapeLineStart;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
function escapeLineStart(line, options) {
|
|
6
|
+
const features = new Set(options.features);
|
|
7
|
+
if (features.has('heading')) {
|
|
8
|
+
const headingMarkerRegex = new RegExp(`^#{1,${options.maxHeadingLevel}}(?=\\s)`);
|
|
9
|
+
if (headingMarkerRegex.test(line))
|
|
10
|
+
return `\\${line}`;
|
|
11
|
+
}
|
|
12
|
+
if (features.has('bulletList')
|
|
13
|
+
&& constants_1.markdownEditorEscapeRegex.BULLET_MARKER_REGEX.test(line)) {
|
|
14
|
+
return `\\${line}`;
|
|
15
|
+
}
|
|
16
|
+
if (features.has('orderedList')) {
|
|
17
|
+
const ordered = constants_1.markdownEditorEscapeRegex.ORDERED_MARKER_REGEX.exec(line);
|
|
18
|
+
if (ordered) {
|
|
19
|
+
return line.replace(constants_1.markdownEditorEscapeRegex.ORDERED_MARKER_REGEX, `$1\\$2`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (features.has('blockquote')
|
|
23
|
+
&& constants_1.markdownEditorEscapeRegex.BLOCKQUOTE_MARKER_REGEX.test(line)) {
|
|
24
|
+
return `\\${line}`;
|
|
25
|
+
}
|
|
26
|
+
if (features.has('divider')
|
|
27
|
+
&& constants_1.markdownEditorEscapeRegex.DIVIDER_LINE_REGEX.test(line)) {
|
|
28
|
+
return `\\${line}`;
|
|
29
|
+
}
|
|
30
|
+
return line;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function unwrapListParagraphs(html: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unwrapListParagraphs = unwrapListParagraphs;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
function unwrapListParagraphs(html) {
|
|
6
|
+
return html
|
|
7
|
+
.replace(constants_1.EDITOR_MARKDOWN_REGEX.SINGLE_PARAGRAPH_ITEM, '<li>$1</li>')
|
|
8
|
+
.replace(constants_1.EDITOR_MARKDOWN_REGEX.PARAGRAPH_BEFORE_NESTED_LIST, '<li>$1');
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Schema } from '@tiptap/pm/model';
|
|
2
|
+
import type { MarkdownOptions } from '../../../_utils/markdown';
|
|
3
|
+
import { MarkdownParser } from 'prosemirror-markdown';
|
|
4
|
+
export declare function createMarkdownParser(schema: Schema, options?: MarkdownOptions): MarkdownParser;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMarkdownParser = createMarkdownParser;
|
|
4
|
+
const prosemirror_markdown_1 = require("prosemirror-markdown");
|
|
5
|
+
const markdown_1 = require("../../../_utils/markdown");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
function imageToMarkdown(token) {
|
|
8
|
+
var _a;
|
|
9
|
+
const source = (_a = token.attrGet('src')) !== null && _a !== void 0 ? _a : '';
|
|
10
|
+
const title = token.attrGet('title');
|
|
11
|
+
const address = title ? `${source} "${title}"` : source;
|
|
12
|
+
return ``;
|
|
13
|
+
}
|
|
14
|
+
function imagesToTextCoreRule(state) {
|
|
15
|
+
for (const token of state.tokens) {
|
|
16
|
+
if (token.type !== 'inline' || !token.children)
|
|
17
|
+
continue;
|
|
18
|
+
for (const child of token.children) {
|
|
19
|
+
if (child.type !== 'image')
|
|
20
|
+
continue;
|
|
21
|
+
child.type = 'text';
|
|
22
|
+
child.content = imageToMarkdown(child);
|
|
23
|
+
child.children = null;
|
|
24
|
+
child.attrs = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function createMarkdownParser(schema, options) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const tokenizer = (0, markdown_1.createMarkdownRenderer)((0, markdown_1.normalizeOptions)(options));
|
|
31
|
+
tokenizer.core.ruler.before('u_prune_empty_blocks', 'u_editor_images_to_text', imagesToTextCoreRule);
|
|
32
|
+
const specs = {};
|
|
33
|
+
for (const type of Object.keys(constants_1.MARKDOWN_EDITOR_TOKEN_PARSE_SPECS)) {
|
|
34
|
+
const spec = constants_1.MARKDOWN_EDITOR_TOKEN_PARSE_SPECS[type];
|
|
35
|
+
const name = (_b = (_a = spec.block) !== null && _a !== void 0 ? _a : spec.node) !== null && _b !== void 0 ? _b : spec.mark;
|
|
36
|
+
specs[type]
|
|
37
|
+
= name && !schema.nodes[name] && !schema.marks[name]
|
|
38
|
+
? { ignore: true }
|
|
39
|
+
: spec;
|
|
40
|
+
}
|
|
41
|
+
return new prosemirror_markdown_1.MarkdownParser(schema, tokenizer, specs);
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MarkdownSerializer } from 'prosemirror-markdown';
|
|
2
|
+
import type { NormalizedMarkdownOptions } from '../../../_utils/markdown';
|
|
3
|
+
import type { MarkdownSerializerStateOptions, SerializerStateConstructor } from '../interface';
|
|
4
|
+
declare const SerializerState: SerializerStateConstructor;
|
|
5
|
+
export declare class EditorMarkdownSerializerState extends SerializerState {
|
|
6
|
+
private readonly markdownOptions;
|
|
7
|
+
constructor(nodes: MarkdownSerializer['nodes'], marks: MarkdownSerializer['marks'], options: MarkdownSerializer['options'] & MarkdownSerializerStateOptions, markdownOptions: NormalizedMarkdownOptions);
|
|
8
|
+
esc(line: string, startOfLine?: boolean): string;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditorMarkdownSerializerState = void 0;
|
|
4
|
+
const prosemirror_markdown_1 = require("prosemirror-markdown");
|
|
5
|
+
const escape_1 = require("./escape");
|
|
6
|
+
const SerializerState = prosemirror_markdown_1.MarkdownSerializerState;
|
|
7
|
+
class EditorMarkdownSerializerState extends SerializerState {
|
|
8
|
+
constructor(nodes, marks, options, markdownOptions) {
|
|
9
|
+
super(nodes, marks, options);
|
|
10
|
+
this.markdownOptions = markdownOptions;
|
|
11
|
+
}
|
|
12
|
+
esc(line, startOfLine = false) {
|
|
13
|
+
return startOfLine ? (0, escape_1.escapeLineStart)(line, this.markdownOptions) : line;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.EditorMarkdownSerializerState = EditorMarkdownSerializerState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMarkdownSerializer = createMarkdownSerializer;
|
|
4
|
+
const markdown_1 = require("../../../_utils/markdown");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const editor_serializer_1 = require("./editor-serializer");
|
|
7
|
+
function createMarkdownSerializer(options) {
|
|
8
|
+
return new editor_serializer_1.EditorMarkdownSerializer(constants_1.MARKDOWN_EDITOR_NODE_SERIALIZERS, constants_1.MARKDOWN_EDITOR_MARK_SERIALIZERS, { hardBreakNodeName: 'hardBreak' }, (0, markdown_1.normalizeOptions)(options));
|
|
9
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
const markdown_content_cssr_1 = require("../../../_styles/markdown/markdown-content.cssr");
|
|
7
|
+
const cssr_1 = require("../../../_utils/cssr");
|
|
8
|
+
// vars:
|
|
9
|
+
// --u-bezier
|
|
10
|
+
// --u-editor-background-color
|
|
11
|
+
// --u-editor-border-color
|
|
12
|
+
// --u-editor-border-radius
|
|
13
|
+
// --u-editor-toolbar-background-color
|
|
14
|
+
// --u-editor-toolbar-divider-color
|
|
15
|
+
// --u-editor-toolbar-button-color-active
|
|
16
|
+
// --u-editor-toolbar-button-color-hover
|
|
17
|
+
// --u-editor-toolbar-button-ripple-color
|
|
18
|
+
// --u-editor-toolbar-button-wave-opacity
|
|
19
|
+
// --u-editor-toolbar-icon-color-disabled
|
|
20
|
+
// --u-editor-toolbar-icon-color-active
|
|
21
|
+
// --u-editor-toolbar-icon-color-hover
|
|
22
|
+
// --u-editor-toolbar-icon-color
|
|
23
|
+
// --u-editor-content-background-color
|
|
24
|
+
// --u-editor-content-text-color
|
|
25
|
+
// --u-editor-placeholder-color
|
|
26
|
+
// --u-editor-send-button-color
|
|
27
|
+
// --u-editor-send-button-ripple-color
|
|
28
|
+
// --u-editor-send-button-wave-opacity
|
|
29
|
+
// --u-editor-block-type-menu-width
|
|
30
|
+
// --u-editor-block-type-menu-color
|
|
31
|
+
// --u-editor-block-type-menu-border-color
|
|
32
|
+
// --u-editor-block-type-menu-border-radius
|
|
33
|
+
// --u-editor-block-type-menu-box-shadow
|
|
34
|
+
// --u-editor-markdown-quote-border-color
|
|
35
|
+
// --u-editor-markdown-quote-text-color
|
|
36
|
+
// --u-editor-markdown-quote-background-color
|
|
37
|
+
// --u-editor-markdown-quote-marker-color
|
|
38
|
+
// --u-editor-markdown-divider-color
|
|
39
|
+
// --u-editor-markdown-h1-font-size
|
|
40
|
+
// --u-editor-markdown-h2-font-size
|
|
41
|
+
// --u-editor-markdown-h3-font-size
|
|
42
|
+
// --u-editor-markdown-text-font-size
|
|
43
|
+
// --u-editor-markdown-h1-line-height
|
|
44
|
+
// --u-editor-markdown-h2-line-height
|
|
45
|
+
// --u-editor-markdown-h3-line-height
|
|
46
|
+
// --u-editor-markdown-text-line-height
|
|
47
|
+
exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('editor', `
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
width: 100%;
|
|
52
|
+
background-color: var(--u-editor-background-color);
|
|
53
|
+
border-radius: 12px;
|
|
54
|
+
`, [(0, cssr_1.cE)('toolbar', `
|
|
55
|
+
padding: 8px 12px;
|
|
56
|
+
border-top-left-radius: 12px;
|
|
57
|
+
border-top-right-radius: 12px;
|
|
58
|
+
background-color: var(--u-editor-toolbar-background-color);
|
|
59
|
+
`, [(0, cssr_1.cM)('standalone', 'border-radius: var(--u-editor-border-radius);'), (0, cssr_1.cE)('toolbar-divider', `
|
|
60
|
+
font-size: 24px;
|
|
61
|
+
margin: 0;
|
|
62
|
+
`), (0, cssr_1.cE)('toolbar-block-type', `
|
|
63
|
+
width: 71px;
|
|
64
|
+
`)]), (0, cssr_1.cE)('content-wrapper', `
|
|
65
|
+
position: relative;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 8px;
|
|
70
|
+
min-height: 40px;
|
|
71
|
+
padding: 6px 10px;
|
|
72
|
+
padding-right: 24px;
|
|
73
|
+
border: 2px solid var(--u-editor-border-color);
|
|
74
|
+
border-bottom-left-radius: 12px;
|
|
75
|
+
border-bottom-right-radius: 12px;
|
|
76
|
+
`, [(0, cssr_1.cM)('standalone', 'border-radius: var(--u-editor-border-radius);'), (0, cssr_1.cE)('content-scroller', `
|
|
77
|
+
flex: 1;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
height: auto;
|
|
80
|
+
`), (0, cssr_1.cE)('send-button', `
|
|
81
|
+
position: absolute;
|
|
82
|
+
align-items: flex-start;
|
|
83
|
+
right: 6px;
|
|
84
|
+
top: 6px;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
`)]), (0, cssr_1.cE)('content', `
|
|
87
|
+
white-space: normal;
|
|
88
|
+
width: 100%;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
background-color: var(--u-editor-content-background-color);
|
|
91
|
+
color: var(--u-editor-content-text-color);
|
|
92
|
+
font-size: var(--u-editor-markdown-text-font-size);
|
|
93
|
+
line-height: var(--u-editor-markdown-text-line-height);
|
|
94
|
+
word-wrap: break-word;
|
|
95
|
+
`, [(0, cssr_1.cM)('scrollable', `
|
|
96
|
+
overflow-y: auto;
|
|
97
|
+
scrollbar-width: none;
|
|
98
|
+
`, [(0, cssr_1.c)('&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb', `
|
|
99
|
+
width: 0;
|
|
100
|
+
height: 0;
|
|
101
|
+
display: none;
|
|
102
|
+
`)]), (0, cssr_1.cE)('editable', 'outline: none;', [(0, cssr_1.c)('.is-editor-empty:first-child::before', `
|
|
103
|
+
content: attr(data-placeholder);
|
|
104
|
+
float: left;
|
|
105
|
+
height: 0;
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
color: var(--u-editor-placeholder-color);
|
|
108
|
+
`)]), ...(0, markdown_content_cssr_1.markdownContentStyle)({
|
|
109
|
+
cssVarPrefix: '--u-editor-markdown'
|
|
110
|
+
})])]), (0, cssr_1.cB)('editor-block-type-menu', `
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
width: var(--u-editor-block-type-menu-width);
|
|
113
|
+
height: auto;
|
|
114
|
+
max-height: none;
|
|
115
|
+
padding: 8px;
|
|
116
|
+
background-color: var(--u-editor-block-type-menu-color);
|
|
117
|
+
border: 1px solid var(--u-editor-block-type-menu-border-color);
|
|
118
|
+
border-radius: var(--u-editor-block-type-menu-border-radius);
|
|
119
|
+
box-shadow: var(--u-editor-block-type-menu-box-shadow);
|
|
120
|
+
`, [(0, cssr_1.cB)('editor-block-type-option', `
|
|
121
|
+
min-height: unset;
|
|
122
|
+
padding: 12px 16px;
|
|
123
|
+
border-radius: 12px;
|
|
124
|
+
`, [(0, cssr_1.cM)('heading1', `
|
|
125
|
+
font-size: var(--u-editor-markdown-h1-font-size);
|
|
126
|
+
line-height: var(--u-editor-markdown-h1-line-height);
|
|
127
|
+
`), (0, cssr_1.cM)('heading2', `
|
|
128
|
+
font-size: var(--u-editor-markdown-h2-font-size);
|
|
129
|
+
line-height: var(--u-editor-markdown-h2-line-height);
|
|
130
|
+
`), (0, cssr_1.cM)('heading3', `
|
|
131
|
+
font-size: var(--u-editor-markdown-h3-font-size);
|
|
132
|
+
line-height: var(--u-editor-markdown-h3-line-height);
|
|
133
|
+
`), (0, cssr_1.cM)('paragraph', `
|
|
134
|
+
font-size: var(--u-editor-markdown-text-font-size);
|
|
135
|
+
line-height: var(--u-editor-markdown-text-line-height);
|
|
136
|
+
`)])])]);
|