@myrmidon/gve-core 3.0.3 → 5.0.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.
Files changed (28) hide show
  1. package/fesm2022/myrmidon-gve-core.mjs +671 -547
  2. package/fesm2022/myrmidon-gve-core.mjs.map +1 -1
  3. package/index.d.ts +1500 -3
  4. package/package.json +12 -11
  5. package/lib/components/animation-timeline/animation-timeline.component.d.ts +0 -61
  6. package/lib/components/animation-timeline-set/animation-timeline-set.component.d.ts +0 -52
  7. package/lib/components/animation-tween/animation-tween.component.d.ts +0 -58
  8. package/lib/components/base-text-char/base-text-char.component.d.ts +0 -42
  9. package/lib/components/base-text-editor/base-text-editor.component.d.ts +0 -42
  10. package/lib/components/base-text-view/base-text-view.component.d.ts +0 -69
  11. package/lib/components/batch-operation-editor/batch-operation-editor.component.d.ts +0 -44
  12. package/lib/components/chain-operation-editor/chain-operation-editor.component.d.ts +0 -149
  13. package/lib/components/chain-result-view/chain-result-view.component.d.ts +0 -58
  14. package/lib/components/chain-view/chain-view.component.d.ts +0 -42
  15. package/lib/components/feature-editor/feature-editor.component.d.ts +0 -82
  16. package/lib/components/feature-set-editor/feature-set-editor.component.d.ts +0 -76
  17. package/lib/components/feature-set-view/feature-set-view.component.d.ts +0 -54
  18. package/lib/components/ln-heights-editor/ln-heights-editor.component.d.ts +0 -41
  19. package/lib/components/operation-source-editor/operation-source-editor.component.d.ts +0 -52
  20. package/lib/components/snapshot-editor/snapshot-editor.component.d.ts +0 -293
  21. package/lib/components/snapshot-text-editor/snapshot-text-editor.component.d.ts +0 -37
  22. package/lib/components/steps-map/steps-map.component.d.ts +0 -48
  23. package/lib/models.d.ts +0 -15
  24. package/lib/services/gve-api.service.d.ts +0 -148
  25. package/lib/services/gve-graphviz.service.d.ts +0 -20
  26. package/lib/services/settings.service.d.ts +0 -89
  27. package/lib/validators/svg-validators.d.ts +0 -10
  28. package/public-api.d.ts +0 -21
@@ -1,82 +0,0 @@
1
- import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { Feature, FeatureSetPolicy, LabeledId, OperationFeature } from '@myrmidon/gve-snapshot-view';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Features map. This is used for features from closed sets,
7
- * and lists the possible values for each feature.
8
- * The key is the feature name, and the value is an array of
9
- * labeled IDs representing the allowed values for that feature.
10
- */
11
- export interface FeatureMap {
12
- [key: string]: LabeledId[];
13
- }
14
- /**
15
- * 🔑 `gve-feature-editor`
16
- *
17
- * Component for editing a single feature, whose model is a name=value
18
- * pair, plus a set policy value which defines the desired behavior
19
- * when adding that feature to a set.
20
- * Used by `gve-feature-set-editor`.
21
- *
22
- * - ▶️ `feature` (`Feature`): the feature to edit.
23
- * - ▶️ `featNames` (`LabeledId[]`): the list of feature names to display
24
- * in the _name_ selection. This is used when you have a closed list of
25
- * features. Each item in the list is an object with _id_ and _label_
26
- * properties.
27
- * - ▶️ `featValues` (`FeatureMap`): the feature values map. When
28
- * specified and the user selects a feature name present in the map keys,
29
- * the corresponding values will be used to populate the value selection.
30
- * - 🔥 `featureChange` (`Feature`): emitted when feature has changed.
31
- * - 🔥 `featureCancel`: emitted when the user cancels the feature editing.
32
- */
33
- export declare class FeatureEditorComponent implements OnInit, OnDestroy {
34
- private _sub?;
35
- private _frozen?;
36
- nameControl?: ElementRef;
37
- /**
38
- * The list of feature names to display in the name selection.
39
- * This is used when you have a closed list of features.
40
- */
41
- readonly featNames: import("@angular/core").InputSignal<LabeledId[] | undefined>;
42
- /**
43
- * The feature values map. When specified and the user selects a feature
44
- * name present in the map keys, the corresponding values will be used
45
- * to populate the value selection.
46
- */
47
- readonly featValues: import("@angular/core").InputSignal<FeatureMap | undefined>;
48
- /**
49
- * The feature to edit.
50
- */
51
- readonly feature: import("@angular/core").ModelSignal<Feature | OperationFeature | undefined>;
52
- /**
53
- * True if the feature is a variant operation feature, which has
54
- * additional properties like negation, global, and short-lived.
55
- */
56
- readonly isVar: import("@angular/core").InputSignal<boolean>;
57
- /**
58
- * Event emitted when the user cancels the feature editing.
59
- */
60
- readonly featureCancel: import("@angular/core").OutputEmitterRef<void>;
61
- /**
62
- * Event emitted when the user saves the edited feature.
63
- */
64
- readonly featureChange: import("@angular/core").OutputEmitterRef<Feature | OperationFeature>;
65
- name: FormControl<string>;
66
- value: FormControl<string>;
67
- setPolicy: FormControl<FeatureSetPolicy>;
68
- isNegated: FormControl<boolean>;
69
- isGlobal: FormControl<boolean>;
70
- isShortLived: FormControl<boolean>;
71
- form: FormGroup;
72
- nameIds?: LabeledId[];
73
- constructor(formBuilder: FormBuilder);
74
- ngOnInit(): void;
75
- ngOnDestroy(): void;
76
- private getLabeledIdsFor;
77
- private updateForm;
78
- cancel(): void;
79
- save(): void;
80
- static ɵfac: i0.ɵɵFactoryDeclaration<FeatureEditorComponent, never>;
81
- static ɵcmp: i0.ɵɵComponentDeclaration<FeatureEditorComponent, "gve-feature-editor", never, { "featNames": { "alias": "featNames"; "required": false; "isSignal": true; }; "featValues": { "alias": "featValues"; "required": false; "isSignal": true; }; "feature": { "alias": "feature"; "required": false; "isSignal": true; }; "isVar": { "alias": "isVar"; "required": false; "isSignal": true; }; }, { "feature": "featureChange"; "featureCancel": "featureCancel"; "featureChange": "featureChange"; }, never, never, true, never>;
82
- }
@@ -1,76 +0,0 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl } from '@angular/forms';
3
- import { LabeledId, Feature, OperationFeature } from '@myrmidon/gve-snapshot-view';
4
- import { FeatureMap } from '../feature-editor/feature-editor.component';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * 🔑 `gve-feature-set-editor`
8
- *
9
- * Component for editing a set of features. It shows a list of features,
10
- * allowing to edit each of them or adding new ones. Optionally you can
11
- * specify a list of feature names and values to use in the selection.
12
- * Used by base text editor and chain operation editor components.
13
- *
14
- * - ▶️ `featNames` (`LabeledId[]`): the list of feature names to display
15
- * in the _name_ selection. This is used when you have a closed list of features.
16
- * - ▶️ `featValues` (`FeatureMap`): the feature values map. When specified
17
- * and the user selects a feature name present in the map keys, the corresponding
18
- * values will be used to populate the value selection.
19
- * - ▶️ `filterThreshold` (`number`): the threshold at which the features filter
20
- * should become visible. If set to 0, the filter is always visible; if set to -1,
21
- * it is always invisible; otherwise, it gets visible when the number of features
22
- * is equal to or greater than the threshold. Default is 5.
23
- * - ▶️ `features` (`Feature[]`): the features to edit.
24
- * - ▶️ `isVar`: true if the feature is a variant operation feature, which
25
- * has additional properties like negation, global, and short-lived.
26
- * - 🔥 `featuresChange` (`Feature[]`): emitted when features have changed.
27
- */
28
- export declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
29
- private _sub?;
30
- private _editedFeatureIndex;
31
- POLICIES: string[];
32
- /**
33
- * True if the features are variable features.
34
- */
35
- readonly isVar: import("@angular/core").InputSignal<boolean>;
36
- /**
37
- * The list of feature names to display in the name selection.
38
- * This is used when you have a closed list of features.
39
- */
40
- readonly featNames: import("@angular/core").InputSignal<LabeledId[] | undefined>;
41
- /**
42
- * The feature values map. When specified and the user selects a feature
43
- * name present in the map keys, the corresponding values will be used
44
- * to populate the value selection.
45
- */
46
- readonly featValues: import("@angular/core").InputSignal<FeatureMap | undefined>;
47
- /**
48
- * The threshold at which the features filter should become visible.
49
- * If set to 0, the filter is always visible; if set to -1, it is always
50
- * invisible; otherwise, it gets visible when the number of features
51
- * is greater than or equal to the threshold. Default is 5.
52
- */
53
- readonly filterThreshold: import("@angular/core").InputSignal<number>;
54
- /**
55
- * The features to edit.
56
- */
57
- readonly features: import("@angular/core").ModelSignal<Feature[] | OperationFeature[]>;
58
- /**
59
- * Emitted when the features change.
60
- */
61
- readonly featuresChange: import("@angular/core").OutputEmitterRef<Feature[] | OperationFeature[]>;
62
- editedFeature?: Feature | OperationFeature;
63
- filter: FormControl<string | null>;
64
- filteredFeatures: Feature[] | OperationFeature[];
65
- constructor(formBuilder: FormBuilder);
66
- private applyFeatureFilter;
67
- ngOnInit(): void;
68
- ngOnDestroy(): void;
69
- addFeature(): void;
70
- editFeature(feature: Feature | OperationFeature): void;
71
- deleteFeature(feature: Feature | OperationFeature): void;
72
- onFeatureChange(feature?: Feature | OperationFeature): void;
73
- onFeatureCancel(): void;
74
- static ɵfac: i0.ɵɵFactoryDeclaration<FeatureSetEditorComponent, never>;
75
- static ɵcmp: i0.ɵɵComponentDeclaration<FeatureSetEditorComponent, "gve-feature-set-editor", never, { "isVar": { "alias": "isVar"; "required": false; "isSignal": true; }; "featNames": { "alias": "featNames"; "required": false; "isSignal": true; }; "featValues": { "alias": "featValues"; "required": false; "isSignal": true; }; "filterThreshold": { "alias": "filterThreshold"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; }, { "features": "featuresChange"; "featuresChange": "featuresChange"; }, never, never, true, never>;
76
- }
@@ -1,54 +0,0 @@
1
- import { FormBuilder, FormControl } from '@angular/forms';
2
- import { Feature, LabeledId, OperationFeature } from '@myrmidon/gve-snapshot-view';
3
- import { FeatureMap } from '../feature-editor/feature-editor.component';
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
- */
22
- export declare class FeatureSetViewComponent {
23
- private _sub?;
24
- /**
25
- * The features.
26
- */
27
- readonly features: import("@angular/core").InputSignal<Feature[] | OperationFeature[]>;
28
- /**
29
- * The list of feature names to display in the name selection.
30
- * This is used when you have a closed list of features.
31
- */
32
- readonly featNames: import("@angular/core").InputSignal<LabeledId[] | undefined>;
33
- /**
34
- * The feature values map. When specified and the user selects a feature
35
- * name present in the map keys, the corresponding values will be used
36
- * to populate the value selection.
37
- */
38
- readonly featValues: import("@angular/core").InputSignal<FeatureMap | undefined>;
39
- /**
40
- * The threshold at which the features filter should become visible.
41
- * If set to 0, the filter is always visible; if set to -1, it is always
42
- * invisible; otherwise, it gets visible when the number of features
43
- * is greater than the threshold. Default is 5.
44
- */
45
- readonly filterThreshold: import("@angular/core").InputSignal<number>;
46
- filter: FormControl<string | null>;
47
- filteredFeatures: Feature[] | OperationFeature[];
48
- constructor(formBuilder: FormBuilder);
49
- private applyFeatureFilter;
50
- ngOnInit(): void;
51
- ngOnDestroy(): void;
52
- static ɵfac: i0.ɵɵFactoryDeclaration<FeatureSetViewComponent, never>;
53
- static ɵcmp: i0.ɵɵComponentDeclaration<FeatureSetViewComponent, "gve-feature-set-view", never, { "features": { "alias": "features"; "required": false; "isSignal": true; }; "featNames": { "alias": "featNames"; "required": false; "isSignal": true; }; "featValues": { "alias": "featValues"; "required": false; "isSignal": true; }; "filterThreshold": { "alias": "filterThreshold"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
54
- }
@@ -1,41 +0,0 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl } from '@angular/forms';
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
- */
15
- export declare class LnHeightsEditorComponent implements OnInit, OnDestroy {
16
- private _subs?;
17
- private _heights?;
18
- lineNumber: FormControl<number>;
19
- height: FormControl<number>;
20
- /**
21
- * The total number of lines in the text.
22
- */
23
- readonly lineCount: import("@angular/core").InputSignal<number>;
24
- /**
25
- * The heights map of the lines. Each key is a line number and the value is
26
- * the height of the line.
27
- */
28
- readonly heights: import("@angular/core").InputSignal<Record<number, number> | undefined>;
29
- /**
30
- * The event emitted when the heights change.
31
- */
32
- readonly heightsChange: import("@angular/core").OutputEmitterRef<Record<number, number> | undefined>;
33
- lineNumbers: number[];
34
- constructor(formBuilder: FormBuilder);
35
- private pruneHeights;
36
- ngOnInit(): void;
37
- ngOnDestroy(): void;
38
- reset(): void;
39
- static ɵfac: i0.ɵɵFactoryDeclaration<LnHeightsEditorComponent, never>;
40
- static ɵcmp: i0.ɵɵComponentDeclaration<LnHeightsEditorComponent, "gve-ln-heights-editor", never, { "lineCount": { "alias": "lineCount"; "required": false; "isSignal": true; }; "heights": { "alias": "heights"; "required": false; "isSignal": true; }; }, { "heightsChange": "heightsChange"; }, never, never, true, never>;
41
- }
@@ -1,52 +0,0 @@
1
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
2
- import { LabeledId, OperationSource } from '@myrmidon/gve-snapshot-view';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * 🔑 `gve-operation-source-editor`
6
- *
7
- * A component to edit an operation source.
8
- * Used by chain operation editor component.
9
- *
10
- * - ▶️ `source` (`OperationSource`): the source to edit.
11
- * - ▶️ `ids` (`LabeledId[]`): the list of source IDs, when using a closed
12
- * list for them.
13
- * - ▶️ `types` (`LabeledId[]`): the list of source types, when using a closed
14
- * list for them.
15
- * - 🔥 `sourceChange` (`EventEmitter<OperationSource>`): the event emitted
16
- * when the source changes.
17
- * - 🔥 `sourceCancel` (`EventEmitter<void>`): the event emitted when the
18
- * edit is canceled.
19
- */
20
- export declare class OperationSourceEditorComponent {
21
- /**
22
- * The source to edit.
23
- */
24
- readonly source: import("@angular/core").ModelSignal<OperationSource | undefined>;
25
- /**
26
- * The list of source IDs when it's a closed set.
27
- */
28
- readonly ids: import("@angular/core").InputSignal<LabeledId[] | undefined>;
29
- /**
30
- * The list of source types when it's a closed set.
31
- */
32
- readonly types: import("@angular/core").InputSignal<LabeledId[] | undefined>;
33
- /**
34
- * The event emitted when the source changes.
35
- */
36
- readonly sourceChange: import("@angular/core").OutputEmitterRef<OperationSource | undefined>;
37
- /**
38
- * The event emitted when the edit is canceled.
39
- */
40
- sourceCancel: import("@angular/core").OutputEmitterRef<void>;
41
- id: FormControl<string>;
42
- type: FormControl<string>;
43
- rank: FormControl<number>;
44
- note: FormControl<string | null>;
45
- form: FormGroup;
46
- constructor(formBuilder: FormBuilder);
47
- private updateForm;
48
- cancel(): void;
49
- save(): void;
50
- static ɵfac: i0.ɵɵFactoryDeclaration<OperationSourceEditorComponent, never>;
51
- static ɵcmp: i0.ɵɵComponentDeclaration<OperationSourceEditorComponent, "gve-operation-source-editor", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "ids": { "alias": "ids"; "required": false; "isSignal": true; }; "types": { "alias": "types"; "required": false; "isSignal": true; }; }, { "source": "sourceChange"; "sourceChange": "sourceChange"; "sourceCancel": "sourceCancel"; }, never, never, true, never>;
52
- }
@@ -1,293 +0,0 @@
1
- import { ElementRef } from '@angular/core';
2
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { MatSnackBar } from '@angular/material/snack-bar';
4
- import { MatDialog } from '@angular/material/dialog';
5
- import { DialogService } from '@myrmidon/ngx-mat-tools';
6
- import { CharChainOperation, CharNode, GveAnimationTimeline, GveVisualEvent, Snapshot, SnapshotViewComponent, SnapshotViewData, SnapshotViewRenderEvent } from '@myrmidon/gve-snapshot-view';
7
- import { VarBaseTextRange } from '../base-text-view/base-text-view.component';
8
- import { ChainOperationContextStep, CharChain, CharChainResult, GveApiService } from '../../services/gve-api.service';
9
- import * as i0 from "@angular/core";
10
- /**
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.
21
- */
22
- export declare class SnapshotEditorComponent {
23
- private _api;
24
- private _dialog;
25
- private _dialogService;
26
- private _snackbar;
27
- private readonly _nanoid;
28
- private _renderer?;
29
- private _previewing?;
30
- private _transparentIds?;
31
- private _stepPickFrozen?;
32
- private _handlingOver?;
33
- private _lastOverId?;
34
- snapshotView?: ElementRef<SnapshotViewComponent>;
35
- /**
36
- * The snapshot to edit.
37
- */
38
- readonly snapshot: import("@angular/core").ModelSignal<Snapshot | undefined>;
39
- /**
40
- * The batch operations text to set for the editor.
41
- */
42
- readonly batchOps: import("@angular/core").InputSignal<string | undefined>;
43
- /**
44
- * True to disable saving.
45
- */
46
- readonly noSave: import("@angular/core").InputSignal<boolean | undefined>;
47
- /**
48
- * True to enable debug mode for view rendition.
49
- */
50
- readonly debug: import("@angular/core").InputSignal<boolean | undefined>;
51
- /**
52
- * Emitted when the user saves the edited snapshot.
53
- */
54
- readonly snapshotChange: import("@angular/core").OutputEmitterRef<Snapshot>;
55
- /**
56
- * Emitted when the user cancels the snapshot editing.
57
- */
58
- readonly snapshotCancel: import("@angular/core").OutputEmitterRef<void>;
59
- width: FormControl<number>;
60
- height: FormControl<number>;
61
- style: FormControl<string | null>;
62
- baseText: FormControl<CharNode[]>;
63
- offsetX: FormControl<number>;
64
- offsetY: FormControl<number>;
65
- lineHeightOffset: FormControl<number>;
66
- lnHeights: FormControl<Record<number, number> | null>;
67
- charSpacingOffset: FormControl<number>;
68
- spcWidthOffset: FormControl<number>;
69
- textStyle: FormControl<string | null>;
70
- operations: FormControl<CharChainOperation[]>;
71
- opStyle: FormControl<string | null>;
72
- form: FormGroup;
73
- imageUrl: FormControl<string | null>;
74
- imageOpacity: FormControl<number>;
75
- imageX: FormControl<number>;
76
- imageY: FormControl<number>;
77
- imageWidth: FormControl<number>;
78
- imageHeight: FormControl<number>;
79
- defs: FormControl<string | null>;
80
- timelines: FormControl<GveAnimationTimeline[]>;
81
- opTags: string[];
82
- opElementIds: string[];
83
- textRange?: VarBaseTextRange;
84
- lineCount: number;
85
- editedOp?: CharChainOperation;
86
- editedOpIndex: number;
87
- busy?: boolean;
88
- parseError?: string;
89
- opTypeMap: {
90
- 0: string;
91
- 1: string;
92
- 2: string;
93
- 3: string;
94
- 4: string;
95
- 5: string;
96
- 6: string;
97
- 7: string;
98
- };
99
- viewTitle: string;
100
- viewData?: SnapshotViewData;
101
- visualInfo?: string;
102
- rulers: boolean;
103
- result?: CharChainResult;
104
- resultOperationId?: string;
105
- initialStepIndex: number;
106
- readonly showChain: FormControl<boolean>;
107
- chain?: CharChain;
108
- constructor(formBuilder: FormBuilder, _api: GveApiService, _dialog: MatDialog, _dialogService: DialogService, _snackbar: MatSnackBar);
109
- /**
110
- * Set the view data for the snapshot view.
111
- *
112
- * @param snapshot The optional snapshot data to use. If not provided,
113
- * a snapshot will be created from the form data.
114
- * @param title The optional title to set for the view.
115
- */
116
- private setViewData;
117
- private updateForm;
118
- inputBaseText(): void;
119
- /**
120
- * Update the line count based on the received text.
121
- * @param text The text to use for counting lines.
122
- */
123
- private updateLineCount;
124
- /**
125
- * Handle the event fired by the base text editor to pick a text range.
126
- * @param range The picked range.
127
- */
128
- onRangePick(range?: VarBaseTextRange): void;
129
- /**
130
- * Update the lists of operation output tags and element IDs by collecting
131
- * all the operation tags and the IDs of the elements in their diplomatic.g
132
- * SVG code if any.
133
- */
134
- private updateOpLists;
135
- /**
136
- * Edit a new operation.
137
- */
138
- editNewOperation(): void;
139
- /**
140
- * Edit (a copy of) the operation at the specified index.
141
- * @param index The operation index.
142
- */
143
- editOperation(index: number): void;
144
- /**
145
- * Close the currently edited operation.
146
- */
147
- private closeEditedOperation;
148
- /**
149
- * Handle the event fired by the operation editor to cancel
150
- * the current operation edits.
151
- */
152
- onOperationCancel(): void;
153
- /**
154
- * Handle the event fired by the operation editor to change
155
- * the currently edited operation, or add a new one if that
156
- * was a new operation.
157
- * @param op The changed operation.
158
- */
159
- onOperationChange(op?: CharChainOperation | null): void;
160
- /**
161
- * Delete the operation at the specified index.
162
- * @param index The index of the operation to delete.
163
- */
164
- deleteOperation(index: number): void;
165
- /**
166
- * Parse the operations from their text and append them to the current
167
- * snapshot operations.
168
- */
169
- parseOperations(): void;
170
- /**
171
- * Remove all the operations, close the edited operation and update the view data.
172
- */
173
- private removeAllOperations;
174
- /**
175
- * Remove all the operations.
176
- */
177
- clearOperations(): void;
178
- /**
179
- * Parse all the id attributes from the received SVG code and
180
- * return them as an array.
181
- *
182
- * @param svg The SVG content to parse or undefined.
183
- * @returns Array of IDs found in the SVG content or undefined.
184
- */
185
- private parseSvgIds;
186
- private getTransparentIds;
187
- /**
188
- * Supply operation nodes to the snapshot text nodes. An execution result is
189
- * a compact object, so that to build a snapshot accumulating all the nodes
190
- * and their features up to the last executed operation, we need to start
191
- * with the base text nodes, and then examine each execution step in the
192
- * result. Each step contains only those nodes used by the version of the
193
- * text corresponding to its stage. Among them, some are new nodes, and some
194
- * are base text nodes. Also, the step contains the full set of features
195
- * current at its time, both for the text as a whole and for each node.
196
- * This method accumulates the nodes and their features up to the specified
197
- * step, updating the features of the nodes already present in the snapshot
198
- * text nodes, and adding the new nodes.
199
- *
200
- * @param snapshot The snapshot to supply the nodes to.
201
- * @param result The operations execution result.
202
- * @param tag The output tag of the operation to supply the nodes from.
203
- */
204
- private supplyOpNodes;
205
- /**
206
- * Run the operations up to the specified index (included).
207
- * This is called when:
208
- * - a preview is requested by the operation editor.
209
- * - the currently edited operation is saved.
210
- * - the user picks a step in the chain result view.
211
- * - runToLast is called, which happens when:
212
- * - setting the snapshot.
213
- * - parsing a batch of operations.
214
- * - deleting an operation.
215
- *
216
- * @param index The index of the operation to run to.
217
- * @param lastOperation The operation to use in place of the existing
218
- * operation in the snapshot at index. This is used when previewing
219
- * the edited operation from within the operation editor.
220
- * @returns A promise that resolves to the execution result.
221
- */
222
- runTo(index: number, lastOperation?: CharChainOperation): void;
223
- /**
224
- * Run the operations up to the last operation if any, updating the
225
- * execution result. The execution result is always the result from
226
- * all the operations, as users must be able to browse across its steps.
227
- */
228
- runToLast(): void;
229
- getChainAt(index: number, lastOperation?: CharChainOperation): void;
230
- /**
231
- * Update the snapshot view by running the operations up to the
232
- * currently edited operation if any.
233
- *
234
- * @param operation The operation being previewed.
235
- */
236
- onOperationPreview(operation: CharChainOperation): void;
237
- private playTimeline;
238
- /**
239
- * Handle the event fired by the chain result view to pick a step.
240
- *
241
- * @param step The step to pick.
242
- */
243
- onStepPick(step: ChainOperationContextStep): void;
244
- /**
245
- * Handle the event fired by a visual in the snapshot view.
246
- *
247
- * @param event The event.
248
- */
249
- onVisualEvent(event: CustomEvent<GveVisualEvent>): void;
250
- /**
251
- * Handle the change of line heights by updating the form control.
252
- *
253
- * @param heights The line heights.
254
- */
255
- onHeightsChange(heights: Record<number, number> | undefined): void;
256
- /**
257
- * Handle the change of timelines by updating the form control.
258
- *
259
- * @param timelines The timelines.
260
- */
261
- onTimelinesChange(timelines?: GveAnimationTimeline[] | null): void;
262
- /**
263
- * Emit the cancel event for this snapshot edit.
264
- */
265
- close(): void;
266
- /**
267
- * Handle the render event from the snapshot view to get a reference
268
- * to the renderer.
269
- *
270
- * @param event The rendition event.
271
- */
272
- onSnapshotRender(event: CustomEvent<SnapshotViewRenderEvent>): void;
273
- onImageLoad(imageElement: HTMLImageElement): void;
274
- onImageOpacityChange(value: number): void;
275
- resetImgMetadata(): void;
276
- /**
277
- * Toggle rulers in the snapshot view.
278
- */
279
- toggleRulers(): void;
280
- /**
281
- * Get a snapshot from the form data.
282
- *
283
- * @returns New snapshot object.
284
- */
285
- private getSnapshot;
286
- /**
287
- * Get a snapshot from the form data and emit it
288
- * in the snapshot change event.
289
- */
290
- save(): void;
291
- static ɵfac: i0.ɵɵFactoryDeclaration<SnapshotEditorComponent, never>;
292
- static ɵcmp: i0.ɵɵComponentDeclaration<SnapshotEditorComponent, "gve-snapshot-editor", never, { "snapshot": { "alias": "snapshot"; "required": false; "isSignal": true; }; "batchOps": { "alias": "batchOps"; "required": false; "isSignal": true; }; "noSave": { "alias": "noSave"; "required": false; "isSignal": true; }; "debug": { "alias": "debug"; "required": false; "isSignal": true; }; }, { "snapshot": "snapshotChange"; "snapshotChange": "snapshotChange"; "snapshotCancel": "snapshotCancel"; }, never, never, true, never>;
293
- }
@@ -1,37 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { MatDialogRef } from '@angular/material/dialog';
4
- import { CharNode } from '@myrmidon/gve-snapshot-view';
5
- import { PayloadMatDialogConfig } from '../../models';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * 🔑 `gve-snapshot-text-editor`
9
- *
10
- * A component to edit a snapshot text. This component can be used both in a dialog
11
- * and as a standalone component.
12
- *
13
- * - ▶️ `text` (`CharNode[]`): the text to edit.
14
- * - 🔥 `textChange` (`CharNode[]`): event emitted when text changes.
15
- */
16
- export declare class SnapshotTextEditorComponent implements OnInit {
17
- dialogRef?: MatDialogRef<SnapshotTextEditorComponent> | undefined;
18
- data?: PayloadMatDialogConfig<{
19
- text?: CharNode[];
20
- }> | undefined;
21
- userText: FormControl<string>;
22
- form: FormGroup;
23
- readonly text: import("@angular/core").ModelSignal<CharNode[]>;
24
- /**
25
- * Emitted when text changes.
26
- */
27
- readonly textChange: import("@angular/core").OutputEmitterRef<CharNode[]>;
28
- constructor(formBuilder: FormBuilder, dialogRef?: MatDialogRef<SnapshotTextEditorComponent> | undefined, data?: PayloadMatDialogConfig<{
29
- text?: CharNode[];
30
- }> | undefined);
31
- private updateUserText;
32
- ngOnInit(): void;
33
- close(): void;
34
- save(): void;
35
- static ɵfac: i0.ɵɵFactoryDeclaration<SnapshotTextEditorComponent, [null, { optional: true; }, { optional: true; }]>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<SnapshotTextEditorComponent, "gve-snapshot-text-editor", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; }, { "text": "textChange"; "textChange": "textChange"; }, never, never, true, never>;
37
- }