@wise/dynamic-flow-types 4.18.0 → 4.20.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 (61) hide show
  1. package/build/renderers/AlertRendererProps.d.ts +5 -0
  2. package/build/renderers/AlertRendererProps.d.ts.map +1 -1
  3. package/build/renderers/CollectionRendererProps.d.ts +83 -0
  4. package/build/renderers/CollectionRendererProps.d.ts.map +1 -0
  5. package/build/renderers/RendererProps.d.ts +3 -2
  6. package/build/renderers/RendererProps.d.ts.map +1 -1
  7. package/build/renderers/SectionRendererProps.d.ts +1 -0
  8. package/build/renderers/SectionRendererProps.d.ts.map +1 -1
  9. package/build/renderers/index.d.ts +1 -0
  10. package/build/renderers/index.d.ts.map +1 -1
  11. package/build/spec/feature/Behavior.d.ts +3 -1
  12. package/build/spec/feature/Behavior.d.ts.map +1 -1
  13. package/build/spec/feature/DelayBehavior.d.ts +24 -0
  14. package/build/spec/feature/DelayBehavior.d.ts.map +1 -0
  15. package/build/spec/feature/DispatchEventBehavior.d.ts +23 -0
  16. package/build/spec/feature/DispatchEventBehavior.d.ts.map +1 -0
  17. package/build/spec/index.d.ts +12 -0
  18. package/build/spec/index.d.ts.map +1 -1
  19. package/build/spec/layout/AlertLayout.d.ts +18 -0
  20. package/build/spec/layout/AlertLayout.d.ts.map +1 -1
  21. package/build/spec/layout/CollectionLayout.d.ts +52 -0
  22. package/build/spec/layout/CollectionLayout.d.ts.map +1 -0
  23. package/build/spec/layout/CollectionLayoutCallToAction.d.ts +19 -0
  24. package/build/spec/layout/CollectionLayoutCallToAction.d.ts.map +1 -0
  25. package/build/spec/layout/CollectionLayoutFilter.d.ts +6 -0
  26. package/build/spec/layout/CollectionLayoutFilter.d.ts.map +1 -0
  27. package/build/spec/layout/CollectionLayoutItem.d.ts +60 -0
  28. package/build/spec/layout/CollectionLayoutItem.d.ts.map +1 -0
  29. package/build/spec/layout/CollectionLayoutSearch.d.ts +18 -0
  30. package/build/spec/layout/CollectionLayoutSearch.d.ts.map +1 -0
  31. package/build/spec/layout/CollectionLayoutSection.d.ts +24 -0
  32. package/build/spec/layout/CollectionLayoutSection.d.ts.map +1 -0
  33. package/build/spec/layout/CollectionLayoutSelectFilter.d.ts +24 -0
  34. package/build/spec/layout/CollectionLayoutSelectFilter.d.ts.map +1 -0
  35. package/build/spec/layout/CollectionLayoutSelectFilterOption.d.ts +22 -0
  36. package/build/spec/layout/CollectionLayoutSelectFilterOption.d.ts.map +1 -0
  37. package/build/spec/layout/CollectionLayoutState.d.ts +30 -0
  38. package/build/spec/layout/CollectionLayoutState.d.ts.map +1 -0
  39. package/build/spec/layout/Layout.d.ts +3 -1
  40. package/build/spec/layout/Layout.d.ts.map +1 -1
  41. package/build/spec/layout/SectionLayout.d.ts +4 -0
  42. package/build/spec/layout/SectionLayout.d.ts.map +1 -1
  43. package/build/spec/layout/UpdatableLayout.d.ts +56 -0
  44. package/build/spec/layout/UpdatableLayout.d.ts.map +1 -0
  45. package/build/spec/layout/UpdatableLayoutErrorHandler.d.ts +12 -0
  46. package/build/spec/layout/UpdatableLayoutErrorHandler.d.ts.map +1 -0
  47. package/build/spec/layout/UpdatableLayoutOnEventTrigger.d.ts +14 -0
  48. package/build/spec/layout/UpdatableLayoutOnEventTrigger.d.ts.map +1 -0
  49. package/build/spec/layout/UpdatableLayoutState.d.ts +14 -0
  50. package/build/spec/layout/UpdatableLayoutState.d.ts.map +1 -0
  51. package/build/spec/layout/UpdatableLayoutTrigger.d.ts +6 -0
  52. package/build/spec/layout/UpdatableLayoutTrigger.d.ts.map +1 -0
  53. package/build/spec/main.js +161 -40
  54. package/build/spec/main.mjs +161 -40
  55. package/build/spec/misc/InlineAlert.d.ts +5 -0
  56. package/build/spec/misc/InlineAlert.d.ts.map +1 -1
  57. package/build/tsconfig.tsbuildinfo +1 -1
  58. package/build/zod/schemas.d.ts +280 -28
  59. package/build/zod/schemas.d.ts.map +1 -1
  60. package/build/zod/schemas.ts +172 -24
  61. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ import type { CollectionLayoutSelectFilterOption } from './CollectionLayoutSelectFilterOption';
2
+ /**
3
+ * A select filter rendered as a chip bar above the list. By default, exactly one option can be selected.
4
+ * When [multiSelect] is `true`, multiple options may be selected simultaneously.
5
+ */
6
+ export type CollectionLayoutSelectFilter = {
7
+ /**
8
+ * It must be `select`.
9
+ */
10
+ type: 'select';
11
+ /**
12
+ * The query/body parameter name sent in the request.
13
+ */
14
+ param: string;
15
+ /**
16
+ * The available options.
17
+ */
18
+ options: CollectionLayoutSelectFilterOption[];
19
+ /**
20
+ * Whether multiple options can be selected simultaneously. Defaults to `false` (single-select).
21
+ */
22
+ multiSelect?: boolean;
23
+ };
24
+ //# sourceMappingURL=CollectionLayoutSelectFilter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionLayoutSelectFilter.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/CollectionLayoutSelectFilter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAA;AAE9F;;;EAGE;AACF,MAAM,MAAM,4BAA4B,GAAG;IACvC;;MAEE;IACF,IAAI,EAAE,QAAQ,CAAC;IACf;;MAEE;IACF,KAAK,EAAE,MAAM,CAAC;IACd;;MAEE;IACF,OAAO,EAAE,kCAAkC,EAAE,CAAC;IAC9C;;MAEE;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * An option within a [com.wise.dynamicflow.layout.CollectionLayout.SelectFilter].
3
+ */
4
+ export type CollectionLayoutSelectFilterOption = {
5
+ /**
6
+ * The value sent in the request when selected.
7
+ */
8
+ value: string;
9
+ /**
10
+ * The user-facing label.
11
+ */
12
+ title: string;
13
+ /**
14
+ * A description of the filter to be used by screen readers.
15
+ */
16
+ accessibilityDescription?: string;
17
+ /**
18
+ * Whether this option is initially selected. Defaults to `false`.
19
+ */
20
+ selected?: boolean;
21
+ };
22
+ //# sourceMappingURL=CollectionLayoutSelectFilterOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionLayoutSelectFilterOption.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/CollectionLayoutSelectFilterOption.ts"],"names":[],"mappings":"AAAA;;EAEE;AACF,MAAM,MAAM,kCAAkC,GAAG;IAC7C;;MAEE;IACF,KAAK,EAAE,MAAM,CAAC;IACd;;MAEE;IACF,KAAK,EAAE,MAAM,CAAC;IACd;;MAEE;IACF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;MAEE;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { CollectionLayoutSection } from './CollectionLayoutSection';
2
+ import type { CollectionLayoutFilter } from './CollectionLayoutFilter';
3
+ import type { Layout } from './Layout';
4
+ /**
5
+ * Represents a collection with visible sections and an optional pagination cursor.
6
+ */
7
+ export type CollectionLayoutState = {
8
+ /**
9
+ * The sections of items to display. A list with a single section (without a title) behaves as an ungrouped list.
10
+ */
11
+ sections: CollectionLayoutSection[];
12
+ /**
13
+ * An opaque cursor value the client sends back when requesting the next page.
14
+ * A nullish value indicate there are no more pages.
15
+ */
16
+ nextCursor?: string;
17
+ /**
18
+ * An array of filter definitions.
19
+ */
20
+ filters?: CollectionLayoutFilter[];
21
+ /**
22
+ * A list of layouts to show before the sections.
23
+ */
24
+ beforeSections?: Layout[];
25
+ /**
26
+ * A list of layouts to show after the sections.
27
+ */
28
+ afterSections?: Layout[];
29
+ };
30
+ //# sourceMappingURL=CollectionLayoutState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionLayoutState.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/CollectionLayoutState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;EAEE;AACF,MAAM,MAAM,qBAAqB,GAAG;IAChC;;MAEE;IACF,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC;;;MAGE;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;MAEE;IACF,OAAO,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACnC;;MAEE;IACF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;MAEE;IACF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { AlertLayout } from './AlertLayout';
2
2
  import type { BoxLayout } from './BoxLayout';
3
3
  import type { ButtonLayout } from './ButtonLayout';
4
+ import type { CollectionLayout } from './CollectionLayout';
4
5
  import type { ColumnsLayout } from './ColumnsLayout';
5
6
  import type { DecisionLayout } from './DecisionLayout';
6
7
  import type { DividerLayout } from './DividerLayout';
@@ -21,9 +22,10 @@ import type { SearchLayout } from './SearchLayout';
21
22
  import type { SectionLayout } from './SectionLayout';
22
23
  import type { StatusListLayout } from './StatusListLayout';
23
24
  import type { TabsLayout } from './TabsLayout';
25
+ import type { UpdatableLayout } from './UpdatableLayout';
24
26
  import type { UpsellLayout } from './UpsellLayout';
25
27
  /**
26
28
  * Layouts allow you to display information to the user and customise how a step is structured.
27
29
  */
28
- export type Layout = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | MediaLayout | ModalLayout | ParagraphLayout | ProgressLayout | ReviewLayout | SearchLayout | SectionLayout | StatusListLayout | TabsLayout | UpsellLayout;
30
+ export type Layout = AlertLayout | BoxLayout | ButtonLayout | CollectionLayout | ColumnsLayout | DecisionLayout | DividerLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | MediaLayout | ModalLayout | ParagraphLayout | ProgressLayout | ReviewLayout | SearchLayout | SectionLayout | StatusListLayout | TabsLayout | UpdatableLayout | UpsellLayout;
29
31
  //# sourceMappingURL=Layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/Layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM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G,UAAU,GAAG,kBAAkB,GAAG,UAAU,GAAG,sBAAsB,GAAG,cAAc,GAAG,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,GAAG,gBAAgB,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY,CAAC"}
@@ -42,5 +42,9 @@ export type SectionLayout = {
42
42
  * An optional list of identifiers used to configure renderers.
43
43
  */
44
44
  tags?: string[];
45
+ /**
46
+ * An alternative section title for contexts where space is limited.
47
+ */
48
+ shortTitle?: string;
45
49
  };
46
50
  //# sourceMappingURL=SectionLayout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionLayout.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/SectionLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExC;;;;;;;EAOE;AACF,MAAM,MAAM,aAAa,GAAG;IACxB;;MAEE;IACF,IAAI,EAAE,SAAS,CAAC;IAChB;;MAEE;IACF,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;MAEE;IACF,KAAK,EAAE,MAAM,CAAC;IACd;;MAEE;IACF,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC;;MAEE;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;MAEE;IACF,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;MAEE;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;MAEE;IACF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"SectionLayout.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/SectionLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExC;;;;;;;EAOE;AACF,MAAM,MAAM,aAAa,GAAG;IACxB;;MAEE;IACF,IAAI,EAAE,SAAS,CAAC;IAChB;;MAEE;IACF,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;MAEE;IACF,KAAK,EAAE,MAAM,CAAC;IACd;;MAEE;IACF,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC;;MAEE;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;MAEE;IACF,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;MAEE;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;MAEE;IACF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;MAEE;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { Request } from '../misc/Request';
2
+ import type { UpdatableLayoutTrigger } from './UpdatableLayoutTrigger';
3
+ import type { UpdatableLayoutState } from './UpdatableLayoutState';
4
+ import type { UpdatableLayoutErrorHandler } from './UpdatableLayoutErrorHandler';
5
+ import type { Size } from '../misc/Size';
6
+ /**
7
+ * **This API is experimental and likely to change without notice. Please contact us before using this in production flows.**
8
+ * A layout container that can refresh its own state by executing a request when its trigger is satisfied.
9
+ * When a trigger fires, clients compose the final request from [baseRequest] plus runtime update data.
10
+ * In this proposal, the composed request uses `POST` and sends the current submittable step value
11
+ * in the request body. The server responds with a body matching [State],
12
+ * which replaces the container's rendered layouts.
13
+ * ## When to use
14
+ * - When only a subsection of the UI needs to refresh in response to user input or some other event, without refreshing the entire step.
15
+ * @experimental This feature may be changed in the future without notice.
16
+ */
17
+ export type UpdatableLayout = {
18
+ /**
19
+ * It must be `updatable`.
20
+ */
21
+ type: 'updatable';
22
+ /**
23
+ * Base [com.wise.dynamicflow.misc.Request] template used to build the update request.
24
+ */
25
+ baseRequest: Request;
26
+ /**
27
+ * Defines when to trigger the update request.
28
+ */
29
+ trigger: UpdatableLayoutTrigger;
30
+ /**
31
+ * Initial state for this updatable layout instance. If absent, defaults to an empty state.
32
+ */
33
+ initialState?: UpdatableLayoutState;
34
+ /**
35
+ * Defines how request failures should be handled. If absent or present without any properties,
36
+ * errors are ignored and current content is kept unchanged.
37
+ */
38
+ onError?: UpdatableLayoutErrorHandler;
39
+ /**
40
+ * Specify a particular control to use to represent the layout. If the control is unknown, it will be ignored.
41
+ */
42
+ control?: string;
43
+ /**
44
+ * The vertical margin to apply after this component. Defaults to `md`.
45
+ */
46
+ margin?: Size;
47
+ /**
48
+ * An optional identifier to be used in analytics tracking.
49
+ */
50
+ analyticsId?: string;
51
+ /**
52
+ * An optional list of identifiers used to configure renderers.
53
+ */
54
+ tags?: string[];
55
+ };
56
+ //# sourceMappingURL=UpdatableLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdatableLayout.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/UpdatableLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAChF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExC;;;;;;;;;;EAUE;AACF,MAAM,MAAM,eAAe,GAAG;IAC1B;;MAEE;IACF,IAAI,EAAE,WAAW,CAAC;IAClB;;MAEE;IACF,WAAW,EAAE,OAAO,CAAC;IACrB;;MAEE;IACF,OAAO,EAAE,sBAAsB,CAAC;IAChC;;MAEE;IACF,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC;;;MAGE;IACF,OAAO,CAAC,EAAE,2BAA2B,CAAC;IACtC;;MAEE;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;MAEE;IACF,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;MAEE;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;MAEE;IACF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Layout } from './Layout';
2
+ /**
3
+ * Defines how request failures are handled by an [UpdatableLayout].
4
+ * If absent, or present without any properties, errors are ignored and current content is kept unchanged.
5
+ */
6
+ export type UpdatableLayoutErrorHandler = {
7
+ /**
8
+ * Fallback layouts to render if the request fails.
9
+ */
10
+ fallbackLayout?: Layout[];
11
+ };
12
+ //# sourceMappingURL=UpdatableLayoutErrorHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdatableLayoutErrorHandler.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/UpdatableLayoutErrorHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;;EAGE;AACF,MAAM,MAAM,2BAA2B,GAAG;IACtC;;MAEE;IACF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Triggers an update when an event with a matching name is dispatched.
3
+ */
4
+ export type UpdatableLayoutOnEventTrigger = {
5
+ /**
6
+ * It must be `on-event`.
7
+ */
8
+ type: 'on-event';
9
+ /**
10
+ * Event name that triggers the layout update.
11
+ */
12
+ eventName: string;
13
+ };
14
+ //# sourceMappingURL=UpdatableLayoutOnEventTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdatableLayoutOnEventTrigger.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/UpdatableLayoutOnEventTrigger.ts"],"names":[],"mappings":"AAAA;;EAEE;AACF,MAAM,MAAM,6BAA6B,GAAG;IACxC;;MAEE;IACF,IAAI,EAAE,UAAU,CAAC;IACjB;;MAEE;IACF,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Layout } from './Layout';
2
+ /**
3
+ * The state of an [UpdatableLayout] instance, containing the layouts rendered by the container.
4
+ */
5
+ export type UpdatableLayoutState = {
6
+ /**
7
+ * Layouts currently rendered by this container.
8
+ * In initial state, an absent `components` property defaults to an empty array.
9
+ * In update responses, an absent `components` property means no update is applied,
10
+ * while an explicit empty array means the container should have no layouts.
11
+ */
12
+ components?: Layout[];
13
+ };
14
+ //# sourceMappingURL=UpdatableLayoutState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdatableLayoutState.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/UpdatableLayoutState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;EAEE;AACF,MAAM,MAAM,oBAAoB,GAAG;IAC/B;;;;;MAKE;IACF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { UpdatableLayoutOnEventTrigger } from './UpdatableLayoutOnEventTrigger';
2
+ /**
3
+ * Defines when an [UpdatableLayout] should execute an update request.
4
+ */
5
+ export type UpdatableLayoutTrigger = UpdatableLayoutOnEventTrigger;
6
+ //# sourceMappingURL=UpdatableLayoutTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdatableLayoutTrigger.d.ts","sourceRoot":"","sources":["../../../src/spec/layout/UpdatableLayoutTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAEpF;;EAEE;AACF,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,CAAC"}
@@ -63,10 +63,6 @@ var contextSchema = import_zod.z.union([
63
63
  import_zod.z.literal("info"),
64
64
  import_zod.z.literal("primary")
65
65
  ]);
66
- var inlineAlertSchema = import_zod.z.object({
67
- content: import_zod.z.string(),
68
- context: contextSchema.optional()
69
- });
70
66
  var iconTextSchema = import_zod.z.object({
71
67
  text: import_zod.z.string()
72
68
  });
@@ -192,6 +188,23 @@ var loadingIndicatorLayoutSchema = import_zod.z.object({
192
188
  tags: import_zod.z.array(import_zod.z.string()).optional()
193
189
  });
194
190
  var mediaSchema = import_zod.z.union([mediaAvatarSchema, mediaImageSchema]);
191
+ var requestSchema = import_zod.z.object({
192
+ url: import_zod.z.string(),
193
+ method: httpMethodSchema,
194
+ body: jsonElementSchema.optional(),
195
+ prefetch: import_zod.z.boolean().optional(),
196
+ headers: import_zod.z.record(import_zod.z.string()).optional()
197
+ });
198
+ var collectionLayoutSearchSchema = import_zod.z.object({
199
+ param: import_zod.z.string(),
200
+ title: import_zod.z.string().optional(),
201
+ hint: import_zod.z.string().optional()
202
+ });
203
+ var inlineAlertSchema = import_zod.z.object({
204
+ content: import_zod.z.string(),
205
+ context: contextSchema.optional(),
206
+ media: mediaSchema.optional()
207
+ });
195
208
  var paragraphLayoutSchema = import_zod.z.object({
196
209
  type: import_zod.z.literal("paragraph"),
197
210
  text: import_zod.z.string(),
@@ -214,12 +227,11 @@ var listLayoutStatusSchema = import_zod.z.union([
214
227
  import_zod.z.literal("neutral"),
215
228
  import_zod.z.literal("positive")
216
229
  ]);
217
- var requestSchema = import_zod.z.object({
218
- url: import_zod.z.string(),
219
- method: httpMethodSchema,
220
- body: jsonElementSchema.optional(),
221
- prefetch: import_zod.z.boolean().optional(),
222
- headers: import_zod.z.record(import_zod.z.string()).optional()
230
+ var collectionLayoutSelectFilterOptionSchema = import_zod.z.object({
231
+ value: import_zod.z.string(),
232
+ title: import_zod.z.string(),
233
+ accessibilityDescription: import_zod.z.string().optional(),
234
+ selected: import_zod.z.boolean().optional()
223
235
  });
224
236
  var formLayoutSchemaReferenceSchema = import_zod.z.object({
225
237
  $ref: import_zod.z.string()
@@ -330,6 +342,10 @@ var columnsLayoutBiasSchema = import_zod.z.union([
330
342
  import_zod.z.literal("left"),
331
343
  import_zod.z.literal("right")
332
344
  ]);
345
+ var updatableLayoutOnEventTriggerSchema = import_zod.z.object({
346
+ type: import_zod.z.literal("on-event"),
347
+ eventName: import_zod.z.string()
348
+ });
333
349
  var noOpResponseBodySchema = import_zod.z.object({});
334
350
  var searchResultSearchSearchRequestSchema = import_zod.z.object({
335
351
  url: import_zod.z.string(),
@@ -484,9 +500,21 @@ var containerBehaviorSchema = import_zod.z.object({
484
500
  link: linkSchema.optional(),
485
501
  analytics: import_zod.z.record(import_zod.z.string()).optional()
486
502
  });
503
+ var dispatchEventBehaviorSchema = import_zod.z.object({
504
+ type: import_zod.z.literal("dispatch-event"),
505
+ eventName: import_zod.z.string(),
506
+ analytics: import_zod.z.record(import_zod.z.string()).optional()
507
+ });
487
508
  var suggestionsSchema = import_zod.z.object({
488
509
  values: import_zod.z.array(suggestionsValueSchema)
489
510
  });
511
+ var collectionLayoutSelectFilterSchema = import_zod.z.object({
512
+ type: import_zod.z.literal("select"),
513
+ param: import_zod.z.string(),
514
+ options: import_zod.z.array(collectionLayoutSelectFilterOptionSchema),
515
+ multiSelect: import_zod.z.boolean().optional()
516
+ });
517
+ var updatableLayoutTriggerSchema = updatableLayoutOnEventTriggerSchema;
490
518
  var searchResultActionSchema = import_zod.z.object({
491
519
  type: import_zod.z.literal("action"),
492
520
  title: import_zod.z.string(),
@@ -512,6 +540,7 @@ var dynamicLaunchConfigSchema = import_zod.z.object({
512
540
  presentation: presentationSchema
513
541
  });
514
542
  var launchConfigSchema = import_zod.z.union([dynamicLaunchConfigSchema, nativeLaunchConfigSchema]);
543
+ var collectionLayoutFilterSchema = collectionLayoutSelectFilterSchema;
515
544
  var searchResponseBodySchema = import_zod.z.object({
516
545
  type: import_zod.z.literal("results").optional(),
517
546
  results: import_zod.z.array(searchResultSchema)
@@ -536,7 +565,9 @@ var behaviorSchema = import_zod.z.lazy(
536
565
  actionBehaviorSchema,
537
566
  containerBehaviorSchema,
538
567
  copyBehaviorSchema,
568
+ delayBehaviorSchema,
539
569
  dismissBehaviorSchema,
570
+ dispatchEventBehaviorSchema,
540
571
  downloadBehaviorSchema,
541
572
  linkBehaviorSchema,
542
573
  modalBehaviorSchema,
@@ -553,6 +584,53 @@ var reviewLayoutCallToActionSchema = import_zod.z.lazy(
553
584
  context: contextSchema.optional()
554
585
  })
555
586
  );
587
+ var collectionLayoutStateSchema = import_zod.z.lazy(
588
+ () => import_zod.z.object({
589
+ sections: import_zod.z.array(collectionLayoutSectionSchema),
590
+ nextCursor: import_zod.z.string().optional(),
591
+ filters: import_zod.z.array(collectionLayoutFilterSchema).optional(),
592
+ beforeSections: import_zod.z.array(layoutSchema).optional(),
593
+ afterSections: import_zod.z.array(layoutSchema).optional()
594
+ })
595
+ );
596
+ var collectionLayoutSectionSchema = import_zod.z.lazy(
597
+ () => import_zod.z.object({
598
+ id: import_zod.z.string(),
599
+ items: import_zod.z.array(collectionLayoutItemSchema),
600
+ title: import_zod.z.string().optional(),
601
+ callToAction: collectionLayoutCallToActionSchema.optional()
602
+ })
603
+ );
604
+ var layoutSchema = import_zod.z.lazy(
605
+ () => import_zod.z.union([
606
+ alertLayoutSchema,
607
+ boxLayoutSchema,
608
+ buttonLayoutSchema,
609
+ collectionLayoutSchema,
610
+ columnsLayoutSchema,
611
+ decisionLayoutSchema,
612
+ dividerLayoutSchema,
613
+ formLayoutSchema,
614
+ headingLayoutSchema,
615
+ imageLayoutSchema,
616
+ infoLayoutSchema,
617
+ instructionsLayoutSchema,
618
+ listLayoutSchema,
619
+ loadingIndicatorLayoutSchema,
620
+ markdownLayoutSchema,
621
+ mediaLayoutSchema,
622
+ modalLayoutSchema,
623
+ paragraphLayoutSchema,
624
+ progressLayoutSchema,
625
+ reviewLayoutSchema,
626
+ searchLayoutSchema,
627
+ sectionLayoutSchema,
628
+ statusListLayoutSchema,
629
+ tabsLayoutSchema,
630
+ updatableLayoutSchema,
631
+ upsellLayoutSchema
632
+ ])
633
+ );
556
634
  var tabsLayoutSchema = import_zod.z.lazy(
557
635
  () => import_zod.z.object({
558
636
  type: import_zod.z.literal("tabs"),
@@ -572,6 +650,29 @@ var tabsLayoutTabSchema = import_zod.z.lazy(
572
650
  tags: import_zod.z.array(import_zod.z.string()).optional()
573
651
  })
574
652
  );
653
+ var updatableLayoutSchema = import_zod.z.lazy(
654
+ () => import_zod.z.object({
655
+ type: import_zod.z.literal("updatable"),
656
+ baseRequest: requestSchema,
657
+ trigger: updatableLayoutTriggerSchema,
658
+ initialState: updatableLayoutStateSchema.optional(),
659
+ onError: updatableLayoutErrorHandlerSchema.optional(),
660
+ control: import_zod.z.string().optional(),
661
+ margin: sizeSchema.optional(),
662
+ analyticsId: import_zod.z.string().optional(),
663
+ tags: import_zod.z.array(import_zod.z.string()).optional()
664
+ })
665
+ );
666
+ var updatableLayoutStateSchema = import_zod.z.lazy(
667
+ () => import_zod.z.object({
668
+ components: import_zod.z.array(layoutSchema).optional()
669
+ })
670
+ );
671
+ var updatableLayoutErrorHandlerSchema = import_zod.z.lazy(
672
+ () => import_zod.z.object({
673
+ fallbackLayout: import_zod.z.array(layoutSchema).optional()
674
+ })
675
+ );
575
676
  var alertLayoutSchema = import_zod.z.lazy(
576
677
  () => import_zod.z.object({
577
678
  type: import_zod.z.literal("alert"),
@@ -581,7 +682,11 @@ var alertLayoutSchema = import_zod.z.lazy(
581
682
  margin: sizeSchema.optional(),
582
683
  callToAction: alertLayoutCallToActionSchema.optional(),
583
684
  analyticsId: import_zod.z.string().optional(),
584
- tags: import_zod.z.array(import_zod.z.string()).optional()
685
+ tags: import_zod.z.array(import_zod.z.string()).optional(),
686
+ title: import_zod.z.string().optional(),
687
+ media: mediaSchema.optional(),
688
+ onDismiss: requestSchema.optional(),
689
+ secondaryCallToAction: alertLayoutCallToActionSchema.optional()
585
690
  })
586
691
  );
587
692
  var alertLayoutCallToActionSchema = import_zod.z.lazy(
@@ -592,6 +697,29 @@ var alertLayoutCallToActionSchema = import_zod.z.lazy(
592
697
  context: contextSchema.optional()
593
698
  })
594
699
  );
700
+ var collectionLayoutItemSchema = import_zod.z.lazy(
701
+ () => import_zod.z.object({
702
+ entityId: import_zod.z.string(),
703
+ title: import_zod.z.string(),
704
+ description: import_zod.z.string().optional(),
705
+ disabled: import_zod.z.boolean().optional(),
706
+ primaryBehavior: behaviorSchema.optional(),
707
+ callToAction: collectionLayoutCallToActionSchema.optional(),
708
+ additionalInfo: additionalInfoSchema.optional(),
709
+ supportingValues: supportingValuesSchema.optional(),
710
+ inlineAlert: inlineAlertSchema.optional(),
711
+ media: mediaSchema.optional(),
712
+ analyticsId: import_zod.z.string().optional(),
713
+ tags: import_zod.z.array(import_zod.z.string()).optional()
714
+ })
715
+ );
716
+ var collectionLayoutCallToActionSchema = import_zod.z.lazy(
717
+ () => import_zod.z.object({
718
+ title: import_zod.z.string(),
719
+ accessibilityDescription: import_zod.z.string().optional(),
720
+ behavior: behaviorSchema
721
+ })
722
+ );
595
723
  var statusListLayoutItemCallToActionSchema = import_zod.z.lazy(
596
724
  () => import_zod.z.object({
597
725
  title: import_zod.z.string(),
@@ -722,6 +850,18 @@ var statusListLayoutItemSchema = import_zod.z.lazy(
722
850
  tags: import_zod.z.array(import_zod.z.string()).optional()
723
851
  })
724
852
  );
853
+ var collectionLayoutSchema = import_zod.z.lazy(
854
+ () => import_zod.z.object({
855
+ type: import_zod.z.literal("collection"),
856
+ baseRequest: requestSchema,
857
+ initialState: collectionLayoutStateSchema,
858
+ search: collectionLayoutSearchSchema.optional(),
859
+ control: import_zod.z.string().optional(),
860
+ margin: sizeSchema.optional(),
861
+ analyticsId: import_zod.z.string().optional(),
862
+ tags: import_zod.z.array(import_zod.z.string()).optional()
863
+ })
864
+ );
725
865
  var sectionLayoutSchema = import_zod.z.lazy(
726
866
  () => import_zod.z.object({
727
867
  type: import_zod.z.literal("section"),
@@ -731,37 +871,10 @@ var sectionLayoutSchema = import_zod.z.lazy(
731
871
  control: import_zod.z.string().optional(),
732
872
  margin: sizeSchema.optional(),
733
873
  analyticsId: import_zod.z.string().optional(),
734
- tags: import_zod.z.array(import_zod.z.string()).optional()
874
+ tags: import_zod.z.array(import_zod.z.string()).optional(),
875
+ shortTitle: import_zod.z.string().optional()
735
876
  })
736
877
  );
737
- var layoutSchema = import_zod.z.lazy(
738
- () => import_zod.z.union([
739
- alertLayoutSchema,
740
- boxLayoutSchema,
741
- buttonLayoutSchema,
742
- columnsLayoutSchema,
743
- decisionLayoutSchema,
744
- dividerLayoutSchema,
745
- formLayoutSchema,
746
- headingLayoutSchema,
747
- imageLayoutSchema,
748
- infoLayoutSchema,
749
- instructionsLayoutSchema,
750
- listLayoutSchema,
751
- loadingIndicatorLayoutSchema,
752
- markdownLayoutSchema,
753
- mediaLayoutSchema,
754
- modalLayoutSchema,
755
- paragraphLayoutSchema,
756
- progressLayoutSchema,
757
- reviewLayoutSchema,
758
- searchLayoutSchema,
759
- sectionLayoutSchema,
760
- statusListLayoutSchema,
761
- tabsLayoutSchema,
762
- upsellLayoutSchema
763
- ])
764
- );
765
878
  var searchLayoutSchema = import_zod.z.lazy(
766
879
  () => import_zod.z.object({
767
880
  type: import_zod.z.literal("search"),
@@ -1377,6 +1490,14 @@ var modalBehaviorSchema = import_zod.z.lazy(
1377
1490
  analytics: import_zod.z.record(import_zod.z.string()).optional()
1378
1491
  })
1379
1492
  );
1493
+ var delayBehaviorSchema = import_zod.z.lazy(
1494
+ () => import_zod.z.object({
1495
+ type: import_zod.z.literal("delay"),
1496
+ duration: import_zod.z.number(),
1497
+ behavior: behaviorSchema,
1498
+ analytics: import_zod.z.record(import_zod.z.string()).optional()
1499
+ })
1500
+ );
1380
1501
 
1381
1502
  // src/zod/validators.ts
1382
1503
  var validateStep = (step) => validate(step, stepSchema);