@miragon/wardley-renderer 0.13.0 → 0.14.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 +141 -30
- package/dist/Modeler.d.ts.map +1 -1
- package/dist/WardleyBaseViewer.d.ts.map +1 -1
- package/dist/a11y/canvasFocus.d.ts +28 -0
- package/dist/a11y/canvasFocus.d.ts.map +1 -1
- package/dist/a11y/index.d.ts +1 -1
- package/dist/a11y/index.d.ts.map +1 -1
- package/dist/appearance/index.d.ts +10 -0
- package/dist/appearance/index.d.ts.map +1 -0
- package/dist/appearance/index.js +5 -0
- package/dist/appearance/index.js.map +1 -0
- package/dist/append/WardleyAppendBehavior.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeWardley.d.ts +5 -3
- package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -1
- package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -1
- package/dist/draw/WardleyRenderer.d.ts.map +1 -1
- package/dist/draw/index.d.ts +1 -1
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/label-layout.d.ts +13 -4
- package/dist/draw/label-layout.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts +16 -4
- package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawingHandles.d.ts +17 -3
- package/dist/draw-tool/WardleyDrawingHandles.d.ts.map +1 -1
- package/dist/draw-tool/index.d.ts.map +1 -1
- package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts.map +1 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts +10 -3
- package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
- package/dist/evolve/index.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1935 -1495
- package/dist/index.js.map +1 -1
- package/dist/interaction/WardleyInteraction.d.ts +92 -0
- package/dist/interaction/WardleyInteraction.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +5 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/io/WardleyExporter.d.ts +12 -2
- package/dist/io/WardleyExporter.d.ts.map +1 -1
- package/dist/io/rasterize.d.ts +6 -0
- package/dist/io/rasterize.d.ts.map +1 -1
- package/dist/keyboard/WardleyKeyboard.d.ts +18 -1
- package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
- package/dist/label-drag/WardleyLabelDragging.d.ts +9 -3
- package/dist/label-drag/WardleyLabelDragging.d.ts.map +1 -1
- package/dist/label-drag/index.d.ts.map +1 -1
- package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
- package/dist/label-editing/fieldError.d.ts +6 -0
- package/dist/label-editing/fieldError.d.ts.map +1 -1
- package/dist/label-editing/imeComposition.d.ts +7 -0
- package/dist/label-editing/imeComposition.d.ts.map +1 -0
- package/dist/label-editing/index.d.ts +2 -1
- package/dist/label-editing/index.d.ts.map +1 -1
- package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -1
- package/dist/live-preview/LivePreview.d.ts +18 -3
- package/dist/live-preview/LivePreview.d.ts.map +1 -1
- package/dist/live-preview/index.d.ts +1 -1
- package/dist/live-preview/index.d.ts.map +1 -1
- package/dist/map-menu/AxisLabelsPopover.d.ts.map +1 -1
- package/dist/map-menu/MapSizePopover.d.ts.map +1 -1
- package/dist/map-menu/ShortcutsDialog.d.ts +11 -1
- package/dist/map-menu/ShortcutsDialog.d.ts.map +1 -1
- package/dist/map-menu/TitleDialog.d.ts.map +1 -1
- package/dist/map-menu/popover.d.ts.map +1 -1
- package/dist/palette/WardleyHoverTooltipTeardown.d.ts +17 -0
- package/dist/palette/WardleyHoverTooltipTeardown.d.ts.map +1 -0
- package/dist/palette/WardleyPaletteArmedTool.d.ts +19 -0
- package/dist/palette/WardleyPaletteArmedTool.d.ts.map +1 -0
- package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -1
- package/dist/palette/WardleyPaletteTooltip.d.ts +28 -0
- package/dist/palette/WardleyPaletteTooltip.d.ts.map +1 -0
- package/dist/palette/index.d.ts +7 -1
- package/dist/palette/index.d.ts.map +1 -1
- package/dist/popup/WardleyElementSettingsProvider.d.ts.map +1 -1
- package/dist/wardley.css +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
[diagram-js](https://github.com/bpmn-io/diagram-js)-based renderer for
|
|
7
7
|
[Wardley Maps](https://learnwardleymapping.com/): `Viewer`, `NavigatedViewer`, and a full editable
|
|
8
|
-
`Modeler`, plus OWM / JSON import and OWM / JSON / SVG
|
|
8
|
+
`Modeler`, plus OWM / JSON import and OWM / JSON / SVG export (a PNG through `svgToPng` of
|
|
9
|
+
`@miragon/modeler-shell/export`). Browser/DOM only.
|
|
9
10
|
|
|
10
11
|
## Install
|
|
11
12
|
|
|
@@ -47,7 +48,7 @@ Swap `NavigatedViewer` for `Modeler` to get the editable map (palette, context p
|
|
|
47
48
|
| `undo()` / `redo()` / `canUndo()` / `canRedo()` | `Modeler` only: the canvas command stack. |
|
|
48
49
|
| `commitPendingEdits()` | `Modeler` only: saves an open inline editor, e.g. before a save shortcut. |
|
|
49
50
|
| `on(event, callback)` / `off(event, callback)` | diagram-js events, see below. |
|
|
50
|
-
| `svgToPng(svg, { scale, transparent })` / `blobToBase64`
|
|
51
|
+
| `svgToPng(svg, { scale, transparent })` (deprecated) / `blobToBase64` | Deprecated, see below: rasterizes an exported SVG (default 2×, paper background). `blobToBase64` encodes a Blob. |
|
|
51
52
|
| `setAsideEditorState(modeler)` / `restoreEditorState(…)` | Keeps the selection and an open inline editor across a re-import of an externally changed map. |
|
|
52
53
|
|
|
53
54
|
`setEvolutionLabels` turns an empty stage into its default label and `->` into `→`, so the labels
|
|
@@ -63,7 +64,8 @@ typed text across a view change, a scroll, a zoom or a host's fit, and moves wit
|
|
|
63
64
|
Enter, leaving the field, or a click or drag on the canvas saves it. Shift+Enter breaks the line in
|
|
64
65
|
a name (a note's Enter breaks it, and Cmd/Ctrl+Enter saves); the editor of a name is a `<textarea>`
|
|
65
66
|
that grows with its lines, `textarea.wardley-label-input`. A name's line breaks are drawn as lines
|
|
66
|
-
of the label and written to the DSL as a literal `\n` (`@miragon/wardley-dsl`).
|
|
67
|
+
of the label and written to the DSL as a literal `\n` (`@miragon/wardley-dsl`). A backslash typed
|
|
68
|
+
before an `n` in a name is saved as `∖` (U+2216), because the DSL would read `\n` back as a break.
|
|
67
69
|
|
|
68
70
|
Options (the names of the `@miragon/modeler-api` 1.2 factory options):
|
|
69
71
|
|
|
@@ -91,8 +93,27 @@ Enter and Space on a palette tool (lasso, draw) leave the focus on the entry; on
|
|
|
91
93
|
they place the element and hand the focus to the canvas, or to the new element's name editor; on a
|
|
92
94
|
context-pad action they keep the focus in the pad, and an action that closes or redraws the pad
|
|
93
95
|
(delete, line style, remove evolve) returns it to the canvas. A host that hides the canvas without
|
|
94
|
-
destroying it makes the container `inert
|
|
95
|
-
|
|
96
|
+
destroying it makes the container `inert` or hides it with `display: none` or `visibility: hidden`,
|
|
97
|
+
not only transparent: the browser moves the focus off the canvas at its next rendering update. A
|
|
98
|
+
key that reaches the canvas or the map's own chrome before then stays with the page, for each way
|
|
99
|
+
of hiding: the canvas acts on no key, the palette triggers no entry and moves no focus, a line the
|
|
100
|
+
draw tool holds stays as it is, the context pad, the name, annotation and link editors, the colour
|
|
101
|
+
picker and the map menu's popovers take no key, Enter on one of their buttons included, and the
|
|
102
|
+
element settings menu picks no entry: nothing is saved or closed, and the focus stays where it is.
|
|
103
|
+
|
|
104
|
+
Escape on the canvas ends every drag without a change, as it ends a diagram-js drag: also a label
|
|
105
|
+
drag, the point drag of a drawing (the drawing stays selected) and the drag of a component's red
|
|
106
|
+
evolve target. These drags and the colour picker take only an Escape aimed at the canvas (the
|
|
107
|
+
picker also one on its swatches); one aimed at the palette, the context pad, a name editor or a
|
|
108
|
+
host's field, menu, dialog or overlay, inside the canvas container or next to it, stays with that
|
|
109
|
+
control. While the draw tool holds the points of a line, the single-key tools do nothing until the
|
|
110
|
+
line is finished or cancelled, and the canvas takes them with `preventDefault()`. Enter and Space
|
|
111
|
+
on the Draw entry save the line, as Enter on the canvas does. While a point of a drawing is dragged,
|
|
112
|
+
the keys that would change the drawing under the drag or start a second gesture next to it do
|
|
113
|
+
nothing until the release, and the canvas takes them with `preventDefault()`: the single-key tools,
|
|
114
|
+
the arrow keys, paste and duplicate. Delete still removes the drawing, which ends the drag without a
|
|
115
|
+
commit. An undo, a redo or any other command before the release ends the drag without a commit too,
|
|
116
|
+
and the drawing stays selected, as after Escape.
|
|
96
117
|
|
|
97
118
|
## Collaborative hosts
|
|
98
119
|
|
|
@@ -112,30 +133,94 @@ modeler.onContentChanged(() => save(modeler.exportText()));
|
|
|
112
133
|
|
|
113
134
|
An import is silent (no content change is reported back), keeps the selection and an open label
|
|
114
135
|
editor and fits the view (unless `fitOnImport: false`); a host's view change (`setViewState`, a fit)
|
|
115
|
-
never saves an open editor either. A gesture that runs during an import
|
|
116
|
-
|
|
117
|
-
drag
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
never saves an open editor either. A gesture that runs during an import ends first, so its release
|
|
137
|
+
changes nothing. A diagram-js drag is cancelled as Escape cancels it: a move, resize, connect or
|
|
138
|
+
lasso drag, a create from the palette, the context pad or a quick-create key (`C`, `U`, `N`, `P`
|
|
139
|
+
with the pointer over the canvas), a connect started with `A`, the evolve drag the context pad
|
|
140
|
+
starts and the plot-corner drag. A label drag, the point drag of a drawing and the drag of a
|
|
141
|
+
component's red evolve target end when the import removes their element. A line the draw tool holds
|
|
142
|
+
ends without a drawing, and the draw tool with it. A tool that only waits for the user's next press
|
|
143
|
+
stays armed: the lasso from the palette or `L`, and the draw tool before its first point. An
|
|
144
|
+
`importText` called while a user's action runs (a host that echoes its own change back through its
|
|
145
|
+
store imports from the action's change listener) waits until the action has finished, then imports,
|
|
146
|
+
and its Promise settles after that import; imports that wait keep their call order. A drop has
|
|
147
|
+
finished once it has ended and the steps it defers to the next task have run (the name editor of a
|
|
148
|
+
create or an append with the pointer). Any other command, undo or redo has finished once the code
|
|
149
|
+
that ran it has returned, so an import from any listener it calls waits too: a create without a
|
|
150
|
+
pointer (C, U, N, P, a palette entry with Enter or Space, the context pad's append with Enter), the
|
|
151
|
+
save of a name editor (Enter, leaving the field), the save a press on the map or the palette
|
|
152
|
+
makes, and a delete, an undo or a redo that deselects what it removes. The import keeps what the
|
|
153
|
+
action left, as any import does: a create keeps its new element selected and its name editor open
|
|
154
|
+
on it, with what was typed, and a saved name keeps its element selected. A drag that a press started
|
|
155
|
+
after it saved a name ends with the import, as an accepted import ends a running gesture and a press
|
|
156
|
+
below the drag threshold (L1, 1.5;
|
|
157
|
+
[#285](https://github.com/Miragon/modeler-suite/issues/285),
|
|
158
|
+
[#305](https://github.com/Miragon/modeler-suite/issues/305)). The start of a diagram-js drag is an
|
|
159
|
+
action too, until diagram-js has activated the drag: the start clears the selection, so an import
|
|
160
|
+
from the selection listener at the start of a move, a resize, a connect, the evolve placement or a
|
|
161
|
+
create from the palette, the context pad or a quick-create key runs right after it and then ends
|
|
162
|
+
that drag, without an error and without a change
|
|
163
|
+
([#336](https://github.com/Miragon/modeler-suite/issues/336)). A `destroy()` from the selection
|
|
164
|
+
listener there, or from `interaction.onChange` as the drag starts, throws nothing either, also at
|
|
165
|
+
the start of the renderer's own drags (a label, a point of a drawing, the evolve target): the map is
|
|
166
|
+
torn down once the code that started the drag has returned, and no listener of the host hears
|
|
167
|
+
anything after `destroy()`, also not the selection the cancelled drag brings back
|
|
168
|
+
([#346](https://github.com/Miragon/modeler-suite/issues/346)). The same holds for a `destroy()`
|
|
169
|
+
from any listener at a drop or at Escape, the renderer's own drags included, at a create from the
|
|
170
|
+
palette or the keyboard and at a paste placed with a click: the map is torn down once the handler
|
|
171
|
+
of that input has returned, and the name editor a create opens a task later stays closed. No
|
|
172
|
+
delivery calls a listener that an earlier listener of the same delivery unsubscribed
|
|
173
|
+
([#380](https://github.com/Miragon/modeler-suite/issues/380),
|
|
174
|
+
[#373](https://github.com/Miragon/modeler-suite/issues/373)). So does a `destroy()` from a listener
|
|
175
|
+
that a host's own call reaches: the selection listener of `elements.reveal`, or the interaction and
|
|
176
|
+
selection listeners of an import, which ends a held gesture, empties the selection as it clears the
|
|
177
|
+
canvas and selects again what was selected before it. The map is torn down once that call has
|
|
178
|
+
returned. The import still draws its map, which `exportText()` then returns
|
|
179
|
+
([#415](https://github.com/Miragon/modeler-suite/issues/415)), and its Promise rejects with "The
|
|
180
|
+
modeler was destroyed.", as an import does that waits when the modeler is destroyed.
|
|
181
|
+
`exportText()` is the committed document, never a live preview: while the plot corner, an evolve target (its red circle
|
|
182
|
+
or the evolve placement of the context pad) or a label is dragged, or the size or axis-label popover
|
|
183
|
+
previews a change, it returns the document as it was before, and the change event of the commit
|
|
184
|
+
brings the new one ([#347](https://github.com/Miragon/modeler-suite/issues/347)). A command during a
|
|
124
185
|
size preview (an undo pressed mid-drag, a title the host sets) puts the preview back first, and a
|
|
125
|
-
drag then ends without resizing, so the history stays in step with the document.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`
|
|
186
|
+
drag then ends without resizing, so the history stays in step with the document. A drawing's point
|
|
187
|
+
drag, the drag of an evolve target and a label drag end the same way, without a commit, when a
|
|
188
|
+
command runs before their release (an undo pressed mid-drag, or an arrow-key nudge during the other
|
|
189
|
+
two, since a point drag leaves the arrow keys without effect).
|
|
190
|
+
`elements` names components, anchors, pipelines, submaps and accelerators by the id the document
|
|
191
|
+
gives them (`cmp_kettle`), also right after a canvas edit, and `elements.bounds(id)` gives an
|
|
192
|
+
element's live box in diagram coordinates; `getViewState` and `setViewState` carry the viewbox.
|
|
193
|
+
`contentBounds()` (contract 1.3) gives the box a host fits the view to, in diagram coordinates and
|
|
194
|
+
without padding: the plot with its axes and everything drawn beyond it (a long label at the
|
|
195
|
+
commodity edge, a note in the margin), the box the pan constraint keeps in view. It follows every
|
|
196
|
+
edit at once and stays the same across zoom and scroll. A map without elements still has its plot,
|
|
197
|
+
so it is never `undefined` while the modeler lives (before the first import it is the default plot);
|
|
198
|
+
tell an empty map by its elements. `diagram` is the wrapped `Modeler` or `NavigatedViewer` for
|
|
199
|
+
host-specific wiring. Both factories take the options above (`additionalModules`, `freeArea`,
|
|
200
|
+
`fitOnImport` and `undoRedoKeys`); the viewer never edits and ignores the undo keys. Both pass the
|
|
137
201
|
contract's conformance kit (1.3) without skips.
|
|
138
202
|
|
|
203
|
+
`interaction` (contract 1.5) tells a host whether the user holds a gesture, so it can defer a remote
|
|
204
|
+
re-import until the gesture ends: `active()` is true from the moment a move, resize, connect or
|
|
205
|
+
lasso drag, a label drag, the point drag of a drawing, the drag of an evolve target, the evolve or
|
|
206
|
+
plot-corner drag, a create from the palette, the context pad or a quick-create key with the pointer
|
|
207
|
+
over the canvas (also while its preview is over the palette) or a connect started with `A` starts,
|
|
208
|
+
until its drop or cancel. It stays false while the lasso or the draw tool only waits for the next
|
|
209
|
+
press, during a pan and on the viewer. `onChange(callback)` reports each change once, and may run
|
|
210
|
+
inside `importText` (its cancel of a gesture), so a host queues its re-import instead of importing
|
|
211
|
+
from the callback. A callback that throws is reported as an uncaught error a microtask later; the
|
|
212
|
+
gesture and the other callbacks go on as if it had returned.
|
|
213
|
+
|
|
214
|
+
`appearance` (contract 1.5) takes a host's mode: `themes` is `WARDLEY_THEMES`, `["light"]` until the
|
|
215
|
+
Miragon modelers turn dark together, and `set({ theme, contrast })` writes `data-cd-theme` (the theme
|
|
216
|
+
when `themes` lists it, else `themes[0]`) and, for `contrast: "high"`, `data-cd-kontrast="hoch"` on
|
|
217
|
+
the map's container, so the design tokens resolve there and not from the page: on a dark page the
|
|
218
|
+
map stays light, and the contrast the host asks for holds. It is view state: no change event, the
|
|
219
|
+
same text and SVG export, and the history, view, selection and an open editor are left as they are.
|
|
220
|
+
Until the first `set` the map takes its mode from the page, as before. `WARDLEY_THEMES` is also
|
|
221
|
+
`@miragon/wardley-renderer/themes`, which loads no DOM code, for hosts outside the browser (the VS
|
|
222
|
+
Code extension's theme bridge).
|
|
223
|
+
|
|
139
224
|
### Menu entries and dialogs for a host's chrome
|
|
140
225
|
|
|
141
226
|
The map's entries of a chrome menu (Model: "Map title…" where the host passes `mapTitle`, "Map
|
|
@@ -144,15 +229,41 @@ groups of [`@miragon/modeler-shell`](https://www.npmjs.com/package/@miragon/mode
|
|
|
144
229
|
`createMapSizePopover(chrome, modeler)` and `createAxisLabelsPopover(chrome, modeler)` build the two
|
|
145
230
|
popovers (a live preview, one undo step when done), `createTitleDialog(chrome, modeler)` the "Map
|
|
146
231
|
title…" dialog (one undo step on Apply, nothing for an unchanged title),
|
|
147
|
-
`
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
232
|
+
`mapShortcuts(chrome, options)` the groups of its "Keyboard shortcuts…" dialog as data. A web app
|
|
233
|
+
that binds Cmd/Ctrl+O, Cmd/Ctrl+S, Cmd/Ctrl+V on the canvas and `?` itself passes
|
|
234
|
+
`{ fileKeys: true, shortcutsKey: '?' }`, so the dialog lists them too, and
|
|
235
|
+
`mapMenu({ …, shortcutsKey: '?' })` shows the key's chip on "Keyboard shortcuts…". The shell opens
|
|
236
|
+
the dialog: `shell.showShortcutsDialog(mapShortcuts(shell, options))`, or, in a host without a
|
|
237
|
+
mounted shell, `showShortcutsDialog(mapShortcuts(chrome, options), { container })` of
|
|
238
|
+
`@miragon/modeler-shell`.
|
|
151
239
|
`createMapDialog(chrome, parts)` is the modal dialog all of them share (guide §8: header with Close,
|
|
152
240
|
scrolling body, footer), for a host's own dialogs in the same look; `dialogButton(label, variant)`
|
|
153
241
|
gives its buttons. `chrome` is the shell handle or anything of the same shape; the renderer never
|
|
154
242
|
imports the shell itself.
|
|
155
243
|
|
|
244
|
+
### Deprecated: `createShortcutsDialog` and `svgToPng`
|
|
245
|
+
|
|
246
|
+
Both are deprecated since 0.14.0 and removed in 0.15.0
|
|
247
|
+
([#258](https://github.com/Miragon/modeler-suite/issues/258)); the web app and the VS Code webview
|
|
248
|
+
of this repository no longer use them.
|
|
249
|
+
|
|
250
|
+
- `createShortcutsDialog(chrome, options)` (with `ShortcutsDialog` and `ShortcutsDialogChrome`) is
|
|
251
|
+
replaced by the shell's dialog, which takes the groups of `mapShortcuts` and fills the View group
|
|
252
|
+
with the chrome's zoom and fit keys (see above).
|
|
253
|
+
- `svgToPng(svg, { scale, transparent })` (with `SvgToPngOptions`) is replaced by `svgToPng` of
|
|
254
|
+
`@miragon/modeler-shell/export`, which embeds Geist, loads the SVG as a data: URL and fills the
|
|
255
|
+
background the caller names. A map has a plot, so its PNG lies on `--cd-ui-plot` (guide §10.7), not
|
|
256
|
+
on the paper this one fills:
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
import { COLORS } from "@miragon/wardley-renderer";
|
|
260
|
+
import { svgToPng } from "@miragon/modeler-shell/export";
|
|
261
|
+
|
|
262
|
+
const { svg } = await modeler.saveSVG();
|
|
263
|
+
const png = await svgToPng(svg, { background: COLORS.plotBackground }); // 2×
|
|
264
|
+
const forSlides = await svgToPng(svg, { background: "transparent", scale: 4 });
|
|
265
|
+
```
|
|
266
|
+
|
|
156
267
|
## Events
|
|
157
268
|
|
|
158
269
|
| Event | Payload | Notes |
|
package/dist/Modeler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modeler.d.ts","sourceRoot":"","sources":["../src/Modeler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAiB9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Modeler.d.ts","sourceRoot":"","sources":["../src/Modeler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAiB9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA8BvD;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,eAAe;cACvB,WAAW,IAAI,iBAAiB,EAAE;IA2CrD;;;OAGG;IACH,kBAAkB,IAAI,IAAI;IAK1B,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,OAAO;CAGnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyBaseViewer.d.ts","sourceRoot":"","sources":["../src/WardleyBaseViewer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAM9C,OAAO,EAOL,KAAK,SAAS,EAEd,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EAAW,KAAK,aAAa,EAA2B,MAAM,eAAe,CAAC;AASrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"WardleyBaseViewer.d.ts","sourceRoot":"","sources":["../src/WardleyBaseViewer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAM9C,OAAO,EAOL,KAAK,SAAS,EAEd,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EAAW,KAAK,aAAa,EAA2B,MAAM,eAAe,CAAC;AASrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMrD,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB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,IAAI;IA6BP;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAa5B,mEAAmE;IACnE,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,mBAAmB;IAI3B,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAKzC,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAKnC,4EAA4E;IAC5E,MAAM,IAAI,IAAI;IAId,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;IAQf,IAAI,SAAS,IAAI,WAAW,CAE3B;CACF"}
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { default as PopupMenu } from 'diagram-js/lib/features/popup-menu/PopupMenu';
|
|
2
3
|
/** The focusable canvas svg diagram-js renders into its container. */
|
|
3
4
|
export declare function canvasSvg(canvas: Canvas): SVGElement | null;
|
|
5
|
+
/**
|
|
6
|
+
* Whether a keydown is aimed at `root` or an element inside it and still free to act on. A keydown
|
|
7
|
+
* without a key (autofill), one a listener before this one took, and IME composition stay with the
|
|
8
|
+
* page, and so does a key inside an `inert` subtree or on a `root` that an ancestor with
|
|
9
|
+
* `display: none` or `visibility: hidden` hides: Chromium moves the focus off an element the host
|
|
10
|
+
* made inert or hid only at its next rendering update, so until then the key still reaches it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isKeyAimedAt(event: KeyboardEvent, root: Node | null | undefined): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether a key reaches an element the host made inert or hid, before the browser moved the focus
|
|
15
|
+
* off it. The map's own chrome (context pad, editors, popovers, colour picker, popup menu) leaves
|
|
16
|
+
* such a key to the page, as the canvas and the palette do. Its buttons ask it of their click too:
|
|
17
|
+
* Enter on a focused button still clicks it once the host hid it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isKeyOnHiddenTarget(event: Event): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* diagram-js's popup menu runs its selected entry on Enter, also on one the browser still sends to
|
|
22
|
+
* a menu the host made inert or hid: such a key picks nothing and goes on to the page unprevented.
|
|
23
|
+
*/
|
|
24
|
+
export declare function leaveKeysOnHiddenMenuToPage(popupMenu: Pick<PopupMenu, "trigger">): void;
|
|
25
|
+
/**
|
|
26
|
+
* A key is the canvas's only while the canvas `<svg>` has the focus, as with diagram-js' own
|
|
27
|
+
* keyboard: the svg holds no editor, palette, context pad or popup, so they keep their keys, and so
|
|
28
|
+
* do a host's controls inside the container or next to it, a page with nothing focused and a canvas
|
|
29
|
+
* the host made inert or hid.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isCanvasKey(event: KeyboardEvent, canvas: Canvas): boolean;
|
|
4
32
|
/**
|
|
5
33
|
* Moves keyboard focus to the canvas after a pointer gesture or an editor commit. Pointer work
|
|
6
34
|
* must not light up the keyboard focus ring around the whole viewport, and a press that suppressed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvasFocus.d.ts","sourceRoot":"","sources":["../../src/a11y/canvasFocus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"canvasFocus.d.ts","sourceRoot":"","sources":["../../src/a11y/canvasFocus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAE1E,sEAAsE;AACtE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAK3D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAWzF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAGzD;AAID;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,IAAI,CAMvF;AAOD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzE;AAcD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAO3D;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAezC;AAED,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD"}
|
package/dist/a11y/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleDeclaration } from 'didi';
|
|
2
2
|
/** Names the canvas for assistive technology (role, role description, label). */
|
|
3
3
|
export declare const canvasAccessibilityModule: ModuleDeclaration;
|
|
4
|
-
export { canvasSvg, focusCanvasWithoutRing, lastInteractionWasPointer, trackInputModality, } from './canvasFocus.js';
|
|
4
|
+
export { canvasSvg, focusCanvasWithoutRing, isCanvasKey, isKeyAimedAt, isKeyOnHiddenTarget, lastInteractionWasPointer, leaveKeysOnHiddenMenuToPage, trackInputModality, } from './canvasFocus.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/a11y/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/a11y/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,EAAE,iBAEvC,CAAC;AAEF,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/a11y/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,EAAE,iBAEvC,CAAC;AAEF,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppearanceTheme } from '@miragon/modeler-api';
|
|
2
|
+
/**
|
|
3
|
+
* The themes a Wardley map can be drawn in (`appearance.themes` of `@miragon/modeler-api`): light
|
|
4
|
+
* only until the Miragon modelers turn dark together (guide §13.5). Both apps and the VS Code theme
|
|
5
|
+
* bridge read this one list, so the web app, the webview and an embedding host draw the same modes.
|
|
6
|
+
* The module touches no DOM, for hosts that read it outside the browser
|
|
7
|
+
* (`@miragon/wardley-renderer/themes`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const WARDLEY_THEMES: readonly [AppearanceTheme, ...AppearanceTheme[]];
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appearance/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,eAAe,EAAE,GAAG,eAAe,EAAE,CAEjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["WARDLEY_THEMES"],"sources":["../../src/appearance/index.ts"],"sourcesContent":["import type { AppearanceTheme } from \"@miragon/modeler-api\";\n\n/**\n * The themes a Wardley map can be drawn in (`appearance.themes` of `@miragon/modeler-api`): light\n * only until the Miragon modelers turn dark together (guide §13.5). Both apps and the VS Code theme\n * bridge read this one list, so the web app, the webview and an embedding host draw the same modes.\n * The module touches no DOM, for hosts that read it outside the browser\n * (`@miragon/wardley-renderer/themes`).\n */\nexport const WARDLEY_THEMES: readonly [AppearanceTheme, ...AppearanceTheme[]] = Object.freeze([\n \"light\",\n] as const);\n"],"mappings":";AASA,IAAaA,IAAmE,OAAO,OAAO,CAC5F,OACF,CAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyAppendBehavior.d.ts","sourceRoot":"","sources":["../../src/append/WardleyAppendBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AA6CrC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,MAAM,CAAC,OAAO,WAA4B;gBAE9B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"WardleyAppendBehavior.d.ts","sourceRoot":"","sources":["../../src/append/WardleyAppendBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AA6CrC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,MAAM,CAAC,OAAO,WAA4B;gBAE9B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;CAkDnD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollaborativeModeler, CollaborativeModelerOptions, ElementBounds, ElementsSurface } from '@miragon/modeler-api';
|
|
1
|
+
import { AppearanceSurface, CollaborativeModeler, CollaborativeModelerOptions, ElementBounds, ElementsSurface, InteractionSurface } from '@miragon/modeler-api';
|
|
2
2
|
import { ModuleDeclaration } from 'didi';
|
|
3
3
|
import { Modeler } from '../Modeler.js';
|
|
4
4
|
import { NavigatedViewer } from '../NavigatedViewer.js';
|
|
@@ -17,11 +17,13 @@ export interface WardleyElementsSurface extends ElementsSurface {
|
|
|
17
17
|
bounds(id: string): ElementBounds | undefined;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* The contract surface, with the optional `contentBounds` of contract 1.3
|
|
21
|
-
* wrapped diagram for host-specific wiring.
|
|
20
|
+
* The contract surface, with the optional `contentBounds` of contract 1.3 and `interaction` and
|
|
21
|
+
* `appearance` of contract 1.5 always present, plus the wrapped diagram for host-specific wiring.
|
|
22
22
|
*/
|
|
23
23
|
export interface CollaborativeWardleyModeler extends CollaborativeModeler {
|
|
24
24
|
readonly elements: WardleyElementsSurface;
|
|
25
|
+
readonly interaction: InteractionSurface;
|
|
26
|
+
readonly appearance: AppearanceSurface;
|
|
25
27
|
readonly diagram: Modeler | NavigatedViewer;
|
|
26
28
|
contentBounds(): ElementBounds | undefined;
|
|
27
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollaborativeWardley.d.ts","sourceRoot":"","sources":["../../src/collaborative/CollaborativeWardley.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAElB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"CollaborativeWardley.d.ts","sourceRoot":"","sources":["../../src/collaborative/CollaborativeWardley.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAElB,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAExB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAM9C,OAAO,EAAE,OAAO,EAAE,MAA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
1
|
+
{"version":3,"file":"WardleyColorPicker.d.ts","sourceRoot":"","sources":["../../src/color-picker/WardleyColorPicker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAczD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAoBnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAtB3B,MAAM,CAAC,OAAO,WAAyD;IAEvE,OAAO,CAAC,OAAO,CAA0B;IAEzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAE3B;IAIF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAMpB;gBAGiB,MAAM,EAAE,MAAM,EAC/B,QAAQ,EAAE,QAAQ,EACD,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ;IASrC,sFAAsF;IACtF,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAgEjE,MAAM,IAAI,OAAO;IAIjB,KAAK,CAAC,OAAO,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAUrD,OAAO,CAAC,aAAa;CAmBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyRenderer.d.ts","sourceRoot":"","sources":["../../src/draw/WardleyRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAE5D,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CA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C,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM;IAM9D,OAAO,CAAC,aAAa;IAsCrB,kFAAkF;IAClF,OAAO,CAAC,YAAY;IAmFpB,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,YAAY;IAyDpB,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,YAAY;IAuCpB,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,eAAe;IA6BvB,OAAO,CAAC,UAAU;CA8CnB"}
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { ModuleDeclaration } from 'didi';
|
|
|
2
2
|
/** SVG rendering of all Wardley types (BaseRenderer subclass, priority 1500). */
|
|
3
3
|
export declare const wardleyDrawModule: ModuleDeclaration;
|
|
4
4
|
export { default as WardleyRenderer, LABEL_HANDLE_CLASS, LABEL_ROLE_ATTRIBUTE, MOVEMENT_CLASS, NAME_LABEL_CLASS, } from './WardleyRenderer.js';
|
|
5
|
-
export { componentLabelPlacement, componentLabelSlot, movementDeltaX, movementLabelPlacement, movementLabelSlot, normalizeLabelOffset, type LabelPlacement, } from './label-layout.js';
|
|
5
|
+
export { componentLabelPlacement, componentLabelSlot, movementDeltaX, movementLabelPlacement, movementLabelSlot, nameLineGrowth, normalizeLabelOffset, type LabelPlacement, type LineGrowth, } from './label-layout.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/draw/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAC;AAEF,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAC;AAEF,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
1
2
|
import { LabelOffset } from '@miragon/wardley-schema-model';
|
|
2
3
|
import { WardleyShape } from '../model/di-types.js';
|
|
3
4
|
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
@@ -31,14 +32,22 @@ export declare function movementDeltaX(shape: WardleyShape, grid: Pick<Evolution
|
|
|
31
32
|
export declare function estimatedLabelWidth(text: string): number;
|
|
32
33
|
export declare function nameLines(text: string | undefined): string[];
|
|
33
34
|
/**
|
|
34
|
-
* How the lines of a name that holds line breaks spread around the slot of
|
|
35
|
+
* How the lines of a name that holds line breaks spread around the slot of a one-line name:
|
|
35
36
|
* `centered` keeps the block's middle on the slot (names beside a circle or a symbol), `up` keeps
|
|
36
|
-
* the last line on it (a name above an icon, a pipeline's edge or an evolve arrow, which the
|
|
37
|
-
* must stay clear of).
|
|
37
|
+
* the last line on it (a name above an icon, a pipeline's top edge or an evolve arrow, which the
|
|
38
|
+
* lines must stay clear of), `down` keeps the first line on it (a name below a pipeline's top edge).
|
|
38
39
|
*/
|
|
39
|
-
export type LineGrowth = "centered" | "up";
|
|
40
|
+
export type LineGrowth = "centered" | "up" | "down";
|
|
40
41
|
export declare function firstLineBaseline(slotY: number, lineCount: number, growth: LineGrowth): number;
|
|
41
42
|
export declare function lastLineBaseline(slotY: number, lineCount: number, growth: LineGrowth): number;
|
|
43
|
+
/**
|
|
44
|
+
* How the lines of an element's own name grow, shared by the renderer and the name editor. A
|
|
45
|
+
* pipeline's dashed top edge runs through the centre of its anchor component, whose name grows
|
|
46
|
+
* upward as it does over an evolve arrow. The edge runs 11 px above the slot of a member's name:
|
|
47
|
+
* upward, its lines would straddle the edge and run into the anchor component's name, so they grow
|
|
48
|
+
* downward inside the box.
|
|
49
|
+
*/
|
|
50
|
+
export declare function nameLineGrowth(shape: WardleyShape, elementRegistry: Pick<ElementRegistry, "find">): LineGrowth;
|
|
42
51
|
/** The canonical OWM slot of a component name — the origin of its `label [dx, dy]`. */
|
|
43
52
|
export declare function componentLabelSlot(): {
|
|
44
53
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-layout.d.ts","sourceRoot":"","sources":["../../src/draw/label-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"label-layout.d.ts","sourceRoot":"","sources":["../../src/draw/label-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAEpE;;;;;;;GAOG;AAEH,eAAO,MAAM,SAAS,IAAI,C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;AACvF,wBAAgB,kBAAkB,IAAI;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAE7D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAK7F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,YAAY,EACnB,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,cAAc,CAchB;AAED,sGAAsG;AACtG,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAElF;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,cAAc,EAAE,MAAM,GACrB,cAAc,CAShB;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,IAAI;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAE1D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CAOxE;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAKpF"}
|
|
@@ -8,8 +8,10 @@ import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* Excalidraw-style polyline tool: activate, click point by point (rubber-band preview).
|
|
10
10
|
* Finishing (like Excalidraw): click the LAST point again, double-click, Enter or Escape
|
|
11
|
-
* commits the open line
|
|
12
|
-
* two points cancels. The result is ONE undoable
|
|
11
|
+
* commits the open line, and so does Space on the tool's palette entry; clicking the FIRST point
|
|
12
|
+
* closes the shape. Escape with fewer than two points cancels. The result is ONE undoable
|
|
13
|
+
* `drawing` shape that moves as a whole. An import cancels a line in progress without committing
|
|
14
|
+
* it and leaves a tool without points armed.
|
|
13
15
|
*/
|
|
14
16
|
export default class WardleyDrawTool {
|
|
15
17
|
private readonly canvas;
|
|
@@ -26,6 +28,8 @@ export default class WardleyDrawTool {
|
|
|
26
28
|
private layer;
|
|
27
29
|
constructor(canvas: Canvas, eventBus: EventBus, modeling: Modeling, selection: Selection, factory: WardleyElementFactory, grid: EvolutionGrid, injector: Injector);
|
|
28
30
|
isActive(): boolean;
|
|
31
|
+
/** True while the tool holds the points of a line it has not finished yet. */
|
|
32
|
+
holdsLine(): boolean;
|
|
29
33
|
toggle(): void;
|
|
30
34
|
/**
|
|
31
35
|
* The OUTER viewer container — getContainer() returns the inner .djs-container, but the
|
|
@@ -58,10 +62,18 @@ export default class WardleyDrawTool {
|
|
|
58
62
|
* Enter and Escape end the drawing only when aimed at the canvas `<svg>`, or at the palette entry
|
|
59
63
|
* that starts this tool, where a tool started with Enter leaves the focus (guide §5.5). Every
|
|
60
64
|
* other target keeps them, inside the container too: a host's fields, buttons, menus and dialogs,
|
|
61
|
-
* its zoom panel, a focusable element in an overlay next to the canvas,
|
|
62
|
-
* listener on the document would otherwise take them from all
|
|
65
|
+
* its zoom panel, a focusable element in an overlay next to the canvas, `<body>` and a canvas the
|
|
66
|
+
* host made inert or hid. A capture listener on the document would otherwise take them from all
|
|
67
|
+
* of these.
|
|
63
68
|
*/
|
|
64
69
|
private ownsKey;
|
|
70
|
+
private targetsOwnPaletteEntry;
|
|
71
|
+
/**
|
|
72
|
+
* Enter and Space act alike on a palette entry (guide §5.5), and Space on this tool's entry would
|
|
73
|
+
* otherwise toggle the tool off and drop the line it holds, where Enter saves it. A Space with
|
|
74
|
+
* Alt, Ctrl or Meta activates no entry and stays the page's here too.
|
|
75
|
+
*/
|
|
76
|
+
private savesWithSpace;
|
|
65
77
|
private readonly onKeyDown;
|
|
66
78
|
private renderPreview;
|
|
67
79
|
private clearPreview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyDrawTool.d.ts","sourceRoot":"","sources":["../../src/draw-tool/WardleyDrawTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAQrC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,SAAS,MAAM,6CAA6C,CAAC;AAGzE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAcpE
|
|
1
|
+
{"version":3,"file":"WardleyDrawTool.d.ts","sourceRoot":"","sources":["../../src/draw-tool/WardleyDrawTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAQrC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,SAAS,MAAM,6CAA6C,CAAC;AAGzE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAcpE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAiBhC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAtB3B,MAAM,CAAC,OAAO,WAQZ;IAEF,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,KAAK,CAA2B;gBAGrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,QAAQ;IAYrC,QAAQ,IAAI,OAAO;IAInB,8EAA8E;IAC9E,SAAS,IAAI,OAAO;IAIpB,MAAM,IAAI,IAAI;IAKd;;;OAGG;IACH,OAAO,CAAC,cAAc;IAKtB,QAAQ,IAAI,IAAI;IAgBhB,4EAA4E;IAC5E,MAAM,IAAI,IAAI;IAOd,6DAA6D;IAC7D,OAAO,CAAC,YAAY;IAOpB;;;OAGG;IACH,OAAO,CAAC,MAAM;IAWd,MAAM,IAAI,IAAI;IAId,OAAO,CAAC,UAAU;IAelB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAYrB,sFAAsF;IACtF,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAsB1B;IAEF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAKzB;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAI1B;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,sBAAsB;IAQ9B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAcxB;IAEF,OAAO,CAAC,aAAa;IAiDrB,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -3,10 +3,11 @@ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
|
3
3
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
4
|
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
5
5
|
import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
|
|
6
|
+
import { WardleyInteraction } from '../interaction/index.js';
|
|
6
7
|
/**
|
|
7
8
|
* Vertex handles for drawings: when exactly one drawing is selected, every point gets a small
|
|
8
9
|
* draggable handle. Dragging shows a live preview; releasing commits the new geometry (points +
|
|
9
|
-
* recomputed bbox) as ONE undoable command.
|
|
10
|
+
* recomputed bbox) as ONE undoable command, and Escape ends the drag without one.
|
|
10
11
|
*/
|
|
11
12
|
export default class WardleyDrawingHandles {
|
|
12
13
|
private readonly eventBus;
|
|
@@ -14,22 +15,35 @@ export default class WardleyDrawingHandles {
|
|
|
14
15
|
private readonly modeling;
|
|
15
16
|
private readonly grid;
|
|
16
17
|
private readonly injector;
|
|
18
|
+
private readonly interaction;
|
|
17
19
|
static $inject: string[];
|
|
18
20
|
private shape;
|
|
19
21
|
private group;
|
|
20
22
|
private dragPreview;
|
|
21
23
|
private pointDrag;
|
|
22
|
-
|
|
24
|
+
private unwatchRelease;
|
|
25
|
+
constructor(eventBus: EventBus, canvas: Canvas, modeling: WardleyModeling, grid: EvolutionGrid, injector: Injector, interaction: WardleyInteraction);
|
|
23
26
|
private attach;
|
|
24
27
|
private absolutePoints;
|
|
25
28
|
private render;
|
|
26
29
|
private startDrag;
|
|
30
|
+
/** True from the press on a handle until the drag's release or its end. */
|
|
31
|
+
isDraggingPoint(): boolean;
|
|
27
32
|
/**
|
|
28
33
|
* Ends a running point drag without committing it. The point drag is this renderer's own gesture,
|
|
29
34
|
* outside diagram-js dragging, so the import's drag cancel does not reach it: the removal of its
|
|
30
|
-
* drawing ends it.
|
|
35
|
+
* drawing ends it, Escape does, and so does any command before the release.
|
|
31
36
|
*/
|
|
32
37
|
private endPointDrag;
|
|
38
|
+
/**
|
|
39
|
+
* After Escape or a command the button is still down on a handle that stays drawn, so the
|
|
40
|
+
* browser sends the release's click to the canvas, the element under both the press and the
|
|
41
|
+
* release, and a click there clears the selection. A commit redraws the handles, and then no
|
|
42
|
+
* click comes.
|
|
43
|
+
*/
|
|
44
|
+
private swallowClickOfRelease;
|
|
45
|
+
private stopWatchingRelease;
|
|
46
|
+
private stopPointDrag;
|
|
33
47
|
/** New bbox + relative points + normalized anchor — ONE undoable updateProperties command. */
|
|
34
48
|
private commit;
|
|
35
49
|
private renderDragPreview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyDrawingHandles.d.ts","sourceRoot":"","sources":["../../src/draw-tool/WardleyDrawingHandles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAQrC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAGzD,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"WardleyDrawingHandles.d.ts","sourceRoot":"","sources":["../../src/draw-tool/WardleyDrawingHandles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAQrC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAGzD,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAYlE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAiBtC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IArB9B,MAAM,CAAC,OAAO,WAOZ;IAEF,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,cAAc,CAA6B;gBAGhC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,kBAAkB;IAoClD,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,MAAM;IAsBd,OAAO,CAAC,SAAS;IA+CjB,2EAA2E;IAC3E,eAAe,IAAI,OAAO;IAI1B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAKpB;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,aAAa;IASrB,8FAA8F;IAC9F,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,KAAK;IAQb,4FAA4F;IAC5F,OAAO,CAAC,aAAa;CAWtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw-tool/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw-tool/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAM9C,eAAO,MAAM,qBAAqB,EAAE,iBAMnC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvolutionConstraintBehavior.d.ts","sourceRoot":"","sources":["../../src/evolution-grid/EvolutionConstraintBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AAGtE,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AASlE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"EvolutionConstraintBehavior.d.ts","sourceRoot":"","sources":["../../src/evolution-grid/EvolutionConstraintBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AAGtE,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AASlE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAsDpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,kBAAkB;IAcvE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CA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