@cardenelabs/dragon 0.41.0 → 0.42.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 +21 -1
- package/dist/cli.cjs +4122 -969
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +4122 -969
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +3704 -942
- 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 +3704 -942
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +4016 -815
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +159 -3
- package/dist/index.d.ts +159 -3
- package/dist/index.js +4016 -815
- package/dist/index.js.map +1 -1
- package/dist/{ink-B_7OXxtb.d.cts → ink-B8EZL7JV.d.cts} +95 -3
- package/dist/{ink-B_7OXxtb.d.ts → ink-B8EZL7JV.d.ts} +95 -3
- package/dist/node.cjs +2461 -726
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2461 -726
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +2 -2
- package/package.json +1 -1
- package/src/export/capture.ts +17 -5
- package/src/export/fonts.ts +19 -1
- package/src/export/index.ts +2 -2
- package/src/field-messages.ts +12 -0
- package/src/figure-text.ts +26 -0
- package/src/index.ts +11 -1
- package/src/layout/scene.ts +23 -2
- package/src/layout/time.ts +680 -0
- package/src/look/values.ts +142 -2
- package/src/messages.ts +108 -5
- package/src/parser.ts +427 -6
- package/src/player.ts +48 -10
- package/src/printer.ts +63 -12
- package/src/render/icons.ts +2 -0
- package/src/render/parts.ts +29 -9
- package/src/render/svg.ts +129 -21
- package/src/render/time.ts +291 -0
- package/src/schema.ts +109 -10
- package/src/schemas/diagram.schema.json +224 -12
- package/src/schemas/validate-diagram.js +1 -1
- package/src/timeline.ts +147 -10
- package/src/words.ts +39 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NotationLang, D as Diagram, F as FieldError, C as CheckOptions,
|
|
2
|
-
export { B as Box,
|
|
1
|
+
import { N as NotationLang, D as Diagram, F as FieldError, C as CheckOptions, S as SceneBox, R as Rect, L as Layout, a as ColorKey, P as Point, b as Colors, T as Theme, V as ViewMode, O as Overlap } from './ink-B8EZL7JV.cjs';
|
|
2
|
+
export { B as Box, c as Carry, d as Checked, e as Color, f as ColorName, g as DEFAULT_PALETTE, h as DiagramEvent, i as FONTS, j as Family, G as GitBranch, k as GitCommit, I as InkPart, l as LabelSide, m as OverlapSpot, n as PALETTES, o as Palette, p as READABLE_PX, q as Region, r as SceneAction, s as SceneBadge, t as SceneEdge, u as SceneEnd, v as SceneField, w as SceneLabel, x as SceneLifeline, y as ScenePath, z as SceneRegion, A as SceneSide, E as SceneStrip, H as SceneTrail, J as StatePath, K as Step, M as StepSource, Q as StripMeter, U as TimeMarkEvent, W as TimePeriod, X as TimePoint, Y as TimeRow, Z as TimeScale, _ as TimeSpanEvent, $ as TimeSpec, a0 as describeOverlap, a1 as resolvePalette, a2 as validateDiagram } from './ink-B8EZL7JV.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Markdown の中の dragon の囲み (```dragon) を、囲みごとに取り出す。
|
|
@@ -46,6 +46,9 @@ declare function parseNotation(notation: string, options?: ParseOptions): Parsed
|
|
|
46
46
|
* 区画の箱が飛び飛びの時は同じ `group` を開き直す。区画の並びが箱の現れる順と違う時と、
|
|
47
47
|
* 箱の無い区画がある時は、先に全ての区画を中の無い `group … end` で宣言してから開き直す。
|
|
48
48
|
* 枝分かれの図 (#3164) は、枝の `branch` の行を箱より前に書き、札を動かす線の運ぶ物が送る側の名前の札なら書かない。
|
|
49
|
+
* 時間軸の図 (#3165) は、目盛りと区切りと印の列と節目と拡大の範囲の行を箱より前に書き、物差しの欄の後ろに `[meter: <割合>]` を書く。
|
|
50
|
+
* 時間軸の図の `note` は属性を持てるので、`[` を含む字を `"` で囲む。
|
|
51
|
+
* 段の出典 (#3199) は `say` と `code` の後ろ、段の中で起きることより前に、JSON の並びのまま 1 つずつ `source` の行に書く。
|
|
49
52
|
*/
|
|
50
53
|
|
|
51
54
|
declare function printNotation(diagram: Diagram): string;
|
|
@@ -63,6 +66,128 @@ type Read = {
|
|
|
63
66
|
/** 原本を読む。道具より新しい版は描かずに断り、形の誤りは検査の誤りとして返す。誤りの文は `options.lang` (渡さなければ日本語) で出す。 */
|
|
64
67
|
declare function readDiagram(input: unknown, options?: CheckOptions): Read;
|
|
65
68
|
|
|
69
|
+
/** 時間軸。`x` から目盛り 1 つの幅 `unit` で `count` 個並べ、`line` の高さに時刻の目盛りの線を引く */
|
|
70
|
+
interface TimeAxis {
|
|
71
|
+
x: number;
|
|
72
|
+
w: number;
|
|
73
|
+
unit: number;
|
|
74
|
+
count: number;
|
|
75
|
+
line: number;
|
|
76
|
+
}
|
|
77
|
+
/** 印の列 */
|
|
78
|
+
interface TimeRowPlaced extends Rect {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
color: ColorKey;
|
|
82
|
+
}
|
|
83
|
+
/** 目盛り 1 つの印。`empty` は空きの印。`colors` は色を変えた段と出来事と色 */
|
|
84
|
+
interface TimeMark extends Rect {
|
|
85
|
+
row: string;
|
|
86
|
+
unit: number;
|
|
87
|
+
empty: boolean;
|
|
88
|
+
color: ColorKey;
|
|
89
|
+
colors: {
|
|
90
|
+
step: number;
|
|
91
|
+
event: number;
|
|
92
|
+
color: ColorKey;
|
|
93
|
+
}[];
|
|
94
|
+
}
|
|
95
|
+
/** 時刻の字。目盛りの境 `at` に置き、字の左端を `left` に、基準線を `y` に置く */
|
|
96
|
+
interface TimeTick {
|
|
97
|
+
at: number;
|
|
98
|
+
x: number;
|
|
99
|
+
text: string;
|
|
100
|
+
left: number;
|
|
101
|
+
y: number;
|
|
102
|
+
}
|
|
103
|
+
/** 区切り。`name` は区切りの名前と番号、`range` はその区切りの目盛りの番号の範囲。字は区切りの真ん中に置く */
|
|
104
|
+
interface TimePeriodPlaced extends Rect {
|
|
105
|
+
index: number;
|
|
106
|
+
from: number;
|
|
107
|
+
to: number;
|
|
108
|
+
name: string;
|
|
109
|
+
range: string;
|
|
110
|
+
nameY: number;
|
|
111
|
+
rangeY: number;
|
|
112
|
+
}
|
|
113
|
+
/** 節目。置いた目盛り `unit` の印の下の旗の丸。`text` は名札と状態の字が占める所、`changes` は状態の字と色を変えた段と出来事 */
|
|
114
|
+
interface TimePointPlaced {
|
|
115
|
+
id: string;
|
|
116
|
+
unit: number;
|
|
117
|
+
cx: number;
|
|
118
|
+
cy: number;
|
|
119
|
+
r: number;
|
|
120
|
+
text: Rect;
|
|
121
|
+
changes: {
|
|
122
|
+
step: number;
|
|
123
|
+
event: number;
|
|
124
|
+
text: string;
|
|
125
|
+
color?: ColorKey;
|
|
126
|
+
}[];
|
|
127
|
+
}
|
|
128
|
+
/** 拡大の帯の箱。`row` は同じ名札の印の列、`empty` はその列が空きにした目盛りの列の箱 */
|
|
129
|
+
interface TimeBox extends SceneBox {
|
|
130
|
+
row?: string;
|
|
131
|
+
empty?: boolean;
|
|
132
|
+
}
|
|
133
|
+
/** 拡大の帯の列。目盛り `unit` の列に、宣言した箱を同じ並びで置く。`head` は列の上の字 */
|
|
134
|
+
interface TimeColumn extends Rect {
|
|
135
|
+
unit: number;
|
|
136
|
+
head: string;
|
|
137
|
+
boxes: TimeBox[];
|
|
138
|
+
}
|
|
139
|
+
/** 拡大の帯。軸の上の拡大した範囲の枠 `frame` と、枠から帯へつなぐ点線 `guides`。`empty` は空きの枠の字、`headY` は列の上の字の基準線 */
|
|
140
|
+
interface TimeZoom {
|
|
141
|
+
from: number;
|
|
142
|
+
to: number;
|
|
143
|
+
frame: Rect;
|
|
144
|
+
guides: Point[][];
|
|
145
|
+
columns: TimeColumn[];
|
|
146
|
+
empty: string;
|
|
147
|
+
headY: number;
|
|
148
|
+
}
|
|
149
|
+
/** 範囲の括弧 (`bracket`) か囲み (`box`)。`until` は消える段 (無ければ最後の段まで残る)。`textY` は字の基準線 */
|
|
150
|
+
interface TimeSpanPlaced extends Rect {
|
|
151
|
+
step: number;
|
|
152
|
+
event: number;
|
|
153
|
+
kind: "bracket" | "box";
|
|
154
|
+
from: number;
|
|
155
|
+
to: number;
|
|
156
|
+
text: string;
|
|
157
|
+
textRect: Rect;
|
|
158
|
+
textY: number;
|
|
159
|
+
until?: number;
|
|
160
|
+
color: ColorKey;
|
|
161
|
+
}
|
|
162
|
+
/** 拡大の帯の線の両端の箱。`column` は線を出す列、`into` は受ける列の目盛り */
|
|
163
|
+
interface TimeWire {
|
|
164
|
+
step: number;
|
|
165
|
+
event: number;
|
|
166
|
+
from: TimeBox;
|
|
167
|
+
to: TimeBox;
|
|
168
|
+
column: number;
|
|
169
|
+
into: number;
|
|
170
|
+
}
|
|
171
|
+
interface TimeLayout extends Layout {
|
|
172
|
+
kind: "time";
|
|
173
|
+
axis: TimeAxis;
|
|
174
|
+
rows: TimeRowPlaced[];
|
|
175
|
+
marks: TimeMark[];
|
|
176
|
+
ticks: TimeTick[];
|
|
177
|
+
/** 細かい目盛りの線を引く境 */
|
|
178
|
+
minor: number[];
|
|
179
|
+
periods: TimePeriodPlaced[];
|
|
180
|
+
points: TimePointPlaced[];
|
|
181
|
+
zoom?: TimeZoom;
|
|
182
|
+
spans: TimeSpanPlaced[];
|
|
183
|
+
wires: TimeWire[];
|
|
184
|
+
/** 針の線の上端と下端 */
|
|
185
|
+
needle: {
|
|
186
|
+
y1: number;
|
|
187
|
+
y2: number;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
66
191
|
/** 秒で表した、見えている間。`end` の時刻は含まない。 */
|
|
67
192
|
interface Span {
|
|
68
193
|
start: number;
|
|
@@ -87,6 +212,8 @@ interface LabelTime extends Span {
|
|
|
87
212
|
event: number;
|
|
88
213
|
/** 状態遷移図だけが持つ。段が終わった後に薄く残す間 */
|
|
89
214
|
after?: Span;
|
|
215
|
+
/** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから、最後の段と同じ濃さで出し直す間 (#3200) */
|
|
216
|
+
again?: Span;
|
|
90
217
|
}
|
|
91
218
|
/** 処理、箱の字の書き換え、中身の帯の値が起きる時刻。 */
|
|
92
219
|
interface EventTime {
|
|
@@ -116,16 +243,40 @@ interface Timeline {
|
|
|
116
243
|
events: EventTime[];
|
|
117
244
|
/** 段ごとの止め絵の時刻。その段で起きることが全部見えている */
|
|
118
245
|
stills: number[];
|
|
246
|
+
/** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから繰り返す前まで、全ての段の線の名前と箱の中の処理を出す間 (#3200) */
|
|
247
|
+
whole?: Span;
|
|
119
248
|
/** 状態遷移図だけが持つ */
|
|
120
249
|
states?: StateTime[];
|
|
250
|
+
/** 時間軸の図だけが持つ (#3165)。針の動き。[時刻, 目盛りの境の位置] の並びで、間は真っ直ぐ進む */
|
|
251
|
+
needle?: [number, number][];
|
|
252
|
+
/** 時間軸の図だけが持つ。針が目盛りを過ぎた (右の境に着いた) 時刻 */
|
|
253
|
+
units?: {
|
|
254
|
+
unit: number;
|
|
255
|
+
passed: number;
|
|
256
|
+
}[];
|
|
257
|
+
/** 時間軸の図だけが持つ。物差しの欄の満ち具合の動き。[時刻, 割合] の並びで、間は真っ直ぐ変わる */
|
|
258
|
+
meters?: {
|
|
259
|
+
field: string;
|
|
260
|
+
keys: [number, number][];
|
|
261
|
+
}[];
|
|
121
262
|
}
|
|
122
263
|
|
|
123
264
|
interface RenderOptions {
|
|
124
265
|
/** 色味の名前。書かないか知らない名前なら紙と墨 */
|
|
125
266
|
palette?: string;
|
|
267
|
+
/**
|
|
268
|
+
* `palette` の色味に重ねる色の値 (#3198)。鍵は色味が持つ色の変数の名前 (`bg`、`ink`、`c-green` など) で、値は描く `theme` の色になる。
|
|
269
|
+
* 渡さない色は色味の値のまま残る。色味に無い名前と、色の値として読めない値は、名前を挙げて描かずに断る
|
|
270
|
+
*/
|
|
271
|
+
colors?: Colors;
|
|
126
272
|
theme?: Theme;
|
|
127
273
|
/** 描く部品が出す字 (断りの文、全体図の札、読み上げの名前) の言葉。書かなければ日本語 (#3001) */
|
|
128
274
|
lang?: NotationLang;
|
|
275
|
+
/**
|
|
276
|
+
* 最後の段の止め絵に、全ての段の線の名前と箱の中の処理を最後の段と同じ濃さで出す (#3200)。途中の段の止め絵は今の段の名前だけを出す。
|
|
277
|
+
* 箱の下の 1 行に出す処理は、その箱で最後に起きた処理か書き換えの字を出す。違う段の名前が重なっても置き直さず、最後の段の重なり (`overlaps`) に出す
|
|
278
|
+
*/
|
|
279
|
+
still?: boolean;
|
|
129
280
|
}
|
|
130
281
|
interface Rendered {
|
|
131
282
|
svg: string;
|
|
@@ -154,6 +305,10 @@ interface PlayerOptions extends RenderOptions {
|
|
|
154
305
|
* 枠の高さが決まっている置き場 (カタログの拡大の重ね窓) で使う。枠の高さが図に合わせて伸びる置き場で使うと、描くたびに低くなる
|
|
155
306
|
*/
|
|
156
307
|
fitHeight?: boolean;
|
|
308
|
+
/** 置いた時に流さず、段 `pausedAt` (0 から) の止め絵で止めて置く。段の数を超えた時は最後の段で止める。書かなければ置いた時から流す (#3200) */
|
|
309
|
+
pausedAt?: number;
|
|
310
|
+
/** 流した時に最後の段の止め絵で止め、繰り返さない。最後の段で止まった図を流すと、最初の段から流し直す (#3200) */
|
|
311
|
+
playOnce?: boolean;
|
|
157
312
|
}
|
|
158
313
|
interface Player {
|
|
159
314
|
/** 今の段 (0 から) */
|
|
@@ -178,6 +333,7 @@ declare function mountDiagram(host: HTMLElement, diagram: unknown, options?: Pla
|
|
|
178
333
|
* 見本帳 (`docs/design/base/engine.js` の `G`) と同じ形を持つ。`block` だけは見本帳が絵を手で描いていたので、ここで足した。
|
|
179
334
|
* `undo` (戻る矢印) と `yen` (円の印) は、注文の試作 (`docs/design/base/scenes/order.js`) が返品と返金に足した形 (#3171)。
|
|
180
335
|
* package の入口からも出し、見本帳の部品「絵」の頁がこの表から使える絵柄の一覧を作る。1 つずつの絵は `iconSvg` が描く (#3172)。
|
|
336
|
+
* `flag` (旗) は、時間軸の図の節目の丸に描く形 (#3165)。ブロックの確定の試作 (`docs/design/base/scenes/finality.js`) が持っていた。
|
|
181
337
|
*/
|
|
182
338
|
declare const ICONS: Readonly<Record<string, string>>;
|
|
183
339
|
|
|
@@ -192,4 +348,4 @@ declare function chooseView(rendered: Pick<Rendered, "layout" | "view">, frameWi
|
|
|
192
348
|
textPx: number;
|
|
193
349
|
};
|
|
194
350
|
|
|
195
|
-
export { type CarrierTime, CheckOptions, Diagram, type EdgeTime, type EventTime, FORMAT_VERSION, type Fence, FieldError, ICONS, type LabelTime, Layout, type LineError, NotationLang, Overlap, type ParseOptions, type Parsed, type Player, type PlayerOptions, type Read, Rect, type RenderOptions, type Rendered, type Span, type StateTime, Theme, type Timeline, ViewMode, chooseView, extractDiagrams, iconSvg, mountDiagram, parseNotation, printNotation, readDiagram, renderDiagram };
|
|
351
|
+
export { type CarrierTime, CheckOptions, ColorKey, Colors, Diagram, type EdgeTime, type EventTime, FORMAT_VERSION, type Fence, FieldError, ICONS, type LabelTime, Layout, type LineError, NotationLang, Overlap, type ParseOptions, type Parsed, type Player, type PlayerOptions, Point, type Read, Rect, type RenderOptions, type Rendered, SceneBox, type Span, type StateTime, Theme, type TimeAxis, type TimeBox, type TimeColumn, type TimeLayout, type TimeMark, type TimePeriodPlaced, type TimePointPlaced, type TimeRowPlaced, type TimeSpanPlaced, type TimeTick, type TimeWire, type TimeZoom, type Timeline, ViewMode, chooseView, extractDiagrams, iconSvg, mountDiagram, parseNotation, printNotation, readDiagram, renderDiagram };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NotationLang, D as Diagram, F as FieldError, C as CheckOptions,
|
|
2
|
-
export { B as Box,
|
|
1
|
+
import { N as NotationLang, D as Diagram, F as FieldError, C as CheckOptions, S as SceneBox, R as Rect, L as Layout, a as ColorKey, P as Point, b as Colors, T as Theme, V as ViewMode, O as Overlap } from './ink-B8EZL7JV.js';
|
|
2
|
+
export { B as Box, c as Carry, d as Checked, e as Color, f as ColorName, g as DEFAULT_PALETTE, h as DiagramEvent, i as FONTS, j as Family, G as GitBranch, k as GitCommit, I as InkPart, l as LabelSide, m as OverlapSpot, n as PALETTES, o as Palette, p as READABLE_PX, q as Region, r as SceneAction, s as SceneBadge, t as SceneEdge, u as SceneEnd, v as SceneField, w as SceneLabel, x as SceneLifeline, y as ScenePath, z as SceneRegion, A as SceneSide, E as SceneStrip, H as SceneTrail, J as StatePath, K as Step, M as StepSource, Q as StripMeter, U as TimeMarkEvent, W as TimePeriod, X as TimePoint, Y as TimeRow, Z as TimeScale, _ as TimeSpanEvent, $ as TimeSpec, a0 as describeOverlap, a1 as resolvePalette, a2 as validateDiagram } from './ink-B8EZL7JV.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Markdown の中の dragon の囲み (```dragon) を、囲みごとに取り出す。
|
|
@@ -46,6 +46,9 @@ declare function parseNotation(notation: string, options?: ParseOptions): Parsed
|
|
|
46
46
|
* 区画の箱が飛び飛びの時は同じ `group` を開き直す。区画の並びが箱の現れる順と違う時と、
|
|
47
47
|
* 箱の無い区画がある時は、先に全ての区画を中の無い `group … end` で宣言してから開き直す。
|
|
48
48
|
* 枝分かれの図 (#3164) は、枝の `branch` の行を箱より前に書き、札を動かす線の運ぶ物が送る側の名前の札なら書かない。
|
|
49
|
+
* 時間軸の図 (#3165) は、目盛りと区切りと印の列と節目と拡大の範囲の行を箱より前に書き、物差しの欄の後ろに `[meter: <割合>]` を書く。
|
|
50
|
+
* 時間軸の図の `note` は属性を持てるので、`[` を含む字を `"` で囲む。
|
|
51
|
+
* 段の出典 (#3199) は `say` と `code` の後ろ、段の中で起きることより前に、JSON の並びのまま 1 つずつ `source` の行に書く。
|
|
49
52
|
*/
|
|
50
53
|
|
|
51
54
|
declare function printNotation(diagram: Diagram): string;
|
|
@@ -63,6 +66,128 @@ type Read = {
|
|
|
63
66
|
/** 原本を読む。道具より新しい版は描かずに断り、形の誤りは検査の誤りとして返す。誤りの文は `options.lang` (渡さなければ日本語) で出す。 */
|
|
64
67
|
declare function readDiagram(input: unknown, options?: CheckOptions): Read;
|
|
65
68
|
|
|
69
|
+
/** 時間軸。`x` から目盛り 1 つの幅 `unit` で `count` 個並べ、`line` の高さに時刻の目盛りの線を引く */
|
|
70
|
+
interface TimeAxis {
|
|
71
|
+
x: number;
|
|
72
|
+
w: number;
|
|
73
|
+
unit: number;
|
|
74
|
+
count: number;
|
|
75
|
+
line: number;
|
|
76
|
+
}
|
|
77
|
+
/** 印の列 */
|
|
78
|
+
interface TimeRowPlaced extends Rect {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
color: ColorKey;
|
|
82
|
+
}
|
|
83
|
+
/** 目盛り 1 つの印。`empty` は空きの印。`colors` は色を変えた段と出来事と色 */
|
|
84
|
+
interface TimeMark extends Rect {
|
|
85
|
+
row: string;
|
|
86
|
+
unit: number;
|
|
87
|
+
empty: boolean;
|
|
88
|
+
color: ColorKey;
|
|
89
|
+
colors: {
|
|
90
|
+
step: number;
|
|
91
|
+
event: number;
|
|
92
|
+
color: ColorKey;
|
|
93
|
+
}[];
|
|
94
|
+
}
|
|
95
|
+
/** 時刻の字。目盛りの境 `at` に置き、字の左端を `left` に、基準線を `y` に置く */
|
|
96
|
+
interface TimeTick {
|
|
97
|
+
at: number;
|
|
98
|
+
x: number;
|
|
99
|
+
text: string;
|
|
100
|
+
left: number;
|
|
101
|
+
y: number;
|
|
102
|
+
}
|
|
103
|
+
/** 区切り。`name` は区切りの名前と番号、`range` はその区切りの目盛りの番号の範囲。字は区切りの真ん中に置く */
|
|
104
|
+
interface TimePeriodPlaced extends Rect {
|
|
105
|
+
index: number;
|
|
106
|
+
from: number;
|
|
107
|
+
to: number;
|
|
108
|
+
name: string;
|
|
109
|
+
range: string;
|
|
110
|
+
nameY: number;
|
|
111
|
+
rangeY: number;
|
|
112
|
+
}
|
|
113
|
+
/** 節目。置いた目盛り `unit` の印の下の旗の丸。`text` は名札と状態の字が占める所、`changes` は状態の字と色を変えた段と出来事 */
|
|
114
|
+
interface TimePointPlaced {
|
|
115
|
+
id: string;
|
|
116
|
+
unit: number;
|
|
117
|
+
cx: number;
|
|
118
|
+
cy: number;
|
|
119
|
+
r: number;
|
|
120
|
+
text: Rect;
|
|
121
|
+
changes: {
|
|
122
|
+
step: number;
|
|
123
|
+
event: number;
|
|
124
|
+
text: string;
|
|
125
|
+
color?: ColorKey;
|
|
126
|
+
}[];
|
|
127
|
+
}
|
|
128
|
+
/** 拡大の帯の箱。`row` は同じ名札の印の列、`empty` はその列が空きにした目盛りの列の箱 */
|
|
129
|
+
interface TimeBox extends SceneBox {
|
|
130
|
+
row?: string;
|
|
131
|
+
empty?: boolean;
|
|
132
|
+
}
|
|
133
|
+
/** 拡大の帯の列。目盛り `unit` の列に、宣言した箱を同じ並びで置く。`head` は列の上の字 */
|
|
134
|
+
interface TimeColumn extends Rect {
|
|
135
|
+
unit: number;
|
|
136
|
+
head: string;
|
|
137
|
+
boxes: TimeBox[];
|
|
138
|
+
}
|
|
139
|
+
/** 拡大の帯。軸の上の拡大した範囲の枠 `frame` と、枠から帯へつなぐ点線 `guides`。`empty` は空きの枠の字、`headY` は列の上の字の基準線 */
|
|
140
|
+
interface TimeZoom {
|
|
141
|
+
from: number;
|
|
142
|
+
to: number;
|
|
143
|
+
frame: Rect;
|
|
144
|
+
guides: Point[][];
|
|
145
|
+
columns: TimeColumn[];
|
|
146
|
+
empty: string;
|
|
147
|
+
headY: number;
|
|
148
|
+
}
|
|
149
|
+
/** 範囲の括弧 (`bracket`) か囲み (`box`)。`until` は消える段 (無ければ最後の段まで残る)。`textY` は字の基準線 */
|
|
150
|
+
interface TimeSpanPlaced extends Rect {
|
|
151
|
+
step: number;
|
|
152
|
+
event: number;
|
|
153
|
+
kind: "bracket" | "box";
|
|
154
|
+
from: number;
|
|
155
|
+
to: number;
|
|
156
|
+
text: string;
|
|
157
|
+
textRect: Rect;
|
|
158
|
+
textY: number;
|
|
159
|
+
until?: number;
|
|
160
|
+
color: ColorKey;
|
|
161
|
+
}
|
|
162
|
+
/** 拡大の帯の線の両端の箱。`column` は線を出す列、`into` は受ける列の目盛り */
|
|
163
|
+
interface TimeWire {
|
|
164
|
+
step: number;
|
|
165
|
+
event: number;
|
|
166
|
+
from: TimeBox;
|
|
167
|
+
to: TimeBox;
|
|
168
|
+
column: number;
|
|
169
|
+
into: number;
|
|
170
|
+
}
|
|
171
|
+
interface TimeLayout extends Layout {
|
|
172
|
+
kind: "time";
|
|
173
|
+
axis: TimeAxis;
|
|
174
|
+
rows: TimeRowPlaced[];
|
|
175
|
+
marks: TimeMark[];
|
|
176
|
+
ticks: TimeTick[];
|
|
177
|
+
/** 細かい目盛りの線を引く境 */
|
|
178
|
+
minor: number[];
|
|
179
|
+
periods: TimePeriodPlaced[];
|
|
180
|
+
points: TimePointPlaced[];
|
|
181
|
+
zoom?: TimeZoom;
|
|
182
|
+
spans: TimeSpanPlaced[];
|
|
183
|
+
wires: TimeWire[];
|
|
184
|
+
/** 針の線の上端と下端 */
|
|
185
|
+
needle: {
|
|
186
|
+
y1: number;
|
|
187
|
+
y2: number;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
66
191
|
/** 秒で表した、見えている間。`end` の時刻は含まない。 */
|
|
67
192
|
interface Span {
|
|
68
193
|
start: number;
|
|
@@ -87,6 +212,8 @@ interface LabelTime extends Span {
|
|
|
87
212
|
event: number;
|
|
88
213
|
/** 状態遷移図だけが持つ。段が終わった後に薄く残す間 */
|
|
89
214
|
after?: Span;
|
|
215
|
+
/** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから、最後の段と同じ濃さで出し直す間 (#3200) */
|
|
216
|
+
again?: Span;
|
|
90
217
|
}
|
|
91
218
|
/** 処理、箱の字の書き換え、中身の帯の値が起きる時刻。 */
|
|
92
219
|
interface EventTime {
|
|
@@ -116,16 +243,40 @@ interface Timeline {
|
|
|
116
243
|
events: EventTime[];
|
|
117
244
|
/** 段ごとの止め絵の時刻。その段で起きることが全部見えている */
|
|
118
245
|
stills: number[];
|
|
246
|
+
/** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから繰り返す前まで、全ての段の線の名前と箱の中の処理を出す間 (#3200) */
|
|
247
|
+
whole?: Span;
|
|
119
248
|
/** 状態遷移図だけが持つ */
|
|
120
249
|
states?: StateTime[];
|
|
250
|
+
/** 時間軸の図だけが持つ (#3165)。針の動き。[時刻, 目盛りの境の位置] の並びで、間は真っ直ぐ進む */
|
|
251
|
+
needle?: [number, number][];
|
|
252
|
+
/** 時間軸の図だけが持つ。針が目盛りを過ぎた (右の境に着いた) 時刻 */
|
|
253
|
+
units?: {
|
|
254
|
+
unit: number;
|
|
255
|
+
passed: number;
|
|
256
|
+
}[];
|
|
257
|
+
/** 時間軸の図だけが持つ。物差しの欄の満ち具合の動き。[時刻, 割合] の並びで、間は真っ直ぐ変わる */
|
|
258
|
+
meters?: {
|
|
259
|
+
field: string;
|
|
260
|
+
keys: [number, number][];
|
|
261
|
+
}[];
|
|
121
262
|
}
|
|
122
263
|
|
|
123
264
|
interface RenderOptions {
|
|
124
265
|
/** 色味の名前。書かないか知らない名前なら紙と墨 */
|
|
125
266
|
palette?: string;
|
|
267
|
+
/**
|
|
268
|
+
* `palette` の色味に重ねる色の値 (#3198)。鍵は色味が持つ色の変数の名前 (`bg`、`ink`、`c-green` など) で、値は描く `theme` の色になる。
|
|
269
|
+
* 渡さない色は色味の値のまま残る。色味に無い名前と、色の値として読めない値は、名前を挙げて描かずに断る
|
|
270
|
+
*/
|
|
271
|
+
colors?: Colors;
|
|
126
272
|
theme?: Theme;
|
|
127
273
|
/** 描く部品が出す字 (断りの文、全体図の札、読み上げの名前) の言葉。書かなければ日本語 (#3001) */
|
|
128
274
|
lang?: NotationLang;
|
|
275
|
+
/**
|
|
276
|
+
* 最後の段の止め絵に、全ての段の線の名前と箱の中の処理を最後の段と同じ濃さで出す (#3200)。途中の段の止め絵は今の段の名前だけを出す。
|
|
277
|
+
* 箱の下の 1 行に出す処理は、その箱で最後に起きた処理か書き換えの字を出す。違う段の名前が重なっても置き直さず、最後の段の重なり (`overlaps`) に出す
|
|
278
|
+
*/
|
|
279
|
+
still?: boolean;
|
|
129
280
|
}
|
|
130
281
|
interface Rendered {
|
|
131
282
|
svg: string;
|
|
@@ -154,6 +305,10 @@ interface PlayerOptions extends RenderOptions {
|
|
|
154
305
|
* 枠の高さが決まっている置き場 (カタログの拡大の重ね窓) で使う。枠の高さが図に合わせて伸びる置き場で使うと、描くたびに低くなる
|
|
155
306
|
*/
|
|
156
307
|
fitHeight?: boolean;
|
|
308
|
+
/** 置いた時に流さず、段 `pausedAt` (0 から) の止め絵で止めて置く。段の数を超えた時は最後の段で止める。書かなければ置いた時から流す (#3200) */
|
|
309
|
+
pausedAt?: number;
|
|
310
|
+
/** 流した時に最後の段の止め絵で止め、繰り返さない。最後の段で止まった図を流すと、最初の段から流し直す (#3200) */
|
|
311
|
+
playOnce?: boolean;
|
|
157
312
|
}
|
|
158
313
|
interface Player {
|
|
159
314
|
/** 今の段 (0 から) */
|
|
@@ -178,6 +333,7 @@ declare function mountDiagram(host: HTMLElement, diagram: unknown, options?: Pla
|
|
|
178
333
|
* 見本帳 (`docs/design/base/engine.js` の `G`) と同じ形を持つ。`block` だけは見本帳が絵を手で描いていたので、ここで足した。
|
|
179
334
|
* `undo` (戻る矢印) と `yen` (円の印) は、注文の試作 (`docs/design/base/scenes/order.js`) が返品と返金に足した形 (#3171)。
|
|
180
335
|
* package の入口からも出し、見本帳の部品「絵」の頁がこの表から使える絵柄の一覧を作る。1 つずつの絵は `iconSvg` が描く (#3172)。
|
|
336
|
+
* `flag` (旗) は、時間軸の図の節目の丸に描く形 (#3165)。ブロックの確定の試作 (`docs/design/base/scenes/finality.js`) が持っていた。
|
|
181
337
|
*/
|
|
182
338
|
declare const ICONS: Readonly<Record<string, string>>;
|
|
183
339
|
|
|
@@ -192,4 +348,4 @@ declare function chooseView(rendered: Pick<Rendered, "layout" | "view">, frameWi
|
|
|
192
348
|
textPx: number;
|
|
193
349
|
};
|
|
194
350
|
|
|
195
|
-
export { type CarrierTime, CheckOptions, Diagram, type EdgeTime, type EventTime, FORMAT_VERSION, type Fence, FieldError, ICONS, type LabelTime, Layout, type LineError, NotationLang, Overlap, type ParseOptions, type Parsed, type Player, type PlayerOptions, type Read, Rect, type RenderOptions, type Rendered, type Span, type StateTime, Theme, type Timeline, ViewMode, chooseView, extractDiagrams, iconSvg, mountDiagram, parseNotation, printNotation, readDiagram, renderDiagram };
|
|
351
|
+
export { type CarrierTime, CheckOptions, ColorKey, Colors, Diagram, type EdgeTime, type EventTime, FORMAT_VERSION, type Fence, FieldError, ICONS, type LabelTime, Layout, type LineError, NotationLang, Overlap, type ParseOptions, type Parsed, type Player, type PlayerOptions, Point, type Read, Rect, type RenderOptions, type Rendered, SceneBox, type Span, type StateTime, Theme, type TimeAxis, type TimeBox, type TimeColumn, type TimeLayout, type TimeMark, type TimePeriodPlaced, type TimePointPlaced, type TimeRowPlaced, type TimeSpanPlaced, type TimeTick, type TimeWire, type TimeZoom, type Timeline, ViewMode, chooseView, extractDiagrams, iconSvg, mountDiagram, parseNotation, printNotation, readDiagram, renderDiagram };
|