@miragon/dmn-modeler 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- /** Stand up one read-only DMN diff pane in `container`. */
2
- export declare function createDiffViewer(container: HTMLElement, options?: DmnDiffViewerOptions): DmnDiffViewerHandle;
1
+ /* Excluded from this release type: createDiffViewer */
3
2
 
4
3
  /** Factory signature for one independent DMN modeler instance. */
5
4
  export declare type CreateDmnModeler = (container: HTMLElement, options: DmnModelerOptions) => Promise<DmnModelerHandle>;
@@ -23,68 +22,15 @@ declare interface DiffCounts {
23
22
  /** Additional dmn-js dependency-injection modules, grouped by view editor. */
24
23
  export declare type DmnAdditionalModules = Partial<Record<DmnViewType, unknown[]>>;
25
24
 
26
- export declare interface DmnDiffMarkOptions {
27
- /** Puts each changed table's counts on its decision in the DRD. */
28
- readonly countBadges?: boolean;
29
- }
25
+ /* Excluded from this release type: DmnDiffMarkOptions */
30
26
 
31
- /** What one DMN diff pane marks: the DRD's changes, each changed table's and the changed expressions. */
32
- export declare interface DmnDiffMarks {
33
- readonly added: readonly string[];
34
- readonly removed: readonly string[];
35
- readonly changed: readonly string[];
36
- readonly layoutChanged: readonly string[];
37
- readonly tables: Readonly<Record<string, DmnTableMarks>>;
38
- readonly expressions: readonly string[];
39
- }
27
+ /* Excluded from this release type: DmnDiffMarks */
40
28
 
41
- /** How an element a diff pane shows differs; a move is a DRD layout change only. */
42
- export declare type DmnDiffStatus = Exclude<DiffCategory, "layoutChanged">;
29
+ /* Excluded from this release type: DmnDiffStatus */
43
30
 
44
- /**
45
- * A read-only DMN view of one side of a diff: the DRD with pan and zoom, and
46
- * the decision tables and expressions dmn-js opens from it.
47
- */
48
- export declare interface DmnDiffViewerHandle {
49
- importXML(xml: string): Promise<void>;
50
- /** Marks this pane's changes; every view it opens shows them. */
51
- setMarks(marks: DmnDiffMarks, options?: DmnDiffMarkOptions): void;
52
- /**
53
- * Opens the DRD (`null`) or the view of a decision or business knowledge
54
- * model. Resolves `false` when this version has no such element.
55
- */
56
- openView(elementId: string | null): Promise<boolean>;
57
- /** The open view: `null` for the DRD, else its element's id. */
58
- getActiveElementId(): string | null;
59
- /**
60
- * How the open view's element differs, as its view is marked; `undefined`
61
- * for the DRD, a changed table, an element without changes or before marks.
62
- */
63
- getViewStatus(): DmnDiffStatus | undefined;
64
- /** Calls back when the user opens another view; not for {@link openView}. */
65
- onViewChanged(listener: (elementId: string | null) => void): () => void;
66
- /** Outlines and scrolls to a DRD element, rule, column or table, or clears the outline. */
67
- focus(id: string | undefined): void;
68
- /** Brings a DRD element, rule, column or table into view without outlining it. */
69
- reveal(id: string): void;
70
- getViewport(): Viewport | undefined;
71
- setViewport(viewport: Viewport): void;
72
- /** Calls back when the user pans or zooms the DRD. */
73
- onViewportChanged(listener: (viewport: Viewport) => void): () => void;
74
- getTableScroll(): TableScroll | undefined;
75
- setTableScroll(scroll: TableScroll): void;
76
- /** Calls back when the user scrolls the open decision table. */
77
- onTableScroll(listener: (scroll: TableScroll) => void): () => void;
78
- setTheme(theme: DmnThemeMode): void;
79
- setLocale(locale: string): Promise<void>;
80
- destroy(): void;
81
- }
31
+ /* Excluded from this release type: DmnDiffViewerHandle */
82
32
 
83
- export declare interface DmnDiffViewerOptions {
84
- readonly theme?: DmnThemeMode;
85
- /** Pixels at the top of the pane the first DRD fit leaves free, for chrome floating there. */
86
- readonly topInset?: number;
87
- }
33
+ /* Excluded from this release type: DmnDiffViewerOptions */
88
34
 
89
35
  /** One expression language shown by decision editors. */
90
36
  export declare interface DmnExpressionLanguage {
@@ -106,8 +52,13 @@ export declare interface DmnKeyboardOptions {
106
52
  }
107
53
 
108
54
  /** The independent instance handle returned by {@link createModeler}. */
109
- export declare interface DmnModelerHandle {
110
- /** Load DMN XML, replacing any currently loaded document. */
55
+ export declare interface DmnModelerHandle extends DmnPendingInputHandle {
56
+ /**
57
+ * Load DMN XML, replacing any currently loaded document. An outside write
58
+ * keeps the open view, such as a decision's table, while the new document
59
+ * still holds its element (matched by id); otherwise the first view opens,
60
+ * the decision requirements diagram when the document has one.
61
+ */
111
62
  loadDiagram(xml: string): Promise<DmnOperationResult>;
112
63
  /** Serialise the current document as formatted DMN XML. */
113
64
  exportDiagram(): Promise<string>;
@@ -197,29 +148,22 @@ export declare interface DmnOperationResult {
197
148
  readonly warnings: DmnWarning[];
198
149
  }
199
150
 
200
- /* Excluded from this release type: DmnPendingInputHandle */
201
-
202
- /** One decision table's changes, as one diff pane marks them. */
203
- export declare interface DmnTableMarks {
204
- readonly columns: {
205
- readonly added: readonly string[];
206
- readonly removed: readonly string[];
207
- readonly changed: readonly string[];
208
- };
209
- readonly rules: {
210
- readonly added: readonly string[];
211
- readonly removed: readonly string[];
212
- readonly changed: readonly string[];
213
- readonly moved: readonly string[];
214
- };
215
- readonly cells: readonly string[];
216
- readonly annotations: readonly string[];
217
- readonly properties: readonly string[];
218
- readonly counts: DiffCounts;
219
- /** The table's id when its attributes changed and it has one: the step that focuses them. */
220
- readonly attributesStep?: string;
151
+ /**
152
+ * Input a view editor holds in its input debounce, so it is not in the
153
+ * document or an export yet. A host applies it before it exports for a save.
154
+ */
155
+ export declare interface DmnPendingInputHandle {
156
+ /** Whether such input waits; `false` once destroyed. */
157
+ hasPendingInput(): boolean;
158
+ /**
159
+ * Applies that input to the document now. A no-op once destroyed. Input that
160
+ * fails does not hold back the rest; its error is thrown once the rest is applied.
161
+ */
162
+ flushPendingInput(): void;
221
163
  }
222
164
 
165
+ /* Excluded from this release type: DmnTableMarks */
166
+
223
167
  /**
224
168
  * Theme selection for a single instance. The modeler toggles a
225
169
  * `data-dmn-theme` attribute on its container + panel parent (the authoritative
@@ -309,8 +253,8 @@ export { }
309
253
 
310
254
  /**
311
255
  * Ambient type declarations for `bpmn-js-differ`, which ships without its own
312
- * `.d.ts`. Covers only the subset used by the BPMN diff feature — `diff()`
313
- * and the shape of its return value.
256
+ * `.d.ts`. Covers only the subset used by the BPMN diff feature — `diff()`,
257
+ * the shape of its return value and the tracked-element check its specs pin.
314
258
  */
315
259
  declare module "bpmn-js-differ" {
316
260
  /**
@@ -337,21 +281,42 @@ declare module "bpmn-js-differ" {
337
281
  }
338
282
 
339
283
  export function diff(before: ModdleElement, after: ModdleElement): DiffResult;
284
+
285
+ export class ChangeHandler {
286
+ _isTracked(
287
+ element: ModdleElement,
288
+ ): { element: ModdleElement; property: string } | false | undefined;
289
+ }
340
290
  }
341
291
 
342
292
  /**
343
293
  * Minimal ambient shim for `bpmn-moddle`, which ships no `.d.ts`.
344
294
  *
345
- * `computeDiff` casts the dynamic moddle import fully (`as unknown as …`), so it
295
+ * `loadBpmnModdle` treats the dynamic moddle import as `unknown` and casts it, so it
346
296
  * needs the module to *resolve* but never its member types. An empty module
347
297
  * declaration does exactly that — and, unlike a richer shim, it merges without
348
298
  * conflict alongside a consumer program's own `bpmn-moddle` declaration
349
- * (modeler-core and the package each ship a fuller one with divergent shapes).
350
- * Keeping this empty is what lets the differ lib be pulled into any of those
351
- * programs — including `modeler-types`, which has no moddle shim of its own.
299
+ * (the package ships a fuller one for its specs). Keeping this empty is what
300
+ * lets the differ lib be pulled into any program, including those with no moddle
301
+ * shim of their own.
352
302
  */
353
303
  declare module "bpmn-moddle" {}
354
304
 
305
+ /** The part of `saxen`, which ships no `.d.ts`, that the declaration scan uses. */
306
+ declare module "saxen" {
307
+ export class Parser {
308
+ constructor(options?: { proxy?: boolean });
309
+ on(
310
+ event: "openTag",
311
+ handler: (name: string, getAttrs: () => Record<string, string>) => void,
312
+ ): this;
313
+ on(event: "error", handler: (error: Error) => void): this;
314
+ parse(xml: string): Error | undefined;
315
+ }
316
+
317
+ export function decode(text: string): string;
318
+ }
319
+
355
320
  declare module "diagram-js/lib/core/EventBus" {
356
321
  export default class EventBus {
357
322
  on<T extends string>(event: T, callback: EventCallback, that?: any): void;