@collabchron/notiq 1.1.10 → 1.1.12
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-RHRYHSVN.mjs +325 -0
- package/dist/AudioComponent-CKLMLB5T.mjs +278 -0
- package/dist/CodeActionMenuPlugin-FGH6HZLL.mjs +14 -0
- package/dist/CollaborationPlugin-TIZOQBUT.mjs +405 -0
- package/dist/CollaboratorsBar-AMPIAUOY.mjs +20 -0
- package/dist/CommentsPlugin-SDJJTUGK.mjs +19 -0
- package/dist/DynamicBlockComponent-2LOADZUX.mjs +221 -0
- package/dist/{EquationComponent-CB6DFIHV.mjs → EquationComponent-4NFG55NQ.mjs} +82 -46
- package/dist/ExcalidrawComponent-BMSYIPP6.mjs +662 -0
- package/dist/ExcalidrawPlugin-QLPGJPSX.mjs +14 -0
- package/dist/ExportPlugin-MJHYKQZJ.mjs +43 -0
- package/dist/FileComponent-Y56MX5QD.mjs +200 -0
- package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +12 -0
- package/dist/FloatingTextFormatToolbarPlugin-BXCPN3KD.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-KV5DX4ED.mjs +982 -0
- package/dist/SlashCommand-SPR7G5EI.mjs +39 -0
- package/dist/StoryBuilderComponent-JN4ZPZOW.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-F52PVNXU.mjs +823 -0
- package/dist/VersionHistoryPlugin-YWGCREKA.mjs +371 -0
- package/dist/babel-RJXDAKDM.mjs +7287 -0
- package/dist/background-color-RW5JYLMG.mjs +425 -0
- package/dist/block-format-TODFREE2.mjs +14 -0
- package/dist/{chunk-RBWZGXPF.mjs → chunk-22ZIL6NH.mjs} +5 -5
- package/dist/{chunk-DSFQHA7I.mjs → chunk-2LNT36RL.mjs} +118 -295
- package/dist/chunk-37LC44W3.mjs +2677 -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-5D4JF3ZZ.mjs +624 -0
- package/dist/{chunk-POGRR73N.mjs → chunk-5NRAXWYA.mjs} +4 -3
- package/dist/{chunk-PZSUSXQG.mjs → chunk-6D6QLRYR.mjs} +2 -2
- package/dist/chunk-6FQFPPLG.mjs +785 -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-YUDCJRJM.mjs → chunk-BGV62GC2.mjs} +3 -2
- package/dist/{chunk-2FNEAMSP.mjs → chunk-C4JWLBYN.mjs} +50 -45
- package/dist/{chunk-TCYK7DM7.mjs → chunk-CDAMHK63.mjs} +4 -3
- package/dist/chunk-CLRSETYQ.mjs +431 -0
- 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-N3WN46VL.mjs → chunk-ELBTVBTS.mjs} +23 -22
- package/dist/chunk-ENH2IOHI.mjs +1828 -0
- package/dist/{chunk-4EXYCTGJ.mjs → chunk-EVPWKNE4.mjs} +3 -3
- package/dist/{chunk-LGG4IUIA.mjs → chunk-FO7M3X2B.mjs} +2 -2
- 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-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-3JVFG7ER.mjs → chunk-KNW2CGIP.mjs} +7 -64
- package/dist/{chunk-4HBCVSE6.mjs → chunk-KXRLARGI.mjs} +1 -1
- package/dist/{chunk-4GFXER7R.mjs → chunk-LBGM4VVZ.mjs} +141 -89
- package/dist/chunk-LLGVCM7M.mjs +809 -0
- package/dist/chunk-LU2XWLOE.mjs +219 -0
- package/dist/chunk-LVRJM45C.mjs +171 -0
- package/dist/{chunk-K36V4SIW.mjs → chunk-MSAO3YFB.mjs} +21 -18
- package/dist/chunk-N3KDPSRI.mjs +496 -0
- 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-HJPPNHYM.mjs → chunk-QNIY45SF.mjs} +4 -3
- 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-456TN7IM.mjs → chunk-SYUCM5G5.mjs} +15 -14
- package/dist/{chunk-4MEDW3T6.mjs → chunk-T2UBAZ66.mjs} +5 -4
- package/dist/chunk-TC3IISJZ.mjs +408 -0
- package/dist/chunk-VGAX6YEY.mjs +399 -0
- package/dist/chunk-VNDDDXGH.mjs +682 -0
- package/dist/{chunk-U47ABU5Z.mjs → chunk-W6VQSFE5.mjs} +2 -2
- package/dist/chunk-WUVIQCX7.mjs +944 -0
- package/dist/chunk-WYCFGRFJ.mjs +118 -0
- package/dist/chunk-XNJNT6PC.mjs +1701 -0
- package/dist/chunk-XYLTLGY5.mjs +775 -0
- package/dist/chunk-XYMXGU4T.mjs +129 -0
- package/dist/{chunk-3G37YKTV.mjs → chunk-YR2DD74C.mjs} +9 -8
- package/dist/chunk-ZFV2HGD3.mjs +143 -0
- package/dist/{chunk-77UA6HYR.mjs → chunk-ZKZ7MLSS.mjs} +1 -1
- package/dist/chunk-ZYJ7KABY.mjs +419 -0
- package/dist/color-S55XFDYQ.mjs +13 -0
- package/dist/components/canvas/CanvasMode.d.ts +18 -0
- package/dist/components/editor/Core.d.ts +19 -0
- package/dist/components/editor/index.d.ts +38 -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 +10 -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 +89 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.js +74458 -0
- package/dist/core.mjs +138 -0
- package/dist/estree-QRALCFII.mjs +5029 -0
- package/dist/font-IJKFR4BM.mjs +12 -0
- package/dist/font-size-3HMJHKO2.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-QPB2CVXP.mjs} +359 -324
- package/dist/index.d.ts +13 -145
- package/dist/index.js +61491 -44350
- package/dist/index.mjs +466 -1569
- package/dist/insert-audio-I3PD6JFS.mjs +180 -0
- package/dist/insert-file-PHR7XL4V.mjs +190 -0
- package/dist/insert-gif-R5ZO4JHC.mjs +112 -0
- package/dist/insert-image-PLBZELHK.mjs +348 -0
- package/dist/insert-node-DGCZBGKG.mjs +243 -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 +73860 -0
- package/dist/react.mjs +66 -0
- package/dist/standalone-A6VDOPCZ.mjs +2506 -0
- package/dist/stepper-KNITDVLG.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-TEB4S52S.mjs} +22 -19
- package/dist/text-format-T3IY7FBI.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 -1150
- 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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_react_shim
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WYCFGRFJ.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/providers/SharedHistoryContext.tsx
|
|
6
6
|
init_react_shim();
|
|
7
7
|
import { createEmptyHistoryState } from "@lexical/react/LexicalHistoryPlugin";
|
|
8
|
-
import * as React from "react";
|
|
9
8
|
import { createContext, useContext, useMemo } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
var Context = createContext({});
|
|
11
11
|
var SharedHistoryContext = ({
|
|
12
12
|
children
|
|
@@ -15,7 +15,7 @@ var SharedHistoryContext = ({
|
|
|
15
15
|
() => ({ historyState: createEmptyHistoryState() }),
|
|
16
16
|
[]
|
|
17
17
|
);
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value: historyContext, children });
|
|
19
19
|
};
|
|
20
20
|
var useSharedHistoryContext = () => {
|
|
21
21
|
return useContext(Context);
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
$createImageNode,
|
|
3
3
|
$isImageNode,
|
|
4
4
|
ImageNode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ELBTVBTS.mjs";
|
|
6
6
|
import {
|
|
7
7
|
init_react_shim
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WYCFGRFJ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/components/editor/plugins/ImagesPlugin/index.tsx
|
|
11
11
|
init_react_shim();
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JHXDLYEV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__objRest,
|
|
6
|
+
__spreadProps,
|
|
6
7
|
__spreadValues,
|
|
7
8
|
init_react_shim
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WYCFGRFJ.mjs";
|
|
9
10
|
|
|
10
11
|
// src/components/ui/dialog.tsx
|
|
11
12
|
init_react_shim();
|
|
12
13
|
import * as React from "react";
|
|
13
14
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
14
15
|
import { X } from "lucide-react";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
17
|
var Dialog = DialogPrimitive.Root;
|
|
16
18
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
17
19
|
var DialogPortal = DialogPrimitive.Portal;
|
|
18
20
|
var DialogOverlay = React.forwardRef((_a, ref) => {
|
|
19
21
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
20
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
21
23
|
DialogPrimitive.Overlay,
|
|
22
24
|
__spreadValues({
|
|
23
25
|
ref,
|
|
@@ -31,18 +33,27 @@ var DialogOverlay = React.forwardRef((_a, ref) => {
|
|
|
31
33
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
32
34
|
var DialogContent = React.forwardRef((_a, ref) => {
|
|
33
35
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
className
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
38
|
+
/* @__PURE__ */ jsxs(
|
|
39
|
+
DialogPrimitive.Content,
|
|
40
|
+
__spreadProps(__spreadValues({
|
|
41
|
+
ref,
|
|
42
|
+
className: cn(
|
|
43
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
44
|
+
className
|
|
45
|
+
)
|
|
46
|
+
}, props), {
|
|
47
|
+
children: [
|
|
48
|
+
children,
|
|
49
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
52
|
+
] })
|
|
53
|
+
]
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
46
57
|
});
|
|
47
58
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
48
59
|
var DialogHeader = (_a) => {
|
|
@@ -51,7 +62,7 @@ var DialogHeader = (_a) => {
|
|
|
51
62
|
} = _b, props = __objRest(_b, [
|
|
52
63
|
"className"
|
|
53
64
|
]);
|
|
54
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
55
66
|
"div",
|
|
56
67
|
__spreadValues({
|
|
57
68
|
className: cn(
|
|
@@ -68,7 +79,7 @@ var DialogFooter = (_a) => {
|
|
|
68
79
|
} = _b, props = __objRest(_b, [
|
|
69
80
|
"className"
|
|
70
81
|
]);
|
|
71
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
72
83
|
"div",
|
|
73
84
|
__spreadValues({
|
|
74
85
|
className: cn(
|
|
@@ -81,7 +92,7 @@ var DialogFooter = (_a) => {
|
|
|
81
92
|
DialogFooter.displayName = "DialogFooter";
|
|
82
93
|
var DialogTitle = React.forwardRef((_a, ref) => {
|
|
83
94
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
84
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
85
96
|
DialogPrimitive.Title,
|
|
86
97
|
__spreadValues({
|
|
87
98
|
ref,
|
|
@@ -95,7 +106,7 @@ var DialogTitle = React.forwardRef((_a, ref) => {
|
|
|
95
106
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
96
107
|
var DialogDescription = React.forwardRef((_a, ref) => {
|
|
97
108
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
98
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
99
110
|
DialogPrimitive.Description,
|
|
100
111
|
__spreadValues({
|
|
101
112
|
ref,
|
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-OE5JRLCN.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__spreadValues,
|
|
6
|
+
init_react_shim
|
|
7
|
+
} from "./chunk-WYCFGRFJ.mjs";
|
|
8
|
+
|
|
9
|
+
// src/components/editor/plugins/AICommandBarPlugin/index.tsx
|
|
10
|
+
init_react_shim();
|
|
11
|
+
import { useState, useEffect, useRef, useCallback } from "react";
|
|
12
|
+
import { createPortal } from "react-dom";
|
|
13
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
14
|
+
import {
|
|
15
|
+
$getSelection,
|
|
16
|
+
$isRangeSelection,
|
|
17
|
+
$createParagraphNode,
|
|
18
|
+
$createTextNode,
|
|
19
|
+
COMMAND_PRIORITY_CRITICAL,
|
|
20
|
+
createCommand,
|
|
21
|
+
KEY_DOWN_COMMAND
|
|
22
|
+
} from "lexical";
|
|
23
|
+
import {
|
|
24
|
+
Sparkles,
|
|
25
|
+
Loader2,
|
|
26
|
+
Check,
|
|
27
|
+
X,
|
|
28
|
+
RotateCcw,
|
|
29
|
+
CornerDownLeft,
|
|
30
|
+
ChevronDown,
|
|
31
|
+
Wand2,
|
|
32
|
+
Languages,
|
|
33
|
+
ArrowDownToLine
|
|
34
|
+
} from "lucide-react";
|
|
35
|
+
|
|
36
|
+
// src/components/editor/utils/diffUtils.ts
|
|
37
|
+
init_react_shim();
|
|
38
|
+
function tokenize(text) {
|
|
39
|
+
return text.match(/\S+|\s+/g) || [];
|
|
40
|
+
}
|
|
41
|
+
function computeWordDiff(original, updated) {
|
|
42
|
+
const origTokens = tokenize(original);
|
|
43
|
+
const upTokens = tokenize(updated);
|
|
44
|
+
const n = origTokens.length;
|
|
45
|
+
const m = upTokens.length;
|
|
46
|
+
if (n === 0 && m === 0) return [];
|
|
47
|
+
if (n === 0) return [{ type: "added", text: updated }];
|
|
48
|
+
if (m === 0) return [{ type: "removed", text: original }];
|
|
49
|
+
if (n > 1500 || m > 1500) {
|
|
50
|
+
return [
|
|
51
|
+
{ type: "removed", text: original },
|
|
52
|
+
{ type: "added", text: updated }
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
const dp = Array.from(
|
|
56
|
+
{ length: n + 1 },
|
|
57
|
+
() => new Array(m + 1).fill(0)
|
|
58
|
+
);
|
|
59
|
+
for (let i2 = 1; i2 <= n; i2++) {
|
|
60
|
+
for (let j2 = 1; j2 <= m; j2++) {
|
|
61
|
+
if (origTokens[i2 - 1] === upTokens[j2 - 1]) {
|
|
62
|
+
dp[i2][j2] = dp[i2 - 1][j2 - 1] + 1;
|
|
63
|
+
} else {
|
|
64
|
+
dp[i2][j2] = Math.max(dp[i2 - 1][j2], dp[i2][j2 - 1]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const parts = [];
|
|
69
|
+
let i = n;
|
|
70
|
+
let j = m;
|
|
71
|
+
while (i > 0 || j > 0) {
|
|
72
|
+
if (i > 0 && j > 0 && origTokens[i - 1] === upTokens[j - 1]) {
|
|
73
|
+
parts.unshift({ type: "unchanged", text: origTokens[i - 1] });
|
|
74
|
+
i--;
|
|
75
|
+
j--;
|
|
76
|
+
} else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
|
|
77
|
+
parts.unshift({ type: "added", text: upTokens[j - 1] });
|
|
78
|
+
j--;
|
|
79
|
+
} else if (i > 0 && (j === 0 || dp[i][j - 1] < dp[i - 1][j])) {
|
|
80
|
+
parts.unshift({ type: "removed", text: origTokens[i - 1] });
|
|
81
|
+
i--;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const merged = [];
|
|
85
|
+
for (const part of parts) {
|
|
86
|
+
if (merged.length > 0 && merged[merged.length - 1].type === part.type) {
|
|
87
|
+
merged[merged.length - 1].text += part.text;
|
|
88
|
+
} else {
|
|
89
|
+
merged.push(__spreadValues({}, part));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return merged;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/components/editor/plugins/AICommandBarPlugin/index.tsx
|
|
96
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
97
|
+
var OPEN_AI_COMMAND_BAR_COMMAND = createCommand("OPEN_AI_COMMAND_BAR_COMMAND");
|
|
98
|
+
var QUICK_ACTIONS = [
|
|
99
|
+
{ id: "ImproveWriting", label: "Improve Writing", icon: Wand2 },
|
|
100
|
+
{ id: "FixSpellingGrammar", label: "Fix Grammar & Spelling", icon: Check },
|
|
101
|
+
{ id: "MakeShort", label: "Make Shorter", icon: Sparkles },
|
|
102
|
+
{ id: "MakeLong", label: "Make Longer", icon: Sparkles },
|
|
103
|
+
{ id: "SimplifyLanguage", label: "Simplify", icon: Sparkles }
|
|
104
|
+
];
|
|
105
|
+
var TONES = ["Professional", "Casual", "Direct", "Academic", "Friendly"];
|
|
106
|
+
var LANGUAGES = ["Spanish", "French", "German", "Japanese", "Chinese", "Arabic"];
|
|
107
|
+
function AICommandBarPlugin() {
|
|
108
|
+
const [editor] = useLexicalComposerContext();
|
|
109
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
110
|
+
const [coords, setCoords] = useState(null);
|
|
111
|
+
const [prompt, setPrompt] = useState("");
|
|
112
|
+
const [selectedText, setSelectedText] = useState("");
|
|
113
|
+
const [streamedText, setStreamedText] = useState("");
|
|
114
|
+
const [isGenerating, setIsGenerating] = useState(false);
|
|
115
|
+
const [activeAction, setActiveAction] = useState(null);
|
|
116
|
+
const [showToneMenu, setShowToneMenu] = useState(false);
|
|
117
|
+
const [showLangMenu, setShowLangMenu] = useState(false);
|
|
118
|
+
const containerRef = useRef(null);
|
|
119
|
+
const inputRef = useRef(null);
|
|
120
|
+
const abortControllerRef = useRef(null);
|
|
121
|
+
const openBar = useCallback(
|
|
122
|
+
(payload) => {
|
|
123
|
+
let targetText = "";
|
|
124
|
+
editor.getEditorState().read(() => {
|
|
125
|
+
const selection = $getSelection();
|
|
126
|
+
if ($isRangeSelection(selection)) {
|
|
127
|
+
targetText = selection.getTextContent();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
const domSelection = window.getSelection();
|
|
131
|
+
let top = 120;
|
|
132
|
+
let left = window.innerWidth / 2 - 280;
|
|
133
|
+
if (domSelection && domSelection.rangeCount > 0) {
|
|
134
|
+
const rect = domSelection.getRangeAt(0).getBoundingClientRect();
|
|
135
|
+
if (rect.width > 0 || rect.height > 0) {
|
|
136
|
+
left = Math.max(20, Math.min(window.innerWidth - 580, rect.left + rect.width / 2 - 280));
|
|
137
|
+
top = rect.bottom + 12;
|
|
138
|
+
if (top + 280 > window.innerHeight) {
|
|
139
|
+
top = Math.max(20, rect.top - 280);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
setCoords({ top, left });
|
|
144
|
+
setSelectedText(targetText);
|
|
145
|
+
setPrompt((payload == null ? void 0 : payload.initialPrompt) || "");
|
|
146
|
+
setStreamedText("");
|
|
147
|
+
setIsGenerating(false);
|
|
148
|
+
setActiveAction((payload == null ? void 0 : payload.action) || null);
|
|
149
|
+
setIsOpen(true);
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
var _a;
|
|
152
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
153
|
+
}, 50);
|
|
154
|
+
if (payload == null ? void 0 : payload.action) {
|
|
155
|
+
runAction(payload.action, targetText, payload.initialPrompt);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
[editor]
|
|
159
|
+
);
|
|
160
|
+
const closeBar = useCallback(() => {
|
|
161
|
+
if (abortControllerRef.current) {
|
|
162
|
+
abortControllerRef.current.abort();
|
|
163
|
+
abortControllerRef.current = null;
|
|
164
|
+
}
|
|
165
|
+
setIsOpen(false);
|
|
166
|
+
setCoords(null);
|
|
167
|
+
setPrompt("");
|
|
168
|
+
setSelectedText("");
|
|
169
|
+
setStreamedText("");
|
|
170
|
+
setIsGenerating(false);
|
|
171
|
+
setActiveAction(null);
|
|
172
|
+
setShowToneMenu(false);
|
|
173
|
+
setShowLangMenu(false);
|
|
174
|
+
}, []);
|
|
175
|
+
const runAction = async (action, contextText, customQuestion) => {
|
|
176
|
+
setIsGenerating(true);
|
|
177
|
+
setStreamedText("");
|
|
178
|
+
setActiveAction(action);
|
|
179
|
+
if (abortControllerRef.current) {
|
|
180
|
+
abortControllerRef.current.abort();
|
|
181
|
+
}
|
|
182
|
+
const controller = new AbortController();
|
|
183
|
+
abortControllerRef.current = controller;
|
|
184
|
+
try {
|
|
185
|
+
const response = await fetch("/api/ai", {
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers: { "Content-Type": "application/json" },
|
|
188
|
+
body: JSON.stringify({
|
|
189
|
+
action,
|
|
190
|
+
context: contextText || "",
|
|
191
|
+
userQuestion: customQuestion || prompt
|
|
192
|
+
}),
|
|
193
|
+
signal: controller.signal
|
|
194
|
+
});
|
|
195
|
+
if (!response.ok || !response.body) {
|
|
196
|
+
throw new Error("Failed to contact AI service");
|
|
197
|
+
}
|
|
198
|
+
const reader = response.body.getReader();
|
|
199
|
+
const decoder = new TextDecoder();
|
|
200
|
+
let accumulated = "";
|
|
201
|
+
while (true) {
|
|
202
|
+
const { value, done } = await reader.read();
|
|
203
|
+
if (done) break;
|
|
204
|
+
const chunk = decoder.decode(value, { stream: true });
|
|
205
|
+
accumulated += chunk;
|
|
206
|
+
setStreamedText(accumulated);
|
|
207
|
+
}
|
|
208
|
+
} catch (err) {
|
|
209
|
+
if (err.name !== "AbortError") {
|
|
210
|
+
console.error("[Notiq AI Command Bar Error]:", err);
|
|
211
|
+
setStreamedText("An error occurred while generating response.");
|
|
212
|
+
}
|
|
213
|
+
} finally {
|
|
214
|
+
setIsGenerating(false);
|
|
215
|
+
abortControllerRef.current = null;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const handleAccept = () => {
|
|
219
|
+
if (!streamedText) return;
|
|
220
|
+
editor.update(
|
|
221
|
+
() => {
|
|
222
|
+
const selection = $getSelection();
|
|
223
|
+
if ($isRangeSelection(selection)) {
|
|
224
|
+
selection.insertRawText(streamedText);
|
|
225
|
+
} else {
|
|
226
|
+
const root = editor.getRootElement();
|
|
227
|
+
if (root) {
|
|
228
|
+
const p = $createParagraphNode();
|
|
229
|
+
p.append($createTextNode(streamedText));
|
|
230
|
+
selection == null ? void 0 : selection.insertNodes([p]);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{ discrete: true }
|
|
235
|
+
);
|
|
236
|
+
closeBar();
|
|
237
|
+
};
|
|
238
|
+
const handleInsertBelow = () => {
|
|
239
|
+
if (!streamedText) return;
|
|
240
|
+
editor.update(
|
|
241
|
+
() => {
|
|
242
|
+
const selection = $getSelection();
|
|
243
|
+
if ($isRangeSelection(selection)) {
|
|
244
|
+
const anchor = selection.anchor.getNode();
|
|
245
|
+
const topElement = anchor.getKey() === "root" ? anchor : anchor.getTopLevelElementOrThrow();
|
|
246
|
+
const p = $createParagraphNode();
|
|
247
|
+
p.append($createTextNode(streamedText));
|
|
248
|
+
topElement.insertAfter(p);
|
|
249
|
+
p.select();
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{ discrete: true }
|
|
253
|
+
);
|
|
254
|
+
closeBar();
|
|
255
|
+
};
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
return editor.registerCommand(
|
|
258
|
+
KEY_DOWN_COMMAND,
|
|
259
|
+
(event) => {
|
|
260
|
+
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
261
|
+
event.preventDefault();
|
|
262
|
+
if (isOpen) {
|
|
263
|
+
closeBar();
|
|
264
|
+
} else {
|
|
265
|
+
openBar();
|
|
266
|
+
}
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
if (event.key === "Escape" && isOpen) {
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
closeBar();
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
return false;
|
|
275
|
+
},
|
|
276
|
+
COMMAND_PRIORITY_CRITICAL
|
|
277
|
+
);
|
|
278
|
+
}, [editor, isOpen, openBar, closeBar]);
|
|
279
|
+
useEffect(() => {
|
|
280
|
+
return editor.registerCommand(
|
|
281
|
+
OPEN_AI_COMMAND_BAR_COMMAND,
|
|
282
|
+
(payload) => {
|
|
283
|
+
openBar(payload || void 0);
|
|
284
|
+
return true;
|
|
285
|
+
},
|
|
286
|
+
COMMAND_PRIORITY_CRITICAL
|
|
287
|
+
);
|
|
288
|
+
}, [editor, openBar]);
|
|
289
|
+
if (!isOpen || !coords) return null;
|
|
290
|
+
const diffParts = selectedText && streamedText ? computeWordDiff(selectedText, streamedText) : [];
|
|
291
|
+
return createPortal(
|
|
292
|
+
/* @__PURE__ */ jsxs(
|
|
293
|
+
"div",
|
|
294
|
+
{
|
|
295
|
+
ref: containerRef,
|
|
296
|
+
style: {
|
|
297
|
+
position: "fixed",
|
|
298
|
+
top: `${coords.top}px`,
|
|
299
|
+
left: `${coords.left}px`,
|
|
300
|
+
zIndex: 60
|
|
301
|
+
},
|
|
302
|
+
className: "w-[560px] max-w-[calc(100vw-32px)] rounded-xl border border-border/80 bg-popover/95 text-popover-foreground shadow-2xl backdrop-blur-xl animate-in fade-in-0 zoom-in-95 duration-150 overflow-hidden",
|
|
303
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-3 border-b border-border/60 bg-muted/20", children: [
|
|
306
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-7 h-7 rounded-lg bg-primary/10 text-primary shrink-0", children: /* @__PURE__ */ jsx(Sparkles, { className: "w-4 h-4" }) }),
|
|
307
|
+
/* @__PURE__ */ jsx(
|
|
308
|
+
"input",
|
|
309
|
+
{
|
|
310
|
+
ref: inputRef,
|
|
311
|
+
type: "text",
|
|
312
|
+
value: prompt,
|
|
313
|
+
onChange: (e) => setPrompt(e.target.value),
|
|
314
|
+
onKeyDown: (e) => {
|
|
315
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
316
|
+
e.preventDefault();
|
|
317
|
+
if (prompt.trim()) {
|
|
318
|
+
runAction("default", selectedText, prompt);
|
|
319
|
+
}
|
|
320
|
+
} else if (e.key === "Escape") {
|
|
321
|
+
closeBar();
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
placeholder: selectedText ? `Ask AI to edit selection ("${selectedText.slice(0, 24)}...")...` : "Ask AI to write, generate, or continue...",
|
|
325
|
+
className: "flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
isGenerating ? /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", disabled: true, className: "h-8 px-2 text-xs", children: [
|
|
329
|
+
/* @__PURE__ */ jsx(Loader2, { className: "w-3.5 h-3.5 animate-spin mr-1.5" }),
|
|
330
|
+
"Generating..."
|
|
331
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
332
|
+
Button,
|
|
333
|
+
{
|
|
334
|
+
size: "sm",
|
|
335
|
+
variant: "default",
|
|
336
|
+
disabled: !prompt.trim() && !activeAction,
|
|
337
|
+
onClick: () => runAction("default", selectedText, prompt),
|
|
338
|
+
className: "h-8 px-3 text-xs font-medium",
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ jsx("span", { children: "Submit" }),
|
|
341
|
+
/* @__PURE__ */ jsx(CornerDownLeft, { className: "w-3 h-3 ml-1.5 opacity-60" })
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
),
|
|
345
|
+
/* @__PURE__ */ jsx(
|
|
346
|
+
Button,
|
|
347
|
+
{
|
|
348
|
+
size: "sm",
|
|
349
|
+
variant: "ghost",
|
|
350
|
+
onClick: closeBar,
|
|
351
|
+
className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
|
|
352
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
353
|
+
}
|
|
354
|
+
)
|
|
355
|
+
] }),
|
|
356
|
+
streamedText && /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-border/60 max-h-[300px] overflow-y-auto space-y-3 bg-background/50", children: [
|
|
357
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
358
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: selectedText ? "Diff Preview (Original vs. AI)" : "AI Output" }),
|
|
359
|
+
isGenerating && /* @__PURE__ */ jsxs("span", { className: "text-xs text-primary flex items-center gap-1 font-medium", children: [
|
|
360
|
+
/* @__PURE__ */ jsx(Loader2, { className: "w-3 h-3 animate-spin" }),
|
|
361
|
+
"Streaming response..."
|
|
362
|
+
] })
|
|
363
|
+
] }),
|
|
364
|
+
selectedText ? /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed p-3 rounded-lg border border-border/50 bg-muted/30 font-sans", children: diffParts.map((part, index) => {
|
|
365
|
+
if (part.type === "removed") {
|
|
366
|
+
return /* @__PURE__ */ jsx(
|
|
367
|
+
"span",
|
|
368
|
+
{
|
|
369
|
+
className: "bg-red-500/15 text-red-600 dark:text-red-400 line-through rounded px-1 py-0.5 mx-0.5",
|
|
370
|
+
children: part.text
|
|
371
|
+
},
|
|
372
|
+
index
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
if (part.type === "added") {
|
|
376
|
+
return /* @__PURE__ */ jsx(
|
|
377
|
+
"span",
|
|
378
|
+
{
|
|
379
|
+
className: "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 font-medium rounded px-1 py-0.5 mx-0.5",
|
|
380
|
+
children: part.text
|
|
381
|
+
},
|
|
382
|
+
index
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
return /* @__PURE__ */ jsx("span", { children: part.text }, index);
|
|
386
|
+
}) }) : /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed p-3 rounded-lg border border-border/50 bg-muted/30 font-sans whitespace-pre-wrap", children: streamedText }),
|
|
387
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-1", children: [
|
|
388
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
389
|
+
/* @__PURE__ */ jsxs(
|
|
390
|
+
Button,
|
|
391
|
+
{
|
|
392
|
+
size: "sm",
|
|
393
|
+
variant: "default",
|
|
394
|
+
onClick: handleAccept,
|
|
395
|
+
className: "h-8 bg-emerald-600 hover:bg-emerald-700 text-white font-medium text-xs px-3",
|
|
396
|
+
children: [
|
|
397
|
+
/* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5 mr-1" }),
|
|
398
|
+
/* @__PURE__ */ jsx("span", { children: "Replace Selection" }),
|
|
399
|
+
/* @__PURE__ */ jsx("kbd", { className: "ml-1.5 px-1 py-0.2 bg-emerald-700/60 rounded text-[10px]", children: "\u21B5" })
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
/* @__PURE__ */ jsxs(
|
|
404
|
+
Button,
|
|
405
|
+
{
|
|
406
|
+
size: "sm",
|
|
407
|
+
variant: "outline",
|
|
408
|
+
onClick: handleInsertBelow,
|
|
409
|
+
className: "h-8 text-xs font-medium px-3",
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx(ArrowDownToLine, { className: "w-3.5 h-3.5 mr-1.5" }),
|
|
412
|
+
"Insert Below"
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
418
|
+
/* @__PURE__ */ jsxs(
|
|
419
|
+
Button,
|
|
420
|
+
{
|
|
421
|
+
size: "sm",
|
|
422
|
+
variant: "ghost",
|
|
423
|
+
onClick: () => runAction(activeAction || "default", selectedText, prompt),
|
|
424
|
+
className: "h-8 text-xs text-muted-foreground hover:text-foreground",
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ jsx(RotateCcw, { className: "w-3.5 h-3.5 mr-1" }),
|
|
427
|
+
"Retry"
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
),
|
|
431
|
+
/* @__PURE__ */ jsx(
|
|
432
|
+
Button,
|
|
433
|
+
{
|
|
434
|
+
size: "sm",
|
|
435
|
+
variant: "ghost",
|
|
436
|
+
onClick: closeBar,
|
|
437
|
+
className: "h-8 text-xs text-muted-foreground hover:text-destructive",
|
|
438
|
+
children: "Discard"
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
] })
|
|
442
|
+
] })
|
|
443
|
+
] }),
|
|
444
|
+
/* @__PURE__ */ jsx("div", { className: "p-3 bg-muted/10 space-y-2", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
445
|
+
QUICK_ACTIONS.map((action) => {
|
|
446
|
+
const Icon = action.icon;
|
|
447
|
+
return /* @__PURE__ */ jsxs(
|
|
448
|
+
"button",
|
|
449
|
+
{
|
|
450
|
+
onClick: () => runAction(action.id, selectedText),
|
|
451
|
+
className: "flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border/60 bg-background/80 hover:bg-muted text-muted-foreground hover:text-foreground transition-all",
|
|
452
|
+
children: [
|
|
453
|
+
/* @__PURE__ */ jsx(Icon, { className: "w-3.5 h-3.5 text-primary" }),
|
|
454
|
+
/* @__PURE__ */ jsx("span", { children: action.label })
|
|
455
|
+
]
|
|
456
|
+
},
|
|
457
|
+
action.id
|
|
458
|
+
);
|
|
459
|
+
}),
|
|
460
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
461
|
+
/* @__PURE__ */ jsxs(
|
|
462
|
+
"button",
|
|
463
|
+
{
|
|
464
|
+
onClick: () => {
|
|
465
|
+
setShowToneMenu(!showToneMenu);
|
|
466
|
+
setShowLangMenu(false);
|
|
467
|
+
},
|
|
468
|
+
className: "flex items-center gap-1 px-2.5 py-1 text-xs rounded-md border border-border/60 bg-background/80 hover:bg-muted text-muted-foreground hover:text-foreground transition-all",
|
|
469
|
+
children: [
|
|
470
|
+
/* @__PURE__ */ jsx("span", { children: "Change Tone" }),
|
|
471
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-60" })
|
|
472
|
+
]
|
|
473
|
+
}
|
|
474
|
+
),
|
|
475
|
+
showToneMenu && /* @__PURE__ */ jsx("div", { className: "absolute left-0 bottom-full mb-1 w-36 rounded-lg border border-border bg-popover shadow-xl py-1 z-50 animate-in fade-in-0 zoom-in-95", children: TONES.map((tone) => /* @__PURE__ */ jsx(
|
|
476
|
+
"button",
|
|
477
|
+
{
|
|
478
|
+
onClick: () => {
|
|
479
|
+
setShowToneMenu(false);
|
|
480
|
+
runAction(
|
|
481
|
+
"default",
|
|
482
|
+
selectedText,
|
|
483
|
+
`Rewrite the text in a ${tone.toLowerCase()} tone.`
|
|
484
|
+
);
|
|
485
|
+
},
|
|
486
|
+
className: "w-full text-left px-3 py-1.5 text-xs text-popover-foreground hover:bg-muted transition-colors",
|
|
487
|
+
children: tone
|
|
488
|
+
},
|
|
489
|
+
tone
|
|
490
|
+
)) })
|
|
491
|
+
] }),
|
|
492
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
493
|
+
/* @__PURE__ */ jsxs(
|
|
494
|
+
"button",
|
|
495
|
+
{
|
|
496
|
+
onClick: () => {
|
|
497
|
+
setShowLangMenu(!showLangMenu);
|
|
498
|
+
setShowToneMenu(false);
|
|
499
|
+
},
|
|
500
|
+
className: "flex items-center gap-1 px-2.5 py-1 text-xs rounded-md border border-border/60 bg-background/80 hover:bg-muted text-muted-foreground hover:text-foreground transition-all",
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ jsx(Languages, { className: "w-3 h-3 text-primary" }),
|
|
503
|
+
/* @__PURE__ */ jsx("span", { children: "Translate" }),
|
|
504
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-60" })
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
showLangMenu && /* @__PURE__ */ jsx("div", { className: "absolute left-0 bottom-full mb-1 w-36 rounded-lg border border-border bg-popover shadow-xl py-1 z-50 animate-in fade-in-0 zoom-in-95", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx(
|
|
509
|
+
"button",
|
|
510
|
+
{
|
|
511
|
+
onClick: () => {
|
|
512
|
+
setShowLangMenu(false);
|
|
513
|
+
runAction(
|
|
514
|
+
"default",
|
|
515
|
+
selectedText,
|
|
516
|
+
`Translate the text accurately into ${lang}.`
|
|
517
|
+
);
|
|
518
|
+
},
|
|
519
|
+
className: "w-full text-left px-3 py-1.5 text-xs text-popover-foreground hover:bg-muted transition-colors",
|
|
520
|
+
children: lang
|
|
521
|
+
},
|
|
522
|
+
lang
|
|
523
|
+
)) })
|
|
524
|
+
] })
|
|
525
|
+
] }) })
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
document.body
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export {
|
|
534
|
+
OPEN_AI_COMMAND_BAR_COMMAND,
|
|
535
|
+
AICommandBarPlugin
|
|
536
|
+
};
|