@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
package/dist/index.mjs
CHANGED
|
@@ -1,48 +1,133 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
AVATAR_PRESETS,
|
|
3
|
+
OfflineBanner
|
|
4
|
+
} from "./chunk-6SRMKQSD.mjs";
|
|
4
5
|
import {
|
|
5
6
|
CodeHighlightPlugin,
|
|
6
7
|
LexicalAutoLinkPlugin,
|
|
7
8
|
LinkWithMetaDataPlugin,
|
|
8
9
|
nodes_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
Progress,
|
|
12
|
-
UploadProvider,
|
|
13
|
-
useUpload
|
|
14
|
-
} from "./chunk-JXDPPUJI.mjs";
|
|
10
|
+
} from "./chunk-YDDBQZ77.mjs";
|
|
15
11
|
import {
|
|
16
12
|
DynamicBlockPlugin,
|
|
17
13
|
EquationsPlugin,
|
|
18
14
|
InlineImagePlugin,
|
|
19
15
|
StoryBuilderPlugin
|
|
20
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Z6JAFF55.mjs";
|
|
21
17
|
import {
|
|
22
18
|
PollPlugin
|
|
23
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-W6VQSFE5.mjs";
|
|
20
|
+
import {
|
|
21
|
+
CollapsiblePlugin
|
|
22
|
+
} from "./chunk-ACV47ZKE.mjs";
|
|
24
23
|
import {
|
|
25
24
|
AutoEmbedPlugin,
|
|
26
|
-
CollapsiblePlugin,
|
|
27
25
|
FigmaPlugin,
|
|
28
|
-
LayoutPlugin,
|
|
29
26
|
TwitterPlugin,
|
|
30
27
|
YouTubePlugin
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-LLCP7NVE.mjs";
|
|
29
|
+
import "./chunk-IAFCQV3Z.mjs";
|
|
33
30
|
import {
|
|
34
31
|
INSERT_IMAGE_COMMAND,
|
|
35
32
|
ImagesPlugin
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-MW6MAUY3.mjs";
|
|
34
|
+
import "./chunk-4DVIYZVB.mjs";
|
|
35
|
+
import {
|
|
36
|
+
Badge
|
|
37
|
+
} from "./chunk-AMXRQ2TK.mjs";
|
|
38
|
+
import {
|
|
39
|
+
clearFormatting,
|
|
40
|
+
formatBulletList,
|
|
41
|
+
formatCheckList,
|
|
42
|
+
formatCode,
|
|
43
|
+
formatHeading,
|
|
44
|
+
formatNumberedList,
|
|
45
|
+
formatParagraph,
|
|
46
|
+
formatQuote,
|
|
47
|
+
updateFontSize
|
|
48
|
+
} from "./chunk-6D6QLRYR.mjs";
|
|
49
|
+
import {
|
|
50
|
+
DropdownMenu,
|
|
51
|
+
DropdownMenuContent,
|
|
52
|
+
DropdownMenuItem,
|
|
53
|
+
DropdownMenuSeparator,
|
|
54
|
+
DropdownMenuSub,
|
|
55
|
+
DropdownMenuSubContent,
|
|
56
|
+
DropdownMenuSubTrigger,
|
|
57
|
+
DropdownMenuTrigger
|
|
58
|
+
} from "./chunk-OXWTZV3U.mjs";
|
|
59
|
+
import "./chunk-PFH63ZU4.mjs";
|
|
60
|
+
import "./chunk-AYNKORDO.mjs";
|
|
61
|
+
import {
|
|
62
|
+
AICommandBar,
|
|
63
|
+
AICopilot,
|
|
64
|
+
Audio,
|
|
65
|
+
Blockquote,
|
|
66
|
+
BlocksKit,
|
|
67
|
+
Bold,
|
|
68
|
+
BubbleMenu,
|
|
69
|
+
BulletList,
|
|
70
|
+
CheckList,
|
|
71
|
+
Code,
|
|
72
|
+
CodeBlock,
|
|
73
|
+
Collaboration,
|
|
74
|
+
ColumnsLayout,
|
|
75
|
+
Equation,
|
|
76
|
+
Excalidraw,
|
|
77
|
+
Extension,
|
|
78
|
+
Figma,
|
|
79
|
+
File,
|
|
80
|
+
FloatingMenu,
|
|
81
|
+
Heading,
|
|
82
|
+
HintBlock,
|
|
83
|
+
History,
|
|
84
|
+
Image,
|
|
85
|
+
Italic,
|
|
86
|
+
NotiqContent,
|
|
87
|
+
NotiqContext,
|
|
88
|
+
NotiqEditor,
|
|
89
|
+
NotiqEditorImpl,
|
|
90
|
+
NotiqProvider,
|
|
91
|
+
OrderedList,
|
|
92
|
+
Paragraph,
|
|
93
|
+
Poll,
|
|
94
|
+
StarterKit,
|
|
95
|
+
Stepper,
|
|
96
|
+
Strike,
|
|
97
|
+
Tweet,
|
|
98
|
+
Underline,
|
|
99
|
+
YouTube,
|
|
100
|
+
createCanCommands,
|
|
101
|
+
createCommandChain,
|
|
102
|
+
createNotiqEditor,
|
|
103
|
+
editor_theme_default,
|
|
104
|
+
useNotiq,
|
|
105
|
+
useNotiqContext
|
|
106
|
+
} from "./chunk-IU2N42JJ.mjs";
|
|
107
|
+
import "./chunk-PHRVYPVM.mjs";
|
|
108
|
+
import {
|
|
109
|
+
VersionHistoryProvider,
|
|
110
|
+
useVersionHistory
|
|
111
|
+
} from "./chunk-J6ZUY5BY.mjs";
|
|
112
|
+
import "./chunk-EIZMKFHF.mjs";
|
|
113
|
+
import {
|
|
114
|
+
SpeechToTextPlugin_default
|
|
115
|
+
} from "./chunk-ZKZ7MLSS.mjs";
|
|
116
|
+
import "./chunk-EEBA6OAH.mjs";
|
|
117
|
+
import {
|
|
118
|
+
OPEN_AI_COMMAND_BAR_COMMAND
|
|
119
|
+
} from "./chunk-HOZ4QRFV.mjs";
|
|
120
|
+
import {
|
|
121
|
+
$createLayoutContainerNode,
|
|
122
|
+
$createLayoutItemNode,
|
|
123
|
+
LayoutPlugin
|
|
124
|
+
} from "./chunk-W6GAJXUS.mjs";
|
|
38
125
|
import {
|
|
39
126
|
AIProvider,
|
|
40
127
|
useAI
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import
|
|
43
|
-
|
|
44
|
-
} from "./chunk-NZXC6FGU.mjs";
|
|
45
|
-
import "./chunk-GXYD4VZM.mjs";
|
|
128
|
+
} from "./chunk-BGV62GC2.mjs";
|
|
129
|
+
import "./chunk-PD5K4AGP.mjs";
|
|
130
|
+
import "./chunk-KXRLARGI.mjs";
|
|
46
131
|
import {
|
|
47
132
|
CAN_USE_DOM,
|
|
48
133
|
isCapitalize,
|
|
@@ -69,18 +154,30 @@ import {
|
|
|
69
154
|
isSubscript,
|
|
70
155
|
isSuperscript,
|
|
71
156
|
isUppercase
|
|
72
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-K5OAFEVY.mjs";
|
|
158
|
+
import "./chunk-XYDBUQ6Z.mjs";
|
|
73
159
|
import {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
160
|
+
UploadProvider,
|
|
161
|
+
useUpload
|
|
162
|
+
} from "./chunk-N3WTT2U6.mjs";
|
|
163
|
+
import {
|
|
164
|
+
StepperPlugin
|
|
165
|
+
} from "./chunk-2KESP7OU.mjs";
|
|
166
|
+
import "./chunk-VGAX6YEY.mjs";
|
|
167
|
+
import "./chunk-N6ILV6NF.mjs";
|
|
168
|
+
import "./chunk-YTLUQJE2.mjs";
|
|
169
|
+
import "./chunk-43Z4Z2KD.mjs";
|
|
170
|
+
import {
|
|
171
|
+
$createAudioNode,
|
|
172
|
+
AudioNode,
|
|
173
|
+
INSERT_AUDIO_COMMAND
|
|
174
|
+
} from "./chunk-XYMXGU4T.mjs";
|
|
175
|
+
import {
|
|
176
|
+
$createFileNode,
|
|
177
|
+
FileNode,
|
|
178
|
+
INSERT_FILE_COMMAND
|
|
179
|
+
} from "./chunk-ZFV2HGD3.mjs";
|
|
180
|
+
import "./chunk-LU2XWLOE.mjs";
|
|
84
181
|
import {
|
|
85
182
|
DEFAULT_FONT_SIZE,
|
|
86
183
|
MAX_ALLOWED_FONT_SIZE,
|
|
@@ -88,168 +185,68 @@ import {
|
|
|
88
185
|
ToolbarContext,
|
|
89
186
|
blockTypeToBlockName,
|
|
90
187
|
useToolbarState
|
|
91
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-4FFTOZGJ.mjs";
|
|
189
|
+
import {
|
|
190
|
+
CommentsProvider,
|
|
191
|
+
useComments
|
|
192
|
+
} from "./chunk-R7WFRENU.mjs";
|
|
193
|
+
import {
|
|
194
|
+
COLLAB_COLORS,
|
|
195
|
+
COLLAB_SERVER_PRESETS,
|
|
196
|
+
CollabProvider,
|
|
197
|
+
DEFAULT_DOC_ID,
|
|
198
|
+
DEFAULT_SERVER_URL,
|
|
199
|
+
FALLBACK_SERVER_URL,
|
|
200
|
+
useCollab
|
|
201
|
+
} from "./chunk-RJQTA6HG.mjs";
|
|
202
|
+
import "./chunk-6UVNHT3T.mjs";
|
|
203
|
+
import "./chunk-5NRAXWYA.mjs";
|
|
92
204
|
import {
|
|
93
205
|
SharedHistoryContext,
|
|
94
206
|
useSharedHistoryContext
|
|
95
|
-
} from "./chunk-
|
|
96
|
-
import "./chunk-
|
|
97
|
-
import "./chunk-
|
|
98
|
-
import "./chunk-
|
|
99
|
-
import
|
|
100
|
-
HintPlugin
|
|
101
|
-
} from "./chunk-G53GLEAY.mjs";
|
|
102
|
-
import "./chunk-YPHOEJ46.mjs";
|
|
207
|
+
} from "./chunk-EVPWKNE4.mjs";
|
|
208
|
+
import "./chunk-CDAMHK63.mjs";
|
|
209
|
+
import "./chunk-NBE6FF6L.mjs";
|
|
210
|
+
import "./chunk-GYYLZ3MQ.mjs";
|
|
211
|
+
import "./chunk-IUOUIDEQ.mjs";
|
|
103
212
|
import {
|
|
104
213
|
sanitizeUrl
|
|
105
|
-
} from "./chunk-
|
|
106
|
-
import "./chunk-
|
|
107
|
-
import "./chunk-
|
|
108
|
-
import "./chunk-4MEDW3T6.mjs";
|
|
109
|
-
import {
|
|
110
|
-
Badge
|
|
111
|
-
} from "./chunk-FSM26655.mjs";
|
|
112
|
-
import {
|
|
113
|
-
Card,
|
|
114
|
-
CardContent,
|
|
115
|
-
CardHeader,
|
|
116
|
-
CardTitle
|
|
117
|
-
} from "./chunk-3G37YKTV.mjs";
|
|
118
|
-
import "./chunk-POGRR73N.mjs";
|
|
214
|
+
} from "./chunk-RAVYEEIC.mjs";
|
|
215
|
+
import "./chunk-XZXGYNTY.mjs";
|
|
216
|
+
import "./chunk-H3P47YXJ.mjs";
|
|
119
217
|
import {
|
|
120
218
|
Button
|
|
121
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-OE5JRLCN.mjs";
|
|
220
|
+
import "./chunk-4UMUPCDK.mjs";
|
|
221
|
+
import "./chunk-KNW2CGIP.mjs";
|
|
222
|
+
import {
|
|
223
|
+
HintPlugin
|
|
224
|
+
} from "./chunk-7QRJVZQY.mjs";
|
|
225
|
+
import "./chunk-IIVB6JNE.mjs";
|
|
122
226
|
import {
|
|
123
227
|
cn
|
|
124
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-JHXDLYEV.mjs";
|
|
125
229
|
import {
|
|
126
|
-
React,
|
|
127
230
|
__spreadProps,
|
|
128
231
|
__spreadValues,
|
|
129
232
|
init_react_shim
|
|
130
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-WYCFGRFJ.mjs";
|
|
131
234
|
|
|
132
235
|
// src/index.ts
|
|
133
236
|
init_react_shim();
|
|
134
237
|
|
|
135
238
|
// src/components/editor/index.tsx
|
|
136
239
|
init_react_shim();
|
|
137
|
-
import
|
|
240
|
+
import { useMemo as useMemo2 } from "react";
|
|
241
|
+
import "./themes/theme.css";
|
|
138
242
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
139
|
-
|
|
140
|
-
// src/components/editor/themes/editor-theme.ts
|
|
141
|
-
init_react_shim();
|
|
142
|
-
var theme = {
|
|
143
|
-
code: `
|
|
144
|
-
bg-[#e1e1e1] dark:bg-[#1a1a1a] m-0 text-sm
|
|
145
|
-
overflow-auto relative pl-[52px] p-3 font-mono group
|
|
146
|
-
rounded-sm w-full h-fit block line-code
|
|
147
|
-
`,
|
|
148
|
-
codeHighlight: {
|
|
149
|
-
atrule: "PlaygroundEditorTheme__tokenAttr",
|
|
150
|
-
attr: "PlaygroundEditorTheme__tokenAttr",
|
|
151
|
-
boolean: "PlaygroundEditorTheme__tokenProperty",
|
|
152
|
-
builtin: "PlaygroundEditorTheme__tokenSelector",
|
|
153
|
-
cdata: "PlaygroundEditorTheme__tokenComment",
|
|
154
|
-
char: "PlaygroundEditorTheme__tokenSelector",
|
|
155
|
-
class: "PlaygroundEditorTheme__tokenFunction",
|
|
156
|
-
"class-name": "PlaygroundEditorTheme__tokenFunction",
|
|
157
|
-
comment: "PlaygroundEditorTheme__tokenComment",
|
|
158
|
-
constant: "PlaygroundEditorTheme__tokenProperty",
|
|
159
|
-
deleted: "PlaygroundEditorTheme__tokenProperty",
|
|
160
|
-
doctype: "PlaygroundEditorTheme__tokenComment",
|
|
161
|
-
entity: "PlaygroundEditorTheme__tokenOperator",
|
|
162
|
-
function: "PlaygroundEditorTheme__tokenFunction",
|
|
163
|
-
important: "PlaygroundEditorTheme__tokenVariable",
|
|
164
|
-
inserted: "PlaygroundEditorTheme__tokenSelector",
|
|
165
|
-
keyword: "PlaygroundEditorTheme__tokenAttr",
|
|
166
|
-
namespace: "PlaygroundEditorTheme__tokenVariable",
|
|
167
|
-
number: "PlaygroundEditorTheme__tokenProperty",
|
|
168
|
-
operator: "PlaygroundEditorTheme__tokenOperator",
|
|
169
|
-
prolog: "PlaygroundEditorTheme__tokenComment",
|
|
170
|
-
property: "PlaygroundEditorTheme__tokenProperty",
|
|
171
|
-
punctuation: "PlaygroundEditorTheme__tokenPunctuation",
|
|
172
|
-
regex: "PlaygroundEditorTheme__tokenVariable",
|
|
173
|
-
selector: "PlaygroundEditorTheme__tokenSelector",
|
|
174
|
-
string: "PlaygroundEditorTheme__tokenSelector",
|
|
175
|
-
symbol: "PlaygroundEditorTheme__tokenProperty",
|
|
176
|
-
tag: "PlaygroundEditorTheme__tokenProperty",
|
|
177
|
-
url: "PlaygroundEditorTheme__tokenOperator",
|
|
178
|
-
variable: "PlaygroundEditorTheme__tokenVariable"
|
|
179
|
-
},
|
|
180
|
-
embedBlock: {
|
|
181
|
-
base: "PlaygroundEditorTheme__embedBlock",
|
|
182
|
-
focus: "PlaygroundEditorTheme__embedBlockFocus"
|
|
183
|
-
},
|
|
184
|
-
list: {
|
|
185
|
-
checklist: "PlaygroundEditorTheme__checklist",
|
|
186
|
-
listitem: "PlaygroundEditorTheme__listItem",
|
|
187
|
-
listitemChecked: "PlaygroundEditorTheme__listItemChecked",
|
|
188
|
-
listitemUnchecked: "PlaygroundEditorTheme__listItemUnchecked",
|
|
189
|
-
nested: {
|
|
190
|
-
listitem: "PlaygroundEditorTheme__nestedListItem"
|
|
191
|
-
},
|
|
192
|
-
olDepth: [
|
|
193
|
-
"PlaygroundEditorTheme__ol1 ",
|
|
194
|
-
"PlaygroundEditorTheme__ol2",
|
|
195
|
-
"PlaygroundEditorTheme__ol3",
|
|
196
|
-
"PlaygroundEditorTheme__ol4",
|
|
197
|
-
"PlaygroundEditorTheme__ol5"
|
|
198
|
-
],
|
|
199
|
-
ulDepth: [
|
|
200
|
-
"PlaygroundEditorTheme__ul1",
|
|
201
|
-
"PlaygroundEditorTheme__ul2",
|
|
202
|
-
"PlaygroundEditorTheme__ul3",
|
|
203
|
-
"PlaygroundEditorTheme__ul4",
|
|
204
|
-
"PlaygroundEditorTheme__ul5"
|
|
205
|
-
],
|
|
206
|
-
ul: "ul",
|
|
207
|
-
ol: "ol"
|
|
208
|
-
},
|
|
209
|
-
paragraph: "leading-7",
|
|
210
|
-
link: `underline cursor-pointer text-blue-600 after:content-['_\u2197']`,
|
|
211
|
-
hr: "w-full h-1 border-input",
|
|
212
|
-
table: "PlaygroundEditorTheme__table",
|
|
213
|
-
tableCell: "PlaygroundEditorTheme__tableCell",
|
|
214
|
-
tableCellActionButton: "PlaygroundEditorTheme__tableCellActionButton",
|
|
215
|
-
tableCellActionButtonContainer: "PlaygroundEditorTheme__tableCellActionButtonContainer",
|
|
216
|
-
tableCellHeader: "PlaygroundEditorTheme__tableCellHeader",
|
|
217
|
-
tableCellResizer: "PlaygroundEditorTheme__tableCellResizer",
|
|
218
|
-
tableCellSelected: "PlaygroundEditorTheme__tableCellSelected",
|
|
219
|
-
tableRowStriping: "PlaygroundEditorTheme__tableRowStriping",
|
|
220
|
-
tableScrollableWrapper: "PlaygroundEditorTheme__tableScrollableWrapper",
|
|
221
|
-
tableSelected: "PlaygroundEditorTheme__tableSelected",
|
|
222
|
-
tableSelection: "PlaygroundEditorTheme__tableSelection",
|
|
223
|
-
layoutContainer: "grid gap-[10px] my-[10px] ",
|
|
224
|
-
layoutItem: "px-2 py-[16px] border dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-50 border border-zinc-200 bg-white/90 shadow-md rounded-sm",
|
|
225
|
-
heading: {
|
|
226
|
-
h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",
|
|
227
|
-
h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
|
|
228
|
-
h3: "scroll-m-20 text-2xl font-semibold tracking-tight",
|
|
229
|
-
h4: "scroll-m-20 text-xl font-semibold tracking-tight",
|
|
230
|
-
h5: "text-lg font-bold",
|
|
231
|
-
h6: "text-sm font-bold"
|
|
232
|
-
},
|
|
233
|
-
quote: "mt-6 border-l-[4px] pl-6 italic",
|
|
234
|
-
text: {
|
|
235
|
-
bold: "font-bold",
|
|
236
|
-
capitalize: "capitalize",
|
|
237
|
-
code: "inline-flex items-center rounded-sm border border-zinc-200 px-0.1 py-0 h-fit min-h-[20px] transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:border-zinc-800 dark:focus:ring-zinc-300 border-transparent bg-zinc-100 text-zinc-900 hover:bg-zinc-100/80 dark:bg-zinc-800 dark:text-zinc-50 dark:hover:bg-zinc-800/80",
|
|
238
|
-
italic: "italic ",
|
|
239
|
-
lowercase: "lowercase",
|
|
240
|
-
strikethrough: "line-through",
|
|
241
|
-
underline: "underline",
|
|
242
|
-
underlineStrikethrough: "underline line-through",
|
|
243
|
-
uppercase: "uppercase"
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
var editor_theme_default = theme;
|
|
243
|
+
import { LexicalCollaboration } from "@lexical/react/LexicalCollaborationContext";
|
|
247
244
|
|
|
248
245
|
// src/components/editor/Core.tsx
|
|
249
246
|
init_react_shim();
|
|
250
|
-
import { useCallback as
|
|
247
|
+
import { useCallback as useCallback3, useEffect as useEffect8, useRef as useRef3, useState as useState3 } from "react";
|
|
251
248
|
import { useLexicalEditable as useLexicalEditable2 } from "@lexical/react/useLexicalEditable";
|
|
252
|
-
import { useLexicalComposerContext as
|
|
249
|
+
import { useLexicalComposerContext as useLexicalComposerContext8 } from "@lexical/react/LexicalComposerContext";
|
|
253
250
|
import dynamic from "next/dynamic.js";
|
|
254
251
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
255
252
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
@@ -258,6 +255,9 @@ import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
|
258
255
|
import { HorizontalRulePlugin } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
259
256
|
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
260
257
|
import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
|
|
258
|
+
import { INSERT_TABLE_COMMAND, $createTableNodeWithDimensions } from "@lexical/table";
|
|
259
|
+
import { $insertNodeToNearestRoot as $insertNodeToNearestRoot3 } from "@lexical/utils";
|
|
260
|
+
import { $isElementNode as $isElementNode2, COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR3 } from "lexical";
|
|
261
261
|
import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
262
262
|
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
|
|
263
263
|
|
|
@@ -448,7 +448,6 @@ import {
|
|
|
448
448
|
} from "@lexical/table";
|
|
449
449
|
import { calculateZoomLevel } from "@lexical/utils";
|
|
450
450
|
import { $getNearestNodeFromDOMNode, isHTMLElement } from "lexical";
|
|
451
|
-
import * as React2 from "react";
|
|
452
451
|
import {
|
|
453
452
|
useCallback,
|
|
454
453
|
useEffect as useEffect3,
|
|
@@ -457,6 +456,7 @@ import {
|
|
|
457
456
|
useState
|
|
458
457
|
} from "react";
|
|
459
458
|
import { createPortal } from "react-dom";
|
|
459
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
460
460
|
var MIN_ROW_HEIGHT = 33;
|
|
461
461
|
var MIN_COLUMN_WIDTH = 92;
|
|
462
462
|
function TableCellResizer({ editor }) {
|
|
@@ -738,7 +738,8 @@ function TableCellResizer({ editor }) {
|
|
|
738
738
|
styles[draggingDirection].width = "3px";
|
|
739
739
|
styles[draggingDirection].height = `${tableRect.height}px`;
|
|
740
740
|
}
|
|
741
|
-
styles[draggingDirection].backgroundColor = "#
|
|
741
|
+
styles[draggingDirection].backgroundColor = "#10b981";
|
|
742
|
+
styles[draggingDirection].boxShadow = "0 0 8px rgba(16, 185, 129, 0.5)";
|
|
742
743
|
}
|
|
743
744
|
return styles;
|
|
744
745
|
}
|
|
@@ -750,21 +751,24 @@ function TableCellResizer({ editor }) {
|
|
|
750
751
|
};
|
|
751
752
|
}, [activeCell, draggingDirection, mouseCurrentPos]);
|
|
752
753
|
const resizerStyles = getResizers();
|
|
753
|
-
return /* @__PURE__ */
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
754
|
+
return /* @__PURE__ */ jsx("div", { ref: resizerRef, children: activeCell != null && !isMouseDown && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
755
|
+
/* @__PURE__ */ jsx(
|
|
756
|
+
"div",
|
|
757
|
+
{
|
|
758
|
+
className: " absolute TableCellResizer__ui",
|
|
759
|
+
style: resizerStyles.right || void 0,
|
|
760
|
+
onMouseDown: toggleResize("right")
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
/* @__PURE__ */ jsx(
|
|
764
|
+
"div",
|
|
765
|
+
{
|
|
766
|
+
className: "absolute TableCellResizer__ui",
|
|
767
|
+
style: resizerStyles.bottom || void 0,
|
|
768
|
+
onMouseDown: toggleResize("bottom")
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
] }) });
|
|
768
772
|
}
|
|
769
773
|
function TableCellResizerPlugin() {
|
|
770
774
|
const [editor] = useLexicalComposerContext2();
|
|
@@ -775,7 +779,7 @@ function TableCellResizerPlugin() {
|
|
|
775
779
|
}, []);
|
|
776
780
|
const portal = useMemo(() => {
|
|
777
781
|
if (!mounted || !isEditable) return null;
|
|
778
|
-
return createPortal(/* @__PURE__ */
|
|
782
|
+
return createPortal(/* @__PURE__ */ jsx(TableCellResizer, { editor }), document.body);
|
|
779
783
|
}, [mounted, isEditable, editor]);
|
|
780
784
|
return portal;
|
|
781
785
|
}
|
|
@@ -829,40 +833,320 @@ function DragDropPaste() {
|
|
|
829
833
|
|
|
830
834
|
// src/components/editor/plugins/DraggableBlockPlugin/index.tsx
|
|
831
835
|
init_react_shim();
|
|
836
|
+
import { useRef as useRef2, useState as useState2, useCallback as useCallback2 } from "react";
|
|
837
|
+
import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
|
|
832
838
|
import { DraggableBlockPlugin_EXPERIMENTAL } from "@lexical/react/LexicalDraggableBlockPlugin";
|
|
833
|
-
import {
|
|
839
|
+
import {
|
|
840
|
+
$getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode2,
|
|
841
|
+
$createParagraphNode,
|
|
842
|
+
$createTextNode,
|
|
843
|
+
$isElementNode
|
|
844
|
+
} from "lexical";
|
|
845
|
+
import {
|
|
846
|
+
$createHeadingNode,
|
|
847
|
+
$createQuoteNode
|
|
848
|
+
} from "@lexical/rich-text";
|
|
849
|
+
import { $createCodeNode } from "@lexical/code";
|
|
850
|
+
import {
|
|
851
|
+
$createListNode,
|
|
852
|
+
$createListItemNode
|
|
853
|
+
} from "@lexical/list";
|
|
854
|
+
import {
|
|
855
|
+
GripVertical,
|
|
856
|
+
Plus,
|
|
857
|
+
Heading1,
|
|
858
|
+
Heading2,
|
|
859
|
+
Heading3,
|
|
860
|
+
Quote,
|
|
861
|
+
Code as Code2,
|
|
862
|
+
List,
|
|
863
|
+
ListOrdered,
|
|
864
|
+
Columns2,
|
|
865
|
+
Columns3,
|
|
866
|
+
Copy,
|
|
867
|
+
Trash2,
|
|
868
|
+
Sparkles
|
|
869
|
+
} from "lucide-react";
|
|
870
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
834
871
|
var DRAGGABLE_BLOCK_MENU_CLASSNAME = "draggable-block-menu";
|
|
835
872
|
function DraggableBlockPlugin({
|
|
836
|
-
anchorElem = document.body,
|
|
873
|
+
anchorElem = typeof document !== "undefined" ? document.body : void 0,
|
|
837
874
|
className
|
|
838
875
|
}) {
|
|
876
|
+
const [editor] = useLexicalComposerContext4();
|
|
839
877
|
const menuRef = useRef2(null);
|
|
840
878
|
const targetLineRef = useRef2(null);
|
|
879
|
+
const [isMenuOpen, setIsMenuOpen] = useState2(false);
|
|
880
|
+
const getTargetNode = useCallback2(() => {
|
|
881
|
+
if (!menuRef.current) return null;
|
|
882
|
+
const rect = menuRef.current.getBoundingClientRect();
|
|
883
|
+
const targetElem = document.elementFromPoint(
|
|
884
|
+
rect.right + 32,
|
|
885
|
+
rect.top + rect.height / 2
|
|
886
|
+
);
|
|
887
|
+
if (!targetElem) return null;
|
|
888
|
+
let targetNode = null;
|
|
889
|
+
const resolve = () => {
|
|
890
|
+
const node = $getNearestNodeFromDOMNode2(targetElem);
|
|
891
|
+
if (node) {
|
|
892
|
+
targetNode = node.getKey() === "root" ? node : node.getTopLevelElement() || ($isElementNode(node) ? node : null);
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
try {
|
|
896
|
+
resolve();
|
|
897
|
+
} catch (e) {
|
|
898
|
+
editor.read(resolve);
|
|
899
|
+
}
|
|
900
|
+
return targetNode;
|
|
901
|
+
}, [editor]);
|
|
902
|
+
const handleInsertBelow = () => {
|
|
903
|
+
editor.update(
|
|
904
|
+
() => {
|
|
905
|
+
const targetNode = getTargetNode();
|
|
906
|
+
if (targetNode) {
|
|
907
|
+
const p = $createParagraphNode();
|
|
908
|
+
targetNode.insertAfter(p);
|
|
909
|
+
p.select();
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
{ discrete: true }
|
|
913
|
+
);
|
|
914
|
+
};
|
|
915
|
+
const handleTurnInto = (type) => {
|
|
916
|
+
editor.update(
|
|
917
|
+
() => {
|
|
918
|
+
const targetNode = getTargetNode();
|
|
919
|
+
if (!targetNode || targetNode.getKey() === "root") return;
|
|
920
|
+
let replacement = null;
|
|
921
|
+
switch (type) {
|
|
922
|
+
case "h1":
|
|
923
|
+
replacement = $createHeadingNode("h1");
|
|
924
|
+
break;
|
|
925
|
+
case "h2":
|
|
926
|
+
replacement = $createHeadingNode("h2");
|
|
927
|
+
break;
|
|
928
|
+
case "h3":
|
|
929
|
+
replacement = $createHeadingNode("h3");
|
|
930
|
+
break;
|
|
931
|
+
case "quote":
|
|
932
|
+
replacement = $createQuoteNode();
|
|
933
|
+
break;
|
|
934
|
+
case "code":
|
|
935
|
+
replacement = $createCodeNode();
|
|
936
|
+
break;
|
|
937
|
+
case "bullet": {
|
|
938
|
+
const list = $createListNode("bullet");
|
|
939
|
+
const item = $createListItemNode();
|
|
940
|
+
list.append(item);
|
|
941
|
+
replacement = list;
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
case "number": {
|
|
945
|
+
const list = $createListNode("number");
|
|
946
|
+
const item = $createListItemNode();
|
|
947
|
+
list.append(item);
|
|
948
|
+
replacement = list;
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
if (replacement && $isElementNode(targetNode)) {
|
|
953
|
+
const children = targetNode.getChildren();
|
|
954
|
+
if ($isElementNode(replacement)) {
|
|
955
|
+
replacement.append(...children);
|
|
956
|
+
}
|
|
957
|
+
targetNode.replace(replacement);
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
{ discrete: true }
|
|
961
|
+
);
|
|
962
|
+
};
|
|
963
|
+
const handleSplitColumns = (columns) => {
|
|
964
|
+
editor.update(
|
|
965
|
+
() => {
|
|
966
|
+
const targetNode = getTargetNode();
|
|
967
|
+
if (!targetNode || targetNode.getKey() === "root") return;
|
|
968
|
+
const template = columns === 2 ? "1fr 1fr" : "1fr 1fr 1fr";
|
|
969
|
+
const container = $createLayoutContainerNode(template);
|
|
970
|
+
const col1 = $createLayoutItemNode();
|
|
971
|
+
const col2 = $createLayoutItemNode();
|
|
972
|
+
const cloned = targetNode;
|
|
973
|
+
col1.append(cloned);
|
|
974
|
+
col2.append($createParagraphNode());
|
|
975
|
+
if (columns === 3) {
|
|
976
|
+
const col3 = $createLayoutItemNode();
|
|
977
|
+
col3.append($createParagraphNode());
|
|
978
|
+
container.append(col1, col2, col3);
|
|
979
|
+
} else {
|
|
980
|
+
container.append(col1, col2);
|
|
981
|
+
}
|
|
982
|
+
targetNode.replace(container);
|
|
983
|
+
},
|
|
984
|
+
{ discrete: true }
|
|
985
|
+
);
|
|
986
|
+
};
|
|
987
|
+
const handleDuplicate = () => {
|
|
988
|
+
editor.update(
|
|
989
|
+
() => {
|
|
990
|
+
const targetNode = getTargetNode();
|
|
991
|
+
if (targetNode && targetNode.getKey() !== "root") {
|
|
992
|
+
const p = $createParagraphNode();
|
|
993
|
+
p.append($createTextNode(targetNode.getTextContent()));
|
|
994
|
+
targetNode.insertAfter(p);
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
{ discrete: true }
|
|
998
|
+
);
|
|
999
|
+
};
|
|
1000
|
+
const handleDelete = () => {
|
|
1001
|
+
editor.update(
|
|
1002
|
+
() => {
|
|
1003
|
+
const targetNode = getTargetNode();
|
|
1004
|
+
if (targetNode && targetNode.getKey() !== "root") {
|
|
1005
|
+
targetNode.remove();
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
{ discrete: true }
|
|
1009
|
+
);
|
|
1010
|
+
};
|
|
1011
|
+
const handleAskAI = () => {
|
|
1012
|
+
editor.dispatchCommand(OPEN_AI_COMMAND_BAR_COMMAND, {
|
|
1013
|
+
initialPrompt: "",
|
|
1014
|
+
action: "ImproveWriting"
|
|
1015
|
+
});
|
|
1016
|
+
};
|
|
841
1017
|
const isOnMenu = (element) => {
|
|
842
1018
|
return !!element.closest(`.${DRAGGABLE_BLOCK_MENU_CLASSNAME}`);
|
|
843
1019
|
};
|
|
844
|
-
|
|
1020
|
+
if (!anchorElem) return null;
|
|
1021
|
+
return /* @__PURE__ */ jsx2(
|
|
845
1022
|
DraggableBlockPlugin_EXPERIMENTAL,
|
|
846
1023
|
{
|
|
847
1024
|
anchorElem,
|
|
848
1025
|
menuRef,
|
|
849
1026
|
targetLineRef,
|
|
850
|
-
menuComponent: /* @__PURE__ */
|
|
851
|
-
"
|
|
1027
|
+
menuComponent: /* @__PURE__ */ jsxs2(
|
|
1028
|
+
"div",
|
|
852
1029
|
{
|
|
853
|
-
|
|
854
|
-
className:
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1030
|
+
ref: menuRef,
|
|
1031
|
+
className: cn(
|
|
1032
|
+
"draggable-block-menu flex items-center gap-0.5 rounded-md border border-border/40 bg-background/90 text-muted-foreground shadow-sm backdrop-blur transition-all duration-150 group z-40 absolute top-0 left-0",
|
|
1033
|
+
className
|
|
1034
|
+
),
|
|
1035
|
+
children: [
|
|
1036
|
+
/* @__PURE__ */ jsx2(
|
|
1037
|
+
"button",
|
|
1038
|
+
{
|
|
1039
|
+
type: "button",
|
|
1040
|
+
onClick: handleInsertBelow,
|
|
1041
|
+
className: "flex items-center justify-center w-5 h-5 rounded hover:bg-muted hover:text-foreground transition-colors",
|
|
1042
|
+
title: "Insert block below",
|
|
1043
|
+
children: /* @__PURE__ */ jsx2(Plus, { className: "w-3.5 h-3.5" })
|
|
1044
|
+
}
|
|
1045
|
+
),
|
|
1046
|
+
/* @__PURE__ */ jsxs2(DropdownMenu, { open: isMenuOpen, onOpenChange: setIsMenuOpen, children: [
|
|
1047
|
+
/* @__PURE__ */ jsx2(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
1048
|
+
"button",
|
|
1049
|
+
{
|
|
1050
|
+
type: "button",
|
|
1051
|
+
className: "flex items-center justify-center w-5 h-5 rounded cursor-grab active:cursor-grabbing hover:bg-muted hover:text-foreground transition-colors",
|
|
1052
|
+
title: "Drag to move or click for block actions",
|
|
1053
|
+
children: /* @__PURE__ */ jsx2(GripVertical, { className: "w-3.5 h-3.5" })
|
|
1054
|
+
}
|
|
1055
|
+
) }),
|
|
1056
|
+
/* @__PURE__ */ jsxs2(
|
|
1057
|
+
DropdownMenuContent,
|
|
1058
|
+
{
|
|
1059
|
+
align: "start",
|
|
1060
|
+
side: "bottom",
|
|
1061
|
+
sideOffset: 4,
|
|
1062
|
+
className: "w-52 z-50 text-xs",
|
|
1063
|
+
children: [
|
|
1064
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: handleAskAI, className: "gap-2 font-medium text-primary", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx2(Sparkles, { className: "w-3.5 h-3.5 text-primary" }),
|
|
1066
|
+
/* @__PURE__ */ jsx2("span", { children: "Ask AI on block" }),
|
|
1067
|
+
/* @__PURE__ */ jsx2("kbd", { className: "ml-auto font-mono text-[10px] opacity-60", children: "\u2318K" })
|
|
1068
|
+
] }),
|
|
1069
|
+
/* @__PURE__ */ jsx2(DropdownMenuSeparator, {}),
|
|
1070
|
+
/* @__PURE__ */ jsxs2(DropdownMenuSub, { children: [
|
|
1071
|
+
/* @__PURE__ */ jsxs2(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
1072
|
+
/* @__PURE__ */ jsx2(Heading1, { className: "w-3.5 h-3.5 text-muted-foreground" }),
|
|
1073
|
+
/* @__PURE__ */ jsx2("span", { children: "Turn into" })
|
|
1074
|
+
] }),
|
|
1075
|
+
/* @__PURE__ */ jsxs2(DropdownMenuSubContent, { className: "w-44 text-xs", children: [
|
|
1076
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("h1"), className: "gap-2", children: [
|
|
1077
|
+
/* @__PURE__ */ jsx2(Heading1, { className: "w-3.5 h-3.5" }),
|
|
1078
|
+
/* @__PURE__ */ jsx2("span", { children: "Heading 1" })
|
|
1079
|
+
] }),
|
|
1080
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("h2"), className: "gap-2", children: [
|
|
1081
|
+
/* @__PURE__ */ jsx2(Heading2, { className: "w-3.5 h-3.5" }),
|
|
1082
|
+
/* @__PURE__ */ jsx2("span", { children: "Heading 2" })
|
|
1083
|
+
] }),
|
|
1084
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("h3"), className: "gap-2", children: [
|
|
1085
|
+
/* @__PURE__ */ jsx2(Heading3, { className: "w-3.5 h-3.5" }),
|
|
1086
|
+
/* @__PURE__ */ jsx2("span", { children: "Heading 3" })
|
|
1087
|
+
] }),
|
|
1088
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("bullet"), className: "gap-2", children: [
|
|
1089
|
+
/* @__PURE__ */ jsx2(List, { className: "w-3.5 h-3.5" }),
|
|
1090
|
+
/* @__PURE__ */ jsx2("span", { children: "Bullet List" })
|
|
1091
|
+
] }),
|
|
1092
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("number"), className: "gap-2", children: [
|
|
1093
|
+
/* @__PURE__ */ jsx2(ListOrdered, { className: "w-3.5 h-3.5" }),
|
|
1094
|
+
/* @__PURE__ */ jsx2("span", { children: "Numbered List" })
|
|
1095
|
+
] }),
|
|
1096
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("quote"), className: "gap-2", children: [
|
|
1097
|
+
/* @__PURE__ */ jsx2(Quote, { className: "w-3.5 h-3.5" }),
|
|
1098
|
+
/* @__PURE__ */ jsx2("span", { children: "Quote" })
|
|
1099
|
+
] }),
|
|
1100
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleTurnInto("code"), className: "gap-2", children: [
|
|
1101
|
+
/* @__PURE__ */ jsx2(Code2, { className: "w-3.5 h-3.5" }),
|
|
1102
|
+
/* @__PURE__ */ jsx2("span", { children: "Code Block" })
|
|
1103
|
+
] })
|
|
1104
|
+
] })
|
|
1105
|
+
] }),
|
|
1106
|
+
/* @__PURE__ */ jsxs2(DropdownMenuSub, { children: [
|
|
1107
|
+
/* @__PURE__ */ jsxs2(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
1108
|
+
/* @__PURE__ */ jsx2(Columns2, { className: "w-3.5 h-3.5 text-muted-foreground" }),
|
|
1109
|
+
/* @__PURE__ */ jsx2("span", { children: "Columns layout" })
|
|
1110
|
+
] }),
|
|
1111
|
+
/* @__PURE__ */ jsxs2(DropdownMenuSubContent, { className: "w-40 text-xs", children: [
|
|
1112
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleSplitColumns(2), className: "gap-2", children: [
|
|
1113
|
+
/* @__PURE__ */ jsx2(Columns2, { className: "w-3.5 h-3.5" }),
|
|
1114
|
+
/* @__PURE__ */ jsx2("span", { children: "2 Columns" })
|
|
1115
|
+
] }),
|
|
1116
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: () => handleSplitColumns(3), className: "gap-2", children: [
|
|
1117
|
+
/* @__PURE__ */ jsx2(Columns3, { className: "w-3.5 h-3.5" }),
|
|
1118
|
+
/* @__PURE__ */ jsx2("span", { children: "3 Columns" })
|
|
1119
|
+
] })
|
|
1120
|
+
] })
|
|
1121
|
+
] }),
|
|
1122
|
+
/* @__PURE__ */ jsx2(DropdownMenuSeparator, {}),
|
|
1123
|
+
/* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: handleDuplicate, className: "gap-2", children: [
|
|
1124
|
+
/* @__PURE__ */ jsx2(Copy, { className: "w-3.5 h-3.5 text-muted-foreground" }),
|
|
1125
|
+
/* @__PURE__ */ jsx2("span", { children: "Duplicate" })
|
|
1126
|
+
] }),
|
|
1127
|
+
/* @__PURE__ */ jsxs2(
|
|
1128
|
+
DropdownMenuItem,
|
|
1129
|
+
{
|
|
1130
|
+
onClick: handleDelete,
|
|
1131
|
+
className: "gap-2 text-destructive focus:text-destructive focus:bg-destructive/10",
|
|
1132
|
+
children: [
|
|
1133
|
+
/* @__PURE__ */ jsx2(Trash2, { className: "w-3.5 h-3.5 text-destructive" }),
|
|
1134
|
+
/* @__PURE__ */ jsx2("span", { children: "Delete" })
|
|
1135
|
+
]
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1138
|
+
]
|
|
1139
|
+
}
|
|
1140
|
+
)
|
|
1141
|
+
] })
|
|
1142
|
+
]
|
|
1143
|
+
}
|
|
1144
|
+
),
|
|
1145
|
+
targetLineComponent: /* @__PURE__ */ jsx2(
|
|
862
1146
|
"div",
|
|
863
1147
|
{
|
|
864
1148
|
ref: targetLineRef,
|
|
865
|
-
className: "cursor-none bg-
|
|
1149
|
+
className: "cursor-none h-[3px] rounded-full bg-gradient-to-r from-blue-500 to-indigo-600 shadow-sm pointer-events-none absolute left-0 top-0 opacity-0 will-change-transform z-40"
|
|
866
1150
|
}
|
|
867
1151
|
),
|
|
868
1152
|
isOnMenu
|
|
@@ -876,7 +1160,7 @@ import { ClickableLinkPlugin } from "@lexical/react/LexicalClickableLinkPlugin";
|
|
|
876
1160
|
|
|
877
1161
|
// src/components/editor/lexical-on-change.tsx
|
|
878
1162
|
init_react_shim();
|
|
879
|
-
import { useLexicalComposerContext as
|
|
1163
|
+
import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
|
|
880
1164
|
|
|
881
1165
|
// src/components/editor/utils/useLayoutEffect.ts
|
|
882
1166
|
init_react_shim();
|
|
@@ -1022,8 +1306,9 @@ var setNodePlaceholderFromSelection = (editor) => {
|
|
|
1022
1306
|
};
|
|
1023
1307
|
|
|
1024
1308
|
// src/components/editor/lexical-on-change.tsx
|
|
1309
|
+
import { Fragment as Fragment2, jsx as jsx3 } from "react/jsx-runtime";
|
|
1025
1310
|
function LexicalOnChangePlugin() {
|
|
1026
|
-
const [editor] =
|
|
1311
|
+
const [editor] = useLexicalComposerContext5();
|
|
1027
1312
|
useLayoutEffect_default(() => {
|
|
1028
1313
|
const unregisterListener = editor.registerUpdateListener(
|
|
1029
1314
|
({ editorState, dirtyElements, dirtyLeaves, prevEditorState, tags }) => {
|
|
@@ -1037,597 +1322,673 @@ function LexicalOnChangePlugin() {
|
|
|
1037
1322
|
unregisterListener();
|
|
1038
1323
|
};
|
|
1039
1324
|
}, [editor]);
|
|
1040
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ jsx3(Fragment2, {});
|
|
1041
1326
|
}
|
|
1042
1327
|
|
|
1043
|
-
// src/components/editor/
|
|
1044
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
1045
|
-
import { Sparkles, Lightbulb, Quote } from "lucide-react";
|
|
1046
|
-
|
|
1047
|
-
// src/components/editor/plugins/ContentAnalyticsPlugin/index.tsx
|
|
1328
|
+
// src/components/editor/plugins/AudioPlugin/index.tsx
|
|
1048
1329
|
init_react_shim();
|
|
1049
|
-
import {
|
|
1050
|
-
import {
|
|
1051
|
-
import {
|
|
1052
|
-
import {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
import { Clock, Eye, BarChart3, Target, BookOpen, TrendingUp, Zap, ChevronLeft, ChevronRight } from "lucide-react";
|
|
1056
|
-
function calculateReadabilityScore(avgWordsPerSentence, avgSyllablesPerWord) {
|
|
1057
|
-
const score = 206.835 - 1.015 * avgWordsPerSentence - 84.6 * avgSyllablesPerWord;
|
|
1058
|
-
return Math.max(0, Math.min(100, score));
|
|
1059
|
-
}
|
|
1060
|
-
function calculateEngagementScore(metrics, structure) {
|
|
1061
|
-
let score = 50;
|
|
1062
|
-
if (metrics.wordCount >= 500 && metrics.wordCount <= 2e3) {
|
|
1063
|
-
score += 15;
|
|
1064
|
-
} else if (metrics.wordCount > 2e3) {
|
|
1065
|
-
score += 10;
|
|
1066
|
-
}
|
|
1067
|
-
if (structure.structureScore > 70) score += 10;
|
|
1068
|
-
if (metrics.imageCount > 0) score += 5;
|
|
1069
|
-
if (metrics.listCount > 0) score += 5;
|
|
1070
|
-
if (metrics.codeBlockCount > 0) score += 3;
|
|
1071
|
-
if (metrics.readabilityScore > 60) score += 10;
|
|
1072
|
-
if (metrics.linkCount > 0 && metrics.linkCount <= 10) score += 5;
|
|
1073
|
-
return Math.max(0, Math.min(100, score));
|
|
1074
|
-
}
|
|
1075
|
-
function estimateSyllables(word) {
|
|
1076
|
-
word = word.toLowerCase();
|
|
1077
|
-
if (word.length <= 3) return 1;
|
|
1078
|
-
const vowels = "aeiouy";
|
|
1079
|
-
let syllables = 0;
|
|
1080
|
-
let previousWasVowel = false;
|
|
1081
|
-
for (let i = 0; i < word.length; i++) {
|
|
1082
|
-
const isVowel = vowels.includes(word[i]);
|
|
1083
|
-
if (isVowel && !previousWasVowel) {
|
|
1084
|
-
syllables++;
|
|
1085
|
-
}
|
|
1086
|
-
previousWasVowel = isVowel;
|
|
1087
|
-
}
|
|
1088
|
-
if (word.endsWith("e")) syllables--;
|
|
1089
|
-
return Math.max(1, syllables);
|
|
1090
|
-
}
|
|
1091
|
-
function ContentAnalyticsPlugin() {
|
|
1092
|
-
const [editor] = useLexicalComposerContext5();
|
|
1093
|
-
const [metrics, setMetrics] = useState2({
|
|
1094
|
-
wordCount: 0,
|
|
1095
|
-
readingTime: 0,
|
|
1096
|
-
paragraphCount: 0,
|
|
1097
|
-
headingCount: 0,
|
|
1098
|
-
listCount: 0,
|
|
1099
|
-
codeBlockCount: 0,
|
|
1100
|
-
imageCount: 0,
|
|
1101
|
-
linkCount: 0,
|
|
1102
|
-
sentenceCount: 0,
|
|
1103
|
-
avgWordsPerSentence: 0,
|
|
1104
|
-
readabilityScore: 0,
|
|
1105
|
-
engagementScore: 0
|
|
1106
|
-
});
|
|
1107
|
-
const [structure, setStructure] = useState2({
|
|
1108
|
-
h1Count: 0,
|
|
1109
|
-
h2Count: 0,
|
|
1110
|
-
h3Count: 0,
|
|
1111
|
-
hasIntroduction: false,
|
|
1112
|
-
hasConclusion: false,
|
|
1113
|
-
structureScore: 0
|
|
1114
|
-
});
|
|
1115
|
-
const [isVisible, setIsVisible] = useState2(false);
|
|
1116
|
-
const [isPanelHidden, setIsPanelHidden] = useState2(false);
|
|
1330
|
+
import { useEffect as useEffect6 } from "react";
|
|
1331
|
+
import { useLexicalComposerContext as useLexicalComposerContext6 } from "@lexical/react/LexicalComposerContext";
|
|
1332
|
+
import { $insertNodeToNearestRoot } from "@lexical/utils";
|
|
1333
|
+
import { COMMAND_PRIORITY_EDITOR } from "lexical";
|
|
1334
|
+
function AudioPlugin() {
|
|
1335
|
+
const [editor] = useLexicalComposerContext6();
|
|
1117
1336
|
useEffect6(() => {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
let listCount = 0;
|
|
1128
|
-
let codeBlockCount = 0;
|
|
1129
|
-
let imageCount = 0;
|
|
1130
|
-
let linkCount = 0;
|
|
1131
|
-
let h1Count = 0;
|
|
1132
|
-
let h2Count = 0;
|
|
1133
|
-
let h3Count = 0;
|
|
1134
|
-
const children = root.getChildren();
|
|
1135
|
-
children.forEach((child) => {
|
|
1136
|
-
if ($isHeadingNode2(child)) {
|
|
1137
|
-
headingCount++;
|
|
1138
|
-
const tag = child.getTag();
|
|
1139
|
-
if (tag === "h1") h1Count++;
|
|
1140
|
-
else if (tag === "h2") h2Count++;
|
|
1141
|
-
else if (tag === "h3") h3Count++;
|
|
1142
|
-
} else if ($isListNode(child)) {
|
|
1143
|
-
listCount++;
|
|
1144
|
-
} else if ($isCodeNode(child)) {
|
|
1145
|
-
codeBlockCount++;
|
|
1146
|
-
} else if (child.getType() === "paragraph") {
|
|
1147
|
-
paragraphCount++;
|
|
1148
|
-
}
|
|
1149
|
-
const countInNode = (node) => {
|
|
1150
|
-
if (node.getType() === "image" || node.getType() === "inline-image") {
|
|
1151
|
-
imageCount++;
|
|
1152
|
-
}
|
|
1153
|
-
if (node.getType() === "link") {
|
|
1154
|
-
linkCount++;
|
|
1155
|
-
}
|
|
1156
|
-
if (node.getChildren) {
|
|
1157
|
-
node.getChildren().forEach(countInNode);
|
|
1158
|
-
}
|
|
1159
|
-
};
|
|
1160
|
-
countInNode(child);
|
|
1337
|
+
if (!editor.hasNodes([AudioNode])) {
|
|
1338
|
+
throw new Error("AudioPlugin: AudioNode not registered on editor");
|
|
1339
|
+
}
|
|
1340
|
+
return editor.registerCommand(
|
|
1341
|
+
INSERT_AUDIO_COMMAND,
|
|
1342
|
+
(payload) => {
|
|
1343
|
+
editor.update(() => {
|
|
1344
|
+
const audioNode = $createAudioNode(payload);
|
|
1345
|
+
$insertNodeToNearestRoot(audioNode);
|
|
1161
1346
|
});
|
|
1162
|
-
|
|
1163
|
-
const sentenceCount = sentences.length;
|
|
1164
|
-
const avgWordsPerSentence = sentenceCount > 0 ? wordCount / sentenceCount : 0;
|
|
1165
|
-
const totalSyllables = words.reduce((sum, word) => sum + estimateSyllables(word), 0);
|
|
1166
|
-
const avgSyllablesPerWord = wordCount > 0 ? totalSyllables / wordCount : 0;
|
|
1167
|
-
const readabilityScore = calculateReadabilityScore(avgWordsPerSentence, avgSyllablesPerWord);
|
|
1168
|
-
const hasIntroduction = paragraphCount > 0;
|
|
1169
|
-
const hasConclusion = paragraphCount > 2;
|
|
1170
|
-
let structureScore = 0;
|
|
1171
|
-
if (h1Count === 1) structureScore += 20;
|
|
1172
|
-
if (h2Count >= 2) structureScore += 20;
|
|
1173
|
-
if (hasIntroduction) structureScore += 15;
|
|
1174
|
-
if (hasConclusion) structureScore += 15;
|
|
1175
|
-
if (listCount > 0) structureScore += 10;
|
|
1176
|
-
if (imageCount > 0) structureScore += 10;
|
|
1177
|
-
if (linkCount > 0 && linkCount <= 10) structureScore += 10;
|
|
1178
|
-
const newStructure = {
|
|
1179
|
-
h1Count,
|
|
1180
|
-
h2Count,
|
|
1181
|
-
h3Count,
|
|
1182
|
-
hasIntroduction,
|
|
1183
|
-
hasConclusion,
|
|
1184
|
-
structureScore
|
|
1185
|
-
};
|
|
1186
|
-
const newMetrics = {
|
|
1187
|
-
wordCount,
|
|
1188
|
-
readingTime,
|
|
1189
|
-
paragraphCount,
|
|
1190
|
-
headingCount,
|
|
1191
|
-
listCount,
|
|
1192
|
-
codeBlockCount,
|
|
1193
|
-
imageCount,
|
|
1194
|
-
linkCount,
|
|
1195
|
-
sentenceCount,
|
|
1196
|
-
avgWordsPerSentence,
|
|
1197
|
-
readabilityScore,
|
|
1198
|
-
engagementScore: calculateEngagementScore(
|
|
1199
|
-
{
|
|
1200
|
-
wordCount,
|
|
1201
|
-
readingTime,
|
|
1202
|
-
paragraphCount,
|
|
1203
|
-
headingCount,
|
|
1204
|
-
listCount,
|
|
1205
|
-
codeBlockCount,
|
|
1206
|
-
imageCount,
|
|
1207
|
-
linkCount,
|
|
1208
|
-
sentenceCount,
|
|
1209
|
-
avgWordsPerSentence,
|
|
1210
|
-
readabilityScore,
|
|
1211
|
-
engagementScore: 0
|
|
1212
|
-
},
|
|
1213
|
-
newStructure
|
|
1214
|
-
)
|
|
1215
|
-
};
|
|
1216
|
-
setMetrics(newMetrics);
|
|
1217
|
-
setStructure(newStructure);
|
|
1218
|
-
});
|
|
1219
|
-
};
|
|
1220
|
-
const unregister = editor.registerUpdateListener(() => {
|
|
1221
|
-
updateMetrics();
|
|
1222
|
-
});
|
|
1223
|
-
updateMetrics();
|
|
1224
|
-
return unregister;
|
|
1225
|
-
}, [editor]);
|
|
1226
|
-
useEffect6(() => {
|
|
1227
|
-
setIsVisible(metrics.wordCount > 10);
|
|
1228
|
-
}, [metrics.wordCount]);
|
|
1229
|
-
if (!isVisible) return null;
|
|
1230
|
-
const getReadabilityLabel = (score) => {
|
|
1231
|
-
if (score >= 90) return { label: "Very Easy", color: "bg-green-500" };
|
|
1232
|
-
if (score >= 80) return { label: "Easy", color: "bg-green-400" };
|
|
1233
|
-
if (score >= 70) return { label: "Fairly Easy", color: "bg-yellow-400" };
|
|
1234
|
-
if (score >= 60) return { label: "Standard", color: "bg-yellow-500" };
|
|
1235
|
-
if (score >= 50) return { label: "Fairly Difficult", color: "bg-orange-400" };
|
|
1236
|
-
if (score >= 30) return { label: "Difficult", color: "bg-red-400" };
|
|
1237
|
-
return { label: "Very Difficult", color: "bg-red-500" };
|
|
1238
|
-
};
|
|
1239
|
-
const getEngagementLabel = (score) => {
|
|
1240
|
-
if (score >= 80) return { label: "Excellent", color: "text-green-600" };
|
|
1241
|
-
if (score >= 60) return { label: "Good", color: "text-yellow-600" };
|
|
1242
|
-
if (score >= 40) return { label: "Fair", color: "text-orange-600" };
|
|
1243
|
-
return { label: "Needs Work", color: "text-red-600" };
|
|
1244
|
-
};
|
|
1245
|
-
const readability = getReadabilityLabel(metrics.readabilityScore);
|
|
1246
|
-
const engagement = getEngagementLabel(metrics.engagementScore);
|
|
1247
|
-
return /* @__PURE__ */ React.createElement(
|
|
1248
|
-
"div",
|
|
1249
|
-
{
|
|
1250
|
-
className: cn(
|
|
1251
|
-
"fixed top-20 right-4 z-50 transition-transform duration-300 ease-in-out",
|
|
1252
|
-
isPanelHidden ? "translate-x-full" : "translate-x-0"
|
|
1253
|
-
)
|
|
1254
|
-
},
|
|
1255
|
-
/* @__PURE__ */ React.createElement(
|
|
1256
|
-
Button,
|
|
1257
|
-
{
|
|
1258
|
-
variant: "outline",
|
|
1259
|
-
size: "sm",
|
|
1260
|
-
onClick: () => setIsPanelHidden(!isPanelHidden),
|
|
1261
|
-
className: cn(
|
|
1262
|
-
"absolute top-4 -left-10 z-10 h-8 w-8 p-0 bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm shadow-lg border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800",
|
|
1263
|
-
isPanelHidden && "-left-8"
|
|
1264
|
-
)
|
|
1347
|
+
return true;
|
|
1265
1348
|
},
|
|
1266
|
-
|
|
1267
|
-
)
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1349
|
+
COMMAND_PRIORITY_EDITOR
|
|
1350
|
+
);
|
|
1351
|
+
}, [editor]);
|
|
1352
|
+
return null;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// src/components/editor/plugins/FilePlugin/index.tsx
|
|
1356
|
+
init_react_shim();
|
|
1357
|
+
import { useEffect as useEffect7 } from "react";
|
|
1358
|
+
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
1359
|
+
import { $insertNodeToNearestRoot as $insertNodeToNearestRoot2 } from "@lexical/utils";
|
|
1360
|
+
import { COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR2 } from "lexical";
|
|
1361
|
+
function FilePlugin() {
|
|
1362
|
+
const [editor] = useLexicalComposerContext7();
|
|
1363
|
+
useEffect7(() => {
|
|
1364
|
+
if (!editor.hasNodes([FileNode])) {
|
|
1365
|
+
throw new Error("FilePlugin: FileNode not registered on editor");
|
|
1366
|
+
}
|
|
1367
|
+
return editor.registerCommand(
|
|
1368
|
+
INSERT_FILE_COMMAND,
|
|
1369
|
+
(payload) => {
|
|
1370
|
+
editor.update(() => {
|
|
1371
|
+
const fileNode = $createFileNode(payload);
|
|
1372
|
+
$insertNodeToNearestRoot2(fileNode);
|
|
1373
|
+
});
|
|
1374
|
+
return true;
|
|
1272
1375
|
},
|
|
1273
|
-
|
|
1274
|
-
)
|
|
1275
|
-
);
|
|
1376
|
+
COMMAND_PRIORITY_EDITOR2
|
|
1377
|
+
);
|
|
1378
|
+
}, [editor]);
|
|
1379
|
+
return null;
|
|
1276
1380
|
}
|
|
1277
1381
|
|
|
1278
1382
|
// src/components/editor/Core.tsx
|
|
1279
|
-
|
|
1280
|
-
|
|
1383
|
+
import { motion } from "framer-motion";
|
|
1384
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1385
|
+
var SlashCommand = dynamic(() => import("./SlashCommand-2TNOOUBM.mjs"), { ssr: false });
|
|
1386
|
+
var ToolbarPlugin = dynamic(() => import("./ToolbarPlugin-IIAOU4P5.mjs"), {
|
|
1281
1387
|
ssr: false,
|
|
1282
|
-
loading: () => /* @__PURE__ */
|
|
1388
|
+
loading: () => /* @__PURE__ */ jsx4("div", { className: "hidden md:block w-full flex justify-center p-4" })
|
|
1283
1389
|
});
|
|
1284
|
-
var ExportPlugin = dynamic(() => import("./ExportPlugin-
|
|
1285
|
-
var TemplatePlugin = dynamic(() => import("./TemplatePlugin-
|
|
1286
|
-
var ExcalidrawPlugin = dynamic(() => import("./ExcalidrawPlugin-
|
|
1390
|
+
var ExportPlugin = dynamic(() => import("./ExportPlugin-OKZOLBGS.mjs"), { ssr: false });
|
|
1391
|
+
var TemplatePlugin = dynamic(() => import("./TemplatePlugin-HNTPEXBB.mjs"), { ssr: false });
|
|
1392
|
+
var ExcalidrawPlugin = dynamic(() => import("./ExcalidrawPlugin-2SGPIQ6U.mjs"), {
|
|
1287
1393
|
ssr: false
|
|
1288
1394
|
});
|
|
1289
|
-
var FloatingLinkEditorPlugin = dynamic(() => import("./FloatingLinkEditorPlugin-
|
|
1395
|
+
var FloatingLinkEditorPlugin = dynamic(() => import("./FloatingLinkEditorPlugin-MABB34L7.mjs"), {
|
|
1290
1396
|
ssr: false
|
|
1291
1397
|
});
|
|
1292
|
-
var TableCellActionMenuPlugin = dynamic(() => import("./TableCellActionMenuPlugin-
|
|
1398
|
+
var TableCellActionMenuPlugin = dynamic(() => import("./TableCellActionMenuPlugin-YWBA64J7.mjs"), {
|
|
1293
1399
|
ssr: false
|
|
1294
1400
|
});
|
|
1295
|
-
var TableHoverActionsPlugin = dynamic(() => import("./TableHoverActionsPlugin-
|
|
1401
|
+
var TableHoverActionsPlugin = dynamic(() => import("./TableHoverActionsPlugin-2EIXHEXN.mjs"), {
|
|
1296
1402
|
ssr: false
|
|
1297
1403
|
});
|
|
1298
|
-
var CodeActionMenuPlugin = dynamic(() => import("./CodeActionMenuPlugin-
|
|
1404
|
+
var CodeActionMenuPlugin = dynamic(() => import("./CodeActionMenuPlugin-MRKY67ED.mjs"), { ssr: false });
|
|
1299
1405
|
var FloatingTextFormatToolbarPlugin = dynamic(
|
|
1300
|
-
() => import("./FloatingTextFormatToolbarPlugin-
|
|
1406
|
+
() => import("./FloatingTextFormatToolbarPlugin-SO5VON7Q.mjs"),
|
|
1301
1407
|
{ ssr: false }
|
|
1302
1408
|
);
|
|
1303
|
-
var
|
|
1304
|
-
|
|
1305
|
-
{
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
{
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
{
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
{
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
}
|
|
1334
|
-
setIsAnimating(false);
|
|
1335
|
-
}, 300);
|
|
1336
|
-
}, []);
|
|
1337
|
-
useEffect7(() => {
|
|
1338
|
-
const loadInitialQuote = () => {
|
|
1339
|
-
if (typeof window !== "undefined") {
|
|
1340
|
-
const stored = localStorage.getItem("editorQuote");
|
|
1341
|
-
if (stored) {
|
|
1342
|
-
try {
|
|
1343
|
-
const parsed = JSON.parse(stored);
|
|
1344
|
-
const isRecent = Date.now() - parsed.timestamp < 3 * 60 * 60 * 1e3;
|
|
1345
|
-
if (isRecent && parsed.text && parsed.author) {
|
|
1346
|
-
setQuote({ text: parsed.text, author: parsed.author });
|
|
1347
|
-
return;
|
|
1348
|
-
}
|
|
1349
|
-
} catch (e) {
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
const newQuote = QUOTES[Math.floor(Math.random() * QUOTES.length)];
|
|
1354
|
-
setQuote(newQuote);
|
|
1355
|
-
};
|
|
1356
|
-
loadInitialQuote();
|
|
1357
|
-
const interval = setInterval(loadNewQuote, 3 * 60 * 60 * 1e3);
|
|
1358
|
-
return () => clearInterval(interval);
|
|
1359
|
-
}, [loadNewQuote]);
|
|
1360
|
-
return { quote, isAnimating, loadNewQuote };
|
|
1361
|
-
}
|
|
1362
|
-
function EnhancedPlaceholder({ quote, isAnimating, onRefresh }) {
|
|
1363
|
-
if (!quote) {
|
|
1364
|
-
return /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React.createElement(
|
|
1365
|
-
motion.div,
|
|
1366
|
-
{
|
|
1367
|
-
initial: { opacity: 0, scale: 0.9 },
|
|
1368
|
-
animate: { opacity: 1, scale: 1 },
|
|
1369
|
-
className: "flex items-center gap-3 text-gray-400"
|
|
1370
|
-
},
|
|
1371
|
-
/* @__PURE__ */ React.createElement(Sparkles, { className: "h-6 w-6 animate-pulse" }),
|
|
1372
|
-
/* @__PURE__ */ React.createElement("span", { className: "text-lg italic" }, "Loading inspiration...")
|
|
1373
|
-
));
|
|
1374
|
-
}
|
|
1375
|
-
return /* @__PURE__ */ React.createElement("div", { className: "absolute md:-mt-26 -mt-56 inset-0 pointer-events-none select-none overflow-hidden" }, /* @__PURE__ */ React.createElement(
|
|
1376
|
-
motion.div,
|
|
1377
|
-
{
|
|
1378
|
-
className: "relative h-full w-full",
|
|
1379
|
-
initial: { opacity: 0 },
|
|
1380
|
-
animate: { opacity: 1 },
|
|
1381
|
-
transition: { duration: 0.5 }
|
|
1382
|
-
},
|
|
1383
|
-
/* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 opacity-[0.02] dark:opacity-[0.05]" }, /* @__PURE__ */ React.createElement("div", { className: "absolute top-1/4 left-1/4 w-32 h-32 bg-gradient-to-br from-blue-400 to-purple-600 rounded-full blur-3xl" }), /* @__PURE__ */ React.createElement("div", { className: "absolute top-3/4 right-1/4 w-24 h-24 bg-gradient-to-br from-pink-400 to-orange-600 rounded-full blur-2xl" })),
|
|
1384
|
-
/* @__PURE__ */ React.createElement("div", { className: "relative z-10 h-full flex flex-col justify-center px-4 md:px-12" }, /* @__PURE__ */ React.createElement(AnimatePresence, { mode: "wait" }, !isAnimating && /* @__PURE__ */ React.createElement(
|
|
1385
|
-
motion.div,
|
|
1386
|
-
{
|
|
1387
|
-
key: quote.text,
|
|
1388
|
-
initial: { opacity: 0, y: 20, scale: 0.95 },
|
|
1389
|
-
animate: { opacity: 1, y: 0, scale: 1 },
|
|
1390
|
-
exit: { opacity: 0, y: -20, scale: 0.95 },
|
|
1391
|
-
transition: {
|
|
1392
|
-
duration: 0.6,
|
|
1393
|
-
ease: [0.4, 0, 0.2, 1]
|
|
1394
|
-
},
|
|
1395
|
-
className: "max-w-4xl"
|
|
1396
|
-
},
|
|
1397
|
-
/* @__PURE__ */ React.createElement(
|
|
1398
|
-
motion.div,
|
|
1399
|
-
{
|
|
1400
|
-
className: "flex items-center gap-3 mb-6",
|
|
1401
|
-
initial: { opacity: 0, x: -20 },
|
|
1402
|
-
animate: { opacity: 1, x: 0 },
|
|
1403
|
-
transition: { delay: 0.2 }
|
|
1404
|
-
},
|
|
1405
|
-
/* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(Quote, { className: "h-8 w-8 text-blue-400/60 dark:text-blue-300/40" }), /* @__PURE__ */ React.createElement(
|
|
1406
|
-
motion.div,
|
|
1407
|
-
{
|
|
1408
|
-
className: "absolute -top-1 -right-1 h-3 w-3 bg-gradient-to-r from-blue-400 to-purple-500 rounded-full",
|
|
1409
|
-
animate: { scale: [1, 1.2, 1] },
|
|
1410
|
-
transition: { duration: 2, repeat: Infinity, ease: "easeInOut" }
|
|
1411
|
-
}
|
|
1412
|
-
)),
|
|
1413
|
-
/* @__PURE__ */ React.createElement("div", { className: "h-px flex-1 bg-gradient-to-r from-gray-300 to-transparent dark:from-gray-600" })
|
|
1414
|
-
),
|
|
1415
|
-
/* @__PURE__ */ React.createElement(
|
|
1416
|
-
motion.blockquote,
|
|
1417
|
-
{
|
|
1418
|
-
className: "text-2xl md:text-4xl lg:text-5xl font-light italic leading-relaxed text-gray-400 dark:text-gray-500 mb-6",
|
|
1419
|
-
initial: { opacity: 0 },
|
|
1420
|
-
animate: { opacity: 1 },
|
|
1421
|
-
transition: { delay: 0.3, duration: 0.8 }
|
|
1422
|
-
},
|
|
1423
|
-
'"',
|
|
1424
|
-
quote.text,
|
|
1425
|
-
'"'
|
|
1426
|
-
),
|
|
1427
|
-
/* @__PURE__ */ React.createElement(
|
|
1428
|
-
motion.div,
|
|
1429
|
-
{
|
|
1430
|
-
className: "flex items-center gap-3",
|
|
1431
|
-
initial: { opacity: 0, x: 20 },
|
|
1432
|
-
animate: { opacity: 1, x: 0 },
|
|
1433
|
-
transition: { delay: 0.5 }
|
|
1434
|
-
},
|
|
1435
|
-
/* @__PURE__ */ React.createElement("div", { className: "h-px flex-1 bg-gradient-to-l from-gray-300 to-transparent dark:from-gray-600" }),
|
|
1436
|
-
/* @__PURE__ */ React.createElement("cite", { className: "text-lg md:text-xl text-gray-500 dark:text-gray-400 font-medium not-italic" }, quote.author),
|
|
1437
|
-
/* @__PURE__ */ React.createElement(Lightbulb, { className: "h-5 w-5 text-amber-400/60 dark:text-amber-300/40" })
|
|
1438
|
-
),
|
|
1439
|
-
/* @__PURE__ */ React.createElement(
|
|
1440
|
-
motion.button,
|
|
1441
|
-
{
|
|
1442
|
-
onClick: onRefresh,
|
|
1443
|
-
className: "mt-8 pointer-events-auto text-sm text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-200 flex items-center hidden md:flex gap-2 group",
|
|
1444
|
-
whileHover: { scale: 1.05 },
|
|
1445
|
-
whileTap: { scale: 0.95 },
|
|
1446
|
-
initial: { opacity: 0 },
|
|
1447
|
-
animate: { opacity: 1 },
|
|
1448
|
-
transition: { delay: 0.8 }
|
|
1449
|
-
},
|
|
1450
|
-
/* @__PURE__ */ React.createElement(Sparkles, { className: "h-4 w-4 group-hover:animate-spin transition-transform" }),
|
|
1451
|
-
/* @__PURE__ */ React.createElement("span", null, "Click for new inspiration")
|
|
1452
|
-
)
|
|
1453
|
-
)), isAnimating && /* @__PURE__ */ React.createElement(
|
|
1454
|
-
motion.div,
|
|
1455
|
-
{
|
|
1456
|
-
initial: { opacity: 0 },
|
|
1457
|
-
animate: { opacity: 1 },
|
|
1458
|
-
exit: { opacity: 0 },
|
|
1459
|
-
className: "flex items-center justify-center"
|
|
1460
|
-
},
|
|
1461
|
-
/* @__PURE__ */ React.createElement(
|
|
1462
|
-
motion.div,
|
|
1463
|
-
{
|
|
1464
|
-
animate: { rotate: 360 },
|
|
1465
|
-
transition: { duration: 1, repeat: Infinity, ease: "linear" }
|
|
1466
|
-
},
|
|
1467
|
-
/* @__PURE__ */ React.createElement(Sparkles, { className: "h-8 w-8 text-blue-400" })
|
|
1468
|
-
),
|
|
1469
|
-
/* @__PURE__ */ React.createElement("span", { className: "ml-3 text-xl text-gray-400 italic" }, "Finding inspiration...")
|
|
1470
|
-
))
|
|
1471
|
-
));
|
|
1409
|
+
var CollaborationPlugin = dynamic(
|
|
1410
|
+
() => import("./CollaborationPlugin-TIZOQBUT.mjs"),
|
|
1411
|
+
{ ssr: false }
|
|
1412
|
+
);
|
|
1413
|
+
var CollaboratorsBar = dynamic(
|
|
1414
|
+
() => import("./CollaboratorsBar-TMKBOBJI.mjs"),
|
|
1415
|
+
{ ssr: false }
|
|
1416
|
+
);
|
|
1417
|
+
var CommentsPlugin = dynamic(
|
|
1418
|
+
() => import("./CommentsPlugin-5M4RD6YO.mjs"),
|
|
1419
|
+
{ ssr: false }
|
|
1420
|
+
);
|
|
1421
|
+
var VersionHistoryPlugin = dynamic(
|
|
1422
|
+
() => import("./VersionHistoryPlugin-23MAZB4G.mjs"),
|
|
1423
|
+
{ ssr: false }
|
|
1424
|
+
);
|
|
1425
|
+
var InlineCopilotPlugin = dynamic(
|
|
1426
|
+
() => import("./InlineCopilotPlugin-PNS5Y6OO.mjs"),
|
|
1427
|
+
{ ssr: false }
|
|
1428
|
+
);
|
|
1429
|
+
var AICommandBarPlugin = dynamic(
|
|
1430
|
+
() => import("./AICommandBarPlugin-TADJ3X2Y.mjs"),
|
|
1431
|
+
{ ssr: false }
|
|
1432
|
+
);
|
|
1433
|
+
function EditorPlaceholder() {
|
|
1434
|
+
return /* @__PURE__ */ jsxs3("div", { className: "pointer-events-none select-none absolute top-4 md:top-12 left-4 md:left-12 z-10 text-muted-foreground/60 text-sm md:text-base flex items-center gap-1.5 md:gap-2", children: [
|
|
1435
|
+
/* @__PURE__ */ jsx4("span", { children: "Type" }),
|
|
1436
|
+
/* @__PURE__ */ jsx4("kbd", { className: "px-1.5 py-0.5 text-xs font-mono rounded bg-muted border border-border text-muted-foreground", children: "/" }),
|
|
1437
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate max-w-[220px] sm:max-w-none", children: "for commands, or start writing..." })
|
|
1438
|
+
] });
|
|
1472
1439
|
}
|
|
1473
1440
|
function Core({
|
|
1474
|
-
toolbarConfig
|
|
1441
|
+
toolbarConfig,
|
|
1442
|
+
content,
|
|
1443
|
+
showCollaboratorsBar = true
|
|
1475
1444
|
}) {
|
|
1476
1445
|
const { historyState } = useSharedHistoryContext();
|
|
1477
|
-
const { quote, isAnimating, loadNewQuote } = useRotatingQuote();
|
|
1478
1446
|
const isEditable = useLexicalEditable2();
|
|
1447
|
+
const { enabled: isCollabEnabled } = useCollab();
|
|
1479
1448
|
const [floatingAnchorElem, setFloatingAnchorElem] = useState3(null);
|
|
1480
|
-
const
|
|
1449
|
+
const collabCursorsContainerRef = useRef3(null);
|
|
1450
|
+
const [editor] = useLexicalComposerContext8();
|
|
1481
1451
|
const [activeEditor, setActiveEditor] = useState3(editor);
|
|
1482
1452
|
const [isLinkEditMode, setIsLinkEditMode] = useState3(false);
|
|
1483
1453
|
const [hasContent, setHasContent] = useState3(false);
|
|
1484
|
-
const onRef =
|
|
1454
|
+
const onRef = useCallback3((_floatingAnchorElem) => {
|
|
1485
1455
|
if (_floatingAnchorElem !== null) {
|
|
1486
1456
|
setFloatingAnchorElem(_floatingAnchorElem);
|
|
1487
1457
|
}
|
|
1488
1458
|
}, []);
|
|
1489
|
-
|
|
1459
|
+
useEffect8(() => {
|
|
1490
1460
|
const unregister = editor.registerTextContentListener((textContent) => {
|
|
1491
1461
|
setHasContent(textContent.trim().length > 0);
|
|
1492
1462
|
});
|
|
1493
1463
|
return unregister;
|
|
1494
1464
|
}, [editor]);
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
"md:border md:border-gray-200/50 dark:md:border-gray-800/50"
|
|
1518
|
-
)
|
|
1519
|
-
},
|
|
1520
|
-
/* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 rounded-2xl overflow-hidden pointer-events-none" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 bg-gradient-to-br from-blue-50/30 via-transparent to-purple-50/30 dark:from-blue-900/10 dark:to-purple-900/10" }), /* @__PURE__ */ React.createElement("div", { className: "absolute top-0 left-0 w-full h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent dark:via-gray-700" })),
|
|
1521
|
-
/* @__PURE__ */ React.createElement(
|
|
1522
|
-
RichTextPlugin,
|
|
1465
|
+
useEffect8(() => {
|
|
1466
|
+
return editor.registerCommand(
|
|
1467
|
+
INSERT_TABLE_COMMAND,
|
|
1468
|
+
(payload) => {
|
|
1469
|
+
const { columns, rows, includeHeaders = true } = payload || {};
|
|
1470
|
+
const numRows = Number(rows) || 4;
|
|
1471
|
+
const numCols = Number(columns) || 4;
|
|
1472
|
+
const tableNode = $createTableNodeWithDimensions(numRows, numCols, includeHeaders);
|
|
1473
|
+
$insertNodeToNearestRoot3(tableNode);
|
|
1474
|
+
const firstRow = tableNode.getFirstChild();
|
|
1475
|
+
const firstCell = $isElementNode2(firstRow) ? firstRow.getFirstChild() : null;
|
|
1476
|
+
if (firstCell && $isElementNode2(firstCell)) {
|
|
1477
|
+
firstCell.select();
|
|
1478
|
+
}
|
|
1479
|
+
return true;
|
|
1480
|
+
},
|
|
1481
|
+
COMMAND_PRIORITY_EDITOR3
|
|
1482
|
+
);
|
|
1483
|
+
}, [editor]);
|
|
1484
|
+
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1485
|
+
isEditable && /* @__PURE__ */ jsx4(
|
|
1486
|
+
ToolbarPlugin,
|
|
1523
1487
|
{
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
className: cn(
|
|
1530
|
-
"editor-content relative z-20 outline-none",
|
|
1531
|
-
"px-4 md:px-12 py-8 md:py-16",
|
|
1532
|
-
"min-h-[80vh] md:min-h-[70vh]",
|
|
1533
|
-
"focus:outline-none focus:ring-0",
|
|
1534
|
-
"text-foreground selection:bg-blue-100 dark:selection:bg-blue-900/30",
|
|
1535
|
-
"font-['Inter',_system-ui,_sans-serif] antialiased",
|
|
1536
|
-
"leading-relaxed tracking-wide",
|
|
1537
|
-
"transition-all duration-200 ease-in-out",
|
|
1538
|
-
"rounded-2xl"
|
|
1539
|
-
)
|
|
1540
|
-
}
|
|
1541
|
-
)),
|
|
1542
|
-
placeholder: !hasContent ? /* @__PURE__ */ React.createElement(
|
|
1543
|
-
EnhancedPlaceholder,
|
|
1544
|
-
{
|
|
1545
|
-
quote,
|
|
1546
|
-
isAnimating,
|
|
1547
|
-
onRefresh: loadNewQuote
|
|
1548
|
-
}
|
|
1549
|
-
) : null,
|
|
1550
|
-
ErrorBoundary: LexicalErrorBoundary
|
|
1488
|
+
editor,
|
|
1489
|
+
activeEditor,
|
|
1490
|
+
setActiveEditor,
|
|
1491
|
+
setIsLinkEditMode,
|
|
1492
|
+
toolbarConfig
|
|
1551
1493
|
}
|
|
1552
1494
|
),
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
|
|
1559
|
-
/* @__PURE__ */ React.createElement(HorizontalRulePlugin, null),
|
|
1560
|
-
/* @__PURE__ */ React.createElement(TabFocusPlugin, null),
|
|
1561
|
-
/* @__PURE__ */ React.createElement(PollPlugin, null),
|
|
1562
|
-
/* @__PURE__ */ React.createElement(ExcalidrawPlugin, null),
|
|
1563
|
-
/* @__PURE__ */ React.createElement(FigmaPlugin, null),
|
|
1564
|
-
/* @__PURE__ */ React.createElement(EquationsPlugin, null),
|
|
1565
|
-
/* @__PURE__ */ React.createElement(SpeechToTextPlugin_default, null),
|
|
1566
|
-
/* @__PURE__ */ React.createElement(TableCellResizerPlugin, null),
|
|
1567
|
-
/* @__PURE__ */ React.createElement(LayoutPlugin, null),
|
|
1568
|
-
/* @__PURE__ */ React.createElement(CollapsiblePlugin, null),
|
|
1569
|
-
/* @__PURE__ */ React.createElement(CodeHighlightPlugin, null),
|
|
1570
|
-
/* @__PURE__ */ React.createElement(DragDropPaste, null),
|
|
1571
|
-
/* @__PURE__ */ React.createElement(TabIndentationPlugin, { maxIndent: 7 }),
|
|
1572
|
-
/* @__PURE__ */ React.createElement(LexicalAutoLinkPlugin, null),
|
|
1573
|
-
/* @__PURE__ */ React.createElement(LinkWithMetaDataPlugin, null),
|
|
1574
|
-
/* @__PURE__ */ React.createElement(ListPlugin, null),
|
|
1575
|
-
/* @__PURE__ */ React.createElement(LinkPlugin, null),
|
|
1576
|
-
/* @__PURE__ */ React.createElement(StepperPlugin, null),
|
|
1577
|
-
/* @__PURE__ */ React.createElement(TwitterPlugin, null),
|
|
1578
|
-
/* @__PURE__ */ React.createElement(CheckListPlugin, null),
|
|
1579
|
-
/* @__PURE__ */ React.createElement(ImagesPlugin, null),
|
|
1580
|
-
/* @__PURE__ */ React.createElement(InlineImagePlugin, null),
|
|
1581
|
-
/* @__PURE__ */ React.createElement(AutoEmbedPlugin, null),
|
|
1582
|
-
/* @__PURE__ */ React.createElement(HintPlugin, null),
|
|
1583
|
-
/* @__PURE__ */ React.createElement(YouTubePlugin, null),
|
|
1584
|
-
/* @__PURE__ */ React.createElement(StoryBuilderPlugin, null),
|
|
1585
|
-
/* @__PURE__ */ React.createElement(DynamicBlockPlugin, null),
|
|
1586
|
-
/* @__PURE__ */ React.createElement(HistoryPlugin, { externalHistoryState: historyState }),
|
|
1587
|
-
/* @__PURE__ */ React.createElement(ExportPlugin, null),
|
|
1588
|
-
/* @__PURE__ */ React.createElement(TemplatePlugin, null),
|
|
1589
|
-
/* @__PURE__ */ React.createElement(MarkdownShortcutPlugin, null),
|
|
1590
|
-
/* @__PURE__ */ React.createElement(ClickableLinkPlugin, { disabled: isEditable }),
|
|
1591
|
-
/* @__PURE__ */ React.createElement(TablePlugin, { hasCellMerge: true, hasCellBackgroundColor: true, hasHorizontalScroll: true }),
|
|
1592
|
-
floatingAnchorElem && isEditable && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), /* @__PURE__ */ React.createElement(
|
|
1593
|
-
FloatingLinkEditorPlugin,
|
|
1495
|
+
/* @__PURE__ */ jsx4("div", { className: cn(
|
|
1496
|
+
"flex justify-center w-full min-h-[calc(100dvh-5rem)] transition-all duration-300",
|
|
1497
|
+
"dark:md:from-gray-900/50 dark:md:to-gray-800/30",
|
|
1498
|
+
"pt-2 md:pt-4"
|
|
1499
|
+
), children: /* @__PURE__ */ jsxs3(
|
|
1500
|
+
motion.div,
|
|
1594
1501
|
{
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1502
|
+
className: cn(
|
|
1503
|
+
"relative w-full max-w-5xl transition-all duration-500",
|
|
1504
|
+
"prose prose-lg dark:prose-invert lg:prose-xl leading-relaxed",
|
|
1505
|
+
"md:rounded-2xl md:shadow-2xl md:shadow-black/5",
|
|
1506
|
+
"md:dark:shadow-black/20",
|
|
1507
|
+
"bg-white dark:bg-gray-900",
|
|
1508
|
+
"md:border md:border-gray-200/50 dark:md:border-gray-800/50"
|
|
1509
|
+
),
|
|
1510
|
+
children: [
|
|
1511
|
+
/* @__PURE__ */ jsxs3("div", { className: "absolute inset-0 rounded-2xl overflow-hidden pointer-events-none", children: [
|
|
1512
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute inset-0 bg-gradient-to-br from-blue-50/30 via-transparent to-purple-50/30 dark:from-blue-900/10 dark:to-purple-900/10" }),
|
|
1513
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute top-0 left-0 w-full h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent dark:via-gray-700" })
|
|
1514
|
+
] }),
|
|
1515
|
+
showCollaboratorsBar && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-4 md:px-12 py-2.5 border-b border-border/40 bg-muted/10 rounded-t-2xl pointer-events-auto", children: [
|
|
1516
|
+
/* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground font-medium hidden sm:inline", children: "Collaborative Document" }),
|
|
1517
|
+
/* @__PURE__ */ jsx4(CollaboratorsBar, {})
|
|
1518
|
+
] }),
|
|
1519
|
+
/* @__PURE__ */ jsx4(
|
|
1520
|
+
RichTextPlugin,
|
|
1521
|
+
{
|
|
1522
|
+
contentEditable: /* @__PURE__ */ jsx4(
|
|
1523
|
+
"div",
|
|
1524
|
+
{
|
|
1525
|
+
ref: (node) => {
|
|
1526
|
+
if (node) {
|
|
1527
|
+
onRef(node);
|
|
1528
|
+
collabCursorsContainerRef.current = node;
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
"data-collab-cursor-container": "true",
|
|
1532
|
+
className: "relative",
|
|
1533
|
+
children: /* @__PURE__ */ jsx4(
|
|
1534
|
+
ContentEditable,
|
|
1535
|
+
{
|
|
1536
|
+
id: "lexical-editor",
|
|
1537
|
+
autoFocus: true,
|
|
1538
|
+
className: cn(
|
|
1539
|
+
"editor-content relative z-20 outline-none",
|
|
1540
|
+
"px-4 md:px-12 py-4 md:py-12",
|
|
1541
|
+
"min-h-[75dvh] md:min-h-[70vh]",
|
|
1542
|
+
"focus:outline-none focus:ring-0",
|
|
1543
|
+
"text-foreground selection:bg-blue-100 dark:selection:bg-blue-900/30",
|
|
1544
|
+
"font-['Inter',_system-ui,_sans-serif] antialiased",
|
|
1545
|
+
"leading-relaxed tracking-wide",
|
|
1546
|
+
"transition-all duration-200 ease-in-out",
|
|
1547
|
+
"rounded-2xl"
|
|
1548
|
+
)
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
}
|
|
1552
|
+
),
|
|
1553
|
+
placeholder: !hasContent ? /* @__PURE__ */ jsx4(EditorPlaceholder, {}) : null,
|
|
1554
|
+
ErrorBoundary: LexicalErrorBoundary
|
|
1555
|
+
}
|
|
1556
|
+
),
|
|
1557
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute inset-0 rounded-2xl ring-0 ring-blue-500/0 transition-all duration-300 pointer-events-none focus-within:ring-2 focus-within:ring-blue-500/20 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900" }),
|
|
1558
|
+
isCollabEnabled ? /* @__PURE__ */ jsx4(
|
|
1559
|
+
CollaborationPlugin,
|
|
1560
|
+
{
|
|
1561
|
+
cursorsContainerRef: collabCursorsContainerRef,
|
|
1562
|
+
initialEditorState: content
|
|
1563
|
+
}
|
|
1564
|
+
) : /* @__PURE__ */ jsx4(HistoryPlugin, { externalHistoryState: historyState }),
|
|
1565
|
+
/* @__PURE__ */ jsx4(AutoFocusPlugin, { defaultSelection: "rootStart" }),
|
|
1566
|
+
/* @__PURE__ */ jsx4(ClearEditorPlugin, {}),
|
|
1567
|
+
/* @__PURE__ */ jsx4(ShortcutsPlugin, { editor: activeEditor, setIsLinkEditMode }),
|
|
1568
|
+
/* @__PURE__ */ jsx4(LexicalOnChangePlugin, {}),
|
|
1569
|
+
/* @__PURE__ */ jsx4(LinkPlugin, {}),
|
|
1570
|
+
/* @__PURE__ */ jsx4(HorizontalRulePlugin, {}),
|
|
1571
|
+
/* @__PURE__ */ jsx4(TabFocusPlugin, {}),
|
|
1572
|
+
/* @__PURE__ */ jsx4(PollPlugin, {}),
|
|
1573
|
+
/* @__PURE__ */ jsx4(ExcalidrawPlugin, {}),
|
|
1574
|
+
/* @__PURE__ */ jsx4(FigmaPlugin, {}),
|
|
1575
|
+
/* @__PURE__ */ jsx4(EquationsPlugin, {}),
|
|
1576
|
+
/* @__PURE__ */ jsx4(SpeechToTextPlugin_default, {}),
|
|
1577
|
+
/* @__PURE__ */ jsx4(TableCellResizerPlugin, {}),
|
|
1578
|
+
/* @__PURE__ */ jsx4(LayoutPlugin, {}),
|
|
1579
|
+
/* @__PURE__ */ jsx4(CollapsiblePlugin, {}),
|
|
1580
|
+
/* @__PURE__ */ jsx4(CodeHighlightPlugin, {}),
|
|
1581
|
+
/* @__PURE__ */ jsx4(DragDropPaste, {}),
|
|
1582
|
+
/* @__PURE__ */ jsx4(TabIndentationPlugin, { maxIndent: 7 }),
|
|
1583
|
+
/* @__PURE__ */ jsx4(LexicalAutoLinkPlugin, {}),
|
|
1584
|
+
/* @__PURE__ */ jsx4(LinkWithMetaDataPlugin, {}),
|
|
1585
|
+
/* @__PURE__ */ jsx4(ListPlugin, {}),
|
|
1586
|
+
/* @__PURE__ */ jsx4(StepperPlugin, {}),
|
|
1587
|
+
/* @__PURE__ */ jsx4(TwitterPlugin, {}),
|
|
1588
|
+
/* @__PURE__ */ jsx4(CheckListPlugin, {}),
|
|
1589
|
+
/* @__PURE__ */ jsx4(ImagesPlugin, {}),
|
|
1590
|
+
/* @__PURE__ */ jsx4(InlineImagePlugin, {}),
|
|
1591
|
+
/* @__PURE__ */ jsx4(AutoEmbedPlugin, {}),
|
|
1592
|
+
/* @__PURE__ */ jsx4(HintPlugin, {}),
|
|
1593
|
+
/* @__PURE__ */ jsx4(YouTubePlugin, {}),
|
|
1594
|
+
/* @__PURE__ */ jsx4(StoryBuilderPlugin, {}),
|
|
1595
|
+
/* @__PURE__ */ jsx4(DynamicBlockPlugin, {}),
|
|
1596
|
+
/* @__PURE__ */ jsx4(AudioPlugin, {}),
|
|
1597
|
+
/* @__PURE__ */ jsx4(FilePlugin, {}),
|
|
1598
|
+
/* @__PURE__ */ jsx4(ExportPlugin, {}),
|
|
1599
|
+
/* @__PURE__ */ jsx4(TemplatePlugin, {}),
|
|
1600
|
+
/* @__PURE__ */ jsx4(MarkdownShortcutPlugin, {}),
|
|
1601
|
+
/* @__PURE__ */ jsx4(ClickableLinkPlugin, { disabled: isEditable }),
|
|
1602
|
+
/* @__PURE__ */ jsx4(TablePlugin, { hasCellMerge: true, hasCellBackgroundColor: true, hasHorizontalScroll: true }),
|
|
1603
|
+
floatingAnchorElem && isEditable && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1604
|
+
/* @__PURE__ */ jsx4(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }),
|
|
1605
|
+
/* @__PURE__ */ jsx4(
|
|
1606
|
+
FloatingLinkEditorPlugin,
|
|
1607
|
+
{
|
|
1608
|
+
anchorElem: floatingAnchorElem,
|
|
1609
|
+
isLinkEditMode,
|
|
1610
|
+
setIsLinkEditMode
|
|
1611
|
+
}
|
|
1612
|
+
),
|
|
1613
|
+
/* @__PURE__ */ jsx4(FloatingTextFormatToolbarPlugin, { setIsLinkEditMode, anchorElem: floatingAnchorElem }),
|
|
1614
|
+
/* @__PURE__ */ jsx4(TableCellActionMenuPlugin, { anchorElem: floatingAnchorElem, cellMerge: true }),
|
|
1615
|
+
/* @__PURE__ */ jsx4(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem }),
|
|
1616
|
+
/* @__PURE__ */ jsx4(TableHoverActionsPlugin, { anchorElem: floatingAnchorElem })
|
|
1617
|
+
] }),
|
|
1618
|
+
isEditable && /* @__PURE__ */ jsx4(SlashCommand, {}),
|
|
1619
|
+
isEditable && /* @__PURE__ */ jsx4(InlineCopilotPlugin, {}),
|
|
1620
|
+
isEditable && /* @__PURE__ */ jsx4(AICommandBarPlugin, {}),
|
|
1621
|
+
/* @__PURE__ */ jsx4(CommentsPlugin, {}),
|
|
1622
|
+
/* @__PURE__ */ jsx4(VersionHistoryPlugin, {})
|
|
1623
|
+
]
|
|
1598
1624
|
}
|
|
1599
|
-
)
|
|
1600
|
-
|
|
1601
|
-
)));
|
|
1625
|
+
) })
|
|
1626
|
+
] });
|
|
1602
1627
|
}
|
|
1603
1628
|
|
|
1604
1629
|
// src/components/editor/index.tsx
|
|
1630
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1605
1631
|
function Editor({
|
|
1606
1632
|
isEditable = false,
|
|
1607
1633
|
content,
|
|
1608
1634
|
aiConfig,
|
|
1609
1635
|
uploadConfig,
|
|
1610
|
-
toolbarConfig
|
|
1636
|
+
toolbarConfig,
|
|
1637
|
+
collabConfig,
|
|
1638
|
+
showCollaboratorsBar
|
|
1611
1639
|
}) {
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1640
|
+
const isCollabActive = Boolean(collabConfig == null ? void 0 : collabConfig.enabled);
|
|
1641
|
+
const initialConfig = useMemo2(
|
|
1642
|
+
() => ({
|
|
1643
|
+
namespace: "Bloger editor",
|
|
1644
|
+
theme: editor_theme_default,
|
|
1645
|
+
editorState: isCollabActive ? void 0 : typeof content === "string" ? content : typeof content === "object" && content !== null ? JSON.stringify(content) : void 0,
|
|
1646
|
+
nodes: [...nodes_default],
|
|
1647
|
+
onError: (error) => {
|
|
1648
|
+
throw error;
|
|
1649
|
+
},
|
|
1650
|
+
editable: isEditable
|
|
1651
|
+
}),
|
|
1652
|
+
[isCollabActive, content, isEditable]
|
|
1653
|
+
);
|
|
1654
|
+
return /* @__PURE__ */ jsx5(CollabProvider, { config: collabConfig, children: /* @__PURE__ */ jsx5(LexicalCollaboration, { children: /* @__PURE__ */ jsx5(CommentsProvider, { children: /* @__PURE__ */ jsx5(VersionHistoryProvider, { children: /* @__PURE__ */ jsx5(LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsx5(AIProvider, { config: aiConfig, children: /* @__PURE__ */ jsx5(UploadProvider, { config: uploadConfig, children: /* @__PURE__ */ jsx5(SharedHistoryContext, { children: /* @__PURE__ */ jsx5(ToolbarContext, { children: /* @__PURE__ */ jsx5(
|
|
1655
|
+
Core,
|
|
1656
|
+
{
|
|
1657
|
+
toolbarConfig,
|
|
1658
|
+
content,
|
|
1659
|
+
showCollaboratorsBar
|
|
1660
|
+
}
|
|
1661
|
+
) }) }) }) }) }) }) }) }) });
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
// src/components/canvas/CanvasMode.tsx
|
|
1665
|
+
init_react_shim();
|
|
1666
|
+
import { useState as useState4, useRef as useRef4, useEffect as useEffect9, useCallback as useCallback4 } from "react";
|
|
1667
|
+
import {
|
|
1668
|
+
ZoomIn,
|
|
1669
|
+
ZoomOut,
|
|
1670
|
+
Maximize2,
|
|
1671
|
+
StickyNote,
|
|
1672
|
+
FileText,
|
|
1673
|
+
Shapes,
|
|
1674
|
+
Trash2 as Trash22
|
|
1675
|
+
} from "lucide-react";
|
|
1676
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1677
|
+
var NOTE_COLORS = [
|
|
1678
|
+
{ name: "Yellow", bg: "bg-amber-100 dark:bg-amber-950/70 border-amber-300 dark:border-amber-800 text-amber-900 dark:text-amber-100" },
|
|
1679
|
+
{ name: "Blue", bg: "bg-sky-100 dark:bg-sky-950/70 border-sky-300 dark:border-sky-800 text-sky-900 dark:text-sky-100" },
|
|
1680
|
+
{ name: "Emerald", bg: "bg-emerald-100 dark:bg-emerald-950/70 border-emerald-300 dark:border-emerald-800 text-emerald-900 dark:text-emerald-100" },
|
|
1681
|
+
{ name: "Purple", bg: "bg-purple-100 dark:bg-purple-950/70 border-purple-300 dark:border-purple-800 text-purple-900 dark:text-purple-100" },
|
|
1682
|
+
{ name: "Rose", bg: "bg-rose-100 dark:bg-rose-950/70 border-rose-300 dark:border-rose-800 text-rose-900 dark:text-rose-100" }
|
|
1683
|
+
];
|
|
1684
|
+
function CanvasMode({
|
|
1685
|
+
documentContent = "",
|
|
1686
|
+
onClose,
|
|
1687
|
+
className
|
|
1688
|
+
}) {
|
|
1689
|
+
const [scale, setScale] = useState4(1);
|
|
1690
|
+
const [pan, setPan] = useState4({ x: 80, y: 80 });
|
|
1691
|
+
const [isPanning, setIsPanning] = useState4(false);
|
|
1692
|
+
const startPanRef = useRef4({ x: 0, y: 0 });
|
|
1693
|
+
const [cards, setCards] = useState4([
|
|
1694
|
+
{
|
|
1695
|
+
id: "primary-doc",
|
|
1696
|
+
x: 100,
|
|
1697
|
+
y: 100,
|
|
1698
|
+
width: 480,
|
|
1699
|
+
height: 380,
|
|
1700
|
+
type: "doc",
|
|
1701
|
+
title: "Document Core",
|
|
1702
|
+
content: documentContent || `# Project Roadmap
|
|
1703
|
+
|
|
1704
|
+
- [x] Modern Editor Framework Architecture
|
|
1705
|
+
- [x] Command Chaining Engine
|
|
1706
|
+
- [x] Inline AI Command Bar (Cmd+K)
|
|
1707
|
+
- [x] Notion-style Drag Handles
|
|
1708
|
+
- [ ] Infinite Spatial Canvas`,
|
|
1709
|
+
color: "bg-card border-border"
|
|
1620
1710
|
},
|
|
1621
|
-
|
|
1711
|
+
{
|
|
1712
|
+
id: "note-1",
|
|
1713
|
+
x: 640,
|
|
1714
|
+
y: 100,
|
|
1715
|
+
width: 260,
|
|
1716
|
+
height: 200,
|
|
1717
|
+
type: "note",
|
|
1718
|
+
title: "Architectural Vision",
|
|
1719
|
+
content: "Tiptap's ergonomics backed by Lexical's 60fps AST engine. Unmatched speed and zero cloud lock-ins.",
|
|
1720
|
+
color: NOTE_COLORS[0].bg
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
id: "note-2",
|
|
1724
|
+
x: 640,
|
|
1725
|
+
y: 340,
|
|
1726
|
+
width: 260,
|
|
1727
|
+
height: 180,
|
|
1728
|
+
type: "note",
|
|
1729
|
+
title: "Real-Time CRDTs",
|
|
1730
|
+
content: "Yjs + WebSocket + IndexedDB persistent offline synchronization.",
|
|
1731
|
+
color: NOTE_COLORS[1].bg
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
id: "board-1",
|
|
1735
|
+
x: 940,
|
|
1736
|
+
y: 100,
|
|
1737
|
+
width: 420,
|
|
1738
|
+
height: 320,
|
|
1739
|
+
type: "board",
|
|
1740
|
+
title: "System Flowchart (Excalidraw)",
|
|
1741
|
+
content: "[Interactive Whiteboard Canvas]",
|
|
1742
|
+
color: "bg-card border-border"
|
|
1743
|
+
}
|
|
1744
|
+
]);
|
|
1745
|
+
const [activeDragId, setActiveDragId] = useState4(null);
|
|
1746
|
+
const dragOffsetRef = useRef4({ x: 0, y: 0 });
|
|
1747
|
+
const handleMouseDownCanvas = (e) => {
|
|
1748
|
+
if (e.target.closest(".canvas-card")) return;
|
|
1749
|
+
setIsPanning(true);
|
|
1750
|
+
startPanRef.current = { x: e.clientX - pan.x, y: e.clientY - pan.y };
|
|
1622
1751
|
};
|
|
1623
|
-
|
|
1624
|
-
|
|
1752
|
+
const handleMouseMove = useCallback4(
|
|
1753
|
+
(e) => {
|
|
1754
|
+
if (isPanning) {
|
|
1755
|
+
setPan({
|
|
1756
|
+
x: e.clientX - startPanRef.current.x,
|
|
1757
|
+
y: e.clientY - startPanRef.current.y
|
|
1758
|
+
});
|
|
1759
|
+
} else if (activeDragId) {
|
|
1760
|
+
setCards(
|
|
1761
|
+
(prev) => prev.map((card) => {
|
|
1762
|
+
if (card.id === activeDragId) {
|
|
1763
|
+
const newX = (e.clientX - pan.x) / scale - dragOffsetRef.current.x;
|
|
1764
|
+
const newY = (e.clientY - pan.y) / scale - dragOffsetRef.current.y;
|
|
1765
|
+
return __spreadProps(__spreadValues({}, card), { x: Math.round(newX), y: Math.round(newY) });
|
|
1766
|
+
}
|
|
1767
|
+
return card;
|
|
1768
|
+
})
|
|
1769
|
+
);
|
|
1770
|
+
}
|
|
1771
|
+
},
|
|
1772
|
+
[isPanning, activeDragId, pan, scale]
|
|
1773
|
+
);
|
|
1774
|
+
const handleMouseUp = useCallback4(() => {
|
|
1775
|
+
setIsPanning(false);
|
|
1776
|
+
setActiveDragId(null);
|
|
1777
|
+
}, []);
|
|
1778
|
+
useEffect9(() => {
|
|
1779
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
1780
|
+
window.addEventListener("mouseup", handleMouseUp);
|
|
1781
|
+
return () => {
|
|
1782
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
1783
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
1784
|
+
};
|
|
1785
|
+
}, [handleMouseMove, handleMouseUp]);
|
|
1786
|
+
const handleStartCardDrag = (e, card) => {
|
|
1787
|
+
e.stopPropagation();
|
|
1788
|
+
setActiveDragId(card.id);
|
|
1789
|
+
const mouseCanvasX = (e.clientX - pan.x) / scale;
|
|
1790
|
+
const mouseCanvasY = (e.clientY - pan.y) / scale;
|
|
1791
|
+
dragOffsetRef.current = {
|
|
1792
|
+
x: mouseCanvasX - card.x,
|
|
1793
|
+
y: mouseCanvasY - card.y
|
|
1794
|
+
};
|
|
1795
|
+
};
|
|
1796
|
+
const handleAddNote = () => {
|
|
1797
|
+
const randomColor = NOTE_COLORS[Math.floor(Math.random() * NOTE_COLORS.length)].bg;
|
|
1798
|
+
const newCard = {
|
|
1799
|
+
id: `note-${Date.now()}`,
|
|
1800
|
+
x: Math.round(-pan.x / scale + 200 + Math.random() * 80),
|
|
1801
|
+
y: Math.round(-pan.y / scale + 200 + Math.random() * 80),
|
|
1802
|
+
width: 240,
|
|
1803
|
+
height: 180,
|
|
1804
|
+
type: "note",
|
|
1805
|
+
title: "New Idea",
|
|
1806
|
+
content: "Type your notes or thoughts here...",
|
|
1807
|
+
color: randomColor
|
|
1808
|
+
};
|
|
1809
|
+
setCards((prev) => [...prev, newCard]);
|
|
1810
|
+
};
|
|
1811
|
+
const handleDeleteCard = (id) => {
|
|
1812
|
+
setCards((prev) => prev.filter((c) => c.id !== id));
|
|
1813
|
+
};
|
|
1814
|
+
const handleUpdateCardContent = (id, content) => {
|
|
1815
|
+
setCards(
|
|
1816
|
+
(prev) => prev.map((c) => c.id === id ? __spreadProps(__spreadValues({}, c), { content }) : c)
|
|
1817
|
+
);
|
|
1818
|
+
};
|
|
1819
|
+
const handleUpdateCardTitle = (id, title) => {
|
|
1820
|
+
setCards(
|
|
1821
|
+
(prev) => prev.map((c) => c.id === id ? __spreadProps(__spreadValues({}, c), { title }) : c)
|
|
1822
|
+
);
|
|
1823
|
+
};
|
|
1824
|
+
const zoomIn = () => setScale((s) => Math.min(2.5, s + 0.15));
|
|
1825
|
+
const zoomOut = () => setScale((s) => Math.max(0.4, s - 0.15));
|
|
1826
|
+
const resetZoom = () => {
|
|
1827
|
+
setScale(1);
|
|
1828
|
+
setPan({ x: 80, y: 80 });
|
|
1829
|
+
};
|
|
1830
|
+
return /* @__PURE__ */ jsxs4(
|
|
1831
|
+
"div",
|
|
1832
|
+
{
|
|
1833
|
+
className: cn(
|
|
1834
|
+
"relative w-full h-[calc(100vh-4rem)] overflow-hidden bg-dot-grid select-none",
|
|
1835
|
+
isPanning ? "cursor-grabbing" : "cursor-default",
|
|
1836
|
+
className
|
|
1837
|
+
),
|
|
1838
|
+
onMouseDown: handleMouseDownCanvas,
|
|
1839
|
+
children: [
|
|
1840
|
+
/* @__PURE__ */ jsxs4("div", { className: "absolute top-4 left-6 z-30 flex items-center gap-2 p-1.5 rounded-xl border border-border/80 bg-background/90 text-foreground shadow-lg backdrop-blur-md", children: [
|
|
1841
|
+
/* @__PURE__ */ jsx6(Badge, { variant: "outline", className: "bg-primary/10 text-primary border-primary/20 px-2.5 py-1", children: "Canvas View" }),
|
|
1842
|
+
/* @__PURE__ */ jsx6("div", { className: "w-[1px] h-5 bg-border/60 mx-1" }),
|
|
1843
|
+
/* @__PURE__ */ jsxs4(
|
|
1844
|
+
Button,
|
|
1845
|
+
{
|
|
1846
|
+
size: "sm",
|
|
1847
|
+
variant: "ghost",
|
|
1848
|
+
onClick: handleAddNote,
|
|
1849
|
+
className: "h-8 gap-1.5 text-xs font-medium",
|
|
1850
|
+
children: [
|
|
1851
|
+
/* @__PURE__ */ jsx6(StickyNote, { className: "w-3.5 h-3.5 text-amber-500" }),
|
|
1852
|
+
/* @__PURE__ */ jsx6("span", { children: "Add Sticky Note" })
|
|
1853
|
+
]
|
|
1854
|
+
}
|
|
1855
|
+
),
|
|
1856
|
+
/* @__PURE__ */ jsx6("div", { className: "w-[1px] h-5 bg-border/60 mx-1" }),
|
|
1857
|
+
/* @__PURE__ */ jsx6(
|
|
1858
|
+
Button,
|
|
1859
|
+
{
|
|
1860
|
+
size: "sm",
|
|
1861
|
+
variant: "ghost",
|
|
1862
|
+
onClick: zoomOut,
|
|
1863
|
+
className: "h-8 w-8 p-0",
|
|
1864
|
+
title: "Zoom Out",
|
|
1865
|
+
children: /* @__PURE__ */ jsx6(ZoomOut, { className: "w-4 h-4" })
|
|
1866
|
+
}
|
|
1867
|
+
),
|
|
1868
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-xs font-mono font-medium px-1", children: [
|
|
1869
|
+
Math.round(scale * 100),
|
|
1870
|
+
"%"
|
|
1871
|
+
] }),
|
|
1872
|
+
/* @__PURE__ */ jsx6(
|
|
1873
|
+
Button,
|
|
1874
|
+
{
|
|
1875
|
+
size: "sm",
|
|
1876
|
+
variant: "ghost",
|
|
1877
|
+
onClick: zoomIn,
|
|
1878
|
+
className: "h-8 w-8 p-0",
|
|
1879
|
+
title: "Zoom In",
|
|
1880
|
+
children: /* @__PURE__ */ jsx6(ZoomIn, { className: "w-4 h-4" })
|
|
1881
|
+
}
|
|
1882
|
+
),
|
|
1883
|
+
/* @__PURE__ */ jsx6(
|
|
1884
|
+
Button,
|
|
1885
|
+
{
|
|
1886
|
+
size: "sm",
|
|
1887
|
+
variant: "ghost",
|
|
1888
|
+
onClick: resetZoom,
|
|
1889
|
+
className: "h-8 w-8 p-0",
|
|
1890
|
+
title: "Reset View",
|
|
1891
|
+
children: /* @__PURE__ */ jsx6(Maximize2, { className: "w-3.5 h-3.5" })
|
|
1892
|
+
}
|
|
1893
|
+
),
|
|
1894
|
+
onClose && /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
1895
|
+
/* @__PURE__ */ jsx6("div", { className: "w-[1px] h-5 bg-border/60 mx-1" }),
|
|
1896
|
+
/* @__PURE__ */ jsx6(
|
|
1897
|
+
Button,
|
|
1898
|
+
{
|
|
1899
|
+
size: "sm",
|
|
1900
|
+
variant: "outline",
|
|
1901
|
+
onClick: onClose,
|
|
1902
|
+
className: "h-8 text-xs font-medium",
|
|
1903
|
+
children: "Exit Canvas"
|
|
1904
|
+
}
|
|
1905
|
+
)
|
|
1906
|
+
] })
|
|
1907
|
+
] }),
|
|
1908
|
+
/* @__PURE__ */ jsx6(
|
|
1909
|
+
"div",
|
|
1910
|
+
{
|
|
1911
|
+
style: {
|
|
1912
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${scale})`,
|
|
1913
|
+
transformOrigin: "0 0"
|
|
1914
|
+
},
|
|
1915
|
+
className: "absolute inset-0 pointer-events-none",
|
|
1916
|
+
children: cards.map((card) => /* @__PURE__ */ jsxs4(
|
|
1917
|
+
"div",
|
|
1918
|
+
{
|
|
1919
|
+
style: {
|
|
1920
|
+
position: "absolute",
|
|
1921
|
+
left: `${card.x}px`,
|
|
1922
|
+
top: `${card.y}px`,
|
|
1923
|
+
width: `${card.width}px`,
|
|
1924
|
+
minHeight: `${card.height}px`
|
|
1925
|
+
},
|
|
1926
|
+
className: cn(
|
|
1927
|
+
"canvas-card pointer-events-auto rounded-xl border shadow-xl flex flex-col overflow-hidden transition-shadow duration-150",
|
|
1928
|
+
card.color || "bg-card border-border",
|
|
1929
|
+
activeDragId === card.id ? "ring-2 ring-primary shadow-2xl z-20 cursor-grabbing" : "hover:shadow-2xl z-10"
|
|
1930
|
+
),
|
|
1931
|
+
children: [
|
|
1932
|
+
/* @__PURE__ */ jsxs4(
|
|
1933
|
+
"div",
|
|
1934
|
+
{
|
|
1935
|
+
onMouseDown: (e) => handleStartCardDrag(e, card),
|
|
1936
|
+
className: "flex items-center justify-between px-3 py-2 border-b border-border/30 bg-black/5 dark:bg-white/5 cursor-grab active:cursor-grabbing",
|
|
1937
|
+
children: [
|
|
1938
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5 flex-1 mr-2", children: [
|
|
1939
|
+
card.type === "doc" && /* @__PURE__ */ jsx6(FileText, { className: "w-3.5 h-3.5 text-primary shrink-0" }),
|
|
1940
|
+
card.type === "note" && /* @__PURE__ */ jsx6(StickyNote, { className: "w-3.5 h-3.5 text-amber-500 shrink-0" }),
|
|
1941
|
+
card.type === "board" && /* @__PURE__ */ jsx6(Shapes, { className: "w-3.5 h-3.5 text-indigo-500 shrink-0" }),
|
|
1942
|
+
/* @__PURE__ */ jsx6(
|
|
1943
|
+
"input",
|
|
1944
|
+
{
|
|
1945
|
+
type: "text",
|
|
1946
|
+
value: card.title,
|
|
1947
|
+
onChange: (e) => handleUpdateCardTitle(card.id, e.target.value),
|
|
1948
|
+
className: "bg-transparent font-medium text-xs outline-none w-full"
|
|
1949
|
+
}
|
|
1950
|
+
)
|
|
1951
|
+
] }),
|
|
1952
|
+
/* @__PURE__ */ jsx6("div", { className: "flex items-center gap-1", children: card.id !== "primary-doc" && /* @__PURE__ */ jsx6(
|
|
1953
|
+
"button",
|
|
1954
|
+
{
|
|
1955
|
+
onClick: () => handleDeleteCard(card.id),
|
|
1956
|
+
className: "p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 opacity-60 hover:opacity-100 transition-opacity",
|
|
1957
|
+
title: "Delete card",
|
|
1958
|
+
children: /* @__PURE__ */ jsx6(Trash22, { className: "w-3 h-3 text-destructive" })
|
|
1959
|
+
}
|
|
1960
|
+
) })
|
|
1961
|
+
]
|
|
1962
|
+
}
|
|
1963
|
+
),
|
|
1964
|
+
/* @__PURE__ */ jsx6("div", { className: "p-3 flex-1 flex flex-col", children: card.type === "board" ? /* @__PURE__ */ jsxs4("div", { className: "flex-1 flex flex-col items-center justify-center border-2 border-dashed border-border/50 rounded-lg p-6 text-center text-muted-foreground text-xs gap-2", children: [
|
|
1965
|
+
/* @__PURE__ */ jsx6(Shapes, { className: "w-8 h-8 text-indigo-500/70" }),
|
|
1966
|
+
/* @__PURE__ */ jsx6("span", { className: "font-medium text-foreground", children: "Interactive Whiteboard" }),
|
|
1967
|
+
/* @__PURE__ */ jsx6("p", { className: "text-[11px] max-w-[200px]", children: "Integrated with Excalidraw vector sketches and visual wireframes." })
|
|
1968
|
+
] }) : /* @__PURE__ */ jsx6(
|
|
1969
|
+
"textarea",
|
|
1970
|
+
{
|
|
1971
|
+
value: card.content,
|
|
1972
|
+
onChange: (e) => handleUpdateCardContent(card.id, e.target.value),
|
|
1973
|
+
className: "w-full h-full min-h-[120px] bg-transparent text-xs leading-relaxed resize-none outline-none font-sans",
|
|
1974
|
+
placeholder: "Type your notes..."
|
|
1975
|
+
}
|
|
1976
|
+
) })
|
|
1977
|
+
]
|
|
1978
|
+
},
|
|
1979
|
+
card.id
|
|
1980
|
+
))
|
|
1981
|
+
}
|
|
1982
|
+
)
|
|
1983
|
+
]
|
|
1984
|
+
}
|
|
1985
|
+
);
|
|
1625
1986
|
}
|
|
1626
1987
|
|
|
1627
1988
|
// src/styles/tailwind-plugin.ts
|
|
1628
1989
|
init_react_shim();
|
|
1629
1990
|
|
|
1630
|
-
// node_modules/.pnpm/tailwindcss@4.
|
|
1991
|
+
// node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/plugin.mjs
|
|
1631
1992
|
init_react_shim();
|
|
1632
1993
|
function g(i, n) {
|
|
1633
1994
|
return { handler: i, config: n };
|
|
@@ -1641,7 +2002,7 @@ g.withOptions = function(i, n = () => ({})) {
|
|
|
1641
2002
|
var u = g;
|
|
1642
2003
|
|
|
1643
2004
|
// src/styles/tailwind-plugin.ts
|
|
1644
|
-
var notiqPlugin = u(function({ addBase, theme
|
|
2005
|
+
var notiqPlugin = u(function({ addBase, theme }) {
|
|
1645
2006
|
addBase({
|
|
1646
2007
|
":root": {
|
|
1647
2008
|
"--background": "oklch(1 0 0)",
|
|
@@ -1770,18 +2131,78 @@ var notiqPlugin = u(function({ addBase, theme: theme2 }) {
|
|
|
1770
2131
|
}
|
|
1771
2132
|
});
|
|
1772
2133
|
export {
|
|
2134
|
+
AICommandBar,
|
|
2135
|
+
AICopilot,
|
|
2136
|
+
AICopilot as AIKit,
|
|
1773
2137
|
AIProvider,
|
|
2138
|
+
AVATAR_PRESETS,
|
|
2139
|
+
Audio,
|
|
2140
|
+
Blockquote,
|
|
2141
|
+
BlocksKit,
|
|
2142
|
+
Bold,
|
|
2143
|
+
BubbleMenu,
|
|
2144
|
+
BulletList,
|
|
2145
|
+
COLLAB_COLORS,
|
|
2146
|
+
COLLAB_SERVER_PRESETS,
|
|
2147
|
+
CanvasMode,
|
|
2148
|
+
CheckList,
|
|
2149
|
+
Code,
|
|
2150
|
+
CodeBlock,
|
|
2151
|
+
CollabProvider,
|
|
2152
|
+
Collaboration,
|
|
2153
|
+
ColumnsLayout,
|
|
2154
|
+
CommentsProvider,
|
|
2155
|
+
DEFAULT_DOC_ID,
|
|
1774
2156
|
DEFAULT_FONT_SIZE,
|
|
2157
|
+
DEFAULT_SERVER_URL,
|
|
1775
2158
|
Editor,
|
|
2159
|
+
NotiqContent as EditorContent,
|
|
2160
|
+
Equation,
|
|
2161
|
+
Excalidraw,
|
|
2162
|
+
Extension,
|
|
2163
|
+
FALLBACK_SERVER_URL,
|
|
2164
|
+
Figma,
|
|
2165
|
+
File,
|
|
2166
|
+
FloatingMenu,
|
|
2167
|
+
Heading,
|
|
2168
|
+
HintBlock,
|
|
2169
|
+
History,
|
|
2170
|
+
Image,
|
|
2171
|
+
Italic,
|
|
1776
2172
|
MAX_ALLOWED_FONT_SIZE,
|
|
1777
2173
|
MIN_ALLOWED_FONT_SIZE,
|
|
2174
|
+
NotiqContent,
|
|
2175
|
+
NotiqContext,
|
|
2176
|
+
NotiqEditor,
|
|
2177
|
+
NotiqEditorImpl,
|
|
2178
|
+
NotiqProvider,
|
|
2179
|
+
OfflineBanner,
|
|
2180
|
+
OrderedList,
|
|
2181
|
+
Paragraph,
|
|
2182
|
+
Poll,
|
|
1778
2183
|
SharedHistoryContext,
|
|
2184
|
+
StarterKit,
|
|
2185
|
+
Stepper,
|
|
2186
|
+
Strike,
|
|
1779
2187
|
ToolbarContext,
|
|
2188
|
+
Tweet,
|
|
2189
|
+
Underline,
|
|
1780
2190
|
UploadProvider,
|
|
2191
|
+
VersionHistoryProvider,
|
|
2192
|
+
YouTube,
|
|
1781
2193
|
blockTypeToBlockName,
|
|
2194
|
+
createCanCommands,
|
|
2195
|
+
createCommandChain,
|
|
2196
|
+
createNotiqEditor,
|
|
1782
2197
|
notiqPlugin,
|
|
1783
2198
|
useAI,
|
|
2199
|
+
useCollab,
|
|
2200
|
+
useComments,
|
|
2201
|
+
useNotiq as useEditor,
|
|
2202
|
+
useNotiq,
|
|
2203
|
+
useNotiqContext,
|
|
1784
2204
|
useSharedHistoryContext,
|
|
1785
2205
|
useToolbarState,
|
|
1786
|
-
useUpload
|
|
2206
|
+
useUpload,
|
|
2207
|
+
useVersionHistory
|
|
1787
2208
|
};
|