quoin-editor 1.5.0 → 1.7.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 +13 -0
- package/README.md +4 -3
- package/dist/ai.cjs +21 -23
- package/dist/ai.js +1 -1
- package/dist/catalogue.cjs +18 -18
- package/dist/catalogue.d.cts +2 -0
- package/dist/catalogue.d.ts +2 -0
- package/dist/catalogue.js +11 -9
- package/dist/catalogue.js.map +1 -1
- package/dist/chunk-2SWLD6R5.cjs +0 -2
- package/dist/chunk-4T4TJ2QS.cjs +0 -2
- package/dist/{chunk-2AVGGPLT.js → chunk-5JEQZIRI.js} +3 -3
- package/dist/{chunk-2AVGGPLT.js.map → chunk-5JEQZIRI.js.map} +1 -1
- package/dist/{chunk-UUSZGUXJ.cjs → chunk-6T5YGCZ5.cjs} +1 -2
- package/dist/{chunk-B5OMWOVI.js → chunk-7GU25Z6L.js} +3 -3
- package/dist/{chunk-B5OMWOVI.js.map → chunk-7GU25Z6L.js.map} +1 -1
- package/dist/chunk-A6PGQVTR.cjs +0 -2
- package/dist/chunk-AZF7B2AE.cjs +0 -2
- package/dist/{chunk-FNZGXL3O.cjs → chunk-BF7733XS.cjs} +17 -19
- package/dist/chunk-BM2GRZNM.cjs +0 -2
- package/dist/{chunk-T7O3BROK.cjs → chunk-FNJOPGMN.cjs} +38 -40
- package/dist/chunk-H3C3MJW5.cjs +0 -2
- package/dist/{chunk-32OZ2WM2.js → chunk-HSLOPJVT.js} +3 -3
- package/dist/{chunk-32OZ2WM2.js.map → chunk-HSLOPJVT.js.map} +1 -1
- package/dist/{chunk-L6RB43YM.cjs → chunk-I722LBD3.cjs} +19 -21
- package/dist/{chunk-46JH34SR.cjs → chunk-JY5VUHKN.cjs} +7 -9
- package/dist/{chunk-TKCPXUPP.cjs → chunk-KDK2ATMB.cjs} +15 -17
- package/dist/chunk-LE5XMIFJ.cjs +0 -2
- package/dist/chunk-LKZJ2TDU.cjs +90 -0
- package/dist/{chunk-KF3KKN4N.js → chunk-MNA7MBCH.js} +3 -3
- package/dist/{chunk-KF3KKN4N.js.map → chunk-MNA7MBCH.js.map} +1 -1
- package/dist/{chunk-LOP66FVU.cjs → chunk-MZXW2HXP.cjs} +8 -10
- package/dist/{chunk-HVT5HAAZ.js → chunk-OJ4O6HWC.js} +4 -4
- package/dist/{chunk-HVT5HAAZ.js.map → chunk-OJ4O6HWC.js.map} +1 -1
- package/dist/{chunk-HT7OF52E.js → chunk-PLUMKN4B.js} +3 -3
- package/dist/{chunk-HT7OF52E.js.map → chunk-PLUMKN4B.js.map} +1 -1
- package/dist/{chunk-N2SCDXTI.js → chunk-PWUFFHAQ.js} +3 -3
- package/dist/{chunk-N2SCDXTI.js.map → chunk-PWUFFHAQ.js.map} +1 -1
- package/dist/chunk-QJ34MOFV.cjs +0 -2
- package/dist/chunk-QR2NIDUK.cjs +0 -2
- package/dist/chunk-RQXJKJ5S.js +88 -0
- package/dist/chunk-RQXJKJ5S.js.map +1 -0
- package/dist/chunk-STKGRXSA.cjs +0 -2
- package/dist/{chunk-O7XZFXPE.js → chunk-UZS3TW75.js} +3 -3
- package/dist/{chunk-O7XZFXPE.js.map → chunk-UZS3TW75.js.map} +1 -1
- package/dist/chunk-VZZPCYA3.cjs +0 -2
- package/dist/chunk-WN7BZDNH.cjs +0 -2
- package/dist/chunk-WZA5S5EJ.cjs +0 -2
- package/dist/chunk-XZ4NC3Q7.cjs +0 -2
- package/dist/{chunk-XFR7QGSN.cjs → chunk-YEFPH27F.cjs} +39 -41
- package/dist/comments.cjs +18 -20
- package/dist/comments.js +1 -1
- package/dist/diagram-extension-D573COJv.d.cts +38 -0
- package/dist/diagram-extension-Da7hp-tv.d.ts +38 -0
- package/dist/diagram.cjs +25 -0
- package/dist/diagram.d.cts +8 -0
- package/dist/diagram.d.ts +8 -0
- package/dist/diagram.js +10 -0
- package/dist/diagram.js.map +1 -0
- package/dist/diff.cjs +0 -2
- package/dist/docx.cjs +0 -2
- package/dist/embed.cjs +4 -6
- package/dist/embed.js +2 -2
- package/dist/emoji-data.cjs +0 -2
- package/dist/emoji.cjs +5 -7
- package/dist/emoji.js +2 -2
- package/dist/engine.cjs +0 -2
- package/dist/engine.d.cts +3 -15
- package/dist/engine.d.ts +3 -15
- package/dist/find.cjs +6 -8
- package/dist/find.js +2 -2
- package/dist/headless.cjs +0 -2
- package/dist/headless.d.cts +2 -1
- package/dist/headless.d.ts +2 -1
- package/dist/highlight.cjs +2 -4
- package/dist/highlight.js +1 -1
- package/dist/index.cjs +12 -14
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/math.cjs +5 -7
- package/dist/math.js +3 -3
- package/dist/mention.cjs +4 -6
- package/dist/mention.js +2 -2
- package/dist/presence.cjs +1 -3
- package/dist/presence.js +1 -1
- package/dist/prism-grammars.cjs +0 -2
- package/dist/source.cjs +97 -0
- package/dist/source.d.cts +56 -0
- package/dist/source.d.ts +56 -0
- package/dist/source.js +94 -0
- package/dist/source.js.map +1 -0
- package/dist/stats.cjs +1 -3
- package/dist/stats.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/table.cjs +21 -23
- package/dist/table.js +2 -2
- package/dist/to-markdown-BVOzhgVM.d.ts +17 -0
- package/dist/to-markdown-CFPMbbiX.d.cts +17 -0
- package/dist/toc.cjs +5 -7
- package/dist/toc.js +2 -2
- package/dist/view.cjs +0 -2
- package/dist/yjs.cjs +0 -2
- package/package.json +22 -2
- package/dist/ai.cjs.map +0 -1
- package/dist/catalogue.cjs.map +0 -1
- package/dist/chunk-2SWLD6R5.cjs.map +0 -1
- package/dist/chunk-46JH34SR.cjs.map +0 -1
- package/dist/chunk-4T4TJ2QS.cjs.map +0 -1
- package/dist/chunk-A6PGQVTR.cjs.map +0 -1
- package/dist/chunk-AZF7B2AE.cjs.map +0 -1
- package/dist/chunk-BM2GRZNM.cjs.map +0 -1
- package/dist/chunk-FNZGXL3O.cjs.map +0 -1
- package/dist/chunk-H3C3MJW5.cjs.map +0 -1
- package/dist/chunk-L6RB43YM.cjs.map +0 -1
- package/dist/chunk-LE5XMIFJ.cjs.map +0 -1
- package/dist/chunk-LOP66FVU.cjs.map +0 -1
- package/dist/chunk-QJ34MOFV.cjs.map +0 -1
- package/dist/chunk-QR2NIDUK.cjs.map +0 -1
- package/dist/chunk-STKGRXSA.cjs.map +0 -1
- package/dist/chunk-T7O3BROK.cjs.map +0 -1
- package/dist/chunk-TKCPXUPP.cjs.map +0 -1
- package/dist/chunk-UUSZGUXJ.cjs.map +0 -1
- package/dist/chunk-VZZPCYA3.cjs.map +0 -1
- package/dist/chunk-WN7BZDNH.cjs.map +0 -1
- package/dist/chunk-WZA5S5EJ.cjs.map +0 -1
- package/dist/chunk-XFR7QGSN.cjs.map +0 -1
- package/dist/chunk-XZ4NC3Q7.cjs.map +0 -1
- package/dist/comments.cjs.map +0 -1
- package/dist/diff.cjs.map +0 -1
- package/dist/docx.cjs.map +0 -1
- package/dist/embed.cjs.map +0 -1
- package/dist/emoji-data.cjs.map +0 -1
- package/dist/emoji.cjs.map +0 -1
- package/dist/engine.cjs.map +0 -1
- package/dist/find.cjs.map +0 -1
- package/dist/headless.cjs.map +0 -1
- package/dist/highlight.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/math.cjs.map +0 -1
- package/dist/mention.cjs.map +0 -1
- package/dist/presence.cjs.map +0 -1
- package/dist/prism-grammars.cjs.map +0 -1
- package/dist/stats.cjs.map +0 -1
- package/dist/table.cjs.map +0 -1
- package/dist/toc.cjs.map +0 -1
- package/dist/view.cjs.map +0 -1
- package/dist/yjs.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunkXZ4NC3Q7_cjs = require('./chunk-XZ4NC3Q7.cjs');
|
|
4
3
|
var chunkAZF7B2AE_cjs = require('./chunk-AZF7B2AE.cjs');
|
|
5
|
-
var
|
|
4
|
+
var chunkXZ4NC3Q7_cjs = require('./chunk-XZ4NC3Q7.cjs');
|
|
5
|
+
var chunk6T5YGCZ5_cjs = require('./chunk-6T5YGCZ5.cjs');
|
|
6
6
|
var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
|
|
7
7
|
var chunkA6PGQVTR_cjs = require('./chunk-A6PGQVTR.cjs');
|
|
8
8
|
var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
|
|
@@ -95,9 +95,9 @@ function MathBlock({ block, controller, feature }) {
|
|
|
95
95
|
() => ({ enter: () => openMath(controller, { kind: "block", block: blockId, latex }) }),
|
|
96
96
|
[controller, blockId, latex]
|
|
97
97
|
);
|
|
98
|
-
|
|
98
|
+
chunk6T5YGCZ5_cjs.useNodeKeys(controller, blockId, !readOnly, true, root, keys);
|
|
99
99
|
const open = () => {
|
|
100
|
-
|
|
100
|
+
chunk6T5YGCZ5_cjs.selectNode(controller, blockId);
|
|
101
101
|
keys.enter();
|
|
102
102
|
};
|
|
103
103
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -146,7 +146,7 @@ function MathEditorPopover(props) {
|
|
|
146
146
|
};
|
|
147
147
|
const content = react.useRef(null);
|
|
148
148
|
const ownerDocument = react.useCallback(() => controller.root?.ownerDocument ?? document, [controller]);
|
|
149
|
-
|
|
149
|
+
chunk6T5YGCZ5_cjs.useOutsidePress(content, ownerDocument, () => close(true, false));
|
|
150
150
|
const save = (event) => {
|
|
151
151
|
event.preventDefault();
|
|
152
152
|
close(true);
|
|
@@ -167,7 +167,7 @@ function MathEditorPopover(props) {
|
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
170
|
-
|
|
170
|
+
chunk6T5YGCZ5_cjs.Popover,
|
|
171
171
|
{
|
|
172
172
|
open: true,
|
|
173
173
|
modal: false,
|
|
@@ -175,9 +175,9 @@ function MathEditorPopover(props) {
|
|
|
175
175
|
if (!open) close(true, false);
|
|
176
176
|
},
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.PopoverAnchor, { virtualRef: anchor }),
|
|
179
179
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
180
|
-
|
|
180
|
+
chunk6T5YGCZ5_cjs.PopoverContent,
|
|
181
181
|
{
|
|
182
182
|
ref: content,
|
|
183
183
|
"aria-label": labels.editEquation,
|
|
@@ -190,12 +190,12 @@ function MathEditorPopover(props) {
|
|
|
190
190
|
field.current?.focus();
|
|
191
191
|
field.current?.setSelectionRange(end, end);
|
|
192
192
|
},
|
|
193
|
-
onCloseAutoFocus:
|
|
193
|
+
onCloseAutoFocus: chunk6T5YGCZ5_cjs.preventDefault,
|
|
194
194
|
onEscapeKeyDown: (event) => {
|
|
195
195
|
event.preventDefault();
|
|
196
196
|
if (!chunkQJ34MOFV_cjs.isComposingKey(controller, event)) close(false);
|
|
197
197
|
},
|
|
198
|
-
...
|
|
198
|
+
...chunk6T5YGCZ5_cjs.bubblePart(controller),
|
|
199
199
|
children: /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, className: "quoin-math-editor", onSubmit: save, onKeyDown, children: [
|
|
200
200
|
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: fieldId, className: "text-sm font-medium", children: labels.latex }),
|
|
201
201
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -215,7 +215,7 @@ function MathEditorPopover(props) {
|
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
217
|
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", "aria-label": labels.preview, className: "quoin-math-preview", children: /* @__PURE__ */ jsxRuntime.jsx(MathOutput, { feature, latex: draft, displayMode }) }),
|
|
218
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.Button, { ref: saveButton, type: "submit", size: "sm", children: labels.save })
|
|
219
219
|
] })
|
|
220
220
|
}
|
|
221
221
|
)
|
|
@@ -308,7 +308,7 @@ function MathEditorOverlay({ controller, feature }) {
|
|
|
308
308
|
return target.kind === "block" ? /* @__PURE__ */ jsxRuntime.jsx(BlockMathEditor, { controller, feature, target }, JSON.stringify(target)) : /* @__PURE__ */ jsxRuntime.jsx(InlineMathEditor, { controller, feature, target }, JSON.stringify(target));
|
|
309
309
|
}
|
|
310
310
|
function BlockMathEditor({ controller, feature, target }) {
|
|
311
|
-
const anchor =
|
|
311
|
+
const anchor = chunk6T5YGCZ5_cjs.usePartAnchor(controller, target.block, ".quoin-math");
|
|
312
312
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
313
313
|
MathEditorPopover,
|
|
314
314
|
{
|
|
@@ -320,7 +320,7 @@ function BlockMathEditor({ controller, feature, target }) {
|
|
|
320
320
|
displayMode: true,
|
|
321
321
|
onStore: (next, refocus) => storeBlockLatex(controller, target, next, refocus),
|
|
322
322
|
onClose: () => openMath(controller, null),
|
|
323
|
-
onReturn: () =>
|
|
323
|
+
onReturn: () => chunk6T5YGCZ5_cjs.focusNode(controller, target.block)
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
326
|
}
|
|
@@ -331,7 +331,7 @@ function InlineMathEditor({ controller, feature, target }) {
|
|
|
331
331
|
() => ({ block, region, from: offset, to: editing ? offset + 1 : offset }),
|
|
332
332
|
[block, region, offset, editing]
|
|
333
333
|
);
|
|
334
|
-
const { anchor, side } =
|
|
334
|
+
const { anchor, side } = chunk6T5YGCZ5_cjs.useRangeAnchor(controller, range);
|
|
335
335
|
const kept = react.useRef(editing);
|
|
336
336
|
const onStore = (latex, refocus) => {
|
|
337
337
|
kept.current = latex !== "";
|
|
@@ -437,16 +437,16 @@ var mathSlashItems = (labels) => [
|
|
|
437
437
|
title: labels.blockEquation,
|
|
438
438
|
description: labels.blockEquationDescription,
|
|
439
439
|
group: "advanced",
|
|
440
|
-
icon:
|
|
440
|
+
icon: chunk6T5YGCZ5_cjs.Sigma,
|
|
441
441
|
keywords: [...KEYWORDS, "$$"],
|
|
442
|
-
command: () =>
|
|
442
|
+
command: () => chunk6T5YGCZ5_cjs.insertBlockToWrite({ type: "MATH", attrs: { latex: "" } }, true)
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
445
|
id: "inline-equation",
|
|
446
446
|
title: labels.inlineEquation,
|
|
447
447
|
description: labels.inlineEquationDescription,
|
|
448
448
|
group: "advanced",
|
|
449
|
-
icon:
|
|
449
|
+
icon: chunk6T5YGCZ5_cjs.Radical,
|
|
450
450
|
keywords: [...KEYWORDS, "$"],
|
|
451
451
|
available: (state) => !caretInCode(state),
|
|
452
452
|
run({ controller, range }) {
|
|
@@ -480,5 +480,3 @@ function mathExtension(options = {}) {
|
|
|
480
480
|
|
|
481
481
|
exports.englishMathLabels = englishMathLabels;
|
|
482
482
|
exports.mathExtension = mathExtension;
|
|
483
|
-
//# sourceMappingURL=chunk-FNZGXL3O.cjs.map
|
|
484
|
-
//# sourceMappingURL=chunk-FNZGXL3O.cjs.map
|
package/dist/chunk-BM2GRZNM.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6T5YGCZ5_cjs = require('./chunk-6T5YGCZ5.cjs');
|
|
4
4
|
var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
|
|
5
5
|
var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
|
|
6
6
|
var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
|
|
@@ -558,7 +558,7 @@ function useTableKeys(controller, blockId, editable) {
|
|
|
558
558
|
if (handled) event.preventDefault();
|
|
559
559
|
return handled;
|
|
560
560
|
};
|
|
561
|
-
return
|
|
561
|
+
return chunk6T5YGCZ5_cjs.interceptKeys(controller, intercept);
|
|
562
562
|
}, [controller, blockId, editable]);
|
|
563
563
|
}
|
|
564
564
|
var indexes = (from, to) => Array.from({ length: Math.max(to - from, 0) }, (_, i) => from + i);
|
|
@@ -587,7 +587,7 @@ function TableBlock({ block, controller, labels }) {
|
|
|
587
587
|
col
|
|
588
588
|
)) }, index);
|
|
589
589
|
const scroller = readOnly ? { role: "region", "aria-label": labels.table, tabIndex: 0 } : void 0;
|
|
590
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { contentEditable: false, className: "quoin-table", "data-readonly": readOnly ? "" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `quoin-table-scroll ${readOnly ?
|
|
590
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { contentEditable: false, className: "quoin-table", "data-readonly": readOnly ? "" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `quoin-table-scroll ${readOnly ? chunk6T5YGCZ5_cjs.FOCUS_RING : ""}`, ...scroller, children: [
|
|
591
591
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
592
592
|
"table",
|
|
593
593
|
{
|
|
@@ -709,20 +709,20 @@ function HandleMenu({ controller, axis, label, style, items, open, onOpenChange,
|
|
|
709
709
|
if (controller.run(item3.command)) controller.announce(item3.done);
|
|
710
710
|
};
|
|
711
711
|
const item2 = (entry) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
712
|
-
|
|
712
|
+
chunk6T5YGCZ5_cjs.DropdownMenuItem,
|
|
713
713
|
{
|
|
714
714
|
disabled: entry.disabled,
|
|
715
715
|
className: entry.destructive ? DESTRUCTIVE : void 0,
|
|
716
716
|
onSelect: () => run(entry),
|
|
717
717
|
children: [
|
|
718
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
718
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.MenuIcon, { icon: entry.icon }),
|
|
719
719
|
entry.label
|
|
720
720
|
]
|
|
721
721
|
},
|
|
722
722
|
entry.id
|
|
723
723
|
);
|
|
724
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
725
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
724
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunk6T5YGCZ5_cjs.DropdownMenu, { open, onOpenChange, children: [
|
|
725
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
726
|
"button",
|
|
727
727
|
{
|
|
728
728
|
ref: buttonRef,
|
|
@@ -732,22 +732,22 @@ function HandleMenu({ controller, axis, label, style, items, open, onOpenChange,
|
|
|
732
732
|
"data-axis": axis,
|
|
733
733
|
className: "quoin-table-handle",
|
|
734
734
|
style,
|
|
735
|
-
children: axis === "row" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
735
|
+
children: axis === "row" ? /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.GripVertical, { "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.GripHorizontal, { "aria-hidden": "true" })
|
|
736
736
|
}
|
|
737
737
|
) }),
|
|
738
738
|
open && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
739
|
-
|
|
739
|
+
chunk6T5YGCZ5_cjs.DropdownMenuContent,
|
|
740
740
|
{
|
|
741
741
|
align: "start",
|
|
742
742
|
"aria-label": label,
|
|
743
743
|
"aria-labelledby": void 0,
|
|
744
|
-
onCloseAutoFocus:
|
|
745
|
-
...
|
|
744
|
+
onCloseAutoFocus: chunk6T5YGCZ5_cjs.returnFocusToText(controller),
|
|
745
|
+
...chunk6T5YGCZ5_cjs.bubblePart(controller),
|
|
746
746
|
children: [
|
|
747
747
|
items.filter((entry) => !entry.destructive).map(item2),
|
|
748
748
|
children,
|
|
749
749
|
items.filter((entry) => entry.destructive).map((entry) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
750
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
750
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.DropdownMenuSeparator, {}),
|
|
751
751
|
item2(entry)
|
|
752
752
|
] }, entry.id))
|
|
753
753
|
]
|
|
@@ -761,31 +761,31 @@ var item = (id, label, icon, command, done, options = {}) => ({ id, label, icon,
|
|
|
761
761
|
function rowMenuItems(labels, blockId, row, { rows }) {
|
|
762
762
|
const { rowInserted, rowMoved, rowDeleted } = labels;
|
|
763
763
|
return [
|
|
764
|
-
item("above", labels.insertRowAbove,
|
|
765
|
-
item("below", labels.insertRowBelow,
|
|
766
|
-
item("up", labels.moveRowUp,
|
|
767
|
-
item("down", labels.moveRowDown,
|
|
768
|
-
item("delete", labels.deleteRow,
|
|
764
|
+
item("above", labels.insertRowAbove, chunk6T5YGCZ5_cjs.ArrowUpToLine, addRow(blockId, row), rowInserted),
|
|
765
|
+
item("below", labels.insertRowBelow, chunk6T5YGCZ5_cjs.ArrowDownToLine, addRow(blockId, row + 1), rowInserted),
|
|
766
|
+
item("up", labels.moveRowUp, chunk6T5YGCZ5_cjs.ArrowUp, moveRow(blockId, row, row - 1), rowMoved, { disabled: row === 0 }),
|
|
767
|
+
item("down", labels.moveRowDown, chunk6T5YGCZ5_cjs.ArrowDown, moveRow(blockId, row, row + 1), rowMoved, { disabled: row === rows - 1 }),
|
|
768
|
+
item("delete", labels.deleteRow, chunk6T5YGCZ5_cjs.Trash, removeRow(blockId, row), rowDeleted, { disabled: rows === 1, destructive: true })
|
|
769
769
|
];
|
|
770
770
|
}
|
|
771
771
|
function columnMenuItems(labels, blockId, col, { cols }) {
|
|
772
772
|
const { columnInserted, columnMoved, columnDeleted } = labels;
|
|
773
773
|
const last = col === cols - 1;
|
|
774
774
|
return [
|
|
775
|
-
item("left", labels.insertColumnLeft,
|
|
776
|
-
item("right", labels.insertColumnRight,
|
|
777
|
-
item("move-left", labels.moveColumnLeft,
|
|
778
|
-
item("move-right", labels.moveColumnRight,
|
|
779
|
-
item("delete", labels.deleteColumn,
|
|
775
|
+
item("left", labels.insertColumnLeft, chunk6T5YGCZ5_cjs.ArrowLeftToLine, addColumn(blockId, col), columnInserted),
|
|
776
|
+
item("right", labels.insertColumnRight, chunk6T5YGCZ5_cjs.ArrowRightToLine, addColumn(blockId, col + 1), columnInserted),
|
|
777
|
+
item("move-left", labels.moveColumnLeft, chunk6T5YGCZ5_cjs.ArrowLeft, moveColumn(blockId, col, col - 1), columnMoved, { disabled: col === 0 }),
|
|
778
|
+
item("move-right", labels.moveColumnRight, chunk6T5YGCZ5_cjs.ArrowRight, moveColumn(blockId, col, col + 1), columnMoved, { disabled: last }),
|
|
779
|
+
item("delete", labels.deleteColumn, chunk6T5YGCZ5_cjs.Trash, removeColumn(blockId, col), columnDeleted, {
|
|
780
780
|
disabled: cols === 1,
|
|
781
781
|
destructive: true
|
|
782
782
|
})
|
|
783
783
|
];
|
|
784
784
|
}
|
|
785
785
|
var alignItems = (labels) => [
|
|
786
|
-
{ value: "left", label: labels.alignLeft, icon:
|
|
787
|
-
{ value: "center", label: labels.alignCenter, icon:
|
|
788
|
-
{ value: "right", label: labels.alignRight, icon:
|
|
786
|
+
{ value: "left", label: labels.alignLeft, icon: chunk6T5YGCZ5_cjs.AlignLeft, done: labels.alignedLeft },
|
|
787
|
+
{ value: "center", label: labels.alignCenter, icon: chunk6T5YGCZ5_cjs.AlignCenter, done: labels.alignedCenter },
|
|
788
|
+
{ value: "right", label: labels.alignRight, icon: chunk6T5YGCZ5_cjs.AlignRight, done: labels.alignedRight }
|
|
789
789
|
];
|
|
790
790
|
var BESIDE = 4;
|
|
791
791
|
var end = (span) => span.start + span.size;
|
|
@@ -857,7 +857,7 @@ function TableHandles(props) {
|
|
|
857
857
|
onOpenChange: opener("row"),
|
|
858
858
|
buttonRef: rowHandle,
|
|
859
859
|
children: row === 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
860
|
-
|
|
860
|
+
chunk6T5YGCZ5_cjs.DropdownMenuCheckboxItem,
|
|
861
861
|
{
|
|
862
862
|
checked: block.attrs.header !== false,
|
|
863
863
|
onCheckedChange: (on) => run(toggleHeaderRow(block.id), on ? labels.headerRowOn : labels.headerRowOff),
|
|
@@ -878,14 +878,14 @@ function TableHandles(props) {
|
|
|
878
878
|
onOpenChange: opener("column"),
|
|
879
879
|
buttonRef: columnHandle,
|
|
880
880
|
children: [
|
|
881
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
882
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
883
|
-
|
|
881
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.DropdownMenuSeparator, {}),
|
|
882
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.DropdownMenuRadioGroup, { value: align ?? "", children: alignItems(labels).map(({ value, label, icon, done }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
883
|
+
chunk6T5YGCZ5_cjs.DropdownMenuRadioItem,
|
|
884
884
|
{
|
|
885
885
|
value,
|
|
886
886
|
onSelect: () => align === value ? run(setColumnAlign(block.id, col, null), labels.alignmentCleared) : run(setColumnAlign(block.id, col, value), done),
|
|
887
887
|
children: [
|
|
888
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
888
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.MenuIcon, { icon }),
|
|
889
889
|
label
|
|
890
890
|
]
|
|
891
891
|
},
|
|
@@ -904,10 +904,10 @@ function TableHandles(props) {
|
|
|
904
904
|
"data-axis": "row",
|
|
905
905
|
className: "quoin-table-insert",
|
|
906
906
|
style: place(geometry.left - BESIDE, rowInsertAt),
|
|
907
|
-
onPointerDown:
|
|
908
|
-
onMouseDown:
|
|
907
|
+
onPointerDown: chunk6T5YGCZ5_cjs.keepFocus,
|
|
908
|
+
onMouseDown: chunk6T5YGCZ5_cjs.keepFocus,
|
|
909
909
|
onClick: () => run(addRow(block.id, rowEdge), labels.rowInserted),
|
|
910
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
910
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.Plus, { "aria-hidden": "true" })
|
|
911
911
|
}
|
|
912
912
|
),
|
|
913
913
|
colEdge !== null && columnInsertAt !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -919,10 +919,10 @@ function TableHandles(props) {
|
|
|
919
919
|
"data-axis": "column",
|
|
920
920
|
className: "quoin-table-insert",
|
|
921
921
|
style: place(columnInsertAt, geometry.top),
|
|
922
|
-
onPointerDown:
|
|
923
|
-
onMouseDown:
|
|
922
|
+
onPointerDown: chunk6T5YGCZ5_cjs.keepFocus,
|
|
923
|
+
onMouseDown: chunk6T5YGCZ5_cjs.keepFocus,
|
|
924
924
|
onClick: () => run(addColumn(block.id, colEdge), labels.columnInserted),
|
|
925
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
925
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.Plus, { "aria-hidden": "true" })
|
|
926
926
|
}
|
|
927
927
|
)
|
|
928
928
|
] });
|
|
@@ -1114,7 +1114,7 @@ function TableControls({ controller, labels }) {
|
|
|
1114
1114
|
setFocusFor(caret.block);
|
|
1115
1115
|
return true;
|
|
1116
1116
|
};
|
|
1117
|
-
return
|
|
1117
|
+
return chunk6T5YGCZ5_cjs.interceptKeys(controller, intercept);
|
|
1118
1118
|
}, [controller, readOnly]);
|
|
1119
1119
|
const onMenu = react.useCallback(
|
|
1120
1120
|
(menu) => setHeld(menu === null || target === null || block === null ? null : { target, menu, opened: block }),
|
|
@@ -1206,7 +1206,7 @@ var tableSlashItem = (labels) => ({
|
|
|
1206
1206
|
title: labels.table,
|
|
1207
1207
|
description: labels.tableDescription,
|
|
1208
1208
|
group: "advanced",
|
|
1209
|
-
icon:
|
|
1209
|
+
icon: chunk6T5YGCZ5_cjs.Table,
|
|
1210
1210
|
keywords: ["grid", "rows", "columns", "spreadsheet", "|"],
|
|
1211
1211
|
command: () => insertTable(NEW_TABLE.rows, NEW_TABLE.cols)
|
|
1212
1212
|
});
|
|
@@ -1254,5 +1254,3 @@ exports.setColumnAlign = setColumnAlign;
|
|
|
1254
1254
|
exports.setColumnWidth = setColumnWidth;
|
|
1255
1255
|
exports.tableExtension = tableExtension;
|
|
1256
1256
|
exports.toggleHeaderRow = toggleHeaderRow;
|
|
1257
|
-
//# sourceMappingURL=chunk-T7O3BROK.cjs.map
|
|
1258
|
-
//# sourceMappingURL=chunk-T7O3BROK.cjs.map
|
package/dist/chunk-H3C3MJW5.cjs
CHANGED
|
@@ -6529,6 +6529,6 @@ function useAutosave({
|
|
|
6529
6529
|
return { status, error, retry: runner.retry, flush: runner.flush };
|
|
6530
6530
|
}
|
|
6531
6531
|
|
|
6532
|
-
export { AlignCenter, AlignLeft, AlignRight, AppWindow, ArrowDown, ArrowDownToLine, ArrowLeft, ArrowLeftToLine, ArrowRight, ArrowRightToLine, ArrowUp, ArrowUpToLine, BlockCanvas, Bookmark, Button, CODE_LANGUAGES, CaseSensitive, ChevronDown, ChevronUp, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, FLOATING_TOOLBAR, FOCUS_RING, FilePickerButton, GripHorizontal, GripVertical, Input, MENU_ITEM, MenuIcon, MessageSquare, MessageSquarePlus, PenLine, Plus, Popover, PopoverAnchor, PopoverContent, QuoinProvider, Radical, Regex, SendHorizontal, Sigma, SmilePlus, Sparkles, SuggestionMenu, Table, TableOfContents, Trash, UploadField, WholeWord, X, blockFragment, bubblePart, cn, coreBlocks, dismissSuggestion, englishLabels, focusNode, formatShortcut, inlineDirection, insertBlockToWrite, insertBlocks, interceptKeys, keepFocus, linkAddress, linkedBlockId, noChange, preventDefault, rangeRect, replaceTrigger, resolveLabels, returnFocusToText, runOnBlocks, selectHandlers, selectNode, styleTargets, suggestionPlugin, toError, useAutosave, useFocusKey, useLabels, useNodeKeys, useOutsidePress, usePartAnchor, useQuoin, useRangeAnchor, useRovingFocus, virtualAnchor };
|
|
6533
|
-
//# sourceMappingURL=chunk-
|
|
6534
|
-
//# sourceMappingURL=chunk-
|
|
6532
|
+
export { AlignCenter, AlignLeft, AlignRight, AppWindow, ArrowDown, ArrowDownToLine, ArrowLeft, ArrowLeftToLine, ArrowRight, ArrowRightToLine, ArrowUp, ArrowUpToLine, BlockCanvas, Bookmark, Button, CODE_LANGUAGES, CaseSensitive, ChevronDown, ChevronUp, CodeBlock, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, FLOATING_TOOLBAR, FOCUS_RING, FilePickerButton, GripHorizontal, GripVertical, Input, MENU_ITEM, MenuIcon, MessageSquare, MessageSquarePlus, PenLine, Plus, Popover, PopoverAnchor, PopoverContent, QuoinProvider, Radical, Regex, SendHorizontal, Sigma, SmilePlus, Sparkles, SuggestionMenu, Table, TableOfContents, Trash, UploadField, WholeWord, X, blockFragment, bubblePart, cn, coreBlocks, dismissSuggestion, englishLabels, focusNode, formatShortcut, inlineDirection, insertBlockToWrite, insertBlocks, interceptKeys, keepFocus, linkAddress, linkedBlockId, noChange, preventDefault, rangeRect, replaceTrigger, resolveLabels, returnFocusToText, runOnBlocks, selectHandlers, selectNode, styleTargets, suggestionPlugin, toError, useAutosave, useFocusKey, useLabels, useNodeKeys, useOutsidePress, usePartAnchor, useQuoin, useRangeAnchor, useRovingFocus, virtualAnchor };
|
|
6533
|
+
//# sourceMappingURL=chunk-HSLOPJVT.js.map
|
|
6534
|
+
//# sourceMappingURL=chunk-HSLOPJVT.js.map
|