laif-ds 0.1.76 → 0.1.80
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/_virtual/index.js +5 -3
- package/dist/_virtual/index2.js +5 -2
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index7.js +3 -2
- package/dist/_virtual/prism-cpp.js +3 -0
- package/dist/_virtual/prism-cpp2.js +5 -0
- package/dist/_virtual/prism-java.js +3 -0
- package/dist/_virtual/prism-java2.js +5 -0
- package/dist/_virtual/prism-python.js +3 -0
- package/dist/_virtual/prism-python2.js +5 -0
- package/dist/_virtual/prism-rust.js +3 -0
- package/dist/_virtual/prism-rust2.js +5 -0
- package/dist/_virtual/prism-typescript.js +3 -0
- package/dist/_virtual/prism-typescript2.js +5 -0
- package/dist/_virtual/prism.js +3 -0
- package/dist/_virtual/prism2.js +5 -0
- package/dist/components/editor/context/toolbar-context.js +42 -0
- package/dist/components/editor/editor-hooks/use-modal.js +30 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +24 -0
- package/dist/components/editor/editor-ui/content-editable.js +26 -0
- package/dist/components/editor/plugins/actions/actions-plugin.js +7 -0
- package/dist/components/editor/plugins/actions/clear-editor-plugin.js +39 -0
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +53 -0
- package/dist/components/editor/plugins/toolbar/block-format/block-format-data.js +52 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-bulleted-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-check-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-heading.js +31 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-numbered-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-paragraph.js +23 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-quote.js +24 -0
- package/dist/components/editor/plugins/toolbar/block-format-toolbar-plugin.js +56 -0
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +50 -0
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +69 -0
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +34 -0
- package/dist/components/editor/themes/editor-theme.js +112 -0
- package/dist/components/ui/app-editor.js +150 -0
- package/dist/components/ui/app-multiple-select-dropdown.js +2 -2
- package/dist/components/ui/button.js +25 -24
- package/dist/components/ui/calendar.js +9 -9
- package/dist/components/ui/dialog.js +43 -37
- package/dist/components/ui/sidebar.js +20 -19
- package/dist/index.d.ts +23 -1
- package/dist/index.js +48 -44
- package/dist/laif-ds.css +1 -0
- package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +159 -0
- package/dist/node_modules/@lexical/code/LexicalCode.prod.js +236 -0
- package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +46 -0
- package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +89 -0
- package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +108 -0
- package/dist/node_modules/@lexical/link/LexicalLink.prod.js +187 -0
- package/dist/node_modules/@lexical/list/LexicalList.prod.js +729 -0
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +367 -0
- package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +11 -0
- package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +17 -0
- package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +45 -0
- package/dist/node_modules/@lexical/react/LexicalComposerContext.prod.js +22 -0
- package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +55 -0
- package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +49 -0
- package/dist/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js +15 -0
- package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +17 -0
- package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +16 -0
- package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +56 -0
- package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +21 -0
- package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +376 -0
- package/dist/node_modules/@lexical/selection/LexicalSelection.prod.js +107 -0
- package/dist/node_modules/@lexical/table/LexicalTable.prod.js +661 -0
- package/dist/node_modules/@lexical/text/LexicalText.prod.js +37 -0
- package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +102 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/lexical/Lexical.prod.js +4901 -0
- package/dist/node_modules/prismjs/components/prism-c.js +77 -0
- package/dist/node_modules/prismjs/components/prism-clike.js +32 -0
- package/dist/node_modules/prismjs/components/prism-cpp.js +93 -0
- package/dist/node_modules/prismjs/components/prism-css.js +56 -0
- package/dist/node_modules/prismjs/components/prism-java.js +122 -0
- package/dist/node_modules/prismjs/components/prism-javascript.js +138 -0
- package/dist/node_modules/prismjs/components/prism-markdown.js +301 -0
- package/dist/node_modules/prismjs/components/prism-markup.js +174 -0
- package/dist/node_modules/prismjs/components/prism-objectivec.js +11 -0
- package/dist/node_modules/prismjs/components/prism-powershell.js +56 -0
- package/dist/node_modules/prismjs/components/prism-python.js +69 -0
- package/dist/node_modules/prismjs/components/prism-rust.js +124 -0
- package/dist/node_modules/prismjs/components/prism-sql.js +34 -0
- package/dist/node_modules/prismjs/components/prism-swift.js +114 -0
- package/dist/node_modules/prismjs/components/prism-typescript.js +53 -0
- package/dist/node_modules/prismjs/prism.js +1165 -0
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +12 -1
package/dist/_virtual/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
+
var r = t();
|
|
5
|
+
const m = /* @__PURE__ */ e(r);
|
|
4
6
|
export {
|
|
5
|
-
|
|
7
|
+
m as default
|
|
6
8
|
};
|
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
a as default
|
|
5
8
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
-
var t = r();
|
|
5
|
-
const x = /* @__PURE__ */ e(t);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
-
var r = t();
|
|
5
|
-
const m = /* @__PURE__ */ e(r);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as i, useContext as l } from "react";
|
|
4
|
+
const o = i({
|
|
5
|
+
activeEditor: {},
|
|
6
|
+
$updateToolbar: () => {
|
|
7
|
+
},
|
|
8
|
+
blockType: "paragraph",
|
|
9
|
+
setBlockType: () => {
|
|
10
|
+
},
|
|
11
|
+
showModal: () => {
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function x({
|
|
15
|
+
activeEditor: t,
|
|
16
|
+
$updateToolbar: e,
|
|
17
|
+
blockType: r,
|
|
18
|
+
setBlockType: n,
|
|
19
|
+
showModal: a,
|
|
20
|
+
children: u
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ c(
|
|
23
|
+
o.Provider,
|
|
24
|
+
{
|
|
25
|
+
value: {
|
|
26
|
+
activeEditor: t,
|
|
27
|
+
$updateToolbar: e,
|
|
28
|
+
blockType: r,
|
|
29
|
+
setBlockType: n,
|
|
30
|
+
showModal: a
|
|
31
|
+
},
|
|
32
|
+
children: u
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function C() {
|
|
37
|
+
return l(o);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
x as ToolbarContext,
|
|
41
|
+
C as useToolbarContext
|
|
42
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { useState as d, useCallback as i, useMemo as m } from "react";
|
|
4
|
+
import { Dialog as f, DialogContent as h, DialogHeader as p, DialogTitle as C } from "../../ui/dialog.js";
|
|
5
|
+
function x() {
|
|
6
|
+
const [o, r] = d(null), n = i(() => {
|
|
7
|
+
r(null);
|
|
8
|
+
}, []), s = m(() => {
|
|
9
|
+
if (o === null)
|
|
10
|
+
return null;
|
|
11
|
+
const { title: e, content: t } = o;
|
|
12
|
+
return /* @__PURE__ */ l(f, { open: !0, onOpenChange: n, children: /* @__PURE__ */ u(h, { children: [
|
|
13
|
+
/* @__PURE__ */ l(p, { children: /* @__PURE__ */ l(C, { children: e }) }),
|
|
14
|
+
t
|
|
15
|
+
] }) });
|
|
16
|
+
}, [o, n]), a = i(
|
|
17
|
+
(e, t, c = !1) => {
|
|
18
|
+
r({
|
|
19
|
+
closeOnClickOutside: c,
|
|
20
|
+
content: t(n),
|
|
21
|
+
title: e
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
[n]
|
|
25
|
+
);
|
|
26
|
+
return [s, a];
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
x as useEditorModal
|
|
30
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as r } from "react";
|
|
3
|
+
import { useLexicalComposerContext as n } from "../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
4
|
+
import { SELECTION_CHANGE_COMMAND as m, $getSelection as i, COMMAND_PRIORITY_CRITICAL as f } from "../../../node_modules/lexical/Lexical.prod.js";
|
|
5
|
+
import { useToolbarContext as C } from "../context/toolbar-context.js";
|
|
6
|
+
function c(t) {
|
|
7
|
+
const [s] = n(), { activeEditor: o } = C();
|
|
8
|
+
r(() => o.registerCommand(
|
|
9
|
+
m,
|
|
10
|
+
() => {
|
|
11
|
+
const e = i();
|
|
12
|
+
return e && t(e), !1;
|
|
13
|
+
},
|
|
14
|
+
f
|
|
15
|
+
), [s, t]), r(() => {
|
|
16
|
+
o.getEditorState().read(() => {
|
|
17
|
+
const e = i();
|
|
18
|
+
e && t(e);
|
|
19
|
+
});
|
|
20
|
+
}, [o, t]);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
c as useUpdateToolbarHandler
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { ContentEditable as l } from "../../../node_modules/@lexical/react/LexicalContentEditable.prod.js";
|
|
4
|
+
function a({
|
|
5
|
+
placeholder: e,
|
|
6
|
+
className: o,
|
|
7
|
+
placeholderClassName: n
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ t(
|
|
10
|
+
l,
|
|
11
|
+
{
|
|
12
|
+
className: o ?? "ContentEditable__root relative block min-h-72 min-h-full overflow-auto px-8 py-4 focus:outline-none",
|
|
13
|
+
"aria-placeholder": e,
|
|
14
|
+
placeholder: /* @__PURE__ */ t(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: n ?? "text-muted-foreground pointer-events-none absolute top-0 left-0 overflow-hidden px-8 py-[18px] text-ellipsis select-none",
|
|
18
|
+
children: e
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
a as ContentEditable
|
|
26
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useLexicalComposerContext as l } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
4
|
+
import { CLEAR_EDITOR_COMMAND as n } from "../../../../node_modules/lexical/Lexical.prod.js";
|
|
5
|
+
import { Button as e } from "../../../ui/button.js";
|
|
6
|
+
import { Dialog as a, DialogTrigger as d, DialogContent as c, DialogHeader as s, DialogTitle as h, DialogDescription as m, DialogFooter as C, DialogClose as o } from "../../../ui/dialog.js";
|
|
7
|
+
import { Tooltip as u, TooltipTrigger as p, TooltipContent as g } from "../../../ui/tooltip.js";
|
|
8
|
+
import D from "../../../../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
9
|
+
function N() {
|
|
10
|
+
const [t] = l();
|
|
11
|
+
return /* @__PURE__ */ i(a, { children: [
|
|
12
|
+
/* @__PURE__ */ i(u, { disableHoverableContent: !0, children: [
|
|
13
|
+
/* @__PURE__ */ r(p, { asChild: !0, children: /* @__PURE__ */ r(d, { asChild: !0, children: /* @__PURE__ */ r(e, { size: "sm", variant: "ghost", className: "p-2", children: /* @__PURE__ */ r(D, { className: "h-4 w-4" }) }) }) }),
|
|
14
|
+
/* @__PURE__ */ r(g, { children: "Clear Editor" })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ i(c, { children: [
|
|
17
|
+
/* @__PURE__ */ i(s, { children: [
|
|
18
|
+
/* @__PURE__ */ r(h, { children: "Clear Editor" }),
|
|
19
|
+
/* @__PURE__ */ r(m, { children: "Are you sure you want to clear the editor?" })
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ i(C, { children: [
|
|
22
|
+
/* @__PURE__ */ r(o, { asChild: !0, children: /* @__PURE__ */ r(e, { variant: "outline", children: "Cancel" }) }),
|
|
23
|
+
/* @__PURE__ */ r(o, { asChild: !0, children: /* @__PURE__ */ r(
|
|
24
|
+
e,
|
|
25
|
+
{
|
|
26
|
+
variant: "destructive",
|
|
27
|
+
onClick: () => {
|
|
28
|
+
t.dispatchCommand(n, void 0);
|
|
29
|
+
},
|
|
30
|
+
children: "Clear"
|
|
31
|
+
}
|
|
32
|
+
) })
|
|
33
|
+
] })
|
|
34
|
+
] })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
N as ClearEditorActionPlugin
|
|
39
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import { useState as a, useEffect as u } from "react";
|
|
4
|
+
import { useLexicalComposerContext as d } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
5
|
+
import { $rootTextContent as f } from "../../../../node_modules/@lexical/text/LexicalText.prod.js";
|
|
6
|
+
let s = null;
|
|
7
|
+
function h() {
|
|
8
|
+
return window.TextEncoder === void 0 ? null : (s === null && (s = new window.TextEncoder()), s);
|
|
9
|
+
}
|
|
10
|
+
function g(t) {
|
|
11
|
+
const e = h();
|
|
12
|
+
if (e === null) {
|
|
13
|
+
const n = encodeURIComponent(t).match(/%[89ABab]/g);
|
|
14
|
+
return t.length + (n ? n.length : 0);
|
|
15
|
+
}
|
|
16
|
+
return e.encode(t).length;
|
|
17
|
+
}
|
|
18
|
+
const c = (t, e) => {
|
|
19
|
+
if (e === "UTF-8")
|
|
20
|
+
return g(t);
|
|
21
|
+
if (e === "UTF-16")
|
|
22
|
+
return t.length;
|
|
23
|
+
}, i = (t) => t.split(/\s+/).filter((e) => e.length > 0).length;
|
|
24
|
+
function T({
|
|
25
|
+
charset: t = "UTF-16"
|
|
26
|
+
}) {
|
|
27
|
+
const [e] = d(), [n, l] = a(() => {
|
|
28
|
+
const r = e.getEditorState().read(f);
|
|
29
|
+
return {
|
|
30
|
+
characters: c(r, t),
|
|
31
|
+
words: i(r)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
return u(() => e.registerTextContentListener((r) => {
|
|
35
|
+
l({
|
|
36
|
+
characters: c(r, t),
|
|
37
|
+
words: i(r)
|
|
38
|
+
});
|
|
39
|
+
}), [e, t]), /* @__PURE__ */ o("div", { className: "flex gap-2 text-xs whitespace-nowrap text-gray-500", children: [
|
|
40
|
+
/* @__PURE__ */ o("p", { children: [
|
|
41
|
+
n.characters,
|
|
42
|
+
" characters"
|
|
43
|
+
] }),
|
|
44
|
+
"|",
|
|
45
|
+
/* @__PURE__ */ o("p", { children: [
|
|
46
|
+
n.words,
|
|
47
|
+
" words"
|
|
48
|
+
] })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
T as CounterCharacterPlugin
|
|
53
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import e from "../../../../../node_modules/lucide-react/dist/esm/icons/quote.js";
|
|
4
|
+
import i from "../../../../../node_modules/lucide-react/dist/esm/icons/code.js";
|
|
5
|
+
import a from "../../../../../node_modules/lucide-react/dist/esm/icons/list-todo.js";
|
|
6
|
+
import l from "../../../../../node_modules/lucide-react/dist/esm/icons/list.js";
|
|
7
|
+
import s from "../../../../../node_modules/lucide-react/dist/esm/icons/list-ordered.js";
|
|
8
|
+
import c from "../../../../../node_modules/lucide-react/dist/esm/icons/heading-3.js";
|
|
9
|
+
import m from "../../../../../node_modules/lucide-react/dist/esm/icons/heading-2.js";
|
|
10
|
+
import r from "../../../../../node_modules/lucide-react/dist/esm/icons/heading-1.js";
|
|
11
|
+
import t from "../../../../../node_modules/lucide-react/dist/esm/icons/text.js";
|
|
12
|
+
const h = {
|
|
13
|
+
paragraph: {
|
|
14
|
+
label: "Paragrafo",
|
|
15
|
+
icon: /* @__PURE__ */ o(t, { className: "size-4" })
|
|
16
|
+
},
|
|
17
|
+
h1: {
|
|
18
|
+
label: "Titolo 1",
|
|
19
|
+
icon: /* @__PURE__ */ o(r, { className: "size-4" })
|
|
20
|
+
},
|
|
21
|
+
h2: {
|
|
22
|
+
label: "Titolo 2",
|
|
23
|
+
icon: /* @__PURE__ */ o(m, { className: "size-4" })
|
|
24
|
+
},
|
|
25
|
+
h3: {
|
|
26
|
+
label: "Titolo 3",
|
|
27
|
+
icon: /* @__PURE__ */ o(c, { className: "size-4" })
|
|
28
|
+
},
|
|
29
|
+
number: {
|
|
30
|
+
label: "Elenco numerato",
|
|
31
|
+
icon: /* @__PURE__ */ o(s, { className: "size-4" })
|
|
32
|
+
},
|
|
33
|
+
bullet: {
|
|
34
|
+
label: "Elenco puntato",
|
|
35
|
+
icon: /* @__PURE__ */ o(l, { className: "size-4" })
|
|
36
|
+
},
|
|
37
|
+
check: {
|
|
38
|
+
label: "Lista di controllo",
|
|
39
|
+
icon: /* @__PURE__ */ o(a, { className: "size-4" })
|
|
40
|
+
},
|
|
41
|
+
code: {
|
|
42
|
+
label: "Blocco codice",
|
|
43
|
+
icon: /* @__PURE__ */ o(i, { className: "size-4" })
|
|
44
|
+
},
|
|
45
|
+
quote: {
|
|
46
|
+
label: "Citazione",
|
|
47
|
+
icon: /* @__PURE__ */ o(e, { className: "size-4" })
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
h as blockTypeToBlockName
|
|
52
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { INSERT_UNORDERED_LIST_COMMAND as m } from "../../../../../node_modules/@lexical/list/LexicalList.prod.js";
|
|
4
|
+
import { $setBlocksType as n } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
5
|
+
import { $getSelection as c, $isRangeSelection as f, $createParagraphNode as p } from "../../../../../node_modules/lexical/Lexical.prod.js";
|
|
6
|
+
import { useToolbarContext as d } from "../../../context/toolbar-context.js";
|
|
7
|
+
import { blockTypeToBlockName as r } from "./block-format-data.js";
|
|
8
|
+
import { SelectItem as u } from "../../../../ui/select.js";
|
|
9
|
+
const e = "bullet";
|
|
10
|
+
function x() {
|
|
11
|
+
const { activeEditor: o, blockType: a } = d(), i = () => {
|
|
12
|
+
o.update(() => {
|
|
13
|
+
const t = c();
|
|
14
|
+
f(t) && n(t, () => p());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ l(u, { value: e, onPointerDown: () => {
|
|
18
|
+
a !== "number" ? o.dispatchCommand(m, void 0) : i();
|
|
19
|
+
}, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1 font-normal", children: [
|
|
20
|
+
r[e].icon,
|
|
21
|
+
r[e].label
|
|
22
|
+
] }) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
x as FormatBulletedList
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { INSERT_CHECK_LIST_COMMAND as m } from "../../../../../node_modules/@lexical/list/LexicalList.prod.js";
|
|
4
|
+
import { $setBlocksType as n } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
5
|
+
import { $getSelection as l, $isRangeSelection as p, $createParagraphNode as f } from "../../../../../node_modules/lexical/Lexical.prod.js";
|
|
6
|
+
import { useToolbarContext as d } from "../../../context/toolbar-context.js";
|
|
7
|
+
import { blockTypeToBlockName as r } from "./block-format-data.js";
|
|
8
|
+
import { SelectItem as h } from "../../../../ui/select.js";
|
|
9
|
+
const o = "check";
|
|
10
|
+
function g() {
|
|
11
|
+
const { activeEditor: e, blockType: a } = d(), c = () => {
|
|
12
|
+
e.update(() => {
|
|
13
|
+
const t = l();
|
|
14
|
+
p(t) && n(t, () => f());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ i(h, { value: o, onPointerDown: () => {
|
|
18
|
+
a !== "number" ? e.dispatchCommand(m, void 0) : c();
|
|
19
|
+
}, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1 font-normal", children: [
|
|
20
|
+
r[o].icon,
|
|
21
|
+
r[o].label
|
|
22
|
+
] }) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
g as FormatCheckList
|
|
26
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import { $createHeadingNode as s } from "../../../../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
|
|
4
|
+
import { $setBlocksType as p } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
5
|
+
import { $getSelection as f } from "../../../../../node_modules/lexical/Lexical.prod.js";
|
|
6
|
+
import { useToolbarContext as l } from "../../../context/toolbar-context.js";
|
|
7
|
+
import { blockTypeToBlockName as t } from "./block-format-data.js";
|
|
8
|
+
import { SelectItem as d } from "../../../../ui/select.js";
|
|
9
|
+
function y({ levels: r = [] }) {
|
|
10
|
+
const { activeEditor: e, blockType: m } = l(), i = (o) => {
|
|
11
|
+
m !== o && e.update(() => {
|
|
12
|
+
const n = f();
|
|
13
|
+
p(n, () => s(o));
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
return r.map((o) => /* @__PURE__ */ a(
|
|
17
|
+
d,
|
|
18
|
+
{
|
|
19
|
+
value: o,
|
|
20
|
+
onPointerDown: () => i(o),
|
|
21
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1 font-normal", children: [
|
|
22
|
+
t[o].icon,
|
|
23
|
+
t[o].label
|
|
24
|
+
] })
|
|
25
|
+
},
|
|
26
|
+
o
|
|
27
|
+
));
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
y as FormatHeading
|
|
31
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { INSERT_ORDERED_LIST_COMMAND as n } from "../../../../../node_modules/@lexical/list/LexicalList.prod.js";
|
|
4
|
+
import { $setBlocksType as c } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
5
|
+
import { $getSelection as l, $isRangeSelection as p, $createParagraphNode as f } from "../../../../../node_modules/lexical/Lexical.prod.js";
|
|
6
|
+
import { useToolbarContext as d } from "../../../context/toolbar-context.js";
|
|
7
|
+
import { blockTypeToBlockName as r } from "./block-format-data.js";
|
|
8
|
+
import { SelectItem as u } from "../../../../ui/select.js";
|
|
9
|
+
const e = "number";
|
|
10
|
+
function E() {
|
|
11
|
+
const { activeEditor: o, blockType: m } = d(), a = () => {
|
|
12
|
+
o.update(() => {
|
|
13
|
+
const t = l();
|
|
14
|
+
p(t) && c(t, () => f());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ i(u, { value: e, onPointerDown: () => {
|
|
18
|
+
m !== "number" ? o.dispatchCommand(n, void 0) : a();
|
|
19
|
+
}, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1 font-normal", children: [
|
|
20
|
+
r[e].icon,
|
|
21
|
+
r[e].label
|
|
22
|
+
] }) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
E as FormatNumberedList
|
|
26
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { $setBlocksType as n } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
4
|
+
import { $getSelection as c, $isRangeSelection as m, $createParagraphNode as s } from "../../../../../node_modules/lexical/Lexical.prod.js";
|
|
5
|
+
import { useToolbarContext as l } from "../../../context/toolbar-context.js";
|
|
6
|
+
import { blockTypeToBlockName as e } from "./block-format-data.js";
|
|
7
|
+
import { SelectItem as p } from "../../../../ui/select.js";
|
|
8
|
+
const o = "paragraph";
|
|
9
|
+
function T() {
|
|
10
|
+
const { activeEditor: a } = l();
|
|
11
|
+
return /* @__PURE__ */ t(p, { value: o, onPointerDown: () => {
|
|
12
|
+
a.update(() => {
|
|
13
|
+
const r = c();
|
|
14
|
+
m(r) && n(r, () => s());
|
|
15
|
+
});
|
|
16
|
+
}, children: /* @__PURE__ */ i("div", { className: "flex items-center gap-1 font-normal", children: [
|
|
17
|
+
e[o].icon,
|
|
18
|
+
e[o].label
|
|
19
|
+
] }) });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
T as FormatParagraph
|
|
23
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { $createQuoteNode as n } from "../../../../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
|
|
4
|
+
import { $setBlocksType as s } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
5
|
+
import { $getSelection as a } from "../../../../../node_modules/lexical/Lexical.prod.js";
|
|
6
|
+
import { useToolbarContext as l } from "../../../context/toolbar-context.js";
|
|
7
|
+
import { blockTypeToBlockName as o } from "./block-format-data.js";
|
|
8
|
+
import { SelectItem as f } from "../../../../ui/select.js";
|
|
9
|
+
const t = "quote";
|
|
10
|
+
function Q() {
|
|
11
|
+
const { activeEditor: e, blockType: r } = l();
|
|
12
|
+
return /* @__PURE__ */ c(f, { value: "quote", onPointerDown: () => {
|
|
13
|
+
r !== "quote" && e.update(() => {
|
|
14
|
+
const m = a();
|
|
15
|
+
s(m, () => n());
|
|
16
|
+
});
|
|
17
|
+
}, children: /* @__PURE__ */ i("div", { className: "flex items-center gap-1 font-normal", children: [
|
|
18
|
+
o[t].icon,
|
|
19
|
+
o[t].label
|
|
20
|
+
] }) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
Q as FormatQuote
|
|
24
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { $isListNode as d, ListNode as T } from "../../../../node_modules/@lexical/list/LexicalList.prod.js";
|
|
4
|
+
import { $isHeadingNode as u } from "../../../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
|
|
5
|
+
import { $findMatchingParent as y, $getNearestNodeOfType as h } from "../../../../node_modules/@lexical/utils/LexicalUtils.prod.js";
|
|
6
|
+
import { $isRangeSelection as N, $isRootOrShadowRoot as $ } from "../../../../node_modules/lexical/Lexical.prod.js";
|
|
7
|
+
import { useToolbarContext as b } from "../../context/toolbar-context.js";
|
|
8
|
+
import { useUpdateToolbarHandler as L } from "../../editor-hooks/use-update-toolbar.js";
|
|
9
|
+
import { blockTypeToBlockName as s } from "./block-format/block-format-data.js";
|
|
10
|
+
import { Select as S, SelectTrigger as k, SelectContent as w, SelectGroup as O } from "../../../ui/select.js";
|
|
11
|
+
function H({
|
|
12
|
+
children: m
|
|
13
|
+
}) {
|
|
14
|
+
const { activeEditor: p, blockType: i, setBlockType: l } = b();
|
|
15
|
+
function g(n) {
|
|
16
|
+
if (N(n)) {
|
|
17
|
+
const o = n.anchor.getNode();
|
|
18
|
+
let e = o.getKey() === "root" ? o : y(o, (t) => {
|
|
19
|
+
const r = t.getParent();
|
|
20
|
+
return r !== null && $(r);
|
|
21
|
+
});
|
|
22
|
+
e === null && (e = o.getTopLevelElementOrThrow());
|
|
23
|
+
const f = e.getKey();
|
|
24
|
+
if (p.getElementByKey(f) !== null)
|
|
25
|
+
if (d(e)) {
|
|
26
|
+
const t = h(
|
|
27
|
+
o,
|
|
28
|
+
T
|
|
29
|
+
), r = t ? t.getListType() : e.getListType();
|
|
30
|
+
l(r);
|
|
31
|
+
} else {
|
|
32
|
+
const t = u(e) ? e.getTag() : e.getType();
|
|
33
|
+
t in s && l(t);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return L(g), /* @__PURE__ */ c(
|
|
38
|
+
S,
|
|
39
|
+
{
|
|
40
|
+
value: i,
|
|
41
|
+
onValueChange: (n) => {
|
|
42
|
+
l(n);
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ c(k, { className: "!h-8 w-min gap-1", children: [
|
|
46
|
+
s[i].icon,
|
|
47
|
+
/* @__PURE__ */ a("span", { children: s[i].label })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(O, { children: m }) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
H as BlockFormatDropDown
|
|
56
|
+
};
|