@cardenelabs/dragon 0.39.0 → 0.40.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/README.md +37 -1
- package/dist/cli.cjs +1921 -429
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1926 -434
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +1718 -353
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +1723 -358
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +1835 -334
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1835 -334
- package/dist/index.js.map +1 -1
- package/dist/{ink-Cg-v6XSG.d.cts → ink-B_7OXxtb.d.cts} +27 -2
- package/dist/{ink-Cg-v6XSG.d.ts → ink-B_7OXxtb.d.ts} +27 -2
- package/dist/player.global.js +2 -2
- package/package.json +1 -1
- package/src/field-messages.ts +8 -0
- package/src/index.ts +2 -0
- package/src/layout/git.ts +728 -0
- package/src/look/values.ts +40 -1
- package/src/messages.ts +47 -4
- package/src/parser.ts +142 -7
- package/src/printer.ts +16 -4
- package/src/render/git.ts +161 -0
- package/src/render/parts.ts +1 -1
- package/src/render/svg.ts +26 -1
- package/src/schema.ts +47 -13
- package/src/schemas/diagram.schema.json +75 -8
- package/src/schemas/validate-diagram.js +1 -1
- package/src/timeline.ts +18 -3
- package/src/words.ts +19 -3
package/package.json
CHANGED
package/src/field-messages.ts
CHANGED
|
@@ -34,6 +34,10 @@ export interface FieldMessages {
|
|
|
34
34
|
not: (allowed: Allowed | undefined) => string;
|
|
35
35
|
/** 状態遷移図の箱の名札に、始まりと終わりの印の名前 (`names`) を書いた */
|
|
36
36
|
reserved: (names: readonly string[]) => string;
|
|
37
|
+
/** `kind` の図だけが書ける出来事の種類 (`types`) を、別の種類の図に書いた (#3164) */
|
|
38
|
+
kindOnly: (types: readonly string[], kind: string) => string;
|
|
39
|
+
/** 16 進の字を `min` から `max` 字で書く決まり (commit の hash、#3164) */
|
|
40
|
+
hex: (min: number, max: number) => string;
|
|
37
41
|
/** 選べる決まりがどれも欄が足りない時の、足りない欄。それ以外の時は空 */
|
|
38
42
|
anyOf: (fields: readonly string[]) => string;
|
|
39
43
|
oneOf: string;
|
|
@@ -77,6 +81,8 @@ const ja: FieldMessages = {
|
|
|
77
81
|
const: (value) => `${value} にする`,
|
|
78
82
|
not: (allowed) => (allowed ? `${allowed.field} の欄は kind が ${allowed.kind} の時だけ書ける` : "この欄の組み合わせは書けない"),
|
|
79
83
|
reserved: (names) => `${names.join(" と ")} は状態遷移図の始まりと終わりの印の名前で、箱の名札に使えない`,
|
|
84
|
+
kindOnly: (types, kind) => `${types.join(" と ")} の出来事は kind が ${kind} の時だけ書ける`,
|
|
85
|
+
hex: (min, max) => `0 から 9 と a から f の字で ${min} から ${max} 字にする`,
|
|
80
86
|
anyOf: (fields) =>
|
|
81
87
|
fields.length > 0 ? `${fields.join(" か ")} の${fields.length === 2 ? "どちらか" : "どれか"}の欄が要る` : "書ける形のどれにも合わない",
|
|
82
88
|
oneOf: "書ける形のどれか 1 つだけに合わせる",
|
|
@@ -99,6 +105,8 @@ const en: FieldMessages = {
|
|
|
99
105
|
const: (value) => `Use ${value}`,
|
|
100
106
|
not: (allowed) => (allowed ? `The ${allowed.field} field is allowed only when kind is ${allowed.kind}` : "This combination of fields is not allowed"),
|
|
101
107
|
reserved: (names) => `${names.join(" and ")} name the start and end marks of a state diagram and cannot be box ids`,
|
|
108
|
+
kindOnly: (types, kind) => `${types.join(" and ")} events are allowed only when kind is ${kind}`,
|
|
109
|
+
hex: (min, max) => `Use ${min} to ${max} characters of 0-9 and a-f`,
|
|
102
110
|
anyOf: (fields) => (fields.length > 0 ? `Write one of the ${fields.join(" or ")} fields` : "Does not match any of the allowed shapes"),
|
|
103
111
|
oneOf: "Match exactly one of the allowed shapes",
|
|
104
112
|
discriminator: (tag, values) => `${tag} is one of ${values.join(" / ")}`,
|