@cardenelabs/dragon 0.45.5 → 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 (68) hide show
  1. package/dist/cli.cjs +90 -99
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/cli.js +90 -99
  4. package/dist/cli.js.map +1 -1
  5. package/dist/export.cjs +84 -99
  6. package/dist/export.cjs.map +1 -1
  7. package/dist/export.js +84 -99
  8. package/dist/export.js.map +1 -1
  9. package/dist/index.cjs +48 -57
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +48 -57
  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-KVMZIKYF.cjs → time-EXRPI34B.cjs} +84 -84
  36. package/dist/light/time-EXRPI34B.cjs.map +1 -0
  37. package/dist/light/{time-O4CMTUV5.js → time-M3EGEFDU.js} +3 -3
  38. package/dist/light/{tree-6D7KI57H.cjs → tree-DECHTXFU.cjs} +62 -62
  39. package/dist/light/tree-DECHTXFU.cjs.map +1 -0
  40. package/dist/light/{tree-ZJZQI5QT.js → tree-MFU54QKY.js} +3 -3
  41. package/dist/node.cjs +27 -48
  42. package/dist/node.cjs.map +1 -1
  43. package/dist/node.js +27 -48
  44. package/dist/node.js.map +1 -1
  45. package/dist/player.global.js +3 -3
  46. package/package.json +1 -1
  47. package/src/look/values.ts +5 -1
  48. package/src/messages.ts +4 -1
  49. package/src/parser.ts +4 -2
  50. package/src/render/draw.ts +2 -1
  51. package/src/render/parts.ts +28 -7
  52. package/src/schema.ts +6 -0
  53. package/src/schemas/diagram.schema.json +3 -2
  54. package/src/schemas/validate-diagram.js +1 -1
  55. package/dist/light/chunk-5OQV42W3.cjs.map +0 -1
  56. package/dist/light/chunk-EHTQUCW4.js.map +0 -1
  57. package/dist/light/chunk-JCEKXALJ.cjs.map +0 -1
  58. package/dist/light/chunk-YEQSLVIN.js.map +0 -1
  59. package/dist/light/git-K3KAAAWW.cjs.map +0 -1
  60. package/dist/light/lineup-623J25LU.cjs.map +0 -1
  61. package/dist/light/state-OZVCHX7H.cjs.map +0 -1
  62. package/dist/light/time-KVMZIKYF.cjs.map +0 -1
  63. package/dist/light/tree-6D7KI57H.cjs.map +0 -1
  64. /package/dist/light/{git-GESUYKGR.js.map → git-WEJL6VAY.js.map} +0 -0
  65. /package/dist/light/{lineup-2V2U7HZH.js.map → lineup-6LN6Z5T2.js.map} +0 -0
  66. /package/dist/light/{state-T4OTVING.js.map → state-DFYTMQI7.js.map} +0 -0
  67. /package/dist/light/{time-O4CMTUV5.js.map → time-M3EGEFDU.js.map} +0 -0
  68. /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>`;
@@ -4994,6 +5000,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
4994
5000
  return errors === 0;
4995
5001
  }
4996
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"] };
4997
5004
  var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
4998
5005
  var func3 = ucs2length;
4999
5006
  function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
@@ -5109,32 +5116,22 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5109
5116
  }
5110
5117
  if (data.icon !== void 0) {
5111
5118
  let data4 = data.icon;
5112
- if (typeof data4 === "string") {
5113
- if (func3(data4) < 1) {
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" };
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" };
5124
5121
  if (vErrors === null) {
5125
- vErrors = [err11];
5122
+ vErrors = [err10];
5126
5123
  } else {
5127
- vErrors.push(err11);
5124
+ vErrors.push(err10);
5128
5125
  }
5129
5126
  errors++;
5130
5127
  }
5131
5128
  }
5132
5129
  } else {
5133
- 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" };
5134
5131
  if (vErrors === null) {
5135
- vErrors = [err12];
5132
+ vErrors = [err11];
5136
5133
  } else {
5137
- vErrors.push(err12);
5134
+ vErrors.push(err11);
5138
5135
  }
5139
5136
  errors++;
5140
5137
  }
@@ -5255,22 +5252,12 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
5255
5252
  }
5256
5253
  if (data.icon !== void 0) {
5257
5254
  let data4 = data.icon;
5258
- if (typeof data4 === "string") {
5259
- if (func3(data4) < 1) {
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" };
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" };
5270
5257
  if (vErrors === null) {
5271
- vErrors = [err11];
5258
+ vErrors = [err10];
5272
5259
  } else {
5273
- vErrors.push(err11);
5260
+ vErrors.push(err10);
5274
5261
  }
5275
5262
  errors++;
5276
5263
  }
@@ -5279,20 +5266,20 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
5279
5266
  let data5 = data.region;
5280
5267
  if (typeof data5 === "string") {
5281
5268
  if (!pattern0.test(data5)) {
5282
- 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=:]+$"' };
5283
5270
  if (vErrors === null) {
5284
- vErrors = [err12];
5271
+ vErrors = [err11];
5285
5272
  } else {
5286
- vErrors.push(err12);
5273
+ vErrors.push(err11);
5287
5274
  }
5288
5275
  errors++;
5289
5276
  }
5290
5277
  } else {
5291
- 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" };
5292
5279
  if (vErrors === null) {
5293
- vErrors = [err13];
5280
+ vErrors = [err12];
5294
5281
  } else {
5295
- vErrors.push(err13);
5282
+ vErrors.push(err12);
5296
5283
  }
5297
5284
  errors++;
5298
5285
  }
@@ -5301,30 +5288,30 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
5301
5288
  let data6 = data.link;
5302
5289
  if (typeof data6 === "string") {
5303
5290
  if (!pattern3.test(data6)) {
5304
- 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?://)"' };
5305
5292
  if (vErrors === null) {
5306
- vErrors = [err14];
5293
+ vErrors = [err13];
5307
5294
  } else {
5308
- vErrors.push(err14);
5295
+ vErrors.push(err13);
5309
5296
  }
5310
5297
  errors++;
5311
5298
  }
5312
5299
  } else {
5313
- 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" };
5314
5301
  if (vErrors === null) {
5315
- vErrors = [err15];
5302
+ vErrors = [err14];
5316
5303
  } else {
5317
- vErrors.push(err15);
5304
+ vErrors.push(err14);
5318
5305
  }
5319
5306
  errors++;
5320
5307
  }
5321
5308
  }
5322
5309
  } else {
5323
- 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" };
5324
5311
  if (vErrors === null) {
5325
- vErrors = [err16];
5312
+ vErrors = [err15];
5326
5313
  } else {
5327
- vErrors.push(err16);
5314
+ vErrors.push(err15);
5328
5315
  }
5329
5316
  errors++;
5330
5317
  }
@@ -10376,6 +10363,7 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
10376
10363
 
10377
10364
  // src/schema.ts
10378
10365
  var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
10366
+ var ICON_NAMES = Object.keys(ICONS);
10379
10367
  var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node", "line", "seal", "open", "pick", "stamp"];
10380
10368
  var ABSENT = "#/definitions/absent/not";
10381
10369
  var ABSENT_KINDS = {
@@ -10552,6 +10540,7 @@ var ja3 = () => {
10552
10540
  attrTwice: (key2) => `${key2} \u306F 1 \u3064\u306E\u884C\u306B 1 \u3064\u307E\u3067`,
10553
10541
  badAttr: (key2, allowed) => `${key2} \u306F\u3053\u306E\u884C\u306B\u66F8\u3051\u306A\u3044\u5C5E\u6027\u3002\u66F8\u3051\u308B\u306E\u306F ${list(allowed)}`,
10554
10542
  badColor: `color \u306F ${list(COLORS)} \u306E\u3069\u308C\u304B`,
10543
+ badIcon: `icon \u306F ${list(ICON_NAMES)} \u306E\u3069\u308C\u304B`,
10555
10544
  badView: `view \u306F ${list(VIEWS)} \u306E\u3069\u308C\u304B`,
10556
10545
  badCarry: `carry \u306F ${list(CARRIES)} \u306E\u3069\u308C\u304B\u3002\u672D\u306F tag: <\u5024> \u3067\u66F8\u304F`,
10557
10546
  badSide: `side \u306F ${list(SIDES)} \u306E\u3069\u308C\u304B`,
@@ -10690,6 +10679,7 @@ var en2 = () => {
10690
10679
  attrTwice: (key2) => `Write ${key2} only once on a line`,
10691
10680
  badAttr: (key2, allowed) => `${key2} cannot be written on this line. Write ${list(allowed)}`,
10692
10681
  badColor: `color is one of ${list(COLORS)}`,
10682
+ badIcon: `icon is one of ${list(ICON_NAMES)}`,
10693
10683
  badView: `view is one of ${list(VIEWS)}`,
10694
10684
  badCarry: `carry is one of ${list(CARRIES)}. Write a tag as tag: <value>`,
10695
10685
  badSide: `side is one of ${list(SIDES)}`,
@@ -10949,12 +10939,13 @@ function readDeclared(source, word, allowed, m) {
10949
10939
  function lookOf(source, attrs2, m) {
10950
10940
  const color = attrs2.get("color");
10951
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);
10952
10944
  const note = attrs2.get("note")?.value;
10953
- const icon = attrs2.get("icon")?.value;
10954
10945
  return {
10955
10946
  ...note !== void 0 ? { note } : {},
10956
10947
  ...color ? { color: color.value } : {},
10957
- ...icon !== void 0 ? { icon } : {}
10948
+ ...icon ? { icon: icon.value } : {}
10958
10949
  };
10959
10950
  }
10960
10951
  function oldForm(text2, inStep) {
@@ -13077,7 +13068,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
13077
13068
  const vars = paletteVars(palette, theme);
13078
13069
  const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : ""}`);
13079
13070
  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 };
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) };
13081
13072
  const on = involved(diagram);
13082
13073
  const subs = subChanges(diagram, timeline, layout.kind !== "sequence");
13083
13074
  const L = { band: [], base: [], lit: [], node: [], badge: [], top: [] };