quoin-editor 1.2.3 → 1.4.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/CHANGELOG.md +21 -0
- package/THIRD_PARTY_NOTICES.md +47 -0
- package/dist/ai.cjs +69 -70
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.d.cts +4 -3
- package/dist/ai.d.ts +4 -3
- package/dist/ai.js +4 -5
- package/dist/ai.js.map +1 -1
- package/dist/catalogue.cjs +20 -20
- package/dist/catalogue.d.cts +10 -9
- package/dist/catalogue.d.ts +10 -9
- package/dist/catalogue.js +12 -12
- package/dist/{chunk-35CHEARK.cjs → chunk-3NVFHJFS.cjs} +42 -41
- package/dist/chunk-3NVFHJFS.cjs.map +1 -0
- package/dist/{chunk-BR25RE7U.js → chunk-3YA7FYEL.js} +9 -6
- package/dist/chunk-3YA7FYEL.js.map +1 -0
- package/dist/{chunk-CZ5ZXBWC.cjs → chunk-65WK575V.cjs} +762 -306
- package/dist/chunk-65WK575V.cjs.map +1 -0
- package/dist/{chunk-Y7UKOBSY.js → chunk-6LOYAC5N.js} +7 -6
- package/dist/chunk-6LOYAC5N.js.map +1 -0
- package/dist/{chunk-KMIWUFNM.cjs → chunk-7WSBPD6Z.cjs} +96 -93
- package/dist/chunk-7WSBPD6Z.cjs.map +1 -0
- package/dist/{chunk-TARBFPWC.js → chunk-AC4AFDTI.js} +6 -6
- package/dist/{chunk-TARBFPWC.js.map → chunk-AC4AFDTI.js.map} +1 -1
- package/dist/{chunk-SCFW4JFT.cjs → chunk-AZ2ZNSFN.cjs} +43 -44
- package/dist/chunk-AZ2ZNSFN.cjs.map +1 -0
- package/dist/{chunk-ZVCBTQA3.cjs → chunk-AZF7B2AE.cjs} +10 -10
- package/dist/{chunk-ZVCBTQA3.cjs.map → chunk-AZF7B2AE.cjs.map} +1 -1
- package/dist/{chunk-DQV37F7J.cjs → chunk-FQDNF7MF.cjs} +68 -69
- package/dist/chunk-FQDNF7MF.cjs.map +1 -0
- package/dist/{chunk-25HNTVEI.js → chunk-G25FMFEZ.js} +3 -3
- package/dist/{chunk-25HNTVEI.js.map → chunk-G25FMFEZ.js.map} +1 -1
- package/dist/{chunk-A5LIN7FO.cjs → chunk-H5FM6I5W.cjs} +26 -26
- package/dist/{chunk-A5LIN7FO.cjs.map → chunk-H5FM6I5W.cjs.map} +1 -1
- package/dist/{chunk-YCVNFRL3.js → chunk-IJKGF6SC.js} +4 -4
- package/dist/{chunk-YCVNFRL3.js.map → chunk-IJKGF6SC.js.map} +1 -1
- package/dist/{chunk-4HFE3YFF.js → chunk-KRLHGVJV.js} +8 -7
- package/dist/chunk-KRLHGVJV.js.map +1 -0
- package/dist/{chunk-J552D3A7.js → chunk-MQTLZTIM.js} +448 -25
- package/dist/chunk-MQTLZTIM.js.map +1 -0
- package/dist/{chunk-KXOAV7AT.js → chunk-OS2O6IKX.js} +135 -12
- package/dist/chunk-OS2O6IKX.js.map +1 -0
- package/dist/{chunk-OGBD74IR.cjs → chunk-QJ34MOFV.cjs} +187 -117
- package/dist/chunk-QJ34MOFV.cjs.map +1 -0
- package/dist/{chunk-SAPLIQF2.js → chunk-QOIVLYMW.js} +4 -4
- package/dist/{chunk-SAPLIQF2.js.map → chunk-QOIVLYMW.js.map} +1 -1
- package/dist/{chunk-IGEWAL2J.cjs → chunk-QPOUONJ7.cjs} +32 -31
- package/dist/chunk-QPOUONJ7.cjs.map +1 -0
- package/dist/{chunk-K7JEN3KT.cjs → chunk-QR2NIDUK.cjs} +4 -4
- package/dist/{chunk-K7JEN3KT.cjs.map → chunk-QR2NIDUK.cjs.map} +1 -1
- package/dist/{chunk-4D7HZRNC.js → chunk-R7MYG522.js} +3 -3
- package/dist/{chunk-4D7HZRNC.js.map → chunk-R7MYG522.js.map} +1 -1
- package/dist/{chunk-BNUQ647G.js → chunk-STCJWXP5.js} +5 -6
- package/dist/chunk-STCJWXP5.js.map +1 -0
- package/dist/{chunk-BJIWN7BQ.cjs → chunk-STKGRXSA.cjs} +10 -10
- package/dist/{chunk-BJIWN7BQ.cjs.map → chunk-STKGRXSA.cjs.map} +1 -1
- package/dist/{chunk-5ANJW76W.cjs → chunk-VUYJGFUA.cjs} +23 -22
- package/dist/chunk-VUYJGFUA.cjs.map +1 -0
- package/dist/{chunk-FOEEDJ5R.js → chunk-VVS6JJLI.js} +7 -6
- package/dist/chunk-VVS6JJLI.js.map +1 -0
- package/dist/{chunk-G37GQ5JE.cjs → chunk-VZZPCYA3.cjs} +135 -12
- package/dist/chunk-VZZPCYA3.cjs.map +1 -0
- package/dist/{chunk-JYKSWEXT.cjs → chunk-WN7BZDNH.cjs} +6 -6
- package/dist/{chunk-JYKSWEXT.cjs.map → chunk-WN7BZDNH.cjs.map} +1 -1
- package/dist/{chunk-CCOPHCXX.js → chunk-XFEDJEJF.js} +109 -39
- package/dist/chunk-XFEDJEJF.js.map +1 -0
- package/dist/{chunk-I7OOIEZZ.js → chunk-YEQEBJPM.js} +5 -6
- package/dist/chunk-YEQEBJPM.js.map +1 -0
- package/dist/comments.cjs +54 -54
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.d.cts +4 -3
- package/dist/comments.d.ts +4 -3
- package/dist/comments.js +8 -8
- package/dist/comments.js.map +1 -1
- package/dist/diff.d.cts +7 -5
- package/dist/diff.d.ts +7 -5
- package/dist/docx.cjs +1 -1
- package/dist/docx.d.cts +3 -2
- package/dist/docx.d.ts +3 -2
- package/dist/docx.js +1 -1
- package/dist/embed.cjs +6 -6
- package/dist/embed.d.cts +5 -4
- package/dist/embed.d.ts +5 -4
- package/dist/embed.js +4 -4
- package/dist/emoji-data.cjs +272 -263
- package/dist/emoji-data.cjs.map +1 -1
- package/dist/emoji-data.js +272 -263
- package/dist/emoji-data.js.map +1 -1
- package/dist/{emoji-extension-CmPlRssm.d.ts → emoji-extension-C3o_Y5uC.d.cts} +3 -2
- package/dist/{emoji-extension-zJ6F7hW8.d.cts → emoji-extension-gRKnbW8G.d.ts} +3 -2
- package/dist/emoji.cjs +7 -7
- package/dist/emoji.d.cts +6 -5
- package/dist/emoji.d.ts +6 -5
- package/dist/emoji.js +4 -4
- package/dist/engine.cjs +43 -43
- package/dist/engine.d.cts +7 -6
- package/dist/engine.d.ts +7 -6
- package/dist/engine.js +1 -1
- package/dist/{find-extension-CmFehyul.d.ts → find-extension-BGGsJMu4.d.cts} +3 -2
- package/dist/{find-extension-BcRyE9K4.d.cts → find-extension-B_Ctrs6T.d.ts} +3 -2
- package/dist/find.cjs +8 -8
- package/dist/find.d.cts +5 -4
- package/dist/find.d.ts +5 -4
- package/dist/find.js +4 -4
- package/dist/headless.cjs +59 -59
- package/dist/headless.d.cts +10 -9
- package/dist/headless.d.ts +10 -9
- package/dist/headless.js +2 -2
- package/dist/{index-DiCGV60d.d.ts → index-CsG7OQoq.d.cts} +3 -2
- package/dist/{index-CFPmCee4.d.cts → index-h1llgZM-.d.ts} +3 -2
- package/dist/index.cjs +71 -71
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +3 -3
- package/dist/math.cjs +7 -7
- package/dist/math.d.cts +5 -4
- package/dist/math.d.ts +5 -4
- package/dist/math.js +5 -5
- package/dist/mention.cjs +7 -7
- package/dist/mention.d.cts +4 -3
- package/dist/mention.d.ts +4 -3
- package/dist/mention.js +5 -5
- package/dist/presence.cjs +33 -33
- package/dist/presence.d.cts +5 -4
- package/dist/presence.d.ts +5 -4
- package/dist/presence.js +5 -5
- package/dist/{registry-CXegaw5k.d.ts → registry-DdQaddP1.d.cts} +2 -1
- package/dist/{registry-CXegaw5k.d.cts → registry-DdQaddP1.d.ts} +2 -1
- package/dist/{stats-extension-DisOEbbI.d.ts → stats-extension-XqOTvRaq.d.cts} +3 -2
- package/dist/{stats-extension-Dt1lgP3m.d.cts → stats-extension-oD6D1cYy.d.ts} +3 -2
- package/dist/stats.cjs +7 -7
- package/dist/stats.d.cts +6 -5
- package/dist/stats.d.ts +6 -5
- package/dist/stats.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/{table-extension-DxZz3jqp.d.cts → table-extension-BP47hHoz.d.cts} +3 -2
- package/dist/{table-extension-BTMJnT7J.d.ts → table-extension-v6VB59bF.d.ts} +3 -2
- package/dist/table.cjs +23 -23
- package/dist/table.d.cts +5 -4
- package/dist/table.d.ts +5 -4
- package/dist/table.js +4 -4
- package/dist/{to-html-CNCITCln.d.cts → to-html-1oD-CDle.d.cts} +3 -2
- package/dist/{to-html-C5t7xyaM.d.ts → to-html-CLRBCX0I.d.ts} +3 -2
- package/dist/{toc-extension-DGHywOBv.d.cts → toc-extension-CI6jNOYl.d.cts} +3 -2
- package/dist/{toc-extension-CR9U-l6j.d.ts → toc-extension-CTHWjNJC.d.ts} +3 -2
- package/dist/toc.cjs +7 -7
- package/dist/toc.d.cts +5 -4
- package/dist/toc.d.ts +5 -4
- package/dist/toc.js +4 -4
- package/dist/{types-C6_QkXzy.d.ts → types-BjLcmV00.d.ts} +3 -26
- package/dist/{types-DULc8wwg.d.ts → types-CQ8Vw_7N.d.cts} +27 -1
- package/dist/{types-DULc8wwg.d.cts → types-CQ8Vw_7N.d.ts} +27 -1
- package/dist/{types-CJ7Gq3GX.d.cts → types-DXF9p4qV.d.cts} +3 -26
- package/dist/{view-controller-zNqHm_Qg.d.ts → view-controller-BfVSNZYZ.d.cts} +4 -3
- package/dist/{view-controller-cxQJ5rQb.d.cts → view-controller-p-2x3J7Y.d.ts} +4 -3
- package/dist/view.d.cts +7 -5
- package/dist/view.d.ts +7 -5
- package/dist/yjs.cjs +99 -99
- package/dist/yjs.d.cts +4 -4
- package/dist/yjs.d.ts +4 -4
- package/dist/yjs.js +3 -3
- package/package.json +19 -18
- package/dist/chunk-35CHEARK.cjs.map +0 -1
- package/dist/chunk-4HFE3YFF.js.map +0 -1
- package/dist/chunk-5ANJW76W.cjs.map +0 -1
- package/dist/chunk-BNUQ647G.js.map +0 -1
- package/dist/chunk-BR25RE7U.js.map +0 -1
- package/dist/chunk-CCOPHCXX.js.map +0 -1
- package/dist/chunk-CZ5ZXBWC.cjs.map +0 -1
- package/dist/chunk-DQV37F7J.cjs.map +0 -1
- package/dist/chunk-FOEEDJ5R.js.map +0 -1
- package/dist/chunk-G37GQ5JE.cjs.map +0 -1
- package/dist/chunk-I7OOIEZZ.js.map +0 -1
- package/dist/chunk-IGEWAL2J.cjs.map +0 -1
- package/dist/chunk-J552D3A7.js.map +0 -1
- package/dist/chunk-KMIWUFNM.cjs.map +0 -1
- package/dist/chunk-KXOAV7AT.js.map +0 -1
- package/dist/chunk-OGBD74IR.cjs.map +0 -1
- package/dist/chunk-SCFW4JFT.cjs.map +0 -1
- package/dist/chunk-Y7UKOBSY.js.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
|
|
4
4
|
var chunkA6PGQVTR_cjs = require('./chunk-A6PGQVTR.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
|
|
6
6
|
var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
|
|
7
7
|
var React7 = require('react');
|
|
8
|
-
var lucideReact = require('lucide-react');
|
|
9
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
9
|
var ContextMenuPrimitive = require('@radix-ui/react-context-menu');
|
|
11
10
|
var clsx = require('clsx');
|
|
@@ -39,6 +38,418 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
|
|
|
39
38
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
40
39
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
41
40
|
|
|
41
|
+
function Icon({ name, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
width: "24",
|
|
47
|
+
height: "24",
|
|
48
|
+
viewBox: "0 0 24 24",
|
|
49
|
+
fill: "none",
|
|
50
|
+
stroke: "currentColor",
|
|
51
|
+
strokeWidth: "2",
|
|
52
|
+
strokeLinecap: "round",
|
|
53
|
+
strokeLinejoin: "round",
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
"data-quoin-icon": name,
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
var Check = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" }) });
|
|
61
|
+
var Circle = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "circle", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }) });
|
|
62
|
+
var Copy = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "copy", ...props, children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
65
|
+
] });
|
|
66
|
+
var CopyPlus = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "copy-plus", ...props, children: [
|
|
67
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "15", x2: "15", y1: "12", y2: "18" }),
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", x2: "18", y1: "15", y2: "15" }),
|
|
69
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
70
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
71
|
+
] });
|
|
72
|
+
var GripHorizontal = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "grip-horizontal", ...props, children: [
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "9", r: "1" }),
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "19", cy: "9", r: "1" }),
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "5", cy: "9", r: "1" }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "15", r: "1" }),
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "19", cy: "15", r: "1" }),
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "5", cy: "15", r: "1" })
|
|
79
|
+
] });
|
|
80
|
+
var GripVertical = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "grip-vertical", ...props, children: [
|
|
81
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "12", r: "1" }),
|
|
82
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "5", r: "1" }),
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "19", r: "1" }),
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "12", r: "1" }),
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "5", r: "1" }),
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "19", r: "1" })
|
|
87
|
+
] });
|
|
88
|
+
var Link = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "link", ...props, children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })
|
|
91
|
+
] });
|
|
92
|
+
var Minus = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "minus", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }) });
|
|
93
|
+
var PenLine = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "pen-line", ...props, children: [
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13 21h8" }),
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" })
|
|
96
|
+
] });
|
|
97
|
+
var Pencil = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "pencil", ...props, children: [
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }),
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 5 4 4" })
|
|
100
|
+
] });
|
|
101
|
+
var Plus = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "plus", ...props, children: [
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14" })
|
|
104
|
+
] });
|
|
105
|
+
var Trash = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "trash", ...props, children: [
|
|
106
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 11v6" }),
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 11v6" }),
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 6h18" }),
|
|
110
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
111
|
+
] });
|
|
112
|
+
var Unlink = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "unlink", ...props, children: [
|
|
113
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" }),
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" }),
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", x2: "8", y1: "2", y2: "5" }),
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "2", x2: "5", y1: "8", y2: "8" }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", x2: "16", y1: "19", y2: "22" }),
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "19", x2: "22", y1: "16", y2: "16" })
|
|
119
|
+
] });
|
|
120
|
+
var X = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "x", ...props, children: [
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
123
|
+
] });
|
|
124
|
+
var ArrowDown = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-down", ...props, children: [
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14" }),
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m19 12-7 7-7-7" })
|
|
127
|
+
] });
|
|
128
|
+
var ArrowDownToLine = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-down-to-line", ...props, children: [
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 17V3" }),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 11 6 6 6-6" }),
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 21H5" })
|
|
132
|
+
] });
|
|
133
|
+
var ArrowLeft = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-left", ...props, children: [
|
|
134
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12 19-7-7 7-7" }),
|
|
135
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5" })
|
|
136
|
+
] });
|
|
137
|
+
var ArrowLeftToLine = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-left-to-line", ...props, children: [
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 19V5" }),
|
|
139
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m13 6-6 6 6 6" }),
|
|
140
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 12h14" })
|
|
141
|
+
] });
|
|
142
|
+
var ArrowRight = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-right", ...props, children: [
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }),
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12 5 7 7-7 7" })
|
|
145
|
+
] });
|
|
146
|
+
var ArrowRightToLine = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-right-to-line", ...props, children: [
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 12H3" }),
|
|
148
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m11 18 6-6-6-6" }),
|
|
149
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5v14" })
|
|
150
|
+
] });
|
|
151
|
+
var ArrowUp = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-up", ...props, children: [
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m5 12 7-7 7 7" }),
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 19V5" })
|
|
154
|
+
] });
|
|
155
|
+
var ArrowUpToLine = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "arrow-up-to-line", ...props, children: [
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 3h14" }),
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m18 13-6-6-6 6" }),
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 7v14" })
|
|
159
|
+
] });
|
|
160
|
+
var ChevronDown = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-down", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6" }) });
|
|
161
|
+
var ChevronRight = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" }) });
|
|
162
|
+
var ChevronUp = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-up", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m18 15-6-6-6 6" }) });
|
|
163
|
+
var ExternalLink = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "external-link", ...props, children: [
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 3h6v6" }),
|
|
165
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 14 21 3" }),
|
|
166
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
|
|
167
|
+
] });
|
|
168
|
+
var Redo2 = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "redo-2", ...props, children: [
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 14 5-5-5-5" }),
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" })
|
|
171
|
+
] });
|
|
172
|
+
var Repeat2 = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "repeat-2", ...props, children: [
|
|
173
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m2 9 3-3 3 3" }),
|
|
174
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13 18H7a2 2 0 0 1-2-2V6" }),
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m22 15-3 3-3-3" }),
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 6h6a2 2 0 0 1 2 2v10" })
|
|
177
|
+
] });
|
|
178
|
+
var SendHorizontal = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "send-horizontal", ...props, children: [
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" }),
|
|
180
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 12h16" })
|
|
181
|
+
] });
|
|
182
|
+
var Undo2 = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "undo-2", ...props, children: [
|
|
183
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 14 4 9l5-5" }),
|
|
184
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" })
|
|
185
|
+
] });
|
|
186
|
+
var AppWindow = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "app-window", ...props, children: [
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" }),
|
|
188
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 4v4" }),
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 8h20" }),
|
|
190
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 4v4" })
|
|
191
|
+
] });
|
|
192
|
+
var Bookmark = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "bookmark", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z" }) });
|
|
193
|
+
var Download = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "download", ...props, children: [
|
|
194
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 15V3" }),
|
|
195
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
196
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m7 10 5 5 5-5" })
|
|
197
|
+
] });
|
|
198
|
+
var FileArchive = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "file-archive", ...props, children: [
|
|
199
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5" }),
|
|
200
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }),
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 12v-1" }),
|
|
202
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 18v-2" }),
|
|
203
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 7V6" }),
|
|
204
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "20", r: "2" })
|
|
205
|
+
] });
|
|
206
|
+
var FileIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "file", ...props, children: [
|
|
207
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }),
|
|
208
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v5a1 1 0 0 0 1 1h5" })
|
|
209
|
+
] });
|
|
210
|
+
var FileImage = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "file-image", ...props, children: [
|
|
211
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }),
|
|
212
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }),
|
|
213
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "12", r: "2" }),
|
|
214
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22" })
|
|
215
|
+
] });
|
|
216
|
+
var FileMusic = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "file-music", ...props, children: [
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.35" }),
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }),
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 20v-7l3 1.474" }),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6", cy: "20", r: "2" })
|
|
221
|
+
] });
|
|
222
|
+
var FilePlay = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "file-play", ...props, children: [
|
|
223
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }),
|
|
224
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }),
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z" })
|
|
226
|
+
] });
|
|
227
|
+
var FileText = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "file-text", ...props, children: [
|
|
228
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }),
|
|
229
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }),
|
|
230
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 9H8" }),
|
|
231
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 13H8" }),
|
|
232
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 17H8" })
|
|
233
|
+
] });
|
|
234
|
+
var Image = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "image", ...props, children: [
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2" }),
|
|
236
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "9", r: "2" }),
|
|
237
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
238
|
+
] });
|
|
239
|
+
var Paperclip = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "paperclip", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }) });
|
|
240
|
+
var Upload = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "upload", ...props, children: [
|
|
241
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 3v12" }),
|
|
242
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m17 8-5-5-5 5" }),
|
|
243
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" })
|
|
244
|
+
] });
|
|
245
|
+
var AlignCenter = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "align-center", ...props, children: [
|
|
246
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5H3" }),
|
|
247
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 12H7" }),
|
|
248
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 19H5" })
|
|
249
|
+
] });
|
|
250
|
+
var AlignJustify = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "align-justify", ...props, children: [
|
|
251
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 5h18" }),
|
|
252
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 12h18" }),
|
|
253
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 19h18" })
|
|
254
|
+
] });
|
|
255
|
+
var AlignLeft = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "align-left", ...props, children: [
|
|
256
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5H3" }),
|
|
257
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 12H3" }),
|
|
258
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 19H3" })
|
|
259
|
+
] });
|
|
260
|
+
var AlignRight = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "align-right", ...props, children: [
|
|
261
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5H3" }),
|
|
262
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12H9" }),
|
|
263
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 19H7" })
|
|
264
|
+
] });
|
|
265
|
+
var List = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "list", ...props, children: [
|
|
266
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 5h.01" }),
|
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 12h.01" }),
|
|
268
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 19h.01" }),
|
|
269
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5h13" }),
|
|
270
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 12h13" }),
|
|
271
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 19h13" })
|
|
272
|
+
] });
|
|
273
|
+
var ListCollapse = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "list-collapse", ...props, children: [
|
|
274
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 5h11" }),
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 12h11" }),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 19h11" }),
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m3 10 3-3-3-3" }),
|
|
278
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m3 20 3-3-3-3" })
|
|
279
|
+
] });
|
|
280
|
+
var ListIndentDecrease = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "list-indent-decrease", ...props, children: [
|
|
281
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5H11" }),
|
|
282
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12H11" }),
|
|
283
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 19H11" }),
|
|
284
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m7 8-4 4 4 4" })
|
|
285
|
+
] });
|
|
286
|
+
var ListIndentIncrease = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "list-indent-increase", ...props, children: [
|
|
287
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5H11" }),
|
|
288
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12H11" }),
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 19H11" }),
|
|
290
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m3 8 4 4-4 4" })
|
|
291
|
+
] });
|
|
292
|
+
var ListOrdered = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "list-ordered", ...props, children: [
|
|
293
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 5h10" }),
|
|
294
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 12h10" }),
|
|
295
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 19h10" }),
|
|
296
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4h1v5" }),
|
|
297
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 9h2" }),
|
|
298
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" })
|
|
299
|
+
] });
|
|
300
|
+
var ListTodo = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "list-todo", ...props, children: [
|
|
301
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13 5h8" }),
|
|
302
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13 12h8" }),
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13 19h8" }),
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m3 17 2 2 4-4" }),
|
|
305
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "6", height: "6", rx: "1" })
|
|
306
|
+
] });
|
|
307
|
+
var Table = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "table", ...props, children: [
|
|
308
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 3v18" }),
|
|
309
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
310
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 9h18" }),
|
|
311
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 15h18" })
|
|
312
|
+
] });
|
|
313
|
+
var TableOfContents = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "table-of-contents", ...props, children: [
|
|
314
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 5H3" }),
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 12H3" }),
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 19H3" }),
|
|
317
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 5h.01" }),
|
|
318
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12h.01" }),
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 19h.01" })
|
|
320
|
+
] });
|
|
321
|
+
var Droplet = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "droplet", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) });
|
|
322
|
+
var Keyboard = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "keyboard", ...props, children: [
|
|
323
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 8h.01" }),
|
|
324
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 12h.01" }),
|
|
325
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 8h.01" }),
|
|
326
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 12h.01" }),
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 8h.01" }),
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 8h.01" }),
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 16h10" }),
|
|
330
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 12h.01" }),
|
|
331
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "20", height: "16", x: "2", y: "4", rx: "2" })
|
|
332
|
+
] });
|
|
333
|
+
var MessageSquare = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "message-square", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" }) });
|
|
334
|
+
var MessageSquarePlus = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "message-square-plus", ...props, children: [
|
|
335
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" }),
|
|
336
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v6" }),
|
|
337
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 11h6" })
|
|
338
|
+
] });
|
|
339
|
+
var Palette = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "palette", ...props, children: [
|
|
340
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" }),
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }),
|
|
342
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }),
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }),
|
|
344
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" })
|
|
345
|
+
] });
|
|
346
|
+
var Radical = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "radical", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 12h3.28a1 1 0 0 1 .948.684l2.298 7.934a.5.5 0 0 0 .96-.044L13.82 4.771A1 1 0 0 1 14.792 4H21" }) });
|
|
347
|
+
var Sigma = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "sigma", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2" }) });
|
|
348
|
+
var SmilePlus = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "smile-plus", ...props, children: [
|
|
349
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.267 2.08a10 10 0 108.653 8.653" }),
|
|
350
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 10V9" }),
|
|
351
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 5h6" }),
|
|
352
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.472 15a6 6 0 01-8.943 0" }),
|
|
353
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 2v6" }),
|
|
354
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 10V9" })
|
|
355
|
+
] });
|
|
356
|
+
var Sparkles = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "sparkles", ...props, children: [
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" }),
|
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 2v4" }),
|
|
359
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 4h-4" }),
|
|
360
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "4", cy: "20", r: "2" })
|
|
361
|
+
] });
|
|
362
|
+
var Sticker = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "sticker", ...props, children: [
|
|
363
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z" }),
|
|
364
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 3v5a1 1 0 0 0 1 1h5" }),
|
|
365
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 13h.01" }),
|
|
366
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 13h.01" }),
|
|
367
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 16s.8 1 2 1c1.3 0 2-1 2-1" })
|
|
368
|
+
] });
|
|
369
|
+
var Baseline = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "baseline", ...props, children: [
|
|
370
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 20h16" }),
|
|
371
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 16 6-12 6 12" }),
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 12h8" })
|
|
373
|
+
] });
|
|
374
|
+
var Bold = (props) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "bold", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" }) });
|
|
375
|
+
var CaseSensitive = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "case-sensitive", ...props, children: [
|
|
376
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16" }),
|
|
377
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 9v7" }),
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.304 13h6.392" }),
|
|
379
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "18.5", cy: "12.5", r: "3.5" })
|
|
380
|
+
] });
|
|
381
|
+
var Code = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "code", ...props, children: [
|
|
382
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m16 18 6-6-6-6" }),
|
|
383
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m8 6-6 6 6 6" })
|
|
384
|
+
] });
|
|
385
|
+
var Heading1 = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "heading-1", ...props, children: [
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 12h8" }),
|
|
387
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 18V6" }),
|
|
388
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 18V6" }),
|
|
389
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m17 12 3-2v8" })
|
|
390
|
+
] });
|
|
391
|
+
var Heading2 = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "heading-2", ...props, children: [
|
|
392
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 12h8" }),
|
|
393
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 18V6" }),
|
|
394
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 18V6" }),
|
|
395
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1" })
|
|
396
|
+
] });
|
|
397
|
+
var Heading3 = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "heading-3", ...props, children: [
|
|
398
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 12h8" }),
|
|
399
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 18V6" }),
|
|
400
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 18V6" }),
|
|
401
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" }),
|
|
402
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" })
|
|
403
|
+
] });
|
|
404
|
+
var Italic = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "italic", ...props, children: [
|
|
405
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "19", x2: "10", y1: "4", y2: "4" }),
|
|
406
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "14", x2: "5", y1: "20", y2: "20" }),
|
|
407
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "15", x2: "9", y1: "4", y2: "20" })
|
|
408
|
+
] });
|
|
409
|
+
var Regex = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "regex", ...props, children: [
|
|
410
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 3v10" }),
|
|
411
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12.67 5.5 8.66 5" }),
|
|
412
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12.67 10.5 8.66-5" }),
|
|
413
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z" })
|
|
414
|
+
] });
|
|
415
|
+
var Strikethrough = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "strikethrough", ...props, children: [
|
|
416
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 4H9a3 3 0 0 0-2.83 4" }),
|
|
417
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 12a4 4 0 0 1 0 8H6" }),
|
|
418
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", x2: "20", y1: "12", y2: "12" })
|
|
419
|
+
] });
|
|
420
|
+
var Subscript = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "subscript", ...props, children: [
|
|
421
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m4 5 8 8" }),
|
|
422
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12 5-8 8" }),
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" })
|
|
424
|
+
] });
|
|
425
|
+
var Superscript = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "superscript", ...props, children: [
|
|
426
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m4 19 8-8" }),
|
|
427
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12 19-8-8" }),
|
|
428
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06" })
|
|
429
|
+
] });
|
|
430
|
+
var TextQuote = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "text-quote", ...props, children: [
|
|
431
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 5H3" }),
|
|
432
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12H8" }),
|
|
433
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 19H8" }),
|
|
434
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 12v7" })
|
|
435
|
+
] });
|
|
436
|
+
var Type = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "type", ...props, children: [
|
|
437
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 4v16" }),
|
|
438
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" }),
|
|
439
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 20h6" })
|
|
440
|
+
] });
|
|
441
|
+
var Underline = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "underline", ...props, children: [
|
|
442
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }),
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", x2: "20", y1: "20", y2: "20" })
|
|
444
|
+
] });
|
|
445
|
+
var WholeWord = (props) => /* @__PURE__ */ jsxRuntime.jsxs(Icon, { name: "whole-word", ...props, children: [
|
|
446
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "12", r: "3" }),
|
|
447
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 9v6" }),
|
|
448
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "17", cy: "12", r: "3" }),
|
|
449
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 7v8" }),
|
|
450
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1" })
|
|
451
|
+
] });
|
|
452
|
+
|
|
42
453
|
// src/blocks/file/format-size.ts
|
|
43
454
|
var UNITS = ["B", "KB", "MB", "GB", "TB"];
|
|
44
455
|
function formatSize(bytes) {
|
|
@@ -369,35 +780,35 @@ var coreBlocks = [
|
|
|
369
780
|
chunkA6PGQVTR_cjs.defineBlock({
|
|
370
781
|
type: "MARKDOWN",
|
|
371
782
|
label: "Markdown",
|
|
372
|
-
icon:
|
|
783
|
+
icon: FileText,
|
|
373
784
|
preview: MarkdownPreview,
|
|
374
785
|
initialData: () => ({ markdown: "" })
|
|
375
786
|
}),
|
|
376
787
|
chunkA6PGQVTR_cjs.defineBlock({
|
|
377
788
|
type: "CALLOUT",
|
|
378
789
|
label: "Callout",
|
|
379
|
-
icon:
|
|
790
|
+
icon: MessageSquare,
|
|
380
791
|
preview: CalloutPreview,
|
|
381
792
|
initialData: () => ({ tone: "info", body: "" })
|
|
382
793
|
}),
|
|
383
794
|
chunkA6PGQVTR_cjs.defineBlock({
|
|
384
795
|
type: "CODE",
|
|
385
796
|
label: "Code",
|
|
386
|
-
icon:
|
|
797
|
+
icon: Code,
|
|
387
798
|
preview: CodePreview,
|
|
388
799
|
initialData: () => ({ language: "", code: "" })
|
|
389
800
|
}),
|
|
390
801
|
chunkA6PGQVTR_cjs.defineBlock({
|
|
391
802
|
type: "IMAGE",
|
|
392
803
|
label: "Image",
|
|
393
|
-
icon:
|
|
804
|
+
icon: Image,
|
|
394
805
|
preview: ImagePreview,
|
|
395
806
|
initialData: () => ({ storageKey: "", alt: "" })
|
|
396
807
|
}),
|
|
397
808
|
chunkA6PGQVTR_cjs.defineBlock({
|
|
398
809
|
type: "FILE",
|
|
399
810
|
label: "File",
|
|
400
|
-
icon:
|
|
811
|
+
icon: Paperclip,
|
|
401
812
|
preview: FilePreview,
|
|
402
813
|
initialData: () => ({ storageKey: "", filename: "" })
|
|
403
814
|
})
|
|
@@ -408,7 +819,7 @@ function selectNode(controller, blockId) {
|
|
|
408
819
|
const { editor } = controller;
|
|
409
820
|
const { selection } = editor.state;
|
|
410
821
|
if (selection?.kind === "node" && selection.block === blockId) return;
|
|
411
|
-
|
|
822
|
+
chunkQJ34MOFV_cjs.dispatchSelection(controller, chunkVZZPCYA3_cjs.nodeSelection(blockId));
|
|
412
823
|
}
|
|
413
824
|
function focusNode(controller, blockId) {
|
|
414
825
|
selectNode(controller, blockId);
|
|
@@ -459,7 +870,7 @@ function createVoidEditing() {
|
|
|
459
870
|
start?.();
|
|
460
871
|
};
|
|
461
872
|
return {
|
|
462
|
-
extension:
|
|
873
|
+
extension: chunkVZZPCYA3_cjs.defineExtension({
|
|
463
874
|
name: "void-editing",
|
|
464
875
|
priority: ABOVE_CORE_KEYS,
|
|
465
876
|
keymap: { Enter: openEditor },
|
|
@@ -629,7 +1040,7 @@ var ContextMenuItem = /* @__PURE__ */ React7__namespace.forwardRef(function Cont
|
|
|
629
1040
|
var ContextMenuRadioGroup = /* @__PURE__ */ React7__namespace.forwardRef(function ContextMenuRadioGroup2(props, ref) {
|
|
630
1041
|
return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.RadioGroup, { ref, "data-slot": "context-menu-radio-group", ...props });
|
|
631
1042
|
});
|
|
632
|
-
var ContextMenuRadioItem = /* @__PURE__ */ React7__namespace.forwardRef(function ContextMenuRadioItem2({ className, children, indicator = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1043
|
+
var ContextMenuRadioItem = /* @__PURE__ */ React7__namespace.forwardRef(function ContextMenuRadioItem2({ className, children, indicator = /* @__PURE__ */ jsxRuntime.jsx(Circle, { className: "size-2 fill-current" }), ...props }, ref) {
|
|
633
1044
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
634
1045
|
ContextMenuPrimitive__namespace.RadioItem,
|
|
635
1046
|
{
|
|
@@ -681,7 +1092,7 @@ var ContextMenuSubTrigger = /* @__PURE__ */ React7__namespace.forwardRef(functio
|
|
|
681
1092
|
...props,
|
|
682
1093
|
children: [
|
|
683
1094
|
children,
|
|
684
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1095
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "ml-auto size-4" })
|
|
685
1096
|
]
|
|
686
1097
|
}
|
|
687
1098
|
);
|
|
@@ -736,32 +1147,32 @@ function settle(tr, before) {
|
|
|
736
1147
|
const { schema } = tr.before;
|
|
737
1148
|
const result = tr.selection;
|
|
738
1149
|
if (result?.kind !== "blocks" || before?.kind === "blocks") return result;
|
|
739
|
-
const ids =
|
|
740
|
-
const head =
|
|
741
|
-
if (head !== null && ids.includes(head) &&
|
|
742
|
-
return
|
|
1150
|
+
const ids = chunkVZZPCYA3_cjs.selectedBlockIds(doc, result);
|
|
1151
|
+
const head = chunkVZZPCYA3_cjs.headBlockId(before);
|
|
1152
|
+
if (head !== null && ids.includes(head) && chunkVZZPCYA3_cjs.validateSelection(doc, schema, before) === before) return before;
|
|
1153
|
+
return chunkVZZPCYA3_cjs.endOf(doc, schema, ids[0]);
|
|
743
1154
|
}
|
|
744
1155
|
function runOnBlocks(controller, blockIds, command) {
|
|
745
1156
|
const { state } = controller.editor;
|
|
746
1157
|
const ids = blockIds.filter((id) => state.doc.index.has(id));
|
|
747
1158
|
if (ids.length === 0) return false;
|
|
748
1159
|
const before = state.selection;
|
|
749
|
-
const exact = chunkWZA5S5EJ_cjs.sameItems(
|
|
750
|
-
const ran = exact ? before :
|
|
751
|
-
const { ok, tr } =
|
|
752
|
-
const result = ok && tr !== null ? tr : new
|
|
1160
|
+
const exact = chunkWZA5S5EJ_cjs.sameItems(chunkVZZPCYA3_cjs.selectedBlockIds(state.doc, before), ids);
|
|
1161
|
+
const ran = exact ? before : chunkVZZPCYA3_cjs.blockRangeSelection(ids[0], ids[ids.length - 1]);
|
|
1162
|
+
const { ok, tr } = chunkVZZPCYA3_cjs.runCommands(state, [chunkVZZPCYA3_cjs.setSelection(ran), command]);
|
|
1163
|
+
const result = ok && tr !== null ? tr : new chunkVZZPCYA3_cjs.Transaction(state).setSelection(ran);
|
|
753
1164
|
const settled = exact ? result.selection : settle(result, before);
|
|
754
|
-
if (!
|
|
755
|
-
if (result.docChanged || !
|
|
1165
|
+
if (!chunkVZZPCYA3_cjs.sameSelection(settled, result.selection)) result.setSelection(settled);
|
|
1166
|
+
if (result.docChanged || !chunkVZZPCYA3_cjs.sameSelection(result.selection, before)) controller.dispatch(result);
|
|
756
1167
|
return ok;
|
|
757
1168
|
}
|
|
758
1169
|
var noChange = () => true;
|
|
759
1170
|
|
|
760
1171
|
// src/gutter/block-menu-items.ts
|
|
761
|
-
var rangeOf = (blockIds) =>
|
|
1172
|
+
var rangeOf = (blockIds) => chunkVZZPCYA3_cjs.blockRangeSelection(blockIds[0], blockIds[blockIds.length - 1]);
|
|
762
1173
|
function selectedWith(state, blockId) {
|
|
763
1174
|
const { doc, selection } = state;
|
|
764
|
-
const selected =
|
|
1175
|
+
const selected = chunkVZZPCYA3_cjs.selectedBlockIds(doc, selection);
|
|
765
1176
|
const ofBlocks = selection?.kind === "blocks" || selection?.kind === "text" && selected.length > 1;
|
|
766
1177
|
return ofBlocks && selected.includes(blockId) ? selected : null;
|
|
767
1178
|
}
|
|
@@ -770,7 +1181,7 @@ function menuTargets(state, blockId) {
|
|
|
770
1181
|
if (selected !== null) return selected;
|
|
771
1182
|
const { doc } = state;
|
|
772
1183
|
const index = chunkWZA5S5EJ_cjs.requireBlockIndex(doc, blockId);
|
|
773
|
-
return doc.blocks.slice(index,
|
|
1184
|
+
return doc.blocks.slice(index, chunkVZZPCYA3_cjs.descendantsEnd(doc, index)).map((block) => block.id);
|
|
774
1185
|
}
|
|
775
1186
|
function styleTargets(state, blockId) {
|
|
776
1187
|
return selectedWith(state, blockId) ?? [blockId];
|
|
@@ -780,12 +1191,12 @@ function menuActions(core, extra = []) {
|
|
|
780
1191
|
}
|
|
781
1192
|
function markdownOf(editor, blockIds, resolveAssetUrl) {
|
|
782
1193
|
const { doc } = editor.state;
|
|
783
|
-
const range =
|
|
1194
|
+
const range = chunkVZZPCYA3_cjs.selectedBlockRange(doc, rangeOf(blockIds));
|
|
784
1195
|
if (range === null) return "";
|
|
785
1196
|
const blocks = editor.codec.blocksFromDoc(chunkWZA5S5EJ_cjs.createDoc(doc.blocks.slice(range.start, range.end)));
|
|
786
|
-
return
|
|
1197
|
+
return chunkVZZPCYA3_cjs.toMarkdown(blocks, { schema: editor.schema, resolveAssetUrl, comments: false });
|
|
787
1198
|
}
|
|
788
|
-
var applies = (command) => (state, blockIds) => blockIds.every((id) => state.doc.index.has(id)) &&
|
|
1199
|
+
var applies = (command) => (state, blockIds) => blockIds.every((id) => state.doc.index.has(id)) && chunkVZZPCYA3_cjs.runCommands(state, [chunkVZZPCYA3_cjs.setSelection(rangeOf(blockIds)), command]).ok;
|
|
789
1200
|
function coreBlockMenuActions(labels, options) {
|
|
790
1201
|
const copy = (controller, blockIds, text2) => {
|
|
791
1202
|
void copyText(text2).then((copied) => {
|
|
@@ -797,44 +1208,44 @@ function coreBlockMenuActions(labels, options) {
|
|
|
797
1208
|
{
|
|
798
1209
|
id: "duplicate",
|
|
799
1210
|
label: labels.duplicate,
|
|
800
|
-
icon:
|
|
1211
|
+
icon: CopyPlus,
|
|
801
1212
|
shortcut: "Mod-d",
|
|
802
|
-
run: (controller, blockIds) => runOnBlocks(controller, blockIds,
|
|
1213
|
+
run: (controller, blockIds) => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.duplicateBlocks())
|
|
803
1214
|
},
|
|
804
1215
|
{
|
|
805
1216
|
id: "copy",
|
|
806
1217
|
label: labels.copy,
|
|
807
|
-
icon:
|
|
1218
|
+
icon: Copy,
|
|
808
1219
|
run: (controller, blockIds) => copy(controller, blockIds, markdownOf(controller.editor, blockIds, options.resolveAssetUrl))
|
|
809
1220
|
},
|
|
810
1221
|
{
|
|
811
1222
|
id: "copy-link",
|
|
812
1223
|
label: labels.copyLink,
|
|
813
|
-
icon:
|
|
1224
|
+
icon: Link,
|
|
814
1225
|
run: (controller, blockIds) => copy(controller, blockIds, options.blockLink(blockIds[0]))
|
|
815
1226
|
},
|
|
816
1227
|
{
|
|
817
1228
|
id: "move-up",
|
|
818
1229
|
label: labels.moveUp,
|
|
819
|
-
icon:
|
|
1230
|
+
icon: ArrowUp,
|
|
820
1231
|
shortcut: "Mod-Shift-ArrowUp",
|
|
821
|
-
run: (controller, blockIds) => runOnBlocks(controller, blockIds,
|
|
822
|
-
available: applies(
|
|
1232
|
+
run: (controller, blockIds) => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.moveBlocksUp),
|
|
1233
|
+
available: applies(chunkVZZPCYA3_cjs.moveBlocksUp)
|
|
823
1234
|
},
|
|
824
1235
|
{
|
|
825
1236
|
id: "move-down",
|
|
826
1237
|
label: labels.moveDown,
|
|
827
|
-
icon:
|
|
1238
|
+
icon: ArrowDown,
|
|
828
1239
|
shortcut: "Mod-Shift-ArrowDown",
|
|
829
|
-
run: (controller, blockIds) => runOnBlocks(controller, blockIds,
|
|
830
|
-
available: applies(
|
|
1240
|
+
run: (controller, blockIds) => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.moveBlocksDown),
|
|
1241
|
+
available: applies(chunkVZZPCYA3_cjs.moveBlocksDown)
|
|
831
1242
|
},
|
|
832
1243
|
{
|
|
833
1244
|
id: "delete",
|
|
834
1245
|
label: labels.delete,
|
|
835
|
-
icon:
|
|
1246
|
+
icon: Trash,
|
|
836
1247
|
destructive: true,
|
|
837
|
-
run: (controller, blockIds) => runOnBlocks(controller, blockIds,
|
|
1248
|
+
run: (controller, blockIds) => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.deleteBlocks)
|
|
838
1249
|
}
|
|
839
1250
|
];
|
|
840
1251
|
}
|
|
@@ -870,8 +1281,8 @@ function calloutTone(value) {
|
|
|
870
1281
|
function calloutIcon(attrs, tone) {
|
|
871
1282
|
return typeof attrs.icon === "string" && attrs.icon !== "" ? attrs.icon : TONE_ICONS[tone];
|
|
872
1283
|
}
|
|
873
|
-
function MenuIcon({ icon:
|
|
874
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1284
|
+
function MenuIcon({ icon: Icon2 }) {
|
|
1285
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4" }) });
|
|
875
1286
|
}
|
|
876
1287
|
var sharedTone = (blocks) => {
|
|
877
1288
|
const tones = new Set(blocks.map((block) => calloutTone(block.attrs.tone)));
|
|
@@ -880,18 +1291,18 @@ var sharedTone = (blocks) => {
|
|
|
880
1291
|
function CalloutMenus({ kit, controller, blocks }) {
|
|
881
1292
|
const labels = useLabels();
|
|
882
1293
|
const blockIds = blocks.map((block) => block.id);
|
|
883
|
-
const apply = (patch) => runOnBlocks(controller, blockIds,
|
|
1294
|
+
const apply = (patch) => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.setAttrs(patch));
|
|
884
1295
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
885
1296
|
/* @__PURE__ */ jsxRuntime.jsxs(kit.Sub, { children: [
|
|
886
1297
|
/* @__PURE__ */ jsxRuntime.jsxs(kit.SubTrigger, { children: [
|
|
887
|
-
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon:
|
|
1298
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: Droplet }),
|
|
888
1299
|
labels.tone
|
|
889
1300
|
] }),
|
|
890
|
-
/* @__PURE__ */ jsxRuntime.jsx(kit.SubContent, { children: /* @__PURE__ */ jsxRuntime.jsx(kit.RadioGroup, { value: sharedTone(blocks), onValueChange: (tone) => apply({ tone }), children: CALLOUT_TONES.map((tone) => /* @__PURE__ */ jsxRuntime.jsx(kit.RadioItem, { value: tone, indicator: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1301
|
+
/* @__PURE__ */ jsxRuntime.jsx(kit.SubContent, { children: /* @__PURE__ */ jsxRuntime.jsx(kit.RadioGroup, { value: sharedTone(blocks), onValueChange: (tone) => apply({ tone }), children: CALLOUT_TONES.map((tone) => /* @__PURE__ */ jsxRuntime.jsx(kit.RadioItem, { value: tone, indicator: /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "size-4" }), children: labels.calloutTones[tone] }, tone)) }) })
|
|
891
1302
|
] }),
|
|
892
1303
|
/* @__PURE__ */ jsxRuntime.jsxs(kit.Sub, { children: [
|
|
893
1304
|
/* @__PURE__ */ jsxRuntime.jsxs(kit.SubTrigger, { children: [
|
|
894
|
-
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon:
|
|
1305
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: Sticker }),
|
|
895
1306
|
labels.icon
|
|
896
1307
|
] }),
|
|
897
1308
|
/* @__PURE__ */ jsxRuntime.jsx(kit.SubContent, { className: "min-w-0", children: CALLOUT_ICONS.map((icon) => /* @__PURE__ */ jsxRuntime.jsx(kit.Item, { className: "justify-center text-base", onSelect: () => apply({ icon }), children: icon }, icon)) })
|
|
@@ -913,7 +1324,7 @@ function ColorGroups({ kit, value, onPick }) {
|
|
|
913
1324
|
const backgroundTitle = React7.useId();
|
|
914
1325
|
const group = (key, title, titleId) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
915
1326
|
/* @__PURE__ */ jsxRuntime.jsx(kit.Label, { id: titleId, children: title }),
|
|
916
|
-
/* @__PURE__ */ jsxRuntime.jsx(kit.RadioGroup, { "aria-labelledby": titleId, value: value[key], onValueChange: (name) => onPick(key, name), children: chunkWZA5S5EJ_cjs.PALETTE.map((name) => /* @__PURE__ */ jsxRuntime.jsxs(kit.RadioItem, { value: name, indicator: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1327
|
+
/* @__PURE__ */ jsxRuntime.jsx(kit.RadioGroup, { "aria-labelledby": titleId, value: value[key], onValueChange: (name) => onPick(key, name), children: chunkWZA5S5EJ_cjs.PALETTE.map((name) => /* @__PURE__ */ jsxRuntime.jsxs(kit.RadioItem, { value: name, indicator: /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "size-4" }), children: [
|
|
917
1328
|
swatches[key](name),
|
|
918
1329
|
labels.colors[name]
|
|
919
1330
|
] }, name)) })
|
|
@@ -928,10 +1339,10 @@ function ColorMenu({ kit, controller, blocks }) {
|
|
|
928
1339
|
const labels = useLabels();
|
|
929
1340
|
const blockIds = blocks.map((block) => block.id);
|
|
930
1341
|
const value = { color: sharedColor(blocks, "color"), background: sharedColor(blocks, "background") };
|
|
931
|
-
const pick = (key, name) => runOnBlocks(controller, blockIds,
|
|
1342
|
+
const pick = (key, name) => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.setBlockColor({ [key]: name === "default" ? null : name }));
|
|
932
1343
|
return /* @__PURE__ */ jsxRuntime.jsxs(kit.Sub, { children: [
|
|
933
1344
|
/* @__PURE__ */ jsxRuntime.jsxs(kit.SubTrigger, { children: [
|
|
934
|
-
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon:
|
|
1345
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: Palette }),
|
|
935
1346
|
labels.color
|
|
936
1347
|
] }),
|
|
937
1348
|
/* @__PURE__ */ jsxRuntime.jsx(kit.SubContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ColorGroups, { kit, value, onPick: pick }) })
|
|
@@ -959,7 +1370,7 @@ function modifierText(modifier, isMac, { keyNames }) {
|
|
|
959
1370
|
return Object.hasOwn(MODIFIERS, name) ? keyNames[MODIFIERS[name]] : capitalized(modifier);
|
|
960
1371
|
}
|
|
961
1372
|
function formatShortcut(shortcut, platform = {}) {
|
|
962
|
-
const { isMac =
|
|
1373
|
+
const { isMac = chunkVZZPCYA3_cjs.detectMac(), labels = englishLabels } = platform;
|
|
963
1374
|
const parts = shortcut.split(shortcut.includes("+") ? "+" : "-");
|
|
964
1375
|
const key = parts.pop() ?? shortcut;
|
|
965
1376
|
const written = [...parts.map((modifier) => modifierText(modifier, isMac, labels)), keyText(key, labels)];
|
|
@@ -1039,21 +1450,21 @@ function languageOptions(query, plainText) {
|
|
|
1039
1450
|
}
|
|
1040
1451
|
|
|
1041
1452
|
// src/blocks/insert-blocks.ts
|
|
1042
|
-
var isEmptyParagraph = (schema, block) =>
|
|
1453
|
+
var isEmptyParagraph = (schema, block) => chunkVZZPCYA3_cjs.isParagraph(block) && chunkVZZPCYA3_cjs.regionLength(block, chunkVZZPCYA3_cjs.primaryRegion(schema, block) ?? "") === 0;
|
|
1043
1454
|
function fresh(schema, { id, type, attrs, regions }, indent3) {
|
|
1044
|
-
const block =
|
|
1455
|
+
const block = chunkVZZPCYA3_cjs.createBlock(schema, type, attrs, indent3, id);
|
|
1045
1456
|
return regions === void 0 ? block : { ...block, regions };
|
|
1046
1457
|
}
|
|
1047
1458
|
function landOnLine(tr, schema, index, indent3) {
|
|
1048
1459
|
const next = tr.doc.blocks[index];
|
|
1049
1460
|
const reused = next !== void 0 && next.indent === indent3 && isEmptyParagraph(schema, next);
|
|
1050
|
-
const line = reused ? next :
|
|
1051
|
-
if (!reused) tr.step(
|
|
1052
|
-
tr.setSelection(
|
|
1461
|
+
const line = reused ? next : chunkVZZPCYA3_cjs.createBlock(schema, schema.defaultTextBlock, {}, indent3);
|
|
1462
|
+
if (!reused) tr.step(chunkVZZPCYA3_cjs.insertBlocksStep(index, [line]));
|
|
1463
|
+
tr.setSelection(chunkVZZPCYA3_cjs.startOf(tr.doc, schema, line.id));
|
|
1053
1464
|
}
|
|
1054
1465
|
function land(tr, schema, landing, first, after) {
|
|
1055
|
-
if (landing === "text") tr.setSelection(
|
|
1056
|
-
if (landing === "editor") tr.setSelection(
|
|
1466
|
+
if (landing === "text") tr.setSelection(chunkVZZPCYA3_cjs.startOf(tr.doc, schema, first.id));
|
|
1467
|
+
if (landing === "editor") tr.setSelection(chunkVZZPCYA3_cjs.nodeSelection(first.id)).setMeta(OPEN_EDITOR, first.id);
|
|
1057
1468
|
if (landing === "line") landOnLine(tr, schema, after, first.indent);
|
|
1058
1469
|
}
|
|
1059
1470
|
function anchorIndex(doc, id) {
|
|
@@ -1063,24 +1474,24 @@ function anchorIndex(doc, id) {
|
|
|
1063
1474
|
function insertBlocks(blocks, landing, anchorId) {
|
|
1064
1475
|
return (state, dispatch) => {
|
|
1065
1476
|
const { doc, schema } = state;
|
|
1066
|
-
const id = anchorId === void 0 ?
|
|
1477
|
+
const id = anchorId === void 0 ? chunkVZZPCYA3_cjs.headBlockId(state.selection) : anchorId;
|
|
1067
1478
|
const index = anchorIndex(doc, id);
|
|
1068
1479
|
if (index === void 0 || blocks.length === 0) return false;
|
|
1069
1480
|
const anchor = id === null ? void 0 : doc.blocks[index];
|
|
1070
1481
|
const created2 = blocks.map((block) => fresh(schema, block, anchor?.indent ?? 0));
|
|
1071
|
-
const tr = new
|
|
1482
|
+
const tr = new chunkVZZPCYA3_cjs.Transaction(state);
|
|
1072
1483
|
const empty = anchor !== void 0 && landing !== "stay" && isEmptyParagraph(schema, anchor);
|
|
1073
1484
|
if (empty && landing === "line") {
|
|
1074
|
-
tr.step(
|
|
1485
|
+
tr.step(chunkVZZPCYA3_cjs.insertBlocksStep(index, created2)).setSelection(chunkVZZPCYA3_cjs.startOf(tr.doc, schema, anchor.id));
|
|
1075
1486
|
} else if (empty) {
|
|
1076
1487
|
const [first, ...rest] = created2;
|
|
1077
1488
|
const filled = { ...first, id: anchor.id };
|
|
1078
|
-
tr.step(
|
|
1079
|
-
if (rest.length > 0) tr.step(
|
|
1489
|
+
tr.step(chunkVZZPCYA3_cjs.replaceBlockStep(filled));
|
|
1490
|
+
if (rest.length > 0) tr.step(chunkVZZPCYA3_cjs.insertBlocksStep(index + 1, rest));
|
|
1080
1491
|
land(tr, schema, landing, filled, index + created2.length);
|
|
1081
1492
|
} else {
|
|
1082
|
-
const at = anchor === void 0 ? 0 :
|
|
1083
|
-
tr.step(
|
|
1493
|
+
const at = anchor === void 0 ? 0 : chunkVZZPCYA3_cjs.descendantsEnd(doc, index);
|
|
1494
|
+
tr.step(chunkVZZPCYA3_cjs.insertBlocksStep(at, created2));
|
|
1084
1495
|
land(tr, schema, landing, created2[0], at + created2.length);
|
|
1085
1496
|
}
|
|
1086
1497
|
dispatch?.(tr);
|
|
@@ -1103,18 +1514,18 @@ function writeCode(controller, blockId, code, group) {
|
|
|
1103
1514
|
const { editor } = controller;
|
|
1104
1515
|
const block = chunkWZA5S5EJ_cjs.blockById(editor.state.doc, blockId);
|
|
1105
1516
|
if (block === void 0 || block.attrs.code === code) return;
|
|
1106
|
-
controller.dispatch(editor.createTransaction().step(
|
|
1517
|
+
controller.dispatch(editor.createTransaction().step(chunkVZZPCYA3_cjs.setAttrsStep(blockId, { code })).setMeta(chunkVZZPCYA3_cjs.HISTORY_GROUP, group));
|
|
1107
1518
|
}
|
|
1108
1519
|
function codeToParagraph(blockId) {
|
|
1109
1520
|
return (state, dispatch) => {
|
|
1110
|
-
const turn =
|
|
1111
|
-
const { ok, tr } =
|
|
1521
|
+
const turn = chunkVZZPCYA3_cjs.setBlockType("MARKDOWN", { kind: "paragraph" });
|
|
1522
|
+
const { ok, tr } = chunkVZZPCYA3_cjs.runCommands(state, [chunkVZZPCYA3_cjs.setSelection(chunkVZZPCYA3_cjs.nodeSelection(blockId)), turn]);
|
|
1112
1523
|
if (ok && tr !== null) dispatch?.(tr);
|
|
1113
1524
|
return ok;
|
|
1114
1525
|
};
|
|
1115
1526
|
}
|
|
1116
1527
|
function leaveCode(controller, blockId, direction, addsLine = false) {
|
|
1117
|
-
const moved =
|
|
1528
|
+
const moved = chunkQJ34MOFV_cjs.moveToNeighbour(controller, blockId, direction);
|
|
1118
1529
|
if (!moved && !(addsLine && controller.run(insertBlocks([{ type: "MARKDOWN" }], "text", blockId)))) return false;
|
|
1119
1530
|
controller.focus();
|
|
1120
1531
|
return true;
|
|
@@ -1192,8 +1603,8 @@ var MOD_KEYS = [
|
|
|
1192
1603
|
["Mod-a", ({ value, start, end }) => start === 0 && end === value.length ? { kind: "selectAll" } : null]
|
|
1193
1604
|
];
|
|
1194
1605
|
function codeKeyAction(event, field, isMac) {
|
|
1195
|
-
const name =
|
|
1196
|
-
const modKey = MOD_KEYS.find(([key]) =>
|
|
1606
|
+
const name = chunkVZZPCYA3_cjs.keyName(event, isMac);
|
|
1607
|
+
const modKey = MOD_KEYS.find(([key]) => chunkVZZPCYA3_cjs.normalizeKey(key, isMac) === name);
|
|
1197
1608
|
const handler = modKey?.[1] ?? (Object.hasOwn(KEYS, name) ? KEYS[name] : void 0);
|
|
1198
1609
|
return handler?.(field) ?? null;
|
|
1199
1610
|
}
|
|
@@ -1239,7 +1650,7 @@ function travel({ controller, blockId, area }, command) {
|
|
|
1239
1650
|
const before = area.value;
|
|
1240
1651
|
controller.run(command);
|
|
1241
1652
|
const { selection } = controller.editor.state;
|
|
1242
|
-
const edit2 =
|
|
1653
|
+
const edit2 = chunkQJ34MOFV_cjs.textDiff(before, area.value);
|
|
1243
1654
|
if (selection?.kind !== "node" || selection.block !== blockId) controller.focus();
|
|
1244
1655
|
else if (edit2 !== null) area.setSelectionRange(edit2.from + edit2.insert.length, edit2.from + edit2.insert.length);
|
|
1245
1656
|
return true;
|
|
@@ -1255,13 +1666,13 @@ function runCodeAction(action, context) {
|
|
|
1255
1666
|
case "paragraph":
|
|
1256
1667
|
return selectAndFocus(context, codeToParagraph(blockId));
|
|
1257
1668
|
case "undo":
|
|
1258
|
-
return travel(context,
|
|
1669
|
+
return travel(context, chunkVZZPCYA3_cjs.undo);
|
|
1259
1670
|
case "redo":
|
|
1260
|
-
return travel(context,
|
|
1671
|
+
return travel(context, chunkVZZPCYA3_cjs.redo);
|
|
1261
1672
|
case "selectAll":
|
|
1262
|
-
return selectAndFocus(context,
|
|
1673
|
+
return selectAndFocus(context, chunkVZZPCYA3_cjs.selectAll);
|
|
1263
1674
|
case "escape":
|
|
1264
|
-
return selectAndFocus(context,
|
|
1675
|
+
return selectAndFocus(context, chunkVZZPCYA3_cjs.setSelection(chunkVZZPCYA3_cjs.blockRangeSelection(blockId)));
|
|
1265
1676
|
case "controls":
|
|
1266
1677
|
context.focusControls();
|
|
1267
1678
|
return true;
|
|
@@ -1324,11 +1735,11 @@ function CodeEditor({ block, controller, field, focusControls }) {
|
|
|
1324
1735
|
useTypeIntoCode(controller, blockId, field, edit2);
|
|
1325
1736
|
const onKeyDown = (event) => {
|
|
1326
1737
|
const area = event.currentTarget;
|
|
1327
|
-
if (
|
|
1738
|
+
if (chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
|
|
1328
1739
|
const action = codeKeyAction(event, fieldOf(area), controller.isMac);
|
|
1329
1740
|
if (action !== null && runCodeAction(action, { controller, blockId, area, edit: edit2, focusControls })) event.preventDefault();
|
|
1330
1741
|
};
|
|
1331
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...{ [
|
|
1742
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...{ [chunkQJ34MOFV_cjs.NATIVE_INTERACTION]: "" }, dir: "ltr", className: "quoin-code-scroll", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "quoin-code-lines", children: [
|
|
1332
1743
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1333
1744
|
HighlightOverlay,
|
|
1334
1745
|
{
|
|
@@ -1398,7 +1809,7 @@ var Button = React7__namespace.forwardRef(function Button2({ className, variant
|
|
|
1398
1809
|
var COPIED_FOR_MS = 1500;
|
|
1399
1810
|
function CopyCodeButton({ code, controller }) {
|
|
1400
1811
|
const labels = useLabels();
|
|
1401
|
-
const readOnly =
|
|
1812
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
1402
1813
|
const [copied, setCopied] = React7.useState(false);
|
|
1403
1814
|
React7.useEffect(() => {
|
|
1404
1815
|
if (!copied) return;
|
|
@@ -1410,7 +1821,7 @@ function CopyCodeButton({ code, controller }) {
|
|
|
1410
1821
|
setCopied(true);
|
|
1411
1822
|
controller.announce(labels.copied);
|
|
1412
1823
|
};
|
|
1413
|
-
const
|
|
1824
|
+
const Icon2 = copied ? Check : Copy;
|
|
1414
1825
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1415
1826
|
Button,
|
|
1416
1827
|
{
|
|
@@ -1421,7 +1832,7 @@ function CopyCodeButton({ code, controller }) {
|
|
|
1421
1832
|
"aria-label": labels.copyCode,
|
|
1422
1833
|
className: "quoin-code-control",
|
|
1423
1834
|
onClick: () => void copy(),
|
|
1424
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1835
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { "aria-hidden": "true" })
|
|
1425
1836
|
}
|
|
1426
1837
|
);
|
|
1427
1838
|
}
|
|
@@ -1481,7 +1892,7 @@ var preventDefault = (event) => event.preventDefault();
|
|
|
1481
1892
|
|
|
1482
1893
|
// src/blocks/text/set-block-attrs.ts
|
|
1483
1894
|
function setBlockAttrs(controller, blockId, patch) {
|
|
1484
|
-
if (!controller.readOnly) controller.run(
|
|
1895
|
+
if (!controller.readOnly) controller.run(chunkQJ34MOFV_cjs.onBlock(blockId, chunkVZZPCYA3_cjs.setAttrs(patch)));
|
|
1485
1896
|
}
|
|
1486
1897
|
var FIELD = `quoin-code-language quoin-code-control ${FOCUS_RING}`;
|
|
1487
1898
|
var CONTENT = `${MENU_CONTENT} flex max-h-64 w-48 flex-col overflow-y-hidden`;
|
|
@@ -1497,7 +1908,7 @@ function LanguageCombobox({ blockId, controller, language: language2, field, onD
|
|
|
1497
1908
|
const options = draft === null ? [] : languageOptions(draft === shown ? "" : draft, labels.plainText);
|
|
1498
1909
|
const open = options.length > 0;
|
|
1499
1910
|
const optionId = (index) => `${listboxId}-${index}`;
|
|
1500
|
-
|
|
1911
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
1501
1912
|
list.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
1502
1913
|
}, [active]);
|
|
1503
1914
|
const close = () => {
|
|
@@ -1523,7 +1934,7 @@ function LanguageCombobox({ blockId, controller, language: language2, field, onD
|
|
|
1523
1934
|
onDone();
|
|
1524
1935
|
};
|
|
1525
1936
|
const onKeyDown = (event) => {
|
|
1526
|
-
if (
|
|
1937
|
+
if (chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
|
|
1527
1938
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
1528
1939
|
event.preventDefault();
|
|
1529
1940
|
const step = event.key === "ArrowDown" ? 1 : -1;
|
|
@@ -1597,7 +2008,7 @@ function LanguageCombobox({ blockId, controller, language: language2, field, onD
|
|
|
1597
2008
|
}
|
|
1598
2009
|
var CodeBlock = ({ block, controller }) => {
|
|
1599
2010
|
const labels = useLabels();
|
|
1600
|
-
const readOnly =
|
|
2011
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
1601
2012
|
const languageField = React7.useRef(null);
|
|
1602
2013
|
const codeField = React7.useRef(null);
|
|
1603
2014
|
const code = chunkWZA5S5EJ_cjs.str(block.attrs.code);
|
|
@@ -1639,7 +2050,7 @@ function FilePickerButton({ label, accept, disabled, busy = false, onPick }) {
|
|
|
1639
2050
|
}, [disabled]);
|
|
1640
2051
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex rounded-md has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-[var(--quoin-ring)]", children: [
|
|
1641
2052
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": "true", className: disabled || busy ? "pointer-events-none opacity-50" : void 0, children: [
|
|
1642
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2053
|
+
/* @__PURE__ */ jsxRuntime.jsx(Upload, { "aria-hidden": "true" }),
|
|
1643
2054
|
label
|
|
1644
2055
|
] }) }),
|
|
1645
2056
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1699,7 +2110,7 @@ function selectHandlers(controller, blockId, root, onSelect) {
|
|
|
1699
2110
|
return {
|
|
1700
2111
|
onKeyDown(event) {
|
|
1701
2112
|
const key = event.nativeEvent;
|
|
1702
|
-
if (
|
|
2113
|
+
if (chunkQJ34MOFV_cjs.isComposingKey(controller, key)) return;
|
|
1703
2114
|
if (event.key === "Escape") select();
|
|
1704
2115
|
else if (!(event.metaKey || event.ctrlKey) || event.target.matches("input:not([type=file])") || !controller.edit(() => controller.editor.handleKey(key)))
|
|
1705
2116
|
return;
|
|
@@ -1826,15 +2237,17 @@ function focusInEditor(controller) {
|
|
|
1826
2237
|
const active = document.activeElement;
|
|
1827
2238
|
return active !== null && (controller.isEditorElement(active) || isBubblePart(active, controller));
|
|
1828
2239
|
}
|
|
2240
|
+
|
|
2241
|
+
// src/blocks/file/file-icon.ts
|
|
1829
2242
|
var KINDS = [
|
|
1830
|
-
[
|
|
1831
|
-
[
|
|
1832
|
-
[
|
|
1833
|
-
[
|
|
1834
|
-
[
|
|
2243
|
+
[FileImage, /^(image\/|(png|jpe?g|gif|webp|svg|heic|bmp)$)/],
|
|
2244
|
+
[FileMusic, /^(audio\/|(mp3|wav|ogg|flac|m4a|aac)$)/],
|
|
2245
|
+
[FilePlay, /^(video\/|(mp4|mov|webm|mkv|avi|mpe?g)$)/],
|
|
2246
|
+
[FileArchive, /^(zip|rar|7z|tar|gz|xz)$/],
|
|
2247
|
+
[FileText, /^(text\/|(txt|md|csv|pdf|rtf|docx?)$)/]
|
|
1835
2248
|
];
|
|
1836
2249
|
var kindOf = (value) => KINDS.find(([, pattern]) => pattern.test(value))?.[0];
|
|
1837
|
-
var fileIcon = (mime, filename) => kindOf(mime) ?? kindOf(/\.([^.]+)$/.exec(filename)?.[1].toLowerCase() ?? "") ??
|
|
2250
|
+
var fileIcon = (mime, filename) => kindOf(mime) ?? kindOf(/\.([^.]+)$/.exec(filename)?.[1].toLowerCase() ?? "") ?? FileIcon;
|
|
1838
2251
|
|
|
1839
2252
|
// src/blocks/file/file-source.ts
|
|
1840
2253
|
var fileName = (attrs) => chunkWZA5S5EJ_cjs.str(attrs.filename) || chunkWZA5S5EJ_cjs.str(attrs.storageKey);
|
|
@@ -1846,9 +2259,9 @@ function FileCard({ block, controller, readOnly }) {
|
|
|
1846
2259
|
const name = fileName(attrs);
|
|
1847
2260
|
const size = chunkWZA5S5EJ_cjs.optionalNumber(attrs.size);
|
|
1848
2261
|
const href = assetHref(resolveAssetUrl, chunkWZA5S5EJ_cjs.str(attrs.storageKey));
|
|
1849
|
-
const
|
|
2262
|
+
const Icon2 = fileIcon(chunkWZA5S5EJ_cjs.str(attrs.mime), name);
|
|
1850
2263
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: card, className: "quoin-file-card", ...selectHandlers(controller, id, card), children: [
|
|
1851
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2264
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { "aria-hidden": "true", className: "quoin-file-icon" }),
|
|
1852
2265
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "quoin-file-name", children: name }),
|
|
1853
2266
|
size !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "quoin-file-size", children: labels.fileSize(size) }),
|
|
1854
2267
|
href !== null && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1863,7 +2276,7 @@ function FileCard({ block, controller, readOnly }) {
|
|
|
1863
2276
|
tabIndex: readOnly ? void 0 : -1,
|
|
1864
2277
|
...readOnly ? void 0 : bubblePart(controller),
|
|
1865
2278
|
children: [
|
|
1866
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2279
|
+
/* @__PURE__ */ jsxRuntime.jsx(Download, { "aria-hidden": "true" }),
|
|
1867
2280
|
labels.download
|
|
1868
2281
|
]
|
|
1869
2282
|
}
|
|
@@ -1888,7 +2301,7 @@ function assetOf(controller, blockId, type) {
|
|
|
1888
2301
|
var sameAsset = (a, b) => a !== null && b !== null && a.url === b.url && a.storageKey === b.storageKey;
|
|
1889
2302
|
function writeAttrs(controller, blockId, patch, recorded) {
|
|
1890
2303
|
const { editor } = controller;
|
|
1891
|
-
const tr = editor.createTransaction().step(
|
|
2304
|
+
const tr = editor.createTransaction().step(chunkVZZPCYA3_cjs.setAttrsStep(blockId, patch));
|
|
1892
2305
|
editor.dispatch(recorded ? tr : tr.setMeta("addToHistory", false));
|
|
1893
2306
|
}
|
|
1894
2307
|
async function uploadInto(controller, blockId, file, { type, category }, { upload, onLand }, land2) {
|
|
@@ -1919,7 +2332,7 @@ var uploadFile = (controller, blockId, file, host) => uploadInto(
|
|
|
1919
2332
|
var anyFile = () => true;
|
|
1920
2333
|
var FileBlock = ({ block, controller }) => {
|
|
1921
2334
|
const labels = useLabels();
|
|
1922
|
-
const readOnly =
|
|
2335
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
1923
2336
|
const root = React7.useRef(null);
|
|
1924
2337
|
const filled = hasFile(block.attrs);
|
|
1925
2338
|
useNodeKeys(controller, block.id, !readOnly, !filled, root);
|
|
@@ -1981,15 +2394,17 @@ function usePartAnchor(controller, blockId, selector) {
|
|
|
1981
2394
|
return { current: virtualAnchor(() => part()?.getBoundingClientRect() ?? null, part) };
|
|
1982
2395
|
}, [controller, blockId, selector]);
|
|
1983
2396
|
}
|
|
1984
|
-
|
|
2397
|
+
|
|
2398
|
+
// src/blocks/void/node-toolbar-items.ts
|
|
2399
|
+
var replaceItem = (title, run) => run ? [{ id: "replace", title, icon: Upload, run }] : [];
|
|
1985
2400
|
function deleteBlock(controller, blockId) {
|
|
1986
|
-
runOnBlocks(controller, [blockId],
|
|
2401
|
+
runOnBlocks(controller, [blockId], chunkVZZPCYA3_cjs.deleteBlocks);
|
|
1987
2402
|
controller.focus();
|
|
1988
2403
|
}
|
|
1989
2404
|
var deleteItem = (blockId, title) => ({
|
|
1990
2405
|
id: "delete",
|
|
1991
2406
|
title,
|
|
1992
|
-
icon:
|
|
2407
|
+
icon: Trash,
|
|
1993
2408
|
run: (controller) => deleteBlock(controller, blockId)
|
|
1994
2409
|
});
|
|
1995
2410
|
var PRESSED = "aria-pressed:bg-accent aria-pressed:text-accent-foreground";
|
|
@@ -1998,32 +2413,32 @@ function markItem(mark, title, icon) {
|
|
|
1998
2413
|
id: mark,
|
|
1999
2414
|
title,
|
|
2000
2415
|
icon,
|
|
2001
|
-
isActive: (state) =>
|
|
2002
|
-
run: (controller) => void controller.run(
|
|
2416
|
+
isActive: (state) => chunkVZZPCYA3_cjs.isActive(state, mark),
|
|
2417
|
+
run: (controller) => void controller.run(chunkVZZPCYA3_cjs.toggleMark(mark))
|
|
2003
2418
|
};
|
|
2004
2419
|
}
|
|
2005
2420
|
var linkItem = (labels, openLink) => ({
|
|
2006
2421
|
id: "link",
|
|
2007
2422
|
title: labels.link,
|
|
2008
|
-
icon:
|
|
2423
|
+
icon: Link,
|
|
2009
2424
|
run: openLink
|
|
2010
2425
|
});
|
|
2011
2426
|
function bubbleItems(labels, openLink) {
|
|
2012
2427
|
return {
|
|
2013
2428
|
inline: [
|
|
2014
|
-
markItem("bold", labels.bold,
|
|
2015
|
-
markItem("italic", labels.italic,
|
|
2016
|
-
markItem("underline", labels.underline,
|
|
2017
|
-
markItem("strike", labels.strike,
|
|
2018
|
-
markItem("code", labels.code,
|
|
2429
|
+
markItem("bold", labels.bold, Bold),
|
|
2430
|
+
markItem("italic", labels.italic, Italic),
|
|
2431
|
+
markItem("underline", labels.underline, Underline),
|
|
2432
|
+
markItem("strike", labels.strike, Strikethrough),
|
|
2433
|
+
markItem("code", labels.code, Code),
|
|
2019
2434
|
linkItem(labels, openLink)
|
|
2020
2435
|
],
|
|
2021
|
-
scripts: [markItem("sub", labels.subscript,
|
|
2436
|
+
scripts: [markItem("sub", labels.subscript, Subscript), markItem("sup", labels.superscript, Superscript)]
|
|
2022
2437
|
};
|
|
2023
2438
|
}
|
|
2024
2439
|
function ToolbarButton({ item, state, controller, buttonRef }) {
|
|
2025
2440
|
if (item.available?.(state) === false) return null;
|
|
2026
|
-
const
|
|
2441
|
+
const Icon2 = item.icon;
|
|
2027
2442
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2028
2443
|
Button,
|
|
2029
2444
|
{
|
|
@@ -2035,7 +2450,7 @@ function ToolbarButton({ item, state, controller, buttonRef }) {
|
|
|
2035
2450
|
"aria-pressed": item.isActive?.(state),
|
|
2036
2451
|
className: PRESSED,
|
|
2037
2452
|
onClick: () => item.run(controller),
|
|
2038
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2453
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, {})
|
|
2039
2454
|
}
|
|
2040
2455
|
);
|
|
2041
2456
|
}
|
|
@@ -2069,7 +2484,7 @@ function useRovingFocus() {
|
|
|
2069
2484
|
},
|
|
2070
2485
|
[syncTabStop]
|
|
2071
2486
|
);
|
|
2072
|
-
|
|
2487
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(syncTabStop);
|
|
2073
2488
|
const onFocus = (event) => {
|
|
2074
2489
|
if (!owns(event.target)) return;
|
|
2075
2490
|
current.current = event.target;
|
|
@@ -2088,7 +2503,7 @@ function useRovingFocus() {
|
|
|
2088
2503
|
// src/menus/floating/use-focus-key.ts
|
|
2089
2504
|
var isFocusKey = (event) => event.key === "F10" && event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
|
|
2090
2505
|
function useFocusKey(controller, focus) {
|
|
2091
|
-
|
|
2506
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
2092
2507
|
const intercept = (event) => {
|
|
2093
2508
|
if (!isFocusKey(event)) return false;
|
|
2094
2509
|
event.preventDefault();
|
|
@@ -2100,11 +2515,11 @@ function useFocusKey(controller, focus) {
|
|
|
2100
2515
|
}
|
|
2101
2516
|
function NodeToolbar(props) {
|
|
2102
2517
|
const { blockId, controller, label, anchor, items, next, buttonRefs, children, popover } = props;
|
|
2103
|
-
const state =
|
|
2518
|
+
const state = chunkQJ34MOFV_cjs.useEditorState(controller, chunkQJ34MOFV_cjs.wholeState);
|
|
2104
2519
|
const roving = useRovingFocus();
|
|
2105
2520
|
useFocusKey(controller, roving.focusCurrent);
|
|
2106
2521
|
const onKeyDown = (event) => {
|
|
2107
|
-
if (!roving.owns(event.target) ||
|
|
2522
|
+
if (!roving.owns(event.target) || chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
|
|
2108
2523
|
const tab = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
2109
2524
|
const ahead = tab && !event.shiftKey && next !== void 0 ? blockPart(controller, blockId, next) : void 0;
|
|
2110
2525
|
if (ahead !== void 0) ahead.focus();
|
|
@@ -2185,8 +2600,8 @@ var selectedBlock = (type, filled) => ({ doc, selection }) => {
|
|
|
2185
2600
|
return block?.type === type && filled(block.attrs) ? block.id : null;
|
|
2186
2601
|
};
|
|
2187
2602
|
function useToolbarBlock(controller, selected, keptFor = null) {
|
|
2188
|
-
const blockId =
|
|
2189
|
-
const readOnly =
|
|
2603
|
+
const blockId = chunkQJ34MOFV_cjs.useEditorState(controller, selected);
|
|
2604
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
2190
2605
|
const settled = useSelectionSettled(controller);
|
|
2191
2606
|
return blockId !== null && !readOnly && (settled || keptFor === blockId) ? blockId : null;
|
|
2192
2607
|
}
|
|
@@ -2265,7 +2680,7 @@ function ResizeHandles({ blockId, controller, frame, percent, centred, onPreview
|
|
|
2265
2680
|
const value = percent ?? drawn;
|
|
2266
2681
|
const write = (widthPercent) => setBlockAttrs(controller, blockId, { widthPercent });
|
|
2267
2682
|
const onKeyDown = (event) => {
|
|
2268
|
-
if (
|
|
2683
|
+
if (chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
|
|
2269
2684
|
const next = keyedWidth(event.key, value);
|
|
2270
2685
|
if (event.key === "Escape") controller.focus();
|
|
2271
2686
|
else if (next === null) return;
|
|
@@ -2307,7 +2722,7 @@ function ResizeHandles({ blockId, controller, frame, percent, centred, onPreview
|
|
|
2307
2722
|
"aria-valuetext": labels.widthValue(value),
|
|
2308
2723
|
"data-side": side,
|
|
2309
2724
|
className: "quoin-image-handle",
|
|
2310
|
-
...{ [
|
|
2725
|
+
...{ [chunkQJ34MOFV_cjs.NATIVE_INTERACTION]: "" },
|
|
2311
2726
|
...bubblePart(controller),
|
|
2312
2727
|
onKeyDown,
|
|
2313
2728
|
onPointerDown: onPointerDown(side),
|
|
@@ -2351,7 +2766,7 @@ function ImageFigure({ block, controller, readOnly }) {
|
|
|
2351
2766
|
onClick: select
|
|
2352
2767
|
}
|
|
2353
2768
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "img", "aria-label": name, className: "quoin-image-missing", onClick: select, children: [
|
|
2354
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2769
|
+
/* @__PURE__ */ jsxRuntime.jsx(Image, { "aria-hidden": "true" }),
|
|
2355
2770
|
alt
|
|
2356
2771
|
] }),
|
|
2357
2772
|
flagged && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2380,7 +2795,7 @@ function ImageFigure({ block, controller, readOnly }) {
|
|
|
2380
2795
|
)
|
|
2381
2796
|
] }),
|
|
2382
2797
|
(!readOnly || (regions.caption?.length ?? 0) > 0) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2383
|
-
|
|
2798
|
+
chunkQJ34MOFV_cjs.EditableRegion,
|
|
2384
2799
|
{
|
|
2385
2800
|
block: id,
|
|
2386
2801
|
region: "caption",
|
|
@@ -2452,7 +2867,7 @@ function EmbedLinkForm({ blockId, controller }) {
|
|
|
2452
2867
|
}
|
|
2453
2868
|
}
|
|
2454
2869
|
),
|
|
2455
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", variant: "ghost", size: "icon-sm", "aria-label": labels.linkApply, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2870
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", variant: "ghost", size: "icon-sm", "aria-label": labels.linkApply, children: /* @__PURE__ */ jsxRuntime.jsx(Check, {}) }),
|
|
2456
2871
|
invalid && /* @__PURE__ */ jsxRuntime.jsx("p", { id: messageId, role: "alert", className: "quoin-block-message", children: labels.invalidLink })
|
|
2457
2872
|
] });
|
|
2458
2873
|
}
|
|
@@ -2497,7 +2912,7 @@ function ImageUploadArea({ blockId, controller }) {
|
|
|
2497
2912
|
className: "quoin-image-upload",
|
|
2498
2913
|
onSelect: () => setLinking(false),
|
|
2499
2914
|
actions: /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", size: "sm", "aria-expanded": linking, onClick: () => setLinking(true), children: [
|
|
2500
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2915
|
+
/* @__PURE__ */ jsxRuntime.jsx(Link, {}),
|
|
2501
2916
|
labels.embedLink
|
|
2502
2917
|
] }),
|
|
2503
2918
|
children: linking && /* @__PURE__ */ jsxRuntime.jsx(EmbedLinkForm, { blockId, controller })
|
|
@@ -2518,7 +2933,7 @@ function useImageKeys(controller, blockId, picture, editable, root) {
|
|
|
2518
2933
|
// then follows.
|
|
2519
2934
|
enter() {
|
|
2520
2935
|
const { editor } = controller;
|
|
2521
|
-
editor.dispatch(editor.createTransaction().setSelection(
|
|
2936
|
+
editor.dispatch(editor.createTransaction().setSelection(chunkVZZPCYA3_cjs.textSelection(captionEnd(controller, blockId))));
|
|
2522
2937
|
controller.focus();
|
|
2523
2938
|
},
|
|
2524
2939
|
type(key) {
|
|
@@ -2543,7 +2958,7 @@ function useImageKeys(controller, blockId, picture, editable, root) {
|
|
|
2543
2958
|
}
|
|
2544
2959
|
var ImageBlock = ({ block, controller }) => {
|
|
2545
2960
|
const labels = useLabels();
|
|
2546
|
-
const readOnly =
|
|
2961
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
2547
2962
|
const root = React7.useRef(null);
|
|
2548
2963
|
const picture = hasPicture(block.attrs);
|
|
2549
2964
|
useImageKeys(controller, block.id, picture, !readOnly, root);
|
|
@@ -2556,17 +2971,17 @@ var ImageBlock = ({ block, controller }) => {
|
|
|
2556
2971
|
"aria-label": labels.blockNames.image,
|
|
2557
2972
|
contentEditable: false,
|
|
2558
2973
|
className: "quoin-image",
|
|
2559
|
-
...picture ? { [
|
|
2974
|
+
...picture ? { [chunkQJ34MOFV_cjs.NODE_ENTRY]: "" } : void 0,
|
|
2560
2975
|
children: picture ? /* @__PURE__ */ jsxRuntime.jsx(ImageFigure, { block, controller, readOnly }) : empty
|
|
2561
2976
|
}
|
|
2562
2977
|
);
|
|
2563
2978
|
};
|
|
2564
2979
|
function useOutsidePress(element, ownerDocument, onPress) {
|
|
2565
2980
|
const latest = React7.useRef(onPress);
|
|
2566
|
-
|
|
2981
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
2567
2982
|
latest.current = onPress;
|
|
2568
2983
|
});
|
|
2569
|
-
|
|
2984
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
2570
2985
|
const doc = ownerDocument();
|
|
2571
2986
|
const inside = (target) => element.current?.contains(target) === true;
|
|
2572
2987
|
let touched = null;
|
|
@@ -2581,7 +2996,7 @@ function useOutsidePress(element, ownerDocument, onPress) {
|
|
|
2581
2996
|
if (touched !== null && !inside(event.target)) latest.current(touched);
|
|
2582
2997
|
touched = null;
|
|
2583
2998
|
};
|
|
2584
|
-
return
|
|
2999
|
+
return chunkQJ34MOFV_cjs.listen(doc, { pointerdown: down, click }, true);
|
|
2585
3000
|
}, [element, ownerDocument]);
|
|
2586
3001
|
}
|
|
2587
3002
|
function storeAlt(controller, blockId, opened, patch) {
|
|
@@ -2589,7 +3004,7 @@ function storeAlt(controller, blockId, opened, patch) {
|
|
|
2589
3004
|
const attrs = chunkWZA5S5EJ_cjs.blockById(editor.state.doc, blockId)?.attrs ?? {};
|
|
2590
3005
|
const changed = chunkWZA5S5EJ_cjs.str(attrs.alt) !== opened.alt || attrs.decorative === true !== opened.decorative;
|
|
2591
3006
|
if (controller.readOnly || controller.root === null || changed) return;
|
|
2592
|
-
|
|
3007
|
+
chunkQJ34MOFV_cjs.onBlock(blockId, chunkVZZPCYA3_cjs.setAttrs(patch))(editor.state, (tr) => editor.dispatch(tr));
|
|
2593
3008
|
}
|
|
2594
3009
|
function AltTextPopover({ blockId, controller, anchor, opener, alt, decorative, onClose }) {
|
|
2595
3010
|
const labels = useLabels();
|
|
@@ -2631,7 +3046,7 @@ function AltTextPopover({ blockId, controller, anchor, opener, alt, decorative,
|
|
|
2631
3046
|
close(true);
|
|
2632
3047
|
};
|
|
2633
3048
|
const onKeyDown = (event) => {
|
|
2634
|
-
if (event.key !== "Tab" ||
|
|
3049
|
+
if (event.key !== "Tab" || chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
|
|
2635
3050
|
const controls = [...event.currentTarget.elements];
|
|
2636
3051
|
const next = controls[controls.indexOf(event.target) + (event.shiftKey ? -1 : 1)];
|
|
2637
3052
|
event.preventDefault();
|
|
@@ -2659,7 +3074,7 @@ function AltTextPopover({ blockId, controller, anchor, opener, alt, decorative,
|
|
|
2659
3074
|
onCloseAutoFocus: preventDefault,
|
|
2660
3075
|
onEscapeKeyDown: (event) => {
|
|
2661
3076
|
event.preventDefault();
|
|
2662
|
-
if (!
|
|
3077
|
+
if (!chunkQJ34MOFV_cjs.isComposingKey(controller, event)) close(false);
|
|
2663
3078
|
},
|
|
2664
3079
|
...bubblePart(controller),
|
|
2665
3080
|
children: /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, className: "quoin-image-alt", onSubmit: save, onKeyDown, children: [
|
|
@@ -2700,10 +3115,12 @@ function AltTextPopover({ blockId, controller, anchor, opener, alt, decorative,
|
|
|
2700
3115
|
}
|
|
2701
3116
|
);
|
|
2702
3117
|
}
|
|
3118
|
+
|
|
3119
|
+
// src/blocks/image/image-toolbar-items.ts
|
|
2703
3120
|
var ALIGNS = [
|
|
2704
|
-
["left",
|
|
2705
|
-
["center",
|
|
2706
|
-
["right",
|
|
3121
|
+
["left", AlignLeft, "alignLeft"],
|
|
3122
|
+
["center", AlignCenter, "alignCenter"],
|
|
3123
|
+
["right", AlignRight, "alignRight"]
|
|
2707
3124
|
];
|
|
2708
3125
|
function imageToolbarItems(blockId, labels, actions) {
|
|
2709
3126
|
const aligns = ALIGNS.map(
|
|
@@ -2719,8 +3136,8 @@ function imageToolbarItems(blockId, labels, actions) {
|
|
|
2719
3136
|
return [
|
|
2720
3137
|
...aligns,
|
|
2721
3138
|
...replaceItem(labels.replaceImage, replace),
|
|
2722
|
-
{ id: "alt", title: labels.altText, icon:
|
|
2723
|
-
{ id: "download", title: labels.download, icon:
|
|
3139
|
+
{ id: "alt", title: labels.altText, icon: Pencil, run: editAlt },
|
|
3140
|
+
{ id: "download", title: labels.download, icon: Download, run: download2 },
|
|
2724
3141
|
deleteItem(blockId, labels.delete)
|
|
2725
3142
|
];
|
|
2726
3143
|
}
|
|
@@ -2753,7 +3170,7 @@ function ImageToolbarOverlay({ controller }) {
|
|
|
2753
3170
|
}
|
|
2754
3171
|
function ImageToolbar({ blockId, controller, editingAlt, onEditAlt }) {
|
|
2755
3172
|
const { labels, resolveAssetUrl } = useQuoin();
|
|
2756
|
-
const state =
|
|
3173
|
+
const state = chunkQJ34MOFV_cjs.useEditorState(controller, chunkQJ34MOFV_cjs.wholeState);
|
|
2757
3174
|
const picker = useReplacePicker(controller, blockId, uploadImage, "image/*");
|
|
2758
3175
|
const altButton = React7.useRef(null);
|
|
2759
3176
|
const anchor = usePartAnchor(controller, blockId, ".quoin-image-frame");
|
|
@@ -2848,7 +3265,7 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ React7__namespace.forwardRef(func
|
|
|
2848
3265
|
className: cn(MENU_CHECKABLE_ITEM, className),
|
|
2849
3266
|
...props,
|
|
2850
3267
|
children: [
|
|
2851
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: MENU_ITEM_INDICATOR, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3268
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: MENU_ITEM_INDICATOR, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "size-4" }) }) }),
|
|
2852
3269
|
children
|
|
2853
3270
|
]
|
|
2854
3271
|
}
|
|
@@ -2857,7 +3274,7 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ React7__namespace.forwardRef(func
|
|
|
2857
3274
|
var DropdownMenuRadioGroup = /* @__PURE__ */ React7__namespace.forwardRef(function DropdownMenuRadioGroup2(props, ref) {
|
|
2858
3275
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.RadioGroup, { ref, "data-slot": "dropdown-menu-radio-group", ...props });
|
|
2859
3276
|
});
|
|
2860
|
-
var DropdownMenuRadioItem = /* @__PURE__ */ React7__namespace.forwardRef(function DropdownMenuRadioItem2({ className, children, indicator = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3277
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ React7__namespace.forwardRef(function DropdownMenuRadioItem2({ className, children, indicator = /* @__PURE__ */ jsxRuntime.jsx(Circle, { className: "size-2 fill-current" }), ...props }, ref) {
|
|
2861
3278
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2862
3279
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
2863
3280
|
{
|
|
@@ -2911,7 +3328,7 @@ var DropdownMenuSubTrigger = /* @__PURE__ */ React7__namespace.forwardRef(functi
|
|
|
2911
3328
|
...props,
|
|
2912
3329
|
children: [
|
|
2913
3330
|
children,
|
|
2914
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3331
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "ml-auto size-4" })
|
|
2915
3332
|
]
|
|
2916
3333
|
}
|
|
2917
3334
|
);
|
|
@@ -2985,13 +3402,13 @@ function CalloutToneMenu({ blockId, controller, tone }) {
|
|
|
2985
3402
|
}
|
|
2986
3403
|
var CalloutBlock = ({ block, controller }) => {
|
|
2987
3404
|
const labels = useLabels();
|
|
2988
|
-
const readOnly =
|
|
3405
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
2989
3406
|
const tone = calloutTone(block.attrs.tone);
|
|
2990
3407
|
const icon = calloutIcon(block.attrs, tone);
|
|
2991
3408
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("quoin-callout group/callout flex items-start gap-2", TONE[tone]), "data-tone": tone, children: [
|
|
2992
3409
|
readOnly ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex size-6 items-center justify-center text-base", children: icon }) : /* @__PURE__ */ jsxRuntime.jsx(CalloutIconMenu, { blockId: block.id, controller, icon }),
|
|
2993
3410
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2994
|
-
|
|
3411
|
+
chunkQJ34MOFV_cjs.EditableRegion,
|
|
2995
3412
|
{
|
|
2996
3413
|
block: block.id,
|
|
2997
3414
|
region: "body",
|
|
@@ -3060,22 +3477,22 @@ var headingStyles = (level) => `quoin-heading mb-1 font-semibold leading-tight i
|
|
|
3060
3477
|
function Heading({ block }) {
|
|
3061
3478
|
const labels = useLabels();
|
|
3062
3479
|
const level = chunkWZA5S5EJ_cjs.headingLevel(block.attrs.level);
|
|
3063
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "heading", "aria-level": level, className: headingStyles(level), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3480
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "heading", "aria-level": level, className: headingStyles(level), children: /* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { block: block.id, region: REGION, label: labels.heading(level) }) });
|
|
3064
3481
|
}
|
|
3065
3482
|
function NumberedItem({ block, controller }) {
|
|
3066
3483
|
const labels = useLabels();
|
|
3067
|
-
const number =
|
|
3484
|
+
const number = chunkQJ34MOFV_cjs.useOrderedNumber(controller, block.id);
|
|
3068
3485
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "quoin-list-item", "data-list": "ordered", children: [
|
|
3069
3486
|
/* @__PURE__ */ jsxRuntime.jsx(ListMarker, { list: "ordered", number, depth: block.indent }),
|
|
3070
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3487
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { block: block.id, region: REGION, label: labels.numberedItem(number) })
|
|
3071
3488
|
] });
|
|
3072
3489
|
}
|
|
3073
3490
|
function TaskItem({ block, controller }) {
|
|
3074
3491
|
const labels = useLabels();
|
|
3075
|
-
const hostId =
|
|
3492
|
+
const hostId = chunkQJ34MOFV_cjs.useRegionDomId(block.id, REGION);
|
|
3076
3493
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "quoin-task", "data-checked": block.attrs.checked === true, children: [
|
|
3077
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3078
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3494
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.TaskCheckbox, { block, controller, label: labels.task, labelledBy: hostId }),
|
|
3495
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { id: hostId, block: block.id, region: REGION, label: labels.task })
|
|
3079
3496
|
] });
|
|
3080
3497
|
}
|
|
3081
3498
|
var MarkdownBlock = (props) => {
|
|
@@ -3087,16 +3504,16 @@ var MarkdownBlock = (props) => {
|
|
|
3087
3504
|
case "bullet":
|
|
3088
3505
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "quoin-list-item", "data-list": "bullet", children: [
|
|
3089
3506
|
/* @__PURE__ */ jsxRuntime.jsx(ListMarker, { list: "bullet", depth: block.indent }),
|
|
3090
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3507
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { block: block.id, region: REGION, label: labels.bulletItem })
|
|
3091
3508
|
] });
|
|
3092
3509
|
case "ordered":
|
|
3093
3510
|
return /* @__PURE__ */ jsxRuntime.jsx(NumberedItem, { ...props });
|
|
3094
3511
|
case "task":
|
|
3095
3512
|
return /* @__PURE__ */ jsxRuntime.jsx(TaskItem, { ...props });
|
|
3096
3513
|
case "quote":
|
|
3097
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "quoin-quote", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3514
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "quoin-quote", children: /* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { block: block.id, region: REGION, label: labels.quote }) });
|
|
3098
3515
|
default:
|
|
3099
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3516
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { block: block.id, region: REGION, label: labels.paragraph });
|
|
3100
3517
|
}
|
|
3101
3518
|
};
|
|
3102
3519
|
|
|
@@ -3104,19 +3521,19 @@ var MarkdownBlock = (props) => {
|
|
|
3104
3521
|
function nestedBlockIds({ doc }, blockId) {
|
|
3105
3522
|
const index = doc.index.get(blockId);
|
|
3106
3523
|
if (index === void 0) return [];
|
|
3107
|
-
return doc.blocks.slice(index + 1,
|
|
3524
|
+
return doc.blocks.slice(index + 1, chunkVZZPCYA3_cjs.descendantsEnd(doc, index)).map((block) => block.id);
|
|
3108
3525
|
}
|
|
3109
3526
|
function useNestedBlocks(controller, blockId) {
|
|
3110
|
-
return
|
|
3527
|
+
return chunkQJ34MOFV_cjs.useEditorState(controller, (state) => nestedBlockIds(state, blockId), chunkWZA5S5EJ_cjs.sameItems);
|
|
3111
3528
|
}
|
|
3112
3529
|
var ToggleBlock = ({ block, controller }) => {
|
|
3113
3530
|
const labels = useLabels();
|
|
3114
|
-
const domId =
|
|
3531
|
+
const domId = chunkQJ34MOFV_cjs.useBlockDomId();
|
|
3115
3532
|
const nested = useNestedBlocks(controller, block.id);
|
|
3116
|
-
const open =
|
|
3533
|
+
const open = chunkQJ34MOFV_cjs.useToggleOpen(controller, block);
|
|
3117
3534
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "quoin-toggle", "data-open": open, children: [
|
|
3118
3535
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3119
|
-
|
|
3536
|
+
chunkQJ34MOFV_cjs.ToggleChevron,
|
|
3120
3537
|
{
|
|
3121
3538
|
block,
|
|
3122
3539
|
controller,
|
|
@@ -3124,7 +3541,7 @@ var ToggleBlock = ({ block, controller }) => {
|
|
|
3124
3541
|
controls: nested.length === 0 ? void 0 : nested.map(domId).join(" ")
|
|
3125
3542
|
}
|
|
3126
3543
|
),
|
|
3127
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3544
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJ34MOFV_cjs.EditableRegion, { block: block.id, region: "text", label: labels.toggle })
|
|
3128
3545
|
] });
|
|
3129
3546
|
};
|
|
3130
3547
|
|
|
@@ -3155,7 +3572,9 @@ function drawnInPlace(definitions, type) {
|
|
|
3155
3572
|
}
|
|
3156
3573
|
var drawsType = (definitions, type) => !Object.hasOwn(inPlaceRenderers, type) || chunkA6PGQVTR_cjs.blockByType(definitions, type) !== void 0;
|
|
3157
3574
|
var opensEditor = (definitions, type) => drawnInPlace(definitions, type) || !drawnAsText(definitions, type, false) && chunkA6PGQVTR_cjs.blockByType(definitions, type)?.editor !== void 0;
|
|
3158
|
-
|
|
3575
|
+
|
|
3576
|
+
// src/gutter/turn-into-targets.ts
|
|
3577
|
+
var HEADING_ICONS = [Heading1, Heading2, Heading3];
|
|
3159
3578
|
function turnIntoTargets(labels) {
|
|
3160
3579
|
const { blockNames } = labels;
|
|
3161
3580
|
const line = (id, label, icon, attrs) => ({
|
|
@@ -3166,24 +3585,24 @@ function turnIntoTargets(labels) {
|
|
|
3166
3585
|
attrs
|
|
3167
3586
|
});
|
|
3168
3587
|
return [
|
|
3169
|
-
line("text", blockNames.text,
|
|
3588
|
+
line("text", blockNames.text, Type, { kind: "paragraph" }),
|
|
3170
3589
|
...HEADING_ICONS.map((icon, i) => {
|
|
3171
3590
|
const level = i + 1;
|
|
3172
3591
|
return line(`heading${level}`, labels.heading(level), icon, { kind: "heading", level });
|
|
3173
3592
|
}),
|
|
3174
|
-
line("bulletedList", blockNames.bulletedList,
|
|
3175
|
-
line("numberedList", blockNames.numberedList,
|
|
3176
|
-
line("todoList", blockNames.todoList,
|
|
3177
|
-
line("quote", blockNames.quote,
|
|
3178
|
-
{ id: "callout", label: blockNames.callout, icon:
|
|
3179
|
-
{ id: "toggle", label: blockNames.toggle, icon:
|
|
3180
|
-
{ id: "code", label: blockNames.code, icon:
|
|
3593
|
+
line("bulletedList", blockNames.bulletedList, List, { kind: "bullet" }),
|
|
3594
|
+
line("numberedList", blockNames.numberedList, ListOrdered, { kind: "ordered" }),
|
|
3595
|
+
line("todoList", blockNames.todoList, ListTodo, { kind: "task" }),
|
|
3596
|
+
line("quote", blockNames.quote, TextQuote, { kind: "quote" }),
|
|
3597
|
+
{ id: "callout", label: blockNames.callout, icon: MessageSquare, type: "CALLOUT", attrs: {} },
|
|
3598
|
+
{ id: "toggle", label: blockNames.toggle, icon: ListCollapse, type: "TOGGLE", attrs: {} },
|
|
3599
|
+
{ id: "code", label: blockNames.code, icon: Code, type: "CODE", attrs: {} }
|
|
3181
3600
|
];
|
|
3182
3601
|
}
|
|
3183
3602
|
function TurnIntoItems({ kit, controller, blockIds }) {
|
|
3184
3603
|
const { blockTypes, labels } = useQuoin();
|
|
3185
3604
|
const targets = turnIntoTargets(labels).filter((target) => drawsType(blockTypes, target.type));
|
|
3186
|
-
return targets.map((target) => /* @__PURE__ */ jsxRuntime.jsxs(kit.Item, { onSelect: () => runOnBlocks(controller, blockIds,
|
|
3605
|
+
return targets.map((target) => /* @__PURE__ */ jsxRuntime.jsxs(kit.Item, { onSelect: () => runOnBlocks(controller, blockIds, chunkVZZPCYA3_cjs.setBlockType(target.type, target.attrs)), children: [
|
|
3187
3606
|
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: target.icon }),
|
|
3188
3607
|
target.label
|
|
3189
3608
|
] }, target.id));
|
|
@@ -3193,7 +3612,7 @@ function TurnIntoMenu(props) {
|
|
|
3193
3612
|
const labels = useLabels();
|
|
3194
3613
|
return /* @__PURE__ */ jsxRuntime.jsxs(kit.Sub, { children: [
|
|
3195
3614
|
/* @__PURE__ */ jsxRuntime.jsxs(kit.SubTrigger, { children: [
|
|
3196
|
-
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon:
|
|
3615
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: Repeat2 }),
|
|
3197
3616
|
labels.turnInto
|
|
3198
3617
|
] }),
|
|
3199
3618
|
/* @__PURE__ */ jsxRuntime.jsx(kit.SubContent, { children: /* @__PURE__ */ jsxRuntime.jsx(TurnIntoItems, { ...props }) })
|
|
@@ -3218,10 +3637,10 @@ function ActionItem({ kit, controller, action, blockIds }) {
|
|
|
3218
3637
|
);
|
|
3219
3638
|
}
|
|
3220
3639
|
function BlockMenuItems({ kit, controller, blocks, styled, title, actions }) {
|
|
3221
|
-
const state =
|
|
3640
|
+
const state = chunkQJ34MOFV_cjs.useEditorState(controller, chunkQJ34MOFV_cjs.wholeState);
|
|
3222
3641
|
const blockIds = blocks.map((block) => block.id);
|
|
3223
3642
|
const shown = actions.filter((action) => action.available?.(state, blockIds) ?? true);
|
|
3224
|
-
const anyText = styled.some((block) =>
|
|
3643
|
+
const anyText = styled.some((block) => chunkVZZPCYA3_cjs.isTextFlow(state.schema, block));
|
|
3225
3644
|
const anyMarkdown = styled.some((block) => block.type === "MARKDOWN");
|
|
3226
3645
|
const allCallouts = styled.length > 0 && styled.every((block) => block.type === "CALLOUT");
|
|
3227
3646
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -3263,7 +3682,7 @@ var CONTEXT_KIT = {
|
|
|
3263
3682
|
SubTrigger: ContextMenuSubTrigger
|
|
3264
3683
|
};
|
|
3265
3684
|
var GUTTER_BLOCK = "data-quoin-gutter-block";
|
|
3266
|
-
var OWN_MENU = `[${
|
|
3685
|
+
var OWN_MENU = `[${chunkQJ34MOFV_cjs.NATIVE_INTERACTION}], input, textarea, select`;
|
|
3267
3686
|
function contextBlock(controller, target) {
|
|
3268
3687
|
const { state } = controller.editor;
|
|
3269
3688
|
const gutter = target.closest(`[${GUTTER_BLOCK}]`)?.getAttribute(GUTTER_BLOCK);
|
|
@@ -3273,7 +3692,7 @@ function contextBlock(controller, target) {
|
|
|
3273
3692
|
if (target.closest(OWN_MENU) || controller.registry.locate(target) !== null) return null;
|
|
3274
3693
|
const id = controller.blockAt(target);
|
|
3275
3694
|
const block = id === void 0 ? void 0 : chunkWZA5S5EJ_cjs.blockById(state.doc, id);
|
|
3276
|
-
return block === void 0 ||
|
|
3695
|
+
return block === void 0 || chunkVZZPCYA3_cjs.isTextFlow(state.schema, block) ? null : block.id;
|
|
3277
3696
|
}
|
|
3278
3697
|
function useContextMenuOpener(controller, store, trigger) {
|
|
3279
3698
|
React7.useEffect(() => {
|
|
@@ -3292,7 +3711,7 @@ function useContextMenuOpener(controller, store, trigger) {
|
|
|
3292
3711
|
openBlockMenuAt(store, controller.editor.state, block, clientX, clientY);
|
|
3293
3712
|
hidden.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX, clientY }));
|
|
3294
3713
|
};
|
|
3295
|
-
return
|
|
3714
|
+
return chunkQJ34MOFV_cjs.listen(root, { mousedown: onMouseDown, contextmenu: onContextMenu });
|
|
3296
3715
|
}, [controller, store, trigger]);
|
|
3297
3716
|
}
|
|
3298
3717
|
|
|
@@ -3328,7 +3747,7 @@ function useLiveBlocks(controller, blockIds) {
|
|
|
3328
3747
|
(state) => blockIds.flatMap((id) => chunkWZA5S5EJ_cjs.blockById(state.doc, id) ?? []),
|
|
3329
3748
|
[blockIds]
|
|
3330
3749
|
);
|
|
3331
|
-
return
|
|
3750
|
+
return chunkQJ34MOFV_cjs.useEditorState(controller, select, chunkWZA5S5EJ_cjs.sameItems);
|
|
3332
3751
|
}
|
|
3333
3752
|
function useMenuBlocks(controller, store, menu) {
|
|
3334
3753
|
const labels = useLabels();
|
|
@@ -3381,12 +3800,12 @@ function BlockContextMenu({ controller, store, actions }) {
|
|
|
3381
3800
|
// src/gutter/block-menu-keymap.ts
|
|
3382
3801
|
function blockMenuKeymap(store) {
|
|
3383
3802
|
const openForHead = (state, dispatch) => {
|
|
3384
|
-
const head =
|
|
3803
|
+
const head = chunkVZZPCYA3_cjs.headBlockId(state.selection);
|
|
3385
3804
|
if (head === null || !state.doc.index.has(head)) return false;
|
|
3386
3805
|
if (dispatch) openBlockMenu(store, state, head);
|
|
3387
3806
|
return true;
|
|
3388
3807
|
};
|
|
3389
|
-
return
|
|
3808
|
+
return chunkVZZPCYA3_cjs.defineExtension({ name: "block-menu", keymap: { "Mod-/": openForHead } });
|
|
3390
3809
|
}
|
|
3391
3810
|
var UNIQUE_OR_FOCUSABLE = ["id", "data-block-id", "contenteditable", "tabindex"];
|
|
3392
3811
|
function copyOf(shell) {
|
|
@@ -3455,7 +3874,7 @@ var DragOverlay = React7.forwardRef(function DragOverlay2(_props, ref) {
|
|
|
3455
3874
|
var DELETION_STEPS = /* @__PURE__ */ new Set(["removeBlocks", "setIndent"]);
|
|
3456
3875
|
function drawnPosition(doc, blockId) {
|
|
3457
3876
|
const index = doc.index.get(blockId) ?? 0;
|
|
3458
|
-
return [
|
|
3877
|
+
return [chunkQJ34MOFV_cjs.drawnBlockCount(doc, 0, index) + 1, chunkQJ34MOFV_cjs.drawnBlockCount(doc)];
|
|
3459
3878
|
}
|
|
3460
3879
|
function blockMovedMessage(doc, blockId, labels) {
|
|
3461
3880
|
return labels.blockMoved(...drawnPosition(doc, blockId));
|
|
@@ -3471,11 +3890,11 @@ function deletedCount(tr) {
|
|
|
3471
3890
|
return tr.steps.reduce((deleted, step, i) => {
|
|
3472
3891
|
const { index, count } = step.toJSON();
|
|
3473
3892
|
if (step.stepType !== "removeBlocks" || typeof index !== "number" || typeof count !== "number") return deleted;
|
|
3474
|
-
return deleted +
|
|
3893
|
+
return deleted + chunkQJ34MOFV_cjs.drawnBlockCount(tr.docs[i], index, index + count);
|
|
3475
3894
|
}, 0);
|
|
3476
3895
|
}
|
|
3477
3896
|
function insertedBlock(tr) {
|
|
3478
|
-
if (tr.getMeta(
|
|
3897
|
+
if (tr.getMeta(chunkVZZPCYA3_cjs.LINE_SPLIT) === true || tr.steps.some((step) => step.stepType === "removeBlocks")) return null;
|
|
3479
3898
|
const inserted = tr.steps.flatMap((step) => {
|
|
3480
3899
|
const { blocks } = step.toJSON();
|
|
3481
3900
|
return step.stepType === "insertBlocks" && Array.isArray(blocks) ? blocks : [];
|
|
@@ -3483,7 +3902,7 @@ function insertedBlock(tr) {
|
|
|
3483
3902
|
return inserted.find((block) => tr.doc.index.has(block.id))?.id ?? null;
|
|
3484
3903
|
}
|
|
3485
3904
|
function structureAnnouncement(tr, labels, undoKeys) {
|
|
3486
|
-
if (tr.origin !== "command" || tr.getMeta(
|
|
3905
|
+
if (tr.origin !== "command" || tr.getMeta(chunkVZZPCYA3_cjs.LINE_JOIN) === true) return null;
|
|
3487
3906
|
const moved = movedBlock(tr);
|
|
3488
3907
|
if (moved !== null) return blockMovedMessage(tr.doc, moved, labels);
|
|
3489
3908
|
const deleted = deletedCount(tr);
|
|
@@ -3513,7 +3932,7 @@ function inlineEdges(shell, box, rtl) {
|
|
|
3513
3932
|
function measure(controller, root, moved, rtl) {
|
|
3514
3933
|
const { doc } = controller.editor.state;
|
|
3515
3934
|
const origin = rootOrigin(root);
|
|
3516
|
-
return
|
|
3935
|
+
return chunkQJ34MOFV_cjs.visibleBlockIndexes(doc).flatMap((index) => {
|
|
3517
3936
|
const { id, indent: indent3 } = doc.blocks[index];
|
|
3518
3937
|
const shell = controller.blockElement(id);
|
|
3519
3938
|
if (shell === void 0) return [];
|
|
@@ -3528,7 +3947,7 @@ function measureDrag(controller, root, ids) {
|
|
|
3528
3947
|
const { doc } = controller.editor.state;
|
|
3529
3948
|
const direction = inlineDirection(root);
|
|
3530
3949
|
const rtl = direction === "rtl";
|
|
3531
|
-
const moved = new Set(
|
|
3950
|
+
const moved = new Set(chunkVZZPCYA3_cjs.movedBlockIds(doc, ids));
|
|
3532
3951
|
const blocks = measure(controller, root, moved, rtl);
|
|
3533
3952
|
const dragged = blocks.filter((block) => block.dragged);
|
|
3534
3953
|
if (dragged.length === 0) return null;
|
|
@@ -3588,7 +4007,7 @@ function draggedBlocks(controller, blockId) {
|
|
|
3588
4007
|
function followPress(press, root, view) {
|
|
3589
4008
|
const { controller, store, overlay, handle: handle2, pointerId } = press;
|
|
3590
4009
|
const doc = view.document;
|
|
3591
|
-
const scroll =
|
|
4010
|
+
const scroll = chunkQJ34MOFV_cjs.createAutoScroll(root, follow, SCROLL_EDGE);
|
|
3592
4011
|
let pointer = { x: press.x, y: press.y };
|
|
3593
4012
|
let active = null;
|
|
3594
4013
|
let unsubscribe = () => {
|
|
@@ -3641,7 +4060,7 @@ function followPress(press, root, view) {
|
|
|
3641
4060
|
finish();
|
|
3642
4061
|
if (dropped === null || dropped.target === null || controller.readOnly) return;
|
|
3643
4062
|
const { ids, layout, target } = dropped;
|
|
3644
|
-
if (!controller.run(
|
|
4063
|
+
if (!controller.run(chunkVZZPCYA3_cjs.moveBlocksTo(ids, layout.toIndex(target.index), target.indent))) return;
|
|
3645
4064
|
controller.focus();
|
|
3646
4065
|
press.onMoved(ids[0]);
|
|
3647
4066
|
}
|
|
@@ -3663,9 +4082,9 @@ function followPress(press, root, view) {
|
|
|
3663
4082
|
event.stopPropagation();
|
|
3664
4083
|
finish();
|
|
3665
4084
|
}
|
|
3666
|
-
const unlistenDocument =
|
|
3667
|
-
const unlistenBlur =
|
|
3668
|
-
const unlistenKeys =
|
|
4085
|
+
const unlistenDocument = chunkQJ34MOFV_cjs.listen(doc, { pointermove: onPointerMove, pointerup: onPointerUp, pointercancel: finish });
|
|
4086
|
+
const unlistenBlur = chunkQJ34MOFV_cjs.listen(view, { blur: finish });
|
|
4087
|
+
const unlistenKeys = chunkQJ34MOFV_cjs.listen(view, { keydown: onKeyDown }, true);
|
|
3669
4088
|
return finish;
|
|
3670
4089
|
}
|
|
3671
4090
|
function pressDragHandle(press) {
|
|
@@ -3719,10 +4138,10 @@ function addBlockBelow(controller, blockId) {
|
|
|
3719
4138
|
const { doc, schema } = state;
|
|
3720
4139
|
const block = chunkWZA5S5EJ_cjs.blockById(doc, blockId);
|
|
3721
4140
|
if (block === void 0) return false;
|
|
3722
|
-
const empty =
|
|
3723
|
-
const fill = empty ?
|
|
3724
|
-
const slash =
|
|
3725
|
-
const { ok, tr } =
|
|
4141
|
+
const empty = chunkVZZPCYA3_cjs.isParagraph(block) && chunkVZZPCYA3_cjs.regionLength(block, chunkVZZPCYA3_cjs.primaryRegion(schema, block) ?? "") === 0;
|
|
4142
|
+
const fill = empty ? chunkVZZPCYA3_cjs.setSelection(chunkVZZPCYA3_cjs.startOf(doc, schema, blockId)) : chunkVZZPCYA3_cjs.insertBlockAfter("MARKDOWN", { kind: "paragraph" });
|
|
4143
|
+
const slash = chunkVZZPCYA3_cjs.insertText("/", { origin: "command" });
|
|
4144
|
+
const { ok, tr } = chunkVZZPCYA3_cjs.runCommands(state, [chunkVZZPCYA3_cjs.setSelection(chunkVZZPCYA3_cjs.blockRangeSelection(blockId)), fill, slash]);
|
|
3726
4145
|
if (ok && tr !== null) controller.dispatch(tr);
|
|
3727
4146
|
controller.focus();
|
|
3728
4147
|
return ok;
|
|
@@ -3800,7 +4219,7 @@ function place2(controller, root, gutter, block) {
|
|
|
3800
4219
|
gutter.style.visibility = "";
|
|
3801
4220
|
}
|
|
3802
4221
|
function useGutterPosition(controller, gutter, block) {
|
|
3803
|
-
|
|
4222
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
3804
4223
|
const element = gutter.current;
|
|
3805
4224
|
const root = controller.root;
|
|
3806
4225
|
const view = root?.ownerDocument.defaultView;
|
|
@@ -3824,7 +4243,7 @@ function useGutterPosition(controller, gutter, block) {
|
|
|
3824
4243
|
};
|
|
3825
4244
|
}, [controller, gutter, block]);
|
|
3826
4245
|
}
|
|
3827
|
-
var headOf = (state) =>
|
|
4246
|
+
var headOf = (state) => chunkVZZPCYA3_cjs.headBlockId(state.selection);
|
|
3828
4247
|
function blockAcross(controller, root, y) {
|
|
3829
4248
|
const box = root.getBoundingClientRect();
|
|
3830
4249
|
const probe = root.ownerDocument.elementFromPoint?.(box.left + box.width / 2, y);
|
|
@@ -3832,7 +4251,7 @@ function blockAcross(controller, root, y) {
|
|
|
3832
4251
|
}
|
|
3833
4252
|
function useGutterTarget(controller, store, gutter) {
|
|
3834
4253
|
const hovered = useCanvasUi(store, (state) => state.hoveredBlock);
|
|
3835
|
-
const head =
|
|
4254
|
+
const head = chunkQJ34MOFV_cjs.useEditorState(controller, headOf);
|
|
3836
4255
|
const [focusWithin, setFocusWithin] = React7.useState(false);
|
|
3837
4256
|
React7.useEffect(() => {
|
|
3838
4257
|
const root = controller.root;
|
|
@@ -3850,7 +4269,7 @@ function useGutterTarget(controller, store, gutter) {
|
|
|
3850
4269
|
const onFocusIn = () => setFocusWithin(true);
|
|
3851
4270
|
const onFocusOut = (event) => setFocusWithin(root.contains(event.relatedTarget));
|
|
3852
4271
|
setFocusWithin(root.contains(root.ownerDocument.activeElement));
|
|
3853
|
-
return
|
|
4272
|
+
return chunkQJ34MOFV_cjs.listen(root, { pointermove: onPointerMove, pointerleave: onPointerLeave, focusin: onFocusIn, focusout: onFocusOut });
|
|
3854
4273
|
}, [controller, store, gutter]);
|
|
3855
4274
|
const fallback = focusWithin ? head : null;
|
|
3856
4275
|
const target = hovered ?? fallback;
|
|
@@ -3895,7 +4314,7 @@ function Gutter({ controller, store, actions }) {
|
|
|
3895
4314
|
className: ADD_BELOW,
|
|
3896
4315
|
onPointerDown: keepFocus,
|
|
3897
4316
|
onClick: addBelow,
|
|
3898
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4317
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Plus, {})
|
|
3899
4318
|
}
|
|
3900
4319
|
),
|
|
3901
4320
|
/* @__PURE__ */ jsxRuntime.jsx(BlockMenu, { controller, store, actions, onOpen: openMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3917,7 +4336,7 @@ function Gutter({ controller, store, actions }) {
|
|
|
3917
4336
|
menuOpenAtPress.current = false;
|
|
3918
4337
|
if (!drag.takeClick(event) && !closing) openMenu();
|
|
3919
4338
|
},
|
|
3920
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4339
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(GripVertical, {})
|
|
3921
4340
|
}
|
|
3922
4341
|
) })
|
|
3923
4342
|
]
|
|
@@ -3947,7 +4366,7 @@ function pointInHost(host, { node, offset }) {
|
|
|
3947
4366
|
return host.contains(node) ? { node, offset: Math.min(offset, nodeLength(node)) } : null;
|
|
3948
4367
|
}
|
|
3949
4368
|
function textRect(host, { from, to }) {
|
|
3950
|
-
const map =
|
|
4369
|
+
const map = chunkQJ34MOFV_cjs.domMapOf(host);
|
|
3951
4370
|
const range = host.ownerDocument.createRange();
|
|
3952
4371
|
if (map === void 0 || typeof range.getBoundingClientRect !== "function") return null;
|
|
3953
4372
|
const start = pointInHost(host, map.toDom(from, 1));
|
|
@@ -3960,7 +4379,7 @@ function textRect(host, { from, to }) {
|
|
|
3960
4379
|
}
|
|
3961
4380
|
function rangeRect(controller, range) {
|
|
3962
4381
|
const host = controller.registry.get(range.block, range.region);
|
|
3963
|
-
if (host === void 0 || !host.isConnected || controller.composingKey ===
|
|
4382
|
+
if (host === void 0 || !host.isConnected || controller.composingKey === chunkQJ34MOFV_cjs.hostKey(range.block, range.region)) {
|
|
3964
4383
|
return null;
|
|
3965
4384
|
}
|
|
3966
4385
|
const rect = textRect(host, range);
|
|
@@ -3976,7 +4395,7 @@ function union(a, b) {
|
|
|
3976
4395
|
function selectionRect(controller) {
|
|
3977
4396
|
const { state } = controller.editor;
|
|
3978
4397
|
if (state.selection?.kind !== "text") return null;
|
|
3979
|
-
const ranges =
|
|
4398
|
+
const ranges = chunkVZZPCYA3_cjs.markRanges(state);
|
|
3980
4399
|
if (ranges.length === 0) return null;
|
|
3981
4400
|
const first = rangeRect(controller, ranges[0]);
|
|
3982
4401
|
if (ranges.length === 1) return first;
|
|
@@ -3987,7 +4406,7 @@ function selectionRect(controller) {
|
|
|
3987
4406
|
// src/menus/floating/use-selection-anchor.ts
|
|
3988
4407
|
var ROOM_ABOVE = 56;
|
|
3989
4408
|
function selectionHost(controller) {
|
|
3990
|
-
const [first] =
|
|
4409
|
+
const [first] = chunkVZZPCYA3_cjs.markRanges(controller.editor.state);
|
|
3991
4410
|
return (first && controller.registry.get(first.block, first.region)) ?? controller.root ?? void 0;
|
|
3992
4411
|
}
|
|
3993
4412
|
function useSelectionAnchor(controller, state) {
|
|
@@ -4001,7 +4420,7 @@ function useSelectionAnchor(controller, state) {
|
|
|
4001
4420
|
[controller, state]
|
|
4002
4421
|
);
|
|
4003
4422
|
const [side, setSide] = React7.useState("top");
|
|
4004
|
-
|
|
4423
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4005
4424
|
const rect = selectionRect(controller);
|
|
4006
4425
|
if (rect) setSide(rect.top < ROOM_ABOVE ? "bottom" : "top");
|
|
4007
4426
|
}, [controller, state]);
|
|
@@ -4032,11 +4451,11 @@ function ToolbarMenu({ controller, trigger, children }) {
|
|
|
4032
4451
|
}
|
|
4033
4452
|
);
|
|
4034
4453
|
}
|
|
4035
|
-
var ICONS = { left:
|
|
4454
|
+
var ICONS = { left: AlignLeft, center: AlignCenter, right: AlignRight, justify: AlignJustify };
|
|
4036
4455
|
var ALIGNS2 = Object.keys(ICONS);
|
|
4037
4456
|
var LABEL_KEYS = { left: "alignLeft", center: "alignCenter", right: "alignRight", justify: "alignJustify" };
|
|
4038
4457
|
function sharedAlign(state) {
|
|
4039
|
-
const blocks =
|
|
4458
|
+
const blocks = chunkVZZPCYA3_cjs.selectedBlockIds(state.doc, state.selection).map((id) => chunkWZA5S5EJ_cjs.blockById(state.doc, id)).filter((block) => block?.type === "MARKDOWN");
|
|
4040
4459
|
if (blocks.length === 0) return null;
|
|
4041
4460
|
const aligns = new Set(blocks.map((block) => chunkWZA5S5EJ_cjs.alignOrUndefined(block?.attrs.align) ?? "left"));
|
|
4042
4461
|
return aligns.size === 1 ? [...aligns][0] : "";
|
|
@@ -4045,9 +4464,9 @@ function AlignDropdown({ controller, state }) {
|
|
|
4045
4464
|
const labels = useLabels();
|
|
4046
4465
|
const value = sharedAlign(state);
|
|
4047
4466
|
if (value === null) return null;
|
|
4048
|
-
const
|
|
4049
|
-
const trigger = /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.align, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4050
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRadioGroup, { value, onValueChange: (align) => controller.run(
|
|
4467
|
+
const Icon2 = value === "" ? AlignLeft : ICONS[value];
|
|
4468
|
+
const trigger = /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.align, children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, {}) });
|
|
4469
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRadioGroup, { value, onValueChange: (align) => controller.run(chunkVZZPCYA3_cjs.setTextAlign(align)), children: ALIGNS2.map((align) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuRadioItem, { value: align, indicator: /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "size-4" }), children: [
|
|
4051
4470
|
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: ICONS[align] }),
|
|
4052
4471
|
labels[LABEL_KEYS[align]]
|
|
4053
4472
|
] }, align)) }) });
|
|
@@ -4055,8 +4474,8 @@ function AlignDropdown({ controller, state }) {
|
|
|
4055
4474
|
var MARKS = { color: "color", background: "highlight" };
|
|
4056
4475
|
function selectionColor(state, mark) {
|
|
4057
4476
|
const names = /* @__PURE__ */ new Set();
|
|
4058
|
-
for (const range of
|
|
4059
|
-
for (const node of
|
|
4477
|
+
for (const range of chunkVZZPCYA3_cjs.markRanges(state)) {
|
|
4478
|
+
for (const node of chunkVZZPCYA3_cjs.rangeContent(state, range)) {
|
|
4060
4479
|
const found = node.marks.find((candidate) => candidate.type === mark);
|
|
4061
4480
|
names.add(found === void 0 ? "default" : found.attrs?.color);
|
|
4062
4481
|
}
|
|
@@ -4065,25 +4484,25 @@ function selectionColor(state, mark) {
|
|
|
4065
4484
|
return names.size === 1 && typeof only === "string" ? only : "";
|
|
4066
4485
|
}
|
|
4067
4486
|
function colorCommand(key, name) {
|
|
4068
|
-
return name === "default" ?
|
|
4487
|
+
return name === "default" ? chunkVZZPCYA3_cjs.unsetMark(MARKS[key]) : chunkVZZPCYA3_cjs.setMark(MARKS[key], { color: name });
|
|
4069
4488
|
}
|
|
4070
4489
|
function ColorPopover({ controller, state }) {
|
|
4071
4490
|
const labels = useLabels();
|
|
4072
4491
|
const value = { color: selectionColor(state, MARKS.color), background: selectionColor(state, MARKS.background) };
|
|
4073
|
-
const trigger = /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.color, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4492
|
+
const trigger = /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.color, children: /* @__PURE__ */ jsxRuntime.jsx(Baseline, {}) });
|
|
4074
4493
|
return /* @__PURE__ */ jsxRuntime.jsx(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsxRuntime.jsx(ColorGroups, { kit: DROPDOWN_KIT, value, onPick: (key, name) => controller.run(colorCommand(key, name)) }) });
|
|
4075
4494
|
}
|
|
4076
4495
|
function TurnIntoDropdown({ controller, state }) {
|
|
4077
4496
|
const labels = useLabels();
|
|
4078
4497
|
const trigger = /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "gap-1 px-2 has-[>svg]:px-2", children: [
|
|
4079
4498
|
labels.turnInto,
|
|
4080
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4499
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
4081
4500
|
] });
|
|
4082
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsxRuntime.jsx(TurnIntoItems, { kit: DROPDOWN_KIT, controller, blockIds:
|
|
4501
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsxRuntime.jsx(TurnIntoItems, { kit: DROPDOWN_KIT, controller, blockIds: chunkVZZPCYA3_cjs.selectedBlockIds(state.doc, state.selection) }) });
|
|
4083
4502
|
}
|
|
4084
4503
|
var DIVIDER = "mx-0.5 h-5 w-px shrink-0 bg-border";
|
|
4085
4504
|
function BubbleToolbar({ controller, labels, store, extraItems }) {
|
|
4086
|
-
const state =
|
|
4505
|
+
const state = chunkQJ34MOFV_cjs.useEditorState(controller, chunkQJ34MOFV_cjs.wholeState);
|
|
4087
4506
|
const { anchor, side } = useSelectionAnchor(controller, state);
|
|
4088
4507
|
const roving = useRovingFocus();
|
|
4089
4508
|
const items = React7.useMemo(() => bubbleItems(labels, () => store.set({ linkPopover: { open: true } })), [labels, store]);
|
|
@@ -4145,10 +4564,10 @@ function useMediaQuery(query, unsupported) {
|
|
|
4145
4564
|
var useFinePointer = () => useMediaQuery("(pointer: fine)", true);
|
|
4146
4565
|
|
|
4147
4566
|
// src/menus/bubble/use-bubble-visibility.ts
|
|
4148
|
-
var hasTextRange = (state) => state.selection?.kind === "text" && !
|
|
4567
|
+
var hasTextRange = (state) => state.selection?.kind === "text" && !chunkVZZPCYA3_cjs.isCollapsed(state.selection) && chunkVZZPCYA3_cjs.markRanges(state).length > 0;
|
|
4149
4568
|
function useBubbleVisibility(controller) {
|
|
4150
|
-
const range =
|
|
4151
|
-
const readOnly =
|
|
4569
|
+
const range = chunkQJ34MOFV_cjs.useEditorState(controller, hasTextRange);
|
|
4570
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
4152
4571
|
const fine = useFinePointer();
|
|
4153
4572
|
const settled = useSelectionSettled(controller);
|
|
4154
4573
|
return range && !readOnly && fine && settled;
|
|
@@ -4165,14 +4584,14 @@ function BubbleOverlay({ controller }) {
|
|
|
4165
4584
|
return /* @__PURE__ */ jsxRuntime.jsx(BubbleToolbar, { controller, labels, store, extraItems });
|
|
4166
4585
|
}
|
|
4167
4586
|
function bubbleExtension() {
|
|
4168
|
-
return
|
|
4587
|
+
return chunkVZZPCYA3_cjs.defineExtension({ name: "bubble", ui: { overlays: [BubbleOverlay] } });
|
|
4169
4588
|
}
|
|
4170
4589
|
|
|
4171
4590
|
// src/menus/link/link-at-selection.ts
|
|
4172
4591
|
function linkAround(state, from, to = from) {
|
|
4173
4592
|
if (from.block !== to.block || from.region !== to.region) return null;
|
|
4174
|
-
const inline =
|
|
4175
|
-
const extent =
|
|
4593
|
+
const inline = chunkQJ34MOFV_cjs.regionInline(state, from.block, from.region) ?? [];
|
|
4594
|
+
const extent = chunkVZZPCYA3_cjs.markExtent(inline, from.offset, "link");
|
|
4176
4595
|
if (extent === null || to.offset > extent.to) return null;
|
|
4177
4596
|
const attrs = chunkWZA5S5EJ_cjs.sliceInline(inline, extent.from, extent.to)[0]?.marks.find((mark) => mark.type === "link")?.attrs;
|
|
4178
4597
|
if (attrs?.href === void 0) return null;
|
|
@@ -4182,7 +4601,7 @@ function linkAround(state, from, to = from) {
|
|
|
4182
4601
|
function linkAtSelection(state) {
|
|
4183
4602
|
const { selection } = state;
|
|
4184
4603
|
if (selection?.kind !== "text") return null;
|
|
4185
|
-
const { from, to } =
|
|
4604
|
+
const { from, to } = chunkVZZPCYA3_cjs.orderedRange(state.doc, selection.anchor, selection.head);
|
|
4186
4605
|
return linkAround(state, from, to);
|
|
4187
4606
|
}
|
|
4188
4607
|
|
|
@@ -4194,7 +4613,7 @@ function linkElementAt(controller, target) {
|
|
|
4194
4613
|
}
|
|
4195
4614
|
function linkAtElement(controller, state, element) {
|
|
4196
4615
|
const host = controller.registry.locate(element);
|
|
4197
|
-
const offset = host === null ? null :
|
|
4616
|
+
const offset = host === null ? null : chunkQJ34MOFV_cjs.domMapOf(host.element)?.fromDom(element, 0) ?? null;
|
|
4198
4617
|
if (host === null || offset === null) return null;
|
|
4199
4618
|
return linkAround(state, { block: host.block, region: host.region, offset });
|
|
4200
4619
|
}
|
|
@@ -4220,7 +4639,7 @@ function truncateMiddle(text2, max) {
|
|
|
4220
4639
|
// src/menus/link/unlink-range.ts
|
|
4221
4640
|
function unlinkRange({ block, region, from, to }) {
|
|
4222
4641
|
return (state, dispatch) => {
|
|
4223
|
-
const tr = new
|
|
4642
|
+
const tr = new chunkVZZPCYA3_cjs.Transaction(state).step(chunkVZZPCYA3_cjs.removeMarkStep(block, region, from, to, "link"));
|
|
4224
4643
|
if (!tr.docChanged) return false;
|
|
4225
4644
|
dispatch?.(tr);
|
|
4226
4645
|
return true;
|
|
@@ -4242,12 +4661,12 @@ function useRestedValue(value, delay) {
|
|
|
4242
4661
|
// src/menus/link/use-caret-in-link.ts
|
|
4243
4662
|
function caretLinkKey(state) {
|
|
4244
4663
|
const { selection } = state;
|
|
4245
|
-
if (selection?.kind !== "text" || !
|
|
4664
|
+
if (selection?.kind !== "text" || !chunkVZZPCYA3_cjs.isCollapsed(selection)) return null;
|
|
4246
4665
|
const link = linkAtSelection(state);
|
|
4247
4666
|
return link && [link.range.block, link.range.region, link.range.from, link.href].join("\0");
|
|
4248
4667
|
}
|
|
4249
4668
|
function useCaretInLink(controller, delay) {
|
|
4250
|
-
const key =
|
|
4669
|
+
const key = chunkQJ34MOFV_cjs.useEditorState(controller, caretLinkKey);
|
|
4251
4670
|
const settled = useSelectionSettled(controller);
|
|
4252
4671
|
return useRestedValue(settled ? key : null, delay) !== null;
|
|
4253
4672
|
}
|
|
@@ -4281,7 +4700,7 @@ var URL_LENGTH = 48;
|
|
|
4281
4700
|
var CARD = "flex w-auto items-center gap-0.5 py-1 ps-3 pe-1 shadow-md";
|
|
4282
4701
|
var ADDRESS = "me-1 whitespace-nowrap text-sm text-muted-foreground";
|
|
4283
4702
|
function LinkCard({ controller, labels, store, cardRef, element, onUnlinked }) {
|
|
4284
|
-
const state =
|
|
4703
|
+
const state = chunkQJ34MOFV_cjs.useEditorState(controller, chunkQJ34MOFV_cjs.wholeState);
|
|
4285
4704
|
const link = React7.useMemo(
|
|
4286
4705
|
() => element === null ? linkAtSelection(state) : linkAtElement(controller, state, element),
|
|
4287
4706
|
[controller, state, element]
|
|
@@ -4298,8 +4717,8 @@ function LinkCard({ controller, labels, store, cardRef, element, onUnlinked }) {
|
|
|
4298
4717
|
const address = truncateMiddle(link.href, URL_LENGTH);
|
|
4299
4718
|
const edit2 = () => {
|
|
4300
4719
|
if (element !== null) {
|
|
4301
|
-
const selection =
|
|
4302
|
-
|
|
4720
|
+
const selection = chunkVZZPCYA3_cjs.textSelection({ block, region, offset: from }, { block, region, offset: to });
|
|
4721
|
+
chunkQJ34MOFV_cjs.dispatchSelection(controller, selection);
|
|
4303
4722
|
}
|
|
4304
4723
|
store.set({ linkPopover: { open: true } });
|
|
4305
4724
|
};
|
|
@@ -4323,9 +4742,9 @@ function LinkCard({ controller, labels, store, cardRef, element, onUnlinked }) {
|
|
|
4323
4742
|
onMouseDown: keepFocus,
|
|
4324
4743
|
children: [
|
|
4325
4744
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ADDRESS, title: address === link.href ? void 0 : link.href, children: address }),
|
|
4326
|
-
href !== null && /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4327
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkEdit, onClick: edit2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4328
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: unlink, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4745
|
+
href !== null && /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, {}) }) }),
|
|
4746
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkEdit, onClick: edit2, children: /* @__PURE__ */ jsxRuntime.jsx(Pencil, {}) }),
|
|
4747
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: unlink, children: /* @__PURE__ */ jsxRuntime.jsx(Unlink, {}) })
|
|
4329
4748
|
]
|
|
4330
4749
|
}
|
|
4331
4750
|
)
|
|
@@ -4345,8 +4764,8 @@ function insertLinkedText(value, href, caret) {
|
|
|
4345
4764
|
return (state, dispatch) => {
|
|
4346
4765
|
if (!safe) return false;
|
|
4347
4766
|
const link = { type: "link", attrs: { href: safe } };
|
|
4348
|
-
const marks = chunkWZA5S5EJ_cjs.addMark(
|
|
4349
|
-
const tr = new
|
|
4767
|
+
const marks = chunkWZA5S5EJ_cjs.addMark(chunkVZZPCYA3_cjs.caretMarks(state.doc, state.schema, state.storedMarks, caret), link);
|
|
4768
|
+
const tr = new chunkVZZPCYA3_cjs.Transaction(state).step(chunkVZZPCYA3_cjs.replaceInlineStep(caret.block, caret.region, caret.offset, caret.offset, [chunkWZA5S5EJ_cjs.text(value, marks)])).setSelection(chunkVZZPCYA3_cjs.textSelection({ ...caret, offset: caret.offset + value.length }));
|
|
4350
4769
|
dispatch?.(tr);
|
|
4351
4770
|
return true;
|
|
4352
4771
|
};
|
|
@@ -4355,10 +4774,10 @@ function applyLink(href, value) {
|
|
|
4355
4774
|
return (state, dispatch) => {
|
|
4356
4775
|
const { selection } = state;
|
|
4357
4776
|
const link = linkAtSelection(state);
|
|
4358
|
-
if (selection?.kind === "text" &&
|
|
4777
|
+
if (selection?.kind === "text" && chunkVZZPCYA3_cjs.isCollapsed(selection) && link === null) {
|
|
4359
4778
|
return insertLinkedText(value, href, selection.head)(state, dispatch);
|
|
4360
4779
|
}
|
|
4361
|
-
return
|
|
4780
|
+
return chunkVZZPCYA3_cjs.setLink(href, link?.title)(state, dispatch);
|
|
4362
4781
|
};
|
|
4363
4782
|
}
|
|
4364
4783
|
var CONTENT2 = "w-80 p-2 shadow-md";
|
|
@@ -4369,7 +4788,7 @@ function popoverAnchor(controller, link) {
|
|
|
4369
4788
|
if (selection?.kind !== "text") return null;
|
|
4370
4789
|
const { block, region, offset } = selection.head;
|
|
4371
4790
|
const caret = link?.range ?? { block, region, from: offset, to: offset };
|
|
4372
|
-
const collapsed =
|
|
4791
|
+
const collapsed = chunkVZZPCYA3_cjs.isCollapsed(selection);
|
|
4373
4792
|
return virtualAnchor(
|
|
4374
4793
|
() => collapsed ? rangeRect(controller, caret) : selectionRect(controller),
|
|
4375
4794
|
() => controller.registry.get(block, region)
|
|
@@ -4398,7 +4817,7 @@ function LinkPopover({ controller, labels, onClose }) {
|
|
|
4398
4817
|
backToText();
|
|
4399
4818
|
};
|
|
4400
4819
|
const remove = () => {
|
|
4401
|
-
controller.run(
|
|
4820
|
+
controller.run(chunkVZZPCYA3_cjs.unsetLink);
|
|
4402
4821
|
backToText();
|
|
4403
4822
|
};
|
|
4404
4823
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4437,9 +4856,9 @@ function LinkPopover({ controller, labels, onClose }) {
|
|
|
4437
4856
|
onChange
|
|
4438
4857
|
}
|
|
4439
4858
|
),
|
|
4440
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", variant: "ghost", size: "icon-sm", "aria-label": labels.linkApply, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4441
|
-
openHref && /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: openHref, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4442
|
-
link !== null && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: remove, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4859
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", variant: "ghost", size: "icon-sm", "aria-label": labels.linkApply, children: /* @__PURE__ */ jsxRuntime.jsx(Check, {}) }),
|
|
4860
|
+
openHref && /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: openHref, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, {}) }) }),
|
|
4861
|
+
link !== null && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: remove, children: /* @__PURE__ */ jsxRuntime.jsx(Unlink, {}) })
|
|
4443
4862
|
] }),
|
|
4444
4863
|
invalid && /* @__PURE__ */ jsxRuntime.jsx("p", { id: messageId, role: "alert", className: MESSAGE, children: labels.invalidLink })
|
|
4445
4864
|
]
|
|
@@ -4466,7 +4885,7 @@ function LinkOverlay({ controller }) {
|
|
|
4466
4885
|
const labels = useLabels();
|
|
4467
4886
|
const store = useCanvasUiStore();
|
|
4468
4887
|
const popoverOpen = useCanvasUi(store, isPopoverOpen);
|
|
4469
|
-
const readOnly =
|
|
4888
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
4470
4889
|
useLinkClicks(controller);
|
|
4471
4890
|
React7.useEffect(() => {
|
|
4472
4891
|
if (readOnly && store.get().linkPopover.open) store.set({ linkPopover: { open: false } });
|
|
@@ -4481,7 +4900,7 @@ function linkExtension(store) {
|
|
|
4481
4900
|
if (dispatch) store.set({ linkPopover: { open: true } });
|
|
4482
4901
|
return true;
|
|
4483
4902
|
};
|
|
4484
|
-
return
|
|
4903
|
+
return chunkVZZPCYA3_cjs.defineExtension({ name: "link", keymap: { "Mod-k": openPopover }, ui: { overlays: [LinkOverlay] } });
|
|
4485
4904
|
}
|
|
4486
4905
|
|
|
4487
4906
|
// src/menus/suggestion/find-trigger.ts
|
|
@@ -4506,7 +4925,7 @@ function triggerOffset(text2, start, config) {
|
|
|
4506
4925
|
}
|
|
4507
4926
|
function findTrigger(state, config) {
|
|
4508
4927
|
const { doc, selection } = state;
|
|
4509
|
-
if (selection?.kind !== "text" || !
|
|
4928
|
+
if (selection?.kind !== "text" || !chunkVZZPCYA3_cjs.isCollapsed(selection)) return null;
|
|
4510
4929
|
const { block: blockId, region, offset: caret } = selection.head;
|
|
4511
4930
|
const block = chunkWZA5S5EJ_cjs.blockById(doc, blockId);
|
|
4512
4931
|
if (block === void 0 || NO_TRIGGER_TYPES.has(block.type) || !Object.hasOwn(block.regions, region)) return null;
|
|
@@ -4544,7 +4963,7 @@ function suggestionPlugin(key, config) {
|
|
|
4544
4963
|
init: (state) => ({ active: nearest(state, findTrigger(state, config)), dismissedAt: null }),
|
|
4545
4964
|
apply(tr, value, oldState, newState) {
|
|
4546
4965
|
const dismissing = tr.getMeta(DISMISS) === key.name;
|
|
4547
|
-
if (!dismissing && !tr.docChanged &&
|
|
4966
|
+
if (!dismissing && !tr.docChanged && chunkVZZPCYA3_cjs.sameSelection(oldState.selection, newState.selection)) return value;
|
|
4548
4967
|
const found = findTrigger(newState, config);
|
|
4549
4968
|
let dismissedAt = null;
|
|
4550
4969
|
if (dismissing) dismissedAt = found && rangeOf2(found);
|
|
@@ -4561,14 +4980,16 @@ function suggestionPlugin(key, config) {
|
|
|
4561
4980
|
}
|
|
4562
4981
|
function dismissSuggestion(key) {
|
|
4563
4982
|
return (state, dispatch) => {
|
|
4564
|
-
if (
|
|
4565
|
-
dispatch?.(new
|
|
4983
|
+
if (chunkVZZPCYA3_cjs.getPluginState(state, key).active === null) return false;
|
|
4984
|
+
dispatch?.(new chunkVZZPCYA3_cjs.Transaction(state).setMeta(DISMISS, key.name));
|
|
4566
4985
|
return true;
|
|
4567
4986
|
};
|
|
4568
4987
|
}
|
|
4569
4988
|
|
|
4570
4989
|
// src/menus/slash/slash-key.ts
|
|
4571
|
-
var slashKey =
|
|
4990
|
+
var slashKey = chunkVZZPCYA3_cjs.createPluginKey("slash");
|
|
4991
|
+
|
|
4992
|
+
// src/menus/slash/slash-items.ts
|
|
4572
4993
|
var DETAILS = {
|
|
4573
4994
|
text: { group: "basic", keywords: ["paragraph", "plain"], shortcut: "Mod-Alt-0" },
|
|
4574
4995
|
heading1: { group: "basic", keywords: ["h1", "title", "#"], shortcut: "Mod-Alt-1" },
|
|
@@ -4600,9 +5021,9 @@ function insertionItem(id, insertion, labels, definitions) {
|
|
|
4600
5021
|
function builtInSlashItems(labels, definitions) {
|
|
4601
5022
|
const { blockNames } = labels;
|
|
4602
5023
|
const insertions = {
|
|
4603
|
-
divider: { label: blockNames.divider, icon:
|
|
4604
|
-
image: { label: blockNames.image, icon:
|
|
4605
|
-
file: { label: blockNames.file, icon:
|
|
5024
|
+
divider: { label: blockNames.divider, icon: Minus, type: "DIVIDER", attrs: {} },
|
|
5025
|
+
image: { label: blockNames.image, icon: Image, type: "IMAGE", attrs: {} },
|
|
5026
|
+
file: { label: blockNames.file, icon: Paperclip, type: "FILE", attrs: {} }
|
|
4606
5027
|
};
|
|
4607
5028
|
for (const target of turnIntoTargets(labels)) insertions[target.id] = target;
|
|
4608
5029
|
return Object.keys(DETAILS).flatMap((id) => {
|
|
@@ -4644,10 +5065,10 @@ function useRangeAnchor(controller, range) {
|
|
|
4644
5065
|
const [side, setSide] = React7.useState("bottom");
|
|
4645
5066
|
const latest = React7.useRef(range);
|
|
4646
5067
|
const start = range === null ? null : `${range.block} ${range.region} ${range.from}`;
|
|
4647
|
-
|
|
5068
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4648
5069
|
latest.current = range;
|
|
4649
5070
|
});
|
|
4650
|
-
|
|
5071
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4651
5072
|
const rect = latest.current && rangeRect(controller, latest.current);
|
|
4652
5073
|
if (rect) setSide(sideFor(rect, window.innerHeight));
|
|
4653
5074
|
}, [controller, start]);
|
|
@@ -4673,11 +5094,11 @@ function openCombobox(host, listboxId) {
|
|
|
4673
5094
|
}
|
|
4674
5095
|
function useComboboxHost(controller, block, region, listboxId, activeOptionId) {
|
|
4675
5096
|
const host = React7.useRef(null);
|
|
4676
|
-
|
|
5097
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4677
5098
|
host.current = block === null || region === null ? null : controller.registry.get(block, region) ?? null;
|
|
4678
5099
|
return host.current === null ? void 0 : openCombobox(host.current, listboxId);
|
|
4679
5100
|
}, [controller, block, region, listboxId]);
|
|
4680
|
-
|
|
5101
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4681
5102
|
if (host.current !== null) restore(host.current, "aria-activedescendant", activeOptionId);
|
|
4682
5103
|
}, [block, region, activeOptionId]);
|
|
4683
5104
|
}
|
|
@@ -4723,10 +5144,10 @@ function handle(event, menu) {
|
|
|
4723
5144
|
}
|
|
4724
5145
|
function useSuggestionKeys(controller, open, menu) {
|
|
4725
5146
|
const latest = React7.useRef(menu);
|
|
4726
|
-
|
|
5147
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4727
5148
|
latest.current = menu;
|
|
4728
5149
|
});
|
|
4729
|
-
|
|
5150
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4730
5151
|
if (!open) return;
|
|
4731
5152
|
const intercept = (event) => {
|
|
4732
5153
|
const handled = handle(event, latest.current);
|
|
@@ -4747,10 +5168,10 @@ var isPromise = (value) => typeof value?.then === "function";
|
|
|
4747
5168
|
function useSuggestionResults(source, query, onError) {
|
|
4748
5169
|
const [answer, setAnswer] = React7.useState(FORGOTTEN);
|
|
4749
5170
|
const report = React7.useRef(onError);
|
|
4750
|
-
|
|
5171
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4751
5172
|
report.current = onError;
|
|
4752
5173
|
});
|
|
4753
|
-
|
|
5174
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4754
5175
|
if (query === null) {
|
|
4755
5176
|
setAnswer(FORGOTTEN);
|
|
4756
5177
|
return;
|
|
@@ -4794,9 +5215,9 @@ function useSuggestion({
|
|
|
4794
5215
|
emptyLabel
|
|
4795
5216
|
}) {
|
|
4796
5217
|
const { labels, onError } = useQuoin();
|
|
4797
|
-
const readOnly =
|
|
4798
|
-
const selectTrigger = React7.useCallback((state) =>
|
|
4799
|
-
const active =
|
|
5218
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
5219
|
+
const selectTrigger = React7.useCallback((state) => chunkVZZPCYA3_cjs.getPluginState(state, pluginKey).active, [pluginKey]);
|
|
5220
|
+
const active = chunkQJ34MOFV_cjs.useEditorState(controller, selectTrigger);
|
|
4800
5221
|
const trigger = readOnly ? null : active;
|
|
4801
5222
|
const results = useSuggestionResults(source, trigger?.query ?? null, onError);
|
|
4802
5223
|
const sections = React7.useMemo(() => groupItems(results.items, groupOf2), [results.items, groupOf2]);
|
|
@@ -4818,7 +5239,7 @@ function useSuggestion({
|
|
|
4818
5239
|
);
|
|
4819
5240
|
const select = React7.useCallback(
|
|
4820
5241
|
(index) => {
|
|
4821
|
-
const current =
|
|
5242
|
+
const current = chunkVZZPCYA3_cjs.getPluginState(controller.editor.state, pluginKey).active;
|
|
4822
5243
|
if (current !== null && index < ordered.length) onSelect(ordered[index], rangeOf2(current));
|
|
4823
5244
|
},
|
|
4824
5245
|
[controller, pluginKey, ordered, onSelect]
|
|
@@ -4866,7 +5287,7 @@ function SuggestionMenu(props) {
|
|
|
4866
5287
|
const { trigger, sections, activeIndex, listboxId } = suggestion;
|
|
4867
5288
|
const { anchor, side } = useRangeAnchor(controller, trigger);
|
|
4868
5289
|
const listbox = React7.useRef(null);
|
|
4869
|
-
|
|
5290
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
4870
5291
|
listbox.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
4871
5292
|
}, [activeIndex, sections]);
|
|
4872
5293
|
if (trigger === null) return null;
|
|
@@ -4925,14 +5346,14 @@ function SuggestionMenu(props) {
|
|
|
4925
5346
|
// src/menus/suggestion/replace-trigger.ts
|
|
4926
5347
|
function deleteTrigger({ block, region, from, to }) {
|
|
4927
5348
|
return (state, dispatch) => {
|
|
4928
|
-
const tr = new
|
|
4929
|
-
if (from >= to || !tr.maybeStep(
|
|
4930
|
-
dispatch?.(tr.setSelection(
|
|
5349
|
+
const tr = new chunkVZZPCYA3_cjs.Transaction(state);
|
|
5350
|
+
if (from >= to || !tr.maybeStep(chunkVZZPCYA3_cjs.replaceInlineStep(block, region, from, to, []))) return false;
|
|
5351
|
+
dispatch?.(tr.setSelection(chunkVZZPCYA3_cjs.textSelection({ block, region, offset: from })));
|
|
4931
5352
|
return true;
|
|
4932
5353
|
};
|
|
4933
5354
|
}
|
|
4934
5355
|
function triggerReplacement(state, range, command) {
|
|
4935
|
-
return
|
|
5356
|
+
return chunkVZZPCYA3_cjs.runCommands(state, command === void 0 ? [deleteTrigger(range)] : [deleteTrigger(range), command]);
|
|
4936
5357
|
}
|
|
4937
5358
|
function replaceTrigger(controller, range, command) {
|
|
4938
5359
|
const { ok, tr } = triggerReplacement(controller.editor.state, range, command);
|
|
@@ -4945,7 +5366,7 @@ var TEXT_STEPS = /* @__PURE__ */ new Set(["replaceInline", "addMark", "removeMar
|
|
|
4945
5366
|
var WHITESPACE3 = /\s/;
|
|
4946
5367
|
var changesBlocks = (tr) => tr !== null && tr.steps.some((step) => !TEXT_STEPS.has(step.stepType));
|
|
4947
5368
|
function withSpaceBefore(state, range) {
|
|
4948
|
-
const inline =
|
|
5369
|
+
const inline = chunkQJ34MOFV_cjs.regionInline(state, range.block, range.region);
|
|
4949
5370
|
if (inline === void 0 || range.from === 0) return null;
|
|
4950
5371
|
const text2 = chunkWZA5S5EJ_cjs.inlineText(inline);
|
|
4951
5372
|
const after = text2.charAt(range.to);
|
|
@@ -5052,32 +5473,34 @@ function SlashOverlay({ controller }) {
|
|
|
5052
5473
|
return /* @__PURE__ */ jsxRuntime.jsx(SlashMenu, { controller, labels, items });
|
|
5053
5474
|
}
|
|
5054
5475
|
function slashExtension() {
|
|
5055
|
-
return
|
|
5476
|
+
return chunkVZZPCYA3_cjs.defineExtension({
|
|
5056
5477
|
name: "slash",
|
|
5057
5478
|
plugins: [suggestionPlugin(slashKey, { char: "/" })],
|
|
5058
5479
|
ui: { overlays: [SlashOverlay] }
|
|
5059
5480
|
});
|
|
5060
5481
|
}
|
|
5482
|
+
|
|
5483
|
+
// src/mobile/mobile-items.tsx
|
|
5061
5484
|
function commandItem(id, title, icon, command) {
|
|
5062
5485
|
return { id, title, icon, run: (controller) => void controller.run(command) };
|
|
5063
5486
|
}
|
|
5064
5487
|
function addBlockAtCaret(controller) {
|
|
5065
|
-
const block =
|
|
5488
|
+
const block = chunkVZZPCYA3_cjs.headBlockId(controller.editor.state.selection);
|
|
5066
5489
|
if (block !== null) addBlockBelow(controller, block);
|
|
5067
5490
|
}
|
|
5068
5491
|
function mobileItems(labels, openLink) {
|
|
5069
5492
|
return {
|
|
5070
|
-
addBlock: { id: "add-block", title: labels.addBelow, icon:
|
|
5493
|
+
addBlock: { id: "add-block", title: labels.addBelow, icon: Plus, run: addBlockAtCaret },
|
|
5071
5494
|
editing: [
|
|
5072
|
-
markItem("bold", labels.bold,
|
|
5073
|
-
markItem("italic", labels.italic,
|
|
5074
|
-
markItem("strike", labels.strike,
|
|
5075
|
-
markItem("code", labels.code,
|
|
5495
|
+
markItem("bold", labels.bold, Bold),
|
|
5496
|
+
markItem("italic", labels.italic, Italic),
|
|
5497
|
+
markItem("strike", labels.strike, Strikethrough),
|
|
5498
|
+
markItem("code", labels.code, Code),
|
|
5076
5499
|
linkItem(labels, openLink),
|
|
5077
|
-
commandItem("indent", labels.indent,
|
|
5078
|
-
commandItem("outdent", labels.outdent,
|
|
5079
|
-
commandItem("undo", labels.undo,
|
|
5080
|
-
commandItem("redo", labels.redo,
|
|
5500
|
+
commandItem("indent", labels.indent, ListIndentIncrease, chunkVZZPCYA3_cjs.indent),
|
|
5501
|
+
commandItem("outdent", labels.outdent, ListIndentDecrease, chunkVZZPCYA3_cjs.outdent),
|
|
5502
|
+
commandItem("undo", labels.undo, Undo2, chunkVZZPCYA3_cjs.undo),
|
|
5503
|
+
commandItem("redo", labels.redo, Redo2, chunkVZZPCYA3_cjs.redo)
|
|
5081
5504
|
]
|
|
5082
5505
|
};
|
|
5083
5506
|
}
|
|
@@ -5131,7 +5554,7 @@ function placement(viewport) {
|
|
|
5131
5554
|
function EditingTools({ controller }) {
|
|
5132
5555
|
const labels = useLabels();
|
|
5133
5556
|
const store = useCanvasUiStore();
|
|
5134
|
-
const state =
|
|
5557
|
+
const state = chunkQJ34MOFV_cjs.useEditorState(controller, chunkQJ34MOFV_cjs.wholeState);
|
|
5135
5558
|
const viewport = useVisualViewport();
|
|
5136
5559
|
const roving = useRovingFocus();
|
|
5137
5560
|
const items = React7.useMemo(() => mobileItems(labels, () => store.set({ linkPopover: { open: true } })), [labels, store]);
|
|
@@ -5216,7 +5639,7 @@ var DialogContent = /* @__PURE__ */ React7__namespace.forwardRef(function Dialog
|
|
|
5216
5639
|
ICON_TAP_TARGET_FLOOR
|
|
5217
5640
|
),
|
|
5218
5641
|
children: [
|
|
5219
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5642
|
+
/* @__PURE__ */ jsxRuntime.jsx(X, {}),
|
|
5220
5643
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: closeLabel })
|
|
5221
5644
|
]
|
|
5222
5645
|
}
|
|
@@ -5377,7 +5800,7 @@ function shortcutsSlashItem(labels, store) {
|
|
|
5377
5800
|
id: "shortcuts",
|
|
5378
5801
|
title: labels.shortcuts,
|
|
5379
5802
|
group: "advanced",
|
|
5380
|
-
icon:
|
|
5803
|
+
icon: Keyboard,
|
|
5381
5804
|
keywords: ["keyboard", "keys", "hotkeys", "help", "?"],
|
|
5382
5805
|
shortcut: SHORTCUT,
|
|
5383
5806
|
run: () => store.set({ shortcutsOpen: true })
|
|
@@ -5388,7 +5811,7 @@ function shortcutsExtension(store) {
|
|
|
5388
5811
|
if (dispatch) store.set({ shortcutsOpen: true });
|
|
5389
5812
|
return true;
|
|
5390
5813
|
};
|
|
5391
|
-
return
|
|
5814
|
+
return chunkVZZPCYA3_cjs.defineExtension({
|
|
5392
5815
|
name: "shortcuts",
|
|
5393
5816
|
keymap: { [SHORTCUT]: open, "Mod-Shift-?": open },
|
|
5394
5817
|
ui: { overlays: [ShortcutsOverlay] }
|
|
@@ -5424,8 +5847,8 @@ function writeBlockData(controller, blockId, data) {
|
|
|
5424
5847
|
const block = doc.blocks[index];
|
|
5425
5848
|
const { attrs, regions } = chunkWZA5S5EJ_cjs.specFor(schema, block.type).fromData(data, editor.codec.context);
|
|
5426
5849
|
if (chunkWZA5S5EJ_cjs.sameValue(attrs, block.attrs) && chunkWZA5S5EJ_cjs.sameValue(regions, block.regions)) return;
|
|
5427
|
-
const tr = editor.createTransaction().step(
|
|
5428
|
-
editor.dispatch(tr.setMeta(
|
|
5850
|
+
const tr = editor.createTransaction().step(chunkVZZPCYA3_cjs.replaceBlockStep({ ...block, attrs, regions }));
|
|
5851
|
+
editor.dispatch(tr.setMeta(chunkVZZPCYA3_cjs.HISTORY_GROUP, `block-data:${blockId}`));
|
|
5429
5852
|
}
|
|
5430
5853
|
function insertAfterBlock(controller, blockId, type, definitions, onError) {
|
|
5431
5854
|
const editor = internal(controller);
|
|
@@ -5455,7 +5878,7 @@ function runHistoryKey(controller, event) {
|
|
|
5455
5878
|
}
|
|
5456
5879
|
function useBlockIndex(controller, blockId) {
|
|
5457
5880
|
const select = React7.useCallback((state) => state.doc.index.get(blockId) ?? -1, [blockId]);
|
|
5458
|
-
return
|
|
5881
|
+
return chunkQJ34MOFV_cjs.useEditorState(controller, select);
|
|
5459
5882
|
}
|
|
5460
5883
|
var FOCUSABLE = [
|
|
5461
5884
|
"input:not([disabled])",
|
|
@@ -5482,8 +5905,8 @@ function useEditingFocus(root, editing, stop) {
|
|
|
5482
5905
|
const leaveUnlessInside = (event) => {
|
|
5483
5906
|
if (!inside.current.has(event)) stop();
|
|
5484
5907
|
};
|
|
5485
|
-
const unlistenCapture =
|
|
5486
|
-
const unlisten =
|
|
5908
|
+
const unlistenCapture = chunkQJ34MOFV_cjs.listen(doc, { pointerdown: leaveForCanvas }, true);
|
|
5909
|
+
const unlisten = chunkQJ34MOFV_cjs.listen(doc, { pointerdown: leaveUnlessInside, focusin: leaveUnlessInside });
|
|
5487
5910
|
return () => {
|
|
5488
5911
|
unlistenCapture();
|
|
5489
5912
|
unlisten();
|
|
@@ -5512,8 +5935,8 @@ function VoidEditor({ Editor, controller, ...props }) {
|
|
|
5512
5935
|
}
|
|
5513
5936
|
function VoidBlock({ block, controller, definition }) {
|
|
5514
5937
|
const { blockTypes, labels } = useQuoin();
|
|
5515
|
-
const { report } = React7.useContext(
|
|
5516
|
-
const readOnly =
|
|
5938
|
+
const { report } = React7.useContext(chunkQJ34MOFV_cjs.BlockErrorContext);
|
|
5939
|
+
const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
|
|
5517
5940
|
const { editor: Editor, alwaysEditing = false } = definition;
|
|
5518
5941
|
const name = blockTypeLabel(labels, block, blockTypes);
|
|
5519
5942
|
const blockId = block.id;
|
|
@@ -5577,7 +6000,7 @@ function VoidBlock({ block, controller, definition }) {
|
|
|
5577
6000
|
role: "group",
|
|
5578
6001
|
"aria-label": name,
|
|
5579
6002
|
tabIndex: editorShown ? -1 : void 0,
|
|
5580
|
-
...{ [
|
|
6003
|
+
...{ [chunkQJ34MOFV_cjs.NATIVE_INTERACTION]: editorShown ? "" : void 0 },
|
|
5581
6004
|
onKeyDown,
|
|
5582
6005
|
...focusHandlers,
|
|
5583
6006
|
onClick,
|
|
@@ -5615,7 +6038,7 @@ function VoidBlock({ block, controller, definition }) {
|
|
|
5615
6038
|
"aria-label": labels.editBlock(name),
|
|
5616
6039
|
onClick: () => start(),
|
|
5617
6040
|
className: "absolute right-0 top-0 bg-background/90 opacity-0 group-hover/void:opacity-100 in-data-[selected=true]:opacity-100 pointer-coarse:opacity-100 focus-visible:opacity-100",
|
|
5618
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6041
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Pencil, { "aria-hidden": "true" })
|
|
5619
6042
|
}
|
|
5620
6043
|
)
|
|
5621
6044
|
]
|
|
@@ -5678,7 +6101,7 @@ function fileBlock(file, stored) {
|
|
|
5678
6101
|
}
|
|
5679
6102
|
function anchorBlock(controller, at) {
|
|
5680
6103
|
const { doc, selection } = controller.editor.state;
|
|
5681
|
-
const candidates = [at?.block,
|
|
6104
|
+
const candidates = [at?.block, chunkVZZPCYA3_cjs.headBlockId(selection), doc.blocks[doc.blocks.length - 1]?.id];
|
|
5682
6105
|
return candidates.find((id) => typeof id === "string" && doc.index.has(id)) ?? null;
|
|
5683
6106
|
}
|
|
5684
6107
|
var writerOf = (controller) => ({
|
|
@@ -5687,7 +6110,7 @@ var writerOf = (controller) => ({
|
|
|
5687
6110
|
});
|
|
5688
6111
|
function movedOn(controller, before) {
|
|
5689
6112
|
const now = writerOf(controller);
|
|
5690
|
-
return now.focus !== before.focus || !
|
|
6113
|
+
return now.focus !== before.focus || !chunkVZZPCYA3_cjs.sameSelection(now.selection, before.selection);
|
|
5691
6114
|
}
|
|
5692
6115
|
async function insertUploads(controller, files, at, { upload, resolveAssetUrl, onError, unavailable, failed }) {
|
|
5693
6116
|
if (!upload) return onError(new Error(unavailable));
|
|
@@ -5722,8 +6145,8 @@ function markdownPlaceholder(state, block, labels) {
|
|
|
5722
6145
|
return holdsHead(state, block) || state.doc.blocks.length === 1 ? labels.placeholderEmpty : void 0;
|
|
5723
6146
|
}
|
|
5724
6147
|
function placeholderFor(state, block, labels) {
|
|
5725
|
-
const region =
|
|
5726
|
-
if (region === null ||
|
|
6148
|
+
const region = chunkVZZPCYA3_cjs.primaryRegion(state.schema, block);
|
|
6149
|
+
if (region === null || chunkVZZPCYA3_cjs.regionLength(block, region) > 0) return void 0;
|
|
5727
6150
|
switch (block.type) {
|
|
5728
6151
|
case "MARKDOWN":
|
|
5729
6152
|
return markdownPlaceholder(state, block, labels);
|
|
@@ -5758,7 +6181,7 @@ function revealLinkedBlock(controller, hash) {
|
|
|
5758
6181
|
if (id === null || shell === void 0) return false;
|
|
5759
6182
|
const { editor } = controller;
|
|
5760
6183
|
const { doc, schema } = editor.state;
|
|
5761
|
-
editor.dispatch(editor.createTransaction().setSelection(
|
|
6184
|
+
editor.dispatch(editor.createTransaction().setSelection(chunkVZZPCYA3_cjs.startOf(doc, schema, id)));
|
|
5762
6185
|
shell.scrollIntoView({ block: "center" });
|
|
5763
6186
|
return true;
|
|
5764
6187
|
}
|
|
@@ -5775,8 +6198,8 @@ function useBlockLinkTarget(controller, focusOnMount) {
|
|
|
5775
6198
|
}, [controller, focusOnMount]);
|
|
5776
6199
|
}
|
|
5777
6200
|
var WRITER_ORIGINS = /* @__PURE__ */ new Set(["command", "input", "paste"]);
|
|
5778
|
-
var isBlockDeletion = (tr) => WRITER_ORIGINS.has(tr.origin) && tr.getMeta(
|
|
5779
|
-
var isEmptyText = (schema, block) =>
|
|
6201
|
+
var isBlockDeletion = (tr) => WRITER_ORIGINS.has(tr.origin) && tr.getMeta(chunkVZZPCYA3_cjs.LINE_JOIN) !== true;
|
|
6202
|
+
var isEmptyText = (schema, block) => chunkVZZPCYA3_cjs.isTextFlow(schema, block) && chunkVZZPCYA3_cjs.regionLength(block, chunkVZZPCYA3_cjs.primaryRegion(schema, block) ?? "") === 0;
|
|
5780
6203
|
function filledLine({ origin, before }, schema) {
|
|
5781
6204
|
const { selection } = before;
|
|
5782
6205
|
if (origin !== "paste" || selection?.kind !== "text") return () => false;
|
|
@@ -5796,7 +6219,7 @@ function deletions(codec, tr) {
|
|
|
5796
6219
|
}
|
|
5797
6220
|
function useDeleteReporter(controller, onDelete) {
|
|
5798
6221
|
const latest = React7.useRef(onDelete);
|
|
5799
|
-
|
|
6222
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
5800
6223
|
latest.current = onDelete;
|
|
5801
6224
|
});
|
|
5802
6225
|
React7.useEffect(() => {
|
|
@@ -5850,7 +6273,7 @@ var BlockCanvas = React7.forwardRef(function BlockCanvas2({
|
|
|
5850
6273
|
const [voidEditing] = React7.useState(createVoidEditing);
|
|
5851
6274
|
const [uiStore] = React7.useState(createCanvasUiStore);
|
|
5852
6275
|
const [allExtensions] = React7.useState(() => [
|
|
5853
|
-
...
|
|
6276
|
+
...chunkVZZPCYA3_cjs.coreExtensions(),
|
|
5854
6277
|
voidEditing.extension,
|
|
5855
6278
|
blockMenuKeymap(uiStore),
|
|
5856
6279
|
slashExtension(),
|
|
@@ -5868,7 +6291,7 @@ var BlockCanvas = React7.forwardRef(function BlockCanvas2({
|
|
|
5868
6291
|
);
|
|
5869
6292
|
useTypedInPlaceWarning(blockTypes, readOnly);
|
|
5870
6293
|
const [focusOnMount] = React7.useState(autoFocus);
|
|
5871
|
-
const controller =
|
|
6294
|
+
const controller = chunkQJ34MOFV_cjs.useQuoinEditor({
|
|
5872
6295
|
blocks,
|
|
5873
6296
|
onChange,
|
|
5874
6297
|
readOnly,
|
|
@@ -5912,7 +6335,7 @@ var BlockCanvas = React7.forwardRef(function BlockCanvas2({
|
|
|
5912
6335
|
[controller, resolveAssetUrl]
|
|
5913
6336
|
);
|
|
5914
6337
|
return /* @__PURE__ */ jsxRuntime.jsx(QuoinProvider, { value: { blockTypes, upload, resolveAssetUrl, onError, highlight, controller, labels }, children: /* @__PURE__ */ jsxRuntime.jsx(VoidEditingContext.Provider, { value: voidEditing, children: /* @__PURE__ */ jsxRuntime.jsx(SlashItemsProvider, { value: slashItems, children: /* @__PURE__ */ jsxRuntime.jsx(BubbleItemsProvider, { value: ui.bubbleItems, children: /* @__PURE__ */ jsxRuntime.jsx(CanvasUiProvider, { value: uiStore, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5915
|
-
|
|
6338
|
+
chunkQJ34MOFV_cjs.EditorView,
|
|
5916
6339
|
{
|
|
5917
6340
|
controller,
|
|
5918
6341
|
renderers: ui.renderers,
|
|
@@ -6131,8 +6554,24 @@ function useAutosave({
|
|
|
6131
6554
|
return { status, error, retry: runner.retry, flush: runner.flush };
|
|
6132
6555
|
}
|
|
6133
6556
|
|
|
6557
|
+
exports.AlignCenter = AlignCenter;
|
|
6558
|
+
exports.AlignLeft = AlignLeft;
|
|
6559
|
+
exports.AlignRight = AlignRight;
|
|
6560
|
+
exports.AppWindow = AppWindow;
|
|
6561
|
+
exports.ArrowDown = ArrowDown;
|
|
6562
|
+
exports.ArrowDownToLine = ArrowDownToLine;
|
|
6563
|
+
exports.ArrowLeft = ArrowLeft;
|
|
6564
|
+
exports.ArrowLeftToLine = ArrowLeftToLine;
|
|
6565
|
+
exports.ArrowRight = ArrowRight;
|
|
6566
|
+
exports.ArrowRightToLine = ArrowRightToLine;
|
|
6567
|
+
exports.ArrowUp = ArrowUp;
|
|
6568
|
+
exports.ArrowUpToLine = ArrowUpToLine;
|
|
6134
6569
|
exports.BlockCanvas = BlockCanvas;
|
|
6570
|
+
exports.Bookmark = Bookmark;
|
|
6135
6571
|
exports.Button = Button;
|
|
6572
|
+
exports.CaseSensitive = CaseSensitive;
|
|
6573
|
+
exports.ChevronDown = ChevronDown;
|
|
6574
|
+
exports.ChevronUp = ChevronUp;
|
|
6136
6575
|
exports.DropdownMenu = DropdownMenu;
|
|
6137
6576
|
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
6138
6577
|
exports.DropdownMenuContent = DropdownMenuContent;
|
|
@@ -6144,15 +6583,32 @@ exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
|
6144
6583
|
exports.FLOATING_TOOLBAR = FLOATING_TOOLBAR;
|
|
6145
6584
|
exports.FOCUS_RING = FOCUS_RING;
|
|
6146
6585
|
exports.FilePickerButton = FilePickerButton;
|
|
6586
|
+
exports.GripHorizontal = GripHorizontal;
|
|
6587
|
+
exports.GripVertical = GripVertical;
|
|
6147
6588
|
exports.Input = Input;
|
|
6148
6589
|
exports.MENU_ITEM = MENU_ITEM;
|
|
6149
6590
|
exports.MenuIcon = MenuIcon;
|
|
6591
|
+
exports.MessageSquare = MessageSquare;
|
|
6592
|
+
exports.MessageSquarePlus = MessageSquarePlus;
|
|
6593
|
+
exports.PenLine = PenLine;
|
|
6594
|
+
exports.Plus = Plus;
|
|
6150
6595
|
exports.Popover = Popover;
|
|
6151
6596
|
exports.PopoverAnchor = PopoverAnchor;
|
|
6152
6597
|
exports.PopoverContent = PopoverContent;
|
|
6153
6598
|
exports.QuoinProvider = QuoinProvider;
|
|
6599
|
+
exports.Radical = Radical;
|
|
6600
|
+
exports.Regex = Regex;
|
|
6601
|
+
exports.SendHorizontal = SendHorizontal;
|
|
6602
|
+
exports.Sigma = Sigma;
|
|
6603
|
+
exports.SmilePlus = SmilePlus;
|
|
6604
|
+
exports.Sparkles = Sparkles;
|
|
6154
6605
|
exports.SuggestionMenu = SuggestionMenu;
|
|
6606
|
+
exports.Table = Table;
|
|
6607
|
+
exports.TableOfContents = TableOfContents;
|
|
6608
|
+
exports.Trash = Trash;
|
|
6155
6609
|
exports.UploadField = UploadField;
|
|
6610
|
+
exports.WholeWord = WholeWord;
|
|
6611
|
+
exports.X = X;
|
|
6156
6612
|
exports.blockFragment = blockFragment;
|
|
6157
6613
|
exports.bubblePart = bubblePart;
|
|
6158
6614
|
exports.cn = cn;
|
|
@@ -6190,5 +6646,5 @@ exports.useQuoin = useQuoin;
|
|
|
6190
6646
|
exports.useRangeAnchor = useRangeAnchor;
|
|
6191
6647
|
exports.useRovingFocus = useRovingFocus;
|
|
6192
6648
|
exports.virtualAnchor = virtualAnchor;
|
|
6193
|
-
//# sourceMappingURL=chunk-
|
|
6194
|
-
//# sourceMappingURL=chunk-
|
|
6649
|
+
//# sourceMappingURL=chunk-65WK575V.cjs.map
|
|
6650
|
+
//# sourceMappingURL=chunk-65WK575V.cjs.map
|