@useinsider/guido 3.19.0-beta.e110e88 → 3.19.0-beta.e424587
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/@types/config/schemas.js +104 -91
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +96 -85
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +11 -11
- package/dist/composables/useCortexBlueprintBridge.js +122 -54
- package/dist/composables/useEmailTemplateApplier.js +111 -50
- package/dist/composables/useHttp.js +64 -54
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/compiler/itemsCompilerRules.js +14 -5
- package/dist/config/compiler/utils/itemsCompilerUtils.js +48 -21
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/itemsBlockMigrator.js +245 -253
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/extensions/Blocks/Items/block.js +78 -67
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
- package/dist/extensions/Blocks/Items/constants/cardWidth.js +20 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +1 -1
- package/dist/extensions/Blocks/Items/template.js +219 -204
- package/dist/extensions/Blocks/Recommendation/block.js +21 -22
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +97 -107
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +203 -209
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +67 -91
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +21 -26
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +3 -1
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +16 -55
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
- package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +5 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
- package/dist/src/extensions/Blocks/Items/constants/cardWidth.d.ts +12 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -13
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -7
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/guido-email-editor.d.ts +20 -10
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/src/utils/liquidProtection.d.ts +3 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
- package/dist/static/styles/components/version-history.css.js +2 -6
- package/dist/stores/guido-email-editor.js +3 -1
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/liquidProtection.js +5 -0
- package/dist/utils/pairProductVariables.js +71 -71
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AuthErrorState {
|
|
2
|
+
status: number;
|
|
3
|
+
data: Record<string, unknown> | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const isPanelOrigin: (url: string) => boolean;
|
|
6
|
+
export declare const reportAuthError: (status: number, body: string, url: string) => void;
|
|
7
|
+
export declare const useAuthError: () => {
|
|
8
|
+
authError: import("vue").Ref<{
|
|
9
|
+
status: number;
|
|
10
|
+
data: Record<string, unknown> | null;
|
|
11
|
+
} | null>;
|
|
12
|
+
};
|
|
@@ -43,6 +43,7 @@ export declare const useConfig: () => {
|
|
|
43
43
|
selectedUnsubscribePages: number[];
|
|
44
44
|
forceRecreate: boolean;
|
|
45
45
|
trackIdCounter: number;
|
|
46
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
46
47
|
migration: {
|
|
47
48
|
recommendationConfigs: {
|
|
48
49
|
[x: string]: {
|
|
@@ -180,6 +181,7 @@ export declare const useConfig: () => {
|
|
|
180
181
|
selectedUnsubscribePages: number[];
|
|
181
182
|
forceRecreate: boolean;
|
|
182
183
|
trackIdCounter: number;
|
|
184
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
183
185
|
migration: {
|
|
184
186
|
recommendationConfigs: {
|
|
185
187
|
[x: string]: {
|
|
@@ -17,12 +17,11 @@
|
|
|
17
17
|
* - `error` segments (and message-level `isError` / `isCancelled`) trigger
|
|
18
18
|
* a localized toaster.
|
|
19
19
|
*
|
|
20
|
+
* Every apply settles into a terminal `applyAcks` entry, so cortex moves its button on the write, not the click.
|
|
21
|
+
*
|
|
20
22
|
* In dev (`import.meta.env.DEV`) every observed segment + message-level flag
|
|
21
23
|
* change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
|
|
22
24
|
* developer can watch the agent stream in real time. In production this is
|
|
23
25
|
* gated behind `localStorage.guido:debug:ai === '1'`.
|
|
24
|
-
*
|
|
25
|
-
* If cortex-fe isn't loaded the chat store is undefined and the bridge is a
|
|
26
|
-
* no-op (intentional — Guido must still work standalone).
|
|
27
26
|
*/
|
|
28
27
|
export declare const useCortexBlueprintBridge: () => void;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
2
|
+
/**
|
|
3
|
+
* Terminal outcome of an apply; every promise here settles with one, since the bridge acks on it.
|
|
4
|
+
* `superseded`: a newer payload for the same key replaced this one and owns the ack.
|
|
5
|
+
*/
|
|
6
|
+
export type ApplyOutcome = {
|
|
7
|
+
status: 'applied';
|
|
8
|
+
} | {
|
|
9
|
+
status: 'failed';
|
|
10
|
+
error: unknown;
|
|
11
|
+
} | {
|
|
12
|
+
status: 'superseded';
|
|
13
|
+
};
|
|
2
14
|
/**
|
|
3
15
|
* Applies email_template blueprints from the chat agent to the Stripo editor.
|
|
4
16
|
*
|
|
@@ -9,18 +21,19 @@ type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
|
9
21
|
* - manual Apply click (first apply): immediate.
|
|
10
22
|
* - blueprint_update after the user has applied once: debounced 250 ms trailing
|
|
11
23
|
* so rapid mid-stream updates don't thrash updateHtmlAndCss.
|
|
24
|
+
* - a click before Stripo is ready is queued and flushed when `isStripoInitialized` flips.
|
|
12
25
|
*/
|
|
13
26
|
export declare const useEmailTemplateApplier: () => {
|
|
14
27
|
applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
|
|
15
|
-
markPending: (
|
|
16
|
-
applyTemplate: (
|
|
28
|
+
markPending: (key: string) => void;
|
|
29
|
+
applyTemplate: (key: string, data: {
|
|
17
30
|
html?: string;
|
|
18
31
|
css?: string;
|
|
19
|
-
}) =>
|
|
20
|
-
applyTemplateDebounced: (
|
|
32
|
+
}) => Promise<ApplyOutcome>;
|
|
33
|
+
applyTemplateDebounced: (key: string, data: {
|
|
21
34
|
html?: string;
|
|
22
35
|
css?: string;
|
|
23
|
-
}) =>
|
|
36
|
+
}) => Promise<ApplyOutcome>;
|
|
24
37
|
};
|
|
25
38
|
export declare const resetEmailTemplateApplier: () => void;
|
|
26
39
|
export {};
|
|
@@ -19,6 +19,8 @@ export declare const provideGuidoActions: (actions: {
|
|
|
19
19
|
}) => void;
|
|
20
20
|
/**
|
|
21
21
|
* Provides individual Guido action handlers
|
|
22
|
+
* @deprecated No consumer in src/ and not exported from library.ts — provideGuidoActions
|
|
23
|
+
* provides all four keys itself. Slated for deletion, see the SD-667788 dead-code ledger.
|
|
22
24
|
*/
|
|
23
25
|
export declare const provideBackHandler: (handler: BackHandler) => void;
|
|
24
26
|
export declare const provideSaveStartHandler: (handler: SaveStartHandler) => void;
|
|
@@ -16,6 +16,7 @@ export interface HttpError {
|
|
|
16
16
|
status?: number;
|
|
17
17
|
statusText?: string;
|
|
18
18
|
response?: Response;
|
|
19
|
+
authReported?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
21
22
|
loading: import("vue").ComputedRef<boolean>;
|
|
@@ -65,6 +66,7 @@ export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
|
65
66
|
json: () => Promise<any>;
|
|
66
67
|
text: () => Promise<string>;
|
|
67
68
|
} | undefined;
|
|
69
|
+
authReported?: boolean | undefined;
|
|
68
70
|
} | null>;
|
|
69
71
|
hasError: import("vue").ComputedRef<boolean>;
|
|
70
72
|
request: <T = unknown>(method: HttpMethod, url: string, data?: unknown, options?: HttpOptions) => Promise<HttpResponse<T>>;
|
|
@@ -10,3 +10,8 @@ export declare const MSO_ITEMS_HIDE_END = "MSO_ITEMS_HIDE_END";
|
|
|
10
10
|
* and collapse them inline for web-engine Outlook.
|
|
11
11
|
*/
|
|
12
12
|
export declare function wrapHiddenPriceTdsForOutlook(html: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Export safety net for a zero Items width: the wrapper gets the 100% pin, the cell's zero is
|
|
15
|
+
* dropped so it keeps its column width (a pin there overflows 33%/50% columns).
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeItemsBlockWidths(html: string): string;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
|
-
|
|
2
|
+
import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
|
|
3
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions) => Promise<string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empties recommendation blocks copied in from another account and stamps the
|
|
3
|
+
* current one, before the editor ever sees the template (SD-151945).
|
|
4
|
+
*
|
|
5
|
+
* Runs at load rather than on document change: the stamp makes it a one-time
|
|
6
|
+
* pass per template, the campaign-URL rule only ever applies to the loaded HTML,
|
|
7
|
+
* and Stripo takes the result as the original document, so nothing is dirtied.
|
|
8
|
+
*/
|
|
9
|
+
export interface PartnerScopeMigrationOptions {
|
|
10
|
+
partnerName: string;
|
|
11
|
+
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
+
campaignUrls?: Record<string, unknown>;
|
|
13
|
+
rrsEnabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @param html Template HTML, already normalized by `migrateRecommendation`.
|
|
17
|
+
* @returns Migrated HTML, or the original when no block needed a reset or a stamp.
|
|
18
|
+
*/
|
|
19
|
+
export declare function migrateRecommendationPartnerScope(html: string, { partnerName, campaignUrls, rrsEnabled }: PartnerScopeMigrationOptions): string;
|
|
@@ -8,8 +8,8 @@ export declare const URLS: {
|
|
|
8
8
|
NEWSLETTER_RECOMMENDATIONS_PATH: string;
|
|
9
9
|
MIGRATE_STRATEGIES_PATH: string;
|
|
10
10
|
TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
|
|
11
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
12
11
|
};
|
|
12
|
+
export declare const strategyCreatePath: () => string;
|
|
13
13
|
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
14
14
|
export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
|
|
15
15
|
export declare const QUERY_PARAMS: {
|
|
@@ -46,6 +46,11 @@ export declare class ItemsBlock extends Block {
|
|
|
46
46
|
* relies on this td-level fallback in pairProductVariables.
|
|
47
47
|
*/
|
|
48
48
|
private _stampProductTdDomAttributes;
|
|
49
|
+
/**
|
|
50
|
+
* Repairs a saved module's collapsed card into the state the load migrator produces. Acts only
|
|
51
|
+
* on a zero width, so Stripo's non-zero drop-time width never triggers it and a healed block no-ops.
|
|
52
|
+
*/
|
|
53
|
+
private _healCollapsedWidths;
|
|
49
54
|
/**
|
|
50
55
|
* Whether a currency self-heal pass should run for this block (SD-147588). The only gate here is
|
|
51
56
|
* once-per-session: heal each instance at most once, so the auto-fix can't fight undo (undo
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single owner for the Items card orientation-dependent layout contract (SD-149368).
|
|
3
|
+
*
|
|
4
|
+
* Two things depend on a card's orientation and are written across several layers:
|
|
5
|
+
*
|
|
6
|
+
* 1. Name column width — a horizontal card lays the name in a narrow side-by-side
|
|
7
|
+
* column, so it is capped; a vertical card gives it a full-width row.
|
|
8
|
+
* 2. Block-cell padding — the collapsible price / original-price block-cell carries its
|
|
9
|
+
* own inter-cell spacing (horizontal cards pad left/right, vertical cards pad
|
|
10
|
+
* top/bottom) so a hidden element removes its own spacing instead of leaving a gap.
|
|
11
|
+
*
|
|
12
|
+
* Every layer that writes these — template render, layouts/horizontal.html,
|
|
13
|
+
* NameTrimmingControl (trimming toggle) and settingsControl (orientation change) — MUST
|
|
14
|
+
* derive them here, or a migrated / re-toggled card silently drifts out of sync with
|
|
15
|
+
* freshly generated markup (convention B1: cross-layer literals live in one module).
|
|
16
|
+
*/
|
|
17
|
+
export declare const NAME_HORIZONTAL_MAX_WIDTH = "130px";
|
|
18
|
+
export declare const NAME_VERTICAL_MAX_WIDTH = "100%";
|
|
19
|
+
/** Name max-width for a card orientation. Non-horizontal (incl. undefined) → full width. */
|
|
20
|
+
export declare const nameMaxWidthFor: (orientation?: string) => string;
|
|
21
|
+
/** Orientation-dependent inter-cell padding classes for a collapsible block-cell. */
|
|
22
|
+
export declare const BLOCK_CELL_PADDING: {
|
|
23
|
+
readonly VERTICAL: "es-p5b es-p5t";
|
|
24
|
+
readonly HORIZONTAL: "es-p5l es-p5r";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Attribute the block-cell carries to mark its LAYOUT-owned padding orientation ('v'|'h').
|
|
28
|
+
* The orientation toggle keys off this marker so it only ever rewrites the padding the
|
|
29
|
+
* layout itself baked — a user's own es-p* padding classes are never matched or clobbered
|
|
30
|
+
* (SD-149368 F1), and a cell without the marker is left untouched rather than mis-swapped.
|
|
31
|
+
*/
|
|
32
|
+
export declare const BLOCK_CELL_PAD_ATTR = "data-items-cell-pad";
|
|
33
|
+
/** Marker attribute (`data-items-cell-pad="v|h"`) for a block-cell in the given orientation. */
|
|
34
|
+
export declare const blockCellPadMarker: (isVertical: boolean) => string;
|
|
35
|
+
/** Padding classes (leading space included) for a block-cell in the given orientation. */
|
|
36
|
+
export declare const blockCellPaddingFor: (isVertical: boolean) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Rewrites a block-cell's LAYOUT-owned padding classes to the target orientation, keyed off
|
|
39
|
+
* the BLOCK_CELL_PAD_ATTR marker. The orientation-change rebuild re-injects existing cells
|
|
40
|
+
* via getOuterHTML(), which still carry the previous orientation's padding — swap only the
|
|
41
|
+
* layout pair (and flip the marker) so price/original-price cells stay padded after a toggle
|
|
42
|
+
* (SD-149368 F3), while a user's own padding and any unmarked cell are left alone (F1).
|
|
43
|
+
*/
|
|
44
|
+
export declare const reorientBlockCellPadding: (html: string, toVertical: boolean) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const PRODUCT_TD_SELECTOR = ".ins-product-td";
|
|
2
|
+
export declare const PRODUCT_WRAPPER_SELECTOR = ".ins-product-wrapper";
|
|
3
|
+
/** The declaration `layouts/vertical.html` and `layouts/horizontal.html` ship inline. */
|
|
4
|
+
export declare const WIDTH_PIN_DECLARATION = "width: 100%";
|
|
5
|
+
/** True for a `width` attribute value that renders the card zero-wide (`0`, `0px`, `0%`). */
|
|
6
|
+
export declare const isZeroWidthValue: (value?: string | null) => boolean;
|
|
7
|
+
/** True when an inline style declares a zero `width` (ignores `max-width` / `min-width`). */
|
|
8
|
+
export declare const hasZeroWidthDeclaration: (style: string) => boolean;
|
|
9
|
+
/** Rewrites a zero width to the pin or appends it; a non-zero width is kept. Idempotent. */
|
|
10
|
+
export declare const withWidthPin: (style: string) => string;
|
|
11
|
+
/** Drops a zero `width` declaration; the product cell must inherit its column width, not be pinned. */
|
|
12
|
+
export declare const withoutZeroWidth: (style: string) => string;
|
|
@@ -39,14 +39,17 @@ export declare const productPairs: {
|
|
|
39
39
|
CART_ITEMS: {
|
|
40
40
|
ATTR: string;
|
|
41
41
|
DEFAULT: string;
|
|
42
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
42
43
|
};
|
|
43
44
|
BROWSED_ITEMS: {
|
|
44
45
|
ATTR: string;
|
|
45
46
|
DEFAULT: string;
|
|
47
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
46
48
|
};
|
|
47
49
|
PURCHASED_ITEMS: {
|
|
48
50
|
ATTR: string;
|
|
49
51
|
DEFAULT: string;
|
|
52
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
50
53
|
};
|
|
51
54
|
};
|
|
52
55
|
price: {
|
|
@@ -37,6 +37,25 @@ type TemplateParameters = {
|
|
|
37
37
|
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
38
38
|
priceOrientation?: PriceOrientationType;
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Applies price orientation styles to the generated HTML template.
|
|
42
|
+
*
|
|
43
|
+
* For Vertical Layout:
|
|
44
|
+
* - vertical price orientation: both cells 100% (stacked)
|
|
45
|
+
* - horizontal price orientation with both visible: both cells 50% (side-by-side)
|
|
46
|
+
* - horizontal price orientation with one hidden: visible cell 100%
|
|
47
|
+
*
|
|
48
|
+
* For Horizontal Layout:
|
|
49
|
+
* - horizontal price orientation: .horizontal-price visible, .vertical-price hidden
|
|
50
|
+
* - vertical price orientation: .horizontal-price hidden, .vertical-price visible
|
|
51
|
+
* @param html - The HTML template string with placeholders replaced
|
|
52
|
+
* @param layoutOrientation - The card layout orientation ('vertical' or 'horizontal')
|
|
53
|
+
* @param priceOrientation - The price orientation within the card ('vertical' or 'horizontal')
|
|
54
|
+
* @param isPriceVisible - Whether the price element is visible
|
|
55
|
+
* @param isOriginalPriceVisible - Whether the original price element is visible
|
|
56
|
+
* @returns HTML string with price orientation styles applied
|
|
57
|
+
*/
|
|
58
|
+
export declare const applyPriceOrientationStyles: (html: string, layoutOrientation: OrientationType, priceOrientation: PriceOrientationType, isPriceVisible?: boolean, isOriginalPriceVisible?: boolean) => string;
|
|
40
59
|
/**
|
|
41
60
|
* Generates the default template for the Items Block.
|
|
42
61
|
* @param params - Template parameters including orientation, items type, item ID, and formatting options
|
|
@@ -139,8 +139,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
139
139
|
* fails when the size actually changed.
|
|
140
140
|
*/
|
|
141
141
|
private _debouncedRegenerateWithProducts;
|
|
142
|
-
/** Draws the current block's products into this panel's node. */
|
|
143
|
-
private _regenerateWithProducts;
|
|
144
142
|
/**
|
|
145
143
|
* Listen to store changes that require product refresh or regeneration.
|
|
146
144
|
*
|
|
@@ -623,20 +623,9 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
623
623
|
* Block-scoped counterpart of `fetchRecommendationProducts`, which only ever serves the
|
|
624
624
|
* selected block. The legacy conversion must refresh the products of the block that
|
|
625
625
|
* started it even after the user selected another one.
|
|
626
|
-
* @returns whether real products arrived
|
|
627
626
|
*/
|
|
628
|
-
fetchStrategyProductsForBlock(blockId: number
|
|
629
|
-
|
|
630
|
-
}): Promise<boolean>;
|
|
631
|
-
/**
|
|
632
|
-
* Reloads a block's products and adopts its strategy's current size, which may have
|
|
633
|
-
* moved since the block was assigned.
|
|
634
|
-
* @returns whether a fresh listing holds the strategy and its products arrived
|
|
635
|
-
*/
|
|
636
|
-
refreshStrategyBlock(blockId: number): Promise<boolean>;
|
|
637
|
-
_doFetchStrategyProducts(blockId: number, { keepOnFailure }?: {
|
|
638
|
-
keepOnFailure?: boolean;
|
|
639
|
-
}): Promise<boolean>;
|
|
627
|
+
fetchStrategyProductsForBlock(blockId: number): Promise<void>;
|
|
628
|
+
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
640
629
|
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
641
630
|
}>;
|
|
642
631
|
export {};
|
|
@@ -83,6 +83,12 @@ export interface RecommendationNodeConfig {
|
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
85
|
strategyId: string;
|
|
86
|
+
/**
|
|
87
|
+
* Account (`config.partner.name`) that last wrote the strategy config. Strategy ids and
|
|
88
|
+
* attribute types are account-scoped, so a block opened under another account is reset.
|
|
89
|
+
* Absent on blocks saved before SD-151945.
|
|
90
|
+
*/
|
|
91
|
+
partnerName?: string;
|
|
86
92
|
/**
|
|
87
93
|
* Layout orientation
|
|
88
94
|
* - 'grid': Products in a grid, attributes aligned across products
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocumentModifier } from '../services/configService';
|
|
2
|
-
import type { PartialNodeConfig
|
|
2
|
+
import type { PartialNodeConfig } from '../types/nodeConfig';
|
|
3
3
|
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
4
4
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
5
5
|
interface ConfigWriterApi {
|
|
@@ -13,8 +13,6 @@ interface ConfigWriterApi {
|
|
|
13
13
|
* itself is torn down.
|
|
14
14
|
*/
|
|
15
15
|
export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
|
|
16
|
-
/** Reads the persisted config of every node carrying a block id (two while a duplicate still shares it). */
|
|
17
|
-
export declare function readBlockNodeConfigs(blockId: number): RecommendationNodeConfig[];
|
|
18
16
|
/**
|
|
19
17
|
* Commits a config change and its product re-render straight to the document,
|
|
20
18
|
* bypassing the settings panel.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RecommendationNodeConfig } from '../types/nodeConfig';
|
|
2
|
+
/**
|
|
3
|
+
* Mirrors the backend's `RecommendationCampaignUrls::isDefined`: a legacy feed URL
|
|
4
|
+
* string or an entry that names a strategy.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isDefinedCampaignUrl(value: unknown): boolean;
|
|
7
|
+
export interface PartnerScopeInputs {
|
|
8
|
+
config: Pick<RecommendationNodeConfig, 'strategyId' | 'partnerName'>;
|
|
9
|
+
blockId: number;
|
|
10
|
+
partnerName: string;
|
|
11
|
+
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
+
campaignUrls: Record<string, unknown> | undefined;
|
|
13
|
+
/** With RRS off `buildCampaignUrl` drops the block's map entry, so the map says nothing. */
|
|
14
|
+
rrsEnabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether a block carries another account's strategy config (SD-151945).
|
|
18
|
+
*
|
|
19
|
+
* A stamped block is judged by its stamp. An unstamped one predates the stamp, so it
|
|
20
|
+
* falls back to the backend's own signal: a cross-account duplicate drops the block's
|
|
21
|
+
* strategy entry from the campaign URL map but leaves the HTML untouched. That signal
|
|
22
|
+
* only holds while RRS is on, and only for the HTML the host loaded — which is what
|
|
23
|
+
* the caller, a load-time migrator, runs on.
|
|
24
|
+
*/
|
|
25
|
+
export declare function carriesForeignPartnerConfig({ config, blockId, partnerName, campaignUrls, rrsEnabled }: PartnerScopeInputs): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether an unstamped block's ownership can be decided at all. `carriesForeignPartnerConfig`
|
|
28
|
+
* answers `false` both for "clean" and for "cannot tell", and stamping on the latter would
|
|
29
|
+
* record a foreign block as this account's and silence every later check. A block with no
|
|
30
|
+
* strategy reference has nothing foreign to carry, so it is always decidable.
|
|
31
|
+
*/
|
|
32
|
+
export declare function canJudgeUnstampedBlock({ config, campaignUrls, rrsEnabled }: Pick<PartnerScopeInputs, 'config' | 'campaignUrls' | 'rrsEnabled'>): boolean;
|
|
33
|
+
export declare function withoutCustomAttributes(composition: string[]): string[];
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { RecommendationNodeConfig } from '../types/nodeConfig';
|
|
2
|
-
/**
|
|
3
|
-
* Re-reads the strategy of a duplicated block and its source and redraws both: the clone copies the
|
|
4
|
-
* cards the source last drew, so a strategy edited since then only reached a block once selected (SD-153266).
|
|
5
|
-
* @param config - the arriving block's persisted config; seeds either block its store entry does not match
|
|
6
|
-
*/
|
|
7
|
-
export declare function refreshDuplicatedStrategyBlocks(sourceId: number, duplicateId: number, config: RecommendationNodeConfig): Promise<void>;
|
|
8
1
|
/**
|
|
9
2
|
* Writes a strategy change and its products straight to the document, without the settings panel.
|
|
10
3
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-harness stand-in for the cortex-fe MFE's shared `chat` store.
|
|
3
|
+
*
|
|
4
|
+
* `useCortexBlueprintBridge` resolves that store by id off the host's pinia at
|
|
5
|
+
* Guido's setup time, so a store registered after mount is never seen. Installing
|
|
6
|
+
* it here — before `<Guido>` renders — lets e2e drive the bridge through its real
|
|
7
|
+
* registration path instead of re-invoking the composable by hand.
|
|
8
|
+
*
|
|
9
|
+
* Activated with `?chatStore=true`; the instance is exposed on `window` so a test
|
|
10
|
+
* can push agent messages into it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const installMockChatStore: () => void;
|
|
@@ -48,6 +48,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
48
48
|
selectedUnsubscribePages: number[];
|
|
49
49
|
forceRecreate: boolean;
|
|
50
50
|
trackIdCounter: number;
|
|
51
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
51
52
|
migration: {
|
|
52
53
|
recommendationConfigs: {
|
|
53
54
|
[x: string]: {
|
|
@@ -191,6 +192,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
191
192
|
selectedUnsubscribePages: number[];
|
|
192
193
|
forceRecreate: boolean;
|
|
193
194
|
trackIdCounter: number;
|
|
195
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
194
196
|
migration: {
|
|
195
197
|
recommendationConfigs: {
|
|
196
198
|
[x: string]: {
|
|
@@ -334,6 +336,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
334
336
|
selectedUnsubscribePages: number[];
|
|
335
337
|
forceRecreate: boolean;
|
|
336
338
|
trackIdCounter: number;
|
|
339
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
337
340
|
migration: {
|
|
338
341
|
recommendationConfigs: {
|
|
339
342
|
[x: string]: {
|
|
@@ -477,6 +480,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
477
480
|
selectedUnsubscribePages: number[];
|
|
478
481
|
forceRecreate: boolean;
|
|
479
482
|
trackIdCounter: number;
|
|
483
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
480
484
|
migration: {
|
|
481
485
|
recommendationConfigs: {
|
|
482
486
|
[x: string]: {
|
|
@@ -620,6 +624,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
620
624
|
selectedUnsubscribePages: number[];
|
|
621
625
|
forceRecreate: boolean;
|
|
622
626
|
trackIdCounter: number;
|
|
627
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
623
628
|
migration: {
|
|
624
629
|
recommendationConfigs: {
|
|
625
630
|
[x: string]: {
|
|
@@ -763,6 +768,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
763
768
|
selectedUnsubscribePages: number[];
|
|
764
769
|
forceRecreate: boolean;
|
|
765
770
|
trackIdCounter: number;
|
|
771
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
766
772
|
migration: {
|
|
767
773
|
recommendationConfigs: {
|
|
768
774
|
[x: string]: {
|
|
@@ -906,6 +912,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
906
912
|
selectedUnsubscribePages: number[];
|
|
907
913
|
forceRecreate: boolean;
|
|
908
914
|
trackIdCounter: number;
|
|
915
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
909
916
|
migration: {
|
|
910
917
|
recommendationConfigs: {
|
|
911
918
|
[x: string]: {
|
|
@@ -1049,6 +1056,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1049
1056
|
selectedUnsubscribePages: number[];
|
|
1050
1057
|
forceRecreate: boolean;
|
|
1051
1058
|
trackIdCounter: number;
|
|
1059
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1052
1060
|
migration: {
|
|
1053
1061
|
recommendationConfigs: {
|
|
1054
1062
|
[x: string]: {
|
|
@@ -1192,6 +1200,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1192
1200
|
selectedUnsubscribePages: number[];
|
|
1193
1201
|
forceRecreate: boolean;
|
|
1194
1202
|
trackIdCounter: number;
|
|
1203
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1195
1204
|
migration: {
|
|
1196
1205
|
recommendationConfigs: {
|
|
1197
1206
|
[x: string]: {
|
|
@@ -1335,6 +1344,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1335
1344
|
selectedUnsubscribePages: number[];
|
|
1336
1345
|
forceRecreate: boolean;
|
|
1337
1346
|
trackIdCounter: number;
|
|
1347
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1338
1348
|
migration: {
|
|
1339
1349
|
recommendationConfigs: {
|
|
1340
1350
|
[x: string]: {
|
|
@@ -1478,6 +1488,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1478
1488
|
selectedUnsubscribePages: number[];
|
|
1479
1489
|
forceRecreate: boolean;
|
|
1480
1490
|
trackIdCounter: number;
|
|
1491
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1481
1492
|
migration: {
|
|
1482
1493
|
recommendationConfigs: {
|
|
1483
1494
|
[x: string]: {
|
|
@@ -1621,6 +1632,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1621
1632
|
selectedUnsubscribePages: number[];
|
|
1622
1633
|
forceRecreate: boolean;
|
|
1623
1634
|
trackIdCounter: number;
|
|
1635
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1624
1636
|
migration: {
|
|
1625
1637
|
recommendationConfigs: {
|
|
1626
1638
|
[x: string]: {
|
|
@@ -1764,6 +1776,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1764
1776
|
selectedUnsubscribePages: number[];
|
|
1765
1777
|
forceRecreate: boolean;
|
|
1766
1778
|
trackIdCounter: number;
|
|
1779
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1767
1780
|
migration: {
|
|
1768
1781
|
recommendationConfigs: {
|
|
1769
1782
|
[x: string]: {
|
|
@@ -1907,6 +1920,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1907
1920
|
selectedUnsubscribePages: number[];
|
|
1908
1921
|
forceRecreate: boolean;
|
|
1909
1922
|
trackIdCounter: number;
|
|
1923
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1910
1924
|
migration: {
|
|
1911
1925
|
recommendationConfigs: {
|
|
1912
1926
|
[x: string]: {
|
|
@@ -2050,6 +2064,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2050
2064
|
selectedUnsubscribePages: number[];
|
|
2051
2065
|
forceRecreate: boolean;
|
|
2052
2066
|
trackIdCounter: number;
|
|
2067
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2053
2068
|
migration: {
|
|
2054
2069
|
recommendationConfigs: {
|
|
2055
2070
|
[x: string]: {
|
|
@@ -2193,6 +2208,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2193
2208
|
selectedUnsubscribePages: number[];
|
|
2194
2209
|
forceRecreate: boolean;
|
|
2195
2210
|
trackIdCounter: number;
|
|
2211
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2196
2212
|
migration: {
|
|
2197
2213
|
recommendationConfigs: {
|
|
2198
2214
|
[x: string]: {
|
|
@@ -2336,6 +2352,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2336
2352
|
selectedUnsubscribePages: number[];
|
|
2337
2353
|
forceRecreate: boolean;
|
|
2338
2354
|
trackIdCounter: number;
|
|
2355
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2339
2356
|
migration: {
|
|
2340
2357
|
recommendationConfigs: {
|
|
2341
2358
|
[x: string]: {
|
|
@@ -2479,6 +2496,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2479
2496
|
selectedUnsubscribePages: number[];
|
|
2480
2497
|
forceRecreate: boolean;
|
|
2481
2498
|
trackIdCounter: number;
|
|
2499
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2482
2500
|
migration: {
|
|
2483
2501
|
recommendationConfigs: {
|
|
2484
2502
|
[x: string]: {
|
|
@@ -2622,6 +2640,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2622
2640
|
selectedUnsubscribePages: number[];
|
|
2623
2641
|
forceRecreate: boolean;
|
|
2624
2642
|
trackIdCounter: number;
|
|
2643
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2625
2644
|
migration: {
|
|
2626
2645
|
recommendationConfigs: {
|
|
2627
2646
|
[x: string]: {
|
|
@@ -2767,6 +2786,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2767
2786
|
selectedUnsubscribePages: number[];
|
|
2768
2787
|
forceRecreate: boolean;
|
|
2769
2788
|
trackIdCounter: number;
|
|
2789
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2770
2790
|
migration: {
|
|
2771
2791
|
recommendationConfigs: {
|
|
2772
2792
|
[x: string]: {
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/** Terminal outcome of an editor write, keyed by `${blueprintId}:${version}`. */
|
|
2
|
+
export interface ApplyAck {
|
|
3
|
+
status: 'applied' | 'failed';
|
|
4
|
+
/** The `applyRequestedAt` of the click this ack answers — lets cortex drop stale acks. */
|
|
5
|
+
requestedAt: number;
|
|
6
|
+
/** Strictly increasing per key, so two acks in the same millisecond still order. */
|
|
7
|
+
ackAt: number;
|
|
8
|
+
/** Stringified — cortex JSON-clones store-derived payloads, an Error would not survive. */
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
1
11
|
/** The published editor snapshot — the shape a consumer reads off the shared store. */
|
|
2
12
|
export interface GuidoEmailEditorState {
|
|
3
13
|
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
@@ -8,6 +18,10 @@ export interface GuidoEmailEditorState {
|
|
|
8
18
|
lastUpdatedAt: number;
|
|
9
19
|
/** Template id from the editor config, so a consumer can scope per-template. */
|
|
10
20
|
templateId: string;
|
|
21
|
+
/** True while a mounted Guido bridge is consuming the chat store. Gates cortex's Apply button. */
|
|
22
|
+
bridgeActive: boolean;
|
|
23
|
+
/** `${blueprintId}:${version}` → terminal outcome of the editor write, written only after it settles. */
|
|
24
|
+
applyAcks: Record<string, ApplyAck>;
|
|
11
25
|
}
|
|
12
26
|
/**
|
|
13
27
|
* Outbound contract Guido publishes to the host's shared Pinia singleton so a
|
|
@@ -18,17 +32,11 @@ export interface GuidoEmailEditorState {
|
|
|
18
32
|
* Published as `@useinsider/guido/editor-state` and from the root barrel, so a
|
|
19
33
|
* consumer imports this store instead of re-declaring one under the same id.
|
|
20
34
|
*
|
|
21
|
-
* State
|
|
22
|
-
*
|
|
23
|
-
* enforces: publishing the definition hands a consumer `$patch` as well, exactly
|
|
24
|
-
* as the runtime `pinia._s` probe always did.
|
|
35
|
+
* State-only by contract: cortex-fe reads `pinia.state.value['guidoEmailEditor']`, which misses
|
|
36
|
+
* actions and getters. Intended writers: `useGuidoStateBridge` and `useCortexBlueprintBridge`.
|
|
25
37
|
*
|
|
26
|
-
*
|
|
27
|
-
* `
|
|
28
|
-
* id stays part of the contract. The internal Guido editor store keeps id
|
|
29
|
-
* `guidoEditor` — these are intentionally separate. The internal store carries
|
|
30
|
-
* UI state a consumer should not see; this public store carries the contract
|
|
31
|
-
* Guido is willing to share.
|
|
38
|
+
* The id `guidoEmailEditor` is part of the cross-MFE contract; the internal
|
|
39
|
+
* store `guidoEditor` is intentionally separate.
|
|
32
40
|
*/
|
|
33
41
|
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", GuidoEmailEditorState, {
|
|
34
42
|
/** True once the bridge has published at least one snapshot. */
|
|
@@ -37,5 +45,7 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
|
|
|
37
45
|
css: string;
|
|
38
46
|
lastUpdatedAt: number;
|
|
39
47
|
templateId: string;
|
|
48
|
+
bridgeActive: boolean;
|
|
49
|
+
applyAcks: Record<string, ApplyAck>;
|
|
40
50
|
} & import("pinia").PiniaCustomStateProperties<GuidoEmailEditorState>) => boolean;
|
|
41
51
|
}, {}>;
|