@cardenelabs/dragon 0.42.1 → 0.43.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 +34 -1
- package/dist/cli.cjs +1732 -501
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1732 -501
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +1635 -496
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +1635 -496
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +1651 -417
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -3
- package/dist/index.d.ts +66 -3
- package/dist/index.js +1651 -417
- package/dist/index.js.map +1 -1
- package/dist/{ink-B8EZL7JV.d.cts → ink-B6s_SMXG.d.cts} +23 -3
- package/dist/{ink-B8EZL7JV.d.ts → ink-B6s_SMXG.d.ts} +23 -3
- package/dist/node.cjs +1102 -475
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +1102 -475
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +3 -2
- package/package.json +1 -1
- package/src/export/fonts.ts +13 -6
- package/src/index.ts +4 -1
- package/src/layout/tree.ts +458 -0
- package/src/look/values.ts +42 -0
- package/src/messages.ts +34 -2
- package/src/parser.ts +89 -1
- package/src/printer.ts +6 -1
- package/src/render/icons.ts +2 -0
- package/src/render/svg.ts +41 -3
- package/src/render/tree.ts +164 -0
- package/src/schema.ts +27 -3
- package/src/schemas/diagram.schema.json +79 -14
- package/src/schemas/validate-diagram.js +1 -1
- package/src/timeline.ts +2 -2
- package/src/words.ts +12 -2
package/dist/cli.cjs
CHANGED
|
@@ -287,6 +287,15 @@ var TYPE = {
|
|
|
287
287
|
gitId: text(11, 700),
|
|
288
288
|
gitHash: text(10.5, 600, "mono"),
|
|
289
289
|
gitNote: text(10.5, 650),
|
|
290
|
+
/**
|
|
291
|
+
* 木の図 (#3233) の、箱の中の値 (hash) と名札、根の箱の値と名札、葉の下の札の字。
|
|
292
|
+
* 値を持たない箱の名札は箱の名前 (`boxName`) の字で描く
|
|
293
|
+
*/
|
|
294
|
+
treeHash: text(13.5, 700, "mono"),
|
|
295
|
+
treeName: text(10.5, 600),
|
|
296
|
+
rootHash: text(15, 700, "mono"),
|
|
297
|
+
rootName: text(11, 700),
|
|
298
|
+
treeCard: text(11.5, 650),
|
|
290
299
|
/**
|
|
291
300
|
* 時間軸の図 (#3165)。拡大の帯の列の上の字、印の列の名前、時刻の字、区切りの名前と目盛りの番号の範囲、
|
|
292
301
|
* 節目の名札と状態、範囲の括弧の字、空きの枠の字、物差しの線の字。和文を含む字は同じ大きさと太さの和文の字で描く
|
|
@@ -379,6 +388,36 @@ var LOOK = {
|
|
|
379
388
|
labelUnder: 50,
|
|
380
389
|
colors: ["blue", "violet", "green", "amber", "rose"]
|
|
381
390
|
},
|
|
391
|
+
/**
|
|
392
|
+
* 木の図 (#3233)。step 2 で本人が選んだ「根を上」の試作 (`.context/propose/merkle-look/`) の寸法を写す。
|
|
393
|
+
* 木の箱は幅の下限 `w`、高さ `h`、字の左右の余白 `padX`、角の丸み `radius`。根の箱は `root` の幅の下限と高さと角の丸みを持ち、
|
|
394
|
+
* 左に絵柄を置いて (`iconX` は箱の左端から絵柄の左端まで)、`textX` から字を左に揃えて並べ、右に `padR` を空ける。
|
|
395
|
+
* `nameY` と `hashY` は根の箱の真ん中から名札と値の基準線まで。ほかの箱の値と名札は `hashY` と `nameY`、1 行の字は `oneY` に置く。
|
|
396
|
+
* 葉は書いた順に横に並べ、隣の葉の箱の間を `slotGap` 空ける。根の上端は図の上の余白から `top` 下げ、深さの段の真ん中どうしは `row` 離す。
|
|
397
|
+
* `card` は値を持つ葉の下の名札の札で、葉の真ん中から札の真ん中まで `drop`、高さ `h`、幅の下限 `minW`、
|
|
398
|
+
* 字の左右の余白 `padX`、絵柄の幅 `icon` と絵柄と字の間 `gap`、絵柄の縮み `glyph`、角の丸み `radius`。
|
|
399
|
+
* `boxGap` は木と木でない箱の列の間、`badgeAlong` は木の線を走る段の番号を、曲がり角から横の線に沿って進める長さ。
|
|
400
|
+
* `faint` は木の線を運ぶ物が通った段から後に、運ぶ物を送りも受けもしていない木の箱を薄く出す濃さ。`color` と `rootColor` は木の箱と根の箱の色
|
|
401
|
+
*/
|
|
402
|
+
tree: {
|
|
403
|
+
w: 74,
|
|
404
|
+
h: 44,
|
|
405
|
+
padX: 10,
|
|
406
|
+
radius: 10,
|
|
407
|
+
root: { w: 112, h: 54, radius: 13, iconX: 10, textX: 46, padR: 14, nameY: -4, hashY: 14 },
|
|
408
|
+
hashY: -1,
|
|
409
|
+
nameY: 14,
|
|
410
|
+
oneY: 4.5,
|
|
411
|
+
slotGap: 12,
|
|
412
|
+
top: 16,
|
|
413
|
+
row: 102,
|
|
414
|
+
card: { drop: 78, h: 30, minW: 70, padX: 10, icon: 12, gap: 6, glyph: 0.62, radius: 9 },
|
|
415
|
+
boxGap: 24,
|
|
416
|
+
badgeAlong: 22,
|
|
417
|
+
faint: 0.42,
|
|
418
|
+
color: "violet",
|
|
419
|
+
rootColor: "green"
|
|
420
|
+
},
|
|
382
421
|
/**
|
|
383
422
|
* 時間軸の図 (#3165)。見本帳の試作 (`scenes/finality.js`) の寸法を写す。
|
|
384
423
|
* 図の幅は `width` で、時間軸は左の `axisX` から右の余白 `right` の手前まで。印の列の名前が長い時は、名前の右に `gutterGap` を空けて軸を右へ寄せる。
|
|
@@ -479,7 +518,10 @@ var LOOK = {
|
|
|
479
518
|
timePoint: 1.75,
|
|
480
519
|
timeFlag: 1.8,
|
|
481
520
|
timeNeedle: 1.25,
|
|
482
|
-
timeMeter: 1.25
|
|
521
|
+
timeMeter: 1.25,
|
|
522
|
+
tree: 1.5,
|
|
523
|
+
treeTrail: 2.6,
|
|
524
|
+
treeCon: 1.3
|
|
483
525
|
},
|
|
484
526
|
shadow: { near: 0.8, far: 4, nearY: 1, farY: 3 },
|
|
485
527
|
mini: { w: 168, pad: 8, title: 14, inset: 12, radius: 10 },
|
|
@@ -1203,7 +1245,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
1203
1245
|
};
|
|
1204
1246
|
const inset = LOOK.edge.inset;
|
|
1205
1247
|
const gapX = (col, toRight) => toRight ? colLeft[col] + colW[col] + (between[col] ?? A.columnGap) / 2 : colLeft[col] - (between[col - 1] ?? A.columnGap) / 2;
|
|
1206
|
-
const
|
|
1248
|
+
const route2 = (from, to) => {
|
|
1207
1249
|
const a = byId.get(from);
|
|
1208
1250
|
const b = byId.get(to);
|
|
1209
1251
|
if (from === to) return loopUnder(a);
|
|
@@ -1276,7 +1318,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
1276
1318
|
event,
|
|
1277
1319
|
from: edge2.from,
|
|
1278
1320
|
to: edge2.to,
|
|
1279
|
-
points:
|
|
1321
|
+
points: route2(edge2.from, edge2.to),
|
|
1280
1322
|
color: edgeColor(edge2, colors),
|
|
1281
1323
|
carry: edge2.carry
|
|
1282
1324
|
}));
|
|
@@ -1375,11 +1417,12 @@ function grow(layout, groups, slots, rooms) {
|
|
|
1375
1417
|
|
|
1376
1418
|
// src/words.ts
|
|
1377
1419
|
var keys = (table) => Object.keys(table);
|
|
1378
|
-
var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true });
|
|
1420
|
+
var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true, tree: true });
|
|
1379
1421
|
var STATE_ENDS = ["start", "finish"];
|
|
1380
1422
|
var TIME_HEADS = ["scale", "period", "row", "point", "zoom", "mark", "span"];
|
|
1381
1423
|
var NOW = "now";
|
|
1382
|
-
var
|
|
1424
|
+
var TREE_HEADS = ["leaf", "node"];
|
|
1425
|
+
var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS, ...TREE_HEADS];
|
|
1383
1426
|
var AS = "as";
|
|
1384
1427
|
var ON = "on";
|
|
1385
1428
|
var COPY = "copy";
|
|
@@ -1387,6 +1430,7 @@ var MERGE = "merge";
|
|
|
1387
1430
|
var FROM = "from";
|
|
1388
1431
|
var HEAD = "HEAD";
|
|
1389
1432
|
var AT = "at";
|
|
1433
|
+
var OF = "of";
|
|
1390
1434
|
var ATTRS = {
|
|
1391
1435
|
diagram: ["view"],
|
|
1392
1436
|
group: ["note", "color", "icon"],
|
|
@@ -1398,6 +1442,8 @@ var ATTRS = {
|
|
|
1398
1442
|
strip: ["meter"],
|
|
1399
1443
|
branch: ["note"],
|
|
1400
1444
|
commit: ["hash", "note"],
|
|
1445
|
+
leaf: ["hash"],
|
|
1446
|
+
node: ["hash"],
|
|
1401
1447
|
scale: ["from"],
|
|
1402
1448
|
period: ["from"],
|
|
1403
1449
|
row: ["color", "empty"],
|
|
@@ -1619,11 +1665,11 @@ function layoutGit(diagram) {
|
|
|
1619
1665
|
col.set(c.id, k);
|
|
1620
1666
|
laneLast.set(c.branch, k);
|
|
1621
1667
|
}
|
|
1622
|
-
const
|
|
1668
|
+
const linesOf2 = (c) => [
|
|
1623
1669
|
...c.hash !== void 0 ? [{ text: c.hash, style: TYPE.gitHash }] : [],
|
|
1624
1670
|
...c.note !== void 0 ? [{ text: c.note, style: TYPE.gitNote }] : []
|
|
1625
1671
|
];
|
|
1626
|
-
const textW = (c) => Math.max(0, ...
|
|
1672
|
+
const textW = (c) => Math.max(0, ...linesOf2(c).map((line) => textWidth(line.text, line.style)));
|
|
1627
1673
|
const tagW = (ref) => textWidth(ref, hasWide(ref) ? TYPE.carrierJa : TYPE.carrier) + C.tagPadX * 2;
|
|
1628
1674
|
const refWidth = Math.max(0, ...walked.refs.map((r) => tagW(r.name)));
|
|
1629
1675
|
const pitch = Math.max(G.pitch, ...walked.made.map((c) => textW(c) + G.textGap), refWidth + G.textGap);
|
|
@@ -1638,7 +1684,7 @@ function layoutGit(diagram) {
|
|
|
1638
1684
|
})
|
|
1639
1685
|
);
|
|
1640
1686
|
const extraRows = (branch) => Math.max(0, ...walked.made.filter((c) => c.branch === branch).map((c) => (walked.rows.get(c.id) ?? 0) - 2)) * G.row;
|
|
1641
|
-
const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 &&
|
|
1687
|
+
const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf2(c).length > 0);
|
|
1642
1688
|
const lanes = [];
|
|
1643
1689
|
let y = margin;
|
|
1644
1690
|
walked.branches.forEach((id, i) => {
|
|
@@ -1656,7 +1702,7 @@ function layoutGit(diagram) {
|
|
|
1656
1702
|
const isTop = laneIndex.get(c.branch) === 0;
|
|
1657
1703
|
const cx = x0 + pitch * (col.get(c.id) ?? 0) + (isTop ? 0 : pitch / 2);
|
|
1658
1704
|
const cy = lane.line;
|
|
1659
|
-
const lines =
|
|
1705
|
+
const lines = linesOf2(c);
|
|
1660
1706
|
const baselines = lines.map((_, k) => isTop ? cy - G.above - (lines.length - 1 - k) * G.lineStep : cy + G.under + k * G.lineStep);
|
|
1661
1707
|
const boxes2 = lines.map((line, k) => textBox(line.text, cx, baselines[k], line.style, "middle"));
|
|
1662
1708
|
const text2 = boxes2.length === 0 ? void 0 : { ...union(boxes2), lines: lines.map((line) => line.text), baselines };
|
|
@@ -2216,7 +2262,7 @@ function layoutState(diagram, lang) {
|
|
|
2216
2262
|
};
|
|
2217
2263
|
const exitX = (box) => starts && box === first ? box.cx + T.side.entry : box.cx;
|
|
2218
2264
|
const finishOf = (id) => ends.find((e) => e.kind === "finish" && e.box === id);
|
|
2219
|
-
const
|
|
2265
|
+
const route2 = (from, to) => {
|
|
2220
2266
|
if (from === "start") {
|
|
2221
2267
|
const start = ends.find((e) => e.kind === "start");
|
|
2222
2268
|
const target = byId.get(to);
|
|
@@ -2260,7 +2306,7 @@ function layoutState(diagram, lang) {
|
|
|
2260
2306
|
event,
|
|
2261
2307
|
from: edge2.from,
|
|
2262
2308
|
to: edge2.to,
|
|
2263
|
-
points:
|
|
2309
|
+
points: route2(edge2.from, edge2.to),
|
|
2264
2310
|
color: colorOf(edge2, colors),
|
|
2265
2311
|
carry: edge2.carry,
|
|
2266
2312
|
...settle ? { settle } : {},
|
|
@@ -2277,7 +2323,7 @@ function layoutState(diagram, lang) {
|
|
|
2277
2323
|
e.points = e.points.map(([x, y]) => flat ? [x, y + d] : [x + d, y]);
|
|
2278
2324
|
outward.set(e, flat ? d > 0 ? "below" : "above" : d > 0 ? "right" : "left");
|
|
2279
2325
|
}
|
|
2280
|
-
const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points:
|
|
2326
|
+
const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route2(p.from, p.to) }));
|
|
2281
2327
|
const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ? loopBadge(edge2.points) : badgeOnPath(edge2.points, taken, lines2);
|
|
2282
2328
|
const labels = [];
|
|
2283
2329
|
const marks = ends.flatMap((e) => e.text === "" ? [] : [textBox(e.text, ...markText(e), TYPE.regionNote)]);
|
|
@@ -2810,6 +2856,321 @@ function labelsOf2(diagram, layout) {
|
|
|
2810
2856
|
return labels;
|
|
2811
2857
|
}
|
|
2812
2858
|
|
|
2859
|
+
// src/layout/tree.ts
|
|
2860
|
+
var isTreeLayout = (layout) => layout.kind === "tree";
|
|
2861
|
+
function grow2(diagram) {
|
|
2862
|
+
const boxes = new Set(diagram.boxes.map((b) => b.id));
|
|
2863
|
+
const byId = /* @__PURE__ */ new Set();
|
|
2864
|
+
const parents = /* @__PURE__ */ new Map();
|
|
2865
|
+
const grown = [];
|
|
2866
|
+
diagram.steps.forEach((step, s) => {
|
|
2867
|
+
step.events.forEach((e, k) => {
|
|
2868
|
+
if (e.type !== "leaf" && e.type !== "node" || byId.has(e.id) || boxes.has(e.id)) return;
|
|
2869
|
+
const children = e.type === "node" ? [...new Set(e.children)].filter((c) => byId.has(c) && !parents.has(c)) : [];
|
|
2870
|
+
for (const c of children) parents.set(c, e.id);
|
|
2871
|
+
grown.push({ id: e.id, kind: e.type, children, step: s, event: k, ...e.hash !== void 0 ? { hash: e.hash } : {} });
|
|
2872
|
+
byId.add(e.id);
|
|
2873
|
+
});
|
|
2874
|
+
});
|
|
2875
|
+
return { grown, parents };
|
|
2876
|
+
}
|
|
2877
|
+
function linesOf(g, root) {
|
|
2878
|
+
if (g.hash === void 0) return [{ text: g.id, style: TYPE.boxName }];
|
|
2879
|
+
if (root)
|
|
2880
|
+
return [
|
|
2881
|
+
{ text: g.id, style: TYPE.rootName },
|
|
2882
|
+
{ text: g.hash, style: TYPE.rootHash }
|
|
2883
|
+
];
|
|
2884
|
+
if (g.kind === "leaf") return [{ text: g.hash, style: TYPE.treeHash }];
|
|
2885
|
+
return [
|
|
2886
|
+
{ text: g.hash, style: TYPE.treeHash },
|
|
2887
|
+
{ text: g.id, style: TYPE.treeName }
|
|
2888
|
+
];
|
|
2889
|
+
}
|
|
2890
|
+
function route(a, b) {
|
|
2891
|
+
const i = LOOK.edge.inset;
|
|
2892
|
+
const top = Math.max(a.y, b.y);
|
|
2893
|
+
const bottom = Math.min(a.y + a.h, b.y + b.h);
|
|
2894
|
+
if (bottom > top) {
|
|
2895
|
+
const y = (top + bottom) / 2;
|
|
2896
|
+
return b.x >= a.x + a.w ? [
|
|
2897
|
+
[a.x + a.w + i, y],
|
|
2898
|
+
[b.x - i, y]
|
|
2899
|
+
] : [
|
|
2900
|
+
[a.x - i, y],
|
|
2901
|
+
[b.x + b.w + i, y]
|
|
2902
|
+
];
|
|
2903
|
+
}
|
|
2904
|
+
const left = Math.max(a.x, b.x);
|
|
2905
|
+
const right = Math.min(a.x + a.w, b.x + b.w);
|
|
2906
|
+
if (right > left) {
|
|
2907
|
+
const x = (left + right) / 2;
|
|
2908
|
+
return b.y >= a.y + a.h ? [
|
|
2909
|
+
[x, a.y + a.h + i],
|
|
2910
|
+
[x, b.y - i]
|
|
2911
|
+
] : [
|
|
2912
|
+
[x, a.y - i],
|
|
2913
|
+
[x, b.y + b.h + i]
|
|
2914
|
+
];
|
|
2915
|
+
}
|
|
2916
|
+
const ax = a.x + a.w / 2;
|
|
2917
|
+
const ty = b.y + b.h / 2;
|
|
2918
|
+
return [
|
|
2919
|
+
[ax, b.y > a.y ? a.y + a.h + i : a.y - i],
|
|
2920
|
+
[ax, ty],
|
|
2921
|
+
[b.x > ax ? b.x - i : b.x + b.w + i, ty]
|
|
2922
|
+
];
|
|
2923
|
+
}
|
|
2924
|
+
function layoutTree(diagram) {
|
|
2925
|
+
const { margin, gap, box: B, tree: T, badge: BD } = LOOK;
|
|
2926
|
+
const { grown, parents } = grow2(diagram);
|
|
2927
|
+
const tops = grown.filter((g) => !parents.has(g.id));
|
|
2928
|
+
const rootId = tops[tops.length - 1]?.id;
|
|
2929
|
+
const byId = new Map(grown.map((g) => [g.id, g]));
|
|
2930
|
+
const depth = /* @__PURE__ */ new Map();
|
|
2931
|
+
const walk2 = (id, d) => {
|
|
2932
|
+
depth.set(id, d);
|
|
2933
|
+
for (const c of byId.get(id)?.children ?? []) walk2(c, d + 1);
|
|
2934
|
+
};
|
|
2935
|
+
for (const t of tops) walk2(t.id, 0);
|
|
2936
|
+
const texts = new Map(grown.map((g) => [g.id, linesOf(g, g.id === rootId)]));
|
|
2937
|
+
const widest = (id) => Math.max(0, ...(texts.get(id) ?? []).map((line) => textWidth(line.text, line.style)));
|
|
2938
|
+
const widthOf = (g) => g.id === rootId ? Math.max(T.root.w, T.root.textX + widest(g.id) + T.root.padR) : Math.max(T.w, widest(g.id) + T.padX * 2);
|
|
2939
|
+
const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap + textWidth(g.id, TYPE.treeCard));
|
|
2940
|
+
const hasCard = (g) => g.kind === "leaf" && g.hash !== void 0;
|
|
2941
|
+
const slots = grown.filter((g) => g.children.length === 0);
|
|
2942
|
+
const pitch = Math.max(...grown.filter((g) => g.id !== rootId || g.children.length === 0).map((g) => Math.max(widthOf(g), hasCard(g) ? cardW(g) : 0)), T.w) + T.slotGap;
|
|
2943
|
+
const x0 = margin + BD.r * 2 + BD.inset;
|
|
2944
|
+
const xs = /* @__PURE__ */ new Map();
|
|
2945
|
+
slots.forEach((g, i) => xs.set(g.id, x0 + pitch * (i + 0.5)));
|
|
2946
|
+
const xOf = (id) => {
|
|
2947
|
+
const known = xs.get(id);
|
|
2948
|
+
if (known !== void 0) return known;
|
|
2949
|
+
const kids = byId.get(id)?.children ?? [];
|
|
2950
|
+
const x = (xOf(kids[0]) + xOf(kids[kids.length - 1])) / 2;
|
|
2951
|
+
xs.set(id, x);
|
|
2952
|
+
return x;
|
|
2953
|
+
};
|
|
2954
|
+
const top0 = margin + T.top;
|
|
2955
|
+
const yOf = (d) => top0 + T.root.h / 2 + d * T.row;
|
|
2956
|
+
const colors = boxColors(diagram);
|
|
2957
|
+
const nodes = grown.map((g) => {
|
|
2958
|
+
const root = g.id === rootId;
|
|
2959
|
+
const d = depth.get(g.id) ?? 0;
|
|
2960
|
+
const cx = xOf(g.id);
|
|
2961
|
+
const cy = yOf(d);
|
|
2962
|
+
const w = widthOf(g);
|
|
2963
|
+
const h = root ? T.root.h : T.h;
|
|
2964
|
+
const lines = texts.get(g.id) ?? [];
|
|
2965
|
+
const baselines = lines.length === 1 ? [cy + T.oneY] : root ? [cy + T.root.nameY, cy + T.root.hashY] : [cy + T.hashY, cy + T.nameY];
|
|
2966
|
+
const parent = parents.get(g.id);
|
|
2967
|
+
const color = root ? T.rootColor : T.color;
|
|
2968
|
+
colors.set(g.id, color);
|
|
2969
|
+
const cw = cardW(g);
|
|
2970
|
+
return {
|
|
2971
|
+
id: g.id,
|
|
2972
|
+
kind: g.kind,
|
|
2973
|
+
depth: d,
|
|
2974
|
+
...parent !== void 0 ? { parent } : {},
|
|
2975
|
+
children: g.children,
|
|
2976
|
+
step: g.step,
|
|
2977
|
+
event: g.event,
|
|
2978
|
+
...g.hash !== void 0 ? { hash: g.hash } : {},
|
|
2979
|
+
root,
|
|
2980
|
+
x: cx - w / 2,
|
|
2981
|
+
y: cy - h / 2,
|
|
2982
|
+
w,
|
|
2983
|
+
h,
|
|
2984
|
+
cx,
|
|
2985
|
+
cy,
|
|
2986
|
+
color,
|
|
2987
|
+
lines: lines.map((line) => line.text),
|
|
2988
|
+
baselines,
|
|
2989
|
+
styles: lines.map((line) => line.style),
|
|
2990
|
+
...hasCard(g) ? { card: { x: cx - cw / 2, y: cy + T.card.drop - T.card.h / 2, w: cw, h: T.card.h, text: g.id } } : {}
|
|
2991
|
+
};
|
|
2992
|
+
});
|
|
2993
|
+
const placed = new Map(nodes.map((n) => [n.id, n]));
|
|
2994
|
+
const links = nodes.flatMap(
|
|
2995
|
+
(p) => p.children.flatMap((id) => {
|
|
2996
|
+
const c = placed.get(id);
|
|
2997
|
+
if (!c) return [];
|
|
2998
|
+
const mid = (c.y + p.y + p.h) / 2;
|
|
2999
|
+
const points2 = [
|
|
3000
|
+
[c.cx, c.y - LOOK.edge.inset],
|
|
3001
|
+
[c.cx, mid],
|
|
3002
|
+
[p.cx, mid],
|
|
3003
|
+
[p.cx, p.y + p.h + LOOK.edge.inset]
|
|
3004
|
+
];
|
|
3005
|
+
return [{ from: c.id, to: p.id, step: p.step, event: p.event, points: points2 }];
|
|
3006
|
+
})
|
|
3007
|
+
);
|
|
3008
|
+
const rooms = slotRooms(diagram);
|
|
3009
|
+
const treeRight = Math.max(x0, ...nodes.flatMap((n) => [n.x + n.w, ...n.card ? [n.card.x + n.card.w] : []]));
|
|
3010
|
+
const rootBox = nodes.find((n) => n.root);
|
|
3011
|
+
const ids = new Set(diagram.boxes.map((b) => b.id));
|
|
3012
|
+
const named = edgesOf(diagram).flatMap(({ edge: edge2 }) => edge2.label !== void 0 && (ids.has(edge2.from) || ids.has(edge2.to)) ? [textWidth(edge2.label, labelStyle(edge2.label)) + LOOK.label.padX * 2] : []);
|
|
3013
|
+
const boxX = Math.max(treeRight + T.boxGap, (rootBox ? rootBox.x + rootBox.w : x0) + Math.max(0, ...named) + gap * 2);
|
|
3014
|
+
let by = rootBox?.y ?? top0;
|
|
3015
|
+
const boxes = diagram.boxes.map((b) => {
|
|
3016
|
+
const w = Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(rooms.get(b.id), b.icon !== void 0, B.padX));
|
|
3017
|
+
const y = by;
|
|
3018
|
+
by += B.h + gap;
|
|
3019
|
+
const box = {
|
|
3020
|
+
id: b.id,
|
|
3021
|
+
name: b.name,
|
|
3022
|
+
...b.sub !== void 0 ? { sub: b.sub } : {},
|
|
3023
|
+
...b.icon !== void 0 ? { icon: b.icon } : {},
|
|
3024
|
+
color: colors.get(b.id) ?? "slate",
|
|
3025
|
+
x: boxX,
|
|
3026
|
+
y,
|
|
3027
|
+
w,
|
|
3028
|
+
h: B.h,
|
|
3029
|
+
cx: boxX + w / 2,
|
|
3030
|
+
cy: y + B.h / 2
|
|
3031
|
+
};
|
|
3032
|
+
placeSlot(box, rooms.get(b.id));
|
|
3033
|
+
return box;
|
|
3034
|
+
});
|
|
3035
|
+
const boxById = new Map(boxes.map((b) => [b.id, b]));
|
|
3036
|
+
const runs = [];
|
|
3037
|
+
const edges = diagram.steps.flatMap(
|
|
3038
|
+
(step, s) => step.events.flatMap((e, k) => {
|
|
3039
|
+
if (e.type !== "edge") return [];
|
|
3040
|
+
const a = placed.get(e.from) ?? boxById.get(e.from);
|
|
3041
|
+
const b = placed.get(e.to) ?? boxById.get(e.to);
|
|
3042
|
+
if (!a || !b) return [];
|
|
3043
|
+
const up = links.find((l) => l.from === e.from && l.to === e.to);
|
|
3044
|
+
const down = links.find((l) => l.from === e.to && l.to === e.from);
|
|
3045
|
+
const link = up ?? down;
|
|
3046
|
+
if (link) runs.push({ step: s, event: k, link: link.from });
|
|
3047
|
+
const points2 = up ? up.points : down ? [...down.points].reverse() : e.from === e.to ? loopUnder({ cx: a.x + a.w / 2, y: a.y, h: a.h }) : route(a, b);
|
|
3048
|
+
return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color: edgeColor(e, colors), carry: e.carry }];
|
|
3049
|
+
})
|
|
3050
|
+
);
|
|
3051
|
+
seatCarriers(edges, boxById, rooms);
|
|
3052
|
+
const layout = {
|
|
3053
|
+
kind: "tree",
|
|
3054
|
+
width: 0,
|
|
3055
|
+
height: 0,
|
|
3056
|
+
regions: [],
|
|
3057
|
+
boxes,
|
|
3058
|
+
lifelines: [],
|
|
3059
|
+
edges,
|
|
3060
|
+
labels: [],
|
|
3061
|
+
actions: [],
|
|
3062
|
+
badges: [],
|
|
3063
|
+
paths: [],
|
|
3064
|
+
ends: [],
|
|
3065
|
+
nodes,
|
|
3066
|
+
links,
|
|
3067
|
+
runs
|
|
3068
|
+
};
|
|
3069
|
+
layout.badges = badgesOf3(diagram, layout);
|
|
3070
|
+
layout.labels = labelsOf3(diagram, layout);
|
|
3071
|
+
const cards = nodes.flatMap((n) => n.card ? [n.card] : []);
|
|
3072
|
+
const solids = [...nodes, ...cards, ...boxes, ...layout.labels];
|
|
3073
|
+
const points = edges.flatMap((e) => e.points);
|
|
3074
|
+
const right = Math.max(...solids.map((r) => r.x + r.w), ...points.map(([x]) => x), x0);
|
|
3075
|
+
const bottom = Math.max(...solids.map((r) => r.y + r.h), ...points.map(([, y]) => y), top0);
|
|
3076
|
+
const width = Math.max(right + margin, stripNeed(diagram) + margin * 2);
|
|
3077
|
+
const strip2 = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);
|
|
3078
|
+
layout.width = width;
|
|
3079
|
+
layout.height = (strip2 ? strip2.y + strip2.h : bottom) + margin;
|
|
3080
|
+
if (strip2) layout.strip = strip2;
|
|
3081
|
+
layout.badges = badgesOf3(diagram, layout);
|
|
3082
|
+
return layout;
|
|
3083
|
+
}
|
|
3084
|
+
function badgesOf3(diagram, layout) {
|
|
3085
|
+
const { r, inset } = LOOK.badge;
|
|
3086
|
+
const apart = r * 2 + inset;
|
|
3087
|
+
const taken = [];
|
|
3088
|
+
const out = [];
|
|
3089
|
+
const solids = [...layout.nodes, ...layout.nodes.flatMap((n) => n.card ? [n.card] : []), ...layout.boxes];
|
|
3090
|
+
const free = (p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && solids.every((s) => gapBetween(badgeRect(p), s) >= LOOK.label.touch);
|
|
3091
|
+
const put = (s, p, color) => {
|
|
3092
|
+
taken.push(p);
|
|
3093
|
+
out.push({ step: s, x: p[0], y: p[1], color });
|
|
3094
|
+
};
|
|
3095
|
+
const passed = /* @__PURE__ */ new Map();
|
|
3096
|
+
diagram.steps.forEach((step, s) => {
|
|
3097
|
+
const k = step.events.findIndex((e2) => e2.type === "leaf" || e2.type === "node" || e2.type === "edge");
|
|
3098
|
+
const first = step.events[k];
|
|
3099
|
+
const n = layout.nodes.find((x) => x.step === s && x.event === k);
|
|
3100
|
+
if (first && first.type !== "edge" && n) {
|
|
3101
|
+
const spots = [
|
|
3102
|
+
[n.x - inset - r, n.cy],
|
|
3103
|
+
[n.x, n.y],
|
|
3104
|
+
[n.x + n.w + inset + r, n.cy],
|
|
3105
|
+
[n.x + n.w, n.y]
|
|
3106
|
+
];
|
|
3107
|
+
put(s, spots.find(free) ?? spots[0], n.color);
|
|
3108
|
+
return;
|
|
3109
|
+
}
|
|
3110
|
+
const e = layout.edges.find((x) => x.step === s && x.event === k);
|
|
3111
|
+
if (first?.type === "edge" && e) {
|
|
3112
|
+
const key = [e.from, e.to].sort().join("\n");
|
|
3113
|
+
const run = layout.runs.some((x) => x.step === s && x.event === k);
|
|
3114
|
+
const lines = layout.edges.filter((x) => x !== e).map((x) => x.points);
|
|
3115
|
+
const point = passed.get(key) ?? (run ? onLink(e.points, free) : midway(e, free)) ?? badgeOnPath(e.points, taken, lines);
|
|
3116
|
+
passed.set(key, point);
|
|
3117
|
+
put(s, point, e.color);
|
|
3118
|
+
return;
|
|
3119
|
+
}
|
|
3120
|
+
const box = step.events.flatMap((ev) => ev.type === "swap" || ev.type === "action" ? [ev.box] : []).flatMap((id) => layout.boxes.filter((b) => b.id === id))[0];
|
|
3121
|
+
if (box) {
|
|
3122
|
+
out.push({ step: s, x: box.x, y: box.y, color: box.color });
|
|
3123
|
+
return;
|
|
3124
|
+
}
|
|
3125
|
+
if (layout.strip && step.events.some((ev) => ev.type === "strip")) {
|
|
3126
|
+
out.push({ step: s, x: layout.strip.x + inset, y: layout.strip.y + inset, color: "slate" });
|
|
3127
|
+
return;
|
|
3128
|
+
}
|
|
3129
|
+
const before = out[out.length - 1];
|
|
3130
|
+
const root = layout.nodes.find((x) => x.root);
|
|
3131
|
+
out.push(before ? { ...before, step: s } : { step: s, x: root?.x ?? LOOK.margin, y: root?.y ?? LOOK.margin, color: root?.color ?? "slate" });
|
|
3132
|
+
});
|
|
3133
|
+
return replaceSameSpot(out);
|
|
3134
|
+
}
|
|
3135
|
+
function onLink(points, free) {
|
|
3136
|
+
const [p0, p1, p2] = points;
|
|
3137
|
+
const flat = Math.abs(p2[0] - p1[0]);
|
|
3138
|
+
const { r, inset } = LOOK.badge;
|
|
3139
|
+
if (flat >= LOOK.tree.badgeAlong + r) {
|
|
3140
|
+
const p = along(points, pathLength([p0, p1]) + LOOK.tree.badgeAlong);
|
|
3141
|
+
if (free(p)) return p;
|
|
3142
|
+
}
|
|
3143
|
+
const side2 = [p1[0] + r + inset, p1[1]];
|
|
3144
|
+
return free(side2) ? side2 : void 0;
|
|
3145
|
+
}
|
|
3146
|
+
function midway(e, free) {
|
|
3147
|
+
const length = pathLength(e.points);
|
|
3148
|
+
const room = carrierHalf(e.carry)[0] + LOOK.badge.r + LOOK.badge.inset;
|
|
3149
|
+
for (let d = 0; d <= length / 2 - room; d += 1) {
|
|
3150
|
+
for (const at2 of [length / 2 - d, length / 2 + d]) {
|
|
3151
|
+
const p = along(e.points, at2);
|
|
3152
|
+
if (free(p)) return p;
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
return void 0;
|
|
3156
|
+
}
|
|
3157
|
+
function labelsOf3(diagram, layout) {
|
|
3158
|
+
const labels = [];
|
|
3159
|
+
const cards = layout.nodes.flatMap((n) => n.card ? [n.card] : []);
|
|
3160
|
+
for (const e of layout.edges) {
|
|
3161
|
+
const source = diagram.steps[e.step]?.events[e.event];
|
|
3162
|
+
if (source?.type !== "edge" || source.label === void 0) continue;
|
|
3163
|
+
const seen = layout.badges.filter((b) => b.step <= e.step).map((b) => badgeRect([b.x, b.y]));
|
|
3164
|
+
labels.push(
|
|
3165
|
+
placeLabel(
|
|
3166
|
+
{ step: e.step, event: e.event, text: source.label, points: e.points, color: e.color, ...source.labelSide ? { side: source.labelSide } : {}, flip: true },
|
|
3167
|
+
{ hard: [...layout.nodes, ...layout.boxes], soft: [...cards, ...labels.filter((l) => l.step === e.step)], touch: seen }
|
|
3168
|
+
)
|
|
3169
|
+
);
|
|
3170
|
+
}
|
|
3171
|
+
return labels;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
2813
3174
|
// src/field-messages.ts
|
|
2814
3175
|
var TYPES_JA = {
|
|
2815
3176
|
string: "\u6587\u5B57\u5217\u306B\u3059\u308B",
|
|
@@ -2883,7 +3244,7 @@ function ucs2length(str) {
|
|
|
2883
3244
|
return length;
|
|
2884
3245
|
}
|
|
2885
3246
|
var validate_diagram_default = validate10;
|
|
2886
|
-
var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
|
|
3247
|
+
var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time", "tree"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
|
|
2887
3248
|
function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2888
3249
|
let vErrors = null;
|
|
2889
3250
|
let errors = 0;
|
|
@@ -2943,34 +3304,79 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2943
3304
|
}
|
|
2944
3305
|
}
|
|
2945
3306
|
}
|
|
3307
|
+
const _errs8 = errors;
|
|
3308
|
+
const _errs9 = errors;
|
|
3309
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3310
|
+
if (data2.type === void 0 && ("type")) {
|
|
3311
|
+
const err3 = {};
|
|
3312
|
+
if (vErrors === null) {
|
|
3313
|
+
vErrors = [err3];
|
|
3314
|
+
} else {
|
|
3315
|
+
vErrors.push(err3);
|
|
3316
|
+
}
|
|
3317
|
+
errors++;
|
|
3318
|
+
} else {
|
|
3319
|
+
if (data2.type !== void 0) {
|
|
3320
|
+
let data4 = data2.type;
|
|
3321
|
+
if (!(data4 === "leaf" || data4 === "node")) {
|
|
3322
|
+
const err4 = {};
|
|
3323
|
+
if (vErrors === null) {
|
|
3324
|
+
vErrors = [err4];
|
|
3325
|
+
} else {
|
|
3326
|
+
vErrors.push(err4);
|
|
3327
|
+
}
|
|
3328
|
+
errors++;
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
var valid9 = _errs9 === errors;
|
|
3334
|
+
if (valid9) {
|
|
3335
|
+
const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3336
|
+
if (vErrors === null) {
|
|
3337
|
+
vErrors = [err5];
|
|
3338
|
+
} else {
|
|
3339
|
+
vErrors.push(err5);
|
|
3340
|
+
}
|
|
3341
|
+
errors++;
|
|
3342
|
+
} else {
|
|
3343
|
+
errors = _errs8;
|
|
3344
|
+
if (vErrors !== null) {
|
|
3345
|
+
if (_errs8) {
|
|
3346
|
+
vErrors.length = _errs8;
|
|
3347
|
+
} else {
|
|
3348
|
+
vErrors = null;
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
2946
3352
|
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
2947
3353
|
if (data2.type !== void 0) {
|
|
2948
|
-
let
|
|
2949
|
-
const
|
|
2950
|
-
const
|
|
2951
|
-
if (!(
|
|
2952
|
-
const
|
|
3354
|
+
let data5 = data2.type;
|
|
3355
|
+
const _errs13 = errors;
|
|
3356
|
+
const _errs14 = errors;
|
|
3357
|
+
if (!(data5 === "commit" || data5 === "branch")) {
|
|
3358
|
+
const err6 = {};
|
|
2953
3359
|
if (vErrors === null) {
|
|
2954
|
-
vErrors = [
|
|
3360
|
+
vErrors = [err6];
|
|
2955
3361
|
} else {
|
|
2956
|
-
vErrors.push(
|
|
3362
|
+
vErrors.push(err6);
|
|
2957
3363
|
}
|
|
2958
3364
|
errors++;
|
|
2959
3365
|
}
|
|
2960
|
-
var
|
|
2961
|
-
if (
|
|
2962
|
-
const
|
|
3366
|
+
var valid13 = _errs14 === errors;
|
|
3367
|
+
if (valid13) {
|
|
3368
|
+
const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
2963
3369
|
if (vErrors === null) {
|
|
2964
|
-
vErrors = [
|
|
3370
|
+
vErrors = [err7];
|
|
2965
3371
|
} else {
|
|
2966
|
-
vErrors.push(
|
|
3372
|
+
vErrors.push(err7);
|
|
2967
3373
|
}
|
|
2968
3374
|
errors++;
|
|
2969
3375
|
} else {
|
|
2970
|
-
errors =
|
|
3376
|
+
errors = _errs13;
|
|
2971
3377
|
if (vErrors !== null) {
|
|
2972
|
-
if (
|
|
2973
|
-
vErrors.length =
|
|
3378
|
+
if (_errs13) {
|
|
3379
|
+
vErrors.length = _errs13;
|
|
2974
3380
|
} else {
|
|
2975
3381
|
vErrors = null;
|
|
2976
3382
|
}
|
|
@@ -2978,29 +3384,29 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2978
3384
|
}
|
|
2979
3385
|
}
|
|
2980
3386
|
if (data2.at !== void 0) {
|
|
2981
|
-
const
|
|
3387
|
+
const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
2982
3388
|
if (vErrors === null) {
|
|
2983
|
-
vErrors = [
|
|
3389
|
+
vErrors = [err8];
|
|
2984
3390
|
} else {
|
|
2985
|
-
vErrors.push(
|
|
3391
|
+
vErrors.push(err8);
|
|
2986
3392
|
}
|
|
2987
3393
|
errors++;
|
|
2988
3394
|
}
|
|
2989
3395
|
if (data2.into !== void 0) {
|
|
2990
|
-
const
|
|
3396
|
+
const err9 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
2991
3397
|
if (vErrors === null) {
|
|
2992
|
-
vErrors = [
|
|
3398
|
+
vErrors = [err9];
|
|
2993
3399
|
} else {
|
|
2994
|
-
vErrors.push(
|
|
3400
|
+
vErrors.push(err9);
|
|
2995
3401
|
}
|
|
2996
3402
|
errors++;
|
|
2997
3403
|
}
|
|
2998
3404
|
if (data2.color !== void 0) {
|
|
2999
|
-
const
|
|
3405
|
+
const err10 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3000
3406
|
if (vErrors === null) {
|
|
3001
|
-
vErrors = [
|
|
3407
|
+
vErrors = [err10];
|
|
3002
3408
|
} else {
|
|
3003
|
-
vErrors.push(
|
|
3409
|
+
vErrors.push(err10);
|
|
3004
3410
|
}
|
|
3005
3411
|
errors++;
|
|
3006
3412
|
}
|
|
@@ -3090,31 +3496,76 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3090
3496
|
}
|
|
3091
3497
|
}
|
|
3092
3498
|
}
|
|
3499
|
+
const _errs8 = errors;
|
|
3500
|
+
const _errs9 = errors;
|
|
3093
3501
|
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3094
|
-
if (data2.
|
|
3095
|
-
const err3 = {
|
|
3502
|
+
if (data2.type === void 0 && ("type")) {
|
|
3503
|
+
const err3 = {};
|
|
3096
3504
|
if (vErrors === null) {
|
|
3097
3505
|
vErrors = [err3];
|
|
3098
3506
|
} else {
|
|
3099
3507
|
vErrors.push(err3);
|
|
3100
3508
|
}
|
|
3101
3509
|
errors++;
|
|
3510
|
+
} else {
|
|
3511
|
+
if (data2.type !== void 0) {
|
|
3512
|
+
let data4 = data2.type;
|
|
3513
|
+
if (!(data4 === "leaf" || data4 === "node")) {
|
|
3514
|
+
const err4 = {};
|
|
3515
|
+
if (vErrors === null) {
|
|
3516
|
+
vErrors = [err4];
|
|
3517
|
+
} else {
|
|
3518
|
+
vErrors.push(err4);
|
|
3519
|
+
}
|
|
3520
|
+
errors++;
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
var valid9 = _errs9 === errors;
|
|
3526
|
+
if (valid9) {
|
|
3527
|
+
const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3528
|
+
if (vErrors === null) {
|
|
3529
|
+
vErrors = [err5];
|
|
3530
|
+
} else {
|
|
3531
|
+
vErrors.push(err5);
|
|
3532
|
+
}
|
|
3533
|
+
errors++;
|
|
3534
|
+
} else {
|
|
3535
|
+
errors = _errs8;
|
|
3536
|
+
if (vErrors !== null) {
|
|
3537
|
+
if (_errs8) {
|
|
3538
|
+
vErrors.length = _errs8;
|
|
3539
|
+
} else {
|
|
3540
|
+
vErrors = null;
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3545
|
+
if (data2.at !== void 0) {
|
|
3546
|
+
const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3547
|
+
if (vErrors === null) {
|
|
3548
|
+
vErrors = [err6];
|
|
3549
|
+
} else {
|
|
3550
|
+
vErrors.push(err6);
|
|
3551
|
+
}
|
|
3552
|
+
errors++;
|
|
3102
3553
|
}
|
|
3103
3554
|
if (data2.into !== void 0) {
|
|
3104
|
-
const
|
|
3555
|
+
const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3105
3556
|
if (vErrors === null) {
|
|
3106
|
-
vErrors = [
|
|
3557
|
+
vErrors = [err7];
|
|
3107
3558
|
} else {
|
|
3108
|
-
vErrors.push(
|
|
3559
|
+
vErrors.push(err7);
|
|
3109
3560
|
}
|
|
3110
3561
|
errors++;
|
|
3111
3562
|
}
|
|
3112
3563
|
if (data2.color !== void 0) {
|
|
3113
|
-
const
|
|
3564
|
+
const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3114
3565
|
if (vErrors === null) {
|
|
3115
|
-
vErrors = [
|
|
3566
|
+
vErrors = [err8];
|
|
3116
3567
|
} else {
|
|
3117
|
-
vErrors.push(
|
|
3568
|
+
vErrors.push(err8);
|
|
3118
3569
|
}
|
|
3119
3570
|
errors++;
|
|
3120
3571
|
}
|
|
@@ -3128,63 +3579,296 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3128
3579
|
validate17.errors = vErrors;
|
|
3129
3580
|
return errors === 0;
|
|
3130
3581
|
}
|
|
3131
|
-
|
|
3132
|
-
var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
|
|
3133
|
-
var func3 = ucs2length;
|
|
3134
|
-
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3582
|
+
function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3135
3583
|
let vErrors = null;
|
|
3136
3584
|
let errors = 0;
|
|
3137
|
-
if (
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3585
|
+
if (Array.isArray(data)) {
|
|
3586
|
+
const len0 = data.length;
|
|
3587
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
3588
|
+
let data0 = data[i0];
|
|
3589
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
|
3590
|
+
if (data0.events !== void 0) {
|
|
3591
|
+
let data1 = data0.events;
|
|
3592
|
+
if (Array.isArray(data1)) {
|
|
3593
|
+
const len1 = data1.length;
|
|
3594
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
3595
|
+
let data2 = data1[i1];
|
|
3596
|
+
const _errs4 = errors;
|
|
3597
|
+
const _errs5 = errors;
|
|
3598
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3599
|
+
if (data2.type === void 0 && ("type")) {
|
|
3600
|
+
const err0 = {};
|
|
3601
|
+
if (vErrors === null) {
|
|
3602
|
+
vErrors = [err0];
|
|
3603
|
+
} else {
|
|
3604
|
+
vErrors.push(err0);
|
|
3605
|
+
}
|
|
3606
|
+
errors++;
|
|
3607
|
+
} else {
|
|
3608
|
+
if (data2.type !== void 0) {
|
|
3609
|
+
let data3 = data2.type;
|
|
3610
|
+
if (!(data3 === "leaf" || data3 === "node")) {
|
|
3611
|
+
const err1 = {};
|
|
3612
|
+
if (vErrors === null) {
|
|
3613
|
+
vErrors = [err1];
|
|
3614
|
+
} else {
|
|
3615
|
+
vErrors.push(err1);
|
|
3616
|
+
}
|
|
3617
|
+
errors++;
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
}
|
|
3622
|
+
var valid6 = _errs5 === errors;
|
|
3623
|
+
if (valid6) {
|
|
3624
|
+
const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3625
|
+
if (vErrors === null) {
|
|
3626
|
+
vErrors = [err2];
|
|
3627
|
+
} else {
|
|
3628
|
+
vErrors.push(err2);
|
|
3629
|
+
}
|
|
3630
|
+
errors++;
|
|
3631
|
+
} else {
|
|
3632
|
+
errors = _errs4;
|
|
3633
|
+
if (vErrors !== null) {
|
|
3634
|
+
if (_errs4) {
|
|
3635
|
+
vErrors.length = _errs4;
|
|
3636
|
+
} else {
|
|
3637
|
+
vErrors = null;
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3642
|
+
if (data2.type !== void 0) {
|
|
3643
|
+
let data4 = data2.type;
|
|
3644
|
+
const _errs9 = errors;
|
|
3645
|
+
const _errs10 = errors;
|
|
3646
|
+
if (!(data4 === "commit" || data4 === "branch")) {
|
|
3647
|
+
const err3 = {};
|
|
3648
|
+
if (vErrors === null) {
|
|
3649
|
+
vErrors = [err3];
|
|
3650
|
+
} else {
|
|
3651
|
+
vErrors.push(err3);
|
|
3652
|
+
}
|
|
3653
|
+
errors++;
|
|
3654
|
+
}
|
|
3655
|
+
var valid10 = _errs10 === errors;
|
|
3656
|
+
if (valid10) {
|
|
3657
|
+
const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3658
|
+
if (vErrors === null) {
|
|
3659
|
+
vErrors = [err4];
|
|
3660
|
+
} else {
|
|
3661
|
+
vErrors.push(err4);
|
|
3662
|
+
}
|
|
3663
|
+
errors++;
|
|
3664
|
+
} else {
|
|
3665
|
+
errors = _errs9;
|
|
3666
|
+
if (vErrors !== null) {
|
|
3667
|
+
if (_errs9) {
|
|
3668
|
+
vErrors.length = _errs9;
|
|
3669
|
+
} else {
|
|
3670
|
+
vErrors = null;
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
validate20.errors = vErrors;
|
|
3683
|
+
return errors === 0;
|
|
3684
|
+
}
|
|
3685
|
+
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3686
|
+
let vErrors = null;
|
|
3687
|
+
let errors = 0;
|
|
3688
|
+
if (Array.isArray(data)) {
|
|
3689
|
+
const len0 = data.length;
|
|
3690
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
3691
|
+
let data0 = data[i0];
|
|
3692
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
|
3693
|
+
if (data0.events !== void 0) {
|
|
3694
|
+
let data1 = data0.events;
|
|
3695
|
+
if (Array.isArray(data1)) {
|
|
3696
|
+
const len1 = data1.length;
|
|
3697
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
3698
|
+
let data2 = data1[i1];
|
|
3699
|
+
const _errs3 = errors;
|
|
3700
|
+
const _errs4 = errors;
|
|
3701
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3702
|
+
if (data2.type === void 0 && ("type")) {
|
|
3703
|
+
const err0 = {};
|
|
3704
|
+
if (vErrors === null) {
|
|
3705
|
+
vErrors = [err0];
|
|
3706
|
+
} else {
|
|
3707
|
+
vErrors.push(err0);
|
|
3708
|
+
}
|
|
3709
|
+
errors++;
|
|
3710
|
+
} else {
|
|
3711
|
+
if (data2.type !== void 0) {
|
|
3712
|
+
let data3 = data2.type;
|
|
3713
|
+
if (!(data3 === "now" || data3 === "mark" || data3 === "span")) {
|
|
3714
|
+
const err1 = {};
|
|
3715
|
+
if (vErrors === null) {
|
|
3716
|
+
vErrors = [err1];
|
|
3717
|
+
} else {
|
|
3718
|
+
vErrors.push(err1);
|
|
3719
|
+
}
|
|
3720
|
+
errors++;
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
}
|
|
3724
|
+
}
|
|
3725
|
+
var valid5 = _errs4 === errors;
|
|
3726
|
+
if (valid5) {
|
|
3727
|
+
const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3728
|
+
if (vErrors === null) {
|
|
3729
|
+
vErrors = [err2];
|
|
3730
|
+
} else {
|
|
3731
|
+
vErrors.push(err2);
|
|
3732
|
+
}
|
|
3733
|
+
errors++;
|
|
3734
|
+
} else {
|
|
3735
|
+
errors = _errs3;
|
|
3736
|
+
if (vErrors !== null) {
|
|
3737
|
+
if (_errs3) {
|
|
3738
|
+
vErrors.length = _errs3;
|
|
3739
|
+
} else {
|
|
3740
|
+
vErrors = null;
|
|
3741
|
+
}
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
3745
|
+
if (data2.type !== void 0) {
|
|
3746
|
+
let data4 = data2.type;
|
|
3747
|
+
const _errs8 = errors;
|
|
3748
|
+
const _errs9 = errors;
|
|
3749
|
+
if (!(data4 === "commit" || data4 === "branch")) {
|
|
3750
|
+
const err3 = {};
|
|
3751
|
+
if (vErrors === null) {
|
|
3752
|
+
vErrors = [err3];
|
|
3753
|
+
} else {
|
|
3754
|
+
vErrors.push(err3);
|
|
3755
|
+
}
|
|
3756
|
+
errors++;
|
|
3757
|
+
}
|
|
3758
|
+
var valid9 = _errs9 === errors;
|
|
3759
|
+
if (valid9) {
|
|
3760
|
+
const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3761
|
+
if (vErrors === null) {
|
|
3762
|
+
vErrors = [err4];
|
|
3763
|
+
} else {
|
|
3764
|
+
vErrors.push(err4);
|
|
3765
|
+
}
|
|
3766
|
+
errors++;
|
|
3767
|
+
} else {
|
|
3768
|
+
errors = _errs8;
|
|
3769
|
+
if (vErrors !== null) {
|
|
3770
|
+
if (_errs8) {
|
|
3771
|
+
vErrors.length = _errs8;
|
|
3772
|
+
} else {
|
|
3773
|
+
vErrors = null;
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
if (data2.at !== void 0) {
|
|
3779
|
+
const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3780
|
+
if (vErrors === null) {
|
|
3781
|
+
vErrors = [err5];
|
|
3782
|
+
} else {
|
|
3783
|
+
vErrors.push(err5);
|
|
3784
|
+
}
|
|
3785
|
+
errors++;
|
|
3786
|
+
}
|
|
3787
|
+
if (data2.into !== void 0) {
|
|
3788
|
+
const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3789
|
+
if (vErrors === null) {
|
|
3790
|
+
vErrors = [err6];
|
|
3791
|
+
} else {
|
|
3792
|
+
vErrors.push(err6);
|
|
3793
|
+
}
|
|
3794
|
+
errors++;
|
|
3795
|
+
}
|
|
3796
|
+
if (data2.color !== void 0) {
|
|
3797
|
+
const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
3798
|
+
if (vErrors === null) {
|
|
3799
|
+
vErrors = [err7];
|
|
3800
|
+
} else {
|
|
3801
|
+
vErrors.push(err7);
|
|
3802
|
+
}
|
|
3803
|
+
errors++;
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
validate22.errors = vErrors;
|
|
3813
|
+
return errors === 0;
|
|
3814
|
+
}
|
|
3815
|
+
var schema57 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
|
|
3816
|
+
var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
|
|
3817
|
+
var func3 = ucs2length;
|
|
3818
|
+
function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3819
|
+
let vErrors = null;
|
|
3820
|
+
let errors = 0;
|
|
3821
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
3822
|
+
if (data.id === void 0) {
|
|
3823
|
+
const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
3824
|
+
if (vErrors === null) {
|
|
3825
|
+
vErrors = [err0];
|
|
3826
|
+
} else {
|
|
3827
|
+
vErrors.push(err0);
|
|
3828
|
+
}
|
|
3829
|
+
errors++;
|
|
3830
|
+
}
|
|
3831
|
+
if (data.name === void 0) {
|
|
3832
|
+
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
|
|
3833
|
+
if (vErrors === null) {
|
|
3834
|
+
vErrors = [err1];
|
|
3835
|
+
} else {
|
|
3836
|
+
vErrors.push(err1);
|
|
3837
|
+
}
|
|
3838
|
+
errors++;
|
|
3839
|
+
}
|
|
3840
|
+
for (const key0 in data) {
|
|
3841
|
+
if (!(key0 === "id" || key0 === "name" || key0 === "note" || key0 === "color" || key0 === "icon")) {
|
|
3842
|
+
const err2 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
3843
|
+
if (vErrors === null) {
|
|
3844
|
+
vErrors = [err2];
|
|
3845
|
+
} else {
|
|
3846
|
+
vErrors.push(err2);
|
|
3847
|
+
}
|
|
3848
|
+
errors++;
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
if (data.id !== void 0) {
|
|
3852
|
+
let data0 = data.id;
|
|
3853
|
+
if (typeof data0 === "string") {
|
|
3854
|
+
if (!pattern0.test(data0)) {
|
|
3855
|
+
const err3 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
3856
|
+
if (vErrors === null) {
|
|
3857
|
+
vErrors = [err3];
|
|
3858
|
+
} else {
|
|
3859
|
+
vErrors.push(err3);
|
|
3860
|
+
}
|
|
3861
|
+
errors++;
|
|
3862
|
+
}
|
|
3863
|
+
} else {
|
|
3864
|
+
const err4 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
3865
|
+
if (vErrors === null) {
|
|
3866
|
+
vErrors = [err4];
|
|
3867
|
+
} else {
|
|
3868
|
+
vErrors.push(err4);
|
|
3869
|
+
}
|
|
3870
|
+
errors++;
|
|
3871
|
+
}
|
|
3188
3872
|
}
|
|
3189
3873
|
if (data.name !== void 0) {
|
|
3190
3874
|
let data1 = data.name;
|
|
@@ -3233,7 +3917,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3233
3917
|
if (data.color !== void 0) {
|
|
3234
3918
|
let data3 = data.color;
|
|
3235
3919
|
if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
|
|
3236
|
-
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
3920
|
+
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
3237
3921
|
if (vErrors === null) {
|
|
3238
3922
|
vErrors = [err9];
|
|
3239
3923
|
} else {
|
|
@@ -3273,11 +3957,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3273
3957
|
}
|
|
3274
3958
|
errors++;
|
|
3275
3959
|
}
|
|
3276
|
-
|
|
3960
|
+
validate27.errors = vErrors;
|
|
3277
3961
|
return errors === 0;
|
|
3278
3962
|
}
|
|
3279
3963
|
var pattern3 = new RegExp("^(/|https?://)", "u");
|
|
3280
|
-
function
|
|
3964
|
+
function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3281
3965
|
let vErrors = null;
|
|
3282
3966
|
let errors = 0;
|
|
3283
3967
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3379,7 +4063,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3379
4063
|
if (data.color !== void 0) {
|
|
3380
4064
|
let data3 = data.color;
|
|
3381
4065
|
if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
|
|
3382
|
-
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
4066
|
+
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
3383
4067
|
if (vErrors === null) {
|
|
3384
4068
|
vErrors = [err9];
|
|
3385
4069
|
} else {
|
|
@@ -3463,11 +4147,11 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3463
4147
|
}
|
|
3464
4148
|
errors++;
|
|
3465
4149
|
}
|
|
3466
|
-
|
|
4150
|
+
validate29.errors = vErrors;
|
|
3467
4151
|
return errors === 0;
|
|
3468
4152
|
}
|
|
3469
4153
|
var pattern4 = new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$", "u");
|
|
3470
|
-
function
|
|
4154
|
+
function validate32(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3471
4155
|
let vErrors = null;
|
|
3472
4156
|
let errors = 0;
|
|
3473
4157
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3553,10 +4237,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3553
4237
|
}
|
|
3554
4238
|
errors++;
|
|
3555
4239
|
}
|
|
3556
|
-
|
|
4240
|
+
validate32.errors = vErrors;
|
|
3557
4241
|
return errors === 0;
|
|
3558
4242
|
}
|
|
3559
|
-
function
|
|
4243
|
+
function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3560
4244
|
let vErrors = null;
|
|
3561
4245
|
let errors = 0;
|
|
3562
4246
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3670,8 +4354,8 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3670
4354
|
}
|
|
3671
4355
|
const len1 = data3.length;
|
|
3672
4356
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
3673
|
-
if (!
|
|
3674
|
-
vErrors = vErrors === null ?
|
|
4357
|
+
if (!validate32(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
|
|
4358
|
+
vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
|
|
3675
4359
|
errors = vErrors.length;
|
|
3676
4360
|
}
|
|
3677
4361
|
}
|
|
@@ -3694,10 +4378,10 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3694
4378
|
}
|
|
3695
4379
|
errors++;
|
|
3696
4380
|
}
|
|
3697
|
-
|
|
4381
|
+
validate31.errors = vErrors;
|
|
3698
4382
|
return errors === 0;
|
|
3699
4383
|
}
|
|
3700
|
-
function
|
|
4384
|
+
function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3701
4385
|
let vErrors = null;
|
|
3702
4386
|
let errors = 0;
|
|
3703
4387
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3783,13 +4467,13 @@ function validate31(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3783
4467
|
}
|
|
3784
4468
|
errors++;
|
|
3785
4469
|
}
|
|
3786
|
-
|
|
4470
|
+
validate36.errors = vErrors;
|
|
3787
4471
|
return errors === 0;
|
|
3788
4472
|
}
|
|
3789
|
-
var
|
|
4473
|
+
var schema80 = { "oneOf": [{ "description": "\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "carry"], "properties": { "type": { "const": "edge" }, "from": { "$ref": "#/definitions/id" }, "to": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" }, "carry": { "$ref": "#/definitions/carry" }, "labelSide": { "description": "\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)", "enum": ["above", "below", "left", "right"] }, "at": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A", "$ref": "#/definitions/unit" }, "into": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217", "$ref": "#/definitions/unit" } } }, { "description": "\u7BB1\u306E\u4E2D\u306E\u51E6\u7406", "type": "object", "additionalProperties": false, "required": ["type", "box", "label"], "properties": { "type": { "const": "action" }, "box": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" } } }, { "description": "\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048", "type": "object", "additionalProperties": false, "required": ["type", "box", "text"], "properties": { "type": { "const": "swap" }, "box": { "$ref": "#/definitions/id" }, "text": { "$ref": "#/definitions/text" }, "color": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272", "$ref": "#/definitions/color" } } }, { "description": "commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064", "type": "object", "additionalProperties": false, "required": ["type", "id", "branch"], "properties": { "type": { "const": "commit" }, "id": { "$ref": "#/definitions/id" }, "branch": { "$ref": "#/definitions/id" }, "copy": { "$ref": "#/definitions/id" }, "merge": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" }, "note": { "$ref": "#/definitions/text" } } }, { "description": "\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059", "type": "object", "additionalProperties": false, "required": ["type", "branch", "from"], "properties": { "type": { "const": "branch" }, "branch": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/id" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B", "type": "object", "additionalProperties": false, "required": ["type", "to"], "properties": { "type": { "const": "now" }, "to": { "$ref": "#/definitions/unit" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B", "type": "object", "additionalProperties": false, "required": ["type", "row", "from", "to", "color"], "properties": { "type": { "const": "mark" }, "row": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "text"], "properties": { "type": { "const": "span" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "text": { "$ref": "#/definitions/text" }, "shape": { "enum": ["box"] }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059", "type": "object", "additionalProperties": false, "required": ["type", "id"], "properties": { "type": { "const": "leaf" }, "id": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B", "type": "object", "additionalProperties": false, "required": ["type", "id", "children"], "properties": { "type": { "const": "node" }, "id": { "$ref": "#/definitions/id" }, "children": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/id" } }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D", "type": "object", "additionalProperties": false, "required": ["type", "field"], "anyOf": [{ "required": ["value"] }, { "required": ["tag"] }], "properties": { "type": { "const": "strip" }, "field": { "$ref": "#/definitions/text" }, "value": { "$ref": "#/definitions/text" }, "tag": { "$ref": "#/definitions/text" } } }] };
|
|
3790
4474
|
var pattern14 = new RegExp("^[0-9a-f]{4,40}$", "u");
|
|
3791
|
-
var
|
|
3792
|
-
function
|
|
4475
|
+
var schema84 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
|
|
4476
|
+
function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3793
4477
|
let vErrors = null;
|
|
3794
4478
|
let errors = 0;
|
|
3795
4479
|
const _errs1 = errors;
|
|
@@ -3915,7 +4599,7 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3915
4599
|
if (data.kind !== void 0) {
|
|
3916
4600
|
let data1 = data.kind;
|
|
3917
4601
|
if (!(data1 === "envelope" || data1 === "tag" || data1 === "coin" || data1 === "none")) {
|
|
3918
|
-
const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues:
|
|
4602
|
+
const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema84.properties.kind.enum }, message: "must be equal to one of the allowed values" };
|
|
3919
4603
|
if (vErrors === null) {
|
|
3920
4604
|
vErrors = [err8];
|
|
3921
4605
|
} else {
|
|
@@ -3955,10 +4639,10 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3955
4639
|
}
|
|
3956
4640
|
errors++;
|
|
3957
4641
|
}
|
|
3958
|
-
|
|
4642
|
+
validate39.errors = vErrors;
|
|
3959
4643
|
return errors === 0;
|
|
3960
4644
|
}
|
|
3961
|
-
function
|
|
4645
|
+
function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3962
4646
|
let vErrors = null;
|
|
3963
4647
|
let errors = 0;
|
|
3964
4648
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -4100,15 +4784,15 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4100
4784
|
}
|
|
4101
4785
|
}
|
|
4102
4786
|
if (data.carry !== void 0) {
|
|
4103
|
-
if (!
|
|
4104
|
-
vErrors = vErrors === null ?
|
|
4787
|
+
if (!validate39(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
|
|
4788
|
+
vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);
|
|
4105
4789
|
errors = vErrors.length;
|
|
4106
4790
|
}
|
|
4107
4791
|
}
|
|
4108
4792
|
if (data.labelSide !== void 0) {
|
|
4109
4793
|
let data5 = data.labelSide;
|
|
4110
4794
|
if (!(data5 === "above" || data5 === "below" || data5 === "left" || data5 === "right")) {
|
|
4111
|
-
const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues:
|
|
4795
|
+
const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[0].properties.labelSide.enum }, message: "must be equal to one of the allowed values" };
|
|
4112
4796
|
if (vErrors === null) {
|
|
4113
4797
|
vErrors = [err13];
|
|
4114
4798
|
} else {
|
|
@@ -4374,7 +5058,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4374
5058
|
if (data.color !== void 0) {
|
|
4375
5059
|
let data14 = data.color;
|
|
4376
5060
|
if (!(data14 === "blue" || data14 === "amber" || data14 === "green" || data14 === "violet" || data14 === "rose" || data14 === "slate" || data14 === "coin")) {
|
|
4377
|
-
const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
5061
|
+
const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
4378
5062
|
if (vErrors === null) {
|
|
4379
5063
|
vErrors = [err38];
|
|
4380
5064
|
} else {
|
|
@@ -4902,7 +5586,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4902
5586
|
if (data.color !== void 0) {
|
|
4903
5587
|
let data31 = data.color;
|
|
4904
5588
|
if (!(data31 === "blue" || data31 === "amber" || data31 === "green" || data31 === "violet" || data31 === "rose" || data31 === "slate" || data31 === "coin")) {
|
|
4905
|
-
const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
5589
|
+
const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
4906
5590
|
if (vErrors === null) {
|
|
4907
5591
|
vErrors = [err88];
|
|
4908
5592
|
} else {
|
|
@@ -5034,98 +5718,342 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5034
5718
|
if (vErrors === null) {
|
|
5035
5719
|
vErrors = [err100];
|
|
5036
5720
|
} else {
|
|
5037
|
-
vErrors.push(err100);
|
|
5721
|
+
vErrors.push(err100);
|
|
5722
|
+
}
|
|
5723
|
+
errors++;
|
|
5724
|
+
}
|
|
5725
|
+
} else {
|
|
5726
|
+
const err101 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5727
|
+
if (vErrors === null) {
|
|
5728
|
+
vErrors = [err101];
|
|
5729
|
+
} else {
|
|
5730
|
+
vErrors.push(err101);
|
|
5731
|
+
}
|
|
5732
|
+
errors++;
|
|
5733
|
+
}
|
|
5734
|
+
}
|
|
5735
|
+
if (data.shape !== void 0) {
|
|
5736
|
+
if (!(data.shape === "box")) {
|
|
5737
|
+
const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[7].properties.shape.enum }, message: "must be equal to one of the allowed values" };
|
|
5738
|
+
if (vErrors === null) {
|
|
5739
|
+
vErrors = [err102];
|
|
5740
|
+
} else {
|
|
5741
|
+
vErrors.push(err102);
|
|
5742
|
+
}
|
|
5743
|
+
errors++;
|
|
5744
|
+
}
|
|
5745
|
+
}
|
|
5746
|
+
if (data.color !== void 0) {
|
|
5747
|
+
let data37 = data.color;
|
|
5748
|
+
if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
|
|
5749
|
+
const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
5750
|
+
if (vErrors === null) {
|
|
5751
|
+
vErrors = [err103];
|
|
5752
|
+
} else {
|
|
5753
|
+
vErrors.push(err103);
|
|
5754
|
+
}
|
|
5755
|
+
errors++;
|
|
5756
|
+
}
|
|
5757
|
+
}
|
|
5758
|
+
} else {
|
|
5759
|
+
const err104 = { instancePath, schemaPath: "#/oneOf/7/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5760
|
+
if (vErrors === null) {
|
|
5761
|
+
vErrors = [err104];
|
|
5762
|
+
} else {
|
|
5763
|
+
vErrors.push(err104);
|
|
5764
|
+
}
|
|
5765
|
+
errors++;
|
|
5766
|
+
}
|
|
5767
|
+
} else if (tag0 === "leaf") {
|
|
5768
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5769
|
+
if (data.type === void 0) {
|
|
5770
|
+
const err105 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
5771
|
+
if (vErrors === null) {
|
|
5772
|
+
vErrors = [err105];
|
|
5773
|
+
} else {
|
|
5774
|
+
vErrors.push(err105);
|
|
5775
|
+
}
|
|
5776
|
+
errors++;
|
|
5777
|
+
}
|
|
5778
|
+
if (data.id === void 0) {
|
|
5779
|
+
const err106 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
5780
|
+
if (vErrors === null) {
|
|
5781
|
+
vErrors = [err106];
|
|
5782
|
+
} else {
|
|
5783
|
+
vErrors.push(err106);
|
|
5784
|
+
}
|
|
5785
|
+
errors++;
|
|
5786
|
+
}
|
|
5787
|
+
for (const key8 in data) {
|
|
5788
|
+
if (!(key8 === "type" || key8 === "id" || key8 === "hash")) {
|
|
5789
|
+
const err107 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
|
|
5790
|
+
if (vErrors === null) {
|
|
5791
|
+
vErrors = [err107];
|
|
5792
|
+
} else {
|
|
5793
|
+
vErrors.push(err107);
|
|
5794
|
+
}
|
|
5795
|
+
errors++;
|
|
5796
|
+
}
|
|
5797
|
+
}
|
|
5798
|
+
if (data.type !== void 0) {
|
|
5799
|
+
if ("leaf" !== data.type) {
|
|
5800
|
+
const err108 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "leaf" }, message: "must be equal to constant" };
|
|
5801
|
+
if (vErrors === null) {
|
|
5802
|
+
vErrors = [err108];
|
|
5803
|
+
} else {
|
|
5804
|
+
vErrors.push(err108);
|
|
5805
|
+
}
|
|
5806
|
+
errors++;
|
|
5807
|
+
}
|
|
5808
|
+
}
|
|
5809
|
+
if (data.id !== void 0) {
|
|
5810
|
+
let data39 = data.id;
|
|
5811
|
+
if (typeof data39 === "string") {
|
|
5812
|
+
if (!pattern0.test(data39)) {
|
|
5813
|
+
const err109 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
5814
|
+
if (vErrors === null) {
|
|
5815
|
+
vErrors = [err109];
|
|
5816
|
+
} else {
|
|
5817
|
+
vErrors.push(err109);
|
|
5818
|
+
}
|
|
5819
|
+
errors++;
|
|
5820
|
+
}
|
|
5821
|
+
} else {
|
|
5822
|
+
const err110 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5823
|
+
if (vErrors === null) {
|
|
5824
|
+
vErrors = [err110];
|
|
5825
|
+
} else {
|
|
5826
|
+
vErrors.push(err110);
|
|
5827
|
+
}
|
|
5828
|
+
errors++;
|
|
5829
|
+
}
|
|
5830
|
+
}
|
|
5831
|
+
if (data.hash !== void 0) {
|
|
5832
|
+
let data40 = data.hash;
|
|
5833
|
+
if (typeof data40 === "string") {
|
|
5834
|
+
if (!pattern14.test(data40)) {
|
|
5835
|
+
const err111 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
|
|
5836
|
+
if (vErrors === null) {
|
|
5837
|
+
vErrors = [err111];
|
|
5838
|
+
} else {
|
|
5839
|
+
vErrors.push(err111);
|
|
5840
|
+
}
|
|
5841
|
+
errors++;
|
|
5842
|
+
}
|
|
5843
|
+
} else {
|
|
5844
|
+
const err112 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5845
|
+
if (vErrors === null) {
|
|
5846
|
+
vErrors = [err112];
|
|
5847
|
+
} else {
|
|
5848
|
+
vErrors.push(err112);
|
|
5849
|
+
}
|
|
5850
|
+
errors++;
|
|
5851
|
+
}
|
|
5852
|
+
}
|
|
5853
|
+
} else {
|
|
5854
|
+
const err113 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5855
|
+
if (vErrors === null) {
|
|
5856
|
+
vErrors = [err113];
|
|
5857
|
+
} else {
|
|
5858
|
+
vErrors.push(err113);
|
|
5859
|
+
}
|
|
5860
|
+
errors++;
|
|
5861
|
+
}
|
|
5862
|
+
} else if (tag0 === "node") {
|
|
5863
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5864
|
+
if (data.type === void 0) {
|
|
5865
|
+
const err114 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
5866
|
+
if (vErrors === null) {
|
|
5867
|
+
vErrors = [err114];
|
|
5868
|
+
} else {
|
|
5869
|
+
vErrors.push(err114);
|
|
5870
|
+
}
|
|
5871
|
+
errors++;
|
|
5872
|
+
}
|
|
5873
|
+
if (data.id === void 0) {
|
|
5874
|
+
const err115 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
5875
|
+
if (vErrors === null) {
|
|
5876
|
+
vErrors = [err115];
|
|
5877
|
+
} else {
|
|
5878
|
+
vErrors.push(err115);
|
|
5879
|
+
}
|
|
5880
|
+
errors++;
|
|
5881
|
+
}
|
|
5882
|
+
if (data.children === void 0) {
|
|
5883
|
+
const err116 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "children" }, message: "must have required property 'children'" };
|
|
5884
|
+
if (vErrors === null) {
|
|
5885
|
+
vErrors = [err116];
|
|
5886
|
+
} else {
|
|
5887
|
+
vErrors.push(err116);
|
|
5888
|
+
}
|
|
5889
|
+
errors++;
|
|
5890
|
+
}
|
|
5891
|
+
for (const key9 in data) {
|
|
5892
|
+
if (!(key9 === "type" || key9 === "id" || key9 === "children" || key9 === "hash")) {
|
|
5893
|
+
const err117 = { instancePath, schemaPath: "#/oneOf/9/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key9 }, message: "must NOT have additional properties" };
|
|
5894
|
+
if (vErrors === null) {
|
|
5895
|
+
vErrors = [err117];
|
|
5896
|
+
} else {
|
|
5897
|
+
vErrors.push(err117);
|
|
5898
|
+
}
|
|
5899
|
+
errors++;
|
|
5900
|
+
}
|
|
5901
|
+
}
|
|
5902
|
+
if (data.type !== void 0) {
|
|
5903
|
+
if ("node" !== data.type) {
|
|
5904
|
+
const err118 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/9/properties/type/const", keyword: "const", params: { allowedValue: "node" }, message: "must be equal to constant" };
|
|
5905
|
+
if (vErrors === null) {
|
|
5906
|
+
vErrors = [err118];
|
|
5907
|
+
} else {
|
|
5908
|
+
vErrors.push(err118);
|
|
5909
|
+
}
|
|
5910
|
+
errors++;
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
if (data.id !== void 0) {
|
|
5914
|
+
let data42 = data.id;
|
|
5915
|
+
if (typeof data42 === "string") {
|
|
5916
|
+
if (!pattern0.test(data42)) {
|
|
5917
|
+
const err119 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
5918
|
+
if (vErrors === null) {
|
|
5919
|
+
vErrors = [err119];
|
|
5920
|
+
} else {
|
|
5921
|
+
vErrors.push(err119);
|
|
5922
|
+
}
|
|
5923
|
+
errors++;
|
|
5924
|
+
}
|
|
5925
|
+
} else {
|
|
5926
|
+
const err120 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5927
|
+
if (vErrors === null) {
|
|
5928
|
+
vErrors = [err120];
|
|
5929
|
+
} else {
|
|
5930
|
+
vErrors.push(err120);
|
|
5931
|
+
}
|
|
5932
|
+
errors++;
|
|
5933
|
+
}
|
|
5934
|
+
}
|
|
5935
|
+
if (data.children !== void 0) {
|
|
5936
|
+
let data43 = data.children;
|
|
5937
|
+
if (Array.isArray(data43)) {
|
|
5938
|
+
if (data43.length < 1) {
|
|
5939
|
+
const err121 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
|
|
5940
|
+
if (vErrors === null) {
|
|
5941
|
+
vErrors = [err121];
|
|
5942
|
+
} else {
|
|
5943
|
+
vErrors.push(err121);
|
|
5944
|
+
}
|
|
5945
|
+
errors++;
|
|
5946
|
+
}
|
|
5947
|
+
const len0 = data43.length;
|
|
5948
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
5949
|
+
let data44 = data43[i0];
|
|
5950
|
+
if (typeof data44 === "string") {
|
|
5951
|
+
if (!pattern0.test(data44)) {
|
|
5952
|
+
const err122 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
5953
|
+
if (vErrors === null) {
|
|
5954
|
+
vErrors = [err122];
|
|
5955
|
+
} else {
|
|
5956
|
+
vErrors.push(err122);
|
|
5957
|
+
}
|
|
5958
|
+
errors++;
|
|
5959
|
+
}
|
|
5960
|
+
} else {
|
|
5961
|
+
const err123 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5962
|
+
if (vErrors === null) {
|
|
5963
|
+
vErrors = [err123];
|
|
5964
|
+
} else {
|
|
5965
|
+
vErrors.push(err123);
|
|
5966
|
+
}
|
|
5967
|
+
errors++;
|
|
5038
5968
|
}
|
|
5039
|
-
errors++;
|
|
5040
5969
|
}
|
|
5041
5970
|
} else {
|
|
5042
|
-
const
|
|
5971
|
+
const err124 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5043
5972
|
if (vErrors === null) {
|
|
5044
|
-
vErrors = [
|
|
5973
|
+
vErrors = [err124];
|
|
5045
5974
|
} else {
|
|
5046
|
-
vErrors.push(
|
|
5975
|
+
vErrors.push(err124);
|
|
5047
5976
|
}
|
|
5048
5977
|
errors++;
|
|
5049
5978
|
}
|
|
5050
5979
|
}
|
|
5051
|
-
if (data.
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
if (
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5980
|
+
if (data.hash !== void 0) {
|
|
5981
|
+
let data45 = data.hash;
|
|
5982
|
+
if (typeof data45 === "string") {
|
|
5983
|
+
if (!pattern14.test(data45)) {
|
|
5984
|
+
const err125 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
|
|
5985
|
+
if (vErrors === null) {
|
|
5986
|
+
vErrors = [err125];
|
|
5987
|
+
} else {
|
|
5988
|
+
vErrors.push(err125);
|
|
5989
|
+
}
|
|
5990
|
+
errors++;
|
|
5058
5991
|
}
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
}
|
|
5062
|
-
if (data.color !== void 0) {
|
|
5063
|
-
let data37 = data.color;
|
|
5064
|
-
if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
|
|
5065
|
-
const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
|
|
5992
|
+
} else {
|
|
5993
|
+
const err126 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5066
5994
|
if (vErrors === null) {
|
|
5067
|
-
vErrors = [
|
|
5995
|
+
vErrors = [err126];
|
|
5068
5996
|
} else {
|
|
5069
|
-
vErrors.push(
|
|
5997
|
+
vErrors.push(err126);
|
|
5070
5998
|
}
|
|
5071
5999
|
errors++;
|
|
5072
6000
|
}
|
|
5073
6001
|
}
|
|
5074
6002
|
} else {
|
|
5075
|
-
const
|
|
6003
|
+
const err127 = { instancePath, schemaPath: "#/oneOf/9/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5076
6004
|
if (vErrors === null) {
|
|
5077
|
-
vErrors = [
|
|
6005
|
+
vErrors = [err127];
|
|
5078
6006
|
} else {
|
|
5079
|
-
vErrors.push(
|
|
6007
|
+
vErrors.push(err127);
|
|
5080
6008
|
}
|
|
5081
6009
|
errors++;
|
|
5082
6010
|
}
|
|
5083
6011
|
} else if (tag0 === "strip") {
|
|
5084
|
-
const
|
|
5085
|
-
let
|
|
5086
|
-
const
|
|
6012
|
+
const _errs142 = errors;
|
|
6013
|
+
let valid56 = false;
|
|
6014
|
+
const _errs143 = errors;
|
|
5087
6015
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5088
6016
|
if (data.value === void 0) {
|
|
5089
|
-
const
|
|
6017
|
+
const err128 = { instancePath, schemaPath: "#/oneOf/10/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
|
|
5090
6018
|
if (vErrors === null) {
|
|
5091
|
-
vErrors = [
|
|
6019
|
+
vErrors = [err128];
|
|
5092
6020
|
} else {
|
|
5093
|
-
vErrors.push(
|
|
6021
|
+
vErrors.push(err128);
|
|
5094
6022
|
}
|
|
5095
6023
|
errors++;
|
|
5096
6024
|
}
|
|
5097
6025
|
}
|
|
5098
|
-
var _valid0 =
|
|
5099
|
-
|
|
5100
|
-
if (!
|
|
5101
|
-
const
|
|
6026
|
+
var _valid0 = _errs143 === errors;
|
|
6027
|
+
valid56 = valid56 || _valid0;
|
|
6028
|
+
if (!valid56) {
|
|
6029
|
+
const _errs144 = errors;
|
|
5102
6030
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5103
6031
|
if (data.tag === void 0) {
|
|
5104
|
-
const
|
|
6032
|
+
const err129 = { instancePath, schemaPath: "#/oneOf/10/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
|
|
5105
6033
|
if (vErrors === null) {
|
|
5106
|
-
vErrors = [
|
|
6034
|
+
vErrors = [err129];
|
|
5107
6035
|
} else {
|
|
5108
|
-
vErrors.push(
|
|
6036
|
+
vErrors.push(err129);
|
|
5109
6037
|
}
|
|
5110
6038
|
errors++;
|
|
5111
6039
|
}
|
|
5112
6040
|
}
|
|
5113
|
-
var _valid0 =
|
|
5114
|
-
|
|
6041
|
+
var _valid0 = _errs144 === errors;
|
|
6042
|
+
valid56 = valid56 || _valid0;
|
|
5115
6043
|
}
|
|
5116
|
-
if (!
|
|
5117
|
-
const
|
|
6044
|
+
if (!valid56) {
|
|
6045
|
+
const err130 = { instancePath, schemaPath: "#/oneOf/10/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
5118
6046
|
if (vErrors === null) {
|
|
5119
|
-
vErrors = [
|
|
6047
|
+
vErrors = [err130];
|
|
5120
6048
|
} else {
|
|
5121
|
-
vErrors.push(
|
|
6049
|
+
vErrors.push(err130);
|
|
5122
6050
|
}
|
|
5123
6051
|
errors++;
|
|
5124
6052
|
} else {
|
|
5125
|
-
errors =
|
|
6053
|
+
errors = _errs142;
|
|
5126
6054
|
if (vErrors !== null) {
|
|
5127
|
-
if (
|
|
5128
|
-
vErrors.length =
|
|
6055
|
+
if (_errs142) {
|
|
6056
|
+
vErrors.length = _errs142;
|
|
5129
6057
|
} else {
|
|
5130
6058
|
vErrors = null;
|
|
5131
6059
|
}
|
|
@@ -5133,151 +6061,151 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5133
6061
|
}
|
|
5134
6062
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5135
6063
|
if (data.type === void 0) {
|
|
5136
|
-
const
|
|
6064
|
+
const err131 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
5137
6065
|
if (vErrors === null) {
|
|
5138
|
-
vErrors = [
|
|
6066
|
+
vErrors = [err131];
|
|
5139
6067
|
} else {
|
|
5140
|
-
vErrors.push(
|
|
6068
|
+
vErrors.push(err131);
|
|
5141
6069
|
}
|
|
5142
6070
|
errors++;
|
|
5143
6071
|
}
|
|
5144
6072
|
if (data.field === void 0) {
|
|
5145
|
-
const
|
|
6073
|
+
const err132 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
|
|
5146
6074
|
if (vErrors === null) {
|
|
5147
|
-
vErrors = [
|
|
6075
|
+
vErrors = [err132];
|
|
5148
6076
|
} else {
|
|
5149
|
-
vErrors.push(
|
|
6077
|
+
vErrors.push(err132);
|
|
5150
6078
|
}
|
|
5151
6079
|
errors++;
|
|
5152
6080
|
}
|
|
5153
|
-
for (const
|
|
5154
|
-
if (!(
|
|
5155
|
-
const
|
|
6081
|
+
for (const key10 in data) {
|
|
6082
|
+
if (!(key10 === "type" || key10 === "field" || key10 === "value" || key10 === "tag")) {
|
|
6083
|
+
const err133 = { instancePath, schemaPath: "#/oneOf/10/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key10 }, message: "must NOT have additional properties" };
|
|
5156
6084
|
if (vErrors === null) {
|
|
5157
|
-
vErrors = [
|
|
6085
|
+
vErrors = [err133];
|
|
5158
6086
|
} else {
|
|
5159
|
-
vErrors.push(
|
|
6087
|
+
vErrors.push(err133);
|
|
5160
6088
|
}
|
|
5161
6089
|
errors++;
|
|
5162
6090
|
}
|
|
5163
6091
|
}
|
|
5164
6092
|
if (data.type !== void 0) {
|
|
5165
6093
|
if ("strip" !== data.type) {
|
|
5166
|
-
const
|
|
6094
|
+
const err134 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/10/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
|
|
5167
6095
|
if (vErrors === null) {
|
|
5168
|
-
vErrors = [
|
|
6096
|
+
vErrors = [err134];
|
|
5169
6097
|
} else {
|
|
5170
|
-
vErrors.push(
|
|
6098
|
+
vErrors.push(err134);
|
|
5171
6099
|
}
|
|
5172
6100
|
errors++;
|
|
5173
6101
|
}
|
|
5174
6102
|
}
|
|
5175
6103
|
if (data.field !== void 0) {
|
|
5176
|
-
let
|
|
5177
|
-
if (typeof
|
|
5178
|
-
if (func3(
|
|
5179
|
-
const
|
|
6104
|
+
let data47 = data.field;
|
|
6105
|
+
if (typeof data47 === "string") {
|
|
6106
|
+
if (func3(data47) < 1) {
|
|
6107
|
+
const err135 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
5180
6108
|
if (vErrors === null) {
|
|
5181
|
-
vErrors = [
|
|
6109
|
+
vErrors = [err135];
|
|
5182
6110
|
} else {
|
|
5183
|
-
vErrors.push(
|
|
6111
|
+
vErrors.push(err135);
|
|
5184
6112
|
}
|
|
5185
6113
|
errors++;
|
|
5186
6114
|
}
|
|
5187
6115
|
} else {
|
|
5188
|
-
const
|
|
6116
|
+
const err136 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5189
6117
|
if (vErrors === null) {
|
|
5190
|
-
vErrors = [
|
|
6118
|
+
vErrors = [err136];
|
|
5191
6119
|
} else {
|
|
5192
|
-
vErrors.push(
|
|
6120
|
+
vErrors.push(err136);
|
|
5193
6121
|
}
|
|
5194
6122
|
errors++;
|
|
5195
6123
|
}
|
|
5196
6124
|
}
|
|
5197
6125
|
if (data.value !== void 0) {
|
|
5198
|
-
let
|
|
5199
|
-
if (typeof
|
|
5200
|
-
if (func3(
|
|
5201
|
-
const
|
|
6126
|
+
let data48 = data.value;
|
|
6127
|
+
if (typeof data48 === "string") {
|
|
6128
|
+
if (func3(data48) < 1) {
|
|
6129
|
+
const err137 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
5202
6130
|
if (vErrors === null) {
|
|
5203
|
-
vErrors = [
|
|
6131
|
+
vErrors = [err137];
|
|
5204
6132
|
} else {
|
|
5205
|
-
vErrors.push(
|
|
6133
|
+
vErrors.push(err137);
|
|
5206
6134
|
}
|
|
5207
6135
|
errors++;
|
|
5208
6136
|
}
|
|
5209
6137
|
} else {
|
|
5210
|
-
const
|
|
6138
|
+
const err138 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5211
6139
|
if (vErrors === null) {
|
|
5212
|
-
vErrors = [
|
|
6140
|
+
vErrors = [err138];
|
|
5213
6141
|
} else {
|
|
5214
|
-
vErrors.push(
|
|
6142
|
+
vErrors.push(err138);
|
|
5215
6143
|
}
|
|
5216
6144
|
errors++;
|
|
5217
6145
|
}
|
|
5218
6146
|
}
|
|
5219
6147
|
if (data.tag !== void 0) {
|
|
5220
|
-
let
|
|
5221
|
-
if (typeof
|
|
5222
|
-
if (func3(
|
|
5223
|
-
const
|
|
6148
|
+
let data49 = data.tag;
|
|
6149
|
+
if (typeof data49 === "string") {
|
|
6150
|
+
if (func3(data49) < 1) {
|
|
6151
|
+
const err139 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
5224
6152
|
if (vErrors === null) {
|
|
5225
|
-
vErrors = [
|
|
6153
|
+
vErrors = [err139];
|
|
5226
6154
|
} else {
|
|
5227
|
-
vErrors.push(
|
|
6155
|
+
vErrors.push(err139);
|
|
5228
6156
|
}
|
|
5229
6157
|
errors++;
|
|
5230
6158
|
}
|
|
5231
6159
|
} else {
|
|
5232
|
-
const
|
|
6160
|
+
const err140 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5233
6161
|
if (vErrors === null) {
|
|
5234
|
-
vErrors = [
|
|
6162
|
+
vErrors = [err140];
|
|
5235
6163
|
} else {
|
|
5236
|
-
vErrors.push(
|
|
6164
|
+
vErrors.push(err140);
|
|
5237
6165
|
}
|
|
5238
6166
|
errors++;
|
|
5239
6167
|
}
|
|
5240
6168
|
}
|
|
5241
6169
|
} else {
|
|
5242
|
-
const
|
|
6170
|
+
const err141 = { instancePath, schemaPath: "#/oneOf/10/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5243
6171
|
if (vErrors === null) {
|
|
5244
|
-
vErrors = [
|
|
6172
|
+
vErrors = [err141];
|
|
5245
6173
|
} else {
|
|
5246
|
-
vErrors.push(
|
|
6174
|
+
vErrors.push(err141);
|
|
5247
6175
|
}
|
|
5248
6176
|
errors++;
|
|
5249
6177
|
}
|
|
5250
6178
|
} else {
|
|
5251
|
-
const
|
|
6179
|
+
const err142 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
|
|
5252
6180
|
if (vErrors === null) {
|
|
5253
|
-
vErrors = [
|
|
6181
|
+
vErrors = [err142];
|
|
5254
6182
|
} else {
|
|
5255
|
-
vErrors.push(
|
|
6183
|
+
vErrors.push(err142);
|
|
5256
6184
|
}
|
|
5257
6185
|
errors++;
|
|
5258
6186
|
}
|
|
5259
6187
|
} else {
|
|
5260
|
-
const
|
|
6188
|
+
const err143 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
|
|
5261
6189
|
if (vErrors === null) {
|
|
5262
|
-
vErrors = [
|
|
6190
|
+
vErrors = [err143];
|
|
5263
6191
|
} else {
|
|
5264
|
-
vErrors.push(
|
|
6192
|
+
vErrors.push(err143);
|
|
5265
6193
|
}
|
|
5266
6194
|
errors++;
|
|
5267
6195
|
}
|
|
5268
6196
|
} else {
|
|
5269
|
-
const
|
|
6197
|
+
const err144 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5270
6198
|
if (vErrors === null) {
|
|
5271
|
-
vErrors = [
|
|
6199
|
+
vErrors = [err144];
|
|
5272
6200
|
} else {
|
|
5273
|
-
vErrors.push(
|
|
6201
|
+
vErrors.push(err144);
|
|
5274
6202
|
}
|
|
5275
6203
|
errors++;
|
|
5276
6204
|
}
|
|
5277
|
-
|
|
6205
|
+
validate38.errors = vErrors;
|
|
5278
6206
|
return errors === 0;
|
|
5279
6207
|
}
|
|
5280
|
-
function
|
|
6208
|
+
function validate35(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5281
6209
|
let vErrors = null;
|
|
5282
6210
|
let errors = 0;
|
|
5283
6211
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5399,8 +6327,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5399
6327
|
}
|
|
5400
6328
|
const len0 = data3.length;
|
|
5401
6329
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
5402
|
-
if (!
|
|
5403
|
-
vErrors = vErrors === null ?
|
|
6330
|
+
if (!validate36(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
|
|
6331
|
+
vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);
|
|
5404
6332
|
errors = vErrors.length;
|
|
5405
6333
|
}
|
|
5406
6334
|
}
|
|
@@ -5419,8 +6347,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5419
6347
|
if (Array.isArray(data5)) {
|
|
5420
6348
|
const len1 = data5.length;
|
|
5421
6349
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
5422
|
-
if (!
|
|
5423
|
-
vErrors = vErrors === null ?
|
|
6350
|
+
if (!validate38(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
|
|
6351
|
+
vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
|
|
5424
6352
|
errors = vErrors.length;
|
|
5425
6353
|
}
|
|
5426
6354
|
}
|
|
@@ -5443,10 +6371,10 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5443
6371
|
}
|
|
5444
6372
|
errors++;
|
|
5445
6373
|
}
|
|
5446
|
-
|
|
6374
|
+
validate35.errors = vErrors;
|
|
5447
6375
|
return errors === 0;
|
|
5448
6376
|
}
|
|
5449
|
-
function
|
|
6377
|
+
function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5450
6378
|
let vErrors = null;
|
|
5451
6379
|
let errors = 0;
|
|
5452
6380
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5524,10 +6452,10 @@ function validate38(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5524
6452
|
}
|
|
5525
6453
|
errors++;
|
|
5526
6454
|
}
|
|
5527
|
-
|
|
6455
|
+
validate43.errors = vErrors;
|
|
5528
6456
|
return errors === 0;
|
|
5529
6457
|
}
|
|
5530
|
-
function
|
|
6458
|
+
function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5531
6459
|
let vErrors = null;
|
|
5532
6460
|
let errors = 0;
|
|
5533
6461
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5635,10 +6563,10 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5635
6563
|
}
|
|
5636
6564
|
errors++;
|
|
5637
6565
|
}
|
|
5638
|
-
|
|
6566
|
+
validate46.errors = vErrors;
|
|
5639
6567
|
return errors === 0;
|
|
5640
6568
|
}
|
|
5641
|
-
function
|
|
6569
|
+
function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5642
6570
|
let vErrors = null;
|
|
5643
6571
|
let errors = 0;
|
|
5644
6572
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5676,8 +6604,8 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5676
6604
|
}
|
|
5677
6605
|
const len0 = data0.length;
|
|
5678
6606
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
5679
|
-
if (!
|
|
5680
|
-
vErrors = vErrors === null ?
|
|
6607
|
+
if (!validate46(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
|
|
6608
|
+
vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);
|
|
5681
6609
|
errors = vErrors.length;
|
|
5682
6610
|
}
|
|
5683
6611
|
}
|
|
@@ -5700,10 +6628,10 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5700
6628
|
}
|
|
5701
6629
|
errors++;
|
|
5702
6630
|
}
|
|
5703
|
-
|
|
6631
|
+
validate45.errors = vErrors;
|
|
5704
6632
|
return errors === 0;
|
|
5705
6633
|
}
|
|
5706
|
-
function
|
|
6634
|
+
function validate50(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5707
6635
|
let vErrors = null;
|
|
5708
6636
|
let errors = 0;
|
|
5709
6637
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5780,10 +6708,10 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5780
6708
|
}
|
|
5781
6709
|
errors++;
|
|
5782
6710
|
}
|
|
5783
|
-
|
|
6711
|
+
validate50.errors = vErrors;
|
|
5784
6712
|
return errors === 0;
|
|
5785
6713
|
}
|
|
5786
|
-
function
|
|
6714
|
+
function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5787
6715
|
let vErrors = null;
|
|
5788
6716
|
let errors = 0;
|
|
5789
6717
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5821,8 +6749,8 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5821
6749
|
}
|
|
5822
6750
|
const len0 = data0.length;
|
|
5823
6751
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
5824
|
-
if (!
|
|
5825
|
-
vErrors = vErrors === null ?
|
|
6752
|
+
if (!validate50(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
|
|
6753
|
+
vErrors = vErrors === null ? validate50.errors : vErrors.concat(validate50.errors);
|
|
5826
6754
|
errors = vErrors.length;
|
|
5827
6755
|
}
|
|
5828
6756
|
}
|
|
@@ -5845,11 +6773,11 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5845
6773
|
}
|
|
5846
6774
|
errors++;
|
|
5847
6775
|
}
|
|
5848
|
-
|
|
6776
|
+
validate49.errors = vErrors;
|
|
5849
6777
|
return errors === 0;
|
|
5850
6778
|
}
|
|
5851
|
-
var
|
|
5852
|
-
function
|
|
6779
|
+
var pattern27 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
|
|
6780
|
+
function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5853
6781
|
let vErrors = null;
|
|
5854
6782
|
let errors = 0;
|
|
5855
6783
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -5916,7 +6844,7 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5916
6844
|
if (data.length !== void 0) {
|
|
5917
6845
|
let data1 = data.length;
|
|
5918
6846
|
if (typeof data1 === "string") {
|
|
5919
|
-
if (!
|
|
6847
|
+
if (!pattern27.test(data1)) {
|
|
5920
6848
|
const err6 = { instancePath: instancePath + "/length", schemaPath: "#/definitions/duration/pattern", keyword: "pattern", params: { pattern: "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$" }, message: 'must match pattern "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"' };
|
|
5921
6849
|
if (vErrors === null) {
|
|
5922
6850
|
vErrors = [err6];
|
|
@@ -5990,10 +6918,10 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5990
6918
|
}
|
|
5991
6919
|
errors++;
|
|
5992
6920
|
}
|
|
5993
|
-
|
|
6921
|
+
validate54.errors = vErrors;
|
|
5994
6922
|
return errors === 0;
|
|
5995
6923
|
}
|
|
5996
|
-
function
|
|
6924
|
+
function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5997
6925
|
let vErrors = null;
|
|
5998
6926
|
let errors = 0;
|
|
5999
6927
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6103,10 +7031,10 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6103
7031
|
}
|
|
6104
7032
|
errors++;
|
|
6105
7033
|
}
|
|
6106
|
-
|
|
7034
|
+
validate56.errors = vErrors;
|
|
6107
7035
|
return errors === 0;
|
|
6108
7036
|
}
|
|
6109
|
-
function
|
|
7037
|
+
function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6110
7038
|
let vErrors = null;
|
|
6111
7039
|
let errors = 0;
|
|
6112
7040
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6186,7 +7114,7 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6186
7114
|
if (data.color !== void 0) {
|
|
6187
7115
|
let data2 = data.color;
|
|
6188
7116
|
if (!(data2 === "blue" || data2 === "amber" || data2 === "green" || data2 === "violet" || data2 === "rose" || data2 === "slate" || data2 === "coin")) {
|
|
6189
|
-
const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
7117
|
+
const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
6190
7118
|
if (vErrors === null) {
|
|
6191
7119
|
vErrors = [err7];
|
|
6192
7120
|
} else {
|
|
@@ -6241,10 +7169,10 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6241
7169
|
}
|
|
6242
7170
|
errors++;
|
|
6243
7171
|
}
|
|
6244
|
-
|
|
7172
|
+
validate58.errors = vErrors;
|
|
6245
7173
|
return errors === 0;
|
|
6246
7174
|
}
|
|
6247
|
-
function
|
|
7175
|
+
function validate60(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6248
7176
|
let vErrors = null;
|
|
6249
7177
|
let errors = 0;
|
|
6250
7178
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6331,10 +7259,10 @@ function validate55(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6331
7259
|
}
|
|
6332
7260
|
errors++;
|
|
6333
7261
|
}
|
|
6334
|
-
|
|
7262
|
+
validate60.errors = vErrors;
|
|
6335
7263
|
return errors === 0;
|
|
6336
7264
|
}
|
|
6337
|
-
function
|
|
7265
|
+
function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6338
7266
|
let vErrors = null;
|
|
6339
7267
|
let errors = 0;
|
|
6340
7268
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6422,10 +7350,10 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6422
7350
|
}
|
|
6423
7351
|
errors++;
|
|
6424
7352
|
}
|
|
6425
|
-
|
|
7353
|
+
validate62.errors = vErrors;
|
|
6426
7354
|
return errors === 0;
|
|
6427
7355
|
}
|
|
6428
|
-
function
|
|
7356
|
+
function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6429
7357
|
let vErrors = null;
|
|
6430
7358
|
let errors = 0;
|
|
6431
7359
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6459,14 +7387,14 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6459
7387
|
}
|
|
6460
7388
|
}
|
|
6461
7389
|
if (data.scale !== void 0) {
|
|
6462
|
-
if (!
|
|
6463
|
-
vErrors = vErrors === null ?
|
|
7390
|
+
if (!validate54(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
|
|
7391
|
+
vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
|
|
6464
7392
|
errors = vErrors.length;
|
|
6465
7393
|
}
|
|
6466
7394
|
}
|
|
6467
7395
|
if (data.period !== void 0) {
|
|
6468
|
-
if (!
|
|
6469
|
-
vErrors = vErrors === null ?
|
|
7396
|
+
if (!validate56(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
|
|
7397
|
+
vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);
|
|
6470
7398
|
errors = vErrors.length;
|
|
6471
7399
|
}
|
|
6472
7400
|
}
|
|
@@ -6484,8 +7412,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6484
7412
|
}
|
|
6485
7413
|
const len0 = data2.length;
|
|
6486
7414
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
6487
|
-
if (!
|
|
6488
|
-
vErrors = vErrors === null ?
|
|
7415
|
+
if (!validate58(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
|
|
7416
|
+
vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);
|
|
6489
7417
|
errors = vErrors.length;
|
|
6490
7418
|
}
|
|
6491
7419
|
}
|
|
@@ -6504,8 +7432,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6504
7432
|
if (Array.isArray(data4)) {
|
|
6505
7433
|
const len1 = data4.length;
|
|
6506
7434
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
6507
|
-
if (!
|
|
6508
|
-
vErrors = vErrors === null ?
|
|
7435
|
+
if (!validate60(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
|
|
7436
|
+
vErrors = vErrors === null ? validate60.errors : vErrors.concat(validate60.errors);
|
|
6509
7437
|
errors = vErrors.length;
|
|
6510
7438
|
}
|
|
6511
7439
|
}
|
|
@@ -6520,8 +7448,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6520
7448
|
}
|
|
6521
7449
|
}
|
|
6522
7450
|
if (data.zoom !== void 0) {
|
|
6523
|
-
if (!
|
|
6524
|
-
vErrors = vErrors === null ?
|
|
7451
|
+
if (!validate62(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
|
|
7452
|
+
vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
|
|
6525
7453
|
errors = vErrors.length;
|
|
6526
7454
|
}
|
|
6527
7455
|
}
|
|
@@ -6534,7 +7462,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6534
7462
|
}
|
|
6535
7463
|
errors++;
|
|
6536
7464
|
}
|
|
6537
|
-
|
|
7465
|
+
validate53.errors = vErrors;
|
|
6538
7466
|
return errors === 0;
|
|
6539
7467
|
}
|
|
6540
7468
|
var func2 = Object.prototype.hasOwnProperty;
|
|
@@ -6918,84 +7846,35 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6918
7846
|
errors++;
|
|
6919
7847
|
}
|
|
6920
7848
|
if (data.steps !== void 0) {
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
for (let i1 = 0; i1 < len1; i1++) {
|
|
6925
|
-
let data23 = data22[i1];
|
|
6926
|
-
if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
|
|
6927
|
-
if (data23.events !== void 0) {
|
|
6928
|
-
let data24 = data23.events;
|
|
6929
|
-
if (Array.isArray(data24)) {
|
|
6930
|
-
const len2 = data24.length;
|
|
6931
|
-
for (let i2 = 0; i2 < len2; i2++) {
|
|
6932
|
-
let data25 = data24[i2];
|
|
6933
|
-
if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
|
|
6934
|
-
if (data25.type !== void 0) {
|
|
6935
|
-
let data26 = data25.type;
|
|
6936
|
-
const _errs62 = errors;
|
|
6937
|
-
const _errs63 = errors;
|
|
6938
|
-
if (!(data26 === "commit" || data26 === "branch")) {
|
|
6939
|
-
const err23 = {};
|
|
6940
|
-
if (vErrors === null) {
|
|
6941
|
-
vErrors = [err23];
|
|
6942
|
-
} else {
|
|
6943
|
-
vErrors.push(err23);
|
|
6944
|
-
}
|
|
6945
|
-
errors++;
|
|
6946
|
-
}
|
|
6947
|
-
var valid31 = _errs63 === errors;
|
|
6948
|
-
if (valid31) {
|
|
6949
|
-
const err24 = { instancePath: instancePath + "/steps/" + i1 + "/events/" + i2 + "/type", schemaPath: "#/definitions/timeSteps/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
6950
|
-
if (vErrors === null) {
|
|
6951
|
-
vErrors = [err24];
|
|
6952
|
-
} else {
|
|
6953
|
-
vErrors.push(err24);
|
|
6954
|
-
}
|
|
6955
|
-
errors++;
|
|
6956
|
-
} else {
|
|
6957
|
-
errors = _errs62;
|
|
6958
|
-
if (vErrors !== null) {
|
|
6959
|
-
if (_errs62) {
|
|
6960
|
-
vErrors.length = _errs62;
|
|
6961
|
-
} else {
|
|
6962
|
-
vErrors = null;
|
|
6963
|
-
}
|
|
6964
|
-
}
|
|
6965
|
-
}
|
|
6966
|
-
}
|
|
6967
|
-
}
|
|
6968
|
-
}
|
|
6969
|
-
}
|
|
6970
|
-
}
|
|
6971
|
-
}
|
|
6972
|
-
}
|
|
7849
|
+
if (!validate20(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
|
|
7850
|
+
vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);
|
|
7851
|
+
errors = vErrors.length;
|
|
6973
7852
|
}
|
|
6974
7853
|
}
|
|
6975
7854
|
if (data.state !== void 0) {
|
|
6976
|
-
const
|
|
7855
|
+
const err23 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
6977
7856
|
if (vErrors === null) {
|
|
6978
|
-
vErrors = [
|
|
7857
|
+
vErrors = [err23];
|
|
6979
7858
|
} else {
|
|
6980
|
-
vErrors.push(
|
|
7859
|
+
vErrors.push(err23);
|
|
6981
7860
|
}
|
|
6982
7861
|
errors++;
|
|
6983
7862
|
}
|
|
6984
7863
|
if (data.git !== void 0) {
|
|
6985
|
-
const
|
|
7864
|
+
const err24 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
6986
7865
|
if (vErrors === null) {
|
|
6987
|
-
vErrors = [
|
|
7866
|
+
vErrors = [err24];
|
|
6988
7867
|
} else {
|
|
6989
|
-
vErrors.push(
|
|
7868
|
+
vErrors.push(err24);
|
|
6990
7869
|
}
|
|
6991
7870
|
errors++;
|
|
6992
7871
|
}
|
|
6993
7872
|
if (data.regions !== void 0) {
|
|
6994
|
-
const
|
|
7873
|
+
const err25 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
6995
7874
|
if (vErrors === null) {
|
|
6996
|
-
vErrors = [
|
|
7875
|
+
vErrors = [err25];
|
|
6997
7876
|
} else {
|
|
6998
|
-
vErrors.push(
|
|
7877
|
+
vErrors.push(err25);
|
|
6999
7878
|
}
|
|
7000
7879
|
errors++;
|
|
7001
7880
|
}
|
|
@@ -7004,72 +7883,178 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7004
7883
|
valid21 = _valid3;
|
|
7005
7884
|
ifClause3 = "then";
|
|
7006
7885
|
} else {
|
|
7007
|
-
const
|
|
7886
|
+
const _errs66 = errors;
|
|
7887
|
+
const _errs67 = errors;
|
|
7888
|
+
let valid27 = true;
|
|
7889
|
+
const _errs68 = errors;
|
|
7008
7890
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
7009
|
-
if (data.
|
|
7010
|
-
|
|
7011
|
-
if (
|
|
7012
|
-
|
|
7013
|
-
|
|
7891
|
+
if (data.kind === void 0 && ("kind")) {
|
|
7892
|
+
const err26 = {};
|
|
7893
|
+
if (vErrors === null) {
|
|
7894
|
+
vErrors = [err26];
|
|
7895
|
+
} else {
|
|
7896
|
+
vErrors.push(err26);
|
|
7897
|
+
}
|
|
7898
|
+
errors++;
|
|
7899
|
+
} else {
|
|
7900
|
+
if (data.kind !== void 0) {
|
|
7901
|
+
if ("tree" !== data.kind) {
|
|
7902
|
+
const err27 = {};
|
|
7014
7903
|
if (vErrors === null) {
|
|
7015
|
-
vErrors = [
|
|
7904
|
+
vErrors = [err27];
|
|
7016
7905
|
} else {
|
|
7017
|
-
vErrors.push(
|
|
7906
|
+
vErrors.push(err27);
|
|
7018
7907
|
}
|
|
7019
7908
|
errors++;
|
|
7020
7909
|
}
|
|
7021
7910
|
}
|
|
7022
7911
|
}
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7912
|
+
}
|
|
7913
|
+
var _valid4 = _errs68 === errors;
|
|
7914
|
+
errors = _errs67;
|
|
7915
|
+
if (vErrors !== null) {
|
|
7916
|
+
if (_errs67) {
|
|
7917
|
+
vErrors.length = _errs67;
|
|
7918
|
+
} else {
|
|
7919
|
+
vErrors = null;
|
|
7028
7920
|
}
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7921
|
+
}
|
|
7922
|
+
let ifClause4;
|
|
7923
|
+
if (_valid4) {
|
|
7924
|
+
const _errs70 = errors;
|
|
7925
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
7926
|
+
if (data.steps !== void 0) {
|
|
7927
|
+
if (!validate22(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
|
|
7928
|
+
vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
|
|
7929
|
+
errors = vErrors.length;
|
|
7930
|
+
}
|
|
7033
7931
|
}
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
} else {
|
|
7040
|
-
vErrors.push(err29);
|
|
7932
|
+
if (data.strip !== void 0) {
|
|
7933
|
+
if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
|
|
7934
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
7935
|
+
errors = vErrors.length;
|
|
7936
|
+
}
|
|
7041
7937
|
}
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7938
|
+
if (data.state !== void 0) {
|
|
7939
|
+
const err28 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
7940
|
+
if (vErrors === null) {
|
|
7941
|
+
vErrors = [err28];
|
|
7942
|
+
} else {
|
|
7943
|
+
vErrors.push(err28);
|
|
7944
|
+
}
|
|
7945
|
+
errors++;
|
|
7946
|
+
}
|
|
7947
|
+
if (data.git !== void 0) {
|
|
7948
|
+
const err29 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
7949
|
+
if (vErrors === null) {
|
|
7950
|
+
vErrors = [err29];
|
|
7951
|
+
} else {
|
|
7952
|
+
vErrors.push(err29);
|
|
7953
|
+
}
|
|
7954
|
+
errors++;
|
|
7955
|
+
}
|
|
7956
|
+
if (data.time !== void 0) {
|
|
7957
|
+
const err30 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
7958
|
+
if (vErrors === null) {
|
|
7959
|
+
vErrors = [err30];
|
|
7960
|
+
} else {
|
|
7961
|
+
vErrors.push(err30);
|
|
7962
|
+
}
|
|
7963
|
+
errors++;
|
|
7964
|
+
}
|
|
7965
|
+
if (data.regions !== void 0) {
|
|
7966
|
+
const err31 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
7967
|
+
if (vErrors === null) {
|
|
7968
|
+
vErrors = [err31];
|
|
7969
|
+
} else {
|
|
7970
|
+
vErrors.push(err31);
|
|
7971
|
+
}
|
|
7972
|
+
errors++;
|
|
7050
7973
|
}
|
|
7051
|
-
errors++;
|
|
7052
7974
|
}
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7975
|
+
var _valid4 = _errs70 === errors;
|
|
7976
|
+
valid27 = _valid4;
|
|
7977
|
+
ifClause4 = "then";
|
|
7978
|
+
} else {
|
|
7979
|
+
const _errs85 = errors;
|
|
7980
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
7981
|
+
if (data.boxes !== void 0) {
|
|
7982
|
+
let data33 = data.boxes;
|
|
7983
|
+
if (Array.isArray(data33)) {
|
|
7984
|
+
if (data33.length < 1) {
|
|
7985
|
+
const err32 = { instancePath: instancePath + "/boxes", schemaPath: "#/else/else/else/else/else/properties/boxes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
|
|
7986
|
+
if (vErrors === null) {
|
|
7987
|
+
vErrors = [err32];
|
|
7988
|
+
} else {
|
|
7989
|
+
vErrors.push(err32);
|
|
7990
|
+
}
|
|
7991
|
+
errors++;
|
|
7992
|
+
}
|
|
7993
|
+
}
|
|
7994
|
+
}
|
|
7995
|
+
if (data.steps !== void 0) {
|
|
7996
|
+
if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
|
|
7997
|
+
vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
|
|
7998
|
+
errors = vErrors.length;
|
|
7999
|
+
}
|
|
8000
|
+
}
|
|
8001
|
+
if (data.strip !== void 0) {
|
|
8002
|
+
if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
|
|
8003
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
8004
|
+
errors = vErrors.length;
|
|
8005
|
+
}
|
|
8006
|
+
}
|
|
8007
|
+
if (data.state !== void 0) {
|
|
8008
|
+
const err33 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
8009
|
+
if (vErrors === null) {
|
|
8010
|
+
vErrors = [err33];
|
|
8011
|
+
} else {
|
|
8012
|
+
vErrors.push(err33);
|
|
8013
|
+
}
|
|
8014
|
+
errors++;
|
|
8015
|
+
}
|
|
8016
|
+
if (data.git !== void 0) {
|
|
8017
|
+
const err34 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
8018
|
+
if (vErrors === null) {
|
|
8019
|
+
vErrors = [err34];
|
|
8020
|
+
} else {
|
|
8021
|
+
vErrors.push(err34);
|
|
8022
|
+
}
|
|
8023
|
+
errors++;
|
|
8024
|
+
}
|
|
8025
|
+
if (data.time !== void 0) {
|
|
8026
|
+
const err35 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
8027
|
+
if (vErrors === null) {
|
|
8028
|
+
vErrors = [err35];
|
|
8029
|
+
} else {
|
|
8030
|
+
vErrors.push(err35);
|
|
8031
|
+
}
|
|
8032
|
+
errors++;
|
|
7059
8033
|
}
|
|
7060
|
-
errors++;
|
|
7061
8034
|
}
|
|
8035
|
+
var _valid4 = _errs85 === errors;
|
|
8036
|
+
valid27 = _valid4;
|
|
8037
|
+
ifClause4 = "else";
|
|
7062
8038
|
}
|
|
7063
|
-
|
|
8039
|
+
if (!valid27) {
|
|
8040
|
+
const err36 = { instancePath, schemaPath: "#/else/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause4 }, message: 'must match "' + ifClause4 + '" schema' };
|
|
8041
|
+
if (vErrors === null) {
|
|
8042
|
+
vErrors = [err36];
|
|
8043
|
+
} else {
|
|
8044
|
+
vErrors.push(err36);
|
|
8045
|
+
}
|
|
8046
|
+
errors++;
|
|
8047
|
+
}
|
|
8048
|
+
var _valid3 = _errs66 === errors;
|
|
7064
8049
|
valid21 = _valid3;
|
|
7065
8050
|
ifClause3 = "else";
|
|
7066
8051
|
}
|
|
7067
8052
|
if (!valid21) {
|
|
7068
|
-
const
|
|
8053
|
+
const err37 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
|
|
7069
8054
|
if (vErrors === null) {
|
|
7070
|
-
vErrors = [
|
|
8055
|
+
vErrors = [err37];
|
|
7071
8056
|
} else {
|
|
7072
|
-
vErrors.push(
|
|
8057
|
+
vErrors.push(err37);
|
|
7073
8058
|
}
|
|
7074
8059
|
errors++;
|
|
7075
8060
|
}
|
|
@@ -7078,11 +8063,11 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7078
8063
|
ifClause2 = "else";
|
|
7079
8064
|
}
|
|
7080
8065
|
if (!valid15) {
|
|
7081
|
-
const
|
|
8066
|
+
const err38 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
|
|
7082
8067
|
if (vErrors === null) {
|
|
7083
|
-
vErrors = [
|
|
8068
|
+
vErrors = [err38];
|
|
7084
8069
|
} else {
|
|
7085
|
-
vErrors.push(
|
|
8070
|
+
vErrors.push(err38);
|
|
7086
8071
|
}
|
|
7087
8072
|
errors++;
|
|
7088
8073
|
}
|
|
@@ -7091,21 +8076,21 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7091
8076
|
ifClause1 = "else";
|
|
7092
8077
|
}
|
|
7093
8078
|
if (!valid6) {
|
|
7094
|
-
const
|
|
8079
|
+
const err39 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
|
|
7095
8080
|
if (vErrors === null) {
|
|
7096
|
-
vErrors = [
|
|
8081
|
+
vErrors = [err39];
|
|
7097
8082
|
} else {
|
|
7098
|
-
vErrors.push(
|
|
8083
|
+
vErrors.push(err39);
|
|
7099
8084
|
}
|
|
7100
8085
|
errors++;
|
|
7101
8086
|
}
|
|
7102
8087
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
7103
8088
|
if (data.sequence !== void 0) {
|
|
7104
|
-
const
|
|
8089
|
+
const err40 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
7105
8090
|
if (vErrors === null) {
|
|
7106
|
-
vErrors = [
|
|
8091
|
+
vErrors = [err40];
|
|
7107
8092
|
} else {
|
|
7108
|
-
vErrors.push(
|
|
8093
|
+
vErrors.push(err40);
|
|
7109
8094
|
}
|
|
7110
8095
|
errors++;
|
|
7111
8096
|
}
|
|
@@ -7115,245 +8100,245 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7115
8100
|
ifClause0 = "else";
|
|
7116
8101
|
}
|
|
7117
8102
|
if (!valid0) {
|
|
7118
|
-
const
|
|
8103
|
+
const err41 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
|
|
7119
8104
|
if (vErrors === null) {
|
|
7120
|
-
vErrors = [
|
|
8105
|
+
vErrors = [err41];
|
|
7121
8106
|
} else {
|
|
7122
|
-
vErrors.push(
|
|
8107
|
+
vErrors.push(err41);
|
|
7123
8108
|
}
|
|
7124
8109
|
errors++;
|
|
7125
8110
|
}
|
|
7126
8111
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
7127
8112
|
if (data.version === void 0) {
|
|
7128
|
-
const
|
|
8113
|
+
const err42 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
|
|
7129
8114
|
if (vErrors === null) {
|
|
7130
|
-
vErrors = [
|
|
8115
|
+
vErrors = [err42];
|
|
7131
8116
|
} else {
|
|
7132
|
-
vErrors.push(
|
|
8117
|
+
vErrors.push(err42);
|
|
7133
8118
|
}
|
|
7134
8119
|
errors++;
|
|
7135
8120
|
}
|
|
7136
8121
|
if (data.kind === void 0) {
|
|
7137
|
-
const
|
|
8122
|
+
const err43 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
|
|
7138
8123
|
if (vErrors === null) {
|
|
7139
|
-
vErrors = [
|
|
8124
|
+
vErrors = [err43];
|
|
7140
8125
|
} else {
|
|
7141
|
-
vErrors.push(
|
|
8126
|
+
vErrors.push(err43);
|
|
7142
8127
|
}
|
|
7143
8128
|
errors++;
|
|
7144
8129
|
}
|
|
7145
8130
|
if (data.title === void 0) {
|
|
7146
|
-
const
|
|
8131
|
+
const err44 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
|
|
7147
8132
|
if (vErrors === null) {
|
|
7148
|
-
vErrors = [
|
|
8133
|
+
vErrors = [err44];
|
|
7149
8134
|
} else {
|
|
7150
|
-
vErrors.push(
|
|
8135
|
+
vErrors.push(err44);
|
|
7151
8136
|
}
|
|
7152
8137
|
errors++;
|
|
7153
8138
|
}
|
|
7154
8139
|
if (data.boxes === void 0) {
|
|
7155
|
-
const
|
|
8140
|
+
const err45 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
|
|
7156
8141
|
if (vErrors === null) {
|
|
7157
|
-
vErrors = [
|
|
8142
|
+
vErrors = [err45];
|
|
7158
8143
|
} else {
|
|
7159
|
-
vErrors.push(
|
|
8144
|
+
vErrors.push(err45);
|
|
7160
8145
|
}
|
|
7161
8146
|
errors++;
|
|
7162
8147
|
}
|
|
7163
8148
|
if (data.steps === void 0) {
|
|
7164
|
-
const
|
|
8149
|
+
const err46 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
|
|
7165
8150
|
if (vErrors === null) {
|
|
7166
|
-
vErrors = [
|
|
8151
|
+
vErrors = [err46];
|
|
7167
8152
|
} else {
|
|
7168
|
-
vErrors.push(
|
|
8153
|
+
vErrors.push(err46);
|
|
7169
8154
|
}
|
|
7170
8155
|
errors++;
|
|
7171
8156
|
}
|
|
7172
8157
|
for (const key0 in data) {
|
|
7173
8158
|
if (!func2.call(schema11.properties, key0)) {
|
|
7174
|
-
const
|
|
8159
|
+
const err47 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
7175
8160
|
if (vErrors === null) {
|
|
7176
|
-
vErrors = [
|
|
8161
|
+
vErrors = [err47];
|
|
7177
8162
|
} else {
|
|
7178
|
-
vErrors.push(
|
|
8163
|
+
vErrors.push(err47);
|
|
7179
8164
|
}
|
|
7180
8165
|
errors++;
|
|
7181
8166
|
}
|
|
7182
8167
|
}
|
|
7183
8168
|
if (data.version !== void 0) {
|
|
7184
|
-
let
|
|
7185
|
-
if (!(typeof
|
|
7186
|
-
const
|
|
8169
|
+
let data40 = data.version;
|
|
8170
|
+
if (!(typeof data40 == "number" && (!(data40 % 1) && !isNaN(data40)) && isFinite(data40))) {
|
|
8171
|
+
const err48 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
|
7187
8172
|
if (vErrors === null) {
|
|
7188
|
-
vErrors = [
|
|
8173
|
+
vErrors = [err48];
|
|
7189
8174
|
} else {
|
|
7190
|
-
vErrors.push(
|
|
8175
|
+
vErrors.push(err48);
|
|
7191
8176
|
}
|
|
7192
8177
|
errors++;
|
|
7193
8178
|
}
|
|
7194
|
-
if (typeof
|
|
7195
|
-
if (
|
|
7196
|
-
const
|
|
8179
|
+
if (typeof data40 == "number" && isFinite(data40)) {
|
|
8180
|
+
if (data40 < 1 || isNaN(data40)) {
|
|
8181
|
+
const err49 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
|
|
7197
8182
|
if (vErrors === null) {
|
|
7198
|
-
vErrors = [
|
|
8183
|
+
vErrors = [err49];
|
|
7199
8184
|
} else {
|
|
7200
|
-
vErrors.push(
|
|
8185
|
+
vErrors.push(err49);
|
|
7201
8186
|
}
|
|
7202
8187
|
errors++;
|
|
7203
8188
|
}
|
|
7204
8189
|
}
|
|
7205
8190
|
}
|
|
7206
8191
|
if (data.kind !== void 0) {
|
|
7207
|
-
let
|
|
7208
|
-
if (!(
|
|
7209
|
-
const
|
|
8192
|
+
let data41 = data.kind;
|
|
8193
|
+
if (!(data41 === "sequence" || data41 === "architecture" || data41 === "state" || data41 === "git" || data41 === "time" || data41 === "tree")) {
|
|
8194
|
+
const err50 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema11.properties.kind.enum }, message: "must be equal to one of the allowed values" };
|
|
7210
8195
|
if (vErrors === null) {
|
|
7211
|
-
vErrors = [
|
|
8196
|
+
vErrors = [err50];
|
|
7212
8197
|
} else {
|
|
7213
|
-
vErrors.push(
|
|
8198
|
+
vErrors.push(err50);
|
|
7214
8199
|
}
|
|
7215
8200
|
errors++;
|
|
7216
8201
|
}
|
|
7217
8202
|
}
|
|
7218
8203
|
if (data.title !== void 0) {
|
|
7219
|
-
let
|
|
7220
|
-
if (typeof
|
|
7221
|
-
if (func3(
|
|
7222
|
-
const
|
|
8204
|
+
let data42 = data.title;
|
|
8205
|
+
if (typeof data42 === "string") {
|
|
8206
|
+
if (func3(data42) < 1) {
|
|
8207
|
+
const err51 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
7223
8208
|
if (vErrors === null) {
|
|
7224
|
-
vErrors = [
|
|
8209
|
+
vErrors = [err51];
|
|
7225
8210
|
} else {
|
|
7226
|
-
vErrors.push(
|
|
8211
|
+
vErrors.push(err51);
|
|
7227
8212
|
}
|
|
7228
8213
|
errors++;
|
|
7229
8214
|
}
|
|
7230
8215
|
} else {
|
|
7231
|
-
const
|
|
8216
|
+
const err52 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7232
8217
|
if (vErrors === null) {
|
|
7233
|
-
vErrors = [
|
|
8218
|
+
vErrors = [err52];
|
|
7234
8219
|
} else {
|
|
7235
|
-
vErrors.push(
|
|
8220
|
+
vErrors.push(err52);
|
|
7236
8221
|
}
|
|
7237
8222
|
errors++;
|
|
7238
8223
|
}
|
|
7239
8224
|
}
|
|
7240
8225
|
if (data.view !== void 0) {
|
|
7241
|
-
let
|
|
7242
|
-
if (!(
|
|
7243
|
-
const
|
|
8226
|
+
let data43 = data.view;
|
|
8227
|
+
if (!(data43 === "fixed" || data43 === "follow")) {
|
|
8228
|
+
const err53 = { instancePath: instancePath + "/view", schemaPath: "#/properties/view/enum", keyword: "enum", params: { allowedValues: schema11.properties.view.enum }, message: "must be equal to one of the allowed values" };
|
|
7244
8229
|
if (vErrors === null) {
|
|
7245
|
-
vErrors = [
|
|
8230
|
+
vErrors = [err53];
|
|
7246
8231
|
} else {
|
|
7247
|
-
vErrors.push(
|
|
8232
|
+
vErrors.push(err53);
|
|
7248
8233
|
}
|
|
7249
8234
|
errors++;
|
|
7250
8235
|
}
|
|
7251
8236
|
}
|
|
7252
8237
|
if (data.regions !== void 0) {
|
|
7253
|
-
let
|
|
7254
|
-
if (Array.isArray(
|
|
7255
|
-
const
|
|
7256
|
-
for (let
|
|
7257
|
-
if (!
|
|
7258
|
-
vErrors = vErrors === null ?
|
|
8238
|
+
let data44 = data.regions;
|
|
8239
|
+
if (Array.isArray(data44)) {
|
|
8240
|
+
const len1 = data44.length;
|
|
8241
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
8242
|
+
if (!validate27(data44[i1], { instancePath: instancePath + "/regions/" + i1, parentData: data44, parentDataProperty: i1, rootData })) {
|
|
8243
|
+
vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
|
|
7259
8244
|
errors = vErrors.length;
|
|
7260
8245
|
}
|
|
7261
8246
|
}
|
|
7262
8247
|
} else {
|
|
7263
|
-
const
|
|
8248
|
+
const err54 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7264
8249
|
if (vErrors === null) {
|
|
7265
|
-
vErrors = [
|
|
8250
|
+
vErrors = [err54];
|
|
7266
8251
|
} else {
|
|
7267
|
-
vErrors.push(
|
|
8252
|
+
vErrors.push(err54);
|
|
7268
8253
|
}
|
|
7269
8254
|
errors++;
|
|
7270
8255
|
}
|
|
7271
8256
|
}
|
|
7272
8257
|
if (data.boxes !== void 0) {
|
|
7273
|
-
let
|
|
7274
|
-
if (Array.isArray(
|
|
7275
|
-
const
|
|
7276
|
-
for (let
|
|
7277
|
-
if (!
|
|
7278
|
-
vErrors = vErrors === null ?
|
|
8258
|
+
let data46 = data.boxes;
|
|
8259
|
+
if (Array.isArray(data46)) {
|
|
8260
|
+
const len2 = data46.length;
|
|
8261
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
8262
|
+
if (!validate29(data46[i2], { instancePath: instancePath + "/boxes/" + i2, parentData: data46, parentDataProperty: i2, rootData })) {
|
|
8263
|
+
vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
|
|
7279
8264
|
errors = vErrors.length;
|
|
7280
8265
|
}
|
|
7281
8266
|
}
|
|
7282
8267
|
} else {
|
|
7283
|
-
const
|
|
8268
|
+
const err55 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7284
8269
|
if (vErrors === null) {
|
|
7285
|
-
vErrors = [
|
|
8270
|
+
vErrors = [err55];
|
|
7286
8271
|
} else {
|
|
7287
|
-
vErrors.push(
|
|
8272
|
+
vErrors.push(err55);
|
|
7288
8273
|
}
|
|
7289
8274
|
errors++;
|
|
7290
8275
|
}
|
|
7291
8276
|
}
|
|
7292
8277
|
if (data.strip !== void 0) {
|
|
7293
|
-
if (!
|
|
7294
|
-
vErrors = vErrors === null ?
|
|
8278
|
+
if (!validate31(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
|
|
8279
|
+
vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
|
|
7295
8280
|
errors = vErrors.length;
|
|
7296
8281
|
}
|
|
7297
8282
|
}
|
|
7298
8283
|
if (data.steps !== void 0) {
|
|
7299
|
-
let
|
|
7300
|
-
if (Array.isArray(
|
|
7301
|
-
if (
|
|
7302
|
-
const
|
|
8284
|
+
let data49 = data.steps;
|
|
8285
|
+
if (Array.isArray(data49)) {
|
|
8286
|
+
if (data49.length < 1) {
|
|
8287
|
+
const err56 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
|
|
7303
8288
|
if (vErrors === null) {
|
|
7304
|
-
vErrors = [
|
|
8289
|
+
vErrors = [err56];
|
|
7305
8290
|
} else {
|
|
7306
|
-
vErrors.push(
|
|
8291
|
+
vErrors.push(err56);
|
|
7307
8292
|
}
|
|
7308
8293
|
errors++;
|
|
7309
8294
|
}
|
|
7310
|
-
const
|
|
7311
|
-
for (let
|
|
7312
|
-
if (!
|
|
7313
|
-
vErrors = vErrors === null ?
|
|
8295
|
+
const len3 = data49.length;
|
|
8296
|
+
for (let i3 = 0; i3 < len3; i3++) {
|
|
8297
|
+
if (!validate35(data49[i3], { instancePath: instancePath + "/steps/" + i3, parentData: data49, parentDataProperty: i3, rootData })) {
|
|
8298
|
+
vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);
|
|
7314
8299
|
errors = vErrors.length;
|
|
7315
8300
|
}
|
|
7316
8301
|
}
|
|
7317
8302
|
} else {
|
|
7318
|
-
const
|
|
8303
|
+
const err57 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7319
8304
|
if (vErrors === null) {
|
|
7320
|
-
vErrors = [
|
|
8305
|
+
vErrors = [err57];
|
|
7321
8306
|
} else {
|
|
7322
|
-
vErrors.push(
|
|
8307
|
+
vErrors.push(err57);
|
|
7323
8308
|
}
|
|
7324
8309
|
errors++;
|
|
7325
8310
|
}
|
|
7326
8311
|
}
|
|
7327
8312
|
if (data.sequence !== void 0) {
|
|
7328
|
-
if (!
|
|
7329
|
-
vErrors = vErrors === null ?
|
|
8313
|
+
if (!validate43(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
|
|
8314
|
+
vErrors = vErrors === null ? validate43.errors : vErrors.concat(validate43.errors);
|
|
7330
8315
|
errors = vErrors.length;
|
|
7331
8316
|
}
|
|
7332
8317
|
}
|
|
7333
8318
|
if (data.state !== void 0) {
|
|
7334
|
-
if (!
|
|
7335
|
-
vErrors = vErrors === null ?
|
|
8319
|
+
if (!validate45(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
|
|
8320
|
+
vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
|
|
7336
8321
|
errors = vErrors.length;
|
|
7337
8322
|
}
|
|
7338
8323
|
}
|
|
7339
8324
|
if (data.git !== void 0) {
|
|
7340
|
-
if (!
|
|
7341
|
-
vErrors = vErrors === null ?
|
|
8325
|
+
if (!validate49(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
|
|
8326
|
+
vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
|
|
7342
8327
|
errors = vErrors.length;
|
|
7343
8328
|
}
|
|
7344
8329
|
}
|
|
7345
8330
|
if (data.time !== void 0) {
|
|
7346
|
-
if (!
|
|
7347
|
-
vErrors = vErrors === null ?
|
|
8331
|
+
if (!validate53(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
|
|
8332
|
+
vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
|
|
7348
8333
|
errors = vErrors.length;
|
|
7349
8334
|
}
|
|
7350
8335
|
}
|
|
7351
8336
|
} else {
|
|
7352
|
-
const
|
|
8337
|
+
const err58 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7353
8338
|
if (vErrors === null) {
|
|
7354
|
-
vErrors = [
|
|
8339
|
+
vErrors = [err58];
|
|
7355
8340
|
} else {
|
|
7356
|
-
vErrors.push(
|
|
8341
|
+
vErrors.push(err58);
|
|
7357
8342
|
}
|
|
7358
8343
|
errors++;
|
|
7359
8344
|
}
|
|
@@ -7363,7 +8348,7 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7363
8348
|
|
|
7364
8349
|
// src/schema.ts
|
|
7365
8350
|
var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
|
|
7366
|
-
var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span"];
|
|
8351
|
+
var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node"];
|
|
7367
8352
|
var ABSENT = "#/definitions/absent/not";
|
|
7368
8353
|
var ABSENT_KINDS = { regions: "sequence / architecture / state", at: "time", into: "time", color: "time", meters: "time" };
|
|
7369
8354
|
var NOT_ALLOWED = {
|
|
@@ -7374,6 +8359,8 @@ var GIT_EVENT = /\/events\/items\/properties\/type\/not$/u;
|
|
|
7374
8359
|
var GIT_EVENTS = ["commit", "branch"];
|
|
7375
8360
|
var TIME_EVENT = /\/events\/items\/not$/u;
|
|
7376
8361
|
var TIME_EVENTS = ["now", "mark", "span"];
|
|
8362
|
+
var TREE_EVENT = /\/events\/items\/allOf\/0\/not$/u;
|
|
8363
|
+
var TREE_EVENTS = ["leaf", "node"];
|
|
7377
8364
|
var DURATION = /^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u;
|
|
7378
8365
|
var RATIO = /%\)\$$/u;
|
|
7379
8366
|
var escape = (key) => key.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
@@ -7404,6 +8391,7 @@ function toFieldError(error, errors, m) {
|
|
|
7404
8391
|
if (RESERVED_ID.test(error.schemaPath)) return { pointer: at2, message: m.reserved(STATE_ENDS) };
|
|
7405
8392
|
if (GIT_EVENT.test(error.schemaPath)) return { pointer: at2, message: m.kindOnly(GIT_EVENTS, "git") };
|
|
7406
8393
|
if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at2}/type`, message: m.kindOnly(TIME_EVENTS, "time") };
|
|
8394
|
+
if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at2}/type`, message: m.kindOnly(TREE_EVENTS, "tree") };
|
|
7407
8395
|
const last = at2.slice(at2.lastIndexOf("/") + 1);
|
|
7408
8396
|
if (error.schemaPath === ABSENT) return { pointer: at2, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };
|
|
7409
8397
|
const allowed = NOT_ALLOWED[last];
|
|
@@ -7515,7 +8503,7 @@ function plan(step, needle) {
|
|
|
7515
8503
|
return;
|
|
7516
8504
|
}
|
|
7517
8505
|
if (event.type === "now" || needle && pulled(event)) return;
|
|
7518
|
-
if (event.type === "commit" || event.type === "branch") {
|
|
8506
|
+
if (event.type === "commit" || event.type === "branch" || event.type === "leaf" || event.type === "node") {
|
|
7519
8507
|
const a = cursor;
|
|
7520
8508
|
const b = a + MOTION.draw;
|
|
7521
8509
|
out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
|
|
@@ -7741,6 +8729,7 @@ var ICONS = {
|
|
|
7741
8729
|
layers: "M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",
|
|
7742
8730
|
code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
|
|
7743
8731
|
paint: "M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",
|
|
8732
|
+
tree: "M 0 -5 v4 M -6 -1 h12 M -6 -1 v3 M 6 -1 v3 M -9 2 h6 v6 h-6 z M 3 2 h6 v6 h-6 z M -3 -10 h6 v5 h-6 z",
|
|
7744
8733
|
block: "M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"
|
|
7745
8734
|
};
|
|
7746
8735
|
|
|
@@ -7993,12 +8982,12 @@ var easeInOut = (t) => t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
|
|
|
7993
8982
|
function carrier(e, time, ctx) {
|
|
7994
8983
|
const { m } = ctx;
|
|
7995
8984
|
const n = LOOK.carrier.samples;
|
|
7996
|
-
const
|
|
7997
|
-
const length = pathLength(
|
|
8985
|
+
const route2 = e.wait ? [e.wait, ...e.points] : e.points;
|
|
8986
|
+
const length = pathLength(route2);
|
|
7998
8987
|
const { depart: a, arrive: b, start: from, end: gone } = time;
|
|
7999
8988
|
const path2 = [];
|
|
8000
8989
|
for (let k = 0; k <= n; k++) {
|
|
8001
|
-
const [x, y] = along(
|
|
8990
|
+
const [x, y] = along(route2, easeInOut(k / n) * length);
|
|
8002
8991
|
path2.push([a + (b - a) * k / n, x, y]);
|
|
8003
8992
|
}
|
|
8004
8993
|
const first = path2[0];
|
|
@@ -8475,6 +9464,128 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
|
|
|
8475
9464
|
return held;
|
|
8476
9465
|
}
|
|
8477
9466
|
|
|
9467
|
+
// src/render/tree.ts
|
|
9468
|
+
var r14 = (v) => Math.round(v * 100) / 100;
|
|
9469
|
+
function drawTree(layout, diagram, timeline, ctx) {
|
|
9470
|
+
const { m } = ctx;
|
|
9471
|
+
const T = LOOK.tree;
|
|
9472
|
+
const B = LOOK.box;
|
|
9473
|
+
const timeOf = (step, event) => timeline.edges.find((t) => t.step === step && t.event === event);
|
|
9474
|
+
const active = /* @__PURE__ */ new Map();
|
|
9475
|
+
const touched = /* @__PURE__ */ new Map();
|
|
9476
|
+
diagram.steps.forEach((step, s) => {
|
|
9477
|
+
for (const e of step.events) {
|
|
9478
|
+
if (e.type !== "edge") continue;
|
|
9479
|
+
for (const id of [e.from, e.to]) {
|
|
9480
|
+
active.set(id, (active.get(id) ?? /* @__PURE__ */ new Set()).add(s));
|
|
9481
|
+
if (e.carry.kind !== "none" && !touched.has(id)) touched.set(id, s);
|
|
9482
|
+
}
|
|
9483
|
+
}
|
|
9484
|
+
});
|
|
9485
|
+
const carries = (step, event) => {
|
|
9486
|
+
const e = diagram.steps[step]?.events[event];
|
|
9487
|
+
return e?.type === "edge" && e.carry.kind !== "none";
|
|
9488
|
+
};
|
|
9489
|
+
const fadeStep = layout.runs.filter((run) => carries(run.step, run.event)).reduce((s, run) => s === void 0 ? run.step : Math.min(s, run.step), void 0);
|
|
9490
|
+
const fadeAt = fadeStep === void 0 ? void 0 : timeline.steps[fadeStep]?.start;
|
|
9491
|
+
const fadeOf = (id) => {
|
|
9492
|
+
if (fadeStep === void 0 || fadeAt === void 0) return void 0;
|
|
9493
|
+
const t = touched.get(id);
|
|
9494
|
+
if (t !== void 0 && t <= fadeStep) return void 0;
|
|
9495
|
+
const back = t === void 0 ? void 0 : timeline.steps[t]?.start;
|
|
9496
|
+
const frames = [
|
|
9497
|
+
[0, { opacity: 1 }],
|
|
9498
|
+
[fadeAt, { opacity: 1 }, EASE.inOut],
|
|
9499
|
+
[fadeAt + MOTION.fade, { opacity: T.faint }]
|
|
9500
|
+
];
|
|
9501
|
+
if (back !== void 0) frames.push([back, { opacity: T.faint }, EASE.inOut], [back + MOTION.fade, { opacity: 1 }]);
|
|
9502
|
+
frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 }, EASE.inOut], [m.total, { opacity: 1 }]);
|
|
9503
|
+
return m.kf(frames);
|
|
9504
|
+
};
|
|
9505
|
+
const faded = (id, markup, attrs = "") => {
|
|
9506
|
+
const fade = fadeOf(id);
|
|
9507
|
+
return fade ? `<g class="dg-a"${attrs} style="${fade}">${markup}</g>` : attrs === "" ? markup : `<g${attrs}>${markup}</g>`;
|
|
9508
|
+
};
|
|
9509
|
+
const drawnAt = new Map(layout.nodes.map((n) => [n.id, timeOf(n.step, n.event)?.drawn ?? 0]));
|
|
9510
|
+
const links = layout.links.map((l) => {
|
|
9511
|
+
const time = timeOf(l.step, l.event);
|
|
9512
|
+
if (!time) return "";
|
|
9513
|
+
ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
|
|
9514
|
+
const kf = m.kf([
|
|
9515
|
+
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
9516
|
+
[time.start, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
|
|
9517
|
+
[time.start + 0.05, { opacity: 1 }],
|
|
9518
|
+
[time.drawn, { "stroke-dashoffset": 0 }],
|
|
9519
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
|
|
9520
|
+
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
9521
|
+
]);
|
|
9522
|
+
return faded(l.from, `<path class="dg-tree-l dg-a" data-tree-link="${esc(l.from)}" pathLength="1" d="${pathOf(l.points)}" style="${kf}"/>`);
|
|
9523
|
+
}).join("");
|
|
9524
|
+
const ties = layout.nodes.flatMap((n) => {
|
|
9525
|
+
if (!n.card) return [];
|
|
9526
|
+
const at2 = drawnAt.get(n.id) ?? 0;
|
|
9527
|
+
const d = `M ${r14(n.cx)} ${r14(n.y + n.h + LOOK.edge.inset)} V ${r14(n.card.y - LOOK.edge.inset)}`;
|
|
9528
|
+
return [faded(n.id, `<path class="dg-tree-con dg-a" d="${d}" style="${m.vis(at2)}"/>`)];
|
|
9529
|
+
}).join("");
|
|
9530
|
+
const traced = /* @__PURE__ */ new Set();
|
|
9531
|
+
const trails = layout.runs.flatMap((run) => {
|
|
9532
|
+
const e = layout.edges.find((x) => x.step === run.step && x.event === run.event);
|
|
9533
|
+
if (!e || traced.has(run.link)) return [];
|
|
9534
|
+
const carried = timeline.carriers.find((c) => c.step === run.step && c.event === run.event);
|
|
9535
|
+
const time = timeOf(run.step, run.event);
|
|
9536
|
+
const a = carried?.depart ?? time?.start;
|
|
9537
|
+
const b = carried?.arrive ?? time?.drawn;
|
|
9538
|
+
if (a === void 0 || b === void 0) return [];
|
|
9539
|
+
traced.add(run.link);
|
|
9540
|
+
const kf = m.kf([
|
|
9541
|
+
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
9542
|
+
[a, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
|
|
9543
|
+
[a + 0.05, { opacity: 1 }],
|
|
9544
|
+
[b, { "stroke-dashoffset": 0 }],
|
|
9545
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
|
|
9546
|
+
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
9547
|
+
]);
|
|
9548
|
+
const d = pathOf(e.points);
|
|
9549
|
+
return [
|
|
9550
|
+
`<g style="${cs(e.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${esc(run.link)}" pathLength="1" d="${d}" style="${kf}"/><path class="dg-tree-h dg-a" d="${arrowHead(e.points)}" style="${m.vis(b)}"/></g>`
|
|
9551
|
+
];
|
|
9552
|
+
}).join("");
|
|
9553
|
+
const cards = layout.nodes.flatMap((n) => {
|
|
9554
|
+
const c = n.card;
|
|
9555
|
+
if (!c) return [];
|
|
9556
|
+
const gx = c.x + T.card.padX + T.card.icon / 2;
|
|
9557
|
+
const cy = c.y + c.h / 2;
|
|
9558
|
+
const text2 = write(ctx.ink, "dg-tree-ct", c.x + T.card.padX + T.card.icon + T.card.gap, cy + LOOK.baseline.label, c.text, TYPE.treeCard, ALWAYS);
|
|
9559
|
+
return [
|
|
9560
|
+
faded(
|
|
9561
|
+
n.id,
|
|
9562
|
+
`<rect class="dg-tree-card" x="${r14(c.x)}" y="${r14(c.y)}" width="${r14(c.w)}" height="${c.h}" rx="${T.card.radius}"/>${glyph("doc", gx, cy, T.card.glyph, "dg-tree-cg")}${text2}`,
|
|
9563
|
+
` data-tree-card="${esc(n.id)}"`
|
|
9564
|
+
)
|
|
9565
|
+
];
|
|
9566
|
+
}).join("");
|
|
9567
|
+
const nodes = layout.nodes.map((n) => {
|
|
9568
|
+
const at2 = drawnAt.get(n.id) ?? 0;
|
|
9569
|
+
const on = [...active.get(n.id) ?? []].sort((x, y) => x - y);
|
|
9570
|
+
const act = on.length > 0 ? activeKf(ctx, on) : void 0;
|
|
9571
|
+
const radius = n.root ? T.root.radius : T.radius;
|
|
9572
|
+
const rect = (cls, extra = "") => `<rect class="${cls}" x="${r14(n.x)}" y="${r14(n.y)}" width="${r14(n.w)}" height="${n.h}" rx="${radius}"${extra}/>`;
|
|
9573
|
+
const frame = `${act ? `<g class="dg-a" style="${act}">${rect("dg-halo")}</g>` : ""}${rect("dg-st", ` ${ctx.sh}`)}${act ? `<g class="dg-a" style="${act}">${rect("dg-on")}</g>` : ""}`;
|
|
9574
|
+
const ix = n.x + T.root.iconX + B.icon / 2;
|
|
9575
|
+
const mark = n.root ? `<rect class="dg-ic" x="${r14(ix - B.icon / 2)}" y="${r14(n.cy - B.icon / 2)}" width="${B.icon}" height="${B.icon}" rx="${B.iconRadius}"/>${glyph("tree", ix, n.cy, B.iconScale)}` : "";
|
|
9576
|
+
const shown = [[at2, Number.POSITIVE_INFINITY]];
|
|
9577
|
+
const texts = n.lines.map((line, k) => {
|
|
9578
|
+
const style = n.styles[k] ?? TYPE.boxName;
|
|
9579
|
+
const cls = style === TYPE.treeHash ? "dg-tree-hash" : style === TYPE.treeName ? "dg-tree-name" : style === TYPE.rootHash ? "dg-tree-rh" : style === TYPE.rootName ? "dg-tree-rn" : "dg-tree-one";
|
|
9580
|
+
const baseline = n.baselines[k] ?? n.cy;
|
|
9581
|
+
return n.root ? write(ctx.ink, cls, n.x + T.root.textX, baseline, line, style, shown) : write(ctx.ink, cls, n.cx, baseline, line, style, shown, "middle");
|
|
9582
|
+
}).join("");
|
|
9583
|
+
const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${esc(n.id)}"${n.root ? ` data-tree-root="${esc(n.id)}"` : ""}`);
|
|
9584
|
+
return `<g class="dg-popc dg-a" style="${cs(n.color)};${m.pop(at2)}">${inner}</g>`;
|
|
9585
|
+
}).join("");
|
|
9586
|
+
return { links: links + ties, trails, nodes: cards + nodes };
|
|
9587
|
+
}
|
|
9588
|
+
|
|
8478
9589
|
// src/render/motion.ts
|
|
8479
9590
|
var r2 = (v) => Math.round(v * 100) / 100;
|
|
8480
9591
|
var Motion = class {
|
|
@@ -8526,8 +9637,8 @@ var Motion = class {
|
|
|
8526
9637
|
]);
|
|
8527
9638
|
}
|
|
8528
9639
|
/** 少し下から浮いて出る。 */
|
|
8529
|
-
rise(a, b = this.last,
|
|
8530
|
-
return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${LOOK.rise}px)` }, within });
|
|
9640
|
+
rise(a, b = this.last, within2 = false) {
|
|
9641
|
+
return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${LOOK.rise}px)` }, within: within2 });
|
|
8531
9642
|
}
|
|
8532
9643
|
/** 小さな所から弾んで出る。 */
|
|
8533
9644
|
pop(a, b = this.last) {
|
|
@@ -8653,6 +9764,19 @@ var PART_CSS = [
|
|
|
8653
9764
|
`.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,
|
|
8654
9765
|
`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,
|
|
8655
9766
|
`.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,
|
|
9767
|
+
// 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く
|
|
9768
|
+
`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
9769
|
+
`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
9770
|
+
`.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9771
|
+
`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,
|
|
9772
|
+
`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,
|
|
9773
|
+
`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9774
|
+
`.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,
|
|
9775
|
+
`.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,
|
|
9776
|
+
`.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,
|
|
9777
|
+
`.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,
|
|
9778
|
+
`.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,
|
|
9779
|
+
`.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,
|
|
8656
9780
|
// 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする
|
|
8657
9781
|
`.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,
|
|
8658
9782
|
`.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,
|
|
@@ -8814,6 +9938,14 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
8814
9938
|
L.node.push(git.commits);
|
|
8815
9939
|
L.top.push(git.tags);
|
|
8816
9940
|
}
|
|
9941
|
+
const treeLayout = isTreeLayout(layout) ? layout : void 0;
|
|
9942
|
+
if (treeLayout) {
|
|
9943
|
+
const tree = drawTree(treeLayout, diagram, timeline, ctx);
|
|
9944
|
+
L.base.push(tree.links);
|
|
9945
|
+
L.lit.push(tree.trails);
|
|
9946
|
+
L.node.push(tree.nodes);
|
|
9947
|
+
}
|
|
9948
|
+
const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));
|
|
8817
9949
|
const timeLayout = isTimeLayout(layout) ? layout : void 0;
|
|
8818
9950
|
if (timeLayout) {
|
|
8819
9951
|
const drawn = drawTime(timeLayout, diagram, timeline, ctx, subs);
|
|
@@ -8825,7 +9957,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
8825
9957
|
const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));
|
|
8826
9958
|
for (const e of layout.edges) {
|
|
8827
9959
|
const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);
|
|
8828
|
-
if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`)) continue;
|
|
9960
|
+
if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`) || runs.has(`${e.step}/${e.event}`)) continue;
|
|
8829
9961
|
const drawn = edge(e, time, ctx, isState);
|
|
8830
9962
|
L.base.push(drawn.base);
|
|
8831
9963
|
L.lit.push(drawn.lit);
|
|
@@ -8856,7 +9988,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
8856
9988
|
}
|
|
8857
9989
|
for (const time of timeline.carriers) {
|
|
8858
9990
|
const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);
|
|
8859
|
-
if (e) L.top.push(carrier(e, time, ctx));
|
|
9991
|
+
if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));
|
|
8860
9992
|
}
|
|
8861
9993
|
const content = Object.values(L).map((parts) => parts.join("")).join("");
|
|
8862
9994
|
const { near, far, nearY, farY } = LOOK.shadow;
|
|
@@ -8894,6 +10026,15 @@ function focusParts(layout, diagram, step) {
|
|
|
8894
10026
|
rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
|
|
8895
10027
|
}
|
|
8896
10028
|
rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));
|
|
10029
|
+
if (isTreeLayout(layout)) {
|
|
10030
|
+
const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => e.type === "edge" ? [e.from, e.to] : []));
|
|
10031
|
+
rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));
|
|
10032
|
+
for (const l of layout.links.filter((x) => x.step === step)) {
|
|
10033
|
+
const xs = l.points.map((p) => p[0]);
|
|
10034
|
+
const ys = l.points.map((p) => p[1]);
|
|
10035
|
+
rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
|
|
10036
|
+
}
|
|
10037
|
+
}
|
|
8897
10038
|
for (const event of diagram.steps[step]?.events ?? []) {
|
|
8898
10039
|
const ids = event.type === "edge" ? [event.from, event.to] : event.type === "action" || event.type === "swap" ? [event.box] : [];
|
|
8899
10040
|
for (const id of ids) {
|
|
@@ -8966,7 +10107,8 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
|
8966
10107
|
const overview = () => {
|
|
8967
10108
|
const shapes = [
|
|
8968
10109
|
...layout.regions.map((r3) => `<rect class="dg-mm-band" style="${cs(r3.color)}" x="${mx + r3.x * k}" y="${my + r3.y * k}" width="${r3.w * k}" height="${r3.h * k}" rx="3"/>`),
|
|
8969
|
-
...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`)
|
|
10110
|
+
...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`),
|
|
10111
|
+
...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class="dg-mm-card" style="${cs(n.color)}" x="${mx + n.x * k}" y="${my + n.y * k}" width="${n.w * k}" height="${n.h * k}" rx="1.5"/>`)
|
|
8970
10112
|
].join("");
|
|
8971
10113
|
const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));
|
|
8972
10114
|
return {
|
|
@@ -8992,7 +10134,7 @@ function renderDiagram(input, options = {}) {
|
|
|
8992
10134
|
const read2 = readDiagram(input, { lang });
|
|
8993
10135
|
if (!read2.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read2.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
|
|
8994
10136
|
const diagram = read2.diagram;
|
|
8995
|
-
const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : layoutArchitecture(diagram);
|
|
10137
|
+
const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : diagram.kind === "tree" ? layoutTree(diagram) : layoutArchitecture(diagram);
|
|
8996
10138
|
return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);
|
|
8997
10139
|
}
|
|
8998
10140
|
function renderLayout(diagram, layout, timeline, options = {}) {
|
|
@@ -9074,11 +10216,11 @@ async function stage(browser, svg, fontCss, body, lang) {
|
|
|
9074
10216
|
const page = await browser.newPage({ viewport: { width, height }, deviceScaleFactor: SCALE });
|
|
9075
10217
|
const paused = svg.replace(/^<svg\b/, '<svg style="--play:paused;--at:0"');
|
|
9076
10218
|
const html = `<!doctype html><html><head><meta charset="utf-8"><style>${fontCss}html,body{margin:0}body{${body}}svg{display:block}</style><script type="module">import * as mb from "/mediabunny.js";import * as gif from "/gifenc.js";window.__tools={mb,gif};</script></head><body>${paused}</body></html>`;
|
|
9077
|
-
await page.route("http://localhost/**", async (
|
|
9078
|
-
const path2 = new URL(
|
|
9079
|
-
if (path2 === "/") return
|
|
10219
|
+
await page.route("http://localhost/**", async (route2) => {
|
|
10220
|
+
const path2 = new URL(route2.request().url()).pathname;
|
|
10221
|
+
if (path2 === "/") return route2.fulfill({ contentType: "text/html; charset=utf-8", body: html });
|
|
9080
10222
|
const script = SCRIPTS[path2];
|
|
9081
|
-
return script ?
|
|
10223
|
+
return script ? route2.fulfill({ contentType: "text/javascript", body: fs.readFileSync(script) }) : route2.fulfill({ status: 404 });
|
|
9082
10224
|
});
|
|
9083
10225
|
await page.goto("http://localhost/");
|
|
9084
10226
|
await page.waitForFunction(() => "__tools" in window);
|
|
@@ -9253,6 +10395,10 @@ function ranges(list2) {
|
|
|
9253
10395
|
});
|
|
9254
10396
|
}
|
|
9255
10397
|
var hex = (code) => `U+${code.toString(16).toUpperCase()}`;
|
|
10398
|
+
function within(span, char) {
|
|
10399
|
+
const code = char.codePointAt(0) ?? -1;
|
|
10400
|
+
return span.some(([from, to]) => code >= from && code <= to);
|
|
10401
|
+
}
|
|
9256
10402
|
var shapeless = (char) => /^[\s\p{Cf}\p{Cc}]$/u.test(char);
|
|
9257
10403
|
function shapedIn(span) {
|
|
9258
10404
|
for (const [from, to] of span) {
|
|
@@ -9271,12 +10417,9 @@ async function fontFaces(chars) {
|
|
|
9271
10417
|
PACKAGES.flatMap(({ family, name }) => {
|
|
9272
10418
|
const base = path$1.dirname(require_2.resolve(`@fontsource-variable/${name}/unicode.json`));
|
|
9273
10419
|
const table = JSON.parse(fs.readFileSync(path$1.join(base, "unicode.json"), "utf8"));
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
const own = chars.filter((char) =>
|
|
9277
|
-
const code = char.codePointAt(0) ?? -1;
|
|
9278
|
-
return span.some(([from, to]) => code >= from && code <= to);
|
|
9279
|
-
});
|
|
10420
|
+
const spans = Object.entries(table).map(([key, list2]) => ({ key, span: ranges(list2) }));
|
|
10421
|
+
return spans.map(async ({ key, span }, index) => {
|
|
10422
|
+
const own = chars.filter((char) => within(span, char) && !spans.slice(index + 1).some((later) => within(later.span, char)));
|
|
9280
10423
|
if (!own.length) return "";
|
|
9281
10424
|
const filler = own.every(shapeless) ? shapedIn(span) ?? "" : "";
|
|
9282
10425
|
const file = path$1.join(base, "files", `${name}-${key.replace(/[[\]]/g, "")}-wght-normal.woff2`);
|
|
@@ -9419,7 +10562,7 @@ var ja3 = () => {
|
|
|
9419
10562
|
emptyCode: "code \u306E\u5F8C\u308D\u306B\u547D\u4EE4\u3092\u66F8\u304F",
|
|
9420
10563
|
sourceShape: "source \u306F source <\u540D\u524D> [url: <URL>] \u306E\u5F62\u3067\u66F8\u304F",
|
|
9421
10564
|
declarationInStep: "group \u3068 box \u3068 strip \u3068 branch \u3068\u3001scale \u3068 period \u3068 row \u3068 point \u3068 zoom \u306F\u6700\u521D\u306E step \u3088\u308A\u524D\u306B\u66F8\u304F",
|
|
9422
|
-
stepLineBeforeStep: "\u7DDA\u3068 say \u3068 code \u3068 source \u3068 act \u3068 note \u3068 set \u3068 commit \u3068\u679D\u3092\u5207\u308B\u884C\u3068\u3001now \u3068 mark \u3068 span \u306E\u884C\u306F step \u306E\u4E0B\u306B\u66F8\u304F",
|
|
10565
|
+
stepLineBeforeStep: "\u7DDA\u3068 say \u3068 code \u3068 source \u3068 act \u3068 note \u3068 set \u3068 commit \u3068\u679D\u3092\u5207\u308B\u884C\u3068\u3001now \u3068 mark \u3068 span \u3068\u3001leaf \u3068 node \u306E\u884C\u306F step \u306E\u4E0B\u306B\u66F8\u304F",
|
|
9423
10566
|
nestedGroup: "group \u306E\u4E2D\u306B group \u306F\u66F8\u3051\u306A\u3044\u3002\u5148\u306B end \u3067\u9589\u3058\u308B",
|
|
9424
10567
|
strayEnd: "end \u306E\u524D\u306B\u3001\u9589\u3058\u308B group \u304C\u7121\u3044",
|
|
9425
10568
|
endTakesNothing: "end \u306E\u5F8C\u308D\u306B\u306F\u4F55\u3082\u66F8\u304B\u306A\u3044",
|
|
@@ -9467,6 +10610,15 @@ var ja3 = () => {
|
|
|
9467
10610
|
headReserved: (name) => `${name} \u306F\u679D\u5206\u304B\u308C\u306E\u56F3\u3067\u4ECA\u3044\u308B\u5834\u6240\u306E\u672D\u306E\u540D\u524D\u3067\u3001\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044`,
|
|
9468
10611
|
badHash: "hash \u306F 0 \u304B\u3089 9 \u3068 a \u304B\u3089 f \u306E\u5B57\u3067 4 \u304B\u3089 40 \u5B57\u306B\u3059\u308B",
|
|
9469
10612
|
timeOnly: (word) => `${word} \u306F time (\u6642\u9593\u8EF8\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
|
|
10613
|
+
treeOnly: (word) => `${word} \u306E\u884C\u306F tree (\u6728\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
|
|
10614
|
+
treeNoGroup: "tree (\u6728\u306E\u56F3) \u306B\u306F group \u3092\u66F8\u3051\u306A\u3044\u3002\u6728\u306E\u7BB1\u306F leaf \u3068 node \u306E\u884C\u3067\u66F8\u304F",
|
|
10615
|
+
noLeaves: "leaf \u306E\u884C\u3067\u8449\u3092 1 \u3064\u4EE5\u4E0A\u66F8\u304F",
|
|
10616
|
+
leafShape: "leaf \u306F leaf <\u540D\u672D> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
|
|
10617
|
+
nodeShape: "node \u306F node <\u540D\u672D> of <\u5B50>, <\u5B50> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
|
|
10618
|
+
noTreeChild: (id) => `${id} \u3068\u3044\u3046\u8449\u304B\u89AA\u306F\u307E\u3060\u66F8\u3044\u3066\u3044\u306A\u3044\u3002\u5B50\u306F\u524D\u306B leaf \u304B node \u3067\u66F8\u3044\u305F\u540D\u672D\u306B\u3059\u308B`,
|
|
10619
|
+
notTreeBox: (id) => `${id} \u306F box \u306E\u884C\u3067\u7F6E\u3044\u305F\u7BB1\u3067\u3001\u6728\u306E\u7BB1\u3067\u306A\u3044\u3002\u5B50\u306F leaf \u304B node \u3067\u66F8\u3044\u305F\u540D\u672D\u306B\u3059\u308B`,
|
|
10620
|
+
twoParents: (id) => `${id} \u306F\u3082\u3046\u5225\u306E\u89AA\u306E\u5B50\u306B\u306A\u3063\u3066\u3044\u308B\u3002\u6728\u306E\u7BB1\u306E\u89AA\u306F 1 \u3064\u3060\u3051`,
|
|
10621
|
+
manyRoots: (id, root) => `${id} \u304C\u89AA\u3092\u6301\u305F\u306A\u3044\u307E\u307E\u6B8B\u308B\u3002\u6728\u306E\u6839\u306F 1 \u3064\u3060\u3051\u3067\u3001${id} \u3082 ${root} \u3082\u6700\u5F8C\u306B 1 \u3064\u306E\u6839\u3078\u7D44\u3080`,
|
|
9470
10622
|
timeTwice: (word) => `${word} \u306F 1 \u3064\u3060\u3051\u5BA3\u8A00\u3059\u308B`,
|
|
9471
10623
|
noScale: "scale \u306E\u884C\u3067\u76EE\u76DB\u308A\u3092\u5BA3\u8A00\u3059\u308B",
|
|
9472
10624
|
noRows: "row \u306E\u884C\u3067\u5370\u306E\u5217\u3092 1 \u3064\u4EE5\u4E0A\u5BA3\u8A00\u3059\u308B",
|
|
@@ -9532,7 +10684,7 @@ var en2 = () => {
|
|
|
9532
10684
|
emptyCode: "Write the command after code",
|
|
9533
10685
|
sourceShape: "Write a source as source <name> [url: <URL>]",
|
|
9534
10686
|
declarationInStep: "Write group, box, strip, branch, scale, period, row, point and zoom before the first step",
|
|
9535
|
-
stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark and
|
|
10687
|
+
stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark, span, leaf and node under a step",
|
|
9536
10688
|
nestedGroup: "A group cannot hold another group. Close it with end first",
|
|
9537
10689
|
strayEnd: "There is no group for this end to close",
|
|
9538
10690
|
endTakesNothing: "Write nothing after end",
|
|
@@ -9580,6 +10732,15 @@ var en2 = () => {
|
|
|
9580
10732
|
headReserved: (name) => `${name} names where you are in a git diagram and cannot be an id`,
|
|
9581
10733
|
badHash: "Write a hash as 4 to 40 characters of 0-9 and a-f",
|
|
9582
10734
|
timeOnly: (word) => `${word} can be written only in time diagrams`,
|
|
10735
|
+
treeOnly: (word) => `${word} lines can be written only in tree diagrams`,
|
|
10736
|
+
treeNoGroup: "A tree diagram takes no group. Write the tree boxes with leaf and node lines",
|
|
10737
|
+
noLeaves: "Write at least one leaf with a leaf line",
|
|
10738
|
+
leafShape: "Write a leaf as leaf <id> [hash: <hash>]",
|
|
10739
|
+
nodeShape: "Write a node as node <id> of <child>, <child> [hash: <hash>]",
|
|
10740
|
+
noTreeChild: (id) => `No leaf or node named ${id} has been written yet. A child must be an id written earlier with leaf or node`,
|
|
10741
|
+
notTreeBox: (id) => `${id} is a box from a box line, not a tree box. A child must be an id written with leaf or node`,
|
|
10742
|
+
twoParents: (id) => `${id} is already a child of another node. A tree box has only one parent`,
|
|
10743
|
+
manyRoots: (id, root) => `${id} is left without a parent. A tree has one root, so join ${id} and ${root} under one root by the end`,
|
|
9583
10744
|
timeTwice: (word) => `Declare only one ${word}`,
|
|
9584
10745
|
noScale: "Declare the scale with a scale line",
|
|
9585
10746
|
noRows: "Declare at least one row with a row line",
|
|
@@ -9640,6 +10801,8 @@ var ID = /^[^\s[\]「」=:]+$/u;
|
|
|
9640
10801
|
var EDGE = /^([^\s:[\]]+?)\s*->\s*([^\s:[\]]+)/du;
|
|
9641
10802
|
var COMMIT = new RegExp(`^commit\\s+([^\\s[]+)(?:\\s+${ON}\\s+([^\\s[]+))?(?:\\s+${COPY}\\s+([^\\s[]+))?(?:\\s+${MERGE}\\s+([^\\s[]+))?`, "du");
|
|
9642
10803
|
var CUT = new RegExp(`^([^\\s[]+)\\s+${FROM}(?:\\s+([^\\s[]+))?\\s*$`, "du");
|
|
10804
|
+
var LEAF = /^leaf\s+([^\s[]+)/du;
|
|
10805
|
+
var NODE = new RegExp(`^node\\s+([^\\s[]+)\\s+${OF}\\s+`, "du");
|
|
9643
10806
|
var HASH = /^[0-9a-f]{4,40}$/u;
|
|
9644
10807
|
var URL_FORM = /^(\/|https?:\/\/)/u;
|
|
9645
10808
|
var SCALE2 = /^scale\s+(\S+)\s+(\S+)\s+([^\s[]+)/du;
|
|
@@ -9805,6 +10968,9 @@ function parseLines(lines, m) {
|
|
|
9805
10968
|
const isState = kind === "state";
|
|
9806
10969
|
const isGit = kind === "git";
|
|
9807
10970
|
const isTime = kind === "time";
|
|
10971
|
+
const isTree = kind === "tree";
|
|
10972
|
+
const trees = /* @__PURE__ */ new Map();
|
|
10973
|
+
const parents = /* @__PURE__ */ new Map();
|
|
9808
10974
|
let scale;
|
|
9809
10975
|
let period;
|
|
9810
10976
|
const rows = [];
|
|
@@ -9852,6 +11018,7 @@ function parseLines(lines, m) {
|
|
|
9852
11018
|
if (!boxes.some((box) => box.id === id) && !points.some((point) => point.id === id)) throw fail(source, at2, m.undeclaredNote(id));
|
|
9853
11019
|
return id;
|
|
9854
11020
|
}
|
|
11021
|
+
if (isTree && trees.has(id)) return id;
|
|
9855
11022
|
if (!isState || !isOneOf(STATE_ENDS, id)) return boxAt(source, id, at2);
|
|
9856
11023
|
if (id === "start" !== (side2 === "from")) throw fail(source, at2, id === "start" ? m.intoStart : m.outOfFinish);
|
|
9857
11024
|
return id;
|
|
@@ -9902,6 +11069,7 @@ function parseLines(lines, m) {
|
|
|
9902
11069
|
}
|
|
9903
11070
|
if (!isGit && (word === "branch" || word === "commit")) throw fail(source, 0, m.gitOnly(word));
|
|
9904
11071
|
if (!isTime && isOneOf(TIME_HEADS, word)) throw fail(source, 0, m.timeOnly(word));
|
|
11072
|
+
if (!isTree && isOneOf(TREE_HEADS, word)) throw fail(source, 0, m.treeOnly(word));
|
|
9905
11073
|
if (!isOneOf(HEADS, word)) {
|
|
9906
11074
|
const old = oldForm(text2, building !== void 0);
|
|
9907
11075
|
throw fail(source, 0, old ? m.oldForm(old.word, old.shape) : m.unknownHead(word));
|
|
@@ -9992,14 +11160,29 @@ function parseLines(lines, m) {
|
|
|
9992
11160
|
case "span":
|
|
9993
11161
|
inStep(source).events.push(readSpan(source));
|
|
9994
11162
|
break;
|
|
11163
|
+
case "leaf": {
|
|
11164
|
+
const step = inStep(source);
|
|
11165
|
+
step.events.push(readLeaf(source));
|
|
11166
|
+
break;
|
|
11167
|
+
}
|
|
11168
|
+
case "node": {
|
|
11169
|
+
const step = inStep(source);
|
|
11170
|
+
step.events.push(readNode(source));
|
|
11171
|
+
break;
|
|
11172
|
+
}
|
|
9995
11173
|
}
|
|
9996
11174
|
}
|
|
9997
11175
|
if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));
|
|
9998
11176
|
settle();
|
|
9999
11177
|
finish();
|
|
10000
11178
|
if (isGit && branches.length === 0) throw fail(head, 0, m.noBranches);
|
|
10001
|
-
if (
|
|
11179
|
+
if (isTree && trees.size === 0) throw fail(head, 0, m.noLeaves);
|
|
11180
|
+
if (boxes.length === 0 && !isGit && !isTime && !isTree) throw fail(head, 0, m.noBoxes);
|
|
10002
11181
|
if (steps.length === 0) throw fail(head, 0, m.noSteps);
|
|
11182
|
+
const roots = [...trees.keys()].filter((id) => !parents.has(id));
|
|
11183
|
+
const [root, stray] = roots;
|
|
11184
|
+
const strayAt = stray === void 0 ? void 0 : trees.get(stray);
|
|
11185
|
+
if (root !== void 0 && stray !== void 0 && strayAt) throw fail(strayAt.source, strayAt.at, m.manyRoots(stray, root));
|
|
10003
11186
|
return {
|
|
10004
11187
|
version: FORMAT_VERSION,
|
|
10005
11188
|
kind,
|
|
@@ -10180,6 +11363,7 @@ function parseLines(lines, m) {
|
|
|
10180
11363
|
function readGroup(source) {
|
|
10181
11364
|
beforeSteps(source);
|
|
10182
11365
|
if (isGit) throw fail(source, 0, m.gitNoGroup);
|
|
11366
|
+
if (isTree) throw fail(source, 0, m.treeNoGroup);
|
|
10183
11367
|
if (group) throw fail(source, 0, m.nestedGroup);
|
|
10184
11368
|
const declared = readDeclared(source, "group", ATTRS.group, m);
|
|
10185
11369
|
if (regions.some((region) => region.id === declared.id)) {
|
|
@@ -10274,6 +11458,53 @@ function parseLines(lines, m) {
|
|
|
10274
11458
|
tips.set(branch, from);
|
|
10275
11459
|
return { type: "branch", branch, from };
|
|
10276
11460
|
}
|
|
11461
|
+
function readLeaf(source) {
|
|
11462
|
+
const text2 = source.text;
|
|
11463
|
+
const found = LEAF.exec(text2);
|
|
11464
|
+
const id = found?.[1];
|
|
11465
|
+
if (!found || id === void 0) throw fail(source, 0, m.leafShape);
|
|
11466
|
+
const idAt = found.indices?.[1]?.[0] ?? 0;
|
|
11467
|
+
if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
|
|
11468
|
+
declare(source, id, idAt);
|
|
11469
|
+
trees.set(id, { source, at: idAt });
|
|
11470
|
+
const rest2 = skipSpaces(text2, found[0].length);
|
|
11471
|
+
if (rest2 < text2.length && text2[rest2] !== "[") throw fail(source, rest2, m.leafShape);
|
|
11472
|
+
const hash = treeHash(source, rest2, ATTRS.leaf);
|
|
11473
|
+
return { type: "leaf", id, ...hash !== void 0 ? { hash } : {} };
|
|
11474
|
+
}
|
|
11475
|
+
function readNode(source) {
|
|
11476
|
+
const text2 = source.text;
|
|
11477
|
+
const found = NODE.exec(text2);
|
|
11478
|
+
const id = found?.[1];
|
|
11479
|
+
if (!found || id === void 0) throw fail(source, 0, m.nodeShape);
|
|
11480
|
+
const idAt = found.indices?.[1]?.[0] ?? 0;
|
|
11481
|
+
if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
|
|
11482
|
+
declare(source, id, idAt);
|
|
11483
|
+
const children = [];
|
|
11484
|
+
let end = found[0].length;
|
|
11485
|
+
for (; ; ) {
|
|
11486
|
+
const start = skipSpaces(text2, end);
|
|
11487
|
+
end = start;
|
|
11488
|
+
while (end < text2.length && text2[end] !== "," && text2[end] !== "[") end++;
|
|
11489
|
+
const child = text2.slice(start, end).trim();
|
|
11490
|
+
if (child === "" || !ID.test(child)) throw fail(source, start, m.nodeShape);
|
|
11491
|
+
if (!trees.has(child)) throw fail(source, start, ids.has(child) && child !== id ? m.notTreeBox(child) : m.noTreeChild(child));
|
|
11492
|
+
if (parents.has(child)) throw fail(source, start, m.twoParents(child));
|
|
11493
|
+
parents.set(child, id);
|
|
11494
|
+
children.push(child);
|
|
11495
|
+
if (text2[end] !== ",") break;
|
|
11496
|
+
end++;
|
|
11497
|
+
}
|
|
11498
|
+
const hash = treeHash(source, end, ATTRS.node);
|
|
11499
|
+
trees.set(id, { source, at: idAt });
|
|
11500
|
+
return { type: "node", id, children, ...hash !== void 0 ? { hash } : {} };
|
|
11501
|
+
}
|
|
11502
|
+
function treeHash(source, at2, keys2) {
|
|
11503
|
+
if (at2 >= source.text.length) return void 0;
|
|
11504
|
+
const hash = readAttrs(source, at2, keys2, m).get("hash");
|
|
11505
|
+
if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);
|
|
11506
|
+
return hash?.value;
|
|
11507
|
+
}
|
|
10277
11508
|
function readStrip(source) {
|
|
10278
11509
|
beforeSteps(source);
|
|
10279
11510
|
if (strip2) throw fail(source, 0, m.stripTwice);
|