@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.
Files changed (282) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -39
  3. package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +15 -0
  4. package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +161 -0
  5. package/dist/EquationComponent-CB6DFIHV.mjs +154 -0
  6. package/dist/ExcalidrawComponent-XW6646OH.mjs +528 -0
  7. package/dist/ExcalidrawPlugin-ZFHT62IF.mjs +14 -0
  8. package/dist/ExportPlugin-V2RLM63S.mjs +11 -0
  9. package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +12 -0
  10. package/dist/FloatingTextFormatToolbarPlugin-F2GY6LMI.mjs +30 -0
  11. package/dist/HintComponet-BRL6EAMS.mjs +217 -0
  12. package/dist/InlineImageComponent-UWIUWBHI.mjs +453 -0
  13. package/dist/MobileToolbar-BOOZAMQE.mjs +268 -0
  14. package/dist/SlashCommand-GMT5JI33.mjs +28 -0
  15. package/dist/StoryBuilderComponent-JGDBM5JU.mjs +562 -0
  16. package/{src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx → dist/TableCellActionMenuPlugin-PGK2K3VG.mjs} +667 -759
  17. package/{src/components/editor/plugins/TableHoverActionsPlugin/index.tsx → dist/TableHoverActionsPlugin-GJVE6VRW.mjs} +258 -314
  18. package/dist/TemplatePlugin-ZD3QEVTI.mjs +9 -0
  19. package/dist/ToolbarPlugin-7TOZRD2R.mjs +1547 -0
  20. package/dist/babel-JZ2EV6AX.mjs +7233 -0
  21. package/dist/background-color-XZTYLGO2.mjs +362 -0
  22. package/dist/block-format-YJCV2DIY.mjs +15 -0
  23. package/dist/chunk-2FNEAMSP.mjs +127 -0
  24. package/dist/chunk-3CPBODXA.mjs +84 -0
  25. package/dist/chunk-3G37YKTV.mjs +83 -0
  26. package/dist/chunk-3JVFG7ER.mjs +184 -0
  27. package/dist/chunk-456TN7IM.mjs +110 -0
  28. package/dist/chunk-4EXYCTGJ.mjs +27 -0
  29. package/{src/utils/getSelectedNode.ts → dist/chunk-4HBCVSE6.mjs} +26 -27
  30. package/dist/chunk-4MEDW3T6.mjs +125 -0
  31. package/dist/chunk-4VWFVWYP.mjs +36 -0
  32. package/dist/chunk-5BAKY5KN.mjs +84 -0
  33. package/dist/chunk-5QSNIVIG.mjs +333 -0
  34. package/dist/chunk-64Z3FI7T.mjs +37 -0
  35. package/{src/components/editor/nodes/Stepper/index.tsx → dist/chunk-6RNZQOH2.mjs} +214 -260
  36. package/dist/chunk-77KXU36M.mjs +64 -0
  37. package/dist/chunk-77UA6HYR.mjs +165 -0
  38. package/dist/chunk-7NZAPJ4G.mjs +102 -0
  39. package/dist/chunk-7VUMHWWL.mjs +152 -0
  40. package/dist/chunk-AMMKBSST.mjs +1256 -0
  41. package/dist/chunk-BIU7WTLX.mjs +95 -0
  42. package/dist/chunk-EGMI62PP.mjs +83 -0
  43. package/dist/chunk-EHNQD5KO.mjs +88 -0
  44. package/dist/chunk-FSM26655.mjs +37 -0
  45. package/{src/components/editor/nodes/Hint/index.tsx → dist/chunk-G53GLEAY.mjs} +158 -190
  46. package/dist/chunk-GK35L7UY.mjs +28 -0
  47. package/dist/chunk-GXYD4VZM.mjs +193 -0
  48. package/dist/chunk-GYIOYVCN.mjs +538 -0
  49. package/dist/chunk-GZPNVR7L.mjs +157 -0
  50. package/dist/chunk-JXDPPUJI.mjs +52 -0
  51. package/dist/chunk-K36V4SIW.mjs +141 -0
  52. package/dist/chunk-KJ6AJ44Q.mjs +128 -0
  53. package/dist/chunk-KJV3FAZ7.mjs +142 -0
  54. package/{src/components/editor/plugins/ImagesPlugin/index.tsx → dist/chunk-LGG4IUIA.mjs} +189 -222
  55. package/dist/chunk-LQN3CMKV.mjs +1906 -0
  56. package/dist/chunk-N3WN46VL.mjs +236 -0
  57. package/dist/chunk-PBD6LMLC.mjs +366 -0
  58. package/dist/chunk-POGRR73N.mjs +33 -0
  59. package/{src/components/editor/utils/editorFormatting.ts → dist/chunk-PZSUSXQG.mjs} +238 -282
  60. package/dist/chunk-QEIFVK5M.mjs +29 -0
  61. package/dist/chunk-QHIQKMVN.mjs +427 -0
  62. package/dist/chunk-TCYK7DM7.mjs +36 -0
  63. package/dist/chunk-TTHQCW5F.mjs +47 -0
  64. package/dist/chunk-U47ABU5Z.mjs +53 -0
  65. package/dist/chunk-WDG7J2DY.mjs +116 -0
  66. package/dist/chunk-WJRHXI2C.mjs +733 -0
  67. package/dist/chunk-XLER2DHM.mjs +357 -0
  68. package/dist/chunk-XWC4TK2N.mjs +315 -0
  69. package/dist/chunk-YHPNOWFH.mjs +15 -0
  70. package/dist/chunk-YKC3SO4Z.mjs +32 -0
  71. package/dist/chunk-YMBXLRW5.mjs +374 -0
  72. package/dist/chunk-YPHOEJ46.mjs +64 -0
  73. package/dist/chunk-YUDCJRJM.mjs +25 -0
  74. package/dist/chunk-Z4EWP7BI.mjs +65 -0
  75. package/dist/chunk-ZB5LZQKC.mjs +191 -0
  76. package/dist/chunk-ZJRKATOJ.mjs +65 -0
  77. package/dist/color-BPKOPQKN.mjs +12 -0
  78. package/dist/estree-XC56IUFX.mjs +4414 -0
  79. package/dist/font-FEZ3GKSF.mjs +13 -0
  80. package/dist/font-size-EK775WRH.mjs +15 -0
  81. package/dist/html-S3ACX7NI.mjs +2738 -0
  82. package/dist/image-2PJIAYAT.mjs +993 -0
  83. package/dist/index.d.mts +145 -0
  84. package/dist/index.d.ts +145 -0
  85. package/dist/index.js +57855 -0
  86. package/dist/index.mjs +1790 -0
  87. package/dist/insert-gif-SAIDYURE.mjs +100 -0
  88. package/dist/insert-image-U3RJN3OW.mjs +259 -0
  89. package/dist/insert-node-5P2CRJ7S.mjs +201 -0
  90. package/dist/insert-poll-HCPM7MO6.mjs +33 -0
  91. package/dist/insert-table-24XYUS2W.mjs +66 -0
  92. package/dist/markdown-SNVBOSRA.mjs +3487 -0
  93. package/dist/poll-component-2R4MDLHS.mjs +303 -0
  94. package/dist/postcss-ONF3VDIM.mjs +5051 -0
  95. package/dist/standalone-EOIALU3M.mjs +2373 -0
  96. package/dist/stepper-FSARL6X6.mjs +304 -0
  97. package/dist/styles/notiq.css +1149 -0
  98. package/dist/text-align-VLECWO4H.mjs +118 -0
  99. package/dist/text-format-BG5WOOPZ.mjs +16 -0
  100. package/dist/typescript-AMPI6OVS.mjs +13135 -0
  101. package/package.json +66 -11
  102. package/src/styles/notiq.css +1149 -0
  103. package/src/styles/tailwind-plugin.ts +134 -0
  104. package/components.json +0 -21
  105. package/eslint.config.mjs +0 -16
  106. package/next.config.ts +0 -12
  107. package/postcss.config.mjs +0 -5
  108. package/public/file.svg +0 -1
  109. package/public/globe.svg +0 -1
  110. package/public/images/icons/plus.svg +0 -10
  111. package/public/next.svg +0 -1
  112. package/public/vercel.svg +0 -1
  113. package/public/window.svg +0 -1
  114. package/src/app/actions.ts +0 -2
  115. package/src/app/api/ai/route.ts +0 -175
  116. package/src/app/api/edgestore/[...edgestore]/route.ts +0 -28
  117. package/src/app/favicon.ico +0 -0
  118. package/src/app/globals.css +0 -205
  119. package/src/app/layout.tsx +0 -38
  120. package/src/app/page.tsx +0 -12
  121. package/src/components/editor/Core.tsx +0 -220
  122. package/src/components/editor/hooks/instructions-messages.ts +0 -300
  123. package/src/components/editor/hooks/use-mobile.ts +0 -19
  124. package/src/components/editor/hooks/useReport.ts +0 -67
  125. package/src/components/editor/hooks/useResizeObservert.ts +0 -22
  126. package/src/components/editor/index.tsx +0 -39
  127. package/src/components/editor/lexical-on-change.tsx +0 -28
  128. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +0 -92
  129. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +0 -65
  130. package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +0 -105
  131. package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +0 -143
  132. package/src/components/editor/nodes/EquationNode/EquationNode.tsx +0 -170
  133. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +0 -228
  134. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +0 -137
  135. package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +0 -317
  136. package/src/components/editor/nodes/ExcalidrawNode/index.tsx +0 -204
  137. package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +0 -134
  138. package/src/components/editor/nodes/Hint/HintComponet.tsx +0 -221
  139. package/src/components/editor/nodes/ImageNode/index.tsx +0 -328
  140. package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +0 -383
  141. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +0 -94
  142. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +0 -309
  143. package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +0 -146
  144. package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +0 -79
  145. package/src/components/editor/nodes/PollNode/index.tsx +0 -204
  146. package/src/components/editor/nodes/TweetNode/index.tsx +0 -214
  147. package/src/components/editor/nodes/index.ts +0 -81
  148. package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +0 -350
  149. package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +0 -56
  150. package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +0 -70
  151. package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +0 -192
  152. package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +0 -217
  153. package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +0 -26
  154. package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +0 -21
  155. package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +0 -76
  156. package/src/components/editor/plugins/CollapsiblePlugin/index.ts +0 -228
  157. package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +0 -44
  158. package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +0 -52
  159. package/src/components/editor/plugins/EquationsPlugin/index.tsx +0 -85
  160. package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +0 -98
  161. package/src/components/editor/plugins/FigmaPlugin/index.tsx +0 -42
  162. package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +0 -445
  163. package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +0 -275
  164. package/src/components/editor/plugins/InlineImagePlugin/index.tsx +0 -351
  165. package/src/components/editor/plugins/LayoutPlugin/index.tsx +0 -238
  166. package/src/components/editor/plugins/LinkPlugin/index.tsx +0 -36
  167. package/src/components/editor/plugins/LinkWithMetaData/index.tsx +0 -271
  168. package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -11
  169. package/src/components/editor/plugins/MarkdownTransformers/index.tsx +0 -304
  170. package/src/components/editor/plugins/PollPlugin/index.tsx +0 -49
  171. package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +0 -180
  172. package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +0 -253
  173. package/src/components/editor/plugins/SlashCommand/index.tsx +0 -621
  174. package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +0 -127
  175. package/src/components/editor/plugins/TabFocusPlugin/index.ts +0 -58
  176. package/src/components/editor/plugins/TableCellResizer/index.tsx +0 -438
  177. package/src/components/editor/plugins/TablePlugin/index.tsx +0 -99
  178. package/src/components/editor/plugins/ToolbarPlugin/index.tsx +0 -522
  179. package/src/components/editor/plugins/TwitterPlugin/index.ts +0 -35
  180. package/src/components/editor/plugins/YouTubeNode/index.tsx +0 -179
  181. package/src/components/editor/plugins/YouTubePlugin/index.ts +0 -41
  182. package/src/components/editor/themes/editor-theme.ts +0 -113
  183. package/src/components/editor/themes/theme.css +0 -377
  184. package/src/components/editor/utils/ai.ts +0 -291
  185. package/src/components/editor/utils/canUseDOM.ts +0 -12
  186. package/src/components/editor/utils/environment.ts +0 -50
  187. package/src/components/editor/utils/extract-data.ts +0 -166
  188. package/src/components/editor/utils/getAllLexicalChildren.ts +0 -13
  189. package/src/components/editor/utils/getDOMRangeRect.ts +0 -27
  190. package/src/components/editor/utils/getSelectedNode.ts +0 -27
  191. package/src/components/editor/utils/gif.ts +0 -29
  192. package/src/components/editor/utils/invariant.ts +0 -15
  193. package/src/components/editor/utils/setFloatingElemPosition.ts +0 -51
  194. package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +0 -40
  195. package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +0 -51
  196. package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +0 -15
  197. package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +0 -114
  198. package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +0 -6
  199. package/src/components/editor/utils/url.ts +0 -109
  200. package/src/components/editor/utils/useLayoutEffect.ts +0 -13
  201. package/src/components/providers/QueryProvider.tsx +0 -15
  202. package/src/components/providers/SharedHistoryContext.tsx +0 -28
  203. package/src/components/providers/ToolbarContext.tsx +0 -123
  204. package/src/components/providers/theme-provider.tsx +0 -11
  205. package/src/components/theme/ModeToggle.tsx +0 -40
  206. package/src/components/ui/FileInput.tsx +0 -40
  207. package/src/components/ui/Input.css +0 -32
  208. package/src/components/ui/Select.css +0 -42
  209. package/src/components/ui/Select.tsx +0 -36
  210. package/src/components/ui/TextInput.tsx +0 -48
  211. package/src/components/ui/ai/ai-button.tsx +0 -574
  212. package/src/components/ui/ai/border.tsx +0 -99
  213. package/src/components/ui/ai/placeholder-input-vanish.tsx +0 -282
  214. package/src/components/ui/button.tsx +0 -89
  215. package/src/components/ui/card.tsx +0 -76
  216. package/src/components/ui/checkbox.tsx +0 -30
  217. package/src/components/ui/command.tsx +0 -153
  218. package/src/components/ui/dialog/Dialog.css +0 -25
  219. package/src/components/ui/dialog/Dialog.tsx +0 -34
  220. package/src/components/ui/dialog.tsx +0 -122
  221. package/src/components/ui/drop-downs/background-color.tsx +0 -183
  222. package/src/components/ui/drop-downs/block-format.tsx +0 -159
  223. package/src/components/ui/drop-downs/code.tsx +0 -42
  224. package/src/components/ui/drop-downs/color.tsx +0 -177
  225. package/src/components/ui/drop-downs/font-size.tsx +0 -138
  226. package/src/components/ui/drop-downs/font.tsx +0 -155
  227. package/src/components/ui/drop-downs/index.tsx +0 -122
  228. package/src/components/ui/drop-downs/insert-node.tsx +0 -213
  229. package/src/components/ui/drop-downs/text-align.tsx +0 -123
  230. package/src/components/ui/drop-downs/text-format.tsx +0 -104
  231. package/src/components/ui/dropdown-menu.tsx +0 -201
  232. package/src/components/ui/equation/EquationEditor.css +0 -38
  233. package/src/components/ui/equation/EquationEditor.tsx +0 -56
  234. package/src/components/ui/equation/KatexEquationAlterer.css +0 -41
  235. package/src/components/ui/equation/KatexEquationAlterer.tsx +0 -83
  236. package/src/components/ui/equation/KatexRenderer.tsx +0 -66
  237. package/src/components/ui/excalidraw/ExcalidrawModal.css +0 -64
  238. package/src/components/ui/excalidraw/ExcalidrawModal.tsx +0 -234
  239. package/src/components/ui/excalidraw/Modal.css +0 -62
  240. package/src/components/ui/excalidraw/Modal.tsx +0 -110
  241. package/src/components/ui/hover-card.tsx +0 -29
  242. package/src/components/ui/image/error-image.tsx +0 -17
  243. package/src/components/ui/image/file-upload.tsx +0 -240
  244. package/src/components/ui/image/image-resizer.tsx +0 -297
  245. package/src/components/ui/image/image-toolbar.tsx +0 -264
  246. package/src/components/ui/image/index.tsx +0 -408
  247. package/src/components/ui/image/lazy-image.tsx +0 -68
  248. package/src/components/ui/image/lazy-video.tsx +0 -71
  249. package/src/components/ui/input.tsx +0 -22
  250. package/src/components/ui/models/custom-dialog.tsx +0 -320
  251. package/src/components/ui/models/insert-gif.tsx +0 -90
  252. package/src/components/ui/models/insert-image.tsx +0 -52
  253. package/src/components/ui/models/insert-poll.tsx +0 -29
  254. package/src/components/ui/models/insert-table.tsx +0 -62
  255. package/src/components/ui/models/use-model.tsx +0 -91
  256. package/src/components/ui/poll/poll-component.tsx +0 -304
  257. package/src/components/ui/popover.tsx +0 -33
  258. package/src/components/ui/progress.tsx +0 -28
  259. package/src/components/ui/scroll-area.tsx +0 -48
  260. package/src/components/ui/separator.tsx +0 -31
  261. package/src/components/ui/skeleton.tsx +0 -15
  262. package/src/components/ui/sonner.tsx +0 -31
  263. package/src/components/ui/stepper/step.tsx +0 -179
  264. package/src/components/ui/stepper/stepper.tsx +0 -89
  265. package/src/components/ui/textarea.tsx +0 -22
  266. package/src/components/ui/toggle.tsx +0 -71
  267. package/src/components/ui/tooltip.tsx +0 -32
  268. package/src/components/ui/write/text-format-floting-toolbar.tsx +0 -346
  269. package/src/lib/edgestore.ts +0 -9
  270. package/src/lib/pinecone-client.ts +0 -0
  271. package/src/lib/utils.ts +0 -6
  272. package/src/utils/docSerialization.ts +0 -77
  273. package/src/utils/emoji-list.ts +0 -16615
  274. package/src/utils/getDOMRangeRect.ts +0 -27
  275. package/src/utils/getThemeSelector.ts +0 -25
  276. package/src/utils/isMobileWidth.ts +0 -7
  277. package/src/utils/joinClasses.ts +0 -13
  278. package/src/utils/setFloatingElemPosition.ts +0 -74
  279. package/src/utils/setFloatingElemPositionForLinkEditor.ts +0 -46
  280. package/src/utils/swipe.ts +0 -127
  281. package/src/utils/url.ts +0 -38
  282. package/tsconfig.json +0 -27
@@ -0,0 +1,184 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues,
4
+ init_react_shim
5
+ } from "./chunk-77KXU36M.mjs";
6
+
7
+ // src/components/ui/equation/KatexRenderer.tsx
8
+ init_react_shim();
9
+ import katex from "katex";
10
+ import * as React from "react";
11
+ import { useEffect, useRef } from "react";
12
+ function KatexRenderer({
13
+ equation,
14
+ inline,
15
+ onDoubleClick
16
+ }) {
17
+ const katexElementRef = useRef(null);
18
+ useEffect(() => {
19
+ const katexElement = katexElementRef.current;
20
+ if (katexElement !== null) {
21
+ katex.render(equation, katexElement, {
22
+ displayMode: !inline,
23
+ // true === block display //
24
+ errorColor: "#cc0000",
25
+ output: "html",
26
+ strict: "warn",
27
+ throwOnError: false,
28
+ trust: false
29
+ });
30
+ }
31
+ }, [equation, inline]);
32
+ return (
33
+ // We use an empty image tag either side to ensure Android doesn't try and compose from the
34
+ // inner text from Katex. There didn't seem to be any other way of making this work,
35
+ // without having a physical space.
36
+ /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
37
+ "img",
38
+ {
39
+ src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
40
+ width: "0",
41
+ height: "0",
42
+ alt: ""
43
+ }
44
+ ), /* @__PURE__ */ React.createElement(
45
+ "span",
46
+ {
47
+ role: "button",
48
+ tabIndex: -1,
49
+ onDoubleClick,
50
+ ref: katexElementRef
51
+ }
52
+ ), /* @__PURE__ */ React.createElement(
53
+ "img",
54
+ {
55
+ src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
56
+ width: "0",
57
+ height: "0",
58
+ alt: ""
59
+ }
60
+ ))
61
+ );
62
+ }
63
+
64
+ // src/components/editor/nodes/EquationNode/EquationNode.tsx
65
+ init_react_shim();
66
+ import katex2 from "katex";
67
+ import { $applyNodeReplacement, DecoratorNode } from "lexical";
68
+ import * as React2 from "react";
69
+ var EquationComponent = React2.lazy(() => import("./EquationComponent-CB6DFIHV.mjs"));
70
+ function $convertEquationElement(domNode) {
71
+ let equation = domNode.getAttribute("data-lexical-equation");
72
+ const inline = domNode.getAttribute("data-lexical-inline") === "true";
73
+ equation = atob(equation || "");
74
+ if (equation) {
75
+ const node = $createEquationNode(equation, inline);
76
+ return { node };
77
+ }
78
+ return null;
79
+ }
80
+ var EquationNode = class _EquationNode extends DecoratorNode {
81
+ static getType() {
82
+ return "equation";
83
+ }
84
+ static clone(node) {
85
+ return new _EquationNode(node.__equation, node.__inline, node.__key);
86
+ }
87
+ constructor(equation, inline, key) {
88
+ super(key);
89
+ this.__equation = equation;
90
+ this.__inline = inline != null ? inline : false;
91
+ }
92
+ static importJSON(serializedNode) {
93
+ return $createEquationNode(
94
+ serializedNode.equation,
95
+ serializedNode.inline
96
+ ).updateFromJSON(serializedNode);
97
+ }
98
+ exportJSON() {
99
+ return __spreadProps(__spreadValues({}, super.exportJSON()), {
100
+ equation: this.getEquation(),
101
+ inline: this.__inline
102
+ });
103
+ }
104
+ createDOM(_config) {
105
+ const element = document.createElement(this.__inline ? "span" : "div");
106
+ element.className = "editor-equation";
107
+ return element;
108
+ }
109
+ exportDOM() {
110
+ const element = document.createElement(this.__inline ? "span" : "div");
111
+ const equation = btoa(this.__equation);
112
+ element.setAttribute("data-lexical-equation", equation);
113
+ element.setAttribute("data-lexical-inline", `${this.__inline}`);
114
+ katex2.render(this.__equation, element, {
115
+ displayMode: !this.__inline,
116
+ // true === block display //
117
+ errorColor: "#cc0000",
118
+ output: "html",
119
+ strict: "warn",
120
+ throwOnError: false,
121
+ trust: false
122
+ });
123
+ return { element };
124
+ }
125
+ static importDOM() {
126
+ return {
127
+ div: (domNode) => {
128
+ if (!domNode.hasAttribute("data-lexical-equation")) {
129
+ return null;
130
+ }
131
+ return {
132
+ conversion: $convertEquationElement,
133
+ priority: 2
134
+ };
135
+ },
136
+ span: (domNode) => {
137
+ if (!domNode.hasAttribute("data-lexical-equation")) {
138
+ return null;
139
+ }
140
+ return {
141
+ conversion: $convertEquationElement,
142
+ priority: 1
143
+ };
144
+ }
145
+ };
146
+ }
147
+ updateDOM(prevNode) {
148
+ return this.__inline !== prevNode.__inline;
149
+ }
150
+ getTextContent() {
151
+ return this.__equation;
152
+ }
153
+ getEquation() {
154
+ return this.__equation;
155
+ }
156
+ setEquation(equation) {
157
+ const writable = this.getWritable();
158
+ writable.__equation = equation;
159
+ }
160
+ decorate() {
161
+ return /* @__PURE__ */ React2.createElement(
162
+ EquationComponent,
163
+ {
164
+ equation: this.__equation,
165
+ inline: this.__inline,
166
+ nodeKey: this.__key
167
+ }
168
+ );
169
+ }
170
+ };
171
+ function $createEquationNode(equation = "", inline = false) {
172
+ const equationNode = new EquationNode(equation, inline);
173
+ return $applyNodeReplacement(equationNode);
174
+ }
175
+ function $isEquationNode(node) {
176
+ return node instanceof EquationNode;
177
+ }
178
+
179
+ export {
180
+ KatexRenderer,
181
+ EquationNode,
182
+ $createEquationNode,
183
+ $isEquationNode
184
+ };
@@ -0,0 +1,110 @@
1
+ import {
2
+ DropDown
3
+ } from "./chunk-EGMI62PP.mjs";
4
+ import {
5
+ SHORTCUTS
6
+ } from "./chunk-ZB5LZQKC.mjs";
7
+ import {
8
+ clearFormatting
9
+ } from "./chunk-PZSUSXQG.mjs";
10
+ import {
11
+ __spreadProps,
12
+ __spreadValues,
13
+ init_react_shim
14
+ } from "./chunk-77KXU36M.mjs";
15
+
16
+ // src/components/ui/drop-downs/text-format.tsx
17
+ init_react_shim();
18
+ import { FORMAT_TEXT_COMMAND } from "lexical";
19
+ import {
20
+ CaseSensitive,
21
+ CaseUpper,
22
+ HighlighterIcon,
23
+ LucideRemoveFormatting,
24
+ Strikethrough,
25
+ Subscript,
26
+ Superscript,
27
+ Trash
28
+ } from "lucide-react";
29
+ import React, { useMemo } from "react";
30
+ function TextFormat({
31
+ disabled = false,
32
+ editor,
33
+ toolbarState,
34
+ style,
35
+ ShowChevronsUpDown,
36
+ side,
37
+ sideOffset
38
+ }) {
39
+ const items = useMemo(
40
+ () => [
41
+ {
42
+ label: "Lowercase",
43
+ icon: /* @__PURE__ */ React.createElement(CaseSensitive, { className: "w-4 h-4" }),
44
+ func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "lowercase"),
45
+ shortcuts: SHORTCUTS.LOWERCASE,
46
+ selected: toolbarState.isLowercase
47
+ },
48
+ {
49
+ label: "Uppercase",
50
+ icon: /* @__PURE__ */ React.createElement(CaseUpper, { className: "w-4 h-4" }),
51
+ func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "uppercase"),
52
+ shortcuts: SHORTCUTS.UPPERCASE,
53
+ selected: toolbarState.isUppercase
54
+ },
55
+ {
56
+ label: "Strikethrough",
57
+ icon: /* @__PURE__ */ React.createElement(Strikethrough, { className: "w-4 h-4" }),
58
+ func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough"),
59
+ shortcuts: SHORTCUTS.STRIKETHROUGH,
60
+ selected: toolbarState.isStrikethrough
61
+ },
62
+ {
63
+ label: "Subscript",
64
+ icon: /* @__PURE__ */ React.createElement(Subscript, { className: "w-4 h-4" }),
65
+ func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "subscript"),
66
+ shortcuts: SHORTCUTS.SUBSCRIPT,
67
+ selected: toolbarState.isSubscript
68
+ },
69
+ {
70
+ label: "Superscript",
71
+ icon: /* @__PURE__ */ React.createElement(Superscript, { className: "w-4 h-4" }),
72
+ func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "superscript"),
73
+ shortcuts: SHORTCUTS.SUPERSCRIPT,
74
+ selected: toolbarState.isSuperscript
75
+ },
76
+ {
77
+ label: "Highlight",
78
+ icon: /* @__PURE__ */ React.createElement(HighlighterIcon, { className: "w-4 h-4" }),
79
+ func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "highlight"),
80
+ selected: toolbarState.isHighlight
81
+ },
82
+ {
83
+ label: "Clear Formatting",
84
+ icon: /* @__PURE__ */ React.createElement(Trash, { className: "w-4 h-4" }),
85
+ func: () => clearFormatting(editor),
86
+ shortcuts: SHORTCUTS.CLEAR_FORMATTING,
87
+ selected: false
88
+ }
89
+ ],
90
+ [editor, toolbarState]
91
+ );
92
+ return /* @__PURE__ */ React.createElement(
93
+ DropDown,
94
+ {
95
+ PopoverContentClassName: { width: "100%" },
96
+ TriggerClassName: __spreadProps(__spreadValues({}, style), { width: "100%", border: "none" }),
97
+ disabled,
98
+ sideOffset,
99
+ side,
100
+ className: "cursor-pointer",
101
+ ShowChevronsUpDown,
102
+ TriggerLabel: /* @__PURE__ */ React.createElement(LucideRemoveFormatting, null),
103
+ values: items
104
+ }
105
+ );
106
+ }
107
+
108
+ export {
109
+ TextFormat
110
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ init_react_shim
3
+ } from "./chunk-77KXU36M.mjs";
4
+
5
+ // src/components/providers/SharedHistoryContext.tsx
6
+ init_react_shim();
7
+ import { createEmptyHistoryState } from "@lexical/react/LexicalHistoryPlugin";
8
+ import * as React from "react";
9
+ import { createContext, useContext, useMemo } from "react";
10
+ var Context = createContext({});
11
+ var SharedHistoryContext = ({
12
+ children
13
+ }) => {
14
+ const historyContext = useMemo(
15
+ () => ({ historyState: createEmptyHistoryState() }),
16
+ []
17
+ );
18
+ return /* @__PURE__ */ React.createElement(Context.Provider, { value: historyContext }, children);
19
+ };
20
+ var useSharedHistoryContext = () => {
21
+ return useContext(Context);
22
+ };
23
+
24
+ export {
25
+ SharedHistoryContext,
26
+ useSharedHistoryContext
27
+ };
@@ -1,27 +1,26 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- import {$isAtNodeEnd} from '@lexical/selection';
9
- import {ElementNode, RangeSelection, TextNode} from 'lexical';
10
-
11
- export function getSelectedNode(
12
- selection: RangeSelection,
13
- ): TextNode | ElementNode {
14
- const anchor = selection.anchor;
15
- const focus = selection.focus;
16
- const anchorNode = selection.anchor.getNode();
17
- const focusNode = selection.focus.getNode();
18
- if (anchorNode === focusNode) {
19
- return anchorNode;
20
- }
21
- const isBackward = selection.isBackward();
22
- if (isBackward) {
23
- return $isAtNodeEnd(focus) ? anchorNode : focusNode;
24
- } else {
25
- return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
26
- }
27
- }
1
+ import {
2
+ init_react_shim
3
+ } from "./chunk-77KXU36M.mjs";
4
+
5
+ // src/components/editor/utils/getSelectedNode.ts
6
+ init_react_shim();
7
+ import { $isAtNodeEnd } from "@lexical/selection";
8
+ function getSelectedNode(selection) {
9
+ const anchor = selection.anchor;
10
+ const focus = selection.focus;
11
+ const anchorNode = selection.anchor.getNode();
12
+ const focusNode = selection.focus.getNode();
13
+ if (anchorNode === focusNode) {
14
+ return anchorNode;
15
+ }
16
+ const isBackward = selection.isBackward();
17
+ if (isBackward) {
18
+ return $isAtNodeEnd(focus) ? anchorNode : focusNode;
19
+ } else {
20
+ return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
21
+ }
22
+ }
23
+
24
+ export {
25
+ getSelectedNode
26
+ };
@@ -0,0 +1,125 @@
1
+ import {
2
+ init_react_shim
3
+ } from "./chunk-77KXU36M.mjs";
4
+
5
+ // src/components/editor/nodes/StoryBuilderNode/StoryBuilderNode.tsx
6
+ init_react_shim();
7
+ import { $applyNodeReplacement, DecoratorNode } from "lexical";
8
+ import * as React from "react";
9
+ import { Suspense } from "react";
10
+ var StoryBuilderComponent = React.lazy(() => import("./StoryBuilderComponent-JGDBM5JU.mjs"));
11
+ function convertStoryBuilderElement(domNode) {
12
+ const textContent = domNode.textContent;
13
+ if (textContent) {
14
+ const node = $createStoryBuilderNode({
15
+ nodes: [],
16
+ currentNodeId: "",
17
+ title: "Interactive Story"
18
+ });
19
+ return {
20
+ node
21
+ };
22
+ }
23
+ return null;
24
+ }
25
+ var StoryBuilderNode = class _StoryBuilderNode extends DecoratorNode {
26
+ static getType() {
27
+ return "story-builder";
28
+ }
29
+ static clone(node) {
30
+ return new _StoryBuilderNode(node.__nodes, node.__currentNodeId, node.__title, node.__key);
31
+ }
32
+ static importJSON(serializedNode) {
33
+ const { nodes, currentNodeId, title } = serializedNode;
34
+ const node = $createStoryBuilderNode({
35
+ nodes,
36
+ currentNodeId,
37
+ title
38
+ });
39
+ return node;
40
+ }
41
+ exportJSON() {
42
+ return {
43
+ nodes: this.__nodes,
44
+ currentNodeId: this.__currentNodeId,
45
+ title: this.__title,
46
+ type: "story-builder",
47
+ version: 1
48
+ };
49
+ }
50
+ constructor(nodes, currentNodeId, title, key) {
51
+ super(key);
52
+ this.__nodes = nodes;
53
+ this.__currentNodeId = currentNodeId;
54
+ this.__title = title;
55
+ }
56
+ exportDOM() {
57
+ const element = document.createElement("div");
58
+ element.setAttribute("data-lexical-story-builder", "true");
59
+ element.textContent = this.__title;
60
+ return { element };
61
+ }
62
+ static importDOM() {
63
+ return {
64
+ div: (domNode) => {
65
+ if (!domNode.hasAttribute("data-lexical-story-builder")) {
66
+ return null;
67
+ }
68
+ return {
69
+ conversion: convertStoryBuilderElement,
70
+ priority: 1
71
+ };
72
+ }
73
+ };
74
+ }
75
+ updateStory(payload) {
76
+ const writable = this.getWritable();
77
+ writable.__nodes = payload.nodes;
78
+ writable.__currentNodeId = payload.currentNodeId;
79
+ writable.__title = payload.title;
80
+ }
81
+ setTitle(title) {
82
+ const writable = this.getWritable();
83
+ writable.__title = title;
84
+ }
85
+ getNodes() {
86
+ return this.__nodes;
87
+ }
88
+ getCurrentNodeId() {
89
+ return this.__currentNodeId;
90
+ }
91
+ getTitle() {
92
+ return this.__title;
93
+ }
94
+ createDOM(config) {
95
+ const div = document.createElement("div");
96
+ div.style.display = "contents";
97
+ return div;
98
+ }
99
+ updateDOM() {
100
+ return false;
101
+ }
102
+ decorate() {
103
+ return /* @__PURE__ */ React.createElement(Suspense, { fallback: null }, /* @__PURE__ */ React.createElement(
104
+ StoryBuilderComponent,
105
+ {
106
+ nodes: this.__nodes,
107
+ currentNodeId: this.__currentNodeId,
108
+ title: this.__title,
109
+ nodeKey: this.getKey()
110
+ }
111
+ ));
112
+ }
113
+ };
114
+ function $createStoryBuilderNode(payload) {
115
+ return $applyNodeReplacement(new StoryBuilderNode(payload.nodes, payload.currentNodeId, payload.title));
116
+ }
117
+ function $isStoryBuilderNode(node) {
118
+ return node instanceof StoryBuilderNode;
119
+ }
120
+
121
+ export {
122
+ StoryBuilderNode,
123
+ $createStoryBuilderNode,
124
+ $isStoryBuilderNode
125
+ };
@@ -0,0 +1,36 @@
1
+ import {
2
+ init_react_shim
3
+ } from "./chunk-77KXU36M.mjs";
4
+
5
+ // src/components/editor/utils/url.ts
6
+ init_react_shim();
7
+ var SUPPORTED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
8
+ "http:",
9
+ "https:",
10
+ "mailto:",
11
+ "sms:",
12
+ "tel:",
13
+ "ftp:"
14
+ ]);
15
+ function sanitizeUrl(url) {
16
+ try {
17
+ const parsedUrl = new URL(url);
18
+ if (!SUPPORTED_URL_PROTOCOLS.has(parsedUrl.protocol)) {
19
+ return "about:blank";
20
+ }
21
+ } catch (e) {
22
+ return url;
23
+ }
24
+ return url;
25
+ }
26
+ var urlRegExp = new RegExp(
27
+ /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/
28
+ );
29
+ function validateUrl(url) {
30
+ return url === "https://" || urlRegExp.test(url);
31
+ }
32
+
33
+ export {
34
+ sanitizeUrl,
35
+ validateUrl
36
+ };
@@ -0,0 +1,84 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues,
4
+ init_react_shim
5
+ } from "./chunk-77KXU36M.mjs";
6
+
7
+ // src/components/editor/nodes/DynamicBlockNode/DynamicBlockNode.tsx
8
+ init_react_shim();
9
+ import { DecoratorBlockNode } from "@lexical/react/LexicalDecoratorBlockNode";
10
+ import * as React from "react";
11
+ function convertDynamicBlockElement(domNode) {
12
+ const element = domNode;
13
+ const payload = element.getAttribute("data-lexical-dynamic-block");
14
+ if (payload) {
15
+ const node = $createDynamicBlockNode(JSON.parse(payload));
16
+ return { node };
17
+ }
18
+ return null;
19
+ }
20
+ var DynamicBlockNode = class _DynamicBlockNode extends DecoratorBlockNode {
21
+ static getType() {
22
+ return "dynamic-block";
23
+ }
24
+ static clone(node) {
25
+ return new _DynamicBlockNode(node.__payload, node.__format, node.__key);
26
+ }
27
+ static importJSON(serializedNode) {
28
+ const { payload } = serializedNode;
29
+ const node = $createDynamicBlockNode(payload);
30
+ node.setFormat(serializedNode.format);
31
+ return node;
32
+ }
33
+ exportJSON() {
34
+ return __spreadProps(__spreadValues({}, super.exportJSON()), {
35
+ payload: this.__payload,
36
+ type: "dynamic-block",
37
+ version: 1
38
+ });
39
+ }
40
+ static importDOM() {
41
+ return {
42
+ div: (node) => ({
43
+ conversion: convertDynamicBlockElement,
44
+ priority: 1
45
+ })
46
+ };
47
+ }
48
+ exportDOM() {
49
+ const element = document.createElement("div");
50
+ element.setAttribute("data-lexical-dynamic-block", JSON.stringify(this.__payload));
51
+ element.className = "dynamic-block-container";
52
+ return { element };
53
+ }
54
+ constructor(payload, format, key) {
55
+ super(format, key);
56
+ this.__payload = payload;
57
+ }
58
+ updatePayload(payload) {
59
+ const writable = this.getWritable();
60
+ writable.__payload = payload;
61
+ }
62
+ getPayload() {
63
+ return this.getLatest().__payload;
64
+ }
65
+ getTextContent() {
66
+ return `Dynamic Block: ${this.__payload.title}`;
67
+ }
68
+ decorate() {
69
+ return /* @__PURE__ */ React.createElement(DynamicBlockComponent, { nodeKey: this.getKey(), payload: this.__payload });
70
+ }
71
+ };
72
+ function $createDynamicBlockNode(payload) {
73
+ return new DynamicBlockNode(payload);
74
+ }
75
+ function $isDynamicBlockNode(node) {
76
+ return node instanceof DynamicBlockNode;
77
+ }
78
+ var DynamicBlockComponent = React.lazy(() => import("./DynamicBlockComponent-NRQJ4WW4.mjs"));
79
+
80
+ export {
81
+ DynamicBlockNode,
82
+ $createDynamicBlockNode,
83
+ $isDynamicBlockNode
84
+ };