@collabchron/notiq 0.3.0 → 1.0.0
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/LICENSE +21 -0
- package/README.md +230 -39
- package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +15 -0
- package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +161 -0
- package/dist/EquationComponent-CB6DFIHV.mjs +154 -0
- package/dist/ExcalidrawComponent-XW6646OH.mjs +528 -0
- package/dist/ExcalidrawPlugin-ZFHT62IF.mjs +14 -0
- package/dist/ExportPlugin-V2RLM63S.mjs +11 -0
- package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +12 -0
- package/dist/FloatingTextFormatToolbarPlugin-F2GY6LMI.mjs +30 -0
- package/dist/HintComponet-BRL6EAMS.mjs +217 -0
- package/dist/InlineImageComponent-UWIUWBHI.mjs +453 -0
- package/dist/MobileToolbar-BOOZAMQE.mjs +268 -0
- package/dist/SlashCommand-GMT5JI33.mjs +28 -0
- package/dist/StoryBuilderComponent-JGDBM5JU.mjs +562 -0
- package/{src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx → dist/TableCellActionMenuPlugin-PGK2K3VG.mjs} +667 -759
- package/{src/components/editor/plugins/TableHoverActionsPlugin/index.tsx → dist/TableHoverActionsPlugin-GJVE6VRW.mjs} +258 -314
- package/dist/TemplatePlugin-ZD3QEVTI.mjs +9 -0
- package/dist/ToolbarPlugin-7TOZRD2R.mjs +1547 -0
- package/dist/babel-JZ2EV6AX.mjs +7233 -0
- package/dist/background-color-XZTYLGO2.mjs +362 -0
- package/dist/block-format-YJCV2DIY.mjs +15 -0
- package/dist/chunk-2FNEAMSP.mjs +127 -0
- package/dist/chunk-3CPBODXA.mjs +84 -0
- package/dist/chunk-3G37YKTV.mjs +83 -0
- package/dist/chunk-3JVFG7ER.mjs +184 -0
- package/dist/chunk-456TN7IM.mjs +110 -0
- package/dist/chunk-4EXYCTGJ.mjs +27 -0
- package/{src/utils/getSelectedNode.ts → dist/chunk-4HBCVSE6.mjs} +26 -27
- package/dist/chunk-4MEDW3T6.mjs +125 -0
- package/dist/chunk-4VWFVWYP.mjs +36 -0
- package/dist/chunk-5BAKY5KN.mjs +84 -0
- package/dist/chunk-5QSNIVIG.mjs +333 -0
- package/dist/chunk-64Z3FI7T.mjs +37 -0
- package/{src/components/editor/nodes/Stepper/index.tsx → dist/chunk-6RNZQOH2.mjs} +214 -260
- package/dist/chunk-77KXU36M.mjs +64 -0
- package/dist/chunk-77UA6HYR.mjs +165 -0
- package/dist/chunk-7NZAPJ4G.mjs +102 -0
- package/dist/chunk-7VUMHWWL.mjs +152 -0
- package/dist/chunk-AMMKBSST.mjs +1256 -0
- package/dist/chunk-BIU7WTLX.mjs +95 -0
- package/dist/chunk-EGMI62PP.mjs +83 -0
- package/dist/chunk-EHNQD5KO.mjs +88 -0
- package/dist/chunk-FSM26655.mjs +37 -0
- package/{src/components/editor/nodes/Hint/index.tsx → dist/chunk-G53GLEAY.mjs} +158 -190
- package/dist/chunk-GK35L7UY.mjs +28 -0
- package/dist/chunk-GXYD4VZM.mjs +193 -0
- package/dist/chunk-GYIOYVCN.mjs +538 -0
- package/dist/chunk-GZPNVR7L.mjs +157 -0
- package/dist/chunk-JXDPPUJI.mjs +52 -0
- package/dist/chunk-K36V4SIW.mjs +141 -0
- package/dist/chunk-KJ6AJ44Q.mjs +128 -0
- package/dist/chunk-KJV3FAZ7.mjs +142 -0
- package/{src/components/editor/plugins/ImagesPlugin/index.tsx → dist/chunk-LGG4IUIA.mjs} +189 -222
- package/dist/chunk-LQN3CMKV.mjs +1906 -0
- package/dist/chunk-N3WN46VL.mjs +236 -0
- package/dist/chunk-PBD6LMLC.mjs +366 -0
- package/dist/chunk-POGRR73N.mjs +33 -0
- package/{src/components/editor/utils/editorFormatting.ts → dist/chunk-PZSUSXQG.mjs} +238 -282
- package/dist/chunk-QEIFVK5M.mjs +29 -0
- package/dist/chunk-QHIQKMVN.mjs +427 -0
- package/dist/chunk-TCYK7DM7.mjs +36 -0
- package/dist/chunk-TTHQCW5F.mjs +47 -0
- package/dist/chunk-U47ABU5Z.mjs +53 -0
- package/dist/chunk-WDG7J2DY.mjs +116 -0
- package/dist/chunk-WJRHXI2C.mjs +733 -0
- package/dist/chunk-XLER2DHM.mjs +357 -0
- package/dist/chunk-XWC4TK2N.mjs +315 -0
- package/dist/chunk-YHPNOWFH.mjs +15 -0
- package/dist/chunk-YKC3SO4Z.mjs +32 -0
- package/dist/chunk-YMBXLRW5.mjs +374 -0
- package/dist/chunk-YPHOEJ46.mjs +64 -0
- package/dist/chunk-YUDCJRJM.mjs +25 -0
- package/dist/chunk-Z4EWP7BI.mjs +65 -0
- package/dist/chunk-ZB5LZQKC.mjs +191 -0
- package/dist/chunk-ZJRKATOJ.mjs +65 -0
- package/dist/color-BPKOPQKN.mjs +12 -0
- package/dist/estree-XC56IUFX.mjs +4414 -0
- package/dist/font-FEZ3GKSF.mjs +13 -0
- package/dist/font-size-EK775WRH.mjs +15 -0
- package/dist/html-S3ACX7NI.mjs +2738 -0
- package/dist/image-2PJIAYAT.mjs +993 -0
- package/dist/index.d.mts +145 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.js +57855 -0
- package/dist/index.mjs +1790 -0
- package/dist/insert-gif-SAIDYURE.mjs +100 -0
- package/dist/insert-image-U3RJN3OW.mjs +259 -0
- package/dist/insert-node-5P2CRJ7S.mjs +201 -0
- package/dist/insert-poll-HCPM7MO6.mjs +33 -0
- package/dist/insert-table-24XYUS2W.mjs +66 -0
- package/dist/markdown-SNVBOSRA.mjs +3487 -0
- package/dist/poll-component-2R4MDLHS.mjs +303 -0
- package/dist/postcss-ONF3VDIM.mjs +5051 -0
- package/dist/standalone-EOIALU3M.mjs +2373 -0
- package/dist/stepper-FSARL6X6.mjs +304 -0
- package/dist/styles/notiq.css +1149 -0
- package/dist/text-align-VLECWO4H.mjs +118 -0
- package/dist/text-format-BG5WOOPZ.mjs +16 -0
- package/dist/typescript-AMPI6OVS.mjs +13135 -0
- package/package.json +66 -11
- package/src/styles/notiq.css +1149 -0
- package/src/styles/tailwind-plugin.ts +134 -0
- package/components.json +0 -21
- package/eslint.config.mjs +0 -16
- package/next.config.ts +0 -12
- package/postcss.config.mjs +0 -5
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/images/icons/plus.svg +0 -10
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/src/app/actions.ts +0 -2
- package/src/app/api/ai/route.ts +0 -175
- package/src/app/api/edgestore/[...edgestore]/route.ts +0 -28
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -205
- package/src/app/layout.tsx +0 -38
- package/src/app/page.tsx +0 -12
- package/src/components/editor/Core.tsx +0 -220
- package/src/components/editor/hooks/instructions-messages.ts +0 -300
- package/src/components/editor/hooks/use-mobile.ts +0 -19
- package/src/components/editor/hooks/useReport.ts +0 -67
- package/src/components/editor/hooks/useResizeObservert.ts +0 -22
- package/src/components/editor/index.tsx +0 -39
- package/src/components/editor/lexical-on-change.tsx +0 -28
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +0 -92
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +0 -65
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +0 -105
- package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +0 -143
- package/src/components/editor/nodes/EquationNode/EquationNode.tsx +0 -170
- package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +0 -228
- package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +0 -137
- package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +0 -317
- package/src/components/editor/nodes/ExcalidrawNode/index.tsx +0 -204
- package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +0 -134
- package/src/components/editor/nodes/Hint/HintComponet.tsx +0 -221
- package/src/components/editor/nodes/ImageNode/index.tsx +0 -328
- package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +0 -383
- package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +0 -94
- package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +0 -309
- package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +0 -146
- package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +0 -79
- package/src/components/editor/nodes/PollNode/index.tsx +0 -204
- package/src/components/editor/nodes/TweetNode/index.tsx +0 -214
- package/src/components/editor/nodes/index.ts +0 -81
- package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +0 -350
- package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +0 -56
- package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +0 -70
- package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +0 -192
- package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +0 -217
- package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +0 -26
- package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +0 -21
- package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +0 -76
- package/src/components/editor/plugins/CollapsiblePlugin/index.ts +0 -228
- package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +0 -44
- package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +0 -52
- package/src/components/editor/plugins/EquationsPlugin/index.tsx +0 -85
- package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +0 -98
- package/src/components/editor/plugins/FigmaPlugin/index.tsx +0 -42
- package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +0 -445
- package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +0 -275
- package/src/components/editor/plugins/InlineImagePlugin/index.tsx +0 -351
- package/src/components/editor/plugins/LayoutPlugin/index.tsx +0 -238
- package/src/components/editor/plugins/LinkPlugin/index.tsx +0 -36
- package/src/components/editor/plugins/LinkWithMetaData/index.tsx +0 -271
- package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -11
- package/src/components/editor/plugins/MarkdownTransformers/index.tsx +0 -304
- package/src/components/editor/plugins/PollPlugin/index.tsx +0 -49
- package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +0 -180
- package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +0 -253
- package/src/components/editor/plugins/SlashCommand/index.tsx +0 -621
- package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +0 -127
- package/src/components/editor/plugins/TabFocusPlugin/index.ts +0 -58
- package/src/components/editor/plugins/TableCellResizer/index.tsx +0 -438
- package/src/components/editor/plugins/TablePlugin/index.tsx +0 -99
- package/src/components/editor/plugins/ToolbarPlugin/index.tsx +0 -522
- package/src/components/editor/plugins/TwitterPlugin/index.ts +0 -35
- package/src/components/editor/plugins/YouTubeNode/index.tsx +0 -179
- package/src/components/editor/plugins/YouTubePlugin/index.ts +0 -41
- package/src/components/editor/themes/editor-theme.ts +0 -113
- package/src/components/editor/themes/theme.css +0 -377
- package/src/components/editor/utils/ai.ts +0 -291
- package/src/components/editor/utils/canUseDOM.ts +0 -12
- package/src/components/editor/utils/environment.ts +0 -50
- package/src/components/editor/utils/extract-data.ts +0 -166
- package/src/components/editor/utils/getAllLexicalChildren.ts +0 -13
- package/src/components/editor/utils/getDOMRangeRect.ts +0 -27
- package/src/components/editor/utils/getSelectedNode.ts +0 -27
- package/src/components/editor/utils/gif.ts +0 -29
- package/src/components/editor/utils/invariant.ts +0 -15
- package/src/components/editor/utils/setFloatingElemPosition.ts +0 -51
- package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +0 -40
- package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +0 -51
- package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +0 -15
- package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +0 -114
- package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +0 -6
- package/src/components/editor/utils/url.ts +0 -109
- package/src/components/editor/utils/useLayoutEffect.ts +0 -13
- package/src/components/providers/QueryProvider.tsx +0 -15
- package/src/components/providers/SharedHistoryContext.tsx +0 -28
- package/src/components/providers/ToolbarContext.tsx +0 -123
- package/src/components/providers/theme-provider.tsx +0 -11
- package/src/components/theme/ModeToggle.tsx +0 -40
- package/src/components/ui/FileInput.tsx +0 -40
- package/src/components/ui/Input.css +0 -32
- package/src/components/ui/Select.css +0 -42
- package/src/components/ui/Select.tsx +0 -36
- package/src/components/ui/TextInput.tsx +0 -48
- package/src/components/ui/ai/ai-button.tsx +0 -574
- package/src/components/ui/ai/border.tsx +0 -99
- package/src/components/ui/ai/placeholder-input-vanish.tsx +0 -282
- package/src/components/ui/button.tsx +0 -89
- package/src/components/ui/card.tsx +0 -76
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/dialog/Dialog.css +0 -25
- package/src/components/ui/dialog/Dialog.tsx +0 -34
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/drop-downs/background-color.tsx +0 -183
- package/src/components/ui/drop-downs/block-format.tsx +0 -159
- package/src/components/ui/drop-downs/code.tsx +0 -42
- package/src/components/ui/drop-downs/color.tsx +0 -177
- package/src/components/ui/drop-downs/font-size.tsx +0 -138
- package/src/components/ui/drop-downs/font.tsx +0 -155
- package/src/components/ui/drop-downs/index.tsx +0 -122
- package/src/components/ui/drop-downs/insert-node.tsx +0 -213
- package/src/components/ui/drop-downs/text-align.tsx +0 -123
- package/src/components/ui/drop-downs/text-format.tsx +0 -104
- package/src/components/ui/dropdown-menu.tsx +0 -201
- package/src/components/ui/equation/EquationEditor.css +0 -38
- package/src/components/ui/equation/EquationEditor.tsx +0 -56
- package/src/components/ui/equation/KatexEquationAlterer.css +0 -41
- package/src/components/ui/equation/KatexEquationAlterer.tsx +0 -83
- package/src/components/ui/equation/KatexRenderer.tsx +0 -66
- package/src/components/ui/excalidraw/ExcalidrawModal.css +0 -64
- package/src/components/ui/excalidraw/ExcalidrawModal.tsx +0 -234
- package/src/components/ui/excalidraw/Modal.css +0 -62
- package/src/components/ui/excalidraw/Modal.tsx +0 -110
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/image/error-image.tsx +0 -17
- package/src/components/ui/image/file-upload.tsx +0 -240
- package/src/components/ui/image/image-resizer.tsx +0 -297
- package/src/components/ui/image/image-toolbar.tsx +0 -264
- package/src/components/ui/image/index.tsx +0 -408
- package/src/components/ui/image/lazy-image.tsx +0 -68
- package/src/components/ui/image/lazy-video.tsx +0 -71
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/models/custom-dialog.tsx +0 -320
- package/src/components/ui/models/insert-gif.tsx +0 -90
- package/src/components/ui/models/insert-image.tsx +0 -52
- package/src/components/ui/models/insert-poll.tsx +0 -29
- package/src/components/ui/models/insert-table.tsx +0 -62
- package/src/components/ui/models/use-model.tsx +0 -91
- package/src/components/ui/poll/poll-component.tsx +0 -304
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/progress.tsx +0 -28
- package/src/components/ui/scroll-area.tsx +0 -48
- package/src/components/ui/separator.tsx +0 -31
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -31
- package/src/components/ui/stepper/step.tsx +0 -179
- package/src/components/ui/stepper/stepper.tsx +0 -89
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle.tsx +0 -71
- package/src/components/ui/tooltip.tsx +0 -32
- package/src/components/ui/write/text-format-floting-toolbar.tsx +0 -346
- package/src/lib/edgestore.ts +0 -9
- package/src/lib/pinecone-client.ts +0 -0
- package/src/lib/utils.ts +0 -6
- package/src/utils/docSerialization.ts +0 -77
- package/src/utils/emoji-list.ts +0 -16615
- package/src/utils/getDOMRangeRect.ts +0 -27
- package/src/utils/getThemeSelector.ts +0 -25
- package/src/utils/isMobileWidth.ts +0 -7
- package/src/utils/joinClasses.ts +0 -13
- package/src/utils/setFloatingElemPosition.ts +0 -74
- package/src/utils/setFloatingElemPositionForLinkEditor.ts +0 -46
- package/src/utils/swipe.ts +0 -127
- package/src/utils/url.ts +0 -38
- package/tsconfig.json +0 -27
|
@@ -1,260 +1,214 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "lexical";
|
|
18
|
-
import React, { Suspense, useEffect } from "react";
|
|
19
|
-
|
|
20
|
-
() => import("
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return self;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
self.__steps
|
|
127
|
-
return self;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export function $isStepperNode(
|
|
219
|
-
node: LexicalNode | null | undefined
|
|
220
|
-
): node is StepperNode {
|
|
221
|
-
return node instanceof StepperNode;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export function $createStepperNode(steps: StepsType): StepperNode {
|
|
225
|
-
return new StepperNode(steps);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export const INSERT_STEPPER_COMMAND: LexicalCommand<StepsType> =
|
|
229
|
-
createCommand();
|
|
230
|
-
|
|
231
|
-
export function $insertStepperNode(steps: StepsType) {
|
|
232
|
-
const selection = $getSelection();
|
|
233
|
-
if ($isRangeSelection(selection)) {
|
|
234
|
-
const stepperNode = $createStepperNode(steps);
|
|
235
|
-
selection.insertNodes([stepperNode]);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export default function StepperPlugin() {
|
|
240
|
-
const [editor] = useLexicalComposerContext();
|
|
241
|
-
useEffect(() => {
|
|
242
|
-
if (!editor.hasNodes([StepperNode])) {
|
|
243
|
-
throw new Error("StepperNode: StepperNode not registered on editor");
|
|
244
|
-
}
|
|
245
|
-
}, [editor]);
|
|
246
|
-
useEffect(() => {
|
|
247
|
-
return editor.registerCommand(
|
|
248
|
-
INSERT_STEPPER_COMMAND,
|
|
249
|
-
(payload: StepsType) => {
|
|
250
|
-
editor.update(() => {
|
|
251
|
-
$insertStepperNode(payload);
|
|
252
|
-
});
|
|
253
|
-
return true;
|
|
254
|
-
},
|
|
255
|
-
COMMAND_PRIORITY_LOW
|
|
256
|
-
);
|
|
257
|
-
}, [editor]);
|
|
258
|
-
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues,
|
|
4
|
+
init_react_shim
|
|
5
|
+
} from "./chunk-77KXU36M.mjs";
|
|
6
|
+
|
|
7
|
+
// src/components/editor/nodes/Stepper/index.tsx
|
|
8
|
+
init_react_shim();
|
|
9
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
10
|
+
import {
|
|
11
|
+
DecoratorNode,
|
|
12
|
+
createEditor,
|
|
13
|
+
createCommand,
|
|
14
|
+
$getSelection,
|
|
15
|
+
$isRangeSelection,
|
|
16
|
+
COMMAND_PRIORITY_LOW
|
|
17
|
+
} from "lexical";
|
|
18
|
+
import React, { Suspense, useEffect } from "react";
|
|
19
|
+
var StepperComponent = React.lazy(
|
|
20
|
+
() => import("./stepper-FSARL6X6.mjs")
|
|
21
|
+
);
|
|
22
|
+
var initialEditorState = {
|
|
23
|
+
root: {
|
|
24
|
+
children: [
|
|
25
|
+
{
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
detail: 0,
|
|
29
|
+
format: 0,
|
|
30
|
+
mode: "normal",
|
|
31
|
+
style: "",
|
|
32
|
+
text: "type the content here..",
|
|
33
|
+
type: "text",
|
|
34
|
+
version: 1
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
direction: null,
|
|
38
|
+
format: "",
|
|
39
|
+
indent: 0,
|
|
40
|
+
type: "paragraph",
|
|
41
|
+
version: 1,
|
|
42
|
+
textFormat: 0,
|
|
43
|
+
textStyle: ""
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
direction: null,
|
|
47
|
+
format: "",
|
|
48
|
+
indent: 0,
|
|
49
|
+
type: "root",
|
|
50
|
+
version: 1
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var StepperNode = class _StepperNode extends DecoratorNode {
|
|
54
|
+
constructor(steps, key) {
|
|
55
|
+
super(key);
|
|
56
|
+
this.__steps = steps.map((step) => {
|
|
57
|
+
if (!step.content) {
|
|
58
|
+
const newEditor = createEditor();
|
|
59
|
+
const parsedEditorState = newEditor.parseEditorState(
|
|
60
|
+
JSON.stringify(initialEditorState)
|
|
61
|
+
);
|
|
62
|
+
newEditor.setEditorState(parsedEditorState);
|
|
63
|
+
return __spreadProps(__spreadValues({}, step), { content: newEditor });
|
|
64
|
+
}
|
|
65
|
+
return step;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static getType() {
|
|
69
|
+
return "stepper";
|
|
70
|
+
}
|
|
71
|
+
addStep(step) {
|
|
72
|
+
const self = this.getWritable();
|
|
73
|
+
const newEditor = createEditor();
|
|
74
|
+
const parsedEditorState = newEditor.parseEditorState(
|
|
75
|
+
JSON.stringify(initialEditorState)
|
|
76
|
+
);
|
|
77
|
+
newEditor.setEditorState(parsedEditorState);
|
|
78
|
+
const newStep = __spreadProps(__spreadValues({}, step), {
|
|
79
|
+
content: newEditor
|
|
80
|
+
});
|
|
81
|
+
self.__steps.push(newStep);
|
|
82
|
+
return self;
|
|
83
|
+
}
|
|
84
|
+
insertStepAtIndex(step, index) {
|
|
85
|
+
if (index < 0 || index > this.__steps.length) {
|
|
86
|
+
throw new Error("Invalid index for inserting step.");
|
|
87
|
+
}
|
|
88
|
+
const self = this.getWritable();
|
|
89
|
+
const newEditor = createEditor();
|
|
90
|
+
const parsedEditorState = newEditor.parseEditorState(
|
|
91
|
+
JSON.stringify(initialEditorState)
|
|
92
|
+
);
|
|
93
|
+
newEditor.setEditorState(parsedEditorState);
|
|
94
|
+
const newStep = __spreadProps(__spreadValues({}, step), {
|
|
95
|
+
content: newEditor
|
|
96
|
+
});
|
|
97
|
+
self.__steps.splice(index, 0, newStep);
|
|
98
|
+
return self;
|
|
99
|
+
}
|
|
100
|
+
deleteStep(id) {
|
|
101
|
+
const self = this.getWritable();
|
|
102
|
+
self.__steps = self.__steps.filter((step) => step.id !== id);
|
|
103
|
+
return self;
|
|
104
|
+
}
|
|
105
|
+
updateTitle(id, title) {
|
|
106
|
+
const self = this.getWritable();
|
|
107
|
+
const step = self.__steps.find((s) => s.id === id);
|
|
108
|
+
if (step) step.title = title;
|
|
109
|
+
return self;
|
|
110
|
+
}
|
|
111
|
+
replaceSteps(steps) {
|
|
112
|
+
const self = this.getWritable();
|
|
113
|
+
self.__steps = steps.map((step) => {
|
|
114
|
+
if (step.content) return step;
|
|
115
|
+
const newEditor = createEditor();
|
|
116
|
+
const parsedEditorState = newEditor.parseEditorState(
|
|
117
|
+
JSON.stringify(initialEditorState)
|
|
118
|
+
);
|
|
119
|
+
newEditor.setEditorState(parsedEditorState);
|
|
120
|
+
return __spreadProps(__spreadValues({}, step), { content: newEditor });
|
|
121
|
+
});
|
|
122
|
+
return self;
|
|
123
|
+
}
|
|
124
|
+
reorderSteps(newSteps) {
|
|
125
|
+
const self = this.getWritable();
|
|
126
|
+
self.__steps = newSteps;
|
|
127
|
+
return self;
|
|
128
|
+
}
|
|
129
|
+
static clone(node) {
|
|
130
|
+
return new _StepperNode(node.__steps, node.__key);
|
|
131
|
+
}
|
|
132
|
+
static importJSON(serializedNode) {
|
|
133
|
+
const steps = serializedNode.steps.map((serializedStep) => {
|
|
134
|
+
const newEditor = createEditor();
|
|
135
|
+
const editorState = newEditor.parseEditorState(
|
|
136
|
+
serializedStep.content.editorState
|
|
137
|
+
);
|
|
138
|
+
newEditor.setEditorState(editorState);
|
|
139
|
+
return {
|
|
140
|
+
title: serializedStep.title,
|
|
141
|
+
id: parseInt(serializedStep.id, 10),
|
|
142
|
+
content: newEditor
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
return new _StepperNode(steps);
|
|
146
|
+
}
|
|
147
|
+
exportJSON() {
|
|
148
|
+
return __spreadProps(__spreadValues({}, super.exportJSON()), {
|
|
149
|
+
steps: this.__steps.map((step) => ({
|
|
150
|
+
title: step.title,
|
|
151
|
+
id: step.id.toString(),
|
|
152
|
+
content: {
|
|
153
|
+
editorState: step.content.getEditorState().toJSON()
|
|
154
|
+
}
|
|
155
|
+
})),
|
|
156
|
+
type: "stepper"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
createDOM() {
|
|
160
|
+
const element = document.createElement("div");
|
|
161
|
+
element.className = `stepper-${this.__type}`;
|
|
162
|
+
return element;
|
|
163
|
+
}
|
|
164
|
+
updateDOM() {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
decorate() {
|
|
168
|
+
return /* @__PURE__ */ React.createElement(Suspense, { fallback: null }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(StepperComponent, { steps: this.__steps, nodeKey: this.getKey() })));
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
function $isStepperNode(node) {
|
|
172
|
+
return node instanceof StepperNode;
|
|
173
|
+
}
|
|
174
|
+
function $createStepperNode(steps) {
|
|
175
|
+
return new StepperNode(steps);
|
|
176
|
+
}
|
|
177
|
+
var INSERT_STEPPER_COMMAND = createCommand();
|
|
178
|
+
function $insertStepperNode(steps) {
|
|
179
|
+
const selection = $getSelection();
|
|
180
|
+
if ($isRangeSelection(selection)) {
|
|
181
|
+
const stepperNode = $createStepperNode(steps);
|
|
182
|
+
selection.insertNodes([stepperNode]);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function StepperPlugin() {
|
|
186
|
+
const [editor] = useLexicalComposerContext();
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
if (!editor.hasNodes([StepperNode])) {
|
|
189
|
+
throw new Error("StepperNode: StepperNode not registered on editor");
|
|
190
|
+
}
|
|
191
|
+
}, [editor]);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
return editor.registerCommand(
|
|
194
|
+
INSERT_STEPPER_COMMAND,
|
|
195
|
+
(payload) => {
|
|
196
|
+
editor.update(() => {
|
|
197
|
+
$insertStepperNode(payload);
|
|
198
|
+
});
|
|
199
|
+
return true;
|
|
200
|
+
},
|
|
201
|
+
COMMAND_PRIORITY_LOW
|
|
202
|
+
);
|
|
203
|
+
}, [editor]);
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export {
|
|
208
|
+
initialEditorState,
|
|
209
|
+
StepperNode,
|
|
210
|
+
$isStepperNode,
|
|
211
|
+
$createStepperNode,
|
|
212
|
+
INSERT_STEPPER_COMMAND,
|
|
213
|
+
StepperPlugin
|
|
214
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
var __esm = (fn, res) => function __init() {
|
|
34
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
35
|
+
};
|
|
36
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
37
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
38
|
+
};
|
|
39
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
40
|
+
|
|
41
|
+
// react-shim.js
|
|
42
|
+
import * as React from "react";
|
|
43
|
+
var init_react_shim = __esm({
|
|
44
|
+
"react-shim.js"() {
|
|
45
|
+
"use strict";
|
|
46
|
+
if (typeof globalThis !== "undefined") {
|
|
47
|
+
globalThis.React = React;
|
|
48
|
+
} else if (typeof window !== "undefined") {
|
|
49
|
+
window.React = React;
|
|
50
|
+
} else if (typeof global !== "undefined") {
|
|
51
|
+
global.React = React;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
__spreadValues,
|
|
58
|
+
__spreadProps,
|
|
59
|
+
__objRest,
|
|
60
|
+
__commonJS,
|
|
61
|
+
__publicField,
|
|
62
|
+
React,
|
|
63
|
+
init_react_shim
|
|
64
|
+
};
|