@myrmidon/gve-core 0.0.3 → 0.0.5

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 (46) hide show
  1. package/README.md +43 -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 +154 -0
  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/chain-operation-editor/chain-operation-editor.component.mjs +97 -39
  9. package/esm2022/lib/components/chain-result-view/chain-result-view.component.mjs +44 -12
  10. package/esm2022/lib/components/feature-editor/feature-editor.component.mjs +27 -12
  11. package/esm2022/lib/components/feature-set-editor/feature-set-editor.component.mjs +32 -9
  12. package/esm2022/lib/components/feature-set-view/feature-set-view.component.mjs +28 -8
  13. package/esm2022/lib/components/ln-heights-editor/ln-heights-editor.component.mjs +38 -7
  14. package/esm2022/lib/components/operation-source-editor/operation-source-editor.component.mjs +29 -4
  15. package/esm2022/lib/components/simple-tree/simple-tree.component.mjs +20 -4
  16. package/esm2022/lib/components/snapshot-editor/snapshot-editor.component.mjs +446 -108
  17. package/esm2022/lib/components/steps-map/steps-map.component.mjs +31 -9
  18. package/esm2022/lib/services/gve-api.service.mjs +17 -4
  19. package/esm2022/lib/services/settings.service.mjs +6 -5
  20. package/esm2022/lib/validators/svg-validators.mjs +7 -1
  21. package/esm2022/public-api.mjs +1 -2
  22. package/fesm2022/myrmidon-gve-core.mjs +1089 -375
  23. package/fesm2022/myrmidon-gve-core.mjs.map +1 -1
  24. package/lib/components/animation-timeline/animation-timeline.component.d.ts +31 -9
  25. package/lib/components/animation-timeline-set/animation-timeline-set.component.d.ts +55 -0
  26. package/lib/components/animation-tween/animation-tween.component.d.ts +25 -12
  27. package/lib/components/base-text-char/base-text-char.component.d.ts +16 -0
  28. package/lib/components/base-text-editor/base-text-editor.component.d.ts +5 -1
  29. package/lib/components/base-text-view/base-text-view.component.d.ts +37 -0
  30. package/lib/components/chain-operation-editor/chain-operation-editor.component.d.ts +53 -5
  31. package/lib/components/chain-result-view/chain-result-view.component.d.ts +17 -3
  32. package/lib/components/feature-editor/feature-editor.component.d.ts +21 -7
  33. package/lib/components/feature-set-editor/feature-set-editor.component.d.ts +28 -5
  34. package/lib/components/feature-set-view/feature-set-view.component.d.ts +23 -3
  35. package/lib/components/ln-heights-editor/ln-heights-editor.component.d.ts +22 -0
  36. package/lib/components/operation-source-editor/operation-source-editor.component.d.ts +31 -0
  37. package/lib/components/simple-tree/simple-tree.component.d.ts +19 -0
  38. package/lib/components/snapshot-editor/snapshot-editor.component.d.ts +179 -12
  39. package/lib/components/steps-map/steps-map.component.d.ts +20 -3
  40. package/lib/services/gve-api.service.d.ts +14 -0
  41. package/lib/services/settings.service.d.ts +2 -1
  42. package/lib/validators/svg-validators.d.ts +6 -0
  43. package/package.json +4 -4
  44. package/public-api.d.ts +0 -1
  45. package/esm2022/lib/components/animation-vars/animation-vars.component.mjs +0 -141
  46. package/lib/components/animation-vars/animation-vars.component.d.ts +0 -30
@@ -1,9 +1,26 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { GveAnimationTimeline, GveAnimationTween, GveAnimationVars } from '@myrmidon/gve-snapshot-view';
3
+ import { GveAnimationTimeline, GveAnimationTween } from '@myrmidon/gve-snapshot-view';
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ * 🔑 `gve-animation-timeline`
7
+ *
8
+ * A component to edit an animation timeline.
9
+ * Used by the `gve-animation-timeline-set` component.
10
+ *
11
+ * - ▶️ `timeline` (`GveAnimationTimeline`): the animation timeline to edit.
12
+ * - ▶️ `elementIds` (`string[]`): the IDs of the elements that can be selected
13
+ * by the tween.
14
+ * - ▶️ `tags` (`string[]`): the tags that can be used by the timeline.
15
+ * - 🔥 `timelineChange` (`GveAnimationTimeline`): emitted when the timeline
16
+ * is changed.
17
+ * - 🔥 `timelineCancel` (`void`): emitted when the timeline editing is canceled.
18
+ */
5
19
  export declare class AnimationTimelineComponent {
6
20
  private _timeline?;
21
+ /**
22
+ * The animation timeline to edit.
23
+ */
7
24
  get timeline(): GveAnimationTimeline | undefined;
8
25
  set timeline(value: GveAnimationTimeline | undefined | null);
9
26
  /**
@@ -11,21 +28,26 @@ export declare class AnimationTimelineComponent {
11
28
  * This list is used to allow the user to select an element from a dropdown.
12
29
  */
13
30
  elementIds?: string[];
31
+ /**
32
+ * The tags that can be used by the timeline.
33
+ */
14
34
  tags: string[];
35
+ /**
36
+ * Emitted when the timeline is changed.
37
+ */
15
38
  readonly timelineChange: EventEmitter<GveAnimationTimeline>;
16
- readonly cancel: EventEmitter<void>;
39
+ /**
40
+ * Emitted when the timeline editing is canceled.
41
+ */
42
+ readonly timelineCancel: EventEmitter<void>;
17
43
  tag: FormControl<string>;
18
44
  tweens: FormControl<GveAnimationTween[]>;
19
- vars: FormControl<GveAnimationVars>;
45
+ vars: FormControl<string | null>;
20
46
  form: FormGroup;
21
47
  editedTweenIndex: number;
22
48
  editedTween?: GveAnimationTween;
23
- readonly selectors: {
24
- 0: string;
25
- 1: string;
26
- 2: string;
27
- };
28
49
  constructor(formBuilder: FormBuilder);
50
+ private jsonValidator;
29
51
  private updateForm;
30
52
  addTween(): void;
31
53
  editTween(index: number): void;
@@ -38,5 +60,5 @@ export declare class AnimationTimelineComponent {
38
60
  close(): void;
39
61
  save(): void;
40
62
  static ɵfac: i0.ɵɵFactoryDeclaration<AnimationTimelineComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<AnimationTimelineComponent, "gve-animation-timeline", never, { "timeline": { "alias": "timeline"; "required": false; }; "elementIds": { "alias": "elementIds"; "required": false; }; "tags": { "alias": "tags"; "required": false; }; }, { "timelineChange": "timelineChange"; "cancel": "cancel"; }, never, never, true, never>;
63
+ static ɵcmp: i0.ɵɵComponentDeclaration<AnimationTimelineComponent, "gve-animation-timeline", never, { "timeline": { "alias": "timeline"; "required": false; }; "elementIds": { "alias": "elementIds"; "required": false; }; "tags": { "alias": "tags"; "required": false; }; }, { "timelineChange": "timelineChange"; "timelineCancel": "timelineCancel"; }, never, never, true, never>;
42
64
  }
@@ -0,0 +1,55 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
+ import { DialogService } from '@myrmidon/ng-mat-tools';
4
+ import { GveAnimationTimeline } from '@myrmidon/gve-snapshot-view';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * 🔑 `gve-animation-timeline-set`
8
+ *
9
+ * A component to edit a set of animation timelines.
10
+ * Used by the `gve-snapshot-editor` component.
11
+ *
12
+ * - ▶️ `timelines` (`GveAnimationTimeline[]`): the animation timelines to edit.
13
+ * - ▶️ `elementIds` (`string[]`): the IDs of the elements that can be selected by the tween.
14
+ * - ▶️ `tags` (`string[]`): the tags that can be used by the timeline.
15
+ * - 🔥 `timelinesChange` (`GveAnimationTimeline[]`): emitted when the timelines are changed.
16
+ * - 🔥 `timelinesCancel` (`void`): emitted when the timeline editing is canceled.
17
+ */
18
+ export declare class AnimationTimelineSetComponent {
19
+ private _dialogService;
20
+ private _timelines;
21
+ editedTimeline?: GveAnimationTimeline;
22
+ /**
23
+ * The animation timelines to edit.
24
+ */
25
+ get timelines(): GveAnimationTimeline[];
26
+ set timelines(value: GveAnimationTimeline[] | undefined | null);
27
+ /**
28
+ * The IDs of the elements that can be selected by the tween.
29
+ * This list is used to allow the user to select an element from a dropdown.
30
+ */
31
+ elementIds?: string[];
32
+ /**
33
+ * The tags that can be used by the timeline.
34
+ */
35
+ tags: string[];
36
+ /**
37
+ * Emitted when the timelines are changed.
38
+ */
39
+ readonly timelinesChange: EventEmitter<GveAnimationTimeline[]>;
40
+ /**
41
+ * Emitted when the timeline editing is canceled.
42
+ */
43
+ readonly timelinesCancel: EventEmitter<void>;
44
+ set: FormControl<GveAnimationTimeline[]>;
45
+ form: FormGroup;
46
+ constructor(formBuilder: FormBuilder, _dialogService: DialogService);
47
+ private updateForm;
48
+ closeTimeline(): void;
49
+ newTimeline(): void;
50
+ editTimeline(index: number): void;
51
+ onTimelineChange(timeline: GveAnimationTimeline): void;
52
+ deleteTimeline(index: number): void;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<AnimationTimelineSetComponent, never>;
54
+ static ɵcmp: i0.ɵɵComponentDeclaration<AnimationTimelineSetComponent, "gve-animation-timeline-set", never, { "timelines": { "alias": "timelines"; "required": false; }; "elementIds": { "alias": "elementIds"; "required": false; }; "tags": { "alias": "tags"; "required": false; }; }, { "timelinesChange": "timelinesChange"; "timelinesCancel": "timelinesCancel"; }, never, never, true, never>;
55
+ }
@@ -1,9 +1,17 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { GveAnimationTween, GveAnimationVars } from '@myrmidon/gve-snapshot-view';
3
+ import { GveAnimationTween, TweenType } from '@myrmidon/gve-snapshot-view';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
+ * 🔑 `gve-animation-tween`
7
+ *
6
8
  * A component to edit an animation tween.
9
+ * Used by the `gve-animation-timeline` component.
10
+ *
11
+ * - ▶️ `tween` (`GveAnimationTween`): the tween to edit.
12
+ * - ▶️ `elementIds` (`string[]`): the IDs of the elements that can be selected by the tween.
13
+ * - 🔥 `tweenChange` (`GveAnimationTween`): emitted when the tween is changed.
14
+ * - 🔥 `tweenCancel` (`void`): emitted when the user cancels the edit.
7
15
  */
8
16
  export declare class AnimationTweenComponent implements OnInit, OnDestroy {
9
17
  private _sub?;
@@ -18,30 +26,35 @@ export declare class AnimationTweenComponent implements OnInit, OnDestroy {
18
26
  * This list is used to allow the user to select an element from a dropdown.
19
27
  */
20
28
  elementIds?: string[];
29
+ /**
30
+ * Emitted when the tween is changed.
31
+ */
21
32
  readonly tweenChange: EventEmitter<GveAnimationTween>;
22
- readonly cancel: EventEmitter<void>;
33
+ /**
34
+ * Emitted when the user cancels the edit.
35
+ */
36
+ readonly tweenCancel: EventEmitter<void>;
37
+ types: string[];
23
38
  label: FormControl<string>;
24
39
  note: FormControl<string | null>;
25
- type: FormControl<number>;
40
+ type: FormControl<TweenType>;
26
41
  selector: FormControl<string>;
27
- vars: FormControl<GveAnimationVars>;
28
- vars2: FormControl<GveAnimationVars | null>;
42
+ vars: FormControl<string>;
43
+ vars2: FormControl<string | null>;
29
44
  position: FormControl<string | null>;
30
45
  form: FormGroup;
31
46
  elementId: FormControl<string | null>;
32
- types: {
33
- label: string;
34
- value: number;
35
- }[];
36
47
  constructor(formBuilder: FormBuilder);
37
48
  ngOnInit(): void;
38
49
  ngOnDestroy(): void;
39
- onVarsChange(vars: GveAnimationVars): void;
40
- onVars2Change(vars: GveAnimationVars): void;
50
+ onVarsChange(vars: string): void;
51
+ onVars2Change(vars: string): void;
41
52
  close(): void;
53
+ private jsonValidator;
42
54
  private updateForm;
43
55
  private getTween;
56
+ openUrl(url: string): void;
44
57
  save(): void;
45
58
  static ɵfac: i0.ɵɵFactoryDeclaration<AnimationTweenComponent, never>;
46
- static ɵcmp: i0.ɵɵComponentDeclaration<AnimationTweenComponent, "gve-animation-tween", never, { "tween": { "alias": "tween"; "required": false; }; "elementIds": { "alias": "elementIds"; "required": false; }; }, { "tweenChange": "tweenChange"; "cancel": "cancel"; }, never, never, true, never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<AnimationTweenComponent, "gve-animation-tween", never, { "tween": { "alias": "tween"; "required": false; }; "elementIds": { "alias": "elementIds"; "required": false; }; }, { "tweenChange": "tweenChange"; "tweenCancel": "tweenCancel"; }, never, never, true, never>;
47
60
  }
@@ -1,5 +1,8 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * A single character from a base text.
5
+ */
3
6
  export interface BaseTextChar {
4
7
  id: number;
5
8
  value: string;
@@ -8,20 +11,33 @@ export interface BaseTextChar {
8
11
  borderColor: string;
9
12
  emSize: number;
10
13
  }
14
+ /**
15
+ * Event emitted by the base text character component when a character
16
+ * is clicked.
17
+ */
11
18
  export interface BaseTextCharEvent {
12
19
  char: BaseTextChar;
13
20
  event: MouseEvent;
14
21
  }
15
22
  /**
23
+ * 🔑 `gve-base-text-char`
24
+ *
16
25
  * A component that displays a single character from a base text.
26
+ * Used by `gve-base-text-view`.
17
27
  */
18
28
  export declare class BaseTextCharComponent {
19
29
  private _char;
20
30
  defaultColor: string;
21
31
  defaultBorderColor: string;
22
32
  defaultEmSize: number;
33
+ /**
34
+ * The character to display.
35
+ */
23
36
  get char(): BaseTextChar | undefined;
24
37
  set char(value: BaseTextChar | undefined | null);
38
+ /**
39
+ * Emitted when the character is clicked.
40
+ */
25
41
  charPick: EventEmitter<BaseTextCharEvent>;
26
42
  onCharClick(event: MouseEvent): void;
27
43
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseTextCharComponent, never>;
@@ -6,9 +6,13 @@ import { BaseTextCharEvent } from '../base-text-char/base-text-char.component';
6
6
  import { VarBaseTextRange } from '../base-text-view/base-text-view.component';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
+ * 🔑 `gve-base-text-editor`
10
+ *
9
11
  * Editor for snapshot's base text. This can receive a string or an array
10
12
  * of `CharNode` objects, and lets the user edit the text, character by
11
13
  * character, optionally also setting its features.
14
+ *
15
+ * Used by the `gve-snapshot-editor` component.
12
16
  */
13
17
  export declare class BaseTextEditorComponent {
14
18
  private _dialogService;
@@ -20,7 +24,7 @@ export declare class BaseTextEditorComponent {
20
24
  get text(): CharNode[];
21
25
  set text(value: string | CharNode[] | undefined | null);
22
26
  /**
23
- * Emits the edited text as an array of `CharNode`'s whenever it changes.
27
+ * Emitted for the edited text as an array of `CharNode`'s whenever it changes.
24
28
  */
25
29
  readonly textChange: EventEmitter<CharNode[]>;
26
30
  userText: FormControl<string>;
@@ -2,23 +2,60 @@ import { EventEmitter } from '@angular/core';
2
2
  import { BaseTextChar, BaseTextCharEvent } from '../base-text-char/base-text-char.component';
3
3
  import { CharNode } from '@myrmidon/gve-snapshot-view';
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ * A range in the base text.
7
+ */
5
8
  export interface VarBaseTextRange {
6
9
  at: number;
7
10
  run: number;
8
11
  }
9
12
  /**
13
+ * 🔑 `gve-base-text-view`
14
+ *
10
15
  * A component to display a selectable base text.
16
+ * Used by the chain result view component and the base text editor component.
17
+ *
18
+ * - ▶️ `defaultColor` (`string`): the default color for the text.
19
+ * - ▶️ `defaultBorderColor` (`string`): the default border color for the text.
20
+ * - ▶️ `selectionColor` (`string`): the color for the selected text.
21
+ * - ▶️ `hasLineNumber` (`boolean`): true if line numbers should be displayed next to each line.
22
+ * - ▶️ `text` (`string` | `CharNode[]`): the text to display.
23
+ * - 🔥 `charPick` (`BaseTextCharEvent`): emitted when a character is picked.
24
+ * - 🔥 `rangePick` (`VarBaseTextRange`): emitted when a range is picked.
11
25
  */
12
26
  export declare class BaseTextViewComponent {
13
27
  private _text?;
14
28
  private _lastSelectedChar?;
29
+ /**
30
+ * The default color for the text.
31
+ */
15
32
  defaultColor: string;
33
+ /**
34
+ * The default border color for the text.
35
+ */
16
36
  defaultBorderColor: string;
37
+ /**
38
+ * The color for the selected text.
39
+ */
17
40
  selectionColor: string;
41
+ /**
42
+ * True if line numbers should be displayed next to each line.
43
+ */
18
44
  hasLineNumber: boolean;
45
+ /**
46
+ * The text to display.
47
+ */
19
48
  get text(): string | CharNode[] | undefined;
20
49
  set text(value: string | CharNode[] | undefined | null);
50
+ /**
51
+ * Emitted when a character is picked.
52
+ */
21
53
  charPick: EventEmitter<BaseTextCharEvent>;
54
+ /**
55
+ * Emitted when a range is picked. This is preceded by a character pick event.
56
+ * The range is defined by the starting character and the number of characters.
57
+ * The range is inclusive.
58
+ */
22
59
  rangePick: EventEmitter<VarBaseTextRange>;
23
60
  lines: BaseTextChar[][];
24
61
  private buildLines;
@@ -1,16 +1,64 @@
1
- /// <reference types="monaco-editor/monaco" />
2
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
3
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
4
3
  import { Clipboard } from '@angular/cdk/clipboard';
4
+ import { DialogService } from '@myrmidon/ng-mat-tools';
5
5
  import { CharChainOperation, Feature, OperationFeature, OperationType, OperationSource, SnapshotBase } from '@myrmidon/gve-snapshot-view';
6
6
  import { SettingsService } from '../../services/settings.service';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
+ * 🔑 `gve-chain-operation-editor`
10
+ *
9
11
  * A component for editing a variant generation operation.
12
+ * Used by the `gve-snapshot-editor` component.
13
+ * - ▶️ `operation` (`CharChainOperation`): the operation to edit.
14
+ * - ▶️ `snapshot` (`SnapshotBase`): the snapshot the operation refers to.
15
+ * - ▶️ `hidePreview` (`boolean`): whether to hide the preview request button.
16
+ * - 🔥 `operationChange` (`CharChainOperation`): emitted when the operation
17
+ * is changed.
18
+ * - 🔥 `operationPreview` (`CharChainOperation`): emitted when the operation
19
+ * preview is requested.
20
+ * - 🔥 `operationCancel` (`void`): emitted when operation editing is cancelled.
21
+ *
22
+ * The editor is composed of many sections:
23
+ * - **general**:
24
+ * - ID: each operation has an ID, automatically assigned. This is not used in
25
+ * the context of the operation or of its transformations, but is provided as a
26
+ * reference.
27
+ * - at and run: coordinates for the selection of the base text targeted by
28
+ * this operation. Check `idx` when `at` is index-based rather than ID-based.
29
+ * - to and to-run: a second coordinate, used by some operations.
30
+ * - value: the text value argument, for those operations requiring it.
31
+ * - rank and group ID.
32
+ * - input and output tags.
33
+ * - features. These are metadata attached to this operation, and can be any
34
+ * type of name=value pairs.
35
+ * - **sources**: sources are a special type of metadata used when your text
36
+ * versions come from more than a single source. In this case, you can specify
37
+ * the source(s) for each operation, just like in a traditional apparatus you
38
+ * specify witnesses for each variant. Each source has an ID, a type, a
39
+ * probability rank (0=not specified, else 1-N), and an optional free text note.
40
+ * - **diplomatic**: SVG `g` code. The diplomatic section is the approximate
41
+ * diplomatic representation of the layout of the annotated text. It essentially
42
+ * consists in a freely editable SVG code, always grouped into a single root `g`
43
+ * element, encoding all the graphical traits representing this operation.
44
+ * The visual part of each operation can be placed everywhere on the snapshot,
45
+ * as specified by its coordinates.
46
+ * - **elements**: features of any of the SVG code elements having an ID.
47
+ * The elements section lists all the SVG elements having an `id` attribute in
48
+ * the SVG code of the diplomatic section. The ID allows you to attach
49
+ * any number of features (metadata modeled as name=value pairs) to each of
50
+ * these elements. Among these features, you may use `style` or `class` for
51
+ * renditional purposes, and any other name for your own metadata. Note that
52
+ * element IDs will be required also when dealing with animations. So, ensure
53
+ * to assign an ID to each element you want to animate.
54
+ * - **dp feats**: diplomatic features: these are features (metadata modeled
55
+ * as name=value pairs) for the diplomatic representation of this operation
56
+ * as a whole.
10
57
  */
11
58
  export declare class ChainOperationEditorComponent implements OnInit, OnDestroy {
12
59
  private _clipboard;
13
60
  private _settings;
61
+ private _dialogService;
14
62
  private readonly _disposables;
15
63
  private _editorModel?;
16
64
  private _editor?;
@@ -34,15 +82,15 @@ export declare class ChainOperationEditorComponent implements OnInit, OnDestroy
34
82
  */
35
83
  hidePreview?: boolean;
36
84
  /**
37
- * Emits when the operation is changed.
85
+ * Emitted when the operation is changed.
38
86
  */
39
87
  readonly operationChange: EventEmitter<CharChainOperation>;
40
88
  /**
41
- * Emits when the operation preview is requested.
89
+ * Emitted when the operation preview is requested.
42
90
  */
43
91
  readonly operationPreview: EventEmitter<CharChainOperation>;
44
92
  /**
45
- * Emits when the operation editing is cancelled.
93
+ * Emitted when operation editing is cancelled.
46
94
  */
47
95
  readonly operationCancel: EventEmitter<void>;
48
96
  tabIndex: number;
@@ -71,7 +119,7 @@ export declare class ChainOperationEditorComponent implements OnInit, OnDestroy
71
119
  elements: SVGElement[];
72
120
  editedElementId?: string;
73
121
  editedSource?: OperationSource;
74
- constructor(formBuilder: FormBuilder, _clipboard: Clipboard, _settings: SettingsService);
122
+ constructor(formBuilder: FormBuilder, _clipboard: Clipboard, _settings: SettingsService, _dialogService: DialogService);
75
123
  ngOnInit(): void;
76
124
  ngOnDestroy(): void;
77
125
  private hasTextChanges;
@@ -6,19 +6,32 @@ import { ChainOperationContextStep, CharChainResult } from '../../services/gve-a
6
6
  import { BaseTextCharEvent } from '../base-text-char/base-text-char.component';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
+ * 🔑 `gve-chain-result-view`
10
+ *
9
11
  * Component to display a chain result.
12
+ * Used by the `gve-snapshot-editor` component.
13
+ *
14
+ * - ▶️ `result` (`CharChainResult`): the result to display.
15
+ * - 🔥 `stepPick` (`ChainOperationContextStep`): emitted when a
16
+ * result's step is picked by the user.
10
17
  */
11
18
  export declare class ChainResultViewComponent implements OnInit, OnDestroy {
12
19
  private _subs?;
13
20
  private _result?;
14
- private _stepPickFrozen?;
21
+ private _initialStepIndex?;
15
22
  /**
16
23
  * The result to display.
17
24
  */
18
25
  get result(): CharChainResult | undefined;
19
26
  set result(value: CharChainResult | undefined | null);
20
27
  /**
21
- * Emits when a result's step is picked.
28
+ * The index of the initial step to display after the result is set.
29
+ * If the index is negative, it is counted from the end of the steps.
30
+ */
31
+ get initialStepIndex(): number | undefined;
32
+ set initialStepIndex(value: number | undefined | null);
33
+ /**
34
+ * Emitted when a result's step is picked by the user.
22
35
  */
23
36
  stepPick: EventEmitter<ChainOperationContextStep>;
24
37
  versionTags: string[];
@@ -30,6 +43,7 @@ export declare class ChainResultViewComponent implements OnInit, OnDestroy {
30
43
  selectionFeatures: OperationFeature[];
31
44
  constructor(formBuilder: FormBuilder);
32
45
  ngOnInit(): void;
46
+ private selectInitialStep;
33
47
  ngOnDestroy(): void;
34
48
  private updateVersionTags;
35
49
  private getTagFromVersion;
@@ -40,5 +54,5 @@ export declare class ChainResultViewComponent implements OnInit, OnDestroy {
40
54
  onStepRangePick(range: VarBaseTextRange): void;
41
55
  onStepChange(step: ChainOperationContextStep): void;
42
56
  static ɵfac: i0.ɵɵFactoryDeclaration<ChainResultViewComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<ChainResultViewComponent, "gve-chain-result-view", never, { "result": { "alias": "result"; "required": false; }; }, { "stepPick": "stepPick"; }, never, never, true, never>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChainResultViewComponent, "gve-chain-result-view", never, { "result": { "alias": "result"; "required": false; }; "initialStepIndex": { "alias": "initialStepIndex"; "required": false; }; }, { "stepPick": "stepPick"; }, never, never, true, never>;
44
58
  }
@@ -5,22 +5,36 @@ import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Features map. This is used for features from closed sets,
7
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.
8
10
  */
9
11
  export interface FeatureMap {
10
12
  [key: string]: LabeledId[];
11
13
  }
12
14
  /**
13
- * Feature editor. This edits a single feature, either free or from
14
- * a closed set. In the latter case you must define the set via
15
- * the `labeledIds` input. Also, you can provide a map of features
16
- * to values via the `map` input. This is useful when you want to
17
- * provide a set of features and values to the user, and you want
18
- * to provide human-readable labels for the values.
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.
19
32
  */
20
33
  export declare class FeatureEditorComponent implements OnInit, OnDestroy {
21
34
  private _sub?;
22
35
  private _feature?;
23
36
  private _map?;
37
+ private _frozen?;
24
38
  nameControl?: ElementRef;
25
39
  /**
26
40
  * The list of feature names to display in the name selection.
@@ -51,7 +65,7 @@ export declare class FeatureEditorComponent implements OnInit, OnDestroy {
51
65
  /**
52
66
  * Event emitted when the user saves the edited feature.
53
67
  */
54
- featureChange: EventEmitter<Feature | OperationFeature>;
68
+ featureChange: EventEmitter<OperationFeature | Feature>;
55
69
  name: FormControl<string>;
56
70
  value: FormControl<string>;
57
71
  setPolicy: FormControl<FeatureSetPolicy>;
@@ -4,12 +4,32 @@ import { LabeledId, Feature, OperationFeature } from '@myrmidon/gve-snapshot-vie
4
4
  import { FeatureMap } from '../feature-editor/feature-editor.component';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
- * Editor for a set of features.
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 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.
8
27
  */
9
28
  export declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
10
29
  private _sub?;
11
30
  private _features;
12
31
  private _editedFeatureIndex;
32
+ POLICIES: string[];
13
33
  /**
14
34
  * True if the features are variable features.
15
35
  */
@@ -26,9 +46,12 @@ export declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
26
46
  */
27
47
  featValues: FeatureMap | undefined;
28
48
  /**
29
- * True to hide the feature filter.
49
+ * The threshold at which the features filter should become visible.
50
+ * If set to 0, the filter is always visible; if set to -1, it is always
51
+ * invisible; otherwise, it gets visible when the number of features
52
+ * is greater than the threshold. Default is 5.
30
53
  */
31
- noFilter: boolean;
54
+ filterThreshold: number;
32
55
  /**
33
56
  * The features to edit.
34
57
  */
@@ -37,7 +60,7 @@ export declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
37
60
  /**
38
61
  * Emitted when the features change.
39
62
  */
40
- featuresChange: EventEmitter<Feature[] | OperationFeature[]>;
63
+ featuresChange: EventEmitter<OperationFeature[] | Feature[]>;
41
64
  editedFeature?: Feature | OperationFeature;
42
65
  filter: FormControl<string | null>;
43
66
  filteredFeatures: Feature[] | OperationFeature[];
@@ -51,5 +74,5 @@ export declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
51
74
  onFeatureChange(feature: Feature | OperationFeature): void;
52
75
  onFeatureCancel(): void;
53
76
  static ɵfac: i0.ɵɵFactoryDeclaration<FeatureSetEditorComponent, never>;
54
- static ɵcmp: i0.ɵɵComponentDeclaration<FeatureSetEditorComponent, "gve-feature-set-editor", never, { "isVar": { "alias": "isVar"; "required": false; }; "featNames": { "alias": "featNames"; "required": false; }; "featValues": { "alias": "featValues"; "required": false; }; "noFilter": { "alias": "noFilter"; "required": false; }; "features": { "alias": "features"; "required": false; }; }, { "featuresChange": "featuresChange"; }, never, never, true, never>;
77
+ static ɵcmp: i0.ɵɵComponentDeclaration<FeatureSetEditorComponent, "gve-feature-set-editor", never, { "isVar": { "alias": "isVar"; "required": false; }; "featNames": { "alias": "featNames"; "required": false; }; "featValues": { "alias": "featValues"; "required": false; }; "filterThreshold": { "alias": "filterThreshold"; "required": false; }; "features": { "alias": "features"; "required": false; }; }, { "featuresChange": "featuresChange"; }, never, never, true, never>;
55
78
  }
@@ -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
  }