quoin-editor 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/ai.cjs +78 -78
- package/dist/ai.js +6 -6
- package/dist/catalogue.cjs +24 -24
- package/dist/catalogue.js +16 -16
- package/dist/{chunk-DYWU4SQ2.js → chunk-3BCP6ZUM.js} +5 -6
- package/dist/chunk-3BCP6ZUM.js.map +1 -0
- package/dist/{chunk-L4D23LM2.js → chunk-4EU4BTLZ.js} +82 -34
- package/dist/chunk-4EU4BTLZ.js.map +1 -0
- package/dist/{chunk-VFSVN5IQ.cjs → chunk-4F2IWBFM.cjs} +294 -244
- package/dist/chunk-4F2IWBFM.cjs.map +1 -0
- package/dist/{chunk-HQ43EIYO.cjs → chunk-4T4TJ2QS.cjs} +9 -9
- package/dist/{chunk-HQ43EIYO.cjs.map → chunk-4T4TJ2QS.cjs.map} +1 -1
- package/dist/{chunk-7XQGOCUG.cjs → chunk-6X5A4DUQ.cjs} +290 -291
- package/dist/chunk-6X5A4DUQ.cjs.map +1 -0
- package/dist/{chunk-7FAVFJAS.js → chunk-AD3NY7NA.js} +3 -3
- package/dist/{chunk-7FAVFJAS.js.map → chunk-AD3NY7NA.js.map} +1 -1
- package/dist/{chunk-L6OW2FL3.js → chunk-BJTOLCRR.js} +84 -10
- package/dist/chunk-BJTOLCRR.js.map +1 -0
- package/dist/{chunk-HTLWPSMU.js → chunk-BKEHG4QV.js} +4 -4
- package/dist/{chunk-HTLWPSMU.js.map → chunk-BKEHG4QV.js.map} +1 -1
- package/dist/{chunk-7SVKLWDT.cjs → chunk-BM2GRZNM.cjs} +47 -43
- package/dist/chunk-BM2GRZNM.cjs.map +1 -0
- package/dist/{chunk-2EQ6FKSK.js → chunk-BXSWZEA5.js} +3 -3
- package/dist/{chunk-2EQ6FKSK.js.map → chunk-BXSWZEA5.js.map} +1 -1
- package/dist/{chunk-3BXUGX5F.js → chunk-CSKKSXCE.js} +38 -31
- package/dist/chunk-CSKKSXCE.js.map +1 -0
- package/dist/{chunk-U5BSCAMP.cjs → chunk-EQKFQK3C.cjs} +13 -13
- package/dist/{chunk-U5BSCAMP.cjs.map → chunk-EQKFQK3C.cjs.map} +1 -1
- package/dist/{chunk-TYZSB7JT.js → chunk-GHNQKJMD.js} +3 -3
- package/dist/{chunk-TYZSB7JT.js.map → chunk-GHNQKJMD.js.map} +1 -1
- package/dist/{chunk-RIIXJWBR.cjs → chunk-H3C3MJW5.cjs} +4 -4
- package/dist/{chunk-RIIXJWBR.cjs.map → chunk-H3C3MJW5.cjs.map} +1 -1
- package/dist/{chunk-UEVR4B5S.js → chunk-I4CSCA3O.js} +6 -6
- package/dist/{chunk-UEVR4B5S.js.map → chunk-I4CSCA3O.js.map} +1 -1
- package/dist/{chunk-SFMORPWB.js → chunk-I4NEX6SZ.js} +7 -7
- package/dist/{chunk-SFMORPWB.js.map → chunk-I4NEX6SZ.js.map} +1 -1
- package/dist/{chunk-L2QA2UTY.js → chunk-IHTHOAUY.js} +7 -7
- package/dist/{chunk-L2QA2UTY.js.map → chunk-IHTHOAUY.js.map} +1 -1
- package/dist/{chunk-KXRGY5LK.cjs → chunk-IQ2DE3Y3.cjs} +90 -90
- package/dist/{chunk-KXRGY5LK.cjs.map → chunk-IQ2DE3Y3.cjs.map} +1 -1
- package/dist/{chunk-W7B4WQ3L.cjs → chunk-K7E2DR5W.cjs} +24 -24
- package/dist/{chunk-W7B4WQ3L.cjs.map → chunk-K7E2DR5W.cjs.map} +1 -1
- package/dist/{chunk-QSXPKZ2F.js → chunk-KIU5MPZ4.js} +3 -3
- package/dist/{chunk-QSXPKZ2F.js.map → chunk-KIU5MPZ4.js.map} +1 -1
- package/dist/{chunk-MUIPM26J.js → chunk-MEXDDWJF.js} +6 -6
- package/dist/{chunk-MUIPM26J.js.map → chunk-MEXDDWJF.js.map} +1 -1
- package/dist/{chunk-IGZRZIAF.cjs → chunk-NNDLIP2C.cjs} +161 -136
- package/dist/chunk-NNDLIP2C.cjs.map +1 -0
- package/dist/{chunk-CKHKCPGL.js → chunk-OWX3Y5UU.js} +6 -6
- package/dist/{chunk-CKHKCPGL.js.map → chunk-OWX3Y5UU.js.map} +1 -1
- package/dist/{chunk-WAGBELKA.js → chunk-PMJ3VCSR.js} +5 -5
- package/dist/{chunk-WAGBELKA.js.map → chunk-PMJ3VCSR.js.map} +1 -1
- package/dist/{chunk-IEP7BPFN.js → chunk-PVCXTSUO.js} +49 -24
- package/dist/chunk-PVCXTSUO.js.map +1 -0
- package/dist/{chunk-7NAONESM.cjs → chunk-R45RJQRD.cjs} +31 -31
- package/dist/{chunk-7NAONESM.cjs.map → chunk-R45RJQRD.cjs.map} +1 -1
- package/dist/{chunk-VNRI5DAL.cjs → chunk-RENKFSFD.cjs} +28 -28
- package/dist/{chunk-VNRI5DAL.cjs.map → chunk-RENKFSFD.cjs.map} +1 -1
- package/dist/{chunk-KZ6ZFCGO.js → chunk-TG5T7BEJ.js} +8 -8
- package/dist/{chunk-KZ6ZFCGO.js.map → chunk-TG5T7BEJ.js.map} +1 -1
- package/dist/{chunk-WH56EW3H.cjs → chunk-TLMO46OV.cjs} +15 -15
- package/dist/{chunk-WH56EW3H.cjs.map → chunk-TLMO46OV.cjs.map} +1 -1
- package/dist/{chunk-XAS7LANM.cjs → chunk-TN32PKUI.cjs} +98 -98
- package/dist/{chunk-XAS7LANM.cjs.map → chunk-TN32PKUI.cjs.map} +1 -1
- package/dist/{chunk-JCEFSTVG.cjs → chunk-TWFMNDOC.cjs} +55 -55
- package/dist/{chunk-JCEFSTVG.cjs.map → chunk-TWFMNDOC.cjs.map} +1 -1
- package/dist/{chunk-OKWER2RV.cjs → chunk-UHAAYYMX.cjs} +45 -45
- package/dist/{chunk-OKWER2RV.cjs.map → chunk-UHAAYYMX.cjs.map} +1 -1
- package/dist/{chunk-EFRQMYZ6.cjs → chunk-UMTKQVOX.cjs} +4 -4
- package/dist/{chunk-EFRQMYZ6.cjs.map → chunk-UMTKQVOX.cjs.map} +1 -1
- package/dist/{chunk-OM7E43ZN.cjs → chunk-VNRBCUBV.cjs} +15 -15
- package/dist/{chunk-OM7E43ZN.cjs.map → chunk-VNRBCUBV.cjs.map} +1 -1
- package/dist/{chunk-RFLFRIPV.js → chunk-WCAUPASG.js} +6 -6
- package/dist/{chunk-RFLFRIPV.js.map → chunk-WCAUPASG.js.map} +1 -1
- package/dist/{chunk-AIS37SL2.cjs → chunk-WZA5S5EJ.cjs} +84 -9
- package/dist/chunk-WZA5S5EJ.cjs.map +1 -0
- package/dist/{chunk-VBJY2CSK.js → chunk-X4FDLUXJ.js} +6 -6
- package/dist/{chunk-VBJY2CSK.js.map → chunk-X4FDLUXJ.js.map} +1 -1
- package/dist/{chunk-3QRVAI53.cjs → chunk-XZ4NC3Q7.cjs} +6 -6
- package/dist/{chunk-3QRVAI53.cjs.map → chunk-XZ4NC3Q7.cjs.map} +1 -1
- package/dist/comments.cjs +58 -58
- package/dist/comments.js +7 -7
- package/dist/diff.cjs +29 -32
- package/dist/diff.cjs.map +1 -1
- package/dist/diff.js +8 -11
- package/dist/diff.js.map +1 -1
- package/dist/docx.cjs +30 -30
- package/dist/docx.js +3 -3
- package/dist/embed.cjs +9 -9
- package/dist/embed.js +7 -7
- package/dist/emoji.cjs +9 -9
- package/dist/emoji.js +6 -6
- package/dist/engine.cjs +58 -58
- package/dist/engine.d.cts +4 -1
- package/dist/engine.d.ts +4 -1
- package/dist/engine.js +3 -3
- package/dist/find.cjs +10 -10
- package/dist/find.js +6 -6
- package/dist/headless.cjs +74 -74
- package/dist/headless.js +4 -4
- package/dist/index.cjs +86 -86
- package/dist/index.js +5 -5
- package/dist/math.cjs +10 -10
- package/dist/math.js +8 -8
- package/dist/mention.cjs +10 -10
- package/dist/mention.js +8 -8
- package/dist/presence.cjs +38 -38
- package/dist/presence.js +7 -7
- package/dist/stats.cjs +10 -10
- package/dist/stats.js +7 -7
- package/dist/table.cjs +25 -25
- package/dist/table.js +6 -6
- package/dist/toc.cjs +9 -9
- package/dist/toc.js +6 -6
- package/dist/view.cjs +4 -4
- package/dist/view.js +2 -2
- package/dist/yjs.cjs +125 -120
- package/dist/yjs.cjs.map +1 -1
- package/dist/yjs.js +11 -6
- package/dist/yjs.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3BXUGX5F.js.map +0 -1
- package/dist/chunk-7SVKLWDT.cjs.map +0 -1
- package/dist/chunk-7XQGOCUG.cjs.map +0 -1
- package/dist/chunk-AIS37SL2.cjs.map +0 -1
- package/dist/chunk-DYWU4SQ2.js.map +0 -1
- package/dist/chunk-IEP7BPFN.js.map +0 -1
- package/dist/chunk-IGZRZIAF.cjs.map +0 -1
- package/dist/chunk-L4D23LM2.js.map +0 -1
- package/dist/chunk-L6OW2FL3.js.map +0 -1
- package/dist/chunk-VFSVN5IQ.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk4F2IWBFM_cjs = require('./chunk-4F2IWBFM.cjs');
|
|
4
|
+
var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var reactDom = require('react-dom');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -34,7 +34,7 @@ function isCrossSelection(selection) {
|
|
|
34
34
|
}
|
|
35
35
|
function selectionDecorations(state, mode) {
|
|
36
36
|
if (mode !== "decorations" || !isCrossSelection(state.selection)) return [];
|
|
37
|
-
return
|
|
37
|
+
return chunk4F2IWBFM_cjs.markRanges(state).map(({ block, region, from, to }) => ({
|
|
38
38
|
kind: "inline",
|
|
39
39
|
block,
|
|
40
40
|
region,
|
|
@@ -45,9 +45,9 @@ function selectionDecorations(state, mode) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// src/view/dom/attributes.ts
|
|
48
|
-
var sortedEntries = (attrs) =>
|
|
48
|
+
var sortedEntries = (attrs) => chunkWZA5S5EJ_cjs.dataAttributes(attrs, "");
|
|
49
49
|
function setAttributes(element, attrs, prefix = "") {
|
|
50
|
-
for (const [name, value] of
|
|
50
|
+
for (const [name, value] of chunkWZA5S5EJ_cjs.writtenAttrs(chunkWZA5S5EJ_cjs.dataAttributes(attrs, prefix))) element.setAttribute(name, value);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// src/view/dom/segments.ts
|
|
@@ -62,7 +62,7 @@ function decorationRanges(decorations, length) {
|
|
|
62
62
|
return ranges;
|
|
63
63
|
}
|
|
64
64
|
function toSegments(inline, decorations) {
|
|
65
|
-
const length =
|
|
65
|
+
const length = chunkWZA5S5EJ_cjs.inlineLength(inline);
|
|
66
66
|
const ranges = decorationRanges(decorations, length);
|
|
67
67
|
const widgets = decorations.filter((decoration) => decoration.kind === "widget").map((decoration) => ({ decoration, at: Math.min(Math.max(decoration.offset, 0), length) })).sort((a, b) => a.at - b.at || (a.decoration.side ?? 1) - (b.decoration.side ?? 1));
|
|
68
68
|
const edges = [...ranges.flatMap((range) => [range.from, range.to]), ...widgets.map((widget) => widget.at)];
|
|
@@ -78,7 +78,7 @@ function toSegments(inline, decorations) {
|
|
|
78
78
|
};
|
|
79
79
|
let start = 0;
|
|
80
80
|
for (const node of inline) {
|
|
81
|
-
const end = start +
|
|
81
|
+
const end = start + chunkWZA5S5EJ_cjs.nodeLength(node);
|
|
82
82
|
if (node.kind === "atom") {
|
|
83
83
|
placeWidgets(start);
|
|
84
84
|
segments.push({ kind: "atom", node, decorations: covering(start, end), from: start });
|
|
@@ -133,7 +133,7 @@ function create(doc, tag, attributes) {
|
|
|
133
133
|
return element;
|
|
134
134
|
}
|
|
135
135
|
function linkElement({ href = "", title } = {}, doc) {
|
|
136
|
-
const safe =
|
|
136
|
+
const safe = chunkWZA5S5EJ_cjs.sanitizeHref(href);
|
|
137
137
|
if (safe === null) return create(doc, "span", [["data-quoin-link", ""]]);
|
|
138
138
|
const anchor = create(doc, "a", [["href", safe], ["data-quoin-link", ""]]);
|
|
139
139
|
if (title) anchor.title = title;
|
|
@@ -141,8 +141,8 @@ function linkElement({ href = "", title } = {}, doc) {
|
|
|
141
141
|
}
|
|
142
142
|
function markElement2(mark2, doc) {
|
|
143
143
|
if (mark2.type === "link") return linkElement(mark2.attrs, doc);
|
|
144
|
-
const { tag, attrs } =
|
|
145
|
-
return create(doc, tag,
|
|
144
|
+
const { tag, attrs } = chunkWZA5S5EJ_cjs.markElement(mark2);
|
|
145
|
+
return create(doc, tag, chunkWZA5S5EJ_cjs.writtenAttrs(attrs));
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// src/view/dom/wrappers.ts
|
|
@@ -272,7 +272,7 @@ function createDomMap(host, length, entries) {
|
|
|
272
272
|
const after = texts.find((entry) => entry.from <= at && at < entry.to);
|
|
273
273
|
const before = texts.find((entry) => entry.from < at && at <= entry.to);
|
|
274
274
|
const text = assoc === 1 ? after ?? before : before ?? after;
|
|
275
|
-
if (text) return { node: text.node, offset: at - text.from };
|
|
275
|
+
if (text) return { node: text.node, offset: Math.min(at - text.from, textLength(text.node)) };
|
|
276
276
|
const next = stops.find((entry) => entry.from >= at);
|
|
277
277
|
const previous = breaksAndAtoms.filter((entry) => entry.to <= at).pop();
|
|
278
278
|
const beforeNext = next && pointAt(next, 0);
|
|
@@ -339,8 +339,8 @@ function reconcileChildren(parent, specs) {
|
|
|
339
339
|
// src/view/dom/text-diff.ts
|
|
340
340
|
function textDiff(before, after, caretHint) {
|
|
341
341
|
if (before === after) return null;
|
|
342
|
-
const prefix =
|
|
343
|
-
const suffix =
|
|
342
|
+
const prefix = chunk4F2IWBFM_cjs.commonPrefix(before, after);
|
|
343
|
+
const suffix = chunk4F2IWBFM_cjs.commonSuffix(before, after);
|
|
344
344
|
const shared = Math.min(suffix, Math.min(before.length, after.length) - prefix);
|
|
345
345
|
const removed = before.length - prefix - shared;
|
|
346
346
|
const inserted = after.length - prefix - shared;
|
|
@@ -445,12 +445,12 @@ function specsFor(segment, options, doc) {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
function needsFiller(inline) {
|
|
448
|
-
const content =
|
|
448
|
+
const content = chunkWZA5S5EJ_cjs.inlineText(inline);
|
|
449
449
|
return content === "" || content.endsWith("\n");
|
|
450
450
|
}
|
|
451
451
|
function renderInline(host, inline, decorations, options = {}) {
|
|
452
452
|
const doc = host.ownerDocument;
|
|
453
|
-
const length =
|
|
453
|
+
const length = chunkWZA5S5EJ_cjs.inlineLength(inline);
|
|
454
454
|
const specs = toSegments(inline, decorations).flatMap((segment) => specsFor(segment, options, doc));
|
|
455
455
|
if (needsFiller(inline)) specs.push(fillerSpec(doc, length));
|
|
456
456
|
reconcileChildren(host, specs);
|
|
@@ -528,10 +528,10 @@ function readSelection(registry, domSelection, blockAt2 = () => void 0) {
|
|
|
528
528
|
if (!domSelection || !anchorNode || !focusNode) return null;
|
|
529
529
|
const anchor = domToPos(registry, anchorNode, domSelection.anchorOffset);
|
|
530
530
|
const head = domToPos(registry, focusNode, domSelection.focusOffset);
|
|
531
|
-
if (anchor && head) return
|
|
531
|
+
if (anchor && head) return chunk4F2IWBFM_cjs.textSelection(anchor, head);
|
|
532
532
|
if (anchor || head || registry.locate(anchorNode) || registry.locate(focusNode)) return null;
|
|
533
533
|
const block = blockAt2(anchorNode);
|
|
534
|
-
return block !== void 0 && block === blockAt2(focusNode) ?
|
|
534
|
+
return block !== void 0 && block === blockAt2(focusNode) ? chunk4F2IWBFM_cjs.nodeSelection(block) : null;
|
|
535
535
|
}
|
|
536
536
|
function selectBlock(domSelection, element) {
|
|
537
537
|
if (!element) return false;
|
|
@@ -548,7 +548,7 @@ function writeSelection(registry, selection, domSelection, blockElement) {
|
|
|
548
548
|
if (selection.kind !== "text") return false;
|
|
549
549
|
const { anchor, head } = selection;
|
|
550
550
|
if (anchor.block !== head.block || anchor.region !== head.region) return false;
|
|
551
|
-
if (
|
|
551
|
+
if (chunk4F2IWBFM_cjs.sameSelection(readSelection(registry, domSelection), selection)) return true;
|
|
552
552
|
const base = posToDom(registry, anchor, anchor.offset < head.offset ? 1 : -1);
|
|
553
553
|
const extent = posToDom(registry, head, head.offset < anchor.offset ? 1 : -1);
|
|
554
554
|
if (!base || !extent) return false;
|
|
@@ -610,8 +610,8 @@ var known = /* @__PURE__ */ new WeakMap();
|
|
|
610
610
|
function hidersOf(doc) {
|
|
611
611
|
let hiders = known.get(doc);
|
|
612
612
|
if (hiders === void 0) {
|
|
613
|
-
const first = doc.blocks.findIndex(
|
|
614
|
-
hiders = doc.blocks.map((_, index) => first < 0 || index <= first ? null :
|
|
613
|
+
const first = doc.blocks.findIndex(chunk4F2IWBFM_cjs.isClosedToggle);
|
|
614
|
+
hiders = doc.blocks.map((_, index) => first < 0 || index <= first ? null : chunk4F2IWBFM_cjs.hidingToggle(doc, index + 1));
|
|
615
615
|
known.set(doc, hiders);
|
|
616
616
|
}
|
|
617
617
|
return hiders;
|
|
@@ -620,7 +620,7 @@ var hidingToggleAt = (doc, index) => hidersOf(doc)[index] ?? null;
|
|
|
620
620
|
function isHiddenAt(doc, index, choices) {
|
|
621
621
|
if (choices.size === 0) return hidingToggleAt(doc, index) !== null;
|
|
622
622
|
const closed = (block) => block.type === "TOGGLE" && !shownOpen(block, choices);
|
|
623
|
-
return
|
|
623
|
+
return chunk4F2IWBFM_cjs.hidingToggle(doc, index + 1, closed) !== null;
|
|
624
624
|
}
|
|
625
625
|
var visibleBlockIndexes = (doc) => hidersOf(doc).flatMap((hider, index) => hider === null ? [index] : []);
|
|
626
626
|
function drawnBlockCount(doc, start = 0, end = doc.blocks.length) {
|
|
@@ -636,7 +636,7 @@ var dispatchSelection = (controller, selection) => controller.dispatch(controlle
|
|
|
636
636
|
// src/view/navigation/neighbour-block.ts
|
|
637
637
|
var anyBlock = () => true;
|
|
638
638
|
function neighbourBlock(doc, from, direction, accept = anyBlock) {
|
|
639
|
-
const index = doc.index.get(from);
|
|
639
|
+
const index = from === null ? -direction * Infinity : doc.index.get(from);
|
|
640
640
|
if (index === void 0) return null;
|
|
641
641
|
const visible = visibleBlockIndexes(doc);
|
|
642
642
|
const ahead = direction < 0 ? visible.filter((at) => at < index).reverse() : visible.filter((at) => at > index);
|
|
@@ -645,18 +645,18 @@ function neighbourBlock(doc, from, direction, accept = anyBlock) {
|
|
|
645
645
|
}
|
|
646
646
|
function entryEdge(controller, block, direction) {
|
|
647
647
|
const { doc, schema } = controller.editor.state;
|
|
648
|
-
const edge = direction < 0 ?
|
|
648
|
+
const edge = direction < 0 ? chunk4F2IWBFM_cjs.endOf(doc, schema, block) : chunk4F2IWBFM_cjs.startOf(doc, schema, block);
|
|
649
649
|
if (edge.kind !== "text") return edge;
|
|
650
650
|
const drawn = controller.registry.get(edge.head.block, edge.head.region) !== void 0;
|
|
651
|
-
return drawn && !entersAsNode(controller, block) ? edge :
|
|
651
|
+
return drawn && !entersAsNode(controller, block) ? edge : chunk4F2IWBFM_cjs.nodeSelection(block);
|
|
652
652
|
}
|
|
653
|
-
var ownNode = (controller, block, direction) => direction < 0 && entersAsNode(controller, block) ?
|
|
653
|
+
var ownNode = (controller, block, direction) => direction < 0 && entersAsNode(controller, block) ? chunk4F2IWBFM_cjs.nodeSelection(block) : null;
|
|
654
654
|
var canBeEntered = (controller) => (block) => {
|
|
655
655
|
const { schema } = controller.editor.state;
|
|
656
|
-
const region =
|
|
656
|
+
const region = chunk4F2IWBFM_cjs.isTextFlow(schema, block) ? chunk4F2IWBFM_cjs.primaryRegion(schema, block) : null;
|
|
657
657
|
return region === null || controller.registry.get(block.id, region) !== void 0 || entersAsNode(controller, block.id);
|
|
658
658
|
};
|
|
659
|
-
var holdsTextHead = (controller) => (block) =>
|
|
659
|
+
var holdsTextHead = (controller) => (block) => chunk4F2IWBFM_cjs.isTextFlow(controller.editor.state.schema, block) && entryEdge(controller, block.id, 1).kind === "text";
|
|
660
660
|
function neighbourHead(controller, from, direction) {
|
|
661
661
|
const target = neighbourBlock(controller.editor.state.doc, from, direction, holdsTextHead(controller));
|
|
662
662
|
const edge = target && entryEdge(controller, target.id, direction);
|
|
@@ -795,7 +795,7 @@ function createCrossBlockPointer(controller) {
|
|
|
795
795
|
let preventMouseDown = false;
|
|
796
796
|
const scroll = createAutoScroll(root, () => follow(last.x, last.y));
|
|
797
797
|
function select(selection) {
|
|
798
|
-
if (
|
|
798
|
+
if (chunk4F2IWBFM_cjs.sameSelection(selection, controller.editor.state.selection)) return;
|
|
799
799
|
dispatchSelection(controller, selection);
|
|
800
800
|
}
|
|
801
801
|
function startDragging() {
|
|
@@ -811,14 +811,14 @@ function createCrossBlockPointer(controller) {
|
|
|
811
811
|
if (current.anchor === null) return;
|
|
812
812
|
startDragging();
|
|
813
813
|
}
|
|
814
|
-
select(
|
|
814
|
+
select(chunk4F2IWBFM_cjs.textSelection(current.anchor, caretPosAt(controller, target, x, y)));
|
|
815
815
|
}
|
|
816
816
|
function followBlocks(current, x, y) {
|
|
817
817
|
if (!controller.dragging && Math.hypot(x - current.x, y - current.y) < DRAG_DISTANCE) return;
|
|
818
818
|
const block = blockAt(controller, x, y);
|
|
819
819
|
if (block === null) return;
|
|
820
820
|
startDragging();
|
|
821
|
-
select(
|
|
821
|
+
select(chunk4F2IWBFM_cjs.blockRangeSelection(current.start, block));
|
|
822
822
|
}
|
|
823
823
|
function follow(x, y) {
|
|
824
824
|
if (press?.kind === "text") followText(press, x, y);
|
|
@@ -853,10 +853,10 @@ function createCrossBlockPointer(controller) {
|
|
|
853
853
|
}
|
|
854
854
|
function pressWhole(block) {
|
|
855
855
|
if (entryEdge(controller, block, 1).kind !== "node") return;
|
|
856
|
-
const pressed =
|
|
857
|
-
if (pressed !== void 0 && !canBeEntered(controller)(pressed)) return select(
|
|
856
|
+
const pressed = chunkWZA5S5EJ_cjs.blockById(controller.editor.state.doc, block);
|
|
857
|
+
if (pressed !== void 0 && !canBeEntered(controller)(pressed)) return select(chunk4F2IWBFM_cjs.blockRangeSelection(block));
|
|
858
858
|
controller.nodeReveal.pressed(block);
|
|
859
|
-
select(
|
|
859
|
+
select(chunk4F2IWBFM_cjs.nodeSelection(block));
|
|
860
860
|
}
|
|
861
861
|
function onPointerDown(event) {
|
|
862
862
|
end();
|
|
@@ -898,7 +898,7 @@ function createCrossBlockPointer(controller) {
|
|
|
898
898
|
// src/view/selection/paint-selection.ts
|
|
899
899
|
var NAME = "quoin-selection";
|
|
900
900
|
function coveredRanges(controller) {
|
|
901
|
-
return
|
|
901
|
+
return chunk4F2IWBFM_cjs.markRanges(controller.editor.state).flatMap(({ block, region, from, to }) => {
|
|
902
902
|
const host = controller.registry.get(block, region);
|
|
903
903
|
const map = host && domMapOf(host);
|
|
904
904
|
if (!host || !map) return [];
|
|
@@ -969,7 +969,7 @@ function heldBySink(selection) {
|
|
|
969
969
|
}
|
|
970
970
|
var NO_TEXT = "\xA0";
|
|
971
971
|
function selectionText(state) {
|
|
972
|
-
const text =
|
|
972
|
+
const text = chunk4F2IWBFM_cjs.markRanges(state).map((range) => chunkWZA5S5EJ_cjs.inlinePlainText(chunk4F2IWBFM_cjs.rangeContent(state, range), state.schema)).join("\n");
|
|
973
973
|
return text === "" ? NO_TEXT : text;
|
|
974
974
|
}
|
|
975
975
|
var focusInPlace = (sink) => inPlace(sink, () => sink.focus({ preventScroll: true }));
|
|
@@ -992,7 +992,7 @@ function focusSink(controller) {
|
|
|
992
992
|
sink.ownerDocument.getSelection()?.selectAllChildren(sink);
|
|
993
993
|
}
|
|
994
994
|
function selectedBlockName({ doc, schema, selection }, blockLabel) {
|
|
995
|
-
const block = selection?.kind === "node" ?
|
|
995
|
+
const block = selection?.kind === "node" ? chunkWZA5S5EJ_cjs.blockById(doc, selection.block) : void 0;
|
|
996
996
|
return block === void 0 ? null : blockLabel?.(block, schema) ?? "";
|
|
997
997
|
}
|
|
998
998
|
function clearSink(controller) {
|
|
@@ -1129,7 +1129,7 @@ function createElementSlot(changed) {
|
|
|
1129
1129
|
|
|
1130
1130
|
// src/view/controller/selection-element.ts
|
|
1131
1131
|
function elementFor({ doc }, selection, rendered) {
|
|
1132
|
-
const id =
|
|
1132
|
+
const id = chunk4F2IWBFM_cjs.headBlockId(selection);
|
|
1133
1133
|
const index = id === null ? void 0 : doc.index.get(id);
|
|
1134
1134
|
if (id === null || index === void 0) return void 0;
|
|
1135
1135
|
const hiding = hidingToggleAt(doc, index);
|
|
@@ -1142,7 +1142,7 @@ function selectionElement(state, rendered) {
|
|
|
1142
1142
|
if (doc.blocks.length === 0) return rendered.empty?.() ?? void 0;
|
|
1143
1143
|
const sink = heldBySink(selection) ? rendered.sink?.() : null;
|
|
1144
1144
|
if (sink) return sink;
|
|
1145
|
-
return elementFor(state, selection, rendered) ?? elementFor(state,
|
|
1145
|
+
return elementFor(state, selection, rendered) ?? elementFor(state, chunk4F2IWBFM_cjs.startOf(doc, schema, doc.blocks[0].id), rendered);
|
|
1146
1146
|
}
|
|
1147
1147
|
|
|
1148
1148
|
// src/view/controller/tab-stop.ts
|
|
@@ -1209,9 +1209,9 @@ function ownsFocus(controller, doc) {
|
|
|
1209
1209
|
function focusTarget(state, target) {
|
|
1210
1210
|
const { doc, schema, selection } = state;
|
|
1211
1211
|
if (doc.blocks.length === 0) return null;
|
|
1212
|
-
if (target === "end") return
|
|
1213
|
-
if (target === "start" || target === void 0 && selection === null) return
|
|
1214
|
-
return target === void 0 ? selection :
|
|
1212
|
+
if (target === "end") return chunk4F2IWBFM_cjs.endOf(doc, schema, doc.blocks[doc.blocks.length - 1].id);
|
|
1213
|
+
if (target === "start" || target === void 0 && selection === null) return chunk4F2IWBFM_cjs.startOf(doc, schema, doc.blocks[0].id);
|
|
1214
|
+
return target === void 0 ? selection : chunk4F2IWBFM_cjs.textSelection(target);
|
|
1215
1215
|
}
|
|
1216
1216
|
|
|
1217
1217
|
// src/view/controller/host-decorations.ts
|
|
@@ -1227,7 +1227,7 @@ function decorationsByHost(decorations) {
|
|
|
1227
1227
|
return byHost;
|
|
1228
1228
|
}
|
|
1229
1229
|
function sameDecoration(a, b) {
|
|
1230
|
-
if (a.kind !== b.kind || a.block !== b.block || !
|
|
1230
|
+
if (a.kind !== b.kind || a.block !== b.block || !chunkWZA5S5EJ_cjs.sameAttrs(a.attrs, b.attrs)) return false;
|
|
1231
1231
|
if (a.kind === "inline" && b.kind === "inline") {
|
|
1232
1232
|
return a.region === b.region && a.from === b.from && a.to === b.to;
|
|
1233
1233
|
}
|
|
@@ -1238,7 +1238,7 @@ function sameDecoration(a, b) {
|
|
|
1238
1238
|
return true;
|
|
1239
1239
|
}
|
|
1240
1240
|
function sameDecorations(a, b) {
|
|
1241
|
-
return a === b ||
|
|
1241
|
+
return a === b || chunkWZA5S5EJ_cjs.sameItems(a, b, sameDecoration);
|
|
1242
1242
|
}
|
|
1243
1243
|
var byMode = { highlight: /* @__PURE__ */ new WeakMap(), decorations: /* @__PURE__ */ new WeakMap() };
|
|
1244
1244
|
function hostDecorations(editor, block, region, mode = "highlight") {
|
|
@@ -1254,7 +1254,7 @@ function hostDecorations(editor, block, region, mode = "highlight") {
|
|
|
1254
1254
|
|
|
1255
1255
|
// src/view/controller/region-inline.ts
|
|
1256
1256
|
function regionInline(state, block, region) {
|
|
1257
|
-
const regions =
|
|
1257
|
+
const regions = chunkWZA5S5EJ_cjs.blockById(state.doc, block)?.regions;
|
|
1258
1258
|
return regions && Object.hasOwn(regions, region) ? regions[region] : void 0;
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
@@ -1304,7 +1304,7 @@ function createOutsideChanges(editorHasFocus, movedFrom) {
|
|
|
1304
1304
|
}
|
|
1305
1305
|
const from = moved ?? (outside && !settled ? movedFrom(tr.before.selection) : null);
|
|
1306
1306
|
settled ||= outside;
|
|
1307
|
-
moved = from &&
|
|
1307
|
+
moved = from && chunk4F2IWBFM_cjs.mapSelection(from, (pos, assoc) => tr.mapPos(pos, assoc), tr.before.doc);
|
|
1308
1308
|
},
|
|
1309
1309
|
takeFocused() {
|
|
1310
1310
|
const value = focused;
|
|
@@ -1397,7 +1397,7 @@ function handleCopy(controller, event, cut) {
|
|
|
1397
1397
|
clipboardData.setData("text/plain", copied.text);
|
|
1398
1398
|
clipboardData.setData("text/html", wrapSliceHTML(copied.html, copied.json));
|
|
1399
1399
|
clipboardData.setData(QUOIN_SLICE_TYPE, copied.json);
|
|
1400
|
-
if (cut) controller.run(
|
|
1400
|
+
if (cut) controller.run(chunk4F2IWBFM_cjs.deleteSelection);
|
|
1401
1401
|
}
|
|
1402
1402
|
function handlePaste(controller, event) {
|
|
1403
1403
|
if (!event.clipboardData) return;
|
|
@@ -1429,7 +1429,7 @@ function handleDrop(controller, event) {
|
|
|
1429
1429
|
return;
|
|
1430
1430
|
}
|
|
1431
1431
|
const pos = dropPos(controller, event.clientX, event.clientY);
|
|
1432
|
-
if (pos) controller.dispatch(controller.editor.createTransaction().setSelection(
|
|
1432
|
+
if (pos) controller.dispatch(controller.editor.createTransaction().setSelection(chunk4F2IWBFM_cjs.textSelection(pos)).setOrigin("drop"));
|
|
1433
1433
|
pasteTransfer(controller, dataTransfer);
|
|
1434
1434
|
}
|
|
1435
1435
|
function handleDragOver(event) {
|
|
@@ -1508,7 +1508,8 @@ function composedText(sink, { before, after }) {
|
|
|
1508
1508
|
if (text.startsWith(before)) text = text.slice(before.length);
|
|
1509
1509
|
return text.endsWith(after) ? text.slice(0, text.length - after.length) : text;
|
|
1510
1510
|
}
|
|
1511
|
-
function createSinkComposition(controller) {
|
|
1511
|
+
function createSinkComposition(controller, settled = () => {
|
|
1512
|
+
}) {
|
|
1512
1513
|
let outside = null;
|
|
1513
1514
|
let stopWaiting = null;
|
|
1514
1515
|
function settle() {
|
|
@@ -1522,6 +1523,7 @@ function createSinkComposition(controller) {
|
|
|
1522
1523
|
clearSink(controller);
|
|
1523
1524
|
if (text === "") controller.syncSelectionToDom();
|
|
1524
1525
|
else controller.edit(() => controller.editor.insertText(text));
|
|
1526
|
+
settled();
|
|
1525
1527
|
}
|
|
1526
1528
|
return {
|
|
1527
1529
|
start() {
|
|
@@ -1557,29 +1559,29 @@ function createSinkComposition(controller) {
|
|
|
1557
1559
|
var LINE_BREAK = "\n";
|
|
1558
1560
|
var transposeChars = (state, dispatch) => {
|
|
1559
1561
|
const { selection } = state;
|
|
1560
|
-
if (selection?.kind !== "text" || !
|
|
1562
|
+
if (selection?.kind !== "text" || !chunk4F2IWBFM_cjs.isCollapsed(selection)) return false;
|
|
1561
1563
|
const { head } = selection;
|
|
1562
|
-
const inline =
|
|
1564
|
+
const inline = chunkWZA5S5EJ_cjs.blockById(state.doc, head.block)?.regions[head.region];
|
|
1563
1565
|
if (inline === void 0) return false;
|
|
1564
|
-
const value =
|
|
1566
|
+
const value = chunkWZA5S5EJ_cjs.inlineText(inline);
|
|
1565
1567
|
const atLineEnd = head.offset === value.length || value[head.offset] === LINE_BREAK;
|
|
1566
|
-
const end = atLineEnd ? head.offset :
|
|
1567
|
-
const middle =
|
|
1568
|
-
const start =
|
|
1568
|
+
const end = atLineEnd ? head.offset : chunk4F2IWBFM_cjs.nextGraphemeOffset(value, head.offset);
|
|
1569
|
+
const middle = chunk4F2IWBFM_cjs.prevGraphemeOffset(value, end);
|
|
1570
|
+
const start = chunk4F2IWBFM_cjs.prevGraphemeOffset(value, middle);
|
|
1569
1571
|
if (start === middle || value.slice(start, end).includes(LINE_BREAK)) return false;
|
|
1570
|
-
const swapped = [...
|
|
1571
|
-
const tr = new
|
|
1572
|
-
tr.step(
|
|
1573
|
-
dispatch?.(tr.setSelection(
|
|
1572
|
+
const swapped = [...chunkWZA5S5EJ_cjs.sliceInline(inline, middle, end), ...chunkWZA5S5EJ_cjs.sliceInline(inline, start, middle)];
|
|
1573
|
+
const tr = new chunk4F2IWBFM_cjs.Transaction(state).setOrigin("input");
|
|
1574
|
+
tr.step(chunk4F2IWBFM_cjs.replaceInlineStep(head.block, head.region, start, end, swapped));
|
|
1575
|
+
dispatch?.(tr.setSelection(chunk4F2IWBFM_cjs.textSelection({ ...head, offset: end })));
|
|
1574
1576
|
return true;
|
|
1575
1577
|
};
|
|
1576
1578
|
|
|
1577
1579
|
// src/view/input/replace-range.ts
|
|
1578
1580
|
function replaceRange(editor, range, text, withRules) {
|
|
1579
1581
|
const dispatch = (tr) => editor.dispatch(tr);
|
|
1580
|
-
dispatch(editor.createTransaction().setSelection(
|
|
1581
|
-
if (text === "") return
|
|
1582
|
-
return withRules ? editor.insertText(text) :
|
|
1582
|
+
dispatch(editor.createTransaction().setSelection(chunk4F2IWBFM_cjs.textSelection(range.from, range.to)).setOrigin("input"));
|
|
1583
|
+
if (text === "") return chunk4F2IWBFM_cjs.deleteSelection(editor.state, (tr) => dispatch(tr.setOrigin("input")));
|
|
1584
|
+
return withRules ? editor.insertText(text) : chunk4F2IWBFM_cjs.insertText(text, { origin: "input" })(editor.state, dispatch);
|
|
1583
1585
|
}
|
|
1584
1586
|
|
|
1585
1587
|
// src/view/input/target-range.ts
|
|
@@ -1590,13 +1592,13 @@ function targetRangeToModel(controller, event) {
|
|
|
1590
1592
|
const to = domToPos(controller.registry, range.endContainer, range.endOffset);
|
|
1591
1593
|
return from && to && { from, to };
|
|
1592
1594
|
}
|
|
1593
|
-
var isEmpty = ({ from, to }) =>
|
|
1595
|
+
var isEmpty = ({ from, to }) => chunk4F2IWBFM_cjs.sameSelection(chunk4F2IWBFM_cjs.textSelection(from), chunk4F2IWBFM_cjs.textSelection(to));
|
|
1594
1596
|
function targetBeyondSelection(controller, event) {
|
|
1595
1597
|
const range = targetRangeToModel(controller, event);
|
|
1596
1598
|
if (range === null || isEmpty(range)) return null;
|
|
1597
1599
|
const { doc, selection } = controller.editor.state;
|
|
1598
|
-
const selected =
|
|
1599
|
-
const same = selected !== null &&
|
|
1600
|
+
const selected = chunk4F2IWBFM_cjs.selectionRange(doc, selection);
|
|
1601
|
+
const same = selected !== null && chunk4F2IWBFM_cjs.sameSelection(chunk4F2IWBFM_cjs.textSelection(selected.from, selected.to), chunk4F2IWBFM_cjs.textSelection(range.from, range.to));
|
|
1600
1602
|
return same ? null : range;
|
|
1601
1603
|
}
|
|
1602
1604
|
|
|
@@ -1618,34 +1620,34 @@ function insertTypedText(controller, event) {
|
|
|
1618
1620
|
else controller.edit(() => replaceRange(controller.editor, range, text, false));
|
|
1619
1621
|
}
|
|
1620
1622
|
function deleteContentBackward(controller, event) {
|
|
1621
|
-
if (!controller.run(
|
|
1623
|
+
if (!controller.run(chunk4F2IWBFM_cjs.undoInputRule)) targetOr(chunk4F2IWBFM_cjs.deleteBackward)(controller, event);
|
|
1622
1624
|
}
|
|
1623
1625
|
function insertReplacementText(controller, event) {
|
|
1624
1626
|
const text = event.dataTransfer?.getData("text/plain") || event.data;
|
|
1625
1627
|
if (!text) return;
|
|
1626
1628
|
const range = targetRangeToModel(controller, event);
|
|
1627
|
-
if (range === null) controller.run(
|
|
1629
|
+
if (range === null) controller.run(chunk4F2IWBFM_cjs.insertText(text, { origin: "input" }));
|
|
1628
1630
|
else controller.edit(() => replaceRange(controller.editor, range, text, false));
|
|
1629
1631
|
}
|
|
1630
1632
|
var actions = {
|
|
1631
1633
|
insertText: insertTypedText,
|
|
1632
1634
|
insertReplacementText,
|
|
1633
1635
|
insertParagraph: (controller) => void controller.edit(() => controller.editor.handleKey(ENTER)),
|
|
1634
|
-
insertLineBreak: run(
|
|
1636
|
+
insertLineBreak: run(chunk4F2IWBFM_cjs.insertHardBreak),
|
|
1635
1637
|
deleteContentBackward,
|
|
1636
|
-
deleteContentForward: targetOr(
|
|
1637
|
-
deleteWordBackward: targetOr(
|
|
1638
|
-
deleteWordForward: targetOr(
|
|
1639
|
-
deleteSoftLineBackward: targetOr(
|
|
1640
|
-
deleteHardLineBackward: targetOr(
|
|
1641
|
-
deleteSoftLineForward: targetOr(
|
|
1642
|
-
deleteHardLineForward: targetOr(
|
|
1643
|
-
formatBold: run(
|
|
1644
|
-
formatItalic: run(
|
|
1645
|
-
formatUnderline: run(
|
|
1646
|
-
formatStrikeThrough: run(
|
|
1647
|
-
historyUndo: run(
|
|
1648
|
-
historyRedo: run(
|
|
1638
|
+
deleteContentForward: targetOr(chunk4F2IWBFM_cjs.deleteForward),
|
|
1639
|
+
deleteWordBackward: targetOr(chunk4F2IWBFM_cjs.deleteWordBackward),
|
|
1640
|
+
deleteWordForward: targetOr(chunk4F2IWBFM_cjs.deleteWordForward),
|
|
1641
|
+
deleteSoftLineBackward: targetOr(chunk4F2IWBFM_cjs.deleteToLineStart),
|
|
1642
|
+
deleteHardLineBackward: targetOr(chunk4F2IWBFM_cjs.deleteToLineStart),
|
|
1643
|
+
deleteSoftLineForward: targetOr(chunk4F2IWBFM_cjs.deleteToLineEnd),
|
|
1644
|
+
deleteHardLineForward: targetOr(chunk4F2IWBFM_cjs.deleteToLineEnd),
|
|
1645
|
+
formatBold: run(chunk4F2IWBFM_cjs.toggleMark("bold")),
|
|
1646
|
+
formatItalic: run(chunk4F2IWBFM_cjs.toggleMark("italic")),
|
|
1647
|
+
formatUnderline: run(chunk4F2IWBFM_cjs.toggleMark("underline")),
|
|
1648
|
+
formatStrikeThrough: run(chunk4F2IWBFM_cjs.toggleMark("strike")),
|
|
1649
|
+
historyUndo: run(chunk4F2IWBFM_cjs.undo),
|
|
1650
|
+
historyRedo: run(chunk4F2IWBFM_cjs.redo),
|
|
1649
1651
|
insertTranspose: run(transposeChars),
|
|
1650
1652
|
insertFromPaste: leaveToHandlers,
|
|
1651
1653
|
insertFromDrop: leaveToHandlers,
|
|
@@ -1746,7 +1748,7 @@ function snapshotComposition(controller, block, region) {
|
|
|
1746
1748
|
const element = controller.registry.get(block, region);
|
|
1747
1749
|
const inline = regionInline(editor.state, block, region);
|
|
1748
1750
|
if (element === void 0 || inline === void 0) return null;
|
|
1749
|
-
const text =
|
|
1751
|
+
const text = chunkWZA5S5EJ_cjs.inlineText(inline);
|
|
1750
1752
|
const end = composedEnd(controller, block, region);
|
|
1751
1753
|
const since = [];
|
|
1752
1754
|
const release = editor.subscribe((_, tr) => void (tr && since.push(tr)));
|
|
@@ -1784,7 +1786,8 @@ function elementOf(controller, target) {
|
|
|
1784
1786
|
if (target === EMPTY_HOST) return controller.emptyHost ?? void 0;
|
|
1785
1787
|
return target ? controller.registry.get(target.block, target.region) : void 0;
|
|
1786
1788
|
}
|
|
1787
|
-
function createCompositionHandlers(controller) {
|
|
1789
|
+
function createCompositionHandlers(controller, settled = () => {
|
|
1790
|
+
}) {
|
|
1788
1791
|
let active = false;
|
|
1789
1792
|
let target = null;
|
|
1790
1793
|
let snapshot = null;
|
|
@@ -1803,6 +1806,7 @@ function createCompositionHandlers(controller) {
|
|
|
1803
1806
|
controller.renderHost(host.block, host.region);
|
|
1804
1807
|
controller.syncSelectionToDom();
|
|
1805
1808
|
}
|
|
1809
|
+
settled();
|
|
1806
1810
|
}
|
|
1807
1811
|
function waitForInput(element) {
|
|
1808
1812
|
const onInput = () => settle();
|
|
@@ -1858,7 +1862,7 @@ function reconcileHost(controller, block, region, caretHint) {
|
|
|
1858
1862
|
const element = controller.registry.get(block, region);
|
|
1859
1863
|
const inline = regionInline(controller.editor.state, block, region);
|
|
1860
1864
|
if (element === void 0 || inline === void 0) return false;
|
|
1861
|
-
const before =
|
|
1865
|
+
const before = chunkWZA5S5EJ_cjs.inlineText(inline);
|
|
1862
1866
|
const after = readDomText(element);
|
|
1863
1867
|
const edit = before === after ? null : textDiff(before, after, domCaretOffset(element));
|
|
1864
1868
|
if (edit === null) return false;
|
|
@@ -1879,9 +1883,10 @@ function createDomInputFallback(controller) {
|
|
|
1879
1883
|
let queued = false;
|
|
1880
1884
|
function enqueue(node) {
|
|
1881
1885
|
const entry = controller.registry.locate(node);
|
|
1882
|
-
if (entry === null || controller.
|
|
1883
|
-
|
|
1884
|
-
|
|
1886
|
+
if (entry === null || controller.readOnly) return false;
|
|
1887
|
+
const key = hostKey(entry.block, entry.region);
|
|
1888
|
+
if (key !== controller.composingKey) pending.set(key, entry);
|
|
1889
|
+
return controller.composingKey === null;
|
|
1885
1890
|
}
|
|
1886
1891
|
function flush() {
|
|
1887
1892
|
queued = false;
|
|
@@ -1923,33 +1928,33 @@ function createDomInputFallback(controller) {
|
|
|
1923
1928
|
|
|
1924
1929
|
// src/view/navigation/cross-moves.ts
|
|
1925
1930
|
function moveHead(controller, { anchor }, head) {
|
|
1926
|
-
dispatchSelection(controller,
|
|
1931
|
+
dispatchSelection(controller, chunk4F2IWBFM_cjs.textSelection(anchor, head));
|
|
1927
1932
|
return true;
|
|
1928
1933
|
}
|
|
1929
1934
|
function blockOf(controller, { block }) {
|
|
1930
1935
|
const { doc } = controller.editor.state;
|
|
1931
|
-
return doc.blocks[
|
|
1936
|
+
return doc.blocks[chunkWZA5S5EJ_cjs.requireBlockIndex(doc, block)];
|
|
1932
1937
|
}
|
|
1933
1938
|
function collapseCross(controller, selection, direction) {
|
|
1934
|
-
const { from, to } =
|
|
1935
|
-
dispatchSelection(controller,
|
|
1939
|
+
const { from, to } = chunk4F2IWBFM_cjs.selectionRange(controller.editor.state.doc, selection);
|
|
1940
|
+
dispatchSelection(controller, chunk4F2IWBFM_cjs.textSelection(direction < 0 ? from : to));
|
|
1936
1941
|
return true;
|
|
1937
1942
|
}
|
|
1938
1943
|
function crossHeadVertically(controller, selection, direction) {
|
|
1939
1944
|
const { head } = selection;
|
|
1940
1945
|
const edge = neighbourHead(controller, head.block, direction);
|
|
1941
1946
|
if (edge !== null) {
|
|
1942
|
-
const end2 =
|
|
1947
|
+
const end2 = chunk4F2IWBFM_cjs.regionLength(blockOf(controller, edge), edge.region);
|
|
1943
1948
|
return moveHead(controller, selection, { ...edge, offset: Math.min(head.offset, end2) });
|
|
1944
1949
|
}
|
|
1945
|
-
const end =
|
|
1950
|
+
const end = chunk4F2IWBFM_cjs.regionLength(blockOf(controller, head), head.region);
|
|
1946
1951
|
return moveHead(controller, selection, { ...head, offset: direction < 0 ? 0 : end });
|
|
1947
1952
|
}
|
|
1948
1953
|
function crossHeadHorizontally(controller, selection, direction) {
|
|
1949
1954
|
const { head } = selection;
|
|
1950
|
-
const text =
|
|
1955
|
+
const text = chunkWZA5S5EJ_cjs.inlineText(blockOf(controller, head).regions[head.region] ?? []);
|
|
1951
1956
|
if (direction < 0 ? head.offset > 0 : head.offset < text.length) {
|
|
1952
|
-
const offset = direction < 0 ?
|
|
1957
|
+
const offset = direction < 0 ? chunk4F2IWBFM_cjs.prevGraphemeOffset(text, head.offset) : chunk4F2IWBFM_cjs.nextGraphemeOffset(text, head.offset);
|
|
1953
1958
|
return moveHead(controller, selection, { ...head, offset });
|
|
1954
1959
|
}
|
|
1955
1960
|
const edge = neighbourHead(controller, head.block, direction);
|
|
@@ -1968,9 +1973,9 @@ function moveHorizontally(controller, direction, extend) {
|
|
|
1968
1973
|
const move = extend ? crossHeadHorizontally : collapseCross;
|
|
1969
1974
|
return move(controller, selection, direction);
|
|
1970
1975
|
}
|
|
1971
|
-
if (!extend && !
|
|
1976
|
+
if (!extend && !chunk4F2IWBFM_cjs.isCollapsed(selection)) return false;
|
|
1972
1977
|
const { head } = selection;
|
|
1973
|
-
const length =
|
|
1978
|
+
const length = chunk4F2IWBFM_cjs.regionLength(doc.blocks[chunkWZA5S5EJ_cjs.requireBlockIndex(doc, head.block)], head.region);
|
|
1974
1979
|
if (direction < 0 ? head.offset > 0 : head.offset < length) return false;
|
|
1975
1980
|
const own2 = extend ? null : ownNode(controller, head.block, direction);
|
|
1976
1981
|
if (own2 !== null) {
|
|
@@ -1979,9 +1984,7 @@ function moveHorizontally(controller, direction, extend) {
|
|
|
1979
1984
|
}
|
|
1980
1985
|
if (!extend) return moveToNeighbour(controller, head.block, direction);
|
|
1981
1986
|
const edge = neighbourHead(controller, head.block, direction);
|
|
1982
|
-
|
|
1983
|
-
dispatchSelection(controller, chunkVFSVN5IQ_cjs.textSelection(selection.anchor, edge));
|
|
1984
|
-
return true;
|
|
1987
|
+
return edge !== null && moveHead(controller, selection, edge);
|
|
1985
1988
|
}
|
|
1986
1989
|
|
|
1987
1990
|
// src/view/navigation/line-edges.ts
|
|
@@ -2078,16 +2081,17 @@ function caretAtGoal(controller, host, at, y) {
|
|
|
2078
2081
|
}
|
|
2079
2082
|
function landAtGoal(controller, block, direction) {
|
|
2080
2083
|
const { schema } = controller.editor.state;
|
|
2081
|
-
const region =
|
|
2084
|
+
const region = chunk4F2IWBFM_cjs.isTextFlow(schema, block) ? chunk4F2IWBFM_cjs.primaryRegion(schema, block) : null;
|
|
2082
2085
|
const host = region === null ? void 0 : controller.registry.get(block.id, region);
|
|
2083
2086
|
if (!host || region === null || controller.goalX === null) return null;
|
|
2084
2087
|
const line = lineInView(host, direction < 0);
|
|
2085
2088
|
const pos = line && caretAtGoal(controller, host, { block: block.id, region }, line.top + line.height / 2);
|
|
2086
|
-
return pos ?
|
|
2089
|
+
return pos ? chunk4F2IWBFM_cjs.textSelection(pos) : null;
|
|
2087
2090
|
}
|
|
2088
2091
|
function moveInHost(controller, host, head, caret, direction) {
|
|
2089
2092
|
const { goalX } = controller;
|
|
2090
|
-
|
|
2093
|
+
const native = !isCrossSelection(controller.editor.state.selection);
|
|
2094
|
+
if (goalX === null || !caret || native && Math.abs(caret.left - goalX) < caret.height / 2) return null;
|
|
2091
2095
|
const y = adjacentLineMiddle(host, caret, direction);
|
|
2092
2096
|
const pos = y === null ? null : caretAtGoal(controller, host, head, y);
|
|
2093
2097
|
return pos && pos.offset !== head.offset ? pos : null;
|
|
@@ -2101,7 +2105,7 @@ function landing(controller, { head }, direction, extend) {
|
|
|
2101
2105
|
controller.goalX ??= caret?.left ?? null;
|
|
2102
2106
|
if (!(direction < 0 ? isOnFirstLine(host, point) : isOnLastLine(host, point))) {
|
|
2103
2107
|
const pos = moveInHost(controller, host, head, caret, direction);
|
|
2104
|
-
return pos &&
|
|
2108
|
+
return pos && chunk4F2IWBFM_cjs.textSelection(pos);
|
|
2105
2109
|
}
|
|
2106
2110
|
const own2 = extend ? null : ownNode(controller, head.block, direction);
|
|
2107
2111
|
if (own2 !== null) return own2;
|
|
@@ -2112,17 +2116,18 @@ function landing(controller, { head }, direction, extend) {
|
|
|
2112
2116
|
function moveText(controller, selection, direction, extend) {
|
|
2113
2117
|
const next = landing(controller, selection, direction, extend);
|
|
2114
2118
|
if (next === null) {
|
|
2119
|
+
if (isCrossSelection(selection)) return crossHeadVertically(controller, selection, direction);
|
|
2115
2120
|
controller.nativeVerticalMove = true;
|
|
2116
2121
|
return false;
|
|
2117
2122
|
}
|
|
2118
|
-
|
|
2119
|
-
dispatchSelection(controller,
|
|
2123
|
+
if (extend && next.kind === "text") return moveHead(controller, selection, next.head);
|
|
2124
|
+
dispatchSelection(controller, next);
|
|
2120
2125
|
return true;
|
|
2121
2126
|
}
|
|
2122
2127
|
function extendBlocks(controller, { anchor, head }, direction) {
|
|
2123
2128
|
const next = neighbourBlock(controller.editor.state.doc, head, direction);
|
|
2124
2129
|
if (next === null) return false;
|
|
2125
|
-
dispatchSelection(controller,
|
|
2130
|
+
dispatchSelection(controller, chunk4F2IWBFM_cjs.blockRangeSelection(anchor, next.id));
|
|
2126
2131
|
return true;
|
|
2127
2132
|
}
|
|
2128
2133
|
function moveVertically(controller, direction, extend) {
|
|
@@ -2130,16 +2135,16 @@ function moveVertically(controller, direction, extend) {
|
|
|
2130
2135
|
if (selection?.kind === "node") return !extend && moveToNeighbour(controller, selection.block, direction);
|
|
2131
2136
|
if (selection?.kind === "blocks") return extend && extendBlocks(controller, selection, direction);
|
|
2132
2137
|
if (selection?.kind !== "text") return false;
|
|
2133
|
-
if (!isCrossSelection(selection)) return moveText(controller, selection, direction, extend);
|
|
2138
|
+
if (extend || !isCrossSelection(selection)) return moveText(controller, selection, direction, extend);
|
|
2134
2139
|
controller.goalX = null;
|
|
2135
|
-
return
|
|
2140
|
+
return collapseCross(controller, selection, direction);
|
|
2136
2141
|
}
|
|
2137
2142
|
|
|
2138
2143
|
// src/view/input/flip-block.ts
|
|
2139
2144
|
var isTask = ({ type, attrs }) => type === "MARKDOWN" && attrs.kind === "task";
|
|
2140
2145
|
function flipCommand(block) {
|
|
2141
|
-
if (isTask(block)) return
|
|
2142
|
-
return block.type === "TOGGLE" ?
|
|
2146
|
+
if (isTask(block)) return chunk4F2IWBFM_cjs.toggleTask;
|
|
2147
|
+
return block.type === "TOGGLE" ? chunk4F2IWBFM_cjs.setAttrs({ open: block.attrs.open !== true }) : null;
|
|
2143
2148
|
}
|
|
2144
2149
|
var toggleState = (open) => open ? "expanded" : "collapsed";
|
|
2145
2150
|
function stateName(block) {
|
|
@@ -2148,7 +2153,7 @@ function stateName(block) {
|
|
|
2148
2153
|
}
|
|
2149
2154
|
function blockHoldingCaret({ doc, selection }) {
|
|
2150
2155
|
if (selection?.kind !== "text" || selection.anchor.block !== selection.head.block) return null;
|
|
2151
|
-
return
|
|
2156
|
+
return chunkWZA5S5EJ_cjs.blockById(doc, selection.head.block) ?? null;
|
|
2152
2157
|
}
|
|
2153
2158
|
function flipForReader(controller, block) {
|
|
2154
2159
|
if (block?.type !== "TOGGLE") return false;
|
|
@@ -2163,7 +2168,7 @@ function flipSelectedBlock(controller) {
|
|
|
2163
2168
|
if (controller.readOnly) return flipForReader(controller, block);
|
|
2164
2169
|
const command = block && flipCommand(block);
|
|
2165
2170
|
if (!block || !command || !controller.run(command)) return false;
|
|
2166
|
-
const after =
|
|
2171
|
+
const after = chunkWZA5S5EJ_cjs.blockById(editor.state.doc, block.id);
|
|
2167
2172
|
if (after) controller.announce(stateName(after));
|
|
2168
2173
|
return true;
|
|
2169
2174
|
}
|
|
@@ -2184,6 +2189,15 @@ function arrow(controller, event) {
|
|
|
2184
2189
|
const [move, direction] = ARROWS[event.key];
|
|
2185
2190
|
return move(controller, direction, event.shiftKey);
|
|
2186
2191
|
}
|
|
2192
|
+
var isMod = (controller, event) => controller.isMac ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;
|
|
2193
|
+
function documentEdge(controller, event) {
|
|
2194
|
+
const at = (controller.isMac ? ["ArrowUp", "ArrowDown"] : ["Home", "End"]).indexOf(event.key);
|
|
2195
|
+
if (at < 0 || !isMod(controller, event) || event.altKey) return false;
|
|
2196
|
+
const direction = at ? -1 : 1;
|
|
2197
|
+
const { selection } = controller.editor.state;
|
|
2198
|
+
const head = event.shiftKey && selection?.kind === "text" && neighbourHead(controller, null, direction);
|
|
2199
|
+
return head ? moveHead(controller, selection, head) : moveToNeighbour(controller, null, direction);
|
|
2200
|
+
}
|
|
2187
2201
|
function tab(controller, event) {
|
|
2188
2202
|
const { selection } = controller.editor.state;
|
|
2189
2203
|
if (selection === null || selection.kind === "blocks") return false;
|
|
@@ -2202,15 +2216,14 @@ function holdHistoryKeys(controller, event) {
|
|
|
2202
2216
|
return Object.hasOwn(ARROWS, event.key) && (event.metaKey || event.ctrlKey || event.altKey);
|
|
2203
2217
|
}
|
|
2204
2218
|
function flip(controller, event) {
|
|
2205
|
-
|
|
2206
|
-
if (event.key !== "Enter" || !mod || event.shiftKey || event.altKey) return false;
|
|
2219
|
+
if (event.key !== "Enter" || !isMod(controller, event) || event.shiftKey || event.altKey) return false;
|
|
2207
2220
|
flipSelectedBlock(controller);
|
|
2208
2221
|
return true;
|
|
2209
2222
|
}
|
|
2210
2223
|
function handle(controller, event) {
|
|
2211
2224
|
if (arrow(controller, event)) return true;
|
|
2212
2225
|
if (event.key === "Tab" && !event.ctrlKey && !event.metaKey && !event.altKey) return tab(controller, event);
|
|
2213
|
-
return runKeymap(controller, event) || flip(controller, event) || typeOverNode(controller, event) || holdHistoryKeys(controller, event);
|
|
2226
|
+
return runKeymap(controller, event) || flip(controller, event) || documentEdge(controller, event) || typeOverNode(controller, event) || holdHistoryKeys(controller, event);
|
|
2214
2227
|
}
|
|
2215
2228
|
function handleReaderKeydown(controller, event) {
|
|
2216
2229
|
if (flip(controller, event)) event.preventDefault();
|
|
@@ -2224,9 +2237,21 @@ function handleKeydown(controller, event) {
|
|
|
2224
2237
|
|
|
2225
2238
|
// src/view/input/attach-input.ts
|
|
2226
2239
|
function attachInput(controller, root) {
|
|
2227
|
-
const composition = createCompositionHandlers(controller);
|
|
2228
|
-
const sinkComposition = createSinkComposition(controller);
|
|
2229
2240
|
const fallback = createDomInputFallback(controller);
|
|
2241
|
+
const afterComposition = () => {
|
|
2242
|
+
const { editor } = controller;
|
|
2243
|
+
let { selection } = editor.state;
|
|
2244
|
+
const stop = editor.subscribe((_, tr) => {
|
|
2245
|
+
if (tr && selection) selection = chunk4F2IWBFM_cjs.mapSelection(selection, (pos, assoc) => tr.mapPos(pos, assoc));
|
|
2246
|
+
});
|
|
2247
|
+
fallback.flush();
|
|
2248
|
+
stop();
|
|
2249
|
+
if (selection && editor.state.selection !== selection) {
|
|
2250
|
+
controller.dispatch(editor.createTransaction().setSelection(selection));
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
const composition = createCompositionHandlers(controller, afterComposition);
|
|
2254
|
+
const sinkComposition = createSinkComposition(controller, afterComposition);
|
|
2230
2255
|
const observed = /* @__PURE__ */ new Map();
|
|
2231
2256
|
const inHost = (event) => controller.registry.locate(event.target) !== null;
|
|
2232
2257
|
const inSink = (event) => controller.sink !== null && event.target === controller.sink;
|
|
@@ -2374,7 +2399,7 @@ function bindRoot(controller, root, cross, committed) {
|
|
|
2374
2399
|
function movedSelection(controller, doc, model) {
|
|
2375
2400
|
if (controller.composingKey !== null || controller.dragging || !doc || !ownsFocus(controller, doc)) return null;
|
|
2376
2401
|
const selection = readSelection(controller.registry, doc.getSelection(), (node) => controller.blockAt(node));
|
|
2377
|
-
return selection === null ||
|
|
2402
|
+
return selection === null || chunk4F2IWBFM_cjs.sameSelection(selection, model) ? null : selection;
|
|
2378
2403
|
}
|
|
2379
2404
|
function writeModelSelection(controller, doc, moved, local) {
|
|
2380
2405
|
const domSelection = doc?.getSelection();
|
|
@@ -2432,7 +2457,7 @@ var ViewController = class {
|
|
|
2432
2457
|
});
|
|
2433
2458
|
this.#flush = options.flush ?? runNow;
|
|
2434
2459
|
this.onFiles = options.onFiles;
|
|
2435
|
-
this.isMac = options.isMac ??
|
|
2460
|
+
this.isMac = options.isMac ?? chunk4F2IWBFM_cjs.detectMac();
|
|
2436
2461
|
const decorationsOf = (block, region) => this.decorationsFor(block, region);
|
|
2437
2462
|
const drain = (element) => this.#binding?.input.drain(element);
|
|
2438
2463
|
this.#hosts = createHostRenderer(options.editor, options.render, decorationsOf, drain);
|
|
@@ -2585,7 +2610,7 @@ var ViewController = class {
|
|
|
2585
2610
|
focus(target) {
|
|
2586
2611
|
const { editor } = this;
|
|
2587
2612
|
const selection = focusTarget(editor.state, target);
|
|
2588
|
-
if (selection !== null && !
|
|
2613
|
+
if (selection !== null && !chunk4F2IWBFM_cjs.sameSelection(selection, editor.state.selection)) dispatchSelection(this, selection);
|
|
2589
2614
|
this.#takeFocus();
|
|
2590
2615
|
this.syncSelectionToDom();
|
|
2591
2616
|
}
|
|
@@ -2633,7 +2658,7 @@ function useQuoinEditor(options) {
|
|
|
2633
2658
|
const { blocks, readOnly = false } = options;
|
|
2634
2659
|
const callbacks = react.useRef(options);
|
|
2635
2660
|
const [controller] = react.useState(() => {
|
|
2636
|
-
const editor =
|
|
2661
|
+
const editor = chunk4F2IWBFM_cjs.createEditor({
|
|
2637
2662
|
blocks,
|
|
2638
2663
|
extensions: options.extensions,
|
|
2639
2664
|
onChange: (next) => callbacks.current.onChange(next),
|
|
@@ -2696,11 +2721,11 @@ function SelectionSink({ label = "Selected content", blockLabel }) {
|
|
|
2696
2721
|
}
|
|
2697
2722
|
);
|
|
2698
2723
|
}
|
|
2699
|
-
var headingPlaceholder = (_state, { type, attrs }) => type === "MARKDOWN" && attrs.kind === "heading" ? `Heading ${
|
|
2724
|
+
var headingPlaceholder = (_state, { type, attrs }) => type === "MARKDOWN" && attrs.kind === "heading" ? `Heading ${chunkWZA5S5EJ_cjs.headingLevel(attrs.level)}` : void 0;
|
|
2700
2725
|
var BlockPlaceholderContext = react.createContext(headingPlaceholder);
|
|
2701
2726
|
function regionPlaceholder(state, blockId, region, placeholderOf) {
|
|
2702
|
-
const block =
|
|
2703
|
-
return block !== void 0 &&
|
|
2727
|
+
const block = chunkWZA5S5EJ_cjs.blockById(state.doc, blockId);
|
|
2728
|
+
return block !== void 0 && chunk4F2IWBFM_cjs.primaryRegion(state.schema, block) === region ? placeholderOf(state, block) : void 0;
|
|
2704
2729
|
}
|
|
2705
2730
|
var samePainted = (a, b) => a.inline === b.inline && a.placeholder === b.placeholder && sameDecorations(a.decorations, b.decorations);
|
|
2706
2731
|
function EditableRegion({ block, region, label, id, placeholder, className }) {
|
|
@@ -2711,7 +2736,7 @@ function EditableRegion({ block, region, label, id, placeholder, className }) {
|
|
|
2711
2736
|
const select = react.useCallback(
|
|
2712
2737
|
(state) => {
|
|
2713
2738
|
const inline2 = regionInline(state, block, region);
|
|
2714
|
-
const empty = inline2 === void 0 ||
|
|
2739
|
+
const empty = inline2 === void 0 || chunkWZA5S5EJ_cjs.inlineLength(inline2) === 0;
|
|
2715
2740
|
return {
|
|
2716
2741
|
inline: inline2,
|
|
2717
2742
|
decorations: controller.decorationsFor(block, region),
|
|
@@ -2756,7 +2781,7 @@ var CalloutBlock = ({ block }) => {
|
|
|
2756
2781
|
// src/view/react/block-command.ts
|
|
2757
2782
|
function onBlock(id, command) {
|
|
2758
2783
|
return (state, dispatch) => {
|
|
2759
|
-
const { ok, tr } =
|
|
2784
|
+
const { ok, tr } = chunk4F2IWBFM_cjs.runCommands(state, [chunk4F2IWBFM_cjs.setSelection(chunk4F2IWBFM_cjs.blockRangeSelection(id)), command]);
|
|
2760
2785
|
if (!ok || tr === null) return false;
|
|
2761
2786
|
dispatch?.(tr.setSelection(state.selection));
|
|
2762
2787
|
return true;
|
|
@@ -2776,7 +2801,7 @@ function TaskCheckbox({ block, controller, label, labelledBy }) {
|
|
|
2776
2801
|
role: "checkbox",
|
|
2777
2802
|
"aria-checked": checked,
|
|
2778
2803
|
"aria-readonly": readOnly ? "true" : void 0,
|
|
2779
|
-
"aria-label":
|
|
2804
|
+
"aria-label": chunkWZA5S5EJ_cjs.firstNamed(label, "Task"),
|
|
2780
2805
|
"aria-labelledby": labelledBy,
|
|
2781
2806
|
className: "quoin-task-box",
|
|
2782
2807
|
contentEditable: false,
|
|
@@ -2807,7 +2832,7 @@ function numberDoc(doc) {
|
|
|
2807
2832
|
numbers[index] = run2.next++;
|
|
2808
2833
|
return;
|
|
2809
2834
|
}
|
|
2810
|
-
const start =
|
|
2835
|
+
const start = chunkWZA5S5EJ_cjs.orderedStart(block.attrs.start);
|
|
2811
2836
|
numbers[index] = start;
|
|
2812
2837
|
runs.push({ indent: block.indent, next: start + 1 });
|
|
2813
2838
|
});
|
|
@@ -2845,7 +2870,7 @@ var MarkdownBlock = (props) => {
|
|
|
2845
2870
|
const { block } = props;
|
|
2846
2871
|
switch (block.attrs.kind) {
|
|
2847
2872
|
case "heading": {
|
|
2848
|
-
const level =
|
|
2873
|
+
const level = chunkWZA5S5EJ_cjs.headingLevel(block.attrs.level);
|
|
2849
2874
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "heading", "aria-level": level, className: "quoin-heading", children: /* @__PURE__ */ jsxRuntime.jsx(TextRegion, { block, label: `Heading ${level}` }) });
|
|
2850
2875
|
}
|
|
2851
2876
|
case "bullet":
|
|
@@ -2959,7 +2984,7 @@ function covers(state, id, index) {
|
|
|
2959
2984
|
if (selection === null) return false;
|
|
2960
2985
|
if (selection.kind === "node") return selection.block === id;
|
|
2961
2986
|
if (selection.kind === "blocks") return within(state, index, [selection.anchor, selection.head]);
|
|
2962
|
-
if (!isCrossSelection(selection) ||
|
|
2987
|
+
if (!isCrossSelection(selection) || chunk4F2IWBFM_cjs.isTextFlow(schema, doc.blocks[index])) return false;
|
|
2963
2988
|
return within(state, index, [selection.anchor.block, selection.head.block]);
|
|
2964
2989
|
}
|
|
2965
2990
|
function blockStatus(state, id, choices = NO_CHOICES) {
|
|
@@ -3001,11 +3026,11 @@ var BlockShell = react.memo(function BlockShell2({ block, renderers }) {
|
|
|
3001
3026
|
"data-quoin-block": "",
|
|
3002
3027
|
"data-block-id": block.id,
|
|
3003
3028
|
"data-type": block.type,
|
|
3004
|
-
"data-kind":
|
|
3029
|
+
"data-kind": chunkWZA5S5EJ_cjs.optionalString(kind),
|
|
3005
3030
|
"data-indent": block.indent,
|
|
3006
|
-
"data-color":
|
|
3007
|
-
"data-bg":
|
|
3008
|
-
"data-align":
|
|
3031
|
+
"data-color": chunkWZA5S5EJ_cjs.paletteOrUndefined(color),
|
|
3032
|
+
"data-bg": chunkWZA5S5EJ_cjs.paletteOrUndefined(background),
|
|
3033
|
+
"data-align": chunkWZA5S5EJ_cjs.alignOrUndefined(align),
|
|
3009
3034
|
style: { "--quoin-indent": block.indent },
|
|
3010
3035
|
tabIndex: -1,
|
|
3011
3036
|
"data-selected": status === "selected" ? "true" : void 0,
|
|
@@ -3202,5 +3227,5 @@ exports.useToggleOpen = useToggleOpen;
|
|
|
3202
3227
|
exports.useViewController = useViewController;
|
|
3203
3228
|
exports.visibleBlockIndexes = visibleBlockIndexes;
|
|
3204
3229
|
exports.wholeState = wholeState;
|
|
3205
|
-
//# sourceMappingURL=chunk-
|
|
3206
|
-
//# sourceMappingURL=chunk-
|
|
3230
|
+
//# sourceMappingURL=chunk-NNDLIP2C.cjs.map
|
|
3231
|
+
//# sourceMappingURL=chunk-NNDLIP2C.cjs.map
|