@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/export.js CHANGED
@@ -317,7 +317,11 @@ var LOOK = {
317
317
  gap: 10,
318
318
  /** 図の外周の余白 */
319
319
  margin: 14,
320
- box: { h: 72, minW: 92, padX: 12, radius: 12, icon: 24, iconRadius: 7, iconY: -16, iconScale: 0.74, nameY: 12, subY: 27 },
320
+ /**
321
+ * 箱。`iconY` と `nameY` と `subY` は箱の真ん中から絵柄の真ん中と名前と下の字の基準線まで。
322
+ * `nameMid` と `subMid` はアイコンも置き場の枠も持つ箱が無い図の名前と下の字の基準線で、名前を箱の真ん中に置き、下の字を名前から `subY - nameY` と同じ間で置く (#3307、#3309)
323
+ */
324
+ 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 },
321
325
  region: { pad: 18, gap: 10, radius: 14, inset: 14, icon: 24, iconRadius: 7, iconScale: 0.68, nameY: 58, line: 16, minH: 108 },
322
326
  architecture: { columns: 4, columnGap: 56, maxColumnGap: 160, rowGap: 44, labelRoom: 16 },
323
327
  /**
@@ -1709,6 +1713,48 @@ var en = {
1709
1713
  };
1710
1714
  var FIELD_MESSAGES = { ja, en };
1711
1715
 
1716
+ // src/render/icons.ts
1717
+ var ICONS = {
1718
+ app: "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 h22",
1719
+ router: "M -9 -4 h16 M 3 -8 l4 4 l-4 4 M 9 5 h-16 M -3 1 l-4 4 l4 4",
1720
+ on: "M -7 7 L 7 -7 M -1 -7 h8 v8",
1721
+ off: "M -7 -7 L 7 7 M 7 -1 v8 h-8",
1722
+ pool: "M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",
1723
+ db: "M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",
1724
+ exe: "M -5 -8 L 7 0 L -5 8 Z",
1725
+ idx: "M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",
1726
+ sign: "M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",
1727
+ env: "M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",
1728
+ lock: "M -5.5 -1 h11 v8 h-11 z M -3.5 -1 v-3 a3.5 3.5 0 0 1 7 0 v3",
1729
+ check: "M -5 0 l3.5 3.5 l6.5 -7",
1730
+ flag: "M -4 8 V -8 M -4 -7 H 6 L 3.5 -3.5 L 6 0 H -4",
1731
+ x: "M -5 -5 l10 10 M 5 -5 l-10 10",
1732
+ chain: "M -1.5 4.5 l-2 2 a3.5 3.5 0 0 1 -5 -5 l3 -3 a3.5 3.5 0 0 1 5 0 M 1.5 -4.5 l2 -2 a3.5 3.5 0 0 1 5 5 l-3 3 a3.5 3.5 0 0 1 -5 0 M -2.5 2.5 l5 -5",
1733
+ net: "M -1.3 -4.6 L -5.8 3 M 1.3 -4.6 L 5.8 3 M -4.3 5.5 H 4.3 M -2.2 -7 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M -9.2 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M 4.8 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0",
1734
+ user: "M -4 -4.5 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0 M -8 9 c0 -5 3.6 -7.5 8 -7.5 s8 2.5 8 7.5",
1735
+ server: "M -9 -8 h18 v7 h-18 z M -9 1 h18 v7 h-18 z M -5 -4.5 h0.01 M -5 4.5 h0.01",
1736
+ key: "M -9 0 a3.5 3.5 0 1 0 7 0 a3.5 3.5 0 1 0 -7 0 M -2 0 h10 M 5 0 v3.5 M 8 0 v2.5",
1737
+ shield: "M 0 -9 l8 3 v5 c0 5 -3.5 8 -8 10 c-4.5 -2 -8 -5 -8 -10 v-5 z",
1738
+ globe: "M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M -9 0 h18 M 0 -9 c-4.5 4 -4.5 14 0 18 M 0 -9 c4.5 4 4.5 14 0 18",
1739
+ bolt: "M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",
1740
+ doc: "M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",
1741
+ box: "M -9 -4.5 l9 -4.5 l9 4.5 v9 l-9 4.5 l-9 -4.5 z M -9 -4.5 l9 4.5 l9 -4.5 M 0 0 v9",
1742
+ truck: "M -10 -6 h11 v10 h-11 z M 1 -2 h5 l3.5 3.5 v2.5 h-8.5 M -7.5 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0 M 3 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0",
1743
+ card: "M -9 -6.5 h18 a2 2 0 0 1 2 2 v9 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-9 a2 2 0 0 1 2 -2 z M -11 -2 h22 M -7 3 h5",
1744
+ cart: "M -10 -8 h3 l3 11 h11 l2.5 -8 h-15.5 M -4.5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0 M 5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0",
1745
+ clock: "M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M 0 -5 v5 l3.5 2.5",
1746
+ branch: "M -4 -4.5 v9 M 5 0.5 c0 4 -9 3 -9 6.5 M -6.2 -7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M -6.2 7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M 2.8 -2 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0",
1747
+ cloud: "M -7 6 h13 a4.5 4.5 0 0 0 0.5 -9 a6 6 0 0 0 -11.5 -1 a4.5 4.5 0 0 0 -2 10 z",
1748
+ refresh: "M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",
1749
+ undo: "M -7 -2 h10 a5 5 0 0 1 0 10 h-6 M -3 -6 l-4 4 l4 4",
1750
+ yen: "M -6 -8 l6 7 l6 -7 M 0 -1 v9 M -5 1.5 h10 M -5 5 h10",
1751
+ 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",
1752
+ code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
1753
+ 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",
1754
+ 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",
1755
+ 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"
1756
+ };
1757
+
1712
1758
  // src/schemas/validate-diagram.js
1713
1759
  function ucs2length(str) {
1714
1760
  let length = 0;
@@ -2667,6 +2713,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
2667
2713
  return errors === 0;
2668
2714
  }
2669
2715
  var schema79 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
2716
+ 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"] };
2670
2717
  var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
2671
2718
  var func3 = ucs2length;
2672
2719
  function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
@@ -2782,32 +2829,22 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
2782
2829
  }
2783
2830
  if (data.icon !== void 0) {
2784
2831
  let data4 = data.icon;
2785
- if (typeof data4 === "string") {
2786
- if (func3(data4) < 1) {
2787
- const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2788
- if (vErrors === null) {
2789
- vErrors = [err10];
2790
- } else {
2791
- vErrors.push(err10);
2792
- }
2793
- errors++;
2794
- }
2795
- } else {
2796
- const err11 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2832
+ 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")) {
2833
+ 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" };
2797
2834
  if (vErrors === null) {
2798
- vErrors = [err11];
2835
+ vErrors = [err10];
2799
2836
  } else {
2800
- vErrors.push(err11);
2837
+ vErrors.push(err10);
2801
2838
  }
2802
2839
  errors++;
2803
2840
  }
2804
2841
  }
2805
2842
  } else {
2806
- const err12 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2843
+ const err11 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2807
2844
  if (vErrors === null) {
2808
- vErrors = [err12];
2845
+ vErrors = [err11];
2809
2846
  } else {
2810
- vErrors.push(err12);
2847
+ vErrors.push(err11);
2811
2848
  }
2812
2849
  errors++;
2813
2850
  }
@@ -2928,22 +2965,12 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
2928
2965
  }
2929
2966
  if (data.icon !== void 0) {
2930
2967
  let data4 = data.icon;
2931
- if (typeof data4 === "string") {
2932
- if (func3(data4) < 1) {
2933
- const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
2934
- if (vErrors === null) {
2935
- vErrors = [err10];
2936
- } else {
2937
- vErrors.push(err10);
2938
- }
2939
- errors++;
2940
- }
2941
- } else {
2942
- const err11 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2968
+ 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")) {
2969
+ 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" };
2943
2970
  if (vErrors === null) {
2944
- vErrors = [err11];
2971
+ vErrors = [err10];
2945
2972
  } else {
2946
- vErrors.push(err11);
2973
+ vErrors.push(err10);
2947
2974
  }
2948
2975
  errors++;
2949
2976
  }
@@ -2952,20 +2979,20 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
2952
2979
  let data5 = data.region;
2953
2980
  if (typeof data5 === "string") {
2954
2981
  if (!pattern0.test(data5)) {
2955
- const err12 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
2982
+ const err11 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
2956
2983
  if (vErrors === null) {
2957
- vErrors = [err12];
2984
+ vErrors = [err11];
2958
2985
  } else {
2959
- vErrors.push(err12);
2986
+ vErrors.push(err11);
2960
2987
  }
2961
2988
  errors++;
2962
2989
  }
2963
2990
  } else {
2964
- const err13 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2991
+ const err12 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2965
2992
  if (vErrors === null) {
2966
- vErrors = [err13];
2993
+ vErrors = [err12];
2967
2994
  } else {
2968
- vErrors.push(err13);
2995
+ vErrors.push(err12);
2969
2996
  }
2970
2997
  errors++;
2971
2998
  }
@@ -2974,30 +3001,30 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
2974
3001
  let data6 = data.link;
2975
3002
  if (typeof data6 === "string") {
2976
3003
  if (!pattern3.test(data6)) {
2977
- const err14 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/pattern", keyword: "pattern", params: { pattern: "^(/|https?://)" }, message: 'must match pattern "^(/|https?://)"' };
3004
+ const err13 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/pattern", keyword: "pattern", params: { pattern: "^(/|https?://)" }, message: 'must match pattern "^(/|https?://)"' };
2978
3005
  if (vErrors === null) {
2979
- vErrors = [err14];
3006
+ vErrors = [err13];
2980
3007
  } else {
2981
- vErrors.push(err14);
3008
+ vErrors.push(err13);
2982
3009
  }
2983
3010
  errors++;
2984
3011
  }
2985
3012
  } else {
2986
- const err15 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/type", keyword: "type", params: { type: "string" }, message: "must be string" };
3013
+ const err14 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2987
3014
  if (vErrors === null) {
2988
- vErrors = [err15];
3015
+ vErrors = [err14];
2989
3016
  } else {
2990
- vErrors.push(err15);
3017
+ vErrors.push(err14);
2991
3018
  }
2992
3019
  errors++;
2993
3020
  }
2994
3021
  }
2995
3022
  } else {
2996
- const err16 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
3023
+ const err15 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
2997
3024
  if (vErrors === null) {
2998
- vErrors = [err16];
3025
+ vErrors = [err15];
2999
3026
  } else {
3000
- vErrors.push(err16);
3027
+ vErrors.push(err15);
3001
3028
  }
3002
3029
  errors++;
3003
3030
  }
@@ -8049,8 +8076,6 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
8049
8076
  var STATE_ENDS = ["start", "finish"];
8050
8077
  var LANE_MOST = 12;
8051
8078
  var HEAD = "HEAD";
8052
-
8053
- // src/schema.ts
8054
8079
  var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node", "line", "seal", "open", "pick", "stamp"];
8055
8080
  var ABSENT = "#/definitions/absent/not";
8056
8081
  var ABSENT_KINDS = {
@@ -8424,48 +8449,6 @@ function stateTimes(diagram, edges, last) {
8424
8449
  return [...times.values()];
8425
8450
  }
8426
8451
 
8427
- // src/render/icons.ts
8428
- var ICONS = {
8429
- app: "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 h22",
8430
- router: "M -9 -4 h16 M 3 -8 l4 4 l-4 4 M 9 5 h-16 M -3 1 l-4 4 l4 4",
8431
- on: "M -7 7 L 7 -7 M -1 -7 h8 v8",
8432
- off: "M -7 -7 L 7 7 M 7 -1 v8 h-8",
8433
- pool: "M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",
8434
- db: "M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",
8435
- exe: "M -5 -8 L 7 0 L -5 8 Z",
8436
- idx: "M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",
8437
- sign: "M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",
8438
- env: "M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",
8439
- lock: "M -5.5 -1 h11 v8 h-11 z M -3.5 -1 v-3 a3.5 3.5 0 0 1 7 0 v3",
8440
- check: "M -5 0 l3.5 3.5 l6.5 -7",
8441
- flag: "M -4 8 V -8 M -4 -7 H 6 L 3.5 -3.5 L 6 0 H -4",
8442
- x: "M -5 -5 l10 10 M 5 -5 l-10 10",
8443
- chain: "M -1.5 4.5 l-2 2 a3.5 3.5 0 0 1 -5 -5 l3 -3 a3.5 3.5 0 0 1 5 0 M 1.5 -4.5 l2 -2 a3.5 3.5 0 0 1 5 5 l-3 3 a3.5 3.5 0 0 1 -5 0 M -2.5 2.5 l5 -5",
8444
- net: "M -1.3 -4.6 L -5.8 3 M 1.3 -4.6 L 5.8 3 M -4.3 5.5 H 4.3 M -2.2 -7 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M -9.2 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M 4.8 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0",
8445
- user: "M -4 -4.5 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0 M -8 9 c0 -5 3.6 -7.5 8 -7.5 s8 2.5 8 7.5",
8446
- server: "M -9 -8 h18 v7 h-18 z M -9 1 h18 v7 h-18 z M -5 -4.5 h0.01 M -5 4.5 h0.01",
8447
- key: "M -9 0 a3.5 3.5 0 1 0 7 0 a3.5 3.5 0 1 0 -7 0 M -2 0 h10 M 5 0 v3.5 M 8 0 v2.5",
8448
- shield: "M 0 -9 l8 3 v5 c0 5 -3.5 8 -8 10 c-4.5 -2 -8 -5 -8 -10 v-5 z",
8449
- globe: "M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M -9 0 h18 M 0 -9 c-4.5 4 -4.5 14 0 18 M 0 -9 c4.5 4 4.5 14 0 18",
8450
- bolt: "M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",
8451
- doc: "M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",
8452
- box: "M -9 -4.5 l9 -4.5 l9 4.5 v9 l-9 4.5 l-9 -4.5 z M -9 -4.5 l9 4.5 l9 -4.5 M 0 0 v9",
8453
- truck: "M -10 -6 h11 v10 h-11 z M 1 -2 h5 l3.5 3.5 v2.5 h-8.5 M -7.5 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0 M 3 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0",
8454
- card: "M -9 -6.5 h18 a2 2 0 0 1 2 2 v9 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-9 a2 2 0 0 1 2 -2 z M -11 -2 h22 M -7 3 h5",
8455
- cart: "M -10 -8 h3 l3 11 h11 l2.5 -8 h-15.5 M -4.5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0 M 5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0",
8456
- clock: "M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M 0 -5 v5 l3.5 2.5",
8457
- branch: "M -4 -4.5 v9 M 5 0.5 c0 4 -9 3 -9 6.5 M -6.2 -7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M -6.2 7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M 2.8 -2 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0",
8458
- cloud: "M -7 6 h13 a4.5 4.5 0 0 0 0.5 -9 a6 6 0 0 0 -11.5 -1 a4.5 4.5 0 0 0 -2 10 z",
8459
- refresh: "M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",
8460
- undo: "M -7 -2 h10 a5 5 0 0 1 0 10 h-6 M -3 -6 l-4 4 l4 4",
8461
- yen: "M -6 -8 l6 7 l6 -7 M 0 -1 v9 M -5 1.5 h10 M -5 5 h10",
8462
- 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",
8463
- code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
8464
- 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",
8465
- 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",
8466
- 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"
8467
- };
8468
-
8469
8452
  // src/render/ink.ts
8470
8453
  var ALWAYS = [[0, Number.POSITIVE_INFINITY]];
8471
8454
  var BITE = 0.5;
@@ -8497,7 +8480,7 @@ var linkTo = (link, markup) => link === void 0 ? markup : `<a href="${esc(link)}
8497
8480
  var r1 = (v) => Math.round(v * 100) / 100;
8498
8481
  var cs = (k) => k === "coin" ? "--c:var(--coin);--ct:var(--coint)" : `--c:var(--c-${k});--ct:var(--t-${k})`;
8499
8482
  function glyph(name, x, y, scale, cls = "dg-gl") {
8500
- const d = name === void 0 ? void 0 : ICONS[name];
8483
+ const d = name !== void 0 && drawsIcon(name) ? ICONS[name] : void 0;
8501
8484
  return d ? `<path class="${cls}" transform="translate(${r1(x)} ${r1(y)}) scale(${scale})" d="${d}"/>` : "";
8502
8485
  }
8503
8486
  function pathOf(points) {
@@ -8528,6 +8511,8 @@ function arrowHead(points) {
8528
8511
  const { arrow: a, arrowHalf: h } = LOOK.edge;
8529
8512
  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)}`;
8530
8513
  }
8514
+ var drawsIcon = (name) => name !== void 0 && Object.hasOwn(ICONS, name);
8515
+ 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 };
8531
8516
  var sansOf = (t) => ({ ...t, family: "sans" });
8532
8517
  function write(ink, cls, x, y, text2, style, shown = ALWAYS, anchor) {
8533
8518
  ink?.push({ text: text2, rect: textBox(text2, x, y, style, anchor), shown });
@@ -8554,7 +8539,7 @@ function band(region, ink) {
8554
8539
  const { x, y } = region.header;
8555
8540
  const lines = region.lines.map((t, k) => write(ink, "dg-bz", x, region.y + nameY + k * line, t, TYPE.regionName)).join("");
8556
8541
  const note = region.note ? write(ink, "dg-bx", x, region.y + nameY + region.lines.length * line + 1, region.note, TYPE.regionNote) : "";
8557
- 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)}` : "";
8542
+ 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)}` : "";
8558
8543
  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>`;
8559
8544
  }
8560
8545
  function subLines(box, m, changes, y, ink, right) {
@@ -8574,18 +8559,18 @@ function cardFrame(box, ctx, act, y, h) {
8574
8559
  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>` : ""}`;
8575
8560
  }
8576
8561
  function card(box, ctx, on, changes, lit) {
8577
- const { icon, iconRadius, iconScale, iconY, nameY, subY } = LOOK.box;
8578
- const subs = subLines(box, ctx.m, changes, box.cy + subY, ctx.ink);
8562
+ const { icon, iconRadius, iconScale, iconY } = LOOK.box;
8563
+ const subs = subLines(box, ctx.m, changes, box.cy + ctx.boxText.sub, ctx.ink);
8579
8564
  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;
8580
8565
  const ix = box.iconX ?? box.cx;
8581
8566
  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}"/>` : "";
8582
8567
  let mark = "";
8583
- if (box.icon && ICONS[box.icon]) {
8568
+ if (drawsIcon(box.icon)) {
8584
8569
  const rect = { x: ix - icon / 2, y: box.cy + iconY - icon / 2, w: icon, h: icon };
8585
8570
  ctx.ink.push({ text: `${box.name} \u306E\u7D75\u67C4`, rect, shown: ALWAYS, boxed: true, part: { kind: "icon", box: box.name } });
8586
8571
  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)}`;
8587
8572
  }
8588
- 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>`;
8573
+ 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>`;
8589
8574
  }
8590
8575
  function headCard(box, ctx, on, changes) {
8591
8576
  const { pad: pad2, h, nameY, subY } = LOOK.follow.head;
@@ -8598,7 +8583,7 @@ function ghostCard(box, ink) {
8598
8583
  const G = LOOK.state.ghost;
8599
8584
  const ix = box.x + G.pad + icon / 2;
8600
8585
  const tx = box.x + G.pad + icon + G.gap;
8601
- 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)}` : "";
8586
+ 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)}` : "";
8602
8587
  const nameY = box.sub ? G.nameY : LOOK.baseline.mark;
8603
8588
  const sub = box.sub ? write(ink, "dg-ss", tx, box.cy + G.subY, box.sub, TYPE.boxSub, ALWAYS, "start") : "";
8604
8589
  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>`;
@@ -9195,7 +9180,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
9195
9180
  const vars = paletteVars(palette, theme);
9196
9181
  const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : ""}`);
9197
9182
  const m = new Motion(`dg${id}`, timeline.total, timeline.last);
9198
- const ctx = { m, t: timeline, id, sh: `filter="url(#dg-sh-${id})"`, end: timeline.steps[timeline.steps.length - 1].end, ink, traces };
9183
+ 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) };
9199
9184
  const on = involved(diagram);
9200
9185
  const subs = subChanges(diagram, timeline, layout.kind !== "sequence");
9201
9186
  const L = { band: [], base: [], lit: [], node: [], badge: [], top: [] };