@cardenelabs/dragon 0.45.3 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +97 -104
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +97 -104
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +91 -104
- package/dist/export.cjs.map +1 -1
- package/dist/export.js +91 -104
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +55 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +55 -62
- package/dist/index.js.map +1 -1
- package/dist/light/chunk-CLS6JVKK.cjs.map +1 -1
- package/dist/light/{chunk-EHTQUCW4.js → chunk-DVGDEPCV.js} +6 -2
- package/dist/light/chunk-DVGDEPCV.js.map +1 -0
- package/dist/light/{chunk-5OQV42W3.cjs → chunk-SUL4AJLI.cjs} +6 -2
- package/dist/light/chunk-SUL4AJLI.cjs.map +1 -0
- package/dist/light/{chunk-JCEKXALJ.cjs → chunk-V34DCH34.cjs} +90 -87
- package/dist/light/chunk-V34DCH34.cjs.map +1 -0
- package/dist/light/{chunk-YEQSLVIN.js → chunk-YO3UBEC3.js} +12 -9
- package/dist/light/chunk-YO3UBEC3.js.map +1 -0
- package/dist/light/{git-K3KAAAWW.cjs → git-WBGFDRBD.cjs} +59 -59
- package/dist/light/git-WBGFDRBD.cjs.map +1 -0
- package/dist/light/{git-GESUYKGR.js → git-WEJL6VAY.js} +3 -3
- package/dist/light/index.cjs +358 -372
- package/dist/light/index.cjs.map +1 -1
- package/dist/light/index.js +43 -57
- package/dist/light/index.js.map +1 -1
- package/dist/light/{lineup-2V2U7HZH.js → lineup-6LN6Z5T2.js} +3 -3
- package/dist/light/{lineup-623J25LU.cjs → lineup-WLGNGTFX.cjs} +40 -40
- package/dist/light/lineup-WLGNGTFX.cjs.map +1 -0
- package/dist/light/{state-T4OTVING.js → state-DFYTMQI7.js} +2 -2
- package/dist/light/{state-OZVCHX7H.cjs → state-JVAH4TSM.cjs} +41 -41
- package/dist/light/state-JVAH4TSM.cjs.map +1 -0
- package/dist/light/{time-PQCPVQOE.cjs → time-EXRPI34B.cjs} +90 -88
- package/dist/light/time-EXRPI34B.cjs.map +1 -0
- package/dist/light/{time-6WEMD4FQ.js → time-M3EGEFDU.js} +10 -8
- package/dist/light/{time-6WEMD4FQ.js.map → time-M3EGEFDU.js.map} +1 -1
- package/dist/light/{tree-6D7KI57H.cjs → tree-DECHTXFU.cjs} +62 -62
- package/dist/light/tree-DECHTXFU.cjs.map +1 -0
- package/dist/light/{tree-ZJZQI5QT.js → tree-MFU54QKY.js} +3 -3
- package/dist/node.cjs +27 -48
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +27 -48
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +3 -3
- package/package.json +1 -1
- package/src/look/values.ts +5 -1
- package/src/messages.ts +4 -1
- package/src/parser.ts +4 -2
- package/src/render/draw.ts +2 -1
- package/src/render/parts.ts +28 -7
- package/src/render/time.ts +13 -6
- package/src/schema.ts +6 -0
- package/src/schemas/diagram.schema.json +3 -2
- package/src/schemas/validate-diagram.js +1 -1
- package/dist/light/chunk-5OQV42W3.cjs.map +0 -1
- package/dist/light/chunk-EHTQUCW4.js.map +0 -1
- package/dist/light/chunk-JCEKXALJ.cjs.map +0 -1
- package/dist/light/chunk-YEQSLVIN.js.map +0 -1
- package/dist/light/git-K3KAAAWW.cjs.map +0 -1
- package/dist/light/lineup-623J25LU.cjs.map +0 -1
- package/dist/light/state-OZVCHX7H.cjs.map +0 -1
- package/dist/light/time-PQCPVQOE.cjs.map +0 -1
- package/dist/light/tree-6D7KI57H.cjs.map +0 -1
- /package/dist/light/{git-GESUYKGR.js.map → git-WEJL6VAY.js.map} +0 -0
- /package/dist/light/{lineup-2V2U7HZH.js.map → lineup-6LN6Z5T2.js.map} +0 -0
- /package/dist/light/{state-T4OTVING.js.map → state-DFYTMQI7.js.map} +0 -0
- /package/dist/light/{tree-ZJZQI5QT.js.map → tree-MFU54QKY.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -321,7 +321,11 @@ var LOOK = {
|
|
|
321
321
|
gap: 10,
|
|
322
322
|
/** 図の外周の余白 */
|
|
323
323
|
margin: 14,
|
|
324
|
-
|
|
324
|
+
/**
|
|
325
|
+
* 箱。`iconY` と `nameY` と `subY` は箱の真ん中から絵柄の真ん中と名前と下の字の基準線まで。
|
|
326
|
+
* `nameMid` と `subMid` はアイコンも置き場の枠も持つ箱が無い図の名前と下の字の基準線で、名前を箱の真ん中に置き、下の字を名前から `subY - nameY` と同じ間で置く (#3307、#3309)
|
|
327
|
+
*/
|
|
328
|
+
box: { h: 72, minW: 92, padX: 12, radius: 12, icon: 24, iconRadius: 7, iconY: -16, iconScale: 0.74, nameY: 12, nameMid: 5, subY: 27, subMid: 20 },
|
|
325
329
|
region: { pad: 18, gap: 10, radius: 14, inset: 14, icon: 24, iconRadius: 7, iconScale: 0.68, nameY: 58, line: 16, minH: 108 },
|
|
326
330
|
architecture: { columns: 4, columnGap: 56, maxColumnGap: 160, rowGap: 44, labelRoom: 16 },
|
|
327
331
|
/**
|
|
@@ -1752,7 +1756,7 @@ var linkTo = (link, markup) => link === void 0 ? markup : `<a href="${esc(link)}
|
|
|
1752
1756
|
var r1 = (v) => Math.round(v * 100) / 100;
|
|
1753
1757
|
var cs = (k) => k === "coin" ? "--c:var(--coin);--ct:var(--coint)" : `--c:var(--c-${k});--ct:var(--t-${k})`;
|
|
1754
1758
|
function glyph(name2, x, y, scale, cls = "dg-gl") {
|
|
1755
|
-
const d = name2
|
|
1759
|
+
const d = name2 !== void 0 && drawsIcon(name2) ? ICONS[name2] : void 0;
|
|
1756
1760
|
return d ? `<path class="${cls}" transform="translate(${r1(x)} ${r1(y)}) scale(${scale})" d="${d}"/>` : "";
|
|
1757
1761
|
}
|
|
1758
1762
|
function iconSvg(name2) {
|
|
@@ -1788,6 +1792,8 @@ function arrowHead(points) {
|
|
|
1788
1792
|
const { arrow: a, arrowHalf: h } = LOOK.edge;
|
|
1789
1793
|
return `M ${r1(ex - dx * a - dy * h)} ${r1(ey - dy * a + dx * h)} L ${r1(ex)} ${r1(ey)} L ${r1(ex - dx * a + dy * h)} ${r1(ey - dy * a - dx * h)}`;
|
|
1790
1794
|
}
|
|
1795
|
+
var drawsIcon = (name2) => name2 !== void 0 && Object.hasOwn(ICONS, name2);
|
|
1796
|
+
var boxTextY = (boxes) => boxes.some((b) => drawsIcon(b.icon) || b.slot !== void 0) ? { name: LOOK.box.nameY, sub: LOOK.box.subY } : { name: LOOK.box.nameMid, sub: LOOK.box.subMid };
|
|
1791
1797
|
var sansOf = (t) => ({ ...t, family: "sans" });
|
|
1792
1798
|
function write(ink, cls, x, y, text2, style, shown2 = ALWAYS, anchor) {
|
|
1793
1799
|
ink?.push({ text: text2, rect: textBox(text2, x, y, style, anchor), shown: shown2 });
|
|
@@ -1814,7 +1820,7 @@ function band(region, ink) {
|
|
|
1814
1820
|
const { x, y } = region.header;
|
|
1815
1821
|
const lines = region.lines.map((t, k) => write(ink, "dg-bz", x, region.y + nameY + k * line2, t, TYPE.regionName)).join("");
|
|
1816
1822
|
const note = region.note ? write(ink, "dg-bx", x, region.y + nameY + region.lines.length * line2 + 1, region.note, TYPE.regionNote) : "";
|
|
1817
|
-
const mark = region.icon
|
|
1823
|
+
const mark = drawsIcon(region.icon) ? `<rect class="dg-bi" x="${r1(x)}" y="${r1(y)}" width="${icon}" height="${icon}" rx="${iconRadius}"/>${glyph(region.icon, x + icon / 2, y + icon / 2, iconScale)}` : "";
|
|
1818
1824
|
return `<g style="${cs(region.color)}"><rect class="dg-band" x="${r1(region.x + 0.5)}" y="${r1(region.y + 0.5)}" width="${r1(region.w - 1)}" height="${r1(region.h - 1)}" rx="${radius}"/>${mark}${lines}${note}</g>`;
|
|
1819
1825
|
}
|
|
1820
1826
|
function subLines(box, m, changes, y, ink, right) {
|
|
@@ -1834,18 +1840,18 @@ function cardFrame(box, ctx, act, y, h) {
|
|
|
1834
1840
|
return `${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>` : ""}`;
|
|
1835
1841
|
}
|
|
1836
1842
|
function card(box, ctx, on, changes, lit) {
|
|
1837
|
-
const { icon, iconRadius, iconScale, iconY
|
|
1838
|
-
const subs = subLines(box, ctx.m, changes, box.cy +
|
|
1843
|
+
const { icon, iconRadius, iconScale, iconY } = LOOK.box;
|
|
1844
|
+
const subs = subLines(box, ctx.m, changes, box.cy + ctx.boxText.sub, ctx.ink);
|
|
1839
1845
|
const act = lit ? lit.length > 0 ? rangeKf(ctx.m, lit.map((s) => [s.start, s.end])) : void 0 : on.length > 0 ? activeKf(ctx, on) : void 0;
|
|
1840
1846
|
const ix = box.iconX ?? box.cx;
|
|
1841
1847
|
const slot = box.slot ? `<rect class="dg-slot" x="${r1(box.slot.x)}" y="${r1(box.slot.y)}" width="${r1(box.slot.w)}" height="${r1(box.slot.h)}" rx="${LOOK.slot.radius}"/>` : "";
|
|
1842
1848
|
let mark = "";
|
|
1843
|
-
if (box.icon
|
|
1849
|
+
if (drawsIcon(box.icon)) {
|
|
1844
1850
|
const rect = { x: ix - icon / 2, y: box.cy + iconY - icon / 2, w: icon, h: icon };
|
|
1845
1851
|
ctx.ink.push({ text: `${box.name} \u306E\u7D75\u67C4`, rect, shown: ALWAYS, boxed: true, part: { kind: "icon", box: box.name } });
|
|
1846
1852
|
mark = `<rect class="dg-ic" x="${r1(rect.x)}" y="${r1(rect.y)}" width="${icon}" height="${icon}" rx="${iconRadius}"/>${glyph(box.icon, ix, box.cy + iconY, iconScale)}`;
|
|
1847
1853
|
}
|
|
1848
|
-
return `<g style="${cs(box.color)}">${cardFrame(box, ctx, act, box.y, box.h)}${slot}${mark}${write(ctx.ink, "dg-sn", box.cx, box.cy +
|
|
1854
|
+
return `<g style="${cs(box.color)}">${cardFrame(box, ctx, act, box.y, box.h)}${slot}${mark}${write(ctx.ink, "dg-sn", box.cx, box.cy + ctx.boxText.name, box.name, TYPE.boxName, ALWAYS, "middle")}${subs}</g>`;
|
|
1849
1855
|
}
|
|
1850
1856
|
function headCard(box, ctx, on, changes) {
|
|
1851
1857
|
const { pad: pad2, h, nameY, subY } = LOOK.follow.head;
|
|
@@ -1858,7 +1864,7 @@ function ghostCard(box, ink) {
|
|
|
1858
1864
|
const G = LOOK.state.ghost;
|
|
1859
1865
|
const ix = box.x + G.pad + icon / 2;
|
|
1860
1866
|
const tx = box.x + G.pad + icon + G.gap;
|
|
1861
|
-
const mark = box.icon
|
|
1867
|
+
const mark = drawsIcon(box.icon) ? `<rect class="dg-ic" x="${r1(ix - icon / 2)}" y="${r1(box.cy - icon / 2)}" width="${icon}" height="${icon}" rx="${iconRadius}"/>${glyph(box.icon, ix, box.cy, iconScale)}` : "";
|
|
1862
1868
|
const nameY = box.sub ? G.nameY : LOOK.baseline.mark;
|
|
1863
1869
|
const sub = box.sub ? write(ink, "dg-ss", tx, box.cy + G.subY, box.sub, TYPE.boxSub, ALWAYS, "start") : "";
|
|
1864
1870
|
return `<g data-ghost="${esc(box.id)}" style="${cs(box.color)}"><rect class="dg-ghost" x="${r1(box.x)}" y="${r1(box.y)}" width="${r1(box.w)}" height="${box.h}" rx="${radius}"/>${mark}${write(ink, "dg-sn", tx, box.cy + nameY, box.name, TYPE.boxName, ALWAYS, "start")}${sub}</g>`;
|
|
@@ -3476,13 +3482,15 @@ function meterField(field2, keys2, ctx) {
|
|
|
3476
3482
|
function timeFocus(layout, timeline, step, parts, vw, vh) {
|
|
3477
3483
|
const span = timeline.steps[step];
|
|
3478
3484
|
const position = valueAt(timeline.needle ?? [], span.end - MOTION.still);
|
|
3479
|
-
const
|
|
3485
|
+
const badge2 = layout.badges.find((b) => b.step === step);
|
|
3486
|
+
const anchored = badge2 && valueAt(timeline.needle ?? [], span.start) === position && !(layout.strip && badge2.y >= layout.strip.y);
|
|
3487
|
+
const ax = anchored ? badge2.x : layout.axis.x + position * layout.axis.unit;
|
|
3480
3488
|
const top = Math.min(...layout.rows.map((r) => r.y));
|
|
3481
3489
|
const bottom = Math.max(...layout.rows.map((r) => r.y + r.h));
|
|
3482
|
-
let held = { x:
|
|
3483
|
-
const
|
|
3484
|
-
const
|
|
3485
|
-
const extra = [...badge2 ? [{ x: badge2.x - LOOK.badge.r, y: badge2.y - LOOK.badge.r, w: LOOK.badge.r * 2, h: LOOK.badge.r * 2 }] : [], ...[...parts].sort((a, b) => near(a) - near(b))];
|
|
3490
|
+
let held = { x: ax - 1, y: top, w: 2, h: bottom - top };
|
|
3491
|
+
const near = (p) => Math.hypot(Math.max(0, p.x - ax, ax - p.x - p.w), Math.max(0, p.y - top, top - p.y - p.h));
|
|
3492
|
+
const changed = layout.points.filter((point) => point.changes.some((change) => change.step === step)).map((point) => ({ x: point.cx - point.r, y: point.cy - point.r, w: point.text.x + point.text.w - point.cx + point.r, h: point.r * 2 }));
|
|
3493
|
+
const extra = [...badge2 ? [{ x: badge2.x - LOOK.badge.r, y: badge2.y - LOOK.badge.r, w: LOOK.badge.r * 2, h: LOOK.badge.r * 2 }] : [], ...[...parts, ...changed].sort((a, b) => near(a) - near(b))];
|
|
3486
3494
|
for (const p of extra) {
|
|
3487
3495
|
const x = Math.min(held.x, p.x);
|
|
3488
3496
|
const y = Math.min(held.y, p.y);
|
|
@@ -4994,6 +5002,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4994
5002
|
return errors === 0;
|
|
4995
5003
|
}
|
|
4996
5004
|
var schema79 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
|
|
5005
|
+
var schema80 = { "enum": ["app", "router", "on", "off", "pool", "db", "exe", "idx", "sign", "env", "lock", "check", "flag", "x", "chain", "net", "user", "server", "key", "shield", "globe", "bolt", "doc", "box", "truck", "card", "cart", "clock", "branch", "cloud", "refresh", "undo", "yen", "layers", "code", "paint", "tree", "block"] };
|
|
4997
5006
|
var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
|
|
4998
5007
|
var func3 = ucs2length;
|
|
4999
5008
|
function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
@@ -5109,32 +5118,22 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5109
5118
|
}
|
|
5110
5119
|
if (data.icon !== void 0) {
|
|
5111
5120
|
let data4 = data.icon;
|
|
5112
|
-
if (
|
|
5113
|
-
|
|
5114
|
-
const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
5115
|
-
if (vErrors === null) {
|
|
5116
|
-
vErrors = [err10];
|
|
5117
|
-
} else {
|
|
5118
|
-
vErrors.push(err10);
|
|
5119
|
-
}
|
|
5120
|
-
errors++;
|
|
5121
|
-
}
|
|
5122
|
-
} else {
|
|
5123
|
-
const err11 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5121
|
+
if (!(data4 === "app" || data4 === "router" || data4 === "on" || data4 === "off" || data4 === "pool" || data4 === "db" || data4 === "exe" || data4 === "idx" || data4 === "sign" || data4 === "env" || data4 === "lock" || data4 === "check" || data4 === "flag" || data4 === "x" || data4 === "chain" || data4 === "net" || data4 === "user" || data4 === "server" || data4 === "key" || data4 === "shield" || data4 === "globe" || data4 === "bolt" || data4 === "doc" || data4 === "box" || data4 === "truck" || data4 === "card" || data4 === "cart" || data4 === "clock" || data4 === "branch" || data4 === "cloud" || data4 === "refresh" || data4 === "undo" || data4 === "yen" || data4 === "layers" || data4 === "code" || data4 === "paint" || data4 === "tree" || data4 === "block")) {
|
|
5122
|
+
const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/icon/enum", keyword: "enum", params: { allowedValues: schema80.enum }, message: "must be equal to one of the allowed values" };
|
|
5124
5123
|
if (vErrors === null) {
|
|
5125
|
-
vErrors = [
|
|
5124
|
+
vErrors = [err10];
|
|
5126
5125
|
} else {
|
|
5127
|
-
vErrors.push(
|
|
5126
|
+
vErrors.push(err10);
|
|
5128
5127
|
}
|
|
5129
5128
|
errors++;
|
|
5130
5129
|
}
|
|
5131
5130
|
}
|
|
5132
5131
|
} else {
|
|
5133
|
-
const
|
|
5132
|
+
const err11 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5134
5133
|
if (vErrors === null) {
|
|
5135
|
-
vErrors = [
|
|
5134
|
+
vErrors = [err11];
|
|
5136
5135
|
} else {
|
|
5137
|
-
vErrors.push(
|
|
5136
|
+
vErrors.push(err11);
|
|
5138
5137
|
}
|
|
5139
5138
|
errors++;
|
|
5140
5139
|
}
|
|
@@ -5255,22 +5254,12 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5255
5254
|
}
|
|
5256
5255
|
if (data.icon !== void 0) {
|
|
5257
5256
|
let data4 = data.icon;
|
|
5258
|
-
if (
|
|
5259
|
-
|
|
5260
|
-
const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
5261
|
-
if (vErrors === null) {
|
|
5262
|
-
vErrors = [err10];
|
|
5263
|
-
} else {
|
|
5264
|
-
vErrors.push(err10);
|
|
5265
|
-
}
|
|
5266
|
-
errors++;
|
|
5267
|
-
}
|
|
5268
|
-
} else {
|
|
5269
|
-
const err11 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5257
|
+
if (!(data4 === "app" || data4 === "router" || data4 === "on" || data4 === "off" || data4 === "pool" || data4 === "db" || data4 === "exe" || data4 === "idx" || data4 === "sign" || data4 === "env" || data4 === "lock" || data4 === "check" || data4 === "flag" || data4 === "x" || data4 === "chain" || data4 === "net" || data4 === "user" || data4 === "server" || data4 === "key" || data4 === "shield" || data4 === "globe" || data4 === "bolt" || data4 === "doc" || data4 === "box" || data4 === "truck" || data4 === "card" || data4 === "cart" || data4 === "clock" || data4 === "branch" || data4 === "cloud" || data4 === "refresh" || data4 === "undo" || data4 === "yen" || data4 === "layers" || data4 === "code" || data4 === "paint" || data4 === "tree" || data4 === "block")) {
|
|
5258
|
+
const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/icon/enum", keyword: "enum", params: { allowedValues: schema80.enum }, message: "must be equal to one of the allowed values" };
|
|
5270
5259
|
if (vErrors === null) {
|
|
5271
|
-
vErrors = [
|
|
5260
|
+
vErrors = [err10];
|
|
5272
5261
|
} else {
|
|
5273
|
-
vErrors.push(
|
|
5262
|
+
vErrors.push(err10);
|
|
5274
5263
|
}
|
|
5275
5264
|
errors++;
|
|
5276
5265
|
}
|
|
@@ -5279,20 +5268,20 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5279
5268
|
let data5 = data.region;
|
|
5280
5269
|
if (typeof data5 === "string") {
|
|
5281
5270
|
if (!pattern0.test(data5)) {
|
|
5282
|
-
const
|
|
5271
|
+
const err11 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
5283
5272
|
if (vErrors === null) {
|
|
5284
|
-
vErrors = [
|
|
5273
|
+
vErrors = [err11];
|
|
5285
5274
|
} else {
|
|
5286
|
-
vErrors.push(
|
|
5275
|
+
vErrors.push(err11);
|
|
5287
5276
|
}
|
|
5288
5277
|
errors++;
|
|
5289
5278
|
}
|
|
5290
5279
|
} else {
|
|
5291
|
-
const
|
|
5280
|
+
const err12 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5292
5281
|
if (vErrors === null) {
|
|
5293
|
-
vErrors = [
|
|
5282
|
+
vErrors = [err12];
|
|
5294
5283
|
} else {
|
|
5295
|
-
vErrors.push(
|
|
5284
|
+
vErrors.push(err12);
|
|
5296
5285
|
}
|
|
5297
5286
|
errors++;
|
|
5298
5287
|
}
|
|
@@ -5301,30 +5290,30 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5301
5290
|
let data6 = data.link;
|
|
5302
5291
|
if (typeof data6 === "string") {
|
|
5303
5292
|
if (!pattern3.test(data6)) {
|
|
5304
|
-
const
|
|
5293
|
+
const err13 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/pattern", keyword: "pattern", params: { pattern: "^(/|https?://)" }, message: 'must match pattern "^(/|https?://)"' };
|
|
5305
5294
|
if (vErrors === null) {
|
|
5306
|
-
vErrors = [
|
|
5295
|
+
vErrors = [err13];
|
|
5307
5296
|
} else {
|
|
5308
|
-
vErrors.push(
|
|
5297
|
+
vErrors.push(err13);
|
|
5309
5298
|
}
|
|
5310
5299
|
errors++;
|
|
5311
5300
|
}
|
|
5312
5301
|
} else {
|
|
5313
|
-
const
|
|
5302
|
+
const err14 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5314
5303
|
if (vErrors === null) {
|
|
5315
|
-
vErrors = [
|
|
5304
|
+
vErrors = [err14];
|
|
5316
5305
|
} else {
|
|
5317
|
-
vErrors.push(
|
|
5306
|
+
vErrors.push(err14);
|
|
5318
5307
|
}
|
|
5319
5308
|
errors++;
|
|
5320
5309
|
}
|
|
5321
5310
|
}
|
|
5322
5311
|
} else {
|
|
5323
|
-
const
|
|
5312
|
+
const err15 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5324
5313
|
if (vErrors === null) {
|
|
5325
|
-
vErrors = [
|
|
5314
|
+
vErrors = [err15];
|
|
5326
5315
|
} else {
|
|
5327
|
-
vErrors.push(
|
|
5316
|
+
vErrors.push(err15);
|
|
5328
5317
|
}
|
|
5329
5318
|
errors++;
|
|
5330
5319
|
}
|
|
@@ -10376,6 +10365,7 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
10376
10365
|
|
|
10377
10366
|
// src/schema.ts
|
|
10378
10367
|
var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
|
|
10368
|
+
var ICON_NAMES = Object.keys(ICONS);
|
|
10379
10369
|
var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node", "line", "seal", "open", "pick", "stamp"];
|
|
10380
10370
|
var ABSENT = "#/definitions/absent/not";
|
|
10381
10371
|
var ABSENT_KINDS = {
|
|
@@ -10552,6 +10542,7 @@ var ja3 = () => {
|
|
|
10552
10542
|
attrTwice: (key2) => `${key2} \u306F 1 \u3064\u306E\u884C\u306B 1 \u3064\u307E\u3067`,
|
|
10553
10543
|
badAttr: (key2, allowed) => `${key2} \u306F\u3053\u306E\u884C\u306B\u66F8\u3051\u306A\u3044\u5C5E\u6027\u3002\u66F8\u3051\u308B\u306E\u306F ${list(allowed)}`,
|
|
10554
10544
|
badColor: `color \u306F ${list(COLORS)} \u306E\u3069\u308C\u304B`,
|
|
10545
|
+
badIcon: `icon \u306F ${list(ICON_NAMES)} \u306E\u3069\u308C\u304B`,
|
|
10555
10546
|
badView: `view \u306F ${list(VIEWS)} \u306E\u3069\u308C\u304B`,
|
|
10556
10547
|
badCarry: `carry \u306F ${list(CARRIES)} \u306E\u3069\u308C\u304B\u3002\u672D\u306F tag: <\u5024> \u3067\u66F8\u304F`,
|
|
10557
10548
|
badSide: `side \u306F ${list(SIDES)} \u306E\u3069\u308C\u304B`,
|
|
@@ -10690,6 +10681,7 @@ var en2 = () => {
|
|
|
10690
10681
|
attrTwice: (key2) => `Write ${key2} only once on a line`,
|
|
10691
10682
|
badAttr: (key2, allowed) => `${key2} cannot be written on this line. Write ${list(allowed)}`,
|
|
10692
10683
|
badColor: `color is one of ${list(COLORS)}`,
|
|
10684
|
+
badIcon: `icon is one of ${list(ICON_NAMES)}`,
|
|
10693
10685
|
badView: `view is one of ${list(VIEWS)}`,
|
|
10694
10686
|
badCarry: `carry is one of ${list(CARRIES)}. Write a tag as tag: <value>`,
|
|
10695
10687
|
badSide: `side is one of ${list(SIDES)}`,
|
|
@@ -10949,12 +10941,13 @@ function readDeclared(source, word, allowed, m) {
|
|
|
10949
10941
|
function lookOf(source, attrs2, m) {
|
|
10950
10942
|
const color = attrs2.get("color");
|
|
10951
10943
|
if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);
|
|
10944
|
+
const icon = attrs2.get("icon");
|
|
10945
|
+
if (icon && !ICON_NAMES.includes(icon.value)) throw fail(source, icon.at, m.badIcon);
|
|
10952
10946
|
const note = attrs2.get("note")?.value;
|
|
10953
|
-
const icon = attrs2.get("icon")?.value;
|
|
10954
10947
|
return {
|
|
10955
10948
|
...note !== void 0 ? { note } : {},
|
|
10956
10949
|
...color ? { color: color.value } : {},
|
|
10957
|
-
...icon
|
|
10950
|
+
...icon ? { icon: icon.value } : {}
|
|
10958
10951
|
};
|
|
10959
10952
|
}
|
|
10960
10953
|
function oldForm(text2, inStep) {
|
|
@@ -13077,7 +13070,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
13077
13070
|
const vars = paletteVars(palette, theme);
|
|
13078
13071
|
const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : ""}`);
|
|
13079
13072
|
const m = new Motion(`dg${id}`, timeline.total, timeline.last);
|
|
13080
|
-
const ctx = { m, t: timeline, id, sh: `filter="url(#dg-sh-${id})"`, end: timeline.steps[timeline.steps.length - 1].end, ink, traces };
|
|
13073
|
+
const ctx = { m, t: timeline, id, sh: `filter="url(#dg-sh-${id})"`, end: timeline.steps[timeline.steps.length - 1].end, ink, traces, boxText: boxTextY(layout.boxes) };
|
|
13081
13074
|
const on = involved(diagram);
|
|
13082
13075
|
const subs = subChanges(diagram, timeline, layout.kind !== "sequence");
|
|
13083
13076
|
const L = { band: [], base: [], lit: [], node: [], badge: [], top: [] };
|