@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-EEBA6OAH.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DropDown
|
|
3
|
-
} from "./chunk-LU2XWLOE.mjs";
|
|
4
|
-
import {
|
|
5
|
-
init_react_shim
|
|
6
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
7
|
-
|
|
8
|
-
// src/components/editor/utils/codeLanguages.ts
|
|
9
|
-
init_react_shim();
|
|
10
|
-
import {
|
|
11
|
-
getCodeLanguageOptions as getShikiOptions,
|
|
12
|
-
normalizeCodeLanguage
|
|
13
|
-
} from "@lexical/code-shiki";
|
|
14
|
-
var options = getShikiOptions();
|
|
15
|
-
var friendlyNameMap = new Map(options);
|
|
16
|
-
function getCodeLanguageOptions() {
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
function getLanguageFriendlyName(lang) {
|
|
20
|
-
if (!lang) return "Plain Text";
|
|
21
|
-
const normalized = normalizeCodeLanguage(lang) || lang;
|
|
22
|
-
return friendlyNameMap.get(normalized) || friendlyNameMap.get(lang) || lang;
|
|
23
|
-
}
|
|
24
|
-
function normalizeCodeLang(lang) {
|
|
25
|
-
if (!lang) return "";
|
|
26
|
-
return normalizeCodeLanguage(lang) || lang;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// src/components/ui/drop-downs/code.tsx
|
|
30
|
-
init_react_shim();
|
|
31
|
-
import { jsx } from "react/jsx-runtime";
|
|
32
|
-
function CodeList({
|
|
33
|
-
onCodeLanguageSelect,
|
|
34
|
-
disabled = false,
|
|
35
|
-
codeLanguage
|
|
36
|
-
}) {
|
|
37
|
-
const CODE_LANGUAGE_OPTIONS = getCodeLanguageOptions();
|
|
38
|
-
const languageButtons = CODE_LANGUAGE_OPTIONS.map(([lang, friendlyName]) => ({
|
|
39
|
-
label: friendlyName || lang,
|
|
40
|
-
func: () => onCodeLanguageSelect(lang)
|
|
41
|
-
}));
|
|
42
|
-
return /* @__PURE__ */ jsx(
|
|
43
|
-
DropDown,
|
|
44
|
-
{
|
|
45
|
-
values: languageButtons,
|
|
46
|
-
disabled,
|
|
47
|
-
triggerVariants: "ghost",
|
|
48
|
-
className: "h-7 text-xs px-2 py-0 font-mono text-zinc-700 dark:text-zinc-300 hover:text-zinc-900 dark:hover:text-white",
|
|
49
|
-
TriggerClassName: { maxWidth: "140px", minWidth: "60px" },
|
|
50
|
-
TriggerLabel: getLanguageFriendlyName(codeLanguage) || "Plain Text"
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
getLanguageFriendlyName,
|
|
57
|
-
normalizeCodeLang,
|
|
58
|
-
CodeList
|
|
59
|
-
};
|
package/dist/chunk-EIZMKFHF.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_react_shim
|
|
3
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/editor/plugins/TemplatePlugin/index.tsx
|
|
6
|
-
init_react_shim();
|
|
7
|
-
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
8
|
-
import { $convertFromMarkdownString, TRANSFORMERS } from "@lexical/markdown";
|
|
9
|
-
import { COMMAND_PRIORITY_EDITOR, createCommand } from "lexical";
|
|
10
|
-
import { useEffect } from "react";
|
|
11
|
-
var INSERT_TEMPLATE_COMMAND = createCommand("INSERT_TEMPLATE_COMMAND");
|
|
12
|
-
function TemplatePlugin() {
|
|
13
|
-
const [editor] = useLexicalComposerContext();
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
return editor.registerCommand(
|
|
16
|
-
INSERT_TEMPLATE_COMMAND,
|
|
17
|
-
(markdownContent) => {
|
|
18
|
-
editor.update(() => {
|
|
19
|
-
$convertFromMarkdownString(markdownContent, TRANSFORMERS);
|
|
20
|
-
});
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
23
|
-
COMMAND_PRIORITY_EDITOR
|
|
24
|
-
);
|
|
25
|
-
}, [editor]);
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
INSERT_TEMPLATE_COMMAND,
|
|
31
|
-
TemplatePlugin
|
|
32
|
-
};
|
package/dist/chunk-EVPWKNE4.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_react_shim
|
|
3
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/providers/SharedHistoryContext.tsx
|
|
6
|
-
init_react_shim();
|
|
7
|
-
import { createEmptyHistoryState } from "@lexical/react/LexicalHistoryPlugin";
|
|
8
|
-
import { createContext, useContext, useMemo } from "react";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var Context = createContext({});
|
|
11
|
-
var SharedHistoryContext = ({
|
|
12
|
-
children
|
|
13
|
-
}) => {
|
|
14
|
-
const historyContext = useMemo(
|
|
15
|
-
() => ({ historyState: createEmptyHistoryState() }),
|
|
16
|
-
[]
|
|
17
|
-
);
|
|
18
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value: historyContext, children });
|
|
19
|
-
};
|
|
20
|
-
var useSharedHistoryContext = () => {
|
|
21
|
-
return useContext(Context);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
SharedHistoryContext,
|
|
26
|
-
useSharedHistoryContext
|
|
27
|
-
};
|
package/dist/chunk-FMJ7DGWP.mjs
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatBulletList,
|
|
3
|
-
formatCheckList,
|
|
4
|
-
formatCode,
|
|
5
|
-
formatHeading,
|
|
6
|
-
formatNumberedList,
|
|
7
|
-
formatParagraph,
|
|
8
|
-
formatQuote
|
|
9
|
-
} from "./chunk-6D6QLRYR.mjs";
|
|
10
|
-
import {
|
|
11
|
-
DropDown
|
|
12
|
-
} from "./chunk-LU2XWLOE.mjs";
|
|
13
|
-
import {
|
|
14
|
-
__spreadProps,
|
|
15
|
-
__spreadValues,
|
|
16
|
-
init_react_shim
|
|
17
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
18
|
-
|
|
19
|
-
// src/components/ui/drop-downs/block-format.tsx
|
|
20
|
-
init_react_shim();
|
|
21
|
-
import { useMemo } from "react";
|
|
22
|
-
import {
|
|
23
|
-
Pilcrow,
|
|
24
|
-
Heading1,
|
|
25
|
-
Heading2,
|
|
26
|
-
Heading3,
|
|
27
|
-
Heading4,
|
|
28
|
-
Heading5,
|
|
29
|
-
Heading6,
|
|
30
|
-
List,
|
|
31
|
-
ListTodo,
|
|
32
|
-
ListOrdered,
|
|
33
|
-
Braces,
|
|
34
|
-
Quote
|
|
35
|
-
} from "lucide-react";
|
|
36
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
-
function BlockFormatDropDown({
|
|
38
|
-
editor,
|
|
39
|
-
blockType,
|
|
40
|
-
disabled = false,
|
|
41
|
-
style,
|
|
42
|
-
ShowChevronsUpDown = true,
|
|
43
|
-
side,
|
|
44
|
-
sideOffset
|
|
45
|
-
}) {
|
|
46
|
-
const Blocks = useMemo(
|
|
47
|
-
() => ({
|
|
48
|
-
paragraph: {
|
|
49
|
-
icon: /* @__PURE__ */ jsx(Pilcrow, { className: "size-4" }),
|
|
50
|
-
label: "paragraph",
|
|
51
|
-
desc: "Just start writing plain text.",
|
|
52
|
-
func: () => formatParagraph(editor)
|
|
53
|
-
},
|
|
54
|
-
h1: {
|
|
55
|
-
icon: /* @__PURE__ */ jsx(Heading1, { className: "size-4" }),
|
|
56
|
-
desc: "Heading 1 for main titles.",
|
|
57
|
-
label: "Heading 1",
|
|
58
|
-
func: () => formatHeading(editor, blockType, "h1")
|
|
59
|
-
},
|
|
60
|
-
h2: {
|
|
61
|
-
icon: /* @__PURE__ */ jsx(Heading2, { className: "size-4" }),
|
|
62
|
-
desc: "Heading 2 for major sections.",
|
|
63
|
-
label: "Heading 2",
|
|
64
|
-
func: () => formatHeading(editor, blockType, "h2")
|
|
65
|
-
},
|
|
66
|
-
h3: {
|
|
67
|
-
icon: /* @__PURE__ */ jsx(Heading3, { className: "size-4" }),
|
|
68
|
-
desc: "Heading 3 for sub-sections.",
|
|
69
|
-
label: "Heading 3",
|
|
70
|
-
func: () => formatHeading(editor, blockType, "h3")
|
|
71
|
-
},
|
|
72
|
-
h4: {
|
|
73
|
-
icon: /* @__PURE__ */ jsx(Heading4, { className: "size-4" }),
|
|
74
|
-
desc: "Heading 4 for minor sections.",
|
|
75
|
-
label: "Heading 4",
|
|
76
|
-
func: () => formatHeading(editor, blockType, "h4")
|
|
77
|
-
},
|
|
78
|
-
h5: {
|
|
79
|
-
icon: /* @__PURE__ */ jsx(Heading5, { className: "size-4" }),
|
|
80
|
-
desc: "Heading 5 for small headings.",
|
|
81
|
-
label: "Heading 5",
|
|
82
|
-
func: () => formatHeading(editor, blockType, "h5")
|
|
83
|
-
},
|
|
84
|
-
h6: {
|
|
85
|
-
icon: /* @__PURE__ */ jsx(Heading6, { className: "size-4" }),
|
|
86
|
-
desc: "Heading 6 for tiny headings.",
|
|
87
|
-
label: "Heading 6",
|
|
88
|
-
func: () => formatHeading(editor, blockType, "h6")
|
|
89
|
-
},
|
|
90
|
-
bullet: {
|
|
91
|
-
icon: /* @__PURE__ */ jsx(List, { className: "size-4" }),
|
|
92
|
-
desc: "Bullet list for unordered items.",
|
|
93
|
-
label: "Bullet List",
|
|
94
|
-
func: () => formatBulletList(editor, blockType)
|
|
95
|
-
},
|
|
96
|
-
check: {
|
|
97
|
-
icon: /* @__PURE__ */ jsx(ListTodo, { className: "size-4" }),
|
|
98
|
-
desc: "Checklist for tasks or to-dos.",
|
|
99
|
-
label: "check box",
|
|
100
|
-
func: () => formatCheckList(editor, blockType)
|
|
101
|
-
},
|
|
102
|
-
number: {
|
|
103
|
-
icon: /* @__PURE__ */ jsx(ListOrdered, { className: "size-4" }),
|
|
104
|
-
desc: "Numbered list for ordered items.",
|
|
105
|
-
label: "Numbered list",
|
|
106
|
-
func: () => formatNumberedList(editor, blockType)
|
|
107
|
-
},
|
|
108
|
-
code: {
|
|
109
|
-
icon: /* @__PURE__ */ jsx(Braces, { className: "size-4" }),
|
|
110
|
-
desc: "Code block for snippets.",
|
|
111
|
-
label: "Code",
|
|
112
|
-
func: () => formatCode(editor, blockType)
|
|
113
|
-
},
|
|
114
|
-
quote: {
|
|
115
|
-
icon: /* @__PURE__ */ jsx(Quote, { className: "size-4" }),
|
|
116
|
-
desc: "Blockquote for quotations.",
|
|
117
|
-
label: "Blockquote",
|
|
118
|
-
func: () => formatQuote(editor, blockType)
|
|
119
|
-
}
|
|
120
|
-
}),
|
|
121
|
-
[editor]
|
|
122
|
-
);
|
|
123
|
-
const currentBlock = Blocks[blockType] || Blocks.paragraph;
|
|
124
|
-
return /* @__PURE__ */ jsx(
|
|
125
|
-
DropDown,
|
|
126
|
-
{
|
|
127
|
-
TriggerClassName: __spreadProps(__spreadValues({}, style), { width: "100%" }),
|
|
128
|
-
disabled,
|
|
129
|
-
side,
|
|
130
|
-
sideOffset,
|
|
131
|
-
className: "h-7 min-w-[29px] w-[29px] px-2 border-none cursor-pointer dark:bg-zinc-850 hover:bg-zinc-100 hover:text-zinc-900 dark:border-zinc-800",
|
|
132
|
-
TriggerLabel: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133
|
-
currentBlock.icon,
|
|
134
|
-
/* @__PURE__ */ jsx("span", { className: "max-sm:hidden", children: currentBlock.label })
|
|
135
|
-
] }),
|
|
136
|
-
ShowChevronsUpDown,
|
|
137
|
-
values: Object.values(Blocks)
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export {
|
|
143
|
-
BlockFormatDropDown
|
|
144
|
-
};
|
package/dist/chunk-FYLRS4BG.mjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExcalidrawModal
|
|
3
|
-
} from "./chunk-TC3IISJZ.mjs";
|
|
4
|
-
import {
|
|
5
|
-
$createExcalidrawNode,
|
|
6
|
-
ExcalidrawNode
|
|
7
|
-
} from "./chunk-XZXGYNTY.mjs";
|
|
8
|
-
import {
|
|
9
|
-
init_react_shim
|
|
10
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
11
|
-
|
|
12
|
-
// src/components/editor/plugins/ExcalidrawPlugin/index.tsx
|
|
13
|
-
init_react_shim();
|
|
14
|
-
import "@excalidraw/excalidraw/index.css";
|
|
15
|
-
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
16
|
-
import { $wrapNodeInElement } from "@lexical/utils";
|
|
17
|
-
import {
|
|
18
|
-
$createParagraphNode,
|
|
19
|
-
$insertNodes,
|
|
20
|
-
$isRootOrShadowRoot,
|
|
21
|
-
COMMAND_PRIORITY_EDITOR,
|
|
22
|
-
createCommand
|
|
23
|
-
} from "lexical";
|
|
24
|
-
import { useEffect, useState } from "react";
|
|
25
|
-
import { jsx } from "react/jsx-runtime";
|
|
26
|
-
var INSERT_EXCALIDRAW_COMMAND = createCommand(
|
|
27
|
-
"INSERT_EXCALIDRAW_COMMAND"
|
|
28
|
-
);
|
|
29
|
-
function ExcalidrawPlugin() {
|
|
30
|
-
const [editor] = useLexicalComposerContext();
|
|
31
|
-
const [isModalOpen, setModalOpen] = useState(false);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (!editor.hasNodes([ExcalidrawNode])) {
|
|
34
|
-
throw new Error(
|
|
35
|
-
"ExcalidrawPlugin: ExcalidrawNode not registered on editor"
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return editor.registerCommand(
|
|
39
|
-
INSERT_EXCALIDRAW_COMMAND,
|
|
40
|
-
() => {
|
|
41
|
-
setModalOpen(true);
|
|
42
|
-
return true;
|
|
43
|
-
},
|
|
44
|
-
COMMAND_PRIORITY_EDITOR
|
|
45
|
-
);
|
|
46
|
-
}, [editor]);
|
|
47
|
-
const onClose = () => {
|
|
48
|
-
setModalOpen(false);
|
|
49
|
-
};
|
|
50
|
-
const onDelete = () => {
|
|
51
|
-
setModalOpen(false);
|
|
52
|
-
};
|
|
53
|
-
const onSave = (elements, appState, files) => {
|
|
54
|
-
editor.update(() => {
|
|
55
|
-
const excalidrawNode = $createExcalidrawNode();
|
|
56
|
-
excalidrawNode.setData(
|
|
57
|
-
JSON.stringify({
|
|
58
|
-
appState,
|
|
59
|
-
elements,
|
|
60
|
-
files
|
|
61
|
-
})
|
|
62
|
-
);
|
|
63
|
-
$insertNodes([excalidrawNode]);
|
|
64
|
-
if ($isRootOrShadowRoot(excalidrawNode.getParentOrThrow())) {
|
|
65
|
-
$wrapNodeInElement(excalidrawNode, $createParagraphNode).selectEnd();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
setModalOpen(false);
|
|
69
|
-
};
|
|
70
|
-
return isModalOpen ? /* @__PURE__ */ jsx(
|
|
71
|
-
ExcalidrawModal,
|
|
72
|
-
{
|
|
73
|
-
initialElements: [],
|
|
74
|
-
initialAppState: {},
|
|
75
|
-
initialFiles: {},
|
|
76
|
-
isShown: isModalOpen,
|
|
77
|
-
onDelete,
|
|
78
|
-
onClose,
|
|
79
|
-
onSave,
|
|
80
|
-
closeOnClickOutside: false
|
|
81
|
-
}
|
|
82
|
-
) : null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export {
|
|
86
|
-
INSERT_EXCALIDRAW_COMMAND,
|
|
87
|
-
ExcalidrawPlugin
|
|
88
|
-
};
|