@rokt/dcui-orchestrator 1.2.1-rc.52 → 1.2.1-rc.53
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.
- package/dist/index.cjs +17 -17
- package/dist/index.js +30 -30
- package/dist/libraries/domain/src/models/global-state.d.ts +15 -1
- package/dist/libraries/module-utils/src/sagas/child-layouts/sagas.d.ts +12 -4
- package/dist/modules/instant-purchase/src/selectors/catalog-selection/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/selectors/catalog-selection/selectors.d.ts +7 -0
- package/dist/modules/instant-purchase/src/selectors/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/utils/compute-selections-for-item.d.ts +7 -0
- package/package.json +1 -1
|
@@ -16,10 +16,24 @@ export interface GlobalState {
|
|
|
16
16
|
firedEvents: Partial<Record<LayoutEvent, boolean>>;
|
|
17
17
|
formStates: FormStatesState;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* The catalog choice a host module has made, synced so a child layout can
|
|
21
|
+
* show it. The child already holds the offer, so only identifiers travel.
|
|
22
|
+
*/
|
|
23
|
+
export interface SyncedCatalogSelection {
|
|
24
|
+
/** The selected item, or a stacked selector's preview of one; `null` before any choice. */
|
|
25
|
+
catalogItemId: string | null;
|
|
26
|
+
/** Chosen option label per attribute id, partial while the shopper is choosing. */
|
|
27
|
+
attributeSelections: Record<string, string>;
|
|
28
|
+
}
|
|
19
29
|
/**
|
|
20
30
|
* The GlobalState slices a host syncs down to a child layout; `breakpoint`
|
|
21
31
|
* is absent because the child computes its own from its iframe width.
|
|
32
|
+
* `catalogSelection` is module state, present only when the launching module
|
|
33
|
+
* has a catalog selection to share.
|
|
22
34
|
*/
|
|
23
|
-
export type SyncedGlobalState = Pick<GlobalState, 'progression' | 'customStates' | 'domainStates' | 'firedEvents' | 'formStates'
|
|
35
|
+
export type SyncedGlobalState = Pick<GlobalState, 'progression' | 'customStates' | 'domainStates' | 'firedEvents' | 'formStates'> & {
|
|
36
|
+
catalogSelection?: SyncedCatalogSelection;
|
|
37
|
+
};
|
|
24
38
|
export declare function makeSyncedGlobalState(state?: Partial<SyncedGlobalState>): SyncedGlobalState;
|
|
25
39
|
export declare function makeGlobalState(state?: Partial<GlobalState>): GlobalState;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { LaunchChildLayout } from '../../../../domain/src/behaviors';
|
|
2
|
-
import { CallEffect, CancelledEffect, ChannelTakeEffect, ForkEffect, PutEffect, RaceEffect, SelectEffect } from 'redux-saga/effects';
|
|
2
|
+
import { CallEffect, CancelEffect, CancelledEffect, ChannelTakeEffect, ForkEffect, PutEffect, RaceEffect, SelectEffect } from 'redux-saga/effects';
|
|
3
3
|
import { GlobalGateway } from '../../../../module-connector/src/main';
|
|
4
|
-
import { Log, PluginOffer } from '../../../../domain/src/models';
|
|
4
|
+
import { Log, PluginOffer, SyncedCatalogSelection } from '../../../../domain/src/models';
|
|
5
5
|
import { BasicObject, ChildPluginInterface } from '@rokt/plugin';
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Reads a module's catalog selection from its own store. Re-read after every
|
|
8
|
+
* module action; an unchanged result is not re-sent.
|
|
9
|
+
*/
|
|
10
|
+
export type SelectCatalogSelection = {
|
|
11
|
+
bivarianceHack(state: unknown): SyncedCatalogSelection;
|
|
12
|
+
}['bivarianceHack'];
|
|
13
|
+
export declare function launchChildLayout(gateway: GlobalGateway, logger: (log: Log) => void, action: LaunchChildLayout, selectCatalogSelection?: SelectCatalogSelection): Generator<PutEffect | CallEffect | SelectEffect | ForkEffect, void, never>;
|
|
7
14
|
type BridgeChannelMessage = {
|
|
8
15
|
kind: 'ready';
|
|
9
16
|
} | {
|
|
@@ -15,5 +22,6 @@ export declare function childLayoutBridge(gateway: GlobalGateway, logger: (log:
|
|
|
15
22
|
offerPositionIndex: number | undefined;
|
|
16
23
|
childInstanceGuid: string;
|
|
17
24
|
advanceOnDismiss?: boolean;
|
|
18
|
-
|
|
25
|
+
selectCatalogSelection?: SelectCatalogSelection;
|
|
26
|
+
}): Generator<PutEffect | CallEffect | CancelledEffect | CancelEffect | ForkEffect | SelectEffect | RaceEffect<ChannelTakeEffect<BridgeChannelMessage> | CallEffect>, void, never>;
|
|
19
27
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectors';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SyncedCatalogSelection } from '../../../../../libraries/domain/src/models';
|
|
2
|
+
import { AppState } from '../../reducers';
|
|
3
|
+
/**
|
|
4
|
+
* The selection a child layout mirrors. A full-item choice (a dropdown or the
|
|
5
|
+
* default item) has no recorded attribute choices, so they are derived from it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSyncedCatalogSelection(state: AppState): SyncedCatalogSelection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CatalogItemGroupAttribute } from '../../../../libraries/domain/src/models';
|
|
2
|
+
/**
|
|
3
|
+
* Derives the per-attribute option labels that resolve to a catalog item: for
|
|
4
|
+
* each attribute, the option whose catalogItemIds contains the item. Used to
|
|
5
|
+
* pre-fill stacked dropdowns and to describe a full-item selection.
|
|
6
|
+
*/
|
|
7
|
+
export declare function computeSelectionsForItem(attributes: CatalogItemGroupAttribute[], catalogItemId: string): Record<string, string>;
|