@rokt/dcui-orchestrator 0.0.4-rc.0 → 0.0.4-rc.10

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.
@@ -12,6 +12,14 @@ export type OutboundRealtimeOfferFulfillmentReferralEventPayload = {
12
12
  referralCreativeID: string;
13
13
  };
14
14
  };
15
+ export type OutboundRealtimeOfferFulfillmentConversionEventPayload = {
16
+ name: 'REALTIME_OFFER_FULFILLMENT_CONVERSION';
17
+ body: {
18
+ rclid: string;
19
+ accountID: string;
20
+ referralCreativeID: string;
21
+ };
22
+ };
15
23
  export type OutboundRealtimeOfferFulfillmentSuccessEventPayload = {
16
24
  name: 'REALTIME_OFFER_FULFILLMENT_SUCCESS';
17
25
  body: Record<string, string>;
@@ -28,7 +36,7 @@ export type OutboundUpsellCreativeSentEventPayload = {
28
36
  description: string;
29
37
  };
30
38
  };
31
- export type OutboundPartnerEventPayload<EventType extends OutboundPartnerEvent> = EventType extends 'REALTIME_OFFER_FULFILLMENT_REFERRAL' ? OutboundRealtimeOfferFulfillmentReferralEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_SUCCESS' ? OutboundRealtimeOfferFulfillmentSuccessEventPayload : EventType extends 'V2_CART_ITEM_UPDATED' | 'CART_ITEM_INSTANT_PURCHASE' | 'UPSELL_CREATIVE_SENT' ? never : {
39
+ 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' | 'CART_ITEM_INSTANT_PURCHASE' | 'UPSELL_CREATIVE_SENT' ? never : {
32
40
  name: EventType;
33
41
  };
34
42
  export type SendPartner<EventType extends OutboundPartnerEvent> = {
@@ -1,5 +1,5 @@
1
1
  export type CatalogOutboundPartnerEvent = 'V2_CART_ITEM_UPDATED' | 'CART_ITEM_INSTANT_PURCHASE';
2
- export type OfferOutboundPartnerEvent = CatalogOutboundPartnerEvent | 'OFFER_ENGAGEMENT' | 'POSITIVE_ENGAGEMENT' | 'UPSELL_CREATIVE_SENT' | 'REALTIME_OFFER_FULFILLMENT_REFERRAL' | 'REALTIME_OFFER_FULFILLMENT_SUCCESS';
2
+ export type OfferOutboundPartnerEvent = CatalogOutboundPartnerEvent | 'OFFER_ENGAGEMENT' | 'POSITIVE_ENGAGEMENT' | 'UPSELL_CREATIVE_SENT' | 'REALTIME_OFFER_FULFILLMENT_REFERRAL' | 'REALTIME_OFFER_FULFILLMENT_CONVERSION' | 'REALTIME_OFFER_FULFILLMENT_SUCCESS';
3
3
  export type OutboundPartnerEvent = OfferOutboundPartnerEvent | 'PLACEMENT_CLOSED' | 'PLACEMENT_COMPLETED' | 'PLACEMENT_INTERACTIVE' | 'PLACEMENT_FAILURE';
4
4
  export declare function isOutboundPartnerEvent(value: unknown): value is OutboundPartnerEvent;
5
5
  export declare function isOfferOutboundPartnerEvent(value: unknown): value is OfferOutboundPartnerEvent;
@@ -2,9 +2,14 @@ import { PluginCatalogItem } from '../../../../libraries/domain/src/models';
2
2
  export type SetSelectedItemPayload = {
3
3
  catalogItem: PluginCatalogItem;
4
4
  };
5
+ export declare const TRIGGER_SELECT_ITEM = "CATALOG/TRIGGER_SELECT_ITEM";
6
+ export type TriggerSelectItemAction = {
7
+ type: typeof TRIGGER_SELECT_ITEM;
8
+ payload: SetSelectedItemPayload;
9
+ };
5
10
  export declare const SET_SELECTED_ITEM = "CATALOG/SET_SELECTED_ITEM";
6
- export type SetSelectedItem = {
11
+ export type SetSelectedItemAction = {
7
12
  type: typeof SET_SELECTED_ITEM;
8
13
  payload: SetSelectedItemPayload;
9
14
  };
10
- export type CatalogSelectionActions = SetSelectedItem;
15
+ export type CatalogSelectionActions = SetSelectedItemAction | TriggerSelectItemAction;
@@ -0,0 +1,9 @@
1
+ import { LayoutSchemaModel, ToggleButtonStateTriggerModel, WhenPredicate } from '@rokt/dcui-layout-schema';
2
+ export interface ButtonStateTriggerModel<Children, Predicates> extends ToggleButtonStateTriggerModel<Children, Predicates> {
3
+ customStateValue: number;
4
+ }
5
+ export interface ButtonStateTriggerProps {
6
+ schema: ButtonStateTriggerModel<LayoutSchemaModel, WhenPredicate>;
7
+ testId?: string;
8
+ }
9
+ export declare function ButtonStateTrigger(props: ButtonStateTriggerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { BackgroundStylingProperties, BasicStateStylingBlock, BorderStylingProperties, ConditionalStyleTransition, ContainerStylingProperties, DimensionStylingProperties, FlexChildStylingProperties, LayoutStyle, NonInteractableChildren, SpacingStylingProperties, TextStylingProperties, WhenPredicate } from '@rokt/dcui-layout-schema';
2
2
  import { PluginCatalogItem } from '../../../../../libraries/domain/src/models';
3
- export interface DropDownStyles {
3
+ export interface CatalogDropDownStyles {
4
4
  container?: null | ContainerStylingProperties;
5
5
  background?: null | BackgroundStylingProperties;
6
6
  border?: null | BorderStylingProperties;
@@ -9,29 +9,28 @@ export interface DropDownStyles {
9
9
  spacing?: null | SpacingStylingProperties;
10
10
  text?: null | TextStylingProperties;
11
11
  }
12
- export interface DropDownTransitions {
13
- own?: null | DropDownStyles;
12
+ export interface CatalogDropDownTransitions {
13
+ own?: null | CatalogDropDownStyles;
14
14
  }
15
- export interface DropDownElements {
16
- own: BasicStateStylingBlock<DropDownStyles>[];
17
- dropDownSelectedElement?: null | BasicStateStylingBlock<DropDownStyles>[];
18
- dropDownListContainer?: null | BasicStateStylingBlock<DropDownStyles>[];
19
- dropDownListElement?: null | BasicStateStylingBlock<DropDownStyles>[];
15
+ export interface CatalogDropDownElements {
16
+ own: BasicStateStylingBlock<CatalogDropDownStyles>[];
17
+ dropDownSelectedElement?: null | BasicStateStylingBlock<CatalogDropDownStyles>[];
18
+ dropDownListContainer?: null | BasicStateStylingBlock<CatalogDropDownStyles>[];
19
+ dropDownListElement?: null | BasicStateStylingBlock<CatalogDropDownStyles>[];
20
20
  }
21
- export interface DropDownOptionData {
21
+ export interface CatalogDropDownOptionData {
22
22
  catalogItem: PluginCatalogItem;
23
23
  index: number;
24
24
  }
25
- interface DropDownModel<NonInteractableChildren, Predicates> {
26
- styles?: null | LayoutStyle<DropDownElements, ConditionalStyleTransition<DropDownTransitions, Predicates>>;
25
+ interface CatalogDropDownModel<NonInteractableChildren, Predicates> {
26
+ styles?: null | LayoutStyle<CatalogDropDownElements, ConditionalStyleTransition<CatalogDropDownTransitions, Predicates>>;
27
27
  openTemplate: NonInteractableChildren;
28
28
  closedTemplate: NonInteractableChildren;
29
- closedDefaultTemplate: NonInteractableChildren;
30
- options: DropDownOptionData[];
29
+ options: CatalogDropDownOptionData[];
31
30
  }
32
- export interface DropDownProps {
31
+ export interface CatalogDropDownProps {
33
32
  /**
34
- * - `openTemplate`, `closedTemplate`, `closedDefaultTemplate`: it can accept below nodes,
33
+ * - `openTemplate`, `closedTemplate`: it can accept below nodes,
35
34
  * * `Row`
36
35
  * * `FlowRow
37
36
  * * `Column`
@@ -68,8 +67,8 @@ export interface DropDownProps {
68
67
  * - `spacing`
69
68
  * - `text`
70
69
  */
71
- schema: DropDownModel<NonInteractableChildren, WhenPredicate>;
70
+ schema: CatalogDropDownModel<NonInteractableChildren, WhenPredicate>;
72
71
  testId?: string;
73
72
  }
74
- export declare function DropDown(props: DropDownProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function CatalogDropDown(props: CatalogDropDownProps): import("react/jsx-runtime").JSX.Element;
75
74
  export {};
@@ -0,0 +1,25 @@
1
+ import { BackgroundStylingProperties, BasicStateStylingBlock, BorderStylingProperties, ConditionalStyleTransition, ContainerStylingProperties, DimensionStylingProperties, FlexChildStylingProperties, LayoutStyle, SpacingStylingProperties, WhenPredicate } from '@rokt/dcui-layout-schema';
2
+ interface ColorSwatchStyles {
3
+ container?: null | ContainerStylingProperties;
4
+ background?: null | BackgroundStylingProperties;
5
+ border?: null | BorderStylingProperties;
6
+ dimension?: null | DimensionStylingProperties;
7
+ flexChild?: null | FlexChildStylingProperties;
8
+ spacing?: null | SpacingStylingProperties;
9
+ }
10
+ interface ColorSwatchElements {
11
+ own: BasicStateStylingBlock<ColorSwatchStyles>[];
12
+ }
13
+ interface ColorSwatchTransitions {
14
+ own: null | ColorSwatchStyles;
15
+ }
16
+ export interface ColorSwatchModel<Predicates> {
17
+ styles?: null | LayoutStyle<ColorSwatchElements, ConditionalStyleTransition<ColorSwatchTransitions, Predicates>>;
18
+ value: string;
19
+ }
20
+ export interface ColorSwatchProps {
21
+ schema: ColorSwatchModel<WhenPredicate>;
22
+ testId?: string;
23
+ }
24
+ export declare function ColorSwatch(props: ColorSwatchProps): import("react/jsx-runtime").JSX.Element | null;
25
+ export {};
@@ -1,15 +1,17 @@
1
1
  import { GlobalActions } from '../../../../libraries/domain/src/behaviors';
2
- import { ChildLayoutActions, childLayoutsReducer, ChildLayoutsState, StaticData, staticDataReducer } from '@rokt/module-utils';
2
+ import { ChildLayoutActions, childLayoutsReducer, ChildLayoutsState, StaticData, staticDataReducer, DynamicData, dynamicDataReducer } from '@rokt/module-utils';
3
3
  import { CatalogSelectionState } from '../models/state/catalog-selection';
4
4
  export type AppState = {
5
5
  staticData: StaticData;
6
6
  selectedItem: CatalogSelectionState;
7
+ dynamicData: DynamicData;
7
8
  childLayouts: ChildLayoutsState;
8
9
  };
9
10
  export type StateActions = GlobalActions | ChildLayoutActions;
10
11
  export declare const appReducers: {
11
12
  staticData: typeof staticDataReducer;
12
13
  selectedItem: (state: CatalogSelectionState | undefined, action: import("redux").AnyAction) => CatalogSelectionState;
14
+ dynamicData: typeof dynamicDataReducer;
13
15
  childLayouts: typeof childLayoutsReducer;
14
16
  };
15
17
  export declare function makeAppInitialState(data?: Partial<AppState>): AppState;
@@ -16,4 +16,4 @@ export declare const sagaActionTypes: {
16
16
  readonly SET_GLOBAL_OFFER_DATA_CART: "GLOBAL/SET_GLOBAL_OFFER_DATA_CART";
17
17
  readonly LAUNCH_CHILD_LAYOUT: "GLOBAL/LAUNCH_CHILD_LAYOUT";
18
18
  };
19
- export declare function appSagas(gateway: GlobalGateway, logger: (log: Log) => void): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<never>>, void, unknown>;
19
+ export declare function appSagas(gateway: GlobalGateway, logger: (log: Log) => void): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<void>>, void, unknown>;
@@ -1,9 +1,12 @@
1
1
  import { SelectEffect, PutEffect, CallEffect } from 'redux-saga/effects';
2
- import { Log } from '../../../../../libraries/domain/src/models';
3
- import { InitiateInstantPurchase, InstantPurchasePartnerResponse } from '../../actions/instant-purchase';
2
+ import { Log, PluginCatalogItem } from '../../../../../libraries/domain/src/models';
4
3
  import { GlobalGateway } from '../../../../../libraries/module-connector/src/main';
5
4
  import { StaticData } from '@rokt/module-utils';
5
+ import { InitiateInstantPurchase, InstantPurchasePartnerResponse } from '../../actions/instant-purchase';
6
+ import { TriggerSelectItemAction } from '../../actions';
6
7
  export declare const INSTANT_PURCHASE_RESPONSE_TTL = 60000;
8
+ export declare function processSelectFirstCatalogItem(): Generator<SelectEffect | PutEffect, void, PluginCatalogItem | undefined>;
9
+ export declare function processSelectCatalogItem(action: TriggerSelectItemAction): Generator<PutEffect, void, PluginCatalogItem | undefined>;
7
10
  export declare function processInstantPurchaseCartItem(gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateInstantPurchase): Generator<CallEffect<void> | import("redux-saga/effects").ForkEffect<void> | PutEffect<{
8
11
  type: string;
9
12
  payload: {
@@ -0,0 +1 @@
1
+ export * from './selectors';
@@ -0,0 +1,4 @@
1
+ import { AppState } from '../../reducers';
2
+ import { PluginCatalogItem } from '../../../../../libraries/domain/src/models';
3
+ export declare function getCatalogItems(state: AppState): Array<PluginCatalogItem>;
4
+ export declare function getFirstCatalogItem(state: AppState): PluginCatalogItem | undefined;
@@ -0,0 +1 @@
1
+ export * from './catalogItems';
@@ -2,10 +2,12 @@ import { GlobalActions, OfferEngagement, OfferEngagementFulfillmentPayload } fro
2
2
  import { Log } from '../../../../../libraries/domain/src/models';
3
3
  import { GlobalGateway } from '../../../../../libraries/module-connector/src/main';
4
4
  import { CallEffect, CancelledEffect, ChannelTakeEffect, PutEffect, TakeEffect } from 'redux-saga/effects';
5
+ import { ChildPluginFactoryInterface } from '@rokt/plugin';
5
6
  import { ChildPluginResult, RealtimeFulfillmentEvent } from './channels';
6
7
  import { EventChannel } from 'redux-saga';
8
+ type ChildPlugin = ReturnType<ChildPluginFactoryInterface['create']>;
7
9
  export declare function listenToChildPluginChannel(channel: EventChannel<ChildPluginResult>, dispatch: (action: GlobalActions) => void, isRealtimeConversion: boolean, realtimeSuccessCallback?: () => Generator<CallEffect<void> | PutEffect, void, void>): Generator<CallEffect<void> | ChannelTakeEffect<"SUCCESS" | "UNSPECIFIED" | "CLOSED">, void, ChildPluginResult>;
8
- export declare function getRealtimeFulfillmentSuccessCallback(gateway: GlobalGateway, logger: (log: Log) => void, payload: OfferEngagementFulfillmentPayload): (() => Generator<CallEffect<void> | PutEffect<{
10
+ export declare function getRealtimeFulfillmentSuccessCallback(gateway: GlobalGateway, logger: (log: Log) => void, payload: OfferEngagementFulfillmentPayload, childPlugin: Pick<ChildPlugin, 'close'>): (() => Generator<CallEffect<void> | PutEffect<{
9
11
  type: string;
10
12
  payload: {
11
13
  name: string;
@@ -16,5 +18,6 @@ export declare function getRealtimeFulfillmentSuccessCallback(gateway: GlobalGat
16
18
  };
17
19
  };
18
20
  }>, void, unknown>) | undefined;
19
- export declare function listenForRealtimeFulfillmentEvent(gateway: GlobalGateway, logger: (log: Log) => void): Generator<TakeEffect | CallEffect | CancelledEffect | PutEffect | ChannelTakeEffect<RealtimeFulfillmentEvent>, void, RealtimeFulfillmentEvent>;
21
+ export declare function listenForRealtimeFulfillmentEvent(gateway: GlobalGateway, logger: (log: Log) => void, childPlugin?: Pick<ChildPlugin, 'close'>): Generator<TakeEffect | CallEffect | CancelledEffect | PutEffect | ChannelTakeEffect<RealtimeFulfillmentEvent>, void, RealtimeFulfillmentEvent>;
20
22
  export declare function processOfferResponse(gateway: GlobalGateway, logger: (log: Log) => void, action: OfferEngagement): Generator<CallEffect | PutEffect, void, never>;
23
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokt/dcui-orchestrator",
3
- "version": "0.0.4-rc.0",
3
+ "version": "0.0.4-rc.10",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",