@pixerate/editor 0.139.1 → 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/README.md +25 -4
- package/dist/agent/formatTools.d.cts +15 -0
- package/dist/agent/formatTools.d.ts +15 -0
- package/dist/agent/index.cjs +408 -49
- package/dist/agent/index.js +375 -16
- package/dist/agent/providers.d.cts +5 -3
- package/dist/agent/providers.d.ts +5 -3
- package/dist/animation-editor/effect-tools.d.cts +1 -1
- package/dist/animation-editor/effect-tools.d.ts +1 -1
- package/dist/animation-editor/index.cjs +250 -116
- package/dist/animation-editor/index.js +228 -94
- package/dist/animation-editor/instructions.d.cts +1 -1
- package/dist/animation-editor/instructions.d.ts +1 -1
- package/dist/animation-editor/parse.d.cts +3 -1
- package/dist/animation-editor/parse.d.ts +3 -1
- package/dist/animation-editor/tools.d.cts +8 -3
- package/dist/animation-editor/tools.d.ts +8 -3
- package/dist/bridge/cli.cjs +4 -3
- package/dist/bridge/cli.js +3 -2
- package/dist/bridge/index.cjs +8 -3
- package/dist/bridge/index.d.cts +7 -0
- package/dist/bridge/index.d.ts +7 -0
- package/dist/bridge/index.js +9 -4
- package/dist/bridge/skills.d.cts +9 -0
- package/dist/bridge/skills.d.ts +9 -0
- package/dist/canvas/effect-tools.d.cts +1 -1
- package/dist/canvas/effect-tools.d.ts +1 -1
- package/dist/canvas/index.cjs +22 -17
- package/dist/canvas/index.js +8 -3
- package/dist/chart/file-tools.d.cts +1 -1
- package/dist/chart/file-tools.d.ts +1 -1
- package/dist/chart/index.cjs +7 -1
- package/dist/chart/index.js +7 -1
- package/dist/chart/tools.d.cts +1 -1
- package/dist/chart/tools.d.ts +1 -1
- 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-BKMU3V6K.js → chunk-5ED73EC6.js} +8 -1
- package/dist/{chunk-NKBUVQJW.cjs → chunk-5WOY52O6.cjs} +15 -15
- package/dist/{chunk-VRIR53SW.js → chunk-6GAYGQDC.js} +10 -8
- package/dist/{chunk-HZZXBTLB.js → chunk-6IN474P4.js} +25 -5
- package/dist/{chunk-KHMVB3SJ.js → chunk-7KWJEYIK.js} +4 -1
- package/dist/{chunk-R47NQICB.cjs → chunk-AGCD3EHB.cjs} +47 -10
- package/dist/{chunk-6I63VZ45.js → chunk-CXXKJBQZ.js} +5 -1
- package/dist/{chunk-6NXVDJDR.cjs → chunk-G43MNQ4C.cjs} +5 -5
- package/dist/chunk-HDK3T2QS.cjs +1159 -0
- package/dist/chunk-HF5QZS7Z.js +46 -0
- package/dist/{chunk-S7I3RI5Z.cjs → chunk-HMGWFXEC.cjs} +27 -24
- package/dist/{chunk-6NCBFBXA.js → chunk-IQ6KKXOU.js} +1 -1
- package/dist/{chunk-T6Y5FV7G.cjs → chunk-L434J57V.cjs} +10 -8
- package/dist/{chunk-UCRL6JEV.cjs → chunk-L5OWG2NA.cjs} +8 -3
- package/dist/{chunk-CZRWP6IW.cjs → chunk-N2FGYZ4Q.cjs} +8 -1
- package/dist/{chunk-GUPQ5BNA.cjs → chunk-PUR6BZFA.cjs} +112 -111
- package/dist/chunk-RB62U6MS.js +1159 -0
- package/dist/{chunk-3V746PF4.cjs → chunk-RUZQMYXH.cjs} +4 -1
- package/dist/{chunk-HGHXGCKG.cjs → chunk-SVFEVKLF.cjs} +1 -1
- package/dist/{chunk-PCNCT4ZY.js → chunk-UMS6YFA6.js} +40 -3
- package/dist/{chunk-4LGWAJDI.js → chunk-V5OOP74P.js} +5 -2
- package/dist/{chunk-BWT4IWLK.cjs → chunk-VKF3PWKR.cjs} +7 -7
- package/dist/{chunk-PQMADRCI.js → chunk-WBJ6BG4R.js} +23 -22
- package/dist/{chunk-WIYAOZZU.js → chunk-WHKNYFM2.js} +7 -2
- package/dist/{chunk-TBSPPVTT.js → chunk-XCK7QK5D.js} +1 -1
- 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/commands/agentTools.d.cts +1 -1
- package/dist/commands/agentTools.d.ts +1 -1
- package/dist/commands/index.cjs +3 -0
- package/dist/commands/index.js +3 -0
- package/dist/compare/index.cjs +4 -3
- package/dist/compare/index.js +3 -2
- package/dist/diagram/index.cjs +3 -0
- package/dist/diagram/index.js +3 -0
- package/dist/diagram/tools.d.cts +1 -1
- package/dist/diagram/tools.d.ts +1 -1
- package/dist/effects/index.cjs +32 -32
- package/dist/effects/index.js +1 -1
- package/dist/effects/tools.d.cts +5 -1
- package/dist/effects/tools.d.ts +5 -1
- 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/generation/index.cjs +7 -1
- package/dist/generation/index.js +7 -1
- package/dist/image-editor/index.cjs +25 -18
- package/dist/image-editor/index.js +10 -3
- package/dist/image-editor/provider-effect-tools.d.cts +1 -1
- package/dist/image-editor/provider-effect-tools.d.ts +1 -1
- package/dist/image-editor/tools.d.cts +1 -1
- package/dist/image-editor/tools.d.ts +1 -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/paint-editor/effect-tools.d.cts +1 -1
- package/dist/paint-editor/effect-tools.d.ts +1 -1
- package/dist/paint-editor/index.cjs +18 -8
- package/dist/paint-editor/index.js +13 -3
- package/dist/paint-editor/tools.d.cts +1 -1
- package/dist/paint-editor/tools.d.ts +1 -1
- 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/bridge-client.d.cts +3 -3
- package/dist/tools/bridge-client.d.ts +3 -3
- package/dist/tools/capture.d.cts +5 -1
- package/dist/tools/capture.d.ts +5 -1
- package/dist/tools/definitions.d.cts +2 -2
- package/dist/tools/definitions.d.ts +2 -2
- package/dist/tools/index.cjs +39 -5
- package/dist/tools/index.d.cts +4 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.js +39 -5
- package/dist/tools/mcp-server.d.cts +24 -6
- package/dist/tools/mcp-server.d.ts +24 -6
- package/dist/tools/registry.d.cts +81 -6
- package/dist/tools/registry.d.ts +81 -6
- package/dist/tools/safe-json.d.cts +27 -0
- package/dist/tools/safe-json.d.ts +27 -0
- package/dist/tools/search.d.cts +30 -0
- package/dist/tools/search.d.ts +30 -0
- package/dist/tools/skills.d.cts +26 -0
- package/dist/tools/skills.d.ts +26 -0
- package/dist/tools/view.d.cts +95 -0
- package/dist/tools/view.d.ts +95 -0
- package/dist/vector/effect-tools.d.cts +1 -1
- package/dist/vector/effect-tools.d.ts +1 -1
- package/dist/vector/index.cjs +13 -7
- package/dist/vector/index.js +8 -2
- package/dist/video-editor/effect-tools.d.cts +1 -1
- package/dist/video-editor/effect-tools.d.ts +1 -1
- package/dist/video-editor/index.cjs +275 -269
- package/dist/video-editor/index.js +8 -2
- package/dist/video-editor/tools.d.cts +1 -1
- package/dist/video-editor/tools.d.ts +1 -1
- package/package.json +31 -29
- package/skills/README.md +8 -3
- package/skills/pixerate-agent-tools/SKILL.md +33 -7
- package/skills/pixerate-animation-editor/SKILL.md +7 -0
- package/skills/pixerate-rich-text/SKILL.md +18 -4
- package/dist/chunk-5RRYDFU2.js +0 -466
- package/dist/chunk-SPVIXXIB.cjs +0 -466
- /package/dist/{chunk-SMJK5HBJ.js → chunk-K73HMKQP.js} +0 -0
- /package/dist/{chunk-DDF6WQ62.cjs → chunk-LACYURUW.cjs} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// 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
|
+
export {
|
|
43
|
+
UNSAFE_JSON_KEYS,
|
|
44
|
+
isUnsafeJsonKey,
|
|
45
|
+
stripPrototypeKeys
|
|
46
|
+
};
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
|
|
11
14
|
|
|
12
15
|
// src/compare/diff.ts
|
|
13
16
|
var EQUAL = 0;
|
|
@@ -257,9 +260,9 @@ var _core = require('@tiptap/core');
|
|
|
257
260
|
|
|
258
261
|
var _model = require('@tiptap/pm/model');
|
|
259
262
|
var REVIEW_MARK_NAMES = /* @__PURE__ */ new Set([
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
+
_chunk34RQAGWIcjs.INSERTION_MARK_NAME,
|
|
264
|
+
_chunk34RQAGWIcjs.DELETION_MARK_NAME,
|
|
265
|
+
_chunk34RQAGWIcjs.FORMAT_CHANGE_MARK_NAME,
|
|
263
266
|
"comment",
|
|
264
267
|
"bookmark"
|
|
265
268
|
]);
|
|
@@ -286,7 +289,7 @@ function toNode(source, schema) {
|
|
|
286
289
|
const node = source;
|
|
287
290
|
return node.type.schema === schema ? node : schema.nodeFromJSON(node.toJSON());
|
|
288
291
|
}
|
|
289
|
-
return schema.nodeFromJSON(source);
|
|
292
|
+
return schema.nodeFromJSON(_chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, source));
|
|
290
293
|
}
|
|
291
294
|
function newAttributes(ctx) {
|
|
292
295
|
return {
|
|
@@ -303,7 +306,7 @@ function lazyAttributes(ctx) {
|
|
|
303
306
|
}
|
|
304
307
|
function stripBlockChange(attrs) {
|
|
305
308
|
const copy = { ...attrs };
|
|
306
|
-
delete copy[
|
|
309
|
+
delete copy[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE];
|
|
307
310
|
return copy;
|
|
308
311
|
}
|
|
309
312
|
function wrapperOf(node) {
|
|
@@ -316,7 +319,7 @@ function filteredAttributes(attrs, ctx) {
|
|
|
316
319
|
return stableStringify(
|
|
317
320
|
Object.fromEntries(
|
|
318
321
|
Object.entries(_nullishCoalesce(attrs, () => ( {}))).filter(
|
|
319
|
-
([key]) => key !==
|
|
322
|
+
([key]) => key !== _chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE && !ctx.ignoredAttributes.has(key)
|
|
320
323
|
)
|
|
321
324
|
)
|
|
322
325
|
);
|
|
@@ -327,7 +330,7 @@ function sameBlock(a, b, ctx) {
|
|
|
327
330
|
if (a.wrappers.length !== b.wrappers.length) return false;
|
|
328
331
|
return a.wrappers.every((w, i) => w.type === b.wrappers[i].type);
|
|
329
332
|
}
|
|
330
|
-
var hasBlockChange = (node) => !!node.type.spec.attrs &&
|
|
333
|
+
var hasBlockChange = (node) => !!node.type.spec.attrs && _chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE in node.type.spec.attrs;
|
|
331
334
|
var label = (node) => node.type.name;
|
|
332
335
|
function normalize(text, ctx) {
|
|
333
336
|
let result = ctx.ignoreWhitespace ? text.replace(/\s+/g, " ") : text;
|
|
@@ -380,12 +383,12 @@ function wholeBlock(node, operation, wrappers, attrs, ctx) {
|
|
|
380
383
|
previous: snapshot(node, wrappers),
|
|
381
384
|
operation
|
|
382
385
|
};
|
|
383
|
-
return [node.type.create({ ...node.attrs, [
|
|
386
|
+
return [node.type.create({ ...node.attrs, [_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE]: record }, node.content, node.marks)];
|
|
384
387
|
}
|
|
385
388
|
const markType = operation === "insert" ? ctx.insertion : ctx.deletion;
|
|
386
389
|
if (markType && node.type.allowsMarkType(markType) && node.content.size > 0) {
|
|
387
390
|
ctx.notes.add(
|
|
388
|
-
`${verb} ${label(node)} blocks have no "${
|
|
391
|
+
`${verb} ${label(node)} blocks have no "${_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE}" attribute: only their text is tracked, so an empty block remains when the change is ${operation === "insert" ? "rejected" : "accepted"}.`
|
|
389
392
|
);
|
|
390
393
|
return [node.type.create(node.attrs, markInline(node.content, markType.create(attrs())), node.marks)];
|
|
391
394
|
}
|
|
@@ -484,7 +487,7 @@ function formattingOf(marks, ctx) {
|
|
|
484
487
|
}
|
|
485
488
|
function withoutReviewMarks(marks) {
|
|
486
489
|
return marks.filter(
|
|
487
|
-
(mark) => mark.type.name !==
|
|
490
|
+
(mark) => mark.type.name !== _chunk34RQAGWIcjs.INSERTION_MARK_NAME && mark.type.name !== _chunk34RQAGWIcjs.DELETION_MARK_NAME && mark.type.name !== _chunk34RQAGWIcjs.FORMAT_CHANGE_MARK_NAME
|
|
488
491
|
);
|
|
489
492
|
}
|
|
490
493
|
function mergeInline(original, revised, parentType, ctx) {
|
|
@@ -580,12 +583,12 @@ function mergeTextblocks(original, revised, oPath, rPath, ctx) {
|
|
|
580
583
|
if (hasBlockChange(revised)) {
|
|
581
584
|
const onlyWrappers = ctx.wrapperChange && sameBlock(previous, { ...snapshot(revised, rPath), wrappers: previous.wrappers }, ctx);
|
|
582
585
|
const base = onlyWrappers ? ctx.wrapperChange() : newAttributes(ctx);
|
|
583
|
-
attrs = { ...attrs, [
|
|
586
|
+
attrs = { ...attrs, [_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE]: { ...base, previous } };
|
|
584
587
|
} else {
|
|
585
588
|
ctx.notes.add(`Block changes to ${label(revised)} blocks cannot be tracked.`);
|
|
586
589
|
}
|
|
587
|
-
} else if (
|
|
588
|
-
attrs[
|
|
590
|
+
} else if (_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE in attrs) {
|
|
591
|
+
attrs[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE] = null;
|
|
589
592
|
}
|
|
590
593
|
const type = revised.type;
|
|
591
594
|
const inlineTracking = !!ctx.insertion && !!ctx.deletion && type.allowsMarkType(ctx.insertion) && type.allowsMarkType(ctx.deletion);
|
|
@@ -679,7 +682,7 @@ function detectMovedBlocks(children, ctx) {
|
|
|
679
682
|
const keyOf = (node) => `${node.type.name}\0${filteredAttributes(node.attrs, ctx)}\0${stableStringify(node.content.toJSON())}`;
|
|
680
683
|
const candidates = /* @__PURE__ */ new Map();
|
|
681
684
|
children.forEach((node, index) => {
|
|
682
|
-
const operation = _optionalChain([node, 'access', _2 => _2.attrs, 'optionalAccess', _3 => _3[
|
|
685
|
+
const operation = _optionalChain([node, 'access', _2 => _2.attrs, 'optionalAccess', _3 => _3[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _4 => _4.operation]);
|
|
683
686
|
if (!operation || !node.isTextblock || !node.textContent.trim()) return;
|
|
684
687
|
if (!node.type.allowsMarkType(ctx.insertion) || !node.type.allowsMarkType(ctx.deletion)) return;
|
|
685
688
|
const key = keyOf(node);
|
|
@@ -691,11 +694,11 @@ function detectMovedBlocks(children, ctx) {
|
|
|
691
694
|
candidates.forEach(({ del, ins }) => {
|
|
692
695
|
if (del.length !== 1 || ins.length !== 1) return;
|
|
693
696
|
const attrs = newAttributes(ctx);
|
|
694
|
-
const moved = { ...attrs, [
|
|
697
|
+
const moved = { ...attrs, [_chunk34RQAGWIcjs.MOVE_ID_ATTRIBUTE]: attrs.changeId };
|
|
695
698
|
const relink = (index, markType) => {
|
|
696
699
|
const node = out[index];
|
|
697
700
|
out[index] = node.type.create(
|
|
698
|
-
{ ...node.attrs, [
|
|
701
|
+
{ ...node.attrs, [_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE]: null },
|
|
699
702
|
markInline(node.content, markType.create(moved)),
|
|
700
703
|
node.marks
|
|
701
704
|
);
|
|
@@ -714,7 +717,7 @@ function summarize(doc, notes) {
|
|
|
714
717
|
moves: 0,
|
|
715
718
|
notHonoured: [...notes]
|
|
716
719
|
};
|
|
717
|
-
|
|
720
|
+
_chunk34RQAGWIcjs.getTrackedChanges.call(void 0, doc).forEach((change) => {
|
|
718
721
|
if (change.type === "move") summary.moves++;
|
|
719
722
|
else if (change.type === "insertion" || _optionalChain([change, 'access', _5 => _5.block, 'optionalAccess', _6 => _6.operation]) === "insert") summary.insertions++;
|
|
720
723
|
else if (change.type === "deletion" || _optionalChain([change, 'access', _7 => _7.block, 'optionalAccess', _8 => _8.operation]) === "delete") summary.deletions++;
|
|
@@ -730,7 +733,7 @@ function compareDocuments(original, revised, options = {}) {
|
|
|
730
733
|
schema,
|
|
731
734
|
author: _nullishCoalesce(options.author, () => ( { id: "compare", name: "Compare" })),
|
|
732
735
|
createdAt: toTime(options.date),
|
|
733
|
-
generateId: _nullishCoalesce(options.generateId, () => ( (() =>
|
|
736
|
+
generateId: _nullishCoalesce(options.generateId, () => ( (() => _chunk34RQAGWIcjs.createReviewId.call(void 0, "change")))),
|
|
734
737
|
granularity: _nullishCoalesce(options.granularity, () => ( "word")),
|
|
735
738
|
ignoreCase: !!options.ignoreCase,
|
|
736
739
|
ignoreWhitespace: !!options.ignoreWhitespace,
|
|
@@ -738,9 +741,9 @@ function compareDocuments(original, revised, options = {}) {
|
|
|
738
741
|
maxCharDiff: _nullishCoalesce(options.maxCharDiff, () => ( 2e3)),
|
|
739
742
|
ignoredMarks: new Set(_nullishCoalesce(options.ignoredMarks, () => ( []))),
|
|
740
743
|
ignoredAttributes: new Set(_nullishCoalesce(options.ignoredBlockAttributes, () => ( ["id"]))),
|
|
741
|
-
insertion: schema.marks[
|
|
742
|
-
deletion: schema.marks[
|
|
743
|
-
format: schema.marks[
|
|
744
|
+
insertion: schema.marks[_chunk34RQAGWIcjs.INSERTION_MARK_NAME],
|
|
745
|
+
deletion: schema.marks[_chunk34RQAGWIcjs.DELETION_MARK_NAME],
|
|
746
|
+
format: schema.marks[_chunk34RQAGWIcjs.FORMAT_CHANGE_MARK_NAME],
|
|
744
747
|
notes: /* @__PURE__ */ new Set(),
|
|
745
748
|
keys: /* @__PURE__ */ new Map(),
|
|
746
749
|
wrapperChange: null
|
|
@@ -753,9 +756,9 @@ function compareDocuments(original, revised, options = {}) {
|
|
|
753
756
|
}
|
|
754
757
|
const prepare = (source) => {
|
|
755
758
|
const doc2 = toNode(source, schema);
|
|
756
|
-
if (
|
|
759
|
+
if (_chunk34RQAGWIcjs.getTrackedChanges.call(void 0, doc2).length === 0) return doc2;
|
|
757
760
|
ctx.notes.add("Tracked changes already in the documents were accepted before comparing.");
|
|
758
|
-
return
|
|
761
|
+
return _chunk34RQAGWIcjs.resolveTrackedChanges.call(void 0, doc2, "accepted");
|
|
759
762
|
};
|
|
760
763
|
const a = prepare(original);
|
|
761
764
|
const b = prepare(revised);
|
|
@@ -15,11 +15,12 @@ var _chunk6HMEHNWWcjs = require('./chunk-6HMEHNWW.cjs');
|
|
|
15
15
|
var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
|
|
23
24
|
|
|
24
25
|
// src/extensions/table/nesting.ts
|
|
25
26
|
var _model = require('@tiptap/pm/model');
|
|
@@ -1550,7 +1551,7 @@ var Chart = _core.Node.create({
|
|
|
1550
1551
|
const svg = staticChartSvg(node, this.options);
|
|
1551
1552
|
return [
|
|
1552
1553
|
"div",
|
|
1553
|
-
|
|
1554
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
|
|
1554
1555
|
"data-type": "chart",
|
|
1555
1556
|
class: "pixerate-chart"
|
|
1556
1557
|
}),
|
|
@@ -1717,7 +1718,7 @@ var Sparkline = _core.Node.create({
|
|
|
1717
1718
|
});
|
|
1718
1719
|
return [
|
|
1719
1720
|
"span",
|
|
1720
|
-
|
|
1721
|
+
_chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
|
|
1721
1722
|
"data-type": "sparkline",
|
|
1722
1723
|
class: "pixerate-sparkline"
|
|
1723
1724
|
}),
|
|
@@ -1836,7 +1837,7 @@ function getTableActionState(editor, action, params = {}) {
|
|
|
1836
1837
|
switch (action) {
|
|
1837
1838
|
case "mergeCells":
|
|
1838
1839
|
case "splitCell": {
|
|
1839
|
-
if (
|
|
1840
|
+
if (_chunk34RQAGWIcjs.isTrackChangesEnabled.call(void 0, editor)) {
|
|
1840
1841
|
return `${action === "mergeCells" ? "Merging" : "Splitting"} cells cannot be tracked: turn off Track Changes first.`;
|
|
1841
1842
|
}
|
|
1842
1843
|
if (action === "mergeCells") {
|
|
@@ -2005,6 +2006,7 @@ function createTableStore(editor) {
|
|
|
2005
2006
|
|
|
2006
2007
|
// src/extensions/agent-caret.ts
|
|
2007
2008
|
|
|
2009
|
+
var _history = require('@tiptap/pm/history');
|
|
2008
2010
|
|
|
2009
2011
|
var _view = require('@tiptap/pm/view');
|
|
2010
2012
|
var DEFAULT_AGENT_CARET_COLOR = "#8b5cf6";
|
|
@@ -2153,9 +2155,9 @@ function getAgentCarets(state) {
|
|
|
2153
2155
|
return _nullishCoalesce(_optionalChain([agentCaretPluginKey, 'access', _77 => _77.getState, 'call', _78 => _78(state), 'optionalAccess', _79 => _79.carets]), () => ( []));
|
|
2154
2156
|
}
|
|
2155
2157
|
function replaceWithTextTransaction(state, from, to, text) {
|
|
2156
|
-
return /[\r\n]/.test(text) ? state.tr.replace(from, to,
|
|
2158
|
+
return /[\r\n]/.test(text) ? state.tr.replace(from, to, _chunkG43MNQ4Ccjs.plainTextToSlice.call(void 0, text, state.schema)) : text ? state.tr.insertText(text, from, to) : state.tr.delete(from, to);
|
|
2157
2159
|
}
|
|
2158
|
-
var NO_HISTORY = (tr) => tr.setMeta("addToHistory", false).setMeta(
|
|
2160
|
+
var NO_HISTORY = (tr) => tr.setMeta("addToHistory", false).setMeta(_chunk34RQAGWIcjs.TRACK_CHANGES_SKIP_META, true);
|
|
2159
2161
|
var cannotAnimate = () => typeof document === "undefined" || document.hidden === true;
|
|
2160
2162
|
async function typeAgentText(editor, options) {
|
|
2161
2163
|
const { from, to, text, caret, signal } = options;
|
|
@@ -2164,7 +2166,7 @@ async function typeAgentText(editor, options) {
|
|
|
2164
2166
|
ensureAgentCaret(editor);
|
|
2165
2167
|
const show = (tr, anchor, head = anchor) => tr.setMeta(agentCaretPluginKey, { set: { ...caret, from: anchor, to: head } });
|
|
2166
2168
|
const commit = (start, end) => {
|
|
2167
|
-
const tr = replaceWithTextTransaction(editor.state, start, end, text);
|
|
2169
|
+
const tr = _history.closeHistory.call(void 0, replaceWithTextTransaction(editor.state, start, end, text));
|
|
2168
2170
|
const insertedTo = tr.mapping.map(end, 1);
|
|
2169
2171
|
const insertedFrom = Math.min(tr.mapping.map(start, -1), insertedTo);
|
|
2170
2172
|
editor.view.dispatch(show(tr, insertedTo).scrollIntoView());
|
|
@@ -1,4 +1,9 @@
|
|
|
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; }
|
|
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
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
|
|
5
|
+
|
|
6
|
+
// src/persistence/migrate.ts
|
|
2
7
|
function hasLoadProblems(report) {
|
|
3
8
|
return report.problems.length > 0 || report.readOnly !== null;
|
|
4
9
|
}
|
|
@@ -23,7 +28,7 @@ function toObject(json) {
|
|
|
23
28
|
return void 0;
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
|
-
return isObject(value) ? deepClone(value) : void 0;
|
|
31
|
+
return isObject(value) ? _chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, deepClone(value)) : void 0;
|
|
27
32
|
}
|
|
28
33
|
function migrateDocument(json, options) {
|
|
29
34
|
const versionKey = _nullishCoalesce(options.versionKey, () => ( "version"));
|
|
@@ -106,7 +111,7 @@ function loadSections(doc, sections, options = {}) {
|
|
|
106
111
|
}
|
|
107
112
|
const unknown = {};
|
|
108
113
|
for (const key of Object.keys(source)) {
|
|
109
|
-
if (!(key in sections) && !ignore.has(key)) unknown[key] = source[key];
|
|
114
|
+
if (!(key in sections) && !ignore.has(key) && !_chunk2BSBFBOAcjs.isUnsafeJsonKey.call(void 0, key)) unknown[key] = source[key];
|
|
110
115
|
}
|
|
111
116
|
return { value, problems, unknown };
|
|
112
117
|
}
|
|
@@ -186,7 +186,14 @@ function createCaptureTool(surface, options = {}) {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
function createCaptureToolProvider(surface, options = {}) {
|
|
189
|
-
return {
|
|
189
|
+
return {
|
|
190
|
+
id: _nullishCoalesce(options.id, () => ( "capture")),
|
|
191
|
+
namespace: options.namespace,
|
|
192
|
+
title: _nullishCoalesce(options.title, () => ( "Screen capture")),
|
|
193
|
+
description: _nullishCoalesce(options.description, () => ( `A screenshot of ${_nullishCoalesce(options.subject, () => ( "the editor"))}, to check what text cannot tell you: overlap, legibility, balance.`)),
|
|
194
|
+
...options.skill ? { skill: options.skill } : {},
|
|
195
|
+
tools: [createCaptureTool(surface, options)]
|
|
196
|
+
};
|
|
190
197
|
}
|
|
191
198
|
|
|
192
199
|
|