@rokt/dcui-orchestrator 1.2.1-rc.6 → 1.2.1-rc.61

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 (123) hide show
  1. package/dist/index.cjs +47 -38
  2. package/dist/index.js +59 -50
  3. package/dist/libraries/dcui-components/src/components/index.d.ts +3 -0
  4. package/dist/libraries/dcui-components/src/components/paypal-button/index.d.ts +1 -0
  5. package/dist/libraries/dcui-components/src/components/paypal-button/paypal-button.d.ts +78 -0
  6. package/dist/libraries/dcui-components/src/components/paypal-button/paypal-wordmark.d.ts +10 -0
  7. package/dist/libraries/dcui-components/src/components/progress-control/index.d.ts +1 -0
  8. package/dist/libraries/dcui-components/src/components/progress-control/progress-control.d.ts +49 -0
  9. package/dist/libraries/dcui-components/src/components/progress-indicator/get-progress-indicator-state.d.ts +3 -0
  10. package/dist/libraries/dcui-components/src/components/progress-indicator/index.d.ts +3 -0
  11. package/dist/libraries/dcui-components/src/components/progress-indicator/progress-indicator.d.ts +8 -0
  12. package/dist/libraries/dcui-components/src/components/progress-indicator/types.d.ts +88 -0
  13. package/dist/libraries/dcui-components/src/components/style-mapper/combiners/escape-css-string.d.ts +19 -0
  14. package/dist/libraries/dcui-components/src/components/style-mapper/combiners/index.d.ts +1 -0
  15. package/dist/libraries/dcui-components/src/contexts/index.d.ts +1 -0
  16. package/dist/libraries/dcui-components/src/contexts/lead-capture-offer-context.d.ts +5 -0
  17. package/dist/libraries/dcui-components/src/contexts/validators/validator-provider.d.ts +5 -3
  18. package/dist/libraries/dcui-components/src/failure-codes.d.ts +2 -0
  19. package/dist/libraries/dcui-components/src/utils/index.d.ts +1 -0
  20. package/dist/libraries/dcui-components/src/utils/link-schemes.d.ts +35 -0
  21. package/dist/libraries/dcui-components/src/utils/responsive-css.d.ts +9 -0
  22. package/dist/libraries/domain/src/behaviors/continuous-child.d.ts +62 -0
  23. package/dist/libraries/domain/src/behaviors/custom-states.d.ts +8 -1
  24. package/dist/libraries/domain/src/behaviors/index.d.ts +1 -0
  25. package/dist/libraries/domain/src/behaviors/offer-engagement.d.ts +11 -0
  26. package/dist/libraries/domain/src/behaviors/send-partner.d.ts +14 -2
  27. package/dist/libraries/domain/src/behaviors/trigger-action.d.ts +3 -3
  28. package/dist/libraries/domain/src/models/child-layout-response.d.ts +6 -0
  29. package/dist/libraries/domain/src/models/form-state.d.ts +85 -0
  30. package/dist/libraries/domain/src/models/global-state.d.ts +15 -1
  31. package/dist/libraries/domain/src/models/index.d.ts +1 -0
  32. package/dist/libraries/domain/src/models/layout/layout-offer.d.ts +2 -0
  33. package/dist/libraries/domain/src/models/partner-event.d.ts +1 -1
  34. package/dist/libraries/domain/src/models/plugin/plugin-child-layout-model.d.ts +1 -0
  35. package/dist/libraries/domain/src/models/plugin/plugin-offer.d.ts +2 -0
  36. package/dist/libraries/domain/src/models/purchase.d.ts +3 -0
  37. package/dist/libraries/layout-renderer-utils/src/reducers/breakpoint/coerce-breakpoints.d.ts +19 -0
  38. package/dist/libraries/layout-renderer-utils/src/reducers/breakpoint/index.d.ts +1 -0
  39. package/dist/libraries/layout-renderer-utils/src/sagas/error/error-codes.d.ts +3 -0
  40. package/dist/libraries/layout-renderer-utils/src/sagas/plugin/display.d.ts +3 -0
  41. package/dist/libraries/layout-renderer-utils/src/sagas/plugin/sagas.d.ts +4 -1
  42. package/dist/libraries/layout-renderer-utils/src/sagas/utils/index.d.ts +8 -1
  43. package/dist/libraries/layout-renderer-utils/src/sagas/utils/links.d.ts +28 -1
  44. package/dist/libraries/module-connector/src/main.d.ts +1 -1
  45. package/dist/libraries/module-connector/src/models/gateway.d.ts +19 -3
  46. package/dist/libraries/module-connector/src/models/module-attributes.d.ts +3 -0
  47. package/dist/libraries/module-connector/src/models/module-connector-builder.d.ts +1 -0
  48. package/dist/libraries/module-utils/src/sagas/child-layouts/sagas.d.ts +14 -4
  49. package/dist/libraries/orchestrator/src/actions/global-offer-data-state.d.ts +11 -1
  50. package/dist/libraries/orchestrator/src/actions/index.d.ts +2 -0
  51. package/dist/libraries/orchestrator/src/actions/module.d.ts +9 -1
  52. package/dist/libraries/orchestrator/src/cart-listener-gateway.d.ts +7 -0
  53. package/dist/libraries/orchestrator/src/components/progress-control/progress-control.d.ts +2 -45
  54. package/dist/libraries/orchestrator/src/components/progress-indicator/progress-indicator.d.ts +1 -9
  55. package/dist/libraries/orchestrator/src/components/progress-indicator/types.d.ts +1 -87
  56. package/dist/libraries/orchestrator/src/measurement/creative-measurement.d.ts +54 -0
  57. package/dist/libraries/orchestrator/src/models/state/global-offer-data-state.d.ts +6 -0
  58. package/dist/libraries/orchestrator/src/models/state/module.d.ts +1 -0
  59. package/dist/libraries/orchestrator/src/reducers/progression/reducer.d.ts +8 -0
  60. package/dist/libraries/orchestrator/src/sagas/child-layouts/continuous-child-host.d.ts +15 -0
  61. package/dist/libraries/orchestrator/src/sagas/child-layouts/continuous-child.d.ts +52 -0
  62. package/dist/libraries/orchestrator/src/sagas/index.d.ts +1 -1
  63. package/dist/libraries/orchestrator/src/sagas/offer-engagement/sagas.d.ts +3 -3
  64. package/dist/libraries/orchestrator/src/sagas/partner-cart-sync/sagas.d.ts +2 -2
  65. package/dist/libraries/orchestrator/src/sagas/progression/sagas.d.ts +8 -2
  66. package/dist/libraries/orchestrator/src/sagas/utils/distribution.d.ts +21 -0
  67. package/dist/libraries/orchestrator/src/sagas/utils/index.d.ts +3 -0
  68. package/dist/libraries/orchestrator/src/selectors/global-offer-data-state/selectors.d.ts +8 -1
  69. package/dist/libraries/plugin-utils/src/plugin-service/display.d.ts +1 -0
  70. package/dist/libraries/saga-utils/src/utils/index.d.ts +1 -0
  71. package/dist/libraries/saga-utils/src/utils/quantity-rules.d.ts +184 -0
  72. package/dist/modules/add-to-cart/src/actions/cart.d.ts +7 -1
  73. package/dist/modules/add-to-cart/src/actions/catalog-item.d.ts +15 -1
  74. package/dist/modules/add-to-cart/src/components/when-catalog-quantity/when-catalog-quantity.d.ts +2 -1
  75. package/dist/modules/add-to-cart/src/reducers/cart/reducer.d.ts +2 -1
  76. package/dist/modules/add-to-cart/src/sagas/index.d.ts +2 -1
  77. package/dist/modules/add-to-cart/src/sagas/update-cart-item/sagas.d.ts +6 -3
  78. package/dist/modules/add-to-cart/src/selectors/cart/selectors.d.ts +31 -0
  79. package/dist/modules/add-to-cart/src/selectors/catalogItems/selectors.d.ts +8 -0
  80. package/dist/modules/instant-purchase/src/actions/instant-purchase.d.ts +4 -0
  81. package/dist/modules/instant-purchase/src/components/catalog-device-pay-button/catalog-device-pay-button.d.ts +8 -0
  82. package/dist/modules/instant-purchase/src/components/catalog-selectors-stacked/catalog-selectors-stacked.d.ts +30 -0
  83. package/dist/modules/instant-purchase/src/constants/device-pay-error.d.ts +1 -1
  84. package/dist/modules/instant-purchase/src/models/state/device-pay-availability.d.ts +2 -0
  85. package/dist/modules/instant-purchase/src/models/state/instant-purchase.d.ts +4 -0
  86. package/dist/modules/instant-purchase/src/sagas/device-pay/sagas.d.ts +2 -7
  87. package/dist/modules/instant-purchase/src/sagas/instant-purchase/sagas.d.ts +17 -3
  88. package/dist/modules/instant-purchase/src/sagas/paypal/sagas.d.ts +2 -0
  89. package/dist/modules/instant-purchase/src/sagas/tax-and-shipping/sagas.d.ts +10 -20
  90. package/dist/modules/instant-purchase/src/selectors/catalog-selection/index.d.ts +1 -0
  91. package/dist/modules/instant-purchase/src/selectors/catalog-selection/selectors.d.ts +7 -0
  92. package/dist/modules/instant-purchase/src/selectors/device-pay-availability/selectors.d.ts +2 -0
  93. package/dist/modules/instant-purchase/src/selectors/index.d.ts +1 -0
  94. package/dist/modules/instant-purchase/src/selectors/tax-and-shipping/selectors.d.ts +8 -0
  95. package/dist/modules/instant-purchase/src/utils/compute-selections-for-item.d.ts +7 -0
  96. package/dist/modules/instant-purchase/src/utils/create-tax-and-shipping-cache-key.d.ts +4 -0
  97. package/dist/modules/instant-purchase/src/utils/parse-non-negative-monetary-amount.d.ts +1 -0
  98. package/dist/modules/instant-purchase/src/utils/requires-tax-and-shipping-initialization.d.ts +2 -0
  99. package/dist/modules/standard-marketing/src/sagas/offer-engagement/sagas.d.ts +2 -1
  100. package/node_modules/@rokt/dcui-layout-schema/dist/schema.d.ts +583 -21
  101. package/node_modules/@rokt/dcui-layout-schema/dist/tsconfig.tsbuildinfo +1 -1
  102. package/node_modules/@rokt/dcui-layout-schema/package.json +1 -1
  103. package/node_modules/@rokt/dcui-layout-schema/v1.21/index.d.ts +7105 -0
  104. package/node_modules/@rokt/dcui-layout-schema/v1.21/index.js +4 -0
  105. package/node_modules/@rokt/dcui-layout-schema/v1.22/index.d.ts +7121 -0
  106. package/node_modules/@rokt/dcui-layout-schema/v1.22/index.js +4 -0
  107. package/node_modules/@rokt/dcui-layout-schema/v1.23/index.d.ts +7126 -0
  108. package/node_modules/@rokt/dcui-layout-schema/v1.23/index.js +4 -0
  109. package/node_modules/@rokt/dcui-layout-schema/v1.24/index.d.ts +7492 -0
  110. package/node_modules/@rokt/dcui-layout-schema/v1.24/index.js +4 -0
  111. package/node_modules/@rokt/dcui-layout-schema/v1.25/index.d.ts +7510 -0
  112. package/node_modules/@rokt/dcui-layout-schema/v1.25/index.js +4 -0
  113. package/node_modules/@rokt/dcui-layout-schema/v1.26/index.d.ts +7516 -0
  114. package/node_modules/@rokt/dcui-layout-schema/v1.26/index.js +4 -0
  115. package/node_modules/@rokt/dcui-layout-schema/v1.27/index.d.ts +7577 -0
  116. package/node_modules/@rokt/dcui-layout-schema/v1.27/index.js +4 -0
  117. package/node_modules/@rokt/dcui-layout-schema/v1.28/index.d.ts +7628 -0
  118. package/node_modules/@rokt/dcui-layout-schema/v1.28/index.js +4 -0
  119. package/node_modules/@rokt/dcui-layout-schema/v1.29/index.d.ts +7643 -0
  120. package/node_modules/@rokt/dcui-layout-schema/v1.29/index.js +4 -0
  121. package/node_modules/@rokt/dcui-layout-schema/v1.30/index.d.ts +7659 -0
  122. package/node_modules/@rokt/dcui-layout-schema/v1.30/index.js +4 -0
  123. package/package.json +2 -2
@@ -31,3 +31,6 @@ export * from './form';
31
31
  export * from './text-input';
32
32
  export * from './action-button';
33
33
  export * from './apple-pay-button';
34
+ export * from './paypal-button';
35
+ export * from './progress-indicator';
36
+ export * from './progress-control';
@@ -0,0 +1 @@
1
+ export * from './paypal-button';
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import type { ThemeColor } from '@rokt/dcui-layout-schema';
3
+ /**
4
+ * Renders a PayPal-branded button whose look is fixed to the options in
5
+ * PayPal's button style guide (colors, shapes, height range), the same way
6
+ * ApplePayButton only offers Apple's styles. Layout styles can pick between
7
+ * those options but cannot restyle the brand.
8
+ * @see https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/
9
+ */
10
+ export type PayPalButtonColor = 'gold' | 'blue' | 'silver' | 'white' | 'black';
11
+ export type PayPalButtonStyle = {
12
+ color: {
13
+ light: PayPalButtonColor;
14
+ dark?: PayPalButtonColor;
15
+ };
16
+ };
17
+ export declare const PAYPAL_BUTTON_MIN_HEIGHT = 25;
18
+ export declare const PAYPAL_BUTTON_MAX_HEIGHT = 55;
19
+ export declare const PAYPAL_BUTTON_DEFAULT_HEIGHT = 45;
20
+ export declare const PAYPAL_BUTTON_DEFAULT_RADIUS = 4;
21
+ /**
22
+ * Base `own` styles to merge under the layout's own styles (with
23
+ * mergeStylesWithDefaults), so the defaults sit in the normal style cascade:
24
+ * layout breakpoints, pseudo-states and conditional transitions override them
25
+ * only where they apply.
26
+ */
27
+ export declare const PAYPAL_BUTTON_DEFAULT_OWN_STYLES: {
28
+ readonly dimension: {
29
+ readonly height: {
30
+ readonly type: "fixed";
31
+ readonly value: 45;
32
+ };
33
+ };
34
+ readonly border: {
35
+ readonly borderRadius: 4;
36
+ };
37
+ };
38
+ /**
39
+ * Structural shape of the `own` style hints this module reads, declared
40
+ * structurally so any schema node with `own` styles can pass itself.
41
+ */
42
+ export type PayPalButtonStyleSource = {
43
+ styles?: {
44
+ elements?: {
45
+ own?: ReadonlyArray<{
46
+ default?: {
47
+ background?: {
48
+ backgroundColor?: ThemeColor | null;
49
+ } | null;
50
+ } | null;
51
+ } | null> | null;
52
+ } | null;
53
+ } | null;
54
+ };
55
+ /**
56
+ * Derives the PayPal button color from the schema's `own` default styles.
57
+ * The background color picks gold, blue, silver, white or black by exact PayPal
58
+ * hex (#RGB, #RRGGBB, or alpha-first #ARGB / #AARRGGBB when fully opaque);
59
+ * anything else falls back to gold, PayPal's recommended color. A `dark` value
60
+ * applies in dark mode. Colors are brand-locked, so breakpoint blocks merge
61
+ * with last-non-null-wins, as for Apple Pay.
62
+ *
63
+ * Height and border radius are not derived: they stay in the layout's own
64
+ * class, merged over PAYPAL_BUTTON_DEFAULT_OWN_STYLES, and PayPalButton only
65
+ * bounds the height to PayPal's 25-55px range.
66
+ */
67
+ export declare function derivePayPalButtonStyle(schema: PayPalButtonStyleSource): PayPalButtonStyle;
68
+ type PayPalButtonProps = {
69
+ buttonStyle?: PayPalButtonStyle;
70
+ ariaLabel?: string;
71
+ className?: string;
72
+ disabled?: boolean;
73
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
74
+ tabIndex?: number;
75
+ testId?: string;
76
+ };
77
+ export declare const PayPalButton: React.ForwardRefExoticComponent<PayPalButtonProps & React.RefAttributes<HTMLButtonElement>>;
78
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type JSX } from 'react';
2
+ export type PayPalWordmarkVariant = 'blue' | 'white';
3
+ /**
4
+ * Shown or hidden with `--paypal-wordmark-<variant>-display`, so the button can
5
+ * swap variants in dark mode without recoloring either one. Outside a button,
6
+ * only the blue variant shows.
7
+ */
8
+ export declare function PayPalWordmark({ variant, }: {
9
+ variant: PayPalWordmarkVariant;
10
+ }): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './progress-control';
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { ProgressControlModel, NonInteractableChildren, WhenPredicate } from '@rokt/dcui-layout-schema';
3
+ export interface ProgressControlProps {
4
+ /**
5
+ * - `a11yLabel`: the aria-label for the button
6
+ * - `direction`: 'Forward' | 'Backward'.
7
+ * - `children`: it can accept below nodes,
8
+ * * `Row`
9
+ * * `Column`
10
+ * * `ZStack`
11
+ * * `BasicText`
12
+ * * `StaticImage`
13
+ * * `When`
14
+ * * `InlineContainer`
15
+ * - `styles`:
16
+ * * `elements`:
17
+ * * `own`:
18
+ * - `container`
19
+ * - `background`
20
+ * - `border`
21
+ * - `dimension`
22
+ * - `flexChild`
23
+ * - `spacing`
24
+ * * `transitions`:
25
+ * - `type`: 'Conditional'
26
+ * - `transition`:
27
+ * * `predicates`: WhenPredicate[]
28
+ * * `duration`: number
29
+ * * `value`:
30
+ * * `own`:
31
+ * - `container`
32
+ * - `background`
33
+ * - `border`
34
+ * - `dimension`
35
+ * - `flexChild`
36
+ * - `spacing`
37
+ */
38
+ schema: ProgressControlModel<NonInteractableChildren, WhenPredicate>;
39
+ testId?: string;
40
+ onClick: () => void;
41
+ /** Additional navigation boundary imposed by the owning renderer. */
42
+ disabled?: boolean;
43
+ }
44
+ /**The ProgressControl is a progress node that facilitates navigation
45
+ * through sequential steps or stages of a process or content.<br>
46
+ * It offers users the ability to move both forward and backward
47
+ * within a linear progression, allowing them to review and control their journey.<br>
48
+ * */
49
+ export declare function ProgressControl(props: ProgressControlProps): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ProgressIndicatorStateProps } from './types';
2
+ /** Resolve the schema's one-based (or end-relative) start position. */
3
+ export declare function getProgressIndicatorState(numberOfGroups: number, activeIndex: number, startPosition?: number | null): ProgressIndicatorStateProps;
@@ -0,0 +1,3 @@
1
+ export * from './progress-indicator';
2
+ export * from './types';
3
+ export * from './get-progress-indicator-state';
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { ProgressIndicatorProps } from './types';
3
+ /** The ProgressIndicator is a progress node that provides users with real-time
4
+ * feedback on the status of ongoing processes or actions.<br>
5
+ * It's a visual representation of progress, often displayed as a bar,
6
+ * circle, or numerical percentage.<br>
7
+ * */
8
+ export declare function ProgressIndicator({ activeIndex, startIndex, numOfIndicators, schema, ariaLabel, }: ProgressIndicatorProps): React.JSX.Element | null;
@@ -0,0 +1,88 @@
1
+ import { ProgressIndicatorModel, WhenPredicate } from '@rokt/dcui-layout-schema';
2
+ export interface ProgressIndicatorStateProps {
3
+ /** The number of indicators */
4
+ numOfIndicators: number;
5
+ /** The currently active index. */
6
+ activeIndex: number;
7
+ /** The index of the indicator to start displaying from **/
8
+ startIndex: number;
9
+ }
10
+ export interface ProgressIndicatorSchemaProps {
11
+ /**
12
+ * - `indicator`: The string content of the indicator.
13
+ * - `styles`:
14
+ * * `elements`:
15
+ * * `own`:
16
+ * - `container`
17
+ * - `background`
18
+ * - `border`
19
+ * - `dimension`
20
+ * - `flexChild`
21
+ * - `spacing`
22
+ * * `indicator`:
23
+ * - `container`
24
+ * - `background`
25
+ * - `border`
26
+ * - `dimension`
27
+ * - `flexChild`
28
+ * - `spacing`
29
+ * - `text`
30
+ * * `activeIndicator`:
31
+ * - `container`
32
+ * - `background`
33
+ * - `border`
34
+ * - `dimension`
35
+ * - `flexChild`
36
+ * - `spacing`
37
+ * - `text`
38
+ * * `seenIndicator`:
39
+ * - `container`
40
+ * - `background`
41
+ * - `border`
42
+ * - `dimension`
43
+ * - `flexChild`
44
+ * - `spacing`
45
+ * - `text`
46
+ * * `transitions`:
47
+ * - `type`: 'Conditional'
48
+ * - `transition`:
49
+ * * `predicates`: WhenPredicate[]
50
+ * * `duration`: number
51
+ * * `value`:
52
+ * * `own`:
53
+ * - `container`
54
+ * - `background`
55
+ * - `border`
56
+ * - `dimension`
57
+ * - `flexChild`
58
+ * - `spacing`
59
+ * * `indicator`:
60
+ * - `container`
61
+ * - `background`
62
+ * - `border`
63
+ * - `dimension`
64
+ * - `flexChild`
65
+ * - `spacing`
66
+ * - `text`
67
+ * * `activeIndicator`:
68
+ * - `container`
69
+ * - `background`
70
+ * - `border`
71
+ * - `dimension`
72
+ * - `flexChild`
73
+ * - `spacing`
74
+ * - `text`
75
+ * * `seenIndicator`:
76
+ * - `container`
77
+ * - `background`
78
+ * - `border`
79
+ * - `dimension`
80
+ * - `flexChild`
81
+ * - `spacing`
82
+ * - `text`
83
+ */
84
+ schema: ProgressIndicatorModel<WhenPredicate>;
85
+ }
86
+ export interface ProgressIndicatorProps extends ProgressIndicatorSchemaProps, ProgressIndicatorStateProps {
87
+ ariaLabel?: string;
88
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Escapes the characters that can end or escape a double-quoted CSS string:
3
+ * a double quote and a backslash get a backslash in front, and a CSS newline
4
+ * (LF, CR, FF) or a NUL becomes its hex escape with a space terminator. The
5
+ * css writer's parser (stylis) ends a quoted string at a raw NUL; the escape
6
+ * `\0 ` is read by the browser as U+FFFD, the code point CSS gives a NUL. A
7
+ * value written into url("...") then stays inside the quotes even when the
8
+ * validator in front of it lets one of them through.
9
+ *
10
+ * A colon and a semicolon become their hex escapes too. The css writer
11
+ * (Emotion) scans the whole style string for `label:<name>` and appends the
12
+ * name to the class it inserts, and the rule's own closing `");` ends a
13
+ * label that the value starts (the `")` is read into the name, the `;` ends
14
+ * it), so a label read out of the value would turn that class into a
15
+ * selector list that reaches the host page. The colon is escaped so the word
16
+ * label can never be followed by one, and the semicolon so a raw one cannot
17
+ * end such a label. The browser decodes both back to the same url.
18
+ */
19
+ export declare function escapeCSSString(value: string): string;
@@ -1,4 +1,5 @@
1
1
  export * from './apply-from-spec';
2
+ export * from './escape-css-string';
2
3
  export * from './join';
3
4
  export * from './join-to-css-rule';
4
5
  export * from './join-to-media-query';
@@ -3,6 +3,7 @@ export * from './global-state-context';
3
3
  export * from './node-mapper-context';
4
4
  export * from './root-element-context';
5
5
  export * from './offer-data-context';
6
+ export * from './lead-capture-offer-context';
6
7
  export * from './data-mapper-context';
7
8
  export * from './scoped-style-mapper-context';
8
9
  export * from './layout-schema-type-context';
@@ -0,0 +1,5 @@
1
+ import { PluginOffer } from '../../../domain/src/models';
2
+ /** Resolves the offer whose referral response a lead form belongs to. */
3
+ export type LeadCaptureOfferResolver = (offerPositionIndex?: number) => PluginOffer | undefined;
4
+ export declare const LeadCaptureOfferContext: import("react").Context<LeadCaptureOfferResolver>;
5
+ export declare const useLeadCaptureOffer: () => LeadCaptureOfferResolver;
@@ -1,14 +1,16 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactNode, RefObject } from 'react';
2
2
  export type Validator = () => boolean;
3
3
  export interface ValidatorFieldData {
4
4
  validators: Validator[];
5
5
  isValid: boolean;
6
+ element?: HTMLElement;
6
7
  }
7
8
  export type ValidatorMap = Record<string, ValidatorFieldData>;
8
9
  export interface ValidatorContextType {
9
- registerValidators: (validatorFieldKey: string, validators: Validator[]) => void;
10
+ registerValidators: (validatorFieldKey: string, validators: Validator[], element?: HTMLElement) => void;
10
11
  validateFieldKeys: (validatorFieldKey: string[]) => boolean;
11
12
  getFieldKeyValidity: (validatorFieldKey: string) => boolean;
13
+ focusFirstInvalidField?: () => void;
12
14
  }
13
15
  export declare const ValidatorContext: import("react").Context<ValidatorContextType | null>;
14
16
  /**
@@ -21,4 +23,4 @@ export declare function ValidatorProvider(props: {
21
23
  children: ReactNode;
22
24
  }): import("react").JSX.Element;
23
25
  export declare function useValidator(): ValidatorContextType;
24
- export declare function useRegisterValidators(validationFieldKey: string | undefined, validators: Validator[]): void;
26
+ export declare function useRegisterValidators(validationFieldKey: string | undefined, validators: Validator[], targetRef?: RefObject<HTMLElement | null>): void;
@@ -5,3 +5,5 @@ export declare const FAILED_TEMPLATING_DATA = "FAILED_TEMPLATING_DATA";
5
5
  export declare const FAILED_TO_MAP_STATIC_DATA = "FAILED_TO_MAP_STATIC_DATA";
6
6
  export declare const FAILED_SANITISING_HTML = "FAILED_SANITISING_HTML";
7
7
  export declare const UNRESOLVED_FORM_VALIDATION_TARGET = "UNRESOLVED_FORM_VALIDATION_TARGET";
8
+ export declare const MISSING_LEAD_IDENTITY = "MISSING_LEAD_IDENTITY";
9
+ export declare const UNSAFE_FORM_VALIDATION_PATTERN = "UNSAFE_FORM_VALIDATION_PATTERN";
@@ -2,6 +2,7 @@ export * from './apply-image-dimension-bounding';
2
2
  export * from './get-disabled-attributes';
3
3
  export * from './is-escape-hatch';
4
4
  export * from './is-touch-device';
5
+ export * from './link-schemes';
5
6
  export * from './merge-styles-with-defaults';
6
7
  export * from './node-factories';
7
8
  export * from './responsive-css';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * True when the url parses to a scheme that runs script. No base is needed: a
3
+ * relative href resolves to the page's own scheme, so it can never be one.
4
+ */
5
+ export declare function isScriptUrl(url: string): boolean;
6
+ /**
7
+ * A relative href ("#anchor", "/path") resolves against base, the page the
8
+ * plugin runs in. With no base only an absolute url can pass, because nothing
9
+ * says what the relative one would open.
10
+ */
11
+ export declare function isNavigableUrl(url: string, base?: string): boolean;
12
+ /**
13
+ * What the asserts throw, so a catch block can tell the guard's refusal from
14
+ * a failed open and report it under REFUSED_LINK_SCHEME rather than
15
+ * FAILED_TO_OPEN_LINK. The message names the scheme for whoever reads that
16
+ * report.
17
+ */
18
+ export declare class RefusedLinkError extends Error {
19
+ constructor(message: string);
20
+ }
21
+ export declare function isRefusedLink(err: unknown): err is RefusedLinkError;
22
+ export declare function assertNavigableUrl(url: string, base?: string): void;
23
+ export declare function assertNotScriptUrl(url: string, base?: string): void;
24
+ /**
25
+ * The html a rich text renders has passed the sanitiser, but an entity in an
26
+ * href ("javascript&colon;", "java&#9;script:") is decoded by the browser
27
+ * only after that check. This parses the html the way the browser will, into
28
+ * an inert template, and removes every anchor href whose decoded scheme runs
29
+ * script. Html with nothing to remove is returned exactly as it came.
30
+ *
31
+ * Call it on the final string, after every regex pass that rewrites tags. An
32
+ * older serialiser writes "<" raw inside an attribute value, so a pass that
33
+ * runs after it can turn an href's text into a tag with its own attributes.
34
+ */
35
+ export declare function dropScriptHrefs(html: string): string;
@@ -1 +1,10 @@
1
+ /**
2
+ * A breakpoint width is written into CSS text, a media query or a class name,
3
+ * so only a finite, non-negative number is interpolated. The store replaces
4
+ * every other layout value before it arrives here; this is the second check,
5
+ * for a width that reaches the style mapper another way. A value that is not
6
+ * a width gets a form that matches nothing, never a rule that applies
7
+ * everywhere.
8
+ */
9
+ export declare function isBreakpointWidth(width: unknown): width is number;
1
10
  export declare function getBreakpointCSSClass(width?: number): string;
@@ -0,0 +1,62 @@
1
+ import { LinkOpenTarget } from '@rokt/dcui-layout-schema';
2
+ import { PluginChildLayoutModel } from '../models';
3
+ /** Plugin builds support explicit continuationKey opt-in; standalone consumers stay off. */
4
+ export declare function isContinuousChildEnabled(environment: string | undefined): boolean;
5
+ export declare const CONTINUOUS_CHILD_CAPABILITY_ENABLED: boolean;
6
+ export declare const CONTINUOUS_CHILD_VERSION = 1;
7
+ export declare const CONTINUOUS_CHILD_EVENTS: {
8
+ readonly READY: "CONTINUOUS_CHILD/READY";
9
+ readonly PRESENTATION: "CONTINUOUS_CHILD/PRESENTATION";
10
+ readonly APPLIED: "CONTINUOUS_CHILD/APPLIED";
11
+ readonly REQUEST: "CONTINUOUS_CHILD/REQUEST";
12
+ readonly EXPOSURE: "CONTINUOUS_CHILD/EXPOSURE";
13
+ };
14
+ /** Generated Web 1.30 child schema contract. */
15
+ export type ContinuousChildSchema = PluginChildLayoutModel['childLayoutSchema'];
16
+ export interface ContinuousIdentity {
17
+ sessionId: string;
18
+ revision: number;
19
+ position: number;
20
+ creativeInstanceGuid: string;
21
+ /** Optional serving tracking metadata; session/revision and creative identity remain required. */
22
+ childInstanceGuid?: string;
23
+ }
24
+ export interface ContinuousPresentationInput {
25
+ config: PluginChildLayoutModel;
26
+ position: number;
27
+ ownsViewability: boolean;
28
+ }
29
+ export interface ContinuousPresentation extends ContinuousPresentationInput {
30
+ identity: ContinuousIdentity;
31
+ totalCount: number;
32
+ }
33
+ export interface ContinuousRequest {
34
+ identity: ContinuousIdentity;
35
+ actionId: string;
36
+ openLinks?: LinkOpenTarget;
37
+ dismissalMethod?: string;
38
+ inferredView?: {
39
+ supportedByBrowser: boolean;
40
+ };
41
+ action: 'next' | 'previous' | 'positive' | 'negative' | 'close';
42
+ }
43
+ export interface ContinuousExposure {
44
+ identity: ContinuousIdentity;
45
+ kind: 'rendered' | 'qualified';
46
+ inferred: boolean;
47
+ supportedByBrowser: boolean;
48
+ }
49
+ export declare const continuousEnvelope: <T>(payload: T) => {
50
+ version: number;
51
+ payload: T;
52
+ };
53
+ export declare function isContinuousEnvelope(value: unknown): value is {
54
+ version: 1;
55
+ payload: unknown;
56
+ };
57
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
58
+ export declare function isContinuousIdentity(value: unknown): value is ContinuousIdentity;
59
+ export declare function sameContinuousIdentity(a: ContinuousIdentity, b: ContinuousIdentity): boolean;
60
+ export declare function isContinuousRequest(value: unknown): value is ContinuousRequest;
61
+ export declare function isContinuousExposure(value: unknown): value is ContinuousExposure;
62
+ export declare function isContinuousPresentation(value: unknown): value is ContinuousPresentation;
@@ -17,11 +17,18 @@ export declare function isValidSetCustomStatePayload(payload: unknown): payload
17
17
  export declare const DEVICE_PAY_PROCESSING_STATE_KEY = "ProcessingState";
18
18
  export declare const DEVICE_PAY_PROCESSING_IDLE = 0;
19
19
  export declare const DEVICE_PAY_PROCESSING_IN_FLIGHT = 1;
20
- export declare const DEVICE_PAY_AVAILABILITY_KEYS: readonly ["applePay", "afterpay"];
20
+ export declare const DEVICE_PAY_AVAILABILITY_KEYS: readonly ["applePay", "afterpay", "paypal", "googlePay"];
21
21
  export type DevicePayProviderKey = (typeof DEVICE_PAY_AVAILABILITY_KEYS)[number];
22
22
  export declare const DEVICE_PAY_APPLE_PAY_AVAILABLE_STATE_KEY = "applePayAvailable";
23
23
  export declare const DEVICE_PAY_ERROR_STATE_KEY = "DevicePayErrorState";
24
24
  export declare const DEVICE_PAY_ERROR_HIDDEN = 0;
25
25
  export declare const DEVICE_PAY_ERROR_RETRYABLE_DECLINE = 1;
26
+ /**
27
+ * PayPal's own retryable-decline state, separate from DEVICE_PAY_ERROR_STATE_KEY
28
+ * (Apple Pay's) so a decline in one provider never shows or focuses an error on
29
+ * the other's button. Same values: DEVICE_PAY_ERROR_HIDDEN or
30
+ * DEVICE_PAY_ERROR_RETRYABLE_DECLINE.
31
+ */
32
+ export declare const DEVICE_PAY_PAYPAL_ERROR_STATE_KEY = "PayPalDevicePayErrorState";
26
33
  /** @deprecated Use DEVICE_PAY_APPLE_PAY_AVAILABLE_STATE_KEY for new layouts. */
27
34
  export declare const DEVICE_PAY_APPLE_PAY_UNAVAILABLE_STATE_KEY = "applePayUnavailable";
@@ -18,3 +18,4 @@ export * from './dismiss-overlay';
18
18
  export * from './trigger-action';
19
19
  export * from './form-state';
20
20
  export * from './report-error';
21
+ export * from './continuous-child';
@@ -14,10 +14,12 @@ export interface OfferEngagementFulfillmentPayload {
14
14
  fulfillment: Fulfillment;
15
15
  accountID: string;
16
16
  referralCreativeID?: string;
17
+ adID?: string;
17
18
  }
18
19
  export interface OfferEngagementUrlPayload extends PluginCreativeUrlResponseOption {
19
20
  accountID: string;
20
21
  referralCreativeID?: string;
22
+ adID?: string;
21
23
  creativeInstanceGuid?: string;
22
24
  }
23
25
  export interface OfferEngagementProductItemResponsePayload extends OfferEngagementUrlPayload {
@@ -44,6 +46,15 @@ export declare function isRealTimeReferralOnly(response: OfferEngagementPayload
44
46
  })): response is OfferEngagementPayload & {
45
47
  accountID: string;
46
48
  referralCreativeID: string;
49
+ adID?: string;
50
+ };
51
+ /**
52
+ * `adID` is the key the Web SDK's realtime-conversion-promotion extension reads.
53
+ * Anything but a non-empty string yields no key, so a payload or event without
54
+ * an ad id keeps exactly the keys it had before.
55
+ */
56
+ export declare function adIDField(adID: string | undefined): {
57
+ adID?: string;
47
58
  };
48
59
  export declare function makeCaptureOnlyOfferEngagementPayload(offerPayload?: Partial<OfferEngagementCaptureOnlyPayload>): OfferEngagementCaptureOnlyPayload;
49
60
  export declare function makeUrlOfferEngagementPayload(offerPayload?: Partial<OfferEngagementUrlPayload>): OfferEngagementUrlPayload;
@@ -14,6 +14,7 @@ export type OutboundRealtimeOfferFulfillmentReferralEventPayload = {
14
14
  rclid: string;
15
15
  accountID: string;
16
16
  referralCreativeID: string;
17
+ adID?: string;
17
18
  referralOnly?: boolean;
18
19
  rewardHandoff?: boolean;
19
20
  };
@@ -24,6 +25,7 @@ export type OutboundRealtimeOfferFulfillmentConversionEventPayload = {
24
25
  rclid: string;
25
26
  accountID: string;
26
27
  referralCreativeID: string;
28
+ adID?: string;
27
29
  rewardHandoff?: boolean;
28
30
  };
29
31
  };
@@ -80,10 +82,20 @@ export type OutboundAbortDevicePayEventPayload = {
80
82
  export type OutboundCompleteDevicePayEventPayload = {
81
83
  name: 'COMPLETE_DEVICE_PAY_EVENT';
82
84
  };
83
- export type OutboundPartnerEventPayload<EventType extends OutboundPartnerEvent> = EventType extends 'REALTIME_OFFER_FULFILLMENT_REFERRAL' ? OutboundRealtimeOfferFulfillmentReferralEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_CONVERSION' ? OutboundRealtimeOfferFulfillmentConversionEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_SUCCESS' ? OutboundRealtimeOfferFulfillmentSuccessEventPayload : EventType extends 'V2_CART_ITEM_UPDATED' | 'UPDATE_CART_ITEM_MESSAGE' | 'CART_ITEM_INSTANT_PURCHASE' | 'UPSELL_ITEM_INSTANT_PURCHASE' | 'UPSELL_CREATIVE_SENT' | 'INITIATE_INSTANT_PURCHASE_EVENT' | 'INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT' | 'INITIATE_CART_ITEM_EVENT' | 'DELIVERY_DETAILS_SENT' | 'PREPARE_DEVICE_PAY_EVENT' | 'INITIATE_DEVICE_PAY_EVENT' | 'ABORT_DEVICE_PAY_EVENT' | 'COMPLETE_DEVICE_PAY_EVENT' ? never : {
85
+ export type OutboundLeadCaptureSubmittedEventPayload = {
86
+ name: 'LEAD_CAPTURE_SUBMITTED';
87
+ body: {
88
+ email?: string;
89
+ mobile_number?: string;
90
+ rclid?: string;
91
+ accountID?: string;
92
+ referralCreativeID?: string;
93
+ };
94
+ };
95
+ export type OutboundPartnerEventPayload<EventType extends OutboundPartnerEvent> = EventType extends 'LEAD_CAPTURE_SUBMITTED' ? OutboundLeadCaptureSubmittedEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_REFERRAL' ? OutboundRealtimeOfferFulfillmentReferralEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_CONVERSION' ? OutboundRealtimeOfferFulfillmentConversionEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_SUCCESS' ? OutboundRealtimeOfferFulfillmentSuccessEventPayload : EventType extends 'V2_CART_ITEM_UPDATED' | 'UPDATE_CART_ITEM_MESSAGE' | 'CART_ITEM_INSTANT_PURCHASE' | 'UPSELL_ITEM_INSTANT_PURCHASE' | 'UPSELL_CREATIVE_SENT' | 'INITIATE_INSTANT_PURCHASE_EVENT' | 'INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT' | 'INITIATE_CART_ITEM_EVENT' | 'DELIVERY_DETAILS_SENT' | 'PREPARE_DEVICE_PAY_EVENT' | 'INITIATE_DEVICE_PAY_EVENT' | 'ABORT_DEVICE_PAY_EVENT' | 'COMPLETE_DEVICE_PAY_EVENT' ? never : {
84
96
  name: EventType;
85
97
  };
86
98
  export type SendPartner<EventType extends OutboundPartnerEvent> = {
87
99
  type: typeof SEND_PARTNER;
88
- payload: OutboundPartnerEventPayload<EventType> | OutboundUpdateCartEventPayload | OutboundUpdateCartItemMessageEventPayload | OutboundInstantPurchaseEventPayload | OutboundUpsellItemInstantPurchaseEventPayload | OutboundUpsellCreativeSentEventPayload | OutboundInstantPurchaseWsdkEventPayload | OutboundInstantPurchaseTaxAndShippingEventPayload | OutboundCartItemEventPayload | OutboundDeliveryDetailsSentEventPayload | OutboundPrepareDevicePayEventPayload | OutboundDevicePayEventPayload | OutboundAbortDevicePayEventPayload | OutboundCompleteDevicePayEventPayload;
100
+ payload: OutboundPartnerEventPayload<EventType> | OutboundUpdateCartEventPayload | OutboundUpdateCartItemMessageEventPayload | OutboundInstantPurchaseEventPayload | OutboundUpsellItemInstantPurchaseEventPayload | OutboundUpsellCreativeSentEventPayload | OutboundInstantPurchaseWsdkEventPayload | OutboundInstantPurchaseTaxAndShippingEventPayload | OutboundCartItemEventPayload | OutboundDeliveryDetailsSentEventPayload | OutboundPrepareDevicePayEventPayload | OutboundDevicePayEventPayload | OutboundAbortDevicePayEventPayload | OutboundCompleteDevicePayEventPayload | OutboundLeadCaptureSubmittedEventPayload;
89
101
  };
@@ -1,14 +1,14 @@
1
- import { LayoutAction, LayoutVariantAction, OuterLayoutAction } from '@rokt/dcui-layout-schema';
1
+ import { ChildLayoutAction, LayoutAction, LayoutVariantAction, OuterLayoutAction } from '@rokt/dcui-layout-schema';
2
2
  import { PluginOffer } from '../models';
3
3
  export declare const TRIGGER_ACTION = "GLOBAL/TRIGGER_ACTION";
4
4
  /**
5
5
  * Actions a trigger (e.g. a layout timer or button) can carry. A trigger may
6
- * originate in any of the three layout contexts, so the channel accepts the
6
+ * originate in any of the four layout contexts, so the channel accepts the
7
7
  * union of all their action sets rather than assuming one stays a superset of
8
8
  * the others. This keeps producers in every context assignable even if the
9
9
  * sets diverge in future schema versions.
10
10
  */
11
- export type TriggerableAction = LayoutAction | OuterLayoutAction | LayoutVariantAction;
11
+ export type TriggerableAction = LayoutAction | OuterLayoutAction | LayoutVariantAction | ChildLayoutAction;
12
12
  export interface TriggerAction {
13
13
  type: typeof TRIGGER_ACTION;
14
14
  payload: {
@@ -0,0 +1,6 @@
1
+ import { PluginOffer } from './plugin/plugin-offer';
2
+ import { PluginCreativeCaptureOnlyResponseOption, PluginCreativeUrlResponseOption } from './plugin/plugin-creative-response-option';
3
+ /** Child acceptance supports ordinary positive URLs, not deferred fulfillment. */
4
+ export declare function getChildPositiveResponse(offer: PluginOffer | null, responseKey: string): PluginCreativeUrlResponseOption | undefined;
5
+ /** Persistent children dispatch ordinary responses through the current parent module. */
6
+ export declare function getContinuousChildResponse(offer: PluginOffer | null, responseKey: 'positive' | 'negative'): PluginCreativeUrlResponseOption | PluginCreativeCaptureOnlyResponseOption | undefined;