@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
package/dist/agent/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ var _chunkGLQQ2VILcjs = require('../chunk-GLQQ2VIL.cjs');
|
|
|
12
12
|
|
|
13
13
|
var _chunkMRD3NXKRcjs = require('../chunk-MRD3NXKR.cjs');
|
|
14
14
|
require('../chunk-4EFNS2HV.cjs');
|
|
15
|
-
require('../chunk-
|
|
15
|
+
require('../chunk-LACYURUW.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -38,7 +38,7 @@ require('../chunk-R6DFK5OX.cjs');
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunkHDK3T2QScjs = require('../chunk-HDK3T2QS.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -96,7 +96,7 @@ var _chunkN2FGYZ4Qcjs = require('../chunk-N2FGYZ4Q.cjs');
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
var
|
|
99
|
+
var _chunkL434J57Vcjs = require('../chunk-L434J57V.cjs');
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
var _chunkXQ33O5BCcjs = require('../chunk-XQ33O5BC.cjs');
|
|
@@ -108,9 +108,14 @@ var _chunkUR37VCIRcjs = require('../chunk-UR37VCIR.cjs');
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
var
|
|
111
|
+
var _chunkG43MNQ4Ccjs = require('../chunk-G43MNQ4C.cjs');
|
|
112
112
|
require('../chunk-JG5VGCKP.cjs');
|
|
113
|
-
require('../chunk-
|
|
113
|
+
require('../chunk-34RQAGWI.cjs');
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
var _chunk2BSBFBOAcjs = require('../chunk-2BSBFBOA.cjs');
|
|
114
119
|
|
|
115
120
|
|
|
116
121
|
|
|
@@ -507,7 +512,7 @@ function describe(chart, includeSpec) {
|
|
|
507
512
|
function sparklines(doc) {
|
|
508
513
|
const found = [];
|
|
509
514
|
doc.descendants((node, pos) => {
|
|
510
|
-
if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label:
|
|
515
|
+
if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkL434J57Vcjs.sparklineLabel.call(void 0, node) });
|
|
511
516
|
});
|
|
512
517
|
return found;
|
|
513
518
|
}
|
|
@@ -518,7 +523,7 @@ function checkPosition(editor, at) {
|
|
|
518
523
|
function createDocumentChartTools(editor) {
|
|
519
524
|
const chartType = () => editor().schema.nodes.chart;
|
|
520
525
|
const findChart = (args) => {
|
|
521
|
-
const charts =
|
|
526
|
+
const charts = _chunkL434J57Vcjs.getDocumentCharts.call(void 0, editor().state.doc);
|
|
522
527
|
const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
|
|
523
528
|
if (args.chartId !== void 0) {
|
|
524
529
|
const chart = charts.find((c) => c.id === args.chartId);
|
|
@@ -545,7 +550,7 @@ function createDocumentChartTools(editor) {
|
|
|
545
550
|
annotations: { title: "List charts in the document", ...READ },
|
|
546
551
|
handler: ({ includeSpec = false }) => {
|
|
547
552
|
const doc = editor().state.doc;
|
|
548
|
-
return { charts:
|
|
553
|
+
return { charts: _chunkL434J57Vcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
|
|
549
554
|
}
|
|
550
555
|
};
|
|
551
556
|
const insertChart = {
|
|
@@ -572,7 +577,7 @@ function createDocumentChartTools(editor) {
|
|
|
572
577
|
const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
|
|
573
578
|
const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
|
|
574
579
|
const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
|
|
575
|
-
const chart =
|
|
580
|
+
const chart = _chunkL434J57Vcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
|
|
576
581
|
if (!ok || !chart) throw new Error(`A chart cannot go at ${_nullishCoalesce(at, () => ( ed.state.selection.from))}; pass a position between blocks or inside a paragraph.`);
|
|
577
582
|
return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
|
|
578
583
|
}
|
|
@@ -619,8 +624,8 @@ function createDocumentChartTools(editor) {
|
|
|
619
624
|
inputSchema: {
|
|
620
625
|
type: "object",
|
|
621
626
|
properties: {
|
|
622
|
-
values: { type: "array", items: _chunkFLUTRPLYcjs.VALUE, minItems: 1, maxItems:
|
|
623
|
-
kind: { type: "string", enum: [...
|
|
627
|
+
values: { type: "array", items: _chunkFLUTRPLYcjs.VALUE, minItems: 1, maxItems: _chunkL434J57Vcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
|
|
628
|
+
kind: { type: "string", enum: [..._chunkL434J57Vcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
|
|
624
629
|
at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
|
|
625
630
|
width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
|
|
626
631
|
height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
|
|
@@ -639,7 +644,7 @@ function createDocumentChartTools(editor) {
|
|
|
639
644
|
if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
|
|
640
645
|
const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
|
|
641
646
|
if (!ed.state.doc.resolve(pos).parent.inlineContent) throw new Error(`Position ${pos} is between blocks; a sparkline goes inside a paragraph (use a position from get_text {blocks: true}).`);
|
|
642
|
-
const stored =
|
|
647
|
+
const stored = _chunkL434J57Vcjs.normalizeSparklineValues.call(void 0, parsed);
|
|
643
648
|
ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
|
|
644
649
|
return { pos, kind, values: stored };
|
|
645
650
|
}
|
|
@@ -977,8 +982,8 @@ function createTextPresence(editor, providerId, option) {
|
|
|
977
982
|
const config = option === false ? null : option === true || option === void 0 ? {} : option;
|
|
978
983
|
const caret = {
|
|
979
984
|
id: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _34 => _34.id]), () => ( providerId)),
|
|
980
|
-
name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _35 => _35.name]), () => (
|
|
981
|
-
color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _36 => _36.color]), () => (
|
|
985
|
+
name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _35 => _35.name]), () => ( _chunkL434J57Vcjs.DEFAULT_AGENT_CARET_NAME)),
|
|
986
|
+
color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _36 => _36.color]), () => ( _chunkL434J57Vcjs.DEFAULT_AGENT_CARET_COLOR))
|
|
982
987
|
};
|
|
983
988
|
const typing = !_optionalChain([config, 'optionalAccess', _37 => _37.typing]) ? null : config.typing === true ? {} : config.typing;
|
|
984
989
|
const idleMs = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _38 => _38.idleMs]), () => ( 12e3));
|
|
@@ -991,19 +996,19 @@ function createTextPresence(editor, providerId, option) {
|
|
|
991
996
|
};
|
|
992
997
|
const touch = () => {
|
|
993
998
|
clearTimeout(idleTimer);
|
|
994
|
-
if (idleMs > 0) idleTimer = setTimeout(() => live() &&
|
|
999
|
+
if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkL434J57Vcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
|
|
995
1000
|
};
|
|
996
1001
|
const tint = (ed, ranges) => {
|
|
997
1002
|
clearTimeout(tintTimer);
|
|
998
|
-
|
|
999
|
-
if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() &&
|
|
1003
|
+
_chunkL434J57Vcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
|
|
1004
|
+
if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkL434J57Vcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
|
|
1000
1005
|
};
|
|
1001
1006
|
return {
|
|
1002
1007
|
/** Puts the caret at `head`, selecting from `anchor`. */
|
|
1003
1008
|
show(anchor, head = anchor) {
|
|
1004
1009
|
const ed = live();
|
|
1005
1010
|
if (!ed) return;
|
|
1006
|
-
|
|
1011
|
+
_chunkL434J57Vcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
|
|
1007
1012
|
touch();
|
|
1008
1013
|
},
|
|
1009
1014
|
/** Shows the caret after ranges just changed by a tool, tinting them. */
|
|
@@ -1011,7 +1016,7 @@ function createTextPresence(editor, providerId, option) {
|
|
|
1011
1016
|
const ed = live();
|
|
1012
1017
|
if (!ed || !ranges.length) return;
|
|
1013
1018
|
const last = ranges[ranges.length - 1];
|
|
1014
|
-
|
|
1019
|
+
_chunkL434J57Vcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
|
|
1015
1020
|
tint(ed, ranges);
|
|
1016
1021
|
touch();
|
|
1017
1022
|
},
|
|
@@ -1019,12 +1024,12 @@ function createTextPresence(editor, providerId, option) {
|
|
|
1019
1024
|
async write(ed, from, to, text, signal) {
|
|
1020
1025
|
if (live() && typing) {
|
|
1021
1026
|
clearTimeout(tintTimer);
|
|
1022
|
-
const range2 = await
|
|
1023
|
-
if (changedMs > 0) tintTimer = setTimeout(() => live() &&
|
|
1027
|
+
const range2 = await _chunkL434J57Vcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
|
|
1028
|
+
if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkL434J57Vcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
|
|
1024
1029
|
touch();
|
|
1025
1030
|
return range2;
|
|
1026
1031
|
}
|
|
1027
|
-
const tr = _history.closeHistory.call(void 0,
|
|
1032
|
+
const tr = _history.closeHistory.call(void 0, _chunkL434J57Vcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text));
|
|
1028
1033
|
const end = tr.mapping.map(to, 1);
|
|
1029
1034
|
const range = { from: Math.min(tr.mapping.map(from, -1), end), to: end };
|
|
1030
1035
|
ed.view.dispatch(tr.scrollIntoView());
|
|
@@ -1053,7 +1058,7 @@ function findMatches(editor, query, args, replacement) {
|
|
|
1053
1058
|
wholeWord: !!args.wholeWord,
|
|
1054
1059
|
...args.regex ? { regex: true } : { literal: true }
|
|
1055
1060
|
};
|
|
1056
|
-
const result =
|
|
1061
|
+
const result = _chunkL434J57Vcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
|
|
1057
1062
|
if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
|
|
1058
1063
|
return { matches: result.matches, truncated: result.truncated };
|
|
1059
1064
|
}
|
|
@@ -1090,7 +1095,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1090
1095
|
},
|
|
1091
1096
|
handler: ({ format = "text", blocks = false }) => {
|
|
1092
1097
|
const ed = editor();
|
|
1093
|
-
const content = format === "html" ? ed.getHTML() : format === "markdown" ?
|
|
1098
|
+
const content = format === "html" ? ed.getHTML() : format === "markdown" ? _chunkG43MNQ4Ccjs.getEditorMarkdown.call(void 0, ed) : _chunkG43MNQ4Ccjs.getEditorText.call(void 0, ed);
|
|
1094
1099
|
return {
|
|
1095
1100
|
format,
|
|
1096
1101
|
content,
|
|
@@ -1208,7 +1213,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1208
1213
|
replacement: String(replace).replace(/\r\n?|\n/g, "\r")
|
|
1209
1214
|
}));
|
|
1210
1215
|
const tr = _history.closeHistory.call(void 0, ed.state.tr);
|
|
1211
|
-
const ends =
|
|
1216
|
+
const ends = _chunkL434J57Vcjs.applyReplacements.call(void 0, tr, chosen);
|
|
1212
1217
|
ed.view.dispatch(tr.scrollIntoView());
|
|
1213
1218
|
const ranges = chosen.map((m, i) => ({ from: tr.mapping.map(m.from, -1), to: ends[i] }));
|
|
1214
1219
|
presence.changed(ranges.filter((r) => r.from < r.to));
|
|
@@ -1309,7 +1314,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1309
1314
|
inputSchema: {
|
|
1310
1315
|
type: "object",
|
|
1311
1316
|
properties: {
|
|
1312
|
-
operation: { type: "string", enum:
|
|
1317
|
+
operation: { type: "string", enum: _chunkL434J57Vcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
|
|
1313
1318
|
at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
|
|
1314
1319
|
rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
|
|
1315
1320
|
cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
|
|
@@ -1339,10 +1344,10 @@ function createRichTextToolProvider(target, options) {
|
|
|
1339
1344
|
ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
|
|
1340
1345
|
}
|
|
1341
1346
|
const action = operation;
|
|
1342
|
-
const state =
|
|
1347
|
+
const state = _chunkL434J57Vcjs.getTableActionState.call(void 0, ed, action, params);
|
|
1343
1348
|
if (state !== true) throw new Error(state);
|
|
1344
|
-
|
|
1345
|
-
const table =
|
|
1349
|
+
_chunkL434J57Vcjs.runTableAction.call(void 0, ed, action, params);
|
|
1350
|
+
const table = _chunkL434J57Vcjs.getTableState.call(void 0, ed);
|
|
1346
1351
|
return {
|
|
1347
1352
|
operation,
|
|
1348
1353
|
table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
|
|
@@ -1361,7 +1366,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1361
1366
|
if (!ed || ed.isDestroyed) return [];
|
|
1362
1367
|
if (!ed.isEditable) return [getText, findText, ...charts.read()];
|
|
1363
1368
|
const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection, ...formatting.tools(ed)];
|
|
1364
|
-
return [...tools, ...
|
|
1369
|
+
return [...tools, ..._chunkL434J57Vcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write()];
|
|
1365
1370
|
},
|
|
1366
1371
|
subscribe: (notify) => {
|
|
1367
1372
|
const ed = editor();
|
|
@@ -2057,4 +2062,7 @@ function createCanvasComponentToolProvider(controller, options = { id: "canvas-c
|
|
|
2057
2062
|
|
|
2058
2063
|
|
|
2059
2064
|
|
|
2060
|
-
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
exports.CAPTURE_EXCLUDE_SELECTOR = _chunkSVFEVKLFcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkSVFEVKLFcjs.CAPTURE_OVERLAY_SELECTORS; exports.EDITOR_CANVAS_TOOLS = _chunkSVFEVKLFcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkSVFEVKLFcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkSVFEVKLFcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkSVFEVKLFcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkSVFEVKLFcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkHDK3T2QScjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkHDK3T2QScjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkSVFEVKLFcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkSVFEVKLFcjs.MCP_TOOL_VIEW_EDITOR; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkHDK3T2QScjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_DISCOVERY_TOOLS = _chunkHDK3T2QScjs.TOOL_DISCOVERY_TOOLS; exports.TOOL_NAMESPACE_SEPARATOR = _chunkHDK3T2QScjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkHDK3T2QScjs.ToolRegistry; exports.ToolRegistryError = _chunkHDK3T2QScjs.ToolRegistryError; exports.ToolRegistryView = _chunkHDK3T2QScjs.ToolRegistryView; exports.UNSAFE_JSON_KEYS = _chunk2BSBFBOAcjs.UNSAFE_JSON_KEYS; exports.baseToolName = _chunkHDK3T2QScjs.baseToolName; exports.captureInputSchema = _chunkN2FGYZ4Qcjs.captureInputSchema; exports.captureOutputSize = _chunkN2FGYZ4Qcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkSVFEVKLFcjs.cloneElementWithStyles; exports.connectToolBridge = _chunkHDK3T2QScjs.connectToolBridge; exports.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createDocumentChartTools = createDocumentChartTools; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createMcpServer = _chunkHDK3T2QScjs.createMcpServer; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; exports.createToolRegistry = _chunkHDK3T2QScjs.createToolRegistry; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunkHDK3T2QScjs.errorResult; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkills = _chunkHDK3T2QScjs.listSkills; exports.normalizeSide = normalizeSide; exports.parseSkillFrontmatter = _chunkHDK3T2QScjs.parseSkillFrontmatter; exports.planAgentCommand = planAgentCommand; exports.planToolCall = planToolCall; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunkHDK3T2QScjs.readSkillFile; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.searchTokens = _chunkHDK3T2QScjs.searchTokens; exports.searchTools = _chunkHDK3T2QScjs.searchTools; exports.stripPrototypeKeys = _chunk2BSBFBOAcjs.stripPrototypeKeys; exports.summarize = _chunkHDK3T2QScjs.summarize; exports.toCapturedImageData = _chunkN2FGYZ4Qcjs.toCapturedImageData; exports.toToolResult = _chunkHDK3T2QScjs.toToolResult; exports.toolCallToAgentCommand = toolCallToAgentCommand; exports.toolsetInstructions = _chunkHDK3T2QScjs.toolsetInstructions; exports.toolsetName = _chunkHDK3T2QScjs.toolsetName; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unknownToolMessage = _chunkHDK3T2QScjs.unknownToolMessage; exports.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
|
package/dist/agent/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
placeBeside
|
|
13
13
|
} from "../chunk-BTZS3KZY.js";
|
|
14
14
|
import "../chunk-7KZ2HKKC.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-K73HMKQP.js";
|
|
16
16
|
import {
|
|
17
17
|
JSON_RPC_ERRORS,
|
|
18
18
|
MCP_PROTOCOL_VERSIONS,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
toolsetInstructions,
|
|
39
39
|
toolsetName,
|
|
40
40
|
unknownToolMessage
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-RB62U6MS.js";
|
|
42
42
|
import {
|
|
43
43
|
CAPTURE_EXCLUDE_SELECTOR,
|
|
44
44
|
CAPTURE_OVERLAY_SELECTORS,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
setAgentCaret,
|
|
97
97
|
sparklineLabel,
|
|
98
98
|
typeAgentText
|
|
99
|
-
} from "../chunk-
|
|
99
|
+
} from "../chunk-6GAYGQDC.js";
|
|
100
100
|
import {
|
|
101
101
|
describeChart
|
|
102
102
|
} from "../chunk-KI2VBONS.js";
|
|
@@ -108,9 +108,14 @@ import {
|
|
|
108
108
|
import {
|
|
109
109
|
getEditorMarkdown,
|
|
110
110
|
getEditorText
|
|
111
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-2INPJDNY.js";
|
|
112
112
|
import "../chunk-RTRQ7XFI.js";
|
|
113
|
-
import "../chunk-
|
|
113
|
+
import "../chunk-6IN474P4.js";
|
|
114
|
+
import {
|
|
115
|
+
UNSAFE_JSON_KEYS,
|
|
116
|
+
isUnsafeJsonKey,
|
|
117
|
+
stripPrototypeKeys
|
|
118
|
+
} from "../chunk-HF5QZS7Z.js";
|
|
114
119
|
import {
|
|
115
120
|
isSingleCellRange,
|
|
116
121
|
normalizeRange,
|
|
@@ -2020,6 +2025,7 @@ export {
|
|
|
2020
2025
|
ToolRegistry,
|
|
2021
2026
|
ToolRegistryError,
|
|
2022
2027
|
ToolRegistryView,
|
|
2028
|
+
UNSAFE_JSON_KEYS,
|
|
2023
2029
|
baseToolName,
|
|
2024
2030
|
captureInputSchema,
|
|
2025
2031
|
captureOutputSize,
|
|
@@ -2037,6 +2043,7 @@ export {
|
|
|
2037
2043
|
createToolRegistry,
|
|
2038
2044
|
elementToSvg,
|
|
2039
2045
|
errorResult,
|
|
2046
|
+
isUnsafeJsonKey,
|
|
2040
2047
|
listSkills,
|
|
2041
2048
|
normalizeSide,
|
|
2042
2049
|
parseSkillFrontmatter,
|
|
@@ -2047,6 +2054,7 @@ export {
|
|
|
2047
2054
|
resolveCaptureRequest,
|
|
2048
2055
|
searchTokens,
|
|
2049
2056
|
searchTools,
|
|
2057
|
+
stripPrototypeKeys,
|
|
2050
2058
|
summarize,
|
|
2051
2059
|
toCapturedImageData,
|
|
2052
2060
|
toToolResult,
|
package/dist/bridge/cli.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var _chunkAGCD3EHBcjs = require('../chunk-AGCD3EHB.cjs');
|
|
5
|
+
require('../chunk-HDK3T2QS.cjs');
|
|
6
|
+
require('../chunk-2BSBFBOA.cjs');
|
|
6
7
|
require('../chunk-WOFXZ3XU.cjs');
|
|
7
8
|
|
|
8
9
|
// src/bridge/cli.ts
|
|
@@ -22,7 +23,7 @@ args.forEach((arg, i) => {
|
|
|
22
23
|
if (arg === "--origin" && args[i + 1]) origins.push(args[i + 1]);
|
|
23
24
|
});
|
|
24
25
|
var port = value("--port");
|
|
25
|
-
void
|
|
26
|
+
void _chunkAGCD3EHBcjs.createToolBridge.call(void 0, {
|
|
26
27
|
name: _nullishCoalesce(value("--name"), () => ( "pixerate")),
|
|
27
28
|
port: port !== void 0 ? Number(port) : void 0,
|
|
28
29
|
token: _nullishCoalesce(value("--token"), () => ( process.env.PIXERATE_BRIDGE_TOKEN)),
|
package/dist/bridge/cli.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createToolBridge
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-UMS6YFA6.js";
|
|
5
|
+
import "../chunk-RB62U6MS.js";
|
|
6
|
+
import "../chunk-HF5QZS7Z.js";
|
|
6
7
|
import "../chunk-V2ZCJRDM.js";
|
|
7
8
|
|
|
8
9
|
// src/bridge/cli.ts
|
package/dist/bridge/index.cjs
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkAGCD3EHBcjs = require('../chunk-AGCD3EHB.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHDK3T2QScjs = require('../chunk-HDK3T2QS.cjs');
|
|
11
|
+
require('../chunk-2BSBFBOA.cjs');
|
|
11
12
|
require('../chunk-WOFXZ3XU.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
@@ -16,4 +17,4 @@ require('../chunk-WOFXZ3XU.cjs');
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
exports.TOOL_BRIDGE_DEFAULT_PORT =
|
|
20
|
+
exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkHDK3T2QScjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL; exports.createToolBridge = _chunkAGCD3EHBcjs.createToolBridge; exports.defaultSkillsDir = _chunkAGCD3EHBcjs.defaultSkillsDir; exports.isLocalOrigin = _chunkAGCD3EHBcjs.isLocalOrigin; exports.loadSkillFiles = _chunkAGCD3EHBcjs.loadSkillFiles;
|
package/dist/bridge/index.js
CHANGED
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
defaultSkillsDir,
|
|
4
4
|
isLocalOrigin,
|
|
5
5
|
loadSkillFiles
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-UMS6YFA6.js";
|
|
7
7
|
import {
|
|
8
8
|
TOOL_BRIDGE_DEFAULT_PORT,
|
|
9
9
|
TOOL_BRIDGE_PROTOCOL
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-RB62U6MS.js";
|
|
11
|
+
import "../chunk-HF5QZS7Z.js";
|
|
11
12
|
import "../chunk-V2ZCJRDM.js";
|
|
12
13
|
export {
|
|
13
14
|
TOOL_BRIDGE_DEFAULT_PORT,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/tools/safe-json.ts
|
|
2
|
+
var UNSAFE_JSON_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
3
|
+
var isUnsafeJsonKey = (key) => UNSAFE_JSON_KEYS.has(key);
|
|
4
|
+
var isPlainObject = (value) => {
|
|
5
|
+
if (value === null || typeof value !== "object") return false;
|
|
6
|
+
const proto = Object.getPrototypeOf(value);
|
|
7
|
+
return proto === Object.prototype || proto === null;
|
|
8
|
+
};
|
|
9
|
+
function hasUnsafeKeys(value, seen) {
|
|
10
|
+
if (value === null || typeof value !== "object" || seen.has(value)) return false;
|
|
11
|
+
seen.add(value);
|
|
12
|
+
if (Array.isArray(value)) return value.some((item) => hasUnsafeKeys(item, seen));
|
|
13
|
+
if (!isPlainObject(value)) return false;
|
|
14
|
+
for (const key of Object.keys(value)) {
|
|
15
|
+
if (isUnsafeJsonKey(key) || hasUnsafeKeys(value[key], seen)) return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
function strip(value, seen) {
|
|
20
|
+
if (value === null || typeof value !== "object") return value;
|
|
21
|
+
if (seen.has(value)) return seen.get(value);
|
|
22
|
+
if (Array.isArray(value)) {
|
|
23
|
+
const out2 = [];
|
|
24
|
+
seen.set(value, out2);
|
|
25
|
+
for (const item of value) out2.push(strip(item, seen));
|
|
26
|
+
return out2;
|
|
27
|
+
}
|
|
28
|
+
if (!isPlainObject(value)) return value;
|
|
29
|
+
const out = {};
|
|
30
|
+
seen.set(value, out);
|
|
31
|
+
for (const key of Object.keys(value)) {
|
|
32
|
+
if (isUnsafeJsonKey(key)) continue;
|
|
33
|
+
out[key] = strip(value[key], seen);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
function stripPrototypeKeys(value) {
|
|
38
|
+
if (!hasUnsafeKeys(value, /* @__PURE__ */ new Set())) return value;
|
|
39
|
+
return strip(value, /* @__PURE__ */ new Map());
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
exports.UNSAFE_JSON_KEYS = UNSAFE_JSON_KEYS; exports.isUnsafeJsonKey = isUnsafeJsonKey; exports.stripPrototypeKeys = stripPrototypeKeys;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
BLOCK_CHANGE_ATTRIBUTE,
|
|
9
9
|
MOVE_ID_ATTRIBUTE,
|
|
10
10
|
resolveTrackedChanges
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6IN474P4.js";
|
|
12
12
|
|
|
13
13
|
// src/serializers/plain-text.ts
|
|
14
14
|
import { DOMSerializer, Slice, Fragment, Node as ProsemirrorNode } from "@tiptap/pm/model";
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
|
|
5
|
+
|
|
6
|
+
// src/extensions/safe-merge-attributes.ts
|
|
7
|
+
var _core = require('@tiptap/core');
|
|
8
|
+
function safeMergeAttributes(...objects) {
|
|
9
|
+
return _core.mergeAttributes.call(void 0,
|
|
10
|
+
...objects.filter((item) => !!item).map((item) => {
|
|
11
|
+
const keys = Object.keys(item);
|
|
12
|
+
if (!keys.some(_chunk2BSBFBOAcjs.isUnsafeJsonKey)) return item;
|
|
13
|
+
const copy = {};
|
|
14
|
+
for (const key of keys) if (!_chunk2BSBFBOAcjs.isUnsafeJsonKey.call(void 0, key)) copy[key] = item[key];
|
|
15
|
+
return copy;
|
|
16
|
+
})
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/extensions/comment-store.ts
|
|
2
21
|
var idCounter = 0;
|
|
3
22
|
function createReviewId(prefix = "c") {
|
|
4
23
|
idCounter = (idCounter + 1) % 1e6;
|
|
@@ -44,7 +63,7 @@ var CommentStore = (_class = class _CommentStore {
|
|
|
44
63
|
}
|
|
45
64
|
/** Parses `toJSON()` output (or a plain thread array). */
|
|
46
65
|
static parse(json) {
|
|
47
|
-
const value = typeof json === "string" ? JSON.parse(json) : json;
|
|
66
|
+
const value = _chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, typeof json === "string" ? JSON.parse(json) : json);
|
|
48
67
|
const list = Array.isArray(value) ? value : _optionalChain([value, 'optionalAccess', _ => _.threads]);
|
|
49
68
|
if (!Array.isArray(list)) return [];
|
|
50
69
|
return list.filter((t) => t && t.id != null).map(normalizeThread);
|
|
@@ -237,7 +256,7 @@ function formatReviewTime(timestamp, now = Date.now()) {
|
|
|
237
256
|
}
|
|
238
257
|
|
|
239
258
|
// src/extensions/track-changes.ts
|
|
240
|
-
|
|
259
|
+
|
|
241
260
|
|
|
242
261
|
|
|
243
262
|
|
|
@@ -369,7 +388,7 @@ var TrackedInsertion = _core.Mark.create({
|
|
|
369
388
|
const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
|
|
370
389
|
return [
|
|
371
390
|
"ins",
|
|
372
|
-
|
|
391
|
+
safeMergeAttributes(base, HTMLAttributes, {
|
|
373
392
|
"data-change-type": "insertion"
|
|
374
393
|
}),
|
|
375
394
|
0
|
|
@@ -403,7 +422,7 @@ var TrackedDeletion = _core.Mark.create({
|
|
|
403
422
|
const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
|
|
404
423
|
return [
|
|
405
424
|
"del",
|
|
406
|
-
|
|
425
|
+
safeMergeAttributes(base, HTMLAttributes, {
|
|
407
426
|
"data-change-type": "deletion"
|
|
408
427
|
}),
|
|
409
428
|
0
|
|
@@ -444,7 +463,7 @@ var TrackedFormatChange = _core.Mark.create({
|
|
|
444
463
|
renderHTML({ HTMLAttributes }) {
|
|
445
464
|
return [
|
|
446
465
|
"span",
|
|
447
|
-
|
|
466
|
+
safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
448
467
|
"data-change-type": "format"
|
|
449
468
|
}),
|
|
450
469
|
0
|
|
@@ -1958,4 +1977,5 @@ var TrackChanges = _core.Extension.create({
|
|
|
1958
1977
|
|
|
1959
1978
|
|
|
1960
1979
|
|
|
1961
|
-
|
|
1980
|
+
|
|
1981
|
+
exports.safeMergeAttributes = safeMergeAttributes; exports.createReviewId = createReviewId; exports.CommentStore = CommentStore; exports.createCommentStore = createCommentStore; exports.formatReviewTime = formatReviewTime; exports.INSERTION_MARK_NAME = INSERTION_MARK_NAME; exports.DELETION_MARK_NAME = DELETION_MARK_NAME; exports.FORMAT_CHANGE_MARK_NAME = FORMAT_CHANGE_MARK_NAME; exports.BLOCK_CHANGE_ATTRIBUTE = BLOCK_CHANGE_ATTRIBUTE; exports.MOVE_ID_ATTRIBUTE = MOVE_ID_ATTRIBUTE; exports.TRACK_CHANGES_SKIP_META = TRACK_CHANGES_SKIP_META; exports.TrackChangesStore = TrackChangesStore; exports.trackChangesPluginKey = trackChangesPluginKey; exports.MOVE_TO_CLASS = MOVE_TO_CLASS; exports.MOVE_FROM_CLASS = MOVE_FROM_CLASS; exports.TrackedInsertion = TrackedInsertion; exports.TrackedDeletion = TrackedDeletion; exports.TrackedFormatChange = TrackedFormatChange; exports.describeFormatChange = describeFormatChange; exports.describeBlockChange = describeBlockChange; exports.trackedChangeLabel = trackedChangeLabel; exports.getTrackedChanges = getTrackedChanges; exports.getTrackedChangeAt = getTrackedChangeAt; exports.isTrackChangesEnabled = isTrackChangesEnabled; exports.getTrackChangesStore = getTrackChangesStore; exports.resolveTrackedChanges = resolveTrackedChanges; exports.isMoveSized = isMoveSized; exports.TrackChanges = TrackChanges;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
|
|
5
8
|
|
|
6
9
|
// src/serializers/html.ts
|
|
7
10
|
var DROP_WITH_CONTENT_REGEX = /<(script|style|template|noscript|iframe|object|embed|head|title|svg|math|textarea|select|button)\b[^>]*>[\s\S]*?<\/\1\s*>/gi;
|
|
@@ -15,12 +18,12 @@ function sanitizeImportedHtml(html) {
|
|
|
15
18
|
const body = BODY_REGEX.exec(content);
|
|
16
19
|
if (body) content = body[1];
|
|
17
20
|
content = content.replace(DROP_WITH_CONTENT_REGEX, "").replace(UNCLOSED_RAW_TEXT_REGEX, "").replace(NAMESPACED_TAG_REGEX, "");
|
|
18
|
-
const sanitized =
|
|
21
|
+
const sanitized = _chunkG43MNQ4Ccjs.sanitizeHtml.call(void 0, content, { disallowedTags: "strip" }).trim();
|
|
19
22
|
return sanitized || "<p></p>";
|
|
20
23
|
}
|
|
21
24
|
function plainTextToParagraphHtml(text) {
|
|
22
25
|
if (!text) return "<p></p>";
|
|
23
|
-
return text.replace(/\r\n?/g, "\n").split("\n").map((line) => `<p>${
|
|
26
|
+
return text.replace(/\r\n?/g, "\n").split("\n").map((line) => `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, line)}</p>`).join("");
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
// src/serializers/rtf.ts
|
|
@@ -263,7 +266,7 @@ function parseRichClipboardPayload(data, schema) {
|
|
|
263
266
|
if (!payload || payload.version !== 1) return null;
|
|
264
267
|
if (payload.schema !== getSchemaSignature(schema)) return null;
|
|
265
268
|
if (!payload.slice) return null;
|
|
266
|
-
return _model.Slice.fromJSON(schema, payload.slice);
|
|
269
|
+
return _model.Slice.fromJSON(schema, _chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, payload.slice));
|
|
267
270
|
} catch (e) {
|
|
268
271
|
return null;
|
|
269
272
|
}
|