@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.
Files changed (411) hide show
  1. package/README.md +281 -259
  2. package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +12 -0
  3. package/dist/AIDialog-RHRYHSVN.mjs +325 -0
  4. package/dist/AudioComponent-CKLMLB5T.mjs +278 -0
  5. package/dist/CodeActionMenuPlugin-FGH6HZLL.mjs +14 -0
  6. package/dist/CollaborationPlugin-TIZOQBUT.mjs +405 -0
  7. package/dist/CollaboratorsBar-AMPIAUOY.mjs +20 -0
  8. package/dist/CommentsPlugin-SDJJTUGK.mjs +19 -0
  9. package/dist/DynamicBlockComponent-2LOADZUX.mjs +221 -0
  10. package/dist/{EquationComponent-CB6DFIHV.mjs → EquationComponent-4NFG55NQ.mjs} +82 -46
  11. package/dist/ExcalidrawComponent-BMSYIPP6.mjs +662 -0
  12. package/dist/ExcalidrawPlugin-QLPGJPSX.mjs +14 -0
  13. package/dist/ExportPlugin-MJHYKQZJ.mjs +43 -0
  14. package/dist/FileComponent-Y56MX5QD.mjs +200 -0
  15. package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +12 -0
  16. package/dist/FloatingTextFormatToolbarPlugin-BXCPN3KD.mjs +45 -0
  17. package/dist/HintComponet-ET7M2Q7S.mjs +288 -0
  18. package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +360 -0
  19. package/dist/{InlineImageComponent-UWIUWBHI.mjs → InlineImageComponent-FVTA4LXZ.mjs} +129 -99
  20. package/dist/MobileToolbar-KV5DX4ED.mjs +982 -0
  21. package/dist/SlashCommand-SPR7G5EI.mjs +39 -0
  22. package/dist/StoryBuilderComponent-JN4ZPZOW.mjs +816 -0
  23. package/dist/{TableCellActionMenuPlugin-PGK2K3VG.mjs → TableCellActionMenuPlugin-YWBA64J7.mjs} +328 -157
  24. package/dist/{TableHoverActionsPlugin-GJVE6VRW.mjs → TableHoverActionsPlugin-2EIXHEXN.mjs} +43 -36
  25. package/dist/{TemplatePlugin-ZD3QEVTI.mjs → TemplatePlugin-HNTPEXBB.mjs} +2 -2
  26. package/dist/ToolbarPlugin-F52PVNXU.mjs +823 -0
  27. package/dist/VersionHistoryPlugin-YWGCREKA.mjs +371 -0
  28. package/dist/babel-RJXDAKDM.mjs +7287 -0
  29. package/dist/background-color-RW5JYLMG.mjs +425 -0
  30. package/dist/block-format-TODFREE2.mjs +14 -0
  31. package/dist/{chunk-RBWZGXPF.mjs → chunk-22ZIL6NH.mjs} +5 -5
  32. package/dist/{chunk-DSFQHA7I.mjs → chunk-2LNT36RL.mjs} +118 -295
  33. package/dist/chunk-37LC44W3.mjs +2677 -0
  34. package/dist/{chunk-GK35L7UY.mjs → chunk-3IILA3IP.mjs} +1 -1
  35. package/dist/chunk-3JN6QEJR.mjs +31 -0
  36. package/dist/{chunk-5BAKY5KN.mjs → chunk-43Z4Z2KD.mjs} +5 -8
  37. package/dist/{chunk-GXYD4VZM.mjs → chunk-4DVIYZVB.mjs} +1 -1
  38. package/dist/{chunk-7NZAPJ4G.mjs → chunk-4FFTOZGJ.mjs} +4 -3
  39. package/dist/chunk-4UMUPCDK.mjs +68 -0
  40. package/dist/chunk-5D4JF3ZZ.mjs +624 -0
  41. package/dist/{chunk-POGRR73N.mjs → chunk-5NRAXWYA.mjs} +4 -3
  42. package/dist/{chunk-PZSUSXQG.mjs → chunk-6D6QLRYR.mjs} +2 -2
  43. package/dist/chunk-6FQFPPLG.mjs +785 -0
  44. package/dist/{chunk-3CPBODXA.mjs → chunk-6UVNHT3T.mjs} +7 -27
  45. package/dist/{chunk-G53GLEAY.mjs → chunk-7QRJVZQY.mjs} +47 -22
  46. package/dist/chunk-ACV47ZKE.mjs +201 -0
  47. package/dist/{chunk-FSM26655.mjs → chunk-AMXRQ2TK.mjs} +4 -4
  48. package/dist/{chunk-YUDCJRJM.mjs → chunk-BGV62GC2.mjs} +3 -2
  49. package/dist/{chunk-2FNEAMSP.mjs → chunk-C4JWLBYN.mjs} +50 -45
  50. package/dist/{chunk-TCYK7DM7.mjs → chunk-CDAMHK63.mjs} +4 -3
  51. package/dist/chunk-CLRSETYQ.mjs +431 -0
  52. package/dist/{chunk-QHIQKMVN.mjs → chunk-D3IOUQFR.mjs} +125 -111
  53. package/dist/chunk-EEBA6OAH.mjs +59 -0
  54. package/dist/{chunk-YKC3SO4Z.mjs → chunk-EIZMKFHF.mjs} +1 -1
  55. package/dist/{chunk-N3WN46VL.mjs → chunk-ELBTVBTS.mjs} +23 -22
  56. package/dist/chunk-ENH2IOHI.mjs +1828 -0
  57. package/dist/{chunk-4EXYCTGJ.mjs → chunk-EVPWKNE4.mjs} +3 -3
  58. package/dist/{chunk-LGG4IUIA.mjs → chunk-FO7M3X2B.mjs} +2 -2
  59. package/dist/{chunk-WDG7J2DY.mjs → chunk-H3P47YXJ.mjs} +30 -19
  60. package/dist/chunk-HOZ4QRFV.mjs +536 -0
  61. package/dist/{chunk-5QSNIVIG.mjs → chunk-IAFCQV3Z.mjs} +94 -78
  62. package/dist/{chunk-64Z3FI7T.mjs → chunk-IIVB6JNE.mjs} +5 -4
  63. package/dist/chunk-IUOUIDEQ.mjs +70 -0
  64. package/dist/chunk-J6ZUY5BY.mjs +202 -0
  65. package/dist/{chunk-YHPNOWFH.mjs → chunk-JHXDLYEV.mjs} +1 -1
  66. package/dist/{chunk-ZB5LZQKC.mjs → chunk-K5OAFEVY.mjs} +1 -1
  67. package/dist/{chunk-3JVFG7ER.mjs → chunk-KNW2CGIP.mjs} +7 -64
  68. package/dist/{chunk-4HBCVSE6.mjs → chunk-KXRLARGI.mjs} +1 -1
  69. package/dist/{chunk-4GFXER7R.mjs → chunk-LBGM4VVZ.mjs} +141 -89
  70. package/dist/chunk-LLGVCM7M.mjs +809 -0
  71. package/dist/chunk-LU2XWLOE.mjs +219 -0
  72. package/dist/chunk-LVRJM45C.mjs +171 -0
  73. package/dist/{chunk-K36V4SIW.mjs → chunk-MSAO3YFB.mjs} +21 -18
  74. package/dist/chunk-N3KDPSRI.mjs +496 -0
  75. package/dist/chunk-N3WTT2U6.mjs +21 -0
  76. package/dist/{chunk-GZPNVR7L.mjs → chunk-N6ILV6NF.mjs} +7 -6
  77. package/dist/{chunk-QEIFVK5M.mjs → chunk-NBE6FF6L.mjs} +4 -4
  78. package/dist/{chunk-BIU7WTLX.mjs → chunk-OE5JRLCN.mjs} +21 -18
  79. package/dist/chunk-OXWTZV3U.mjs +174 -0
  80. package/dist/{chunk-Z4EWP7BI.mjs → chunk-PD5K4AGP.mjs} +22 -23
  81. package/dist/chunk-PFH63ZU4.mjs +33 -0
  82. package/dist/{chunk-HJPPNHYM.mjs → chunk-QNIY45SF.mjs} +4 -3
  83. package/dist/chunk-R7WFRENU.mjs +262 -0
  84. package/dist/{chunk-4VWFVWYP.mjs → chunk-RAVYEEIC.mjs} +1 -1
  85. package/dist/chunk-RJQTA6HG.mjs +358 -0
  86. package/dist/{chunk-7VUMHWWL.mjs → chunk-SAOJHVPE.mjs} +5 -4
  87. package/dist/{chunk-456TN7IM.mjs → chunk-SYUCM5G5.mjs} +15 -14
  88. package/dist/{chunk-4MEDW3T6.mjs → chunk-T2UBAZ66.mjs} +5 -4
  89. package/dist/chunk-TC3IISJZ.mjs +408 -0
  90. package/dist/chunk-VGAX6YEY.mjs +399 -0
  91. package/dist/chunk-VNDDDXGH.mjs +682 -0
  92. package/dist/{chunk-U47ABU5Z.mjs → chunk-W6VQSFE5.mjs} +2 -2
  93. package/dist/chunk-WUVIQCX7.mjs +944 -0
  94. package/dist/chunk-WYCFGRFJ.mjs +118 -0
  95. package/dist/chunk-XNJNT6PC.mjs +1701 -0
  96. package/dist/chunk-XYLTLGY5.mjs +775 -0
  97. package/dist/chunk-XYMXGU4T.mjs +129 -0
  98. package/dist/{chunk-3G37YKTV.mjs → chunk-YR2DD74C.mjs} +9 -8
  99. package/dist/chunk-ZFV2HGD3.mjs +143 -0
  100. package/dist/{chunk-77UA6HYR.mjs → chunk-ZKZ7MLSS.mjs} +1 -1
  101. package/dist/chunk-ZYJ7KABY.mjs +419 -0
  102. package/dist/color-S55XFDYQ.mjs +13 -0
  103. package/dist/components/canvas/CanvasMode.d.ts +18 -0
  104. package/dist/components/editor/Core.d.ts +19 -0
  105. package/dist/components/editor/index.d.ts +38 -0
  106. package/dist/components/editor/lexical-on-change.d.ts +1 -0
  107. package/dist/components/editor/nodes/AudioNode/AudioComponent.d.ts +15 -0
  108. package/dist/components/editor/nodes/AudioNode/index.d.ts +36 -0
  109. package/dist/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.d.ts +22 -0
  110. package/dist/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.d.ts +18 -0
  111. package/dist/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.d.ts +19 -0
  112. package/dist/components/editor/nodes/DynamicBlockNode/DynamicBlockComponent.d.ts +7 -0
  113. package/dist/components/editor/nodes/DynamicBlockNode/DynamicBlockNode.d.ts +49 -0
  114. package/dist/components/editor/nodes/EquationNode/EquationComponent.d.ts +16 -0
  115. package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +33 -0
  116. package/dist/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +15 -0
  117. package/dist/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +57 -0
  118. package/dist/components/editor/nodes/ExcalidrawNode/ImageResizer.d.ts +24 -0
  119. package/dist/components/editor/nodes/ExcalidrawNode/index.d.ts +39 -0
  120. package/dist/components/editor/nodes/FigmaNode/FigmaNode.d.ts +27 -0
  121. package/dist/components/editor/nodes/FileNode/FileComponent.d.ts +16 -0
  122. package/dist/components/editor/nodes/FileNode/index.d.ts +39 -0
  123. package/dist/components/editor/nodes/Hint/HintComponet.d.ts +20 -0
  124. package/dist/components/editor/nodes/Hint/index.d.ts +33 -0
  125. package/dist/components/editor/nodes/ImageNode/index.d.ts +62 -0
  126. package/dist/components/editor/nodes/InlineImageNode/InlineImageComponent.d.ts +25 -0
  127. package/dist/components/editor/nodes/InlineImageNode/InlineImageNode.d.ts +66 -0
  128. package/dist/components/editor/nodes/LayoutNode/LayoutContainerNode.d.ts +31 -0
  129. package/dist/components/editor/nodes/LayoutNode/LayoutItemNode.d.ts +21 -0
  130. package/dist/components/editor/nodes/PollNode/index.d.ts +34 -0
  131. package/dist/components/editor/nodes/Stepper/index.d.ts +66 -0
  132. package/dist/components/editor/nodes/StoryBuilderNode/StoryBuilderComponent.d.ts +10 -0
  133. package/dist/components/editor/nodes/StoryBuilderNode/StoryBuilderNode.d.ts +59 -0
  134. package/dist/components/editor/nodes/TweetNode/index.d.ts +21 -0
  135. package/dist/components/editor/nodes/index.d.ts +4 -0
  136. package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +7 -0
  137. package/dist/components/editor/plugins/AudioPlugin/index.d.ts +1 -0
  138. package/dist/components/editor/plugins/AutoEmbedPlugin/index.d.ts +19 -0
  139. package/dist/components/editor/plugins/AutoLinkPlugin/index.d.ts +1 -0
  140. package/dist/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.d.ts +8 -0
  141. package/dist/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.d.ts +9 -0
  142. package/dist/components/editor/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
  143. package/dist/components/editor/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
  144. package/dist/components/editor/plugins/CodeHighlightPlugin/index.d.ts +11 -0
  145. package/dist/components/editor/plugins/CollaborationPlugin/CollaboratorsBar.d.ts +9 -0
  146. package/dist/components/editor/plugins/CollaborationPlugin/index.d.ts +8 -0
  147. package/dist/components/editor/plugins/CollapsiblePlugin/index.d.ts +4 -0
  148. package/dist/components/editor/plugins/CommentsPlugin/CommentThreadItem.d.ts +7 -0
  149. package/dist/components/editor/plugins/CommentsPlugin/CommentsSidebar.d.ts +2 -0
  150. package/dist/components/editor/plugins/CommentsPlugin/MentionsAutocomplete.d.ts +22 -0
  151. package/dist/components/editor/plugins/CommentsPlugin/NewCommentDialog.d.ts +2 -0
  152. package/dist/components/editor/plugins/CommentsPlugin/index.d.ts +5 -0
  153. package/dist/components/editor/plugins/ContentAnalyticsPlugin/index.d.ts +1 -0
  154. package/dist/components/editor/plugins/DragDropPastePlugin/index.d.ts +1 -0
  155. package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +5 -0
  156. package/dist/components/editor/plugins/DynamicBlockPlugin/index.d.ts +7 -0
  157. package/dist/components/editor/plugins/EquationsPlugin/index.d.ts +20 -0
  158. package/dist/components/editor/plugins/ExcalidrawPlugin/index.d.ts +5 -0
  159. package/dist/components/editor/plugins/ExportPlugin/ImportExportModal.d.ts +9 -0
  160. package/dist/components/editor/plugins/ExportPlugin/index.d.ts +28 -0
  161. package/dist/components/editor/plugins/FigmaPlugin/index.d.ts +11 -0
  162. package/dist/components/editor/plugins/FilePlugin/index.d.ts +1 -0
  163. package/dist/components/editor/plugins/FloatingLinkEditorPlugin/index.d.ts +6 -0
  164. package/dist/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +6 -0
  165. package/dist/components/editor/plugins/ImagesPlugin/index.d.ts +14 -0
  166. package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +32 -0
  167. package/dist/components/editor/plugins/InlineImagePlugin/index.d.ts +16 -0
  168. package/dist/components/editor/plugins/LayoutPlugin/index.d.ts +14 -0
  169. package/dist/components/editor/plugins/LinkPlugin/index.d.ts +13 -0
  170. package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +46 -0
  171. package/dist/components/editor/plugins/MarkdownShortcutPlugin/index.d.ts +2 -0
  172. package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +12 -0
  173. package/dist/components/editor/plugins/PollPlugin/index.d.ts +4 -0
  174. package/dist/components/editor/plugins/ShortcutsPlugin/index.d.ts +13 -0
  175. package/dist/components/editor/plugins/ShortcutsPlugin/shortcuts.d.ts +58 -0
  176. package/dist/components/editor/plugins/SlashCommand/index.d.ts +25 -0
  177. package/dist/components/editor/plugins/SpeechToTextPlugin/index.d.ts +5 -0
  178. package/dist/components/editor/plugins/StoryBuilderPlugin/index.d.ts +7 -0
  179. package/dist/components/editor/plugins/TabFocusPlugin/index.d.ts +1 -0
  180. package/dist/components/editor/plugins/TableCellActionMenuPlugin/index.d.ts +5 -0
  181. package/dist/components/editor/plugins/TableCellResizer/index.d.ts +2 -0
  182. package/dist/components/editor/plugins/TableHoverActionsPlugin/index.d.ts +4 -0
  183. package/dist/components/editor/plugins/TablePlugin/index.d.ts +27 -0
  184. package/dist/components/editor/plugins/TemplatePlugin/TemplateDialog.d.ts +1 -0
  185. package/dist/components/editor/plugins/TemplatePlugin/index.d.ts +3 -0
  186. package/dist/components/editor/plugins/ToolbarPlugin/MobileToolbar.d.ts +10 -0
  187. package/dist/components/editor/plugins/ToolbarPlugin/index.d.ts +11 -0
  188. package/dist/components/editor/plugins/TwitterPlugin/index.d.ts +4 -0
  189. package/dist/components/editor/plugins/VersionHistoryPlugin/NameVersionModal.d.ts +2 -0
  190. package/dist/components/editor/plugins/VersionHistoryPlugin/VersionHistoryDrawer.d.ts +2 -0
  191. package/dist/components/editor/plugins/VersionHistoryPlugin/index.d.ts +2 -0
  192. package/dist/components/editor/plugins/YouTubeNode/index.d.ts +22 -0
  193. package/dist/components/editor/plugins/YouTubePlugin/index.d.ts +11 -0
  194. package/dist/components/editor/templates/data.d.ts +7 -0
  195. package/dist/components/editor/themes/editor-theme.d.ts +3 -0
  196. package/dist/components/editor/utils/ai.d.ts +27 -0
  197. package/dist/components/editor/utils/canUseDOM.d.ts +8 -0
  198. package/dist/components/editor/utils/codeLanguages.d.ts +3 -0
  199. package/dist/components/editor/utils/diffUtils.d.ts +10 -0
  200. package/dist/components/editor/utils/editorFormatting.d.ts +26 -0
  201. package/dist/components/editor/utils/environment.d.ts +17 -0
  202. package/dist/components/editor/utils/extract-data.d.ts +8 -0
  203. package/dist/components/editor/utils/getAllLexicalChildren.d.ts +6 -0
  204. package/dist/components/editor/utils/getDOMRangeRect.d.ts +8 -0
  205. package/dist/components/editor/utils/getSelectedNode.d.ts +2 -0
  206. package/dist/components/editor/utils/gif.d.ts +7 -0
  207. package/dist/components/editor/utils/importUtils.d.ts +27 -0
  208. package/dist/components/editor/utils/invariant.d.ts +1 -0
  209. package/dist/components/editor/utils/markdownTransformers.d.ts +20 -0
  210. package/dist/components/editor/utils/setFloatingElemPosition.d.ts +1 -0
  211. package/dist/components/editor/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
  212. package/dist/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.d.ts +2 -0
  213. package/dist/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.d.ts +2 -0
  214. package/dist/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.d.ts +5 -0
  215. package/dist/components/editor/utils/url.d.ts +11 -0
  216. package/dist/components/editor/utils/useLayoutEffect.d.ts +3 -0
  217. package/dist/components/providers/AIContext.d.ts +21 -0
  218. package/dist/components/providers/CollabContext.d.ts +92 -0
  219. package/dist/components/providers/CommentsContext.d.ts +48 -0
  220. package/dist/components/providers/QueryProvider.d.ts +5 -0
  221. package/dist/components/providers/SharedHistoryContext.d.ts +11 -0
  222. package/dist/components/providers/ToolbarContext.d.ts +61 -0
  223. package/dist/components/providers/UploadContext.d.ts +29 -0
  224. package/dist/components/providers/VersionHistoryContext.d.ts +33 -0
  225. package/dist/components/providers/theme-provider.d.ts +3 -0
  226. package/dist/components/theme/ModeToggle.d.ts +2 -0
  227. package/dist/components/ui/ContentEditable.d.ts +15 -0
  228. package/dist/components/ui/FileInput.d.ts +16 -0
  229. package/dist/components/ui/Modal.d.ts +15 -0
  230. package/dist/components/ui/Select.d.ts +14 -0
  231. package/dist/components/ui/TextInput.d.ts +19 -0
  232. package/dist/components/ui/accordion.d.ts +7 -0
  233. package/dist/components/ui/ai/AIDialog.d.ts +9 -0
  234. package/dist/components/ui/ai/ai-button.d.ts +5 -0
  235. package/dist/components/ui/ai/border.d.ts +8 -0
  236. package/dist/components/ui/ai/placeholder-input-vanish.d.ts +6 -0
  237. package/dist/components/ui/badge.d.ts +9 -0
  238. package/dist/components/ui/button.d.ts +12 -0
  239. package/dist/components/ui/card.d.ts +8 -0
  240. package/dist/components/ui/checkbox.d.ts +4 -0
  241. package/dist/components/ui/command.d.ts +80 -0
  242. package/dist/components/ui/dialog/Dialog.d.ts +16 -0
  243. package/dist/components/ui/dialog.d.ts +19 -0
  244. package/dist/components/ui/drop-downs/background-color.d.ts +12 -0
  245. package/dist/components/ui/drop-downs/block-format.d.ts +25 -0
  246. package/dist/components/ui/drop-downs/code.d.ts +6 -0
  247. package/dist/components/ui/drop-downs/codeTheme.d.ts +8 -0
  248. package/dist/components/ui/drop-downs/color.d.ts +12 -0
  249. package/dist/components/ui/drop-downs/font-size.d.ts +10 -0
  250. package/dist/components/ui/drop-downs/font.d.ts +11 -0
  251. package/dist/components/ui/drop-downs/index.d.ts +24 -0
  252. package/dist/components/ui/drop-downs/insert-node.d.ts +6 -0
  253. package/dist/components/ui/drop-downs/table-dropdown.d.ts +10 -0
  254. package/dist/components/ui/drop-downs/text-align.d.ts +8 -0
  255. package/dist/components/ui/drop-downs/text-format.d.ts +11 -0
  256. package/dist/components/ui/dropdown-menu.d.ts +27 -0
  257. package/dist/components/ui/equation/EquationEditor.d.ts +14 -0
  258. package/dist/components/ui/equation/KatexEquationAlterer.d.ts +14 -0
  259. package/dist/components/ui/equation/KatexRenderer.d.ts +13 -0
  260. package/dist/components/ui/excalidraw/ExcalidrawModal.d.ts +48 -0
  261. package/dist/components/ui/excalidraw/Modal.d.ts +16 -0
  262. package/dist/components/ui/hover-card.d.ts +6 -0
  263. package/dist/components/ui/icons/brand-icons.d.ts +5 -0
  264. package/dist/components/ui/image/error-image.d.ts +2 -0
  265. package/dist/components/ui/image/file-upload.d.ts +8 -0
  266. package/dist/components/ui/image/image-resizer.d.ts +10 -0
  267. package/dist/components/ui/image/image-toolbar.d.ts +8 -0
  268. package/dist/components/ui/image/index.d.ts +16 -0
  269. package/dist/components/ui/image/lazy-image.d.ts +10 -0
  270. package/dist/components/ui/image/lazy-video.d.ts +11 -0
  271. package/dist/components/ui/input.d.ts +3 -0
  272. package/dist/components/ui/label.d.ts +5 -0
  273. package/dist/components/ui/models/custom-dialog.d.ts +58 -0
  274. package/dist/components/ui/models/insert-audio.d.ts +7 -0
  275. package/dist/components/ui/models/insert-file.d.ts +7 -0
  276. package/dist/components/ui/models/insert-gif.d.ts +7 -0
  277. package/dist/components/ui/models/insert-image.d.ts +6 -0
  278. package/dist/components/ui/models/insert-poll.d.ts +5 -0
  279. package/dist/components/ui/models/insert-table.d.ts +6 -0
  280. package/dist/components/ui/models/use-model.d.ts +6 -0
  281. package/dist/components/ui/poll/poll-component.d.ts +8 -0
  282. package/dist/components/ui/popover.d.ts +7 -0
  283. package/dist/components/ui/progress.d.ts +4 -0
  284. package/dist/components/ui/scroll-area.d.ts +5 -0
  285. package/dist/components/ui/separator.d.ts +4 -0
  286. package/dist/components/ui/skeleton.d.ts +2 -0
  287. package/dist/components/ui/sonner.d.ts +4 -0
  288. package/dist/components/ui/stepper/step.d.ts +11 -0
  289. package/dist/components/ui/stepper/stepper.d.ts +6 -0
  290. package/dist/components/ui/tabs.d.ts +7 -0
  291. package/dist/components/ui/textarea.d.ts +3 -0
  292. package/dist/components/ui/toggle.d.ts +14 -0
  293. package/dist/components/ui/tooltip.d.ts +7 -0
  294. package/dist/components/ui/write/text-format-floating.d.ts +27 -0
  295. package/dist/components/ui/write/text-format-floting-toolbar.d.ts +26 -0
  296. package/dist/core/chain.d.ts +4 -0
  297. package/dist/core/editor.d.ts +42 -0
  298. package/dist/core/extension.d.ts +20 -0
  299. package/dist/core/extensions/blocks-kit.d.ts +14 -0
  300. package/dist/core/extensions/copilot-and-collab.d.ts +10 -0
  301. package/dist/core/extensions/nodes-and-marks.d.ts +36 -0
  302. package/dist/core/index.d.ts +10 -0
  303. package/dist/core/react/BubbleMenu.d.ts +13 -0
  304. package/dist/core/react/FloatingMenu.d.ts +12 -0
  305. package/dist/core/react/NotiqContent.d.ts +11 -0
  306. package/dist/core/react/NotiqEditor.d.ts +29 -0
  307. package/dist/core/react/context.d.ts +15 -0
  308. package/dist/core/react/index.d.ts +8 -0
  309. package/dist/core/react/useNotiq.d.ts +16 -0
  310. package/dist/core/types.d.ts +89 -0
  311. package/dist/core.d.ts +1 -0
  312. package/dist/core.js +74458 -0
  313. package/dist/core.mjs +138 -0
  314. package/dist/estree-QRALCFII.mjs +5029 -0
  315. package/dist/font-IJKFR4BM.mjs +12 -0
  316. package/dist/font-size-3HMJHKO2.mjs +15 -0
  317. package/dist/hooks/instructions-messages.d.ts +11 -0
  318. package/dist/hooks/use-mobile.d.ts +1 -0
  319. package/dist/hooks/useModal.d.ts +12 -0
  320. package/dist/hooks/useReport.d.ts +8 -0
  321. package/dist/hooks/useResizeObservert.d.ts +1 -0
  322. package/dist/html-CE2S5FIJ.mjs +3185 -0
  323. package/dist/{image-2PJIAYAT.mjs → image-QPB2CVXP.mjs} +359 -324
  324. package/dist/index.d.ts +13 -145
  325. package/dist/index.js +61491 -44350
  326. package/dist/index.mjs +466 -1569
  327. package/dist/insert-audio-I3PD6JFS.mjs +180 -0
  328. package/dist/insert-file-PHR7XL4V.mjs +190 -0
  329. package/dist/insert-gif-R5ZO4JHC.mjs +112 -0
  330. package/dist/insert-image-PLBZELHK.mjs +348 -0
  331. package/dist/insert-node-DGCZBGKG.mjs +243 -0
  332. package/dist/insert-poll-6BCIFY5G.mjs +36 -0
  333. package/dist/insert-table-ZRJP6X52.mjs +70 -0
  334. package/dist/lib/edgestore.d.ts +2 -0
  335. package/dist/lib/index.d.ts +0 -0
  336. package/dist/lib/pinecone-client.d.ts +3 -0
  337. package/dist/lib/utils.d.ts +2 -0
  338. package/dist/markdown-GMCB4RDA.mjs +6753 -0
  339. package/dist/{poll-component-2R4MDLHS.mjs → poll-component-VHMM5KKZ.mjs} +126 -95
  340. package/dist/{postcss-ONF3VDIM.mjs → postcss-GH4QXSB5.mjs} +1879 -1697
  341. package/dist/react.d.ts +1 -0
  342. package/dist/react.js +73860 -0
  343. package/dist/react.mjs +66 -0
  344. package/dist/standalone-A6VDOPCZ.mjs +2506 -0
  345. package/dist/stepper-KNITDVLG.mjs +356 -0
  346. package/dist/styles/notiq.css +2 -2
  347. package/dist/styles/tailwind-plugin.d.ts +4 -0
  348. package/dist/table-dropdown-4VCRSQB6.mjs +391 -0
  349. package/dist/{text-align-VLECWO4H.mjs → text-align-TEB4S52S.mjs} +22 -19
  350. package/dist/text-format-T3IY7FBI.mjs +15 -0
  351. package/dist/typescript-CGC67LRI.mjs +13392 -0
  352. package/dist/utils/docSerialization.d.ts +10 -0
  353. package/dist/utils/emoji-list.d.ts +27 -0
  354. package/dist/utils/getDOMRangeRect.d.ts +8 -0
  355. package/dist/utils/getSelectedNode.d.ts +2 -0
  356. package/dist/utils/getThemeSelector.d.ts +9 -0
  357. package/dist/utils/html.d.ts +9 -0
  358. package/dist/utils/htmlExport.d.ts +9 -0
  359. package/dist/utils/isMobileWidth.d.ts +7 -0
  360. package/dist/utils/joinClasses.d.ts +8 -0
  361. package/dist/utils/setFloatingElemPosition.d.ts +1 -0
  362. package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
  363. package/dist/utils/swipe.d.ts +11 -0
  364. package/dist/utils/url.d.ts +9 -0
  365. package/package.json +128 -105
  366. package/src/styles/notiq.css +1315 -1150
  367. package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +0 -15
  368. package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +0 -161
  369. package/dist/ExcalidrawComponent-LUZJNFWV.mjs +0 -528
  370. package/dist/ExcalidrawPlugin-HC2L43YG.mjs +0 -14
  371. package/dist/ExportPlugin-V2RLM63S.mjs +0 -11
  372. package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +0 -12
  373. package/dist/FloatingTextFormatToolbarPlugin-ENECEZSX.mjs +0 -30
  374. package/dist/HintComponet-BRL6EAMS.mjs +0 -217
  375. package/dist/MobileToolbar-BOOZAMQE.mjs +0 -268
  376. package/dist/SlashCommand-FHEWHFZU.mjs +0 -28
  377. package/dist/StoryBuilderComponent-JGDBM5JU.mjs +0 -562
  378. package/dist/ToolbarPlugin-2VP7FDWD.mjs +0 -1547
  379. package/dist/babel-JZ2EV6AX.mjs +0 -7233
  380. package/dist/background-color-XZTYLGO2.mjs +0 -362
  381. package/dist/block-format-YJCV2DIY.mjs +0 -15
  382. package/dist/chunk-77KXU36M.mjs +0 -64
  383. package/dist/chunk-AMMKBSST.mjs +0 -1256
  384. package/dist/chunk-EGMI62PP.mjs +0 -83
  385. package/dist/chunk-JXDPPUJI.mjs +0 -52
  386. package/dist/chunk-KJ6AJ44Q.mjs +0 -128
  387. package/dist/chunk-NOJDE3CE.mjs +0 -1906
  388. package/dist/chunk-NZXC6FGU.mjs +0 -214
  389. package/dist/chunk-PBD6LMLC.mjs +0 -366
  390. package/dist/chunk-TTHQCW5F.mjs +0 -47
  391. package/dist/chunk-V2NIZOSQ.mjs +0 -538
  392. package/dist/chunk-WAK5JGNJ.mjs +0 -315
  393. package/dist/chunk-YMBXLRW5.mjs +0 -374
  394. package/dist/chunk-YPHOEJ46.mjs +0 -64
  395. package/dist/chunk-ZJRKATOJ.mjs +0 -65
  396. package/dist/color-BPKOPQKN.mjs +0 -12
  397. package/dist/estree-XC56IUFX.mjs +0 -4414
  398. package/dist/font-FEZ3GKSF.mjs +0 -13
  399. package/dist/font-size-EK775WRH.mjs +0 -15
  400. package/dist/html-S3ACX7NI.mjs +0 -2738
  401. package/dist/index.d.mts +0 -145
  402. package/dist/insert-gif-SAIDYURE.mjs +0 -100
  403. package/dist/insert-image-U3RJN3OW.mjs +0 -259
  404. package/dist/insert-node-WXW4ZER4.mjs +0 -201
  405. package/dist/insert-poll-HCPM7MO6.mjs +0 -33
  406. package/dist/insert-table-24XYUS2W.mjs +0 -66
  407. package/dist/markdown-SNVBOSRA.mjs +0 -3487
  408. package/dist/standalone-EOIALU3M.mjs +0 -2373
  409. package/dist/stepper-JDEE26TX.mjs +0 -304
  410. package/dist/text-format-BG5WOOPZ.mjs +0 -16
  411. package/dist/typescript-AMPI6OVS.mjs +0 -13135
package/dist/index.mjs CHANGED
@@ -1,86 +1,90 @@
1
1
  import {
2
- SpeechToTextPlugin_default
3
- } from "./chunk-77UA6HYR.mjs";
4
- import {
5
- CodeHighlightPlugin,
6
- LexicalAutoLinkPlugin,
7
- LinkWithMetaDataPlugin,
8
- nodes_default
9
- } from "./chunk-4GFXER7R.mjs";
10
- import {
11
- Progress,
12
- UploadProvider,
13
- useUpload
14
- } from "./chunk-JXDPPUJI.mjs";
2
+ Badge
3
+ } from "./chunk-AMXRQ2TK.mjs";
15
4
  import {
16
- DynamicBlockPlugin,
17
- EquationsPlugin,
18
- InlineImagePlugin,
19
- StoryBuilderPlugin
20
- } from "./chunk-DSFQHA7I.mjs";
5
+ AICommandBar,
6
+ AICopilot,
7
+ Audio,
8
+ Blockquote,
9
+ BlocksKit,
10
+ Bold,
11
+ BulletList,
12
+ CheckList,
13
+ Code,
14
+ CodeBlock,
15
+ Collaboration,
16
+ ColumnsLayout,
17
+ Equation,
18
+ Excalidraw,
19
+ Figma,
20
+ File,
21
+ Heading,
22
+ HintBlock,
23
+ History,
24
+ Image,
25
+ Italic,
26
+ OrderedList,
27
+ Paragraph,
28
+ Poll,
29
+ StarterKit,
30
+ Stepper,
31
+ Strike,
32
+ Tweet,
33
+ Underline,
34
+ YouTube
35
+ } from "./chunk-5D4JF3ZZ.mjs";
21
36
  import {
22
- PollPlugin
23
- } from "./chunk-U47ABU5Z.mjs";
37
+ BubbleMenu,
38
+ Editor,
39
+ Extension,
40
+ FloatingMenu,
41
+ NotiqContent,
42
+ NotiqContext,
43
+ NotiqEditor,
44
+ NotiqEditorImpl,
45
+ NotiqProvider,
46
+ createCanCommands,
47
+ createCommandChain,
48
+ createNotiqEditor,
49
+ useNotiq,
50
+ useNotiqContext
51
+ } from "./chunk-37LC44W3.mjs";
24
52
  import {
25
- AutoEmbedPlugin,
26
- CollapsiblePlugin,
27
- FigmaPlugin,
28
- LayoutPlugin,
29
- TwitterPlugin,
30
- YouTubePlugin
31
- } from "./chunk-AMMKBSST.mjs";
32
- import "./chunk-5QSNIVIG.mjs";
53
+ AVATAR_PRESETS,
54
+ OfflineBanner
55
+ } from "./chunk-VNDDDXGH.mjs";
33
56
  import {
34
- INSERT_IMAGE_COMMAND,
35
- ImagesPlugin
36
- } from "./chunk-LGG4IUIA.mjs";
37
- import "./chunk-5BAKY5KN.mjs";
57
+ VersionHistoryProvider,
58
+ useVersionHistory
59
+ } from "./chunk-J6ZUY5BY.mjs";
60
+ import "./chunk-ZKZ7MLSS.mjs";
61
+ import "./chunk-LBGM4VVZ.mjs";
62
+ import "./chunk-HOZ4QRFV.mjs";
63
+ import "./chunk-2LNT36RL.mjs";
64
+ import "./chunk-W6VQSFE5.mjs";
65
+ import "./chunk-ACV47ZKE.mjs";
66
+ import "./chunk-XYLTLGY5.mjs";
67
+ import "./chunk-IAFCQV3Z.mjs";
38
68
  import {
39
69
  AIProvider,
40
70
  useAI
41
- } from "./chunk-YUDCJRJM.mjs";
42
- import {
43
- StepperPlugin
44
- } from "./chunk-NZXC6FGU.mjs";
45
- import "./chunk-GXYD4VZM.mjs";
71
+ } from "./chunk-BGV62GC2.mjs";
72
+ import "./chunk-K5OAFEVY.mjs";
73
+ import "./chunk-LVRJM45C.mjs";
46
74
  import {
47
- CAN_USE_DOM,
48
- isCapitalize,
49
- isCenterAlign,
50
- isClearFormatting,
51
- isDecreaseFontSize,
52
- isFormatBulletList,
53
- isFormatCheckList,
54
- isFormatCode,
55
- isFormatHeading,
56
- isFormatNumberedList,
57
- isFormatParagraph,
58
- isFormatQuote,
59
- isIncreaseFontSize,
60
- isIndent,
61
- isInsertCodeBlock,
62
- isInsertLink,
63
- isJustifyAlign,
64
- isLeftAlign,
65
- isLowercase,
66
- isOutdent,
67
- isRightAlign,
68
- isStrikeThrough,
69
- isSubscript,
70
- isSuperscript,
71
- isUppercase
72
- } from "./chunk-ZB5LZQKC.mjs";
73
- import {
74
- clearFormatting,
75
- formatBulletList,
76
- formatCheckList,
77
- formatCode,
78
- formatHeading,
79
- formatNumberedList,
80
- formatParagraph,
81
- formatQuote,
82
- updateFontSize
83
- } from "./chunk-PZSUSXQG.mjs";
75
+ UploadProvider,
76
+ useUpload
77
+ } from "./chunk-N3WTT2U6.mjs";
78
+ import "./chunk-FO7M3X2B.mjs";
79
+ import "./chunk-4DVIYZVB.mjs";
80
+ import "./chunk-LLGVCM7M.mjs";
81
+ import "./chunk-VGAX6YEY.mjs";
82
+ import "./chunk-N6ILV6NF.mjs";
83
+ import "./chunk-T2UBAZ66.mjs";
84
+ import "./chunk-43Z4Z2KD.mjs";
85
+ import "./chunk-XYMXGU4T.mjs";
86
+ import "./chunk-ZFV2HGD3.mjs";
87
+ import "./chunk-6D6QLRYR.mjs";
84
88
  import {
85
89
  DEFAULT_FONT_SIZE,
86
90
  MAX_ALLOWED_FONT_SIZE,
@@ -88,1546 +92,379 @@ import {
88
92
  ToolbarContext,
89
93
  blockTypeToBlockName,
90
94
  useToolbarState
91
- } from "./chunk-7NZAPJ4G.mjs";
95
+ } from "./chunk-4FFTOZGJ.mjs";
96
+ import "./chunk-OXWTZV3U.mjs";
92
97
  import {
93
- SharedHistoryContext,
94
- useSharedHistoryContext
95
- } from "./chunk-4EXYCTGJ.mjs";
96
- import "./chunk-N3WN46VL.mjs";
97
- import "./chunk-QEIFVK5M.mjs";
98
- import "./chunk-GZPNVR7L.mjs";
98
+ CommentsProvider,
99
+ useComments
100
+ } from "./chunk-R7WFRENU.mjs";
99
101
  import {
100
- HintPlugin
101
- } from "./chunk-G53GLEAY.mjs";
102
- import "./chunk-YPHOEJ46.mjs";
102
+ COLLAB_COLORS,
103
+ COLLAB_SERVER_PRESETS,
104
+ CollabProvider,
105
+ DEFAULT_DOC_ID,
106
+ DEFAULT_SERVER_URL,
107
+ FALLBACK_SERVER_URL,
108
+ useCollab
109
+ } from "./chunk-RJQTA6HG.mjs";
110
+ import "./chunk-PFH63ZU4.mjs";
103
111
  import {
104
- sanitizeUrl
105
- } from "./chunk-4VWFVWYP.mjs";
106
- import "./chunk-HJPPNHYM.mjs";
107
- import "./chunk-3JVFG7ER.mjs";
108
- import "./chunk-4MEDW3T6.mjs";
109
- import {
110
- Badge
111
- } from "./chunk-FSM26655.mjs";
112
- import {
113
- Card,
114
- CardContent,
115
- CardHeader,
116
- CardTitle
117
- } from "./chunk-3G37YKTV.mjs";
118
- import "./chunk-POGRR73N.mjs";
112
+ SharedHistoryContext,
113
+ useSharedHistoryContext
114
+ } from "./chunk-EVPWKNE4.mjs";
115
+ import "./chunk-NBE6FF6L.mjs";
116
+ import "./chunk-ELBTVBTS.mjs";
117
+ import "./chunk-5NRAXWYA.mjs";
118
+ import "./chunk-IUOUIDEQ.mjs";
119
+ import "./chunk-RAVYEEIC.mjs";
120
+ import "./chunk-QNIY45SF.mjs";
119
121
  import {
120
122
  Button
121
- } from "./chunk-BIU7WTLX.mjs";
123
+ } from "./chunk-OE5JRLCN.mjs";
124
+ import "./chunk-4UMUPCDK.mjs";
125
+ import "./chunk-KNW2CGIP.mjs";
126
+ import "./chunk-7QRJVZQY.mjs";
127
+ import "./chunk-IIVB6JNE.mjs";
122
128
  import {
123
129
  cn
124
- } from "./chunk-YHPNOWFH.mjs";
130
+ } from "./chunk-JHXDLYEV.mjs";
125
131
  import {
126
- React,
127
132
  __spreadProps,
128
133
  __spreadValues,
129
134
  init_react_shim
130
- } from "./chunk-77KXU36M.mjs";
135
+ } from "./chunk-WYCFGRFJ.mjs";
131
136
 
132
137
  // src/index.ts
133
138
  init_react_shim();
134
139
 
135
- // src/components/editor/index.tsx
136
- init_react_shim();
137
- import React3 from "react";
138
- import { LexicalComposer } from "@lexical/react/LexicalComposer";
139
-
140
- // src/components/editor/themes/editor-theme.ts
140
+ // src/components/canvas/CanvasMode.tsx
141
141
  init_react_shim();
142
- var theme = {
143
- code: `
144
- bg-[#e1e1e1] dark:bg-[#1a1a1a] m-0 text-sm
145
- overflow-auto relative pl-[52px] p-3 font-mono group
146
- rounded-sm w-full h-fit block line-code
147
- `,
148
- codeHighlight: {
149
- atrule: "PlaygroundEditorTheme__tokenAttr",
150
- attr: "PlaygroundEditorTheme__tokenAttr",
151
- boolean: "PlaygroundEditorTheme__tokenProperty",
152
- builtin: "PlaygroundEditorTheme__tokenSelector",
153
- cdata: "PlaygroundEditorTheme__tokenComment",
154
- char: "PlaygroundEditorTheme__tokenSelector",
155
- class: "PlaygroundEditorTheme__tokenFunction",
156
- "class-name": "PlaygroundEditorTheme__tokenFunction",
157
- comment: "PlaygroundEditorTheme__tokenComment",
158
- constant: "PlaygroundEditorTheme__tokenProperty",
159
- deleted: "PlaygroundEditorTheme__tokenProperty",
160
- doctype: "PlaygroundEditorTheme__tokenComment",
161
- entity: "PlaygroundEditorTheme__tokenOperator",
162
- function: "PlaygroundEditorTheme__tokenFunction",
163
- important: "PlaygroundEditorTheme__tokenVariable",
164
- inserted: "PlaygroundEditorTheme__tokenSelector",
165
- keyword: "PlaygroundEditorTheme__tokenAttr",
166
- namespace: "PlaygroundEditorTheme__tokenVariable",
167
- number: "PlaygroundEditorTheme__tokenProperty",
168
- operator: "PlaygroundEditorTheme__tokenOperator",
169
- prolog: "PlaygroundEditorTheme__tokenComment",
170
- property: "PlaygroundEditorTheme__tokenProperty",
171
- punctuation: "PlaygroundEditorTheme__tokenPunctuation",
172
- regex: "PlaygroundEditorTheme__tokenVariable",
173
- selector: "PlaygroundEditorTheme__tokenSelector",
174
- string: "PlaygroundEditorTheme__tokenSelector",
175
- symbol: "PlaygroundEditorTheme__tokenProperty",
176
- tag: "PlaygroundEditorTheme__tokenProperty",
177
- url: "PlaygroundEditorTheme__tokenOperator",
178
- variable: "PlaygroundEditorTheme__tokenVariable"
179
- },
180
- embedBlock: {
181
- base: "PlaygroundEditorTheme__embedBlock",
182
- focus: "PlaygroundEditorTheme__embedBlockFocus"
183
- },
184
- list: {
185
- checklist: "PlaygroundEditorTheme__checklist",
186
- listitem: "PlaygroundEditorTheme__listItem",
187
- listitemChecked: "PlaygroundEditorTheme__listItemChecked",
188
- listitemUnchecked: "PlaygroundEditorTheme__listItemUnchecked",
189
- nested: {
190
- listitem: "PlaygroundEditorTheme__nestedListItem"
191
- },
192
- olDepth: [
193
- "PlaygroundEditorTheme__ol1 ",
194
- "PlaygroundEditorTheme__ol2",
195
- "PlaygroundEditorTheme__ol3",
196
- "PlaygroundEditorTheme__ol4",
197
- "PlaygroundEditorTheme__ol5"
198
- ],
199
- ulDepth: [
200
- "PlaygroundEditorTheme__ul1",
201
- "PlaygroundEditorTheme__ul2",
202
- "PlaygroundEditorTheme__ul3",
203
- "PlaygroundEditorTheme__ul4",
204
- "PlaygroundEditorTheme__ul5"
205
- ],
206
- ul: "ul",
207
- ol: "ol"
208
- },
209
- paragraph: "leading-7",
210
- link: `underline cursor-pointer text-blue-600 after:content-['_\u2197']`,
211
- hr: "w-full h-1 border-input",
212
- table: "PlaygroundEditorTheme__table",
213
- tableCell: "PlaygroundEditorTheme__tableCell",
214
- tableCellActionButton: "PlaygroundEditorTheme__tableCellActionButton",
215
- tableCellActionButtonContainer: "PlaygroundEditorTheme__tableCellActionButtonContainer",
216
- tableCellHeader: "PlaygroundEditorTheme__tableCellHeader",
217
- tableCellResizer: "PlaygroundEditorTheme__tableCellResizer",
218
- tableCellSelected: "PlaygroundEditorTheme__tableCellSelected",
219
- tableRowStriping: "PlaygroundEditorTheme__tableRowStriping",
220
- tableScrollableWrapper: "PlaygroundEditorTheme__tableScrollableWrapper",
221
- tableSelected: "PlaygroundEditorTheme__tableSelected",
222
- tableSelection: "PlaygroundEditorTheme__tableSelection",
223
- layoutContainer: "grid gap-[10px] my-[10px] ",
224
- layoutItem: "px-2 py-[16px] border dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-50 border border-zinc-200 bg-white/90 shadow-md rounded-sm",
225
- heading: {
226
- h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",
227
- h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
228
- h3: "scroll-m-20 text-2xl font-semibold tracking-tight",
229
- h4: "scroll-m-20 text-xl font-semibold tracking-tight",
230
- h5: "text-lg font-bold",
231
- h6: "text-sm font-bold"
232
- },
233
- quote: "mt-6 border-l-[4px] pl-6 italic",
234
- text: {
235
- bold: "font-bold",
236
- capitalize: "capitalize",
237
- code: "inline-flex items-center rounded-sm border border-zinc-200 px-0.1 py-0 h-fit min-h-[20px] transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:border-zinc-800 dark:focus:ring-zinc-300 border-transparent bg-zinc-100 text-zinc-900 hover:bg-zinc-100/80 dark:bg-zinc-800 dark:text-zinc-50 dark:hover:bg-zinc-800/80",
238
- italic: "italic ",
239
- lowercase: "lowercase",
240
- strikethrough: "line-through",
241
- underline: "underline",
242
- underlineStrikethrough: "underline line-through",
243
- uppercase: "uppercase"
244
- }
245
- };
246
- var editor_theme_default = theme;
247
-
248
- // src/components/editor/Core.tsx
249
- init_react_shim();
250
- import { useCallback as useCallback2, useEffect as useEffect7, useState as useState3 } from "react";
251
- import { useLexicalEditable as useLexicalEditable2 } from "@lexical/react/useLexicalEditable";
252
- import { useLexicalComposerContext as useLexicalComposerContext6 } from "@lexical/react/LexicalComposerContext";
253
- import dynamic from "next/dynamic.js";
254
- import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
255
- import { ContentEditable } from "@lexical/react/LexicalContentEditable";
256
- import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
257
- import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
258
- import { HorizontalRulePlugin } from "@lexical/react/LexicalHorizontalRulePlugin";
259
- import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
260
- import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
261
- import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
262
- import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
263
-
264
- // src/components/editor/plugins/ShortcutsPlugin/index.tsx
265
- init_react_shim();
266
- import { TOGGLE_LINK_COMMAND } from "@lexical/link";
142
+ import { useState, useRef, useEffect, useCallback } from "react";
267
143
  import {
268
- COMMAND_PRIORITY_NORMAL,
269
- FORMAT_ELEMENT_COMMAND,
270
- FORMAT_TEXT_COMMAND,
271
- INDENT_CONTENT_COMMAND,
272
- KEY_MODIFIER_COMMAND,
273
- OUTDENT_CONTENT_COMMAND
274
- } from "lexical";
275
- import { useEffect } from "react";
276
- function ShortcutsPlugin({
277
- editor,
278
- setIsLinkEditMode
144
+ ZoomIn,
145
+ ZoomOut,
146
+ Maximize2,
147
+ StickyNote,
148
+ FileText,
149
+ Shapes,
150
+ Trash2
151
+ } from "lucide-react";
152
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
153
+ var NOTE_COLORS = [
154
+ { name: "Yellow", bg: "bg-amber-100 dark:bg-amber-950/70 border-amber-300 dark:border-amber-800 text-amber-900 dark:text-amber-100" },
155
+ { name: "Blue", bg: "bg-sky-100 dark:bg-sky-950/70 border-sky-300 dark:border-sky-800 text-sky-900 dark:text-sky-100" },
156
+ { name: "Emerald", bg: "bg-emerald-100 dark:bg-emerald-950/70 border-emerald-300 dark:border-emerald-800 text-emerald-900 dark:text-emerald-100" },
157
+ { name: "Purple", bg: "bg-purple-100 dark:bg-purple-950/70 border-purple-300 dark:border-purple-800 text-purple-900 dark:text-purple-100" },
158
+ { name: "Rose", bg: "bg-rose-100 dark:bg-rose-950/70 border-rose-300 dark:border-rose-800 text-rose-900 dark:text-rose-100" }
159
+ ];
160
+ function CanvasMode({
161
+ documentContent = "",
162
+ onClose,
163
+ className
279
164
  }) {
280
- const { toolbarState } = useToolbarState();
281
- useEffect(() => {
282
- const keyboardShortcutsHandler = (payload) => {
283
- const event = payload;
284
- if (isFormatParagraph(event)) {
285
- event.preventDefault();
286
- formatParagraph(editor);
287
- } else if (isFormatHeading(event)) {
288
- event.preventDefault();
289
- const { code } = event;
290
- const headingSize = `h${code[code.length - 1]}`;
291
- formatHeading(editor, toolbarState.blockType, headingSize);
292
- } else if (isFormatBulletList(event)) {
293
- event.preventDefault();
294
- formatBulletList(editor, toolbarState.blockType);
295
- } else if (isFormatNumberedList(event)) {
296
- event.preventDefault();
297
- formatNumberedList(editor, toolbarState.blockType);
298
- } else if (isFormatCheckList(event)) {
299
- event.preventDefault();
300
- formatCheckList(editor, toolbarState.blockType);
301
- } else if (isFormatCode(event)) {
302
- event.preventDefault();
303
- formatCode(editor, toolbarState.blockType);
304
- } else if (isFormatQuote(event)) {
305
- event.preventDefault();
306
- formatQuote(editor, toolbarState.blockType);
307
- } else if (isStrikeThrough(event)) {
308
- event.preventDefault();
309
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough");
310
- } else if (isLowercase(event)) {
311
- event.preventDefault();
312
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "lowercase");
313
- } else if (isUppercase(event)) {
314
- event.preventDefault();
315
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "uppercase");
316
- } else if (isCapitalize(event)) {
317
- event.preventDefault();
318
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "capitalize");
319
- } else if (isIndent(event)) {
320
- event.preventDefault();
321
- editor.dispatchCommand(INDENT_CONTENT_COMMAND, void 0);
322
- } else if (isOutdent(event)) {
323
- event.preventDefault();
324
- editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, void 0);
325
- } else if (isCenterAlign(event)) {
326
- event.preventDefault();
327
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "center");
328
- } else if (isLeftAlign(event)) {
329
- event.preventDefault();
330
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "left");
331
- } else if (isRightAlign(event)) {
332
- event.preventDefault();
333
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "right");
334
- } else if (isJustifyAlign(event)) {
335
- event.preventDefault();
336
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "justify");
337
- } else if (isSubscript(event)) {
338
- event.preventDefault();
339
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "subscript");
340
- } else if (isSuperscript(event)) {
341
- event.preventDefault();
342
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "superscript");
343
- } else if (isInsertCodeBlock(event)) {
344
- event.preventDefault();
345
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "code");
346
- } else if (isIncreaseFontSize(event)) {
347
- event.preventDefault();
348
- updateFontSize(
349
- editor,
350
- 1 /* increment */,
351
- toolbarState.fontSizeInputValue
352
- );
353
- } else if (isDecreaseFontSize(event)) {
354
- event.preventDefault();
355
- updateFontSize(
356
- editor,
357
- 2 /* decrement */,
358
- toolbarState.fontSizeInputValue
359
- );
360
- } else if (isClearFormatting(event)) {
361
- event.preventDefault();
362
- clearFormatting(editor);
363
- } else if (isInsertLink(event)) {
364
- event.preventDefault();
365
- const url = toolbarState.isLink ? null : sanitizeUrl("https://");
366
- setIsLinkEditMode(!toolbarState.isLink);
367
- editor.dispatchCommand(TOGGLE_LINK_COMMAND, url);
368
- }
369
- return false;
370
- };
371
- return editor.registerCommand(
372
- KEY_MODIFIER_COMMAND,
373
- keyboardShortcutsHandler,
374
- COMMAND_PRIORITY_NORMAL
375
- );
376
- }, [
377
- editor,
378
- toolbarState.isLink,
379
- toolbarState.blockType,
380
- toolbarState.fontSizeInputValue,
381
- setIsLinkEditMode
382
- ]);
383
- return null;
384
- }
165
+ const [scale, setScale] = useState(1);
166
+ const [pan, setPan] = useState({ x: 80, y: 80 });
167
+ const [isPanning, setIsPanning] = useState(false);
168
+ const startPanRef = useRef({ x: 0, y: 0 });
169
+ const [cards, setCards] = useState([
170
+ {
171
+ id: "primary-doc",
172
+ x: 100,
173
+ y: 100,
174
+ width: 480,
175
+ height: 380,
176
+ type: "doc",
177
+ title: "Document Core",
178
+ content: documentContent || `# Project Roadmap
385
179
 
386
- // src/components/editor/plugins/TabFocusPlugin/index.ts
387
- init_react_shim();
388
- import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
389
- import {
390
- $getSelection,
391
- $isRangeSelection,
392
- $setSelection,
393
- FOCUS_COMMAND
394
- } from "lexical";
395
- import { useEffect as useEffect2 } from "react";
396
- var COMMAND_PRIORITY_LOW = 1;
397
- var TAB_TO_FOCUS_INTERVAL = 100;
398
- var lastTabKeyDownTimestamp = 0;
399
- var hasRegisteredKeyDownListener = false;
400
- function registerKeyTimeStampTracker() {
401
- window.addEventListener(
402
- "keydown",
403
- (event) => {
404
- if (event.key === "Tab") {
405
- lastTabKeyDownTimestamp = event.timeStamp;
406
- }
180
+ - [x] Modern Editor Framework Architecture
181
+ - [x] Command Chaining Engine
182
+ - [x] Inline AI Command Bar (Cmd+K)
183
+ - [x] Notion-style Drag Handles
184
+ - [ ] Infinite Spatial Canvas`,
185
+ color: "bg-card border-border"
407
186
  },
408
- true
409
- );
410
- }
411
- function TabFocusPlugin() {
412
- const [editor] = useLexicalComposerContext();
413
- useEffect2(() => {
414
- if (!hasRegisteredKeyDownListener) {
415
- registerKeyTimeStampTracker();
416
- hasRegisteredKeyDownListener = true;
187
+ {
188
+ id: "note-1",
189
+ x: 640,
190
+ y: 100,
191
+ width: 260,
192
+ height: 200,
193
+ type: "note",
194
+ title: "Architectural Vision",
195
+ content: "Tiptap's ergonomics backed by Lexical's 60fps AST engine. Unmatched speed and zero cloud lock-ins.",
196
+ color: NOTE_COLORS[0].bg
197
+ },
198
+ {
199
+ id: "note-2",
200
+ x: 640,
201
+ y: 340,
202
+ width: 260,
203
+ height: 180,
204
+ type: "note",
205
+ title: "Real-Time CRDTs",
206
+ content: "Yjs + WebSocket + IndexedDB persistent offline synchronization.",
207
+ color: NOTE_COLORS[1].bg
208
+ },
209
+ {
210
+ id: "board-1",
211
+ x: 940,
212
+ y: 100,
213
+ width: 420,
214
+ height: 320,
215
+ type: "board",
216
+ title: "System Flowchart (Excalidraw)",
217
+ content: "[Interactive Whiteboard Canvas]",
218
+ color: "bg-card border-border"
417
219
  }
418
- return editor.registerCommand(
419
- FOCUS_COMMAND,
420
- (event) => {
421
- const selection = $getSelection();
422
- if ($isRangeSelection(selection)) {
423
- if (lastTabKeyDownTimestamp + TAB_TO_FOCUS_INTERVAL > event.timeStamp) {
424
- $setSelection(selection.clone());
425
- }
426
- }
427
- return false;
428
- },
429
- COMMAND_PRIORITY_LOW
430
- );
431
- }, [editor]);
432
- return null;
433
- }
434
-
435
- // src/components/editor/plugins/TableCellResizer/index.tsx
436
- init_react_shim();
437
- import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
438
- import { useLexicalEditable } from "@lexical/react/useLexicalEditable";
439
- import {
440
- $computeTableMapSkipCellCheck,
441
- $getTableNodeFromLexicalNodeOrThrow,
442
- $getTableRowIndexFromTableCellNode,
443
- $isTableCellNode,
444
- $isTableRowNode,
445
- getDOMCellFromTarget,
446
- getTableElement,
447
- TableNode
448
- } from "@lexical/table";
449
- import { calculateZoomLevel } from "@lexical/utils";
450
- import { $getNearestNodeFromDOMNode, isHTMLElement } from "lexical";
451
- import * as React2 from "react";
452
- import {
453
- useCallback,
454
- useEffect as useEffect3,
455
- useMemo,
456
- useRef,
457
- useState
458
- } from "react";
459
- import { createPortal } from "react-dom";
460
- var MIN_ROW_HEIGHT = 33;
461
- var MIN_COLUMN_WIDTH = 92;
462
- function TableCellResizer({ editor }) {
463
- const targetRef = useRef(null);
464
- const resizerRef = useRef(null);
465
- const tableRectRef = useRef(null);
466
- const mouseStartPosRef = useRef(null);
467
- const [mouseCurrentPos, updateMouseCurrentPos] = useState(null);
468
- const [activeCell, updateActiveCell] = useState(null);
469
- const [isMouseDown, updateIsMouseDown] = useState(false);
470
- const [draggingDirection, updateDraggingDirection] = useState(null);
471
- const resetState = useCallback(() => {
472
- updateActiveCell(null);
473
- targetRef.current = null;
474
- updateDraggingDirection(null);
475
- mouseStartPosRef.current = null;
476
- tableRectRef.current = null;
477
- }, []);
478
- const isMouseDownOnEvent = (event) => {
479
- return (event.buttons & 1) === 1;
220
+ ]);
221
+ const [activeDragId, setActiveDragId] = useState(null);
222
+ const dragOffsetRef = useRef({ x: 0, y: 0 });
223
+ const handleMouseDownCanvas = (e) => {
224
+ if (e.target.closest(".canvas-card")) return;
225
+ setIsPanning(true);
226
+ startPanRef.current = { x: e.clientX - pan.x, y: e.clientY - pan.y };
480
227
  };
481
- useEffect3(() => {
482
- return editor.registerNodeTransform(TableNode, (tableNode) => {
483
- if (tableNode.getColWidths()) {
484
- return tableNode;
485
- }
486
- const numColumns = tableNode.getColumnCount();
487
- const columnWidth = MIN_COLUMN_WIDTH;
488
- tableNode.setColWidths(Array(numColumns).fill(columnWidth));
489
- return tableNode;
490
- });
491
- }, [editor]);
492
- useEffect3(() => {
493
- const onMouseMove = (event) => {
494
- const target = event.target;
495
- if (!isHTMLElement(target)) {
496
- return;
497
- }
498
- if (draggingDirection) {
499
- updateMouseCurrentPos({
500
- x: event.clientX,
501
- y: event.clientY
228
+ const handleMouseMove = useCallback(
229
+ (e) => {
230
+ if (isPanning) {
231
+ setPan({
232
+ x: e.clientX - startPanRef.current.x,
233
+ y: e.clientY - startPanRef.current.y
502
234
  });
503
- return;
504
- }
505
- updateIsMouseDown(isMouseDownOnEvent(event));
506
- if (resizerRef.current && resizerRef.current.contains(target)) {
507
- return;
508
- }
509
- if (targetRef.current !== target) {
510
- targetRef.current = target;
511
- const cell = getDOMCellFromTarget(target);
512
- if (cell && activeCell !== cell) {
513
- editor.getEditorState().read(
514
- () => {
515
- const tableCellNode = $getNearestNodeFromDOMNode(cell.elem);
516
- if (!tableCellNode) {
517
- throw new Error("TableCellResizer: Table cell node not found.");
518
- }
519
- const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
520
- const tableElement = getTableElement(
521
- tableNode,
522
- editor.getElementByKey(tableNode.getKey())
523
- );
524
- if (!tableElement) {
525
- throw new Error("TableCellResizer: Table element not found.");
526
- }
527
- targetRef.current = target;
528
- tableRectRef.current = tableElement.getBoundingClientRect();
529
- updateActiveCell(cell);
530
- },
531
- { editor }
532
- );
533
- } else if (cell == null) {
534
- resetState();
535
- }
235
+ } else if (activeDragId) {
236
+ setCards(
237
+ (prev) => prev.map((card) => {
238
+ if (card.id === activeDragId) {
239
+ const newX = (e.clientX - pan.x) / scale - dragOffsetRef.current.x;
240
+ const newY = (e.clientY - pan.y) / scale - dragOffsetRef.current.y;
241
+ return __spreadProps(__spreadValues({}, card), { x: Math.round(newX), y: Math.round(newY) });
242
+ }
243
+ return card;
244
+ })
245
+ );
536
246
  }
247
+ },
248
+ [isPanning, activeDragId, pan, scale]
249
+ );
250
+ const handleMouseUp = useCallback(() => {
251
+ setIsPanning(false);
252
+ setActiveDragId(null);
253
+ }, []);
254
+ useEffect(() => {
255
+ window.addEventListener("mousemove", handleMouseMove);
256
+ window.addEventListener("mouseup", handleMouseUp);
257
+ return () => {
258
+ window.removeEventListener("mousemove", handleMouseMove);
259
+ window.removeEventListener("mouseup", handleMouseUp);
537
260
  };
538
- const onMouseDown = () => {
539
- updateIsMouseDown(true);
540
- };
541
- const onMouseUp = () => {
542
- updateIsMouseDown(false);
261
+ }, [handleMouseMove, handleMouseUp]);
262
+ const handleStartCardDrag = (e, card) => {
263
+ e.stopPropagation();
264
+ setActiveDragId(card.id);
265
+ const mouseCanvasX = (e.clientX - pan.x) / scale;
266
+ const mouseCanvasY = (e.clientY - pan.y) / scale;
267
+ dragOffsetRef.current = {
268
+ x: mouseCanvasX - card.x,
269
+ y: mouseCanvasY - card.y
543
270
  };
544
- const removeRootListener = editor.registerRootListener(
545
- (rootElement, prevRootElement) => {
546
- prevRootElement == null ? void 0 : prevRootElement.removeEventListener("mousemove", onMouseMove);
547
- prevRootElement == null ? void 0 : prevRootElement.removeEventListener("mousedown", onMouseDown);
548
- prevRootElement == null ? void 0 : prevRootElement.removeEventListener("mouseup", onMouseUp);
549
- rootElement == null ? void 0 : rootElement.addEventListener("mousemove", onMouseMove);
550
- rootElement == null ? void 0 : rootElement.addEventListener("mousedown", onMouseDown);
551
- rootElement == null ? void 0 : rootElement.addEventListener("mouseup", onMouseUp);
552
- }
553
- );
554
- return () => {
555
- removeRootListener();
271
+ };
272
+ const handleAddNote = () => {
273
+ const randomColor = NOTE_COLORS[Math.floor(Math.random() * NOTE_COLORS.length)].bg;
274
+ const newCard = {
275
+ id: `note-${Date.now()}`,
276
+ x: Math.round(-pan.x / scale + 200 + Math.random() * 80),
277
+ y: Math.round(-pan.y / scale + 200 + Math.random() * 80),
278
+ width: 240,
279
+ height: 180,
280
+ type: "note",
281
+ title: "New Idea",
282
+ content: "Type your notes or thoughts here...",
283
+ color: randomColor
556
284
  };
557
- }, [activeCell, draggingDirection, editor, resetState]);
558
- const isHeightChanging = (direction) => {
559
- if (direction === "bottom") {
560
- return true;
561
- }
562
- return false;
285
+ setCards((prev) => [...prev, newCard]);
563
286
  };
564
- const updateRowHeight = useCallback(
565
- (heightChange) => {
566
- if (!activeCell) {
567
- throw new Error("TableCellResizer: Expected active cell.");
568
- }
569
- editor.update(
570
- () => {
571
- const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
572
- if (!$isTableCellNode(tableCellNode)) {
573
- throw new Error("TableCellResizer: Table cell node not found.");
574
- }
575
- const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
576
- const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode) + tableCellNode.getRowSpan() - 1;
577
- const tableRows = tableNode.getChildren();
578
- if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
579
- throw new Error("Expected table cell to be inside of table row.");
580
- }
581
- const tableRow = tableRows[tableRowIndex];
582
- if (!$isTableRowNode(tableRow)) {
583
- throw new Error("Expected table row");
584
- }
585
- let height = tableRow.getHeight();
586
- if (height === void 0) {
587
- const rowCells = tableRow.getChildren();
588
- height = Math.min(
589
- ...rowCells.map(
590
- (cell) => {
591
- var _a;
592
- return (_a = getCellNodeHeight(cell, editor)) != null ? _a : Infinity;
593
- }
594
- )
595
- );
596
- }
597
- const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT);
598
- tableRow.setHeight(newHeight);
599
- },
600
- { tag: "skip-scroll-into-view" }
601
- );
602
- },
603
- [activeCell, editor]
604
- );
605
- const getCellNodeHeight = (cell, activeEditor) => {
606
- const domCellNode = activeEditor.getElementByKey(cell.getKey());
607
- return domCellNode == null ? void 0 : domCellNode.clientHeight;
287
+ const handleDeleteCard = (id) => {
288
+ setCards((prev) => prev.filter((c) => c.id !== id));
608
289
  };
609
- const getCellColumnIndex = (tableCellNode, tableMap) => {
610
- for (let row = 0; row < tableMap.length; row++) {
611
- for (let column = 0; column < tableMap[row].length; column++) {
612
- if (tableMap[row][column].cell === tableCellNode) {
613
- return column;
614
- }
615
- }
616
- }
290
+ const handleUpdateCardContent = (id, content) => {
291
+ setCards(
292
+ (prev) => prev.map((c) => c.id === id ? __spreadProps(__spreadValues({}, c), { content }) : c)
293
+ );
617
294
  };
618
- const updateColumnWidth = useCallback(
619
- (widthChange) => {
620
- if (!activeCell) {
621
- throw new Error("TableCellResizer: Expected active cell.");
622
- }
623
- editor.update(
624
- () => {
625
- const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
626
- if (!$isTableCellNode(tableCellNode)) {
627
- throw new Error("TableCellResizer: Table cell node not found.");
628
- }
629
- const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
630
- const [tableMap] = $computeTableMapSkipCellCheck(
631
- tableNode,
632
- null,
633
- null
634
- );
635
- const columnIndex = getCellColumnIndex(tableCellNode, tableMap);
636
- if (columnIndex === void 0) {
637
- throw new Error("TableCellResizer: Table column not found.");
638
- }
639
- const colWidths = tableNode.getColWidths();
640
- if (!colWidths) {
641
- return;
642
- }
643
- const width = colWidths[columnIndex];
644
- if (width === void 0) {
645
- return;
646
- }
647
- const newColWidths = [...colWidths];
648
- const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);
649
- newColWidths[columnIndex] = newWidth;
650
- tableNode.setColWidths(newColWidths);
651
- },
652
- { tag: "skip-scroll-into-view" }
653
- );
654
- },
655
- [activeCell, editor]
656
- );
657
- const mouseUpHandler = useCallback(
658
- (direction) => {
659
- const handler = (event) => {
660
- event.preventDefault();
661
- event.stopPropagation();
662
- if (!activeCell) {
663
- throw new Error("TableCellResizer: Expected active cell.");
664
- }
665
- if (mouseStartPosRef.current) {
666
- const { x, y } = mouseStartPosRef.current;
667
- if (activeCell === null) {
668
- return;
669
- }
670
- const zoom = calculateZoomLevel(event.target);
671
- if (isHeightChanging(direction)) {
672
- const heightChange = (event.clientY - y) / zoom;
673
- updateRowHeight(heightChange);
674
- } else {
675
- const widthChange = (event.clientX - x) / zoom;
676
- updateColumnWidth(widthChange);
677
- }
678
- resetState();
679
- document.removeEventListener("mouseup", handler);
680
- }
681
- };
682
- return handler;
683
- },
684
- [activeCell, resetState, updateColumnWidth, updateRowHeight]
685
- );
686
- const toggleResize = useCallback(
687
- (direction) => (event) => {
688
- event.preventDefault();
689
- event.stopPropagation();
690
- if (!activeCell) {
691
- throw new Error("TableCellResizer: Expected active cell.");
692
- }
693
- mouseStartPosRef.current = {
694
- x: event.clientX,
695
- y: event.clientY
696
- };
697
- updateMouseCurrentPos(mouseStartPosRef.current);
698
- updateDraggingDirection(direction);
699
- document.addEventListener("mouseup", mouseUpHandler(direction));
700
- },
701
- [activeCell, mouseUpHandler]
702
- );
703
- const getResizers = useCallback(() => {
704
- if (activeCell) {
705
- const { height, width, top, left } = activeCell.elem.getBoundingClientRect();
706
- const zoom = calculateZoomLevel(activeCell.elem);
707
- const zoneWidth = 10;
708
- const styles = {
709
- bottom: {
710
- backgroundColor: "none",
711
- "zIndex": "10",
712
- cursor: "row-resize",
713
- height: `${zoneWidth}px`,
714
- left: `${window.pageXOffset + left}px`,
715
- top: `${window.pageYOffset + top + height - zoneWidth / 2}px`,
716
- width: `${width}px`
717
- },
718
- right: {
719
- backgroundColor: "none",
720
- "zIndex": "10",
721
- cursor: "col-resize",
722
- height: `${height}px`,
723
- left: `${window.pageXOffset + left + width - zoneWidth / 2}px`,
724
- top: `${window.pageYOffset + top}px`,
725
- width: `${zoneWidth}px`
726
- }
727
- };
728
- const tableRect = tableRectRef.current;
729
- if (draggingDirection && mouseCurrentPos && tableRect) {
730
- if (isHeightChanging(draggingDirection)) {
731
- styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`;
732
- styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y / zoom}px`;
733
- styles[draggingDirection].height = "3px";
734
- styles[draggingDirection].width = `${tableRect.width}px`;
735
- } else {
736
- styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`;
737
- styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x / zoom}px`;
738
- styles[draggingDirection].width = "3px";
739
- styles[draggingDirection].height = `${tableRect.height}px`;
740
- }
741
- styles[draggingDirection].backgroundColor = "#adf";
742
- }
743
- return styles;
744
- }
745
- return {
746
- bottom: null,
747
- left: null,
748
- right: null,
749
- top: null
750
- };
751
- }, [activeCell, draggingDirection, mouseCurrentPos]);
752
- const resizerStyles = getResizers();
753
- return /* @__PURE__ */ React2.createElement("div", { ref: resizerRef }, activeCell != null && !isMouseDown && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
754
- "div",
755
- {
756
- className: " absolute TableCellResizer__ui",
757
- style: resizerStyles.right || void 0,
758
- onMouseDown: toggleResize("right")
759
- }
760
- ), /* @__PURE__ */ React2.createElement(
761
- "div",
762
- {
763
- className: "absolute TableCellResizer__ui",
764
- style: resizerStyles.bottom || void 0,
765
- onMouseDown: toggleResize("bottom")
766
- }
767
- )));
768
- }
769
- function TableCellResizerPlugin() {
770
- const [editor] = useLexicalComposerContext2();
771
- const isEditable = useLexicalEditable();
772
- const [mounted, setMounted] = useState(false);
773
- useEffect3(() => {
774
- setMounted(true);
775
- }, []);
776
- const portal = useMemo(() => {
777
- if (!mounted || !isEditable) return null;
778
- return createPortal(/* @__PURE__ */ React2.createElement(TableCellResizer, { editor }), document.body);
779
- }, [mounted, isEditable, editor]);
780
- return portal;
781
- }
782
-
783
- // src/components/editor/Core.tsx
784
- import { TabIndentationPlugin } from "@lexical/react/LexicalTabIndentationPlugin";
785
- import { CheckListPlugin } from "@lexical/react/LexicalCheckListPlugin";
786
- import { ListPlugin } from "@lexical/react/LexicalListPlugin";
787
-
788
- // src/components/editor/plugins/DragDropPastePlugin/index.tsx
789
- init_react_shim();
790
- import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
791
- import { DRAG_DROP_PASTE } from "@lexical/rich-text";
792
- import { isMimeType, mediaFileReader } from "@lexical/utils";
793
- import { COMMAND_PRIORITY_LOW as COMMAND_PRIORITY_LOW2 } from "lexical";
794
- import { useEffect as useEffect4 } from "react";
795
- var ACCEPTABLE_IMAGE_TYPES = [
796
- "image/",
797
- "image/heic",
798
- "image/heif",
799
- "image/gif",
800
- "image/webp"
801
- ];
802
- function DragDropPaste() {
803
- const [editor] = useLexicalComposerContext3();
804
- useEffect4(() => {
805
- return editor.registerCommand(
806
- DRAG_DROP_PASTE,
807
- (files) => {
808
- (async () => {
809
- const filesResult = await mediaFileReader(
810
- files,
811
- [ACCEPTABLE_IMAGE_TYPES].flatMap((x) => x)
812
- );
813
- for (const { file, result } of filesResult) {
814
- if (isMimeType(file, ACCEPTABLE_IMAGE_TYPES)) {
815
- editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
816
- altText: file.name,
817
- src: result
818
- });
819
- }
820
- }
821
- })();
822
- return true;
823
- },
824
- COMMAND_PRIORITY_LOW2
295
+ const handleUpdateCardTitle = (id, title) => {
296
+ setCards(
297
+ (prev) => prev.map((c) => c.id === id ? __spreadProps(__spreadValues({}, c), { title }) : c)
825
298
  );
826
- }, [editor]);
827
- return null;
828
- }
829
-
830
- // src/components/editor/plugins/DraggableBlockPlugin/index.tsx
831
- init_react_shim();
832
- import { DraggableBlockPlugin_EXPERIMENTAL } from "@lexical/react/LexicalDraggableBlockPlugin";
833
- import { useRef as useRef2 } from "react";
834
- var DRAGGABLE_BLOCK_MENU_CLASSNAME = "draggable-block-menu";
835
- function DraggableBlockPlugin({
836
- anchorElem = document.body,
837
- className
838
- }) {
839
- const menuRef = useRef2(null);
840
- const targetLineRef = useRef2(null);
841
- const isOnMenu = (element) => {
842
- return !!element.closest(`.${DRAGGABLE_BLOCK_MENU_CLASSNAME}`);
843
299
  };
844
- return /* @__PURE__ */ React.createElement(
845
- DraggableBlockPlugin_EXPERIMENTAL,
300
+ const zoomIn = () => setScale((s) => Math.min(2.5, s + 0.15));
301
+ const zoomOut = () => setScale((s) => Math.max(0.4, s - 0.15));
302
+ const resetZoom = () => {
303
+ setScale(1);
304
+ setPan({ x: 80, y: 80 });
305
+ };
306
+ return /* @__PURE__ */ jsxs(
307
+ "div",
846
308
  {
847
- anchorElem,
848
- menuRef,
849
- targetLineRef,
850
- menuComponent: /* @__PURE__ */ React.createElement("div", { ref: menuRef, className: cn("draggable-block-menu transition-all z-50 absolute top-0 left-0", className) }, /* @__PURE__ */ React.createElement(
851
- "svg",
852
- {
853
- xmlns: "http://www.w3.org/2000/svg",
854
- className: "w-4 cursor-move rounded-sm h-4 z-50",
855
- "data-name": "Layer 1",
856
- viewBox: "0 0 24 24",
857
- fill: "currentColor"
858
- },
859
- /* @__PURE__ */ React.createElement("path", { stroke: "currentColor", d: "M8.5 10a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm0 7a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm7-10a2 2 0 1 0-2-2 2 2 0 0 0 2 2Zm-7-4a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm7 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm0-7a2 2 0 1 0 2 2 2 2 0 0 0-2-2Z" })
860
- )),
861
- targetLineComponent: /* @__PURE__ */ React.createElement(
862
- "div",
863
- {
864
- ref: targetLineRef,
865
- className: "cursor-none bg-sky-600 h-1 absolute left-0 top-0 opacity-0 will-change-transform"
866
- }
309
+ className: cn(
310
+ "relative w-full h-[calc(100vh-4rem)] overflow-hidden bg-dot-grid select-none",
311
+ isPanning ? "cursor-grabbing" : "cursor-default",
312
+ className
867
313
  ),
868
- isOnMenu
869
- }
870
- );
871
- }
872
-
873
- // src/components/editor/Core.tsx
874
- import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
875
- import { ClickableLinkPlugin } from "@lexical/react/LexicalClickableLinkPlugin";
876
-
877
- // src/components/editor/lexical-on-change.tsx
878
- init_react_shim();
879
- import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
880
-
881
- // src/components/editor/utils/useLayoutEffect.ts
882
- init_react_shim();
883
- import { useEffect as useEffect5, useLayoutEffect } from "react";
884
- var useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect5;
885
- var useLayoutEffect_default = useLayoutEffectImpl;
886
-
887
- // src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts
888
- init_react_shim();
889
- import { $getSelection as $getSelection2, $isRangeSelection as $isRangeSelection2 } from "lexical";
890
-
891
- // src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts
892
- init_react_shim();
893
-
894
- // src/components/editor/utils/getAllLexicalChildren.ts
895
- init_react_shim();
896
- import { $getNodeByKey, $getRoot } from "lexical";
897
- var getAllLexicalChildren = (editor) => {
898
- const childrenKeys = editor.getEditorState().read(() => $getRoot().getChildrenKeys());
899
- return childrenKeys.map((key) => ({
900
- key,
901
- node: $getNodeByKey(key),
902
- htmlElement: editor.getElementByKey(key)
903
- }));
904
- };
905
-
906
- // src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts
907
- init_react_shim();
908
- import { $isParagraphNode } from "lexical";
909
- import { $isHeadingNode, $isQuoteNode } from "@lexical/rich-text";
910
- import { $isListItemNode } from "@lexical/list";
911
- var getNodePlaceholder = (lexicalNode) => {
912
- let placeholder;
913
- if ($isHeadingNode(lexicalNode)) {
914
- const tag = lexicalNode.getTag();
915
- placeholder = "Heading";
916
- switch (tag) {
917
- case "h1": {
918
- placeholder += " 1";
919
- break;
920
- }
921
- case "h2": {
922
- placeholder += " 2";
923
- break;
924
- }
925
- case "h3": {
926
- placeholder += " 3";
927
- break;
928
- }
929
- case "h4": {
930
- placeholder += " 4";
931
- break;
932
- }
933
- case "h5": {
934
- placeholder += "5";
935
- break;
936
- }
937
- case "h6": {
938
- placeholder += "6";
939
- break;
940
- }
941
- }
942
- }
943
- if ($isListItemNode(lexicalNode)) {
944
- placeholder = "list";
945
- }
946
- if ($isQuoteNode(lexicalNode)) {
947
- placeholder = "Quote";
948
- }
949
- if ($isParagraphNode(lexicalNode)) {
950
- placeholder = "Press '/' for command";
951
- }
952
- return placeholder;
953
- };
954
-
955
- // src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts
956
- var PLACEHOLDER_CLASS_NAME = "node-placeholder";
957
- var isHtmlHeadingElement = (el) => {
958
- return el instanceof HTMLHeadingElement;
959
- };
960
- var setPlaceholderOnSelection = ({
961
- selection,
962
- editor
963
- }) => {
964
- const children = getAllLexicalChildren(editor);
965
- const removePlaceholderClass = (element) => {
966
- if (!element) return;
967
- if (element.classList.contains(PLACEHOLDER_CLASS_NAME)) {
968
- element.classList.remove(PLACEHOLDER_CLASS_NAME);
969
- element.removeAttribute("data-placeholder");
970
- }
971
- Array.from(element.children).forEach((child) => {
972
- if (child instanceof HTMLElement) {
973
- removePlaceholderClass(child);
974
- }
975
- });
976
- };
977
- children.forEach(({ htmlElement, node }) => {
978
- if (!htmlElement) {
979
- return;
980
- }
981
- if (isHtmlHeadingElement(htmlElement)) {
982
- return;
983
- }
984
- const classList = htmlElement.classList;
985
- if (node.__type === "collapsible-container") {
986
- removePlaceholderClass(htmlElement);
987
- return;
988
- }
989
- if (node.__type === "table") {
990
- removePlaceholderClass(htmlElement);
991
- return;
992
- }
993
- if (node.__type === "layout-container") {
994
- removePlaceholderClass(htmlElement);
995
- }
996
- if (classList.length && classList.contains(PLACEHOLDER_CLASS_NAME)) {
997
- classList.remove(PLACEHOLDER_CLASS_NAME);
998
- htmlElement.removeAttribute("data-placeholder");
999
- }
1000
- });
1001
- if (children.length === 1 && children[0].htmlElement && !isHtmlHeadingElement(children[0].htmlElement)) {
1002
- return;
1003
- }
1004
- const anchor = selection.anchor;
1005
- const placeholder = getNodePlaceholder(anchor.getNode());
1006
- if (placeholder) {
1007
- const selectedHtmlElement = editor.getElementByKey(anchor.key);
1008
- selectedHtmlElement == null ? void 0 : selectedHtmlElement.classList.add(PLACEHOLDER_CLASS_NAME);
1009
- selectedHtmlElement == null ? void 0 : selectedHtmlElement.setAttribute("data-placeholder", placeholder);
1010
- }
1011
- };
1012
-
1013
- // src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts
1014
- var setNodePlaceholderFromSelection = (editor) => {
1015
- editor.getEditorState().read(() => {
1016
- const selection = $getSelection2();
1017
- if (!$isRangeSelection2(selection)) {
1018
- return;
1019
- }
1020
- setPlaceholderOnSelection({ selection, editor });
1021
- });
1022
- };
1023
-
1024
- // src/components/editor/lexical-on-change.tsx
1025
- function LexicalOnChangePlugin() {
1026
- const [editor] = useLexicalComposerContext4();
1027
- useLayoutEffect_default(() => {
1028
- const unregisterListener = editor.registerUpdateListener(
1029
- ({ editorState, dirtyElements, dirtyLeaves, prevEditorState, tags }) => {
1030
- if (dirtyElements.size === 0 && dirtyLeaves.size === 0 || tags.has("history-merge") || prevEditorState.isEmpty()) {
1031
- return;
1032
- }
1033
- setNodePlaceholderFromSelection(editor);
1034
- }
1035
- );
1036
- return () => {
1037
- unregisterListener();
1038
- };
1039
- }, [editor]);
1040
- return /* @__PURE__ */ React.createElement(React.Fragment, null);
1041
- }
1042
-
1043
- // src/components/editor/Core.tsx
1044
- import { motion, AnimatePresence } from "framer-motion";
1045
- import { Sparkles, Lightbulb, Quote } from "lucide-react";
1046
-
1047
- // src/components/editor/plugins/ContentAnalyticsPlugin/index.tsx
1048
- init_react_shim();
1049
- import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
1050
- import { $getRoot as $getRoot2 } from "lexical";
1051
- import { useEffect as useEffect6, useState as useState2 } from "react";
1052
- import { $isHeadingNode as $isHeadingNode2 } from "@lexical/rich-text";
1053
- import { $isListNode } from "@lexical/list";
1054
- import { $isCodeNode } from "@lexical/code";
1055
- import { Clock, Eye, BarChart3, Target, BookOpen, TrendingUp, Zap, ChevronLeft, ChevronRight } from "lucide-react";
1056
- function calculateReadabilityScore(avgWordsPerSentence, avgSyllablesPerWord) {
1057
- const score = 206.835 - 1.015 * avgWordsPerSentence - 84.6 * avgSyllablesPerWord;
1058
- return Math.max(0, Math.min(100, score));
1059
- }
1060
- function calculateEngagementScore(metrics, structure) {
1061
- let score = 50;
1062
- if (metrics.wordCount >= 500 && metrics.wordCount <= 2e3) {
1063
- score += 15;
1064
- } else if (metrics.wordCount > 2e3) {
1065
- score += 10;
1066
- }
1067
- if (structure.structureScore > 70) score += 10;
1068
- if (metrics.imageCount > 0) score += 5;
1069
- if (metrics.listCount > 0) score += 5;
1070
- if (metrics.codeBlockCount > 0) score += 3;
1071
- if (metrics.readabilityScore > 60) score += 10;
1072
- if (metrics.linkCount > 0 && metrics.linkCount <= 10) score += 5;
1073
- return Math.max(0, Math.min(100, score));
1074
- }
1075
- function estimateSyllables(word) {
1076
- word = word.toLowerCase();
1077
- if (word.length <= 3) return 1;
1078
- const vowels = "aeiouy";
1079
- let syllables = 0;
1080
- let previousWasVowel = false;
1081
- for (let i = 0; i < word.length; i++) {
1082
- const isVowel = vowels.includes(word[i]);
1083
- if (isVowel && !previousWasVowel) {
1084
- syllables++;
1085
- }
1086
- previousWasVowel = isVowel;
1087
- }
1088
- if (word.endsWith("e")) syllables--;
1089
- return Math.max(1, syllables);
1090
- }
1091
- function ContentAnalyticsPlugin() {
1092
- const [editor] = useLexicalComposerContext5();
1093
- const [metrics, setMetrics] = useState2({
1094
- wordCount: 0,
1095
- readingTime: 0,
1096
- paragraphCount: 0,
1097
- headingCount: 0,
1098
- listCount: 0,
1099
- codeBlockCount: 0,
1100
- imageCount: 0,
1101
- linkCount: 0,
1102
- sentenceCount: 0,
1103
- avgWordsPerSentence: 0,
1104
- readabilityScore: 0,
1105
- engagementScore: 0
1106
- });
1107
- const [structure, setStructure] = useState2({
1108
- h1Count: 0,
1109
- h2Count: 0,
1110
- h3Count: 0,
1111
- hasIntroduction: false,
1112
- hasConclusion: false,
1113
- structureScore: 0
1114
- });
1115
- const [isVisible, setIsVisible] = useState2(false);
1116
- const [isPanelHidden, setIsPanelHidden] = useState2(false);
1117
- useEffect6(() => {
1118
- const updateMetrics = () => {
1119
- editor.read(() => {
1120
- const root = $getRoot2();
1121
- const textContent = root.getTextContent();
1122
- const words = textContent.trim().split(/\s+/).filter((word) => word.length > 0);
1123
- const wordCount = words.length;
1124
- const readingTime = Math.ceil(wordCount / 200);
1125
- let paragraphCount = 0;
1126
- let headingCount = 0;
1127
- let listCount = 0;
1128
- let codeBlockCount = 0;
1129
- let imageCount = 0;
1130
- let linkCount = 0;
1131
- let h1Count = 0;
1132
- let h2Count = 0;
1133
- let h3Count = 0;
1134
- const children = root.getChildren();
1135
- children.forEach((child) => {
1136
- if ($isHeadingNode2(child)) {
1137
- headingCount++;
1138
- const tag = child.getTag();
1139
- if (tag === "h1") h1Count++;
1140
- else if (tag === "h2") h2Count++;
1141
- else if (tag === "h3") h3Count++;
1142
- } else if ($isListNode(child)) {
1143
- listCount++;
1144
- } else if ($isCodeNode(child)) {
1145
- codeBlockCount++;
1146
- } else if (child.getType() === "paragraph") {
1147
- paragraphCount++;
1148
- }
1149
- const countInNode = (node) => {
1150
- if (node.getType() === "image" || node.getType() === "inline-image") {
1151
- imageCount++;
314
+ onMouseDown: handleMouseDownCanvas,
315
+ children: [
316
+ /* @__PURE__ */ jsxs("div", { className: "absolute top-4 left-6 z-30 flex items-center gap-2 p-1.5 rounded-xl border border-border/80 bg-background/90 text-foreground shadow-lg backdrop-blur-md", children: [
317
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "bg-primary/10 text-primary border-primary/20 px-2.5 py-1", children: "Canvas View" }),
318
+ /* @__PURE__ */ jsx("div", { className: "w-[1px] h-5 bg-border/60 mx-1" }),
319
+ /* @__PURE__ */ jsxs(
320
+ Button,
321
+ {
322
+ size: "sm",
323
+ variant: "ghost",
324
+ onClick: handleAddNote,
325
+ className: "h-8 gap-1.5 text-xs font-medium",
326
+ children: [
327
+ /* @__PURE__ */ jsx(StickyNote, { className: "w-3.5 h-3.5 text-amber-500" }),
328
+ /* @__PURE__ */ jsx("span", { children: "Add Sticky Note" })
329
+ ]
1152
330
  }
1153
- if (node.getType() === "link") {
1154
- linkCount++;
331
+ ),
332
+ /* @__PURE__ */ jsx("div", { className: "w-[1px] h-5 bg-border/60 mx-1" }),
333
+ /* @__PURE__ */ jsx(
334
+ Button,
335
+ {
336
+ size: "sm",
337
+ variant: "ghost",
338
+ onClick: zoomOut,
339
+ className: "h-8 w-8 p-0",
340
+ title: "Zoom Out",
341
+ children: /* @__PURE__ */ jsx(ZoomOut, { className: "w-4 h-4" })
1155
342
  }
1156
- if (node.getChildren) {
1157
- node.getChildren().forEach(countInNode);
343
+ ),
344
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-mono font-medium px-1", children: [
345
+ Math.round(scale * 100),
346
+ "%"
347
+ ] }),
348
+ /* @__PURE__ */ jsx(
349
+ Button,
350
+ {
351
+ size: "sm",
352
+ variant: "ghost",
353
+ onClick: zoomIn,
354
+ className: "h-8 w-8 p-0",
355
+ title: "Zoom In",
356
+ children: /* @__PURE__ */ jsx(ZoomIn, { className: "w-4 h-4" })
1158
357
  }
1159
- };
1160
- countInNode(child);
1161
- });
1162
- const sentences = textContent.split(/[.!?]+/).filter((s) => s.trim().length > 0);
1163
- const sentenceCount = sentences.length;
1164
- const avgWordsPerSentence = sentenceCount > 0 ? wordCount / sentenceCount : 0;
1165
- const totalSyllables = words.reduce((sum, word) => sum + estimateSyllables(word), 0);
1166
- const avgSyllablesPerWord = wordCount > 0 ? totalSyllables / wordCount : 0;
1167
- const readabilityScore = calculateReadabilityScore(avgWordsPerSentence, avgSyllablesPerWord);
1168
- const hasIntroduction = paragraphCount > 0;
1169
- const hasConclusion = paragraphCount > 2;
1170
- let structureScore = 0;
1171
- if (h1Count === 1) structureScore += 20;
1172
- if (h2Count >= 2) structureScore += 20;
1173
- if (hasIntroduction) structureScore += 15;
1174
- if (hasConclusion) structureScore += 15;
1175
- if (listCount > 0) structureScore += 10;
1176
- if (imageCount > 0) structureScore += 10;
1177
- if (linkCount > 0 && linkCount <= 10) structureScore += 10;
1178
- const newStructure = {
1179
- h1Count,
1180
- h2Count,
1181
- h3Count,
1182
- hasIntroduction,
1183
- hasConclusion,
1184
- structureScore
1185
- };
1186
- const newMetrics = {
1187
- wordCount,
1188
- readingTime,
1189
- paragraphCount,
1190
- headingCount,
1191
- listCount,
1192
- codeBlockCount,
1193
- imageCount,
1194
- linkCount,
1195
- sentenceCount,
1196
- avgWordsPerSentence,
1197
- readabilityScore,
1198
- engagementScore: calculateEngagementScore(
358
+ ),
359
+ /* @__PURE__ */ jsx(
360
+ Button,
1199
361
  {
1200
- wordCount,
1201
- readingTime,
1202
- paragraphCount,
1203
- headingCount,
1204
- listCount,
1205
- codeBlockCount,
1206
- imageCount,
1207
- linkCount,
1208
- sentenceCount,
1209
- avgWordsPerSentence,
1210
- readabilityScore,
1211
- engagementScore: 0
1212
- },
1213
- newStructure
1214
- )
1215
- };
1216
- setMetrics(newMetrics);
1217
- setStructure(newStructure);
1218
- });
1219
- };
1220
- const unregister = editor.registerUpdateListener(() => {
1221
- updateMetrics();
1222
- });
1223
- updateMetrics();
1224
- return unregister;
1225
- }, [editor]);
1226
- useEffect6(() => {
1227
- setIsVisible(metrics.wordCount > 10);
1228
- }, [metrics.wordCount]);
1229
- if (!isVisible) return null;
1230
- const getReadabilityLabel = (score) => {
1231
- if (score >= 90) return { label: "Very Easy", color: "bg-green-500" };
1232
- if (score >= 80) return { label: "Easy", color: "bg-green-400" };
1233
- if (score >= 70) return { label: "Fairly Easy", color: "bg-yellow-400" };
1234
- if (score >= 60) return { label: "Standard", color: "bg-yellow-500" };
1235
- if (score >= 50) return { label: "Fairly Difficult", color: "bg-orange-400" };
1236
- if (score >= 30) return { label: "Difficult", color: "bg-red-400" };
1237
- return { label: "Very Difficult", color: "bg-red-500" };
1238
- };
1239
- const getEngagementLabel = (score) => {
1240
- if (score >= 80) return { label: "Excellent", color: "text-green-600" };
1241
- if (score >= 60) return { label: "Good", color: "text-yellow-600" };
1242
- if (score >= 40) return { label: "Fair", color: "text-orange-600" };
1243
- return { label: "Needs Work", color: "text-red-600" };
1244
- };
1245
- const readability = getReadabilityLabel(metrics.readabilityScore);
1246
- const engagement = getEngagementLabel(metrics.engagementScore);
1247
- return /* @__PURE__ */ React.createElement(
1248
- "div",
1249
- {
1250
- className: cn(
1251
- "fixed top-20 right-4 z-50 transition-transform duration-300 ease-in-out",
1252
- isPanelHidden ? "translate-x-full" : "translate-x-0"
1253
- )
1254
- },
1255
- /* @__PURE__ */ React.createElement(
1256
- Button,
1257
- {
1258
- variant: "outline",
1259
- size: "sm",
1260
- onClick: () => setIsPanelHidden(!isPanelHidden),
1261
- className: cn(
1262
- "absolute top-4 -left-10 z-10 h-8 w-8 p-0 bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm shadow-lg border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800",
1263
- isPanelHidden && "-left-8"
1264
- )
1265
- },
1266
- isPanelHidden ? /* @__PURE__ */ React.createElement(ChevronLeft, { className: "w-4 h-4" }) : /* @__PURE__ */ React.createElement(ChevronRight, { className: "w-4 h-4" })
1267
- ),
1268
- /* @__PURE__ */ React.createElement("div", { className: "w-80 space-y-4" }, /* @__PURE__ */ React.createElement(Card, { className: "bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm shadow-lg border border-zinc-200 dark:border-zinc-700" }, /* @__PURE__ */ React.createElement(CardHeader, { className: "pb-3" }, /* @__PURE__ */ React.createElement(CardTitle, { className: "flex items-center justify-between text-sm font-medium" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(BarChart3, { className: "w-4 h-4" }), "Content Analytics"))), /* @__PURE__ */ React.createElement(CardContent, { className: "space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-2 gap-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(Clock, { className: "w-4 h-4 text-blue-500" }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-lg font-semibold" }, metrics.readingTime, "m"), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-muted-foreground" }, "Reading time"))), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(BookOpen, { className: "w-4 h-4 text-green-500" }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-lg font-semibold" }, metrics.wordCount), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-muted-foreground" }, "Words")))), /* @__PURE__ */ React.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(TrendingUp, { className: "w-4 h-4 text-purple-500" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium" }, "Engagement")), /* @__PURE__ */ React.createElement(Badge, { variant: "outline", className: engagement.color }, engagement.label)), /* @__PURE__ */ React.createElement(Progress, { value: metrics.engagementScore, className: "h-2" }), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-muted-foreground" }, metrics.engagementScore, "/100")), /* @__PURE__ */ React.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(Eye, { className: "w-4 h-4 text-indigo-500" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium" }, "Readability")), /* @__PURE__ */ React.createElement(Badge, { variant: "outline", className: cn("text-white", readability.color) }, readability.label)), /* @__PURE__ */ React.createElement(Progress, { value: metrics.readabilityScore, className: "h-2" }), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-muted-foreground" }, Math.round(metrics.readabilityScore), "/100 Flesch Score")))), /* @__PURE__ */ React.createElement(Card, { className: "bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm shadow-lg border border-zinc-200 dark:border-zinc-700" }, /* @__PURE__ */ React.createElement(CardHeader, { className: "pb-3" }, /* @__PURE__ */ React.createElement(CardTitle, { className: "flex items-center gap-2 text-sm font-medium" }, /* @__PURE__ */ React.createElement(Target, { className: "w-4 h-4" }), "Content Structure")), /* @__PURE__ */ React.createElement(CardContent, { className: "space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-2 gap-3 text-xs" }, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, "H1 Headers:"), /* @__PURE__ */ React.createElement("span", { className: structure.h1Count === 1 ? "text-green-600" : "text-orange-600" }, structure.h1Count)), /* @__PURE__ */ React.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, "H2 Headers:"), /* @__PURE__ */ React.createElement("span", { className: structure.h2Count >= 2 ? "text-green-600" : "text-orange-600" }, structure.h2Count)), /* @__PURE__ */ React.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, "Paragraphs:"), /* @__PURE__ */ React.createElement("span", null, metrics.paragraphCount)), /* @__PURE__ */ React.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, "Lists:"), /* @__PURE__ */ React.createElement("span", null, metrics.listCount)), /* @__PURE__ */ React.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, "Images:"), /* @__PURE__ */ React.createElement("span", null, metrics.imageCount)), /* @__PURE__ */ React.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, "Links:"), /* @__PURE__ */ React.createElement(
1269
- "span",
1270
- {
1271
- className: metrics.linkCount > 0 && metrics.linkCount <= 10 ? "text-green-600" : "text-orange-600"
1272
- },
1273
- metrics.linkCount
1274
- ))), /* @__PURE__ */ React.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium" }, "Structure Score"), /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, structure.structureScore, "/100")), /* @__PURE__ */ React.createElement(Progress, { value: structure.structureScore, className: "h-2" })))), metrics.engagementScore < 70 && /* @__PURE__ */ React.createElement(Card, { className: "bg-amber-50/95 dark:bg-amber-900/20 backdrop-blur-sm shadow-lg border border-amber-200 dark:border-amber-800" }, /* @__PURE__ */ React.createElement(CardHeader, { className: "pb-2" }, /* @__PURE__ */ React.createElement(CardTitle, { className: "flex items-center gap-2 text-sm font-medium text-amber-800 dark:text-amber-200" }, /* @__PURE__ */ React.createElement(Zap, { className: "w-4 h-4" }), "Quick Tips")), /* @__PURE__ */ React.createElement(CardContent, { className: "space-y-2" }, /* @__PURE__ */ React.createElement("div", { className: "text-xs text-amber-700 dark:text-amber-300 space-y-1" }, structure.h1Count !== 1 && /* @__PURE__ */ React.createElement("div", null, "\u2022 Use exactly one H1 header for your main title"), structure.h2Count < 2 && /* @__PURE__ */ React.createElement("div", null, "\u2022 Add more H2 headers to break up your content"), metrics.imageCount === 0 && /* @__PURE__ */ React.createElement("div", null, "\u2022 Add images to make your content more engaging"), metrics.listCount === 0 && /* @__PURE__ */ React.createElement("div", null, "\u2022 Use bullet points or numbered lists for better readability"), metrics.wordCount < 300 && /* @__PURE__ */ React.createElement("div", null, "\u2022 Consider expanding your content (aim for 500+ words)"), metrics.readabilityScore < 50 && /* @__PURE__ */ React.createElement("div", null, "\u2022 Try shorter sentences for better readability")))))
1275
- );
1276
- }
1277
-
1278
- // src/components/editor/Core.tsx
1279
- var SlashCommand = dynamic(() => import("./SlashCommand-FHEWHFZU.mjs"), { ssr: false });
1280
- var ToolbarPlugin = dynamic(() => import("./ToolbarPlugin-2VP7FDWD.mjs"), {
1281
- ssr: false,
1282
- loading: () => /* @__PURE__ */ React.createElement("div", { className: "hidden md:block w-full flex justify-center p-4" })
1283
- });
1284
- var ExportPlugin = dynamic(() => import("./ExportPlugin-V2RLM63S.mjs"), { ssr: false });
1285
- var TemplatePlugin = dynamic(() => import("./TemplatePlugin-ZD3QEVTI.mjs"), { ssr: false });
1286
- var ExcalidrawPlugin = dynamic(() => import("./ExcalidrawPlugin-HC2L43YG.mjs"), {
1287
- ssr: false
1288
- });
1289
- var FloatingLinkEditorPlugin = dynamic(() => import("./FloatingLinkEditorPlugin-TRTCMSP4.mjs"), {
1290
- ssr: false
1291
- });
1292
- var TableCellActionMenuPlugin = dynamic(() => import("./TableCellActionMenuPlugin-PGK2K3VG.mjs"), {
1293
- ssr: false
1294
- });
1295
- var TableHoverActionsPlugin = dynamic(() => import("./TableHoverActionsPlugin-GJVE6VRW.mjs"), {
1296
- ssr: false
1297
- });
1298
- var CodeActionMenuPlugin = dynamic(() => import("./CodeActionMenuPlugin-EINOY4U4.mjs"), { ssr: false });
1299
- var FloatingTextFormatToolbarPlugin = dynamic(
1300
- () => import("./FloatingTextFormatToolbarPlugin-ENECEZSX.mjs"),
1301
- { ssr: false }
1302
- );
1303
- var QUOTES = [
1304
- { text: "The best way to predict the future is to invent it.", author: "Alan Kay" },
1305
- { text: "Do not wait to strike till the iron is hot, but make it hot by striking.", author: "William Butler Yeats" },
1306
- { text: "Creativity is intelligence having fun.", author: "Albert Einstein" },
1307
- { text: "Start where you are. Use what you have. Do what you can.", author: "Arthur Ashe" },
1308
- { text: "Your time is limited, so don't waste it living someone else's life.", author: "Steve Jobs" },
1309
- { text: "The only way to do great work is to love what you do.", author: "Steve Jobs" },
1310
- { text: "Success is not the key to happiness. Happiness is the key to success.", author: "Albert Schweitzer" },
1311
- { text: "In the middle of difficulty lies opportunity.", author: "Albert Einstein" },
1312
- { text: "What we think, we become.", author: "Buddha" },
1313
- { text: "The journey of a thousand miles begins with one step.", author: "Lao Tzu" },
1314
- { text: "Believe you can and you're halfway there.", author: "Theodore Roosevelt" },
1315
- { text: "Innovation distinguishes between a leader and a follower.", author: "Steve Jobs" },
1316
- { text: "Life is what happens to you while you're busy making other plans.", author: "John Lennon" },
1317
- { text: "The future belongs to those who believe in the beauty of their dreams.", author: "Eleanor Roosevelt" },
1318
- { text: "It is during our darkest moments that we must focus to see the light.", author: "Aristotle" }
1319
- ];
1320
- function useRotatingQuote() {
1321
- const [quote, setQuote] = useState3(null);
1322
- const [isAnimating, setIsAnimating] = useState3(false);
1323
- const loadNewQuote = useCallback2(() => {
1324
- setIsAnimating(true);
1325
- setTimeout(() => {
1326
- const newQuote = QUOTES[Math.floor(Math.random() * QUOTES.length)];
1327
- setQuote(newQuote);
1328
- if (typeof window !== "undefined") {
1329
- localStorage.setItem(
1330
- "editorQuote",
1331
- JSON.stringify(__spreadProps(__spreadValues({}, newQuote), { timestamp: Date.now() }))
1332
- );
1333
- }
1334
- setIsAnimating(false);
1335
- }, 300);
1336
- }, []);
1337
- useEffect7(() => {
1338
- const loadInitialQuote = () => {
1339
- if (typeof window !== "undefined") {
1340
- const stored = localStorage.getItem("editorQuote");
1341
- if (stored) {
1342
- try {
1343
- const parsed = JSON.parse(stored);
1344
- const isRecent = Date.now() - parsed.timestamp < 3 * 60 * 60 * 1e3;
1345
- if (isRecent && parsed.text && parsed.author) {
1346
- setQuote({ text: parsed.text, author: parsed.author });
1347
- return;
362
+ size: "sm",
363
+ variant: "ghost",
364
+ onClick: resetZoom,
365
+ className: "h-8 w-8 p-0",
366
+ title: "Reset View",
367
+ children: /* @__PURE__ */ jsx(Maximize2, { className: "w-3.5 h-3.5" })
1348
368
  }
1349
- } catch (e) {
1350
- }
1351
- }
1352
- }
1353
- const newQuote = QUOTES[Math.floor(Math.random() * QUOTES.length)];
1354
- setQuote(newQuote);
1355
- };
1356
- loadInitialQuote();
1357
- const interval = setInterval(loadNewQuote, 3 * 60 * 60 * 1e3);
1358
- return () => clearInterval(interval);
1359
- }, [loadNewQuote]);
1360
- return { quote, isAnimating, loadNewQuote };
1361
- }
1362
- function EnhancedPlaceholder({ quote, isAnimating, onRefresh }) {
1363
- if (!quote) {
1364
- return /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React.createElement(
1365
- motion.div,
1366
- {
1367
- initial: { opacity: 0, scale: 0.9 },
1368
- animate: { opacity: 1, scale: 1 },
1369
- className: "flex items-center gap-3 text-gray-400"
1370
- },
1371
- /* @__PURE__ */ React.createElement(Sparkles, { className: "h-6 w-6 animate-pulse" }),
1372
- /* @__PURE__ */ React.createElement("span", { className: "text-lg italic" }, "Loading inspiration...")
1373
- ));
1374
- }
1375
- return /* @__PURE__ */ React.createElement("div", { className: "absolute md:-mt-26 -mt-56 inset-0 pointer-events-none select-none overflow-hidden" }, /* @__PURE__ */ React.createElement(
1376
- motion.div,
1377
- {
1378
- className: "relative h-full w-full",
1379
- initial: { opacity: 0 },
1380
- animate: { opacity: 1 },
1381
- transition: { duration: 0.5 }
1382
- },
1383
- /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 opacity-[0.02] dark:opacity-[0.05]" }, /* @__PURE__ */ React.createElement("div", { className: "absolute top-1/4 left-1/4 w-32 h-32 bg-gradient-to-br from-blue-400 to-purple-600 rounded-full blur-3xl" }), /* @__PURE__ */ React.createElement("div", { className: "absolute top-3/4 right-1/4 w-24 h-24 bg-gradient-to-br from-pink-400 to-orange-600 rounded-full blur-2xl" })),
1384
- /* @__PURE__ */ React.createElement("div", { className: "relative z-10 h-full flex flex-col justify-center px-4 md:px-12" }, /* @__PURE__ */ React.createElement(AnimatePresence, { mode: "wait" }, !isAnimating && /* @__PURE__ */ React.createElement(
1385
- motion.div,
1386
- {
1387
- key: quote.text,
1388
- initial: { opacity: 0, y: 20, scale: 0.95 },
1389
- animate: { opacity: 1, y: 0, scale: 1 },
1390
- exit: { opacity: 0, y: -20, scale: 0.95 },
1391
- transition: {
1392
- duration: 0.6,
1393
- ease: [0.4, 0, 0.2, 1]
1394
- },
1395
- className: "max-w-4xl"
1396
- },
1397
- /* @__PURE__ */ React.createElement(
1398
- motion.div,
1399
- {
1400
- className: "flex items-center gap-3 mb-6",
1401
- initial: { opacity: 0, x: -20 },
1402
- animate: { opacity: 1, x: 0 },
1403
- transition: { delay: 0.2 }
1404
- },
1405
- /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(Quote, { className: "h-8 w-8 text-blue-400/60 dark:text-blue-300/40" }), /* @__PURE__ */ React.createElement(
1406
- motion.div,
1407
- {
1408
- className: "absolute -top-1 -right-1 h-3 w-3 bg-gradient-to-r from-blue-400 to-purple-500 rounded-full",
1409
- animate: { scale: [1, 1.2, 1] },
1410
- transition: { duration: 2, repeat: Infinity, ease: "easeInOut" }
1411
- }
1412
- )),
1413
- /* @__PURE__ */ React.createElement("div", { className: "h-px flex-1 bg-gradient-to-r from-gray-300 to-transparent dark:from-gray-600" })
1414
- ),
1415
- /* @__PURE__ */ React.createElement(
1416
- motion.blockquote,
1417
- {
1418
- className: "text-2xl md:text-4xl lg:text-5xl font-light italic leading-relaxed text-gray-400 dark:text-gray-500 mb-6",
1419
- initial: { opacity: 0 },
1420
- animate: { opacity: 1 },
1421
- transition: { delay: 0.3, duration: 0.8 }
1422
- },
1423
- '"',
1424
- quote.text,
1425
- '"'
1426
- ),
1427
- /* @__PURE__ */ React.createElement(
1428
- motion.div,
1429
- {
1430
- className: "flex items-center gap-3",
1431
- initial: { opacity: 0, x: 20 },
1432
- animate: { opacity: 1, x: 0 },
1433
- transition: { delay: 0.5 }
1434
- },
1435
- /* @__PURE__ */ React.createElement("div", { className: "h-px flex-1 bg-gradient-to-l from-gray-300 to-transparent dark:from-gray-600" }),
1436
- /* @__PURE__ */ React.createElement("cite", { className: "text-lg md:text-xl text-gray-500 dark:text-gray-400 font-medium not-italic" }, quote.author),
1437
- /* @__PURE__ */ React.createElement(Lightbulb, { className: "h-5 w-5 text-amber-400/60 dark:text-amber-300/40" })
1438
- ),
1439
- /* @__PURE__ */ React.createElement(
1440
- motion.button,
1441
- {
1442
- onClick: onRefresh,
1443
- className: "mt-8 pointer-events-auto text-sm text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-200 flex items-center hidden md:flex gap-2 group",
1444
- whileHover: { scale: 1.05 },
1445
- whileTap: { scale: 0.95 },
1446
- initial: { opacity: 0 },
1447
- animate: { opacity: 1 },
1448
- transition: { delay: 0.8 }
1449
- },
1450
- /* @__PURE__ */ React.createElement(Sparkles, { className: "h-4 w-4 group-hover:animate-spin transition-transform" }),
1451
- /* @__PURE__ */ React.createElement("span", null, "Click for new inspiration")
1452
- )
1453
- )), isAnimating && /* @__PURE__ */ React.createElement(
1454
- motion.div,
1455
- {
1456
- initial: { opacity: 0 },
1457
- animate: { opacity: 1 },
1458
- exit: { opacity: 0 },
1459
- className: "flex items-center justify-center"
1460
- },
1461
- /* @__PURE__ */ React.createElement(
1462
- motion.div,
1463
- {
1464
- animate: { rotate: 360 },
1465
- transition: { duration: 1, repeat: Infinity, ease: "linear" }
1466
- },
1467
- /* @__PURE__ */ React.createElement(Sparkles, { className: "h-8 w-8 text-blue-400" })
1468
- ),
1469
- /* @__PURE__ */ React.createElement("span", { className: "ml-3 text-xl text-gray-400 italic" }, "Finding inspiration...")
1470
- ))
1471
- ));
1472
- }
1473
- function Core({
1474
- toolbarConfig
1475
- }) {
1476
- const { historyState } = useSharedHistoryContext();
1477
- const { quote, isAnimating, loadNewQuote } = useRotatingQuote();
1478
- const isEditable = useLexicalEditable2();
1479
- const [floatingAnchorElem, setFloatingAnchorElem] = useState3(null);
1480
- const [editor] = useLexicalComposerContext6();
1481
- const [activeEditor, setActiveEditor] = useState3(editor);
1482
- const [isLinkEditMode, setIsLinkEditMode] = useState3(false);
1483
- const [hasContent, setHasContent] = useState3(false);
1484
- const onRef = useCallback2((_floatingAnchorElem) => {
1485
- if (_floatingAnchorElem !== null) {
1486
- setFloatingAnchorElem(_floatingAnchorElem);
1487
- }
1488
- }, []);
1489
- useEffect7(() => {
1490
- const unregister = editor.registerTextContentListener((textContent) => {
1491
- setHasContent(textContent.trim().length > 0);
1492
- });
1493
- return unregister;
1494
- }, [editor]);
1495
- return /* @__PURE__ */ React.createElement(React.Fragment, null, isEditable && /* @__PURE__ */ React.createElement(
1496
- ToolbarPlugin,
1497
- {
1498
- editor,
1499
- activeEditor,
1500
- setActiveEditor,
1501
- setIsLinkEditMode,
1502
- toolbarConfig
1503
- }
1504
- ), isEditable && /* @__PURE__ */ React.createElement(ContentAnalyticsPlugin, null), /* @__PURE__ */ React.createElement("div", { className: cn(
1505
- "flex justify-center w-full min-h-screen transition-all duration-300",
1506
- "dark:md:from-gray-900/50 dark:md:to-gray-800/30",
1507
- "pt-20 md:pt-10"
1508
- ) }, /* @__PURE__ */ React.createElement(
1509
- motion.div,
1510
- {
1511
- className: cn(
1512
- "relative w-full max-w-5xl transition-all duration-500",
1513
- "prose prose-lg dark:prose-invert lg:prose-xl leading-relaxed",
1514
- "md:rounded-2xl md:shadow-2xl md:shadow-black/5",
1515
- "md:dark:shadow-black/20",
1516
- "bg-white dark:bg-gray-900",
1517
- "md:border md:border-gray-200/50 dark:md:border-gray-800/50"
1518
- )
1519
- },
1520
- /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 rounded-2xl overflow-hidden pointer-events-none" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 bg-gradient-to-br from-blue-50/30 via-transparent to-purple-50/30 dark:from-blue-900/10 dark:to-purple-900/10" }), /* @__PURE__ */ React.createElement("div", { className: "absolute top-0 left-0 w-full h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent dark:via-gray-700" })),
1521
- /* @__PURE__ */ React.createElement(
1522
- RichTextPlugin,
1523
- {
1524
- contentEditable: /* @__PURE__ */ React.createElement("div", { ref: onRef, className: "relative" }, /* @__PURE__ */ React.createElement(
1525
- ContentEditable,
1526
- {
1527
- id: "lexical-editor",
1528
- autoFocus: true,
1529
- className: cn(
1530
- "editor-content relative z-20 outline-none",
1531
- "px-4 md:px-12 py-8 md:py-16",
1532
- "min-h-[80vh] md:min-h-[70vh]",
1533
- "focus:outline-none focus:ring-0",
1534
- "text-foreground selection:bg-blue-100 dark:selection:bg-blue-900/30",
1535
- "font-['Inter',_system-ui,_sans-serif] antialiased",
1536
- "leading-relaxed tracking-wide",
1537
- "transition-all duration-200 ease-in-out",
1538
- "rounded-2xl"
369
+ ),
370
+ onClose && /* @__PURE__ */ jsxs(Fragment, { children: [
371
+ /* @__PURE__ */ jsx("div", { className: "w-[1px] h-5 bg-border/60 mx-1" }),
372
+ /* @__PURE__ */ jsx(
373
+ Button,
374
+ {
375
+ size: "sm",
376
+ variant: "outline",
377
+ onClick: onClose,
378
+ className: "h-8 text-xs font-medium",
379
+ children: "Exit Canvas"
380
+ }
1539
381
  )
1540
- }
1541
- )),
1542
- placeholder: !hasContent ? /* @__PURE__ */ React.createElement(
1543
- EnhancedPlaceholder,
382
+ ] })
383
+ ] }),
384
+ /* @__PURE__ */ jsx(
385
+ "div",
1544
386
  {
1545
- quote,
1546
- isAnimating,
1547
- onRefresh: loadNewQuote
387
+ style: {
388
+ transform: `translate(${pan.x}px, ${pan.y}px) scale(${scale})`,
389
+ transformOrigin: "0 0"
390
+ },
391
+ className: "absolute inset-0 pointer-events-none",
392
+ children: cards.map((card) => /* @__PURE__ */ jsxs(
393
+ "div",
394
+ {
395
+ style: {
396
+ position: "absolute",
397
+ left: `${card.x}px`,
398
+ top: `${card.y}px`,
399
+ width: `${card.width}px`,
400
+ minHeight: `${card.height}px`
401
+ },
402
+ className: cn(
403
+ "canvas-card pointer-events-auto rounded-xl border shadow-xl flex flex-col overflow-hidden transition-shadow duration-150",
404
+ card.color || "bg-card border-border",
405
+ activeDragId === card.id ? "ring-2 ring-primary shadow-2xl z-20 cursor-grabbing" : "hover:shadow-2xl z-10"
406
+ ),
407
+ children: [
408
+ /* @__PURE__ */ jsxs(
409
+ "div",
410
+ {
411
+ onMouseDown: (e) => handleStartCardDrag(e, card),
412
+ className: "flex items-center justify-between px-3 py-2 border-b border-border/30 bg-black/5 dark:bg-white/5 cursor-grab active:cursor-grabbing",
413
+ children: [
414
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 flex-1 mr-2", children: [
415
+ card.type === "doc" && /* @__PURE__ */ jsx(FileText, { className: "w-3.5 h-3.5 text-primary shrink-0" }),
416
+ card.type === "note" && /* @__PURE__ */ jsx(StickyNote, { className: "w-3.5 h-3.5 text-amber-500 shrink-0" }),
417
+ card.type === "board" && /* @__PURE__ */ jsx(Shapes, { className: "w-3.5 h-3.5 text-indigo-500 shrink-0" }),
418
+ /* @__PURE__ */ jsx(
419
+ "input",
420
+ {
421
+ type: "text",
422
+ value: card.title,
423
+ onChange: (e) => handleUpdateCardTitle(card.id, e.target.value),
424
+ className: "bg-transparent font-medium text-xs outline-none w-full"
425
+ }
426
+ )
427
+ ] }),
428
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: card.id !== "primary-doc" && /* @__PURE__ */ jsx(
429
+ "button",
430
+ {
431
+ onClick: () => handleDeleteCard(card.id),
432
+ className: "p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 opacity-60 hover:opacity-100 transition-opacity",
433
+ title: "Delete card",
434
+ children: /* @__PURE__ */ jsx(Trash2, { className: "w-3 h-3 text-destructive" })
435
+ }
436
+ ) })
437
+ ]
438
+ }
439
+ ),
440
+ /* @__PURE__ */ jsx("div", { className: "p-3 flex-1 flex flex-col", children: card.type === "board" ? /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col items-center justify-center border-2 border-dashed border-border/50 rounded-lg p-6 text-center text-muted-foreground text-xs gap-2", children: [
441
+ /* @__PURE__ */ jsx(Shapes, { className: "w-8 h-8 text-indigo-500/70" }),
442
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "Interactive Whiteboard" }),
443
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] max-w-[200px]", children: "Integrated with Excalidraw vector sketches and visual wireframes." })
444
+ ] }) : /* @__PURE__ */ jsx(
445
+ "textarea",
446
+ {
447
+ value: card.content,
448
+ onChange: (e) => handleUpdateCardContent(card.id, e.target.value),
449
+ className: "w-full h-full min-h-[120px] bg-transparent text-xs leading-relaxed resize-none outline-none font-sans",
450
+ placeholder: "Type your notes..."
451
+ }
452
+ ) })
453
+ ]
454
+ },
455
+ card.id
456
+ ))
1548
457
  }
1549
- ) : null,
1550
- ErrorBoundary: LexicalErrorBoundary
1551
- }
1552
- ),
1553
- /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 rounded-2xl ring-0 ring-blue-500/0 transition-all duration-300 pointer-events-none focus-within:ring-2 focus-within:ring-blue-500/20 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900" }),
1554
- /* @__PURE__ */ React.createElement(AutoFocusPlugin, { defaultSelection: "rootStart" }),
1555
- /* @__PURE__ */ React.createElement(ClearEditorPlugin, null),
1556
- /* @__PURE__ */ React.createElement(ShortcutsPlugin, { editor: activeEditor, setIsLinkEditMode }),
1557
- /* @__PURE__ */ React.createElement(LexicalOnChangePlugin, null),
1558
- /* @__PURE__ */ React.createElement(LinkPlugin, null),
1559
- /* @__PURE__ */ React.createElement(HorizontalRulePlugin, null),
1560
- /* @__PURE__ */ React.createElement(TabFocusPlugin, null),
1561
- /* @__PURE__ */ React.createElement(PollPlugin, null),
1562
- /* @__PURE__ */ React.createElement(ExcalidrawPlugin, null),
1563
- /* @__PURE__ */ React.createElement(FigmaPlugin, null),
1564
- /* @__PURE__ */ React.createElement(EquationsPlugin, null),
1565
- /* @__PURE__ */ React.createElement(SpeechToTextPlugin_default, null),
1566
- /* @__PURE__ */ React.createElement(TableCellResizerPlugin, null),
1567
- /* @__PURE__ */ React.createElement(LayoutPlugin, null),
1568
- /* @__PURE__ */ React.createElement(CollapsiblePlugin, null),
1569
- /* @__PURE__ */ React.createElement(CodeHighlightPlugin, null),
1570
- /* @__PURE__ */ React.createElement(DragDropPaste, null),
1571
- /* @__PURE__ */ React.createElement(TabIndentationPlugin, { maxIndent: 7 }),
1572
- /* @__PURE__ */ React.createElement(LexicalAutoLinkPlugin, null),
1573
- /* @__PURE__ */ React.createElement(LinkWithMetaDataPlugin, null),
1574
- /* @__PURE__ */ React.createElement(ListPlugin, null),
1575
- /* @__PURE__ */ React.createElement(LinkPlugin, null),
1576
- /* @__PURE__ */ React.createElement(StepperPlugin, null),
1577
- /* @__PURE__ */ React.createElement(TwitterPlugin, null),
1578
- /* @__PURE__ */ React.createElement(CheckListPlugin, null),
1579
- /* @__PURE__ */ React.createElement(ImagesPlugin, null),
1580
- /* @__PURE__ */ React.createElement(InlineImagePlugin, null),
1581
- /* @__PURE__ */ React.createElement(AutoEmbedPlugin, null),
1582
- /* @__PURE__ */ React.createElement(HintPlugin, null),
1583
- /* @__PURE__ */ React.createElement(YouTubePlugin, null),
1584
- /* @__PURE__ */ React.createElement(StoryBuilderPlugin, null),
1585
- /* @__PURE__ */ React.createElement(DynamicBlockPlugin, null),
1586
- /* @__PURE__ */ React.createElement(HistoryPlugin, { externalHistoryState: historyState }),
1587
- /* @__PURE__ */ React.createElement(ExportPlugin, null),
1588
- /* @__PURE__ */ React.createElement(TemplatePlugin, null),
1589
- /* @__PURE__ */ React.createElement(MarkdownShortcutPlugin, null),
1590
- /* @__PURE__ */ React.createElement(ClickableLinkPlugin, { disabled: isEditable }),
1591
- /* @__PURE__ */ React.createElement(TablePlugin, { hasCellMerge: true, hasCellBackgroundColor: true, hasHorizontalScroll: true }),
1592
- floatingAnchorElem && isEditable && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), /* @__PURE__ */ React.createElement(
1593
- FloatingLinkEditorPlugin,
1594
- {
1595
- anchorElem: floatingAnchorElem,
1596
- isLinkEditMode,
1597
- setIsLinkEditMode
1598
- }
1599
- ), /* @__PURE__ */ React.createElement(FloatingTextFormatToolbarPlugin, { setIsLinkEditMode, anchorElem: floatingAnchorElem }), /* @__PURE__ */ React.createElement(TableCellActionMenuPlugin, { anchorElem: floatingAnchorElem, cellMerge: true }), /* @__PURE__ */ React.createElement(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem }), /* @__PURE__ */ React.createElement(TableHoverActionsPlugin, { anchorElem: floatingAnchorElem })),
1600
- isEditable && /* @__PURE__ */ React.createElement(SlashCommand, null)
1601
- )));
1602
- }
1603
-
1604
- // src/components/editor/index.tsx
1605
- function Editor({
1606
- isEditable = false,
1607
- content,
1608
- aiConfig,
1609
- uploadConfig,
1610
- toolbarConfig
1611
- }) {
1612
- const initialConfig = {
1613
- namespace: "Bloger editor",
1614
- theme: editor_theme_default,
1615
- editorState: typeof content === "string" ? content : void 0,
1616
- // typeof content === "string" ? content : JSON.stringify(content),
1617
- nodes: [...nodes_default],
1618
- onError: (error) => {
1619
- throw error;
1620
- },
1621
- editable: isEditable
1622
- };
1623
- console.log("Editor content:", content);
1624
- return /* @__PURE__ */ React3.createElement(LexicalComposer, { initialConfig }, /* @__PURE__ */ React3.createElement(AIProvider, { config: aiConfig }, /* @__PURE__ */ React3.createElement(UploadProvider, { config: uploadConfig }, /* @__PURE__ */ React3.createElement(SharedHistoryContext, null, /* @__PURE__ */ React3.createElement(ToolbarContext, null, /* @__PURE__ */ React3.createElement(Core, { toolbarConfig }))))));
458
+ )
459
+ ]
460
+ }
461
+ );
1625
462
  }
1626
463
 
1627
464
  // src/styles/tailwind-plugin.ts
1628
465
  init_react_shim();
1629
466
 
1630
- // node_modules/.pnpm/tailwindcss@4.1.13/node_modules/tailwindcss/dist/plugin.mjs
467
+ // node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/plugin.mjs
1631
468
  init_react_shim();
1632
469
  function g(i, n) {
1633
470
  return { handler: i, config: n };
@@ -1641,7 +478,7 @@ g.withOptions = function(i, n = () => ({})) {
1641
478
  var u = g;
1642
479
 
1643
480
  // src/styles/tailwind-plugin.ts
1644
- var notiqPlugin = u(function({ addBase, theme: theme2 }) {
481
+ var notiqPlugin = u(function({ addBase, theme }) {
1645
482
  addBase({
1646
483
  ":root": {
1647
484
  "--background": "oklch(1 0 0)",
@@ -1770,18 +607,78 @@ var notiqPlugin = u(function({ addBase, theme: theme2 }) {
1770
607
  }
1771
608
  });
1772
609
  export {
610
+ AICommandBar,
611
+ AICopilot,
612
+ AICopilot as AIKit,
1773
613
  AIProvider,
614
+ AVATAR_PRESETS,
615
+ Audio,
616
+ Blockquote,
617
+ BlocksKit,
618
+ Bold,
619
+ BubbleMenu,
620
+ BulletList,
621
+ COLLAB_COLORS,
622
+ COLLAB_SERVER_PRESETS,
623
+ CanvasMode,
624
+ CheckList,
625
+ Code,
626
+ CodeBlock,
627
+ CollabProvider,
628
+ Collaboration,
629
+ ColumnsLayout,
630
+ CommentsProvider,
631
+ DEFAULT_DOC_ID,
1774
632
  DEFAULT_FONT_SIZE,
633
+ DEFAULT_SERVER_URL,
1775
634
  Editor,
635
+ NotiqContent as EditorContent,
636
+ Equation,
637
+ Excalidraw,
638
+ Extension,
639
+ FALLBACK_SERVER_URL,
640
+ Figma,
641
+ File,
642
+ FloatingMenu,
643
+ Heading,
644
+ HintBlock,
645
+ History,
646
+ Image,
647
+ Italic,
1776
648
  MAX_ALLOWED_FONT_SIZE,
1777
649
  MIN_ALLOWED_FONT_SIZE,
650
+ NotiqContent,
651
+ NotiqContext,
652
+ NotiqEditor,
653
+ NotiqEditorImpl,
654
+ NotiqProvider,
655
+ OfflineBanner,
656
+ OrderedList,
657
+ Paragraph,
658
+ Poll,
1778
659
  SharedHistoryContext,
660
+ StarterKit,
661
+ Stepper,
662
+ Strike,
1779
663
  ToolbarContext,
664
+ Tweet,
665
+ Underline,
1780
666
  UploadProvider,
667
+ VersionHistoryProvider,
668
+ YouTube,
1781
669
  blockTypeToBlockName,
670
+ createCanCommands,
671
+ createCommandChain,
672
+ createNotiqEditor,
1782
673
  notiqPlugin,
1783
674
  useAI,
675
+ useCollab,
676
+ useComments,
677
+ useNotiq as useEditor,
678
+ useNotiq,
679
+ useNotiqContext,
1784
680
  useSharedHistoryContext,
1785
681
  useToolbarState,
1786
- useUpload
682
+ useUpload,
683
+ useVersionHistory
1787
684
  };