@aleph-alpha/settings-kit 0.1.0 → 1.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 (172) hide show
  1. package/README.md +465 -15
  2. package/dist/SkLayout.vue_vue_type_script_setup_true_lang-ZjV2AMdR.js +51 -0
  3. package/dist/SkLayoutPage-DGbCpQFm.js +2545 -0
  4. package/dist/UseFileConvertor-DN6cCXNi.js +50 -0
  5. package/dist/components/SkField/SkField.vue.d.ts +28 -0
  6. package/dist/components/SkField/SkField.vue.d.ts.map +1 -0
  7. package/dist/components/SkField/index.d.ts +2 -0
  8. package/dist/components/SkField/index.d.ts.map +1 -0
  9. package/dist/components/SkGroup/SkGroup.vue.d.ts +29 -0
  10. package/dist/components/SkGroup/SkGroup.vue.d.ts.map +1 -0
  11. package/dist/components/SkGroup/index.d.ts +2 -0
  12. package/dist/components/SkGroup/index.d.ts.map +1 -0
  13. package/dist/components/SkItem/SkItem.vue.d.ts +22 -0
  14. package/dist/components/SkItem/SkItem.vue.d.ts.map +1 -0
  15. package/dist/components/SkItem/index.d.ts +2 -0
  16. package/dist/components/SkItem/index.d.ts.map +1 -0
  17. package/dist/components/SkLayout/SkLayout.vue.d.ts +53 -0
  18. package/dist/components/SkLayout/SkLayout.vue.d.ts.map +1 -0
  19. package/dist/components/SkLayout/SkLayoutPage.d.ts +23 -0
  20. package/dist/components/SkLayout/SkLayoutPage.d.ts.map +1 -0
  21. package/dist/components/SkLayout/context.d.ts +61 -0
  22. package/dist/components/SkLayout/context.d.ts.map +1 -0
  23. package/dist/components/SkLayout/index.d.ts +5 -0
  24. package/dist/components/SkLayout/index.d.ts.map +1 -0
  25. package/dist/components/SkPage/SkPage.vue.d.ts +35 -0
  26. package/dist/components/SkPage/SkPage.vue.d.ts.map +1 -0
  27. package/dist/components/SkPage/index.d.ts +2 -0
  28. package/dist/components/SkPage/index.d.ts.map +1 -0
  29. package/dist/components/SkSection/SkSection.vue.d.ts +29 -0
  30. package/dist/components/SkSection/SkSection.vue.d.ts.map +1 -0
  31. package/dist/components/SkSection/index.d.ts +2 -0
  32. package/dist/components/SkSection/index.d.ts.map +1 -0
  33. package/dist/components/controls/SkActionsControl/SkActionsControl.vue.d.ts +37 -0
  34. package/dist/components/controls/SkActionsControl/SkActionsControl.vue.d.ts.map +1 -0
  35. package/dist/components/controls/SkActionsControl/index.d.ts +2 -0
  36. package/dist/components/controls/SkActionsControl/index.d.ts.map +1 -0
  37. package/dist/components/controls/SkCheckboxControl/SkCheckboxControl.vue.d.ts +35 -0
  38. package/dist/components/controls/SkCheckboxControl/SkCheckboxControl.vue.d.ts.map +1 -0
  39. package/dist/components/controls/SkCheckboxControl/index.d.ts +2 -0
  40. package/dist/components/controls/SkCheckboxControl/index.d.ts.map +1 -0
  41. package/dist/components/controls/SkColorControl/SkColorControl.vue.d.ts +35 -0
  42. package/dist/components/controls/SkColorControl/SkColorControl.vue.d.ts.map +1 -0
  43. package/dist/components/controls/SkColorControl/index.d.ts +2 -0
  44. package/dist/components/controls/SkColorControl/index.d.ts.map +1 -0
  45. package/dist/components/controls/SkFileUpload/SkFilePlaceholder.vue.d.ts +11 -0
  46. package/dist/components/controls/SkFileUpload/SkFilePlaceholder.vue.d.ts.map +1 -0
  47. package/dist/components/controls/SkFileUpload/SkFileUpload.vue.d.ts +46 -0
  48. package/dist/components/controls/SkFileUpload/SkFileUpload.vue.d.ts.map +1 -0
  49. package/dist/components/controls/SkFileUpload/index.d.ts +2 -0
  50. package/dist/components/controls/SkFileUpload/index.d.ts.map +1 -0
  51. package/dist/components/controls/SkPeriodControl/SkPeriodControl.vue.d.ts +35 -0
  52. package/dist/components/controls/SkPeriodControl/SkPeriodControl.vue.d.ts.map +1 -0
  53. package/dist/components/controls/SkPeriodControl/index.d.ts +2 -0
  54. package/dist/components/controls/SkPeriodControl/index.d.ts.map +1 -0
  55. package/dist/components/controls/SkSelectControl/SkSelectControl.vue.d.ts +40 -0
  56. package/dist/components/controls/SkSelectControl/SkSelectControl.vue.d.ts.map +1 -0
  57. package/dist/components/controls/SkSelectControl/index.d.ts +2 -0
  58. package/dist/components/controls/SkSelectControl/index.d.ts.map +1 -0
  59. package/dist/components/controls/SkTelControl/SKTelPrefixControl.vue.d.ts +16 -0
  60. package/dist/components/controls/SkTelControl/SKTelPrefixControl.vue.d.ts.map +1 -0
  61. package/dist/components/controls/SkTelControl/SkTelControl.vue.d.ts +35 -0
  62. package/dist/components/controls/SkTelControl/SkTelControl.vue.d.ts.map +1 -0
  63. package/dist/components/controls/SkTelControl/index.d.ts +4 -0
  64. package/dist/components/controls/SkTelControl/index.d.ts.map +1 -0
  65. package/dist/components/controls/SkTelControl/prefixes.d.ts +26 -0
  66. package/dist/components/controls/SkTelControl/prefixes.d.ts.map +1 -0
  67. package/dist/components/controls/SkTextControl/SkTextControl.vue.d.ts +45 -0
  68. package/dist/components/controls/SkTextControl/SkTextControl.vue.d.ts.map +1 -0
  69. package/dist/components/controls/SkTextControl/index.d.ts +2 -0
  70. package/dist/components/controls/SkTextControl/index.d.ts.map +1 -0
  71. package/dist/components/controls/SkUnsupportedControl/SkUnsupportedControl.vue.d.ts +8 -0
  72. package/dist/components/controls/SkUnsupportedControl/SkUnsupportedControl.vue.d.ts.map +1 -0
  73. package/dist/components/controls/storyEventLog.d.ts +33 -0
  74. package/dist/components/controls/storyEventLog.d.ts.map +1 -0
  75. package/dist/components/index.d.ts +7 -2
  76. package/dist/components/index.d.ts.map +1 -1
  77. package/dist/components/index.js +12 -2
  78. package/dist/composables/UseFileConvertor/UseFileConvertor.d.ts +7 -0
  79. package/dist/composables/UseFileConvertor/UseFileConvertor.d.ts.map +1 -0
  80. package/dist/composables/index.d.ts +14 -0
  81. package/dist/composables/index.d.ts.map +1 -0
  82. package/dist/composables/useFieldInheritance/useFieldInheritance.d.ts +24 -0
  83. package/dist/composables/useFieldInheritance/useFieldInheritance.d.ts.map +1 -0
  84. package/dist/composables/useFieldValidator/useFieldValidator.d.ts +50 -0
  85. package/dist/composables/useFieldValidator/useFieldValidator.d.ts.map +1 -0
  86. package/dist/composables/useSettingField/useSettingField.d.ts +24 -0
  87. package/dist/composables/useSettingField/useSettingField.d.ts.map +1 -0
  88. package/dist/composables/useSettingsForm/useSettingsForm.d.ts +12 -0
  89. package/dist/composables/useSettingsForm/useSettingsForm.d.ts.map +1 -0
  90. package/dist/composables/useSettingsLayout/useSettingsLayout.d.ts +71 -0
  91. package/dist/composables/useSettingsLayout/useSettingsLayout.d.ts.map +1 -0
  92. package/dist/composables/useSettingsLocale/useSettingsLocale.d.ts +38 -0
  93. package/dist/composables/useSettingsLocale/useSettingsLocale.d.ts.map +1 -0
  94. package/dist/composables/useStateManager/useStateManager.d.ts +10 -0
  95. package/dist/composables/useStateManager/useStateManager.d.ts.map +1 -0
  96. package/dist/core/controls/controlDefinitions.d.ts +33 -0
  97. package/dist/core/controls/controlDefinitions.d.ts.map +1 -0
  98. package/dist/core/controls/index.d.ts +26 -0
  99. package/dist/core/controls/index.d.ts.map +1 -0
  100. package/dist/core/index.d.ts +18 -0
  101. package/dist/core/index.d.ts.map +1 -0
  102. package/dist/core/layout/index.d.ts +8 -0
  103. package/dist/core/layout/index.d.ts.map +1 -0
  104. package/dist/core/layout/navigation.d.ts +33 -0
  105. package/dist/core/layout/navigation.d.ts.map +1 -0
  106. package/dist/core/layout/resolve.d.ts +41 -0
  107. package/dist/core/layout/resolve.d.ts.map +1 -0
  108. package/dist/core/layout/types.d.ts +160 -0
  109. package/dist/core/layout/types.d.ts.map +1 -0
  110. package/dist/core/layout/validate.d.ts +26 -0
  111. package/dist/core/layout/validate.d.ts.map +1 -0
  112. package/dist/core/types.d.ts +541 -0
  113. package/dist/core/types.d.ts.map +1 -0
  114. package/dist/core/useControlModel.d.ts +13 -0
  115. package/dist/core/useControlModel.d.ts.map +1 -0
  116. package/dist/core/utils/a11y.d.ts +25 -0
  117. package/dist/core/utils/a11y.d.ts.map +1 -0
  118. package/dist/core/utils/cast.d.ts +8 -0
  119. package/dist/core/utils/cast.d.ts.map +1 -0
  120. package/dist/core/utils/consts.d.ts +978 -0
  121. package/dist/core/utils/consts.d.ts.map +1 -0
  122. package/dist/core/utils/kitMessages.d.ts +165 -0
  123. package/dist/core/utils/kitMessages.d.ts.map +1 -0
  124. package/dist/core/utils/localizedText.d.ts +10 -0
  125. package/dist/core/utils/localizedText.d.ts.map +1 -0
  126. package/dist/core/utils/useName.d.ts +7 -0
  127. package/dist/core/utils/useName.d.ts.map +1 -0
  128. package/dist/core/validate/constraints.d.ts +20 -0
  129. package/dist/core/validate/constraints.d.ts.map +1 -0
  130. package/dist/core/validate/rules.d.ts +29 -0
  131. package/dist/core/validate/rules.d.ts.map +1 -0
  132. package/dist/index-BQ6z6MK4.js +214 -0
  133. package/dist/index-BXs-0JdT.js +168 -0
  134. package/dist/index-BynIH0EE.js +92 -0
  135. package/dist/index-C-WLhRod.js +100 -0
  136. package/dist/index-CFMv8jSO.js +4 -0
  137. package/dist/index-CGYERet5.js +373 -0
  138. package/dist/index-KAbhkO1J.js +81 -0
  139. package/dist/index.d.ts +8 -2
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +48 -3
  142. package/dist/service/index.d.ts +2 -0
  143. package/dist/service/index.d.ts.map +1 -0
  144. package/dist/shell/SkShell.vue.d.ts +80 -0
  145. package/dist/shell/SkShell.vue.d.ts.map +1 -0
  146. package/dist/shell/SkShellFrame.vue.d.ts +46 -0
  147. package/dist/shell/SkShellFrame.vue.d.ts.map +1 -0
  148. package/dist/shell/SkShellNav.vue.d.ts +19 -0
  149. package/dist/shell/SkShellNav.vue.d.ts.map +1 -0
  150. package/dist/shell/history.d.ts +9 -0
  151. package/dist/shell/history.d.ts.map +1 -0
  152. package/dist/shell/index.d.ts +12 -0
  153. package/dist/shell/index.d.ts.map +1 -0
  154. package/dist/shell/index.js +848 -0
  155. package/dist/shell/labels.d.ts +25 -0
  156. package/dist/shell/labels.d.ts.map +1 -0
  157. package/dist/shell/location.d.ts +18 -0
  158. package/dist/shell/location.d.ts.map +1 -0
  159. package/dist/shell/routes.d.ts +19 -0
  160. package/dist/shell/routes.d.ts.map +1 -0
  161. package/dist/shell/useMediaQuery.d.ts +4 -0
  162. package/dist/shell/useMediaQuery.d.ts.map +1 -0
  163. package/dist/shell/useShellLocation.d.ts +37 -0
  164. package/dist/shell/useShellLocation.d.ts.map +1 -0
  165. package/package.json +42 -23
  166. package/dist/SettingToggleUnit.vue_vue_type_script_setup_true_lang-BM7-6aXj.js +0 -61
  167. package/dist/components/SettingToggleUnit/SettingToggleUnit.vue.d.ts +0 -16
  168. package/dist/components/SettingToggleUnit/SettingToggleUnit.vue.d.ts.map +0 -1
  169. package/dist/components/SettingToggleUnit/index.d.ts +0 -3
  170. package/dist/components/SettingToggleUnit/index.d.ts.map +0 -1
  171. package/dist/components/SettingToggleUnit/types.d.ts +0 -11
  172. package/dist/components/SettingToggleUnit/types.d.ts.map +0 -1
@@ -0,0 +1,71 @@
1
+ import type { ComputedRef, MaybeRefOrGetter } from 'vue';
2
+ import { type LayoutIssue, type LayoutNavigationNode, type ResolvedLayout, type ResolvedPage, type SettingsLayout } from '../../core/layout';
3
+ import type { SettingField, StandardSchemaV1, StateManager } from '../../core/types';
4
+ import type { UseFieldValidatorReturn } from '../useFieldValidator/useFieldValidator';
5
+ import type { SettingsLocale } from '../useSettingsLocale/useSettingsLocale';
6
+ /** Options for `useSettingsLayout`. */
7
+ export interface UseSettingsLayoutOptions {
8
+ /** Where each setting renders. */
9
+ layout: MaybeRefOrGetter<SettingsLayout>;
10
+ /**
11
+ * The state manager to read fields and values from and to stage edits in.
12
+ * Omitted, the nearest `useSettingsForm` session is used; without one, a
13
+ * private manager is created from `fields`.
14
+ */
15
+ session?: StateManager;
16
+ /**
17
+ * Field descriptors. With a private manager they are its `fields`; with a
18
+ * host session each one is registered into it, so the layout resolves and
19
+ * rules evaluate before any field mounts. Fields the session already
20
+ * declares win.
21
+ */
22
+ fields?: MaybeRefOrGetter<SettingField[] | undefined>;
23
+ /** External validators per setting key (any Standard Schema). */
24
+ validators?: Record<string, StandardSchemaV1>;
25
+ /**
26
+ * Locale context for labels and validation wording. Omitted, the nearest
27
+ * `provideSettingsLocale` is used. `inject` does not see a `provide` in
28
+ * the same component. If one component provides and calls this
29
+ * composable, pass the value that `provideSettingsLocale` returns.
30
+ */
31
+ settingsLocale?: SettingsLocale;
32
+ }
33
+ /** What `useSettingsLayout` returns. */
34
+ export interface SettingsLayoutModel {
35
+ /** The state manager in use; also provided to descendant fields. */
36
+ session: StateManager;
37
+ /** The resolved tree: ordered, rule-filtered, with unique ids. */
38
+ resolved: ComputedRef<ResolvedLayout>;
39
+ /** Every page in display order. */
40
+ pages: ComputedRef<ResolvedPage[]>;
41
+ /** Categories > pages, with `invalid` marks from the shown errors. */
42
+ navigation: ComputedRef<LayoutNavigationNode[]>;
43
+ /** Page by id (`<category>/<page>`). */
44
+ page: (id: string | undefined) => ResolvedPage | undefined;
45
+ /** Layout problems against the known fields (see `validateLayout`). */
46
+ issues: ComputedRef<LayoutIssue[]>;
47
+ /** Fields that are placed and currently visible: what gets validated. */
48
+ fields: ComputedRef<SettingField[]>;
49
+ /** Validation of the visible fields against the session's values. */
50
+ validator: UseFieldValidatorReturn;
51
+ /**
52
+ * Errors to display: server issues always; client issues once the setting
53
+ * is dirty or after `revealErrors()`.
54
+ */
55
+ errorsByKey: ComputedRef<Record<string, string[]>>;
56
+ /** Shows every client error, e.g. after a failed apply. */
57
+ revealErrors: () => void;
58
+ /** Back to showing client errors on dirty settings only. */
59
+ resetErrors: () => void;
60
+ }
61
+ /**
62
+ * Headless layout model. Resolves the layout against the state manager —
63
+ * fields from `session.fieldByKey`, rule values from `session.valueOf` — so
64
+ * the tree, navigation and validation follow every staged edit. Renders
65
+ * nothing; `SkLayout` and `SkShell` are built on it.
66
+ *
67
+ * Provides the session to its descendants, so every
68
+ * `SkField` rendered below stages edits in the same manager.
69
+ */
70
+ export declare function useSettingsLayout(options: UseSettingsLayoutOptions): SettingsLayoutModel;
71
+ //# sourceMappingURL=useSettingsLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSettingsLayout.d.ts","sourceRoot":"","sources":["../../../src/composables/useSettingsLayout/useSettingsLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAMtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAI7E,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC,kCAAkC;IAClC,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IACzC;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,CAAC;IACtD,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,OAAO,EAAE,YAAY,CAAC;IACtB,kEAAkE;IAClE,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACtC,mCAAmC;IACnC,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACnC,sEAAsE;IACtE,UAAU,EAAE,WAAW,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAChD,wCAAwC;IACxC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,KAAK,YAAY,GAAG,SAAS,CAAC;IAC3D,uEAAuE;IACvE,MAAM,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;IACnC,yEAAyE;IACzE,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACpC,qEAAqE;IACrE,SAAS,EAAE,uBAAuB,CAAC;IACnC;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACnD,2DAA2D;IAC3D,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,mBAAmB,CA8FrB"}
@@ -0,0 +1,38 @@
1
+ import type { ComputedRef, InjectionKey, MaybeRefOrGetter } from 'vue';
2
+ import type { KitMessageKey, KitMessageOverrides } from '../../core';
3
+ import type { LocalizedText } from '../../core/types';
4
+ /** What the application passes to `provideSettingsLocale`. */
5
+ export interface SettingsLocaleOptions {
6
+ /** Language of the admin. Defaults to `'en'`. */
7
+ locale?: MaybeRefOrGetter<string>;
8
+ /** Used when `locale` has no translation. */
9
+ fallbackLocale?: MaybeRefOrGetter<string | undefined>;
10
+ /** Replaces kit wording per key. Pass every key to replace all of it. */
11
+ messages?: MaybeRefOrGetter<KitMessageOverrides | undefined>;
12
+ }
13
+ /** What `useSettingsLocale` hands back. */
14
+ export interface SettingsLocale {
15
+ locale: ComputedRef<string>;
16
+ fallbackLocale: ComputedRef<string | undefined>;
17
+ /** Replacement wording from the application, if any. */
18
+ messages: ComputedRef<KitMessageOverrides | undefined>;
19
+ /** Resolves schema text with the locale chain. */
20
+ resolveText: (text: LocalizedText) => string;
21
+ /** Resolves wording owned by the kit. */
22
+ message: (key: KitMessageKey, params?: Record<string, string | number>) => string;
23
+ }
24
+ /** Injection key fields use to find the locale settings. */
25
+ export declare const settingsLocaleKey: InjectionKey<SettingsLocale>;
26
+ /**
27
+ * Sets the locale for all fields below the calling component, and returns it.
28
+ * An option you leave out comes from the parent provider. Messages merge
29
+ * with the parent messages per locale, and your own win.
30
+ *
31
+ * Inject does not see a provide in the same component. To use the locale in
32
+ * this component, for example with `useFieldValidator`, pass the same refs
33
+ * to that composable as options.
34
+ */
35
+ export declare function provideSettingsLocale(options?: SettingsLocaleOptions): SettingsLocale;
36
+ /** The nearest provided locale. Without a provider it uses the kit defaults. */
37
+ export declare function useSettingsLocale(): SettingsLocale;
38
+ //# sourceMappingURL=useSettingsLocale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSettingsLocale.d.ts","sourceRoot":"","sources":["../../../src/composables/useSettingsLocale/useSettingsLocale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAMrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,MAAM,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAClC,6CAA6C;IAC7C,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtD,yEAAyE;IACzE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;CAC9D;AAED,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD,wDAAwD;IACxD,QAAQ,EAAE,WAAW,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IACvD,kDAAkD;IAClD,WAAW,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,MAAM,CAAC;IAC7C,yCAAyC;IACzC,OAAO,EAAE,CACP,GAAG,EAAE,aAAa,EAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAAC;CACb;AAED,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,cAAc,CAChC,CAAC;AAuB5B;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,qBAA0B,GAClC,cAAc,CAoBhB;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,IAAI,cAAc,CAKlD"}
@@ -0,0 +1,10 @@
1
+ import type { StateManager, StateManagerOptions } from '../../core/types';
2
+ /**
3
+ * Headless state manager behind `useSettingsForm`. Owns every field's
4
+ * unsaved work, baseline and save status, resolves inheritance, and batches
5
+ * saves. Nothing here needs a component.
6
+ */
7
+ export declare function createStateManager(options?: StateManagerOptions): StateManager;
8
+ /** `createStateManager` under the Vue naming convention, for use inside `setup()`. */
9
+ export declare function useStateManager(options?: StateManagerOptions): StateManager;
10
+ //# sourceMappingURL=useStateManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStateManager.d.ts","sourceRoot":"","sources":["../../../src/composables/useStateManager/useStateManager.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAOV,YAAY,EACZ,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AA+B1B;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,mBAAwB,GAChC,YAAY,CA2ad;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAC7B,OAAO,GAAE,mBAAwB,GAChC,YAAY,CAEd"}
@@ -0,0 +1,33 @@
1
+ import { type Component } from 'vue';
2
+ import type { SettingField } from '../types';
3
+ /** Locale-resolved schema data a control's prop mapper can draw from. */
4
+ export interface ControlPropsContext {
5
+ /** Field label resolved for the active locale. */
6
+ label: string;
7
+ /** Field description resolved for the active locale. */
8
+ tooltip?: string;
9
+ }
10
+ /**
11
+ * What a control emits. `input` controls edit a value and fire
12
+ * `update:modelValue`/`change`; `button` controls hold no value and fire
13
+ * `action` with the pressed option's method.
14
+ */
15
+ export type ControlKind = 'input' | 'button';
16
+ /**
17
+ * Internal schema of one control: the component the factory produces, what
18
+ * kind of events it emits, and how schema data maps to the control's props.
19
+ * Every control extends the base contract in `../core`, so all entries also
20
+ * accept the same shared attrs.
21
+ */
22
+ export interface ControlDefinition {
23
+ component: Component;
24
+ /** Decides which listeners `SkField` attaches to the control. */
25
+ kind: ControlKind;
26
+ /** Maps schema data to the control's own props. */
27
+ props: (field: SettingField, context: ControlPropsContext) => Record<string, unknown>;
28
+ }
29
+ /** Built-in map from `presentation.control` to that control's definition. */
30
+ export declare const controlDefinitions: Record<string, ControlDefinition>;
31
+ /** Definition used when a control has no dedicated entry in the map. */
32
+ export declare const fallbackDefinition: ControlDefinition;
33
+ //# sourceMappingURL=controlDefinitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controlDefinitions.d.ts","sourceRoot":"","sources":["../../../src/core/controls/controlDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAI9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,iEAAiE;IACjE,IAAI,EAAE,WAAW,CAAC;IAClB,mDAAmD;IACnD,KAAK,EAAE,CACL,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,mBAAmB,KACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B;AAqCD,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAqFhE,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,EAAE,iBAOhC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { Component, InjectionKey } from 'vue';
2
+ import { type ControlDefinition } from './controlDefinitions';
3
+ import type { SettingField, SettingFieldControl } from '../types';
4
+ export type { ControlDefinition, ControlKind, ControlPropsContext, } from './controlDefinitions';
5
+ /** Control definitions by `presentation.control` name. */
6
+ export type ControlRegistry = Readonly<Record<string, ControlDefinition>>;
7
+ /** Injection key for the control registry fields resolve against. */
8
+ export declare const skControlRegistryKey: InjectionKey<ControlRegistry>;
9
+ /**
10
+ * Adds or replaces controls for every field below the caller. Entries merge
11
+ * over the nearest provided registry (the built-ins at the top), so a
12
+ * custom `presentation.control` name renders the component given here.
13
+ */
14
+ export declare function provideControls(definitions: Record<string, ControlDefinition>): ControlRegistry;
15
+ /** The nearest provided registry, else the built-in controls. */
16
+ export declare function useControlRegistry(): ControlRegistry;
17
+ /** The control a field renders: `presentation.control` or the type default. */
18
+ export declare function resolveFieldControl(field: SettingField): SettingFieldControl | undefined;
19
+ /**
20
+ * The control definition for a field from `registry` (the built-ins by
21
+ * default), else the unsupported fallback.
22
+ */
23
+ export declare function resolveControlDefinition(field: SettingField, registry?: ControlRegistry): ControlDefinition;
24
+ /** The input component a field renders with the built-in controls. */
25
+ export declare function createFieldInput(field: SettingField): Component;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/controls/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAEnD,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAE1E,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,eAAe,CAE9D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAC7C,eAAe,CAIjB;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,IAAI,eAAe,CAKpD;AAaD,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,GAClB,mBAAmB,GAAG,SAAS,CAEjC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,YAAY,EACnB,QAAQ,GAAE,eAAoC,GAC7C,iBAAiB,CAGnB;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAE/D"}
@@ -0,0 +1,18 @@
1
+ export { skBaseControlDefaults, skPeriodUnits } from './utils/consts';
2
+ export type { SkPeriodUnit } from './utils/consts';
3
+ export { skA11yAttrs, skDescriptionId, skErrorId, useA11yAttrs, } from './utils/a11y';
4
+ export { useName } from './utils/useName';
5
+ export { skCastModelValue } from './utils/cast';
6
+ export type { SkModelCastModifiers } from './utils/cast';
7
+ export { resolveLocalizedText } from './utils/localizedText';
8
+ export { resolveKitMessage } from './utils/kitMessages';
9
+ export type { KitMessageKey, KitMessageOverrides } from './utils/kitMessages';
10
+ export type { A11yAttrName, A11yAttrs } from './utils/a11y';
11
+ export { useControlModel } from './useControlModel';
12
+ export { evaluateCondition, evaluateFieldRules, evaluateRuleStates, validateFieldRules, } from './validate/rules';
13
+ export type { SettingFieldRuleState } from './validate/rules';
14
+ export { checkFieldConstraints, resolveConstraintMessage, } from './validate/constraints';
15
+ export { byOrder, keysOf, layoutIdSegment, layoutPageId, resolveLayout, toNavigation, validateLayout, } from './layout';
16
+ export type * from './layout';
17
+ export type * from './types';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,eAAe,EACf,SAAS,EACT,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,OAAO,EACP,MAAM,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type * from './types';
2
+ export { byOrder, layoutIdSegment, layoutPageId, resolveLayout, } from './resolve';
3
+ export type { ResolveLayoutOptions, ResolveLayoutSource } from './resolve';
4
+ export { keysOf, toNavigation } from './navigation';
5
+ export type { LayoutNavigationNode, LayoutNavigationOptions, } from './navigation';
6
+ export { validateLayout } from './validate';
7
+ export type { LayoutIssue, LayoutIssueCode } from './validate';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/layout/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,eAAe,EACf,YAAY,EACZ,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { LayoutNodeKind, ResolvedLayout, ResolvedPage } from './types';
2
+ /** One entry of the navigation outline. */
3
+ export interface LayoutNavigationNode {
4
+ /** The resolved node's unique `id`. */
5
+ id: string;
6
+ kind: LayoutNodeKind;
7
+ label: string;
8
+ /** Route path, on page nodes only. */
9
+ path?: string;
10
+ /** Whether a visible setting below this node currently has errors. */
11
+ invalid: boolean;
12
+ children: LayoutNavigationNode[];
13
+ }
14
+ /** Options for `toNavigation`. */
15
+ export interface LayoutNavigationOptions {
16
+ /** Deepest level in the outline. Defaults to `page`. */
17
+ depth?: 'page' | 'item';
18
+ /** Locale for item labels. Defaults to `en`. */
19
+ locale?: string;
20
+ /** Used when `locale` has no translation. Then `en`, then any translation. */
21
+ fallbackLocale?: string;
22
+ /** Whether a setting key currently has errors; marks `invalid` up the tree. */
23
+ isInvalid?: (key: string) => boolean;
24
+ }
25
+ /**
26
+ * The navigation outline of a resolved layout: categories > pages, and with
27
+ * `depth: 'item'` down to the settings. Only what the resolver kept appears;
28
+ * an unlabelled section or group hands its children to its parent.
29
+ */
30
+ export declare function toNavigation(layout: ResolvedLayout, options?: LayoutNavigationOptions): LayoutNavigationNode[];
31
+ /** Visible setting keys of a page, actions included, in display order. */
32
+ export declare function keysOf(page: ResolvedPage): string[];
33
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/core/layout/navigation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAGd,cAAc,EACd,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC;AAED,kCAAkC;AAClC,MAAM,WAAW,uBAAuB;IACtC,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,uBAA4B,GACpC,oBAAoB,EAAE,CAkExB;AAED,0EAA0E;AAC1E,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,EAAE,CAUnD"}
@@ -0,0 +1,41 @@
1
+ import type { SettingField } from '../types';
2
+ import type { ResolvedLayout, SettingsLayout } from './types';
3
+ /** What the resolver reads; `createStateManager` satisfies it directly. */
4
+ export interface ResolveLayoutSource {
5
+ /** Field descriptor for a key; `undefined` skips the item. */
6
+ fieldByKey: (key: string) => SettingField | undefined;
7
+ /** Effective value of a key, used to evaluate rules. */
8
+ valueOf: (key: string) => unknown;
9
+ }
10
+ /** Options for `resolveLayout`. */
11
+ export interface ResolveLayoutOptions {
12
+ /** Locale for every label and description. Defaults to `en`. */
13
+ locale?: string;
14
+ /** Used when `locale` has no translation. Then `en`, then any translation. */
15
+ fallbackLocale?: string;
16
+ }
17
+ /**
18
+ * Stable sort by `order`. Entries whose `order` is missing or not finite
19
+ * sort as `missing` (after every ordered entry by default); ties keep their
20
+ * array position.
21
+ */
22
+ export declare function byOrder<T extends {
23
+ order?: number;
24
+ }>(entries: readonly T[], missing?: number): T[];
25
+ /** Id segment for a uid: URI-encoded so `/` in a uid cannot fake nesting. */
26
+ export declare function layoutIdSegment(uid: string): string;
27
+ /** Page id: `<category>/<page>`, each segment encoded. */
28
+ export declare function layoutPageId(categoryUid: string, pageUid: string): string;
29
+ /**
30
+ * Turns a layout plus the field source into the tree every renderer and
31
+ * navigation reads. The tree holds only what is shown:
32
+ *
33
+ * - every level sorted by `order` (see `byOrder`); items without `order` keep
34
+ * their position and come before a section's groups;
35
+ * - a uid repeated among siblings, an unknown key, or a key placed a second
36
+ * time is skipped (first wins; `validateLayout` reports it);
37
+ * - a rule-hidden item is dropped, and so is a group or section left empty;
38
+ * - `actions` fields move to their page's `actions`.
39
+ */
40
+ export declare function resolveLayout(layout: SettingsLayout, source: ResolveLayoutSource, options?: ResolveLayoutOptions): ResolvedLayout;
41
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/core/layout/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,KAAK,EASV,cAAc,EAGd,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IACtD,wDAAwD;IACxD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAClD,OAAO,EAAE,SAAS,CAAC,EAAE,EACrB,OAAO,GAAE,MAAiC,GACzC,CAAC,EAAE,CAOL;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzE;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,GAAE,oBAAyB,GACjC,cAAc,CAyKhB"}
@@ -0,0 +1,160 @@
1
+ import type { LocalizedText, SettingField } from '../types';
2
+ import type { SettingFieldRuleState } from '../validate/rules';
3
+ /** Grid settings for a section or group of items. */
4
+ export interface LayoutGridSettings {
5
+ /**
6
+ * Logical columns from the small breakpoint up. Items flow one per column;
7
+ * below it every grid reflows to a single column.
8
+ */
9
+ columns: number;
10
+ }
11
+ /** Column split of a page's content sidebar: 8/4, 7/5, or 6/6. */
12
+ export type LayoutSidebarMode = 'default' | 'wide' | 'max';
13
+ /** Header options shared by sections and groups. */
14
+ export interface LayoutPresentation {
15
+ /** Hide the heading block when `false`. Defaults to shown. */
16
+ showHeader?: boolean;
17
+ }
18
+ /**
19
+ * Presentation for one page. Adds the content sidebar to the shared header
20
+ * options. `sidebar` turns the slot on for that page; the host fills it.
21
+ */
22
+ export interface LayoutPagePresentation extends LayoutPresentation {
23
+ /** Render the content sidebar beside this page. */
24
+ sidebar?: boolean;
25
+ /** Column split while that sidebar slot is filled. Defaults to `default`. */
26
+ sidebarMode?: LayoutSidebarMode;
27
+ }
28
+ /** Reference to a setting field placed in a section or group. */
29
+ export interface LayoutItem {
30
+ /** Key of the setting field to render (matches `SettingField.key`). */
31
+ key: string;
32
+ /**
33
+ * Position among its siblings. Items without one keep their array position
34
+ * and come before every group of the same section.
35
+ */
36
+ order?: number;
37
+ /** 1-based column the item is pinned to; defaults to natural flow. */
38
+ column?: number;
39
+ }
40
+ /** A labelled cluster of items inside a section. */
41
+ export interface LayoutGroup {
42
+ uid: string;
43
+ label?: LocalizedText;
44
+ description?: LocalizedText;
45
+ order: number;
46
+ presentation?: LayoutPresentation;
47
+ layout?: LayoutGridSettings;
48
+ items: LayoutItem[];
49
+ }
50
+ /** A block on a page; holds items directly and/or via groups. */
51
+ export interface LayoutSection {
52
+ uid: string;
53
+ label?: LocalizedText;
54
+ description?: LocalizedText;
55
+ order: number;
56
+ presentation?: LayoutPresentation;
57
+ layout?: LayoutGridSettings;
58
+ items?: LayoutItem[];
59
+ groups?: LayoutGroup[];
60
+ }
61
+ /** A navigable settings page composed of sections. */
62
+ export interface LayoutPage {
63
+ uid: string;
64
+ label: LocalizedText;
65
+ description?: LocalizedText;
66
+ order: number;
67
+ presentation?: LayoutPagePresentation;
68
+ sections: LayoutSection[];
69
+ }
70
+ /** Top-level navigation group of pages. */
71
+ export interface LayoutCategory {
72
+ uid: string;
73
+ label: LocalizedText;
74
+ order: number;
75
+ pages: LayoutPage[];
76
+ }
77
+ /** Full settings layout: what the backend delivers next to the fields. */
78
+ export interface SettingsLayout {
79
+ categories: LayoutCategory[];
80
+ }
81
+ /** The five layout levels, outermost first. */
82
+ export type LayoutNodeKind = 'category' | 'page' | 'section' | 'group' | 'item';
83
+ /**
84
+ * Identity shared by every resolved node. `id` is unique across the whole
85
+ * layout: the URI-encoded uid path from the category down, e.g.
86
+ * `appearance/branding/colors`.
87
+ */
88
+ interface ResolvedNodeBase {
89
+ id: string;
90
+ uid: string;
91
+ }
92
+ /** A placed setting, with its field and current rule state. */
93
+ export interface ResolvedItem extends ResolvedNodeBase {
94
+ kind: 'item';
95
+ /** The setting key; equal to `uid`. */
96
+ key: string;
97
+ field: SettingField;
98
+ /** 1-based column pin, clamped to the parent grid. */
99
+ column?: number;
100
+ /** Rule outcome against the current values. */
101
+ rule: SettingFieldRuleState;
102
+ }
103
+ /** A labelled cluster of items. */
104
+ export interface ResolvedGroup extends ResolvedNodeBase {
105
+ kind: 'group';
106
+ label?: string;
107
+ description?: string;
108
+ showHeader: boolean;
109
+ columns: number;
110
+ children: ResolvedItem[];
111
+ }
112
+ /** A block on a page. Children are items and groups in display order. */
113
+ export interface ResolvedSection extends ResolvedNodeBase {
114
+ kind: 'section';
115
+ label?: string;
116
+ description?: string;
117
+ showHeader: boolean;
118
+ columns: number;
119
+ children: (ResolvedItem | ResolvedGroup)[];
120
+ }
121
+ /**
122
+ * A navigable page. `actions` are the `actions` fields placed anywhere in
123
+ * it; they render once, in the page footer, instead of inline.
124
+ */
125
+ export interface ResolvedPage extends ResolvedNodeBase {
126
+ kind: 'page';
127
+ /** Uid of the owning category. */
128
+ categoryId: string;
129
+ /** Always `/<category>/<page>`, each segment URI-encoded. */
130
+ path: string;
131
+ label: string;
132
+ description?: string;
133
+ showHeader: boolean;
134
+ sidebar: boolean;
135
+ sidebarMode: LayoutSidebarMode;
136
+ children: ResolvedSection[];
137
+ actions: ResolvedItem[];
138
+ }
139
+ /** A top-level navigation group of pages. */
140
+ export interface ResolvedCategory extends ResolvedNodeBase {
141
+ kind: 'category';
142
+ label: string;
143
+ children: ResolvedPage[];
144
+ }
145
+ /** Any resolved node. */
146
+ export type ResolvedLayoutNode = ResolvedCategory | ResolvedPage | ResolvedSection | ResolvedGroup | ResolvedItem;
147
+ /** The resolved tree plus flat lookups. */
148
+ export interface ResolvedLayout {
149
+ categories: ResolvedCategory[];
150
+ /** Every page in display order. */
151
+ pages: ResolvedPage[];
152
+ /** Page by `id`. */
153
+ pageById: Map<string, ResolvedPage>;
154
+ /** Page id by placed setting key. */
155
+ pageOfKey: Map<string, string>;
156
+ /** Keys placed in the layout, visible or not, in display order. */
157
+ placedKeys: string[];
158
+ }
159
+ export {};
160
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/layout/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kEAAkE;AAClE,MAAM,MAAM,iBAAiB,GAAG,SAAS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Layout } from './types';
3
+ /** What `validateLayout` can report. */
4
+ export type LayoutIssueCode = 'empty-uid' | 'duplicate-uid' | 'unknown-key' | 'duplicate-key' | 'invalid-column' | 'path-collision' | 'unplaced-field';
5
+ /** One problem in a layout. */
6
+ export interface LayoutIssue {
7
+ code: LayoutIssueCode;
8
+ /**
9
+ * `error`: the resolver drops or rewrites something.
10
+ * `warning`: renders, but is probably not what the author meant.
11
+ */
12
+ severity: 'error' | 'warning';
13
+ /** Uid path of the offending node, e.g. `appearance/branding/colors`. */
14
+ path: string;
15
+ /** Human-readable explanation for logs. */
16
+ message: string;
17
+ }
18
+ /**
19
+ * Checks a layout against its fields. Never throws: the resolver already
20
+ * tolerates every reported case (first wins, unknown is skipped), so a host
21
+ * can log the issues in development and still render.
22
+ *
23
+ * Without `fields`, key checks (`unknown-key`, `unplaced-field`) are skipped.
24
+ */
25
+ export declare function validateLayout(layout: SettingsLayout, fields?: readonly SettingField[]): LayoutIssue[];
26
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/core/layout/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,wCAAwC;AACxC,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,eAAe,GACf,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,CAAC;AAErB,+BAA+B;AAC/B,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAwID;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,EACtB,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,EAAE,CAuCf"}