@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.
- package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
- package/dist/{AIDialog-RHRYHSVN.mjs → AIDialog-HJW6PQPR.mjs} +11 -12
- package/dist/{AudioComponent-CKLMLB5T.mjs → AudioComponent-W5XMZPQB.mjs} +10 -6
- package/dist/{DynamicBlockComponent-2LOADZUX.mjs → DynamicBlockComponent-CHRL2GAQ.mjs} +7 -6
- package/dist/{EquationComponent-4NFG55NQ.mjs → EquationComponent-GNQHG53L.mjs} +26 -7
- package/dist/{ExcalidrawComponent-BMSYIPP6.mjs → ExcalidrawComponent-POMYXDSG.mjs} +33 -6
- package/dist/{FileComponent-Y56MX5QD.mjs → FileComponent-EOVCH4V5.mjs} +9 -5
- package/dist/{HintComponet-ET7M2Q7S.mjs → HintComponet-QXL5ESND.mjs} +32 -8
- package/dist/{InlineImageComponent-FVTA4LXZ.mjs → InlineImageComponent-KDN3VGZC.mjs} +8 -3
- package/dist/{StoryBuilderComponent-JN4ZPZOW.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +8 -9
- package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
- package/dist/chunk-5CJZC5IB.mjs +9086 -0
- package/dist/{chunk-FO7M3X2B.mjs → chunk-6NK5DONB.mjs} +1 -1
- package/dist/{chunk-N6ILV6NF.mjs → chunk-ACW4DLVO.mjs} +21 -7
- package/dist/chunk-BCGD2YXP.mjs +574 -0
- package/dist/{chunk-TC3IISJZ.mjs → chunk-BTR3TPIN.mjs} +18 -5
- package/dist/{chunk-ZYJ7KABY.mjs → chunk-CQCS5YPS.mjs} +3 -5
- package/dist/{chunk-T2UBAZ66.mjs → chunk-D4UBNSUW.mjs} +1 -1
- package/dist/{chunk-KNW2CGIP.mjs → chunk-DBRZIA43.mjs} +4 -1
- package/dist/{chunk-CDAMHK63.mjs → chunk-GJK2L7ZM.mjs} +23 -2
- package/dist/{chunk-ELBTVBTS.mjs → chunk-IKYVBTCJ.mjs} +43 -20
- package/dist/chunk-IXRA5D53.mjs +10447 -0
- package/dist/{chunk-W6VQSFE5.mjs → chunk-J2CEQXG4.mjs} +1 -1
- package/dist/{chunk-43Z4Z2KD.mjs → chunk-JTNLN4JI.mjs} +1 -1
- package/dist/{chunk-OE5JRLCN.mjs → chunk-ONOHG5NB.mjs} +6 -4
- package/dist/{chunk-QNIY45SF.mjs → chunk-OO42URWA.mjs} +27 -6
- package/dist/chunk-PBVRSNGU.mjs +129 -0
- package/dist/chunk-QCS57TIF.mjs +1794 -0
- package/dist/chunk-RNEIJRUS.mjs +60 -0
- package/dist/chunk-TJPTGECP.mjs +1556 -0
- package/dist/{chunk-XYMXGU4T.mjs → chunk-TMYRA2W4.mjs} +1 -1
- package/dist/{chunk-ZFV2HGD3.mjs → chunk-UNEFOZTS.mjs} +1 -1
- package/dist/chunk-X4NI7EQS.mjs +282 -0
- package/dist/{chunk-5D4JF3ZZ.mjs → chunk-XAJ4GACN.mjs} +171 -49
- package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
- package/dist/components/editor/index.d.ts +1 -1
- package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +1 -0
- package/dist/components/editor/nodes/Hint/index.d.ts +2 -1
- package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +73 -1
- package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +25 -3
- package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +16 -3
- package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +20 -25
- package/dist/components/editor/plugins/MarkdownPastePlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +2 -0
- package/dist/components/editor/plugins/SlashCommand/index.d.ts +18 -1
- package/dist/components/editor/plugins/SmartTypographyPlugin/index.d.ts +26 -0
- package/dist/components/editor/utils/aiStream.d.ts +27 -0
- package/dist/components/editor/utils/excalidrawDiagramBuilder.d.ts +29 -0
- package/dist/components/editor/utils/markdownTransformers.d.ts +4 -1
- package/dist/components/editor/utils/url.d.ts +16 -4
- package/dist/components/providers/AIContext.d.ts +8 -0
- package/dist/components/ui/equation/equationTypography.d.ts +23 -0
- package/dist/core/extension.d.ts +3 -1
- package/dist/core/extensions/blocks-kit.d.ts +22 -1
- package/dist/core/extensions/copilot-and-collab.d.ts +15 -1
- package/dist/core/react/NotiqContent.d.ts +4 -1
- package/dist/core/react/index.d.ts +1 -0
- package/dist/core/react/node-renderers.d.ts +73 -0
- package/dist/core.js +15429 -13116
- package/dist/core.mjs +47 -39
- package/dist/hooks/instructions-messages.d.ts +13 -4
- package/dist/{image-QPB2CVXP.mjs → image-AL6PHM2A.mjs} +17 -12
- package/dist/index.js +15526 -13194
- package/dist/index.mjs +64 -60
- package/dist/{insert-audio-I3PD6JFS.mjs → insert-audio-CRWR7EO5.mjs} +4 -6
- package/dist/{insert-file-PHR7XL4V.mjs → insert-file-I73AZW3L.mjs} +4 -6
- package/dist/{insert-gif-R5ZO4JHC.mjs → insert-gif-KWRC3ACT.mjs} +1 -1
- package/dist/{insert-image-PLBZELHK.mjs → insert-image-XIY6BGW5.mjs} +4 -3
- package/dist/{insert-poll-6BCIFY5G.mjs → insert-poll-J5YVZNZ4.mjs} +4 -3
- package/dist/{insert-table-ZRJP6X52.mjs → insert-table-OIMJRFFK.mjs} +1 -1
- package/dist/{poll-component-VHMM5KKZ.mjs → poll-component-TVHXIKGQ.mjs} +3 -2
- package/dist/react.js +14747 -12554
- package/dist/react.mjs +40 -38
- package/dist/{stepper-KNITDVLG.mjs → stepper-ILF7YXTO.mjs} +63 -73
- package/dist/styles/notiq.css +1 -1
- package/package.json +2 -2
- package/src/styles/notiq.css +20 -0
- package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +0 -12
- package/dist/CodeActionMenuPlugin-FGH6HZLL.mjs +0 -14
- package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
- package/dist/CollaboratorsBar-AMPIAUOY.mjs +0 -20
- package/dist/CommentsPlugin-SDJJTUGK.mjs +0 -19
- package/dist/ExcalidrawPlugin-QLPGJPSX.mjs +0 -14
- package/dist/ExportPlugin-MJHYKQZJ.mjs +0 -43
- package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
- package/dist/FloatingTextFormatToolbarPlugin-BXCPN3KD.mjs +0 -45
- package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
- package/dist/MobileToolbar-KV5DX4ED.mjs +0 -982
- package/dist/SlashCommand-SPR7G5EI.mjs +0 -39
- package/dist/TableCellActionMenuPlugin-YWBA64J7.mjs +0 -838
- package/dist/TableHoverActionsPlugin-2EIXHEXN.mjs +0 -265
- package/dist/TemplatePlugin-HNTPEXBB.mjs +0 -9
- package/dist/ToolbarPlugin-F52PVNXU.mjs +0 -823
- package/dist/VersionHistoryPlugin-YWGCREKA.mjs +0 -371
- package/dist/background-color-RW5JYLMG.mjs +0 -425
- package/dist/block-format-TODFREE2.mjs +0 -14
- package/dist/chunk-22ZIL6NH.mjs +0 -88
- package/dist/chunk-2LNT36RL.mjs +0 -555
- package/dist/chunk-37LC44W3.mjs +0 -2677
- package/dist/chunk-3IILA3IP.mjs +0 -28
- package/dist/chunk-4DVIYZVB.mjs +0 -193
- package/dist/chunk-4FFTOZGJ.mjs +0 -103
- package/dist/chunk-4UMUPCDK.mjs +0 -68
- package/dist/chunk-6D6QLRYR.mjs +0 -238
- package/dist/chunk-6FQFPPLG.mjs +0 -785
- package/dist/chunk-ACV47ZKE.mjs +0 -201
- package/dist/chunk-BGV62GC2.mjs +0 -26
- package/dist/chunk-C4JWLBYN.mjs +0 -132
- package/dist/chunk-CLRSETYQ.mjs +0 -431
- package/dist/chunk-D3IOUQFR.mjs +0 -441
- package/dist/chunk-EEBA6OAH.mjs +0 -59
- package/dist/chunk-EIZMKFHF.mjs +0 -32
- package/dist/chunk-ENH2IOHI.mjs +0 -1828
- package/dist/chunk-EVPWKNE4.mjs +0 -27
- package/dist/chunk-HOZ4QRFV.mjs +0 -536
- package/dist/chunk-IAFCQV3Z.mjs +0 -349
- package/dist/chunk-J6ZUY5BY.mjs +0 -202
- package/dist/chunk-K5OAFEVY.mjs +0 -191
- package/dist/chunk-KXRLARGI.mjs +0 -26
- package/dist/chunk-LBGM4VVZ.mjs +0 -409
- package/dist/chunk-LLGVCM7M.mjs +0 -809
- package/dist/chunk-LU2XWLOE.mjs +0 -219
- package/dist/chunk-LVRJM45C.mjs +0 -171
- package/dist/chunk-MSAO3YFB.mjs +0 -144
- package/dist/chunk-N3KDPSRI.mjs +0 -496
- package/dist/chunk-OXWTZV3U.mjs +0 -174
- package/dist/chunk-PD5K4AGP.mjs +0 -64
- package/dist/chunk-PFH63ZU4.mjs +0 -33
- package/dist/chunk-R7WFRENU.mjs +0 -262
- package/dist/chunk-RAVYEEIC.mjs +0 -36
- package/dist/chunk-RJQTA6HG.mjs +0 -358
- package/dist/chunk-SAOJHVPE.mjs +0 -153
- package/dist/chunk-SYUCM5G5.mjs +0 -111
- package/dist/chunk-VGAX6YEY.mjs +0 -399
- package/dist/chunk-VNDDDXGH.mjs +0 -682
- package/dist/chunk-WUVIQCX7.mjs +0 -944
- package/dist/chunk-XNJNT6PC.mjs +0 -1701
- package/dist/chunk-XYLTLGY5.mjs +0 -775
- package/dist/chunk-ZKZ7MLSS.mjs +0 -165
- package/dist/color-S55XFDYQ.mjs +0 -13
- package/dist/font-IJKFR4BM.mjs +0 -12
- package/dist/font-size-3HMJHKO2.mjs +0 -15
- package/dist/insert-node-DGCZBGKG.mjs +0 -243
- package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
- package/dist/text-align-TEB4S52S.mjs +0 -121
- 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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
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-
|
|
15
|
+
import "./chunk-IKYVBTCJ.mjs";
|
|
16
|
+
import "./chunk-OO42URWA.mjs";
|
|
19
17
|
import {
|
|
20
18
|
Button
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
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-
|
|
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: () =>
|
|
178
|
-
|
|
179
|
-
|
|
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
|
|
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-
|
|
13
|
+
} from "./chunk-JTNLN4JI.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Button
|
|
16
|
-
} from "./chunk-
|
|
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__ */
|
|
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
|
-
|
|
2
|
+
KatexRenderer,
|
|
3
|
+
handleEquationInputChange
|
|
4
|
+
} from "./chunk-PBVRSNGU.mjs";
|
|
4
5
|
import {
|
|
5
6
|
$isEquationNode
|
|
6
|
-
} from "./chunk-
|
|
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
|
-
|
|
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-
|
|
3
|
+
} from "./chunk-BTR3TPIN.mjs";
|
|
4
4
|
import "./chunk-H3P47YXJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
$isExcalidrawNode
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
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
|
-
|
|
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-
|
|
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: () =>
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
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:
|
|
259
|
-
|
|
260
|
-
|
|
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-
|
|
9
|
+
} from "./chunk-X4NI7EQS.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Button
|
|
12
|
-
} from "./chunk-
|
|
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-
|
|
16
|
-
import {
|
|
17
|
-
Badge
|
|
18
|
-
} from "./chunk-AMXRQ2TK.mjs";
|
|
19
|
+
} from "./chunk-4SYRK2NH.mjs";
|
|
19
20
|
import {
|
|
20
21
|
$isStoryBuilderNode
|
|
21
|
-
} from "./chunk-
|
|
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-
|
|
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
|
};
|