@myrmidon/gve-core 0.0.5 → 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 (33) hide show
  1. package/README.md +2 -0
  2. package/esm2022/lib/components/animation-timeline/animation-timeline.component.mjs +4 -4
  3. package/esm2022/lib/components/animation-timeline-set/animation-timeline-set.component.mjs +4 -4
  4. package/esm2022/lib/components/animation-tween/animation-tween.component.mjs +4 -4
  5. package/esm2022/lib/components/base-text-char/base-text-char.component.mjs +4 -4
  6. package/esm2022/lib/components/base-text-editor/base-text-editor.component.mjs +4 -4
  7. package/esm2022/lib/components/base-text-view/base-text-view.component.mjs +4 -4
  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 +4 -4
  10. package/esm2022/lib/components/chain-result-view/chain-result-view.component.mjs +8 -5
  11. package/esm2022/lib/components/feature-editor/feature-editor.component.mjs +4 -4
  12. package/esm2022/lib/components/feature-set-editor/feature-set-editor.component.mjs +4 -4
  13. package/esm2022/lib/components/feature-set-view/feature-set-view.component.mjs +5 -5
  14. package/esm2022/lib/components/ln-heights-editor/ln-heights-editor.component.mjs +4 -4
  15. package/esm2022/lib/components/operation-source-editor/operation-source-editor.component.mjs +4 -4
  16. package/esm2022/lib/components/simple-tree/simple-tree.component.mjs +4 -4
  17. package/esm2022/lib/components/snapshot-editor/snapshot-editor.component.mjs +82 -75
  18. package/esm2022/lib/components/steps-map/steps-map.component.mjs +12 -6
  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 +4 -4
  22. package/esm2022/public-api.mjs +2 -1
  23. package/fesm2022/myrmidon-gve-core.mjs +296 -183
  24. package/fesm2022/myrmidon-gve-core.mjs.map +1 -1
  25. package/lib/components/batch-operation-editor/batch-operation-editor.component.d.ts +46 -0
  26. package/lib/components/chain-result-view/chain-result-view.component.d.ts +4 -1
  27. package/lib/components/feature-set-editor/feature-set-editor.component.d.ts +1 -1
  28. package/lib/components/snapshot-editor/snapshot-editor.component.d.ts +11 -9
  29. package/lib/components/steps-map/steps-map.component.d.ts +2 -0
  30. package/lib/models.d.ts +8 -0
  31. package/lib/services/gve-api.service.d.ts +33 -0
  32. package/package.json +8 -8
  33. package/public-api.d.ts +1 -0
@@ -0,0 +1,46 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
+ import { MatDialogRef } from '@angular/material/dialog';
4
+ import { CharChainOperation } from '@myrmidon/gve-snapshot-view';
5
+ import { PayloadMatDialogConfig } from '../../models';
6
+ import { GveApiService } from '../../services/gve-api.service';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * 🔑 `gve-batch-operation-editor`
10
+ *
11
+ * A component to edit a batch of operations. This component can be used both in a dialog
12
+ * and as a standalone component.
13
+ *
14
+ * - ▶️ `preset` (`string`): the optional preset text to parse.
15
+ * - 🔥 `operationsChange` (`CharChainOperation[]`): event emitted when operations change.
16
+ */
17
+ export declare class BatchOperationEditorComponent implements OnInit {
18
+ private _api;
19
+ dialogRef?: MatDialogRef<BatchOperationEditorComponent> | undefined;
20
+ data?: PayloadMatDialogConfig<{
21
+ preset?: string;
22
+ }> | undefined;
23
+ private _preset?;
24
+ busy?: boolean;
25
+ parseError?: string;
26
+ text: FormControl<string | null>;
27
+ form: FormGroup;
28
+ /**
29
+ * The preset text to parse if any. Usually you start with a blank
30
+ * text, but sometimes you might want to pre-set it.
31
+ */
32
+ get preset(): string | undefined | null;
33
+ set preset(value: string | undefined | null);
34
+ /**
35
+ * Emitted when operations change.
36
+ */
37
+ readonly operationsChange: EventEmitter<CharChainOperation[]>;
38
+ constructor(formBuilder: FormBuilder, _api: GveApiService, dialogRef?: MatDialogRef<BatchOperationEditorComponent> | undefined, data?: PayloadMatDialogConfig<{
39
+ preset?: string;
40
+ }> | undefined);
41
+ ngOnInit(): void;
42
+ parseOperations(): void;
43
+ close(): void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<BatchOperationEditorComponent, [null, null, { optional: true; }, { optional: true; }]>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<BatchOperationEditorComponent, "gve-batch-operation-editor", never, { "preset": { "alias": "preset"; "required": false; }; }, { "operationsChange": "operationsChange"; }, never, never, true, never>;
46
+ }
@@ -8,7 +8,10 @@ import * as i0 from "@angular/core";
8
8
  /**
9
9
  * 🔑 `gve-chain-result-view`
10
10
  *
11
- * Component to display a chain result.
11
+ * Component to display a chain result. This provides a version picker
12
+ * by staged version or simple step, and shows the selected step's text
13
+ * and features, plus a steps map. User can pick a step from both the
14
+ * pickers or the map.
12
15
  * Used by the `gve-snapshot-editor` component.
13
16
  *
14
17
  * - ▶️ `result` (`CharChainResult`): the result to display.
@@ -60,7 +60,7 @@ export declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
60
60
  /**
61
61
  * Emitted when the features change.
62
62
  */
63
- featuresChange: EventEmitter<OperationFeature[] | Feature[]>;
63
+ featuresChange: EventEmitter<Feature[] | OperationFeature[]>;
64
64
  editedFeature?: Feature | OperationFeature;
65
65
  filter: FormControl<string | null>;
66
66
  filteredFeatures: Feature[] | OperationFeature[];
@@ -1,6 +1,7 @@
1
- import { ElementRef, 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
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';
@@ -18,8 +19,9 @@ import * as i0 from "@angular/core";
18
19
  * - 🔥 `snapshotChange` (`Snapshot`): emitted when the user saves the edited snapshot.
19
20
  * - 🔥 `snapshotCancel` (`void`): emitted when the user cancels the snapshot editing.
20
21
  */
21
- export declare class SnapshotEditorComponent implements OnInit {
22
+ export declare class SnapshotEditorComponent {
22
23
  private _api;
24
+ private _dialog;
23
25
  private _dialogService;
24
26
  private _snackbar;
25
27
  private readonly _nanoid;
@@ -66,7 +68,6 @@ export declare class SnapshotEditorComponent implements OnInit {
66
68
  spcWidthOffset: FormControl<number>;
67
69
  textStyle: FormControl<string | null>;
68
70
  operations: FormControl<CharChainOperation[]>;
69
- inputOps: FormControl<string | null>;
70
71
  opStyle: FormControl<string | null>;
71
72
  form: FormGroup;
72
73
  imageUrl: FormControl<string | null>;
@@ -102,8 +103,7 @@ export declare class SnapshotEditorComponent implements OnInit {
102
103
  result?: CharChainResult;
103
104
  resultOperationId?: string;
104
105
  initialStepIndex: number;
105
- constructor(formBuilder: FormBuilder, _api: GveApiService, _dialogService: DialogService, _snackbar: MatSnackBar);
106
- ngOnInit(): void;
106
+ constructor(formBuilder: FormBuilder, _api: GveApiService, _dialog: MatDialog, _dialogService: DialogService, _snackbar: MatSnackBar);
107
107
  /**
108
108
  * Set the view data for the snapshot view.
109
109
  *
@@ -182,6 +182,7 @@ export declare class SnapshotEditorComponent implements OnInit {
182
182
  * @returns Array of IDs found in the SVG content or undefined.
183
183
  */
184
184
  private parseSvgIds;
185
+ private getTransparentIds;
185
186
  /**
186
187
  * Run the operations up to the specified index (included).
187
188
  * This is called when:
@@ -198,12 +199,13 @@ export declare class SnapshotEditorComponent implements OnInit {
198
199
  * operation in the snapshot at index. This is used when previewing
199
200
  * the edited operation from within the operation editor.
200
201
  */
201
- runTo(index: number, lastOperation?: CharChainOperation): Promise<void>;
202
+ runTo(index: number, lastOperation?: CharChainOperation): Promise<CharChainResult>;
202
203
  /**
203
- * Run the operations up to the last operation if any.
204
- * Otherwise, just update the snapshot view.
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.
205
207
  */
206
- runToLast(): void;
208
+ runToLast(): Promise<void>;
207
209
  /**
208
210
  * Update the snapshot view by running the operations up to the
209
211
  * currently edited operation if any.
@@ -22,6 +22,7 @@ import * as i0 from "@angular/core";
22
22
  */
23
23
  export declare class StepsMapComponent {
24
24
  private _steps?;
25
+ lines: string[];
25
26
  /**
26
27
  * The steps to display.
27
28
  */
@@ -40,6 +41,7 @@ export declare class StepsMapComponent {
40
41
  * the steps are set for the first time.
41
42
  */
42
43
  selectedStepChange: EventEmitter<ChainOperationContextStep>;
44
+ private updateLines;
43
45
  onStepClick(step: ChainOperationContextStep): void;
44
46
  static ɵfac: i0.ɵɵFactoryDeclaration<StepsMapComponent, never>;
45
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>;
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/gve-core",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Cadmus - GVE Angular frontend core components.",
5
5
  "keywords": [
6
6
  "GVE"
@@ -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",
22
+ "@myrmidon/gve-snapshot-view": "^1.1.2",
23
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.6.3"
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
@@ -4,6 +4,7 @@ export * from './lib/components/animation-tween/animation-tween.component';
4
4
  export * from './lib/components/base-text-char/base-text-char.component';
5
5
  export * from './lib/components/base-text-editor/base-text-editor.component';
6
6
  export * from './lib/components/base-text-view/base-text-view.component';
7
+ export * from './lib/components/batch-operation-editor/batch-operation-editor.component';
7
8
  export * from './lib/components/chain-operation-editor/chain-operation-editor.component';
8
9
  export * from './lib/components/chain-result-view/chain-result-view.component';
9
10
  export * from './lib/components/feature-editor/feature-editor.component';