@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.
- package/dist/cli.cjs +90 -99
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +90 -99
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +84 -99
- package/dist/export.cjs.map +1 -1
- package/dist/export.js +84 -99
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +48 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -57
- 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-KVMZIKYF.cjs → time-EXRPI34B.cjs} +84 -84
- package/dist/light/time-EXRPI34B.cjs.map +1 -0
- package/dist/light/{time-O4CMTUV5.js → time-M3EGEFDU.js} +3 -3
- 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/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-KVMZIKYF.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/{time-O4CMTUV5.js.map → time-M3EGEFDU.js.map} +0 -0
- /package/dist/light/{tree-ZJZQI5QT.js.map → tree-MFU54QKY.js.map} +0 -0
package/dist/export.cjs
CHANGED
|
@@ -323,7 +323,11 @@ var LOOK = {
|
|
|
323
323
|
gap: 10,
|
|
324
324
|
/** 図の外周の余白 */
|
|
325
325
|
margin: 14,
|
|
326
|
-
|
|
326
|
+
/**
|
|
327
|
+
* 箱。`iconY` と `nameY` と `subY` は箱の真ん中から絵柄の真ん中と名前と下の字の基準線まで。
|
|
328
|
+
* `nameMid` と `subMid` はアイコンも置き場の枠も持つ箱が無い図の名前と下の字の基準線で、名前を箱の真ん中に置き、下の字を名前から `subY - nameY` と同じ間で置く (#3307、#3309)
|
|
329
|
+
*/
|
|
330
|
+
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 },
|
|
327
331
|
region: { pad: 18, gap: 10, radius: 14, inset: 14, icon: 24, iconRadius: 7, iconScale: 0.68, nameY: 58, line: 16, minH: 108 },
|
|
328
332
|
architecture: { columns: 4, columnGap: 56, maxColumnGap: 160, rowGap: 44, labelRoom: 16 },
|
|
329
333
|
/**
|
|
@@ -1715,6 +1719,48 @@ var en = {
|
|
|
1715
1719
|
};
|
|
1716
1720
|
var FIELD_MESSAGES = { ja, en };
|
|
1717
1721
|
|
|
1722
|
+
// src/render/icons.ts
|
|
1723
|
+
var ICONS = {
|
|
1724
|
+
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",
|
|
1725
|
+
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",
|
|
1726
|
+
on: "M -7 7 L 7 -7 M -1 -7 h8 v8",
|
|
1727
|
+
off: "M -7 -7 L 7 7 M 7 -1 v8 h-8",
|
|
1728
|
+
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",
|
|
1729
|
+
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",
|
|
1730
|
+
exe: "M -5 -8 L 7 0 L -5 8 Z",
|
|
1731
|
+
idx: "M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",
|
|
1732
|
+
sign: "M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",
|
|
1733
|
+
env: "M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",
|
|
1734
|
+
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",
|
|
1735
|
+
check: "M -5 0 l3.5 3.5 l6.5 -7",
|
|
1736
|
+
flag: "M -4 8 V -8 M -4 -7 H 6 L 3.5 -3.5 L 6 0 H -4",
|
|
1737
|
+
x: "M -5 -5 l10 10 M 5 -5 l-10 10",
|
|
1738
|
+
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",
|
|
1739
|
+
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",
|
|
1740
|
+
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",
|
|
1741
|
+
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",
|
|
1742
|
+
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",
|
|
1743
|
+
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",
|
|
1744
|
+
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",
|
|
1745
|
+
bolt: "M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",
|
|
1746
|
+
doc: "M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",
|
|
1747
|
+
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",
|
|
1748
|
+
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",
|
|
1749
|
+
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",
|
|
1750
|
+
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",
|
|
1751
|
+
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",
|
|
1752
|
+
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",
|
|
1753
|
+
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",
|
|
1754
|
+
refresh: "M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",
|
|
1755
|
+
undo: "M -7 -2 h10 a5 5 0 0 1 0 10 h-6 M -3 -6 l-4 4 l4 4",
|
|
1756
|
+
yen: "M -6 -8 l6 7 l6 -7 M 0 -1 v9 M -5 1.5 h10 M -5 5 h10",
|
|
1757
|
+
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",
|
|
1758
|
+
code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
|
|
1759
|
+
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",
|
|
1760
|
+
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",
|
|
1761
|
+
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"
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1718
1764
|
// src/schemas/validate-diagram.js
|
|
1719
1765
|
function ucs2length(str) {
|
|
1720
1766
|
let length = 0;
|
|
@@ -2673,6 +2719,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2673
2719
|
return errors === 0;
|
|
2674
2720
|
}
|
|
2675
2721
|
var schema79 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
|
|
2722
|
+
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"] };
|
|
2676
2723
|
var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
|
|
2677
2724
|
var func3 = ucs2length;
|
|
2678
2725
|
function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
@@ -2788,32 +2835,22 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2788
2835
|
}
|
|
2789
2836
|
if (data.icon !== void 0) {
|
|
2790
2837
|
let data4 = data.icon;
|
|
2791
|
-
if (
|
|
2792
|
-
|
|
2793
|
-
const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
2794
|
-
if (vErrors === null) {
|
|
2795
|
-
vErrors = [err10];
|
|
2796
|
-
} else {
|
|
2797
|
-
vErrors.push(err10);
|
|
2798
|
-
}
|
|
2799
|
-
errors++;
|
|
2800
|
-
}
|
|
2801
|
-
} else {
|
|
2802
|
-
const err11 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2838
|
+
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")) {
|
|
2839
|
+
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" };
|
|
2803
2840
|
if (vErrors === null) {
|
|
2804
|
-
vErrors = [
|
|
2841
|
+
vErrors = [err10];
|
|
2805
2842
|
} else {
|
|
2806
|
-
vErrors.push(
|
|
2843
|
+
vErrors.push(err10);
|
|
2807
2844
|
}
|
|
2808
2845
|
errors++;
|
|
2809
2846
|
}
|
|
2810
2847
|
}
|
|
2811
2848
|
} else {
|
|
2812
|
-
const
|
|
2849
|
+
const err11 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2813
2850
|
if (vErrors === null) {
|
|
2814
|
-
vErrors = [
|
|
2851
|
+
vErrors = [err11];
|
|
2815
2852
|
} else {
|
|
2816
|
-
vErrors.push(
|
|
2853
|
+
vErrors.push(err11);
|
|
2817
2854
|
}
|
|
2818
2855
|
errors++;
|
|
2819
2856
|
}
|
|
@@ -2934,22 +2971,12 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2934
2971
|
}
|
|
2935
2972
|
if (data.icon !== void 0) {
|
|
2936
2973
|
let data4 = data.icon;
|
|
2937
|
-
if (
|
|
2938
|
-
|
|
2939
|
-
const err10 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
2940
|
-
if (vErrors === null) {
|
|
2941
|
-
vErrors = [err10];
|
|
2942
|
-
} else {
|
|
2943
|
-
vErrors.push(err10);
|
|
2944
|
-
}
|
|
2945
|
-
errors++;
|
|
2946
|
-
}
|
|
2947
|
-
} else {
|
|
2948
|
-
const err11 = { instancePath: instancePath + "/icon", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2974
|
+
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")) {
|
|
2975
|
+
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" };
|
|
2949
2976
|
if (vErrors === null) {
|
|
2950
|
-
vErrors = [
|
|
2977
|
+
vErrors = [err10];
|
|
2951
2978
|
} else {
|
|
2952
|
-
vErrors.push(
|
|
2979
|
+
vErrors.push(err10);
|
|
2953
2980
|
}
|
|
2954
2981
|
errors++;
|
|
2955
2982
|
}
|
|
@@ -2958,20 +2985,20 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2958
2985
|
let data5 = data.region;
|
|
2959
2986
|
if (typeof data5 === "string") {
|
|
2960
2987
|
if (!pattern0.test(data5)) {
|
|
2961
|
-
const
|
|
2988
|
+
const err11 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
2962
2989
|
if (vErrors === null) {
|
|
2963
|
-
vErrors = [
|
|
2990
|
+
vErrors = [err11];
|
|
2964
2991
|
} else {
|
|
2965
|
-
vErrors.push(
|
|
2992
|
+
vErrors.push(err11);
|
|
2966
2993
|
}
|
|
2967
2994
|
errors++;
|
|
2968
2995
|
}
|
|
2969
2996
|
} else {
|
|
2970
|
-
const
|
|
2997
|
+
const err12 = { instancePath: instancePath + "/region", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2971
2998
|
if (vErrors === null) {
|
|
2972
|
-
vErrors = [
|
|
2999
|
+
vErrors = [err12];
|
|
2973
3000
|
} else {
|
|
2974
|
-
vErrors.push(
|
|
3001
|
+
vErrors.push(err12);
|
|
2975
3002
|
}
|
|
2976
3003
|
errors++;
|
|
2977
3004
|
}
|
|
@@ -2980,30 +3007,30 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2980
3007
|
let data6 = data.link;
|
|
2981
3008
|
if (typeof data6 === "string") {
|
|
2982
3009
|
if (!pattern3.test(data6)) {
|
|
2983
|
-
const
|
|
3010
|
+
const err13 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/pattern", keyword: "pattern", params: { pattern: "^(/|https?://)" }, message: 'must match pattern "^(/|https?://)"' };
|
|
2984
3011
|
if (vErrors === null) {
|
|
2985
|
-
vErrors = [
|
|
3012
|
+
vErrors = [err13];
|
|
2986
3013
|
} else {
|
|
2987
|
-
vErrors.push(
|
|
3014
|
+
vErrors.push(err13);
|
|
2988
3015
|
}
|
|
2989
3016
|
errors++;
|
|
2990
3017
|
}
|
|
2991
3018
|
} else {
|
|
2992
|
-
const
|
|
3019
|
+
const err14 = { instancePath: instancePath + "/link", schemaPath: "#/definitions/url/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2993
3020
|
if (vErrors === null) {
|
|
2994
|
-
vErrors = [
|
|
3021
|
+
vErrors = [err14];
|
|
2995
3022
|
} else {
|
|
2996
|
-
vErrors.push(
|
|
3023
|
+
vErrors.push(err14);
|
|
2997
3024
|
}
|
|
2998
3025
|
errors++;
|
|
2999
3026
|
}
|
|
3000
3027
|
}
|
|
3001
3028
|
} else {
|
|
3002
|
-
const
|
|
3029
|
+
const err15 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
3003
3030
|
if (vErrors === null) {
|
|
3004
|
-
vErrors = [
|
|
3031
|
+
vErrors = [err15];
|
|
3005
3032
|
} else {
|
|
3006
|
-
vErrors.push(
|
|
3033
|
+
vErrors.push(err15);
|
|
3007
3034
|
}
|
|
3008
3035
|
errors++;
|
|
3009
3036
|
}
|
|
@@ -8055,8 +8082,6 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
8055
8082
|
var STATE_ENDS = ["start", "finish"];
|
|
8056
8083
|
var LANE_MOST = 12;
|
|
8057
8084
|
var HEAD = "HEAD";
|
|
8058
|
-
|
|
8059
|
-
// src/schema.ts
|
|
8060
8085
|
var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node", "line", "seal", "open", "pick", "stamp"];
|
|
8061
8086
|
var ABSENT = "#/definitions/absent/not";
|
|
8062
8087
|
var ABSENT_KINDS = {
|
|
@@ -8430,48 +8455,6 @@ function stateTimes(diagram, edges, last) {
|
|
|
8430
8455
|
return [...times.values()];
|
|
8431
8456
|
}
|
|
8432
8457
|
|
|
8433
|
-
// src/render/icons.ts
|
|
8434
|
-
var ICONS = {
|
|
8435
|
-
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",
|
|
8436
|
-
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",
|
|
8437
|
-
on: "M -7 7 L 7 -7 M -1 -7 h8 v8",
|
|
8438
|
-
off: "M -7 -7 L 7 7 M 7 -1 v8 h-8",
|
|
8439
|
-
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",
|
|
8440
|
-
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",
|
|
8441
|
-
exe: "M -5 -8 L 7 0 L -5 8 Z",
|
|
8442
|
-
idx: "M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",
|
|
8443
|
-
sign: "M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",
|
|
8444
|
-
env: "M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",
|
|
8445
|
-
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",
|
|
8446
|
-
check: "M -5 0 l3.5 3.5 l6.5 -7",
|
|
8447
|
-
flag: "M -4 8 V -8 M -4 -7 H 6 L 3.5 -3.5 L 6 0 H -4",
|
|
8448
|
-
x: "M -5 -5 l10 10 M 5 -5 l-10 10",
|
|
8449
|
-
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",
|
|
8450
|
-
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",
|
|
8451
|
-
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",
|
|
8452
|
-
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",
|
|
8453
|
-
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",
|
|
8454
|
-
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",
|
|
8455
|
-
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",
|
|
8456
|
-
bolt: "M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",
|
|
8457
|
-
doc: "M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",
|
|
8458
|
-
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",
|
|
8459
|
-
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",
|
|
8460
|
-
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",
|
|
8461
|
-
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",
|
|
8462
|
-
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",
|
|
8463
|
-
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",
|
|
8464
|
-
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",
|
|
8465
|
-
refresh: "M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",
|
|
8466
|
-
undo: "M -7 -2 h10 a5 5 0 0 1 0 10 h-6 M -3 -6 l-4 4 l4 4",
|
|
8467
|
-
yen: "M -6 -8 l6 7 l6 -7 M 0 -1 v9 M -5 1.5 h10 M -5 5 h10",
|
|
8468
|
-
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",
|
|
8469
|
-
code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
|
|
8470
|
-
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",
|
|
8471
|
-
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",
|
|
8472
|
-
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"
|
|
8473
|
-
};
|
|
8474
|
-
|
|
8475
8458
|
// src/render/ink.ts
|
|
8476
8459
|
var ALWAYS = [[0, Number.POSITIVE_INFINITY]];
|
|
8477
8460
|
var BITE = 0.5;
|
|
@@ -8503,7 +8486,7 @@ var linkTo = (link, markup) => link === void 0 ? markup : `<a href="${esc(link)}
|
|
|
8503
8486
|
var r1 = (v) => Math.round(v * 100) / 100;
|
|
8504
8487
|
var cs = (k) => k === "coin" ? "--c:var(--coin);--ct:var(--coint)" : `--c:var(--c-${k});--ct:var(--t-${k})`;
|
|
8505
8488
|
function glyph(name, x, y, scale, cls = "dg-gl") {
|
|
8506
|
-
const d = name
|
|
8489
|
+
const d = name !== void 0 && drawsIcon(name) ? ICONS[name] : void 0;
|
|
8507
8490
|
return d ? `<path class="${cls}" transform="translate(${r1(x)} ${r1(y)}) scale(${scale})" d="${d}"/>` : "";
|
|
8508
8491
|
}
|
|
8509
8492
|
function pathOf(points) {
|
|
@@ -8534,6 +8517,8 @@ function arrowHead(points) {
|
|
|
8534
8517
|
const { arrow: a, arrowHalf: h } = LOOK.edge;
|
|
8535
8518
|
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)}`;
|
|
8536
8519
|
}
|
|
8520
|
+
var drawsIcon = (name) => name !== void 0 && Object.hasOwn(ICONS, name);
|
|
8521
|
+
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 };
|
|
8537
8522
|
var sansOf = (t) => ({ ...t, family: "sans" });
|
|
8538
8523
|
function write(ink, cls, x, y, text2, style, shown = ALWAYS, anchor) {
|
|
8539
8524
|
ink?.push({ text: text2, rect: textBox(text2, x, y, style, anchor), shown });
|
|
@@ -8560,7 +8545,7 @@ function band(region, ink) {
|
|
|
8560
8545
|
const { x, y } = region.header;
|
|
8561
8546
|
const lines = region.lines.map((t, k) => write(ink, "dg-bz", x, region.y + nameY + k * line, t, TYPE.regionName)).join("");
|
|
8562
8547
|
const note = region.note ? write(ink, "dg-bx", x, region.y + nameY + region.lines.length * line + 1, region.note, TYPE.regionNote) : "";
|
|
8563
|
-
const mark = region.icon
|
|
8548
|
+
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)}` : "";
|
|
8564
8549
|
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>`;
|
|
8565
8550
|
}
|
|
8566
8551
|
function subLines(box, m, changes, y, ink, right) {
|
|
@@ -8580,18 +8565,18 @@ function cardFrame(box, ctx, act, y, h) {
|
|
|
8580
8565
|
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>` : ""}`;
|
|
8581
8566
|
}
|
|
8582
8567
|
function card(box, ctx, on, changes, lit) {
|
|
8583
|
-
const { icon, iconRadius, iconScale, iconY
|
|
8584
|
-
const subs = subLines(box, ctx.m, changes, box.cy +
|
|
8568
|
+
const { icon, iconRadius, iconScale, iconY } = LOOK.box;
|
|
8569
|
+
const subs = subLines(box, ctx.m, changes, box.cy + ctx.boxText.sub, ctx.ink);
|
|
8585
8570
|
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;
|
|
8586
8571
|
const ix = box.iconX ?? box.cx;
|
|
8587
8572
|
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}"/>` : "";
|
|
8588
8573
|
let mark = "";
|
|
8589
|
-
if (box.icon
|
|
8574
|
+
if (drawsIcon(box.icon)) {
|
|
8590
8575
|
const rect = { x: ix - icon / 2, y: box.cy + iconY - icon / 2, w: icon, h: icon };
|
|
8591
8576
|
ctx.ink.push({ text: `${box.name} \u306E\u7D75\u67C4`, rect, shown: ALWAYS, boxed: true, part: { kind: "icon", box: box.name } });
|
|
8592
8577
|
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)}`;
|
|
8593
8578
|
}
|
|
8594
|
-
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 +
|
|
8579
|
+
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>`;
|
|
8595
8580
|
}
|
|
8596
8581
|
function headCard(box, ctx, on, changes) {
|
|
8597
8582
|
const { pad: pad2, h, nameY, subY } = LOOK.follow.head;
|
|
@@ -8604,7 +8589,7 @@ function ghostCard(box, ink) {
|
|
|
8604
8589
|
const G = LOOK.state.ghost;
|
|
8605
8590
|
const ix = box.x + G.pad + icon / 2;
|
|
8606
8591
|
const tx = box.x + G.pad + icon + G.gap;
|
|
8607
|
-
const mark = box.icon
|
|
8592
|
+
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)}` : "";
|
|
8608
8593
|
const nameY = box.sub ? G.nameY : LOOK.baseline.mark;
|
|
8609
8594
|
const sub = box.sub ? write(ink, "dg-ss", tx, box.cy + G.subY, box.sub, TYPE.boxSub, ALWAYS, "start") : "";
|
|
8610
8595
|
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>`;
|
|
@@ -9201,7 +9186,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
9201
9186
|
const vars = paletteVars(palette, theme);
|
|
9202
9187
|
const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : ""}`);
|
|
9203
9188
|
const m = new Motion(`dg${id}`, timeline.total, timeline.last);
|
|
9204
|
-
const ctx = { m, t: timeline, id, sh: `filter="url(#dg-sh-${id})"`, end: timeline.steps[timeline.steps.length - 1].end, ink, traces };
|
|
9189
|
+
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) };
|
|
9205
9190
|
const on = involved(diagram);
|
|
9206
9191
|
const subs = subChanges(diagram, timeline, layout.kind !== "sequence");
|
|
9207
9192
|
const L = { band: [], base: [], lit: [], node: [], badge: [], top: [] };
|