@cardenelabs/dragon 0.16.0 → 0.17.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 +9 -0
- package/dist/index.cjs +495 -370
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +168 -6
- package/dist/index.d.ts +168 -6
- package/dist/index.js +496 -372
- package/dist/index.js.map +1 -1
- package/package.json +12 -13
- package/src/compile.ts +453 -714
- package/src/index.ts +1 -0
- package/src/json-parser.ts +122 -1
- package/src/schemas/diagram.json +57 -1
- package/src/tokenize.ts +5 -5
- package/src/types.ts +55 -1
- package/src/v05/parser.ts +175 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CdlDiagram, NodeKind, Tone, EdgeStyle, LaidDiagram } from '@cardenelabs/cdl';
|
|
1
|
+
import { CdlDiagram, NodeKind, Tone, EdgeStyle, EdgeHead, EdgeHeadFill, ClassRelationType, SequenceMessageKind, EdgeReveal, LaidDiagram } from '@cardenelabs/cdl';
|
|
2
2
|
export { CdlDiagram } from '@cardenelabs/cdl';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -58,7 +58,7 @@ type V05ParseResult = {
|
|
|
58
58
|
* 書くと、項目を足した時に案内か一覧のどちらかが取り残される (実際に `states` / `values` が
|
|
59
59
|
* 一覧に 1 件も無い状態で放置されていた)。
|
|
60
60
|
*/
|
|
61
|
-
declare const TOP_LEVEL_KEYS: readonly ["title", "type", "actors", "flow", "states", "values", "animation", "viewport", "lanes", "groups", "eyebrow", "axes", "readouts", "inputs", "formulas", "events", "scrolls"];
|
|
61
|
+
declare const TOP_LEVEL_KEYS: readonly ["title", "type", "actors", "flow", "states", "values", "animation", "viewport", "lanes", "groups", "eyebrow", "axes", "readouts", "inputs", "formulas", "events", "scrolls", "bands", "reveal"];
|
|
62
62
|
/** 受け付ける図種。 記法一覧はここを見る。 */
|
|
63
63
|
declare const PRESET_TYPES: ReadonlySet<PresetType>;
|
|
64
64
|
/**
|
|
@@ -336,6 +336,20 @@ type DslDocument = {
|
|
|
336
336
|
/** v0.5+ 拡張 ... viewport / lanes / groups */
|
|
337
337
|
viewport?: DslViewport;
|
|
338
338
|
lanes?: Record<string, DslLane>;
|
|
339
|
+
/**
|
|
340
|
+
* 動いている間の帯 (#1466)。 順序図だけが読む。
|
|
341
|
+
*
|
|
342
|
+
* 書かなければ面ごとに「最初に関わった段から最後まで」 の 1 本。 途中で手が空く面を
|
|
343
|
+
* 分けたい図だけ書く = どこで手が空くかは言づての並びからは決まらない。
|
|
344
|
+
*/
|
|
345
|
+
bands?: DslBand[];
|
|
346
|
+
/**
|
|
347
|
+
* 矢印をいつ出すか (`reveal:`、 #1470)。
|
|
348
|
+
*
|
|
349
|
+
* 既定 (`phase`) は「段が名指しする矢印は、その段が来るまで描かない」。 `all` と書くと
|
|
350
|
+
* 段に関わらず最初から全部描く。 描き手の `CdlDiagram.edgeReveal` にそのまま渡る。
|
|
351
|
+
*/
|
|
352
|
+
reveal?: EdgeReveal;
|
|
339
353
|
groups?: Record<string, DslGroup>;
|
|
340
354
|
/**
|
|
341
355
|
* 値を見せる部品 (`readouts:`、 #1374)。 割合の輪や数え上げを図の脇に出す。
|
|
@@ -418,6 +432,14 @@ type DslActor = {
|
|
|
418
432
|
*/
|
|
419
433
|
previous?: string;
|
|
420
434
|
rows?: string[];
|
|
435
|
+
/**
|
|
436
|
+
* 行頭の印 (#1466)。 `rows` と同じ並びで、空文字はその行に印を付けない。
|
|
437
|
+
*
|
|
438
|
+
* **語の意味は図の種類が決める**。 ER は `pk` / `fk` / `opt`、状態遷移は
|
|
439
|
+
* `entry` / `exit` / `do` / `internal`。 印の 2 軸 (形 × 塗り) は共通だが、その軸が
|
|
440
|
+
* 何を指すかは種類ごとに違う。
|
|
441
|
+
*/
|
|
442
|
+
marks?: string[];
|
|
421
443
|
/**
|
|
422
444
|
* 箱の中に描く図形 (`shape:`、 #1374)。 水位や角度を状態で動かせる。
|
|
423
445
|
*
|
|
@@ -603,6 +625,35 @@ type DslStep = {
|
|
|
603
625
|
dashOffsetBind?: string;
|
|
604
626
|
/** 矢印がどの辺から出るか (#1385)。 書かなければ描画側が自動で選ぶ */
|
|
605
627
|
side?: "top" | "right" | "bottom" | "left";
|
|
628
|
+
/**
|
|
629
|
+
* 矢印の先の形 (#1462)。 書かなければ従来どおり塗った三角。
|
|
630
|
+
*
|
|
631
|
+
* 4 図の設計は **端の形で関係の種類を示す** = 三角 (継ぐ) / 菱 (持つ) /
|
|
632
|
+
* 開いた矢 (使う) / 鳥の足 (多)。 書けないと 4 種とも同じ三角になり、
|
|
633
|
+
* 線の種類 (実線 / 点線) だけで 6 種の関係を区別することになる。
|
|
634
|
+
*
|
|
635
|
+
* 受ける語は描画側の `EDGE_HEADS` から導く = 描画側が増やせば書けるようになる。
|
|
636
|
+
*/
|
|
637
|
+
head?: EdgeHead;
|
|
638
|
+
/** 出どころ側の端の形 (#1466)。 ER は端ごとに違う個数を示すので両端に要る */
|
|
639
|
+
tailHead?: EdgeHead;
|
|
640
|
+
/** 端の印の塗り (#1466)。 白抜きの菱が「持つ」、塗った菱が「抱える」 */
|
|
641
|
+
headFill?: EdgeHeadFill;
|
|
642
|
+
/** 出どころ側の印の塗り (#1466) */
|
|
643
|
+
tailHeadFill?: EdgeHeadFill;
|
|
644
|
+
/**
|
|
645
|
+
* クラス図の関係の種類 (#1466)。 書くと線と端の形と塗りと付く側がまとめて決まる。
|
|
646
|
+
*
|
|
647
|
+
* 4 つを個別に書かせないのは、組合せが 6 通りしか無く、1 つでも書き違えると読み手に
|
|
648
|
+
* 別の意味で伝わるため (菱を逆に置くと持ち主が入れ替わる)。
|
|
649
|
+
*/
|
|
650
|
+
relation?: ClassRelationType;
|
|
651
|
+
/**
|
|
652
|
+
* 言づての種類 (#1466)。 順序図で線と矢の形がまとめて決まる。
|
|
653
|
+
*
|
|
654
|
+
* `kind` にしないのは、箱の種類 (`DslActor.kind`) と同じ語が別の意味を持つため。
|
|
655
|
+
*/
|
|
656
|
+
msgKind?: SequenceMessageKind;
|
|
606
657
|
labelOffsetX?: number;
|
|
607
658
|
labelOffsetY?: number;
|
|
608
659
|
/** true で説明文を矢印の線の上に重ねる。 分岐図の条件ラベル用。 */
|
|
@@ -717,6 +768,12 @@ type DslValue = {
|
|
|
717
768
|
durationMs: number;
|
|
718
769
|
});
|
|
719
770
|
/** ステップ (phase) */
|
|
771
|
+
/** 動いている間の帯 (#1466)。 順序図で、面がいつ動いているかを段の番号で持つ */
|
|
772
|
+
type DslBand = {
|
|
773
|
+
actor: string;
|
|
774
|
+
from: number;
|
|
775
|
+
to: number;
|
|
776
|
+
};
|
|
720
777
|
type DslPhase = {
|
|
721
778
|
name: string;
|
|
722
779
|
durationMs: number;
|
|
@@ -836,7 +893,7 @@ interface CompileToCdlOpts {
|
|
|
836
893
|
}
|
|
837
894
|
/** 図は出せるが書いた通りにならなかった、 という知らせ。 */
|
|
838
895
|
type CompileNotice = {
|
|
839
|
-
kind: "relative-position-ignored" | "focus-target-missing" | "state-override-rejected" | "external-paint-dropped" | "part-not-drawn" | "scale-reserved" | "chart-value-unreadable" | "chart-edge-dropped" | "value-shadows-state" | "value-unresolved" | "value-duplicate" | "flow-actor-missing" | "value-trigger-unresolved" | "
|
|
896
|
+
kind: "relative-position-ignored" | "focus-target-missing" | "state-override-rejected" | "external-paint-dropped" | "part-not-drawn" | "scale-reserved" | "chart-value-unreadable" | "chart-edge-dropped" | "value-shadows-state" | "value-unresolved" | "value-duplicate" | "flow-actor-missing" | "value-trigger-unresolved" | "lane-not-honored" | "lane-declared-empty" | "eyebrow-not-honored" | "flow-endpoint-not-honored" | "draw-not-honored" | "draw-target-mismatch" | "formula-unresolved" | "event-target-missing" | "actor-kind-not-honored" | "sub-node-not-found" | "message-option-not-honored";
|
|
840
897
|
/** 対象の名前。 光らせる相手なら書かれた指定そのまま */
|
|
841
898
|
actor: string;
|
|
842
899
|
/** 書かれていた行 */
|
|
@@ -1007,6 +1064,19 @@ declare function partVisualSize(part: CdlDiagram, targetW?: number, targetH?: nu
|
|
|
1007
1064
|
w: number;
|
|
1008
1065
|
h: number;
|
|
1009
1066
|
};
|
|
1067
|
+
/**
|
|
1068
|
+
* 既存の図が縦に何段ぶんを占めるかの目安 (#1481)。
|
|
1069
|
+
*
|
|
1070
|
+
* **箱の数では数えない**。 数で数えると、図を丸ごと 1 つの箱で描く種別が 1 段に潰れる。
|
|
1071
|
+
* 順序図は `#1466` で 1 枚の板になり、高さ 432 の箱 1 つになった = 1 段 (280) と見積もられ、
|
|
1072
|
+
* その下に置いたパーツが板に 31px 重なっていた (実測)。
|
|
1073
|
+
*
|
|
1074
|
+
* 大きさを自分で持つ箱は、その高さから段数を出す。 持たない箱は今までどおり 1 段と数えるので、
|
|
1075
|
+
* 高さを書かない図の並び方は変わらない。
|
|
1076
|
+
*/
|
|
1077
|
+
declare function partsBaseRows(nodes: ReadonlyArray<{
|
|
1078
|
+
h?: number;
|
|
1079
|
+
}>): number;
|
|
1010
1080
|
/**
|
|
1011
1081
|
* 位置を書かなかったパーツを格子に並べた時の、 矩形の中心。
|
|
1012
1082
|
*
|
|
@@ -1017,9 +1087,9 @@ declare function partVisualSize(part: CdlDiagram, targetW?: number, targetH?: nu
|
|
|
1017
1087
|
* 隣と重なる (実測 = 400 の次に 200 を置くと 280 重なった)。 段の高さも段内の最大高で揃える。
|
|
1018
1088
|
* 縦は自分の高さの半分だけ段の上端から下げて、 段内で上端を揃える。
|
|
1019
1089
|
*
|
|
1020
|
-
* @param
|
|
1090
|
+
* @param baseRows 既存の図が占める段数の目安 (`partsBaseRows`)。 図の下から並べ始めるために使う
|
|
1021
1091
|
*/
|
|
1022
|
-
declare function partsGridCenters(
|
|
1092
|
+
declare function partsGridCenters(baseRows: number, items: ReadonlyArray<{
|
|
1023
1093
|
id: string;
|
|
1024
1094
|
w: number;
|
|
1025
1095
|
h: number;
|
|
@@ -1496,6 +1566,14 @@ interface DragonJson {
|
|
|
1496
1566
|
label?: string;
|
|
1497
1567
|
lanes: string[];
|
|
1498
1568
|
}>;
|
|
1569
|
+
/** 順序図で面が動いている間の帯 (#1466)。 記法の最上位 `bands:` と同じ */
|
|
1570
|
+
bands?: {
|
|
1571
|
+
actor: string;
|
|
1572
|
+
from: number;
|
|
1573
|
+
to: number;
|
|
1574
|
+
}[];
|
|
1575
|
+
/** 矢印をいつ出すか (#1470)。 記法の最上位 `reveal:` と同じ */
|
|
1576
|
+
reveal?: EdgeReveal;
|
|
1499
1577
|
}
|
|
1500
1578
|
interface JsonActor {
|
|
1501
1579
|
name: string;
|
|
@@ -1617,6 +1695,8 @@ interface JsonActor {
|
|
|
1617
1695
|
* 読めない項目名として知らせる)。
|
|
1618
1696
|
*/
|
|
1619
1697
|
scale?: number;
|
|
1698
|
+
/** 行頭の印 (#1466)。 行と対で読む。 語の意味は図の種類が決める */
|
|
1699
|
+
marks?: string[];
|
|
1620
1700
|
}
|
|
1621
1701
|
/** 2 軸で仕分ける図の軸の名前 (#1294)。 記法の `axes:` と同じ形 */
|
|
1622
1702
|
interface JsonAxes {
|
|
@@ -1643,6 +1723,21 @@ interface JsonStep {
|
|
|
1643
1723
|
sub?: string;
|
|
1644
1724
|
/** 矢印がどの辺から出るか (#1385)。 記法の `side:` と同じ */
|
|
1645
1725
|
side?: "top" | "right" | "bottom" | "left";
|
|
1726
|
+
/**
|
|
1727
|
+
* 矢印の先の形 (#1462)。 記法の `{ head: triangle }` と同じ。
|
|
1728
|
+
*
|
|
1729
|
+
* 三角 (継ぐ) / 菱 (持つ) / 開いた矢 (使う) / 鳥の足 (多)。
|
|
1730
|
+
* 書かなければ従来どおり塗った三角になる。
|
|
1731
|
+
*/
|
|
1732
|
+
head?: EdgeHead;
|
|
1733
|
+
/** 出どころ側の端の形と、両端の塗り (#1466)。 記法の `{ tailHead: diamond }` 等と同じ */
|
|
1734
|
+
tailHead?: EdgeHead;
|
|
1735
|
+
headFill?: EdgeHeadFill;
|
|
1736
|
+
tailHeadFill?: EdgeHeadFill;
|
|
1737
|
+
/** クラス図の関係の語 (#1466)。 書くと端の形 / 塗り / 線種がまとめて決まる */
|
|
1738
|
+
relation?: ClassRelationType;
|
|
1739
|
+
/** 順序図の言づての種類 (#1466)。 `call` / `return` / `fire` */
|
|
1740
|
+
kind?: SequenceMessageKind;
|
|
1646
1741
|
/**
|
|
1647
1742
|
* 矢印の色 (#1304)。 記法の `(成功)` と同じく別名 (`成功` / `neutral` 等) も受ける。
|
|
1648
1743
|
*
|
|
@@ -1874,6 +1969,13 @@ declare const diagramJsonSchema: {
|
|
|
1874
1969
|
};
|
|
1875
1970
|
description: string;
|
|
1876
1971
|
};
|
|
1972
|
+
marks: {
|
|
1973
|
+
type: string;
|
|
1974
|
+
items: {
|
|
1975
|
+
type: string;
|
|
1976
|
+
};
|
|
1977
|
+
description: string;
|
|
1978
|
+
};
|
|
1877
1979
|
lane: {
|
|
1878
1980
|
type: string;
|
|
1879
1981
|
description: string;
|
|
@@ -2158,6 +2260,36 @@ declare const diagramJsonSchema: {
|
|
|
2158
2260
|
enum: string[];
|
|
2159
2261
|
description: string;
|
|
2160
2262
|
};
|
|
2263
|
+
head: {
|
|
2264
|
+
type: string;
|
|
2265
|
+
enum: string[];
|
|
2266
|
+
description: string;
|
|
2267
|
+
};
|
|
2268
|
+
tailHead: {
|
|
2269
|
+
type: string;
|
|
2270
|
+
enum: string[];
|
|
2271
|
+
description: string;
|
|
2272
|
+
};
|
|
2273
|
+
headFill: {
|
|
2274
|
+
type: string;
|
|
2275
|
+
enum: string[];
|
|
2276
|
+
description: string;
|
|
2277
|
+
};
|
|
2278
|
+
tailHeadFill: {
|
|
2279
|
+
type: string;
|
|
2280
|
+
enum: string[];
|
|
2281
|
+
description: string;
|
|
2282
|
+
};
|
|
2283
|
+
relation: {
|
|
2284
|
+
type: string;
|
|
2285
|
+
enum: string[];
|
|
2286
|
+
description: string;
|
|
2287
|
+
};
|
|
2288
|
+
kind: {
|
|
2289
|
+
type: string;
|
|
2290
|
+
enum: string[];
|
|
2291
|
+
description: string;
|
|
2292
|
+
};
|
|
2161
2293
|
labelOffsetX: {
|
|
2162
2294
|
type: string;
|
|
2163
2295
|
description: string;
|
|
@@ -2922,6 +3054,36 @@ declare const diagramJsonSchema: {
|
|
|
2922
3054
|
pattern: string;
|
|
2923
3055
|
};
|
|
2924
3056
|
};
|
|
3057
|
+
reveal: {
|
|
3058
|
+
type: string;
|
|
3059
|
+
enum: string[];
|
|
3060
|
+
description: string;
|
|
3061
|
+
};
|
|
3062
|
+
bands: {
|
|
3063
|
+
type: string;
|
|
3064
|
+
description: string;
|
|
3065
|
+
items: {
|
|
3066
|
+
type: string;
|
|
3067
|
+
required: string[];
|
|
3068
|
+
additionalProperties: boolean;
|
|
3069
|
+
properties: {
|
|
3070
|
+
actor: {
|
|
3071
|
+
type: string;
|
|
3072
|
+
description: string;
|
|
3073
|
+
};
|
|
3074
|
+
from: {
|
|
3075
|
+
type: string;
|
|
3076
|
+
minimum: number;
|
|
3077
|
+
description: string;
|
|
3078
|
+
};
|
|
3079
|
+
to: {
|
|
3080
|
+
type: string;
|
|
3081
|
+
minimum: number;
|
|
3082
|
+
description: string;
|
|
3083
|
+
};
|
|
3084
|
+
};
|
|
3085
|
+
};
|
|
3086
|
+
};
|
|
2925
3087
|
events: {
|
|
2926
3088
|
type: string;
|
|
2927
3089
|
description: string;
|
|
@@ -3046,4 +3208,4 @@ interface CompileOpts {
|
|
|
3046
3208
|
*/
|
|
3047
3209
|
declare function textDslToDiagram(src: string, opts?: CompileOpts): CdlDiagram;
|
|
3048
3210
|
|
|
3049
|
-
export { type AnchorBox, type CompileNotice, type CompileOpts, DIAGRAM_BOUNDARY_PADDING, DRAW_TARGETS, DRAW_WORDS, type DiagramBoundingBox, type DragonJson, type DslActor, type DslAnimate, type DslDocument, type DslError, type DslGroup, type DslLane, type DslPhase, type DslSet, type DslState, type DslStep, type DslTween, type DslValue, type DslViewport, type FocusEntry, type InputSize, JSONを分解する, type JsonActor, type JsonActorNodeOverride, type JsonAxes, type JsonDslError, type JsonPhase, type JsonStep, type LayoutMode, type LayoutPos, type LintIssue, type LintReport, type LintSeverity, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, type PresetType, RELATIVE_GAP_DEFAULT, type RelativeDirection, type RelativePos, TONE_ALIAS, TOP_LEVEL_KEYS, autoFix, compileToCdl, computeDiagramBoundingBox, countBytes, countDiagramElements, countDocElements, describeOversize, describeOversizeSource, diagramJsonSchema, isColorValue, jsonToDiagram, lintDiagram, measureActorBoxes, normalizePartScale, orderByDependency, parseFocusEntry, parseRelativePos, parseTextDsl, parseTextDslV05, partBoxInFrame, partDrawsInDiagram, partIsMeasurable, partRenderSize, partScaleFactor, partTargetScale, partTargetSize, partVisualSize, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, type トークン, type トークンの種類, 区間に広げる, 記法を分解する };
|
|
3211
|
+
export { type AnchorBox, type CompileNotice, type CompileOpts, DIAGRAM_BOUNDARY_PADDING, DRAW_TARGETS, DRAW_WORDS, type DiagramBoundingBox, type DragonJson, type DslActor, type DslAnimate, type DslDocument, type DslError, type DslGroup, type DslLane, type DslPhase, type DslSet, type DslState, type DslStep, type DslTween, type DslValue, type DslViewport, type FocusEntry, type InputSize, JSONを分解する, type JsonActor, type JsonActorNodeOverride, type JsonAxes, type JsonDslError, type JsonPhase, type JsonStep, type LayoutMode, type LayoutPos, type LintIssue, type LintReport, type LintSeverity, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, type PresetType, RELATIVE_GAP_DEFAULT, type RelativeDirection, type RelativePos, TONE_ALIAS, TOP_LEVEL_KEYS, autoFix, compileToCdl, computeDiagramBoundingBox, countBytes, countDiagramElements, countDocElements, describeOversize, describeOversizeSource, diagramJsonSchema, isColorValue, jsonToDiagram, lintDiagram, measureActorBoxes, normalizePartScale, orderByDependency, parseFocusEntry, parseRelativePos, parseTextDsl, parseTextDslV05, partBoxInFrame, partDrawsInDiagram, partIsMeasurable, partRenderSize, partScaleFactor, partTargetScale, partTargetSize, partVisualSize, partsBaseRows, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, type トークン, type トークンの種類, 区間に広げる, 記法を分解する };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CdlDiagram, NodeKind, Tone, EdgeStyle, LaidDiagram } from '@cardenelabs/cdl';
|
|
1
|
+
import { CdlDiagram, NodeKind, Tone, EdgeStyle, EdgeHead, EdgeHeadFill, ClassRelationType, SequenceMessageKind, EdgeReveal, LaidDiagram } from '@cardenelabs/cdl';
|
|
2
2
|
export { CdlDiagram } from '@cardenelabs/cdl';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -58,7 +58,7 @@ type V05ParseResult = {
|
|
|
58
58
|
* 書くと、項目を足した時に案内か一覧のどちらかが取り残される (実際に `states` / `values` が
|
|
59
59
|
* 一覧に 1 件も無い状態で放置されていた)。
|
|
60
60
|
*/
|
|
61
|
-
declare const TOP_LEVEL_KEYS: readonly ["title", "type", "actors", "flow", "states", "values", "animation", "viewport", "lanes", "groups", "eyebrow", "axes", "readouts", "inputs", "formulas", "events", "scrolls"];
|
|
61
|
+
declare const TOP_LEVEL_KEYS: readonly ["title", "type", "actors", "flow", "states", "values", "animation", "viewport", "lanes", "groups", "eyebrow", "axes", "readouts", "inputs", "formulas", "events", "scrolls", "bands", "reveal"];
|
|
62
62
|
/** 受け付ける図種。 記法一覧はここを見る。 */
|
|
63
63
|
declare const PRESET_TYPES: ReadonlySet<PresetType>;
|
|
64
64
|
/**
|
|
@@ -336,6 +336,20 @@ type DslDocument = {
|
|
|
336
336
|
/** v0.5+ 拡張 ... viewport / lanes / groups */
|
|
337
337
|
viewport?: DslViewport;
|
|
338
338
|
lanes?: Record<string, DslLane>;
|
|
339
|
+
/**
|
|
340
|
+
* 動いている間の帯 (#1466)。 順序図だけが読む。
|
|
341
|
+
*
|
|
342
|
+
* 書かなければ面ごとに「最初に関わった段から最後まで」 の 1 本。 途中で手が空く面を
|
|
343
|
+
* 分けたい図だけ書く = どこで手が空くかは言づての並びからは決まらない。
|
|
344
|
+
*/
|
|
345
|
+
bands?: DslBand[];
|
|
346
|
+
/**
|
|
347
|
+
* 矢印をいつ出すか (`reveal:`、 #1470)。
|
|
348
|
+
*
|
|
349
|
+
* 既定 (`phase`) は「段が名指しする矢印は、その段が来るまで描かない」。 `all` と書くと
|
|
350
|
+
* 段に関わらず最初から全部描く。 描き手の `CdlDiagram.edgeReveal` にそのまま渡る。
|
|
351
|
+
*/
|
|
352
|
+
reveal?: EdgeReveal;
|
|
339
353
|
groups?: Record<string, DslGroup>;
|
|
340
354
|
/**
|
|
341
355
|
* 値を見せる部品 (`readouts:`、 #1374)。 割合の輪や数え上げを図の脇に出す。
|
|
@@ -418,6 +432,14 @@ type DslActor = {
|
|
|
418
432
|
*/
|
|
419
433
|
previous?: string;
|
|
420
434
|
rows?: string[];
|
|
435
|
+
/**
|
|
436
|
+
* 行頭の印 (#1466)。 `rows` と同じ並びで、空文字はその行に印を付けない。
|
|
437
|
+
*
|
|
438
|
+
* **語の意味は図の種類が決める**。 ER は `pk` / `fk` / `opt`、状態遷移は
|
|
439
|
+
* `entry` / `exit` / `do` / `internal`。 印の 2 軸 (形 × 塗り) は共通だが、その軸が
|
|
440
|
+
* 何を指すかは種類ごとに違う。
|
|
441
|
+
*/
|
|
442
|
+
marks?: string[];
|
|
421
443
|
/**
|
|
422
444
|
* 箱の中に描く図形 (`shape:`、 #1374)。 水位や角度を状態で動かせる。
|
|
423
445
|
*
|
|
@@ -603,6 +625,35 @@ type DslStep = {
|
|
|
603
625
|
dashOffsetBind?: string;
|
|
604
626
|
/** 矢印がどの辺から出るか (#1385)。 書かなければ描画側が自動で選ぶ */
|
|
605
627
|
side?: "top" | "right" | "bottom" | "left";
|
|
628
|
+
/**
|
|
629
|
+
* 矢印の先の形 (#1462)。 書かなければ従来どおり塗った三角。
|
|
630
|
+
*
|
|
631
|
+
* 4 図の設計は **端の形で関係の種類を示す** = 三角 (継ぐ) / 菱 (持つ) /
|
|
632
|
+
* 開いた矢 (使う) / 鳥の足 (多)。 書けないと 4 種とも同じ三角になり、
|
|
633
|
+
* 線の種類 (実線 / 点線) だけで 6 種の関係を区別することになる。
|
|
634
|
+
*
|
|
635
|
+
* 受ける語は描画側の `EDGE_HEADS` から導く = 描画側が増やせば書けるようになる。
|
|
636
|
+
*/
|
|
637
|
+
head?: EdgeHead;
|
|
638
|
+
/** 出どころ側の端の形 (#1466)。 ER は端ごとに違う個数を示すので両端に要る */
|
|
639
|
+
tailHead?: EdgeHead;
|
|
640
|
+
/** 端の印の塗り (#1466)。 白抜きの菱が「持つ」、塗った菱が「抱える」 */
|
|
641
|
+
headFill?: EdgeHeadFill;
|
|
642
|
+
/** 出どころ側の印の塗り (#1466) */
|
|
643
|
+
tailHeadFill?: EdgeHeadFill;
|
|
644
|
+
/**
|
|
645
|
+
* クラス図の関係の種類 (#1466)。 書くと線と端の形と塗りと付く側がまとめて決まる。
|
|
646
|
+
*
|
|
647
|
+
* 4 つを個別に書かせないのは、組合せが 6 通りしか無く、1 つでも書き違えると読み手に
|
|
648
|
+
* 別の意味で伝わるため (菱を逆に置くと持ち主が入れ替わる)。
|
|
649
|
+
*/
|
|
650
|
+
relation?: ClassRelationType;
|
|
651
|
+
/**
|
|
652
|
+
* 言づての種類 (#1466)。 順序図で線と矢の形がまとめて決まる。
|
|
653
|
+
*
|
|
654
|
+
* `kind` にしないのは、箱の種類 (`DslActor.kind`) と同じ語が別の意味を持つため。
|
|
655
|
+
*/
|
|
656
|
+
msgKind?: SequenceMessageKind;
|
|
606
657
|
labelOffsetX?: number;
|
|
607
658
|
labelOffsetY?: number;
|
|
608
659
|
/** true で説明文を矢印の線の上に重ねる。 分岐図の条件ラベル用。 */
|
|
@@ -717,6 +768,12 @@ type DslValue = {
|
|
|
717
768
|
durationMs: number;
|
|
718
769
|
});
|
|
719
770
|
/** ステップ (phase) */
|
|
771
|
+
/** 動いている間の帯 (#1466)。 順序図で、面がいつ動いているかを段の番号で持つ */
|
|
772
|
+
type DslBand = {
|
|
773
|
+
actor: string;
|
|
774
|
+
from: number;
|
|
775
|
+
to: number;
|
|
776
|
+
};
|
|
720
777
|
type DslPhase = {
|
|
721
778
|
name: string;
|
|
722
779
|
durationMs: number;
|
|
@@ -836,7 +893,7 @@ interface CompileToCdlOpts {
|
|
|
836
893
|
}
|
|
837
894
|
/** 図は出せるが書いた通りにならなかった、 という知らせ。 */
|
|
838
895
|
type CompileNotice = {
|
|
839
|
-
kind: "relative-position-ignored" | "focus-target-missing" | "state-override-rejected" | "external-paint-dropped" | "part-not-drawn" | "scale-reserved" | "chart-value-unreadable" | "chart-edge-dropped" | "value-shadows-state" | "value-unresolved" | "value-duplicate" | "flow-actor-missing" | "value-trigger-unresolved" | "
|
|
896
|
+
kind: "relative-position-ignored" | "focus-target-missing" | "state-override-rejected" | "external-paint-dropped" | "part-not-drawn" | "scale-reserved" | "chart-value-unreadable" | "chart-edge-dropped" | "value-shadows-state" | "value-unresolved" | "value-duplicate" | "flow-actor-missing" | "value-trigger-unresolved" | "lane-not-honored" | "lane-declared-empty" | "eyebrow-not-honored" | "flow-endpoint-not-honored" | "draw-not-honored" | "draw-target-mismatch" | "formula-unresolved" | "event-target-missing" | "actor-kind-not-honored" | "sub-node-not-found" | "message-option-not-honored";
|
|
840
897
|
/** 対象の名前。 光らせる相手なら書かれた指定そのまま */
|
|
841
898
|
actor: string;
|
|
842
899
|
/** 書かれていた行 */
|
|
@@ -1007,6 +1064,19 @@ declare function partVisualSize(part: CdlDiagram, targetW?: number, targetH?: nu
|
|
|
1007
1064
|
w: number;
|
|
1008
1065
|
h: number;
|
|
1009
1066
|
};
|
|
1067
|
+
/**
|
|
1068
|
+
* 既存の図が縦に何段ぶんを占めるかの目安 (#1481)。
|
|
1069
|
+
*
|
|
1070
|
+
* **箱の数では数えない**。 数で数えると、図を丸ごと 1 つの箱で描く種別が 1 段に潰れる。
|
|
1071
|
+
* 順序図は `#1466` で 1 枚の板になり、高さ 432 の箱 1 つになった = 1 段 (280) と見積もられ、
|
|
1072
|
+
* その下に置いたパーツが板に 31px 重なっていた (実測)。
|
|
1073
|
+
*
|
|
1074
|
+
* 大きさを自分で持つ箱は、その高さから段数を出す。 持たない箱は今までどおり 1 段と数えるので、
|
|
1075
|
+
* 高さを書かない図の並び方は変わらない。
|
|
1076
|
+
*/
|
|
1077
|
+
declare function partsBaseRows(nodes: ReadonlyArray<{
|
|
1078
|
+
h?: number;
|
|
1079
|
+
}>): number;
|
|
1010
1080
|
/**
|
|
1011
1081
|
* 位置を書かなかったパーツを格子に並べた時の、 矩形の中心。
|
|
1012
1082
|
*
|
|
@@ -1017,9 +1087,9 @@ declare function partVisualSize(part: CdlDiagram, targetW?: number, targetH?: nu
|
|
|
1017
1087
|
* 隣と重なる (実測 = 400 の次に 200 を置くと 280 重なった)。 段の高さも段内の最大高で揃える。
|
|
1018
1088
|
* 縦は自分の高さの半分だけ段の上端から下げて、 段内で上端を揃える。
|
|
1019
1089
|
*
|
|
1020
|
-
* @param
|
|
1090
|
+
* @param baseRows 既存の図が占める段数の目安 (`partsBaseRows`)。 図の下から並べ始めるために使う
|
|
1021
1091
|
*/
|
|
1022
|
-
declare function partsGridCenters(
|
|
1092
|
+
declare function partsGridCenters(baseRows: number, items: ReadonlyArray<{
|
|
1023
1093
|
id: string;
|
|
1024
1094
|
w: number;
|
|
1025
1095
|
h: number;
|
|
@@ -1496,6 +1566,14 @@ interface DragonJson {
|
|
|
1496
1566
|
label?: string;
|
|
1497
1567
|
lanes: string[];
|
|
1498
1568
|
}>;
|
|
1569
|
+
/** 順序図で面が動いている間の帯 (#1466)。 記法の最上位 `bands:` と同じ */
|
|
1570
|
+
bands?: {
|
|
1571
|
+
actor: string;
|
|
1572
|
+
from: number;
|
|
1573
|
+
to: number;
|
|
1574
|
+
}[];
|
|
1575
|
+
/** 矢印をいつ出すか (#1470)。 記法の最上位 `reveal:` と同じ */
|
|
1576
|
+
reveal?: EdgeReveal;
|
|
1499
1577
|
}
|
|
1500
1578
|
interface JsonActor {
|
|
1501
1579
|
name: string;
|
|
@@ -1617,6 +1695,8 @@ interface JsonActor {
|
|
|
1617
1695
|
* 読めない項目名として知らせる)。
|
|
1618
1696
|
*/
|
|
1619
1697
|
scale?: number;
|
|
1698
|
+
/** 行頭の印 (#1466)。 行と対で読む。 語の意味は図の種類が決める */
|
|
1699
|
+
marks?: string[];
|
|
1620
1700
|
}
|
|
1621
1701
|
/** 2 軸で仕分ける図の軸の名前 (#1294)。 記法の `axes:` と同じ形 */
|
|
1622
1702
|
interface JsonAxes {
|
|
@@ -1643,6 +1723,21 @@ interface JsonStep {
|
|
|
1643
1723
|
sub?: string;
|
|
1644
1724
|
/** 矢印がどの辺から出るか (#1385)。 記法の `side:` と同じ */
|
|
1645
1725
|
side?: "top" | "right" | "bottom" | "left";
|
|
1726
|
+
/**
|
|
1727
|
+
* 矢印の先の形 (#1462)。 記法の `{ head: triangle }` と同じ。
|
|
1728
|
+
*
|
|
1729
|
+
* 三角 (継ぐ) / 菱 (持つ) / 開いた矢 (使う) / 鳥の足 (多)。
|
|
1730
|
+
* 書かなければ従来どおり塗った三角になる。
|
|
1731
|
+
*/
|
|
1732
|
+
head?: EdgeHead;
|
|
1733
|
+
/** 出どころ側の端の形と、両端の塗り (#1466)。 記法の `{ tailHead: diamond }` 等と同じ */
|
|
1734
|
+
tailHead?: EdgeHead;
|
|
1735
|
+
headFill?: EdgeHeadFill;
|
|
1736
|
+
tailHeadFill?: EdgeHeadFill;
|
|
1737
|
+
/** クラス図の関係の語 (#1466)。 書くと端の形 / 塗り / 線種がまとめて決まる */
|
|
1738
|
+
relation?: ClassRelationType;
|
|
1739
|
+
/** 順序図の言づての種類 (#1466)。 `call` / `return` / `fire` */
|
|
1740
|
+
kind?: SequenceMessageKind;
|
|
1646
1741
|
/**
|
|
1647
1742
|
* 矢印の色 (#1304)。 記法の `(成功)` と同じく別名 (`成功` / `neutral` 等) も受ける。
|
|
1648
1743
|
*
|
|
@@ -1874,6 +1969,13 @@ declare const diagramJsonSchema: {
|
|
|
1874
1969
|
};
|
|
1875
1970
|
description: string;
|
|
1876
1971
|
};
|
|
1972
|
+
marks: {
|
|
1973
|
+
type: string;
|
|
1974
|
+
items: {
|
|
1975
|
+
type: string;
|
|
1976
|
+
};
|
|
1977
|
+
description: string;
|
|
1978
|
+
};
|
|
1877
1979
|
lane: {
|
|
1878
1980
|
type: string;
|
|
1879
1981
|
description: string;
|
|
@@ -2158,6 +2260,36 @@ declare const diagramJsonSchema: {
|
|
|
2158
2260
|
enum: string[];
|
|
2159
2261
|
description: string;
|
|
2160
2262
|
};
|
|
2263
|
+
head: {
|
|
2264
|
+
type: string;
|
|
2265
|
+
enum: string[];
|
|
2266
|
+
description: string;
|
|
2267
|
+
};
|
|
2268
|
+
tailHead: {
|
|
2269
|
+
type: string;
|
|
2270
|
+
enum: string[];
|
|
2271
|
+
description: string;
|
|
2272
|
+
};
|
|
2273
|
+
headFill: {
|
|
2274
|
+
type: string;
|
|
2275
|
+
enum: string[];
|
|
2276
|
+
description: string;
|
|
2277
|
+
};
|
|
2278
|
+
tailHeadFill: {
|
|
2279
|
+
type: string;
|
|
2280
|
+
enum: string[];
|
|
2281
|
+
description: string;
|
|
2282
|
+
};
|
|
2283
|
+
relation: {
|
|
2284
|
+
type: string;
|
|
2285
|
+
enum: string[];
|
|
2286
|
+
description: string;
|
|
2287
|
+
};
|
|
2288
|
+
kind: {
|
|
2289
|
+
type: string;
|
|
2290
|
+
enum: string[];
|
|
2291
|
+
description: string;
|
|
2292
|
+
};
|
|
2161
2293
|
labelOffsetX: {
|
|
2162
2294
|
type: string;
|
|
2163
2295
|
description: string;
|
|
@@ -2922,6 +3054,36 @@ declare const diagramJsonSchema: {
|
|
|
2922
3054
|
pattern: string;
|
|
2923
3055
|
};
|
|
2924
3056
|
};
|
|
3057
|
+
reveal: {
|
|
3058
|
+
type: string;
|
|
3059
|
+
enum: string[];
|
|
3060
|
+
description: string;
|
|
3061
|
+
};
|
|
3062
|
+
bands: {
|
|
3063
|
+
type: string;
|
|
3064
|
+
description: string;
|
|
3065
|
+
items: {
|
|
3066
|
+
type: string;
|
|
3067
|
+
required: string[];
|
|
3068
|
+
additionalProperties: boolean;
|
|
3069
|
+
properties: {
|
|
3070
|
+
actor: {
|
|
3071
|
+
type: string;
|
|
3072
|
+
description: string;
|
|
3073
|
+
};
|
|
3074
|
+
from: {
|
|
3075
|
+
type: string;
|
|
3076
|
+
minimum: number;
|
|
3077
|
+
description: string;
|
|
3078
|
+
};
|
|
3079
|
+
to: {
|
|
3080
|
+
type: string;
|
|
3081
|
+
minimum: number;
|
|
3082
|
+
description: string;
|
|
3083
|
+
};
|
|
3084
|
+
};
|
|
3085
|
+
};
|
|
3086
|
+
};
|
|
2925
3087
|
events: {
|
|
2926
3088
|
type: string;
|
|
2927
3089
|
description: string;
|
|
@@ -3046,4 +3208,4 @@ interface CompileOpts {
|
|
|
3046
3208
|
*/
|
|
3047
3209
|
declare function textDslToDiagram(src: string, opts?: CompileOpts): CdlDiagram;
|
|
3048
3210
|
|
|
3049
|
-
export { type AnchorBox, type CompileNotice, type CompileOpts, DIAGRAM_BOUNDARY_PADDING, DRAW_TARGETS, DRAW_WORDS, type DiagramBoundingBox, type DragonJson, type DslActor, type DslAnimate, type DslDocument, type DslError, type DslGroup, type DslLane, type DslPhase, type DslSet, type DslState, type DslStep, type DslTween, type DslValue, type DslViewport, type FocusEntry, type InputSize, JSONを分解する, type JsonActor, type JsonActorNodeOverride, type JsonAxes, type JsonDslError, type JsonPhase, type JsonStep, type LayoutMode, type LayoutPos, type LintIssue, type LintReport, type LintSeverity, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, type PresetType, RELATIVE_GAP_DEFAULT, type RelativeDirection, type RelativePos, TONE_ALIAS, TOP_LEVEL_KEYS, autoFix, compileToCdl, computeDiagramBoundingBox, countBytes, countDiagramElements, countDocElements, describeOversize, describeOversizeSource, diagramJsonSchema, isColorValue, jsonToDiagram, lintDiagram, measureActorBoxes, normalizePartScale, orderByDependency, parseFocusEntry, parseRelativePos, parseTextDsl, parseTextDslV05, partBoxInFrame, partDrawsInDiagram, partIsMeasurable, partRenderSize, partScaleFactor, partTargetScale, partTargetSize, partVisualSize, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, type トークン, type トークンの種類, 区間に広げる, 記法を分解する };
|
|
3211
|
+
export { type AnchorBox, type CompileNotice, type CompileOpts, DIAGRAM_BOUNDARY_PADDING, DRAW_TARGETS, DRAW_WORDS, type DiagramBoundingBox, type DragonJson, type DslActor, type DslAnimate, type DslDocument, type DslError, type DslGroup, type DslLane, type DslPhase, type DslSet, type DslState, type DslStep, type DslTween, type DslValue, type DslViewport, type FocusEntry, type InputSize, JSONを分解する, type JsonActor, type JsonActorNodeOverride, type JsonAxes, type JsonDslError, type JsonPhase, type JsonStep, type LayoutMode, type LayoutPos, type LintIssue, type LintReport, type LintSeverity, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, type PresetType, RELATIVE_GAP_DEFAULT, type RelativeDirection, type RelativePos, TONE_ALIAS, TOP_LEVEL_KEYS, autoFix, compileToCdl, computeDiagramBoundingBox, countBytes, countDiagramElements, countDocElements, describeOversize, describeOversizeSource, diagramJsonSchema, isColorValue, jsonToDiagram, lintDiagram, measureActorBoxes, normalizePartScale, orderByDependency, parseFocusEntry, parseRelativePos, parseTextDsl, parseTextDslV05, partBoxInFrame, partDrawsInDiagram, partIsMeasurable, partRenderSize, partScaleFactor, partTargetScale, partTargetSize, partVisualSize, partsBaseRows, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, type トークン, type トークンの種類, 区間に広げる, 記法を分解する };
|