@meltemi/diagrams-model 1.9.0 → 1.10.17
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/dist/c4.d.ts +5 -4
- package/dist/c4.d.ts.map +1 -1
- package/dist/c4.js +115 -36
- package/dist/c4.js.map +1 -1
- package/dist/diagram-types.d.ts.map +1 -1
- package/dist/diagram-types.js +10 -1
- package/dist/diagram-types.js.map +1 -1
- package/dist/diff.d.ts +1 -1
- package/dist/diff.d.ts.map +1 -1
- package/dist/diff.js +27 -0
- package/dist/diff.js.map +1 -1
- package/dist/export.d.ts.map +1 -1
- package/dist/export.js +1 -16
- package/dist/export.js.map +1 -1
- package/dist/flow.d.ts +100 -8
- package/dist/flow.d.ts.map +1 -1
- package/dist/flow.js +614 -66
- package/dist/flow.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +48 -0
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +28 -1
- package/dist/json.js.map +1 -1
- package/dist/messages/changes.d.ts +2 -0
- package/dist/messages/changes.d.ts.map +1 -1
- package/dist/messages/changes.js +4 -0
- package/dist/messages/changes.js.map +1 -1
- package/dist/messages/en.d.ts +83 -9
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +92 -14
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/es.d.ts.map +1 -1
- package/dist/messages/es.js +52 -11
- package/dist/messages/es.js.map +1 -1
- package/dist/messages/index.d.ts +44 -6
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/outline.d.ts +14 -0
- package/dist/outline.d.ts.map +1 -0
- package/dist/outline.js +27 -0
- package/dist/outline.js.map +1 -0
- package/dist/scenario.d.ts +15 -2
- package/dist/scenario.d.ts.map +1 -1
- package/dist/scenario.js +37 -1
- package/dist/scenario.js.map +1 -1
- package/dist/schema.d.ts +102 -11
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +168 -13
- package/dist/schema.js.map +1 -1
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +252 -12
- package/dist/sequence.js.map +1 -1
- package/dist/story.d.ts +8 -0
- package/dist/story.d.ts.map +1 -1
- package/dist/story.js +39 -12
- package/dist/story.js.map +1 -1
- package/dist/style-values.d.ts +9 -0
- package/dist/style-values.d.ts.map +1 -1
- package/dist/style-values.js +82 -27
- package/dist/style-values.js.map +1 -1
- package/dist/types.d.ts +123 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/schema.d.ts
CHANGED
|
@@ -6,8 +6,11 @@ export type ValueSpec = {
|
|
|
6
6
|
readonly kind: "enum";
|
|
7
7
|
readonly values: readonly string[];
|
|
8
8
|
readonly default?: string;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
/** A quoted string; with `nonEmpty`, one with some text, such as a font stack. */
|
|
11
|
+
| {
|
|
10
12
|
readonly kind: "string";
|
|
13
|
+
readonly nonEmpty?: boolean;
|
|
11
14
|
} | {
|
|
12
15
|
readonly kind: "icon";
|
|
13
16
|
}
|
|
@@ -69,6 +72,13 @@ export type ValueSpec = {
|
|
|
69
72
|
/** A quoted `http:`, `https:` or `mailto:` URL, or a relative one. */
|
|
70
73
|
| {
|
|
71
74
|
readonly kind: "url";
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `tag "Text"`: one line of quoted text, not empty, written any number of times in a block (a
|
|
78
|
+
* sequence message's or participant's), each a pill of its owner.
|
|
79
|
+
*/
|
|
80
|
+
| {
|
|
81
|
+
readonly kind: "tag";
|
|
72
82
|
};
|
|
73
83
|
export type PropertyTable = Readonly<Record<string, ValueSpec>>;
|
|
74
84
|
export declare const DIRECTIONS: readonly ["LR", "RL", "TB", "BT"];
|
|
@@ -96,7 +106,7 @@ export declare const ANIMATION_DEFAULT_DURATIONS: {
|
|
|
96
106
|
/** Element kinds of flow diagrams. */
|
|
97
107
|
export declare const ELEMENT_KINDS: readonly ["node", "decision", "data", "group", "note", "tag"];
|
|
98
108
|
/** Object kinds of free diagrams. */
|
|
99
|
-
export declare const FREE_ELEMENT_KINDS: readonly ["box", "text", "icon", "image", "group"];
|
|
109
|
+
export declare const FREE_ELEMENT_KINDS: readonly ["box", "text", "icon", "image", "note", "sticky", "line", "pen", "group"];
|
|
100
110
|
/** Participant kinds of sequence diagrams. */
|
|
101
111
|
export declare const PARTICIPANT_KINDS: readonly ["participant", "actor", "boundary", "control", "entity", "database", "collections", "queue"];
|
|
102
112
|
/** Element kinds of sequence diagrams: the participants and their groups. */
|
|
@@ -116,16 +126,29 @@ export declare const C4_LEVELS: readonly ["context", "container", "component"];
|
|
|
116
126
|
/** The type line C4 shapes draw under the label. */
|
|
117
127
|
export declare const ENTITY_TYPE_NAMES: Readonly<Record<string, string>>;
|
|
118
128
|
/** Every element kind of every compiled profile. */
|
|
119
|
-
export declare const ALL_ELEMENT_KINDS: readonly ["node", "decision", "data", "group", "note", "tag", "box", "text", "icon", "image", "participant", "actor", "boundary", "control", "entity", "database", "collections", "queue", "person", "system", "container", "datastore", "component"];
|
|
129
|
+
export declare const ALL_ELEMENT_KINDS: readonly ["node", "decision", "data", "group", "note", "tag", "box", "text", "icon", "image", "sticky", "line", "pen", "participant", "actor", "boundary", "control", "entity", "database", "collections", "queue", "person", "system", "container", "datastore", "component"];
|
|
120
130
|
/** Fragment operators of sequence diagrams. */
|
|
121
131
|
export declare const FRAGMENT_OPERATORS: readonly ["alt", "opt", "loop", "par", "break", "critical", "region"];
|
|
122
132
|
/** The keyword of further branches of the operators that have them. */
|
|
123
133
|
export declare const FRAGMENT_BRANCH_KEYWORDS: Readonly<Record<string, string>>;
|
|
124
134
|
/** Event statements of sequence diagrams, besides messages. */
|
|
125
|
-
export declare const SEQUENCE_EVENTS: readonly ["activate", "deactivate", "create", "destroy", "note", "alt", "opt", "loop", "par", "break", "critical", "region", "divider", "delay"];
|
|
135
|
+
export declare const SEQUENCE_EVENTS: readonly ["activate", "deactivate", "create", "destroy", "note", "alt", "opt", "loop", "par", "break", "critical", "region", "divider", "delay", "return"];
|
|
126
136
|
/** Statements of a `scenario` block. */
|
|
127
137
|
export declare const SCENARIO_STATEMENTS: readonly ["choose", "repeat", "skip", "take"];
|
|
128
138
|
export declare const LINE_STYLES: readonly ["solid", "dashed", "dotted"];
|
|
139
|
+
/** Where a relation's token puts its heads: at the end, at both ends, or at neither. */
|
|
140
|
+
export type RelationHeads = "end" | "both" | "none";
|
|
141
|
+
/**
|
|
142
|
+
* What each relation token draws: its line and its heads. One dash more is dashed; `<` adds the
|
|
143
|
+
* head at the start; the lines `--` and `---` drop the head glyph. A profile's `arrows` table says
|
|
144
|
+
* which of them it takes.
|
|
145
|
+
*/
|
|
146
|
+
export declare const RELATION_ARROWS: Readonly<Record<string, {
|
|
147
|
+
readonly line: "solid" | "dashed";
|
|
148
|
+
readonly heads: RelationHeads;
|
|
149
|
+
}>>;
|
|
150
|
+
/** The token that writes a relation of this line and these heads: `arrowToken("dashed", "none")` is `---`. */
|
|
151
|
+
export declare function arrowToken(line: "solid" | "dashed", heads: RelationHeads): string;
|
|
129
152
|
export declare const DIAGRAM_TYPES: readonly ["flow", "sequence", "c4", "free"];
|
|
130
153
|
export declare const MESSAGE_KINDS: readonly ["sync", "async"];
|
|
131
154
|
export declare const PATTERNS: readonly ["none", "hatch", "dots", "cross"];
|
|
@@ -136,9 +159,26 @@ export declare const PATTERNS: readonly ["none", "hatch", "dots", "cross"];
|
|
|
136
159
|
export declare const ARROWHEADS: readonly ["triangle", "open", "none", "triangleOutline", "diamond", "diamondOutline", "circle", "circleOutline", "bar", "cross", "many", "oneOrMany", "onlyOne", "zeroOrOne", "zeroOrMany"];
|
|
137
160
|
/** Corners of straight and elbow connectors. */
|
|
138
161
|
export declare const CORNERS: readonly ["sharp", "rounded"];
|
|
162
|
+
/** How a theme paints strokes: clean, or in two jittered passes of a hand-drawn look. */
|
|
163
|
+
export declare const SKETCH_LEVELS: readonly ["none", "light", "rough"];
|
|
139
164
|
/** Targets of `rule <kind> { }`: the element kinds of every profile, `relation` and `fragment`. */
|
|
140
|
-
export declare const RULE_KINDS: readonly ["node", "decision", "data", "group", "note", "tag", "box", "text", "icon", "image", "participant", "actor", "boundary", "control", "entity", "database", "collections", "queue", "person", "system", "container", "datastore", "component", "relation", "fragment"];
|
|
141
|
-
|
|
165
|
+
export declare const RULE_KINDS: readonly ["node", "decision", "data", "group", "note", "tag", "box", "text", "icon", "image", "sticky", "line", "pen", "participant", "actor", "boundary", "control", "entity", "database", "collections", "queue", "person", "system", "container", "datastore", "component", "relation", "fragment"];
|
|
166
|
+
/**
|
|
167
|
+
* Canvas presets: a document warns past 1,200 px, a slide keeps 16:9, and a board grows with what
|
|
168
|
+
* is drawn on it, unreported.
|
|
169
|
+
*/
|
|
170
|
+
export declare const PRESETS: readonly ["document", "slide", "board"];
|
|
171
|
+
/** How a list group (`layout column|row` in a free group block) arranges its children. */
|
|
172
|
+
export declare const LIST_LAYOUTS: readonly ["column", "row"];
|
|
173
|
+
/** Where the children of a list sit across its axis (`align` in a free group block). */
|
|
174
|
+
export declare const LIST_ALIGNS: readonly ["start", "center", "end", "stretch"];
|
|
175
|
+
/** The distance a list's `spacing` may write between its children, in pixels. */
|
|
176
|
+
export declare const LIST_SPACING_RANGE: {
|
|
177
|
+
readonly min: 0;
|
|
178
|
+
readonly max: 400;
|
|
179
|
+
};
|
|
180
|
+
/** The properties of a free group block that make it a list. */
|
|
181
|
+
export declare const LIST_PROPERTIES: readonly ["layout", "spacing", "align"];
|
|
142
182
|
/**
|
|
143
183
|
* Where the icon of a node, decision, data store or box goes: beside, above or below its text, or
|
|
144
184
|
* at the centre as the picture of the box, the label at the edge `labelPosition` names.
|
|
@@ -170,7 +210,8 @@ export declare const ROTATION_RANGE: {
|
|
|
170
210
|
};
|
|
171
211
|
/**
|
|
172
212
|
* The element kinds `rotation` turns: every element of flow diagrams and free compositions but
|
|
173
|
-
* groups, which hold other elements
|
|
213
|
+
* groups, which hold other elements, and lines and pens, whose points are written as they are
|
|
214
|
+
* drawn.
|
|
174
215
|
*/
|
|
175
216
|
export declare function takesRotation(kind: string): boolean;
|
|
176
217
|
/** Whether a profile's elements take `rotation`: sequence diagrams and C4 views do not. */
|
|
@@ -178,16 +219,23 @@ export declare function profileTakesRotation(profile: {
|
|
|
178
219
|
readonly name: string;
|
|
179
220
|
}): boolean;
|
|
180
221
|
export declare const TEXT_ALIGNS: readonly ["left", "center", "right"];
|
|
222
|
+
/** Where a free box's text block sits within the shape's text band, top to bottom. */
|
|
223
|
+
export declare const VERTICAL_ALIGNS: readonly ["top", "middle", "bottom"];
|
|
181
224
|
export declare const FONT_WEIGHTS: readonly [400, 500, 600, 700];
|
|
182
225
|
/** The layer every free diagram has; listed last when `layers` does not name it. */
|
|
183
226
|
export declare const MAIN_LAYER = "main";
|
|
184
227
|
export declare const FRAME_MODES: readonly ["none", "footer", "header"];
|
|
185
228
|
export declare const MARK_MODES: readonly ["meltemi", "none"];
|
|
186
229
|
/** Themes whose tokens are built into the layout package; file themes may extend them. */
|
|
187
|
-
export declare const BUILT_IN_THEMES: readonly ["technical.light", "technical.dark", "editorial.light", "editorial.dark", "stage.light", "stage.dark"];
|
|
230
|
+
export declare const BUILT_IN_THEMES: readonly ["technical.light", "technical.dark", "editorial.light", "editorial.dark", "stage.light", "stage.dark", "sketch.light", "sketch.dark"];
|
|
188
231
|
export declare const DEFAULT_THEME = "technical.light";
|
|
232
|
+
/**
|
|
233
|
+
* The colour tokens of whiteboards: highlighter strokes, the default fill of stickies and their
|
|
234
|
+
* text. Colour tokens like the others; the theme panel groups them apart.
|
|
235
|
+
*/
|
|
236
|
+
export declare const THEME_WHITEBOARD_TOKENS: readonly ["highlight", "sticky", "stickyText"];
|
|
189
237
|
/** Colour tokens of a theme, in the order they are documented. */
|
|
190
|
-
export declare const THEME_COLOR_TOKENS: readonly ["background", "surface", "ink", "muted", "line", "connector", "band", "bandLine", "tag", "tagText", "accent", "accentEnd", "success", "warning", "danger", "info"];
|
|
238
|
+
export declare const THEME_COLOR_TOKENS: readonly ["background", "surface", "ink", "muted", "line", "connector", "band", "bandLine", "tag", "tagText", "accent", "accentEnd", "success", "warning", "danger", "info", "highlight", "sticky", "stickyText"];
|
|
191
239
|
/**
|
|
192
240
|
* Colour tokens the canvas draws its selection and guides with; they mean nothing in an export,
|
|
193
241
|
* so they are not colour names in styles. Built-in themes write none: the canvas uses `accent`.
|
|
@@ -207,7 +255,20 @@ export declare const THEME_DURATION_TOKENS: {
|
|
|
207
255
|
};
|
|
208
256
|
/** Tokens accepted inside `theme <id> { }` blocks. */
|
|
209
257
|
export declare const THEME_TOKENS: PropertyTable;
|
|
210
|
-
/**
|
|
258
|
+
/**
|
|
259
|
+
* The text properties of every profile (decision 0067): the font stack a target's text is
|
|
260
|
+
* measured and drawn with, and its size and weight. Every target that draws text takes them;
|
|
261
|
+
* icons, images and pens refuse them (`TEXTLESS_KINDS`).
|
|
262
|
+
*/
|
|
263
|
+
export declare const TEXT_STYLE_PROPERTIES: PropertyTable;
|
|
264
|
+
export declare const TEXT_PROPERTIES: readonly string[];
|
|
265
|
+
/** The element kinds that draw no text of their own, and so refuse the text properties. */
|
|
266
|
+
export declare const TEXTLESS_KINDS: readonly string[];
|
|
267
|
+
/**
|
|
268
|
+
* Style properties that only free diagrams accept: where text sits across (`textAlign`) and down
|
|
269
|
+
* (`verticalAlign`) its box, and the `opacity` of elements, groups, lines and pens (0 is
|
|
270
|
+
* invisible, 1 opaque).
|
|
271
|
+
*/
|
|
211
272
|
export declare const FREE_STYLE_PROPERTIES: PropertyTable;
|
|
212
273
|
/**
|
|
213
274
|
* Properties of classes and rules: the `style` properties without `class`. Theme classes and rules
|
|
@@ -217,6 +278,35 @@ export declare const STYLE_PROPERTIES: PropertyTable;
|
|
|
217
278
|
/** Style properties that apply only to elements, and only to relations. */
|
|
218
279
|
export declare const ELEMENT_ONLY_PROPERTIES: readonly string[];
|
|
219
280
|
export declare const RELATION_ONLY_PROPERTIES: readonly string[];
|
|
281
|
+
/**
|
|
282
|
+
* Style properties a free line refuses: the element properties but `opacity`, which fades a line as
|
|
283
|
+
* it fades a box. A line takes the relation properties.
|
|
284
|
+
*/
|
|
285
|
+
export declare const LINE_REFUSED_PROPERTIES: readonly string[];
|
|
286
|
+
/** The style properties a pen stroke takes. */
|
|
287
|
+
export declare const PEN_PROPERTIES: readonly string[];
|
|
288
|
+
/**
|
|
289
|
+
* Style properties a pen refuses: a box's fill, shape, radius and pattern, a connector's routing
|
|
290
|
+
* and corners, the icon properties and the text properties. `rotation` is refused apart, as a
|
|
291
|
+
* line's is: a pen's points are written in its statement.
|
|
292
|
+
*/
|
|
293
|
+
export declare const PEN_REFUSED_PROPERTIES: readonly string[];
|
|
294
|
+
/** The `width` of a pen stroke: one pixel at least, unlike outlines and connectors. */
|
|
295
|
+
export declare const PEN_WIDTH_RANGE: {
|
|
296
|
+
readonly min: 1;
|
|
297
|
+
readonly max: 64;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* The style properties a sticky takes: its card's fill and outline, its text, an icon at the top
|
|
301
|
+
* left, rotation and opacity.
|
|
302
|
+
*/
|
|
303
|
+
export declare const STICKY_PROPERTIES: readonly string[];
|
|
304
|
+
/**
|
|
305
|
+
* Style properties a sticky refuses: a box's `pattern`, the icon placements of a box (its icon
|
|
306
|
+
* sits at the top left) and the relation properties. `shape` is refused apart, naming the kinds
|
|
307
|
+
* that take it.
|
|
308
|
+
*/
|
|
309
|
+
export declare const STICKY_REFUSED_PROPERTIES: readonly string[];
|
|
220
310
|
/**
|
|
221
311
|
* Classes every built-in theme provides. Colours are token names, so the classes follow the
|
|
222
312
|
* theme. A class of the same name in a file theme or a diagram shadows them.
|
|
@@ -285,7 +375,7 @@ export declare const EXPORT_EXTENSIONS: Readonly<Record<Format, string>>;
|
|
|
285
375
|
/** Statements of a `story` block, of a scene, and the actions a scene runs. */
|
|
286
376
|
export declare const STORY_STATEMENTS: readonly ["title", "description", "scene"];
|
|
287
377
|
export declare const SCENE_STATEMENTS: readonly ["view", "transition"];
|
|
288
|
-
export declare const STORY_ACTIONS: readonly ["reveal", "hide", "highlight", "focus", "camera", "trace", "hold", "parallel"];
|
|
378
|
+
export declare const STORY_ACTIONS: readonly ["reveal", "hide", "highlight", "focus", "camera", "trace", "draw", "hold", "parallel"];
|
|
289
379
|
export declare const STORY_TRANSITIONS: readonly ["cut", "fade", "morph"];
|
|
290
380
|
/** Times an action or transition takes when it writes no `over`, in milliseconds. */
|
|
291
381
|
export declare const STORY_DEFAULT_TIMES: {
|
|
@@ -295,6 +385,7 @@ export declare const STORY_DEFAULT_TIMES: {
|
|
|
295
385
|
readonly camera: 800;
|
|
296
386
|
readonly highlight: 1000;
|
|
297
387
|
readonly trace: 1200;
|
|
388
|
+
readonly draw: 800;
|
|
298
389
|
readonly hold: 0;
|
|
299
390
|
readonly parallel: 0;
|
|
300
391
|
readonly cut: 0;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;AAC1F,kFAAkF;GAChF;IAAE,QAAQ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;AAC3F,eAAO,MAAM,aAAa,iCAAkC,CAAC;AAE7D,KAAK,MAAM,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAI9C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,CAAC,CAqBzF,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ9D,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,4CAA6C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,iCAAkC,CAAC;AAChE,eAAO,MAAM,aAAa,kGAUhB,CAAC;AACX,eAAO,MAAM,iBAAiB,mCAAoC,CAAC;AACnE,qFAAqF;AACrF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAatB,CAAC;AACX,qEAAqE;AACrE,eAAO,MAAM,cAAc,SAAU,CAAC;AAEtC,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,aAA4B,GAAG,MAAM,EAAE,CAOjF;AAED,2EAA2E;AAC3E,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD"}
|
package/dist/schema.js
CHANGED
|
@@ -32,7 +32,17 @@ export const ANIMATION_DEFAULT_DURATIONS = {
|
|
|
32
32
|
/** Element kinds of flow diagrams. */
|
|
33
33
|
export const ELEMENT_KINDS = ["node", "decision", "data", "group", "note", "tag"];
|
|
34
34
|
/** Object kinds of free diagrams. */
|
|
35
|
-
export const FREE_ELEMENT_KINDS = [
|
|
35
|
+
export const FREE_ELEMENT_KINDS = [
|
|
36
|
+
"box",
|
|
37
|
+
"text",
|
|
38
|
+
"icon",
|
|
39
|
+
"image",
|
|
40
|
+
"note",
|
|
41
|
+
"sticky",
|
|
42
|
+
"line",
|
|
43
|
+
"pen",
|
|
44
|
+
"group",
|
|
45
|
+
];
|
|
36
46
|
/** Participant kinds of sequence diagrams. */
|
|
37
47
|
export const PARTICIPANT_KINDS = [
|
|
38
48
|
"participant",
|
|
@@ -80,6 +90,9 @@ export const ALL_ELEMENT_KINDS = [
|
|
|
80
90
|
"text",
|
|
81
91
|
"icon",
|
|
82
92
|
"image",
|
|
93
|
+
"sticky",
|
|
94
|
+
"line",
|
|
95
|
+
"pen",
|
|
83
96
|
...PARTICIPANT_KINDS,
|
|
84
97
|
...ENTITY_KINDS,
|
|
85
98
|
];
|
|
@@ -109,10 +122,33 @@ export const SEQUENCE_EVENTS = [
|
|
|
109
122
|
...FRAGMENT_OPERATORS,
|
|
110
123
|
"divider",
|
|
111
124
|
"delay",
|
|
125
|
+
"return",
|
|
112
126
|
];
|
|
113
127
|
/** Statements of a `scenario` block. */
|
|
114
128
|
export const SCENARIO_STATEMENTS = ["choose", "repeat", "skip", "take"];
|
|
115
129
|
export const LINE_STYLES = ["solid", "dashed", "dotted"];
|
|
130
|
+
/**
|
|
131
|
+
* What each relation token draws: its line and its heads. One dash more is dashed; `<` adds the
|
|
132
|
+
* head at the start; the lines `--` and `---` drop the head glyph. A profile's `arrows` table says
|
|
133
|
+
* which of them it takes.
|
|
134
|
+
*/
|
|
135
|
+
export const RELATION_ARROWS = {
|
|
136
|
+
"->": { line: "solid", heads: "end" },
|
|
137
|
+
"-->": { line: "dashed", heads: "end" },
|
|
138
|
+
"--": { line: "solid", heads: "none" },
|
|
139
|
+
"---": { line: "dashed", heads: "none" },
|
|
140
|
+
"<->": { line: "solid", heads: "both" },
|
|
141
|
+
"<-->": { line: "dashed", heads: "both" },
|
|
142
|
+
};
|
|
143
|
+
/** The token that writes a relation of this line and these heads: `arrowToken("dashed", "none")` is `---`. */
|
|
144
|
+
export function arrowToken(line, heads) {
|
|
145
|
+
const dashed = line === "dashed";
|
|
146
|
+
if (heads === "none")
|
|
147
|
+
return dashed ? "---" : "--";
|
|
148
|
+
if (heads === "both")
|
|
149
|
+
return dashed ? "<-->" : "<->";
|
|
150
|
+
return dashed ? "-->" : "->";
|
|
151
|
+
}
|
|
116
152
|
export const DIAGRAM_TYPES = ["flow", "sequence", "c4", "free"];
|
|
117
153
|
export const MESSAGE_KINDS = ["sync", "async"];
|
|
118
154
|
export const PATTERNS = ["none", "hatch", "dots", "cross"];
|
|
@@ -139,9 +175,23 @@ export const ARROWHEADS = [
|
|
|
139
175
|
];
|
|
140
176
|
/** Corners of straight and elbow connectors. */
|
|
141
177
|
export const CORNERS = ["sharp", "rounded"];
|
|
178
|
+
/** How a theme paints strokes: clean, or in two jittered passes of a hand-drawn look. */
|
|
179
|
+
export const SKETCH_LEVELS = ["none", "light", "rough"];
|
|
142
180
|
/** Targets of `rule <kind> { }`: the element kinds of every profile, `relation` and `fragment`. */
|
|
143
181
|
export const RULE_KINDS = [...ALL_ELEMENT_KINDS, "relation", "fragment"];
|
|
144
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Canvas presets: a document warns past 1,200 px, a slide keeps 16:9, and a board grows with what
|
|
184
|
+
* is drawn on it, unreported.
|
|
185
|
+
*/
|
|
186
|
+
export const PRESETS = ["document", "slide", "board"];
|
|
187
|
+
/** How a list group (`layout column|row` in a free group block) arranges its children. */
|
|
188
|
+
export const LIST_LAYOUTS = ["column", "row"];
|
|
189
|
+
/** Where the children of a list sit across its axis (`align` in a free group block). */
|
|
190
|
+
export const LIST_ALIGNS = ["start", "center", "end", "stretch"];
|
|
191
|
+
/** The distance a list's `spacing` may write between its children, in pixels. */
|
|
192
|
+
export const LIST_SPACING_RANGE = { min: 0, max: 400 };
|
|
193
|
+
/** The properties of a free group block that make it a list. */
|
|
194
|
+
export const LIST_PROPERTIES = ["layout", "spacing", "align"];
|
|
145
195
|
/**
|
|
146
196
|
* Where the icon of a node, decision, data store or box goes: beside, above or below its text, or
|
|
147
197
|
* at the centre as the picture of the box, the label at the edge `labelPosition` names.
|
|
@@ -194,16 +244,19 @@ export function takesShape(kind) {
|
|
|
194
244
|
export const ROTATION_RANGE = { min: 0, max: 360 };
|
|
195
245
|
/**
|
|
196
246
|
* The element kinds `rotation` turns: every element of flow diagrams and free compositions but
|
|
197
|
-
* groups, which hold other elements
|
|
247
|
+
* groups, which hold other elements, and lines and pens, whose points are written as they are
|
|
248
|
+
* drawn.
|
|
198
249
|
*/
|
|
199
250
|
export function takesRotation(kind) {
|
|
200
|
-
return kind !== "group";
|
|
251
|
+
return kind !== "group" && kind !== "line" && kind !== "pen";
|
|
201
252
|
}
|
|
202
253
|
/** Whether a profile's elements take `rotation`: sequence diagrams and C4 views do not. */
|
|
203
254
|
export function profileTakesRotation(profile) {
|
|
204
255
|
return profile.name !== "sequence" && profile.name !== "c4";
|
|
205
256
|
}
|
|
206
257
|
export const TEXT_ALIGNS = ["left", "center", "right"];
|
|
258
|
+
/** Where a free box's text block sits within the shape's text band, top to bottom. */
|
|
259
|
+
export const VERTICAL_ALIGNS = ["top", "middle", "bottom"];
|
|
207
260
|
export const FONT_WEIGHTS = [400, 500, 600, 700];
|
|
208
261
|
/** The layer every free diagram has; listed last when `layers` does not name it. */
|
|
209
262
|
export const MAIN_LAYER = "main";
|
|
@@ -217,8 +270,15 @@ export const BUILT_IN_THEMES = [
|
|
|
217
270
|
"editorial.dark",
|
|
218
271
|
"stage.light",
|
|
219
272
|
"stage.dark",
|
|
273
|
+
"sketch.light",
|
|
274
|
+
"sketch.dark",
|
|
220
275
|
];
|
|
221
276
|
export const DEFAULT_THEME = "technical.light";
|
|
277
|
+
/**
|
|
278
|
+
* The colour tokens of whiteboards: highlighter strokes, the default fill of stickies and their
|
|
279
|
+
* text. Colour tokens like the others; the theme panel groups them apart.
|
|
280
|
+
*/
|
|
281
|
+
export const THEME_WHITEBOARD_TOKENS = ["highlight", "sticky", "stickyText"];
|
|
222
282
|
/** Colour tokens of a theme, in the order they are documented. */
|
|
223
283
|
export const THEME_COLOR_TOKENS = [
|
|
224
284
|
"background",
|
|
@@ -237,6 +297,7 @@ export const THEME_COLOR_TOKENS = [
|
|
|
237
297
|
"warning",
|
|
238
298
|
"danger",
|
|
239
299
|
"info",
|
|
300
|
+
...THEME_WHITEBOARD_TOKENS,
|
|
240
301
|
];
|
|
241
302
|
/**
|
|
242
303
|
* Colour tokens the canvas draws its selection and guides with; they mean nothing in an export,
|
|
@@ -288,6 +349,7 @@ export const THEME_TOKENS = {
|
|
|
288
349
|
...THEME_NUMBER_TOKENS,
|
|
289
350
|
arrowhead: { kind: "enum", values: ARROWHEADS },
|
|
290
351
|
corners: { kind: "enum", values: CORNERS },
|
|
352
|
+
sketch: { kind: "enum", values: SKETCH_LEVELS },
|
|
291
353
|
iconPosition: { kind: "enum", values: ICON_POSITIONS },
|
|
292
354
|
frame: { kind: "enum", values: FRAME_MODES },
|
|
293
355
|
brand: { kind: "string" },
|
|
@@ -301,11 +363,28 @@ export const THEME_TOKENS = {
|
|
|
301
363
|
},
|
|
302
364
|
])),
|
|
303
365
|
};
|
|
304
|
-
/**
|
|
305
|
-
|
|
366
|
+
/**
|
|
367
|
+
* The text properties of every profile (decision 0067): the font stack a target's text is
|
|
368
|
+
* measured and drawn with, and its size and weight. Every target that draws text takes them;
|
|
369
|
+
* icons, images and pens refuse them (`TEXTLESS_KINDS`).
|
|
370
|
+
*/
|
|
371
|
+
export const TEXT_STYLE_PROPERTIES = {
|
|
372
|
+
font: { kind: "string", nonEmpty: true },
|
|
306
373
|
fontSize: { kind: "number", min: 6, max: 160 },
|
|
307
374
|
fontWeight: { kind: "number", min: 400, max: 700, values: FONT_WEIGHTS },
|
|
375
|
+
};
|
|
376
|
+
export const TEXT_PROPERTIES = Object.keys(TEXT_STYLE_PROPERTIES);
|
|
377
|
+
/** The element kinds that draw no text of their own, and so refuse the text properties. */
|
|
378
|
+
export const TEXTLESS_KINDS = ["icon", "image", "pen"];
|
|
379
|
+
/**
|
|
380
|
+
* Style properties that only free diagrams accept: where text sits across (`textAlign`) and down
|
|
381
|
+
* (`verticalAlign`) its box, and the `opacity` of elements, groups, lines and pens (0 is
|
|
382
|
+
* invisible, 1 opaque).
|
|
383
|
+
*/
|
|
384
|
+
export const FREE_STYLE_PROPERTIES = {
|
|
308
385
|
textAlign: { kind: "enum", values: TEXT_ALIGNS },
|
|
386
|
+
verticalAlign: { kind: "enum", values: VERTICAL_ALIGNS },
|
|
387
|
+
opacity: { kind: "number", min: 0, max: 1 },
|
|
309
388
|
};
|
|
310
389
|
/**
|
|
311
390
|
* Properties of classes and rules: the `style` properties without `class`. Theme classes and rules
|
|
@@ -317,7 +396,8 @@ export const STYLE_PROPERTIES = {
|
|
|
317
396
|
stroke: { kind: "color", tokens: true },
|
|
318
397
|
color: { kind: "color", tokens: true },
|
|
319
398
|
line: { kind: "enum", values: LINE_STYLES },
|
|
320
|
-
|
|
399
|
+
/** An outline, a connector or a pen stroke; a pen refuses 0 (`PEN_WIDTH_RANGE`). */
|
|
400
|
+
width: { kind: "number", min: 0, max: 64 },
|
|
321
401
|
pattern: { kind: "enum", values: PATTERNS },
|
|
322
402
|
arrowhead: { kind: "enum", values: ARROWHEADS },
|
|
323
403
|
arrowtail: { kind: "enum", values: ARROWHEADS },
|
|
@@ -335,6 +415,7 @@ export const STYLE_PROPERTIES = {
|
|
|
335
415
|
radius: RADIUS,
|
|
336
416
|
/** Degrees an element is turned, clockwise about the centre of its box. */
|
|
337
417
|
rotation: { kind: "number", ...ROTATION_RANGE },
|
|
418
|
+
...TEXT_STYLE_PROPERTIES,
|
|
338
419
|
...FREE_STYLE_PROPERTIES,
|
|
339
420
|
};
|
|
340
421
|
/** Style properties that apply only to elements, and only to relations. */
|
|
@@ -354,6 +435,56 @@ export const RELATION_ONLY_PROPERTIES = [
|
|
|
354
435
|
"routing",
|
|
355
436
|
"corners",
|
|
356
437
|
];
|
|
438
|
+
/**
|
|
439
|
+
* Style properties a free line refuses: the element properties but `opacity`, which fades a line as
|
|
440
|
+
* it fades a box. A line takes the relation properties.
|
|
441
|
+
*/
|
|
442
|
+
export const LINE_REFUSED_PROPERTIES = ELEMENT_ONLY_PROPERTIES.filter((name) => name !== "opacity");
|
|
443
|
+
/** The style properties a pen stroke takes. */
|
|
444
|
+
export const PEN_PROPERTIES = [
|
|
445
|
+
"stroke",
|
|
446
|
+
"width",
|
|
447
|
+
"line",
|
|
448
|
+
"opacity",
|
|
449
|
+
"arrowhead",
|
|
450
|
+
"arrowtail",
|
|
451
|
+
];
|
|
452
|
+
/**
|
|
453
|
+
* Style properties a pen refuses: a box's fill, shape, radius and pattern, a connector's routing
|
|
454
|
+
* and corners, the icon properties and the text properties. `rotation` is refused apart, as a
|
|
455
|
+
* line's is: a pen's points are written in its statement.
|
|
456
|
+
*/
|
|
457
|
+
export const PEN_REFUSED_PROPERTIES = Object.keys(STYLE_PROPERTIES).filter((name) => !PEN_PROPERTIES.includes(name) && name !== "rotation");
|
|
458
|
+
/** The `width` of a pen stroke: one pixel at least, unlike outlines and connectors. */
|
|
459
|
+
export const PEN_WIDTH_RANGE = { min: 1, max: 64 };
|
|
460
|
+
/**
|
|
461
|
+
* The style properties a sticky takes: its card's fill and outline, its text, an icon at the top
|
|
462
|
+
* left, rotation and opacity.
|
|
463
|
+
*/
|
|
464
|
+
export const STICKY_PROPERTIES = [
|
|
465
|
+
"fill",
|
|
466
|
+
"stroke",
|
|
467
|
+
"color",
|
|
468
|
+
"line",
|
|
469
|
+
"width",
|
|
470
|
+
"font",
|
|
471
|
+
"fontSize",
|
|
472
|
+
"fontWeight",
|
|
473
|
+
"textAlign",
|
|
474
|
+
"verticalAlign",
|
|
475
|
+
"radius",
|
|
476
|
+
"rotation",
|
|
477
|
+
"opacity",
|
|
478
|
+
"icon",
|
|
479
|
+
"iconColor",
|
|
480
|
+
"iconSize",
|
|
481
|
+
];
|
|
482
|
+
/**
|
|
483
|
+
* Style properties a sticky refuses: a box's `pattern`, the icon placements of a box (its icon
|
|
484
|
+
* sits at the top left) and the relation properties. `shape` is refused apart, naming the kinds
|
|
485
|
+
* that take it.
|
|
486
|
+
*/
|
|
487
|
+
export const STICKY_REFUSED_PROPERTIES = Object.keys(STYLE_PROPERTIES).filter((name) => !STICKY_PROPERTIES.includes(name) && name !== "shape");
|
|
357
488
|
/**
|
|
358
489
|
* Classes every built-in theme provides. Colours are token names, so the classes follow the
|
|
359
490
|
* theme. A class of the same name in a file theme or a diagram shadows them.
|
|
@@ -427,7 +558,14 @@ export const FLOW_PROFILE = {
|
|
|
427
558
|
assumption: { kind: "string" },
|
|
428
559
|
class: { kind: "classes" },
|
|
429
560
|
},
|
|
430
|
-
arrows: {
|
|
561
|
+
arrows: {
|
|
562
|
+
"->": "solid",
|
|
563
|
+
"-->": "dashed",
|
|
564
|
+
"--": "solid",
|
|
565
|
+
"---": "dashed",
|
|
566
|
+
"<->": "solid",
|
|
567
|
+
"<-->": "dashed",
|
|
568
|
+
},
|
|
431
569
|
diagramBlocks: ["placement", "style", "animate", "class", "rule"],
|
|
432
570
|
placementStatements: ["place", "size", "route", "label", ...CONSTRAINTS],
|
|
433
571
|
ports: PORTS,
|
|
@@ -461,6 +599,10 @@ export const FREE_PROFILE = {
|
|
|
461
599
|
layer: { kind: "name" },
|
|
462
600
|
link: { kind: "link" },
|
|
463
601
|
url: { kind: "url" },
|
|
602
|
+
// A list: the children in source order along a column or a row.
|
|
603
|
+
layout: { kind: "enum", values: LIST_LAYOUTS },
|
|
604
|
+
spacing: { kind: "number", ...LIST_SPACING_RANGE },
|
|
605
|
+
align: { kind: "enum", values: LIST_ALIGNS },
|
|
464
606
|
},
|
|
465
607
|
relationProperties: {
|
|
466
608
|
description: { kind: "string" },
|
|
@@ -468,7 +610,14 @@ export const FREE_PROFILE = {
|
|
|
468
610
|
class: { kind: "classes" },
|
|
469
611
|
layer: { kind: "name" },
|
|
470
612
|
},
|
|
471
|
-
arrows: {
|
|
613
|
+
arrows: {
|
|
614
|
+
"->": "solid",
|
|
615
|
+
"-->": "dashed",
|
|
616
|
+
"--": "solid",
|
|
617
|
+
"---": "dashed",
|
|
618
|
+
"<->": "solid",
|
|
619
|
+
"<-->": "dashed",
|
|
620
|
+
},
|
|
472
621
|
diagramBlocks: ["placement", "style", "animate", "class", "rule"],
|
|
473
622
|
placementStatements: ["place", "size", "route", "label", ...CONSTRAINTS],
|
|
474
623
|
ports: PORTS,
|
|
@@ -487,6 +636,7 @@ export const SEQUENCE_PROFILE = {
|
|
|
487
636
|
preset: { kind: "enum", values: PRESETS },
|
|
488
637
|
canvas: { kind: "size", min: 100, max: 10000 },
|
|
489
638
|
autonumber: { kind: "number", min: 0, max: 100000 },
|
|
639
|
+
spacing: { kind: "number", min: 0, max: 400 },
|
|
490
640
|
},
|
|
491
641
|
elementKinds: SEQUENCE_ELEMENT_KINDS,
|
|
492
642
|
shorthand: { box: "participant", data: "database" },
|
|
@@ -496,6 +646,7 @@ export const SEQUENCE_PROFILE = {
|
|
|
496
646
|
class: { kind: "classes" },
|
|
497
647
|
link: { kind: "link" },
|
|
498
648
|
url: { kind: "url" },
|
|
649
|
+
tag: { kind: "tag" },
|
|
499
650
|
},
|
|
500
651
|
groupProperties: {
|
|
501
652
|
description: { kind: "string" },
|
|
@@ -508,6 +659,7 @@ export const SEQUENCE_PROFILE = {
|
|
|
508
659
|
assumption: { kind: "string" },
|
|
509
660
|
class: { kind: "classes" },
|
|
510
661
|
kind: { kind: "enum", values: MESSAGE_KINDS },
|
|
662
|
+
tag: { kind: "tag" },
|
|
511
663
|
},
|
|
512
664
|
arrows: { "->": "solid", "-->": "dashed", "<->": "solid", "<-->": "dashed" },
|
|
513
665
|
diagramBlocks: ["placement", "style", "animate", "class", "rule", "scenario"],
|
|
@@ -526,11 +678,12 @@ export const C4_PROFILE = {
|
|
|
526
678
|
level: { kind: "enum", values: C4_LEVELS },
|
|
527
679
|
scope: { kind: "name" },
|
|
528
680
|
},
|
|
529
|
-
// Elements come from the model; views declare
|
|
530
|
-
elementKinds: [],
|
|
681
|
+
// Elements come from the model; views declare notes, never entities.
|
|
682
|
+
elementKinds: ["note"],
|
|
531
683
|
shorthand: { box: "container", data: "datastore" },
|
|
532
684
|
implicitKind: "container",
|
|
533
|
-
|
|
685
|
+
// A view's note takes `class` and `url`; `description`, `layer` and `link` stay refused.
|
|
686
|
+
elementProperties: { class: { kind: "classes" }, url: { kind: "url" } },
|
|
534
687
|
groupProperties: {},
|
|
535
688
|
relationProperties: {
|
|
536
689
|
description: { kind: "string" },
|
|
@@ -543,7 +696,7 @@ export const C4_PROFILE = {
|
|
|
543
696
|
ports: PORTS,
|
|
544
697
|
styleProperties: { ...STYLE_PROPERTIES, class: { kind: "classes" } },
|
|
545
698
|
animateProperties: ANIMATE_PROPERTIES,
|
|
546
|
-
ruleKinds: [...C4_ELEMENT_KINDS, "relation"],
|
|
699
|
+
ruleKinds: [...C4_ELEMENT_KINDS, "note", "relation"],
|
|
547
700
|
events: [],
|
|
548
701
|
};
|
|
549
702
|
/** Statements of a C4 view besides diagram properties and blocks. */
|
|
@@ -622,6 +775,7 @@ export const STORY_ACTIONS = [
|
|
|
622
775
|
"focus",
|
|
623
776
|
"camera",
|
|
624
777
|
"trace",
|
|
778
|
+
"draw",
|
|
625
779
|
"hold",
|
|
626
780
|
"parallel",
|
|
627
781
|
];
|
|
@@ -634,6 +788,7 @@ export const STORY_DEFAULT_TIMES = {
|
|
|
634
788
|
camera: 800,
|
|
635
789
|
highlight: 1000,
|
|
636
790
|
trace: 1200,
|
|
791
|
+
draw: 800,
|
|
637
792
|
hold: 0,
|
|
638
793
|
parallel: 0,
|
|
639
794
|
cut: 0,
|