@kong-ui-public/freeform 0.11.2 → 0.12.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 (29) hide show
  1. package/README.md +5 -2
  2. package/dist/filler/packages/core/freeform/src/composables/errors.d.ts +7 -1
  3. package/dist/filler/packages/core/freeform/src/composables/errors.d.ts.map +1 -1
  4. package/dist/filler/packages/core/freeform/src/composables/field.d.ts +7 -1
  5. package/dist/filler/packages/core/freeform/src/composables/field.d.ts.map +1 -1
  6. package/dist/filler/packages/core/freeform/src/composables/form-context.d.ts +2 -0
  7. package/dist/filler/packages/core/freeform/src/composables/form-context.d.ts.map +1 -1
  8. package/dist/filler/packages/core/freeform/src/composables/index.d.ts +1 -0
  9. package/dist/filler/packages/core/freeform/src/composables/index.d.ts.map +1 -1
  10. package/dist/filler/packages/core/freeform/src/composables/reveal-open.d.ts +15 -0
  11. package/dist/filler/packages/core/freeform/src/composables/reveal-open.d.ts.map +1 -0
  12. package/dist/filler/packages/core/freeform/src/composables/reveal.d.ts +7 -0
  13. package/dist/filler/packages/core/freeform/src/composables/reveal.d.ts.map +1 -1
  14. package/dist/freeform.es.js +1606 -1563
  15. package/dist/freeform.umd.js +5 -5
  16. package/dist/style.css +1 -1
  17. package/dist/types/composables/errors.d.ts +7 -1
  18. package/dist/types/composables/errors.d.ts.map +1 -1
  19. package/dist/types/composables/field.d.ts +7 -1
  20. package/dist/types/composables/field.d.ts.map +1 -1
  21. package/dist/types/composables/form-context.d.ts +2 -0
  22. package/dist/types/composables/form-context.d.ts.map +1 -1
  23. package/dist/types/composables/index.d.ts +1 -0
  24. package/dist/types/composables/index.d.ts.map +1 -1
  25. package/dist/types/composables/reveal-open.d.ts +15 -0
  26. package/dist/types/composables/reveal-open.d.ts.map +1 -0
  27. package/dist/types/composables/reveal.d.ts +7 -0
  28. package/dist/types/composables/reveal.d.ts.map +1 -1
  29. package/package.json +1 -1
package/README.md CHANGED
@@ -132,6 +132,7 @@ All exports below are re-exported from the package root (`render-rules.ts` only
132
132
  | File | Exports | Purpose |
133
133
  |---|---|---|
134
134
  | `form-context.ts` | `provideFormShared()`, `useFormShared()` | Central form state: reactive data, schema, config, render rules, getValue/setValue, getEmptyOrDefault/getEmptyValue |
135
+ | `reveal-open.ts` | `useRevealOpen(container, open)` | Opens a section that keeps its fields mounted while closed (e.g. `KCollapse`) when a reveal heads for a field inside it |
135
136
  | `field.ts` | `useField(name)` | Individual field state: value, schema, path, renderer, error, ancestors, emptyOrDefaultValue, emptyValue |
136
137
  | `field-path.ts` | `useFieldPath()` | Calculates absolute dot-notation path from parent context via provide/inject |
137
138
  | `schema.ts` | `useSchemaHelpers()` | Schema introspection: getSchema, getDefault, getEmptyOrDefault, getEmptyValue, getSelectItems, getLabelAttributes |
@@ -353,7 +354,9 @@ const result = await formRef.value?.reveal('config.redis.host')
353
354
 
354
355
  The field names in an entity checks alert (`EntityChecksAlert`, shown at the top of a record) are links that reveal the field, resolved against the record's path, e.g. `redis.host` on `config` reveals `config.redis.host`.
355
356
 
356
- A custom container opens itself for a reveal through `useField(name).revealTarget`: the path being revealed while it is the field itself or inside it, `null` otherwise. Containers that are not field paths (custom tabs and sections) are not supported yet.
357
+ A custom container opens itself for a reveal through `useField(name).revealTarget`: the path being revealed while it is the field itself or inside it, `null` otherwise.
358
+
359
+ A section that is not a field path but keeps its fields mounted while closed (e.g. `KCollapse`, which uses `v-show`) opens itself with `useRevealOpen(container, open)`: `open` is called when the field that renders the target is inside `container`. The form knows which field that is because every mounted field registers itself, and a record split with `omit` covers only the fields it renders. Try it in the sandbox's **Split fields** page. A section that unmounts its fields while closed is not supported.
357
360
 
358
361
  ### Field Errors
359
362
 
@@ -369,7 +372,7 @@ A custom container opens itself for a reveal through `useField(name).revealTarge
369
372
  | Display only | The form only shows the errors. Turning a server response into `errors`, and when to set or clear them, is up to the host. Showing errors and revealing fields are separate: a host that lists the errors can call `reveal(error.path)` when one is clicked |
370
373
  | Where an error shows | A field shows its own errors. A record, array or map shows only errors on itself, never a count of the ones inside. A set or a JSON field is one field, so it also shows the errors of its items (`tags.1`) |
371
374
  | Structure changes | An error belongs to the item it was raised on, not to its index. When an array item or a map entry is removed through the form, its errors are dropped and the errors of later array items move to their new index; when a map key is renamed, its errors follow it. The form emits the new list through `update:errors`, so bind `v-model:errors`. Whether an error still holds after the user edits the value is not decided here: that is up to the host |
372
- | Unmatched errors | An error no field can show in the current state — its path is malformed or not in the schema, names a map key that isn't in the data, sits under a record or array item without a value, or is hidden by a render rule — is left out of the form and listed in the exposed `unmatchedErrors`, for the host to show elsewhere |
375
+ | Unmatched errors | An error no field can show in the current state — its path is malformed or not in the schema, names a map key that isn't in the data, sits under a record or array item without a value, is hidden by a render rule, or is rendered by no mounted field (e.g. every record that could show it leaves it out with `omit`) — is left out of the form and listed in the exposed `unmatchedErrors`, for the host to show elsewhere |
373
376
 
374
377
  A custom field component gets its errors from `useField(name)`: `fieldErrors` (its own and those below it), `ownFieldErrors`, and `fieldErrorMessage` (`fieldErrors` as one line). The `FieldErrors` component renders a list of them.
375
378
 
@@ -7,7 +7,8 @@ import type { UnionFieldSchema } from '../form-schema';
7
7
  * An error is matched when a field can show it in the current state. It is
8
8
  * unmatched when its path is malformed or not in the schema, names a map key
9
9
  * that isn't in the data, sits under a record or array item that has no
10
- * value (e.g. a record that is switched off), or is hidden by a render rule.
10
+ * value (e.g. a record that is switched off), is hidden by a render rule, or
11
+ * no mounted field renders it (e.g. it is left out with `omit` everywhere).
11
12
  */
12
13
  export declare function createFieldErrors(options: {
13
14
  errors: MaybeRefOrGetter<FieldError[] | undefined>;
@@ -15,6 +16,11 @@ export declare function createFieldErrors(options: {
15
16
  getSchema: (path: string) => UnionFieldSchema | undefined;
16
17
  getKey: (id: KeyId) => string | undefined;
17
18
  isFieldHidden: (path: string) => boolean;
19
+ /**
20
+ * Whether a mounted field shows the field at a path, now or once expanded.
21
+ * Without it, every field in the schema counts as rendered.
22
+ */
23
+ isFieldRendered?: (fieldPath: string) => boolean;
18
24
  /** Called with the errors rewritten after the data's structure changed */
19
25
  onChange?: (errors: FieldError[]) => void;
20
26
  }): {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/errors.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,MAAM,EAAE,gBAAgB,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC,CAAA;IAClD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAA;IACzD,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAA;IACzC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;CAC1C;gCA+FoC,MAAM,qBAAgB,UAAU,EAAE;;yCAiEzB,MAAM,SAAS,MAAM;oCAW1B,MAAM,QAAQ,MAAM,MAAM,MAAM;oCAOhC,MAAM,OAAO,MAAM;EAW3D"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/errors.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,MAAM,EAAE,gBAAgB,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC,CAAA;IAClD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAA;IACzD,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAA;IACzC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;IAChD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;CAC1C;gCAsGoC,MAAM,qBAAgB,UAAU,EAAE;;yCAiEzB,MAAM,SAAS,MAAM;oCAW1B,MAAM,QAAQ,MAAM,MAAM,MAAM;oCAOhC,MAAM,OAAO,MAAM;EAW3D"}
@@ -3,7 +3,13 @@ import type { MaybeRefOrGetter } from 'vue';
3
3
  export declare function useFormData<T>(name: MaybeRefOrGetter<string>): {
4
4
  value: import("vue").WritableComputedRef<T, T>;
5
5
  };
6
- export declare function useField<TData = unknown, TSchema extends UnionFieldSchema = UnionFieldSchema>(name: MaybeRefOrGetter<string>): {
6
+ export declare function useField<TData = unknown, TSchema extends UnionFieldSchema = UnionFieldSchema>(name: MaybeRefOrGetter<string>, options?: {
7
+ /**
8
+ * Child fields this component leaves out, e.g. `ObjectField`'s `omit`, so
9
+ * the form knows it doesn't render them
10
+ */
11
+ exclude?: MaybeRefOrGetter<string[] | undefined>;
12
+ }): {
7
13
  error: Error;
8
14
  schema?: undefined;
9
15
  path?: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/field.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;EAW5D;AAED,wBAAgB,QAAQ,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;;;;;IAyEzH;;OAEG;;;;;;;;;;;;;;;;;IAFH;;OAEG;;;;;;;;;;EAWN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC;mBAQ/C,CAAC,SAAS,MAAM,KAAG,MAAM;EAmChD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC,EACpC,UAAU,EAAE,MAAM,QAenB"}
1
+ {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/field.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;EAW5D;AAED,wBAAgB,QAAQ,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EAC3F,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC9B,OAAO,GAAE;IACP;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;CAC5C;;;;;;;IA2EJ;;OAEG;;;;;;;;;;;;;;;;;IAFH;;OAEG;;;;;;;;;;EAWN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC;mBAQ/C,CAAC,SAAS,MAAM,KAAG,MAAM;EAmChD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC,EACpC,UAAU,EAAE,MAAM,QAenB"}
@@ -33,6 +33,7 @@ export declare const provideFormShared: (options: {
33
33
  getEmptyOrDefault: <T = unknown>(path?: string) => EmptyValue | T;
34
34
  revealTarget: import("vue").ShallowRef<string | null, string | null>;
35
35
  registerFieldElement: (entry: import("./reveal").FieldElementEntry) => () => void;
36
+ findCoveringElement: (fieldPath: string) => Element | null;
36
37
  /**
37
38
  * Reveals the field at a data path, see `createFieldReveal`
38
39
  */
@@ -92,6 +93,7 @@ export declare const provideFormShared: (options: {
92
93
  getEmptyOrDefault: <T = unknown>(path?: string) => EmptyValue | T;
93
94
  revealTarget: import("vue").ShallowRef<string | null, string | null>;
94
95
  registerFieldElement: (entry: import("./reveal").FieldElementEntry) => () => void;
96
+ findCoveringElement: (fieldPath: string) => Element | null;
95
97
  /**
96
98
  * Reveals the field at a data path, see `createFieldReveal`
97
99
  */
@@ -1 +1 @@
1
- {"version":3,"file":"form-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/form-context.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB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zF,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAElE,eAAO,MAAO,iBAAiB;YAEnB,UAAU,GAAG,gBAAgB;;;uBAGlB,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAC;kBAC9C,gBAAgB,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;kDAC7B,IAAI;qBACd,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;wBAqJpB,MAAM;wBAIN,CAAC,mBAAmB,MAAM;;;;IA0CnD;;OAEG;;;;;;;;;;;;;;;;;IAvBH;;OAEG;;;;;;;;;aA6C8jN,CAAC;qBAA6D,CAAC;;;;GArOrmN,qBAAqB;;;;;;;;;;;;;;;;;;;;wBA6JvB,MAAM;wBAIN,CAAC,mBAAmB,MAAM;;;;IA0CnD;;OAEG;;;;;;;;;;;;;;;;;IAvBH;;OAEG;;;;;;;;;aA6C8jN,CAAC;qBAA6D,CAAC;;;;aAfroN,CAAA;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAM/D,UAAU,CAAC,OAAO,qBAAqB,CAAC,GAAG;IACzD,QAAQ,EAAE,CAAC,CAAA;IACX,MAAM,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAC,CAAA;CAClB,CACF"}
@@ -8,6 +8,7 @@ export * from './form-context';
8
8
  export * from './labels';
9
9
  export type { RevealOptions, RevealResult } from './reveal';
10
10
  export { DEFAULT_REVEAL_DURATION, DEFAULT_REVEAL_HIGHLIGHT_DURATION } from './reveal';
11
+ export * from './reveal-open';
11
12
  export * from './schema';
12
13
  export * from './useMapField';
13
14
  export { renderRuleExactMatch } from './render-rules';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AACrF,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AACrF,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * Opens a collapsed section when a reveal heads for a field inside it.
4
+ *
5
+ * For a section that hides its content but keeps it mounted (e.g. `KCollapse`,
6
+ * which uses `v-show`): the fields inside are registered, so the form knows
7
+ * which mounted field stands for the target. When that field's element is
8
+ * inside `container`, `open` is called, and the reveal lands once the field
9
+ * shows. A section that unmounts its content can't tell what is inside it.
10
+ *
11
+ * @param container The section's root element
12
+ * @param open Opens the section; only view state should change
13
+ */
14
+ export declare function useRevealOpen(container: MaybeRefOrGetter<Element | null | undefined>, open: () => void): void;
15
+ //# sourceMappingURL=reveal-open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal-open.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/reveal-open.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,gBAAgB,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,QAgBtG"}
@@ -33,6 +33,11 @@ export interface FieldElementEntry {
33
33
  /** The field path, with key IDs for map entries */
34
34
  path: () => string;
35
35
  element: () => Element | null;
36
+ /**
37
+ * Child fields it leaves out, e.g. `ObjectField`'s `omit`. The entry stands
38
+ * for its path and everything below it except these.
39
+ */
40
+ exclude?: () => string[] | undefined;
36
41
  }
37
42
  type PathMapOptions = {
38
43
  formData: Record<string, any>;
@@ -58,6 +63,8 @@ export declare function toDataPath(fieldPath: string, getKey: PathMapOptions['ge
58
63
  export declare function createFieldReveal(options: PathMapOptions): {
59
64
  revealTarget: import("vue").ShallowRef<string | null, string | null>;
60
65
  registerFieldElement: (entry: FieldElementEntry) => () => void;
66
+ isFieldRendered: (fieldPath: string) => boolean;
67
+ findCoveringElement: (fieldPath: string) => Element | null;
61
68
  reveal: (path: string, { duration, highlight: withHighlight }?: RevealOptions) => Promise<RevealResult | null>;
62
69
  };
63
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reveal.d.ts","sourceRoot":"","sources":["../../../../../../../src/composables/reveal.ts"],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