@myrmidon/gve-core 7.0.8 → 7.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/gve-core",
3
- "version": "7.0.8",
3
+ "version": "7.0.10",
4
4
  "description": "Cadmus - GVE Angular frontend core components.",
5
5
  "keywords": [
6
6
  "GVE"
@@ -6,7 +6,6 @@ import { DialogService } from '@myrmidon/ngx-mat-tools';
6
6
  import { HttpClient } from '@angular/common/http';
7
7
  import { Observable } from 'rxjs';
8
8
  import { ErrorService, EnvService } from '@myrmidon/ngx-tools';
9
- import { Clipboard } from '@angular/cdk/clipboard';
10
9
  import { MatSnackBar } from '@angular/material/snack-bar';
11
10
  import { GveSnapshotRendition, GveRenditionSettings } from '@myrmidon/gve-snapshot-rendition';
12
11
 
@@ -607,94 +606,6 @@ declare class BatchOperationEditorComponent implements OnInit {
607
606
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<BatchOperationEditorComponent, "gve-batch-operation-editor", never, { "preset": { "alias": "preset"; "required": false; "isSignal": true; }; }, { "operationsChange": "operationsChange"; }, never, never, true, never>;
608
607
  }
609
608
 
610
- /**
611
- * Service to store and retrieve dynamic settings.
612
- */
613
- declare class SettingsService {
614
- private readonly _cache;
615
- private readonly _subject;
616
- /**
617
- * Observable emitting the key of the setting that has changed.
618
- */
619
- get settingChange$(): Observable<string | null>;
620
- /**
621
- * Prefix to scope the keys. This prefix is used internally to scope the keys
622
- * so that they cannot conflict with other keys in the local storage.
623
- * The prefix is totally transparent to the user of the service, who should
624
- * use the keys without the prefix.
625
- */
626
- keyPrefix?: string;
627
- /**
628
- * True to persist the settings in the local storage by default.
629
- */
630
- persistDefault: boolean;
631
- /**
632
- * Scopes the key by prefixing it with the keyPrefix if any.
633
- *
634
- * @param key The key to scope.
635
- * @returns The scoped key.
636
- */
637
- private getScopedKey;
638
- private isPersist;
639
- /**
640
- * Sets a setting's value.
641
- *
642
- * @param key The key.
643
- * @param value The value.
644
- * @param persist True to persist this setting in local storage.
645
- */
646
- set(key: string, value: any, persist?: boolean): void;
647
- /**
648
- * Set multiple settings at once from the specified settings object.
649
- *
650
- * @param settings The settings to set.
651
- * @param persist True to persist these settings in local storage.
652
- */
653
- setFrom(settings: {
654
- [key: string]: any;
655
- } | undefined | null, persist?: boolean): void;
656
- /**
657
- * Get a setting's value of type T.
658
- *
659
- * @param key The key.
660
- * @param defaultValue The default value to get when the setting
661
- * is not found in the store.
662
- * @returns The value.
663
- */
664
- get<T>(key: string, defaultValue?: any, persist?: boolean): T;
665
- /**
666
- * Check if a key exists in the store.
667
- *
668
- * @param key The key.
669
- * @param persist True to check if the key exists in local storage.
670
- * @returns True if the key exists in the store.
671
- */
672
- contains(key: string, persist?: boolean): boolean;
673
- /**
674
- * Get all the keys of the settings in the store.
675
- *
676
- * @param persist True to include keys from local storage.
677
- * @returns The keys of the settings in the store.
678
- */
679
- getKeys(persist?: boolean): string[];
680
- /**
681
- * Remove a setting if present.
682
- *
683
- * @param key The key.
684
- * @param persist True to remove the setting from local storage.
685
- */
686
- remove(key: string, persist?: boolean): void;
687
- /**
688
- * Clear all settings. Warning: this will remove all settings from the
689
- * local storage if no key prefix is set.
690
- *
691
- * @param persist True to remove all settings from local storage.
692
- */
693
- clear(persist?: boolean): void;
694
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SettingsService, never>;
695
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<SettingsService>;
696
- }
697
-
698
609
  /**
699
610
  * Features map. This is used for features from closed sets,
700
611
  * and lists the possible values for each feature.
@@ -704,6 +615,20 @@ declare class SettingsService {
704
615
  interface FeatureMap {
705
616
  [key: string]: LabeledId[];
706
617
  }
618
+ /**
619
+ * Feature properties map. This is used to preset properties like set policy,
620
+ * negation, global, and short-lived for specific features without hardcoding
621
+ * that logic in the component. The key is the feature name's ID, and the
622
+ * value is an object containing the properties to preset for that feature.
623
+ */
624
+ interface FeaturePropMap {
625
+ [key: string]: {
626
+ setPolicy: FeatureSetPolicy;
627
+ isNegated?: boolean;
628
+ isGlobal?: boolean;
629
+ isShortLived?: boolean;
630
+ };
631
+ }
707
632
  /**
708
633
  * 🔑 `gve-feature-editor`
709
634
  *
@@ -742,6 +667,14 @@ declare class FeatureEditorComponent implements OnInit, OnDestroy {
742
667
  * to populate the value selection.
743
668
  */
744
669
  readonly featValues: _angular_core.InputSignal<FeatureMap | undefined>;
670
+ /**
671
+ * The feature properties map. When specified and the user selects a
672
+ * feature name present in the map keys, the corresponding properties
673
+ * will be used to populate the form controls for set policy, negation,
674
+ * global, and short-lived. This allows presetting these properties
675
+ * for specific features without hardcoding that logic in the component.
676
+ */
677
+ readonly featProps: _angular_core.InputSignal<FeaturePropMap | undefined>;
745
678
  /**
746
679
  * The feature to edit.
747
680
  */
@@ -796,7 +729,7 @@ declare class FeatureEditorComponent implements OnInit, OnDestroy {
796
729
  cancel(): void;
797
730
  save(): void;
798
731
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<FeatureEditorComponent, never>;
799
- static ɵcmp: _angular_core.ɵɵ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; }; "multiValuedFeatureIds": { "alias": "multiValuedFeatureIds"; "required": false; "isSignal": true; }; }, { "feature": "featureChange"; "featureCancel": "featureCancel"; }, never, never, true, never>;
732
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FeatureEditorComponent, "gve-feature-editor", never, { "featNames": { "alias": "featNames"; "required": false; "isSignal": true; }; "featValues": { "alias": "featValues"; "required": false; "isSignal": true; }; "featProps": { "alias": "featProps"; "required": false; "isSignal": true; }; "feature": { "alias": "feature"; "required": false; "isSignal": true; }; "isVar": { "alias": "isVar"; "required": false; "isSignal": true; }; "multiValuedFeatureIds": { "alias": "multiValuedFeatureIds"; "required": false; "isSignal": true; }; }, { "feature": "featureChange"; "featureCancel": "featureCancel"; }, never, never, true, never>;
800
733
  }
801
734
 
802
735
  /**
@@ -814,6 +747,14 @@ interface FeatureDefinitions {
814
747
  * to populate the value selection.
815
748
  */
816
749
  values?: FeatureMap;
750
+ /**
751
+ * The feature properties map. When specified and the user selects a
752
+ * feature name present in the map keys, the corresponding properties
753
+ * will be used to populate the form controls for set policy, negation,
754
+ * global, and short-lived. This allows presetting these properties
755
+ * for specific features without hardcoding that logic in the component.
756
+ */
757
+ props?: FeaturePropMap;
817
758
  }
818
759
  /**
819
760
  * 🔑 `gve-chain-operation-editor`
@@ -826,7 +767,7 @@ interface FeatureDefinitions {
826
767
  * - ▶️ `sourceIds` (`LabeledId[]`): the list of source IDs, when using a closed list.
827
768
  * - ▶️ `sourceTypes` (`LabeledId[]`): the list of source types, when using a closed list.
828
769
  * - ▶️ `featureDefs` (`FeatureDefinitions`): definitions for features, including
829
- * names and values.
770
+ * names, values, and properties.
830
771
  * - ▶️ `rangePatch` (`BaseTextRange`): when set, the edited operation's text
831
772
  * range (at and run) will be patched with the provided one.
832
773
  * - 🔥 `operationChange` (`CharChainOperation`): emitted when the operation
@@ -872,9 +813,6 @@ interface FeatureDefinitions {
872
813
  * as a whole.
873
814
  */
874
815
  declare class ChainOperationEditorComponent implements OnInit, OnDestroy {
875
- private _clipboard;
876
- private _settings;
877
- private _dialogService;
878
816
  private readonly _subs;
879
817
  private readonly _nanoid;
880
818
  /**
@@ -890,7 +828,7 @@ declare class ChainOperationEditorComponent implements OnInit, OnDestroy {
890
828
  */
891
829
  readonly hidePreview: _angular_core.InputSignal<boolean | undefined>;
892
830
  /**
893
- * Definitions for features, including names and values.
831
+ * Definitions for features, including names, values, and properties.
894
832
  */
895
833
  readonly featureDefs: _angular_core.InputSignal<FeatureDefinitions | undefined>;
896
834
  /**
@@ -911,10 +849,6 @@ declare class ChainOperationEditorComponent implements OnInit, OnDestroy {
911
849
  * The list of source types when it's a closed set.
912
850
  */
913
851
  readonly sourceTypes: _angular_core.InputSignal<LabeledId[] | undefined>;
914
- /**
915
- * Emitted when the operation is changed.
916
- */
917
- readonly operationChange: _angular_core.OutputEmitterRef<CharChainOperation>;
918
852
  /**
919
853
  * Emitted when the operation preview is requested.
920
854
  */
@@ -951,7 +885,7 @@ declare class ChainOperationEditorComponent implements OnInit, OnDestroy {
951
885
  newTextHidden: FormControl<boolean>;
952
886
  dpFeatures: FormControl<Feature[]>;
953
887
  form: FormGroup;
954
- constructor(formBuilder: FormBuilder, _clipboard: Clipboard, _settings: SettingsService, _dialogService: DialogService);
888
+ constructor(formBuilder: FormBuilder);
955
889
  ngOnInit(): void;
956
890
  ngOnDestroy(): void;
957
891
  private toggleLfEscape;
@@ -965,10 +899,11 @@ declare class ChainOperationEditorComponent implements OnInit, OnDestroy {
965
899
  private updateForm;
966
900
  cancel(): void;
967
901
  private getOperation;
902
+ deleteSource(index: number): void;
968
903
  requestPreview(): void;
969
904
  save(): void;
970
905
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChainOperationEditorComponent, never>;
971
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChainOperationEditorComponent, "gve-chain-operation-editor", never, { "operation": { "alias": "operation"; "required": false; "isSignal": true; }; "snapshot": { "alias": "snapshot"; "required": false; "isSignal": true; }; "hidePreview": { "alias": "hidePreview"; "required": false; "isSignal": true; }; "featureDefs": { "alias": "featureDefs"; "required": false; "isSignal": true; }; "rangePatch": { "alias": "rangePatch"; "required": false; "isSignal": true; }; "multiValuedFeatureIds": { "alias": "multiValuedFeatureIds"; "required": false; "isSignal": true; }; "sourceIds": { "alias": "sourceIds"; "required": false; "isSignal": true; }; "sourceTypes": { "alias": "sourceTypes"; "required": false; "isSignal": true; }; }, { "operation": "operationChange"; "operationChange": "operationChange"; "operationPreview": "operationPreview"; "operationCancel": "operationCancel"; }, never, never, true, never>;
906
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChainOperationEditorComponent, "gve-chain-operation-editor", never, { "operation": { "alias": "operation"; "required": false; "isSignal": true; }; "snapshot": { "alias": "snapshot"; "required": false; "isSignal": true; }; "hidePreview": { "alias": "hidePreview"; "required": false; "isSignal": true; }; "featureDefs": { "alias": "featureDefs"; "required": false; "isSignal": true; }; "rangePatch": { "alias": "rangePatch"; "required": false; "isSignal": true; }; "multiValuedFeatureIds": { "alias": "multiValuedFeatureIds"; "required": false; "isSignal": true; }; "sourceIds": { "alias": "sourceIds"; "required": false; "isSignal": true; }; "sourceTypes": { "alias": "sourceTypes"; "required": false; "isSignal": true; }; }, { "operation": "operationChange"; "operationPreview": "operationPreview"; "operationCancel": "operationCancel"; }, never, never, true, never>;
972
907
  }
973
908
 
974
909
  /**
@@ -1096,6 +1031,14 @@ declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
1096
1031
  * to populate the value selection.
1097
1032
  */
1098
1033
  readonly featValues: _angular_core.InputSignal<FeatureMap | undefined>;
1034
+ /**
1035
+ * The feature properties map. When specified and the user selects a
1036
+ * feature name present in the map keys, the corresponding properties
1037
+ * will be used to populate the form controls for set policy, negation,
1038
+ * global, and short-lived. This allows presetting these properties
1039
+ * for specific features without hardcoding that logic in the component.
1040
+ */
1041
+ readonly featProps: _angular_core.InputSignal<FeaturePropMap | undefined>;
1099
1042
  /**
1100
1043
  * The threshold at which the features filter should become visible.
1101
1044
  * If set to 0, the filter is always visible; if set to -1, it is always
@@ -1142,7 +1085,7 @@ declare class FeatureSetEditorComponent implements OnInit, OnDestroy {
1142
1085
  onFeatureCancel(): void;
1143
1086
  onOk(): void;
1144
1087
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<FeatureSetEditorComponent, never>;
1145
- static ɵcmp: _angular_core.ɵɵ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; }; "multiValuedFeatureIds": { "alias": "multiValuedFeatureIds"; "required": false; "isSignal": true; }; "batchMode": { "alias": "batchMode"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; }, { "close": "close"; "features": "featuresChange"; }, never, never, true, never>;
1088
+ static ɵcmp: _angular_core.ɵɵ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; }; "featProps": { "alias": "featProps"; "required": false; "isSignal": true; }; "filterThreshold": { "alias": "filterThreshold"; "required": false; "isSignal": true; }; "multiValuedFeatureIds": { "alias": "multiValuedFeatureIds"; "required": false; "isSignal": true; }; "batchMode": { "alias": "batchMode"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; }, { "close": "close"; "features": "featuresChange"; }, never, never, true, never>;
1146
1089
  }
1147
1090
 
1148
1091
  /**
@@ -1687,5 +1630,93 @@ declare class GveGraphvizService {
1687
1630
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<GveGraphvizService>;
1688
1631
  }
1689
1632
 
1633
+ /**
1634
+ * Service to store and retrieve dynamic settings.
1635
+ */
1636
+ declare class SettingsService {
1637
+ private readonly _cache;
1638
+ private readonly _subject;
1639
+ /**
1640
+ * Observable emitting the key of the setting that has changed.
1641
+ */
1642
+ get settingChange$(): Observable<string | null>;
1643
+ /**
1644
+ * Prefix to scope the keys. This prefix is used internally to scope the keys
1645
+ * so that they cannot conflict with other keys in the local storage.
1646
+ * The prefix is totally transparent to the user of the service, who should
1647
+ * use the keys without the prefix.
1648
+ */
1649
+ keyPrefix?: string;
1650
+ /**
1651
+ * True to persist the settings in the local storage by default.
1652
+ */
1653
+ persistDefault: boolean;
1654
+ /**
1655
+ * Scopes the key by prefixing it with the keyPrefix if any.
1656
+ *
1657
+ * @param key The key to scope.
1658
+ * @returns The scoped key.
1659
+ */
1660
+ private getScopedKey;
1661
+ private isPersist;
1662
+ /**
1663
+ * Sets a setting's value.
1664
+ *
1665
+ * @param key The key.
1666
+ * @param value The value.
1667
+ * @param persist True to persist this setting in local storage.
1668
+ */
1669
+ set(key: string, value: any, persist?: boolean): void;
1670
+ /**
1671
+ * Set multiple settings at once from the specified settings object.
1672
+ *
1673
+ * @param settings The settings to set.
1674
+ * @param persist True to persist these settings in local storage.
1675
+ */
1676
+ setFrom(settings: {
1677
+ [key: string]: any;
1678
+ } | undefined | null, persist?: boolean): void;
1679
+ /**
1680
+ * Get a setting's value of type T.
1681
+ *
1682
+ * @param key The key.
1683
+ * @param defaultValue The default value to get when the setting
1684
+ * is not found in the store.
1685
+ * @returns The value.
1686
+ */
1687
+ get<T>(key: string, defaultValue?: any, persist?: boolean): T;
1688
+ /**
1689
+ * Check if a key exists in the store.
1690
+ *
1691
+ * @param key The key.
1692
+ * @param persist True to check if the key exists in local storage.
1693
+ * @returns True if the key exists in the store.
1694
+ */
1695
+ contains(key: string, persist?: boolean): boolean;
1696
+ /**
1697
+ * Get all the keys of the settings in the store.
1698
+ *
1699
+ * @param persist True to include keys from local storage.
1700
+ * @returns The keys of the settings in the store.
1701
+ */
1702
+ getKeys(persist?: boolean): string[];
1703
+ /**
1704
+ * Remove a setting if present.
1705
+ *
1706
+ * @param key The key.
1707
+ * @param persist True to remove the setting from local storage.
1708
+ */
1709
+ remove(key: string, persist?: boolean): void;
1710
+ /**
1711
+ * Clear all settings. Warning: this will remove all settings from the
1712
+ * local storage if no key prefix is set.
1713
+ *
1714
+ * @param persist True to remove all settings from local storage.
1715
+ */
1716
+ clear(persist?: boolean): void;
1717
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SettingsService, never>;
1718
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<SettingsService>;
1719
+ }
1720
+
1690
1721
  export { BaseTextCharComponent, BaseTextEditorComponent, BaseTextViewComponent, BatchOperationEditorComponent, ChainOperationEditorComponent, ChainResultViewComponent, FeatureEditorComponent, FeatureSetEditorComponent, FeatureSetPolicy, FeatureSetViewComponent, GveApiService, GveBaseTextService, GveGraphvizService, OperationSourceEditorComponent, OperationType, SettingsService, SnapshotEditorComponent, SnapshotTextEditorComponent, StepsMapComponent };
1691
- export type { BaseTextChar, BaseTextCharEvent, BaseTextRange, ChainOperationContextStep, ChainOperationTags, CharChain, CharChainLink, CharChainNode, CharChainOperation, CharChainResult, CharNode, Feature, FeatureDefinitions, FeatureMap, GraphvizRankdir, LabeledId, OperationFeature, OperationMetadata, OperationSource, PayloadMatDialogConfig, ResultWrapper, Snapshot, TreeNode };
1722
+ export type { BaseTextChar, BaseTextCharEvent, BaseTextRange, ChainOperationContextStep, ChainOperationTags, CharChain, CharChainLink, CharChainNode, CharChainOperation, CharChainResult, CharNode, Feature, FeatureDefinitions, FeatureMap, FeaturePropMap, GraphvizRankdir, LabeledId, OperationFeature, OperationMetadata, OperationSource, PayloadMatDialogConfig, ResultWrapper, Snapshot, TreeNode };