@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.
- package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
- package/dist/{AIDialog-2WZUFWSC.mjs → AIDialog-HJW6PQPR.mjs} +12 -13
- 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-SIMURTCA.mjs → ExcalidrawComponent-POMYXDSG.mjs} +34 -7
- 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-WQSNFPMM.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +9 -10
- package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
- package/dist/chunk-5CJZC5IB.mjs +9086 -0
- package/dist/{chunk-MW6MAUY3.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-XAVQAXOJ.mjs → chunk-CQCS5YPS.mjs} +3 -5
- package/dist/{chunk-YTLUQJE2.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-GYYLZ3MQ.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-XZXGYNTY.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-XAJ4GACN.mjs +746 -0
- package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
- package/dist/components/editor/Core.d.ts +15 -2
- package/dist/components/editor/index.d.ts +16 -5
- 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/index.d.ts +2 -1
- package/dist/core/react/NotiqContent.d.ts +4 -1
- package/dist/core/react/NotiqEditor.d.ts +8 -8
- package/dist/core/react/index.d.ts +1 -0
- package/dist/core/react/node-renderers.d.ts +73 -0
- package/dist/core/types.d.ts +1 -0
- package/dist/core.js +18136 -9084
- package/dist/core.mjs +58 -44
- package/dist/hooks/instructions-messages.d.ts +13 -4
- package/dist/{image-TPW7PZZK.mjs → image-AL6PHM2A.mjs} +18 -13
- package/dist/index.js +15180 -12858
- package/dist/index.mjs +121 -1641
- package/dist/{insert-audio-C66RZRKY.mjs → insert-audio-CRWR7EO5.mjs} +6 -8
- package/dist/{insert-file-3DTGRO7W.mjs → insert-file-I73AZW3L.mjs} +6 -8
- package/dist/{insert-gif-FIMCCBAI.mjs → insert-gif-KWRC3ACT.mjs} +4 -4
- package/dist/{insert-image-CZV6HWQZ.mjs → insert-image-XIY6BGW5.mjs} +6 -5
- 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 +17933 -9531
- package/dist/react.mjs +41 -34
- package/dist/{stepper-4AO5XMO7.mjs → stepper-ILF7YXTO.mjs} +64 -74
- 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-MRKY67ED.mjs +0 -14
- package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
- package/dist/CollaboratorsBar-TMKBOBJI.mjs +0 -20
- package/dist/CommentsPlugin-5M4RD6YO.mjs +0 -19
- package/dist/ExcalidrawPlugin-2SGPIQ6U.mjs +0 -14
- package/dist/ExportPlugin-OKZOLBGS.mjs +0 -42
- package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
- package/dist/FloatingTextFormatToolbarPlugin-SO5VON7Q.mjs +0 -45
- package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
- package/dist/MobileToolbar-JKP2MLQJ.mjs +0 -984
- package/dist/SlashCommand-2TNOOUBM.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-IIAOU4P5.mjs +0 -35
- package/dist/VersionHistoryPlugin-23MAZB4G.mjs +0 -371
- package/dist/background-color-OZJCBYCT.mjs +0 -425
- package/dist/block-format-MTSIXWID.mjs +0 -14
- package/dist/chunk-2KESP7OU.mjs +0 -809
- package/dist/chunk-3AHNLIME.mjs +0 -1701
- 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-6SRMKQSD.mjs +0 -682
- package/dist/chunk-ACV47ZKE.mjs +0 -201
- package/dist/chunk-AYNKORDO.mjs +0 -6
- package/dist/chunk-BGV62GC2.mjs +0 -26
- package/dist/chunk-D3IOUQFR.mjs +0 -441
- package/dist/chunk-EEBA6OAH.mjs +0 -59
- package/dist/chunk-EIZMKFHF.mjs +0 -32
- package/dist/chunk-EVPWKNE4.mjs +0 -27
- package/dist/chunk-FMJ7DGWP.mjs +0 -144
- package/dist/chunk-FYLRS4BG.mjs +0 -88
- package/dist/chunk-HOZ4QRFV.mjs +0 -536
- package/dist/chunk-IAFCQV3Z.mjs +0 -349
- package/dist/chunk-IU2N42JJ.mjs +0 -1763
- package/dist/chunk-J6ZUY5BY.mjs +0 -202
- package/dist/chunk-K5OAFEVY.mjs +0 -191
- package/dist/chunk-KDA7ZYMJ.mjs +0 -431
- package/dist/chunk-KXRLARGI.mjs +0 -26
- package/dist/chunk-LAUAYRPC.mjs +0 -944
- package/dist/chunk-LLCP7NVE.mjs +0 -449
- package/dist/chunk-LU2XWLOE.mjs +0 -219
- package/dist/chunk-MPTE332I.mjs +0 -787
- package/dist/chunk-MTQZWJHR.mjs +0 -111
- package/dist/chunk-OXWTZV3U.mjs +0 -174
- package/dist/chunk-PD5K4AGP.mjs +0 -64
- package/dist/chunk-PFH63ZU4.mjs +0 -33
- package/dist/chunk-PHRVYPVM.mjs +0 -808
- 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-VGAX6YEY.mjs +0 -399
- package/dist/chunk-W6GAJXUS.mjs +0 -334
- package/dist/chunk-XYDBUQ6Z.mjs +0 -1978
- package/dist/chunk-XYT6XM5S.mjs +0 -496
- package/dist/chunk-YDDBQZ77.mjs +0 -409
- package/dist/chunk-YE7M2VKR.mjs +0 -132
- package/dist/chunk-Z6JAFF55.mjs +0 -555
- package/dist/chunk-ZKZ7MLSS.mjs +0 -165
- package/dist/color-23323E3B.mjs +0 -13
- package/dist/font-IJKFR4BM.mjs +0 -12
- package/dist/font-size-GTL6UVQL.mjs +0 -15
- package/dist/insert-node-MA3FXEYN.mjs +0 -245
- package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
- package/dist/text-align-CSDLJUDA.mjs +0 -121
- package/dist/text-format-6L5N3CHZ.mjs +0 -15
package/dist/chunk-ZKZ7MLSS.mjs
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_react_shim
|
|
3
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/editor/plugins/SpeechToTextPlugin/index.ts
|
|
6
|
-
init_react_shim();
|
|
7
|
-
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
8
|
-
import {
|
|
9
|
-
$getSelection,
|
|
10
|
-
$isRangeSelection,
|
|
11
|
-
COMMAND_PRIORITY_EDITOR,
|
|
12
|
-
createCommand,
|
|
13
|
-
REDO_COMMAND,
|
|
14
|
-
UNDO_COMMAND
|
|
15
|
-
} from "lexical";
|
|
16
|
-
import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
|
17
|
-
|
|
18
|
-
// src/hooks/useReport.ts
|
|
19
|
-
init_react_shim();
|
|
20
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
21
|
-
var getElement = () => {
|
|
22
|
-
let element = document.getElementById("report-container");
|
|
23
|
-
if (element === null) {
|
|
24
|
-
element = document.createElement("div");
|
|
25
|
-
element.id = "report-container";
|
|
26
|
-
element.style.position = "fixed";
|
|
27
|
-
element.style.top = "50%";
|
|
28
|
-
element.style.left = "50%";
|
|
29
|
-
element.style.fontSize = "32px";
|
|
30
|
-
element.style.transform = "translate(-50%, -50px)";
|
|
31
|
-
element.style.padding = "20px";
|
|
32
|
-
element.style.background = "rgba(240, 240, 240, 0.4)";
|
|
33
|
-
element.style.borderRadius = "20px";
|
|
34
|
-
if (document.body) {
|
|
35
|
-
document.body.appendChild(element);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return element;
|
|
39
|
-
};
|
|
40
|
-
function useReport() {
|
|
41
|
-
const timer = useRef(null);
|
|
42
|
-
const cleanup = useCallback(() => {
|
|
43
|
-
if (timer.current !== null) {
|
|
44
|
-
clearTimeout(timer.current);
|
|
45
|
-
timer.current = null;
|
|
46
|
-
}
|
|
47
|
-
if (document.body) {
|
|
48
|
-
document.body.removeChild(getElement());
|
|
49
|
-
}
|
|
50
|
-
}, []);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
return cleanup;
|
|
53
|
-
}, [cleanup]);
|
|
54
|
-
return useCallback(
|
|
55
|
-
(content) => {
|
|
56
|
-
console.log(content);
|
|
57
|
-
const element = getElement();
|
|
58
|
-
if (timer.current !== null) {
|
|
59
|
-
clearTimeout(timer.current);
|
|
60
|
-
}
|
|
61
|
-
element.innerHTML = content;
|
|
62
|
-
timer.current = setTimeout(cleanup, 1e3);
|
|
63
|
-
return timer.current;
|
|
64
|
-
},
|
|
65
|
-
[cleanup]
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/components/editor/plugins/SpeechToTextPlugin/index.ts
|
|
70
|
-
var SPEECH_TO_TEXT_COMMAND = createCommand(
|
|
71
|
-
"SPEECH_TO_TEXT_COMMAND"
|
|
72
|
-
);
|
|
73
|
-
var VOICE_COMMANDS = {
|
|
74
|
-
"\n": ({ selection }) => {
|
|
75
|
-
selection.insertParagraph();
|
|
76
|
-
},
|
|
77
|
-
redo: ({ editor }) => {
|
|
78
|
-
editor.dispatchCommand(REDO_COMMAND, void 0);
|
|
79
|
-
},
|
|
80
|
-
undo: ({ editor }) => {
|
|
81
|
-
editor.dispatchCommand(UNDO_COMMAND, void 0);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
var SUPPORT_SPEECH_RECOGNITION = typeof window !== "undefined" && ("SpeechRecognition" in window || "webkitSpeechRecognition" in window);
|
|
85
|
-
function SpeechToTextPlugin() {
|
|
86
|
-
const [editor] = useLexicalComposerContext();
|
|
87
|
-
const [isEnabled, setIsEnabled] = useState(false);
|
|
88
|
-
const SpeechRecognition = (
|
|
89
|
-
// @ts-expect-error missing type
|
|
90
|
-
window.SpeechRecognition || window.webkitSpeechRecognition
|
|
91
|
-
);
|
|
92
|
-
const recognition = useRef2(null);
|
|
93
|
-
const isRecognizing = useRef2(false);
|
|
94
|
-
const report = useReport();
|
|
95
|
-
useEffect2(() => {
|
|
96
|
-
if (isEnabled && recognition.current === null) {
|
|
97
|
-
recognition.current = new SpeechRecognition();
|
|
98
|
-
recognition.current.continuous = true;
|
|
99
|
-
recognition.current.interimResults = true;
|
|
100
|
-
recognition.current.onresult = (event) => {
|
|
101
|
-
const resultItem = event.results.item(event.resultIndex);
|
|
102
|
-
const { transcript } = resultItem.item(0);
|
|
103
|
-
report(transcript);
|
|
104
|
-
if (!resultItem.isFinal) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
editor.update(() => {
|
|
108
|
-
const selection = $getSelection();
|
|
109
|
-
if ($isRangeSelection(selection)) {
|
|
110
|
-
const command = VOICE_COMMANDS[transcript.toLowerCase().trim()];
|
|
111
|
-
if (command) {
|
|
112
|
-
command({ editor, selection });
|
|
113
|
-
} else if (transcript.match(/\s*\n\s*/)) {
|
|
114
|
-
selection.insertParagraph();
|
|
115
|
-
} else {
|
|
116
|
-
selection.insertText(transcript);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
recognition.current.onstart = () => {
|
|
122
|
-
isRecognizing.current = true;
|
|
123
|
-
};
|
|
124
|
-
recognition.current.onend = () => {
|
|
125
|
-
var _a;
|
|
126
|
-
isRecognizing.current = false;
|
|
127
|
-
if (isEnabled) {
|
|
128
|
-
(_a = recognition.current) == null ? void 0 : _a.start();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (recognition.current) {
|
|
133
|
-
if (isEnabled && !isRecognizing.current) {
|
|
134
|
-
recognition.current.start();
|
|
135
|
-
} else if (!isEnabled && isRecognizing.current) {
|
|
136
|
-
recognition.current.stop();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return () => {
|
|
140
|
-
if (recognition.current) {
|
|
141
|
-
recognition.current.stop();
|
|
142
|
-
recognition.current = null;
|
|
143
|
-
isRecognizing.current = false;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}, [SpeechRecognition, editor, isEnabled, report]);
|
|
147
|
-
useEffect2(() => {
|
|
148
|
-
return editor.registerCommand(
|
|
149
|
-
SPEECH_TO_TEXT_COMMAND,
|
|
150
|
-
(_isEnabled) => {
|
|
151
|
-
setIsEnabled(_isEnabled);
|
|
152
|
-
return true;
|
|
153
|
-
},
|
|
154
|
-
COMMAND_PRIORITY_EDITOR
|
|
155
|
-
);
|
|
156
|
-
}, [editor]);
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
var SpeechToTextPlugin_default = SUPPORT_SPEECH_RECOGNITION ? SpeechToTextPlugin : () => null;
|
|
160
|
-
|
|
161
|
-
export {
|
|
162
|
-
SPEECH_TO_TEXT_COMMAND,
|
|
163
|
-
SUPPORT_SPEECH_RECOGNITION,
|
|
164
|
-
SpeechToTextPlugin_default
|
|
165
|
-
};
|
package/dist/color-23323E3B.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Color
|
|
3
|
-
} from "./chunk-KDA7ZYMJ.mjs";
|
|
4
|
-
import "./chunk-PFH63ZU4.mjs";
|
|
5
|
-
import "./chunk-6UVNHT3T.mjs";
|
|
6
|
-
import "./chunk-5NRAXWYA.mjs";
|
|
7
|
-
import "./chunk-OE5JRLCN.mjs";
|
|
8
|
-
import "./chunk-IIVB6JNE.mjs";
|
|
9
|
-
import "./chunk-JHXDLYEV.mjs";
|
|
10
|
-
import "./chunk-WYCFGRFJ.mjs";
|
|
11
|
-
export {
|
|
12
|
-
Color as default
|
|
13
|
-
};
|
package/dist/font-IJKFR4BM.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Font
|
|
3
|
-
} from "./chunk-SAOJHVPE.mjs";
|
|
4
|
-
import "./chunk-LU2XWLOE.mjs";
|
|
5
|
-
import "./chunk-H3P47YXJ.mjs";
|
|
6
|
-
import "./chunk-OE5JRLCN.mjs";
|
|
7
|
-
import "./chunk-IIVB6JNE.mjs";
|
|
8
|
-
import "./chunk-JHXDLYEV.mjs";
|
|
9
|
-
import "./chunk-WYCFGRFJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
Font as default
|
|
12
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FontSize,
|
|
3
|
-
parseAllowedFontSize
|
|
4
|
-
} from "./chunk-YE7M2VKR.mjs";
|
|
5
|
-
import "./chunk-6D6QLRYR.mjs";
|
|
6
|
-
import "./chunk-K5OAFEVY.mjs";
|
|
7
|
-
import "./chunk-4FFTOZGJ.mjs";
|
|
8
|
-
import "./chunk-5NRAXWYA.mjs";
|
|
9
|
-
import "./chunk-OE5JRLCN.mjs";
|
|
10
|
-
import "./chunk-JHXDLYEV.mjs";
|
|
11
|
-
import "./chunk-WYCFGRFJ.mjs";
|
|
12
|
-
export {
|
|
13
|
-
FontSize as default,
|
|
14
|
-
parseAllowedFontSize
|
|
15
|
-
};
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
INSERT_EXCALIDRAW_COMMAND
|
|
3
|
-
} from "./chunk-FYLRS4BG.mjs";
|
|
4
|
-
import {
|
|
5
|
-
INSERT_COLLAPSIBLE_COMMAND
|
|
6
|
-
} from "./chunk-ACV47ZKE.mjs";
|
|
7
|
-
import {
|
|
8
|
-
AutoEmbedDialog,
|
|
9
|
-
Figma,
|
|
10
|
-
FigmaEmbedConfig,
|
|
11
|
-
Twitter,
|
|
12
|
-
TwitterEmbedConfig,
|
|
13
|
-
Youtube,
|
|
14
|
-
YoutubeEmbedConfig
|
|
15
|
-
} from "./chunk-LLCP7NVE.mjs";
|
|
16
|
-
import {
|
|
17
|
-
useModal
|
|
18
|
-
} from "./chunk-IAFCQV3Z.mjs";
|
|
19
|
-
import {
|
|
20
|
-
INSERT_IMAGE_COMMAND
|
|
21
|
-
} from "./chunk-MW6MAUY3.mjs";
|
|
22
|
-
import "./chunk-4DVIYZVB.mjs";
|
|
23
|
-
import {
|
|
24
|
-
INSERT_LAYOUT_COMMAND
|
|
25
|
-
} from "./chunk-W6GAJXUS.mjs";
|
|
26
|
-
import "./chunk-VGAX6YEY.mjs";
|
|
27
|
-
import {
|
|
28
|
-
DropDown
|
|
29
|
-
} from "./chunk-LU2XWLOE.mjs";
|
|
30
|
-
import "./chunk-5NRAXWYA.mjs";
|
|
31
|
-
import {
|
|
32
|
-
Skeleton
|
|
33
|
-
} from "./chunk-NBE6FF6L.mjs";
|
|
34
|
-
import "./chunk-GYYLZ3MQ.mjs";
|
|
35
|
-
import "./chunk-TC3IISJZ.mjs";
|
|
36
|
-
import "./chunk-XZXGYNTY.mjs";
|
|
37
|
-
import "./chunk-H3P47YXJ.mjs";
|
|
38
|
-
import "./chunk-OE5JRLCN.mjs";
|
|
39
|
-
import {
|
|
40
|
-
INSERT_HINT_COMMAND
|
|
41
|
-
} from "./chunk-7QRJVZQY.mjs";
|
|
42
|
-
import "./chunk-IIVB6JNE.mjs";
|
|
43
|
-
import "./chunk-JHXDLYEV.mjs";
|
|
44
|
-
import {
|
|
45
|
-
init_react_shim
|
|
46
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
47
|
-
|
|
48
|
-
// src/components/ui/drop-downs/insert-node.tsx
|
|
49
|
-
init_react_shim();
|
|
50
|
-
import { useMemo, lazy, Suspense } from "react";
|
|
51
|
-
import { Columns2, Columns3, Columns4, DraftingCompassIcon, FileAudio, FileText, FlipHorizontal2, Image, ImagePlay, Lightbulb, Plus, SquareChevronRight, SquarePenIcon, Table } from "lucide-react";
|
|
52
|
-
import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
|
|
53
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
54
|
-
var InsertImageDialog = lazy(() => import("./insert-image-CZV6HWQZ.mjs").then((module) => ({ default: module.InsertImageDialog })));
|
|
55
|
-
var InsertGif = lazy(() => import("./insert-gif-FIMCCBAI.mjs"));
|
|
56
|
-
var InsertTableBody = lazy(() => import("./insert-table-ZRJP6X52.mjs").then((module) => ({ default: module.InsertTable })));
|
|
57
|
-
var InsertPoll = lazy(
|
|
58
|
-
() => import("./insert-poll-6BCIFY5G.mjs").then((module) => ({ default: module.InsertPoll }))
|
|
59
|
-
);
|
|
60
|
-
var InsertAudioDialog = lazy(
|
|
61
|
-
() => import("./insert-audio-C66RZRKY.mjs").then((module) => ({ default: module.InsertAudioDialog }))
|
|
62
|
-
);
|
|
63
|
-
var InsertFileDialog = lazy(
|
|
64
|
-
() => import("./insert-file-3DTGRO7W.mjs").then((module) => ({ default: module.InsertFileDialog }))
|
|
65
|
-
);
|
|
66
|
-
function InsertNode({
|
|
67
|
-
disabled,
|
|
68
|
-
editor
|
|
69
|
-
}) {
|
|
70
|
-
const [model, showModal] = useModal();
|
|
71
|
-
const insertGifOnClick = (payload) => {
|
|
72
|
-
editor.dispatchCommand(INSERT_IMAGE_COMMAND, payload);
|
|
73
|
-
};
|
|
74
|
-
const items = useMemo(
|
|
75
|
-
() => [
|
|
76
|
-
{
|
|
77
|
-
label: "Horizontal Rule",
|
|
78
|
-
icon: /* @__PURE__ */ jsx(FlipHorizontal2, { className: "w-4 h-4" }),
|
|
79
|
-
func: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0)
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: "Image",
|
|
83
|
-
icon: /* @__PURE__ */ jsx(Image, { className: "size-4" }),
|
|
84
|
-
func: () => {
|
|
85
|
-
showModal(
|
|
86
|
-
"Insert Image",
|
|
87
|
-
"Please select an image to upload.",
|
|
88
|
-
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[350px] h-[350px]" }), children: /* @__PURE__ */ jsx(InsertImageDialog, { activeEditor: editor, onClose }) }),
|
|
89
|
-
true
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: "Audio Player",
|
|
95
|
-
icon: /* @__PURE__ */ jsx(FileAudio, { className: "size-4 text-emerald-500" }),
|
|
96
|
-
func: () => {
|
|
97
|
-
showModal(
|
|
98
|
-
"Insert Audio",
|
|
99
|
-
"Upload an audio file or paste an audio URL.",
|
|
100
|
-
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[250px]" }), children: /* @__PURE__ */ jsx(InsertAudioDialog, { activeEditor: editor, onClose }) }),
|
|
101
|
-
true
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
label: "File Attachment",
|
|
107
|
-
icon: /* @__PURE__ */ jsx(FileText, { className: "size-4 text-blue-500" }),
|
|
108
|
-
func: () => {
|
|
109
|
-
showModal(
|
|
110
|
-
"Attach Document",
|
|
111
|
-
"Attach a file (PDF, Doc, Spreadsheet, Archive) to the document.",
|
|
112
|
-
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[250px]" }), children: /* @__PURE__ */ jsx(InsertFileDialog, { activeEditor: editor, onClose }) }),
|
|
113
|
-
true
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
label: "GIF",
|
|
119
|
-
icon: /* @__PURE__ */ jsx(ImagePlay, { className: "w-4 h-4" }),
|
|
120
|
-
func: () => {
|
|
121
|
-
showModal(
|
|
122
|
-
"Insert GIF",
|
|
123
|
-
"Please select a GIF to upload.",
|
|
124
|
-
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[400px]" }), children: /* @__PURE__ */ jsx(InsertGif, { insertGifOnClick, onClose }) }),
|
|
125
|
-
true
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
label: "Table",
|
|
131
|
-
icon: /* @__PURE__ */ jsx(Table, { className: "w-4 h-4" }),
|
|
132
|
-
func: () => {
|
|
133
|
-
showModal(
|
|
134
|
-
"Insert Table",
|
|
135
|
-
"Please configure your table.",
|
|
136
|
-
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[100px]" }), children: /* @__PURE__ */ jsx(InsertTableBody, { activeEditor: editor, onClose }) }),
|
|
137
|
-
true
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
label: "ExcaliDraw",
|
|
143
|
-
icon: /* @__PURE__ */ jsx(DraftingCompassIcon, { className: "w-4 h-4" }),
|
|
144
|
-
func: () => {
|
|
145
|
-
editor.dispatchCommand(INSERT_EXCALIDRAW_COMMAND, void 0);
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
label: "Poll",
|
|
150
|
-
icon: /* @__PURE__ */ jsx(SquarePenIcon, { className: "w-4 h-4" }),
|
|
151
|
-
func: () => {
|
|
152
|
-
showModal(
|
|
153
|
-
"Create Poll",
|
|
154
|
-
"Please type your question.",
|
|
155
|
-
(onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[100px]" }), children: /* @__PURE__ */ jsx(InsertPoll, { activeEditor: editor, onClose }) }),
|
|
156
|
-
true
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
label: "2 columns (equal width)",
|
|
162
|
-
icon: /* @__PURE__ */ jsx(Columns2, { className: "w-4 h-4" }),
|
|
163
|
-
func: () => {
|
|
164
|
-
editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr");
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
label: "3 columns (equal width)",
|
|
169
|
-
icon: /* @__PURE__ */ jsx(Columns3, { className: "w-4 h-4" }),
|
|
170
|
-
func: () => {
|
|
171
|
-
editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr 1fr");
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
label: "4 columns (equal width)",
|
|
176
|
-
icon: /* @__PURE__ */ jsx(Columns4, { className: "w-4 h-4" }),
|
|
177
|
-
func: () => {
|
|
178
|
-
editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr 1fr 1fr");
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
label: "2 columns (25% - 75%)",
|
|
183
|
-
icon: /* @__PURE__ */ jsx(Columns2, { className: "w-4 h-4" }),
|
|
184
|
-
func: () => {
|
|
185
|
-
editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 3fr");
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
label: "Collapsible container",
|
|
190
|
-
icon: /* @__PURE__ */ jsx(SquareChevronRight, { className: "w-4 h-4" }),
|
|
191
|
-
func: () => {
|
|
192
|
-
editor.dispatchCommand(INSERT_COLLAPSIBLE_COMMAND, void 0);
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
label: "Twitter",
|
|
197
|
-
icon: /* @__PURE__ */ jsx(Twitter, { className: "w-4 h-4" }),
|
|
198
|
-
func: () => {
|
|
199
|
-
showModal("Twitter tweet", "Insert a URL to embed a live preview. Works with Twitter, Google Drive, Vimeo, and more.", (onClose) => /* @__PURE__ */ jsx(AutoEmbedDialog, { embedConfig: TwitterEmbedConfig, onClose }), true);
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
label: "Youtube",
|
|
204
|
-
icon: /* @__PURE__ */ jsx(Youtube, {}),
|
|
205
|
-
func: () => {
|
|
206
|
-
showModal("Youtube", "Insert a URL to embed a live preview. Works with YouTube, Google Drive, Vimeo, and more.", (onClose) => /* @__PURE__ */ jsx(AutoEmbedDialog, { embedConfig: YoutubeEmbedConfig, onClose }), true);
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
label: "Figma",
|
|
211
|
-
icon: /* @__PURE__ */ jsx(Figma, {}),
|
|
212
|
-
func: () => {
|
|
213
|
-
showModal("Figma", "Insert a URL to embed a live preview. Works with Figma.", (onClose) => /* @__PURE__ */ jsx(AutoEmbedDialog, { embedConfig: FigmaEmbedConfig, onClose }), true);
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
label: "Callout",
|
|
218
|
-
icon: /* @__PURE__ */ jsx(Lightbulb, { className: "h-4 w-4 text-emerald-500" }),
|
|
219
|
-
func: () => {
|
|
220
|
-
editor.dispatchCommand(INSERT_HINT_COMMAND, "tip");
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
],
|
|
224
|
-
[editor, showModal]
|
|
225
|
-
);
|
|
226
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
227
|
-
/* @__PURE__ */ jsx(
|
|
228
|
-
DropDown,
|
|
229
|
-
{
|
|
230
|
-
values: items,
|
|
231
|
-
TriggerClassName: { width: "115px", border: "none" },
|
|
232
|
-
className: "cursor-pointer",
|
|
233
|
-
TriggerLabel: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
234
|
-
/* @__PURE__ */ jsx(Plus, {}),
|
|
235
|
-
/* @__PURE__ */ jsx("span", { children: "Insert" })
|
|
236
|
-
] }),
|
|
237
|
-
disabled
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
model
|
|
241
|
-
] });
|
|
242
|
-
}
|
|
243
|
-
export {
|
|
244
|
-
InsertNode as default
|
|
245
|
-
};
|