@myrmidon/gve-core 0.0.4 → 0.0.6

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.
Files changed (50) hide show
  1. package/README.md +45 -77
  2. package/esm2022/lib/components/animation-timeline/animation-timeline.component.mjs +50 -19
  3. package/esm2022/lib/components/animation-timeline-set/animation-timeline-set.component.mjs +32 -8
  4. package/esm2022/lib/components/animation-tween/animation-tween.component.mjs +48 -25
  5. package/esm2022/lib/components/base-text-char/base-text-char.component.mjs +13 -4
  6. package/esm2022/lib/components/base-text-editor/base-text-editor.component.mjs +10 -6
  7. package/esm2022/lib/components/base-text-view/base-text-view.component.mjs +39 -5
  8. package/esm2022/lib/components/batch-operation-editor/batch-operation-editor.component.mjs +111 -0
  9. package/esm2022/lib/components/chain-operation-editor/chain-operation-editor.component.mjs +97 -39
  10. package/esm2022/lib/components/chain-result-view/chain-result-view.component.mjs +48 -13
  11. package/esm2022/lib/components/feature-editor/feature-editor.component.mjs +27 -12
  12. package/esm2022/lib/components/feature-set-editor/feature-set-editor.component.mjs +32 -9
  13. package/esm2022/lib/components/feature-set-view/feature-set-view.component.mjs +28 -8
  14. package/esm2022/lib/components/ln-heights-editor/ln-heights-editor.component.mjs +38 -7
  15. package/esm2022/lib/components/operation-source-editor/operation-source-editor.component.mjs +29 -4
  16. package/esm2022/lib/components/simple-tree/simple-tree.component.mjs +20 -4
  17. package/esm2022/lib/components/snapshot-editor/snapshot-editor.component.mjs +471 -159
  18. package/esm2022/lib/components/steps-map/steps-map.component.mjs +37 -9
  19. package/esm2022/lib/models.mjs +1 -1
  20. package/esm2022/lib/services/gve-api.service.mjs +4 -4
  21. package/esm2022/lib/services/settings.service.mjs +6 -5
  22. package/esm2022/lib/validators/svg-validators.mjs +7 -1
  23. package/esm2022/public-api.mjs +2 -2
  24. package/fesm2022/myrmidon-gve-core.mjs +1159 -487
  25. package/fesm2022/myrmidon-gve-core.mjs.map +1 -1
  26. package/lib/components/animation-timeline/animation-timeline.component.d.ts +31 -9
  27. package/lib/components/animation-timeline-set/animation-timeline-set.component.d.ts +28 -4
  28. package/lib/components/animation-tween/animation-tween.component.d.ts +25 -12
  29. package/lib/components/base-text-char/base-text-char.component.d.ts +16 -0
  30. package/lib/components/base-text-editor/base-text-editor.component.d.ts +5 -1
  31. package/lib/components/base-text-view/base-text-view.component.d.ts +37 -0
  32. package/lib/components/batch-operation-editor/batch-operation-editor.component.d.ts +46 -0
  33. package/lib/components/chain-operation-editor/chain-operation-editor.component.d.ts +53 -5
  34. package/lib/components/chain-result-view/chain-result-view.component.d.ts +21 -4
  35. package/lib/components/feature-editor/feature-editor.component.d.ts +20 -6
  36. package/lib/components/feature-set-editor/feature-set-editor.component.d.ts +27 -4
  37. package/lib/components/feature-set-view/feature-set-view.component.d.ts +23 -3
  38. package/lib/components/ln-heights-editor/ln-heights-editor.component.d.ts +22 -0
  39. package/lib/components/operation-source-editor/operation-source-editor.component.d.ts +31 -0
  40. package/lib/components/simple-tree/simple-tree.component.d.ts +19 -0
  41. package/lib/components/snapshot-editor/snapshot-editor.component.d.ts +184 -19
  42. package/lib/components/steps-map/steps-map.component.d.ts +22 -3
  43. package/lib/models.d.ts +8 -0
  44. package/lib/services/gve-api.service.d.ts +33 -0
  45. package/lib/services/settings.service.d.ts +2 -1
  46. package/lib/validators/svg-validators.d.ts +6 -0
  47. package/package.json +10 -10
  48. package/public-api.d.ts +1 -1
  49. package/esm2022/lib/components/animation-vars/animation-vars.component.mjs +0 -141
  50. package/lib/components/animation-vars/animation-vars.component.d.ts +0 -30
@@ -2,6 +2,23 @@ import { FormBuilder, FormControl } from '@angular/forms';
2
2
  import { Feature, LabeledId, OperationFeature } from '@myrmidon/gve-snapshot-view';
3
3
  import { FeatureMap } from '../feature-editor/feature-editor.component';
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ * 🔑 `gve-feature-set-view`
7
+ *
8
+ * A component to display a list of features.
9
+ * Used by the chain result view component.
10
+ *
11
+ * - ▶️ `features` (`Feature[]`): the features to display.
12
+ * - ▶️ `featNames` (`LabeledId[]`): the list of feature names to display
13
+ * in the _name_ selection. This is used when you have a closed list of features.
14
+ * - ▶️ `featValues` (`FeatureMap`): the feature values map. When specified
15
+ * and the user selects a feature name present in the map keys, the corresponding
16
+ * values will be used to populate the value selection.
17
+ * - ▶️ `filterThreshold` (`number`): the threshold at which the features filter
18
+ * should become visible. If set to 0, the filter is always visible; if set to -1,
19
+ * it is always invisible; otherwise, it gets visible when the number of features
20
+ * is greater than the threshold. Default is 5.
21
+ */
5
22
  export declare class FeatureSetViewComponent {
6
23
  private _sub?;
7
24
  private _features;
@@ -22,9 +39,12 @@ export declare class FeatureSetViewComponent {
22
39
  */
23
40
  featValues: FeatureMap | undefined;
24
41
  /**
25
- * The minimum count of features required for filter to be visible.
42
+ * The threshold at which the features filter should become visible.
43
+ * If set to 0, the filter is always visible; if set to -1, it is always
44
+ * invisible; otherwise, it gets visible when the number of features
45
+ * is greater than the threshold. Default is 5.
26
46
  */
27
- minFilterCount: number;
47
+ filterThreshold: number;
28
48
  filter: FormControl<string | null>;
29
49
  filteredFeatures: Feature[] | OperationFeature[];
30
50
  constructor(formBuilder: FormBuilder);
@@ -32,5 +52,5 @@ export declare class FeatureSetViewComponent {
32
52
  ngOnInit(): void;
33
53
  ngOnDestroy(): void;
34
54
  static ɵfac: i0.ɵɵFactoryDeclaration<FeatureSetViewComponent, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<FeatureSetViewComponent, "gve-feature-set-view", never, { "features": { "alias": "features"; "required": false; }; "featNames": { "alias": "featNames"; "required": false; }; "featValues": { "alias": "featValues"; "required": false; }; "minFilterCount": { "alias": "minFilterCount"; "required": false; }; }, {}, never, never, true, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<FeatureSetViewComponent, "gve-feature-set-view", never, { "features": { "alias": "features"; "required": false; }; "featNames": { "alias": "featNames"; "required": false; }; "featValues": { "alias": "featValues"; "required": false; }; "filterThreshold": { "alias": "filterThreshold"; "required": false; }; }, {}, never, never, true, never>;
36
56
  }
@@ -1,19 +1,41 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormBuilder, FormControl } from '@angular/forms';
3
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * 🔑 `gve-ln-heights-editor`
6
+ *
7
+ * A component to edit line heights.
8
+ * Used by the `gve-snapshot-editor` component.
9
+ *
10
+ * - ▶️ `lineCount` (`number`): the number of lines.
11
+ * - ▶️ `heights` (`Record<number, number>`): the line heights.
12
+ * - 🔥 `heightsChange` (`EventEmitter<Record<number, number>>`): the event
13
+ * emitted when the heights change.
14
+ */
4
15
  export declare class LnHeightsEditorComponent implements OnInit, OnDestroy {
5
16
  private _subs?;
6
17
  private _heights?;
7
18
  private _lineCount;
8
19
  lineNumber: FormControl<number>;
9
20
  height: FormControl<number>;
21
+ /**
22
+ * The total number of lines in the text.
23
+ */
10
24
  get lineCount(): number;
11
25
  set lineCount(value: number);
26
+ /**
27
+ * The heights map of the lines. Each key is a line number and the value is
28
+ * the height of the line.
29
+ */
12
30
  get heights(): Record<number, number> | undefined;
13
31
  set heights(value: Record<number, number> | undefined | null);
32
+ /**
33
+ * The event emitted when the heights change.
34
+ */
14
35
  readonly heightsChange: EventEmitter<Record<number, number> | undefined>;
15
36
  lineNumbers: number[];
16
37
  constructor(formBuilder: FormBuilder);
38
+ private pruneHeights;
17
39
  ngOnInit(): void;
18
40
  ngOnDestroy(): void;
19
41
  reset(): void;
@@ -2,13 +2,44 @@ import { EventEmitter } from '@angular/core';
2
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
3
  import { LabeledId, OperationSource } from '@myrmidon/gve-snapshot-view';
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ * 🔑 `gve-operation-source-editor`
7
+ *
8
+ * A component to edit an operation source.
9
+ * Used by chain operation editor component.
10
+ *
11
+ * - ▶️ `source` (`OperationSource`): the source to edit.
12
+ * - ▶️ `ids` (`LabeledId[]`): the list of source IDs, when using a closed
13
+ * list for them.
14
+ * - ▶️ `types` (`LabeledId[]`): the list of source types, when using a closed
15
+ * list for them.
16
+ * - 🔥 `sourceChange` (`EventEmitter<OperationSource>`): the event emitted
17
+ * when the source changes.
18
+ * - 🔥 `sourceCancel` (`EventEmitter<void>`): the event emitted when the
19
+ * edit is canceled.
20
+ */
5
21
  export declare class OperationSourceEditorComponent {
6
22
  private _source;
23
+ /**
24
+ * The source to edit.
25
+ */
7
26
  get source(): OperationSource | undefined;
8
27
  set source(value: OperationSource | undefined | null);
28
+ /**
29
+ * The list of source IDs when it's closed.
30
+ */
9
31
  ids?: LabeledId[];
32
+ /**
33
+ * The list of source types when it's closed.
34
+ */
10
35
  types?: LabeledId[];
36
+ /**
37
+ * The event emitted when the source changes.
38
+ */
11
39
  readonly sourceChange: EventEmitter<OperationSource | undefined>;
40
+ /**
41
+ * The event emitted when the edit is canceled.
42
+ */
12
43
  sourceCancel: EventEmitter<void>;
13
44
  id: FormControl<string>;
14
45
  type: FormControl<string>;
@@ -1,11 +1,30 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { TreeNode } from '@myrmidon/gve-snapshot-view';
3
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * 🔑 `gve-simple-tree`
6
+ *
7
+ * A simple tree component.
8
+ *
9
+ * - ▶️ `node` (`TreeNode<any>`): the node to display.
10
+ * - ▶️ `selectedNode` (`TreeNode<any> | null`): the selected node.
11
+ * - 🔥 `selectedNodeChange` (`EventEmitter<TreeNode<any> | null>`): the event
12
+ * emitted when the selected node changes.
13
+ */
4
14
  export declare class SimpleTreeComponent implements OnInit {
5
15
  private _node;
16
+ /**
17
+ * The node to display.
18
+ */
6
19
  get node(): TreeNode<any> | undefined;
7
20
  set node(value: TreeNode<any> | undefined);
21
+ /**
22
+ * The selected node.
23
+ */
8
24
  selectedNode?: TreeNode<any> | null;
25
+ /**
26
+ * The event emitted when the selected node changes.
27
+ */
9
28
  selectedNodeChange: EventEmitter<TreeNode<any> | null>;
10
29
  level: number;
11
30
  ngOnInit(): void;
@@ -1,22 +1,36 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { ElementRef, EventEmitter } from '@angular/core';
2
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
3
  import { MatSnackBar } from '@angular/material/snack-bar';
4
+ import { MatDialog } from '@angular/material/dialog';
4
5
  import { DialogService } from '@myrmidon/ng-mat-tools';
5
- import { CharChainOperation, CharNode, GveAnimationTimeline, GveVisualEvent, Snapshot, SnapshotViewData, SnapshotViewRenderEvent } from '@myrmidon/gve-snapshot-view';
6
+ import { CharChainOperation, CharNode, GveAnimationTimeline, GveVisualEvent, Snapshot, SnapshotViewComponent, SnapshotViewData, SnapshotViewRenderEvent } from '@myrmidon/gve-snapshot-view';
6
7
  import { VarBaseTextRange } from '../base-text-view/base-text-view.component';
7
8
  import { ChainOperationContextStep, CharChainResult, GveApiService } from '../../services/gve-api.service';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
- * A component to edit a text snapshot.
11
+ * 🔑 `gve-snapshot-editor`
12
+ *
13
+ * A component to edit a text snapshot. This is the top level component in the GVE core
14
+ * library.
15
+ *
16
+ * - ▶️ `snapshot` (`Snapshot`): the snapshot to edit.
17
+ * - ▶️ `batchOps` (`string`): the batch operations text to set for the editor.
18
+ * - ▶️ `noSave` (`boolean`): true to disable saving.
19
+ * - 🔥 `snapshotChange` (`Snapshot`): emitted when the user saves the edited snapshot.
20
+ * - 🔥 `snapshotCancel` (`void`): emitted when the user cancels the snapshot editing.
11
21
  */
12
- export declare class SnapshotEditorComponent implements OnInit {
22
+ export declare class SnapshotEditorComponent {
13
23
  private _api;
24
+ private _dialog;
14
25
  private _dialogService;
15
26
  private _snackbar;
16
27
  private readonly _nanoid;
17
28
  private _snapshot?;
18
29
  private _renderer?;
19
30
  private _previewing?;
31
+ private _transparentIds?;
32
+ private _stepPickFrozen?;
33
+ snapshotView?: ElementRef<SnapshotViewComponent>;
20
34
  /**
21
35
  * The snapshot to edit.
22
36
  */
@@ -30,6 +44,10 @@ export declare class SnapshotEditorComponent implements OnInit {
30
44
  * True to disable saving.
31
45
  */
32
46
  noSave?: boolean;
47
+ /**
48
+ * True to enable debug mode for view rendition.
49
+ */
50
+ debug?: boolean;
33
51
  /**
34
52
  * Emitted when the user saves the edited snapshot.
35
53
  */
@@ -50,7 +68,6 @@ export declare class SnapshotEditorComponent implements OnInit {
50
68
  spcWidthOffset: FormControl<number>;
51
69
  textStyle: FormControl<string | null>;
52
70
  operations: FormControl<CharChainOperation[]>;
53
- inputOps: FormControl<string | null>;
54
71
  opStyle: FormControl<string | null>;
55
72
  form: FormGroup;
56
73
  imageUrl: FormControl<string | null>;
@@ -61,11 +78,12 @@ export declare class SnapshotEditorComponent implements OnInit {
61
78
  imageHeight: FormControl<number>;
62
79
  defs: FormControl<string | null>;
63
80
  timelines: FormControl<GveAnimationTimeline[]>;
81
+ opTags: string[];
82
+ opElementIds: string[];
64
83
  textRange?: VarBaseTextRange;
84
+ lineCount: number;
65
85
  editedOp?: CharChainOperation;
66
86
  editedOpIndex: number;
67
- opTags: string[];
68
- opElementIds: string[];
69
87
  busy?: boolean;
70
88
  parseError?: string;
71
89
  opTypeMap: {
@@ -78,38 +96,185 @@ export declare class SnapshotEditorComponent implements OnInit {
78
96
  6: string;
79
97
  7: string;
80
98
  };
81
- lineCount: number;
82
99
  viewTitle: string;
83
100
  viewData?: SnapshotViewData;
84
101
  visualInfo?: string;
85
102
  rulers: boolean;
86
103
  result?: CharChainResult;
87
104
  resultOperationId?: string;
88
- constructor(formBuilder: FormBuilder, _api: GveApiService, _dialogService: DialogService, _snackbar: MatSnackBar);
89
- ngOnInit(): void;
90
- updateViewData(newOperation?: CharChainOperation, snapshot?: Snapshot, title?: string): void;
105
+ initialStepIndex: number;
106
+ constructor(formBuilder: FormBuilder, _api: GveApiService, _dialog: MatDialog, _dialogService: DialogService, _snackbar: MatSnackBar);
107
+ /**
108
+ * Set the view data for the snapshot view.
109
+ *
110
+ * @param snapshot The optional snapshot data to use. If not provided,
111
+ * a snapshot will be created from the form data.
112
+ * @param title The optional title to set for the view.
113
+ */
114
+ private setViewData;
91
115
  private updateForm;
116
+ /**
117
+ * Update the line count based on the received text.
118
+ * @param text The text to use for counting lines.
119
+ */
120
+ private updateLineCount;
121
+ /**
122
+ * Handle the event fired by the base text editor to pick a text range.
123
+ * @param range The picked range.
124
+ */
125
+ onRangePick(range: VarBaseTextRange): void;
126
+ /**
127
+ * Handle the event fired by the base text editor to change the base text.
128
+ * @param text The text to set.
129
+ */
130
+ onTextChange(text: CharNode[]): void;
131
+ /**
132
+ * Update the lists of operation output tags and element IDs by collecting
133
+ * all the operation tags and the IDs of the elements in their diplomatic.g
134
+ * SVG code if any.
135
+ */
136
+ private updateOpLists;
137
+ /**
138
+ * Edit a new operation.
139
+ */
92
140
  editNewOperation(): void;
141
+ /**
142
+ * Edit (a copy of) the operation at the specified index.
143
+ * @param index The operation index.
144
+ */
93
145
  editOperation(index: number): void;
94
- private closeEditedOp;
146
+ /**
147
+ * Close the currently edited operation.
148
+ */
149
+ private closeEditedOperation;
150
+ /**
151
+ * Handle the event fired by the operation editor to cancel
152
+ * the current operation edits.
153
+ */
95
154
  onOperationCancel(): void;
96
- onOperationChange(op: CharChainOperation): void;
155
+ /**
156
+ * Handle the event fired by the operation editor to change
157
+ * the currently edited operation, or add a new one if that
158
+ * was a new operation.
159
+ * @param op The changed operation.
160
+ */
161
+ onOperationChange(op: CharChainOperation): Promise<void>;
162
+ /**
163
+ * Delete the operation at the specified index.
164
+ * @param index The index of the operation to delete.
165
+ */
97
166
  deleteOperation(index: number): void;
98
- onTextChange(text: CharNode[]): void;
99
- onRangePick(range: VarBaseTextRange): void;
167
+ /**
168
+ * Parse the operations from their text and append them to the current
169
+ * snapshot operations.
170
+ */
100
171
  parseOperations(): void;
172
+ private removeAllOperations;
173
+ /**
174
+ * Remove all the operations.
175
+ */
101
176
  clearOperations(): void;
177
+ /**
178
+ * Parse all the id attributes from the received SVG code and
179
+ * return them as an array.
180
+ *
181
+ * @param svg The SVG content to parse or undefined.
182
+ * @returns Array of IDs found in the SVG content or undefined.
183
+ */
184
+ private parseSvgIds;
185
+ private getTransparentIds;
186
+ /**
187
+ * Run the operations up to the specified index (included).
188
+ * This is called when:
189
+ * - a preview is requested by the operation editor.
190
+ * - the currently edited operation is saved.
191
+ * - the user picks a step in the chain result view.
192
+ * - runToLast is called, which happens when:
193
+ * - setting the snapshot.
194
+ * - parsing a batch of operations.
195
+ * - deleting an operation.
196
+ *
197
+ * @param index The index of the operation to run to.
198
+ * @param lastOperation The operation to use in place of the existing
199
+ * operation in the snapshot at index. This is used when previewing
200
+ * the edited operation from within the operation editor.
201
+ */
202
+ runTo(index: number, lastOperation?: CharChainOperation): Promise<CharChainResult>;
203
+ /**
204
+ * Run the operations up to the last operation if any, updating the
205
+ * execution result. The execution result is always the result from
206
+ * all the operations, as users must be able to browse across its steps.
207
+ */
208
+ runToLast(): Promise<void>;
209
+ /**
210
+ * Update the snapshot view by running the operations up to the
211
+ * currently edited operation if any.
212
+ *
213
+ * @param operation The operation being previewed.
214
+ */
102
215
  onOperationPreview(operation: CharChainOperation): void;
103
- runTo(index: number): void;
104
- onStepPick(step: ChainOperationContextStep): void;
216
+ /**
217
+ * Build the snapshot at the specified execution step. This implies adding
218
+ * the nodes introduced by the operations up to the specified step, and
219
+ * updating the features of the nodes introduced by the specified step.
220
+ * Also, the operations after the specified step are removed from the
221
+ * snapshot.
222
+ *
223
+ * @param step The step to build the snapshot at.
224
+ * @returns The snapshot at the specified step.
225
+ */
226
+ private buildSnapshotAtStep;
227
+ private playTimeline;
228
+ /**
229
+ * Handle the event fired by the chain result view to pick a step.
230
+ *
231
+ * @param step The step to pick.
232
+ */
233
+ onStepPick(step: ChainOperationContextStep): Promise<void>;
234
+ /**
235
+ * Handle the event fired by a visual in the snapshot view.
236
+ *
237
+ * @param event The event.
238
+ */
105
239
  onVisualEvent(event: CustomEvent<GveVisualEvent>): void;
240
+ /**
241
+ * Handle the change of line heights by updating the form control.
242
+ *
243
+ * @param heights The line heights.
244
+ */
106
245
  onHeightsChange(heights: Record<number, number> | undefined): void;
246
+ /**
247
+ * Handle the change of timelines by updating the form control.
248
+ *
249
+ * @param timelines The timelines.
250
+ */
251
+ onTimelinesChange(timelines: GveAnimationTimeline[]): void;
252
+ /**
253
+ * Emit the cancel event for this snapshot edit.
254
+ */
107
255
  close(): void;
256
+ /**
257
+ * Handle the render event from the snapshot view to get a reference
258
+ * to the renderer.
259
+ *
260
+ * @param event The rendition event.
261
+ */
108
262
  onSnapshotRender(event: CustomEvent<SnapshotViewRenderEvent>): void;
263
+ /**
264
+ * Toggle rulers in the snapshot view.
265
+ */
109
266
  toggleRulers(): void;
267
+ /**
268
+ * Get a snapshot from the form data.
269
+ *
270
+ * @returns New snapshot object.
271
+ */
110
272
  private getSnapshot;
111
- onTimelinesChange(timelines: GveAnimationTimeline[]): void;
273
+ /**
274
+ * Get a snapshot from the form data and emit it
275
+ * in the snapshot change event.
276
+ */
112
277
  save(): void;
113
278
  static ɵfac: i0.ɵɵFactoryDeclaration<SnapshotEditorComponent, never>;
114
- static ɵcmp: i0.ɵɵComponentDeclaration<SnapshotEditorComponent, "gve-snapshot-editor", never, { "snapshot": { "alias": "snapshot"; "required": false; }; "batchOps": { "alias": "batchOps"; "required": false; }; "noSave": { "alias": "noSave"; "required": false; }; }, { "snapshotChange": "snapshotChange"; "snapshotCancel": "snapshotCancel"; }, never, never, true, never>;
279
+ static ɵcmp: i0.ɵɵComponentDeclaration<SnapshotEditorComponent, "gve-snapshot-editor", never, { "snapshot": { "alias": "snapshot"; "required": false; }; "batchOps": { "alias": "batchOps"; "required": false; }; "noSave": { "alias": "noSave"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; }, { "snapshotChange": "snapshotChange"; "snapshotCancel": "snapshotCancel"; }, never, never, true, never>;
115
280
  }
@@ -2,10 +2,27 @@ import { EventEmitter } from '@angular/core';
2
2
  import { ChainOperationContextStep } from '../../services/gve-api.service';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
- * A map of steps in a chain operation context.
5
+ * 🔑 `gve-steps-map`
6
+ *
7
+ * A map of steps in a chain operation context. This shows the list of
8
+ * steps in the execution of a set of operations, and allows the user to
9
+ * pick a step to view.
10
+ *
11
+ * Used by the `gve-chain-result-view` component.
12
+ *
13
+ * - ▶️ `steps` (`ChainOperationContextStep[]`): the steps to display.
14
+ * - ▶️ `selectedStep` (`ChainOperationContextStep`): the step that is
15
+ * currently selected.
16
+ * - ▶️ `textFontSize` (`string`): the font size of the steps text.
17
+ * - 🔥 `selectedStepChange` (`ChainOperationContextStep`): emitted when
18
+ * the selectd step has been changed by the user. This is not emitted
19
+ * when the selected step is changed programmatically, unless this is
20
+ * the first time the steps are set. In that case, the last step is
21
+ * automatically selected.
6
22
  */
7
23
  export declare class StepsMapComponent {
8
24
  private _steps?;
25
+ lines: string[];
9
26
  /**
10
27
  * The steps to display.
11
28
  */
@@ -20,10 +37,12 @@ export declare class StepsMapComponent {
20
37
  */
21
38
  textFontSize: string;
22
39
  /**
23
- * Emitted when the selectd step has changed.
40
+ * Emitted when the selected step has changed by user, or when
41
+ * the steps are set for the first time.
24
42
  */
25
43
  selectedStepChange: EventEmitter<ChainOperationContextStep>;
26
- onSelectStep(step: ChainOperationContextStep): void;
44
+ private updateLines;
45
+ onStepClick(step: ChainOperationContextStep): void;
27
46
  static ɵfac: i0.ɵɵFactoryDeclaration<StepsMapComponent, never>;
28
47
  static ɵcmp: i0.ɵɵComponentDeclaration<StepsMapComponent, "gve-steps-map", never, { "steps": { "alias": "steps"; "required": false; }; "selectedStep": { "alias": "selectedStep"; "required": false; }; "textFontSize": { "alias": "textFontSize"; "required": false; }; }, { "selectedStepChange": "selectedStepChange"; }, never, never, true, never>;
29
48
  }
package/lib/models.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { MatDialogConfig } from "@angular/material/dialog";
1
2
  /**
2
3
  * API call result wrapper.
3
4
  */
@@ -5,3 +6,10 @@ export interface ResultWrapper<T> {
5
6
  result?: T;
6
7
  error?: string;
7
8
  }
9
+ /**
10
+ * PayloadMatDialogConfig is a MatDialogConfig with a payload, used
11
+ * to pass data of type T to a dialog.
12
+ */
13
+ export interface PayloadMatDialogConfig<T> extends MatDialogConfig {
14
+ payload?: T;
15
+ }
@@ -8,23 +8,56 @@ import * as i0 from "@angular/core";
8
8
  * Execution step of a char-based chain operation.
9
9
  */
10
10
  export interface ChainOperationContextStep {
11
+ /**
12
+ * The operation that was executed.
13
+ */
11
14
  operation: CharChainOperation;
15
+ /**
16
+ * The input version tag.
17
+ */
12
18
  inputTag: string;
19
+ /**
20
+ * The output version tag.
21
+ */
13
22
  outputTag: string;
23
+ /**
24
+ * The string synthetically representing the result.
25
+ */
14
26
  result?: string;
27
+ /**
28
+ * The features emitted up to the executed operation.
29
+ * These are the features of the text as a whole, and
30
+ * those belonging to specific nodes.
31
+ */
15
32
  featureSet: {
16
33
  features: OperationFeature[];
17
34
  nodeFeatures: Record<string, OperationFeature[]>;
18
35
  };
36
+ /**
37
+ * The reference node IDs of the operation which was
38
+ * executed.
39
+ */
19
40
  refNodeIds: number[];
20
41
  }
21
42
  /**
22
43
  * Result of execution of a char-based chain.
23
44
  */
24
45
  export interface CharChainResult {
46
+ /**
47
+ * The execution steps of the chain.
48
+ */
25
49
  steps: ChainOperationContextStep[];
50
+ /**
51
+ * The chain dump, which is the text representation of the chain.
52
+ */
26
53
  chainDump: string;
54
+ /**
55
+ * The list of unique tags in the chain.
56
+ */
27
57
  chainTags: string[];
58
+ /**
59
+ * The sets of nodes in their order, for each version tag.
60
+ */
28
61
  taggedNodes: {
29
62
  [key: string]: CharNode[];
30
63
  };
@@ -1,6 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * Service to store and retrieve dynamic settings.
3
+ * Service to store and retrieve dynamic settings. On demand, settings can
4
+ * be persisted in the local storage.
4
5
  */
5
6
  export declare class SettingsService {
6
7
  private readonly _cache;
@@ -1,4 +1,10 @@
1
1
  import { ValidatorFn } from '@angular/forms';
2
+ /**
3
+ * Validators for SVG.
4
+ */
2
5
  export declare class SvgValidators {
6
+ /**
7
+ * Validator for a valid SVG `g` root element in GVE.
8
+ */
3
9
  static rootGValidator(): ValidatorFn;
4
10
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myrmidon/gve-core",
3
- "version": "0.0.4",
4
- "description": "Cadmus - GVE frontend core components.",
3
+ "version": "0.0.6",
4
+ "description": "Cadmus - GVE Angular frontend core components.",
5
5
  "keywords": [
6
6
  "GVE"
7
7
  ],
@@ -14,19 +14,19 @@
14
14
  "name": "Daniele Fusi"
15
15
  },
16
16
  "peerDependencies": {
17
- "@angular/common": "^18.0.0",
18
- "@angular/core": "^18.0.0",
19
- "@cisstech/nge": "^17.7.1",
17
+ "@angular/common": "^18.2.10",
18
+ "@angular/core": "^18.2.10",
19
+ "@cisstech/nge": "^18.0.4",
20
20
  "@myrmidon/ng-mat-tools": "^3.1.0",
21
21
  "@myrmidon/ng-tools": "^3.1.1",
22
- "@myrmidon/gve-snapshot-view": "^0.0.19",
23
- "@svgdotjs/svg.js": "^3.2.3",
22
+ "@myrmidon/gve-snapshot-view": "^1.1.2",
23
+ "@svgdotjs/svg.js": "^3.2.4",
24
24
  "gsap": "^3.12.5",
25
- "monaco-editor": "^0.50.0",
26
- "nanoid": "^5.0.7"
25
+ "monaco-editor": "^0.52.0",
26
+ "nanoid": "^5.0.8"
27
27
  },
28
28
  "dependencies": {
29
- "tslib": "^2.3.0"
29
+ "tslib": "^2.8.0"
30
30
  },
31
31
  "sideEffects": false,
32
32
  "module": "fesm2022/myrmidon-gve-core.mjs",
package/public-api.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export * from './lib/models';
2
2
  export * from './lib/components/animation-timeline/animation-timeline.component';
3
3
  export * from './lib/components/animation-tween/animation-tween.component';
4
- export * from './lib/components/animation-vars/animation-vars.component';
5
4
  export * from './lib/components/base-text-char/base-text-char.component';
6
5
  export * from './lib/components/base-text-editor/base-text-editor.component';
7
6
  export * from './lib/components/base-text-view/base-text-view.component';
7
+ export * from './lib/components/batch-operation-editor/batch-operation-editor.component';
8
8
  export * from './lib/components/chain-operation-editor/chain-operation-editor.component';
9
9
  export * from './lib/components/chain-result-view/chain-result-view.component';
10
10
  export * from './lib/components/feature-editor/feature-editor.component';