@pixerate/editor 0.164.0 → 0.165.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 +54 -39
- package/dist/agent/index.js +24 -9
- package/dist/animation/index.cjs +6 -5
- package/dist/animation/index.js +5 -4
- package/dist/animation-editor/index.cjs +65 -64
- package/dist/animation-editor/index.js +8 -7
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/index.cjs +89 -87
- package/dist/canvas/index.js +11 -9
- package/dist/chart/controller.d.cts +31 -2
- package/dist/chart/controller.d.ts +31 -2
- package/dist/chart/index.cjs +504 -132
- package/dist/chart/index.d.cts +2 -0
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.js +386 -14
- package/dist/chart/layout-families.d.cts +7 -0
- package/dist/chart/layout-families.d.ts +7 -0
- package/dist/chart/links.d.cts +34 -0
- package/dist/chart/links.d.ts +34 -0
- package/dist/chart/mermaid.d.cts +9 -6
- package/dist/chart/mermaid.d.ts +9 -6
- package/dist/chart/schemas.d.cts +3 -0
- package/dist/chart/schemas.d.ts +3 -0
- package/dist/chart/spec.d.cts +3 -2
- package/dist/chart/spec.d.ts +3 -2
- package/dist/chart/style.d.cts +33 -0
- package/dist/chart/style.d.ts +33 -0
- package/dist/chart/types.d.cts +24 -2
- package/dist/chart/types.d.ts +24 -2
- package/dist/{chunk-TALQONZ5.js → chunk-2J5VLJHC.js} +3 -3
- package/dist/{chunk-3NEZJCBY.js → chunk-2ZRN43IN.js} +340 -201
- package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
- package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
- package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
- package/dist/{chunk-YSAGBIRW.cjs → chunk-64VWWR5U.cjs} +16 -16
- package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
- package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
- package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
- package/dist/{chunk-POR54B55.js → chunk-CRFSQWKQ.js} +4 -1
- package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
- package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
- package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
- package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-5FNGLV2D.js → chunk-FEU2XVQH.js} +15 -3
- package/dist/{chunk-SZA42R4N.js → chunk-FRBRLKNQ.js} +154 -16
- package/dist/chunk-HIDFL5LQ.js +484 -0
- package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
- package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
- package/dist/{chunk-GKNEJ6EN.cjs → chunk-IMRXC7OA.cjs} +241 -103
- package/dist/chunk-KGRZMHZB.js +204 -0
- package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
- package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
- package/dist/{chunk-D54JHQK2.cjs → chunk-MKXK6E4O.cjs} +51 -51
- package/dist/{chunk-DAPQGA55.js → chunk-N7NBGT2Y.js} +2 -2
- package/dist/chunk-O6OGNDND.js +164 -0
- package/dist/{chunk-22KLZZGH.cjs → chunk-ODFCS7HF.cjs} +8 -8
- package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
- package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
- package/dist/{chunk-YGG7WDWT.cjs → chunk-Q25WAFTD.cjs} +21 -18
- package/dist/{chunk-SBQVEBSU.cjs → chunk-QO2T6KA5.cjs} +165 -67
- package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
- package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
- package/dist/chunk-TFF2GTGN.cjs +153 -0
- package/dist/chunk-TTCJPX4U.cjs +204 -0
- package/dist/{chunk-NZD2MZJC.cjs → chunk-TVQW26AV.cjs} +35 -23
- package/dist/{chunk-R3P2M7HU.cjs → chunk-UVXTOZ2B.cjs} +346 -207
- package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
- package/dist/{chunk-Z4P2RBMJ.js → chunk-V5GSY3NC.js} +101 -3
- package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
- package/dist/chunk-VU6WQSMB.cjs +164 -0
- package/dist/{chunk-OXERWBKE.js → chunk-X5W645RI.js} +3 -3
- package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
- package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
- package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
- package/dist/chunk-YBAPT7NL.js +153 -0
- package/dist/chunk-Z2UQYMPS.cjs +484 -0
- package/dist/color/index.cjs +5 -3
- package/dist/color/index.js +12 -10
- package/dist/diagram/index.cjs +55 -243
- package/dist/diagram/index.js +12 -200
- package/dist/export/index.cjs +7 -6
- package/dist/export/index.js +6 -5
- package/dist/extensions/index.cjs +12 -9
- package/dist/extensions/index.js +11 -8
- package/dist/gradient/index.cjs +29 -27
- package/dist/gradient/index.js +6 -4
- package/dist/image-editor/index.cjs +644 -643
- package/dist/image-editor/index.js +7 -6
- package/dist/index.cjs +21 -18
- package/dist/index.js +14 -11
- package/dist/paint-editor/index.cjs +19 -18
- package/dist/paint-editor/index.js +7 -6
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/persistence/assetWrites.d.cts +22 -0
- package/dist/persistence/assetWrites.d.ts +22 -0
- package/dist/persistence/assets.d.cts +71 -0
- package/dist/persistence/assets.d.ts +71 -0
- package/dist/persistence/documentStore.d.cts +17 -1
- package/dist/persistence/documentStore.d.ts +17 -1
- package/dist/persistence/documentTools.d.cts +5 -1
- package/dist/persistence/documentTools.d.ts +5 -1
- package/dist/persistence/editorAutosave.d.cts +7 -0
- package/dist/persistence/editorAutosave.d.ts +7 -0
- package/dist/persistence/index.cjs +141 -21
- package/dist/persistence/index.js +130 -10
- package/dist/persistence/storage.d.cts +13 -1
- package/dist/persistence/storage.d.ts +13 -1
- package/dist/spreadsheet/index.cjs +3 -3
- package/dist/spreadsheet/index.js +2 -2
- package/dist/tokens/index.cjs +11 -3
- package/dist/tokens/index.d.cts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +10 -2
- package/dist/tokens/style.d.cts +36 -0
- package/dist/tokens/style.d.ts +36 -0
- package/dist/tools/index.cjs +15 -3
- package/dist/tools/index.d.cts +2 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +14 -2
- package/dist/tools/style-tools.d.cts +19 -0
- package/dist/tools/style-tools.d.ts +19 -0
- package/dist/tools/style.d.cts +212 -0
- package/dist/tools/style.d.ts +212 -0
- package/dist/tools/view.d.cts +6 -0
- package/dist/tools/view.d.ts +6 -0
- package/dist/typography/index.cjs +8 -6
- package/dist/typography/index.js +5 -3
- package/dist/vector/index.cjs +953 -952
- package/dist/vector/index.js +7 -6
- package/dist/video-editor/index.cjs +8 -7
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/dist/chunk-ERAGQL2N.cjs +0 -68
- package/dist/chunk-KMU6QJB7.js +0 -68
package/dist/diagram/index.cjs
CHANGED
|
@@ -112,10 +112,17 @@
|
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
|
|
115
|
+
var _chunk3FSUJIXNcjs = require('../chunk-3FSUJIXN.cjs');
|
|
115
116
|
|
|
116
117
|
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
|
|
120
|
+
var _chunkTTCJPX4Ucjs = require('../chunk-TTCJPX4U.cjs');
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
var _chunkVU6WQSMBcjs = require('../chunk-VU6WQSMB.cjs');
|
|
119
126
|
|
|
120
127
|
|
|
121
128
|
|
|
@@ -126,7 +133,7 @@ var _chunkZVNAMTFOcjs = require('../chunk-ZVNAMTFO.cjs');
|
|
|
126
133
|
var _chunkSWTUM32Hcjs = require('../chunk-SWTUM32H.cjs');
|
|
127
134
|
|
|
128
135
|
|
|
129
|
-
var
|
|
136
|
+
var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
|
|
130
137
|
require('../chunk-2BSBFBOA.cjs');
|
|
131
138
|
|
|
132
139
|
|
|
@@ -137,7 +144,7 @@ var DIRECTIONS = ["TB", "TD", "BT", "LR", "RL"];
|
|
|
137
144
|
|
|
138
145
|
// src/diagram/editorDocument.ts
|
|
139
146
|
function createDiagramEditorDocument(controller) {
|
|
140
|
-
return
|
|
147
|
+
return _chunkSJ2CPTQCcjs.defineEditorDocument.call(void 0, {
|
|
141
148
|
kind: "diagram",
|
|
142
149
|
get: () => ({ source: controller.getSource() }),
|
|
143
150
|
load: (document, { history }) => {
|
|
@@ -182,8 +189,8 @@ function findMermaidSources(text) {
|
|
|
182
189
|
}
|
|
183
190
|
function asDiagram(source, heading, strict = false) {
|
|
184
191
|
if (!source.trim()) return void 0;
|
|
185
|
-
const split =
|
|
186
|
-
const family =
|
|
192
|
+
const split = _chunkVU6WQSMBcjs.splitSource.call(void 0, source);
|
|
193
|
+
const family = _chunkVU6WQSMBcjs.detectFamilyFromHeader.call(void 0, split.header);
|
|
187
194
|
if (family === "unknown") return void 0;
|
|
188
195
|
if (strict && !/^\s*([a-z]|C4)/.test(split.header)) return void 0;
|
|
189
196
|
const fmTitle = _optionalChain([split, 'access', _ => _.preamble, 'access', _2 => _2.frontmatter, 'optionalAccess', _3 => _3.title]);
|
|
@@ -566,9 +573,9 @@ function nextTaskId(graph) {
|
|
|
566
573
|
function newTaskStart(graph) {
|
|
567
574
|
const format = typeof _optionalChain([graph, 'access', _4 => _4.data, 'optionalAccess', _5 => _5.dateFormat]) === "string" ? graph.data.dateFormat : void 0;
|
|
568
575
|
const ends = graph.nodes.map((n) => _optionalChain([n, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.endTime])).filter((t) => typeof t === "number" && Number.isFinite(t));
|
|
569
|
-
if (ends.length) return
|
|
576
|
+
if (ends.length) return _chunk3FSUJIXNcjs.formatGanttDate.call(void 0, Math.max(...ends), format);
|
|
570
577
|
const starts = graph.nodes.map((n) => _optionalChain([n, 'access', _8 => _8.data, 'optionalAccess', _9 => _9.startTime])).filter((t) => typeof t === "number" && Number.isFinite(t));
|
|
571
|
-
if (starts.length) return
|
|
578
|
+
if (starts.length) return _chunk3FSUJIXNcjs.formatGanttDate.call(void 0, Math.min(...starts), format);
|
|
572
579
|
return "2026-01-01";
|
|
573
580
|
}
|
|
574
581
|
var ganttUI = {
|
|
@@ -609,7 +616,7 @@ var ganttUI = {
|
|
|
609
616
|
label: "Tags",
|
|
610
617
|
type: "tags",
|
|
611
618
|
hint: "done, active, crit, milestone, vert",
|
|
612
|
-
options:
|
|
619
|
+
options: _chunk3FSUJIXNcjs.GANTT_TAGS.map((t) => ({ value: t, label: t }))
|
|
613
620
|
},
|
|
614
621
|
{ key: "id", label: "Task id", type: "text" }
|
|
615
622
|
],
|
|
@@ -882,7 +889,7 @@ var flowchartUI = {
|
|
|
882
889
|
family: "flowchart",
|
|
883
890
|
nodeFields: IMAGE_FIELDS,
|
|
884
891
|
title: "Flowchart",
|
|
885
|
-
shapes:
|
|
892
|
+
shapes: _chunk3FSUJIXNcjs.FLOWCHART_SHAPES.map((s) => ({ value: s.name, label: s.title, category: s.category })),
|
|
886
893
|
edgeKinds: [
|
|
887
894
|
{
|
|
888
895
|
value: "arrow",
|
|
@@ -964,7 +971,7 @@ var classUI = {
|
|
|
964
971
|
family: "class",
|
|
965
972
|
title: "Class diagram",
|
|
966
973
|
shapes: [{ value: "classBox", label: "Class" }],
|
|
967
|
-
edgeKinds:
|
|
974
|
+
edgeKinds: _chunk3FSUJIXNcjs.CLASS_RELATIONS.filter((r) => !r.title.includes("reversed")).map((r) => ({
|
|
968
975
|
value: r.token,
|
|
969
976
|
label: r.title,
|
|
970
977
|
arrowStart: r.arrowStart,
|
|
@@ -1028,7 +1035,7 @@ var erUI = {
|
|
|
1028
1035
|
{ value: "dotted", label: "Non-identifying" }
|
|
1029
1036
|
],
|
|
1030
1037
|
arrowHeads: Array.from(
|
|
1031
|
-
new Map(
|
|
1038
|
+
new Map(_chunk3FSUJIXNcjs.ER_CARDINALITIES.map((c) => [c.head, { value: c.head, label: c.title }])).values()
|
|
1032
1039
|
),
|
|
1033
1040
|
groups: { supported: false, label: "Group" },
|
|
1034
1041
|
labels: true,
|
|
@@ -1138,201 +1145,6 @@ var FAMILY_DESCRIPTIONS = {
|
|
|
1138
1145
|
radar: "Scores across several axes, one curve per item compared."
|
|
1139
1146
|
};
|
|
1140
1147
|
|
|
1141
|
-
// src/diagram/sankey/index.ts
|
|
1142
|
-
function parseSankey(source) {
|
|
1143
|
-
const split = _chunkZVNAMTFOcjs.splitSource.call(void 0, source);
|
|
1144
|
-
if (!/^\s*sankey(?:-beta)?\b/i.test(split.header)) {
|
|
1145
|
-
return { error: "Not a sankey diagram: the first line should be `sankey-beta`." };
|
|
1146
|
-
}
|
|
1147
|
-
const firstLine = split.headerIndex + 2;
|
|
1148
|
-
const kept = [];
|
|
1149
|
-
split.bodyLines.forEach((text, i) => {
|
|
1150
|
-
if (/^\s*%%/.test(text)) return;
|
|
1151
|
-
kept.push({ text: text.trim(), line: firstLine + i });
|
|
1152
|
-
});
|
|
1153
|
-
const records = readRecords(kept);
|
|
1154
|
-
if ("error" in records) return records;
|
|
1155
|
-
const nodes = [];
|
|
1156
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1157
|
-
const add = (name) => {
|
|
1158
|
-
if (!seen.has(name)) {
|
|
1159
|
-
seen.add(name);
|
|
1160
|
-
nodes.push(name);
|
|
1161
|
-
}
|
|
1162
|
-
};
|
|
1163
|
-
const links = [];
|
|
1164
|
-
for (const { fields, line } of records) {
|
|
1165
|
-
if (fields.length !== 3) {
|
|
1166
|
-
return {
|
|
1167
|
-
error: `Expected three fields (source,target,value), found ${fields.length}.`,
|
|
1168
|
-
line
|
|
1169
|
-
};
|
|
1170
|
-
}
|
|
1171
|
-
const [source2, target, raw] = fields;
|
|
1172
|
-
const value = Number.parseFloat(raw);
|
|
1173
|
-
if (!Number.isFinite(value)) {
|
|
1174
|
-
return { error: `"${raw}" is not a number.`, line };
|
|
1175
|
-
}
|
|
1176
|
-
add(source2);
|
|
1177
|
-
add(target);
|
|
1178
|
-
links.push({ source: source2, target, value });
|
|
1179
|
-
}
|
|
1180
|
-
if (!links.length) return { error: "No links: add lines like `A,B,10`." };
|
|
1181
|
-
return { data: { nodes, links } };
|
|
1182
|
-
}
|
|
1183
|
-
function readRecords(lines) {
|
|
1184
|
-
const records = [];
|
|
1185
|
-
let i = 0;
|
|
1186
|
-
while (i < lines.length) {
|
|
1187
|
-
const start = lines[i];
|
|
1188
|
-
if (start.text === "") {
|
|
1189
|
-
i++;
|
|
1190
|
-
continue;
|
|
1191
|
-
}
|
|
1192
|
-
const fields = [];
|
|
1193
|
-
let text = start.text;
|
|
1194
|
-
let pos = 0;
|
|
1195
|
-
let field = "";
|
|
1196
|
-
let quoted = false;
|
|
1197
|
-
for (; ; ) {
|
|
1198
|
-
if (quoted) {
|
|
1199
|
-
const close = text.indexOf('"', pos);
|
|
1200
|
-
if (close < 0) {
|
|
1201
|
-
field += text.slice(pos);
|
|
1202
|
-
i++;
|
|
1203
|
-
if (i >= lines.length)
|
|
1204
|
-
return { error: "A quoted field is never closed.", line: start.line };
|
|
1205
|
-
field += "\n";
|
|
1206
|
-
text = lines[i].text;
|
|
1207
|
-
pos = 0;
|
|
1208
|
-
continue;
|
|
1209
|
-
}
|
|
1210
|
-
field += text.slice(pos, close);
|
|
1211
|
-
if (text[close + 1] === '"') {
|
|
1212
|
-
field += '"';
|
|
1213
|
-
pos = close + 2;
|
|
1214
|
-
continue;
|
|
1215
|
-
}
|
|
1216
|
-
quoted = false;
|
|
1217
|
-
pos = close + 1;
|
|
1218
|
-
const rest = /^[ \t]*/.exec(text.slice(pos))[0].length;
|
|
1219
|
-
pos += rest;
|
|
1220
|
-
if (pos < text.length && text[pos] !== ",") {
|
|
1221
|
-
return { error: "Unexpected text after a quoted field.", line: lines[i].line };
|
|
1222
|
-
}
|
|
1223
|
-
continue;
|
|
1224
|
-
}
|
|
1225
|
-
if (pos >= text.length) {
|
|
1226
|
-
fields.push(field.trim());
|
|
1227
|
-
break;
|
|
1228
|
-
}
|
|
1229
|
-
const ch = text[pos];
|
|
1230
|
-
if (ch === ",") {
|
|
1231
|
-
fields.push(field.trim());
|
|
1232
|
-
field = "";
|
|
1233
|
-
pos++;
|
|
1234
|
-
} else if (ch === '"' && field.trim() === "") {
|
|
1235
|
-
quoted = true;
|
|
1236
|
-
field = "";
|
|
1237
|
-
pos++;
|
|
1238
|
-
} else if (ch === '"') {
|
|
1239
|
-
return { error: "A quote inside an unquoted field.", line: lines[i].line };
|
|
1240
|
-
} else {
|
|
1241
|
-
field += ch;
|
|
1242
|
-
pos++;
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
records.push({ fields, line: start.line });
|
|
1246
|
-
i++;
|
|
1247
|
-
}
|
|
1248
|
-
return records;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
// src/diagram/treemap/index.ts
|
|
1252
|
-
var NAME = String.raw`(?:"([^"]*)"|'([^']*)')`;
|
|
1253
|
-
var CLASS = String.raw`(?:\s*:::\s*([A-Za-z_]\w*))?`;
|
|
1254
|
-
var SECTION_RE = new RegExp(String.raw`^${NAME}${CLASS}$`);
|
|
1255
|
-
var LEAF_RE = new RegExp(String.raw`^${NAME}\s*[:,]\s*([0-9_.,]+)${CLASS}$`);
|
|
1256
|
-
function parseTreemap(source) {
|
|
1257
|
-
const split = _chunkZVNAMTFOcjs.splitSource.call(void 0, source);
|
|
1258
|
-
if (!/^\s*treemap(?:-beta)?\b/i.test(split.header)) {
|
|
1259
|
-
return { error: "Not a treemap: the first line should be `treemap-beta`." };
|
|
1260
|
-
}
|
|
1261
|
-
const data = { items: [] };
|
|
1262
|
-
const stack = [];
|
|
1263
|
-
const firstLine = split.headerIndex + 2;
|
|
1264
|
-
const lines = split.bodyLines;
|
|
1265
|
-
for (let i = 0; i < lines.length; i++) {
|
|
1266
|
-
const raw = lines[i];
|
|
1267
|
-
const line = firstLine + i;
|
|
1268
|
-
const indent = /^[ \t]*/.exec(raw)[0].length;
|
|
1269
|
-
const text = stripComment(raw).trim();
|
|
1270
|
-
if (!text) continue;
|
|
1271
|
-
const accBlock = /^accDescr\s*\{(.*)$/.exec(text);
|
|
1272
|
-
if (accBlock) {
|
|
1273
|
-
let body = accBlock[1];
|
|
1274
|
-
while (!body.includes("}") && i + 1 < lines.length) body += `
|
|
1275
|
-
${lines[++i]}`;
|
|
1276
|
-
if (!body.includes("}")) return { error: "`accDescr {` is never closed.", line };
|
|
1277
|
-
data.accDescr = body.slice(0, body.indexOf("}")).trim();
|
|
1278
|
-
continue;
|
|
1279
|
-
}
|
|
1280
|
-
const acc = /^(accTitle|accDescr)\s*:(.*)$/.exec(text);
|
|
1281
|
-
if (acc) {
|
|
1282
|
-
data[acc[1]] = acc[2].trim();
|
|
1283
|
-
continue;
|
|
1284
|
-
}
|
|
1285
|
-
const title = /^title(?:[ \t]+(.*))?$/.exec(text);
|
|
1286
|
-
if (title) {
|
|
1287
|
-
data.title = (_nullishCoalesce(title[1], () => ( ""))).trim() || void 0;
|
|
1288
|
-
continue;
|
|
1289
|
-
}
|
|
1290
|
-
if (/^classDef\s/.test(text)) continue;
|
|
1291
|
-
let item;
|
|
1292
|
-
const leaf = LEAF_RE.exec(text);
|
|
1293
|
-
const section = leaf ? null : SECTION_RE.exec(text);
|
|
1294
|
-
if (leaf) {
|
|
1295
|
-
const value = Number.parseFloat(leaf[3].replace(/,/g, ""));
|
|
1296
|
-
if (!Number.isFinite(value)) return { error: `"${leaf[3]}" is not a number.`, line };
|
|
1297
|
-
item = { name: _nullishCoalesce(leaf[1], () => ( leaf[2])), value };
|
|
1298
|
-
if (leaf[4]) item.className = leaf[4];
|
|
1299
|
-
} else if (section) {
|
|
1300
|
-
item = { name: _nullishCoalesce(section[1], () => ( section[2])), children: [] };
|
|
1301
|
-
if (section[3]) item.className = section[3];
|
|
1302
|
-
} else {
|
|
1303
|
-
return {
|
|
1304
|
-
error: /^["']/.test(text) ? 'Expected `"Name"` for a section or `"Name": value` for a leaf.' : 'Names must be in quotes, e.g. `"Sales": 120`.',
|
|
1305
|
-
line
|
|
1306
|
-
};
|
|
1307
|
-
}
|
|
1308
|
-
while (stack.length && stack[stack.length - 1].indent >= indent) stack.pop();
|
|
1309
|
-
const parent = _optionalChain([stack, 'access', _11 => _11[stack.length - 1], 'optionalAccess', _12 => _12.item]);
|
|
1310
|
-
if (parent) parent.children.push(item);
|
|
1311
|
-
else data.items.push(item);
|
|
1312
|
-
if (item.children) stack.push({ item, indent });
|
|
1313
|
-
}
|
|
1314
|
-
if (!data.items.length) return { error: 'No items: add lines like `"Sales": 120`.' };
|
|
1315
|
-
return { data };
|
|
1316
|
-
}
|
|
1317
|
-
function stripComment(line) {
|
|
1318
|
-
let quote3 = null;
|
|
1319
|
-
for (let i = 0; i < line.length; i++) {
|
|
1320
|
-
const ch = line[i];
|
|
1321
|
-
if (quote3) {
|
|
1322
|
-
if (ch === quote3) quote3 = null;
|
|
1323
|
-
} else if (ch === '"' || ch === "'") {
|
|
1324
|
-
quote3 = ch;
|
|
1325
|
-
} else if (ch === "%" && line[i + 1] === "%") {
|
|
1326
|
-
return line.slice(0, i);
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
return line;
|
|
1330
|
-
}
|
|
1331
|
-
function treemapValue(item) {
|
|
1332
|
-
if (!item.children) return _nullishCoalesce(item.value, () => ( 0));
|
|
1333
|
-
return item.children.reduce((sum, child) => sum + treemapValue(child), 0);
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
1148
|
// src/diagram/controller.ts
|
|
1337
1149
|
var EDITABLE_DIAGRAM_FAMILIES = [
|
|
1338
1150
|
"flowchart",
|
|
@@ -1353,17 +1165,17 @@ var EDITABLE_DIAGRAM_FAMILIES = [
|
|
|
1353
1165
|
"radar"
|
|
1354
1166
|
];
|
|
1355
1167
|
function diagramShapes(family) {
|
|
1356
|
-
if (family === "flowchart") return
|
|
1357
|
-
if (family === "state") return
|
|
1168
|
+
if (family === "flowchart") return _chunk3FSUJIXNcjs.FLOWCHART_SHAPES.map((shape) => shape.name);
|
|
1169
|
+
if (family === "state") return _chunk3FSUJIXNcjs.STATE_SHAPES.map((shape) => shape.name);
|
|
1358
1170
|
if (family === "class" || family === "er") return [];
|
|
1359
|
-
const shapes = _nullishCoalesce(_optionalChain([familyUI, 'call',
|
|
1171
|
+
const shapes = _nullishCoalesce(_optionalChain([familyUI, 'call', _11 => _11(family), 'optionalAccess', _12 => _12.shapes]), () => ( []));
|
|
1360
1172
|
return shapes.length > 1 ? shapes.map((shape) => shape.value) : [];
|
|
1361
1173
|
}
|
|
1362
1174
|
function diagramSupportsGroups(family) {
|
|
1363
|
-
return _nullishCoalesce(_optionalChain([familyUI, 'call',
|
|
1175
|
+
return _nullishCoalesce(_optionalChain([familyUI, 'call', _13 => _13(family), 'optionalAccess', _14 => _14.groups, 'access', _15 => _15.supported]), () => ( false));
|
|
1364
1176
|
}
|
|
1365
1177
|
function diagramSupportsDirection(family) {
|
|
1366
|
-
return _optionalChain([familyUI, 'call',
|
|
1178
|
+
return _optionalChain([familyUI, 'call', _16 => _16(family), 'optionalAccess', _17 => _17.directions]) !== false;
|
|
1367
1179
|
}
|
|
1368
1180
|
var quote2 = (ids) => [...ids].map((id) => `"${id}"`).join(", ");
|
|
1369
1181
|
function validateDiagramEdit(doc, op) {
|
|
@@ -1448,12 +1260,12 @@ var DiagramController = (_class = class {
|
|
|
1448
1260
|
this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkFJ2MSI43cjs.HistoryManager)()));
|
|
1449
1261
|
this.onChange = options.onChange;
|
|
1450
1262
|
this.readOnly = _nullishCoalesce(options.readOnly, () => ( false));
|
|
1451
|
-
this.doc =
|
|
1263
|
+
this.doc = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, _nullishCoalesce(options.source, () => ( "flowchart TD\n")));
|
|
1452
1264
|
this.state = this.computeState();
|
|
1453
1265
|
this.connect();
|
|
1454
1266
|
}
|
|
1455
1267
|
connect() {
|
|
1456
|
-
_optionalChain([this, 'access',
|
|
1268
|
+
_optionalChain([this, 'access', _18 => _18.unsubscribeHistory, 'optionalCall', _19 => _19()]);
|
|
1457
1269
|
this.unsubscribeHistory = this.history.subscribe((h) => {
|
|
1458
1270
|
const s = this.state;
|
|
1459
1271
|
if (this.applying || s.canUndo === h.canUndo && s.canRedo === h.canRedo && s.undoLabel === h.undoName && s.redoLabel === h.redoName) return;
|
|
@@ -1462,7 +1274,7 @@ var DiagramController = (_class = class {
|
|
|
1462
1274
|
}
|
|
1463
1275
|
/** Stops listening to the history (subscribing again reconnects). */
|
|
1464
1276
|
destroy() {
|
|
1465
|
-
_optionalChain([this, 'access',
|
|
1277
|
+
_optionalChain([this, 'access', _20 => _20.unsubscribeHistory, 'optionalCall', _21 => _21()]);
|
|
1466
1278
|
this.unsubscribeHistory = void 0;
|
|
1467
1279
|
}
|
|
1468
1280
|
/** The current snapshot (stable until the next change). */
|
|
@@ -1502,7 +1314,7 @@ var DiagramController = (_class = class {
|
|
|
1502
1314
|
notify(sourceChanged) {
|
|
1503
1315
|
this.revision++;
|
|
1504
1316
|
this.state = this.computeState();
|
|
1505
|
-
if (sourceChanged) _optionalChain([this, 'access',
|
|
1317
|
+
if (sourceChanged) _optionalChain([this, 'access', _22 => _22.onChange, 'optionalCall', _23 => _23(this.doc.source, this.doc)]);
|
|
1506
1318
|
const state = this.state;
|
|
1507
1319
|
this.listeners.forEach((listener) => {
|
|
1508
1320
|
try {
|
|
@@ -1557,7 +1369,7 @@ var DiagramController = (_class = class {
|
|
|
1557
1369
|
for (const op of list2) {
|
|
1558
1370
|
const problem = validateDiagramEdit(doc, op);
|
|
1559
1371
|
if (problem) return this.reject(problem);
|
|
1560
|
-
doc =
|
|
1372
|
+
doc = _chunk3FSUJIXNcjs.applyEdits.call(void 0, doc, [op]);
|
|
1561
1373
|
}
|
|
1562
1374
|
this.commit(label, doc);
|
|
1563
1375
|
return { ok: true, document: this.doc };
|
|
@@ -1567,7 +1379,7 @@ var DiagramController = (_class = class {
|
|
|
1567
1379
|
* otherwise the replacement is one undo step.
|
|
1568
1380
|
*/
|
|
1569
1381
|
load(source, options = {}) {
|
|
1570
|
-
const next =
|
|
1382
|
+
const next = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, source, { metaCarrier: this.doc.metaCarrier });
|
|
1571
1383
|
if (options.clearHistory) {
|
|
1572
1384
|
this.history.clear();
|
|
1573
1385
|
this.issue = null;
|
|
@@ -1634,7 +1446,7 @@ var object = (properties, required = []) => ({
|
|
|
1634
1446
|
function describeDiagram(doc) {
|
|
1635
1447
|
const { graph } = doc;
|
|
1636
1448
|
const ui = familyUI(doc.family);
|
|
1637
|
-
const settings = pickFieldData(_optionalChain([ui, 'optionalAccess',
|
|
1449
|
+
const settings = pickFieldData(_optionalChain([ui, 'optionalAccess', _24 => _24.diagramFields]), graph.data);
|
|
1638
1450
|
return {
|
|
1639
1451
|
family: doc.family,
|
|
1640
1452
|
editable: doc.tier === "editable",
|
|
@@ -1647,8 +1459,8 @@ function describeDiagram(doc) {
|
|
|
1647
1459
|
...n.parentId ? { parentId: n.parentId } : {},
|
|
1648
1460
|
...n.classes.length ? { classes: n.classes } : {},
|
|
1649
1461
|
...n.styles.length ? { styles: n.styles } : {},
|
|
1650
|
-
..._optionalChain([n, 'access',
|
|
1651
|
-
..._optionalChain([ui, 'optionalAccess',
|
|
1462
|
+
..._optionalChain([n, 'access', _25 => _25.data, 'optionalAccess', _26 => _26.synthetic]) ? { synthetic: true } : {},
|
|
1463
|
+
..._optionalChain([ui, 'optionalAccess', _27 => _27.nodeFields]) && Object.keys(pickFieldData(ui.nodeFields, n.data)).length ? { data: pickFieldData(ui.nodeFields, n.data) } : {}
|
|
1652
1464
|
})),
|
|
1653
1465
|
edges: graph.edges.map((e) => ({
|
|
1654
1466
|
id: e.id,
|
|
@@ -1657,7 +1469,7 @@ function describeDiagram(doc) {
|
|
|
1657
1469
|
...e.label ? { label: e.label } : {},
|
|
1658
1470
|
pattern: e.pattern,
|
|
1659
1471
|
arrowEnd: e.arrowEnd,
|
|
1660
|
-
..._optionalChain([ui, 'optionalAccess',
|
|
1472
|
+
..._optionalChain([ui, 'optionalAccess', _28 => _28.edgeFields]) && Object.keys(pickFieldData(ui.edgeFields, e.data)).length ? { data: pickFieldData(ui.edgeFields, e.data) } : {}
|
|
1661
1473
|
})),
|
|
1662
1474
|
groups: graph.groups.map((g) => ({
|
|
1663
1475
|
id: g.id,
|
|
@@ -1667,11 +1479,11 @@ function describeDiagram(doc) {
|
|
|
1667
1479
|
})),
|
|
1668
1480
|
shapes: diagramShapes(doc.family),
|
|
1669
1481
|
...Object.keys(settings).length ? { settings } : {},
|
|
1670
|
-
...ui && (_optionalChain([ui, 'access',
|
|
1482
|
+
...ui && (_optionalChain([ui, 'access', _29 => _29.nodeFields, 'optionalAccess', _30 => _30.length]) || _optionalChain([ui, 'access', _31 => _31.edgeFields, 'optionalAccess', _32 => _32.length]) || _optionalChain([ui, 'access', _33 => _33.diagramFields, 'optionalAccess', _34 => _34.length])) ? {
|
|
1671
1483
|
fields: {
|
|
1672
|
-
..._optionalChain([ui, 'access',
|
|
1673
|
-
..._optionalChain([ui, 'access',
|
|
1674
|
-
..._optionalChain([ui, 'access',
|
|
1484
|
+
..._optionalChain([ui, 'access', _35 => _35.nodeFields, 'optionalAccess', _36 => _36.length]) ? { node: describeFields(ui.nodeFields) } : {},
|
|
1485
|
+
..._optionalChain([ui, 'access', _37 => _37.edgeFields, 'optionalAccess', _38 => _38.length]) ? { edge: describeFields(ui.edgeFields) } : {},
|
|
1486
|
+
..._optionalChain([ui, 'access', _39 => _39.diagramFields, 'optionalAccess', _40 => _40.length]) ? { diagram: describeFields(ui.diagramFields) } : {}
|
|
1675
1487
|
}
|
|
1676
1488
|
} : {},
|
|
1677
1489
|
positions: Object.fromEntries(Object.entries(_nullishCoalesce(doc.meta.layout, () => ( {}))).map(([id, [x, y]]) => [id, { x: Math.round(x), y: Math.round(y) }])),
|
|
@@ -1698,7 +1510,7 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
1698
1510
|
return n ? { id: n.id, label: n.label, ..."shape" in n ? { shape: n.shape } : {}, ...n.parentId ? { parentId: n.parentId } : {} } : { id };
|
|
1699
1511
|
};
|
|
1700
1512
|
const pinned = (moves) => {
|
|
1701
|
-
const shown = _optionalChain([options, 'access',
|
|
1513
|
+
const shown = _optionalChain([options, 'access', _41 => _41.getPositions, 'optionalCall', _42 => _42()]);
|
|
1702
1514
|
if (!shown) return moves;
|
|
1703
1515
|
const stored = _nullishCoalesce(doc().meta.layout, () => ( {}));
|
|
1704
1516
|
const taken = new Set(moves.map((m) => m.id));
|
|
@@ -1752,8 +1564,8 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
1752
1564
|
handler: async ({ source }) => {
|
|
1753
1565
|
const fenced = /^\s*(`{3,}|~{3,})/m.test(source) ? findMermaidSources(source) : [];
|
|
1754
1566
|
if (fenced.length > 1) throw new Error(`The text holds ${fenced.length} diagrams; pass one (find_mermaid_diagrams lists them).`);
|
|
1755
|
-
const text = _nullishCoalesce(_optionalChain([fenced, 'access',
|
|
1756
|
-
if (
|
|
1567
|
+
const text = _nullishCoalesce(_optionalChain([fenced, 'access', _43 => _43[0], 'optionalAccess', _44 => _44.source]), () => ( source));
|
|
1568
|
+
if (_chunk3FSUJIXNcjs.detectFamily.call(void 0, text) === "unknown")
|
|
1757
1569
|
throw new Error('The text has no Mermaid header (e.g. "flowchart LR", "stateDiagram-v2", "classDiagram", "erDiagram"); nothing was changed.');
|
|
1758
1570
|
const result = options.director ? await options.director.playSource(actor, text) : controller.load(text);
|
|
1759
1571
|
if (!result.ok) throw new Error(result.message);
|
|
@@ -1793,9 +1605,9 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
1793
1605
|
if (edgeLabel !== void 0 && from === void 0) throw new Error('edgeLabel needs "from", the node the edge starts at.');
|
|
1794
1606
|
const ui = familyUI(doc().family);
|
|
1795
1607
|
const nodeId = _nullishCoalesce(id, () => ( (ui && !["flowchart", "state", "class", "er"].includes(ui.family) ? ui.nextId(doc().graph) : controller.nextId())));
|
|
1796
|
-
const defaults = _nullishCoalesce(_optionalChain([ui, 'optionalAccess',
|
|
1608
|
+
const defaults = _nullishCoalesce(_optionalChain([ui, 'optionalAccess', _45 => _45.newNode, 'optionalCall', _46 => _46(doc().graph, parentId)]), () => ( {}));
|
|
1797
1609
|
const nodeShape = _nullishCoalesce(shape, () => ( defaults.shape));
|
|
1798
|
-
const nodeData = { ..._nullishCoalesce(defaults.data, () => ( {})), ...data ? checkFieldData(_optionalChain([ui, 'optionalAccess',
|
|
1610
|
+
const nodeData = { ..._nullishCoalesce(defaults.data, () => ( {})), ...data ? checkFieldData(_optionalChain([ui, 'optionalAccess', _47 => _47.nodeFields]), data, `a ${doc().family} node`, nodeShape) : {} };
|
|
1799
1611
|
const before = edgeIds();
|
|
1800
1612
|
const ops = [
|
|
1801
1613
|
{
|
|
@@ -1860,7 +1672,7 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
1860
1672
|
handler: async ({ id, styles }) => {
|
|
1861
1673
|
requireEditable();
|
|
1862
1674
|
const d = await apply({ type: "setNodeStyles", id, styles }, "Style node");
|
|
1863
|
-
return { id, styles: _nullishCoalesce(_optionalChain([d, 'access',
|
|
1675
|
+
return { id, styles: _nullishCoalesce(_optionalChain([d, 'access', _48 => _48.graph, 'access', _49 => _49.nodes, 'access', _50 => _50.find, 'call', _51 => _51((n) => n.id === id), 'optionalAccess', _52 => _52.styles]), () => ( [])) };
|
|
1864
1676
|
}
|
|
1865
1677
|
};
|
|
1866
1678
|
const connect = {
|
|
@@ -2009,7 +1821,7 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
2009
1821
|
};
|
|
2010
1822
|
const fieldsOf = (kind2) => {
|
|
2011
1823
|
const ui = familyUI(doc().family);
|
|
2012
|
-
return kind2 === "node" ? _optionalChain([ui, 'optionalAccess',
|
|
1824
|
+
return kind2 === "node" ? _optionalChain([ui, 'optionalAccess', _53 => _53.nodeFields]) : kind2 === "edge" ? _optionalChain([ui, 'optionalAccess', _54 => _54.edgeFields]) : _optionalChain([ui, 'optionalAccess', _55 => _55.diagramFields]);
|
|
2013
1825
|
};
|
|
2014
1826
|
const setNodeData = {
|
|
2015
1827
|
name: "set_diagram_node_data",
|
|
@@ -2030,7 +1842,7 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
2030
1842
|
const patch = checkFieldData(fieldsOf("node"), data, `a ${doc().family} node`, node.shape);
|
|
2031
1843
|
const d = await apply({ type: "setNodeData", id, data: patch }, "Edit data");
|
|
2032
1844
|
const after = d.graph.nodes.find((n) => n.id === id);
|
|
2033
|
-
return { node: { ...nodeOut(d, id), data: pickFieldData(fieldsOf("node"), _optionalChain([after, 'optionalAccess',
|
|
1845
|
+
return { node: { ...nodeOut(d, id), data: pickFieldData(fieldsOf("node"), _optionalChain([after, 'optionalAccess', _56 => _56.data])) } };
|
|
2034
1846
|
}
|
|
2035
1847
|
};
|
|
2036
1848
|
const setEdgeData = {
|
|
@@ -2051,7 +1863,7 @@ function createDiagramToolProvider(controller, options = {}) {
|
|
|
2051
1863
|
const patch = checkFieldData(fieldsOf("edge"), data, `a ${doc().family} edge`);
|
|
2052
1864
|
const d = await apply({ type: "setEdgeData", id, data: patch }, "Edit data");
|
|
2053
1865
|
const edge = d.graph.edges.find((e) => e.id === id);
|
|
2054
|
-
return { edge: { id, ...edge ? { source: edge.source, target: edge.target } : {}, data: pickFieldData(fieldsOf("edge"), _optionalChain([edge, 'optionalAccess',
|
|
1866
|
+
return { edge: { id, ...edge ? { source: edge.source, target: edge.target } : {}, data: pickFieldData(fieldsOf("edge"), _optionalChain([edge, 'optionalAccess', _57 => _57.data])) } };
|
|
2055
1867
|
}
|
|
2056
1868
|
};
|
|
2057
1869
|
const setSettings = {
|
|
@@ -2147,8 +1959,8 @@ function headerIndexOf(lines, header) {
|
|
|
2147
1959
|
}
|
|
2148
1960
|
function draftFrames(current, target, options = {}) {
|
|
2149
1961
|
const maxFrames = Math.max(2, _nullishCoalesce(options.maxFrames, () => ( 40)));
|
|
2150
|
-
const now =
|
|
2151
|
-
const goal =
|
|
1962
|
+
const now = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, current);
|
|
1963
|
+
const goal = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, target);
|
|
2152
1964
|
if (goal.family !== now.family || goal.diagnostics.length) return null;
|
|
2153
1965
|
const eol = goal.eol;
|
|
2154
1966
|
const lines = target.split(/\r?\n/);
|
|
@@ -2160,14 +1972,14 @@ function draftFrames(current, target, options = {}) {
|
|
|
2160
1972
|
const have = bodyLines(currentLines, currentAt);
|
|
2161
1973
|
const body = lines.map((line, index) => ({ line, index })).slice(at + 1).filter(({ line }) => !isMeta(line));
|
|
2162
1974
|
for (let i = 0; i < have.length; i++) {
|
|
2163
|
-
if (_optionalChain([body, 'access',
|
|
1975
|
+
if (_optionalChain([body, 'access', _58 => _58[i], 'optionalAccess', _59 => _59.line]) !== have[i]) return null;
|
|
2164
1976
|
}
|
|
2165
1977
|
const frames = [];
|
|
2166
1978
|
let last = signature(now.graph);
|
|
2167
1979
|
for (let i = have.length; i < body.length; i++) {
|
|
2168
1980
|
const end = body[i].index;
|
|
2169
1981
|
const candidate = lines.slice(0, end + 1).join(eol) + eol;
|
|
2170
|
-
const doc =
|
|
1982
|
+
const doc = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, candidate);
|
|
2171
1983
|
if (doc.family !== goal.family || doc.diagnostics.length) continue;
|
|
2172
1984
|
const sig = signature(doc.graph);
|
|
2173
1985
|
if (sig === last) continue;
|
|
@@ -2242,7 +2054,7 @@ function planDiagramEdit(doc, place, op, speed = 1, next) {
|
|
|
2242
2054
|
};
|
|
2243
2055
|
switch (op.type) {
|
|
2244
2056
|
case "addNode": {
|
|
2245
|
-
const from = _optionalChain([next, 'optionalAccess',
|
|
2057
|
+
const from = _optionalChain([next, 'optionalAccess', _60 => _60.type]) === "addEdge" && next.edge.target === op.node.id ? at(next.edge.source) : null;
|
|
2246
2058
|
const to = op.position ? { x: op.position[0] + 80, y: op.position[1] + 28 } : from ? besideFree(place, from, doc.graph.direction) : freeSpot(place);
|
|
2247
2059
|
const label = _nullishCoalesce(op.node.label, () => ( op.node.id));
|
|
2248
2060
|
return [...click(to), { type: "type", text: label, ms: ms(Math.min(900, 60 * label.length + 200)) }, { type: "commit" }];
|
|
@@ -2332,7 +2144,7 @@ var DiagramDirector = class {
|
|
|
2332
2144
|
for (const op of ops) {
|
|
2333
2145
|
const problem = validateDiagramEdit(check, op);
|
|
2334
2146
|
if (problem) return Promise.resolve({ ok: false, message: problem });
|
|
2335
|
-
check =
|
|
2147
|
+
check = _chunk3FSUJIXNcjs.applyEdits.call(void 0, check, [op]);
|
|
2336
2148
|
}
|
|
2337
2149
|
return this.queue.run(actor, async () => {
|
|
2338
2150
|
const mark = this.controller.history.mark();
|
|
@@ -2437,10 +2249,10 @@ var DiagramDirector = class {
|
|
|
2437
2249
|
}
|
|
2438
2250
|
};
|
|
2439
2251
|
function planDiagramEdits(source, place, ops, speed = 1) {
|
|
2440
|
-
let doc =
|
|
2252
|
+
let doc = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, source);
|
|
2441
2253
|
return ops.map((op, i) => {
|
|
2442
2254
|
const steps = planDiagramEdit(doc, place, op, speed, ops[i + 1]);
|
|
2443
|
-
doc =
|
|
2255
|
+
doc = _chunk3FSUJIXNcjs.applyEdits.call(void 0, doc, [op]);
|
|
2444
2256
|
return steps;
|
|
2445
2257
|
});
|
|
2446
2258
|
}
|
|
@@ -2609,4 +2421,4 @@ function planDiagramEdits(source, place, ops, speed = 1) {
|
|
|
2609
2421
|
|
|
2610
2422
|
|
|
2611
2423
|
|
|
2612
|
-
exports.ARCH_METRICS =
|
|
2424
|
+
exports.ARCH_METRICS = _chunk3FSUJIXNcjs.ARCH_METRICS; exports.C4_METRICS = _chunk3FSUJIXNcjs.C4_METRICS; exports.CLASS_RELATIONS = _chunk3FSUJIXNcjs.CLASS_RELATIONS; exports.DIRECTIONS = DIRECTIONS; exports.DiagramController = DiagramController; exports.DiagramDirector = DiagramDirector; exports.EDITABLE_DIAGRAM_FAMILIES = EDITABLE_DIAGRAM_FAMILIES; exports.ER_CARDINALITIES = _chunk3FSUJIXNcjs.ER_CARDINALITIES; exports.ER_PATTERNS = _chunk3FSUJIXNcjs.ER_PATTERNS; exports.FAMILY_BLANKS = FAMILY_BLANKS; exports.FAMILY_DESCRIPTIONS = FAMILY_DESCRIPTIONS; exports.FAMILY_TEMPLATES = FAMILY_TEMPLATES; exports.FAMILY_TITLES = FAMILY_TITLES; exports.FLOWCHART_SHAPES = _chunk3FSUJIXNcjs.FLOWCHART_SHAPES; exports.GANTT_CONFIG_KEYS = _chunk3FSUJIXNcjs.GANTT_CONFIG_KEYS; exports.GANTT_METRICS = _chunk3FSUJIXNcjs.GANTT_METRICS; exports.GANTT_TAGS = _chunk3FSUJIXNcjs.GANTT_TAGS; exports.META_COMMENT_PREFIX = _chunk3FSUJIXNcjs.META_COMMENT_PREFIX; exports.META_FRONTMATTER_KEY = _chunk3FSUJIXNcjs.META_FRONTMATTER_KEY; exports.POINT_BOX = _chunk3FSUJIXNcjs.POINT_BOX; exports.PRESENCE_COLORS = _chunkSWTUM32Hcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkSWTUM32Hcjs.PerformanceQueue; exports.PresenceStore = _chunkSWTUM32Hcjs.PresenceStore; exports.QUADRANT_METRICS = _chunk3FSUJIXNcjs.QUADRANT_METRICS; exports.RADAR_CHART_BOX = _chunk3FSUJIXNcjs.RADAR_CHART_BOX; exports.SEQUENCE_METRICS = _chunk3FSUJIXNcjs.SEQUENCE_METRICS; exports.STATE_SHAPES = _chunk3FSUJIXNcjs.STATE_SHAPES; exports.XY_CHART_BOX = _chunk3FSUJIXNcjs.XY_CHART_BOX; exports.afterIds = _chunk3FSUJIXNcjs.afterIds; exports.applyEdit = _chunk3FSUJIXNcjs.applyEdit; exports.applyEdits = _chunk3FSUJIXNcjs.applyEdits; exports.applyStatementEdit = _chunk3FSUJIXNcjs.applyStatementEdit; exports.architectureAdapter = _chunk3FSUJIXNcjs.architectureAdapter; exports.architectureArrow = _chunk3FSUJIXNcjs.architectureArrow; exports.architectureEdgeRoute = _chunk3FSUJIXNcjs.architectureEdgeRoute; exports.architectureGrammar = _chunk3FSUJIXNcjs.architectureGrammar; exports.architectureLayout = _chunk3FSUJIXNcjs.architectureLayout; exports.architectureUI = architectureUI; exports.c4Adapter = _chunk3FSUJIXNcjs.c4Adapter; exports.c4ArrowHead = _chunk3FSUJIXNcjs.c4ArrowHead; exports.c4BoundaryText = _chunk3FSUJIXNcjs.c4BoundaryText; exports.c4ElementGeometry = _chunk3FSUJIXNcjs.c4ElementGeometry; exports.c4ElementType = _chunk3FSUJIXNcjs.c4ElementType; exports.c4Grammar = _chunk3FSUJIXNcjs.c4Grammar; exports.c4Layout = _chunk3FSUJIXNcjs.c4Layout; exports.c4RelGeometry = _chunk3FSUJIXNcjs.c4RelGeometry; exports.c4Stereotype = _chunk3FSUJIXNcjs.c4Stereotype; exports.c4UI = c4UI; exports.canonicalShape = _chunk3FSUJIXNcjs.canonicalShape; exports.changedItems = changedItems; exports.checkFieldData = checkFieldData; exports.classGrammar = _chunk3FSUJIXNcjs.classGrammar; exports.classUI = classUI; exports.createDiagramEditorDocument = createDiagramEditorDocument; exports.createDiagramToolProvider = createDiagramToolProvider; exports.createInstantPresenceClock = _chunkSWTUM32Hcjs.createInstantPresenceClock; exports.createLineAdapter = _chunk3FSUJIXNcjs.createLineAdapter; exports.createPassthroughAdapter = _chunk3FSUJIXNcjs.createPassthroughAdapter; exports.createStatementAdapter = _chunk3FSUJIXNcjs.createStatementAdapter; exports.describeDiagram = describeDiagram; exports.describeFields = describeFields; exports.detectFamily = _chunk3FSUJIXNcjs.detectFamily; exports.detectFamilyFromHeader = _chunkVU6WQSMBcjs.detectFamilyFromHeader; exports.diagramShapes = diagramShapes; exports.diagramSupportsDirection = diagramSupportsDirection; exports.diagramSupportsGroups = diagramSupportsGroups; exports.draftFrames = draftFrames; exports.dropMetaKeys = _chunk3FSUJIXNcjs.dropMetaKeys; exports.emptyMeta = _chunk3FSUJIXNcjs.emptyMeta; exports.erGrammar = _chunk3FSUJIXNcjs.erGrammar; exports.erUI = erUI; exports.familyUI = familyUI; exports.filterInPlace = _chunk3FSUJIXNcjs.filterInPlace; exports.findMermaidSources = findMermaidSources; exports.flowchartAdapter = _chunk3FSUJIXNcjs.flowchartAdapter; exports.flowchartUI = flowchartUI; exports.formatAxis = _chunk3FSUJIXNcjs.formatAxis; exports.formatChain = _chunk3FSUJIXNcjs.formatChain; exports.formatGanttDate = _chunk3FSUJIXNcjs.formatGanttDate; exports.formatLink = _chunk3FSUJIXNcjs.formatLink; exports.formatNode = _chunk3FSUJIXNcjs.formatNode; exports.ganttAdapter = _chunk3FSUJIXNcjs.ganttAdapter; exports.ganttGeometry = _chunk3FSUJIXNcjs.ganttGeometry; exports.ganttGrammar = _chunk3FSUJIXNcjs.ganttGrammar; exports.ganttUI = ganttUI; exports.getDiagramAdapter = _chunk3FSUJIXNcjs.getDiagramAdapter; exports.getFamilyLayout = _chunk3FSUJIXNcjs.getFamilyLayout; exports.gitGraphAdapter = _chunk3FSUJIXNcjs.gitGraphAdapter; exports.gitGraphGrammar = _chunk3FSUJIXNcjs.gitGraphGrammar; exports.gitGraphUI = gitGraphUI; exports.indentOf = _chunk3FSUJIXNcjs.indentOf; exports.isMetaEmpty = _chunk3FSUJIXNcjs.isMetaEmpty; exports.journeyAdapter = _chunk3FSUJIXNcjs.journeyAdapter; exports.journeyGrammar = _chunk3FSUJIXNcjs.journeyGrammar; exports.journeyLayout = _chunk3FSUJIXNcjs.journeyLayout; exports.journeyUI = journeyUI; exports.mergeMeta = _chunk3FSUJIXNcjs.mergeMeta; exports.mindmapAdapter = _chunk3FSUJIXNcjs.mindmapAdapter; exports.mindmapGrammar = _chunk3FSUJIXNcjs.mindmapGrammar; exports.mindmapUI = mindmapUI; exports.parseAttributes = _chunk3FSUJIXNcjs.parseAttributes; exports.parseChain = _chunk3FSUJIXNcjs.parseChain; exports.parseFlowchartSource = _chunk3FSUJIXNcjs.parseFlowchartSource; exports.parseGanttDate = _chunk3FSUJIXNcjs.parseGanttDate; exports.parseLink = _chunk3FSUJIXNcjs.parseLink; exports.parseMembers = _chunk3FSUJIXNcjs.parseMembers; exports.parseMermaid = _chunk3FSUJIXNcjs.parseMermaid; exports.parseSankey = _chunkTTCJPX4Ucjs.parseSankey; exports.parseStatement = _chunk3FSUJIXNcjs.parseStatement; exports.parseStatementDocument = _chunk3FSUJIXNcjs.parseStatementDocument; exports.parseTreemap = _chunkTTCJPX4Ucjs.parseTreemap; exports.pickFieldData = pickFieldData; exports.pieAdapter = _chunk3FSUJIXNcjs.pieAdapter; exports.pieGrammar = _chunk3FSUJIXNcjs.pieGrammar; exports.pieUI = pieUI; exports.planDiagramEdit = planDiagramEdit; exports.planDiagramEdits = planDiagramEdits; exports.pointCentre = _chunk3FSUJIXNcjs.pointCentre; exports.pointPosition = _chunk3FSUJIXNcjs.pointPosition; exports.positionToData = _chunk3FSUJIXNcjs.positionToData; exports.quadrantAdapter = _chunk3FSUJIXNcjs.quadrantAdapter; exports.quadrantGeometry = _chunk3FSUJIXNcjs.quadrantGeometry; exports.quadrantGrammar = _chunk3FSUJIXNcjs.quadrantGrammar; exports.quadrantSpace = _chunk3FSUJIXNcjs.quadrantSpace; exports.quadrantUI = quadrantUI; exports.quote = _chunk3FSUJIXNcjs.quote; exports.quoteLabelIfNeeded = _chunk3FSUJIXNcjs.quoteLabelIfNeeded; exports.radarAdapter = _chunk3FSUJIXNcjs.radarAdapter; exports.radarGrammar = _chunk3FSUJIXNcjs.radarGrammar; exports.radarUI = radarUI; exports.realPresenceClock = _chunkSWTUM32Hcjs.realPresenceClock; exports.registerDiagramAdapter = _chunk3FSUJIXNcjs.registerDiagramAdapter; exports.registerFamilyLayout = _chunk3FSUJIXNcjs.registerFamilyLayout; exports.relationFor = _chunk3FSUJIXNcjs.relationFor; exports.renameMetaKey = _chunk3FSUJIXNcjs.renameMetaKey; exports.resolveShape = _chunk3FSUJIXNcjs.resolveShape; exports.sequenceAdapter = _chunk3FSUJIXNcjs.sequenceAdapter; exports.sequenceGeometry = _chunk3FSUJIXNcjs.sequenceGeometry; exports.sequenceGrammar = _chunk3FSUJIXNcjs.sequenceGrammar; exports.sequenceUI = sequenceUI; exports.serializeMermaid = _chunk3FSUJIXNcjs.serializeMermaid; exports.serializeMeta = _chunk3FSUJIXNcjs.serializeMeta; exports.serializeStatementDocument = _chunk3FSUJIXNcjs.serializeStatementDocument; exports.serviceLabelLines = _chunk3FSUJIXNcjs.serviceLabelLines; exports.sharedFrameLayout = _chunk3FSUJIXNcjs.sharedFrameLayout; exports.slugId = _chunk3FSUJIXNcjs.slugId; exports.spaceInput = _chunk3FSUJIXNcjs.spaceInput; exports.splitOutsideQuotes = _chunk3FSUJIXNcjs.splitOutsideQuotes; exports.splitSource = _chunkVU6WQSMBcjs.splitSource; exports.splitStatements = _chunkVU6WQSMBcjs.splitStatements; exports.stateGrammar = _chunk3FSUJIXNcjs.stateGrammar; exports.stateUI = stateUI; exports.supportTierOf = _chunk3FSUJIXNcjs.supportTierOf; exports.timelineAdapter = _chunk3FSUJIXNcjs.timelineAdapter; exports.timelineGrammar = _chunk3FSUJIXNcjs.timelineGrammar; exports.timelineLayout = _chunk3FSUJIXNcjs.timelineLayout; exports.timelineUI = timelineUI; exports.treemapValue = _chunkTTCJPX4Ucjs.treemapValue; exports.uniqueId = _chunk3FSUJIXNcjs.uniqueId; exports.unquote = _chunk3FSUJIXNcjs.unquote; exports.validateDiagramEdit = validateDiagramEdit; exports.xyChartAdapter = _chunk3FSUJIXNcjs.xyChartAdapter; exports.xyChartGrammar = _chunk3FSUJIXNcjs.xyChartGrammar; exports.xyChartUI = xyChartUI;
|