@collabchron/notiq 1.1.9 → 1.1.11
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 +281 -259
- package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +12 -0
- package/dist/AIDialog-2WZUFWSC.mjs +325 -0
- package/dist/AudioComponent-CKLMLB5T.mjs +278 -0
- package/dist/CodeActionMenuPlugin-MRKY67ED.mjs +14 -0
- package/dist/CollaborationPlugin-TIZOQBUT.mjs +405 -0
- package/dist/CollaboratorsBar-TMKBOBJI.mjs +20 -0
- package/dist/CommentsPlugin-5M4RD6YO.mjs +19 -0
- package/dist/DynamicBlockComponent-2LOADZUX.mjs +221 -0
- package/dist/{EquationComponent-CB6DFIHV.mjs → EquationComponent-4NFG55NQ.mjs} +82 -46
- package/dist/ExcalidrawComponent-SIMURTCA.mjs +662 -0
- package/dist/ExcalidrawPlugin-2SGPIQ6U.mjs +14 -0
- package/dist/ExportPlugin-OKZOLBGS.mjs +42 -0
- package/dist/FileComponent-Y56MX5QD.mjs +200 -0
- package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +12 -0
- package/dist/FloatingTextFormatToolbarPlugin-SO5VON7Q.mjs +45 -0
- package/dist/HintComponet-ET7M2Q7S.mjs +288 -0
- package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +360 -0
- package/dist/{InlineImageComponent-UWIUWBHI.mjs → InlineImageComponent-FVTA4LXZ.mjs} +129 -99
- package/dist/MobileToolbar-JKP2MLQJ.mjs +984 -0
- package/dist/SlashCommand-2TNOOUBM.mjs +39 -0
- package/dist/StoryBuilderComponent-WQSNFPMM.mjs +816 -0
- package/dist/{TableCellActionMenuPlugin-PGK2K3VG.mjs → TableCellActionMenuPlugin-YWBA64J7.mjs} +328 -157
- package/dist/{TableHoverActionsPlugin-GJVE6VRW.mjs → TableHoverActionsPlugin-2EIXHEXN.mjs} +43 -36
- package/dist/{TemplatePlugin-ZD3QEVTI.mjs → TemplatePlugin-HNTPEXBB.mjs} +2 -2
- package/dist/ToolbarPlugin-IIAOU4P5.mjs +35 -0
- package/dist/VersionHistoryPlugin-23MAZB4G.mjs +371 -0
- package/dist/babel-RJXDAKDM.mjs +7287 -0
- package/dist/background-color-OZJCBYCT.mjs +425 -0
- package/dist/block-format-MTSIXWID.mjs +14 -0
- package/dist/chunk-2KESP7OU.mjs +809 -0
- package/dist/chunk-3AHNLIME.mjs +1701 -0
- package/dist/{chunk-GK35L7UY.mjs → chunk-3IILA3IP.mjs} +1 -1
- package/dist/chunk-3JN6QEJR.mjs +31 -0
- package/dist/{chunk-5BAKY5KN.mjs → chunk-43Z4Z2KD.mjs} +5 -8
- package/dist/{chunk-GXYD4VZM.mjs → chunk-4DVIYZVB.mjs} +1 -1
- package/dist/{chunk-7NZAPJ4G.mjs → chunk-4FFTOZGJ.mjs} +4 -3
- package/dist/chunk-4UMUPCDK.mjs +68 -0
- package/dist/{chunk-POGRR73N.mjs → chunk-5NRAXWYA.mjs} +4 -3
- package/dist/{chunk-PZSUSXQG.mjs → chunk-6D6QLRYR.mjs} +2 -2
- package/dist/chunk-6SRMKQSD.mjs +682 -0
- package/dist/{chunk-3CPBODXA.mjs → chunk-6UVNHT3T.mjs} +7 -27
- package/dist/{chunk-G53GLEAY.mjs → chunk-7QRJVZQY.mjs} +47 -22
- package/dist/chunk-ACV47ZKE.mjs +201 -0
- package/dist/{chunk-FSM26655.mjs → chunk-AMXRQ2TK.mjs} +4 -4
- package/dist/chunk-AYNKORDO.mjs +6 -0
- package/dist/{chunk-YUDCJRJM.mjs → chunk-BGV62GC2.mjs} +3 -2
- package/dist/{chunk-TCYK7DM7.mjs → chunk-CDAMHK63.mjs} +4 -3
- package/dist/{chunk-QHIQKMVN.mjs → chunk-D3IOUQFR.mjs} +125 -111
- package/dist/chunk-EEBA6OAH.mjs +59 -0
- package/dist/{chunk-YKC3SO4Z.mjs → chunk-EIZMKFHF.mjs} +1 -1
- package/dist/{chunk-4EXYCTGJ.mjs → chunk-EVPWKNE4.mjs} +3 -3
- package/dist/{chunk-K36V4SIW.mjs → chunk-FMJ7DGWP.mjs} +23 -20
- package/dist/{chunk-RBWZGXPF.mjs → chunk-FYLRS4BG.mjs} +5 -5
- package/dist/{chunk-N3WN46VL.mjs → chunk-GYYLZ3MQ.mjs} +23 -22
- package/dist/{chunk-WDG7J2DY.mjs → chunk-H3P47YXJ.mjs} +30 -19
- package/dist/chunk-HOZ4QRFV.mjs +536 -0
- package/dist/{chunk-5QSNIVIG.mjs → chunk-IAFCQV3Z.mjs} +94 -78
- package/dist/{chunk-64Z3FI7T.mjs → chunk-IIVB6JNE.mjs} +5 -4
- package/dist/chunk-IU2N42JJ.mjs +1763 -0
- package/dist/chunk-IUOUIDEQ.mjs +70 -0
- package/dist/chunk-J6ZUY5BY.mjs +202 -0
- package/dist/{chunk-YHPNOWFH.mjs → chunk-JHXDLYEV.mjs} +1 -1
- package/dist/{chunk-ZB5LZQKC.mjs → chunk-K5OAFEVY.mjs} +1 -1
- package/dist/chunk-KDA7ZYMJ.mjs +431 -0
- package/dist/{chunk-3JVFG7ER.mjs → chunk-KNW2CGIP.mjs} +7 -64
- package/dist/{chunk-4HBCVSE6.mjs → chunk-KXRLARGI.mjs} +1 -1
- package/dist/chunk-LAUAYRPC.mjs +944 -0
- package/dist/chunk-LLCP7NVE.mjs +449 -0
- package/dist/chunk-LU2XWLOE.mjs +219 -0
- package/dist/chunk-MPTE332I.mjs +787 -0
- package/dist/{chunk-456TN7IM.mjs → chunk-MTQZWJHR.mjs} +17 -16
- package/dist/{chunk-LGG4IUIA.mjs → chunk-MW6MAUY3.mjs} +2 -2
- package/dist/chunk-N3WTT2U6.mjs +21 -0
- package/dist/{chunk-GZPNVR7L.mjs → chunk-N6ILV6NF.mjs} +7 -6
- package/dist/{chunk-QEIFVK5M.mjs → chunk-NBE6FF6L.mjs} +4 -4
- package/dist/{chunk-BIU7WTLX.mjs → chunk-OE5JRLCN.mjs} +21 -18
- package/dist/chunk-OXWTZV3U.mjs +174 -0
- package/dist/{chunk-Z4EWP7BI.mjs → chunk-PD5K4AGP.mjs} +22 -23
- package/dist/chunk-PFH63ZU4.mjs +33 -0
- package/dist/chunk-PHRVYPVM.mjs +808 -0
- package/dist/chunk-R7WFRENU.mjs +262 -0
- package/dist/{chunk-4VWFVWYP.mjs → chunk-RAVYEEIC.mjs} +1 -1
- package/dist/chunk-RJQTA6HG.mjs +358 -0
- package/dist/{chunk-7VUMHWWL.mjs → chunk-SAOJHVPE.mjs} +5 -4
- package/dist/chunk-TC3IISJZ.mjs +408 -0
- package/dist/chunk-VGAX6YEY.mjs +399 -0
- package/dist/chunk-W6GAJXUS.mjs +334 -0
- package/dist/{chunk-U47ABU5Z.mjs → chunk-W6VQSFE5.mjs} +2 -2
- package/dist/chunk-WYCFGRFJ.mjs +118 -0
- package/dist/chunk-XAVQAXOJ.mjs +419 -0
- package/dist/chunk-XYDBUQ6Z.mjs +1978 -0
- package/dist/chunk-XYMXGU4T.mjs +129 -0
- package/dist/chunk-XYT6XM5S.mjs +496 -0
- package/dist/{chunk-HJPPNHYM.mjs → chunk-XZXGYNTY.mjs} +4 -3
- package/dist/{chunk-4GFXER7R.mjs → chunk-YDDBQZ77.mjs} +141 -89
- package/dist/{chunk-2FNEAMSP.mjs → chunk-YE7M2VKR.mjs} +52 -47
- package/dist/{chunk-3G37YKTV.mjs → chunk-YR2DD74C.mjs} +9 -8
- package/dist/{chunk-4MEDW3T6.mjs → chunk-YTLUQJE2.mjs} +5 -4
- package/dist/{chunk-DSFQHA7I.mjs → chunk-Z6JAFF55.mjs} +118 -295
- package/dist/chunk-ZFV2HGD3.mjs +143 -0
- package/dist/{chunk-77UA6HYR.mjs → chunk-ZKZ7MLSS.mjs} +1 -1
- package/dist/color-23323E3B.mjs +13 -0
- package/dist/components/canvas/CanvasMode.d.ts +18 -0
- package/dist/components/editor/Core.d.ts +6 -0
- package/dist/components/editor/index.d.ts +27 -0
- package/dist/components/editor/lexical-on-change.d.ts +1 -0
- package/dist/components/editor/nodes/AudioNode/AudioComponent.d.ts +15 -0
- package/dist/components/editor/nodes/AudioNode/index.d.ts +36 -0
- package/dist/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.d.ts +22 -0
- package/dist/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.d.ts +18 -0
- package/dist/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.d.ts +19 -0
- package/dist/components/editor/nodes/DynamicBlockNode/DynamicBlockComponent.d.ts +7 -0
- package/dist/components/editor/nodes/DynamicBlockNode/DynamicBlockNode.d.ts +49 -0
- package/dist/components/editor/nodes/EquationNode/EquationComponent.d.ts +16 -0
- package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +33 -0
- package/dist/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +15 -0
- package/dist/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +57 -0
- package/dist/components/editor/nodes/ExcalidrawNode/ImageResizer.d.ts +24 -0
- package/dist/components/editor/nodes/ExcalidrawNode/index.d.ts +39 -0
- package/dist/components/editor/nodes/FigmaNode/FigmaNode.d.ts +27 -0
- package/dist/components/editor/nodes/FileNode/FileComponent.d.ts +16 -0
- package/dist/components/editor/nodes/FileNode/index.d.ts +39 -0
- package/dist/components/editor/nodes/Hint/HintComponet.d.ts +20 -0
- package/dist/components/editor/nodes/Hint/index.d.ts +33 -0
- package/dist/components/editor/nodes/ImageNode/index.d.ts +62 -0
- package/dist/components/editor/nodes/InlineImageNode/InlineImageComponent.d.ts +25 -0
- package/dist/components/editor/nodes/InlineImageNode/InlineImageNode.d.ts +66 -0
- package/dist/components/editor/nodes/LayoutNode/LayoutContainerNode.d.ts +31 -0
- package/dist/components/editor/nodes/LayoutNode/LayoutItemNode.d.ts +21 -0
- package/dist/components/editor/nodes/PollNode/index.d.ts +34 -0
- package/dist/components/editor/nodes/Stepper/index.d.ts +66 -0
- package/dist/components/editor/nodes/StoryBuilderNode/StoryBuilderComponent.d.ts +10 -0
- package/dist/components/editor/nodes/StoryBuilderNode/StoryBuilderNode.d.ts +59 -0
- package/dist/components/editor/nodes/TweetNode/index.d.ts +21 -0
- package/dist/components/editor/nodes/index.d.ts +4 -0
- package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +7 -0
- package/dist/components/editor/plugins/AudioPlugin/index.d.ts +1 -0
- package/dist/components/editor/plugins/AutoEmbedPlugin/index.d.ts +19 -0
- package/dist/components/editor/plugins/AutoLinkPlugin/index.d.ts +1 -0
- package/dist/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.d.ts +8 -0
- package/dist/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.d.ts +9 -0
- package/dist/components/editor/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
- package/dist/components/editor/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
- package/dist/components/editor/plugins/CodeHighlightPlugin/index.d.ts +11 -0
- package/dist/components/editor/plugins/CollaborationPlugin/CollaboratorsBar.d.ts +9 -0
- package/dist/components/editor/plugins/CollaborationPlugin/index.d.ts +8 -0
- package/dist/components/editor/plugins/CollapsiblePlugin/index.d.ts +4 -0
- package/dist/components/editor/plugins/CommentsPlugin/CommentThreadItem.d.ts +7 -0
- package/dist/components/editor/plugins/CommentsPlugin/CommentsSidebar.d.ts +2 -0
- package/dist/components/editor/plugins/CommentsPlugin/MentionsAutocomplete.d.ts +22 -0
- package/dist/components/editor/plugins/CommentsPlugin/NewCommentDialog.d.ts +2 -0
- package/dist/components/editor/plugins/CommentsPlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/ContentAnalyticsPlugin/index.d.ts +1 -0
- package/dist/components/editor/plugins/DragDropPastePlugin/index.d.ts +1 -0
- package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/DynamicBlockPlugin/index.d.ts +7 -0
- package/dist/components/editor/plugins/EquationsPlugin/index.d.ts +20 -0
- package/dist/components/editor/plugins/ExcalidrawPlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/ExportPlugin/ImportExportModal.d.ts +9 -0
- package/dist/components/editor/plugins/ExportPlugin/index.d.ts +28 -0
- package/dist/components/editor/plugins/FigmaPlugin/index.d.ts +11 -0
- package/dist/components/editor/plugins/FilePlugin/index.d.ts +1 -0
- package/dist/components/editor/plugins/FloatingLinkEditorPlugin/index.d.ts +6 -0
- package/dist/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +6 -0
- package/dist/components/editor/plugins/ImagesPlugin/index.d.ts +14 -0
- package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +32 -0
- package/dist/components/editor/plugins/InlineImagePlugin/index.d.ts +16 -0
- package/dist/components/editor/plugins/LayoutPlugin/index.d.ts +14 -0
- package/dist/components/editor/plugins/LinkPlugin/index.d.ts +13 -0
- package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +46 -0
- package/dist/components/editor/plugins/MarkdownShortcutPlugin/index.d.ts +2 -0
- package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +12 -0
- package/dist/components/editor/plugins/PollPlugin/index.d.ts +4 -0
- package/dist/components/editor/plugins/ShortcutsPlugin/index.d.ts +13 -0
- package/dist/components/editor/plugins/ShortcutsPlugin/shortcuts.d.ts +58 -0
- package/dist/components/editor/plugins/SlashCommand/index.d.ts +25 -0
- package/dist/components/editor/plugins/SpeechToTextPlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/StoryBuilderPlugin/index.d.ts +7 -0
- package/dist/components/editor/plugins/TabFocusPlugin/index.d.ts +1 -0
- package/dist/components/editor/plugins/TableCellActionMenuPlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/TableCellResizer/index.d.ts +2 -0
- package/dist/components/editor/plugins/TableHoverActionsPlugin/index.d.ts +4 -0
- package/dist/components/editor/plugins/TablePlugin/index.d.ts +27 -0
- package/dist/components/editor/plugins/TemplatePlugin/TemplateDialog.d.ts +1 -0
- package/dist/components/editor/plugins/TemplatePlugin/index.d.ts +3 -0
- package/dist/components/editor/plugins/ToolbarPlugin/MobileToolbar.d.ts +10 -0
- package/dist/components/editor/plugins/ToolbarPlugin/index.d.ts +11 -0
- package/dist/components/editor/plugins/TwitterPlugin/index.d.ts +4 -0
- package/dist/components/editor/plugins/VersionHistoryPlugin/NameVersionModal.d.ts +2 -0
- package/dist/components/editor/plugins/VersionHistoryPlugin/VersionHistoryDrawer.d.ts +2 -0
- package/dist/components/editor/plugins/VersionHistoryPlugin/index.d.ts +2 -0
- package/dist/components/editor/plugins/YouTubeNode/index.d.ts +22 -0
- package/dist/components/editor/plugins/YouTubePlugin/index.d.ts +11 -0
- package/dist/components/editor/templates/data.d.ts +7 -0
- package/dist/components/editor/themes/editor-theme.d.ts +3 -0
- package/dist/components/editor/utils/ai.d.ts +27 -0
- package/dist/components/editor/utils/canUseDOM.d.ts +8 -0
- package/dist/components/editor/utils/codeLanguages.d.ts +3 -0
- package/dist/components/editor/utils/diffUtils.d.ts +10 -0
- package/dist/components/editor/utils/editorFormatting.d.ts +26 -0
- package/dist/components/editor/utils/environment.d.ts +17 -0
- package/dist/components/editor/utils/extract-data.d.ts +8 -0
- package/dist/components/editor/utils/getAllLexicalChildren.d.ts +6 -0
- package/dist/components/editor/utils/getDOMRangeRect.d.ts +8 -0
- package/dist/components/editor/utils/getSelectedNode.d.ts +2 -0
- package/dist/components/editor/utils/gif.d.ts +7 -0
- package/dist/components/editor/utils/importUtils.d.ts +27 -0
- package/dist/components/editor/utils/invariant.d.ts +1 -0
- package/dist/components/editor/utils/markdownTransformers.d.ts +20 -0
- package/dist/components/editor/utils/setFloatingElemPosition.d.ts +1 -0
- package/dist/components/editor/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/dist/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.d.ts +2 -0
- package/dist/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.d.ts +2 -0
- package/dist/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.d.ts +5 -0
- package/dist/components/editor/utils/url.d.ts +11 -0
- package/dist/components/editor/utils/useLayoutEffect.d.ts +3 -0
- package/dist/components/providers/AIContext.d.ts +21 -0
- package/dist/components/providers/CollabContext.d.ts +92 -0
- package/dist/components/providers/CommentsContext.d.ts +48 -0
- package/dist/components/providers/QueryProvider.d.ts +5 -0
- package/dist/components/providers/SharedHistoryContext.d.ts +11 -0
- package/dist/components/providers/ToolbarContext.d.ts +61 -0
- package/dist/components/providers/UploadContext.d.ts +29 -0
- package/dist/components/providers/VersionHistoryContext.d.ts +33 -0
- package/dist/components/providers/theme-provider.d.ts +3 -0
- package/dist/components/theme/ModeToggle.d.ts +2 -0
- package/dist/components/ui/ContentEditable.d.ts +15 -0
- package/dist/components/ui/FileInput.d.ts +16 -0
- package/dist/components/ui/Modal.d.ts +15 -0
- package/dist/components/ui/Select.d.ts +14 -0
- package/dist/components/ui/TextInput.d.ts +19 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/ai/AIDialog.d.ts +9 -0
- package/dist/components/ui/ai/ai-button.d.ts +5 -0
- package/dist/components/ui/ai/border.d.ts +8 -0
- package/dist/components/ui/ai/placeholder-input-vanish.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/command.d.ts +80 -0
- package/dist/components/ui/dialog/Dialog.d.ts +16 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/drop-downs/background-color.d.ts +12 -0
- package/dist/components/ui/drop-downs/block-format.d.ts +25 -0
- package/dist/components/ui/drop-downs/code.d.ts +6 -0
- package/dist/components/ui/drop-downs/codeTheme.d.ts +8 -0
- package/dist/components/ui/drop-downs/color.d.ts +12 -0
- package/dist/components/ui/drop-downs/font-size.d.ts +10 -0
- package/dist/components/ui/drop-downs/font.d.ts +11 -0
- package/dist/components/ui/drop-downs/index.d.ts +24 -0
- package/dist/components/ui/drop-downs/insert-node.d.ts +6 -0
- package/dist/components/ui/drop-downs/table-dropdown.d.ts +10 -0
- package/dist/components/ui/drop-downs/text-align.d.ts +8 -0
- package/dist/components/ui/drop-downs/text-format.d.ts +11 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/equation/EquationEditor.d.ts +14 -0
- package/dist/components/ui/equation/KatexEquationAlterer.d.ts +14 -0
- package/dist/components/ui/equation/KatexRenderer.d.ts +13 -0
- package/dist/components/ui/excalidraw/ExcalidrawModal.d.ts +48 -0
- package/dist/components/ui/excalidraw/Modal.d.ts +16 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/icons/brand-icons.d.ts +5 -0
- package/dist/components/ui/image/error-image.d.ts +2 -0
- package/dist/components/ui/image/file-upload.d.ts +8 -0
- package/dist/components/ui/image/image-resizer.d.ts +10 -0
- package/dist/components/ui/image/image-toolbar.d.ts +8 -0
- package/dist/components/ui/image/index.d.ts +16 -0
- package/dist/components/ui/image/lazy-image.d.ts +10 -0
- package/dist/components/ui/image/lazy-video.d.ts +11 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/models/custom-dialog.d.ts +58 -0
- package/dist/components/ui/models/insert-audio.d.ts +7 -0
- package/dist/components/ui/models/insert-file.d.ts +7 -0
- package/dist/components/ui/models/insert-gif.d.ts +7 -0
- package/dist/components/ui/models/insert-image.d.ts +6 -0
- package/dist/components/ui/models/insert-poll.d.ts +5 -0
- package/dist/components/ui/models/insert-table.d.ts +6 -0
- package/dist/components/ui/models/use-model.d.ts +6 -0
- package/dist/components/ui/poll/poll-component.d.ts +8 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/stepper/step.d.ts +11 -0
- package/dist/components/ui/stepper/stepper.d.ts +6 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle.d.ts +14 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/write/text-format-floating.d.ts +27 -0
- package/dist/components/ui/write/text-format-floting-toolbar.d.ts +26 -0
- package/dist/core/chain.d.ts +4 -0
- package/dist/core/editor.d.ts +42 -0
- package/dist/core/extension.d.ts +20 -0
- package/dist/core/extensions/blocks-kit.d.ts +14 -0
- package/dist/core/extensions/copilot-and-collab.d.ts +10 -0
- package/dist/core/extensions/nodes-and-marks.d.ts +36 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/react/BubbleMenu.d.ts +13 -0
- package/dist/core/react/FloatingMenu.d.ts +12 -0
- package/dist/core/react/NotiqContent.d.ts +11 -0
- package/dist/core/react/NotiqEditor.d.ts +29 -0
- package/dist/core/react/context.d.ts +15 -0
- package/dist/core/react/index.d.ts +8 -0
- package/dist/core/react/useNotiq.d.ts +16 -0
- package/dist/core/types.d.ts +88 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.js +67719 -0
- package/dist/core.mjs +132 -0
- package/dist/estree-QRALCFII.mjs +5029 -0
- package/dist/font-IJKFR4BM.mjs +12 -0
- package/dist/font-size-GTL6UVQL.mjs +15 -0
- package/dist/hooks/instructions-messages.d.ts +11 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/useModal.d.ts +12 -0
- package/dist/hooks/useReport.d.ts +8 -0
- package/dist/hooks/useResizeObservert.d.ts +1 -0
- package/dist/html-CE2S5FIJ.mjs +3185 -0
- package/dist/{image-2PJIAYAT.mjs → image-TPW7PZZK.mjs} +360 -325
- package/dist/index.d.ts +13 -145
- package/dist/index.js +61780 -44629
- package/dist/index.mjs +1157 -736
- package/dist/insert-audio-C66RZRKY.mjs +180 -0
- package/dist/insert-file-3DTGRO7W.mjs +190 -0
- package/dist/insert-gif-FIMCCBAI.mjs +112 -0
- package/dist/insert-image-CZV6HWQZ.mjs +348 -0
- package/dist/insert-node-MA3FXEYN.mjs +245 -0
- package/dist/insert-poll-6BCIFY5G.mjs +36 -0
- package/dist/insert-table-ZRJP6X52.mjs +70 -0
- package/dist/lib/edgestore.d.ts +2 -0
- package/dist/lib/index.d.ts +0 -0
- package/dist/lib/pinecone-client.d.ts +3 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/markdown-GMCB4RDA.mjs +6753 -0
- package/dist/{poll-component-2R4MDLHS.mjs → poll-component-VHMM5KKZ.mjs} +126 -95
- package/dist/{postcss-ONF3VDIM.mjs → postcss-GH4QXSB5.mjs} +1879 -1697
- package/dist/react.d.ts +1 -0
- package/dist/react.js +67651 -0
- package/dist/react.mjs +61 -0
- package/dist/standalone-A6VDOPCZ.mjs +2506 -0
- package/dist/stepper-4AO5XMO7.mjs +356 -0
- package/dist/styles/notiq.css +2 -2
- package/dist/styles/tailwind-plugin.d.ts +4 -0
- package/dist/table-dropdown-4VCRSQB6.mjs +391 -0
- package/dist/{text-align-VLECWO4H.mjs → text-align-CSDLJUDA.mjs} +24 -21
- package/dist/text-format-6L5N3CHZ.mjs +15 -0
- package/dist/typescript-CGC67LRI.mjs +13392 -0
- package/dist/utils/docSerialization.d.ts +10 -0
- package/dist/utils/emoji-list.d.ts +27 -0
- package/dist/utils/getDOMRangeRect.d.ts +8 -0
- package/dist/utils/getSelectedNode.d.ts +2 -0
- package/dist/utils/getThemeSelector.d.ts +9 -0
- package/dist/utils/html.d.ts +9 -0
- package/dist/utils/htmlExport.d.ts +9 -0
- package/dist/utils/isMobileWidth.d.ts +7 -0
- package/dist/utils/joinClasses.d.ts +8 -0
- package/dist/utils/setFloatingElemPosition.d.ts +1 -0
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/dist/utils/swipe.d.ts +11 -0
- package/dist/utils/url.d.ts +9 -0
- package/package.json +128 -105
- package/src/styles/notiq.css +1315 -1057
- package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +0 -15
- package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +0 -161
- package/dist/ExcalidrawComponent-LUZJNFWV.mjs +0 -528
- package/dist/ExcalidrawPlugin-HC2L43YG.mjs +0 -14
- package/dist/ExportPlugin-V2RLM63S.mjs +0 -11
- package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +0 -12
- package/dist/FloatingTextFormatToolbarPlugin-ENECEZSX.mjs +0 -30
- package/dist/HintComponet-BRL6EAMS.mjs +0 -217
- package/dist/MobileToolbar-BOOZAMQE.mjs +0 -268
- package/dist/SlashCommand-FHEWHFZU.mjs +0 -28
- package/dist/StoryBuilderComponent-JGDBM5JU.mjs +0 -562
- package/dist/ToolbarPlugin-2VP7FDWD.mjs +0 -1547
- package/dist/babel-JZ2EV6AX.mjs +0 -7233
- package/dist/background-color-XZTYLGO2.mjs +0 -362
- package/dist/block-format-YJCV2DIY.mjs +0 -15
- package/dist/chunk-77KXU36M.mjs +0 -64
- package/dist/chunk-AMMKBSST.mjs +0 -1256
- package/dist/chunk-EGMI62PP.mjs +0 -83
- package/dist/chunk-JXDPPUJI.mjs +0 -52
- package/dist/chunk-KJ6AJ44Q.mjs +0 -128
- package/dist/chunk-NOJDE3CE.mjs +0 -1906
- package/dist/chunk-NZXC6FGU.mjs +0 -214
- package/dist/chunk-PBD6LMLC.mjs +0 -366
- package/dist/chunk-TTHQCW5F.mjs +0 -47
- package/dist/chunk-V2NIZOSQ.mjs +0 -538
- package/dist/chunk-WAK5JGNJ.mjs +0 -315
- package/dist/chunk-YMBXLRW5.mjs +0 -374
- package/dist/chunk-YPHOEJ46.mjs +0 -64
- package/dist/chunk-ZJRKATOJ.mjs +0 -65
- package/dist/color-BPKOPQKN.mjs +0 -12
- package/dist/estree-XC56IUFX.mjs +0 -4414
- package/dist/font-FEZ3GKSF.mjs +0 -13
- package/dist/font-size-EK775WRH.mjs +0 -15
- package/dist/html-S3ACX7NI.mjs +0 -2738
- package/dist/index.d.mts +0 -145
- package/dist/insert-gif-SAIDYURE.mjs +0 -100
- package/dist/insert-image-U3RJN3OW.mjs +0 -259
- package/dist/insert-node-WXW4ZER4.mjs +0 -201
- package/dist/insert-poll-HCPM7MO6.mjs +0 -33
- package/dist/insert-table-24XYUS2W.mjs +0 -66
- package/dist/markdown-SNVBOSRA.mjs +0 -3487
- package/dist/standalone-EOIALU3M.mjs +0 -2373
- package/dist/stepper-JDEE26TX.mjs +0 -304
- package/dist/text-format-BG5WOOPZ.mjs +0 -16
- package/dist/typescript-AMPI6OVS.mjs +0 -13135
|
@@ -0,0 +1,984 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
INSERT_EXCALIDRAW_COMMAND
|
|
4
|
+
} from "./chunk-FYLRS4BG.mjs";
|
|
5
|
+
import {
|
|
6
|
+
INSERT_COMMENT_COMMAND
|
|
7
|
+
} from "./chunk-LAUAYRPC.mjs";
|
|
8
|
+
import "./chunk-3JN6QEJR.mjs";
|
|
9
|
+
import {
|
|
10
|
+
AutoEmbedDialog,
|
|
11
|
+
Youtube,
|
|
12
|
+
YoutubeEmbedConfig
|
|
13
|
+
} from "./chunk-LLCP7NVE.mjs";
|
|
14
|
+
import {
|
|
15
|
+
useModal
|
|
16
|
+
} from "./chunk-IAFCQV3Z.mjs";
|
|
17
|
+
import "./chunk-OXWTZV3U.mjs";
|
|
18
|
+
import {
|
|
19
|
+
SPEECH_TO_TEXT_COMMAND,
|
|
20
|
+
SUPPORT_SPEECH_RECOGNITION
|
|
21
|
+
} from "./chunk-ZKZ7MLSS.mjs";
|
|
22
|
+
import {
|
|
23
|
+
INSERT_LAYOUT_COMMAND
|
|
24
|
+
} from "./chunk-W6GAJXUS.mjs";
|
|
25
|
+
import "./chunk-VGAX6YEY.mjs";
|
|
26
|
+
import "./chunk-R7WFRENU.mjs";
|
|
27
|
+
import "./chunk-RJQTA6HG.mjs";
|
|
28
|
+
import "./chunk-6UVNHT3T.mjs";
|
|
29
|
+
import "./chunk-5NRAXWYA.mjs";
|
|
30
|
+
import {
|
|
31
|
+
Skeleton
|
|
32
|
+
} from "./chunk-NBE6FF6L.mjs";
|
|
33
|
+
import {
|
|
34
|
+
sanitizeUrl
|
|
35
|
+
} from "./chunk-RAVYEEIC.mjs";
|
|
36
|
+
import "./chunk-TC3IISJZ.mjs";
|
|
37
|
+
import "./chunk-XZXGYNTY.mjs";
|
|
38
|
+
import "./chunk-H3P47YXJ.mjs";
|
|
39
|
+
import "./chunk-OE5JRLCN.mjs";
|
|
40
|
+
import {
|
|
41
|
+
INSERT_HINT_COMMAND
|
|
42
|
+
} from "./chunk-7QRJVZQY.mjs";
|
|
43
|
+
import {
|
|
44
|
+
cn
|
|
45
|
+
} from "./chunk-JHXDLYEV.mjs";
|
|
46
|
+
import {
|
|
47
|
+
init_react_shim
|
|
48
|
+
} from "./chunk-WYCFGRFJ.mjs";
|
|
49
|
+
|
|
50
|
+
// src/components/editor/plugins/ToolbarPlugin/MobileToolbar.tsx
|
|
51
|
+
init_react_shim();
|
|
52
|
+
import { useEffect, useState, useMemo, lazy, Suspense, useCallback, useRef } from "react";
|
|
53
|
+
import {
|
|
54
|
+
$getSelection,
|
|
55
|
+
$isRangeSelection,
|
|
56
|
+
FORMAT_TEXT_COMMAND,
|
|
57
|
+
FORMAT_ELEMENT_COMMAND,
|
|
58
|
+
REDO_COMMAND,
|
|
59
|
+
UNDO_COMMAND
|
|
60
|
+
} from "lexical";
|
|
61
|
+
import {
|
|
62
|
+
Bold,
|
|
63
|
+
Italic,
|
|
64
|
+
Underline,
|
|
65
|
+
Strikethrough,
|
|
66
|
+
Undo2,
|
|
67
|
+
Redo2,
|
|
68
|
+
Heading1,
|
|
69
|
+
Heading2,
|
|
70
|
+
Heading3,
|
|
71
|
+
Type,
|
|
72
|
+
List,
|
|
73
|
+
ListOrdered,
|
|
74
|
+
Link as LinkIcon,
|
|
75
|
+
Code,
|
|
76
|
+
Quote,
|
|
77
|
+
CheckSquare,
|
|
78
|
+
AlignLeft,
|
|
79
|
+
AlignCenter,
|
|
80
|
+
AlignRight,
|
|
81
|
+
Mic,
|
|
82
|
+
Plus,
|
|
83
|
+
Image,
|
|
84
|
+
FileAudio,
|
|
85
|
+
FileText,
|
|
86
|
+
Table,
|
|
87
|
+
SquarePenIcon,
|
|
88
|
+
DraftingCompassIcon,
|
|
89
|
+
AlertCircle,
|
|
90
|
+
FlipHorizontal2,
|
|
91
|
+
Columns2,
|
|
92
|
+
ChevronDown,
|
|
93
|
+
Palette,
|
|
94
|
+
Sparkles,
|
|
95
|
+
Eraser,
|
|
96
|
+
MessageSquarePlus,
|
|
97
|
+
ArrowDownUp
|
|
98
|
+
} from "lucide-react";
|
|
99
|
+
import { TOGGLE_LINK_COMMAND } from "@lexical/link";
|
|
100
|
+
import {
|
|
101
|
+
INSERT_ORDERED_LIST_COMMAND,
|
|
102
|
+
INSERT_UNORDERED_LIST_COMMAND,
|
|
103
|
+
INSERT_CHECK_LIST_COMMAND
|
|
104
|
+
} from "@lexical/list";
|
|
105
|
+
import { $createHeadingNode, $createQuoteNode } from "@lexical/rich-text";
|
|
106
|
+
import { $setBlocksType, $patchStyleText } from "@lexical/selection";
|
|
107
|
+
import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
|
|
108
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
109
|
+
var InsertImageDialog = lazy(
|
|
110
|
+
() => import("./insert-image-CZV6HWQZ.mjs").then((m) => ({ default: m.InsertImageDialog }))
|
|
111
|
+
);
|
|
112
|
+
var InsertAudioDialog = lazy(
|
|
113
|
+
() => import("./insert-audio-C66RZRKY.mjs").then((m) => ({ default: m.InsertAudioDialog }))
|
|
114
|
+
);
|
|
115
|
+
var InsertFileDialog = lazy(
|
|
116
|
+
() => import("./insert-file-3DTGRO7W.mjs").then((m) => ({ default: m.InsertFileDialog }))
|
|
117
|
+
);
|
|
118
|
+
var InsertTableBody = lazy(
|
|
119
|
+
() => import("./insert-table-ZRJP6X52.mjs").then((m) => ({ default: m.InsertTable }))
|
|
120
|
+
);
|
|
121
|
+
var InsertPoll = lazy(
|
|
122
|
+
() => import("./insert-poll-6BCIFY5G.mjs").then((m) => ({ default: m.InsertPoll }))
|
|
123
|
+
);
|
|
124
|
+
var TEXT_COLORS = [
|
|
125
|
+
{ label: "Default", color: "inherit", bg: "bg-foreground" },
|
|
126
|
+
{ label: "Blue", color: "#2563eb", bg: "bg-blue-600" },
|
|
127
|
+
{ label: "Purple", color: "#7c3aed", bg: "bg-purple-600" },
|
|
128
|
+
{ label: "Emerald", color: "#059669", bg: "bg-emerald-600" },
|
|
129
|
+
{ label: "Amber", color: "#d97706", bg: "bg-amber-600" },
|
|
130
|
+
{ label: "Rose", color: "#e11d48", bg: "bg-rose-600" }
|
|
131
|
+
];
|
|
132
|
+
var HIGHLIGHT_COLORS = [
|
|
133
|
+
{ label: "None", color: "transparent", border: "border-border" },
|
|
134
|
+
{ label: "Yellow", color: "#fef08a", bg: "bg-yellow-200" },
|
|
135
|
+
{ label: "Green", color: "#bbf7d0", bg: "bg-green-200" },
|
|
136
|
+
{ label: "Blue", color: "#bfdbfe", bg: "bg-blue-200" },
|
|
137
|
+
{ label: "Pink", color: "#fbcfe8", bg: "bg-pink-200" },
|
|
138
|
+
{ label: "Orange", color: "#fed7aa", bg: "bg-orange-200" }
|
|
139
|
+
];
|
|
140
|
+
function MobileToolbar({
|
|
141
|
+
editor,
|
|
142
|
+
activeEditor,
|
|
143
|
+
toolbarState,
|
|
144
|
+
setIsLinkEditMode,
|
|
145
|
+
isVisible,
|
|
146
|
+
toolbarConfig
|
|
147
|
+
}) {
|
|
148
|
+
const [activeTab, setActiveTab] = useState("format");
|
|
149
|
+
const [isKeyboardOpen, setIsKeyboardOpen] = useState(false);
|
|
150
|
+
const [bottomOffset, setBottomOffset] = useState(0);
|
|
151
|
+
const [isSpeechActive, setIsSpeechActive] = useState(false);
|
|
152
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
153
|
+
const [insertCategory, setInsertCategory] = useState("all");
|
|
154
|
+
const [modal, showModal] = useModal();
|
|
155
|
+
const targetEditor = activeEditor || editor;
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (isVisible || isKeyboardOpen) {
|
|
158
|
+
setIsExpanded(true);
|
|
159
|
+
}
|
|
160
|
+
}, [isVisible, isKeyboardOpen]);
|
|
161
|
+
const scrollContainerRef = useRef(null);
|
|
162
|
+
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
163
|
+
const [canScrollRight, setCanScrollRight] = useState(true);
|
|
164
|
+
const checkScrollAffordance = useCallback(() => {
|
|
165
|
+
const el = scrollContainerRef.current;
|
|
166
|
+
if (!el) return;
|
|
167
|
+
setCanScrollLeft(el.scrollLeft > 4);
|
|
168
|
+
setCanScrollRight(el.scrollLeft < el.scrollWidth - el.clientWidth - 4);
|
|
169
|
+
}, []);
|
|
170
|
+
useEffect(() => {
|
|
171
|
+
checkScrollAffordance();
|
|
172
|
+
}, [activeTab, checkScrollAffordance]);
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
const visualViewport = window.visualViewport;
|
|
175
|
+
if (!visualViewport) return;
|
|
176
|
+
const handleResize = () => {
|
|
177
|
+
const windowHeight = window.innerHeight;
|
|
178
|
+
const viewportHeight = visualViewport.height;
|
|
179
|
+
const offsetTop = visualViewport.offsetTop;
|
|
180
|
+
const viewportBottom = offsetTop + viewportHeight;
|
|
181
|
+
const diff = windowHeight - viewportBottom;
|
|
182
|
+
setBottomOffset(Math.max(0, Math.min(diff, windowHeight * 0.55)));
|
|
183
|
+
const keyboardIsOpen = viewportHeight < windowHeight * 0.82;
|
|
184
|
+
setIsKeyboardOpen(keyboardIsOpen);
|
|
185
|
+
if (keyboardIsOpen) {
|
|
186
|
+
setIsExpanded(true);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
visualViewport.addEventListener("resize", handleResize);
|
|
190
|
+
visualViewport.addEventListener("scroll", handleResize);
|
|
191
|
+
handleResize();
|
|
192
|
+
return () => {
|
|
193
|
+
visualViewport.removeEventListener("resize", handleResize);
|
|
194
|
+
visualViewport.removeEventListener("scroll", handleResize);
|
|
195
|
+
};
|
|
196
|
+
}, []);
|
|
197
|
+
const handleOpenDock = useCallback(
|
|
198
|
+
(e) => {
|
|
199
|
+
if (e) {
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
e.stopPropagation();
|
|
202
|
+
}
|
|
203
|
+
setIsExpanded(true);
|
|
204
|
+
try {
|
|
205
|
+
targetEditor.focus();
|
|
206
|
+
} catch (e2) {
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
[targetEditor]
|
|
210
|
+
);
|
|
211
|
+
const handleCloseDock = useCallback((e) => {
|
|
212
|
+
if (e) {
|
|
213
|
+
e.preventDefault();
|
|
214
|
+
e.stopPropagation();
|
|
215
|
+
}
|
|
216
|
+
setIsExpanded(false);
|
|
217
|
+
}, []);
|
|
218
|
+
const shouldShow = isExpanded;
|
|
219
|
+
const formatHeading = (level) => {
|
|
220
|
+
targetEditor.update(() => {
|
|
221
|
+
const selection = $getSelection();
|
|
222
|
+
if ($isRangeSelection(selection)) {
|
|
223
|
+
$setBlocksType(selection, () => $createHeadingNode(level));
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
const formatQuote = () => {
|
|
228
|
+
targetEditor.update(() => {
|
|
229
|
+
const selection = $getSelection();
|
|
230
|
+
if ($isRangeSelection(selection)) {
|
|
231
|
+
$setBlocksType(selection, () => $createQuoteNode());
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
const applyColor = (color) => {
|
|
236
|
+
targetEditor.update(() => {
|
|
237
|
+
const selection = $getSelection();
|
|
238
|
+
if ($isRangeSelection(selection)) {
|
|
239
|
+
$patchStyleText(selection, { color: color === "inherit" ? "" : color });
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
const applyHighlight = (bgColor) => {
|
|
244
|
+
targetEditor.update(() => {
|
|
245
|
+
const selection = $getSelection();
|
|
246
|
+
if ($isRangeSelection(selection)) {
|
|
247
|
+
$patchStyleText(selection, {
|
|
248
|
+
"background-color": bgColor === "transparent" ? "" : bgColor
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
const toggleSpeech = () => {
|
|
254
|
+
if (!SUPPORT_SPEECH_RECOGNITION) return;
|
|
255
|
+
const next = !isSpeechActive;
|
|
256
|
+
setIsSpeechActive(next);
|
|
257
|
+
targetEditor.dispatchCommand(SPEECH_TO_TEXT_COMMAND, next);
|
|
258
|
+
};
|
|
259
|
+
const handleInsertLink = () => {
|
|
260
|
+
if (!toolbarState.isLink) {
|
|
261
|
+
setIsLinkEditMode(true);
|
|
262
|
+
targetEditor.dispatchCommand(TOGGLE_LINK_COMMAND, sanitizeUrl("https://"));
|
|
263
|
+
} else {
|
|
264
|
+
setIsLinkEditMode(false);
|
|
265
|
+
targetEditor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
const INSERT_BLOCKS = useMemo(
|
|
269
|
+
() => [
|
|
270
|
+
{
|
|
271
|
+
id: "image",
|
|
272
|
+
category: "media",
|
|
273
|
+
label: "Image",
|
|
274
|
+
desc: "Upload photo or web URL",
|
|
275
|
+
icon: Image,
|
|
276
|
+
color: "text-blue-500 bg-blue-500/10 dark:bg-blue-500/20",
|
|
277
|
+
action: () => {
|
|
278
|
+
showModal(
|
|
279
|
+
"Insert Image",
|
|
280
|
+
"Upload an image from your device or paste a URL.",
|
|
281
|
+
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-48 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertImageDialog, { activeEditor: targetEditor, onClose }) }),
|
|
282
|
+
true
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: "audio",
|
|
288
|
+
category: "media",
|
|
289
|
+
label: "Audio Track",
|
|
290
|
+
desc: "Interactive player with speed controls",
|
|
291
|
+
icon: FileAudio,
|
|
292
|
+
color: "text-emerald-500 bg-emerald-500/10 dark:bg-emerald-500/20",
|
|
293
|
+
action: () => {
|
|
294
|
+
showModal(
|
|
295
|
+
"Insert Audio Player",
|
|
296
|
+
"Attach an audio clip, voice memo, or music track.",
|
|
297
|
+
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-48 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertAudioDialog, { activeEditor: targetEditor, onClose }) }),
|
|
298
|
+
true
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: "file",
|
|
304
|
+
category: "media",
|
|
305
|
+
label: "Document File",
|
|
306
|
+
desc: "PDF, Word, Excel, ZIP or code file",
|
|
307
|
+
icon: FileText,
|
|
308
|
+
color: "text-amber-500 bg-amber-500/10 dark:bg-amber-500/20",
|
|
309
|
+
action: () => {
|
|
310
|
+
showModal(
|
|
311
|
+
"Attach Document",
|
|
312
|
+
"Upload a document or document archive to download.",
|
|
313
|
+
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-48 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertFileDialog, { activeEditor: targetEditor, onClose }) }),
|
|
314
|
+
true
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
id: "youtube",
|
|
320
|
+
category: "media",
|
|
321
|
+
label: "YouTube Video",
|
|
322
|
+
desc: "Embed streaming video player",
|
|
323
|
+
icon: Youtube,
|
|
324
|
+
color: "text-red-500 bg-red-500/10 dark:bg-red-500/20",
|
|
325
|
+
action: () => {
|
|
326
|
+
showModal(
|
|
327
|
+
"Embed YouTube Video",
|
|
328
|
+
"Paste a YouTube video URL to embed it in the page.",
|
|
329
|
+
(onClose) => /* @__PURE__ */ jsx(AutoEmbedDialog, { embedConfig: YoutubeEmbedConfig, onClose }),
|
|
330
|
+
true
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "table",
|
|
336
|
+
category: "blocks",
|
|
337
|
+
label: "Data Table",
|
|
338
|
+
desc: "Configurable rows and columns",
|
|
339
|
+
icon: Table,
|
|
340
|
+
color: "text-purple-500 bg-purple-500/10 dark:bg-purple-500/20",
|
|
341
|
+
action: () => {
|
|
342
|
+
showModal(
|
|
343
|
+
"Insert Table",
|
|
344
|
+
"Choose rows and columns for your data table.",
|
|
345
|
+
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-32 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertTableBody, { activeEditor: targetEditor, onClose }) }),
|
|
346
|
+
true
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: "poll",
|
|
352
|
+
category: "blocks",
|
|
353
|
+
label: "Voting Poll",
|
|
354
|
+
desc: "Interactive multi-choice question",
|
|
355
|
+
icon: SquarePenIcon,
|
|
356
|
+
color: "text-rose-500 bg-rose-500/10 dark:bg-rose-500/20",
|
|
357
|
+
action: () => {
|
|
358
|
+
showModal(
|
|
359
|
+
"Create Poll",
|
|
360
|
+
"Add a voting poll with customizable choices.",
|
|
361
|
+
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-32 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertPoll, { activeEditor: targetEditor, onClose }) }),
|
|
362
|
+
true
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: "excalidraw",
|
|
368
|
+
category: "blocks",
|
|
369
|
+
label: "Sketch Canvas",
|
|
370
|
+
desc: "Hand-drawn diagram and whiteboard",
|
|
371
|
+
icon: DraftingCompassIcon,
|
|
372
|
+
color: "text-orange-500 bg-orange-500/10 dark:bg-orange-500/20",
|
|
373
|
+
action: () => {
|
|
374
|
+
targetEditor.dispatchCommand(INSERT_EXCALIDRAW_COMMAND, void 0);
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
id: "hint",
|
|
379
|
+
category: "blocks",
|
|
380
|
+
label: "Callout Card",
|
|
381
|
+
desc: "Colored highlight note or tip",
|
|
382
|
+
icon: AlertCircle,
|
|
383
|
+
color: "text-indigo-500 bg-indigo-500/10 dark:bg-indigo-500/20",
|
|
384
|
+
action: () => {
|
|
385
|
+
targetEditor.dispatchCommand(INSERT_HINT_COMMAND, "info");
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: "columns",
|
|
390
|
+
category: "blocks",
|
|
391
|
+
label: "2 Columns",
|
|
392
|
+
desc: "Side-by-side content container",
|
|
393
|
+
icon: Columns2,
|
|
394
|
+
color: "text-teal-500 bg-teal-500/10 dark:bg-teal-500/20",
|
|
395
|
+
action: () => {
|
|
396
|
+
targetEditor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr");
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: "hr",
|
|
401
|
+
category: "blocks",
|
|
402
|
+
label: "Divider",
|
|
403
|
+
desc: "Clean horizontal separator line",
|
|
404
|
+
icon: FlipHorizontal2,
|
|
405
|
+
color: "text-slate-500 bg-slate-500/10 dark:bg-slate-500/20",
|
|
406
|
+
action: () => {
|
|
407
|
+
targetEditor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
[targetEditor, showModal]
|
|
412
|
+
);
|
|
413
|
+
const filteredBlocks = useMemo(() => {
|
|
414
|
+
if (insertCategory === "all") return INSERT_BLOCKS;
|
|
415
|
+
return INSERT_BLOCKS.filter((b) => b.category === insertCategory);
|
|
416
|
+
}, [INSERT_BLOCKS, insertCategory]);
|
|
417
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
418
|
+
modal,
|
|
419
|
+
!shouldShow && /* @__PURE__ */ jsx("div", { className: "fixed bottom-5 right-4 z-40 md:hidden animate-in fade-in zoom-in-95 duration-200", children: /* @__PURE__ */ jsxs(
|
|
420
|
+
"button",
|
|
421
|
+
{
|
|
422
|
+
type: "button",
|
|
423
|
+
onClick: handleOpenDock,
|
|
424
|
+
className: "flex items-center gap-2 px-4 py-2.5 rounded-full bg-primary text-primary-foreground shadow-2xl shadow-primary/40 text-xs font-semibold active:scale-95 transition-all touch-manipulation border border-primary/20 backdrop-blur-md cursor-pointer",
|
|
425
|
+
"aria-label": "Open formatting dock",
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "w-3.5 h-3.5 text-amber-300 animate-pulse" }),
|
|
428
|
+
/* @__PURE__ */ jsx("span", { children: "Format & Insert" })
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
) }),
|
|
432
|
+
/* @__PURE__ */ jsx(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
className: cn(
|
|
436
|
+
"fixed left-0 right-0 w-full z-50 md:hidden transition-transform duration-300 ease-out",
|
|
437
|
+
shouldShow ? "translate-y-0" : "translate-y-[120%] pointer-events-none"
|
|
438
|
+
),
|
|
439
|
+
style: {
|
|
440
|
+
bottom: `${bottomOffset}px`
|
|
441
|
+
},
|
|
442
|
+
children: /* @__PURE__ */ jsxs(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
className: cn(
|
|
446
|
+
"w-full bg-background/95 dark:bg-zinc-950/95 backdrop-blur-2xl border-t border-border/80 shadow-2xl pointer-events-auto rounded-t-2xl",
|
|
447
|
+
"pb-[max(0.5rem,env(safe-area-inset-bottom))]",
|
|
448
|
+
toolbarConfig == null ? void 0 : toolbarConfig.mobileClassName
|
|
449
|
+
),
|
|
450
|
+
onMouseDown: (e) => {
|
|
451
|
+
if (e.target instanceof Element && e.target.tagName !== "INPUT") {
|
|
452
|
+
e.preventDefault();
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center pt-2 pb-1", children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-muted-foreground/25" }) }),
|
|
457
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 pb-1.5 border-b border-border/50 text-xs", children: [
|
|
458
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 bg-muted/50 p-0.5 rounded-xl border border-border/40", children: [
|
|
459
|
+
/* @__PURE__ */ jsxs(
|
|
460
|
+
"button",
|
|
461
|
+
{
|
|
462
|
+
type: "button",
|
|
463
|
+
onClick: () => setActiveTab("format"),
|
|
464
|
+
className: cn(
|
|
465
|
+
"flex items-center gap-1 px-2.5 py-1 rounded-lg font-medium transition-all text-xs touch-manipulation",
|
|
466
|
+
activeTab === "format" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
467
|
+
),
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ jsx(Type, { className: "w-3.5 h-3.5" }),
|
|
470
|
+
/* @__PURE__ */ jsx("span", { children: "Format" })
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
),
|
|
474
|
+
/* @__PURE__ */ jsxs(
|
|
475
|
+
"button",
|
|
476
|
+
{
|
|
477
|
+
type: "button",
|
|
478
|
+
onClick: () => setActiveTab("insert"),
|
|
479
|
+
className: cn(
|
|
480
|
+
"flex items-center gap-1 px-2.5 py-1 rounded-lg font-medium transition-all text-xs touch-manipulation",
|
|
481
|
+
activeTab === "insert" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
482
|
+
),
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ jsx(Plus, { className: "w-3.5 h-3.5" }),
|
|
485
|
+
/* @__PURE__ */ jsx("span", { children: "Insert" })
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
),
|
|
489
|
+
/* @__PURE__ */ jsxs(
|
|
490
|
+
"button",
|
|
491
|
+
{
|
|
492
|
+
type: "button",
|
|
493
|
+
onClick: () => setActiveTab("style"),
|
|
494
|
+
className: cn(
|
|
495
|
+
"flex items-center gap-1 px-2.5 py-1 rounded-lg font-medium transition-all text-xs touch-manipulation",
|
|
496
|
+
activeTab === "style" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
497
|
+
),
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ jsx(Palette, { className: "w-3.5 h-3.5" }),
|
|
500
|
+
/* @__PURE__ */ jsx("span", { children: "Style" })
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
)
|
|
504
|
+
] }),
|
|
505
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
506
|
+
SUPPORT_SPEECH_RECOGNITION && /* @__PURE__ */ jsxs(
|
|
507
|
+
"button",
|
|
508
|
+
{
|
|
509
|
+
type: "button",
|
|
510
|
+
onClick: toggleSpeech,
|
|
511
|
+
className: cn(
|
|
512
|
+
"flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] font-medium transition-all touch-manipulation",
|
|
513
|
+
isSpeechActive ? "bg-rose-500 text-white animate-pulse" : "text-muted-foreground hover:bg-muted"
|
|
514
|
+
),
|
|
515
|
+
title: "Speech to Text",
|
|
516
|
+
"aria-label": "Toggle voice typing",
|
|
517
|
+
children: [
|
|
518
|
+
/* @__PURE__ */ jsx(Mic, { className: "w-3.5 h-3.5" }),
|
|
519
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: isSpeechActive ? "Listening..." : "Dictate" })
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
/* @__PURE__ */ jsx(
|
|
524
|
+
"button",
|
|
525
|
+
{
|
|
526
|
+
type: "button",
|
|
527
|
+
onClick: handleCloseDock,
|
|
528
|
+
className: "p-1.5 rounded-lg text-muted-foreground hover:bg-muted active:scale-95 transition-colors touch-manipulation cursor-pointer",
|
|
529
|
+
"aria-label": "Dismiss mobile toolbar",
|
|
530
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4" })
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
] })
|
|
534
|
+
] }),
|
|
535
|
+
activeTab === "format" && /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
536
|
+
/* @__PURE__ */ jsx(
|
|
537
|
+
"div",
|
|
538
|
+
{
|
|
539
|
+
className: cn(
|
|
540
|
+
"pointer-events-none absolute left-0 top-0 bottom-0 w-5 bg-gradient-to-r from-background to-transparent z-10 transition-opacity duration-200",
|
|
541
|
+
canScrollLeft ? "opacity-100" : "opacity-0"
|
|
542
|
+
)
|
|
543
|
+
}
|
|
544
|
+
),
|
|
545
|
+
/* @__PURE__ */ jsx(
|
|
546
|
+
"div",
|
|
547
|
+
{
|
|
548
|
+
className: cn(
|
|
549
|
+
"pointer-events-none absolute right-0 top-0 bottom-0 w-5 bg-gradient-to-l from-background to-transparent z-10 transition-opacity duration-200",
|
|
550
|
+
canScrollRight ? "opacity-100" : "opacity-0"
|
|
551
|
+
)
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ jsxs(
|
|
555
|
+
"div",
|
|
556
|
+
{
|
|
557
|
+
ref: scrollContainerRef,
|
|
558
|
+
onScroll: checkScrollAffordance,
|
|
559
|
+
className: "flex items-center gap-1.5 px-3 py-2 overflow-x-auto no-scrollbar scroll-smooth w-full",
|
|
560
|
+
children: [
|
|
561
|
+
/* @__PURE__ */ jsx(
|
|
562
|
+
"button",
|
|
563
|
+
{
|
|
564
|
+
type: "button",
|
|
565
|
+
disabled: !toolbarState.canUndo,
|
|
566
|
+
onClick: (e) => {
|
|
567
|
+
e.preventDefault();
|
|
568
|
+
targetEditor.dispatchCommand(UNDO_COMMAND, void 0);
|
|
569
|
+
},
|
|
570
|
+
className: cn(
|
|
571
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all touch-manipulation",
|
|
572
|
+
toolbarState.canUndo ? "text-foreground hover:bg-muted active:scale-95" : "text-muted-foreground/30 cursor-not-allowed"
|
|
573
|
+
),
|
|
574
|
+
"aria-label": "Undo",
|
|
575
|
+
children: /* @__PURE__ */ jsx(Undo2, { className: "w-4 h-4" })
|
|
576
|
+
}
|
|
577
|
+
),
|
|
578
|
+
/* @__PURE__ */ jsx(
|
|
579
|
+
"button",
|
|
580
|
+
{
|
|
581
|
+
type: "button",
|
|
582
|
+
disabled: !toolbarState.canRedo,
|
|
583
|
+
onClick: (e) => {
|
|
584
|
+
e.preventDefault();
|
|
585
|
+
targetEditor.dispatchCommand(REDO_COMMAND, void 0);
|
|
586
|
+
},
|
|
587
|
+
className: cn(
|
|
588
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all touch-manipulation",
|
|
589
|
+
toolbarState.canRedo ? "text-foreground hover:bg-muted active:scale-95" : "text-muted-foreground/30 cursor-not-allowed"
|
|
590
|
+
),
|
|
591
|
+
"aria-label": "Redo",
|
|
592
|
+
children: /* @__PURE__ */ jsx(Redo2, { className: "w-4 h-4" })
|
|
593
|
+
}
|
|
594
|
+
),
|
|
595
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
|
|
596
|
+
/* @__PURE__ */ jsx(
|
|
597
|
+
"button",
|
|
598
|
+
{
|
|
599
|
+
type: "button",
|
|
600
|
+
onClick: (e) => {
|
|
601
|
+
e.preventDefault();
|
|
602
|
+
targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold");
|
|
603
|
+
},
|
|
604
|
+
className: cn(
|
|
605
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
606
|
+
toolbarState.isBold ? "bg-primary text-primary-foreground font-bold shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
607
|
+
),
|
|
608
|
+
"aria-label": "Bold",
|
|
609
|
+
children: /* @__PURE__ */ jsx(Bold, { className: "w-4 h-4 stroke-[2.5]" })
|
|
610
|
+
}
|
|
611
|
+
),
|
|
612
|
+
/* @__PURE__ */ jsx(
|
|
613
|
+
"button",
|
|
614
|
+
{
|
|
615
|
+
type: "button",
|
|
616
|
+
onClick: (e) => {
|
|
617
|
+
e.preventDefault();
|
|
618
|
+
targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic");
|
|
619
|
+
},
|
|
620
|
+
className: cn(
|
|
621
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
622
|
+
toolbarState.isItalic ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
623
|
+
),
|
|
624
|
+
"aria-label": "Italic",
|
|
625
|
+
children: /* @__PURE__ */ jsx(Italic, { className: "w-4 h-4 stroke-[2.5]" })
|
|
626
|
+
}
|
|
627
|
+
),
|
|
628
|
+
/* @__PURE__ */ jsx(
|
|
629
|
+
"button",
|
|
630
|
+
{
|
|
631
|
+
type: "button",
|
|
632
|
+
onClick: (e) => {
|
|
633
|
+
e.preventDefault();
|
|
634
|
+
targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline");
|
|
635
|
+
},
|
|
636
|
+
className: cn(
|
|
637
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
638
|
+
toolbarState.isUnderline ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
639
|
+
),
|
|
640
|
+
"aria-label": "Underline",
|
|
641
|
+
children: /* @__PURE__ */ jsx(Underline, { className: "w-4 h-4 stroke-[2.5]" })
|
|
642
|
+
}
|
|
643
|
+
),
|
|
644
|
+
/* @__PURE__ */ jsx(
|
|
645
|
+
"button",
|
|
646
|
+
{
|
|
647
|
+
type: "button",
|
|
648
|
+
onClick: (e) => {
|
|
649
|
+
e.preventDefault();
|
|
650
|
+
targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough");
|
|
651
|
+
},
|
|
652
|
+
className: cn(
|
|
653
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
654
|
+
toolbarState.isStrikethrough ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
655
|
+
),
|
|
656
|
+
"aria-label": "Strikethrough",
|
|
657
|
+
children: /* @__PURE__ */ jsx(Strikethrough, { className: "w-4 h-4 stroke-[2.5]" })
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
/* @__PURE__ */ jsx(
|
|
661
|
+
"button",
|
|
662
|
+
{
|
|
663
|
+
type: "button",
|
|
664
|
+
onClick: (e) => {
|
|
665
|
+
e.preventDefault();
|
|
666
|
+
targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "code");
|
|
667
|
+
},
|
|
668
|
+
className: cn(
|
|
669
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation font-mono",
|
|
670
|
+
toolbarState.isCode ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
671
|
+
),
|
|
672
|
+
"aria-label": "Inline Code",
|
|
673
|
+
children: /* @__PURE__ */ jsx(Code, { className: "w-4 h-4 stroke-[2.5]" })
|
|
674
|
+
}
|
|
675
|
+
),
|
|
676
|
+
/* @__PURE__ */ jsx(
|
|
677
|
+
"button",
|
|
678
|
+
{
|
|
679
|
+
type: "button",
|
|
680
|
+
onClick: (e) => {
|
|
681
|
+
e.preventDefault();
|
|
682
|
+
handleInsertLink();
|
|
683
|
+
},
|
|
684
|
+
className: cn(
|
|
685
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
686
|
+
toolbarState.isLink ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
687
|
+
),
|
|
688
|
+
"aria-label": "Link",
|
|
689
|
+
children: /* @__PURE__ */ jsx(LinkIcon, { className: "w-4 h-4 stroke-[2.5]" })
|
|
690
|
+
}
|
|
691
|
+
),
|
|
692
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
|
|
693
|
+
/* @__PURE__ */ jsx(
|
|
694
|
+
"button",
|
|
695
|
+
{
|
|
696
|
+
type: "button",
|
|
697
|
+
onClick: (e) => {
|
|
698
|
+
e.preventDefault();
|
|
699
|
+
formatHeading("h1");
|
|
700
|
+
},
|
|
701
|
+
className: cn(
|
|
702
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
703
|
+
toolbarState.blockType === "h1" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20 font-bold" : "text-muted-foreground hover:bg-muted"
|
|
704
|
+
),
|
|
705
|
+
"aria-label": "Heading 1",
|
|
706
|
+
children: /* @__PURE__ */ jsx(Heading1, { className: "w-4 h-4 stroke-[2.5]" })
|
|
707
|
+
}
|
|
708
|
+
),
|
|
709
|
+
/* @__PURE__ */ jsx(
|
|
710
|
+
"button",
|
|
711
|
+
{
|
|
712
|
+
type: "button",
|
|
713
|
+
onClick: (e) => {
|
|
714
|
+
e.preventDefault();
|
|
715
|
+
formatHeading("h2");
|
|
716
|
+
},
|
|
717
|
+
className: cn(
|
|
718
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
719
|
+
toolbarState.blockType === "h2" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20 font-bold" : "text-muted-foreground hover:bg-muted"
|
|
720
|
+
),
|
|
721
|
+
"aria-label": "Heading 2",
|
|
722
|
+
children: /* @__PURE__ */ jsx(Heading2, { className: "w-4 h-4 stroke-[2.5]" })
|
|
723
|
+
}
|
|
724
|
+
),
|
|
725
|
+
/* @__PURE__ */ jsx(
|
|
726
|
+
"button",
|
|
727
|
+
{
|
|
728
|
+
type: "button",
|
|
729
|
+
onClick: (e) => {
|
|
730
|
+
e.preventDefault();
|
|
731
|
+
formatHeading("h3");
|
|
732
|
+
},
|
|
733
|
+
className: cn(
|
|
734
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
735
|
+
toolbarState.blockType === "h3" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20 font-bold" : "text-muted-foreground hover:bg-muted"
|
|
736
|
+
),
|
|
737
|
+
"aria-label": "Heading 3",
|
|
738
|
+
children: /* @__PURE__ */ jsx(Heading3, { className: "w-4 h-4 stroke-[2.5]" })
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
|
|
742
|
+
/* @__PURE__ */ jsx(
|
|
743
|
+
"button",
|
|
744
|
+
{
|
|
745
|
+
type: "button",
|
|
746
|
+
onClick: (e) => {
|
|
747
|
+
e.preventDefault();
|
|
748
|
+
targetEditor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, void 0);
|
|
749
|
+
},
|
|
750
|
+
className: cn(
|
|
751
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
752
|
+
toolbarState.blockType === "bullet" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
753
|
+
),
|
|
754
|
+
"aria-label": "Bullet list",
|
|
755
|
+
children: /* @__PURE__ */ jsx(List, { className: "w-4 h-4 stroke-[2.5]" })
|
|
756
|
+
}
|
|
757
|
+
),
|
|
758
|
+
/* @__PURE__ */ jsx(
|
|
759
|
+
"button",
|
|
760
|
+
{
|
|
761
|
+
type: "button",
|
|
762
|
+
onClick: (e) => {
|
|
763
|
+
e.preventDefault();
|
|
764
|
+
targetEditor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, void 0);
|
|
765
|
+
},
|
|
766
|
+
className: cn(
|
|
767
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
768
|
+
toolbarState.blockType === "number" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
769
|
+
),
|
|
770
|
+
"aria-label": "Numbered list",
|
|
771
|
+
children: /* @__PURE__ */ jsx(ListOrdered, { className: "w-4 h-4 stroke-[2.5]" })
|
|
772
|
+
}
|
|
773
|
+
),
|
|
774
|
+
/* @__PURE__ */ jsx(
|
|
775
|
+
"button",
|
|
776
|
+
{
|
|
777
|
+
type: "button",
|
|
778
|
+
onClick: (e) => {
|
|
779
|
+
e.preventDefault();
|
|
780
|
+
targetEditor.dispatchCommand(INSERT_CHECK_LIST_COMMAND, void 0);
|
|
781
|
+
},
|
|
782
|
+
className: cn(
|
|
783
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
784
|
+
toolbarState.blockType === "check" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
785
|
+
),
|
|
786
|
+
"aria-label": "Checklist",
|
|
787
|
+
children: /* @__PURE__ */ jsx(CheckSquare, { className: "w-4 h-4 stroke-[2.5]" })
|
|
788
|
+
}
|
|
789
|
+
),
|
|
790
|
+
/* @__PURE__ */ jsx(
|
|
791
|
+
"button",
|
|
792
|
+
{
|
|
793
|
+
type: "button",
|
|
794
|
+
onClick: (e) => {
|
|
795
|
+
e.preventDefault();
|
|
796
|
+
formatQuote();
|
|
797
|
+
},
|
|
798
|
+
className: cn(
|
|
799
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
800
|
+
toolbarState.blockType === "quote" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
801
|
+
),
|
|
802
|
+
"aria-label": "Quote",
|
|
803
|
+
children: /* @__PURE__ */ jsx(Quote, { className: "w-4 h-4 stroke-[2.5]" })
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
|
|
807
|
+
/* @__PURE__ */ jsx(
|
|
808
|
+
"button",
|
|
809
|
+
{
|
|
810
|
+
type: "button",
|
|
811
|
+
onClick: (e) => {
|
|
812
|
+
e.preventDefault();
|
|
813
|
+
targetEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "left");
|
|
814
|
+
},
|
|
815
|
+
className: cn(
|
|
816
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
817
|
+
toolbarState.elementFormat === "left" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
818
|
+
),
|
|
819
|
+
"aria-label": "Align left",
|
|
820
|
+
children: /* @__PURE__ */ jsx(AlignLeft, { className: "w-4 h-4 stroke-[2.5]" })
|
|
821
|
+
}
|
|
822
|
+
),
|
|
823
|
+
/* @__PURE__ */ jsx(
|
|
824
|
+
"button",
|
|
825
|
+
{
|
|
826
|
+
type: "button",
|
|
827
|
+
onClick: (e) => {
|
|
828
|
+
e.preventDefault();
|
|
829
|
+
targetEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "center");
|
|
830
|
+
},
|
|
831
|
+
className: cn(
|
|
832
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
833
|
+
toolbarState.elementFormat === "center" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
834
|
+
),
|
|
835
|
+
"aria-label": "Align center",
|
|
836
|
+
children: /* @__PURE__ */ jsx(AlignCenter, { className: "w-4 h-4 stroke-[2.5]" })
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
/* @__PURE__ */ jsx(
|
|
840
|
+
"button",
|
|
841
|
+
{
|
|
842
|
+
type: "button",
|
|
843
|
+
onClick: (e) => {
|
|
844
|
+
e.preventDefault();
|
|
845
|
+
targetEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "right");
|
|
846
|
+
},
|
|
847
|
+
className: cn(
|
|
848
|
+
"flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
|
|
849
|
+
toolbarState.elementFormat === "right" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
|
|
850
|
+
),
|
|
851
|
+
"aria-label": "Align right",
|
|
852
|
+
children: /* @__PURE__ */ jsx(AlignRight, { className: "w-4 h-4 stroke-[2.5]" })
|
|
853
|
+
}
|
|
854
|
+
),
|
|
855
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
|
|
856
|
+
/* @__PURE__ */ jsx(
|
|
857
|
+
"button",
|
|
858
|
+
{
|
|
859
|
+
type: "button",
|
|
860
|
+
onClick: (e) => {
|
|
861
|
+
e.preventDefault();
|
|
862
|
+
targetEditor.dispatchCommand(INSERT_COMMENT_COMMAND, void 0);
|
|
863
|
+
},
|
|
864
|
+
className: "flex items-center justify-center min-w-[36px] h-9 rounded-xl text-muted-foreground hover:bg-muted active:scale-95 transition-all touch-manipulation",
|
|
865
|
+
"aria-label": "Add inline comment",
|
|
866
|
+
children: /* @__PURE__ */ jsx(MessageSquarePlus, { className: "w-4 h-4" })
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
/* @__PURE__ */ jsx(
|
|
870
|
+
"button",
|
|
871
|
+
{
|
|
872
|
+
type: "button",
|
|
873
|
+
onClick: (e) => {
|
|
874
|
+
e.preventDefault();
|
|
875
|
+
if (typeof window !== "undefined") {
|
|
876
|
+
window.dispatchEvent(
|
|
877
|
+
new CustomEvent("notiq:open-import-export", {
|
|
878
|
+
detail: { defaultTab: "export" }
|
|
879
|
+
})
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
className: "flex items-center justify-center min-w-[36px] h-9 rounded-xl text-muted-foreground hover:bg-muted active:scale-95 transition-all touch-manipulation",
|
|
884
|
+
"aria-label": "Import & Export document",
|
|
885
|
+
title: "Import / Export",
|
|
886
|
+
children: /* @__PURE__ */ jsx(ArrowDownUp, { className: "w-4 h-4" })
|
|
887
|
+
}
|
|
888
|
+
)
|
|
889
|
+
]
|
|
890
|
+
}
|
|
891
|
+
)
|
|
892
|
+
] }),
|
|
893
|
+
activeTab === "insert" && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 space-y-2.5", children: [
|
|
894
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 pb-1 overflow-x-auto no-scrollbar", children: ["all", "media", "blocks"].map((cat) => /* @__PURE__ */ jsx(
|
|
895
|
+
"button",
|
|
896
|
+
{
|
|
897
|
+
type: "button",
|
|
898
|
+
onClick: () => setInsertCategory(cat),
|
|
899
|
+
className: cn(
|
|
900
|
+
"px-3 py-1 rounded-full text-xs font-medium capitalize transition-all touch-manipulation",
|
|
901
|
+
insertCategory === cat ? "bg-primary text-primary-foreground shadow-sm" : "bg-muted/60 text-muted-foreground hover:bg-muted"
|
|
902
|
+
),
|
|
903
|
+
children: cat === "all" ? "All Blocks" : cat === "media" ? "Media & Files" : "Rich Blocks"
|
|
904
|
+
},
|
|
905
|
+
cat
|
|
906
|
+
)) }),
|
|
907
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 max-h-[42dvh] overflow-y-auto pr-0.5", children: filteredBlocks.map((block) => {
|
|
908
|
+
const Icon = block.icon;
|
|
909
|
+
return /* @__PURE__ */ jsxs(
|
|
910
|
+
"button",
|
|
911
|
+
{
|
|
912
|
+
type: "button",
|
|
913
|
+
onClick: (e) => {
|
|
914
|
+
e.preventDefault();
|
|
915
|
+
block.action();
|
|
916
|
+
},
|
|
917
|
+
className: "flex items-center gap-2.5 p-2.5 rounded-xl bg-card hover:bg-muted/70 active:scale-97 transition-all touch-manipulation border border-border/50 text-left shadow-sm",
|
|
918
|
+
children: [
|
|
919
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center w-9 h-9 rounded-xl flex-shrink-0", block.color), children: /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4" }) }),
|
|
920
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
921
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-semibold text-foreground truncate", children: block.label }),
|
|
922
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] text-muted-foreground truncate leading-tight mt-0.5", children: block.desc })
|
|
923
|
+
] })
|
|
924
|
+
]
|
|
925
|
+
},
|
|
926
|
+
block.id
|
|
927
|
+
);
|
|
928
|
+
}) })
|
|
929
|
+
] }),
|
|
930
|
+
activeTab === "style" && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2.5 space-y-3", children: [
|
|
931
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
932
|
+
/* @__PURE__ */ jsx("div", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5", children: "Text Color" }),
|
|
933
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 overflow-x-auto no-scrollbar", children: TEXT_COLORS.map((tc) => /* @__PURE__ */ jsxs(
|
|
934
|
+
"button",
|
|
935
|
+
{
|
|
936
|
+
type: "button",
|
|
937
|
+
onClick: () => applyColor(tc.color),
|
|
938
|
+
className: "flex flex-col items-center gap-1 min-w-[44px] py-1 rounded-lg hover:bg-muted active:scale-95 transition-all touch-manipulation",
|
|
939
|
+
children: [
|
|
940
|
+
/* @__PURE__ */ jsx(
|
|
941
|
+
"span",
|
|
942
|
+
{
|
|
943
|
+
className: cn("w-6 h-6 rounded-full border border-border/60 shadow-sm flex items-center justify-center", tc.bg)
|
|
944
|
+
}
|
|
945
|
+
),
|
|
946
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground font-medium", children: tc.label })
|
|
947
|
+
]
|
|
948
|
+
},
|
|
949
|
+
tc.label
|
|
950
|
+
)) })
|
|
951
|
+
] }),
|
|
952
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
953
|
+
/* @__PURE__ */ jsx("div", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5", children: "Highlight Background" }),
|
|
954
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 overflow-x-auto no-scrollbar", children: HIGHLIGHT_COLORS.map((hc) => /* @__PURE__ */ jsxs(
|
|
955
|
+
"button",
|
|
956
|
+
{
|
|
957
|
+
type: "button",
|
|
958
|
+
onClick: () => applyHighlight(hc.color),
|
|
959
|
+
className: "flex flex-col items-center gap-1 min-w-[44px] py-1 rounded-lg hover:bg-muted active:scale-95 transition-all touch-manipulation",
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ jsx(
|
|
962
|
+
"span",
|
|
963
|
+
{
|
|
964
|
+
className: cn("w-6 h-6 rounded-lg border shadow-sm flex items-center justify-center", hc.bg || "bg-transparent", hc.border),
|
|
965
|
+
children: hc.color === "transparent" && /* @__PURE__ */ jsx(Eraser, { className: "w-3 h-3 text-muted-foreground" })
|
|
966
|
+
}
|
|
967
|
+
),
|
|
968
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground font-medium", children: hc.label })
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
hc.label
|
|
972
|
+
)) })
|
|
973
|
+
] })
|
|
974
|
+
] })
|
|
975
|
+
]
|
|
976
|
+
}
|
|
977
|
+
)
|
|
978
|
+
}
|
|
979
|
+
)
|
|
980
|
+
] });
|
|
981
|
+
}
|
|
982
|
+
export {
|
|
983
|
+
MobileToolbar as default
|
|
984
|
+
};
|