@miragon/wardley-renderer 0.15.0 → 0.16.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 +22 -6
- package/dist/WardleyBaseViewer.d.ts +19 -0
- package/dist/WardleyBaseViewer.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeWardley.d.ts +8 -1
- package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -1
- package/dist/context-pad/WardleyContextPadProvider.d.ts +10 -1
- package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -1
- package/dist/draw/WardleyRenderer.d.ts +9 -1
- package/dist/draw/WardleyRenderer.d.ts.map +1 -1
- package/dist/draw/lucide.d.ts +2 -1
- package/dist/draw/lucide.d.ts.map +1 -1
- package/dist/draw/styles.d.ts +7 -0
- package/dist/draw/styles.d.ts.map +1 -1
- package/dist/index.js +1031 -957
- package/dist/index.js.map +1 -1
- package/dist/io/saveSvg.d.ts.map +1 -1
- package/dist/link-editing/WardleyLinkOpener.d.ts +24 -0
- package/dist/link-editing/WardleyLinkOpener.d.ts.map +1 -0
- package/dist/link-editing/index.d.ts +4 -2
- package/dist/link-editing/index.d.ts.map +1 -1
- package/dist/link-editing/link-url.d.ts +14 -0
- package/dist/link-editing/link-url.d.ts.map +1 -1
- package/dist/wardley.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -99,6 +99,21 @@ Options (the names of the `@miragon/modeler-api` 1.2 factory options):
|
|
|
99
99
|
- `fitOnImport: false` leaves the view after an import to the host, whose chrome fits it.
|
|
100
100
|
- `additionalModules` adds diagram-js modules; every Wardley feature module is exported for custom
|
|
101
101
|
editors.
|
|
102
|
+
- `openRelativeLink: (address) => …` follows a link without a scheme (`details/payment.wmap`) from
|
|
103
|
+
the context pad: only the host knows where the map's file lies, so it resolves the address or says
|
|
104
|
+
why it can't. Without this option the pad offers no "Open link" on such an address. No scheme but
|
|
105
|
+
http(s) and `mailto:` ever opens.
|
|
106
|
+
- `openExternalLink: (address) => …` opens an http(s) or `mailto:` address from the context pad;
|
|
107
|
+
without it a new browser tab opens. A host whose page can't open windows, such as a VS Code
|
|
108
|
+
webview, hands the address to its own opener.
|
|
109
|
+
- `chooseLinkTarget: () => Promise<string | undefined>` adds "Link to map…" to the context pad of a
|
|
110
|
+
component or submap: the host lets the user choose another map and resolves with its address
|
|
111
|
+
relative to the current map (`undefined` when the user cancels), which becomes the element's link
|
|
112
|
+
in one undoable step.
|
|
113
|
+
|
|
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.
|
|
102
117
|
|
|
103
118
|
The `wardleyReadOnly` service (`modeler.get<WardleyReadOnly>('wardleyReadOnly').setReadOnly(true)`)
|
|
104
119
|
locks the canvas while its host cannot save an edit, e.g. while the document is invalid: every edit
|
|
@@ -224,8 +239,9 @@ edit at once and stays the same across zoom and scroll. A map without elements s
|
|
|
224
239
|
so it is never `undefined` while the modeler lives (before the first import it is the default plot);
|
|
225
240
|
tell an empty map by its elements. `diagram` is the wrapped `Modeler` or `NavigatedViewer` for
|
|
226
241
|
host-specific wiring. Both factories take the options above (`additionalModules`, `freeArea`,
|
|
227
|
-
`fitOnImport` and
|
|
228
|
-
contract's conformance kit
|
|
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.
|
|
229
245
|
|
|
230
246
|
`interaction` (contract 1.5) tells a host whether the user holds a gesture, so it can defer a remote
|
|
231
247
|
re-import until the gesture ends: `active()` is true from the moment a move, resize, connect or
|
|
@@ -319,8 +335,8 @@ MIT
|
|
|
319
335
|
The tool icons of the palette (`square-dashed-mouse-pointer`, and for Draw `spline` with a
|
|
320
336
|
straight segment), the Close icon of the dialogs (`x`) and the icons of the context pad (`pencil`,
|
|
321
337
|
`trash`, `circle-plus`, `arrow-right`, `chevrons-right`, `sliders-horizontal`, `line-style`,
|
|
322
|
-
`palette`, `link`, `external-link`, and for Remove evolve `chevrons-right` with the corner
|
|
323
|
-
`calendar-x-2`) are copied from [Lucide](https://lucide.dev) (`lucide-static` 1.59.0):
|
|
338
|
+
`palette`, `link`, `map`, `external-link`, and for Remove evolve `chevrons-right` with the corner
|
|
339
|
+
`x` of `calendar-x-2`) are copied from [Lucide](https://lucide.dev) (`lucide-static` 1.59.0):
|
|
324
340
|
|
|
325
341
|
> ISC License
|
|
326
342
|
>
|
|
@@ -337,8 +353,8 @@ straight segment), the Close icon of the dialogs (`x`) and the icons of the cont
|
|
|
337
353
|
> NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
338
354
|
> PERFORMANCE OF THIS SOFTWARE.
|
|
339
355
|
|
|
340
|
-
`arrow-right`, `chevrons-right`, `circle-plus`, `external-link`, `link`, `trash` and `x` are
|
|
341
|
-
from [Feather](https://feathericons.com):
|
|
356
|
+
`arrow-right`, `chevrons-right`, `circle-plus`, `external-link`, `link`, `map`, `trash` and `x` are
|
|
357
|
+
derived from [Feather](https://feathericons.com):
|
|
342
358
|
|
|
343
359
|
> The MIT License (MIT)
|
|
344
360
|
>
|
|
@@ -28,6 +28,25 @@ export interface WardleyViewerOptions {
|
|
|
28
28
|
* `false` leaves them to the host (e.g. VS Code, which owns the document's undo stack).
|
|
29
29
|
*/
|
|
30
30
|
undoRedoKeys?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Follows a link without a scheme (`details/payment.wmap`) from the context pad. Only the host
|
|
33
|
+
* knows where the map's file lies, so it resolves the address or says why it can't. Without this
|
|
34
|
+
* option the pad offers no "Open link" on such an address; http(s) and `mailto:` addresses open
|
|
35
|
+
* in a new tab either way.
|
|
36
|
+
*/
|
|
37
|
+
openRelativeLink?: ((address: string) => void) | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Opens an http(s) or `mailto:` address from the context pad. Default: a new browser tab. A host
|
|
40
|
+
* whose page can't open windows (a VS Code webview) hands the address to its own opener.
|
|
41
|
+
*/
|
|
42
|
+
openExternalLink?: ((address: string) => void) | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Lets the user choose another map as the link of a component or submap, from the context pad's
|
|
45
|
+
* "Link to map…": resolves with its address relative to the current map, or `undefined` when the
|
|
46
|
+
* user cancels. Only the host knows the files around the map; without this option the pad offers
|
|
47
|
+
* no "Link to map…".
|
|
48
|
+
*/
|
|
49
|
+
chooseLinkTarget?: (() => Promise<string | undefined>) | undefined;
|
|
31
50
|
}
|
|
32
51
|
export type EventCallback<T = unknown> = (event: T) => void;
|
|
33
52
|
/** The plot size as drawn, plus whether the map writes it explicitly (`size [w, h]`). */
|
|
@@ -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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EAAE,MAAM,EACd,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAIzC,gFAAgF;IAC1E,YAAY,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;YAI7E,UAAU;IA0BxB,oEAAoE;IACpE,OAAO,CAAC,mBAAmB;IAQ3B,UAAU,IAAI,WAAW;YAWX,iBAAiB;IAmB/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO7B;;;;;;;;;;;OAWG;IACH,kBAAkB,CAChB,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACxC,OAAO,GAAE,yBAA8B,GACtC,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"}
|
|
@@ -6,11 +6,18 @@ import { NavigatedViewer } from '../NavigatedViewer.js';
|
|
|
6
6
|
export declare const WARDLEY_NOTATION = "wardley";
|
|
7
7
|
/**
|
|
8
8
|
* The contract's factory options (`freeArea`, `fitOnImport`, `undoRedoKeys`, see
|
|
9
|
-
* `WardleyViewerOptions`) plus the renderer's own. The viewer ignores `undoRedoKeys
|
|
9
|
+
* `WardleyViewerOptions`) plus the renderer's own. The viewer ignores `undoRedoKeys` and the link
|
|
10
|
+
* handlers, as it has no context pad.
|
|
10
11
|
*/
|
|
11
12
|
export interface CollaborativeWardleyOptions extends CollaborativeModelerOptions {
|
|
12
13
|
/** Appended to the renderer's own modules (e.g. a host's chrome module). */
|
|
13
14
|
additionalModules?: ModuleDeclaration[] | undefined;
|
|
15
|
+
/** Follows a link without a scheme, see `WardleyViewerOptions`. */
|
|
16
|
+
openRelativeLink?: ((address: string) => void) | undefined;
|
|
17
|
+
/** Opens an http(s) or `mailto:` link, see `WardleyViewerOptions`. */
|
|
18
|
+
openExternalLink?: ((address: string) => void) | undefined;
|
|
19
|
+
/** Chooses another map as a link, see `WardleyViewerOptions`. */
|
|
20
|
+
chooseLinkTarget?: (() => Promise<string | undefined>) | undefined;
|
|
14
21
|
}
|
|
15
22
|
/** The contract's element surface, with the optional `bounds` of contract 1.2 always present. */
|
|
16
23
|
export interface WardleyElementsSurface extends ElementsSurface {
|
|
@@ -1 +1 @@
|
|
|
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,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAaxD,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"CollaborativeWardley.d.ts","sourceRoot":"","sources":["../../src/collaborative/CollaborativeWardley.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK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AC;CAC5C;AA2BD,uFAAuF;AACvF,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,2BAAgC,GACxC,2BAA2B,CAW7B;AAED,+FAA+F;AAC/F,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,2BAAgC,GACxC,2BAA2B,CAE7B"}
|
|
@@ -13,6 +13,7 @@ import { default as WardleyLabelEditing } from '../label-editing/WardleyLabelEdi
|
|
|
13
13
|
import { default as WardleyEvolveDragging } from '../evolve/WardleyEvolveDragging.js';
|
|
14
14
|
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
15
15
|
import { default as WardleyColorPicker } from '../color-picker/WardleyColorPicker.js';
|
|
16
|
+
import { WardleyLinksConfig } from '../link-editing/index.js';
|
|
16
17
|
/** Context actions per element (concept doc §5.5). */
|
|
17
18
|
export default class WardleyContextPadProvider implements ContextPadProvider {
|
|
18
19
|
private readonly contextPad;
|
|
@@ -27,10 +28,11 @@ export default class WardleyContextPadProvider implements ContextPadProvider {
|
|
|
27
28
|
private readonly colorPicker;
|
|
28
29
|
private readonly canvas;
|
|
29
30
|
private readonly injector;
|
|
31
|
+
private readonly linksConfig;
|
|
30
32
|
static $inject: string[];
|
|
31
33
|
/** Synthetic clicks created for Enter/Space, so actions can pick a pointer-free variant. */
|
|
32
34
|
private readonly keyboardEvents;
|
|
33
|
-
constructor(contextPad: ContextPad, modeling: Modeling, connect: Connect, create: Create, popupMenu: PopupMenu, wardleyModeling: WardleyModeling, labelEditing: WardleyLabelEditing, evolveDragging: WardleyEvolveDragging, factory: WardleyElementFactory, colorPicker: WardleyColorPicker, eventBus: EventBus, canvas: Canvas, injector: Injector);
|
|
35
|
+
constructor(contextPad: ContextPad, modeling: Modeling, connect: Connect, create: Create, popupMenu: PopupMenu, wardleyModeling: WardleyModeling, labelEditing: WardleyLabelEditing, evolveDragging: WardleyEvolveDragging, factory: WardleyElementFactory, colorPicker: WardleyColorPicker, eventBus: EventBus, canvas: Canvas, injector: Injector, linksConfig: WardleyLinksConfig | undefined);
|
|
34
36
|
getContextPadEntries(element: Element): ContextPadEntries;
|
|
35
37
|
/** Connections: edit the annotation (or the flow value of an imported flow link) + delete. */
|
|
36
38
|
private connectionEntries;
|
|
@@ -38,6 +40,13 @@ export default class WardleyContextPadProvider implements ContextPadProvider {
|
|
|
38
40
|
private addPrimaryEntries;
|
|
39
41
|
/** Row 2: settings, line style, colour, link. */
|
|
40
42
|
private addPropertyEntries;
|
|
43
|
+
/**
|
|
44
|
+
* Links the element to the map the user chooses in the host. While the host's picker is open, an
|
|
45
|
+
* import may replace the element or lock the canvas, so the element is looked up again after it.
|
|
46
|
+
* The link re-renders the pad, which takes a focused entry with it: as after a synchronous
|
|
47
|
+
* action (`onPadKeydown`), the canvas then takes the focus instead of `<body>`.
|
|
48
|
+
*/
|
|
49
|
+
private linkChosenMap;
|
|
41
50
|
/**
|
|
42
51
|
* For an entry that opens no editor or popup: after a pointer click or drag it hands the focus to
|
|
43
52
|
* the canvas (guide §5.8), whose keys act only while it has the focus. The clicked entry took the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyContextPadProvider.d.ts","sourceRoot":"","sources":["../../src/context-pad/WardleyContextPadProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,UAAU,MAAM,gDAAgD,CAAC;AAC7E,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,EACV,iBAAiB,EACjB,OAAO,IAAI,kBAAkB,EAC9B,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"WardleyContextPadProvider.d.ts","sourceRoot":"","sources":["../../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C/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAlC9B,MAAM,CAAC,OAAO,WAeZ;IAEF,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwB;gBAGpC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,qBAAqB,EACrC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,kBAAkB,EAChD,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,kBAAkB,GAAG,SAAS;IAU9D,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB;IAsBzD,8FAA8F;IAC9F,OAAO,CAAC,iBAAiB;IAuBzB,kDAAkD;IAClD,OAAO,CAAC,iBAAiB;IA8EzB,iDAAiD;IACjD,OAAO,CAAC,kBAAkB;IAyF1B;;;;;OAKG;YACW,aAAa;IAc3B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAOtB,wEAAwE;IACxE,OAAO,CAAC,YAAY;IAuCpB,OAAO,CAAC,cAAc;IAiBtB;;;OAGG;IACH,OAAO,CAAC,WAAW;CAuBpB"}
|
|
@@ -3,6 +3,7 @@ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
|
3
3
|
import { ElementLike, ShapeLike, ConnectionLike } from 'diagram-js/lib/model/Types';
|
|
4
4
|
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
5
5
|
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
6
|
+
import { Injector } from 'didi';
|
|
6
7
|
/** Primary name text of a node (contract shared with other modules and consumers' CSS). */
|
|
7
8
|
export declare const NAME_LABEL_CLASS = "wardley-name-label";
|
|
8
9
|
/** Groups every evolve visual so tools (e.g. the context pad) can tell the node from its movement. */
|
|
@@ -14,8 +15,9 @@ export declare const LABEL_ROLE_ATTRIBUTE = "data-label-role";
|
|
|
14
15
|
export default class WardleyRenderer extends BaseRenderer {
|
|
15
16
|
private readonly grid;
|
|
16
17
|
private readonly elementRegistry;
|
|
18
|
+
private readonly injector;
|
|
17
19
|
static $inject: string[];
|
|
18
|
-
constructor(eventBus: EventBus, grid: EvolutionGrid, elementRegistry: ElementRegistry);
|
|
20
|
+
constructor(eventBus: EventBus, grid: EvolutionGrid, elementRegistry: ElementRegistry, injector: Injector);
|
|
19
21
|
canRender(element: ElementLike): boolean;
|
|
20
22
|
drawShape(visuals: SVGElement, element: ShapeLike): SVGElement;
|
|
21
23
|
/** Freeform drawing: polyline/polygon from relative points (see WardleyDrawTool). */
|
|
@@ -33,5 +35,11 @@ export default class WardleyRenderer extends BaseRenderer {
|
|
|
33
35
|
private drawAnnotation;
|
|
34
36
|
private drawAccelerator;
|
|
35
37
|
private drawSubmap;
|
|
38
|
+
/**
|
|
39
|
+
* Marks the element at its lower left, where neither its name, its inertia nor its evolve sits,
|
|
40
|
+
* when the editor can open its link. Only the editing mount has the link opener: the viewer opens
|
|
41
|
+
* no links, so it shows no mark.
|
|
42
|
+
*/
|
|
43
|
+
private drawLinkBadge;
|
|
36
44
|
}
|
|
37
45
|
//# sourceMappingURL=WardleyRenderer.d.ts.map
|
|
@@ -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,CAAC;A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CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,GAAG,UAAU;IAkDxE,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAKtC,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM;IAM9D,OAAO,CAAC,aAAa;IAwCrB,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;IAgDlB;;;;OAIG;IACH,OAAO,CAAC,aAAa;CAmBtB"}
|
package/dist/draw/lucide.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! @miragon/wardley-renderer icon geometry: the context pad icons. Lucide (lucide-static 1.59.0)
|
|
2
2
|
* @license ISC Copyright (c) 2026 Lucide Icons and Contributors
|
|
3
|
-
* arrow-right, chevrons-right, circle-plus, external-link, link and trash derive from Feather
|
|
3
|
+
* arrow-right, chevrons-right, circle-plus, external-link, link, map and trash derive from Feather
|
|
4
4
|
* @license MIT, Copyright (c) 2013-present Cole Bemis
|
|
5
5
|
* Full notices: README.md of @miragon/wardley-renderer */
|
|
6
6
|
/**
|
|
@@ -20,6 +20,7 @@ export declare const LUCIDE: {
|
|
|
20
20
|
readonly palette: "<path d=\"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z\"/><circle cx=\"13.5\" cy=\"6.5\" r=\".5\" fill=\"currentColor\"/><circle cx=\"17.5\" cy=\"10.5\" r=\".5\" fill=\"currentColor\"/><circle cx=\"6.5\" cy=\"12.5\" r=\".5\" fill=\"currentColor\"/><circle cx=\"8.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\"/>";
|
|
21
21
|
readonly link: "<path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/>";
|
|
22
22
|
readonly "external-link": "<path d=\"M15 3h6v6\"/><path d=\"M10 14 21 3\"/><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/>";
|
|
23
|
+
readonly map: "<path d=\"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z\"/><path d=\"M15 5.764v15\"/><path d=\"M9 3.236v15\"/>";
|
|
23
24
|
};
|
|
24
25
|
export type LucideIconName = keyof typeof LUCIDE;
|
|
25
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucide.d.ts","sourceRoot":"","sources":["../../src/draw/lucide.ts"],"names":[],"mappings":"AAAA;;;;0DAI0D;AAE1D;;;;GAIG;AACH,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"lucide.d.ts","sourceRoot":"","sources":["../../src/draw/lucide.ts"],"names":[],"mappings":"AAAA;;;;0DAI0D;AAE1D;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAwBT,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,MAAM,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAEvD"}
|
package/dist/draw/styles.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export { PLOT_MIN } from '@miragon/wardley-schema-model';
|
|
|
16
16
|
export declare const NODE_SIZE = 34;
|
|
17
17
|
export declare const COMPONENT_RADIUS = 15;
|
|
18
18
|
export declare const COMPONENT_INNER_RADIUS = 12;
|
|
19
|
+
/**
|
|
20
|
+
* The mark on an element whose link the editor opens (its context pad's "Open link"): editor
|
|
21
|
+
* chrome in the `--cd-ui-*` roles of `wardley.css`, which the export leaves out.
|
|
22
|
+
*/
|
|
23
|
+
export declare const LINK_BADGE_CLASS = "wardley-link-badge";
|
|
24
|
+
export declare const LINK_BADGE_RADIUS = 8;
|
|
25
|
+
export declare const LINK_BADGE_ICON_SIZE = 11;
|
|
19
26
|
export declare const ANCHOR_ICON_SIZE = 26;
|
|
20
27
|
export declare const PIPELINE_HEIGHT = 30;
|
|
21
28
|
export declare const PIPELINE_ANCHOR_SIZE = 16;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/draw/styles.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAK/F;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC;AAEX,gGAAgG;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAKnC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQ7F;AAiBD;;;;;GAKG;AACH,eAAO,MAA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