@useinsider/guido 3.18.2-beta.6cafced → 3.18.2-beta.83b62a8
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/README.md +20 -0
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +30 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -70
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/composables/useCustomInterfaceAppearance.js +46 -56
- package/dist/composables/useGuidoStateBridge.js +29 -24
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useRecommendation.js +35 -40
- package/dist/composables/useStripo.js +31 -31
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -189
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/library.js +15 -13
- package/dist/public/editorState.js +4 -0
- package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -7
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -75
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/library.d.ts +2 -0
- package/dist/src/public/editorState.d.ts +14 -0
- package/dist/src/public/trackingIds.d.ts +6 -2
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/stores/guido-email-editor.d.ts +27 -27
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
- package/dist/stores/editor.js +4 -0
- package/dist/stores/guido-email-editor.js +0 -4
- package/dist/stores/onboarding.js +36 -41
- package/dist/utils/templatePreparation.js +52 -52
- package/package.json +5 -1
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
- package/dist/static/styles/components/skeleton.css.js +0 -23
package/dist/library.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { MessageType as
|
|
1
|
+
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
+
import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { assignTrackingIds as
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
|
|
5
|
+
import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
|
|
6
|
+
import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
a as Guido,
|
|
9
|
+
t as MessageType,
|
|
10
|
+
d as ProductType,
|
|
11
|
+
u as assignTrackingIds,
|
|
12
|
+
s as getValidationErrors,
|
|
12
13
|
p as isValidConfig,
|
|
13
14
|
g as parseConfig,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
m as parseConfigSafe,
|
|
16
|
+
x as readTrackFloor,
|
|
17
|
+
T as readTrackSeq,
|
|
18
|
+
C as useGuidoEmailEditorStore,
|
|
19
|
+
n as validateConfig
|
|
18
20
|
};
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Outbound bridge — publishes the current editor's html/css to the shared
|
|
3
|
-
* Pinia store `guidoEmailEditor
|
|
4
|
-
*
|
|
3
|
+
* Pinia store `guidoEmailEditor`. cortex-fe reads it at chat-stream submit
|
|
4
|
+
* time and forwards it as `clientState.editor`, which is what enables
|
|
5
5
|
* sub-case 1.3 (refine an already-loaded template via the email-agent).
|
|
6
6
|
*
|
|
7
7
|
* The bridge writes on three triggers:
|
|
8
8
|
*
|
|
9
9
|
* 1. Stripo finishes initializing — first snapshot.
|
|
10
|
-
* 2.
|
|
11
|
-
* Stripo edit doesn't thrash the store.
|
|
10
|
+
* 2. Every document change, via the `changeSeq` counter — debounced 500 ms
|
|
11
|
+
* so a streaming Stripo edit doesn't thrash the store.
|
|
12
12
|
* 3. Editor `hasChanges` flips back to false (post-save / autosave) —
|
|
13
13
|
* immediate, since this is the canonical "saved" snapshot.
|
|
14
14
|
*
|
|
15
15
|
* `getTemplateData()` is a Stripo iframe call; it must not run before
|
|
16
16
|
* `isStripoInitialized` is true. The bridge guards against that.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The store is written even with no reader attached — it has zero overhead,
|
|
19
|
+
* and a late reader still finds consistent state.
|
|
20
|
+
*
|
|
21
|
+
* Readers are not optional any more, so treat the publish timing as part of
|
|
22
|
+
* the contract: the store ships as `@useinsider/guido/editor-state`, and
|
|
23
|
+
* email-fe imports it to scan the live html for its Array of Objects lock.
|
|
24
|
+
* Weakening a trigger here silently breaks that lock in the consumer.
|
|
21
25
|
*/
|
|
22
26
|
export declare const useGuidoStateBridge: () => void;
|
|
@@ -5,9 +5,7 @@ export declare const URLS: {
|
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
6
|
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
7
|
RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
|
|
8
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
9
8
|
};
|
|
10
|
-
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
11
9
|
export declare const QUERY_PARAMS: {
|
|
12
10
|
CLIENT_ID: string;
|
|
13
11
|
};
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
11
|
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
12
12
|
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
13
|
-
export declare const RRS_CONFIG_VERSION = 2;
|
|
14
13
|
/**
|
|
15
14
|
* Default currency configuration
|
|
16
15
|
* Uses USD as the base currency with standard formatting
|
|
@@ -10,4 +10,4 @@ export { RecommendationBlockId } from './blockIds';
|
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
11
|
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
|
-
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION,
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -70,8 +70,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
70
70
|
* state was rebuilt with (SD-150347).
|
|
71
71
|
*/
|
|
72
72
|
private _syncNodeConfigIfChanged;
|
|
73
|
-
/** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
|
|
74
|
-
private _isPendingStrategyIdChange;
|
|
75
73
|
private _capturePendingNodeConfigWrite;
|
|
76
74
|
/**
|
|
77
75
|
* Accumulates the pending write into `documentModifier` without applying, so the
|
|
@@ -2,7 +2,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
2
2
|
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
3
|
export declare class StrategyControl extends CommonControl {
|
|
4
4
|
private store;
|
|
5
|
-
private onboardingStore;
|
|
6
5
|
private storeUnsubscription;
|
|
7
6
|
private listeners;
|
|
8
7
|
private lastPaintedState;
|
|
@@ -10,14 +9,6 @@ export declare class StrategyControl extends CommonControl {
|
|
|
10
9
|
getTemplate(): string;
|
|
11
10
|
private _strategyAction;
|
|
12
11
|
onRender(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the document itself says this block has no strategy.
|
|
15
|
-
*
|
|
16
|
-
* Read the node, not the store: when the main control cannot resolve the block id off the
|
|
17
|
-
* node it never syncs the persisted config, so the store still holds defaults (empty
|
|
18
|
-
* strategyId) for an assigned block.
|
|
19
|
-
*/
|
|
20
|
-
private _isNodeUnassigned;
|
|
21
12
|
onDestroy(): void;
|
|
22
13
|
private _teardown;
|
|
23
14
|
private _setupButtonListeners;
|
|
@@ -107,7 +107,7 @@ export interface RegenerateWithStylesOptions extends Omit<RegenerateProductRowsO
|
|
|
107
107
|
* HTML removes the need for any post-rebuild reapply pass.
|
|
108
108
|
* @param options - Configuration options for regeneration
|
|
109
109
|
*/
|
|
110
|
-
export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions):
|
|
110
|
+
export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions): void;
|
|
111
111
|
/**
|
|
112
112
|
* Adjusts a products array to a target size.
|
|
113
113
|
* Used by ProductLayoutControl to synchronously match products to the new size
|
|
@@ -151,11 +151,6 @@ export interface UpdateProductContentInPlaceOptions {
|
|
|
151
151
|
currentNode: ImmutableHtmlNode | null | undefined;
|
|
152
152
|
documentModifier: DocumentModifier;
|
|
153
153
|
products: RecommendationProduct[];
|
|
154
|
-
/**
|
|
155
|
-
* Called when the batch was actually committed. Identical products commit nothing, which
|
|
156
|
-
* leaves anything a caller staged into the same batch unwritten unless it applies itself.
|
|
157
|
-
*/
|
|
158
|
-
onApplied?: () => void;
|
|
159
154
|
}
|
|
160
155
|
/**
|
|
161
156
|
* Updates product content in-place without regenerating HTML structure.
|
|
@@ -166,7 +161,7 @@ export interface UpdateProductContentInPlaceOptions {
|
|
|
166
161
|
* After updating desktop, also updates mobile container to keep them in sync.
|
|
167
162
|
*
|
|
168
163
|
* Falls back to false when product count changed (need to add/remove elements).
|
|
169
|
-
* @param options - Configuration options
|
|
164
|
+
* @param options - Configuration options
|
|
170
165
|
* @returns true if in-place update was successful, false to fall back to full regeneration
|
|
171
166
|
*/
|
|
172
167
|
export declare function updateProductContentInPlace(options: UpdateProductContentInPlaceOptions): boolean;
|
|
@@ -83,11 +83,8 @@ interface StoreState {
|
|
|
83
83
|
strategies: RrsStrategy[];
|
|
84
84
|
strategiesLoading: boolean;
|
|
85
85
|
strategyUrlTemplates: Record<string, string>;
|
|
86
|
-
strategiesFetched: boolean;
|
|
87
|
-
strategiesSettled: boolean;
|
|
88
86
|
blockStates: Record<number, PerBlockState>;
|
|
89
87
|
currentRecommendationId: number | null;
|
|
90
|
-
strategyPanelOpen: boolean;
|
|
91
88
|
configVersion: number;
|
|
92
89
|
}
|
|
93
90
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -114,11 +111,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
114
111
|
}[];
|
|
115
112
|
strategiesLoading: boolean;
|
|
116
113
|
strategyUrlTemplates: Record<string, string>;
|
|
117
|
-
strategiesFetched: boolean;
|
|
118
|
-
strategiesSettled: boolean;
|
|
119
114
|
blockStates: Record<number, PerBlockState>;
|
|
120
115
|
currentRecommendationId: number | null;
|
|
121
|
-
strategyPanelOpen: boolean;
|
|
122
116
|
configVersion: number;
|
|
123
117
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
124
118
|
/**
|
|
@@ -143,11 +137,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
143
137
|
}[];
|
|
144
138
|
strategiesLoading: boolean;
|
|
145
139
|
strategyUrlTemplates: Record<string, string>;
|
|
146
|
-
strategiesFetched: boolean;
|
|
147
|
-
strategiesSettled: boolean;
|
|
148
140
|
blockStates: Record<number, PerBlockState>;
|
|
149
141
|
currentRecommendationId: number | null;
|
|
150
|
-
strategyPanelOpen: boolean;
|
|
151
142
|
configVersion: number;
|
|
152
143
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
153
144
|
/**
|
|
@@ -172,11 +163,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
172
163
|
}[];
|
|
173
164
|
strategiesLoading: boolean;
|
|
174
165
|
strategyUrlTemplates: Record<string, string>;
|
|
175
|
-
strategiesFetched: boolean;
|
|
176
|
-
strategiesSettled: boolean;
|
|
177
166
|
blockStates: Record<number, PerBlockState>;
|
|
178
167
|
currentRecommendationId: number | null;
|
|
179
|
-
strategyPanelOpen: boolean;
|
|
180
168
|
configVersion: number;
|
|
181
169
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
182
170
|
assignStrategyDrawerStatus(state: {
|
|
@@ -198,11 +186,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
198
186
|
}[];
|
|
199
187
|
strategiesLoading: boolean;
|
|
200
188
|
strategyUrlTemplates: Record<string, string>;
|
|
201
|
-
strategiesFetched: boolean;
|
|
202
|
-
strategiesSettled: boolean;
|
|
203
189
|
blockStates: Record<number, PerBlockState>;
|
|
204
190
|
currentRecommendationId: number | null;
|
|
205
|
-
strategyPanelOpen: boolean;
|
|
206
191
|
configVersion: number;
|
|
207
192
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
208
193
|
removeStrategyModalStatus(state: {
|
|
@@ -224,11 +209,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
224
209
|
}[];
|
|
225
210
|
strategiesLoading: boolean;
|
|
226
211
|
strategyUrlTemplates: Record<string, string>;
|
|
227
|
-
strategiesFetched: boolean;
|
|
228
|
-
strategiesSettled: boolean;
|
|
229
212
|
blockStates: Record<number, PerBlockState>;
|
|
230
213
|
currentRecommendationId: number | null;
|
|
231
|
-
strategyPanelOpen: boolean;
|
|
232
214
|
configVersion: number;
|
|
233
215
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
234
216
|
assignedStrategy(state: {
|
|
@@ -250,11 +232,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
250
232
|
}[];
|
|
251
233
|
strategiesLoading: boolean;
|
|
252
234
|
strategyUrlTemplates: Record<string, string>;
|
|
253
|
-
strategiesFetched: boolean;
|
|
254
|
-
strategiesSettled: boolean;
|
|
255
235
|
blockStates: Record<number, PerBlockState>;
|
|
256
236
|
currentRecommendationId: number | null;
|
|
257
|
-
strategyPanelOpen: boolean;
|
|
258
237
|
configVersion: number;
|
|
259
238
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
260
239
|
/**
|
|
@@ -279,11 +258,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
279
258
|
}[];
|
|
280
259
|
strategiesLoading: boolean;
|
|
281
260
|
strategyUrlTemplates: Record<string, string>;
|
|
282
|
-
strategiesFetched: boolean;
|
|
283
|
-
strategiesSettled: boolean;
|
|
284
261
|
blockStates: Record<number, PerBlockState>;
|
|
285
262
|
currentRecommendationId: number | null;
|
|
286
|
-
strategyPanelOpen: boolean;
|
|
287
263
|
configVersion: number;
|
|
288
264
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
289
265
|
/**
|
|
@@ -308,11 +284,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
308
284
|
}[];
|
|
309
285
|
strategiesLoading: boolean;
|
|
310
286
|
strategyUrlTemplates: Record<string, string>;
|
|
311
|
-
strategiesFetched: boolean;
|
|
312
|
-
strategiesSettled: boolean;
|
|
313
287
|
blockStates: Record<number, PerBlockState>;
|
|
314
288
|
currentRecommendationId: number | null;
|
|
315
|
-
strategyPanelOpen: boolean;
|
|
316
289
|
configVersion: number;
|
|
317
290
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
318
291
|
hasFilters(): boolean;
|
|
@@ -338,11 +311,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
338
311
|
}[];
|
|
339
312
|
strategiesLoading: boolean;
|
|
340
313
|
strategyUrlTemplates: Record<string, string>;
|
|
341
|
-
strategiesFetched: boolean;
|
|
342
|
-
strategiesSettled: boolean;
|
|
343
314
|
blockStates: Record<number, PerBlockState>;
|
|
344
315
|
currentRecommendationId: number | null;
|
|
345
|
-
strategyPanelOpen: boolean;
|
|
346
316
|
configVersion: number;
|
|
347
317
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
348
318
|
text: string;
|
|
@@ -367,11 +337,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
367
337
|
}[];
|
|
368
338
|
strategiesLoading: boolean;
|
|
369
339
|
strategyUrlTemplates: Record<string, string>;
|
|
370
|
-
strategiesFetched: boolean;
|
|
371
|
-
strategiesSettled: boolean;
|
|
372
340
|
blockStates: Record<number, PerBlockState>;
|
|
373
341
|
currentRecommendationId: number | null;
|
|
374
|
-
strategyPanelOpen: boolean;
|
|
375
342
|
configVersion: number;
|
|
376
343
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
377
344
|
text: string;
|
|
@@ -396,11 +363,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
396
363
|
}[];
|
|
397
364
|
strategiesLoading: boolean;
|
|
398
365
|
strategyUrlTemplates: Record<string, string>;
|
|
399
|
-
strategiesFetched: boolean;
|
|
400
|
-
strategiesSettled: boolean;
|
|
401
366
|
blockStates: Record<number, PerBlockState>;
|
|
402
367
|
currentRecommendationId: number | null;
|
|
403
|
-
strategyPanelOpen: boolean;
|
|
404
368
|
configVersion: number;
|
|
405
369
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
406
370
|
text: string;
|
|
@@ -481,40 +445,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
481
445
|
openRemoveStrategyModal(): void;
|
|
482
446
|
closeRemoveStrategyModal(): void;
|
|
483
447
|
fetchStrategies(): Promise<void>;
|
|
484
|
-
invalidateStrategies(): void;
|
|
485
|
-
/**
|
|
486
|
-
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
487
|
-
* the user comes back. `visibilitychange` only: a `focus` listener would also fire when
|
|
488
|
-
* focus merely returns from the Stripo canvas iframe to the panel, refetching and
|
|
489
|
-
* regenerating the canvas while the user never left the editor (SD-149916).
|
|
490
|
-
*
|
|
491
|
-
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
492
|
-
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
493
|
-
* leave that one missing from the list. It disarms on the first return AFTER that tab is
|
|
494
|
-
* closed instead, so an ordinary alt-tab later in the session costs nothing. Armed only
|
|
495
|
-
* once the user actually opens a strategy page, so anyone who never does pays nothing.
|
|
496
|
-
*/
|
|
497
|
-
_armStrategyPageReturn(url: string): void;
|
|
498
|
-
/**
|
|
499
|
-
* Reloads the products of the block the user is on, so an edit made in the strategy tab
|
|
500
|
-
* lands on the canvas instead of waiting for the assign drawer to be reopened.
|
|
501
|
-
*
|
|
502
|
-
* Only the selected block: the canvas regeneration is driven off the active block's
|
|
503
|
-
* product array, so refreshing an unselected block would fetch without redrawing it.
|
|
504
|
-
*/
|
|
505
|
-
_refreshAssignedStrategyProducts(): Promise<void>;
|
|
506
|
-
/** Lets the editor tear the return listeners down when it unmounts. */
|
|
507
|
-
disposeStrategyPageReturn(): void;
|
|
508
|
-
/**
|
|
509
|
-
* Opens Smart Recommender's strategy creation page. Every return refreshes the list so the
|
|
510
|
-
* new strategy is offered; the user picks it themselves.
|
|
511
|
-
*/
|
|
512
|
-
openStrategyCreation(): void;
|
|
513
|
-
/**
|
|
514
|
-
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
515
|
-
* edited configuration.
|
|
516
|
-
*/
|
|
517
|
-
openStrategyEdit(strategyId: string | number): void;
|
|
518
448
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
519
449
|
assignStrategy(strategy: RrsStrategy): void;
|
|
520
450
|
removeStrategy(): void;
|
|
@@ -532,11 +462,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
532
462
|
* every block's recommendationConfigs across user edits.
|
|
533
463
|
*/
|
|
534
464
|
hasInvalidBlock(): boolean;
|
|
535
|
-
/**
|
|
536
|
-
* Which required fields are missing across the design's blocks, so the save
|
|
537
|
-
* toaster can name the cause instead of always showing the generic message.
|
|
538
|
-
*/
|
|
539
|
-
invalidBlockFields(): string[];
|
|
540
465
|
fetchRecommendationProducts(): Promise<void>;
|
|
541
466
|
_doFetchProducts(): Promise<void>;
|
|
542
467
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
@@ -15,11 +15,7 @@ export interface RequiredField {
|
|
|
15
15
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
16
16
|
condition?: (config: PerBlockConfigs) => boolean;
|
|
17
17
|
}
|
|
18
|
-
/** Field key of the strategy/algorithm descriptor, used to pick the toaster message. */
|
|
19
|
-
export declare const STRATEGY_FIELD_KEY = "strategy";
|
|
20
18
|
export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
|
|
21
19
|
export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
|
|
22
|
-
/** Shown instead of the generic message when the only thing missing is the strategy. */
|
|
23
|
-
export declare const RecommendationAssignStrategyKey = "newsletter.recommendation-assign-strategy";
|
|
24
20
|
export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice, fields?: RequiredField[]): string[];
|
|
25
21
|
export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ export { default as Guido } from './components/Guido.vue';
|
|
|
2
2
|
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, TemplateMigrationConfig, LegacyRecommendationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
|
|
3
3
|
export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidationErrors, MessageType, ProductType, } from './@types/config';
|
|
4
4
|
export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
|
|
5
|
+
export { useGuidoEmailEditorStore } from './public/editorState';
|
|
6
|
+
export type { GuidoEmailEditorState } from './public/editorState';
|
|
5
7
|
export type { StripoEventType } from './@types/events';
|
|
6
8
|
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published as `@useinsider/guido/editor-state` — the live editor snapshot Guido
|
|
3
|
+
* writes into the host's shared Pinia singleton.
|
|
4
|
+
*
|
|
5
|
+
* Importing from here pulls in nothing but pinia, so the editor never enters a
|
|
6
|
+
* consumer's module graph. Re-export surface only: this is the contract,
|
|
7
|
+
* `stores/guido-email-editor` is the implementation and stays free to move.
|
|
8
|
+
*
|
|
9
|
+
* Consumers read the store by importing it; the id `guidoEmailEditor` remains
|
|
10
|
+
* part of the contract for cortex-fe, which probes `pinia._s` at runtime instead
|
|
11
|
+
* of taking a build-time dependency on this package.
|
|
12
|
+
*/
|
|
13
|
+
export { useGuidoEmailEditorStore } from '../stores/guido-email-editor';
|
|
14
|
+
export type { GuidoEmailEditorState } from '../stores/guido-email-editor';
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Importing from here pulls in nothing else, so the editor never enters a
|
|
5
5
|
* consumer's module graph. Re-export surface only: this is the contract,
|
|
6
6
|
* `utils/linkTrackingIds` is the implementation and stays free to move.
|
|
7
|
+
*
|
|
8
|
+
* Relative, not the `@@/Utils/` alias: vue-tsc copies the specifier into the emitted
|
|
9
|
+
* .d.ts verbatim, and a consumer's TypeScript cannot resolve our alias table. A relative
|
|
10
|
+
* path resolves against dist/src/, so the published types actually load.
|
|
7
11
|
*/
|
|
8
|
-
export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '
|
|
9
|
-
export type { TrackingIdResult } from '
|
|
12
|
+
export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '../utils/linkTrackingIds';
|
|
13
|
+
export type { TrackingIdResult } from '../utils/linkTrackingIds';
|
|
@@ -6,6 +6,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
6
6
|
isPreviewModeOpen: boolean;
|
|
7
7
|
editorVisualMode: string;
|
|
8
8
|
hasChanges: boolean;
|
|
9
|
+
changeSeq: number;
|
|
9
10
|
isStripoInitialized: boolean;
|
|
10
11
|
templateId: string;
|
|
11
12
|
syncModulesEnabled: boolean;
|
|
@@ -19,6 +20,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
19
20
|
isPreviewModeOpen: boolean;
|
|
20
21
|
editorVisualMode: string;
|
|
21
22
|
hasChanges: boolean;
|
|
23
|
+
changeSeq: number;
|
|
22
24
|
isStripoInitialized: boolean;
|
|
23
25
|
templateId: string;
|
|
24
26
|
syncModulesEnabled: boolean;
|
|
@@ -31,6 +33,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
31
33
|
isPreviewModeOpen: boolean;
|
|
32
34
|
editorVisualMode: string;
|
|
33
35
|
hasChanges: boolean;
|
|
36
|
+
changeSeq: number;
|
|
34
37
|
isStripoInitialized: boolean;
|
|
35
38
|
templateId: string;
|
|
36
39
|
syncModulesEnabled: boolean;
|
|
@@ -44,6 +47,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
44
47
|
isPreviewModeOpen: boolean;
|
|
45
48
|
editorVisualMode: string;
|
|
46
49
|
hasChanges: boolean;
|
|
50
|
+
changeSeq: number;
|
|
47
51
|
isStripoInitialized: boolean;
|
|
48
52
|
templateId: string;
|
|
49
53
|
syncModulesEnabled: boolean;
|
|
@@ -56,6 +60,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
56
60
|
isPreviewModeOpen: boolean;
|
|
57
61
|
editorVisualMode: string;
|
|
58
62
|
hasChanges: boolean;
|
|
63
|
+
changeSeq: number;
|
|
59
64
|
isStripoInitialized: boolean;
|
|
60
65
|
templateId: string;
|
|
61
66
|
syncModulesEnabled: boolean;
|
|
@@ -69,6 +74,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
69
74
|
isPreviewModeOpen: boolean;
|
|
70
75
|
editorVisualMode: string;
|
|
71
76
|
hasChanges: boolean;
|
|
77
|
+
changeSeq: number;
|
|
72
78
|
isStripoInitialized: boolean;
|
|
73
79
|
templateId: string;
|
|
74
80
|
syncModulesEnabled: boolean;
|
|
@@ -81,6 +87,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
81
87
|
isPreviewModeOpen: boolean;
|
|
82
88
|
editorVisualMode: string;
|
|
83
89
|
hasChanges: boolean;
|
|
90
|
+
changeSeq: number;
|
|
84
91
|
isStripoInitialized: boolean;
|
|
85
92
|
templateId: string;
|
|
86
93
|
syncModulesEnabled: boolean;
|
|
@@ -94,6 +101,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
94
101
|
isPreviewModeOpen: boolean;
|
|
95
102
|
editorVisualMode: string;
|
|
96
103
|
hasChanges: boolean;
|
|
104
|
+
changeSeq: number;
|
|
97
105
|
isStripoInitialized: boolean;
|
|
98
106
|
templateId: string;
|
|
99
107
|
syncModulesEnabled: boolean;
|
|
@@ -106,6 +114,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
106
114
|
isPreviewModeOpen: boolean;
|
|
107
115
|
editorVisualMode: string;
|
|
108
116
|
hasChanges: boolean;
|
|
117
|
+
changeSeq: number;
|
|
109
118
|
isStripoInitialized: boolean;
|
|
110
119
|
templateId: string;
|
|
111
120
|
syncModulesEnabled: boolean;
|
|
@@ -119,6 +128,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
119
128
|
isPreviewModeOpen: boolean;
|
|
120
129
|
editorVisualMode: string;
|
|
121
130
|
hasChanges: boolean;
|
|
131
|
+
changeSeq: number;
|
|
122
132
|
isStripoInitialized: boolean;
|
|
123
133
|
templateId: string;
|
|
124
134
|
syncModulesEnabled: boolean;
|
|
@@ -131,6 +141,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
131
141
|
isPreviewModeOpen: boolean;
|
|
132
142
|
editorVisualMode: string;
|
|
133
143
|
hasChanges: boolean;
|
|
144
|
+
changeSeq: number;
|
|
134
145
|
isStripoInitialized: boolean;
|
|
135
146
|
templateId: string;
|
|
136
147
|
syncModulesEnabled: boolean;
|
|
@@ -144,6 +155,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
144
155
|
isPreviewModeOpen: boolean;
|
|
145
156
|
editorVisualMode: string;
|
|
146
157
|
hasChanges: boolean;
|
|
158
|
+
changeSeq: number;
|
|
147
159
|
isStripoInitialized: boolean;
|
|
148
160
|
templateId: string;
|
|
149
161
|
syncModulesEnabled: boolean;
|
|
@@ -156,6 +168,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
156
168
|
isPreviewModeOpen: boolean;
|
|
157
169
|
editorVisualMode: string;
|
|
158
170
|
hasChanges: boolean;
|
|
171
|
+
changeSeq: number;
|
|
159
172
|
isStripoInitialized: boolean;
|
|
160
173
|
templateId: string;
|
|
161
174
|
syncModulesEnabled: boolean;
|
|
@@ -169,6 +182,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
169
182
|
isPreviewModeOpen: boolean;
|
|
170
183
|
editorVisualMode: string;
|
|
171
184
|
hasChanges: boolean;
|
|
185
|
+
changeSeq: number;
|
|
172
186
|
isStripoInitialized: boolean;
|
|
173
187
|
templateId: string;
|
|
174
188
|
syncModulesEnabled: boolean;
|
|
@@ -181,6 +195,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
181
195
|
isPreviewModeOpen: boolean;
|
|
182
196
|
editorVisualMode: string;
|
|
183
197
|
hasChanges: boolean;
|
|
198
|
+
changeSeq: number;
|
|
184
199
|
isStripoInitialized: boolean;
|
|
185
200
|
templateId: string;
|
|
186
201
|
syncModulesEnabled: boolean;
|
|
@@ -194,6 +209,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
194
209
|
isPreviewModeOpen: boolean;
|
|
195
210
|
editorVisualMode: string;
|
|
196
211
|
hasChanges: boolean;
|
|
212
|
+
changeSeq: number;
|
|
197
213
|
isStripoInitialized: boolean;
|
|
198
214
|
templateId: string;
|
|
199
215
|
syncModulesEnabled: boolean;
|
|
@@ -206,6 +222,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
206
222
|
isPreviewModeOpen: boolean;
|
|
207
223
|
editorVisualMode: string;
|
|
208
224
|
hasChanges: boolean;
|
|
225
|
+
changeSeq: number;
|
|
209
226
|
isStripoInitialized: boolean;
|
|
210
227
|
templateId: string;
|
|
211
228
|
syncModulesEnabled: boolean;
|
|
@@ -219,6 +236,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
219
236
|
isPreviewModeOpen: boolean;
|
|
220
237
|
editorVisualMode: string;
|
|
221
238
|
hasChanges: boolean;
|
|
239
|
+
changeSeq: number;
|
|
222
240
|
isStripoInitialized: boolean;
|
|
223
241
|
templateId: string;
|
|
224
242
|
syncModulesEnabled: boolean;
|
|
@@ -231,6 +249,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
231
249
|
isPreviewModeOpen: boolean;
|
|
232
250
|
editorVisualMode: string;
|
|
233
251
|
hasChanges: boolean;
|
|
252
|
+
changeSeq: number;
|
|
234
253
|
isStripoInitialized: boolean;
|
|
235
254
|
templateId: string;
|
|
236
255
|
syncModulesEnabled: boolean;
|
|
@@ -244,6 +263,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
244
263
|
isPreviewModeOpen: boolean;
|
|
245
264
|
editorVisualMode: string;
|
|
246
265
|
hasChanges: boolean;
|
|
266
|
+
changeSeq: number;
|
|
247
267
|
isStripoInitialized: boolean;
|
|
248
268
|
templateId: string;
|
|
249
269
|
syncModulesEnabled: boolean;
|
|
@@ -256,6 +276,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
256
276
|
isPreviewModeOpen: boolean;
|
|
257
277
|
editorVisualMode: string;
|
|
258
278
|
hasChanges: boolean;
|
|
279
|
+
changeSeq: number;
|
|
259
280
|
isStripoInitialized: boolean;
|
|
260
281
|
templateId: string;
|
|
261
282
|
syncModulesEnabled: boolean;
|
|
@@ -269,6 +290,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
269
290
|
isPreviewModeOpen: boolean;
|
|
270
291
|
editorVisualMode: string;
|
|
271
292
|
hasChanges: boolean;
|
|
293
|
+
changeSeq: number;
|
|
272
294
|
isStripoInitialized: boolean;
|
|
273
295
|
templateId: string;
|
|
274
296
|
syncModulesEnabled: boolean;
|
|
@@ -281,6 +303,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
281
303
|
isPreviewModeOpen: boolean;
|
|
282
304
|
editorVisualMode: string;
|
|
283
305
|
hasChanges: boolean;
|
|
306
|
+
changeSeq: number;
|
|
284
307
|
isStripoInitialized: boolean;
|
|
285
308
|
templateId: string;
|
|
286
309
|
syncModulesEnabled: boolean;
|
|
@@ -294,6 +317,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
294
317
|
isPreviewModeOpen: boolean;
|
|
295
318
|
editorVisualMode: string;
|
|
296
319
|
hasChanges: boolean;
|
|
320
|
+
changeSeq: number;
|
|
297
321
|
isStripoInitialized: boolean;
|
|
298
322
|
templateId: string;
|
|
299
323
|
syncModulesEnabled: boolean;
|
|
@@ -306,6 +330,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
306
330
|
isPreviewModeOpen: boolean;
|
|
307
331
|
editorVisualMode: string;
|
|
308
332
|
hasChanges: boolean;
|
|
333
|
+
changeSeq: number;
|
|
309
334
|
isStripoInitialized: boolean;
|
|
310
335
|
templateId: string;
|
|
311
336
|
syncModulesEnabled: boolean;
|