@pixerate/editor 0.140.0 → 0.140.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +39 -31
- package/dist/agent/index.js +13 -5
- package/dist/bridge/cli.cjs +4 -3
- package/dist/bridge/cli.js +3 -2
- package/dist/bridge/index.cjs +4 -3
- package/dist/bridge/index.js +3 -2
- package/dist/chunk-2BSBFBOA.cjs +46 -0
- package/dist/{chunk-SWZTQWY7.js → chunk-2INPJDNY.js} +1 -1
- package/dist/{chunk-CCKP4XAN.cjs → chunk-34RQAGWI.cjs} +27 -7
- package/dist/{chunk-HXCBQ7A6.cjs → chunk-3AJMR7EG.cjs} +7 -4
- package/dist/{chunk-NKBUVQJW.cjs → chunk-5WOY52O6.cjs} +15 -15
- package/dist/{chunk-5G3KYRER.js → chunk-6GAYGQDC.js} +8 -7
- package/dist/{chunk-HZZXBTLB.js → chunk-6IN474P4.js} +25 -5
- package/dist/{chunk-HDCH35UM.cjs → chunk-AGCD3EHB.cjs} +7 -7
- package/dist/{chunk-6I63VZ45.js → chunk-CXXKJBQZ.js} +5 -1
- package/dist/{chunk-6NXVDJDR.cjs → chunk-G43MNQ4C.cjs} +5 -5
- package/dist/{chunk-ZAOOIJ6I.cjs → chunk-HDK3T2QS.cjs} +4 -1
- package/dist/chunk-HF5QZS7Z.js +46 -0
- package/dist/{chunk-S7I3RI5Z.cjs → chunk-HMGWFXEC.cjs} +27 -24
- package/dist/{chunk-RPW7YL3D.cjs → chunk-L434J57V.cjs} +8 -7
- package/dist/{chunk-UCRL6JEV.cjs → chunk-L5OWG2NA.cjs} +8 -3
- package/dist/{chunk-RWML7TWG.cjs → chunk-PUR6BZFA.cjs} +112 -111
- package/dist/{chunk-WBKLYLZE.js → chunk-RB62U6MS.js} +4 -1
- package/dist/{chunk-KIBEEN5K.js → chunk-UMS6YFA6.js} +1 -1
- package/dist/{chunk-4LGWAJDI.js → chunk-V5OOP74P.js} +5 -2
- package/dist/{chunk-UOJS6PUP.js → chunk-WBJ6BG4R.js} +23 -22
- package/dist/{chunk-WIYAOZZU.js → chunk-WHKNYFM2.js} +7 -2
- package/dist/{chunk-F652BKMS.cjs → chunk-YN6JKAUE.cjs} +6 -2
- package/dist/{chunk-YTGF4TJR.js → chunk-ZLZKGHSZ.js} +5 -2
- package/dist/{chunk-USU2FL3N.js → chunk-ZNHB5RG6.js} +1 -1
- package/dist/compare/index.cjs +4 -3
- package/dist/compare/index.js +3 -2
- package/dist/export/index.cjs +4 -3
- package/dist/export/index.js +3 -2
- package/dist/extensions/index.cjs +11 -8
- package/dist/extensions/index.d.cts +1 -0
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.js +10 -7
- package/dist/extensions/safe-merge-attributes.d.cts +10 -0
- package/dist/extensions/safe-merge-attributes.d.ts +10 -0
- package/dist/image-editor/index.cjs +4 -3
- package/dist/image-editor/index.js +2 -1
- package/dist/index.cjs +42 -29
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -9
- package/dist/persistence/index.cjs +3 -2
- package/dist/persistence/index.js +2 -1
- package/dist/serializers/index.cjs +5 -4
- package/dist/serializers/index.js +4 -3
- package/dist/tools/index.cjs +11 -3
- package/dist/tools/index.d.cts +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +10 -2
- package/dist/tools/safe-json.d.cts +27 -0
- package/dist/tools/safe-json.d.ts +27 -0
- package/package.json +28 -28
- /package/dist/{chunk-MCTQXUXR.js → chunk-K73HMKQP.js} +0 -0
- /package/dist/{chunk-R6DFK5OX.cjs → chunk-LACYURUW.cjs} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ var _chunkHLMF3E53cjs = require('./chunk-HLMF3E53.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkL434J57Vcjs = require('./chunk-L434J57V.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
|
|
@@ -46,20 +46,21 @@ var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
var
|
|
49
|
+
var _chunk3AJMR7EGcjs = require('./chunk-3AJMR7EG.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
var _chunkALNIFK5Gcjs = require('./chunk-ALNIFK5G.cjs');
|
|
@@ -438,7 +439,7 @@ var LoadingNode = _core.Node.create({
|
|
|
438
439
|
renderHTML({ HTMLAttributes }) {
|
|
439
440
|
return [
|
|
440
441
|
"span",
|
|
441
|
-
|
|
442
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, HTMLAttributes, {
|
|
442
443
|
"data-type": "loading",
|
|
443
444
|
class: "inline-flex items-center px-1.5 py-0.5 text-xs text-muted-foreground animate-pulse"
|
|
444
445
|
}),
|
|
@@ -1948,7 +1949,7 @@ var Comments = _core.Mark.create({
|
|
|
1948
1949
|
},
|
|
1949
1950
|
addStorage() {
|
|
1950
1951
|
return {
|
|
1951
|
-
store: _nullishCoalesce(this.options.store, () => ( new (0,
|
|
1952
|
+
store: _nullishCoalesce(this.options.store, () => ( new (0, _chunk34RQAGWIcjs.CommentStore)())),
|
|
1952
1953
|
// tiptap-markdown: comments are not part of the exported markdown.
|
|
1953
1954
|
markdown: { serialize: { open: "", close: "" }, parse: {} }
|
|
1954
1955
|
};
|
|
@@ -1966,7 +1967,7 @@ var Comments = _core.Mark.create({
|
|
|
1966
1967
|
return [{ tag: "span[data-comment-id]" }];
|
|
1967
1968
|
},
|
|
1968
1969
|
renderHTML({ HTMLAttributes }) {
|
|
1969
|
-
return ["span",
|
|
1970
|
+
return ["span", _chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
1970
1971
|
},
|
|
1971
1972
|
addCommands() {
|
|
1972
1973
|
const store = () => this.storage.store;
|
|
@@ -1975,7 +1976,7 @@ var Comments = _core.Mark.create({
|
|
|
1975
1976
|
const { from, to, empty } = state.selection;
|
|
1976
1977
|
if (empty) return false;
|
|
1977
1978
|
if (dispatch) {
|
|
1978
|
-
const id = _nullishCoalesce(options.id, () => (
|
|
1979
|
+
const id = _nullishCoalesce(options.id, () => ( _chunk34RQAGWIcjs.createReviewId.call(void 0, "comment")));
|
|
1979
1980
|
tr.addMark(from, to, this.type.create({ commentId: id }));
|
|
1980
1981
|
tr.setMeta(commentsPluginKey, "refresh");
|
|
1981
1982
|
store().createThread({
|
|
@@ -2116,10 +2117,10 @@ function getCommentAuthor(editor) {
|
|
|
2116
2117
|
// src/extensions/document-compare.ts
|
|
2117
2118
|
|
|
2118
2119
|
function trackChangesAuthor(state) {
|
|
2119
|
-
return _optionalChain([
|
|
2120
|
+
return _optionalChain([_chunk34RQAGWIcjs.trackChangesPluginKey, 'access', _75 => _75.getState, 'call', _76 => _76(state), 'optionalAccess', _77 => _77.author]);
|
|
2120
2121
|
}
|
|
2121
2122
|
function compareInEditor(editor, original, revised, options = {}) {
|
|
2122
|
-
return
|
|
2123
|
+
return _chunkHMGWFXECcjs.compareDocuments.call(void 0, original, revised, {
|
|
2123
2124
|
...options,
|
|
2124
2125
|
author: _nullishCoalesce(options.author, () => ( trackChangesAuthor(editor.state))),
|
|
2125
2126
|
schema: editor.schema
|
|
@@ -2129,7 +2130,7 @@ function applyDocumentComparison(editor, original, revised, options = {}) {
|
|
|
2129
2130
|
const result = compareInEditor(editor, original, revised, options);
|
|
2130
2131
|
const { state } = editor;
|
|
2131
2132
|
const tr = state.tr.replaceWith(0, state.doc.content.size, result.doc.content);
|
|
2132
|
-
tr.setMeta(
|
|
2133
|
+
tr.setMeta(_chunk34RQAGWIcjs.TRACK_CHANGES_SKIP_META, true);
|
|
2133
2134
|
editor.view.dispatch(tr);
|
|
2134
2135
|
return result;
|
|
2135
2136
|
}
|
|
@@ -2145,14 +2146,14 @@ var DocumentCompare = _core.Extension.create({
|
|
|
2145
2146
|
return {
|
|
2146
2147
|
setContentFromComparison: (original, revised, options = {}) => ({ state, tr, dispatch }) => {
|
|
2147
2148
|
const merged = { ...this.options.compare, ...options };
|
|
2148
|
-
const result =
|
|
2149
|
+
const result = _chunkHMGWFXECcjs.compareDocuments.call(void 0, original, revised, {
|
|
2149
2150
|
...merged,
|
|
2150
2151
|
author: _nullishCoalesce(merged.author, () => ( trackChangesAuthor(state))),
|
|
2151
2152
|
schema: state.schema
|
|
2152
2153
|
});
|
|
2153
2154
|
if (dispatch) {
|
|
2154
2155
|
tr.replaceWith(0, tr.doc.content.size, result.doc.content);
|
|
2155
|
-
tr.setMeta(
|
|
2156
|
+
tr.setMeta(_chunk34RQAGWIcjs.TRACK_CHANGES_SKIP_META, true);
|
|
2156
2157
|
this.storage.lastResult = result;
|
|
2157
2158
|
}
|
|
2158
2159
|
return true;
|
|
@@ -2484,10 +2485,10 @@ async function loadCharts(zip, Parser, root, rels, options) {
|
|
|
2484
2485
|
}
|
|
2485
2486
|
function chartBlockHtml(chart) {
|
|
2486
2487
|
const [head, ...rows] = _chunkUR37VCIRcjs.chartDataToTable.call(void 0, chart.spec);
|
|
2487
|
-
const cell = (v, tag) => `<${tag}><p>${
|
|
2488
|
+
const cell = (v, tag) => `<${tag}><p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, v === null || v === void 0 ? "" : String(v))}</p></${tag}>`;
|
|
2488
2489
|
const table = `<table><tbody><tr>${head.map((h) => cell(h, "th")).join("")}</tr>${rows.map((r) => `<tr>${r.map((v, i) => cell(v, i ? "td" : "th")).join("")}</tr>`).join("")}</tbody></table>`;
|
|
2489
|
-
const caption = `<p>${
|
|
2490
|
-
return `<div data-type="chart" data-chart-id="${
|
|
2490
|
+
const caption = `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, `[Chart: ${chart.title || "untitled"}]`)}</p>`;
|
|
2491
|
+
return `<div data-type="chart" data-chart-id="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, chart.id)}" data-chart="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, JSON.stringify(chart.spec))}">${caption}${table}</div>`;
|
|
2491
2492
|
}
|
|
2492
2493
|
async function loadImages(zip, root, rels, options) {
|
|
2493
2494
|
const images = /* @__PURE__ */ new Map();
|
|
@@ -2638,7 +2639,7 @@ function mapStyleIds(styles) {
|
|
|
2638
2639
|
if (!/^[A-Za-z]/.test(id)) id = `S${id}`;
|
|
2639
2640
|
let unique = id;
|
|
2640
2641
|
for (let n = 2; used.has(unique); n++) unique = `${id}${n}`;
|
|
2641
|
-
if (!
|
|
2642
|
+
if (!_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, unique)) return;
|
|
2642
2643
|
used.add(unique);
|
|
2643
2644
|
ids.set(fileId, unique);
|
|
2644
2645
|
});
|
|
@@ -2669,12 +2670,12 @@ function styleDefinitions(styles, ids) {
|
|
|
2669
2670
|
else if (style.outlineLevel !== void 0 && style.outlineLevel >= 0 && style.outlineLevel <= 5) {
|
|
2670
2671
|
definition.block = { type: "heading", attrs: { level: style.outlineLevel + 1 } };
|
|
2671
2672
|
} else if (id === "Code") definition.block = { type: "codeBlock" };
|
|
2672
|
-
else if (id ===
|
|
2673
|
+
else if (id === _chunkYN6JKAUEcjs.NORMAL_STYLE_ID) definition.block = { type: "paragraph" };
|
|
2673
2674
|
}
|
|
2674
2675
|
if (style.priority !== void 0) definition.priority = style.priority;
|
|
2675
2676
|
if (style.quick) definition.quick = true;
|
|
2676
2677
|
if (style.hidden) definition.hidden = true;
|
|
2677
|
-
const builtin =
|
|
2678
|
+
const builtin = _chunkYN6JKAUEcjs.DEFAULT_STYLES.find((s) => s.id === id && s.kind === kind);
|
|
2678
2679
|
if (builtin) {
|
|
2679
2680
|
definition.builtin = true;
|
|
2680
2681
|
definition.block ??= builtin.block;
|
|
@@ -2844,7 +2845,7 @@ function readComments(commentsXml, extendedXml, people) {
|
|
|
2844
2845
|
const threads = /* @__PURE__ */ new Map();
|
|
2845
2846
|
for (const entry of entries.values()) {
|
|
2846
2847
|
if (rootOf(entry) !== entry) continue;
|
|
2847
|
-
const id =
|
|
2848
|
+
const id = _chunk34RQAGWIcjs.createReviewId.call(void 0, "comment");
|
|
2848
2849
|
byFileId.set(entry.fileId, id);
|
|
2849
2850
|
threads.set(entry.fileId, {
|
|
2850
2851
|
id,
|
|
@@ -2864,7 +2865,7 @@ function readComments(commentsXml, extendedXml, people) {
|
|
|
2864
2865
|
if (!thread) continue;
|
|
2865
2866
|
byFileId.set(entry.fileId, thread.id);
|
|
2866
2867
|
const reply = {
|
|
2867
|
-
id:
|
|
2868
|
+
id: _chunk34RQAGWIcjs.createReviewId.call(void 0, "reply"),
|
|
2868
2869
|
author: entry.author,
|
|
2869
2870
|
body: entry.body,
|
|
2870
2871
|
createdAt: entry.createdAt
|
|
@@ -2895,7 +2896,7 @@ function applyMarker(el, ctx) {
|
|
|
2895
2896
|
const name = _nullishCoalesce(attr(el, "name"), () => ( `range-${id}`));
|
|
2896
2897
|
let moveId = ctx.moveIds.get(name);
|
|
2897
2898
|
if (!moveId) {
|
|
2898
|
-
moveId =
|
|
2899
|
+
moveId = _chunk34RQAGWIcjs.createReviewId.call(void 0, "move");
|
|
2899
2900
|
ctx.moveIds.set(name, moveId);
|
|
2900
2901
|
}
|
|
2901
2902
|
if (id !== void 0) {
|
|
@@ -2923,7 +2924,7 @@ var FORMAT_MARK_TYPES = [
|
|
|
2923
2924
|
var formatMarks = (f) => FORMAT_MARK_TYPES.filter(([key]) => f[key]).map(([, type]) => ({ type }));
|
|
2924
2925
|
var formatKey = (f) => `${f.b ? 1 : 0}${f.i ? 1 : 0}${f.u ? 1 : 0}${f.s ? 1 : 0}${f.sup ? 1 : 0}${f.sub ? 1 : 0}|${_nullishCoalesce(f.href, () => ( ""))}` + (f.rev ? `|${f.rev.kind}:${f.rev.changeId}:${_nullishCoalesce(f.rev.moveId, () => ( ""))}` : "") + (f.fmt ? `|f:${f.fmt.changeId}` : "") + (f.comments ? `|c:${f.comments.join(",")}` : "");
|
|
2925
2926
|
function changeAttrs(change) {
|
|
2926
|
-
return ` data-change-id="${
|
|
2927
|
+
return ` data-change-id="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, change.changeId)}" data-author-id="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, change.authorId)}" data-author-name="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, change.authorName)}" data-created-at="${change.createdAt}"`;
|
|
2927
2928
|
}
|
|
2928
2929
|
function wrapFormat(inner, f) {
|
|
2929
2930
|
let html = inner;
|
|
@@ -2934,15 +2935,15 @@ function wrapFormat(inner, f) {
|
|
|
2934
2935
|
if (f.i) html = `<em>${html}</em>`;
|
|
2935
2936
|
if (f.b) html = `<strong>${html}</strong>`;
|
|
2936
2937
|
if (f.fmt) {
|
|
2937
|
-
html = `<span data-change-type="format"${changeAttrs(f.fmt)} data-format-before="${
|
|
2938
|
+
html = `<span data-change-type="format"${changeAttrs(f.fmt)} data-format-before="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, JSON.stringify(f.fmt.before))}" data-format-after="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, JSON.stringify(f.fmt.after))}">${html}</span>`;
|
|
2938
2939
|
}
|
|
2939
2940
|
if (f.rev) {
|
|
2940
2941
|
const tag = f.rev.kind === "insertion" ? "ins" : "del";
|
|
2941
|
-
const move = f.rev.moveId ? ` data-move-id="${
|
|
2942
|
+
const move = f.rev.moveId ? ` data-move-id="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, f.rev.moveId)}"` : "";
|
|
2942
2943
|
html = `<${tag} data-change-type="${f.rev.kind}"${changeAttrs(f.rev)}${move}>${html}</${tag}>`;
|
|
2943
2944
|
}
|
|
2944
|
-
for (const id of [..._nullishCoalesce(f.comments, () => ( []))].reverse()) html = `<span data-comment-id="${
|
|
2945
|
-
if (f.href) html = `<a href="${
|
|
2945
|
+
for (const id of [..._nullishCoalesce(f.comments, () => ( []))].reverse()) html = `<span data-comment-id="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, id)}">${html}</span>`;
|
|
2946
|
+
if (f.href) html = `<a href="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, f.href)}">${html}</a>`;
|
|
2946
2947
|
return html;
|
|
2947
2948
|
}
|
|
2948
2949
|
function renderSegments(segments, code = false) {
|
|
@@ -2954,10 +2955,10 @@ function renderSegments(segments, code = false) {
|
|
|
2954
2955
|
let j = i;
|
|
2955
2956
|
for (; j < segments.length && formatKey(segments[j].format) === key; j++) {
|
|
2956
2957
|
const seg = segments[j];
|
|
2957
|
-
if (seg.kind === "text") inner +=
|
|
2958
|
+
if (seg.kind === "text") inner += _chunkG43MNQ4Ccjs.escapeHtml.call(void 0, seg.text);
|
|
2958
2959
|
else if (seg.kind === "br") inner += code ? "\n" : "<br>";
|
|
2959
|
-
else if (seg.kind === "img") inner += code ? "" : `<img src="${
|
|
2960
|
-
else if (seg.kind === "chart") inner += code ?
|
|
2960
|
+
else if (seg.kind === "img") inner += code ? "" : `<img src="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, seg.src)}" alt="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, seg.alt)}">`;
|
|
2961
|
+
else if (seg.kind === "chart") inner += code ? _chunkG43MNQ4Ccjs.escapeHtml.call(void 0, `[Chart: ${seg.chart.title || "untitled"}]`) : "";
|
|
2961
2962
|
else inner += `<sup>${seg.n}</sup>`;
|
|
2962
2963
|
}
|
|
2963
2964
|
const format = segments[i].format;
|
|
@@ -3027,7 +3028,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
3027
3028
|
changeId(key) {
|
|
3028
3029
|
const last = this.ctx.lastChange;
|
|
3029
3030
|
if (last && last.key === key && last.end === this.ctx.segmentCount) return last.changeId;
|
|
3030
|
-
return
|
|
3031
|
+
return _chunk34RQAGWIcjs.createReviewId.call(void 0, "change");
|
|
3031
3032
|
}
|
|
3032
3033
|
change(el, kind, extra = "") {
|
|
3033
3034
|
const author = authorOf(this.ctx, attr(el, "author"));
|
|
@@ -3043,7 +3044,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
3043
3044
|
if (el.localName === "moveFrom" || el.localName === "moveTo") {
|
|
3044
3045
|
const to = el.localName === "moveTo";
|
|
3045
3046
|
for (const range of this.ctx.moveRanges.values()) if (range.to === to) moveId = range.moveId;
|
|
3046
|
-
moveId ??=
|
|
3047
|
+
moveId ??= _chunk34RQAGWIcjs.createReviewId.call(void 0, "move");
|
|
3047
3048
|
}
|
|
3048
3049
|
const { info, key } = this.change(el, kind, _nullishCoalesce(moveId, () => ( "")));
|
|
3049
3050
|
return { rev: { ...info, kind, ...moveId ? { moveId } : {} }, key };
|
|
@@ -3294,17 +3295,17 @@ function blockChangeAttr(pPr, ctx) {
|
|
|
3294
3295
|
const oldOutline = attr(wChild(oldPPr, "outlineLvl"), "val");
|
|
3295
3296
|
const level = oldOutline !== void 0 ? Number(oldOutline) >= 0 && Number(oldOutline) <= 5 ? Number(oldOutline) + 1 : void 0 : styleHeadingLevel(ctx.styles, oldStyle);
|
|
3296
3297
|
const mappedStyle = oldStyle ? ctx.styleIds.get(oldStyle) : void 0;
|
|
3297
|
-
const previous = level !== void 0 ? { type: "heading", attrs: { level }, wrappers: [] } : specialStyle(ctx.styles, oldStyle) === "code" ? { type: "codeBlock", attrs: {}, wrappers: [] } : { type: "paragraph", attrs: mappedStyle && mappedStyle !==
|
|
3298
|
+
const previous = level !== void 0 ? { type: "heading", attrs: { level }, wrappers: [] } : specialStyle(ctx.styles, oldStyle) === "code" ? { type: "codeBlock", attrs: {}, wrappers: [] } : { type: "paragraph", attrs: mappedStyle && mappedStyle !== _chunkYN6JKAUEcjs.NORMAL_STYLE_ID ? { styleId: mappedStyle } : {}, wrappers: [] };
|
|
3298
3299
|
const author = authorOf(ctx, attr(change, "author"));
|
|
3299
3300
|
const record = {
|
|
3300
|
-
changeId:
|
|
3301
|
+
changeId: _chunk34RQAGWIcjs.createReviewId.call(void 0, "change"),
|
|
3301
3302
|
authorId: author.id,
|
|
3302
3303
|
authorName: author.name,
|
|
3303
3304
|
authorColor: null,
|
|
3304
3305
|
createdAt: dateOf(attr(change, "date")),
|
|
3305
3306
|
previous
|
|
3306
3307
|
};
|
|
3307
|
-
return ` data-block-change="${
|
|
3308
|
+
return ` data-block-change="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, JSON.stringify(record))}"`;
|
|
3308
3309
|
}
|
|
3309
3310
|
function renderBlocks(container, ctx, part, topLevel = false) {
|
|
3310
3311
|
let html = "";
|
|
@@ -3346,7 +3347,7 @@ function renderBlocks(container, ctx, part, topLevel = false) {
|
|
|
3346
3347
|
const task = list && !list.ordered ? renderer.takeTaskGlyph() : void 0;
|
|
3347
3348
|
const inner = renderer.html();
|
|
3348
3349
|
const mappedStyle = styleId ? ctx.styleIds.get(styleId) : void 0;
|
|
3349
|
-
const styleAttr = !heading && !list && mappedStyle && mappedStyle !==
|
|
3350
|
+
const styleAttr = !heading && !list && mappedStyle && mappedStyle !== _chunkYN6JKAUEcjs.NORMAL_STYLE_ID ? ` data-style="${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, mappedStyle)}"` : "";
|
|
3350
3351
|
const changeAttr = topLevel && !list && ctx.tracked === "marks" ? blockChangeAttr(pPr, ctx) : "";
|
|
3351
3352
|
const charts = renderer.charts.map(chartBlockHtml).join("");
|
|
3352
3353
|
const blockHtml = (charts && !inner && !heading ? "" : heading ? `<h${heading}${changeAttr}>${inner}</h${heading}>` : `<p${styleAttr}${changeAttr}>${inner}</p>`) + charts;
|
|
@@ -3522,13 +3523,13 @@ async function docxToDocumentImport(data, options = {}) {
|
|
|
3522
3523
|
}
|
|
3523
3524
|
html += `<hr><ol>${notesHtml}</ol>`;
|
|
3524
3525
|
}
|
|
3525
|
-
const sanitized =
|
|
3526
|
-
const result = { html: sanitized, text:
|
|
3526
|
+
const sanitized = _chunk3AJMR7EGcjs.sanitizeImportedHtml.call(void 0, html);
|
|
3527
|
+
const result = { html: sanitized, text: _chunkG43MNQ4Ccjs.htmlToPlainText.call(void 0, sanitized) };
|
|
3527
3528
|
if (threads.length) result.comments = { version: 1, threads };
|
|
3528
3529
|
if (ctx.charts.length) result.charts = ctx.charts;
|
|
3529
3530
|
if (useStyles) {
|
|
3530
3531
|
const definitions = styleDefinitions(styles, styleIds);
|
|
3531
|
-
if (definitions.length) result.styles =
|
|
3532
|
+
if (definitions.length) result.styles = _chunkYN6JKAUEcjs.createStyleRegistry.call(void 0, { styles: definitions });
|
|
3532
3533
|
}
|
|
3533
3534
|
return result;
|
|
3534
3535
|
}
|
|
@@ -3555,7 +3556,7 @@ var markdownImportAdapter = {
|
|
|
3555
3556
|
target: "document",
|
|
3556
3557
|
async import(_input, context) {
|
|
3557
3558
|
const text = await context.readText();
|
|
3558
|
-
return { html:
|
|
3559
|
+
return { html: _chunkG43MNQ4Ccjs.markdownToTipTapHtml.call(void 0, text), text };
|
|
3559
3560
|
}
|
|
3560
3561
|
};
|
|
3561
3562
|
var htmlImportAdapter = {
|
|
@@ -3565,8 +3566,8 @@ var htmlImportAdapter = {
|
|
|
3565
3566
|
extensions: [".html", ".htm", ".xhtml"],
|
|
3566
3567
|
target: "document",
|
|
3567
3568
|
async import(_input, context) {
|
|
3568
|
-
const html =
|
|
3569
|
-
return { html, text:
|
|
3569
|
+
const html = _chunk3AJMR7EGcjs.sanitizeImportedHtml.call(void 0, await context.readText());
|
|
3570
|
+
return { html, text: _chunkG43MNQ4Ccjs.htmlToPlainText.call(void 0, html) };
|
|
3570
3571
|
}
|
|
3571
3572
|
};
|
|
3572
3573
|
var plainTextImportAdapter = {
|
|
@@ -3577,7 +3578,7 @@ var plainTextImportAdapter = {
|
|
|
3577
3578
|
target: "document",
|
|
3578
3579
|
async import(_input, context) {
|
|
3579
3580
|
const text = (await context.readText()).replace(/\r\n?/g, "\n");
|
|
3580
|
-
return { html:
|
|
3581
|
+
return { html: _chunk3AJMR7EGcjs.plainTextToParagraphHtml.call(void 0, text), text };
|
|
3581
3582
|
}
|
|
3582
3583
|
};
|
|
3583
3584
|
var rtfImportAdapter = {
|
|
@@ -3587,8 +3588,8 @@ var rtfImportAdapter = {
|
|
|
3587
3588
|
extensions: [".rtf"],
|
|
3588
3589
|
target: "document",
|
|
3589
3590
|
async import(_input, context) {
|
|
3590
|
-
const text =
|
|
3591
|
-
return { html:
|
|
3591
|
+
const text = _chunk3AJMR7EGcjs.rtfToPlainText.call(void 0, await context.readText());
|
|
3592
|
+
return { html: _chunk3AJMR7EGcjs.plainTextToParagraphHtml.call(void 0, text), text };
|
|
3592
3593
|
}
|
|
3593
3594
|
};
|
|
3594
3595
|
var BUILT_IN_IMPORT_ADAPTERS = [
|
|
@@ -3642,16 +3643,16 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
3642
3643
|
if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
|
|
3643
3644
|
from = to = _state.Selection.near(state.doc.resolve(from)).from;
|
|
3644
3645
|
}
|
|
3645
|
-
if (htmlSlice &&
|
|
3646
|
+
if (htmlSlice && _chunkL434J57Vcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkL434J57Vcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
|
|
3646
3647
|
const tr2 = state.tr;
|
|
3647
|
-
const end2 =
|
|
3648
|
+
const end2 = _chunkL434J57Vcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
|
|
3648
3649
|
if (end2 !== null) {
|
|
3649
3650
|
if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
|
|
3650
3651
|
view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
3651
3652
|
return end2;
|
|
3652
3653
|
}
|
|
3653
3654
|
}
|
|
3654
|
-
const tr = htmlSlice ? state.tr.replaceRange(from, to, htmlSlice) : state.tr.replace(from, to,
|
|
3655
|
+
const tr = htmlSlice ? state.tr.replaceRange(from, to, htmlSlice) : state.tr.replace(from, to, _chunkG43MNQ4Ccjs.plainTextToSlice.call(void 0, content.text, state.schema));
|
|
3655
3656
|
const end = tr.mapping.map(to, 1);
|
|
3656
3657
|
view.dispatch(tr.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
3657
3658
|
return end;
|
|
@@ -3780,7 +3781,7 @@ var richClipboardPluginKey = new (0, _state.PluginKey)("richClipboard");
|
|
|
3780
3781
|
function writeRichClipboard(view, event, options = {}) {
|
|
3781
3782
|
const { state } = view;
|
|
3782
3783
|
if (state.selection.empty) return false;
|
|
3783
|
-
const data =
|
|
3784
|
+
const data = _chunk3AJMR7EGcjs.getClipboardData.call(void 0, event);
|
|
3784
3785
|
if (!data || typeof data.setData !== "function") return false;
|
|
3785
3786
|
const slice = state.selection.content();
|
|
3786
3787
|
const { dom, text } = view.serializeForClipboard(slice);
|
|
@@ -3788,7 +3789,7 @@ function writeRichClipboard(view, event, options = {}) {
|
|
|
3788
3789
|
_optionalChain([data, 'access', _146 => _146.clearData, 'optionalCall', _147 => _147()]);
|
|
3789
3790
|
data.setData("text/html", dom.innerHTML);
|
|
3790
3791
|
data.setData("text/plain", text);
|
|
3791
|
-
data.setData(_nullishCoalesce(options.mimeType, () => (
|
|
3792
|
+
data.setData(_nullishCoalesce(options.mimeType, () => ( _chunk3AJMR7EGcjs.PIXERATE_DOCUMENT_MIME)), _chunk3AJMR7EGcjs.serializeRichClipboardPayload.call(void 0, slice, state.schema));
|
|
3792
3793
|
if (options.cut && view.editable) {
|
|
3793
3794
|
view.dispatch(state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
3794
3795
|
}
|
|
@@ -3798,7 +3799,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3798
3799
|
name: "richClipboard",
|
|
3799
3800
|
addOptions() {
|
|
3800
3801
|
return {
|
|
3801
|
-
mimeType:
|
|
3802
|
+
mimeType: _chunk3AJMR7EGcjs.PIXERATE_DOCUMENT_MIME,
|
|
3802
3803
|
plainTextMode: false
|
|
3803
3804
|
};
|
|
3804
3805
|
},
|
|
@@ -3806,7 +3807,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3806
3807
|
return { plainTextMode: !!this.options.plainTextMode };
|
|
3807
3808
|
},
|
|
3808
3809
|
addProseMirrorPlugins() {
|
|
3809
|
-
const mimeType = _nullishCoalesce(this.options.mimeType, () => (
|
|
3810
|
+
const mimeType = _nullishCoalesce(this.options.mimeType, () => ( _chunk3AJMR7EGcjs.PIXERATE_DOCUMENT_MIME));
|
|
3810
3811
|
const storage = this.storage;
|
|
3811
3812
|
return [
|
|
3812
3813
|
new (0, _state.Plugin)({
|
|
@@ -3818,10 +3819,10 @@ var RichClipboard = _core.Extension.create({
|
|
|
3818
3819
|
},
|
|
3819
3820
|
handlePaste(view, event) {
|
|
3820
3821
|
if (storage.plainTextMode) return false;
|
|
3821
|
-
const slice =
|
|
3822
|
+
const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
|
|
3822
3823
|
if (!slice) return false;
|
|
3823
3824
|
event.preventDefault();
|
|
3824
|
-
if (
|
|
3825
|
+
if (_chunkL434J57Vcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
|
|
3825
3826
|
view.dispatch(
|
|
3826
3827
|
view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
|
|
3827
3828
|
);
|
|
@@ -4222,7 +4223,7 @@ function createOutlineStore(editor) {
|
|
|
4222
4223
|
if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
|
|
4223
4224
|
const headings = getOutline(editor);
|
|
4224
4225
|
const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _161 => _161(editor, headings), 'optionalAccess', _162 => _162.id]), () => ( null));
|
|
4225
|
-
const sameStructure =
|
|
4226
|
+
const sameStructure = _chunkL434J57Vcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
|
|
4226
4227
|
if (sameStructure && snapshot.activeId === activeId) return snapshot;
|
|
4227
4228
|
return {
|
|
4228
4229
|
headings: sameStructure ? snapshot.headings : headings,
|
|
@@ -4270,7 +4271,7 @@ function navigateToHeading(editor, heading, options = {}) {
|
|
|
4270
4271
|
editor.view.dispatch(tr);
|
|
4271
4272
|
editor.view.focus();
|
|
4272
4273
|
}
|
|
4273
|
-
|
|
4274
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
|
|
4274
4275
|
return true;
|
|
4275
4276
|
}
|
|
4276
4277
|
function assignHeadingIds(state, types, generateId) {
|
|
@@ -4295,11 +4296,11 @@ function assignHeadingIds(state, types, generateId) {
|
|
|
4295
4296
|
}
|
|
4296
4297
|
var Outline = _core.Extension.create({
|
|
4297
4298
|
name: "outline",
|
|
4298
|
-
priority:
|
|
4299
|
+
priority: _chunkL434J57Vcjs.STRUCTURE_PRIORITY,
|
|
4299
4300
|
addOptions() {
|
|
4300
4301
|
return {
|
|
4301
4302
|
types: ["heading"],
|
|
4302
|
-
generateId: () =>
|
|
4303
|
+
generateId: () => _chunkL434J57Vcjs.generateStructureId.call(void 0, "h"),
|
|
4303
4304
|
onUpdate: void 0
|
|
4304
4305
|
};
|
|
4305
4306
|
},
|
|
@@ -4332,14 +4333,14 @@ var Outline = _core.Extension.create({
|
|
|
4332
4333
|
tr.scrollIntoView();
|
|
4333
4334
|
_optionalChain([view, 'optionalAccess', _169 => _169.focus, 'optionalCall', _170 => _170()]);
|
|
4334
4335
|
}
|
|
4335
|
-
|
|
4336
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4336
4337
|
}
|
|
4337
4338
|
return true;
|
|
4338
4339
|
},
|
|
4339
4340
|
scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
|
|
4340
4341
|
const heading = findHeading(state, id);
|
|
4341
4342
|
if (!heading) return false;
|
|
4342
|
-
if (dispatch)
|
|
4343
|
+
if (dispatch) _chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4343
4344
|
return true;
|
|
4344
4345
|
}
|
|
4345
4346
|
};
|
|
@@ -4360,7 +4361,7 @@ var Outline = _core.Extension.create({
|
|
|
4360
4361
|
apply: (tr, prev, _oldState, newState) => {
|
|
4361
4362
|
if (!tr.docChanged) return prev;
|
|
4362
4363
|
const next = computeOutline(newState.doc, types);
|
|
4363
|
-
if (
|
|
4364
|
+
if (_chunkL434J57Vcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
|
|
4364
4365
|
storage.headings = next;
|
|
4365
4366
|
_optionalChain([onUpdate, 'call', _171 => _171(), 'optionalCall', _172 => _172(next)]);
|
|
4366
4367
|
return next;
|
|
@@ -4378,7 +4379,7 @@ var Outline = _core.Extension.create({
|
|
|
4378
4379
|
},
|
|
4379
4380
|
onBeforeCreate() {
|
|
4380
4381
|
const { types, generateId } = this.options;
|
|
4381
|
-
|
|
4382
|
+
_chunkL434J57Vcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
|
|
4382
4383
|
}
|
|
4383
4384
|
});
|
|
4384
4385
|
|
|
@@ -4548,7 +4549,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4548
4549
|
node.attrs.minLevel,
|
|
4549
4550
|
node.attrs.maxLevel
|
|
4550
4551
|
);
|
|
4551
|
-
if (!
|
|
4552
|
+
if (!_chunkL434J57Vcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
|
|
4552
4553
|
tr = _nullishCoalesce(tr, () => ( state.tr));
|
|
4553
4554
|
tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
|
|
4554
4555
|
}
|
|
@@ -4560,7 +4561,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4560
4561
|
}
|
|
4561
4562
|
var TableOfContents = _core.Node.create({
|
|
4562
4563
|
name: "tableOfContents",
|
|
4563
|
-
priority:
|
|
4564
|
+
priority: _chunkL434J57Vcjs.STRUCTURE_PRIORITY - 5,
|
|
4564
4565
|
group: "block",
|
|
4565
4566
|
atom: true,
|
|
4566
4567
|
selectable: true,
|
|
@@ -4625,7 +4626,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4625
4626
|
] : ["p", { class: "toc-empty" }, this.options.emptyText];
|
|
4626
4627
|
return [
|
|
4627
4628
|
"nav",
|
|
4628
|
-
|
|
4629
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
|
|
4629
4630
|
"data-type": "table-of-contents",
|
|
4630
4631
|
"aria-label": node.attrs.title || "Table of contents",
|
|
4631
4632
|
class: "pixerate-toc"
|
|
@@ -4671,7 +4672,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4671
4672
|
return [
|
|
4672
4673
|
new (0, _state.Plugin)({
|
|
4673
4674
|
key: tableOfContentsPluginKey,
|
|
4674
|
-
state:
|
|
4675
|
+
state: _chunkL434J57Vcjs.presenceStateSpec.call(void 0, [this.name]),
|
|
4675
4676
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4676
4677
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
4677
4678
|
if (!tableOfContentsPluginKey.getState(newState)) return null;
|
|
@@ -4695,7 +4696,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4695
4696
|
);
|
|
4696
4697
|
view.focus();
|
|
4697
4698
|
}
|
|
4698
|
-
|
|
4699
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, heading.pos);
|
|
4699
4700
|
return true;
|
|
4700
4701
|
}
|
|
4701
4702
|
}
|
|
@@ -4705,7 +4706,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4705
4706
|
},
|
|
4706
4707
|
onBeforeCreate() {
|
|
4707
4708
|
const { headingTypes } = this.options;
|
|
4708
|
-
|
|
4709
|
+
_chunkL434J57Vcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
|
|
4709
4710
|
}
|
|
4710
4711
|
});
|
|
4711
4712
|
|
|
@@ -4763,7 +4764,7 @@ function syncFootnotes(tr, options = {}) {
|
|
|
4763
4764
|
const listType = schema.nodes[LIST];
|
|
4764
4765
|
const itemType = schema.nodes[ITEM];
|
|
4765
4766
|
if (!listType || !itemType) return false;
|
|
4766
|
-
const generateId = _nullishCoalesce(options.generateId, () => ( (() =>
|
|
4767
|
+
const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkL434J57Vcjs.generateStructureId.call(void 0, "fn"))));
|
|
4767
4768
|
const refs = [];
|
|
4768
4769
|
const lists = [];
|
|
4769
4770
|
const existing = /* @__PURE__ */ new Map();
|
|
@@ -4847,7 +4848,7 @@ function findReferences(doc, id) {
|
|
|
4847
4848
|
}
|
|
4848
4849
|
var FootnoteReference = _core.Node.create({
|
|
4849
4850
|
name: REFERENCE,
|
|
4850
|
-
priority:
|
|
4851
|
+
priority: _chunkL434J57Vcjs.STRUCTURE_PRIORITY - 5,
|
|
4851
4852
|
group: "inline",
|
|
4852
4853
|
inline: true,
|
|
4853
4854
|
atom: true,
|
|
@@ -4855,7 +4856,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4855
4856
|
addOptions() {
|
|
4856
4857
|
return {
|
|
4857
4858
|
HTMLAttributes: {},
|
|
4858
|
-
generateId: () =>
|
|
4859
|
+
generateId: () => _chunkL434J57Vcjs.generateStructureId.call(void 0, "fn")
|
|
4859
4860
|
};
|
|
4860
4861
|
},
|
|
4861
4862
|
addAttributes() {
|
|
@@ -4879,7 +4880,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4879
4880
|
const id = node.attrs.id;
|
|
4880
4881
|
return [
|
|
4881
4882
|
"sup",
|
|
4882
|
-
|
|
4883
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
|
|
4883
4884
|
"data-type": "footnote-reference",
|
|
4884
4885
|
class: "pixerate-footnote-ref",
|
|
4885
4886
|
...id ? { id: `fnref-${id}` } : {}
|
|
@@ -4966,7 +4967,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4966
4967
|
_state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
|
|
4967
4968
|
);
|
|
4968
4969
|
tr.scrollIntoView();
|
|
4969
|
-
|
|
4970
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
|
|
4970
4971
|
}
|
|
4971
4972
|
return true;
|
|
4972
4973
|
},
|
|
@@ -4976,7 +4977,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4976
4977
|
if (dispatch) {
|
|
4977
4978
|
tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
|
|
4978
4979
|
tr.scrollIntoView();
|
|
4979
|
-
|
|
4980
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, ref.pos);
|
|
4980
4981
|
}
|
|
4981
4982
|
return true;
|
|
4982
4983
|
}
|
|
@@ -4988,7 +4989,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4988
4989
|
return [
|
|
4989
4990
|
new (0, _state.Plugin)({
|
|
4990
4991
|
key: footnotesPluginKey,
|
|
4991
|
-
state:
|
|
4992
|
+
state: _chunkL434J57Vcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
|
|
4992
4993
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4993
4994
|
if (!transactions.some((tr2) => tr2.docChanged)) return null;
|
|
4994
4995
|
if (!footnotesPluginKey.getState(newState)) return null;
|
|
@@ -5009,7 +5010,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
5009
5010
|
},
|
|
5010
5011
|
onBeforeCreate() {
|
|
5011
5012
|
const { generateId } = this.options;
|
|
5012
|
-
|
|
5013
|
+
_chunkL434J57Vcjs.syncInitialContent.call(void 0, this.editor, (state) => {
|
|
5013
5014
|
const tr = state.tr;
|
|
5014
5015
|
return syncFootnotes(tr, { generateId }) ? tr : null;
|
|
5015
5016
|
});
|
|
@@ -5028,7 +5029,7 @@ var Footnotes = _core.Node.create({
|
|
|
5028
5029
|
renderHTML({ HTMLAttributes }) {
|
|
5029
5030
|
return [
|
|
5030
5031
|
"section",
|
|
5031
|
-
|
|
5032
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, HTMLAttributes, {
|
|
5032
5033
|
"data-type": "footnotes",
|
|
5033
5034
|
class: "pixerate-footnotes",
|
|
5034
5035
|
role: "doc-endnotes"
|
|
@@ -5080,7 +5081,7 @@ var Footnote = _core.Node.create({
|
|
|
5080
5081
|
renderHTML({ HTMLAttributes }) {
|
|
5081
5082
|
return [
|
|
5082
5083
|
"li",
|
|
5083
|
-
|
|
5084
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, HTMLAttributes, {
|
|
5084
5085
|
"data-type": "footnote",
|
|
5085
5086
|
class: "pixerate-footnote"
|
|
5086
5087
|
}),
|
|
@@ -5149,7 +5150,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5149
5150
|
addOptions() {
|
|
5150
5151
|
return {
|
|
5151
5152
|
HTMLAttributes: {},
|
|
5152
|
-
generateId: () =>
|
|
5153
|
+
generateId: () => _chunkL434J57Vcjs.generateStructureId.call(void 0, "bm")
|
|
5153
5154
|
};
|
|
5154
5155
|
},
|
|
5155
5156
|
addAttributes() {
|
|
@@ -5172,7 +5173,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5172
5173
|
renderHTML({ HTMLAttributes }) {
|
|
5173
5174
|
return [
|
|
5174
5175
|
"span",
|
|
5175
|
-
|
|
5176
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
|
|
5176
5177
|
class: "pixerate-bookmark"
|
|
5177
5178
|
}),
|
|
5178
5179
|
0
|
|
@@ -5234,7 +5235,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5234
5235
|
tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
|
|
5235
5236
|
tr.scrollIntoView();
|
|
5236
5237
|
const domPos = state.doc.resolve(bookmark.from);
|
|
5237
|
-
|
|
5238
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
|
|
5238
5239
|
}
|
|
5239
5240
|
return true;
|
|
5240
5241
|
}
|
|
@@ -5299,7 +5300,7 @@ function syncCrossReferences(state, headingTypes) {
|
|
|
5299
5300
|
}
|
|
5300
5301
|
var CrossReference = _core.Node.create({
|
|
5301
5302
|
name: NAME,
|
|
5302
|
-
priority:
|
|
5303
|
+
priority: _chunkL434J57Vcjs.STRUCTURE_PRIORITY - 5,
|
|
5303
5304
|
group: "inline",
|
|
5304
5305
|
inline: true,
|
|
5305
5306
|
atom: true,
|
|
@@ -5347,7 +5348,7 @@ var CrossReference = _core.Node.create({
|
|
|
5347
5348
|
const href = !broken && targetType === "heading" && targetId ? { href: `#${targetId}` } : {};
|
|
5348
5349
|
return [
|
|
5349
5350
|
"a",
|
|
5350
|
-
|
|
5351
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, href, {
|
|
5351
5352
|
"data-type": "cross-reference",
|
|
5352
5353
|
class: broken ? "pixerate-cross-reference is-broken" : "pixerate-cross-reference"
|
|
5353
5354
|
}),
|
|
@@ -5401,7 +5402,7 @@ var CrossReference = _core.Node.create({
|
|
|
5401
5402
|
if (dispatch) {
|
|
5402
5403
|
tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
|
|
5403
5404
|
tr.scrollIntoView();
|
|
5404
|
-
|
|
5405
|
+
_chunkL434J57Vcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
|
|
5405
5406
|
}
|
|
5406
5407
|
return true;
|
|
5407
5408
|
}
|
|
@@ -5413,7 +5414,7 @@ var CrossReference = _core.Node.create({
|
|
|
5413
5414
|
return [
|
|
5414
5415
|
new (0, _state.Plugin)({
|
|
5415
5416
|
key: crossReferencePluginKey,
|
|
5416
|
-
state:
|
|
5417
|
+
state: _chunkL434J57Vcjs.presenceStateSpec.call(void 0, [NAME]),
|
|
5417
5418
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
5418
5419
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
5419
5420
|
if (!crossReferencePluginKey.getState(newState)) return null;
|
|
@@ -5432,7 +5433,7 @@ var CrossReference = _core.Node.create({
|
|
|
5432
5433
|
},
|
|
5433
5434
|
onBeforeCreate() {
|
|
5434
5435
|
const { headingTypes } = this.options;
|
|
5435
|
-
|
|
5436
|
+
_chunkL434J57Vcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
|
|
5436
5437
|
}
|
|
5437
5438
|
});
|
|
5438
5439
|
|
|
@@ -5687,7 +5688,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5687
5688
|
if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
|
|
5688
5689
|
if (dispatch) {
|
|
5689
5690
|
_history.closeHistory.call(void 0, tr);
|
|
5690
|
-
const [end] =
|
|
5691
|
+
const [end] = _chunkL434J57Vcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
|
|
5691
5692
|
tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
|
|
5692
5693
|
meta(tr, { type: "replaced", anchor: end, count: 1 });
|
|
5693
5694
|
}
|
|
@@ -5698,7 +5699,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5698
5699
|
if (!s || !s.active || !s.matches.length) return false;
|
|
5699
5700
|
if (dispatch) {
|
|
5700
5701
|
_history.closeHistory.call(void 0, tr);
|
|
5701
|
-
const ends =
|
|
5702
|
+
const ends = _chunkL434J57Vcjs.applyReplacements.call(void 0, tr, s.matches);
|
|
5702
5703
|
meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
|
|
5703
5704
|
}
|
|
5704
5705
|
return true;
|
|
@@ -5730,7 +5731,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5730
5731
|
if (!s.active || !s.query) {
|
|
5731
5732
|
return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
|
|
5732
5733
|
}
|
|
5733
|
-
const result =
|
|
5734
|
+
const result = _chunkL434J57Vcjs.searchDocument.call(void 0, doc, s.query, s.options, {
|
|
5734
5735
|
replacement: s.replacement,
|
|
5735
5736
|
clipboardText: safeClipboard(options.getClipboardText),
|
|
5736
5737
|
timeLimitMs: options.timeLimitMs,
|
|
@@ -6014,7 +6015,7 @@ var CharacterStyle = _core.Mark.create({
|
|
|
6014
6015
|
default: null,
|
|
6015
6016
|
parseHTML: (el) => {
|
|
6016
6017
|
const id = el.getAttribute("data-char-style");
|
|
6017
|
-
return
|
|
6018
|
+
return _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, id) ? id : null;
|
|
6018
6019
|
},
|
|
6019
6020
|
renderHTML: (attrs) => attrs[STYLE_ID_ATTRIBUTE] ? { "data-char-style": attrs[STYLE_ID_ATTRIBUTE] } : {}
|
|
6020
6021
|
}
|
|
@@ -6024,7 +6025,7 @@ var CharacterStyle = _core.Mark.create({
|
|
|
6024
6025
|
return [{ tag: "span[data-char-style]" }];
|
|
6025
6026
|
},
|
|
6026
6027
|
renderHTML({ HTMLAttributes }) {
|
|
6027
|
-
return ["span",
|
|
6028
|
+
return ["span", _chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, HTMLAttributes), 0];
|
|
6028
6029
|
}
|
|
6029
6030
|
});
|
|
6030
6031
|
var ParagraphStyles = _core.Extension.create({
|
|
@@ -6040,7 +6041,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6040
6041
|
};
|
|
6041
6042
|
},
|
|
6042
6043
|
addStorage() {
|
|
6043
|
-
return { registry: _nullishCoalesce(this.options.registry, () => (
|
|
6044
|
+
return { registry: _nullishCoalesce(this.options.registry, () => ( _chunkYN6JKAUEcjs.createStyleRegistry.call(void 0, ))) };
|
|
6044
6045
|
},
|
|
6045
6046
|
addExtensions() {
|
|
6046
6047
|
return [CharacterStyle];
|
|
@@ -6055,11 +6056,11 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6055
6056
|
keepOnSplit: true,
|
|
6056
6057
|
parseHTML: (el) => {
|
|
6057
6058
|
const id = el.getAttribute("data-style");
|
|
6058
|
-
return
|
|
6059
|
+
return _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, id) ? id : null;
|
|
6059
6060
|
},
|
|
6060
6061
|
renderHTML: (attrs) => {
|
|
6061
6062
|
const id = attrs[STYLE_ID_ATTRIBUTE];
|
|
6062
|
-
return
|
|
6063
|
+
return _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, id) ? { "data-style": id, class: `pixerate-style-${id}` } : {};
|
|
6063
6064
|
}
|
|
6064
6065
|
}
|
|
6065
6066
|
}
|
|
@@ -6086,7 +6087,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6086
6087
|
if (dispatch) setParagraphStyle(tr, state, id, reg);
|
|
6087
6088
|
return true;
|
|
6088
6089
|
},
|
|
6089
|
-
clearParagraphStyle: () => ({ commands }) => commands.setParagraphStyle(
|
|
6090
|
+
clearParagraphStyle: () => ({ commands }) => commands.setParagraphStyle(_chunkYN6JKAUEcjs.NORMAL_STYLE_ID),
|
|
6090
6091
|
setCharacterStyle: (id) => ({ commands }) => {
|
|
6091
6092
|
if (_optionalChain([registry, 'call', _213 => _213(), 'access', _214 => _214.get, 'call', _215 => _215(id), 'optionalAccess', _216 => _216.kind]) !== "character") return false;
|
|
6092
6093
|
return commands.setMark(CHARACTER_STYLE_MARK_NAME, { [STYLE_ID_ATTRIBUTE]: id });
|
|
@@ -6108,7 +6109,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6108
6109
|
const trimmed = name.trim();
|
|
6109
6110
|
if (!trimmed) return false;
|
|
6110
6111
|
const id = _nullishCoalesce(options.id, () => ( reg.newId(trimmed)));
|
|
6111
|
-
if (!
|
|
6112
|
+
if (!_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, id) || reg.get(id)) return false;
|
|
6112
6113
|
const basedOn = options.basedOn === void 0 ? getParagraphStyleAt(state, reg) : options.basedOn;
|
|
6113
6114
|
if (dispatch) {
|
|
6114
6115
|
const captured = captureSelectionFormat(state);
|
|
@@ -6116,7 +6117,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6116
6117
|
id,
|
|
6117
6118
|
name: trimmed,
|
|
6118
6119
|
kind: "paragraph",
|
|
6119
|
-
basedOn: _nullishCoalesce(basedOn, () => (
|
|
6120
|
+
basedOn: _nullishCoalesce(basedOn, () => ( _chunkYN6JKAUEcjs.NORMAL_STYLE_ID)),
|
|
6120
6121
|
paragraph: captured.paragraph,
|
|
6121
6122
|
character: captured.character,
|
|
6122
6123
|
priority: 50,
|
|
@@ -6317,7 +6318,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6317
6318
|
})
|
|
6318
6319
|
];
|
|
6319
6320
|
if (options.table !== false) {
|
|
6320
|
-
extensions2.push(...
|
|
6321
|
+
extensions2.push(..._chunkL434J57Vcjs.createTableExtensions.call(void 0, optionObject(options.table)));
|
|
6321
6322
|
}
|
|
6322
6323
|
if (characterLimit) {
|
|
6323
6324
|
extensions2.push(
|
|
@@ -6379,7 +6380,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6379
6380
|
}
|
|
6380
6381
|
if (options.trackChanges) {
|
|
6381
6382
|
extensions2.push(
|
|
6382
|
-
typeof options.trackChanges === "object" ?
|
|
6383
|
+
typeof options.trackChanges === "object" ? _chunk34RQAGWIcjs.TrackChanges.configure(options.trackChanges) : _chunk34RQAGWIcjs.TrackChanges,
|
|
6383
6384
|
DocumentCompare
|
|
6384
6385
|
);
|
|
6385
6386
|
}
|
|
@@ -6424,8 +6425,8 @@ function createRichTextPreset(options = {}) {
|
|
|
6424
6425
|
}
|
|
6425
6426
|
if (options.chart) {
|
|
6426
6427
|
const { sparkline = true, ...chartOptions } = optionObject(options.chart);
|
|
6427
|
-
extensions2.push(
|
|
6428
|
-
if (sparkline) extensions2.push(
|
|
6428
|
+
extensions2.push(_chunkL434J57Vcjs.Chart.configure(chartOptions));
|
|
6429
|
+
if (sparkline) extensions2.push(_chunkL434J57Vcjs.Sparkline.configure(optionObject(sparkline)));
|
|
6429
6430
|
}
|
|
6430
6431
|
if (options.paragraphStyles) {
|
|
6431
6432
|
extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
|
|
@@ -6566,7 +6567,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6566
6567
|
];
|
|
6567
6568
|
}
|
|
6568
6569
|
function validateFindPattern(query, options = {}) {
|
|
6569
|
-
const result =
|
|
6570
|
+
const result = _chunkL434J57Vcjs.compileFindPattern.call(void 0, query, options);
|
|
6570
6571
|
return result.ok ? null : result.error;
|
|
6571
6572
|
}
|
|
6572
6573
|
|
|
@@ -6575,8 +6576,8 @@ var PARAMS = {
|
|
|
6575
6576
|
insertTable: {
|
|
6576
6577
|
type: "object",
|
|
6577
6578
|
properties: {
|
|
6578
|
-
rows: { type: "integer", minimum: 1, maximum:
|
|
6579
|
-
cols: { type: "integer", minimum: 1, maximum:
|
|
6579
|
+
rows: { type: "integer", minimum: 1, maximum: _chunkL434J57Vcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
|
|
6580
|
+
cols: { type: "integer", minimum: 1, maximum: _chunkL434J57Vcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
|
|
6580
6581
|
withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
|
|
6581
6582
|
},
|
|
6582
6583
|
additionalProperties: false
|
|
@@ -6607,7 +6608,7 @@ function createTableCommands(editor, options = {}) {
|
|
|
6607
6608
|
const group = _nullishCoalesce(options.group, () => ( "Table"));
|
|
6608
6609
|
const scope = options.scope ? { scope: options.scope } : {};
|
|
6609
6610
|
const focus = _nullishCoalesce(options.focus, () => ( true));
|
|
6610
|
-
return
|
|
6611
|
+
return _chunkL434J57Vcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
|
|
6611
6612
|
const params = PARAMS[action];
|
|
6612
6613
|
return {
|
|
6613
6614
|
id: `${prefix}${action}`,
|
|
@@ -6617,13 +6618,13 @@ function createTableCommands(editor, options = {}) {
|
|
|
6617
6618
|
description,
|
|
6618
6619
|
...params ? { params } : {},
|
|
6619
6620
|
...scope,
|
|
6620
|
-
enabled: (_ctx, p) =>
|
|
6621
|
+
enabled: (_ctx, p) => _chunkL434J57Vcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
|
|
6621
6622
|
run: (_ctx, p) => {
|
|
6622
|
-
if (!
|
|
6623
|
-
const reason =
|
|
6623
|
+
if (!_chunkL434J57Vcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
|
|
6624
|
+
const reason = _chunkL434J57Vcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
|
|
6624
6625
|
throw new Error(reason === true ? `${label} did not change the document.` : reason);
|
|
6625
6626
|
}
|
|
6626
|
-
const state =
|
|
6627
|
+
const state = _chunkL434J57Vcjs.getTableState.call(void 0, editor);
|
|
6627
6628
|
return {
|
|
6628
6629
|
done: true,
|
|
6629
6630
|
table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
|