@cardenelabs/dragon 0.39.0 → 0.41.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 +39 -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 -342
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -15
- package/dist/index.d.ts +5 -15
- package/dist/index.js +1836 -342
- 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/node.cjs +2946 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +9 -0
- package/dist/node.d.ts +9 -0
- package/dist/node.js +2944 -0
- package/dist/node.js.map +1 -0
- package/dist/player.global.js +2 -2
- package/package.json +11 -1
- package/src/field-messages.ts +8 -0
- package/src/index.ts +5 -2
- package/src/layout/git.ts +728 -0
- package/src/look/values.ts +40 -1
- package/src/messages.ts +47 -4
- package/src/node.ts +23 -0
- 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/version.ts +1 -20
- package/src/words.ts +19 -3
package/src/words.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type NotationLang = "ja" | "en";
|
|
|
16
16
|
const keys = <K extends string>(table: Record<K, true>): K[] => Object.keys(table) as K[];
|
|
17
17
|
|
|
18
18
|
/** 図の種類。最初の行の頭の語 */
|
|
19
|
-
export const KINDS = keys<Diagram["kind"]>({ sequence: true, architecture: true, state: true });
|
|
19
|
+
export const KINDS = keys<Diagram["kind"]>({ sequence: true, architecture: true, state: true, git: true });
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* 状態遷移図の始まりと終わりの印の名前 (#3163)。線の送る側に `start`、受ける側に `finish` を書き、
|
|
@@ -25,13 +25,27 @@ export const KINDS = keys<Diagram["kind"]>({ sequence: true, architecture: true,
|
|
|
25
25
|
export const STATE_ENDS = ["start", "finish"] as const;
|
|
26
26
|
export type StateEnd = (typeof STATE_ENDS)[number];
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* 最初の行より後の行の頭の語。線の行だけは箱の名札から始まる。
|
|
30
|
+
* `branch` と `commit` は枝分かれの図 (`git`) だけが書ける (#3164)
|
|
31
|
+
*/
|
|
32
|
+
export const HEADS = ["group", "end", "box", "strip", "step", "say", "code", "act", "note", "set", "branch", "commit"] as const;
|
|
30
33
|
type Head = (typeof HEADS)[number];
|
|
31
34
|
|
|
32
35
|
/** 箱と区画の名札の後ろに、見せる名前を続ける語 (`box <名札> as <名前>`) */
|
|
33
36
|
export const AS = "as";
|
|
34
37
|
|
|
38
|
+
/** 枝分かれの図 (#3164) の `commit` の行で、積む枝、当て直しの元、取り込む枝を続ける語 (`commit <名札> on <枝> copy <commit>`) */
|
|
39
|
+
export const ON = "on";
|
|
40
|
+
export const COPY = "copy";
|
|
41
|
+
export const MERGE = "merge";
|
|
42
|
+
/** 枝分かれの図で枝を切る行の、枝の後ろに切る commit を続ける語 (`<枝> from <commit>`) */
|
|
43
|
+
export const FROM = "from";
|
|
44
|
+
/** 枝分かれの図で今いる場所を指す札の名前。枝と commit と箱の名札に使えない */
|
|
45
|
+
export const HEAD = "HEAD";
|
|
46
|
+
/** 枝分かれの図の行の中の語のうち、行の頭の語でも属性でもない語。見本帳の部品が受け持つ語に数える (`on` は commit の行に必ず書くので数えない) */
|
|
47
|
+
export const GIT_WORDS = [FROM, COPY, MERGE] as const;
|
|
48
|
+
|
|
35
49
|
/** 行ごとに書ける属性の鍵 */
|
|
36
50
|
export const ATTRS = {
|
|
37
51
|
diagram: ["view"],
|
|
@@ -39,6 +53,8 @@ export const ATTRS = {
|
|
|
39
53
|
box: ["note", "color", "icon"],
|
|
40
54
|
edge: ["carry", "tag", "side"],
|
|
41
55
|
set: ["tag"],
|
|
56
|
+
branch: ["note"],
|
|
57
|
+
commit: ["hash", "note"],
|
|
42
58
|
} as const;
|
|
43
59
|
|
|
44
60
|
/** `carry` に書ける運ぶ物。封筒は書かない時、札は `tag` で書く */
|