@pixerate/editor 0.256.0 → 0.258.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/dist/agent/index.cjs +40 -38
- package/dist/agent/index.js +9 -7
- package/dist/animation/index.cjs +4 -2
- package/dist/animation/index.js +4 -2
- package/dist/animation-editor/index.cjs +63 -61
- package/dist/animation-editor/index.js +7 -5
- package/dist/brushes/colour.d.cts +11 -0
- package/dist/brushes/colour.d.ts +11 -0
- package/dist/brushes/index.cjs +51 -30
- package/dist/brushes/index.d.cts +1 -0
- package/dist/brushes/index.d.ts +1 -0
- package/dist/brushes/index.js +25 -4
- package/dist/brushes/resolve.d.cts +2 -0
- package/dist/brushes/resolve.d.ts +2 -0
- package/dist/brushes/schema.d.cts +1 -0
- package/dist/brushes/schema.d.ts +1 -0
- package/dist/brushes/tools.d.cts +7 -0
- package/dist/brushes/tools.d.ts +7 -0
- package/dist/brushes/types.d.cts +10 -2
- package/dist/brushes/types.d.ts +10 -2
- package/dist/brushes/ui.d.cts +14 -3
- package/dist/brushes/ui.d.ts +14 -3
- package/dist/{brushstrokeRender-HCOQUSWW.js → brushstrokeRender-JI4W6F2G.js} +2 -2
- package/dist/{brushstrokeRender-ZZOXI5O5.cjs → brushstrokeRender-MQ6PSDM5.cjs} +11 -11
- package/dist/canvas/index.cjs +20 -18
- package/dist/canvas/index.js +7 -5
- package/dist/chart/index.cjs +159 -157
- package/dist/chart/index.js +9 -7
- package/dist/{chunk-7272D3K2.js → chunk-2EUW2XZX.js} +27 -276
- package/dist/{chunk-L6Y7TSQ4.js → chunk-2VJ6OVJV.js} +1 -1
- package/dist/{chunk-6ZZKRH7R.js → chunk-47V3WXDG.js} +2 -2
- package/dist/{chunk-H7ET2ISK.cjs → chunk-4IMD2TLY.cjs} +52 -52
- package/dist/{chunk-VUKUTT2W.js → chunk-4M4E3N6X.js} +1 -1
- package/dist/{chunk-TBAVCLEQ.cjs → chunk-5Q5MLXAD.cjs} +23 -23
- package/dist/{chunk-MONXNVZK.js → chunk-6I23ZCGK.js} +5 -3
- package/dist/{chunk-GOBOCZZI.js → chunk-6NQPKNUZ.js} +1 -1
- package/dist/{chunk-WYGSR3IJ.js → chunk-AORZ5M5C.js} +1 -1
- package/dist/chunk-AVTPZO4Z.cjs +142 -0
- package/dist/{chunk-WKMUBATU.js → chunk-C2WEIEUB.js} +1 -1
- package/dist/{chunk-P3K2JCJA.js → chunk-D5BXSOSU.js} +3 -3
- package/dist/chunk-E2V5DA3W.js +36 -0
- package/dist/{chunk-WZOGDKCQ.js → chunk-F7CPSRLN.js} +0 -133
- package/dist/chunk-FJBQTZS4.js +17 -0
- package/dist/{chunk-SOSBOS5T.cjs → chunk-G23BTQA5.cjs} +22 -22
- package/dist/{chunk-EUIDTZNQ.cjs → chunk-I3Y2Q3PM.cjs} +59 -308
- package/dist/{chunk-YHUMGBZD.js → chunk-ICTPLVSR.js} +22 -4
- package/dist/{chunk-LRNUZKWV.cjs → chunk-IPUTIUGQ.cjs} +1 -1
- package/dist/{chunk-6GRUVGKU.js → chunk-ITURMC2M.js} +3 -3
- package/dist/{chunk-HYWRU5VX.js → chunk-IXQZHCOF.js} +1 -1
- package/dist/chunk-J5UQHWVL.js +142 -0
- package/dist/{chunk-YBAPT7NL.js → chunk-JC2SHA4A.js} +1 -23
- package/dist/chunk-LRTR4ASZ.cjs +17 -0
- package/dist/{chunk-HUAISCUX.cjs → chunk-M2HG5DJ2.cjs} +18 -18
- package/dist/{chunk-N76AMOKE.cjs → chunk-MDLEGVEN.cjs} +42 -42
- package/dist/chunk-MEGSQUQO.cjs +36 -0
- package/dist/chunk-MLLTWAXH.cjs +276 -0
- package/dist/{chunk-RHPSE2YR.js → chunk-MQ6MGIQM.js} +2 -2
- package/dist/{chunk-PGPFWC35.cjs → chunk-MQGQTKVW.cjs} +51 -33
- package/dist/{chunk-5YWWQ36H.cjs → chunk-O3ZVZSNJ.cjs} +9 -9
- package/dist/{chunk-GCTUOTCW.cjs → chunk-P3PZ63M3.cjs} +35 -35
- package/dist/{chunk-WRZ6C4TU.cjs → chunk-P6WYDBTH.cjs} +4 -4
- package/dist/{chunk-CJ6TBL2N.cjs → chunk-RHEMMGCN.cjs} +16 -16
- package/dist/{chunk-HIMGBZAM.cjs → chunk-RSIKDWOP.cjs} +201 -38
- package/dist/{chunk-SABJMH6M.cjs → chunk-RVGP2XLF.cjs} +2 -135
- package/dist/{chunk-JVRLGV3C.js → chunk-SMTUQWGY.js} +184 -21
- package/dist/{chunk-DMTEQ6SH.js → chunk-SSFMWJDK.js} +4 -4
- package/dist/{chunk-TFF2GTGN.cjs → chunk-SXQHWXEL.cjs} +2 -24
- package/dist/{chunk-IWEVV63O.cjs → chunk-UEYLANO3.cjs} +18 -16
- package/dist/chunk-VR6OGHU5.js +276 -0
- package/dist/{chunk-AF23QK5F.js → chunk-YQ4PQTBB.js} +1 -1
- package/dist/{chunk-B7V34GIH.cjs → chunk-YSGW7VV4.cjs} +88 -88
- package/dist/{chunk-3NS5C7FB.cjs → chunk-YYBW6DF2.cjs} +76 -76
- package/dist/{chunk-UFEDHACQ.js → chunk-Z7BX4TWO.js} +2 -2
- package/dist/{chunk-RUONPPMC.cjs → chunk-ZSE25IZA.cjs} +8 -8
- package/dist/color/index.cjs +7 -3
- package/dist/color/index.js +18 -14
- package/dist/export/index.cjs +8 -6
- package/dist/export/index.js +7 -5
- package/dist/extensions/index.cjs +11 -9
- package/dist/extensions/index.js +10 -8
- package/dist/gradient/index.cjs +33 -31
- package/dist/gradient/index.js +5 -3
- package/dist/image-editor/brush-presets.d.cts +4 -1
- package/dist/image-editor/brush-presets.d.ts +4 -1
- package/dist/image-editor/controller.d.cts +10 -5
- package/dist/image-editor/controller.d.ts +10 -5
- package/dist/image-editor/index.cjs +1090 -1073
- package/dist/image-editor/index.js +37 -20
- package/dist/index.cjs +17 -15
- package/dist/index.js +11 -9
- package/dist/paint-editor/brushes.d.cts +18 -1
- package/dist/paint-editor/brushes.d.ts +18 -1
- package/dist/paint-editor/collaboration.d.cts +38 -0
- package/dist/paint-editor/collaboration.d.ts +38 -0
- package/dist/paint-editor/controller.d.cts +60 -0
- package/dist/paint-editor/controller.d.ts +60 -0
- package/dist/paint-editor/engine.d.cts +7 -0
- package/dist/paint-editor/engine.d.ts +7 -0
- package/dist/paint-editor/index.cjs +1564 -1324
- package/dist/paint-editor/index.js +1198 -958
- package/dist/paint-editor/mark-settings.d.cts +1 -1
- package/dist/paint-editor/mark-settings.d.ts +1 -1
- package/dist/paint-editor/procedural.d.cts +4 -2
- package/dist/paint-editor/procedural.d.ts +4 -2
- package/dist/paint-editor/stamp-tip.d.cts +45 -0
- package/dist/paint-editor/stamp-tip.d.ts +45 -0
- package/dist/paint-editor/stroke.d.cts +4 -0
- package/dist/paint-editor/stroke.d.ts +4 -0
- package/dist/stickers/index.cjs +4 -2
- package/dist/stickers/index.js +6 -4
- package/dist/typography/index.cjs +3 -2
- package/dist/typography/index.js +2 -1
- package/dist/vector/index.cjs +971 -969
- package/dist/vector/index.js +8 -6
- package/dist/video-editor/index.cjs +4 -2
- package/dist/video-editor/index.js +4 -2
- package/package.json +1 -1
- package/skills/pixerate-brushes/SKILL.md +21 -11
- package/skills/pixerate-brushes-design/SKILL.md +6 -2
- package/skills/pixerate-brushes-design/evals/canvas-chalk.json +8 -8
- package/skills/pixerate-canvas/SKILL.md +3 -2
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +5 -1
- package/skills/pixerate-vector/SKILL.md +1 -1
|
@@ -7,7 +7,7 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkM2HG5DJ2cjs = require('./chunk-M2HG5DJ2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
@@ -35,10 +35,10 @@ var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkRHEMMGCNcjs = require('./chunk-RHEMMGCN.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunkP6WYDBTHcjs = require('./chunk-P6WYDBTH.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -2296,13 +2296,13 @@ async function loadCharts(zip, Parser, root, rels, options) {
|
|
|
2296
2296
|
const charts = /* @__PURE__ */ new Map();
|
|
2297
2297
|
if (options.charts === false) return charts;
|
|
2298
2298
|
for (const el of descendants(root, "chart")) {
|
|
2299
|
-
if (el.namespaceURI !==
|
|
2299
|
+
if (el.namespaceURI !== _chunkM2HG5DJ2cjs.CHART_OOXML_NS) continue;
|
|
2300
2300
|
const id = attr(el, "id");
|
|
2301
2301
|
const rel = id ? rels.get(id) : void 0;
|
|
2302
2302
|
if (!id || !rel || rel.external || charts.has(id)) continue;
|
|
2303
2303
|
const entry = zip.get(rel.target);
|
|
2304
2304
|
if (!entry) continue;
|
|
2305
|
-
const read =
|
|
2305
|
+
const read = _chunkM2HG5DJ2cjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
|
|
2306
2306
|
charts.set(id, {
|
|
2307
2307
|
id: `chart-${charts.size + 1}`,
|
|
2308
2308
|
path: rel.target,
|
|
@@ -2316,7 +2316,7 @@ async function loadCharts(zip, Parser, root, rels, options) {
|
|
|
2316
2316
|
return charts;
|
|
2317
2317
|
}
|
|
2318
2318
|
function chartBlockHtml(chart) {
|
|
2319
|
-
const [head, ...rows] =
|
|
2319
|
+
const [head, ...rows] = _chunkP6WYDBTHcjs.chartDataToTable.call(void 0, chart.spec);
|
|
2320
2320
|
const cell = (v, tag) => `<${tag}><p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, v === null || v === void 0 ? "" : String(v))}</p></${tag}>`;
|
|
2321
2321
|
const table = `<table><tbody><tr>${head.map((h) => cell(h, "th")).join("")}</tr>${rows.map((r) => `<tr>${r.map((v, i) => cell(v, i ? "td" : "th")).join("")}</tr>`).join("")}</tbody></table>`;
|
|
2322
2322
|
const caption = `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, `[Chart: ${chart.title || "untitled"}]`)}</p>`;
|
|
@@ -2969,7 +2969,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
2969
2969
|
};
|
|
2970
2970
|
if (child.localName === "AlternateContent") {
|
|
2971
2971
|
const branch = childElements(child).find(
|
|
2972
|
-
(b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI ===
|
|
2972
|
+
(b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunkM2HG5DJ2cjs.CHART_OOXML_NS)
|
|
2973
2973
|
);
|
|
2974
2974
|
if (branch) this.image(branch, format, push);
|
|
2975
2975
|
return;
|
|
@@ -3036,7 +3036,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
3036
3036
|
/** Charts this paragraph contains, in order. */
|
|
3037
3037
|
__init4() {this.charts = []}
|
|
3038
3038
|
image(container, format, push) {
|
|
3039
|
-
const chartRef = descendants(container, "chart").find((el) => el.namespaceURI ===
|
|
3039
|
+
const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunkM2HG5DJ2cjs.CHART_OOXML_NS);
|
|
3040
3040
|
const chart = chartRef ? this.part.charts.get(_nullishCoalesce(attr(chartRef, "id"), () => ( ""))) : void 0;
|
|
3041
3041
|
if (chart) {
|
|
3042
3042
|
if (!this.ctx.charts.includes(chart)) this.ctx.charts.push(chart);
|
|
@@ -3475,9 +3475,9 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
3475
3475
|
if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
|
|
3476
3476
|
from = to = _state.Selection.near(state.doc.resolve(from)).from;
|
|
3477
3477
|
}
|
|
3478
|
-
if (htmlSlice &&
|
|
3478
|
+
if (htmlSlice && _chunkRHEMMGCNcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkRHEMMGCNcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
|
|
3479
3479
|
const tr2 = state.tr;
|
|
3480
|
-
const end2 =
|
|
3480
|
+
const end2 = _chunkRHEMMGCNcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
|
|
3481
3481
|
if (end2 !== null) {
|
|
3482
3482
|
if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
|
|
3483
3483
|
view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
@@ -3654,7 +3654,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3654
3654
|
const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
|
|
3655
3655
|
if (!slice) return false;
|
|
3656
3656
|
event.preventDefault();
|
|
3657
|
-
if (
|
|
3657
|
+
if (_chunkRHEMMGCNcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
|
|
3658
3658
|
view.dispatch(
|
|
3659
3659
|
view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
|
|
3660
3660
|
);
|
|
@@ -4055,7 +4055,7 @@ function createOutlineStore(editor) {
|
|
|
4055
4055
|
if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
|
|
4056
4056
|
const headings = getOutline(editor);
|
|
4057
4057
|
const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _153 => _153(editor, headings), 'optionalAccess', _154 => _154.id]), () => ( null));
|
|
4058
|
-
const sameStructure =
|
|
4058
|
+
const sameStructure = _chunkRHEMMGCNcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
|
|
4059
4059
|
if (sameStructure && snapshot.activeId === activeId) return snapshot;
|
|
4060
4060
|
return {
|
|
4061
4061
|
headings: sameStructure ? snapshot.headings : headings,
|
|
@@ -4103,7 +4103,7 @@ function navigateToHeading(editor, heading, options = {}) {
|
|
|
4103
4103
|
editor.view.dispatch(tr);
|
|
4104
4104
|
editor.view.focus();
|
|
4105
4105
|
}
|
|
4106
|
-
|
|
4106
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
|
|
4107
4107
|
return true;
|
|
4108
4108
|
}
|
|
4109
4109
|
function assignHeadingIds(state, types, generateId) {
|
|
@@ -4128,11 +4128,11 @@ function assignHeadingIds(state, types, generateId) {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
var Outline = _core.Extension.create({
|
|
4130
4130
|
name: "outline",
|
|
4131
|
-
priority:
|
|
4131
|
+
priority: _chunkRHEMMGCNcjs.STRUCTURE_PRIORITY,
|
|
4132
4132
|
addOptions() {
|
|
4133
4133
|
return {
|
|
4134
4134
|
types: ["heading"],
|
|
4135
|
-
generateId: () =>
|
|
4135
|
+
generateId: () => _chunkRHEMMGCNcjs.generateStructureId.call(void 0, "h"),
|
|
4136
4136
|
onUpdate: void 0
|
|
4137
4137
|
};
|
|
4138
4138
|
},
|
|
@@ -4165,14 +4165,14 @@ var Outline = _core.Extension.create({
|
|
|
4165
4165
|
tr.scrollIntoView();
|
|
4166
4166
|
_optionalChain([view, 'optionalAccess', _161 => _161.focus, 'optionalCall', _162 => _162()]);
|
|
4167
4167
|
}
|
|
4168
|
-
|
|
4168
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4169
4169
|
}
|
|
4170
4170
|
return true;
|
|
4171
4171
|
},
|
|
4172
4172
|
scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
|
|
4173
4173
|
const heading = findHeading(state, id);
|
|
4174
4174
|
if (!heading) return false;
|
|
4175
|
-
if (dispatch)
|
|
4175
|
+
if (dispatch) _chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4176
4176
|
return true;
|
|
4177
4177
|
}
|
|
4178
4178
|
};
|
|
@@ -4193,7 +4193,7 @@ var Outline = _core.Extension.create({
|
|
|
4193
4193
|
apply: (tr, prev, _oldState, newState) => {
|
|
4194
4194
|
if (!tr.docChanged) return prev;
|
|
4195
4195
|
const next = computeOutline(newState.doc, types);
|
|
4196
|
-
if (
|
|
4196
|
+
if (_chunkRHEMMGCNcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
|
|
4197
4197
|
storage.headings = next;
|
|
4198
4198
|
_optionalChain([onUpdate, 'call', _163 => _163(), 'optionalCall', _164 => _164(next)]);
|
|
4199
4199
|
return next;
|
|
@@ -4211,7 +4211,7 @@ var Outline = _core.Extension.create({
|
|
|
4211
4211
|
},
|
|
4212
4212
|
onBeforeCreate() {
|
|
4213
4213
|
const { types, generateId } = this.options;
|
|
4214
|
-
|
|
4214
|
+
_chunkRHEMMGCNcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
|
|
4215
4215
|
}
|
|
4216
4216
|
});
|
|
4217
4217
|
|
|
@@ -4381,7 +4381,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4381
4381
|
node.attrs.minLevel,
|
|
4382
4382
|
node.attrs.maxLevel
|
|
4383
4383
|
);
|
|
4384
|
-
if (!
|
|
4384
|
+
if (!_chunkRHEMMGCNcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
|
|
4385
4385
|
tr = _nullishCoalesce(tr, () => ( state.tr));
|
|
4386
4386
|
tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
|
|
4387
4387
|
}
|
|
@@ -4393,7 +4393,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
var TableOfContents = _core.Node.create({
|
|
4395
4395
|
name: "tableOfContents",
|
|
4396
|
-
priority:
|
|
4396
|
+
priority: _chunkRHEMMGCNcjs.STRUCTURE_PRIORITY - 5,
|
|
4397
4397
|
group: "block",
|
|
4398
4398
|
atom: true,
|
|
4399
4399
|
selectable: true,
|
|
@@ -4504,7 +4504,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4504
4504
|
return [
|
|
4505
4505
|
new (0, _state.Plugin)({
|
|
4506
4506
|
key: tableOfContentsPluginKey,
|
|
4507
|
-
state:
|
|
4507
|
+
state: _chunkRHEMMGCNcjs.presenceStateSpec.call(void 0, [this.name]),
|
|
4508
4508
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4509
4509
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
4510
4510
|
if (!tableOfContentsPluginKey.getState(newState)) return null;
|
|
@@ -4528,7 +4528,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4528
4528
|
);
|
|
4529
4529
|
view.focus();
|
|
4530
4530
|
}
|
|
4531
|
-
|
|
4531
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, heading.pos);
|
|
4532
4532
|
return true;
|
|
4533
4533
|
}
|
|
4534
4534
|
}
|
|
@@ -4538,7 +4538,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4538
4538
|
},
|
|
4539
4539
|
onBeforeCreate() {
|
|
4540
4540
|
const { headingTypes } = this.options;
|
|
4541
|
-
|
|
4541
|
+
_chunkRHEMMGCNcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
|
|
4542
4542
|
}
|
|
4543
4543
|
});
|
|
4544
4544
|
|
|
@@ -4596,7 +4596,7 @@ function syncFootnotes(tr, options = {}) {
|
|
|
4596
4596
|
const listType = schema.nodes[LIST];
|
|
4597
4597
|
const itemType = schema.nodes[ITEM];
|
|
4598
4598
|
if (!listType || !itemType) return false;
|
|
4599
|
-
const generateId = _nullishCoalesce(options.generateId, () => ( (() =>
|
|
4599
|
+
const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkRHEMMGCNcjs.generateStructureId.call(void 0, "fn"))));
|
|
4600
4600
|
const refs = [];
|
|
4601
4601
|
const lists = [];
|
|
4602
4602
|
const existing = /* @__PURE__ */ new Map();
|
|
@@ -4680,7 +4680,7 @@ function findReferences(doc, id) {
|
|
|
4680
4680
|
}
|
|
4681
4681
|
var FootnoteReference = _core.Node.create({
|
|
4682
4682
|
name: REFERENCE,
|
|
4683
|
-
priority:
|
|
4683
|
+
priority: _chunkRHEMMGCNcjs.STRUCTURE_PRIORITY - 5,
|
|
4684
4684
|
group: "inline",
|
|
4685
4685
|
inline: true,
|
|
4686
4686
|
atom: true,
|
|
@@ -4688,7 +4688,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4688
4688
|
addOptions() {
|
|
4689
4689
|
return {
|
|
4690
4690
|
HTMLAttributes: {},
|
|
4691
|
-
generateId: () =>
|
|
4691
|
+
generateId: () => _chunkRHEMMGCNcjs.generateStructureId.call(void 0, "fn")
|
|
4692
4692
|
};
|
|
4693
4693
|
},
|
|
4694
4694
|
addAttributes() {
|
|
@@ -4799,7 +4799,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4799
4799
|
_state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
|
|
4800
4800
|
);
|
|
4801
4801
|
tr.scrollIntoView();
|
|
4802
|
-
|
|
4802
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
|
|
4803
4803
|
}
|
|
4804
4804
|
return true;
|
|
4805
4805
|
},
|
|
@@ -4809,7 +4809,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4809
4809
|
if (dispatch) {
|
|
4810
4810
|
tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
|
|
4811
4811
|
tr.scrollIntoView();
|
|
4812
|
-
|
|
4812
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, ref.pos);
|
|
4813
4813
|
}
|
|
4814
4814
|
return true;
|
|
4815
4815
|
}
|
|
@@ -4821,7 +4821,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4821
4821
|
return [
|
|
4822
4822
|
new (0, _state.Plugin)({
|
|
4823
4823
|
key: footnotesPluginKey,
|
|
4824
|
-
state:
|
|
4824
|
+
state: _chunkRHEMMGCNcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
|
|
4825
4825
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4826
4826
|
if (!transactions.some((tr2) => tr2.docChanged)) return null;
|
|
4827
4827
|
if (!footnotesPluginKey.getState(newState)) return null;
|
|
@@ -4842,7 +4842,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4842
4842
|
},
|
|
4843
4843
|
onBeforeCreate() {
|
|
4844
4844
|
const { generateId } = this.options;
|
|
4845
|
-
|
|
4845
|
+
_chunkRHEMMGCNcjs.syncInitialContent.call(void 0, this.editor, (state) => {
|
|
4846
4846
|
const tr = state.tr;
|
|
4847
4847
|
return syncFootnotes(tr, { generateId }) ? tr : null;
|
|
4848
4848
|
});
|
|
@@ -4982,7 +4982,7 @@ var Bookmark = _core.Mark.create({
|
|
|
4982
4982
|
addOptions() {
|
|
4983
4983
|
return {
|
|
4984
4984
|
HTMLAttributes: {},
|
|
4985
|
-
generateId: () =>
|
|
4985
|
+
generateId: () => _chunkRHEMMGCNcjs.generateStructureId.call(void 0, "bm")
|
|
4986
4986
|
};
|
|
4987
4987
|
},
|
|
4988
4988
|
addAttributes() {
|
|
@@ -5067,7 +5067,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5067
5067
|
tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
|
|
5068
5068
|
tr.scrollIntoView();
|
|
5069
5069
|
const domPos = state.doc.resolve(bookmark.from);
|
|
5070
|
-
|
|
5070
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
|
|
5071
5071
|
}
|
|
5072
5072
|
return true;
|
|
5073
5073
|
}
|
|
@@ -5132,7 +5132,7 @@ function syncCrossReferences(state, headingTypes) {
|
|
|
5132
5132
|
}
|
|
5133
5133
|
var CrossReference = _core.Node.create({
|
|
5134
5134
|
name: NAME,
|
|
5135
|
-
priority:
|
|
5135
|
+
priority: _chunkRHEMMGCNcjs.STRUCTURE_PRIORITY - 5,
|
|
5136
5136
|
group: "inline",
|
|
5137
5137
|
inline: true,
|
|
5138
5138
|
atom: true,
|
|
@@ -5234,7 +5234,7 @@ var CrossReference = _core.Node.create({
|
|
|
5234
5234
|
if (dispatch) {
|
|
5235
5235
|
tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
|
|
5236
5236
|
tr.scrollIntoView();
|
|
5237
|
-
|
|
5237
|
+
_chunkRHEMMGCNcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
|
|
5238
5238
|
}
|
|
5239
5239
|
return true;
|
|
5240
5240
|
}
|
|
@@ -5246,7 +5246,7 @@ var CrossReference = _core.Node.create({
|
|
|
5246
5246
|
return [
|
|
5247
5247
|
new (0, _state.Plugin)({
|
|
5248
5248
|
key: crossReferencePluginKey,
|
|
5249
|
-
state:
|
|
5249
|
+
state: _chunkRHEMMGCNcjs.presenceStateSpec.call(void 0, [NAME]),
|
|
5250
5250
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
5251
5251
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
5252
5252
|
if (!crossReferencePluginKey.getState(newState)) return null;
|
|
@@ -5265,7 +5265,7 @@ var CrossReference = _core.Node.create({
|
|
|
5265
5265
|
},
|
|
5266
5266
|
onBeforeCreate() {
|
|
5267
5267
|
const { headingTypes } = this.options;
|
|
5268
|
-
|
|
5268
|
+
_chunkRHEMMGCNcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
|
|
5269
5269
|
}
|
|
5270
5270
|
});
|
|
5271
5271
|
|
|
@@ -5520,7 +5520,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5520
5520
|
if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
|
|
5521
5521
|
if (dispatch) {
|
|
5522
5522
|
_history.closeHistory.call(void 0, tr);
|
|
5523
|
-
const [end] =
|
|
5523
|
+
const [end] = _chunkRHEMMGCNcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
|
|
5524
5524
|
tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
|
|
5525
5525
|
meta(tr, { type: "replaced", anchor: end, count: 1 });
|
|
5526
5526
|
}
|
|
@@ -5531,7 +5531,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5531
5531
|
if (!s || !s.active || !s.matches.length) return false;
|
|
5532
5532
|
if (dispatch) {
|
|
5533
5533
|
_history.closeHistory.call(void 0, tr);
|
|
5534
|
-
const ends =
|
|
5534
|
+
const ends = _chunkRHEMMGCNcjs.applyReplacements.call(void 0, tr, s.matches);
|
|
5535
5535
|
meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
|
|
5536
5536
|
}
|
|
5537
5537
|
return true;
|
|
@@ -5563,7 +5563,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5563
5563
|
if (!s.active || !s.query) {
|
|
5564
5564
|
return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
|
|
5565
5565
|
}
|
|
5566
|
-
const result =
|
|
5566
|
+
const result = _chunkRHEMMGCNcjs.searchDocument.call(void 0, doc, s.query, s.options, {
|
|
5567
5567
|
replacement: s.replacement,
|
|
5568
5568
|
clipboardText: safeClipboard(options.getClipboardText),
|
|
5569
5569
|
timeLimitMs: options.timeLimitMs,
|
|
@@ -6150,7 +6150,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6150
6150
|
})
|
|
6151
6151
|
];
|
|
6152
6152
|
if (options.table !== false) {
|
|
6153
|
-
extensions2.push(...
|
|
6153
|
+
extensions2.push(..._chunkRHEMMGCNcjs.createTableExtensions.call(void 0, optionObject(options.table)));
|
|
6154
6154
|
}
|
|
6155
6155
|
if (characterLimit) {
|
|
6156
6156
|
extensions2.push(
|
|
@@ -6207,7 +6207,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6207
6207
|
}
|
|
6208
6208
|
if (options.comments) {
|
|
6209
6209
|
extensions2.push(
|
|
6210
|
-
typeof options.comments === "object" ?
|
|
6210
|
+
typeof options.comments === "object" ? _chunkRHEMMGCNcjs.Comments.configure(options.comments) : _chunkRHEMMGCNcjs.Comments
|
|
6211
6211
|
);
|
|
6212
6212
|
}
|
|
6213
6213
|
if (options.trackChanges) {
|
|
@@ -6257,8 +6257,8 @@ function createRichTextPreset(options = {}) {
|
|
|
6257
6257
|
}
|
|
6258
6258
|
if (options.chart) {
|
|
6259
6259
|
const { sparkline = true, ...chartOptions } = optionObject(options.chart);
|
|
6260
|
-
extensions2.push(
|
|
6261
|
-
if (sparkline) extensions2.push(
|
|
6260
|
+
extensions2.push(_chunkRHEMMGCNcjs.Chart.configure(chartOptions));
|
|
6261
|
+
if (sparkline) extensions2.push(_chunkRHEMMGCNcjs.Sparkline.configure(optionObject(sparkline)));
|
|
6262
6262
|
}
|
|
6263
6263
|
if (options.paragraphStyles) {
|
|
6264
6264
|
extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
|
|
@@ -6399,7 +6399,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6399
6399
|
];
|
|
6400
6400
|
}
|
|
6401
6401
|
function validateFindPattern(query, options = {}) {
|
|
6402
|
-
const result =
|
|
6402
|
+
const result = _chunkRHEMMGCNcjs.compileFindPattern.call(void 0, query, options);
|
|
6403
6403
|
return result.ok ? null : result.error;
|
|
6404
6404
|
}
|
|
6405
6405
|
|
|
@@ -6408,8 +6408,8 @@ var PARAMS = {
|
|
|
6408
6408
|
insertTable: {
|
|
6409
6409
|
type: "object",
|
|
6410
6410
|
properties: {
|
|
6411
|
-
rows: { type: "integer", minimum: 1, maximum:
|
|
6412
|
-
cols: { type: "integer", minimum: 1, maximum:
|
|
6411
|
+
rows: { type: "integer", minimum: 1, maximum: _chunkRHEMMGCNcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
|
|
6412
|
+
cols: { type: "integer", minimum: 1, maximum: _chunkRHEMMGCNcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
|
|
6413
6413
|
withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
|
|
6414
6414
|
},
|
|
6415
6415
|
additionalProperties: false
|
|
@@ -6440,7 +6440,7 @@ function createTableCommands(editor, options = {}) {
|
|
|
6440
6440
|
const group = _nullishCoalesce(options.group, () => ( "Table"));
|
|
6441
6441
|
const scope = options.scope ? { scope: options.scope } : {};
|
|
6442
6442
|
const focus = _nullishCoalesce(options.focus, () => ( true));
|
|
6443
|
-
return
|
|
6443
|
+
return _chunkRHEMMGCNcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
|
|
6444
6444
|
const params = PARAMS[action];
|
|
6445
6445
|
return {
|
|
6446
6446
|
id: `${prefix}${action}`,
|
|
@@ -6450,13 +6450,13 @@ function createTableCommands(editor, options = {}) {
|
|
|
6450
6450
|
description,
|
|
6451
6451
|
...params ? { params } : {},
|
|
6452
6452
|
...scope,
|
|
6453
|
-
enabled: (_ctx, p) =>
|
|
6453
|
+
enabled: (_ctx, p) => _chunkRHEMMGCNcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
|
|
6454
6454
|
run: (_ctx, p) => {
|
|
6455
|
-
if (!
|
|
6456
|
-
const reason =
|
|
6455
|
+
if (!_chunkRHEMMGCNcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
|
|
6456
|
+
const reason = _chunkRHEMMGCNcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
|
|
6457
6457
|
throw new Error(reason === true ? `${label} did not change the document.` : reason);
|
|
6458
6458
|
}
|
|
6459
|
-
const state =
|
|
6459
|
+
const state = _chunkRHEMMGCNcjs.getTableState.call(void 0, editor);
|
|
6460
6460
|
return {
|
|
6461
6461
|
done: true,
|
|
6462
6462
|
table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkO3ZVZSNJcjs = require('./chunk-O3ZVZSNJ.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkGF2RBSDMcjs = require('./chunk-GF2RBSDM.cjs');
|
|
@@ -1361,12 +1361,12 @@ var unit = (x, y) => {
|
|
|
1361
1361
|
return l > 1e-12 && Number.isFinite(l) ? [x / l, y / l] : null;
|
|
1362
1362
|
};
|
|
1363
1363
|
function cubicOf(sp, i) {
|
|
1364
|
-
const s =
|
|
1364
|
+
const s = _chunkO3ZVZSNJcjs.subpathSegment.call(void 0, sp, i);
|
|
1365
1365
|
if (s.length === 4) return s;
|
|
1366
1366
|
const [a, b] = s;
|
|
1367
1367
|
return [a, [a[0] + (b[0] - a[0]) / 3, a[1] + (b[1] - a[1]) / 3], [a[0] + 2 * (b[0] - a[0]) / 3, a[1] + 2 * (b[1] - a[1]) / 3], b];
|
|
1368
1368
|
}
|
|
1369
|
-
var isLine = (sp, i) =>
|
|
1369
|
+
var isLine = (sp, i) => _chunkO3ZVZSNJcjs.subpathSegment.call(void 0, sp, i).length === 2;
|
|
1370
1370
|
function startTangent(c) {
|
|
1371
1371
|
for (let k = 1; k < 4; k++) {
|
|
1372
1372
|
const u = unit(c[k][0] - c[0][0], c[k][1] - c[0][1]);
|
|
@@ -1386,10 +1386,10 @@ function sample(c, n, out, withStart) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
var onAnchor = (a, h) => !h || Math.abs(h.x - a.x) < EPS && Math.abs(h.y - a.y) < EPS;
|
|
1388
1388
|
function tidy(a, keepType = true) {
|
|
1389
|
-
const next =
|
|
1389
|
+
const next = _chunkO3ZVZSNJcjs.cloneAnchor.call(void 0, a);
|
|
1390
1390
|
if (onAnchor(next, next.in)) delete next.in;
|
|
1391
1391
|
if (onAnchor(next, next.out)) delete next.out;
|
|
1392
|
-
const shown =
|
|
1392
|
+
const shown = _chunkO3ZVZSNJcjs.inferAnchorType.call(void 0, next);
|
|
1393
1393
|
const type = keepType && a.type ? a.type === "symmetric" && shown !== "symmetric" ? shown === "corner" ? "corner" : "smooth" : a.type === "smooth" && shown === "corner" ? "corner" : a.type : shown;
|
|
1394
1394
|
if (type === "corner") delete next.type;
|
|
1395
1395
|
else next.type = type;
|
|
@@ -1433,7 +1433,7 @@ function fitAcross(pts, N, t0, t1) {
|
|
|
1433
1433
|
return goldenMin(fit, 0, 1);
|
|
1434
1434
|
}
|
|
1435
1435
|
function removeAnchorKeepingShape(sp, index) {
|
|
1436
|
-
const anchors = sp.anchors.map(
|
|
1436
|
+
const anchors = sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor);
|
|
1437
1437
|
const n = anchors.length;
|
|
1438
1438
|
if (index < 0 || index >= n) return { anchors, closed: sp.closed };
|
|
1439
1439
|
if ((sp.closed || index > 0 && index < n - 1) && n >= 3) {
|
|
@@ -1467,12 +1467,12 @@ function removeAnchorKeepingShape(sp, index) {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
function removeAnchorsKeepingShape(sp, indices) {
|
|
1469
1469
|
const order = [...new Set(indices)].filter((i) => i >= 0 && i < sp.anchors.length).sort((a, b) => b - a);
|
|
1470
|
-
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(
|
|
1470
|
+
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor), closed: sp.closed });
|
|
1471
1471
|
}
|
|
1472
1472
|
function bendSegment(sp, segment, t, p) {
|
|
1473
|
-
const anchors = sp.anchors.map(
|
|
1473
|
+
const anchors = sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor);
|
|
1474
1474
|
const n = anchors.length;
|
|
1475
|
-
if (segment < 0 || segment >=
|
|
1475
|
+
if (segment < 0 || segment >= _chunkO3ZVZSNJcjs.subpathSegmentCount.call(void 0, sp) || !Number.isFinite(t) || !Number.isFinite(p.x) || !Number.isFinite(p.y)) return { anchors, closed: sp.closed };
|
|
1476
1476
|
const tc = Math.min(0.95, Math.max(0.05, t));
|
|
1477
1477
|
const ia = segment;
|
|
1478
1478
|
const ib = (segment + 1) % n;
|
|
@@ -1483,16 +1483,16 @@ function bendSegment(sp, segment, t, p) {
|
|
|
1483
1483
|
const oy = (p.y - (a.y + (b.y - a.y) * tc)) / k;
|
|
1484
1484
|
const c1 = { x: a.x + (b.x - a.x) / 3 + ox, y: a.y + (b.y - a.y) / 3 + oy };
|
|
1485
1485
|
const c2 = { x: b.x + (a.x - b.x) / 3 + ox, y: b.y + (a.y - b.y) / 3 + oy };
|
|
1486
|
-
anchors[ia] =
|
|
1487
|
-
anchors[ib] =
|
|
1486
|
+
anchors[ia] = _chunkO3ZVZSNJcjs.moveAnchorHandle.call(void 0, a, "out", c1);
|
|
1487
|
+
anchors[ib] = _chunkO3ZVZSNJcjs.moveAnchorHandle.call(void 0, b, "in", c2);
|
|
1488
1488
|
return { anchors, closed: sp.closed };
|
|
1489
1489
|
}
|
|
1490
1490
|
function subpathPointAt(sp, segment, t) {
|
|
1491
|
-
const [x, y] = _chunkGF2RBSDMcjs.segmentPoint.call(void 0,
|
|
1491
|
+
const [x, y] = _chunkGF2RBSDMcjs.segmentPoint.call(void 0, _chunkO3ZVZSNJcjs.subpathSegment.call(void 0, sp, segment), t);
|
|
1492
1492
|
return { x, y };
|
|
1493
1493
|
}
|
|
1494
1494
|
function curvatureMoveAnchor(sp, index, q) {
|
|
1495
|
-
const anchors = sp.anchors.map(
|
|
1495
|
+
const anchors = sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor);
|
|
1496
1496
|
const a = sp.anchors[index];
|
|
1497
1497
|
if (!a) return { anchors, closed: sp.closed };
|
|
1498
1498
|
const own = [
|
|
@@ -1538,7 +1538,7 @@ function curvatureMoveAnchor(sp, index, q) {
|
|
|
1538
1538
|
function cutSubpathAt(sp, at) {
|
|
1539
1539
|
const n = sp.anchors.length;
|
|
1540
1540
|
const cuts = [...new Set(at)].filter((i) => Number.isInteger(i) && i >= 0 && i < n && (sp.closed || i > 0 && i < n - 1)).sort((a, b) => a - b);
|
|
1541
|
-
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(
|
|
1541
|
+
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor), closed: sp.closed }];
|
|
1542
1542
|
const first = cuts[0];
|
|
1543
1543
|
const run = sp.closed ? Array.from({ length: n + 1 }, (_, i) => sp.anchors[(first + i) % n]) : sp.anchors;
|
|
1544
1544
|
const cutSet = new Set(sp.closed ? [...cuts.map((c) => (c - first + n) % n), n] : cuts);
|
|
@@ -1546,7 +1546,7 @@ function cutSubpathAt(sp, at) {
|
|
|
1546
1546
|
let cur = [];
|
|
1547
1547
|
run.forEach((a, i) => {
|
|
1548
1548
|
if (!cutSet.has(i)) {
|
|
1549
|
-
cur.push(
|
|
1549
|
+
cur.push(_chunkO3ZVZSNJcjs.cloneAnchor.call(void 0, a));
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
if (cur.length) {
|
|
@@ -1561,10 +1561,10 @@ function cutSubpathAt(sp, at) {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
function splitSubpathAt(sp, segment, t, endTolerance = 1e-6) {
|
|
1563
1563
|
const n = sp.anchors.length;
|
|
1564
|
-
if (segment < 0 || segment >=
|
|
1564
|
+
if (segment < 0 || segment >= _chunkO3ZVZSNJcjs.subpathSegmentCount.call(void 0, sp)) return [{ anchors: sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor), closed: sp.closed }];
|
|
1565
1565
|
if (t <= endTolerance) return cutSubpathAt(sp, [segment]);
|
|
1566
1566
|
if (t >= 1 - endTolerance) return cutSubpathAt(sp, [(segment + 1) % n]);
|
|
1567
|
-
const { subpath, index } =
|
|
1567
|
+
const { subpath, index } = _chunkO3ZVZSNJcjs.insertAnchor.call(void 0, sp, segment, t);
|
|
1568
1568
|
return cutSubpathAt(subpath, [index]);
|
|
1569
1569
|
}
|
|
1570
1570
|
var endOf = (sp, last) => sp.anchors[last ? sp.anchors.length - 1 : 0];
|
|
@@ -1587,7 +1587,7 @@ function joinSubpaths(subpaths, tolerance) {
|
|
|
1587
1587
|
const closed = [];
|
|
1588
1588
|
let open = [];
|
|
1589
1589
|
for (const sp of subpaths) {
|
|
1590
|
-
const copy = { anchors: sp.anchors.map(
|
|
1590
|
+
const copy = { anchors: sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor), closed: sp.closed };
|
|
1591
1591
|
if (sp.closed || sp.anchors.length < 2) {
|
|
1592
1592
|
if (sp.anchors.length) closed.push(copy);
|
|
1593
1593
|
} else open.push(copy);
|
|
@@ -1642,7 +1642,7 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1642
1642
|
const t = Math.min(1, Math.max(0, amount));
|
|
1643
1643
|
const orig = sp.anchors;
|
|
1644
1644
|
const n = orig.length;
|
|
1645
|
-
const anchors = orig.map(
|
|
1645
|
+
const anchors = orig.map(_chunkO3ZVZSNJcjs.cloneAnchor);
|
|
1646
1646
|
if (n < 3 || t === 0) return { anchors, closed: sp.closed };
|
|
1647
1647
|
for (let i = 0; i < n; i++) {
|
|
1648
1648
|
if (!sp.closed && (i === 0 || i === n - 1)) continue;
|
|
@@ -1671,8 +1671,8 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
function segsOf(sp) {
|
|
1673
1673
|
const out = [];
|
|
1674
|
-
for (let i = 0; i <
|
|
1675
|
-
const s =
|
|
1674
|
+
for (let i = 0; i < _chunkO3ZVZSNJcjs.subpathSegmentCount.call(void 0, sp); i++) {
|
|
1675
|
+
const s = _chunkO3ZVZSNJcjs.subpathSegment.call(void 0, sp, i);
|
|
1676
1676
|
out.push(s.length === 2 ? { c: s, line: true } : { c: s, line: false });
|
|
1677
1677
|
}
|
|
1678
1678
|
return out;
|
|
@@ -1729,7 +1729,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1729
1729
|
const tol = Math.max(tolerance, 1e-9);
|
|
1730
1730
|
const types = new Map(sp.anchors.filter((a) => a.type).map((a) => [`${a.x},${a.y}`, a.type]));
|
|
1731
1731
|
const segs = segsOf(sp).filter((s) => !isZeroSeg(s));
|
|
1732
|
-
if (!segs.length) return { anchors: sp.anchors.map(
|
|
1732
|
+
if (!segs.length) return { anchors: sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor), closed: sp.closed };
|
|
1733
1733
|
const minSegs = sp.closed ? 2 : 1;
|
|
1734
1734
|
let changed = true;
|
|
1735
1735
|
while (changed && segs.length > minSegs) {
|
|
@@ -1747,7 +1747,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1747
1747
|
break;
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(
|
|
1750
|
+
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(_chunkO3ZVZSNJcjs.cloneAnchor), closed: sp.closed }));
|
|
1751
1751
|
}
|
|
1752
1752
|
|
|
1753
1753
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mixColors
|
|
3
|
+
} from "./chunk-2EUW2XZX.js";
|
|
1
4
|
import {
|
|
2
5
|
formatDualColor,
|
|
3
6
|
isDualColor,
|
|
4
|
-
mixColors,
|
|
5
7
|
normalizeDualColor,
|
|
6
8
|
resolveColor
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VR6OGHU5.js";
|
|
8
10
|
import {
|
|
9
11
|
deltaEOK,
|
|
10
12
|
formatHex,
|
|
11
13
|
inSrgbGamut
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JC2SHA4A.js";
|
|
13
15
|
import {
|
|
14
16
|
contrastRatio,
|
|
15
17
|
oklabToRgb,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
CHART_STACKINGS,
|
|
19
19
|
CHART_TRENDLINE_TYPES,
|
|
20
20
|
CHART_TYPES
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-47V3WXDG.js";
|
|
22
22
|
|
|
23
23
|
// src/chart/schemas.ts
|
|
24
24
|
var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
|
|
@@ -74,7 +74,7 @@ function profileAlongPolyline(points, values, count = 32) {
|
|
|
74
74
|
var round3 = (v) => Math.round(v * 1e3) / 1e3;
|
|
75
75
|
var loading = null;
|
|
76
76
|
function loadCanvasBrushstrokeRenderer() {
|
|
77
|
-
loading ??= import("./brushstrokeRender-
|
|
77
|
+
loading ??= import("./brushstrokeRender-JI4W6F2G.js").catch((error) => {
|
|
78
78
|
loading = null;
|
|
79
79
|
throw error;
|
|
80
80
|
});
|