@collabchron/notiq 1.1.12 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
  2. package/dist/{AIDialog-RHRYHSVN.mjs → AIDialog-HJW6PQPR.mjs} +11 -12
  3. package/dist/{AudioComponent-CKLMLB5T.mjs → AudioComponent-W5XMZPQB.mjs} +10 -6
  4. package/dist/{DynamicBlockComponent-2LOADZUX.mjs → DynamicBlockComponent-CHRL2GAQ.mjs} +7 -6
  5. package/dist/{EquationComponent-4NFG55NQ.mjs → EquationComponent-GNQHG53L.mjs} +26 -7
  6. package/dist/{ExcalidrawComponent-BMSYIPP6.mjs → ExcalidrawComponent-POMYXDSG.mjs} +33 -6
  7. package/dist/{FileComponent-Y56MX5QD.mjs → FileComponent-EOVCH4V5.mjs} +9 -5
  8. package/dist/{HintComponet-ET7M2Q7S.mjs → HintComponet-QXL5ESND.mjs} +32 -8
  9. package/dist/{InlineImageComponent-FVTA4LXZ.mjs → InlineImageComponent-KDN3VGZC.mjs} +8 -3
  10. package/dist/{StoryBuilderComponent-JN4ZPZOW.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +8 -9
  11. package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
  12. package/dist/chunk-5CJZC5IB.mjs +9086 -0
  13. package/dist/{chunk-FO7M3X2B.mjs → chunk-6NK5DONB.mjs} +1 -1
  14. package/dist/{chunk-N6ILV6NF.mjs → chunk-ACW4DLVO.mjs} +21 -7
  15. package/dist/chunk-BCGD2YXP.mjs +574 -0
  16. package/dist/{chunk-TC3IISJZ.mjs → chunk-BTR3TPIN.mjs} +18 -5
  17. package/dist/{chunk-ZYJ7KABY.mjs → chunk-CQCS5YPS.mjs} +3 -5
  18. package/dist/{chunk-T2UBAZ66.mjs → chunk-D4UBNSUW.mjs} +1 -1
  19. package/dist/{chunk-KNW2CGIP.mjs → chunk-DBRZIA43.mjs} +4 -1
  20. package/dist/{chunk-CDAMHK63.mjs → chunk-GJK2L7ZM.mjs} +23 -2
  21. package/dist/{chunk-ELBTVBTS.mjs → chunk-IKYVBTCJ.mjs} +43 -20
  22. package/dist/chunk-IXRA5D53.mjs +10447 -0
  23. package/dist/{chunk-W6VQSFE5.mjs → chunk-J2CEQXG4.mjs} +1 -1
  24. package/dist/{chunk-43Z4Z2KD.mjs → chunk-JTNLN4JI.mjs} +1 -1
  25. package/dist/{chunk-OE5JRLCN.mjs → chunk-ONOHG5NB.mjs} +6 -4
  26. package/dist/{chunk-QNIY45SF.mjs → chunk-OO42URWA.mjs} +27 -6
  27. package/dist/chunk-PBVRSNGU.mjs +129 -0
  28. package/dist/chunk-QCS57TIF.mjs +1794 -0
  29. package/dist/chunk-RNEIJRUS.mjs +60 -0
  30. package/dist/chunk-TJPTGECP.mjs +1556 -0
  31. package/dist/{chunk-XYMXGU4T.mjs → chunk-TMYRA2W4.mjs} +1 -1
  32. package/dist/{chunk-ZFV2HGD3.mjs → chunk-UNEFOZTS.mjs} +1 -1
  33. package/dist/chunk-X4NI7EQS.mjs +282 -0
  34. package/dist/{chunk-5D4JF3ZZ.mjs → chunk-XAJ4GACN.mjs} +171 -49
  35. package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
  36. package/dist/components/editor/index.d.ts +1 -1
  37. package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +1 -0
  38. package/dist/components/editor/nodes/Hint/index.d.ts +2 -1
  39. package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +73 -1
  40. package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +25 -3
  41. package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +16 -3
  42. package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +20 -25
  43. package/dist/components/editor/plugins/MarkdownPastePlugin/index.d.ts +5 -0
  44. package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +2 -0
  45. package/dist/components/editor/plugins/SlashCommand/index.d.ts +18 -1
  46. package/dist/components/editor/plugins/SmartTypographyPlugin/index.d.ts +26 -0
  47. package/dist/components/editor/utils/aiStream.d.ts +27 -0
  48. package/dist/components/editor/utils/excalidrawDiagramBuilder.d.ts +29 -0
  49. package/dist/components/editor/utils/markdownTransformers.d.ts +4 -1
  50. package/dist/components/editor/utils/url.d.ts +16 -4
  51. package/dist/components/providers/AIContext.d.ts +8 -0
  52. package/dist/components/ui/equation/equationTypography.d.ts +23 -0
  53. package/dist/core/extension.d.ts +3 -1
  54. package/dist/core/extensions/blocks-kit.d.ts +22 -1
  55. package/dist/core/extensions/copilot-and-collab.d.ts +15 -1
  56. package/dist/core/react/NotiqContent.d.ts +4 -1
  57. package/dist/core/react/index.d.ts +1 -0
  58. package/dist/core/react/node-renderers.d.ts +73 -0
  59. package/dist/core.js +15429 -13116
  60. package/dist/core.mjs +47 -39
  61. package/dist/hooks/instructions-messages.d.ts +13 -4
  62. package/dist/{image-QPB2CVXP.mjs → image-AL6PHM2A.mjs} +17 -12
  63. package/dist/index.js +15526 -13194
  64. package/dist/index.mjs +64 -60
  65. package/dist/{insert-audio-I3PD6JFS.mjs → insert-audio-CRWR7EO5.mjs} +4 -6
  66. package/dist/{insert-file-PHR7XL4V.mjs → insert-file-I73AZW3L.mjs} +4 -6
  67. package/dist/{insert-gif-R5ZO4JHC.mjs → insert-gif-KWRC3ACT.mjs} +1 -1
  68. package/dist/{insert-image-PLBZELHK.mjs → insert-image-XIY6BGW5.mjs} +4 -3
  69. package/dist/{insert-poll-6BCIFY5G.mjs → insert-poll-J5YVZNZ4.mjs} +4 -3
  70. package/dist/{insert-table-ZRJP6X52.mjs → insert-table-OIMJRFFK.mjs} +1 -1
  71. package/dist/{poll-component-VHMM5KKZ.mjs → poll-component-TVHXIKGQ.mjs} +3 -2
  72. package/dist/react.js +14747 -12554
  73. package/dist/react.mjs +40 -38
  74. package/dist/{stepper-KNITDVLG.mjs → stepper-ILF7YXTO.mjs} +63 -73
  75. package/dist/styles/notiq.css +1 -1
  76. package/package.json +2 -2
  77. package/src/styles/notiq.css +20 -0
  78. package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +0 -12
  79. package/dist/CodeActionMenuPlugin-FGH6HZLL.mjs +0 -14
  80. package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
  81. package/dist/CollaboratorsBar-AMPIAUOY.mjs +0 -20
  82. package/dist/CommentsPlugin-SDJJTUGK.mjs +0 -19
  83. package/dist/ExcalidrawPlugin-QLPGJPSX.mjs +0 -14
  84. package/dist/ExportPlugin-MJHYKQZJ.mjs +0 -43
  85. package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
  86. package/dist/FloatingTextFormatToolbarPlugin-BXCPN3KD.mjs +0 -45
  87. package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
  88. package/dist/MobileToolbar-KV5DX4ED.mjs +0 -982
  89. package/dist/SlashCommand-SPR7G5EI.mjs +0 -39
  90. package/dist/TableCellActionMenuPlugin-YWBA64J7.mjs +0 -838
  91. package/dist/TableHoverActionsPlugin-2EIXHEXN.mjs +0 -265
  92. package/dist/TemplatePlugin-HNTPEXBB.mjs +0 -9
  93. package/dist/ToolbarPlugin-F52PVNXU.mjs +0 -823
  94. package/dist/VersionHistoryPlugin-YWGCREKA.mjs +0 -371
  95. package/dist/background-color-RW5JYLMG.mjs +0 -425
  96. package/dist/block-format-TODFREE2.mjs +0 -14
  97. package/dist/chunk-22ZIL6NH.mjs +0 -88
  98. package/dist/chunk-2LNT36RL.mjs +0 -555
  99. package/dist/chunk-37LC44W3.mjs +0 -2677
  100. package/dist/chunk-3IILA3IP.mjs +0 -28
  101. package/dist/chunk-4DVIYZVB.mjs +0 -193
  102. package/dist/chunk-4FFTOZGJ.mjs +0 -103
  103. package/dist/chunk-4UMUPCDK.mjs +0 -68
  104. package/dist/chunk-6D6QLRYR.mjs +0 -238
  105. package/dist/chunk-6FQFPPLG.mjs +0 -785
  106. package/dist/chunk-ACV47ZKE.mjs +0 -201
  107. package/dist/chunk-BGV62GC2.mjs +0 -26
  108. package/dist/chunk-C4JWLBYN.mjs +0 -132
  109. package/dist/chunk-CLRSETYQ.mjs +0 -431
  110. package/dist/chunk-D3IOUQFR.mjs +0 -441
  111. package/dist/chunk-EEBA6OAH.mjs +0 -59
  112. package/dist/chunk-EIZMKFHF.mjs +0 -32
  113. package/dist/chunk-ENH2IOHI.mjs +0 -1828
  114. package/dist/chunk-EVPWKNE4.mjs +0 -27
  115. package/dist/chunk-HOZ4QRFV.mjs +0 -536
  116. package/dist/chunk-IAFCQV3Z.mjs +0 -349
  117. package/dist/chunk-J6ZUY5BY.mjs +0 -202
  118. package/dist/chunk-K5OAFEVY.mjs +0 -191
  119. package/dist/chunk-KXRLARGI.mjs +0 -26
  120. package/dist/chunk-LBGM4VVZ.mjs +0 -409
  121. package/dist/chunk-LLGVCM7M.mjs +0 -809
  122. package/dist/chunk-LU2XWLOE.mjs +0 -219
  123. package/dist/chunk-LVRJM45C.mjs +0 -171
  124. package/dist/chunk-MSAO3YFB.mjs +0 -144
  125. package/dist/chunk-N3KDPSRI.mjs +0 -496
  126. package/dist/chunk-OXWTZV3U.mjs +0 -174
  127. package/dist/chunk-PD5K4AGP.mjs +0 -64
  128. package/dist/chunk-PFH63ZU4.mjs +0 -33
  129. package/dist/chunk-R7WFRENU.mjs +0 -262
  130. package/dist/chunk-RAVYEEIC.mjs +0 -36
  131. package/dist/chunk-RJQTA6HG.mjs +0 -358
  132. package/dist/chunk-SAOJHVPE.mjs +0 -153
  133. package/dist/chunk-SYUCM5G5.mjs +0 -111
  134. package/dist/chunk-VGAX6YEY.mjs +0 -399
  135. package/dist/chunk-VNDDDXGH.mjs +0 -682
  136. package/dist/chunk-WUVIQCX7.mjs +0 -944
  137. package/dist/chunk-XNJNT6PC.mjs +0 -1701
  138. package/dist/chunk-XYLTLGY5.mjs +0 -775
  139. package/dist/chunk-ZKZ7MLSS.mjs +0 -165
  140. package/dist/color-S55XFDYQ.mjs +0 -13
  141. package/dist/font-IJKFR4BM.mjs +0 -12
  142. package/dist/font-size-3HMJHKO2.mjs +0 -15
  143. package/dist/insert-node-DGCZBGKG.mjs +0 -243
  144. package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
  145. package/dist/text-align-TEB4S52S.mjs +0 -121
  146. package/dist/text-format-T3IY7FBI.mjs +0 -15
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import {
3
+ AICommandBarPlugin,
4
+ OPEN_AI_COMMAND_BAR_COMMAND,
5
+ extractThinkingAndSources
6
+ } from "./chunk-TJPTGECP.mjs";
7
+ import "./chunk-BCGD2YXP.mjs";
8
+ import "./chunk-D4UBNSUW.mjs";
9
+ import "./chunk-JTNLN4JI.mjs";
10
+ import "./chunk-QCS57TIF.mjs";
11
+ import "./chunk-ACW4DLVO.mjs";
12
+ import "./chunk-TMYRA2W4.mjs";
13
+ import "./chunk-UNEFOZTS.mjs";
14
+ import "./chunk-NBE6FF6L.mjs";
15
+ import "./chunk-IKYVBTCJ.mjs";
16
+ import "./chunk-X4NI7EQS.mjs";
17
+ import "./chunk-OO42URWA.mjs";
18
+ import "./chunk-DBRZIA43.mjs";
19
+ import "./chunk-YVUQRJVV.mjs";
20
+ import "./chunk-RNEIJRUS.mjs";
21
+ import "./chunk-JHXDLYEV.mjs";
22
+ import "./chunk-WYCFGRFJ.mjs";
23
+ export {
24
+ OPEN_AI_COMMAND_BAR_COMMAND,
25
+ AICommandBarPlugin as default,
26
+ extractThinkingAndSources
27
+ };
@@ -3,24 +3,23 @@ import {
3
3
  ExtractData,
4
4
  getSelectedText,
5
5
  insertText
6
- } from "./chunk-ZYJ7KABY.mjs";
7
- import "./chunk-4DVIYZVB.mjs";
8
- import "./chunk-LLGVCM7M.mjs";
9
- import "./chunk-VGAX6YEY.mjs";
10
- import "./chunk-N6ILV6NF.mjs";
11
- import "./chunk-XYMXGU4T.mjs";
12
- import "./chunk-ZFV2HGD3.mjs";
6
+ } from "./chunk-CQCS5YPS.mjs";
7
+ import "./chunk-QCS57TIF.mjs";
8
+ import "./chunk-ACW4DLVO.mjs";
9
+ import "./chunk-TMYRA2W4.mjs";
10
+ import "./chunk-UNEFOZTS.mjs";
13
11
  import "./chunk-NBE6FF6L.mjs";
14
- import "./chunk-ELBTVBTS.mjs";
15
12
  import {
16
13
  Input
17
14
  } from "./chunk-5NRAXWYA.mjs";
18
- import "./chunk-QNIY45SF.mjs";
15
+ import "./chunk-IKYVBTCJ.mjs";
16
+ import "./chunk-OO42URWA.mjs";
19
17
  import {
20
18
  Button
21
- } from "./chunk-OE5JRLCN.mjs";
22
- import "./chunk-KNW2CGIP.mjs";
23
- import "./chunk-7QRJVZQY.mjs";
19
+ } from "./chunk-ONOHG5NB.mjs";
20
+ import "./chunk-DBRZIA43.mjs";
21
+ import "./chunk-YVUQRJVV.mjs";
22
+ import "./chunk-RNEIJRUS.mjs";
24
23
  import {
25
24
  cn
26
25
  } from "./chunk-JHXDLYEV.mjs";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  $isAudioNode
4
- } from "./chunk-XYMXGU4T.mjs";
4
+ } from "./chunk-TMYRA2W4.mjs";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-JHXDLYEV.mjs";
@@ -14,6 +14,7 @@ init_react_shim();
14
14
  import { useState, useRef, useEffect, useCallback } from "react";
15
15
  import { BlockWithAlignableContents } from "@lexical/react/LexicalBlockWithAlignableContents";
16
16
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
17
+ import { useLexicalEditable } from "@lexical/react/useLexicalEditable";
17
18
  import { $getNodeByKey } from "lexical";
18
19
  import {
19
20
  Play,
@@ -41,6 +42,7 @@ function AudioComponent({
41
42
  author: initialAuthor
42
43
  }) {
43
44
  const [editor] = useLexicalComposerContext();
45
+ const isEditable = useLexicalEditable();
44
46
  const audioRef = useRef(null);
45
47
  const [isPlaying, setIsPlaying] = useState(false);
46
48
  const [currentTime, setCurrentTime] = useState(0);
@@ -174,11 +176,13 @@ function AudioComponent({
174
176
  ] }) : /* @__PURE__ */ jsxs(
175
177
  "div",
176
178
  {
177
- onDoubleClick: () => setIsEditingTitle(true),
178
- className: "cursor-pointer group/title",
179
- title: "Double click to edit title",
179
+ onDoubleClick: () => {
180
+ if (isEditable) setIsEditingTitle(true);
181
+ },
182
+ className: cn(isEditable ? "cursor-pointer group/title" : ""),
183
+ title: isEditable ? "Double click to edit title" : void 0,
180
184
  children: [
181
- /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-foreground group-hover/title:text-primary transition-colors", children: title }),
185
+ /* @__PURE__ */ jsx("p", { className: cn("truncate text-sm font-semibold text-foreground transition-colors", isEditable && "group-hover/title:text-primary"), children: title }),
182
186
  /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] text-muted-foreground", children: author })
183
187
  ]
184
188
  }
@@ -220,7 +224,7 @@ function AudioComponent({
220
224
  children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
221
225
  }
222
226
  ),
223
- /* @__PURE__ */ jsx(
227
+ isEditable && /* @__PURE__ */ jsx(
224
228
  "button",
225
229
  {
226
230
  type: "button",
@@ -10,10 +10,10 @@ import {
10
10
  } from "./chunk-AMXRQ2TK.mjs";
11
11
  import {
12
12
  DynamicBlockNode
13
- } from "./chunk-43Z4Z2KD.mjs";
13
+ } from "./chunk-JTNLN4JI.mjs";
14
14
  import {
15
15
  Button
16
- } from "./chunk-OE5JRLCN.mjs";
16
+ } from "./chunk-ONOHG5NB.mjs";
17
17
  import {
18
18
  cn
19
19
  } from "./chunk-JHXDLYEV.mjs";
@@ -28,10 +28,11 @@ import { useState, useEffect, useRef } from "react";
28
28
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
29
29
  import { $getNodeByKey } from "lexical";
30
30
  import { Play, Pause, Settings, Eye, EyeOff, Zap } from "lucide-react";
31
- import { jsx, jsxs } from "react/jsx-runtime";
31
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
32
32
  function DynamicBlockComponent({ nodeKey, payload }) {
33
33
  var _a;
34
34
  const [editor] = useLexicalComposerContext();
35
+ const isEditable = editor.isEditable();
35
36
  const [currentBlockId, setCurrentBlockId] = useState(payload.currentBlockId || ((_a = payload.blocks[0]) == null ? void 0 : _a.id));
36
37
  const [isPreviewMode, setIsPreviewMode] = useState(false);
37
38
  const [isPlaying, setIsPlaying] = useState(false);
@@ -147,14 +148,14 @@ function DynamicBlockComponent({ nodeKey, payload }) {
147
148
  /* @__PURE__ */ jsx(CardTitle, { className: "text-lg font-semibold", children: payload.title }),
148
149
  /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: "Dynamic Block" })
149
150
  ] }),
150
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
151
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: isEditable && /* @__PURE__ */ jsxs(Fragment, { children: [
151
152
  /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setIsPreviewMode(!isPreviewMode), className: "h-8 px-2", children: [
152
153
  isPreviewMode ? /* @__PURE__ */ jsx(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" }),
153
154
  isPreviewMode ? "Edit" : "Preview"
154
155
  ] }),
155
156
  isPreviewMode && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => setIsPlaying(!isPlaying), className: "h-8 px-2", children: isPlaying ? /* @__PURE__ */ jsx(Pause, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Play, { className: "w-4 h-4" }) }),
156
157
  /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => setShowSettings(!showSettings), className: "h-8 px-2", children: /* @__PURE__ */ jsx(Settings, { className: "w-4 h-4" }) })
157
- ] })
158
+ ] }) })
158
159
  ] }) }),
159
160
  /* @__PURE__ */ jsxs(CardContent, { ref: containerRef, className: "space-y-4", children: [
160
161
  /* @__PURE__ */ jsx("div", { className: "min-h-[200px] p-4 rounded-lg border bg-card/50 relative overflow-hidden", children: currentBlock ? /* @__PURE__ */ jsx("div", { className: "transition-all duration-300 ease-in-out", children: renderContentBlock(currentBlock) }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
@@ -162,7 +163,7 @@ function DynamicBlockComponent({ nodeKey, payload }) {
162
163
  /* @__PURE__ */ jsx("p", { children: "No content block selected" }),
163
164
  /* @__PURE__ */ jsx("p", { className: "text-sm", children: "Configure blocks and triggers below" })
164
165
  ] }) }) }),
165
- !isPreviewMode && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
166
+ !isPreviewMode && isEditable && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
166
167
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
167
168
  /* @__PURE__ */ jsxs("h4", { className: "font-medium text-sm", children: [
168
169
  "Content Blocks (",
@@ -1,9 +1,10 @@
1
1
  import {
2
- KatexRenderer
3
- } from "./chunk-4UMUPCDK.mjs";
2
+ KatexRenderer,
3
+ handleEquationInputChange
4
+ } from "./chunk-PBVRSNGU.mjs";
4
5
  import {
5
6
  $isEquationNode
6
- } from "./chunk-KNW2CGIP.mjs";
7
+ } from "./chunk-DBRZIA43.mjs";
7
8
  import {
8
9
  init_react_shim
9
10
  } from "./chunk-WYCFGRFJ.mjs";
@@ -33,9 +34,9 @@ import { forwardRef } from "react";
33
34
  import { jsx, jsxs } from "react/jsx-runtime";
34
35
  function EquationEditor({ equation, setEquation, inline }, forwardedRef) {
35
36
  const onChange = (event) => {
36
- setEquation(event.target.value);
37
+ handleEquationInputChange(event.target, setEquation);
37
38
  };
38
- return inline && isHTMLElement(forwardedRef) ? /* @__PURE__ */ jsxs("span", { className: "EquationEditor_inputBackground", children: [
39
+ return inline && isHTMLElement(forwardedRef) ? /* @__PURE__ */ jsxs("span", { className: "EquationEditor_inputBackground relative inline-flex items-center", children: [
39
40
  /* @__PURE__ */ jsx("span", { className: "EquationEditor_dollarSign", children: "$" }),
40
41
  /* @__PURE__ */ jsx(
41
42
  "input",
@@ -47,7 +48,16 @@ function EquationEditor({ equation, setEquation, inline }, forwardedRef) {
47
48
  ref: forwardedRef
48
49
  }
49
50
  ),
50
- /* @__PURE__ */ jsx("span", { className: "EquationEditor_dollarSign", children: "$" })
51
+ /* @__PURE__ */ jsx("span", { className: "EquationEditor_dollarSign", children: "$" }),
52
+ equation.trim() && /* @__PURE__ */ jsx(
53
+ "span",
54
+ {
55
+ "aria-hidden": "true",
56
+ className: "pointer-events-none absolute left-0 top-full mt-1.5 z-50 rounded-lg border border-border/70 bg-popover/95 px-2.5 py-1 text-popover-foreground shadow-md backdrop-blur-sm whitespace-nowrap",
57
+ children: /* @__PURE__ */ jsx(KatexRenderer, { equation, inline: true, onDoubleClick: () => {
58
+ } })
59
+ }
60
+ )
51
61
  ] }) : /* @__PURE__ */ jsxs("div", { className: "EquationEditor_inputBackground", children: [
52
62
  /* @__PURE__ */ jsx("span", { className: "EquationEditor_dollarSign", children: "$$\n" }),
53
63
  /* @__PURE__ */ jsx(
@@ -59,7 +69,16 @@ function EquationEditor({ equation, setEquation, inline }, forwardedRef) {
59
69
  ref: forwardedRef
60
70
  }
61
71
  ),
62
- /* @__PURE__ */ jsx("span", { className: "EquationEditor_dollarSign", children: "\n$$" })
72
+ /* @__PURE__ */ jsx("span", { className: "EquationEditor_dollarSign", children: "\n$$" }),
73
+ equation.trim() && /* @__PURE__ */ jsx(
74
+ "div",
75
+ {
76
+ "aria-hidden": "true",
77
+ className: "pointer-events-none mt-2 border-t border-border/50 pt-2 text-center",
78
+ children: /* @__PURE__ */ jsx(KatexRenderer, { equation, inline: false, onDoubleClick: () => {
79
+ } })
80
+ }
81
+ )
63
82
  ] });
64
83
  }
65
84
  var EquationEditor_default = forwardRef(EquationEditor);
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  ExcalidrawModal
3
- } from "./chunk-TC3IISJZ.mjs";
3
+ } from "./chunk-BTR3TPIN.mjs";
4
4
  import "./chunk-H3P47YXJ.mjs";
5
5
  import {
6
6
  $isExcalidrawNode
7
- } from "./chunk-QNIY45SF.mjs";
8
- import "./chunk-OE5JRLCN.mjs";
7
+ } from "./chunk-OO42URWA.mjs";
8
+ import "./chunk-ONOHG5NB.mjs";
9
+ import "./chunk-RNEIJRUS.mjs";
9
10
  import {
10
11
  cn
11
12
  } from "./chunk-JHXDLYEV.mjs";
@@ -34,7 +35,6 @@ import { Pencil, Trash2, Palette, Maximize2 } from "lucide-react";
34
35
 
35
36
  // src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx
36
37
  init_react_shim();
37
- import { exportToSvg } from "@excalidraw/excalidraw";
38
38
  import { useEffect, useState } from "react";
39
39
  import { useTheme } from "next-themes";
40
40
  import { jsx } from "react/jsx-runtime";
@@ -62,19 +62,24 @@ function ExcalidrawImage({
62
62
  }) {
63
63
  var _a;
64
64
  const [Svg, setSvg] = useState(null);
65
+ const [exportFailed, setExportFailed] = useState(false);
65
66
  const { resolvedTheme } = useTheme();
66
67
  const isDarkMode = resolvedTheme === "dark";
67
68
  useEffect(() => {
68
69
  let isCancelled = false;
70
+ setExportFailed(false);
69
71
  const setContent = async () => {
70
72
  try {
73
+ if (typeof window === "undefined") return;
74
+ const { exportToSvg } = await import("@excalidraw/excalidraw");
71
75
  const svg = await exportToSvg({
72
76
  appState: __spreadProps(__spreadValues({}, appState), {
73
77
  exportWithDarkMode: isDarkMode,
74
78
  exportBackground: false
75
79
  }),
76
80
  elements,
77
- files
81
+ files,
82
+ skipInliningFonts: true
78
83
  });
79
84
  if (isCancelled) return;
80
85
  removeStyleFromSvg_HACK(svg);
@@ -86,6 +91,9 @@ function ExcalidrawImage({
86
91
  setSvg(svg);
87
92
  } catch (err) {
88
93
  console.error("Failed to export Excalidraw preview SVG", err);
94
+ if (!isCancelled) {
95
+ setExportFailed(true);
96
+ }
89
97
  }
90
98
  };
91
99
  if (elements && elements.length > 0) {
@@ -104,6 +112,21 @@ function ExcalidrawImage({
104
112
  if (height !== "inherit") {
105
113
  containerStyle.height = `${height}px`;
106
114
  }
115
+ if (exportFailed) {
116
+ return /* @__PURE__ */ jsx(
117
+ "div",
118
+ {
119
+ ref: (node) => {
120
+ if (node && imageContainerRef) {
121
+ imageContainerRef.current = node;
122
+ }
123
+ },
124
+ className: rootClassName != null ? rootClassName : "relative flex items-center justify-center overflow-hidden min-h-[140px] min-w-[260px] px-4 py-3 text-xs text-muted-foreground",
125
+ style: containerStyle,
126
+ children: /* @__PURE__ */ jsx("span", { children: "Excalidraw preview unavailable \xB7 Double-click to open" })
127
+ }
128
+ );
129
+ }
107
130
  return /* @__PURE__ */ jsx(
108
131
  "div",
109
132
  {
@@ -513,7 +536,11 @@ function ExcalidrawComponent({
513
536
  appState = {}
514
537
  } = useMemo(() => {
515
538
  try {
516
- return JSON.parse(data);
539
+ const parsed = JSON.parse(data);
540
+ if (Array.isArray(parsed)) {
541
+ return { elements: parsed, files: {}, appState: {} };
542
+ }
543
+ return parsed || { elements: [], files: {}, appState: {} };
517
544
  } catch (e) {
518
545
  return { elements: [], files: {}, appState: {} };
519
546
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  $isFileNode
4
- } from "./chunk-ZFV2HGD3.mjs";
4
+ } from "./chunk-UNEFOZTS.mjs";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-JHXDLYEV.mjs";
@@ -14,6 +14,7 @@ init_react_shim();
14
14
  import { useState, useCallback } from "react";
15
15
  import { BlockWithAlignableContents } from "@lexical/react/LexicalBlockWithAlignableContents";
16
16
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
17
+ import { useLexicalEditable } from "@lexical/react/useLexicalEditable";
17
18
  import { $getNodeByKey } from "lexical";
18
19
  import {
19
20
  FileText,
@@ -95,6 +96,7 @@ function FileComponent({
95
96
  extension: initialExtension
96
97
  }) {
97
98
  const [editor] = useLexicalComposerContext();
99
+ const isEditable = useLexicalEditable();
98
100
  const [title, setTitle] = useState(initialTitle || "Untitled File");
99
101
  const [isEditing, setIsEditing] = useState(false);
100
102
  const inferredExtension = initialExtension || url.split("?")[0].split("#")[0].split(".").pop() || "file";
@@ -143,9 +145,11 @@ function FileComponent({
143
145
  ) : /* @__PURE__ */ jsx(
144
146
  "p",
145
147
  {
146
- onDoubleClick: () => setIsEditing(true),
147
- className: "truncate text-sm font-medium text-foreground hover:text-primary transition-colors cursor-pointer",
148
- title: "Double click to rename",
148
+ onDoubleClick: () => {
149
+ if (isEditable) setIsEditing(true);
150
+ },
151
+ className: cn("truncate text-sm font-medium text-foreground transition-colors", isEditable ? "hover:text-primary cursor-pointer" : "cursor-default"),
152
+ title: isEditable ? "Double click to rename" : void 0,
149
153
  children: title
150
154
  }
151
155
  ),
@@ -182,7 +186,7 @@ function FileComponent({
182
186
  children: /* @__PURE__ */ jsx(ExternalLink, { className: "h-3.5 w-3.5" })
183
187
  }
184
188
  ),
185
- /* @__PURE__ */ jsx(
189
+ isEditable && /* @__PURE__ */ jsx(
186
190
  "button",
187
191
  {
188
192
  type: "button",
@@ -1,20 +1,23 @@
1
1
  "use client";
2
- import {
3
- $isHintNode
4
- } from "./chunk-7QRJVZQY.mjs";
5
2
  import {
6
3
  Popover,
7
4
  PopoverContent,
8
5
  PopoverTrigger
9
6
  } from "./chunk-IIVB6JNE.mjs";
10
- import "./chunk-JHXDLYEV.mjs";
7
+ import {
8
+ $isHintNode
9
+ } from "./chunk-YVUQRJVV.mjs";
10
+ import "./chunk-RNEIJRUS.mjs";
11
+ import {
12
+ cn
13
+ } from "./chunk-JHXDLYEV.mjs";
11
14
  import {
12
15
  init_react_shim
13
16
  } from "./chunk-WYCFGRFJ.mjs";
14
17
 
15
18
  // src/components/editor/nodes/Hint/HintComponet.tsx
16
19
  init_react_shim();
17
- import { useState } from "react";
20
+ import { useState, useEffect } from "react";
18
21
  import { $getNodeByKey, ParagraphNode, TextNode } from "lexical";
19
22
  import { LinkNode } from "@lexical/link";
20
23
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
@@ -138,6 +141,24 @@ function HintComponent({
138
141
  }) {
139
142
  const [editor] = useLexicalComposerContext();
140
143
  const [isPopoverOpen, setPopoverOpen] = useState(false);
144
+ const isEditable = editor.isEditable();
145
+ useEffect(() => {
146
+ if (captionEditor && typeof captionEditor.setEditable === "function") {
147
+ captionEditor.setEditable(isEditable);
148
+ }
149
+ }, [captionEditor, isEditable]);
150
+ useEffect(() => {
151
+ if (!captionEditor) return;
152
+ return captionEditor.registerUpdateListener(({ dirtyElements, dirtyLeaves }) => {
153
+ if (dirtyElements.size === 0 && dirtyLeaves.size === 0) return;
154
+ editor.update(() => {
155
+ const node = $getNodeByKey(nodeKey);
156
+ if ($isHintNode(node)) {
157
+ node.getWritable();
158
+ }
159
+ });
160
+ });
161
+ }, [captionEditor, editor, nodeKey]);
141
162
  const normalizedKey = VARIANT_KEY_MAP[type] || "tip";
142
163
  const config = CALLOUT_VARIANTS[normalizedKey] || CALLOUT_VARIANTS.tip;
143
164
  function handleSelectVariant(newVariant) {
@@ -255,9 +276,12 @@ function HintComponent({
255
276
  contentEditable: /* @__PURE__ */ jsx(
256
277
  ContentEditable,
257
278
  {
258
- className: "w-full border-0 resize-none cursor-text block relative outline-none select-text whitespace-pre-wrap break-words text-sm sm:text-[15px] leading-relaxed",
259
- "aria-placeholder": "Write a callout note...",
260
- placeholder: /* @__PURE__ */ jsx("div", { className: "text-sm sm:text-[15px] text-zinc-400/80 dark:text-zinc-500/80 overflow-hidden absolute top-0 left-0 select-none whitespace-nowrap text-ellipsis pointer-events-none", children: "Write a callout note..." })
279
+ className: cn(
280
+ "w-full border-0 resize-none block relative outline-none select-text whitespace-pre-wrap break-words text-sm sm:text-[15px] leading-relaxed",
281
+ isEditable ? "cursor-text" : "cursor-default select-text"
282
+ ),
283
+ "aria-placeholder": isEditable ? "Write a callout note..." : "",
284
+ placeholder: (isEditable2) => isEditable2 ? /* @__PURE__ */ jsx("div", { className: "text-sm sm:text-[15px] text-zinc-400/80 dark:text-zinc-500/80 overflow-hidden absolute top-0 left-0 select-none whitespace-nowrap text-ellipsis pointer-events-none", children: "Write a callout note..." }) : null
261
285
  }
262
286
  ),
263
287
  placeholder: null,
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-IUOUIDEQ.mjs";
7
7
  import {
8
8
  validateUrl
9
- } from "./chunk-RAVYEEIC.mjs";
9
+ } from "./chunk-X4NI7EQS.mjs";
10
10
  import {
11
11
  Button
12
- } from "./chunk-OE5JRLCN.mjs";
12
+ } from "./chunk-ONOHG5NB.mjs";
13
13
  import "./chunk-JHXDLYEV.mjs";
14
14
  import {
15
15
  init_react_shim
@@ -427,6 +427,11 @@ function InlineImageComponent({
427
427
  };
428
428
  }, [clearSelection, editor, isSelected, nodeKey, $onEnter, $onEscape, setSelected]);
429
429
  const draggable = isSelected && $isNodeSelection(selection);
430
+ useEffect2(() => {
431
+ if (caption && typeof caption.setEditable === "function") {
432
+ caption.setEditable(isEditable);
433
+ }
434
+ }, [caption, isEditable]);
430
435
  const isFocused = isSelected && isEditable;
431
436
  return /* @__PURE__ */ jsxs2(Suspense, { fallback: null, children: [
432
437
  /* @__PURE__ */ jsxs2(Fragment, { children: [
@@ -464,7 +469,7 @@ function InlineImageComponent({
464
469
  contentEditable: /* @__PURE__ */ jsx5(
465
470
  LexicalContentEditable,
466
471
  {
467
- placeholder: "Enter a caption...",
472
+ placeholder: isEditable ? "Enter a caption..." : "",
468
473
  placeholderClassName: "text-xs text-muted-foreground absolute bottom-2.5 left-2.5 pointer-events-none select-none whitespace-nowrap inline-block overflow-hidden text-ellipsis",
469
474
  className: "min-h-5 border-0 resize-none cursor-text block relative outline-none p-2.5 select-text text-sm leading-relaxed w-full whitespace-pre-wrap break-words"
470
475
  }
@@ -5,23 +5,21 @@ import {
5
5
  CardHeader,
6
6
  CardTitle
7
7
  } from "./chunk-YR2DD74C.mjs";
8
+ import {
9
+ Badge
10
+ } from "./chunk-AMXRQ2TK.mjs";
8
11
  import {
9
12
  Textarea
10
13
  } from "./chunk-3JN6QEJR.mjs";
11
14
  import {
15
+ Label,
12
16
  Tabs,
13
17
  TabsList,
14
18
  TabsTrigger
15
- } from "./chunk-6UVNHT3T.mjs";
16
- import {
17
- Badge
18
- } from "./chunk-AMXRQ2TK.mjs";
19
+ } from "./chunk-4SYRK2NH.mjs";
19
20
  import {
20
21
  $isStoryBuilderNode
21
- } from "./chunk-T2UBAZ66.mjs";
22
- import {
23
- Label
24
- } from "./chunk-PFH63ZU4.mjs";
22
+ } from "./chunk-D4UBNSUW.mjs";
25
23
  import {
26
24
  Input
27
25
  } from "./chunk-5NRAXWYA.mjs";
@@ -33,7 +31,7 @@ import {
33
31
  } from "./chunk-H3P47YXJ.mjs";
34
32
  import {
35
33
  Button
36
- } from "./chunk-OE5JRLCN.mjs";
34
+ } from "./chunk-ONOHG5NB.mjs";
37
35
  import {
38
36
  cn
39
37
  } from "./chunk-JHXDLYEV.mjs";
@@ -69,6 +67,7 @@ import {
69
67
  import { jsx, jsxs } from "react/jsx-runtime";
70
68
  function StoryBuilderComponent({ nodes, currentNodeId, title, nodeKey }) {
71
69
  const [editor] = useLexicalComposerContext();
70
+ const isEditable = editor.isEditable();
72
71
  const [isPreviewMode, setIsPreviewMode] = useState(false);
73
72
  const [previewNodeId, setPreviewNodeId] = useState("");
74
73
  const [editingNode, setEditingNode] = useState(null);
@@ -56,9 +56,31 @@ var TabsContent = React.forwardRef((_a, ref) => {
56
56
  });
57
57
  TabsContent.displayName = TabsPrimitive.Content.displayName;
58
58
 
59
+ // src/components/ui/label.tsx
60
+ init_react_shim();
61
+ import * as React2 from "react";
62
+ import * as LabelPrimitive from "@radix-ui/react-label";
63
+ import { cva } from "class-variance-authority";
64
+ import { jsx as jsx2 } from "react/jsx-runtime";
65
+ var labelVariants = cva(
66
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
67
+ );
68
+ var Label = React2.forwardRef((_a, ref) => {
69
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
70
+ return /* @__PURE__ */ jsx2(
71
+ LabelPrimitive.Root,
72
+ __spreadValues({
73
+ ref,
74
+ className: cn(labelVariants(), className)
75
+ }, props)
76
+ );
77
+ });
78
+ Label.displayName = LabelPrimitive.Root.displayName;
79
+
59
80
  export {
60
81
  Tabs,
61
82
  TabsList,
62
83
  TabsTrigger,
63
- TabsContent
84
+ TabsContent,
85
+ Label
64
86
  };