@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.
Files changed (44) hide show
  1. package/README.md +39 -1
  2. package/dist/cli.cjs +1921 -429
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +1926 -434
  5. package/dist/cli.js.map +1 -1
  6. package/dist/export.cjs +1718 -353
  7. package/dist/export.cjs.map +1 -1
  8. package/dist/export.d.cts +1 -1
  9. package/dist/export.d.ts +1 -1
  10. package/dist/export.js +1723 -358
  11. package/dist/export.js.map +1 -1
  12. package/dist/index.cjs +1835 -342
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +5 -15
  15. package/dist/index.d.ts +5 -15
  16. package/dist/index.js +1836 -342
  17. package/dist/index.js.map +1 -1
  18. package/dist/{ink-Cg-v6XSG.d.cts → ink-B_7OXxtb.d.cts} +27 -2
  19. package/dist/{ink-Cg-v6XSG.d.ts → ink-B_7OXxtb.d.ts} +27 -2
  20. package/dist/node.cjs +2946 -0
  21. package/dist/node.cjs.map +1 -0
  22. package/dist/node.d.cts +9 -0
  23. package/dist/node.d.ts +9 -0
  24. package/dist/node.js +2944 -0
  25. package/dist/node.js.map +1 -0
  26. package/dist/player.global.js +2 -2
  27. package/package.json +11 -1
  28. package/src/field-messages.ts +8 -0
  29. package/src/index.ts +5 -2
  30. package/src/layout/git.ts +728 -0
  31. package/src/look/values.ts +40 -1
  32. package/src/messages.ts +47 -4
  33. package/src/node.ts +23 -0
  34. package/src/parser.ts +142 -7
  35. package/src/printer.ts +16 -4
  36. package/src/render/git.ts +161 -0
  37. package/src/render/parts.ts +1 -1
  38. package/src/render/svg.ts +26 -1
  39. package/src/schema.ts +47 -13
  40. package/src/schemas/diagram.schema.json +75 -8
  41. package/src/schemas/validate-diagram.js +1 -1
  42. package/src/timeline.ts +18 -3
  43. package/src/version.ts +1 -20
  44. package/src/words.ts +19 -3
@@ -93,7 +93,29 @@ type DiagramEvent = {
93
93
  field: string;
94
94
  value?: string;
95
95
  tag?: string;
96
+ } | GitCommit | {
97
+ type: "branch";
98
+ branch: string;
99
+ from: string;
96
100
  };
101
+ /**
102
+ * 枝分かれの図 (#3164) の commit を積む出来事。積んだ枝の札と、その枝を指す HEAD が新しい commit へ進む。
103
+ * 当て直し (`copy`) は枝の札を動かさず、merge commit (`merge`) は取り込む枝の先端も親に持つ
104
+ */
105
+ interface GitCommit {
106
+ type: "commit";
107
+ id: string;
108
+ branch: string;
109
+ copy?: string;
110
+ merge?: string;
111
+ hash?: string;
112
+ note?: string;
113
+ }
114
+ /** 枝分かれの図の枝。上から宣言した順に帯を並べる */
115
+ interface GitBranch {
116
+ id: string;
117
+ note?: string;
118
+ }
97
119
  /** 状態遷移図の、最初の段より前に書いた移れる道。`from` に `start`、`to` に `finish` を書ける */
98
120
  interface StatePath {
99
121
  from: string;
@@ -108,7 +130,7 @@ interface Step {
108
130
  }
109
131
  interface Diagram {
110
132
  version: number;
111
- kind: "sequence" | "architecture" | "state";
133
+ kind: "sequence" | "architecture" | "state" | "git";
112
134
  title: string;
113
135
  view?: ViewMode;
114
136
  regions?: Region[];
@@ -124,6 +146,9 @@ interface Diagram {
124
146
  state?: {
125
147
  paths: StatePath[];
126
148
  };
149
+ git?: {
150
+ branches: GitBranch[];
151
+ };
127
152
  }
128
153
  interface FieldError {
129
154
  /** 誤った欄の場所 (JSON Pointer) */
@@ -332,4 +357,4 @@ type Overlap = {
332
357
  */
333
358
  declare function describeOverlap(overlap: Overlap, lang?: NotationLang): string;
334
359
 
335
- export { type StatePath as A, type Box as B, type CheckOptions as C, type Diagram as D, type Step as E, type FieldError as F, describeOverlap as G, resolvePalette as H, type InkPart as I, validateDiagram as J, type Layout as L, type NotationLang as N, type Overlap as O, PALETTES as P, type Rect as R, type SceneAction as S, type Theme as T, type ViewMode as V, type Carry as a, type Checked as b, type Color as c, type ColorKey as d, DEFAULT_PALETTE as e, type DiagramEvent as f, FONTS as g, type Family as h, type LabelSide as i, type OverlapSpot as j, type Palette as k, type Point as l, READABLE_PX as m, type Region as n, type SceneBadge as o, type SceneBox as p, type SceneEdge as q, type SceneEnd as r, type SceneField as s, type SceneLabel as t, type SceneLifeline as u, type ScenePath as v, type SceneRegion as w, type SceneSide as x, type SceneStrip as y, type SceneTrail as z };
360
+ export { type SceneTrail as A, type Box as B, type CheckOptions as C, type Diagram as D, type StatePath as E, type FieldError as F, type GitBranch as G, type Step as H, type InkPart as I, describeOverlap as J, resolvePalette as K, type Layout as L, validateDiagram as M, type NotationLang as N, type Overlap as O, PALETTES as P, type Rect as R, type SceneAction as S, type Theme as T, type ViewMode as V, type Carry as a, type Checked as b, type Color as c, type ColorKey as d, DEFAULT_PALETTE as e, type DiagramEvent as f, FONTS as g, type Family as h, type GitCommit as i, type LabelSide as j, type OverlapSpot as k, type Palette as l, type Point as m, READABLE_PX as n, type Region as o, type SceneBadge as p, type SceneBox as q, type SceneEdge as r, type SceneEnd as s, type SceneField as t, type SceneLabel as u, type SceneLifeline as v, type ScenePath as w, type SceneRegion as x, type SceneSide as y, type SceneStrip as z };
@@ -93,7 +93,29 @@ type DiagramEvent = {
93
93
  field: string;
94
94
  value?: string;
95
95
  tag?: string;
96
+ } | GitCommit | {
97
+ type: "branch";
98
+ branch: string;
99
+ from: string;
96
100
  };
101
+ /**
102
+ * 枝分かれの図 (#3164) の commit を積む出来事。積んだ枝の札と、その枝を指す HEAD が新しい commit へ進む。
103
+ * 当て直し (`copy`) は枝の札を動かさず、merge commit (`merge`) は取り込む枝の先端も親に持つ
104
+ */
105
+ interface GitCommit {
106
+ type: "commit";
107
+ id: string;
108
+ branch: string;
109
+ copy?: string;
110
+ merge?: string;
111
+ hash?: string;
112
+ note?: string;
113
+ }
114
+ /** 枝分かれの図の枝。上から宣言した順に帯を並べる */
115
+ interface GitBranch {
116
+ id: string;
117
+ note?: string;
118
+ }
97
119
  /** 状態遷移図の、最初の段より前に書いた移れる道。`from` に `start`、`to` に `finish` を書ける */
98
120
  interface StatePath {
99
121
  from: string;
@@ -108,7 +130,7 @@ interface Step {
108
130
  }
109
131
  interface Diagram {
110
132
  version: number;
111
- kind: "sequence" | "architecture" | "state";
133
+ kind: "sequence" | "architecture" | "state" | "git";
112
134
  title: string;
113
135
  view?: ViewMode;
114
136
  regions?: Region[];
@@ -124,6 +146,9 @@ interface Diagram {
124
146
  state?: {
125
147
  paths: StatePath[];
126
148
  };
149
+ git?: {
150
+ branches: GitBranch[];
151
+ };
127
152
  }
128
153
  interface FieldError {
129
154
  /** 誤った欄の場所 (JSON Pointer) */
@@ -332,4 +357,4 @@ type Overlap = {
332
357
  */
333
358
  declare function describeOverlap(overlap: Overlap, lang?: NotationLang): string;
334
359
 
335
- export { type StatePath as A, type Box as B, type CheckOptions as C, type Diagram as D, type Step as E, type FieldError as F, describeOverlap as G, resolvePalette as H, type InkPart as I, validateDiagram as J, type Layout as L, type NotationLang as N, type Overlap as O, PALETTES as P, type Rect as R, type SceneAction as S, type Theme as T, type ViewMode as V, type Carry as a, type Checked as b, type Color as c, type ColorKey as d, DEFAULT_PALETTE as e, type DiagramEvent as f, FONTS as g, type Family as h, type LabelSide as i, type OverlapSpot as j, type Palette as k, type Point as l, READABLE_PX as m, type Region as n, type SceneBadge as o, type SceneBox as p, type SceneEdge as q, type SceneEnd as r, type SceneField as s, type SceneLabel as t, type SceneLifeline as u, type ScenePath as v, type SceneRegion as w, type SceneSide as x, type SceneStrip as y, type SceneTrail as z };
360
+ export { type SceneTrail as A, type Box as B, type CheckOptions as C, type Diagram as D, type StatePath as E, type FieldError as F, type GitBranch as G, type Step as H, type InkPart as I, describeOverlap as J, resolvePalette as K, type Layout as L, validateDiagram as M, type NotationLang as N, type Overlap as O, PALETTES as P, type Rect as R, type SceneAction as S, type Theme as T, type ViewMode as V, type Carry as a, type Checked as b, type Color as c, type ColorKey as d, DEFAULT_PALETTE as e, type DiagramEvent as f, FONTS as g, type Family as h, type GitCommit as i, type LabelSide as j, type OverlapSpot as k, type Palette as l, type Point as m, READABLE_PX as n, type Region as o, type SceneBadge as p, type SceneBox as q, type SceneEdge as r, type SceneEnd as s, type SceneField as t, type SceneLabel as u, type SceneLifeline as v, type ScenePath as w, type SceneRegion as x, type SceneSide as y, type SceneStrip as z };