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