@formicoidea/labre-framework-wardley 0.43.1 → 0.45.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/dist/commands.js +12 -6
- package/dist/element-renderer.d.ts +1 -1
- package/dist/element-view.d.ts +1 -1
- package/dist/export.d.ts +56 -6
- package/dist/export.js +12 -13
- package/dist/import.d.ts +107 -106
- package/dist/import.js +96 -54
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/interchange.d.ts +13 -18
- package/dist/interchange.js +16 -20
- package/dist/node/node-renderer.d.ts +1 -1
- package/dist/reading.js +4 -0
- package/dist/roles.js +10 -0
- package/dist/svg-import.d.ts +2 -0
- package/dist/svg-import.js +309 -0
- package/dist/svg-read.d.ts +108 -0
- package/dist/svg-read.js +89 -0
- package/dist/svg-recognise-labre.d.ts +2 -0
- package/dist/svg-recognise-labre.js +240 -0
- package/dist/svg-recognise-owm.d.ts +2 -0
- package/dist/svg-recognise-owm.js +303 -0
- package/dist/svg-recognise-renderer.d.ts +2 -0
- package/dist/svg-recognise-renderer.js +385 -0
- package/dist/svg-recognise-shapes.d.ts +2 -0
- package/dist/svg-recognise-shapes.js +240 -0
- package/dist/svg-remarks.d.ts +16 -0
- package/dist/svg-remarks.js +31 -0
- package/dist/toolbar/config.d.ts +2 -2
- package/dist/toolbar/node-config.d.ts +1 -1
- package/dist/toolbar/senior-tool.d.ts +1 -1
- package/dist/translations.js +10 -2
- package/package.json +2 -2
package/dist/commands.js
CHANGED
|
@@ -372,13 +372,19 @@ const exportCommand = {
|
|
|
372
372
|
* and invocable by an agent.
|
|
373
373
|
*
|
|
374
374
|
* **Flagged for the PO** as a curation call rather than a technical one: it is
|
|
375
|
-
* a one-line change either way.
|
|
375
|
+
* a one-line change either way. ADR 0032 (open point 4) asked again once the
|
|
376
|
+
* reader started yielding a map, and the answer stayed: the catalogue.
|
|
376
377
|
*
|
|
377
378
|
* ## The label names the tier before the file is read
|
|
378
379
|
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
380
|
+
* The description says which producers' pictures arrive as a MAP and that
|
|
381
|
+
* everything else arrives as a sketch — "the import surface must name the tier
|
|
382
|
+
* before the file is read". It is a new key, and the old one
|
|
383
|
+
* (`com.labre.commands.wardley.importSvg.description`, "The axes and the
|
|
384
|
+
* evolution are not read…") is retired rather than reworded: a host's
|
|
385
|
+
* translation of it says the opposite of what the reader now does, and a
|
|
386
|
+
* reworded fallback would have left that translation lying (ADR 0032,
|
|
387
|
+
* Consequences).
|
|
382
388
|
*/
|
|
383
389
|
const importSvgCommand = {
|
|
384
390
|
id: 'wardley.importSvg',
|
|
@@ -386,8 +392,8 @@ const importSvgCommand = {
|
|
|
386
392
|
kind: 'action',
|
|
387
393
|
labelKey: 'com.labre.commands.wardley.importSvg',
|
|
388
394
|
labelFallback: 'Import SVG sketch',
|
|
389
|
-
descriptionKey: 'com.labre.commands.wardley.importSvg.description',
|
|
390
|
-
descriptionFallback: 'Best effort:
|
|
395
|
+
descriptionKey: 'com.labre.commands.wardley.importSvg.recognised.description',
|
|
396
|
+
descriptionFallback: 'Best effort, no round-trip: a map exported as SVG by Labre or OnlineWardleyMaps, or drawn by wardley-map-renderer, arrives as a native Wardley map — components, links, pipelines, evolution. Any other map with its two axes drawn gives its components and links; everything else arrives as a sketch you then promote.',
|
|
391
397
|
// The same section the two OWM directions are filed under, and the same one
|
|
392
398
|
// BPMN files its `.bpmn` pair under: a host that translated the header once
|
|
393
399
|
// has translated it for every framework.
|
|
@@ -12,6 +12,6 @@ import type { WardleyBackgroundElementModel } from '@formicoidea/labre-core/mode
|
|
|
12
12
|
* suite drives it directly with a canvas stub.
|
|
13
13
|
*/
|
|
14
14
|
export declare const wardley: ElementRenderer<WardleyBackgroundElementModel>;
|
|
15
|
-
export declare const WardleyElementRendererExtension: import("@formicoidea/labre-core/store").ExtensionType & {
|
|
15
|
+
export declare const WardleyElementRendererExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType & {
|
|
16
16
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di").ServiceIdentifier<ElementRenderer<WardleyBackgroundElementModel>>;
|
|
17
17
|
};
|
package/dist/element-view.d.ts
CHANGED
|
@@ -29,4 +29,4 @@ export declare class WardleyView extends DeclaredBackgroundView<WardleyBackgroun
|
|
|
29
29
|
* `resizeEnabled` is true — the runtime half of the declaration's
|
|
30
30
|
* `geometry.resizable`.
|
|
31
31
|
*/
|
|
32
|
-
export declare const WardleyInteraction: import("@formicoidea/labre-core/store").ExtensionType;
|
|
32
|
+
export declare const WardleyInteraction: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
|
package/dist/export.d.ts
CHANGED
|
@@ -172,18 +172,68 @@ export interface WardleyExportBoard {
|
|
|
172
172
|
}
|
|
173
173
|
export declare function wardleyBoardFrom(elements: readonly GfxPrimitiveElementModel[]): WardleyExportBoard;
|
|
174
174
|
/**
|
|
175
|
-
* A name a file system will accept, minus the extension
|
|
176
|
-
*
|
|
177
|
-
*
|
|
175
|
+
* A name a file system will accept, minus the extension: the shared
|
|
176
|
+
* `safeFilename` with Wardley's fallback — `map`, because that is what an OWM
|
|
177
|
+
* document is. Held to it by `safe-filename-parity.unit.spec.ts`.
|
|
178
178
|
*/
|
|
179
179
|
export declare function wardleySafeFilename(raw: string | undefined): string;
|
|
180
180
|
/** The label box an import writes, and the width a prediction assumes. */
|
|
181
181
|
export declare const OWM_LABEL_WIDTH = 200;
|
|
182
182
|
export declare const OWM_LABEL_HEIGHT: number;
|
|
183
|
-
/**
|
|
184
|
-
export
|
|
183
|
+
/** What {@link matchLabels} reads of a node: a model, or a file's marker. */
|
|
184
|
+
export interface LabelledNode {
|
|
185
|
+
id: string;
|
|
186
|
+
kind: string;
|
|
187
|
+
role?: string;
|
|
188
|
+
elementBound: {
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
w: number;
|
|
192
|
+
h: number;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** What {@link matchLabels} reads of a label. */
|
|
196
|
+
export interface LabelBox {
|
|
185
197
|
text?: unknown;
|
|
186
|
-
|
|
198
|
+
elementBound: {
|
|
199
|
+
x: number;
|
|
200
|
+
y: number;
|
|
201
|
+
w: number;
|
|
202
|
+
h: number;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Which label names which node — the one heuristic in this module.
|
|
207
|
+
*
|
|
208
|
+
* A name is a separate element on this canvas, so "which node is this the name
|
|
209
|
+
* of" is a question the document does not answer directly and the writer has to
|
|
210
|
+
* ask of the geometry. The naive answer — nearest node to the label box — is
|
|
211
|
+
* WRONG on a real map and provably so: two components 60 units apart
|
|
212
|
+
* horizontally and 17 apart vertically (which is nothing on a 1530-wide plot,
|
|
213
|
+
* and is exactly what the tea-shop corpus holds) put the lower one's centre
|
|
214
|
+
* INSIDE the upper one's label box, so it wins by a distance of half a unit and
|
|
215
|
+
* steals the name.
|
|
216
|
+
*
|
|
217
|
+
* What is asked instead is: how far is this label from where a label for this
|
|
218
|
+
* node WOULD have been written? A wrong node's answer is a whole node spacing;
|
|
219
|
+
* the right node's is the few units between one convention and another. Pairs
|
|
220
|
+
* within {@link LABEL_MATCH_TOLERANCE} are then assigned greedily, closest
|
|
221
|
+
* first, ties broken by document order — so the assignment is a function of the
|
|
222
|
+
* document and not of the iteration order.
|
|
223
|
+
*
|
|
224
|
+
* A pipeline HANDLE never claims a label: it sits on the body's top edge, right
|
|
225
|
+
* under the name the body owns, and would win every pipeline's name from it.
|
|
226
|
+
* A Porter's-forces glyph never claims one either, and for a sharper reason: it
|
|
227
|
+
* HAS no name — its one letter is the shape's own inner text — so any label it
|
|
228
|
+
* matched would be some neighbouring artefact's, taken out of that artefact's
|
|
229
|
+
* mouth and then thrown away, since a force is not written to the file at all.
|
|
230
|
+
*
|
|
231
|
+
* Typed on the four facts it reads rather than on the models, so the SVG
|
|
232
|
+
* reader (`svg-recognise-labre.ts`) names the nodes of Labre's own export with
|
|
233
|
+
* this very function, from the bounds the file's markers carry: an export and
|
|
234
|
+
* the import of that export cannot disagree about whose name is whose.
|
|
235
|
+
*/
|
|
236
|
+
export declare function matchLabels(nodes: readonly LabelledNode[], labels: readonly LabelBox[]): Map<string, string>;
|
|
187
237
|
export interface WardleyOwmExportOptions {
|
|
188
238
|
/** The board's own title, already sanitized by the caller. */
|
|
189
239
|
name?: string;
|
package/dist/export.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { backgroundPlot } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { ConnectorElementModel, TextElementModel, WardleyBackgroundElementModel, WardleyNodeElementModel, } from '@formicoidea/labre-core/model';
|
|
3
|
+
import { safeFilename } from '@formicoidea/labre-core/shared/utils';
|
|
3
4
|
import { WARDLEY_BACKGROUND } from './background.js';
|
|
4
5
|
import { LABEL_FONT_SIZE, LABEL_GAP } from './node/consts.js';
|
|
5
6
|
import { WARDLEY_ROLE } from './roles.js';
|
|
@@ -265,19 +266,12 @@ export function wardleyBoardFrom(elements) {
|
|
|
265
266
|
return { maps, nodes, labels, notes, connectors };
|
|
266
267
|
}
|
|
267
268
|
/**
|
|
268
|
-
* A name a file system will accept, minus the extension
|
|
269
|
-
*
|
|
270
|
-
*
|
|
269
|
+
* A name a file system will accept, minus the extension: the shared
|
|
270
|
+
* `safeFilename` with Wardley's fallback — `map`, because that is what an OWM
|
|
271
|
+
* document is. Held to it by `safe-filename-parity.unit.spec.ts`.
|
|
271
272
|
*/
|
|
272
273
|
export function wardleySafeFilename(raw) {
|
|
273
|
-
|
|
274
|
-
.trim()
|
|
275
|
-
.replaceAll(/[\\/:*?"<>|]/g, '-')
|
|
276
|
-
.replaceAll(/\s+/g, ' ')
|
|
277
|
-
.trim()
|
|
278
|
-
.slice(0, 120)
|
|
279
|
-
.replace(/[. ]+$/, '');
|
|
280
|
-
return safe || 'map';
|
|
274
|
+
return safeFilename(raw, 'map');
|
|
281
275
|
}
|
|
282
276
|
/* ── Matching a name to the artefact it names ─────────────────────────── */
|
|
283
277
|
/** How far a label may sit from where this node's label belongs, in units. */
|
|
@@ -340,8 +334,13 @@ function labelAnchors(node, label) {
|
|
|
340
334
|
* HAS no name — its one letter is the shape's own inner text — so any label it
|
|
341
335
|
* matched would be some neighbouring artefact's, taken out of that artefact's
|
|
342
336
|
* mouth and then thrown away, since a force is not written to the file at all.
|
|
337
|
+
*
|
|
338
|
+
* Typed on the four facts it reads rather than on the models, so the SVG
|
|
339
|
+
* reader (`svg-recognise-labre.ts`) names the nodes of Labre's own export with
|
|
340
|
+
* this very function, from the bounds the file's markers carry: an export and
|
|
341
|
+
* the import of that export cannot disagree about whose name is whose.
|
|
343
342
|
*/
|
|
344
|
-
function matchLabels(nodes, labels) {
|
|
343
|
+
export function matchLabels(nodes, labels) {
|
|
345
344
|
const pairs = [];
|
|
346
345
|
nodes.forEach((node, nodeIndex) => {
|
|
347
346
|
// A handle sits on the pipeline body's top edge, directly under the name
|
|
@@ -379,7 +378,7 @@ function matchLabels(nodes, labels) {
|
|
|
379
378
|
return byNode;
|
|
380
379
|
}
|
|
381
380
|
/** A text element's string, whether it is a `Y.Text` or a test's plain one. */
|
|
382
|
-
|
|
381
|
+
function textOf(element) {
|
|
383
382
|
const text = element.text;
|
|
384
383
|
return text === undefined || text === null ? '' : String(text);
|
|
385
384
|
}
|
package/dist/import.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InterchangeImportContext, InterchangeImportResult } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
-
import {
|
|
1
|
+
import type { InterchangeImportContext, InterchangeImportResult, SerializedElementProps } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import type { ForeignInterchange } from '@formicoidea/labre-core/std/gfx';
|
|
3
3
|
/**
|
|
4
4
|
* The OWM import remarks whose wording is FIXED, as `[key, English]` pairs.
|
|
5
5
|
*
|
|
@@ -29,114 +29,96 @@ export declare const WARDLEY_OWM_IMPORT_REMARKS: {
|
|
|
29
29
|
readonly carriedConstruct: readonly ["com.labre.wardley.import.remark.carried-construct", "{{count}} `{{kind}}` line(s) kept verbatim on the map and written back on the next export. Nothing on this canvas draws them."];
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* of `export.ts` on the vocabulary Labre draws, and an honest accounting of
|
|
34
|
-
* everything else (`docs/adr/0012`, D1–D6).
|
|
32
|
+
* The keywords that declare a positioned artefact, and the kind each is.
|
|
35
33
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* `title`, and the `->` links.
|
|
77
|
-
* **Carried** is every other statement — `style`, `annotation`, `attitudes`
|
|
78
|
-
* (`pioneers` / `settlers` / `townplanners`), `submap`, `url`, `size`,
|
|
79
|
-
* the axis-label overrides, the flow links (`+>`, `+<`, `+<>`,
|
|
80
|
-
* `+'…'>`), a link carrying a `;` context, and every `//` comment — kept
|
|
81
|
-
* verbatim in `interchange.owm.children['@document']` on the map's background
|
|
82
|
-
* element (D6) and written back, in order, at the end of the next export.
|
|
83
|
-
* **Quarantined** is empty, and that is a finding rather than an omission: see
|
|
84
|
-
* the loss table.
|
|
85
|
-
*
|
|
86
|
-
* A mapped line keeps its own tail too — `label [12, -8]`, `(build)`,
|
|
87
|
-
* `inertia`, a trailing comment — under `attrs['@self'].tail` on the artefact
|
|
88
|
-
* it belongs to, so the modifiers this pack does not draw come back on the
|
|
89
|
-
* line they were written on rather than at the bottom of the file.
|
|
90
|
-
*
|
|
91
|
-
* ## The loss table
|
|
92
|
-
*
|
|
93
|
-
* Every semantic capability owes one (ADR 0012), and this is the OWM DSL's.
|
|
94
|
-
* INVISIBLE is not LOST, and the distinction is the deliverable.
|
|
95
|
-
*
|
|
96
|
-
* | what | state | after a round trip |
|
|
97
|
-
* | ---------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
98
|
-
* | `component` / `anchor` / `market` / `ecosystem` and their coordinates | mapped | drawn, and written back from the drawing, to two decimals |
|
|
99
|
-
* | `accelerator` / `deaccelerator` and their coordinates | mapped | drawn as the climate arrow, and written back under OWM's own spelling (`deaccelerator` for a decelerator) |
|
|
100
|
-
* | the NAME, which in this format is the identity | mapped | given back verbatim, quoted exactly as it needs to be — the fixed point |
|
|
101
|
-
* | `pipeline Name [m1, m2]` | mapped | drawn as the body + handle composite; `[m1, m2]` written back from the body's two edges |
|
|
102
|
-
* | `note Text [v, e]` | mapped | a free text on the map, written back from its centre |
|
|
103
|
-
* | `evolve X [-> Y] m` | mapped | an evolved twin at the same height plus a change arrow, written back from the arrow |
|
|
104
|
-
* | `A->B` links | mapped | a `wardley:dependency` connector, consumer → what it needs, never inverted |
|
|
105
|
-
* | `title` | mapped | consumed as the board's own name; written back from the board's name (see the two rows below) |
|
|
106
|
-
* | a mapped line's TAIL — `label [x, y]`, `(build)`, `inertia`, comments | carried | invisible on the canvas, re-appended to the very line it came off |
|
|
107
|
-
* | `style`, `annotation(s)`, `attitudes`, `submap`, `url`, `size`, the axis-label overrides | carried | invisible on the canvas, re-emitted verbatim at the end of the file |
|
|
108
|
-
* | flow links (`+>`, `+<`, `+<>`, `+'…'>`) and a link with a `;` context | carried | not drawn — a flow is not a dependency — and re-emitted verbatim |
|
|
109
|
-
* | a `pipeline` with a `{ … }` body | carried | the block is kept whole and written back whole; the pack draws no pipeline children |
|
|
110
|
-
* | `//` comments | carried | re-emitted verbatim, at the end |
|
|
111
|
-
* | anything else the reader does not recognise | carried | re-emitted verbatim, at the end |
|
|
112
|
-
* | **nothing** | quarantined | every statement this format writes is a standalone sentence, so nothing carried can contradict the drawing (D5) |
|
|
113
|
-
* | a statement with NO coordinates (`anchor Client`) | **lost** | the reader places it at the reference default (0.9, 0.1) and says so; the export then writes the coordinates we invented, not the silence the file had |
|
|
114
|
-
* | a statement with MALFORMED coordinates | **lost** | same, and the report carries a `warning` as well as the `invented-layout` note |
|
|
115
|
-
* | a statement positioned on ONE axis (`[0.5]`, `[nonsense, 0.5]`) | **half mapped, half lost** | the axis the file gave is read and kept exactly; the other takes the reference default and gets its own `invented-layout` note naming WHICH axis was invented. The statement counts as `mapped` — it was positioned — and the export writes a full pair, so the axis the file left silent comes back as a number |
|
|
116
|
-
* | the file's own line ORDER and its blank lines | **lost** | the writer groups statements into sections. Nothing semantic depends on it, and carrying blank lines would make an untouched Labre file report a carried count |
|
|
117
|
-
* | a `pipeline`'s visibility | **lost** | OWM derives it from the component of the same name; the reader places the body under that component and the writer does not write it back |
|
|
118
|
-
* | an `evolve` twin drawn at a different height | **lost** | `evolve` moves along the evolution axis only; the export warns |
|
|
119
|
-
* | a Labre `method` node (build / buy / outsource) | **lost** | written as a plain component — OWM says a method with a decorator this writer cannot tell apart. The export warns |
|
|
120
|
-
* | the file's `title` | **carried**, and it WINS | kept under `attrs['@document'].title` and written back in preference to the name the caller passes — D3's precedence, the same one `interchange.<fmt>.id` has on every element. A board renamed in Labre therefore still exports under the title its file carried, and the export warns that it did; the caller's name is used only when the file carried none (and is still what the DOWNLOAD is called either way) |
|
|
121
|
-
* | surface identity across a re-import | **lost** | a new map beside the old one, never a merge |
|
|
122
|
-
* | a name whose whitespace matters (`Foo Bar`) | **round-trips here, at risk elsewhere** | this reader keeps a name VERBATIM and this writer gives it back verbatim, so Labre → Labre is exact. onlinewardleymaps does not: `normalizeComponentName` collapses whitespace runs before it matches a link end to a component, so a map that goes Labre → OWM → Labre may come back with its links dangling. Not sanitized here, because sanitizing would lose the author's name to protect another tool's matcher |
|
|
123
|
-
* | a top-level `market` / `ecosystem` statement | **round-trips here, refused elsewhere** | Labre reads and writes both. The reference `Converter` registers no strategy for either keyword, so such a line reaches `LinksExtractionStrategy`, has no `->` in it and is recorded as a PARSE ERROR — onlinewardleymaps does not merely fail to draw it. The interoperable spelling is a component carrying the decorator (`component Suppliers [0.3, 0.7] (market)`), which this pair already round-trips through the carried tail |
|
|
124
|
-
*
|
|
125
|
-
* `sourceVersion` reports the DIALECT, because the DSL declares no version: the
|
|
126
|
-
* OnlineWardleyMaps frontend's own extraction strategies, which is what this
|
|
127
|
-
* reader was written against. It reads `DSL (Labre)` for a file holding nothing
|
|
128
|
-
* this library does not itself write — the honest form of "a file we wrote",
|
|
129
|
-
* since the format has no marker to claim one with.
|
|
34
|
+
* `deaccelerator` is OWM's own spelling of a decelerator — the keyword the
|
|
35
|
+
* reference parser claims — so the KEY is the format's word and the VALUE is
|
|
36
|
+
* this canvas's kind. It is the one row where the two differ, and the reason
|
|
37
|
+
* this is a table rather than an identity.
|
|
38
|
+
*/
|
|
39
|
+
declare const NODE_KEYWORDS: {
|
|
40
|
+
readonly component: "component";
|
|
41
|
+
readonly anchor: "anchor";
|
|
42
|
+
readonly market: "market";
|
|
43
|
+
readonly ecosystem: "ecosystem";
|
|
44
|
+
readonly accelerator: "accelerator";
|
|
45
|
+
readonly deaccelerator: "decelerator";
|
|
46
|
+
};
|
|
47
|
+
export type WardleyNodeKeyword = keyof typeof NODE_KEYWORDS;
|
|
48
|
+
type NodeKeyword = WardleyNodeKeyword;
|
|
49
|
+
/**
|
|
50
|
+
* The statements a Wardley map is made of — what this reader builds out of
|
|
51
|
+
* lines, and what the SVG reader (`svg-import.ts`, ADR 0032 §2) builds out of
|
|
52
|
+
* a picture, so both are laid out by {@link layoutWardleyStatements} and a map
|
|
53
|
+
* that arrives from a file and one that arrives from a drawing are the same
|
|
54
|
+
* elements.
|
|
55
|
+
*
|
|
56
|
+
* `id` is the identity links, pipelines and `evolve` lines refer to. OWM has
|
|
57
|
+
* none — the NAME is the identity — so this reader leaves it out; a picture
|
|
58
|
+
* has ids of its own (an SVG producer's), and names that may repeat.
|
|
59
|
+
*/
|
|
60
|
+
export interface WardleyNodeStatement {
|
|
61
|
+
keyword: NodeKeyword;
|
|
62
|
+
name: string;
|
|
63
|
+
id?: string;
|
|
64
|
+
visibility: number;
|
|
65
|
+
evolution: number;
|
|
66
|
+
tail: string;
|
|
67
|
+
invented: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* `id` / `name`: the identity and the name of the component it hangs under —
|
|
71
|
+
* or, with `top`, of the pipeline itself, standing alone with its body's top
|
|
72
|
+
* edge at that visibility (a picture that draws a pipeline as its own
|
|
73
|
+
* artefact; the DSL never does).
|
|
130
74
|
*/
|
|
131
|
-
export
|
|
75
|
+
export interface WardleyPipelineStatement {
|
|
76
|
+
name: string;
|
|
77
|
+
id?: string;
|
|
78
|
+
from: number;
|
|
79
|
+
to: number;
|
|
80
|
+
top?: number;
|
|
81
|
+
tail: string;
|
|
82
|
+
invented: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface WardleyNoteStatement {
|
|
85
|
+
text: string;
|
|
86
|
+
visibility: number;
|
|
87
|
+
evolution: number;
|
|
88
|
+
tail: string;
|
|
89
|
+
invented: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** `id` / `name`: the component that moves; `becomes`: its twin's name. */
|
|
92
|
+
export interface WardleyEvolveStatement {
|
|
93
|
+
name: string;
|
|
94
|
+
id?: string;
|
|
95
|
+
becomes: string;
|
|
96
|
+
evolution: number;
|
|
97
|
+
tail: string;
|
|
98
|
+
invented: boolean;
|
|
99
|
+
}
|
|
100
|
+
/** Two identities: the consumer, then what it needs (ADR 0010). */
|
|
101
|
+
export interface WardleyLinkStatement {
|
|
102
|
+
from: string;
|
|
103
|
+
to: string;
|
|
104
|
+
}
|
|
132
105
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* lands where the tool that wrote the file would have drawn it.
|
|
106
|
+
* An inertia bar, centred where it was drawn. The DSL has no statement for
|
|
107
|
+
* one — `inertia` is a modifier this reader carries in a line's tail — so only
|
|
108
|
+
* a picture ever produces it.
|
|
137
109
|
*/
|
|
138
|
-
export
|
|
139
|
-
|
|
110
|
+
export interface WardleyInertiaStatement {
|
|
111
|
+
visibility: number;
|
|
112
|
+
evolution: number;
|
|
113
|
+
}
|
|
114
|
+
export interface WardleyStatements {
|
|
115
|
+
nodes: WardleyNodeStatement[];
|
|
116
|
+
pipelines: WardleyPipelineStatement[];
|
|
117
|
+
notes: WardleyNoteStatement[];
|
|
118
|
+
evolutions: WardleyEvolveStatement[];
|
|
119
|
+
links: WardleyLinkStatement[];
|
|
120
|
+
inertias: WardleyInertiaStatement[];
|
|
121
|
+
}
|
|
140
122
|
/**
|
|
141
123
|
* An OWM document as element props, plus what became of every line.
|
|
142
124
|
*
|
|
@@ -144,3 +126,22 @@ export declare const OWM_DEFAULT_EVOLUTION = 0.1;
|
|
|
144
126
|
* @param context the caller's name for it, used only if the file names nothing.
|
|
145
127
|
*/
|
|
146
128
|
export declare function importWardleyOwm(source: string, context?: InterchangeImportContext): InterchangeImportResult;
|
|
129
|
+
/**
|
|
130
|
+
* Statements as element props, on a new map at the reference size — the OWM
|
|
131
|
+
* reader's own layout, shared with the SVG reader (ADR 0032 §2.3) so the two
|
|
132
|
+
* paths draw the same elements.
|
|
133
|
+
*
|
|
134
|
+
* Every element that a later statement refers to carries its identity under
|
|
135
|
+
* `interchange.owm.id` (D3): the OWM reader hands that to the materializer
|
|
136
|
+
* as is, and the SVG reader turns it into a provisional local id and drops
|
|
137
|
+
* the payload, because a picture promises no round-trip.
|
|
138
|
+
*
|
|
139
|
+
* @param options.mapPayload what rides on the map element under `owm`, if
|
|
140
|
+
* anything.
|
|
141
|
+
* @param options.onInvented told of every position this layout made up.
|
|
142
|
+
*/
|
|
143
|
+
export declare function layoutWardleyStatements(statements: WardleyStatements, options: {
|
|
144
|
+
mapPayload?: ForeignInterchange;
|
|
145
|
+
onInvented: (element: string, name: string, why: string, whyKey?: string) => void;
|
|
146
|
+
}): SerializedElementProps[];
|
|
147
|
+
export {};
|