@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
package/dist/index.d.mts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { ElementFormatType } from 'lexical';
|
|
4
|
-
import { HistoryState } from '@lexical/react/LexicalHistoryPlugin';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Configuration for AI features in the Notiq editor.
|
|
8
|
-
*/
|
|
9
|
-
interface AIConfig {
|
|
10
|
-
/**
|
|
11
|
-
* The API endpoint for AI completions. Defaults to "/api/ai".
|
|
12
|
-
*/
|
|
13
|
-
apiEndpoint?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Hook to access the current AI configuration.
|
|
17
|
-
*/
|
|
18
|
-
declare const useAI: () => AIConfig;
|
|
19
|
-
/**
|
|
20
|
-
* Provider component for AI configuration.
|
|
21
|
-
*/
|
|
22
|
-
declare const AIProvider: ({ config, children }: {
|
|
23
|
-
config?: AIConfig;
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
}) => React__default.JSX.Element;
|
|
26
|
-
|
|
27
|
-
interface UploadResponse {
|
|
28
|
-
url: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A function that handles file uploads.
|
|
32
|
-
* @param file The file to upload.
|
|
33
|
-
* @param onProgress Callback to report upload progress (0-100).
|
|
34
|
-
* @returns A promise that resolves to an object containing the uploaded file's URL.
|
|
35
|
-
*/
|
|
36
|
-
type UploadHandler = (file: File, onProgress?: (progress: number) => void) => Promise<UploadResponse>;
|
|
37
|
-
interface UploadConfig {
|
|
38
|
-
/**
|
|
39
|
-
* Custom upload handler. If not provided, the editor will attempt to use its default
|
|
40
|
-
* (which currently depends on EdgeStore if configured).
|
|
41
|
-
*/
|
|
42
|
-
uploadHandler?: UploadHandler;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Hook to access the current Upload configuration.
|
|
46
|
-
*/
|
|
47
|
-
declare const useUpload: () => UploadConfig | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Provider component for Upload configuration.
|
|
50
|
-
*/
|
|
51
|
-
declare const UploadProvider: ({ config, children }: {
|
|
52
|
-
config?: UploadConfig;
|
|
53
|
-
children: ReactNode;
|
|
54
|
-
}) => React__default.JSX.Element;
|
|
55
|
-
|
|
56
|
-
type ToolbarItem = "undo" | "redo" | "block-format" | "font-family" | "font-size" | "bold" | "italic" | "underline" | "code" | "link" | "color" | "bg-color" | "text-format" | "insert" | "align" | "speech" | "template" | "download" | "export-md" | "export-pdf" | "separator";
|
|
57
|
-
type ToolbarConfig = {
|
|
58
|
-
items?: ToolbarItem[];
|
|
59
|
-
className?: string;
|
|
60
|
-
itemClassName?: string;
|
|
61
|
-
activeItemClassName?: string;
|
|
62
|
-
mobileClassName?: string;
|
|
63
|
-
mobileItemClassName?: string;
|
|
64
|
-
};
|
|
65
|
-
declare function Editor({ isEditable, content, aiConfig, uploadConfig, toolbarConfig, }: {
|
|
66
|
-
isEditable: boolean;
|
|
67
|
-
content?: unknown;
|
|
68
|
-
aiConfig?: AIConfig;
|
|
69
|
-
uploadConfig?: UploadConfig;
|
|
70
|
-
toolbarConfig?: ToolbarConfig;
|
|
71
|
-
}): React__default.JSX.Element;
|
|
72
|
-
|
|
73
|
-
declare const MIN_ALLOWED_FONT_SIZE = 8;
|
|
74
|
-
declare const MAX_ALLOWED_FONT_SIZE = 72;
|
|
75
|
-
declare const DEFAULT_FONT_SIZE = 15;
|
|
76
|
-
declare const rootTypeToRootName: {
|
|
77
|
-
root: string;
|
|
78
|
-
table: string;
|
|
79
|
-
};
|
|
80
|
-
declare const blockTypeToBlockName: {
|
|
81
|
-
bullet: string;
|
|
82
|
-
check: string;
|
|
83
|
-
code: string;
|
|
84
|
-
h1: string;
|
|
85
|
-
h2: string;
|
|
86
|
-
h3: string;
|
|
87
|
-
h4: string;
|
|
88
|
-
h5: string;
|
|
89
|
-
h6: string;
|
|
90
|
-
number: string;
|
|
91
|
-
paragraph: string;
|
|
92
|
-
quote: string;
|
|
93
|
-
};
|
|
94
|
-
declare const INITIAL_TOOLBAR_STATE: {
|
|
95
|
-
bgColor: string;
|
|
96
|
-
blockType: keyof typeof blockTypeToBlockName;
|
|
97
|
-
canRedo: boolean;
|
|
98
|
-
canUndo: boolean;
|
|
99
|
-
codeLanguage: string;
|
|
100
|
-
elementFormat: ElementFormatType;
|
|
101
|
-
fontColor: string;
|
|
102
|
-
fontFamily: string;
|
|
103
|
-
fontSize: string;
|
|
104
|
-
fontSizeInputValue: string;
|
|
105
|
-
isBold: boolean;
|
|
106
|
-
isCode: boolean;
|
|
107
|
-
isImageCaption: boolean;
|
|
108
|
-
isItalic: boolean;
|
|
109
|
-
isLink: boolean;
|
|
110
|
-
isRTL: boolean;
|
|
111
|
-
isStrikethrough: boolean;
|
|
112
|
-
isSubscript: boolean;
|
|
113
|
-
isSuperscript: boolean;
|
|
114
|
-
isUnderline: boolean;
|
|
115
|
-
isLowercase: boolean;
|
|
116
|
-
isUppercase: boolean;
|
|
117
|
-
isCapitalize: boolean;
|
|
118
|
-
rootType: keyof typeof rootTypeToRootName;
|
|
119
|
-
};
|
|
120
|
-
type ToolbarState = typeof INITIAL_TOOLBAR_STATE;
|
|
121
|
-
type ToolbarStateKey = keyof ToolbarState;
|
|
122
|
-
type ToolbarStateValue<Key extends ToolbarStateKey> = ToolbarState[Key];
|
|
123
|
-
type ContextShape$1 = {
|
|
124
|
-
toolbarState: ToolbarState;
|
|
125
|
-
updateToolbarState<Key extends ToolbarStateKey>(key: Key, value: ToolbarStateValue<Key>): void;
|
|
126
|
-
};
|
|
127
|
-
declare const ToolbarContext: ({ children, }: {
|
|
128
|
-
children: ReactNode;
|
|
129
|
-
}) => React__default.JSX.Element;
|
|
130
|
-
declare const useToolbarState: () => ContextShape$1;
|
|
131
|
-
|
|
132
|
-
type ContextShape = {
|
|
133
|
-
historyState?: HistoryState;
|
|
134
|
-
};
|
|
135
|
-
declare const SharedHistoryContext: ({ children, }: {
|
|
136
|
-
children: ReactNode;
|
|
137
|
-
}) => React.JSX.Element;
|
|
138
|
-
declare const useSharedHistoryContext: () => ContextShape;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* A Tailwind CSS plugin that adds Notiq's custom theme variables and styles.
|
|
142
|
-
*/
|
|
143
|
-
declare const notiqPlugin: any;
|
|
144
|
-
|
|
145
|
-
export { type AIConfig, AIProvider, type ContextShape$1 as ContextShape, DEFAULT_FONT_SIZE, Editor, MAX_ALLOWED_FONT_SIZE, MIN_ALLOWED_FONT_SIZE, SharedHistoryContext, type ToolbarConfig, ToolbarContext, type ToolbarItem, type UploadConfig, type UploadHandler, UploadProvider, type UploadResponse, blockTypeToBlockName, notiqPlugin, useAI, useSharedHistoryContext, useToolbarState, useUpload };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Skeleton
|
|
3
|
-
} from "./chunk-QEIFVK5M.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Input
|
|
6
|
-
} from "./chunk-POGRR73N.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Button
|
|
9
|
-
} from "./chunk-BIU7WTLX.mjs";
|
|
10
|
-
import "./chunk-YHPNOWFH.mjs";
|
|
11
|
-
import {
|
|
12
|
-
init_react_shim
|
|
13
|
-
} from "./chunk-77KXU36M.mjs";
|
|
14
|
-
|
|
15
|
-
// src/components/ui/models/insert-gif.tsx
|
|
16
|
-
init_react_shim();
|
|
17
|
-
import React2, { useState, useEffect } from "react";
|
|
18
|
-
import { useQuery } from "@tanstack/react-query";
|
|
19
|
-
|
|
20
|
-
// src/components/editor/utils/gif.ts
|
|
21
|
-
init_react_shim();
|
|
22
|
-
var API_KEY = process.env.NEXT_PUBLIC_TENOR_API_KEY;
|
|
23
|
-
var fetchGifs = async ({ q = "trending" }) => {
|
|
24
|
-
const params = new URLSearchParams({
|
|
25
|
-
key: API_KEY || "",
|
|
26
|
-
q,
|
|
27
|
-
limit: "200",
|
|
28
|
-
media_filter: "minimal"
|
|
29
|
-
});
|
|
30
|
-
const response = await fetch(`https://tenor.googleapis.com/v2/search?${params.toString()}`);
|
|
31
|
-
if (!response.ok) {
|
|
32
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
33
|
-
}
|
|
34
|
-
const data = await response.json();
|
|
35
|
-
const gifs = data.results.map((gif) => ({
|
|
36
|
-
id: gif.id,
|
|
37
|
-
url: gif.media_formats.gif.url,
|
|
38
|
-
alt_text: gif.content_description
|
|
39
|
-
}));
|
|
40
|
-
return { gifs, next: data.next };
|
|
41
|
-
};
|
|
42
|
-
var gif_default = fetchGifs;
|
|
43
|
-
|
|
44
|
-
// src/components/ui/models/insert-gif.tsx
|
|
45
|
-
import { Search, X } from "lucide-react";
|
|
46
|
-
function InsertGif({ insertGifOnClick, onClose }) {
|
|
47
|
-
const [search, setSearch] = useState("");
|
|
48
|
-
const [debouncedSearch, setDebouncedSearch] = useState("");
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
const handler = setTimeout(() => {
|
|
51
|
-
setDebouncedSearch(search);
|
|
52
|
-
}, 500);
|
|
53
|
-
return () => clearTimeout(handler);
|
|
54
|
-
}, [search]);
|
|
55
|
-
const { data: gifs, isPending } = useQuery({
|
|
56
|
-
queryKey: ["gifs", debouncedSearch],
|
|
57
|
-
queryFn: async () => {
|
|
58
|
-
const { gifs: gifs2 } = await gif_default({ q: debouncedSearch || "trending" });
|
|
59
|
-
return gifs2;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return /* @__PURE__ */ React2.createElement("div", { className: "flex flex-col space-y-1" }, /* @__PURE__ */ React2.createElement("form", { onSubmit: (e) => e.preventDefault(), className: "relative mb-3" }, /* @__PURE__ */ React2.createElement(
|
|
63
|
-
Button,
|
|
64
|
-
{
|
|
65
|
-
type: "submit",
|
|
66
|
-
className: "absolute text-gray-500 left-1 top-[50%] -translate-y-1/2",
|
|
67
|
-
variant: "ghost",
|
|
68
|
-
size: "sm"
|
|
69
|
-
},
|
|
70
|
-
/* @__PURE__ */ React2.createElement(Search, { className: "w-4 h-4" })
|
|
71
|
-
), /* @__PURE__ */ React2.createElement(
|
|
72
|
-
Input,
|
|
73
|
-
{
|
|
74
|
-
onChange: (e) => setSearch(e.target.value),
|
|
75
|
-
value: search,
|
|
76
|
-
placeholder: "Search for GIFs",
|
|
77
|
-
className: "pl-9"
|
|
78
|
-
}
|
|
79
|
-
), search && /* @__PURE__ */ React2.createElement(
|
|
80
|
-
X,
|
|
81
|
-
{
|
|
82
|
-
onClick: () => setSearch(""),
|
|
83
|
-
className: "w-4 h-4 absolute cursor-pointer transition-colors text-gray-500 right-3 top-[50%] hover:text-white -translate-y-1/2"
|
|
84
|
-
}
|
|
85
|
-
)), /* @__PURE__ */ React2.createElement("div", { className: "grid grid-cols-3 gap-2" }, isPending && Array(9).fill(0).map((_, i) => /* @__PURE__ */ React2.createElement(Skeleton, { key: i, className: "rounded-md w-full h-full" })), !isPending && (gifs == null ? void 0 : gifs.map((gif) => /* @__PURE__ */ React2.createElement(
|
|
86
|
-
"button",
|
|
87
|
-
{
|
|
88
|
-
key: gif.id,
|
|
89
|
-
onClick: () => {
|
|
90
|
-
insertGifOnClick({ src: gif.url, altText: gif.alt_text });
|
|
91
|
-
onClose();
|
|
92
|
-
},
|
|
93
|
-
className: "w-full h-full"
|
|
94
|
-
},
|
|
95
|
-
/* @__PURE__ */ React2.createElement("img", { src: gif.url, alt: gif.alt_text, className: "rounded-md w-full h-full" })
|
|
96
|
-
))), !isPending && (gifs == null ? void 0 : gifs.length) === 0 && /* @__PURE__ */ React2.createElement("p", { className: "text-center text-gray-500" }, "No GIFs found")));
|
|
97
|
-
}
|
|
98
|
-
export {
|
|
99
|
-
InsertGif as default
|
|
100
|
-
};
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Progress,
|
|
3
|
-
useUpload
|
|
4
|
-
} from "./chunk-JXDPPUJI.mjs";
|
|
5
|
-
import {
|
|
6
|
-
INSERT_IMAGE_COMMAND
|
|
7
|
-
} from "./chunk-LGG4IUIA.mjs";
|
|
8
|
-
import "./chunk-N3WN46VL.mjs";
|
|
9
|
-
import {
|
|
10
|
-
Card,
|
|
11
|
-
CardContent
|
|
12
|
-
} from "./chunk-3G37YKTV.mjs";
|
|
13
|
-
import {
|
|
14
|
-
Button
|
|
15
|
-
} from "./chunk-BIU7WTLX.mjs";
|
|
16
|
-
import "./chunk-YHPNOWFH.mjs";
|
|
17
|
-
import {
|
|
18
|
-
React,
|
|
19
|
-
init_react_shim
|
|
20
|
-
} from "./chunk-77KXU36M.mjs";
|
|
21
|
-
|
|
22
|
-
// src/components/ui/models/insert-image.tsx
|
|
23
|
-
init_react_shim();
|
|
24
|
-
import { useEffect, useRef as useRef2 } from "react";
|
|
25
|
-
|
|
26
|
-
// src/components/ui/image/file-upload.tsx
|
|
27
|
-
init_react_shim();
|
|
28
|
-
import { useState, useRef } from "react";
|
|
29
|
-
import {
|
|
30
|
-
Upload,
|
|
31
|
-
Loader2,
|
|
32
|
-
X,
|
|
33
|
-
Image,
|
|
34
|
-
UploadCloudIcon,
|
|
35
|
-
Video
|
|
36
|
-
} from "lucide-react";
|
|
37
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
38
|
-
|
|
39
|
-
// src/lib/edgestore.ts
|
|
40
|
-
init_react_shim();
|
|
41
|
-
import { createEdgeStoreProvider } from "@edgestore/react";
|
|
42
|
-
var { EdgeStoreProvider, useEdgeStore } = createEdgeStoreProvider();
|
|
43
|
-
|
|
44
|
-
// src/components/ui/image/file-upload.tsx
|
|
45
|
-
var FileUploadZone = ({
|
|
46
|
-
InsertMedia
|
|
47
|
-
}) => {
|
|
48
|
-
const [draggedZone, setDraggedZone] = useState(null);
|
|
49
|
-
const [files, setFiles] = useState([]);
|
|
50
|
-
const [uploading, setUploading] = useState(false);
|
|
51
|
-
const [progress, setProgress] = useState(0);
|
|
52
|
-
const fileInputRef = useRef(null);
|
|
53
|
-
const { edgestore } = useEdgeStore();
|
|
54
|
-
const uploadConfig = useUpload();
|
|
55
|
-
const handleDragEnter = (index) => (e) => {
|
|
56
|
-
e.preventDefault();
|
|
57
|
-
setDraggedZone(index);
|
|
58
|
-
};
|
|
59
|
-
const handleDragLeave = (e) => {
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
setDraggedZone(null);
|
|
62
|
-
};
|
|
63
|
-
const upload = async (newFiles) => {
|
|
64
|
-
setUploading(true);
|
|
65
|
-
setProgress(0);
|
|
66
|
-
let uploadedFiles = [];
|
|
67
|
-
for (let i = 0; i < newFiles.length; i++) {
|
|
68
|
-
const file = newFiles[i];
|
|
69
|
-
try {
|
|
70
|
-
let url = "";
|
|
71
|
-
if (uploadConfig == null ? void 0 : uploadConfig.uploadHandler) {
|
|
72
|
-
const res = await uploadConfig.uploadHandler(file, (p) => {
|
|
73
|
-
setProgress(
|
|
74
|
-
Math.round(p / 100 * ((i + 1) / newFiles.length) * 100)
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
url = res.url;
|
|
78
|
-
} else {
|
|
79
|
-
const response = await edgestore.publicFiles.upload({
|
|
80
|
-
file,
|
|
81
|
-
onProgressChange: (progress2) => {
|
|
82
|
-
setProgress(
|
|
83
|
-
Math.round(progress2 / 100 * ((i + 1) / newFiles.length) * 100)
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
url = response.url;
|
|
88
|
-
}
|
|
89
|
-
uploadedFiles.push({ url, alt: file.name });
|
|
90
|
-
} catch (error) {
|
|
91
|
-
console.error(`Error uploading ${file.name}:`, error);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
setFiles((prevFiles) => [...prevFiles, ...uploadedFiles]);
|
|
95
|
-
setUploading(false);
|
|
96
|
-
setProgress(100);
|
|
97
|
-
};
|
|
98
|
-
const handleDrop = () => async (e) => {
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
setDraggedZone(null);
|
|
101
|
-
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
102
|
-
if (droppedFiles.length > 0) {
|
|
103
|
-
await upload(droppedFiles);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
const handleFileSelect = async (e) => {
|
|
107
|
-
const selectedFiles = Array.from(e.target.files || []);
|
|
108
|
-
if (selectedFiles.length > 0) {
|
|
109
|
-
await upload(selectedFiles);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const removeFile = (index) => {
|
|
113
|
-
setFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));
|
|
114
|
-
};
|
|
115
|
-
const zones = [
|
|
116
|
-
{
|
|
117
|
-
title: "Upload Images",
|
|
118
|
-
subtitle: "Drop images here",
|
|
119
|
-
icon: Image,
|
|
120
|
-
gradient: "from-purple-400 via-pink-500 to-red-500",
|
|
121
|
-
rotate: "-rotate-2"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
title: "Upload Videos",
|
|
125
|
-
subtitle: "Drop videos here",
|
|
126
|
-
icon: Video,
|
|
127
|
-
gradient: "from-blue-400 via-teal-500 to-green-500",
|
|
128
|
-
rotate: ""
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
title: "Upload Files",
|
|
132
|
-
subtitle: "Drop files here",
|
|
133
|
-
icon: UploadCloudIcon,
|
|
134
|
-
gradient: "from-yellow-400 via-orange-500 to-red-500",
|
|
135
|
-
rotate: "rotate-3"
|
|
136
|
-
}
|
|
137
|
-
];
|
|
138
|
-
return /* @__PURE__ */ React.createElement(Card, { className: "mx-auto w-full bg-transparent border-none max-w-[300px] lg:max-w-[500px] overflow-hidden rounded-[1rem]" }, /* @__PURE__ */ React.createElement(CardContent, { className: "p-6 py-7 cursor:pointer" }, /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6" }, zones.map((zone, index) => /* @__PURE__ */ React.createElement("div", { key: index, className: `relative ${zone.rotate}` }, /* @__PURE__ */ React.createElement(
|
|
139
|
-
motion.div,
|
|
140
|
-
{
|
|
141
|
-
onDragEnter: handleDragEnter(index),
|
|
142
|
-
onDragOver: (e) => e.preventDefault(),
|
|
143
|
-
onDragLeave: handleDragLeave,
|
|
144
|
-
onDrop: handleDrop,
|
|
145
|
-
whileHover: { y: -4, scale: 1.02 },
|
|
146
|
-
whileTap: { scale: 0.98 },
|
|
147
|
-
className: "group relative h-full"
|
|
148
|
-
},
|
|
149
|
-
/* @__PURE__ */ React.createElement(
|
|
150
|
-
"div",
|
|
151
|
-
{
|
|
152
|
-
className: `
|
|
153
|
-
absolute inset-0 -z-10 rounded-xl bg-gradient-to-br ${zone.gradient}
|
|
154
|
-
opacity-0 blur-md transition-opacity duration-300
|
|
155
|
-
${draggedZone === index ? "opacity-70" : "group-hover:opacity-70"}
|
|
156
|
-
`
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
/* @__PURE__ */ React.createElement(Card, { className: "relative h-full rounded-[1rem] overflow-hidden border-2 border-dashed border-gray-200 dark:border-gray-800 transition-colors duration-300 group-hover:border-transparent" }, /* @__PURE__ */ React.createElement(CardContent, { className: "flex h-full flex-col items-center justify-center p-6 text-center" }, /* @__PURE__ */ React.createElement(
|
|
160
|
-
motion.div,
|
|
161
|
-
{
|
|
162
|
-
whileHover: { scale: 1.1, rotate: 10 },
|
|
163
|
-
className: "rounded-full bg-gray-100 dark:bg-gray-800 p-3 mb-4"
|
|
164
|
-
},
|
|
165
|
-
/* @__PURE__ */ React.createElement(zone.icon, { className: "h-8 w-8 text-gray-500" })
|
|
166
|
-
), /* @__PURE__ */ React.createElement("h3", { className: "mb-1 text-sm font-medium" }, zone.title), /* @__PURE__ */ React.createElement("p", { className: "text-xs text-gray-500" }, zone.subtitle)))
|
|
167
|
-
)))), (uploading || files.length > 0) && /* @__PURE__ */ React.createElement("div", { className: "mb-6" }, /* @__PURE__ */ React.createElement(Progress, { value: uploading ? progress : 100, className: "h-2 mb-2" }), /* @__PURE__ */ React.createElement("p", { className: "text-sm text-gray-500 mb-2" }, uploading ? `Uploading... ${progress}%` : `${files.length} file(s) uploaded`), /* @__PURE__ */ React.createElement(AnimatePresence, null, files.map((file, index) => /* @__PURE__ */ React.createElement(
|
|
168
|
-
motion.div,
|
|
169
|
-
{
|
|
170
|
-
key: `${file.alt}-${index}`,
|
|
171
|
-
initial: { opacity: 0, y: -10 },
|
|
172
|
-
animate: { opacity: 1, y: 0 },
|
|
173
|
-
exit: { opacity: 0, y: -10 },
|
|
174
|
-
className: "flex items-center justify-between bg-gray-100 dark:bg-gray-800 rounded-[1rem] p-2 mb-2"
|
|
175
|
-
},
|
|
176
|
-
/* @__PURE__ */ React.createElement("span", { className: "truncate max-w-[80%] text-sm text-gray-700 dark:text-gray-300 ml-2" }, file.alt),
|
|
177
|
-
/* @__PURE__ */ React.createElement(
|
|
178
|
-
Button,
|
|
179
|
-
{
|
|
180
|
-
variant: "ghost",
|
|
181
|
-
size: "icon",
|
|
182
|
-
onClick: () => removeFile(index),
|
|
183
|
-
className: "h-6 w-6 p-0 hover:bg-gray-200 dark:hover:bg-gray-700"
|
|
184
|
-
},
|
|
185
|
-
/* @__PURE__ */ React.createElement(X, { className: "h-4 w-4" })
|
|
186
|
-
)
|
|
187
|
-
)))), /* @__PURE__ */ React.createElement("div", { className: "text-center flex flex-col" }, /* @__PURE__ */ React.createElement(
|
|
188
|
-
"input",
|
|
189
|
-
{
|
|
190
|
-
type: "file",
|
|
191
|
-
ref: fileInputRef,
|
|
192
|
-
onChange: handleFileSelect,
|
|
193
|
-
className: "hidden",
|
|
194
|
-
multiple: true
|
|
195
|
-
}
|
|
196
|
-
), /* @__PURE__ */ React.createElement(
|
|
197
|
-
Button,
|
|
198
|
-
{
|
|
199
|
-
onClick: () => {
|
|
200
|
-
var _a;
|
|
201
|
-
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
202
|
-
},
|
|
203
|
-
disabled: uploading,
|
|
204
|
-
className: "rounded-[1rem] mt-5"
|
|
205
|
-
},
|
|
206
|
-
uploading ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Uploading...") : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Upload, { className: "mr-2 h-4 w-4" }), "Choose Files")
|
|
207
|
-
), files.length > 0 && /* @__PURE__ */ React.createElement(
|
|
208
|
-
Button,
|
|
209
|
-
{
|
|
210
|
-
onClick: () => InsertMedia(files),
|
|
211
|
-
disabled: uploading,
|
|
212
|
-
className: "rounded-[1rem] mt-2"
|
|
213
|
-
},
|
|
214
|
-
"Insert the ",
|
|
215
|
-
files.length == 1 ? "image" : "images"
|
|
216
|
-
))));
|
|
217
|
-
};
|
|
218
|
-
var file_upload_default = FileUploadZone;
|
|
219
|
-
|
|
220
|
-
// src/components/ui/models/insert-image.tsx
|
|
221
|
-
function InsertImageDialog({
|
|
222
|
-
activeEditor,
|
|
223
|
-
onClose
|
|
224
|
-
}) {
|
|
225
|
-
const hasModifier = useRef2(false);
|
|
226
|
-
useEffect(() => {
|
|
227
|
-
hasModifier.current = false;
|
|
228
|
-
const handler = (e) => {
|
|
229
|
-
hasModifier.current = e.altKey;
|
|
230
|
-
};
|
|
231
|
-
document.addEventListener("keydown", handler);
|
|
232
|
-
return () => {
|
|
233
|
-
document.removeEventListener("keydown", handler);
|
|
234
|
-
};
|
|
235
|
-
}, [activeEditor]);
|
|
236
|
-
const handleInsertImage = (payload) => {
|
|
237
|
-
activeEditor.dispatchCommand(INSERT_IMAGE_COMMAND, payload);
|
|
238
|
-
};
|
|
239
|
-
const InsertMedia = (files) => {
|
|
240
|
-
if (!files) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
for (let index = 0; index < files.length; index++) {
|
|
244
|
-
console.log(files);
|
|
245
|
-
const payload = {
|
|
246
|
-
altText: files[index].alt || "image",
|
|
247
|
-
src: files[index].url
|
|
248
|
-
};
|
|
249
|
-
handleInsertImage(payload);
|
|
250
|
-
if (index === files.length - 1) {
|
|
251
|
-
onClose();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
return /* @__PURE__ */ React.createElement(file_upload_default, { InsertMedia });
|
|
256
|
-
}
|
|
257
|
-
export {
|
|
258
|
-
InsertImageDialog
|
|
259
|
-
};
|