@collabchron/notiq 1.1.11 → 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 (152) hide show
  1. package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
  2. package/dist/{AIDialog-2WZUFWSC.mjs → AIDialog-HJW6PQPR.mjs} +12 -13
  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-SIMURTCA.mjs → ExcalidrawComponent-POMYXDSG.mjs} +34 -7
  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-WQSNFPMM.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +9 -10
  11. package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
  12. package/dist/chunk-5CJZC5IB.mjs +9086 -0
  13. package/dist/{chunk-MW6MAUY3.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-XAVQAXOJ.mjs → chunk-CQCS5YPS.mjs} +3 -5
  18. package/dist/{chunk-YTLUQJE2.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-GYYLZ3MQ.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-XZXGYNTY.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-XAJ4GACN.mjs +746 -0
  35. package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
  36. package/dist/components/editor/Core.d.ts +15 -2
  37. package/dist/components/editor/index.d.ts +16 -5
  38. package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +1 -0
  39. package/dist/components/editor/nodes/Hint/index.d.ts +2 -1
  40. package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +73 -1
  41. package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +25 -3
  42. package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +16 -3
  43. package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +20 -25
  44. package/dist/components/editor/plugins/MarkdownPastePlugin/index.d.ts +5 -0
  45. package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +2 -0
  46. package/dist/components/editor/plugins/SlashCommand/index.d.ts +18 -1
  47. package/dist/components/editor/plugins/SmartTypographyPlugin/index.d.ts +26 -0
  48. package/dist/components/editor/utils/aiStream.d.ts +27 -0
  49. package/dist/components/editor/utils/excalidrawDiagramBuilder.d.ts +29 -0
  50. package/dist/components/editor/utils/markdownTransformers.d.ts +4 -1
  51. package/dist/components/editor/utils/url.d.ts +16 -4
  52. package/dist/components/providers/AIContext.d.ts +8 -0
  53. package/dist/components/ui/equation/equationTypography.d.ts +23 -0
  54. package/dist/core/extension.d.ts +3 -1
  55. package/dist/core/extensions/blocks-kit.d.ts +22 -1
  56. package/dist/core/extensions/copilot-and-collab.d.ts +15 -1
  57. package/dist/core/index.d.ts +2 -1
  58. package/dist/core/react/NotiqContent.d.ts +4 -1
  59. package/dist/core/react/NotiqEditor.d.ts +8 -8
  60. package/dist/core/react/index.d.ts +1 -0
  61. package/dist/core/react/node-renderers.d.ts +73 -0
  62. package/dist/core/types.d.ts +1 -0
  63. package/dist/core.js +18136 -9084
  64. package/dist/core.mjs +58 -44
  65. package/dist/hooks/instructions-messages.d.ts +13 -4
  66. package/dist/{image-TPW7PZZK.mjs → image-AL6PHM2A.mjs} +18 -13
  67. package/dist/index.js +15180 -12858
  68. package/dist/index.mjs +121 -1641
  69. package/dist/{insert-audio-C66RZRKY.mjs → insert-audio-CRWR7EO5.mjs} +6 -8
  70. package/dist/{insert-file-3DTGRO7W.mjs → insert-file-I73AZW3L.mjs} +6 -8
  71. package/dist/{insert-gif-FIMCCBAI.mjs → insert-gif-KWRC3ACT.mjs} +4 -4
  72. package/dist/{insert-image-CZV6HWQZ.mjs → insert-image-XIY6BGW5.mjs} +6 -5
  73. package/dist/{insert-poll-6BCIFY5G.mjs → insert-poll-J5YVZNZ4.mjs} +4 -3
  74. package/dist/{insert-table-ZRJP6X52.mjs → insert-table-OIMJRFFK.mjs} +1 -1
  75. package/dist/{poll-component-VHMM5KKZ.mjs → poll-component-TVHXIKGQ.mjs} +3 -2
  76. package/dist/react.js +17933 -9531
  77. package/dist/react.mjs +41 -34
  78. package/dist/{stepper-4AO5XMO7.mjs → stepper-ILF7YXTO.mjs} +64 -74
  79. package/dist/styles/notiq.css +1 -1
  80. package/package.json +2 -2
  81. package/src/styles/notiq.css +20 -0
  82. package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +0 -12
  83. package/dist/CodeActionMenuPlugin-MRKY67ED.mjs +0 -14
  84. package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
  85. package/dist/CollaboratorsBar-TMKBOBJI.mjs +0 -20
  86. package/dist/CommentsPlugin-5M4RD6YO.mjs +0 -19
  87. package/dist/ExcalidrawPlugin-2SGPIQ6U.mjs +0 -14
  88. package/dist/ExportPlugin-OKZOLBGS.mjs +0 -42
  89. package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
  90. package/dist/FloatingTextFormatToolbarPlugin-SO5VON7Q.mjs +0 -45
  91. package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
  92. package/dist/MobileToolbar-JKP2MLQJ.mjs +0 -984
  93. package/dist/SlashCommand-2TNOOUBM.mjs +0 -39
  94. package/dist/TableCellActionMenuPlugin-YWBA64J7.mjs +0 -838
  95. package/dist/TableHoverActionsPlugin-2EIXHEXN.mjs +0 -265
  96. package/dist/TemplatePlugin-HNTPEXBB.mjs +0 -9
  97. package/dist/ToolbarPlugin-IIAOU4P5.mjs +0 -35
  98. package/dist/VersionHistoryPlugin-23MAZB4G.mjs +0 -371
  99. package/dist/background-color-OZJCBYCT.mjs +0 -425
  100. package/dist/block-format-MTSIXWID.mjs +0 -14
  101. package/dist/chunk-2KESP7OU.mjs +0 -809
  102. package/dist/chunk-3AHNLIME.mjs +0 -1701
  103. package/dist/chunk-3IILA3IP.mjs +0 -28
  104. package/dist/chunk-4DVIYZVB.mjs +0 -193
  105. package/dist/chunk-4FFTOZGJ.mjs +0 -103
  106. package/dist/chunk-4UMUPCDK.mjs +0 -68
  107. package/dist/chunk-6D6QLRYR.mjs +0 -238
  108. package/dist/chunk-6SRMKQSD.mjs +0 -682
  109. package/dist/chunk-ACV47ZKE.mjs +0 -201
  110. package/dist/chunk-AYNKORDO.mjs +0 -6
  111. package/dist/chunk-BGV62GC2.mjs +0 -26
  112. package/dist/chunk-D3IOUQFR.mjs +0 -441
  113. package/dist/chunk-EEBA6OAH.mjs +0 -59
  114. package/dist/chunk-EIZMKFHF.mjs +0 -32
  115. package/dist/chunk-EVPWKNE4.mjs +0 -27
  116. package/dist/chunk-FMJ7DGWP.mjs +0 -144
  117. package/dist/chunk-FYLRS4BG.mjs +0 -88
  118. package/dist/chunk-HOZ4QRFV.mjs +0 -536
  119. package/dist/chunk-IAFCQV3Z.mjs +0 -349
  120. package/dist/chunk-IU2N42JJ.mjs +0 -1763
  121. package/dist/chunk-J6ZUY5BY.mjs +0 -202
  122. package/dist/chunk-K5OAFEVY.mjs +0 -191
  123. package/dist/chunk-KDA7ZYMJ.mjs +0 -431
  124. package/dist/chunk-KXRLARGI.mjs +0 -26
  125. package/dist/chunk-LAUAYRPC.mjs +0 -944
  126. package/dist/chunk-LLCP7NVE.mjs +0 -449
  127. package/dist/chunk-LU2XWLOE.mjs +0 -219
  128. package/dist/chunk-MPTE332I.mjs +0 -787
  129. package/dist/chunk-MTQZWJHR.mjs +0 -111
  130. package/dist/chunk-OXWTZV3U.mjs +0 -174
  131. package/dist/chunk-PD5K4AGP.mjs +0 -64
  132. package/dist/chunk-PFH63ZU4.mjs +0 -33
  133. package/dist/chunk-PHRVYPVM.mjs +0 -808
  134. package/dist/chunk-R7WFRENU.mjs +0 -262
  135. package/dist/chunk-RAVYEEIC.mjs +0 -36
  136. package/dist/chunk-RJQTA6HG.mjs +0 -358
  137. package/dist/chunk-SAOJHVPE.mjs +0 -153
  138. package/dist/chunk-VGAX6YEY.mjs +0 -399
  139. package/dist/chunk-W6GAJXUS.mjs +0 -334
  140. package/dist/chunk-XYDBUQ6Z.mjs +0 -1978
  141. package/dist/chunk-XYT6XM5S.mjs +0 -496
  142. package/dist/chunk-YDDBQZ77.mjs +0 -409
  143. package/dist/chunk-YE7M2VKR.mjs +0 -132
  144. package/dist/chunk-Z6JAFF55.mjs +0 -555
  145. package/dist/chunk-ZKZ7MLSS.mjs +0 -165
  146. package/dist/color-23323E3B.mjs +0 -13
  147. package/dist/font-IJKFR4BM.mjs +0 -12
  148. package/dist/font-size-GTL6UVQL.mjs +0 -15
  149. package/dist/insert-node-MA3FXEYN.mjs +0 -245
  150. package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
  151. package/dist/text-align-CSDLJUDA.mjs +0 -121
  152. package/dist/text-format-6L5N3CHZ.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-XAVQAXOJ.mjs";
7
- import "./chunk-4DVIYZVB.mjs";
8
- import "./chunk-2KESP7OU.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";
11
+ import "./chunk-NBE6FF6L.mjs";
13
12
  import {
14
13
  Input
15
14
  } from "./chunk-5NRAXWYA.mjs";
16
- import "./chunk-NBE6FF6L.mjs";
17
- import "./chunk-GYYLZ3MQ.mjs";
18
- import "./chunk-XZXGYNTY.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
+ import "./chunk-H3P47YXJ.mjs";
4
5
  import {
5
6
  $isExcalidrawNode
6
- } from "./chunk-XZXGYNTY.mjs";
7
- import "./chunk-H3P47YXJ.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
- Textarea
10
- } from "./chunk-3JN6QEJR.mjs";
11
8
  import {
12
9
  Badge
13
10
  } from "./chunk-AMXRQ2TK.mjs";
14
11
  import {
15
- Label
16
- } from "./chunk-PFH63ZU4.mjs";
17
- import {
18
- $isStoryBuilderNode
19
- } from "./chunk-YTLUQJE2.mjs";
12
+ Textarea
13
+ } from "./chunk-3JN6QEJR.mjs";
20
14
  import {
15
+ Label,
21
16
  Tabs,
22
17
  TabsList,
23
18
  TabsTrigger
24
- } from "./chunk-6UVNHT3T.mjs";
19
+ } from "./chunk-4SYRK2NH.mjs";
20
+ import {
21
+ $isStoryBuilderNode
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
  };