@pixerate/editor 0.171.0 → 0.174.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/agent/index.cjs +28 -28
- package/dist/agent/index.js +3 -3
- package/dist/animation-editor/index.cjs +9 -9
- package/dist/animation-editor/index.js +1 -1
- package/dist/canvas/index.cjs +10 -10
- package/dist/canvas/index.js +2 -2
- package/dist/chart/index.cjs +156 -68
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +91 -3
- package/dist/chart/layout-shared.d.cts +2 -1
- package/dist/chart/layout-shared.d.ts +2 -1
- package/dist/chart/layout.d.cts +5 -0
- package/dist/chart/layout.d.ts +5 -0
- package/dist/chart/tooltip.d.cts +53 -0
- package/dist/chart/tooltip.d.ts +53 -0
- package/dist/chart/types.d.cts +14 -0
- package/dist/chart/types.d.ts +14 -0
- package/dist/{chunk-CYKWYP6D.cjs → chunk-6DUEV36F.cjs} +14 -14
- package/dist/{chunk-7KWJEYIK.js → chunk-6G2NLMVK.js} +36 -4
- package/dist/{chunk-RUZQMYXH.cjs → chunk-A3A5TI6R.cjs} +43 -11
- package/dist/{chunk-SBAPXFPB.cjs → chunk-FHNGNL3V.cjs} +44 -44
- package/dist/{chunk-2F4GAZL5.cjs → chunk-GXEC4FS6.cjs} +16 -16
- package/dist/{chunk-T62BRXMS.js → chunk-IMHRN4ZZ.js} +1 -1
- package/dist/{chunk-N3ACT6VJ.js → chunk-KPWG3PSW.js} +1 -1
- package/dist/chunk-NZ3CTY7K.js +260 -0
- package/dist/{chunk-M52UCHVZ.js → chunk-OJQVKJYD.js} +12 -1
- package/dist/{chunk-YN4AYYBJ.js → chunk-OZSA5YEJ.js} +1 -1
- package/dist/{chunk-ZUPP4NKM.js → chunk-R2VHVQVY.js} +2 -2
- package/dist/{chunk-GD34ICEX.cjs → chunk-RLOIEDA3.cjs} +10 -10
- package/dist/{chunk-WOIXNDHV.cjs → chunk-TUXKLM5W.cjs} +13 -2
- package/dist/chunk-VCL7CB56.cjs +260 -0
- package/dist/{chunk-HCC2LBCW.js → chunk-WMVEYSOA.js} +1 -1
- package/dist/{chunk-3OSXHLIT.cjs → chunk-Z64NRDEH.cjs} +7 -7
- package/dist/commands/format.d.cts +43 -0
- package/dist/commands/format.d.ts +43 -0
- package/dist/commands/index.cjs +7 -1
- package/dist/commands/index.d.cts +1 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +6 -0
- package/dist/effects/helpers.d.cts +11 -2
- package/dist/effects/helpers.d.ts +11 -2
- package/dist/effects/index.cjs +40 -34
- package/dist/effects/index.js +8 -2
- package/dist/effects/types.d.cts +2 -0
- package/dist/effects/types.d.ts +2 -0
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.js +4 -4
- package/dist/image-editor/index.cjs +13 -13
- package/dist/image-editor/index.js +1 -1
- package/dist/index.cjs +16 -10
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -4
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.js +2 -2
- package/dist/vector/index.cjs +6 -6
- package/dist/vector/index.js +1 -1
- package/dist/video-editor/index.cjs +309 -309
- package/dist/video-editor/index.js +3 -3
- package/package.json +114 -11
- package/skills/pixerate-chart/SKILL.md +1 -0
package/README.md
CHANGED
|
@@ -6,10 +6,14 @@ Framework bindings: [`@pixerate/editor-react`](https://www.npmjs.com/package/@pi
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @pixerate/editor
|
|
9
|
+
# only if you use rich text or prompts (the root entry, /extensions, /serializers, /agent, /compare):
|
|
10
|
+
npm install @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/suggestion @tiptap/extension-character-count @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-image @tiptap/extension-link @tiptap/extension-mention @tiptap/extension-placeholder @tiptap/extension-subscript @tiptap/extension-superscript @tiptap/extension-table @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-table-row @tiptap/extension-task-item @tiptap/extension-task-list @tiptap/extension-text-align @tiptap/extension-text-style @tiptap/extension-typography @tiptap/extension-underline markdown-it markdown-it-task-lists prosemirror-markdown
|
|
9
11
|
# only if you use @pixerate/editor/canvas (or the agent canvas planner):
|
|
10
12
|
npm install @dagrejs/dagre
|
|
11
13
|
```
|
|
12
14
|
|
|
15
|
+
TipTap, ProseMirror and markdown-it are optional peer dependencies, so `@pixerate/editor/chart`, `/spreadsheet`, `/canvas` and the other subpaths install without them.
|
|
16
|
+
|
|
13
17
|
## Prompt grammar
|
|
14
18
|
|
|
15
19
|
Prompts use three token types:
|
package/dist/agent/index.cjs
CHANGED
|
@@ -121,12 +121,12 @@ var _chunkN2FGYZ4Qcjs = require('../chunk-N2FGYZ4Q.cjs');
|
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
var
|
|
124
|
+
var _chunkRLOIEDA3cjs = require('../chunk-RLOIEDA3.cjs');
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
var
|
|
127
|
+
var _chunkGXEC4FS6cjs = require('../chunk-GXEC4FS6.cjs');
|
|
128
128
|
require('../chunk-TTCJPX4U.cjs');
|
|
129
|
-
require('../chunk-
|
|
129
|
+
require('../chunk-TUXKLM5W.cjs');
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
|
|
@@ -666,14 +666,14 @@ function describe(chart, includeSpec) {
|
|
|
666
666
|
series: spec.series.map((s) => ({ id: s.id, name: s.name })),
|
|
667
667
|
width: _nullishCoalesce(node.attrs.width, () => ( null)),
|
|
668
668
|
height: node.attrs.height,
|
|
669
|
-
description:
|
|
669
|
+
description: _chunkGXEC4FS6cjs.describeChart.call(void 0, spec),
|
|
670
670
|
...includeSpec ? { spec } : {}
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
673
|
function sparklines(doc) {
|
|
674
674
|
const found = [];
|
|
675
675
|
doc.descendants((node, pos) => {
|
|
676
|
-
if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label:
|
|
676
|
+
if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkRLOIEDA3cjs.sparklineLabel.call(void 0, node) });
|
|
677
677
|
});
|
|
678
678
|
return found;
|
|
679
679
|
}
|
|
@@ -684,7 +684,7 @@ function checkPosition(editor, at) {
|
|
|
684
684
|
function createDocumentChartTools(editor) {
|
|
685
685
|
const chartType = () => editor().schema.nodes.chart;
|
|
686
686
|
const findChart = (args) => {
|
|
687
|
-
const charts =
|
|
687
|
+
const charts = _chunkRLOIEDA3cjs.getDocumentCharts.call(void 0, editor().state.doc);
|
|
688
688
|
const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
|
|
689
689
|
if (args.chartId !== void 0) {
|
|
690
690
|
const chart = charts.find((c) => c.id === args.chartId);
|
|
@@ -711,7 +711,7 @@ function createDocumentChartTools(editor) {
|
|
|
711
711
|
annotations: { title: "List charts in the document", ...READ },
|
|
712
712
|
handler: ({ includeSpec = false }) => {
|
|
713
713
|
const doc = editor().state.doc;
|
|
714
|
-
return { charts:
|
|
714
|
+
return { charts: _chunkRLOIEDA3cjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
717
|
const insertChart = {
|
|
@@ -738,7 +738,7 @@ function createDocumentChartTools(editor) {
|
|
|
738
738
|
const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
|
|
739
739
|
const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
|
|
740
740
|
const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
|
|
741
|
-
const chart =
|
|
741
|
+
const chart = _chunkRLOIEDA3cjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
|
|
742
742
|
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.`);
|
|
743
743
|
return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
|
|
744
744
|
}
|
|
@@ -785,8 +785,8 @@ function createDocumentChartTools(editor) {
|
|
|
785
785
|
inputSchema: {
|
|
786
786
|
type: "object",
|
|
787
787
|
properties: {
|
|
788
|
-
values: { type: "array", items: _chunkGTF4RYXJcjs.VALUE, minItems: 1, maxItems:
|
|
789
|
-
kind: { type: "string", enum: [...
|
|
788
|
+
values: { type: "array", items: _chunkGTF4RYXJcjs.VALUE, minItems: 1, maxItems: _chunkRLOIEDA3cjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
|
|
789
|
+
kind: { type: "string", enum: [..._chunkRLOIEDA3cjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
|
|
790
790
|
at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
|
|
791
791
|
width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
|
|
792
792
|
height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
|
|
@@ -805,7 +805,7 @@ function createDocumentChartTools(editor) {
|
|
|
805
805
|
if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
|
|
806
806
|
const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
|
|
807
807
|
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}).`);
|
|
808
|
-
const stored =
|
|
808
|
+
const stored = _chunkRLOIEDA3cjs.normalizeSparklineValues.call(void 0, parsed);
|
|
809
809
|
ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
|
|
810
810
|
return { pos, kind, values: stored };
|
|
811
811
|
}
|
|
@@ -1143,8 +1143,8 @@ function createTextPresence(editor, providerId, option) {
|
|
|
1143
1143
|
const config = option === false ? null : option === true || option === void 0 ? {} : option;
|
|
1144
1144
|
const caret = {
|
|
1145
1145
|
id: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _43 => _43.id]), () => ( providerId)),
|
|
1146
|
-
name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _44 => _44.name]), () => (
|
|
1147
|
-
color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _45 => _45.color]), () => (
|
|
1146
|
+
name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _44 => _44.name]), () => ( _chunkRLOIEDA3cjs.DEFAULT_AGENT_CARET_NAME)),
|
|
1147
|
+
color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _45 => _45.color]), () => ( _chunkRLOIEDA3cjs.DEFAULT_AGENT_CARET_COLOR))
|
|
1148
1148
|
};
|
|
1149
1149
|
const typing = !_optionalChain([config, 'optionalAccess', _46 => _46.typing]) ? null : config.typing === true ? {} : config.typing;
|
|
1150
1150
|
const idleMs = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _47 => _47.idleMs]), () => ( 12e3));
|
|
@@ -1157,19 +1157,19 @@ function createTextPresence(editor, providerId, option) {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
const touch = () => {
|
|
1159
1159
|
clearTimeout(idleTimer);
|
|
1160
|
-
if (idleMs > 0) idleTimer = setTimeout(() => live() &&
|
|
1160
|
+
if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkRLOIEDA3cjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
|
|
1161
1161
|
};
|
|
1162
1162
|
const tint = (ed, ranges) => {
|
|
1163
1163
|
clearTimeout(tintTimer);
|
|
1164
|
-
|
|
1165
|
-
if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() &&
|
|
1164
|
+
_chunkRLOIEDA3cjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
|
|
1165
|
+
if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkRLOIEDA3cjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
|
|
1166
1166
|
};
|
|
1167
1167
|
return {
|
|
1168
1168
|
/** Puts the caret at `head`, selecting from `anchor`. */
|
|
1169
1169
|
show(anchor, head = anchor) {
|
|
1170
1170
|
const ed = live();
|
|
1171
1171
|
if (!ed) return;
|
|
1172
|
-
|
|
1172
|
+
_chunkRLOIEDA3cjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
|
|
1173
1173
|
touch();
|
|
1174
1174
|
},
|
|
1175
1175
|
/** Shows the caret after ranges just changed by a tool, tinting them. */
|
|
@@ -1177,7 +1177,7 @@ function createTextPresence(editor, providerId, option) {
|
|
|
1177
1177
|
const ed = live();
|
|
1178
1178
|
if (!ed || !ranges.length) return;
|
|
1179
1179
|
const last = ranges[ranges.length - 1];
|
|
1180
|
-
|
|
1180
|
+
_chunkRLOIEDA3cjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
|
|
1181
1181
|
tint(ed, ranges);
|
|
1182
1182
|
touch();
|
|
1183
1183
|
},
|
|
@@ -1185,12 +1185,12 @@ function createTextPresence(editor, providerId, option) {
|
|
|
1185
1185
|
async write(ed, from, to, text, signal) {
|
|
1186
1186
|
if (live() && typing) {
|
|
1187
1187
|
clearTimeout(tintTimer);
|
|
1188
|
-
const range2 = await
|
|
1189
|
-
if (changedMs > 0) tintTimer = setTimeout(() => live() &&
|
|
1188
|
+
const range2 = await _chunkRLOIEDA3cjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
|
|
1189
|
+
if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkRLOIEDA3cjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
|
|
1190
1190
|
touch();
|
|
1191
1191
|
return range2;
|
|
1192
1192
|
}
|
|
1193
|
-
const tr = _history.closeHistory.call(void 0,
|
|
1193
|
+
const tr = _history.closeHistory.call(void 0, _chunkRLOIEDA3cjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text));
|
|
1194
1194
|
const end = tr.mapping.map(to, 1);
|
|
1195
1195
|
const range = { from: Math.min(tr.mapping.map(from, -1), end), to: end };
|
|
1196
1196
|
ed.view.dispatch(tr.scrollIntoView());
|
|
@@ -1219,7 +1219,7 @@ function findMatches(editor, query, args, replacement) {
|
|
|
1219
1219
|
wholeWord: !!args.wholeWord,
|
|
1220
1220
|
...args.regex ? { regex: true } : { literal: true }
|
|
1221
1221
|
};
|
|
1222
|
-
const result =
|
|
1222
|
+
const result = _chunkRLOIEDA3cjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
|
|
1223
1223
|
if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
|
|
1224
1224
|
return { matches: result.matches, truncated: result.truncated };
|
|
1225
1225
|
}
|
|
@@ -1381,7 +1381,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1381
1381
|
replacement: String(replace).replace(/\r\n?|\n/g, "\r")
|
|
1382
1382
|
}));
|
|
1383
1383
|
const tr = _history.closeHistory.call(void 0, ed.state.tr);
|
|
1384
|
-
const ends =
|
|
1384
|
+
const ends = _chunkRLOIEDA3cjs.applyReplacements.call(void 0, tr, chosen);
|
|
1385
1385
|
ed.view.dispatch(tr.scrollIntoView());
|
|
1386
1386
|
const ranges = chosen.map((m, i) => ({ from: tr.mapping.map(m.from, -1), to: ends[i] }));
|
|
1387
1387
|
presence.changed(ranges.filter((r) => r.from < r.to));
|
|
@@ -1482,7 +1482,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1482
1482
|
inputSchema: {
|
|
1483
1483
|
type: "object",
|
|
1484
1484
|
properties: {
|
|
1485
|
-
operation: { type: "string", enum:
|
|
1485
|
+
operation: { type: "string", enum: _chunkRLOIEDA3cjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
|
|
1486
1486
|
at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
|
|
1487
1487
|
rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
|
|
1488
1488
|
cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
|
|
@@ -1512,10 +1512,10 @@ function createRichTextToolProvider(target, options) {
|
|
|
1512
1512
|
ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
|
|
1513
1513
|
}
|
|
1514
1514
|
const action = operation;
|
|
1515
|
-
const state =
|
|
1515
|
+
const state = _chunkRLOIEDA3cjs.getTableActionState.call(void 0, ed, action, params);
|
|
1516
1516
|
if (state !== true) throw new Error(state);
|
|
1517
|
-
|
|
1518
|
-
const table =
|
|
1517
|
+
_chunkRLOIEDA3cjs.runTableAction.call(void 0, ed, action, params);
|
|
1518
|
+
const table = _chunkRLOIEDA3cjs.getTableState.call(void 0, ed);
|
|
1519
1519
|
return {
|
|
1520
1520
|
operation,
|
|
1521
1521
|
table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
|
|
@@ -1534,7 +1534,7 @@ function createRichTextToolProvider(target, options) {
|
|
|
1534
1534
|
if (!ed || ed.isDestroyed) return [];
|
|
1535
1535
|
if (!ed.isEditable) return [getText, findText, ...charts.read()];
|
|
1536
1536
|
const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection, ...formatting.tools(ed)];
|
|
1537
|
-
return [...tools, ...
|
|
1537
|
+
return [...tools, ..._chunkRLOIEDA3cjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write().map(withCaret)];
|
|
1538
1538
|
},
|
|
1539
1539
|
subscribe: (notify) => {
|
|
1540
1540
|
const ed = editor();
|
package/dist/agent/index.js
CHANGED
|
@@ -121,12 +121,12 @@ import {
|
|
|
121
121
|
setAgentCaret,
|
|
122
122
|
sparklineLabel,
|
|
123
123
|
typeAgentText
|
|
124
|
-
} from "../chunk-
|
|
124
|
+
} from "../chunk-R2VHVQVY.js";
|
|
125
125
|
import {
|
|
126
126
|
describeChart
|
|
127
|
-
} from "../chunk-
|
|
127
|
+
} from "../chunk-KPWG3PSW.js";
|
|
128
128
|
import "../chunk-KGRZMHZB.js";
|
|
129
|
-
import "../chunk-
|
|
129
|
+
import "../chunk-OJQVKJYD.js";
|
|
130
130
|
import {
|
|
131
131
|
normalizeChartSpec,
|
|
132
132
|
parseChartValue
|
|
@@ -48,7 +48,7 @@ require('../chunk-NM3G4VQT.cjs');
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunkA3A5TI6Rcjs = require('../chunk-A3A5TI6R.cjs');
|
|
52
52
|
require('../chunk-WOFXZ3XU.cjs');
|
|
53
53
|
require('../chunk-EBDCRTZI.cjs');
|
|
54
54
|
require('../chunk-YQGCPL5X.cjs');
|
|
@@ -3827,7 +3827,7 @@ var AnimationEditorController = (_class = class {
|
|
|
3827
3827
|
|
|
3828
3828
|
|
|
3829
3829
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
3830
|
-
__init() {this.effects = new (0,
|
|
3830
|
+
__init() {this.effects = new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()}
|
|
3831
3831
|
|
|
3832
3832
|
|
|
3833
3833
|
__init2() {this.selection = null}
|
|
@@ -4012,7 +4012,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4012
4012
|
try {
|
|
4013
4013
|
plan = await work();
|
|
4014
4014
|
} catch (error) {
|
|
4015
|
-
if (
|
|
4015
|
+
if (_chunkA3A5TI6Rcjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
4016
4016
|
throw error;
|
|
4017
4017
|
}
|
|
4018
4018
|
const r = this.apply({ op: "replace_scene", scene: plan.scene }, plan.label, { merge });
|
|
@@ -4023,11 +4023,11 @@ var AnimationEditorController = (_class = class {
|
|
|
4023
4023
|
}
|
|
4024
4024
|
async describeFor(effect, kinds) {
|
|
4025
4025
|
const provider = this.effects.require();
|
|
4026
|
-
if (!provider.applyVectorEffect) throw new (0,
|
|
4026
|
+
if (!provider.applyVectorEffect) throw new (0, _chunkA3A5TI6Rcjs.EffectUnsupportedError)(`${provider.name} has no vector or motion effects.`);
|
|
4027
4027
|
const d = await provider.describe(effect);
|
|
4028
4028
|
if (!kinds.includes(d.kind)) {
|
|
4029
4029
|
const hint = d.kind === "motion" ? "apply it to nodes with apply_effect" : d.kind === "vector" ? "add it with add_vector_effect" : "it draws pixels, which scenes cannot hold";
|
|
4030
|
-
throw new (0,
|
|
4030
|
+
throw new (0, _chunkA3A5TI6Rcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.kind} effect: ${hint}.`, d.id);
|
|
4031
4031
|
}
|
|
4032
4032
|
return d;
|
|
4033
4033
|
}
|
|
@@ -4048,7 +4048,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4048
4048
|
return this.effectEdit(async () => {
|
|
4049
4049
|
this.knownNodes(targets);
|
|
4050
4050
|
const d = await this.describeFor(effect, ["motion"]);
|
|
4051
|
-
const values =
|
|
4051
|
+
const values = _chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4052
4052
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
4053
4053
|
const motion = await this.effects.require().applyVectorEffect(d.id, { svg: motionArtworkSvg(this.scene.artwork), nodeIds: [...targets] }, values);
|
|
4054
4054
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -4070,7 +4070,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4070
4070
|
addVectorEffect(effect, options = {}) {
|
|
4071
4071
|
return this.effectEdit(async () => {
|
|
4072
4072
|
const d = await this.describeFor(effect, ["vector"]);
|
|
4073
|
-
const values =
|
|
4073
|
+
const values = _chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4074
4074
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
4075
4075
|
const motion = await this.effects.require().applyVectorEffect(d.id, motionArtworkSvg(this.scene.artwork), values);
|
|
4076
4076
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -4094,7 +4094,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4094
4094
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4095
4095
|
else throw new Error(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4096
4096
|
}
|
|
4097
|
-
const merged = { ...base, ...
|
|
4097
|
+
const merged = { ...base, ..._chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4098
4098
|
const { scene: bare, place } = withoutMotionEffect(this.scene, instance);
|
|
4099
4099
|
const provider = this.effects.require();
|
|
4100
4100
|
const source = { instance, effect: d.id, provider: provider.id, name: d.name, values: merged };
|
|
@@ -5867,7 +5867,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
5867
5867
|
if (!r.ok) throw new Error(r.error);
|
|
5868
5868
|
return { target, effect: info(r.effect), effects: controller.appliedEffects().filter((e) => e.targets.includes(target)).map(info), ...r.notes.length ? { notes: r.notes } : {} };
|
|
5869
5869
|
};
|
|
5870
|
-
return withAnimationPlayback(
|
|
5870
|
+
return withAnimationPlayback(_chunkA3A5TI6Rcjs.createEffectToolProvider.call(void 0, {
|
|
5871
5871
|
id: _nullishCoalesce(options.id, () => ( "animation-effects")),
|
|
5872
5872
|
namespace: options.namespace,
|
|
5873
5873
|
title: "Animation effects",
|
package/dist/canvas/index.cjs
CHANGED
|
@@ -113,7 +113,7 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
|
113
113
|
var _chunkN2FGYZ4Qcjs = require('../chunk-N2FGYZ4Q.cjs');
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
var
|
|
116
|
+
var _chunkTUXKLM5Wcjs = require('../chunk-TUXKLM5W.cjs');
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
var _chunkOUO3DSRTcjs = require('../chunk-OUO3DSRT.cjs');
|
|
@@ -209,7 +209,7 @@ var _chunkNM3G4VQTcjs = require('../chunk-NM3G4VQT.cjs');
|
|
|
209
209
|
|
|
210
210
|
|
|
211
211
|
|
|
212
|
-
var
|
|
212
|
+
var _chunkA3A5TI6Rcjs = require('../chunk-A3A5TI6R.cjs');
|
|
213
213
|
require('../chunk-WOFXZ3XU.cjs');
|
|
214
214
|
|
|
215
215
|
|
|
@@ -8988,12 +8988,12 @@ function translatePath(d, dx, dy) {
|
|
|
8988
8988
|
}
|
|
8989
8989
|
var xyChartScene = ({ graph, theme }) => {
|
|
8990
8990
|
const box = _chunk3FSUJIXNcjs.XY_CHART_BOX;
|
|
8991
|
-
const scene =
|
|
8991
|
+
const scene = _chunkTUXKLM5Wcjs.layoutChart.call(void 0, xyChartSpec(graph, theme.palette), { width: box.width, height: box.height, theme: chartTheme(theme) });
|
|
8992
8992
|
return toDiagramMarks(scene.marks, box.x, box.y);
|
|
8993
8993
|
};
|
|
8994
8994
|
var radarScene = ({ graph, theme }) => {
|
|
8995
8995
|
const box = _chunk3FSUJIXNcjs.RADAR_CHART_BOX;
|
|
8996
|
-
const scene =
|
|
8996
|
+
const scene = _chunkTUXKLM5Wcjs.layoutChart.call(void 0, radarChartSpec(graph, theme.palette), { width: box.width, height: box.height, theme: chartTheme(theme) });
|
|
8997
8997
|
return toDiagramMarks(scene.marks, box.x, box.y);
|
|
8998
8998
|
};
|
|
8999
8999
|
|
|
@@ -11396,14 +11396,14 @@ function canvasNodeEffect(node) {
|
|
|
11396
11396
|
return _chunkNM3G4VQTcjs.isShapeDescription.call(void 0, shape) ? shape.effect : void 0;
|
|
11397
11397
|
}
|
|
11398
11398
|
function createCanvasEffectsController(options) {
|
|
11399
|
-
const slot = new (0,
|
|
11399
|
+
const slot = new (0, _chunkA3A5TI6Rcjs.EffectsSlot)();
|
|
11400
11400
|
if (options.effects) slot.set(options.effects);
|
|
11401
11401
|
const describe = async (effect, place2) => {
|
|
11402
11402
|
const d = await slot.require().describe(effect);
|
|
11403
11403
|
const allowed = CANVAS_EFFECT_PLACES[place2];
|
|
11404
11404
|
if (d.kind === "motion" || !d.uses.some((u) => allowed.includes(u))) {
|
|
11405
11405
|
const where = place2 === "transition" ? "a scene transition" : place2 === "fill" ? "a fill" : "an overlay";
|
|
11406
|
-
throw new (0,
|
|
11406
|
+
throw new (0, _chunkA3A5TI6Rcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.uses.join(" / ")} effect and cannot be ${where}, which takes ${allowed.join(" or ")} effects; search_effects with use "${allowed[0]}" lists ones that fit.`, d.id);
|
|
11407
11407
|
}
|
|
11408
11408
|
return d;
|
|
11409
11409
|
};
|
|
@@ -11434,7 +11434,7 @@ function createCanvasEffectsController(options) {
|
|
|
11434
11434
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
11435
11435
|
else throw new Error(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
11436
11436
|
}
|
|
11437
|
-
return { ...base, ...
|
|
11437
|
+
return { ...base, ..._chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
11438
11438
|
};
|
|
11439
11439
|
return {
|
|
11440
11440
|
/** The provider slot. */
|
|
@@ -11464,7 +11464,7 @@ function createCanvasEffectsController(options) {
|
|
|
11464
11464
|
const mode = _nullishCoalesce(opts.mode, () => ( "fill"));
|
|
11465
11465
|
const d = await describe(effect, mode);
|
|
11466
11466
|
if (opts.opacity !== void 0 && !(opts.opacity >= 0 && opts.opacity <= 1)) throw new Error("opacity must be from 0 to 1.");
|
|
11467
|
-
const next = { effect: d.id, provider: slot.require().id, name: d.name, values:
|
|
11467
|
+
const next = { effect: d.id, provider: slot.require().id, name: d.name, values: _chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, d, opts.values), mode, ...opts.opacity !== void 0 && opts.opacity !== 1 ? { opacity: opts.opacity } : {} };
|
|
11468
11468
|
commit(`Add effect ${d.name}`, withEffect(nodeId, next));
|
|
11469
11469
|
return next;
|
|
11470
11470
|
},
|
|
@@ -11521,7 +11521,7 @@ function createCanvasEffectsController(options) {
|
|
|
11521
11521
|
const d = await describe(effect, "transition");
|
|
11522
11522
|
const duration = _nullishCoalesce(_nullishCoalesce(opts.duration, () => ( d.duration)), () => ( 600));
|
|
11523
11523
|
if (!(duration > 0)) throw new Error("duration must be a number of ms above 0.");
|
|
11524
|
-
const transition = { effect: d.id, provider: slot.require().id, name: d.name, values:
|
|
11524
|
+
const transition = { effect: d.id, provider: slot.require().id, name: d.name, values: _chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, d, opts.values), duration };
|
|
11525
11525
|
scenes2.update(sceneId, { transition });
|
|
11526
11526
|
return transition;
|
|
11527
11527
|
}
|
|
@@ -11665,7 +11665,7 @@ function createCanvasEffectsToolProvider(controller, options = {}) {
|
|
|
11665
11665
|
const once = (instance) => {
|
|
11666
11666
|
if (instance !== "effect") throw new Error('A shape node has one effect, "effect".');
|
|
11667
11667
|
};
|
|
11668
|
-
return
|
|
11668
|
+
return _chunkA3A5TI6Rcjs.createEffectToolProvider.call(void 0, {
|
|
11669
11669
|
id: _nullishCoalesce(options.id, () => ( "canvas-effects")),
|
|
11670
11670
|
namespace: options.namespace,
|
|
11671
11671
|
title: "Canvas effects",
|
package/dist/canvas/index.js
CHANGED
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
} from "../chunk-5ED73EC6.js";
|
|
114
114
|
import {
|
|
115
115
|
layoutChart
|
|
116
|
-
} from "../chunk-
|
|
116
|
+
} from "../chunk-OJQVKJYD.js";
|
|
117
117
|
import {
|
|
118
118
|
createChartSpec
|
|
119
119
|
} from "../chunk-ORZF4JOO.js";
|
|
@@ -209,7 +209,7 @@ import {
|
|
|
209
209
|
EffectsSlot,
|
|
210
210
|
createEffectToolProvider,
|
|
211
211
|
resolveEffectValues
|
|
212
|
-
} from "../chunk-
|
|
212
|
+
} from "../chunk-6G2NLMVK.js";
|
|
213
213
|
import "../chunk-V2ZCJRDM.js";
|
|
214
214
|
import {
|
|
215
215
|
brushstrokeScaleBucket
|