@miragon/wardley-renderer 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 CHANGED
@@ -35,26 +35,13 @@ const { svg } = await viewer.saveSVG();
35
35
 
36
36
  Swap `NavigatedViewer` for `Modeler` to get the editable map (palette, context pad, undo/redo).
37
37
 
38
- For a host without the Miragon modeler shell, the `Modeler`'s palette is the toolbar of the Miragon
39
- design guide: a glass island at the top centre of the container (opaque in high contrast), in the
40
- second row, 64px from the top, in a container at most 760px wide, and ahead of the canvas in the
41
- tab order, with one tab stop that the arrow keys, Home and End move. Its tooltip names the entry
42
- and its key 8px below the palette, centred on the entry and at least 12px from the container's
43
- sides; it shows after 300ms of hover, at once on keyboard focus or for a neighbour, never for a
44
- tap, and hides on a press, on Escape and when the pointer or the focus leaves. Where the palette
45
- scrolls sideways, the tooltip moves with its entry and hides once the entry has left the view. The
46
- palette lies before the canvas `<svg>` in the container, so a host finds the canvas with
47
- `canvas.getContainer().querySelector(":scope > svg")`, not as the first `svg`. A palette a chrome
48
- skins (`data-chrome="palette"`) is left to that chrome.
49
-
50
- The lasso is pressed (`aria-pressed="true"`) only while it is armed, in every host: Enter or Space
51
- on the armed lasso puts it down, as Escape does, and so does arming the draw tool; a pointer's click
52
- on the lasso arms it again. One tool is armed at a time: arming the lasso (a click, Enter or Space
53
- on its entry, or L) puts the armed draw tool down, and a click, Enter or Space on the lasso's entry
54
- saves a line the draw tool holds, as Escape does; L does nothing while it holds one. While the
55
- read-only lock shows (below), the palette without the shell marks every entry but the lasso
56
- `aria-disabled="true"` and mutes it (guide §13.5): it stays focusable, and a click, drag, Enter or
57
- Space on it does nothing from the lock on.
38
+ Without the Miragon modeler shell, the `Modeler`'s palette is the design guide's toolbar: a glass
39
+ island at the top centre, ahead of the canvas in the tab order (one tab stop; arrows, Home and End
40
+ move), with tooltips. It lies before the canvas `<svg>` in the container, so find the canvas with
41
+ `canvas.getContainer().querySelector(":scope > svg")`. A palette a chrome skins
42
+ (`data-chrome="palette"`) is left to that chrome. One tool is armed at a time; the lasso is
43
+ `aria-pressed="true"` only while armed. Under the read-only lock the palette marks every entry but
44
+ the lasso `aria-disabled="true"`.
58
45
 
59
46
  ## API
60
47
 
@@ -75,18 +62,13 @@ Space on it does nothing from the lock on.
75
62
  `setEvolutionLabels` turns an empty stage into its default label and `->` into `→`, so the labels
76
63
  always write a valid `evolution` line; the default set is stored as `undefined`.
77
64
 
78
- An import validates the whole map first: a map that is not importable rejects before the canvas
79
- changes, and a rendering failure puts the previous map back. It then fits the view to the plot with
80
- its axis margins, centred in the free area and never above 100 %. Without a `freeArea` the pan
81
- constraint may still move a map smaller than the view, to keep its margins around it.
65
+ An import validates the whole map first: an invalid map rejects before the canvas changes, and a
66
+ rendering failure restores the previous map. It then fits the plot into the view (never above 100 %).
82
67
 
83
- An open inline editor (name, note, link annotation, flow value, link address) stays open with its
84
- typed text across a view change, a scroll, a zoom or a host's fit, and moves with its element;
85
- Enter, leaving the field, or a click or drag on the canvas saves it. Shift+Enter breaks the line in
86
- a name (a note's Enter breaks it, and Cmd/Ctrl+Enter saves); the editor of a name is a `<textarea>`
87
- that grows with its lines, `textarea.wardley-label-input`. A name's line breaks are drawn as lines
88
- of the label and written to the DSL as a literal `\n` (`@miragon/wardley-dsl`). A backslash typed
89
- before an `n` in a name is saved as `∖` (U+2216), because the DSL would read `\n` back as a break.
68
+ An open inline editor (name, note, link annotation, flow value, link address) survives view changes
69
+ and moves with its element; Enter, blur or a click on the canvas saves it. Names are a
70
+ `textarea.wardley-label-input`; Shift+Enter breaks the line (in notes Enter breaks and Cmd/Ctrl+Enter
71
+ saves), written to the DSL as a literal `\n`. A typed backslash before `n` is saved as `∖` (U+2216).
90
72
 
91
73
  Options (the names of the `@miragon/modeler-api` 1.2 factory options):
92
74
 
@@ -111,51 +93,23 @@ Options (the names of the `@miragon/modeler-api` 1.2 factory options):
111
93
  relative to the current map (`undefined` when the user cancels), which becomes the element's link
112
94
  in one undoable step.
113
95
 
114
- A component or submap whose link the editor can open, the cases where its context pad offers "Open
115
- link", carries a small link mark at its lower left (Lucide `link` in the `--cd-ui-link` role). It
116
- takes no pointer, the viewer shows none, and the export leaves it out, as the selection outline.
96
+ A component or submap whose link the editor can open carries a small link mark (Lucide `link`,
97
+ `--cd-ui-link`) at its lower left; the viewer and exports show none.
117
98
 
118
99
  The `wardleyReadOnly` service (`modeler.get<WardleyReadOnly>('wardleyReadOnly').setReadOnly(true)`)
119
- locks the canvas while its host cannot save an edit, e.g. while the document is invalid: every edit
120
- rule is vetoed, an open editor, popup or drag ends without saving, the handles hide, and selection,
121
- zoom, pan, select all and export stay. `setReadOnly(true, { delayMs: 800 })` locks at once but marks
122
- the palette only once the delay has passed without `setReadOnly(false)`, so typing an invalid file
123
- in an editor beside the canvas does not flicker (guide §13.5); a call while the delay runs keeps
124
- its timer, `setReadOnly(false)` takes the marks off at once, and `isReadOnlyShown()` tells whether
125
- they show. It fires `wardley.readOnly.changed` with `{ readOnly, shown }` when the lock changes and
126
- once more when delayed marks show.
127
-
128
- The canvas's keys (undo and redo, delete, copy, paste and duplicate, select all, the arrows, Escape
129
- and the single-key tools C, U, N, P, L and A) act only while the canvas `<svg>` has the focus, as
130
- diagram-js' own keyboard does: a key aimed at a host's button or text field, or at a page with
131
- nothing focused, stays with the host. A pointer click on the canvas, a palette entry or a
132
- context-pad action that opens no editor or popup hands the focus to the canvas. From the keyboard,
133
- Enter and Space on a palette tool (lasso, draw) leave the focus on the entry; on a create entry
134
- they place the element and hand the focus to the canvas, or to the new element's name editor; on a
135
- context-pad action they keep the focus in the pad, and an action that closes or redraws the pad
136
- (delete, line style, remove evolve) returns it to the canvas. A host that hides the canvas without
137
- destroying it makes the container `inert` or hides it with `display: none` or `visibility: hidden`,
138
- not only transparent: the browser moves the focus off the canvas at its next rendering update. A
139
- key that reaches the canvas or the map's own chrome before then stays with the page, for each way
140
- of hiding: the canvas acts on no key, the palette triggers no entry and moves no focus, a line the
141
- draw tool holds stays as it is, the context pad, the name, annotation and link editors, the colour
142
- picker and the map menu's popovers take no key, Enter on one of their buttons included, and the
143
- element settings menu picks no entry: nothing is saved or closed, and the focus stays where it is.
144
-
145
- Escape on the canvas ends every drag without a change, as it ends a diagram-js drag: also a label
146
- drag, the point drag of a drawing (the drawing stays selected) and the drag of a component's red
147
- evolve target. These drags and the colour picker take only an Escape aimed at the canvas (the
148
- picker also one on its swatches); one aimed at the palette, the context pad, a name editor or a
149
- host's field, menu, dialog or overlay, inside the canvas container or next to it, stays with that
150
- control. While the draw tool holds the points of a line, the single-key tools and Cmd/Ctrl+V (the
151
- paste attaches to the pointer) do nothing until the line is finished or cancelled, and the canvas
152
- takes them with `preventDefault()`. Enter and Space on the Draw entry save the line, as Enter on
153
- the canvas does. While a point of a drawing is dragged,
154
- the keys that would change the drawing under the drag or start a second gesture next to it do
155
- nothing until the release, and the canvas takes them with `preventDefault()`: the single-key tools,
156
- the arrow keys, paste and duplicate. Delete still removes the drawing, which ends the drag without a
157
- commit. An undo, a redo or any other command before the release ends the drag without a commit too,
158
- and the drawing stays selected, as after Escape.
100
+ locks the canvas while the host cannot save, e.g. while the document is invalid: edits are vetoed,
101
+ open editors and drags end without saving; selection, zoom, pan and export stay.
102
+ `setReadOnly(true, { delayMs: 800 })` locks at once but shows the marks only after the delay
103
+ (no flicker while typing); `isReadOnlyShown()` tells whether they show. It fires
104
+ `wardley.readOnly.changed` with `{ readOnly, shown }`.
105
+
106
+ Keyboard: the canvas's keys (undo/redo, delete, copy/paste/duplicate, select all, arrows, Escape and
107
+ the tools C, U, N, P, L, A) act only while the canvas `<svg>` has the focus, so keys aimed at a
108
+ host's controls stay with the host. A click on the canvas, a palette entry or a context-pad action
109
+ hands it the focus. A host that hides the canvas without destroying it should use `inert`,
110
+ `display: none` or `visibility: hidden`. Escape ends every drag without a change. While the draw
111
+ tool holds a line or a drawing's point is dragged, keys that would start another gesture do
112
+ nothing; an undo or other command ends such a drag without a commit.
159
113
 
160
114
  ## Collaborative hosts
161
115
 
@@ -173,123 +127,56 @@ await modeler.importText(documentText);
173
127
  modeler.onContentChanged(() => save(modeler.exportText()));
174
128
  ```
175
129
 
176
- An import is silent (no content change is reported back), keeps the selection and an open label
177
- editor and fits the view (unless `fitOnImport: false`); a host's view change (`setViewState`, a fit)
178
- never saves an open editor either. A gesture that runs during an import ends first, so its release
179
- changes nothing. A diagram-js drag is cancelled as Escape cancels it: a move, resize, connect or
180
- lasso drag, a create from the palette, the context pad or a quick-create key (`C`, `U`, `N`, `P`
181
- with the pointer over the canvas), a connect started with `A`, the evolve drag the context pad
182
- starts and the plot-corner drag. A label drag, the point drag of a drawing and the drag of a
183
- component's red evolve target end when the import removes their element. A line the draw tool holds
184
- ends without a drawing, and the draw tool with it. A tool that only waits for the user's next press
185
- stays armed: the lasso from the palette or `L`, and the draw tool before its first point. An
186
- `importText` called while a user's action runs (a host that echoes its own change back through its
187
- store imports from the action's change listener) waits until the action has finished, then imports,
188
- and its Promise settles after that import; imports that wait keep their call order. A drop has
189
- finished once it has ended and the steps it defers to the next task have run (the name editor of a
190
- create or an append with the pointer). Any other command, undo or redo has finished once the code
191
- that ran it has returned, so an import from any listener it calls waits too: a create without a
192
- pointer (C, U, N, P, a palette entry with Enter or Space, the context pad's append with Enter), the
193
- save of a name editor (Enter, leaving the field), the save a press on the map or the palette
194
- makes, and a delete, an undo or a redo that deselects what it removes. The import keeps what the
195
- action left, as any import does: a create keeps its new element selected and its name editor open
196
- on it, with what was typed, and a saved name keeps its element selected. A drag that a press started
197
- after it saved a name ends with the import, as an accepted import ends a running gesture and a press
198
- below the drag threshold (L1, 1.5;
130
+ An import is silent (no change is reported back), keeps the selection and an open label editor,
131
+ and fits the view unless `fitOnImport: false`. It ends a running gesture first, without a change;
132
+ an armed tool that only waits for the next press stays armed. An `importText` called while a user
133
+ action runs (e.g. from a change listener) waits until the action has finished; waiting imports keep
134
+ their order. A `destroy()` from any listener tears the map down once the current input handler has
135
+ returned, without errors, and no listener hears anything afterwards; a pending import then rejects
136
+ with "The modeler was destroyed." (details:
199
137
  [#285](https://github.com/Miragon/modeler-suite/issues/285),
200
- [#305](https://github.com/Miragon/modeler-suite/issues/305)). The start of a diagram-js drag is an
201
- action too, until diagram-js has activated the drag: the start clears the selection, so an import
202
- from the selection listener at the start of a move, a resize, a connect, the evolve placement or a
203
- create from the palette, the context pad or a quick-create key runs right after it and then ends
204
- that drag, without an error and without a change
205
- ([#336](https://github.com/Miragon/modeler-suite/issues/336)). A `destroy()` from the selection
206
- listener there, or from `interaction.onChange` as the drag starts, throws nothing either, also at
207
- the start of the renderer's own drags (a label, a point of a drawing, the evolve target): the map is
208
- torn down once the code that started the drag has returned, and no listener of the host hears
209
- anything after `destroy()`, also not the selection the cancelled drag brings back
210
- ([#346](https://github.com/Miragon/modeler-suite/issues/346)). The same holds for a `destroy()`
211
- from any listener at a drop or at Escape, the renderer's own drags included, at a create from the
212
- palette or the keyboard and at a paste placed with a click: the map is torn down once the handler
213
- of that input has returned, and the name editor a create opens a task later stays closed. No
214
- delivery calls a listener that an earlier listener of the same delivery unsubscribed
215
- ([#380](https://github.com/Miragon/modeler-suite/issues/380),
216
- [#373](https://github.com/Miragon/modeler-suite/issues/373)). So does a `destroy()` from a listener
217
- that a host's own call reaches: the selection listener of `elements.reveal`, or the interaction and
218
- selection listeners of an import, which ends a held gesture, empties the selection as it clears the
219
- canvas and selects again what was selected before it. The map is torn down once that call has
220
- returned. The import still draws its map, which `exportText()` then returns
221
- ([#415](https://github.com/Miragon/modeler-suite/issues/415)), and its Promise rejects with "The
222
- modeler was destroyed.", as an import does that waits when the modeler is destroyed.
223
- `exportText()` is the committed document, never a live preview: while the plot corner, an evolve target (its red circle
224
- or the evolve placement of the context pad) or a label is dragged, or the size or axis-label popover
225
- previews a change, it returns the document as it was before, and the change event of the commit
226
- brings the new one ([#347](https://github.com/Miragon/modeler-suite/issues/347)). A command during a
227
- size preview (an undo pressed mid-drag, a title the host sets) puts the preview back first, and a
228
- drag then ends without resizing, so the history stays in step with the document. A drawing's point
229
- drag, the drag of an evolve target and a label drag end the same way, without a commit, when a
230
- command runs before their release (an undo pressed mid-drag, or an arrow-key nudge during the other
231
- two, since a point drag leaves the arrow keys without effect).
232
- `elements` names components, anchors, pipelines, submaps and accelerators by the id the document
233
- gives them (`cmp_kettle`), also right after a canvas edit, and `elements.bounds(id)` gives an
234
- element's live box in diagram coordinates; `getViewState` and `setViewState` carry the viewbox.
235
- `contentBounds()` (contract 1.3) gives the box a host fits the view to, in diagram coordinates and
236
- without padding: the plot with its axes and everything drawn beyond it (a long label at the
237
- commodity edge, a note in the margin), the box the pan constraint keeps in view. It follows every
238
- edit at once and stays the same across zoom and scroll. A map without elements still has its plot,
239
- so it is never `undefined` while the modeler lives (before the first import it is the default plot);
240
- tell an empty map by its elements. `diagram` is the wrapped `Modeler` or `NavigatedViewer` for
241
- host-specific wiring. Both factories take the options above (`additionalModules`, `freeArea`,
242
- `fitOnImport`, `undoRedoKeys` and the link handlers); the viewer never edits and has no context
243
- pad, so it ignores the undo keys and the link handlers. Both pass the contract's conformance kit
244
- (1.3) without skips.
245
-
246
- `interaction` (contract 1.5) tells a host whether the user holds a gesture, so it can defer a remote
247
- re-import until the gesture ends: `active()` is true from the moment a move, resize, connect or
248
- lasso drag, a label drag, the point drag of a drawing, the drag of an evolve target, the evolve or
249
- plot-corner drag, a create from the palette, the context pad or a quick-create key with the pointer
250
- over the canvas (also while its preview is over the palette) or a connect started with `A` starts,
251
- until its drop or cancel. It stays false while the lasso or the draw tool only waits for the next
252
- press, during a pan and on the viewer. `onChange(callback)` reports each change once, and may run
253
- inside `importText` (its cancel of a gesture), so a host queues its re-import instead of importing
254
- from the callback. A callback that throws is reported as an uncaught error a microtask later; the
255
- gesture and the other callbacks go on as if it had returned.
256
-
257
- `appearance` (contract 1.5) takes a host's mode: `themes` is `WARDLEY_THEMES`, `["light"]` until the
258
- Miragon modelers turn dark together, and `set({ theme, contrast })` writes `data-cd-theme` (the theme
259
- when `themes` lists it, else `themes[0]`) and, for `contrast: "high"`, `data-cd-kontrast="hoch"` on
260
- the map's container, so the design tokens resolve there and not from the page: on a dark page the
261
- map stays light, and the contrast the host asks for holds. It is view state: no change event, the
262
- same text and SVG export, and the history, view, selection and an open editor are left as they are.
263
- Until the first `set` the map takes its mode from the page, as before. `WARDLEY_THEMES` is also
264
- `@miragon/wardley-renderer/themes`, which loads no DOM code, for hosts outside the browser (the VS
265
- Code extension's theme bridge).
138
+ [#336](https://github.com/Miragon/modeler-suite/issues/336),
139
+ [#346](https://github.com/Miragon/modeler-suite/issues/346),
140
+ [#415](https://github.com/Miragon/modeler-suite/issues/415)).
141
+
142
+ `exportText()` is the committed document, never a live preview: during a plot-corner, evolve or
143
+ label drag or a size or axis-label preview it returns the previous text, and the commit's change
144
+ event brings the new one ([#347](https://github.com/Miragon/modeler-suite/issues/347)).
145
+
146
+ `elements` names components, anchors, pipelines, submaps and accelerators by their document id
147
+ (`cmp_kettle`); `elements.bounds(id)` gives an element's live box. `getViewState` / `setViewState`
148
+ carry the viewbox. `contentBounds()` (contract 1.3) gives the box to fit: the plot with its axes and
149
+ everything drawn beyond it; never `undefined` while the modeler lives. `diagram` is the wrapped
150
+ `Modeler` or `NavigatedViewer`. Both factories take the options above; the viewer ignores the undo
151
+ keys and link handlers. Both pass the contract's conformance kit without skips.
152
+
153
+ `interaction` (contract 1.5): `active()` is true while the user holds a gesture (a drag, a create,
154
+ a connect), so a host can defer a remote re-import; false while a tool only waits, during a pan and
155
+ on the viewer. `onChange(callback)` reports each change once and may run inside `importText`, so
156
+ queue a re-import instead of importing from it.
157
+
158
+ `appearance` (contract 1.5): `themes` is `WARDLEY_THEMES` (`["light"]` for now);
159
+ `set({ theme, contrast })` writes `data-cd-theme` and, for `contrast: "high"`,
160
+ `data-cd-kontrast="hoch"` on the map's container. It is view state: no change event, same exports.
161
+ `@miragon/wardley-renderer/themes` exports `WARDLEY_THEMES` without DOM code.
266
162
 
267
163
  ### Menu entries and dialogs for a host's chrome
268
164
 
269
- The map's entries of a chrome menu (Model: "Map title…" where the host passes `mapTitle`, "Map
270
- size…" and "X-axis labels…"; Export; Help) come from `mapMenu(actions)`, in the shape the menu
271
- groups of [`@miragon/modeler-shell`](https://www.npmjs.com/package/@miragon/modeler-shell) take.
272
- `createMapSizePopover(chrome, modeler)` and `createAxisLabelsPopover(chrome, modeler)` build the two
273
- popovers (a live preview, one undo step when done; an Escape that closes one keeps a tool armed from
274
- the palette, as the shell's own layers do), `createTitleDialog(chrome, modeler)` the "Map
275
- title…" dialog (one undo step on Apply, nothing for an unchanged title),
276
- `mapShortcuts(chrome, options)` the groups of its "Keyboard shortcuts…" dialog as data. A web app
277
- that binds Cmd/Ctrl+O, Cmd/Ctrl+S, Cmd/Ctrl+V on the canvas and `?` itself passes
278
- `{ fileKeys: true, shortcutsKey: '?' }`, so the dialog lists them too, and
279
- `mapMenu({ …, shortcutsKey: '?' })` shows the key's chip on "Keyboard shortcuts…". The shell opens
280
- the dialog: `shell.showShortcutsDialog(mapShortcuts(shell, options))`, or, in a host without a
281
- mounted shell, `showShortcutsDialog(mapShortcuts(chrome, options), { container })` of
282
- `@miragon/modeler-shell`.
283
- `createMapDialog(chrome, parts)` is the modal dialog all of them share (guide §8: header with Close,
284
- scrolling body, footer), for a host's own dialogs in the same look; `dialogButton(label, variant)`
285
- gives its buttons. `chrome` is the shell handle or anything of the same shape; the renderer never
286
- imports the shell itself.
165
+ `mapMenu(actions)` gives the map's entries of a chrome menu (Model: "Map title…" when `mapTitle` is
166
+ passed, "Map size…", "X-axis labels…"; Export; Help) in the shape of
167
+ [`@miragon/modeler-shell`](https://www.npmjs.com/package/@miragon/modeler-shell)'s menu groups.
168
+ `createMapSizePopover(chrome, modeler)`, `createAxisLabelsPopover(chrome, modeler)` and
169
+ `createTitleDialog(chrome, modeler)` build the popovers and the title dialog (one undo step each).
170
+ `mapShortcuts(chrome, options)` returns the "Keyboard shortcuts…" groups as data; pass
171
+ `{ fileKeys: true, shortcutsKey: '?' }` if the host binds Cmd/Ctrl+O/S/V and `?`, and open it with
172
+ `shell.showShortcutsDialog(…)` (or `showShortcutsDialog(…, { container })` without a mounted shell).
173
+ `createMapDialog(chrome, parts)` and `dialogButton(label, variant)` build dialogs in the same look.
174
+ `chrome` is the shell handle or anything of its shape; the renderer never imports the shell.
287
175
 
288
176
  ### PNG export
289
177
 
290
- The package draws no PNG itself: `svgToPng` of `@miragon/modeler-shell/export` rasterizes the SVG of
291
- `saveSVG()`, embeds Geist, loads the SVG as a data: URL and fills the background the caller names. A
292
- map has a plot, so its PNG lies on `--cd-ui-plot` (guide §10.7), which is `COLORS.plotBackground`:
178
+ `svgToPng` of `@miragon/modeler-shell/export` rasterizes `saveSVG()` and embeds Geist. A map's PNG
179
+ lies on `COLORS.plotBackground`:
293
180
 
294
181
  ```ts
295
182
  import { COLORS } from "@miragon/wardley-renderer";
@@ -300,9 +187,6 @@ const png = await svgToPng(svg, { background: COLORS.plotBackground }); // 2×
300
187
  const forSlides = await svgToPng(svg, { background: "transparent", scale: 4 });
301
188
  ```
302
189
 
303
- `blobToBase64(png)` gives the picture as Base64 without the data-URL prefix, e.g. to post it to a VS
304
- Code extension host.
305
-
306
190
  ## Events
307
191
 
308
192
  | Event | Payload | Notes |
@@ -314,17 +198,9 @@ Code extension host.
314
198
 
315
199
  ### Fonts
316
200
 
317
- The package ships no fonts and uses no CDN. The canvas typeface is **Geist** (Miragon corporate
318
- identity); provide it yourself, preferably self-hosted via [`@fontsource`](https://fontsource.org/)
319
- (one variable file covers all weights):
320
-
321
- ```ts
322
- import "@fontsource-variable/geist/wght.css";
323
- ```
324
-
325
- That package registers the family as `'Geist Variable'`; the renderer's font stack starts with
326
- `'Geist Variable', 'Geist', …` so it matches either that package or a locally installed Geist. Use
327
- `'Geist Variable'` in your own CSS too: `'Geist'` alone never matches the self-hosted face.
201
+ No fonts ship and nothing loads from a CDN. Provide Geist, e.g.
202
+ `import "@fontsource-variable/geist/wght.css"`; the font stack starts with
203
+ `'Geist Variable', 'Geist', …`.
328
204
 
329
205
  Part of the [Wardley Maps Modeler](https://github.com/Miragon/modeler-suite/tree/main/modelers/wardley-maps) in the [Miragon modeler suite](https://github.com/Miragon/modeler-suite).
330
206
 
@@ -1,2 +1,3 @@
1
1
  export { WARDLEY_NOTATION, createCollaborativeModeler, createCollaborativeViewer, type CollaborativeWardleyModeler, type CollaborativeWardleyOptions, type WardleyElementsSurface, } from './CollaborativeWardley.js';
2
+ export { mergeOwmText } from './merge.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collaborative/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,GAC5B,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collaborative/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ModelTextMerge } from '@miragon/modeler-api';
2
+ /**
3
+ * The three-way merge of two OWM texts (`ModelTextMerge` of `@miragon/modeler-api`). OWM writes no
4
+ * ids: an element is known by the id its name derives, so a rename reads as a removal and a new
5
+ * element, which conflicts only when the other side changed that element too. The map's settings
6
+ * merge one by one, elements by that id, dependencies and flows by their ends and the lines the
7
+ * parser leaves unread as they are. Two different changes of one of them, a change against its
8
+ * removal, and an edge left without one of its ends throw a `MergeConflictError`. The result is
9
+ * the draft's text with the merged map patched in (`patchDSL`), so its comments and order stay.
10
+ */
11
+ export declare const mergeOwmText: ModelTextMerge;
12
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/collaborative/merge.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAuD9B;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,cA0C1B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export { restoreEditorState, setAsideEditorState } from './editor-state.js';
40
40
  export { wardleyInteractionModule, WardleyInteraction, INTERACTION_CHANGED, } from './interaction/index.js';
41
41
  export type { InteractionChangedEvent } from './interaction/index.js';
42
42
  export { WARDLEY_THEMES } from './appearance/index.js';
43
- export { WARDLEY_NOTATION, createCollaborativeModeler, createCollaborativeViewer, } from './collaborative/index.js';
43
+ export { WARDLEY_NOTATION, createCollaborativeModeler, createCollaborativeViewer, mergeOwmText, } from './collaborative/index.js';
44
44
  export type { CollaborativeWardleyModeler, CollaborativeWardleyOptions, WardleyElementsSurface, } from './collaborative/index.js';
45
45
  export { EXPORT_LABELS, createAxisLabelsPopover, createMapDialog, createMapSizePopover, createTitleDialog, dialogButton, mapMenu, mapShortcuts, } from './map-menu/index.js';
46
46
  export type { DialogChrome, MapDialog, MapDialogParts, MapShortcutOptions, TitleDialog, TitleDialogChrome, MapExport, MapExports, MapMenu, MapMenuAction, MapMenuActions, MapMenuDialog, MapMenuEntry, MapMenuIcon, PopoverChrome, PopoverHandle, ShortcutGroup, ShortcutKeyNames, ShortcutPlatform, ShortcutRow, ShortcutsChrome, } from './map-menu/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM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