@miragon/wardley-renderer 0.8.0 → 0.9.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 +35 -12
- package/dist/WardleyBaseViewer.d.ts +26 -11
- package/dist/WardleyBaseViewer.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeWardley.d.ts +14 -6
- package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -1
- package/dist/collaborative/index.d.ts +1 -1
- package/dist/collaborative/index.d.ts.map +1 -1
- package/dist/free-rect/FreeRect.d.ts +10 -3
- package/dist/free-rect/FreeRect.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1331 -1139
- package/dist/index.js.map +1 -1
- package/dist/io/WardleyImporter.d.ts +15 -1
- package/dist/io/WardleyImporter.d.ts.map +1 -1
- package/dist/io/fitViewbox.d.ts +21 -0
- package/dist/io/fitViewbox.d.ts.map +1 -0
- package/dist/label-editing/WardleyLabelEditing.d.ts +3 -0
- package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
- package/dist/link-editing/WardleyLinkEditing.d.ts +3 -0
- package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -1
- package/dist/live-preview/LivePreview.d.ts +36 -0
- package/dist/live-preview/LivePreview.d.ts.map +1 -0
- package/dist/live-preview/index.d.ts +5 -0
- package/dist/live-preview/index.d.ts.map +1 -0
- package/dist/map-resize/MapProjection.d.ts +12 -2
- package/dist/map-resize/MapProjection.d.ts.map +1 -1
- package/dist/map-resize/MapResizeHandles.d.ts +1 -0
- package/dist/map-resize/MapResizeHandles.d.ts.map +1 -1
- package/dist/map-resize/index.d.ts.map +1 -1
- package/dist/pan-constraint/PanConstraint.d.ts +5 -3
- package/dist/pan-constraint/PanConstraint.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -54,13 +54,28 @@ Swap `NavigatedViewer` for `Modeler` to get the editable map (palette, context p
|
|
|
54
54
|
always write a valid `evolution` line; the default set is stored as `undefined`.
|
|
55
55
|
|
|
56
56
|
An import validates the whole map first: a map that is not importable rejects before the canvas
|
|
57
|
-
changes, and a rendering failure puts the previous map back.
|
|
57
|
+
changes, and a rendering failure puts the previous map back. It then fits the view to the plot with
|
|
58
|
+
its axis margins, centred in the free area and never above 100 %. Without a `freeArea` the pan
|
|
59
|
+
constraint may still move a map smaller than the view, to keep its margins around it.
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
An open inline editor (name, note, link annotation, flow value, link address) stays open with its
|
|
62
|
+
typed text across a view change, a scroll, a zoom or a host's fit, and moves with its element;
|
|
63
|
+
Enter, leaving the field, or a click or drag on the canvas saves it.
|
|
64
|
+
|
|
65
|
+
Options (the names of the `@miragon/modeler-api` 1.2 factory options):
|
|
66
|
+
|
|
67
|
+
- `undoRedoKeys: false` leaves Cmd/Ctrl+Z, Shift+Z and Y to the host (VS Code owns its document's
|
|
68
|
+
undo stack).
|
|
69
|
+
- `freeArea: { insets: () => ({ top, right, bottom, left }) }` names the canvas edges a host's chrome
|
|
70
|
+
covers: the import fits the plot into the rest, panning keeps the map inside it, a view the host
|
|
71
|
+
fitted into it stays where the host put it, and keyboard creation places elements in its centre.
|
|
72
|
+
`freeArea: { center: () => ({ x, y }) }` gives only that centre, in diagram coordinates.
|
|
73
|
+
- `fitOnImport: false` leaves the view after an import to the host, whose chrome fits it.
|
|
74
|
+
- `additionalModules` adds diagram-js modules; every Wardley feature module is exported for custom
|
|
75
|
+
editors.
|
|
76
|
+
|
|
77
|
+
`keyboard: { undoRedo }` and `freeRectInsets` still work for this minor release, as deprecated
|
|
78
|
+
aliases of `undoRedoKeys` and `freeArea: { insets }`; given both, the aligned name wins.
|
|
64
79
|
|
|
65
80
|
The `wardleyReadOnly` service (`modeler.get<WardleyReadOnly>('wardleyReadOnly').setReadOnly(true)`)
|
|
66
81
|
locks the canvas while its host cannot save an edit, e.g. while the document is invalid: every edit
|
|
@@ -83,12 +98,20 @@ await modeler.importText(documentText);
|
|
|
83
98
|
modeler.onContentChanged(() => save(modeler.exportText()));
|
|
84
99
|
```
|
|
85
100
|
|
|
86
|
-
An import is silent (no content change is reported back)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
An import is silent (no content change is reported back), keeps the selection and an open label
|
|
102
|
+
editor and fits the view (unless `fitOnImport: false`); a host's view change (`setViewState`, a fit)
|
|
103
|
+
never saves an open editor either. `exportText()` is the committed document, never a live preview:
|
|
104
|
+
while the plot corner is dragged or the size or axis-label popover previews a change, it returns the
|
|
105
|
+
document as it was before, and the change event of the commit brings the new one. A command during a
|
|
106
|
+
size preview (an undo pressed mid-drag, a title the host sets) puts the preview back first, and a
|
|
107
|
+
drag then ends without resizing, so the history stays in step with the document. `elements` names
|
|
108
|
+
components, anchors, pipelines, submaps and accelerators by the id the document gives them
|
|
109
|
+
(`cmp_kettle`), also right after a canvas edit, and `elements.bounds(id)` gives an element's live
|
|
110
|
+
box in diagram coordinates; `getViewState` and `setViewState` carry the viewbox. `diagram` is the
|
|
111
|
+
wrapped `Modeler` or `NavigatedViewer` for host-specific wiring. Both factories take the options
|
|
112
|
+
above (`additionalModules`, `freeArea`, `fitOnImport`, `undoRedoKeys` and the deprecated aliases);
|
|
113
|
+
the viewer never edits and ignores the undo keys. Both pass the contract's conformance kit (1.2)
|
|
114
|
+
without skips.
|
|
92
115
|
|
|
93
116
|
### Menu entries and dialogs for a host's chrome
|
|
94
117
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModuleDeclaration } from 'didi';
|
|
2
2
|
import { MapConfig, MapSizePresetId, WardleyMap } from '@miragon/wardley-schema-model';
|
|
3
3
|
import { ImportWarning } from './io/types.js';
|
|
4
|
+
import { FreeArea } from '@miragon/modeler-api';
|
|
4
5
|
import { FreeRectInsets } from './free-rect/index.js';
|
|
5
6
|
export interface WardleyViewerOptions {
|
|
6
7
|
/** Host element. If missing, a detached <div> is created (can be attached later via attachTo). */
|
|
@@ -10,19 +11,30 @@ export interface WardleyViewerOptions {
|
|
|
10
11
|
/** Concatenated to the end of the module list (extension point, §12). */
|
|
11
12
|
additionalModules?: ModuleDeclaration[];
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* The part of the canvas no host chrome covers (`@miragon/modeler-api` `freeArea`), read
|
|
15
|
+
* whenever it is needed. `{ insets }` names what the chrome covers along the container's edges,
|
|
16
|
+
* in px (e.g. `() => shell.fitInsets()` of the Miragon modeler shell): the import fits the plot
|
|
17
|
+
* into the rest, panning keeps the map inside it, and keyboard creation places elements in its
|
|
18
|
+
* centre. `{ center }` gives only that centre, in diagram coordinates. Default: the whole
|
|
19
|
+
* container.
|
|
15
20
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
freeArea?: FreeArea | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Fit the plot into the view after every import. Default `true`; `false` when the host's chrome
|
|
24
|
+
* fits the view itself.
|
|
25
|
+
*/
|
|
26
|
+
fitOnImport?: boolean | undefined;
|
|
19
27
|
/**
|
|
20
|
-
*
|
|
21
|
-
* (e.g.
|
|
22
|
-
* elements in the centre of the free rectangle, and panning keeps the map reachable around it.
|
|
23
|
-
* Without it the whole container counts.
|
|
28
|
+
* Bind Cmd/Ctrl+Z, Cmd/Ctrl+Shift+Z and Cmd/Ctrl+Y to the canvas history. Default `true`;
|
|
29
|
+
* `false` leaves them to the host (e.g. VS Code, which owns the document's undo stack).
|
|
24
30
|
*/
|
|
25
|
-
|
|
31
|
+
undoRedoKeys?: boolean | undefined;
|
|
32
|
+
/** @deprecated Since 0.9, for one minor release: use `undoRedoKeys`, which wins over it. */
|
|
33
|
+
keyboard?: {
|
|
34
|
+
undoRedo?: boolean;
|
|
35
|
+
} | undefined;
|
|
36
|
+
/** @deprecated Since 0.9, for one minor release: use `freeArea: { insets }`, which wins over it. */
|
|
37
|
+
freeRectInsets?: (() => FreeRectInsets) | undefined;
|
|
26
38
|
}
|
|
27
39
|
export type EventCallback<T = unknown> = (event: T) => void;
|
|
28
40
|
/** The plot size as drawn, plus whether the map writes it explicitly (`size [w, h]`). */
|
|
@@ -89,7 +101,7 @@ export declare abstract class WardleyBaseViewer {
|
|
|
89
101
|
* the default size — only `resetMapSize` removes it. In the Modeler `{ transient: true }` shows
|
|
90
102
|
* a live preview without an undo step, and the next call without it commits ONE step from the
|
|
91
103
|
* size before the preview (none when the size ends where the preview started), like
|
|
92
|
-
* `setEvolutionLabels`.
|
|
104
|
+
* `setEvolutionLabels`. A command before that call (e.g. `setTitle`) puts the preview back first.
|
|
93
105
|
*/
|
|
94
106
|
setMapSize(width: number, height: number, options?: SetMapSizeOptions): Promise<{
|
|
95
107
|
warnings: ImportWarning[];
|
|
@@ -99,6 +111,8 @@ export declare abstract class WardleyBaseViewer {
|
|
|
99
111
|
warnings: ImportWarning[];
|
|
100
112
|
}>;
|
|
101
113
|
private _resizeMap;
|
|
114
|
+
/** Shows the map without the size preview again, if one is open. */
|
|
115
|
+
private _putBackSizePreview;
|
|
102
116
|
getMapSize(): MapSizeInfo;
|
|
103
117
|
private _reimportWithSize;
|
|
104
118
|
/**
|
|
@@ -126,6 +140,7 @@ export declare abstract class WardleyBaseViewer {
|
|
|
126
140
|
private _applyConfigDirectly;
|
|
127
141
|
/** The Modeler's command API, or null in the read-only viewers. */
|
|
128
142
|
private _wardleyModeling;
|
|
143
|
+
private _livePreview;
|
|
129
144
|
private _root;
|
|
130
145
|
private _rootBusinessObject;
|
|
131
146
|
exportDSL(): string;
|
|
@@ -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,EAO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IAId,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;IAQf,IAAI,SAAS,IAAI,WAAW,CAE3B;CACF"}
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { CollaborativeModeler, ElementsSurface } from '@miragon/modeler-api';
|
|
1
|
+
import { CollaborativeModeler, CollaborativeModelerOptions, ElementBounds, ElementsSurface } from '@miragon/modeler-api';
|
|
2
2
|
import { ModuleDeclaration } from 'didi';
|
|
3
3
|
import { Modeler } from '../Modeler.js';
|
|
4
4
|
import { NavigatedViewer } from '../NavigatedViewer.js';
|
|
5
5
|
import { FreeRectInsets } from '../free-rect/index.js';
|
|
6
6
|
/** Stable notation id in `meta.notation` of the collaborative-modeler contract. */
|
|
7
7
|
export declare const WARDLEY_NOTATION = "wardley";
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The contract's factory options (`freeArea`, `fitOnImport`, `undoRedoKeys`, see
|
|
10
|
+
* `WardleyViewerOptions`) plus the renderer's own. The viewer ignores `undoRedoKeys`.
|
|
11
|
+
*/
|
|
12
|
+
export interface CollaborativeWardleyOptions extends CollaborativeModelerOptions {
|
|
9
13
|
/** Appended to the renderer's own modules (e.g. a host's chrome module). */
|
|
10
14
|
additionalModules?: ModuleDeclaration[] | undefined;
|
|
11
|
-
/**
|
|
15
|
+
/** @deprecated Since 0.9, for one minor release: use `undoRedoKeys`, which wins over it. */
|
|
12
16
|
keyboard?: {
|
|
13
17
|
undoRedo?: boolean;
|
|
14
18
|
} | undefined;
|
|
15
|
-
/**
|
|
19
|
+
/** @deprecated Since 0.9, for one minor release: use `freeArea: { insets }`, which wins over it. */
|
|
16
20
|
freeRectInsets?: (() => FreeRectInsets) | undefined;
|
|
17
21
|
}
|
|
22
|
+
/** The contract's element surface, with the optional `bounds` of contract 1.2 always present. */
|
|
23
|
+
export interface WardleyElementsSurface extends ElementsSurface {
|
|
24
|
+
bounds(id: string): ElementBounds | undefined;
|
|
25
|
+
}
|
|
18
26
|
/** The contract surface plus the wrapped diagram for host-specific wiring. */
|
|
19
27
|
export interface CollaborativeWardleyModeler extends CollaborativeModeler {
|
|
20
|
-
readonly elements:
|
|
28
|
+
readonly elements: WardleyElementsSurface;
|
|
21
29
|
readonly diagram: Modeler | NavigatedViewer;
|
|
22
30
|
}
|
|
23
31
|
/** The editing mount (`meta.editable: true`) of the collaborative-modeler contract. */
|
|
24
32
|
export declare function createCollaborativeModeler(options?: CollaborativeWardleyOptions): CollaborativeWardleyModeler;
|
|
25
33
|
/** The read-only mount (`meta.editable: false`): imports, exports and reveals, never edits. */
|
|
26
|
-
export declare function createCollaborativeViewer(options?:
|
|
34
|
+
export declare function createCollaborativeViewer(options?: CollaborativeWardleyOptions): CollaborativeWardleyModeler;
|
|
27
35
|
//# sourceMappingURL=CollaborativeWardley.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollaborativeWardley.d.ts","sourceRoot":"","sources":["../../src/collaborative/CollaborativeWardley.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,
|
|
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,EAGrB,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;AAGxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B;IAC9E,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IACpD,4FAA4F;IAC5F,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9C,oGAAoG;IACpG,cAAc,CAAC,EAAE,CAAC,MAAM,cAAc,CAAC,GAAG,SAAS,CAAC;CACrD;AAED,iGAAiG;AACjG,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;CAC/C;AAED,8EAA8E;AAC9E,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,CAAC;CAC7C;AA2BD,uFAAuF;AACvF,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,2BAAgC,GACxC,2BAA2B,CAS7B;AAED,+FAA+F;AAC/F,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,2BAAgC,GACxC,2BAA2B,CAE7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { WARDLEY_NOTATION, createCollaborativeModeler, createCollaborativeViewer, type CollaborativeWardleyModeler, type CollaborativeWardleyOptions, } from './CollaborativeWardley.js';
|
|
1
|
+
export { WARDLEY_NOTATION, createCollaborativeModeler, createCollaborativeViewer, type CollaborativeWardleyModeler, type CollaborativeWardleyOptions, type WardleyElementsSurface, } from './CollaborativeWardley.js';
|
|
2
2
|
//# 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,
|
|
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"}
|
|
@@ -6,9 +6,15 @@ export interface FreeRectInsets {
|
|
|
6
6
|
bottom: number;
|
|
7
7
|
left: number;
|
|
8
8
|
}
|
|
9
|
-
/** Diagram config `wardleyFreeRect` (viewer option `
|
|
9
|
+
/** Diagram config `wardleyFreeRect` (viewer option `freeArea`). */
|
|
10
10
|
export interface FreeRectConfig {
|
|
11
|
+
/** What the chrome covers, in px from the container's edges. */
|
|
11
12
|
insets?: () => FreeRectInsets;
|
|
13
|
+
/** The centre of the free rectangle in diagram coordinates, `undefined` while there is none. */
|
|
14
|
+
center?: () => {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
} | undefined;
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
14
20
|
* The part of the canvas no host chrome covers. Keyboard creation places new elements in its
|
|
@@ -23,8 +29,9 @@ export default class FreeRect {
|
|
|
23
29
|
/** The host's insets, or `undefined` when it reports none. */
|
|
24
30
|
insets(): FreeRectInsets | undefined;
|
|
25
31
|
/**
|
|
26
|
-
* The centre of the free rectangle in diagram coordinates
|
|
27
|
-
* insets
|
|
32
|
+
* The centre of the free rectangle in diagram coordinates: the host's own when it reports one,
|
|
33
|
+
* else the whole visible area without insets. An axis whose insets leave no room centres in the
|
|
34
|
+
* whole container, as fitting does.
|
|
28
35
|
*/
|
|
29
36
|
center(): {
|
|
30
37
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FreeRect.d.ts","sourceRoot":"","sources":["../../src/free-rect/FreeRect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAErD,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,
|
|
1
|
+
{"version":3,"file":"FreeRect.d.ts","sourceRoot":"","sources":["../../src/free-rect/FreeRect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAErD,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,cAAc,CAAC;IAC9B,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAIzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,MAAM,CAAC,OAAO,WAAwC;gBAGnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,cAAc,GAAG,SAAS;IAGrD,8DAA8D;IAC9D,MAAM,IAAI,cAAc,GAAG,SAAS;IAOpC;;;;OAIG;IACH,MAAM,IAAI;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;CAcnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export { labelEditingModule, WardleyLabelEditing } from './label-editing/index.j
|
|
|
37
37
|
export type { ActiveLabelEdit, ActivateOptions, FieldSelection, LabelDeduplicatedEvent, } from './label-editing/WardleyLabelEditing.js';
|
|
38
38
|
export { restoreEditorState, setAsideEditorState } from './editor-state.js';
|
|
39
39
|
export { WARDLEY_NOTATION, createCollaborativeModeler, createCollaborativeViewer, } from './collaborative/index.js';
|
|
40
|
-
export type { CollaborativeWardleyModeler, CollaborativeWardleyOptions, } from './collaborative/index.js';
|
|
40
|
+
export type { CollaborativeWardleyModeler, CollaborativeWardleyOptions, WardleyElementsSurface, } from './collaborative/index.js';
|
|
41
41
|
export { EXPORT_LABELS, createAxisLabelsPopover, createMapDialog, createMapSizePopover, createShortcutsDialog, createTitleDialog, dialogButton, mapMenu, mapShortcuts, } from './map-menu/index.js';
|
|
42
42
|
export type { DialogChrome, MapDialog, MapDialogParts, MapShortcutOptions, TitleDialog, TitleDialogChrome, MapExport, MapExports, MapMenu, MapMenuAction, MapMenuActions, MapMenuDialog, MapMenuEntry, MapMenuIcon, PopoverChrome, PopoverHandle, ShortcutGroup, ShortcutKeyNames, ShortcutPlatform, ShortcutRow, ShortcutsChrome, ShortcutsDialog, ShortcutsDialogChrome, } from './map-menu/index.js';
|
|
43
43
|
export type { EditorState, RestoreOptions } from './editor-state.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL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