@myrmidon/gve-core 3.0.3 → 5.0.1

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 (29) hide show
  1. package/README.md +43 -0
  2. package/fesm2022/myrmidon-gve-core.mjs +697 -548
  3. package/fesm2022/myrmidon-gve-core.mjs.map +1 -1
  4. package/index.d.ts +1541 -3
  5. package/package.json +12 -11
  6. package/lib/components/animation-timeline/animation-timeline.component.d.ts +0 -61
  7. package/lib/components/animation-timeline-set/animation-timeline-set.component.d.ts +0 -52
  8. package/lib/components/animation-tween/animation-tween.component.d.ts +0 -58
  9. package/lib/components/base-text-char/base-text-char.component.d.ts +0 -42
  10. package/lib/components/base-text-editor/base-text-editor.component.d.ts +0 -42
  11. package/lib/components/base-text-view/base-text-view.component.d.ts +0 -69
  12. package/lib/components/batch-operation-editor/batch-operation-editor.component.d.ts +0 -44
  13. package/lib/components/chain-operation-editor/chain-operation-editor.component.d.ts +0 -149
  14. package/lib/components/chain-result-view/chain-result-view.component.d.ts +0 -58
  15. package/lib/components/chain-view/chain-view.component.d.ts +0 -42
  16. package/lib/components/feature-editor/feature-editor.component.d.ts +0 -82
  17. package/lib/components/feature-set-editor/feature-set-editor.component.d.ts +0 -76
  18. package/lib/components/feature-set-view/feature-set-view.component.d.ts +0 -54
  19. package/lib/components/ln-heights-editor/ln-heights-editor.component.d.ts +0 -41
  20. package/lib/components/operation-source-editor/operation-source-editor.component.d.ts +0 -52
  21. package/lib/components/snapshot-editor/snapshot-editor.component.d.ts +0 -293
  22. package/lib/components/snapshot-text-editor/snapshot-text-editor.component.d.ts +0 -37
  23. package/lib/components/steps-map/steps-map.component.d.ts +0 -48
  24. package/lib/models.d.ts +0 -15
  25. package/lib/services/gve-api.service.d.ts +0 -148
  26. package/lib/services/gve-graphviz.service.d.ts +0 -20
  27. package/lib/services/settings.service.d.ts +0 -89
  28. package/lib/validators/svg-validators.d.ts +0 -10
  29. package/public-api.d.ts +0 -21
package/README.md CHANGED
@@ -61,9 +61,52 @@ The snapshot editor is the top-level component in the library and orchestrates t
61
61
  - ▶️ `snapshot` (`Snapshot`): the snapshot to edit.
62
62
  - ▶️ `batchOps` (`string`): the batch operations text to set for the editor.
63
63
  - ▶️ `noSave` (`boolean`): true to disable saving.
64
+ - ▶️ `featureDefs` (`FeatureDefinitions`): preset feature definitions, if any.
65
+ - ▶️ `elementFeatureDefs` (`FeatureDefinitions`): preset feature definitions for graphical elements, if any.
66
+ - ▶️ `diplomaticFeatureDefs` (`FeatureDefinitions`): preset diplomatic feature definitions, if any.
64
67
  - 🔥 `snapshotChange` (`Snapshot`): emitted when the user saves the edited snapshot.
65
68
  - 🔥 `snapshotCancel` (`void`): emitted when the user cancels the snapshot editing.
66
69
 
70
+ As for **feature definitions**, the `FeatureDefinitions` interface can be provided with this model:
71
+
72
+ - `names` (`LabeledId[]`): list of features, each having an ID and a label:
73
+ - `id` (string)
74
+ - `label` (string)
75
+ - `values` (`FeatureMap`, a dictionary of `LabeledId[]` keyed by feature name): used for features from closed sets, it lists the possible values for each feature name. In this dictionary, the key is the feature name, and the value is an array of labeled IDs representing the allowed values for that feature.
76
+
77
+ 💡 Example: in this example we have 2 features, _color_ (ID=`clr`) and _size_ (ID=`sz`). The _size_ feature has unconstrained values, while the _color_ feature is limited to _red_ (ID=`r`), _green_ (ID=`g`), and _blue_ (ID=`b`):
78
+
79
+ ```ts
80
+ {
81
+ names: [
82
+ {
83
+ id: 'clr',
84
+ label: 'color',
85
+ },
86
+ {
87
+ id: 'sz',
88
+ label: 'size',
89
+ },
90
+ ],
91
+ values: {
92
+ clr: [
93
+ {
94
+ id: 'r',
95
+ label: 'red',
96
+ },
97
+ {
98
+ id: 'g',
99
+ label: 'green',
100
+ },
101
+ {
102
+ id: 'b',
103
+ label: 'blue',
104
+ },
105
+ ],
106
+ }
107
+ }
108
+ ```
109
+
67
110
  The only data directly handled by the component are:
68
111
 
69
112
  - size and style;