@useinsider/guido 3.19.0-beta.acb00a2 → 3.19.0-beta.b05a465
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 +8 -8
- package/dist/components/Guido.vue2.js +85 -86
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +23 -25
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useActionsApi.js +44 -43
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +11 -11
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useCortexBlueprintBridge.js +54 -122
- package/dist/composables/useEmailTemplateApplier.js +52 -108
- 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/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/migrator/index.js +14 -13
- 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/Recommendation/block.js +15 -14
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +103 -91
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +45 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +72 -70
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +69 -60
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- 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 +3 -2
- package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -18
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHttp.d.ts +2 -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/Recommendation/controls/cardComposition/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- 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 +10 -20
- 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/stripoEditorApi.d.ts +4 -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 +1 -3
- package/dist/stores/onboarding.js +4 -0
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/stripoEditorApi.js +11 -0
- package/package.json +2 -1
|
@@ -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>>;
|
|
@@ -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: {
|
|
@@ -189,6 +189,9 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
189
189
|
*/
|
|
190
190
|
private _buildCompositionHtml;
|
|
191
191
|
private _applyVisibilityToBlock;
|
|
192
|
+
/** Inline "Product Prices" group row is tagged with whichever price comes first, so it drives both keys. */
|
|
193
|
+
private _resolveVisibilityKeys;
|
|
194
|
+
private _isInlinePrices;
|
|
192
195
|
private _applyTitleVisibilityToBlock;
|
|
193
196
|
private _resolveTitleInjection;
|
|
194
197
|
private _readTitleHtml;
|
|
@@ -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
|
|
@@ -33,6 +33,10 @@ export declare function normalizeCustomAttrValues(values: string[], blockNode?:
|
|
|
33
33
|
* value, which stays correct on rows still tagged with a legacy bare name.
|
|
34
34
|
*/
|
|
35
35
|
export declare function resolveRowCompositionKey(row: ImmutableHtmlNode): string | null;
|
|
36
|
+
/** Inline price mode renders sale + original price in ONE row, tagged with whichever comes first. */
|
|
37
|
+
export declare function isMergedInlinePriceRow(row: ImmutableHtmlNode | null | undefined): boolean;
|
|
38
|
+
/** Keys whose visibility a row carries: the merged inline price row stands for both prices. */
|
|
39
|
+
export declare function resolveRowVisibilityKeys(row: ImmutableHtmlNode): string[];
|
|
36
40
|
/**
|
|
37
41
|
* Finds an attribute row by composition key, tolerating rows still tagged with the
|
|
38
42
|
* legacy bare-name key. Custom candidates are validated against their `product-attr`,
|
|
@@ -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[];
|
|
@@ -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,13 +1,3 @@
|
|
|
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
|
-
}
|
|
11
1
|
/** The published editor snapshot — the shape a consumer reads off the shared store. */
|
|
12
2
|
export interface GuidoEmailEditorState {
|
|
13
3
|
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
@@ -18,10 +8,6 @@ export interface GuidoEmailEditorState {
|
|
|
18
8
|
lastUpdatedAt: number;
|
|
19
9
|
/** Template id from the editor config, so a consumer can scope per-template. */
|
|
20
10
|
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>;
|
|
25
11
|
}
|
|
26
12
|
/**
|
|
27
13
|
* Outbound contract Guido publishes to the host's shared Pinia singleton so a
|
|
@@ -32,11 +18,17 @@ export interface GuidoEmailEditorState {
|
|
|
32
18
|
* Published as `@useinsider/guido/editor-state` and from the root barrel, so a
|
|
33
19
|
* consumer imports this store instead of re-declaring one under the same id.
|
|
34
20
|
*
|
|
35
|
-
* State
|
|
36
|
-
*
|
|
21
|
+
* State + getters only, no actions. `useGuidoStateBridge` is the only intended
|
|
22
|
+
* writer, but that is Guido's own convention rather than something the store
|
|
23
|
+
* enforces: publishing the definition hands a consumer `$patch` as well, exactly
|
|
24
|
+
* as the runtime `pinia._s` probe always did.
|
|
37
25
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
26
|
+
* Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it via
|
|
27
|
+
* `pinia._s.get('guidoEmailEditor')` at runtime rather than importing it, so the
|
|
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.
|
|
40
32
|
*/
|
|
41
33
|
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", GuidoEmailEditorState, {
|
|
42
34
|
/** True once the bridge has published at least one snapshot. */
|
|
@@ -45,7 +37,5 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
|
|
|
45
37
|
css: string;
|
|
46
38
|
lastUpdatedAt: number;
|
|
47
39
|
templateId: string;
|
|
48
|
-
bridgeActive: boolean;
|
|
49
|
-
applyAcks: Record<string, ApplyAck>;
|
|
50
40
|
} & import("pinia").PiniaCustomStateProperties<GuidoEmailEditorState>) => boolean;
|
|
51
41
|
}, {}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OnboardingCardConfig, OnboardingType, OnboardingStoreState } from '@@/Types/onboarding';
|
|
2
2
|
export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoOnboarding", OnboardingStoreState, {
|
|
3
|
+
/** @deprecated Components use the type-specific getters. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
3
4
|
getOnboarding: (state: {
|
|
4
5
|
onboardings: {
|
|
5
6
|
newVersionPopup: {
|
|
@@ -390,6 +391,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
|
|
|
390
391
|
};
|
|
391
392
|
isFetched: boolean;
|
|
392
393
|
} & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => (type: OnboardingType) => boolean;
|
|
394
|
+
/** @deprecated Components use getGenericCurrentCard / getTextBlockCurrentCard. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
393
395
|
getCurrentCard: (state: {
|
|
394
396
|
onboardings: {
|
|
395
397
|
newVersionPopup: {
|
|
@@ -2190,6 +2192,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
|
|
|
2190
2192
|
close(type: OnboardingType): Promise<void>;
|
|
2191
2193
|
next(type: OnboardingType): void;
|
|
2192
2194
|
previous(type: OnboardingType): void;
|
|
2195
|
+
/** @deprecated No caller in src/. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
2193
2196
|
updateCardPosition(type: OnboardingType, cardIndex: number, position: {
|
|
2194
2197
|
top: string;
|
|
2195
2198
|
position: string;
|
|
@@ -2198,6 +2201,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
|
|
|
2198
2201
|
onDiscoverNowClicked(): Promise<void>;
|
|
2199
2202
|
onRemindMeLater(): void;
|
|
2200
2203
|
onNewVersionPopupClose(): Promise<void>;
|
|
2204
|
+
/** @deprecated No caller in src/. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
2201
2205
|
isOnboardingActive(): boolean;
|
|
2202
2206
|
fetchUserModalState(): Promise<void>;
|
|
2203
2207
|
setUserModalState(modal: string, state: string, page: string): Promise<void>;
|
|
@@ -6,5 +6,10 @@ type RecommendationConfig = {
|
|
|
6
6
|
interface StoreState {
|
|
7
7
|
recommendationConfigs: RecommendationConfig[];
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated recommendationConfigs has no writer in src/, so the store is
|
|
11
|
+
* permanently empty and its only readers (useHtmlValidator.ts:496-497) are a
|
|
12
|
+
* no-op. Slated for deletion, see the SD-667788 dead-code ledger.
|
|
13
|
+
*/
|
|
9
14
|
export declare const useRecommendationStore: import("pinia").StoreDefinition<"guidoRecommendation", StoreState, {}, {}>;
|
|
10
15
|
export {};
|
|
@@ -3,12 +3,22 @@
|
|
|
3
3
|
* en-US -> MM/DD/YYYY
|
|
4
4
|
* en-GB -> DD/MM/YYYY
|
|
5
5
|
* tr-TR -> DD.MM.YYYY
|
|
6
|
+
*
|
|
7
|
+
* The non-string branches below are unreachable: the only caller chain is
|
|
8
|
+
* formatShortDate -> AssignStrategyDrawer.vue:74, which passes a non-empty string.
|
|
9
|
+
* The function itself is live — do not delete it with them.
|
|
6
10
|
*/
|
|
7
11
|
export declare const convertToDateObject: (date: string | number | Date | null | undefined) => Date;
|
|
8
12
|
export declare const locale: () => string;
|
|
9
13
|
export declare const localTz: string;
|
|
10
14
|
export declare const timezone: () => string;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated No caller in src/ and not exported from library.ts. Slated for deletion, see the SD-667788 dead-code ledger.
|
|
17
|
+
*/
|
|
11
18
|
export declare const hour12: () => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated No caller in src/ and not exported from library.ts. Slated for deletion, see the SD-667788 dead-code ledger.
|
|
21
|
+
*/
|
|
12
22
|
export declare const dateFormat: () => string;
|
|
13
23
|
/**
|
|
14
24
|
* @example 04/22/2024
|
|
@@ -24,6 +24,9 @@ export declare const getCsrfToken: () => string;
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const getUrlParams: () => URLSearchParams;
|
|
26
26
|
export declare const getUrlParam: (paramName: string, defaultValue?: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated No caller in src/. Slated for deletion, see the SD-667788 dead-code ledger.
|
|
29
|
+
*/
|
|
27
30
|
export declare const replaceString: (string?: string, values?: Record<string, string | number>, isRemoveEmptyValues?: boolean) => string;
|
|
28
31
|
/**
|
|
29
32
|
* Narrows an unknown API value to a printable string; anything that is neither
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StripoEditorApi } from '@@/Types/stripo';
|
|
2
|
+
export declare const EDITOR_NOT_READY_MESSAGE = "The editor is not ready yet. Please wait for it to load and try again.";
|
|
3
|
+
export declare const findEditorApi: () => StripoEditorApi | undefined;
|
|
4
|
+
export declare const getEditorApi: () => StripoEditorApi;
|
|
@@ -52,6 +52,15 @@ const n = `.strategy-control-header {
|
|
|
52
52
|
mask-size: 24px 24px;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
.strategy-control-notice--error {
|
|
56
|
+
border-color: var(--guido-color-border-onpage-message-error);
|
|
57
|
+
background-color: var(--guido-color-background-onpage-message-error);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.strategy-control-notice--error::before {
|
|
61
|
+
background-color: var(--guido-color-border-onpage-message-error);
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
.strategy-control-notice-text {
|
|
56
65
|
margin: 0;
|
|
57
66
|
padding: 4px 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r = `.patch-session-container {
|
|
2
2
|
row-gap: 16px;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -28,11 +28,7 @@ ue-vh-patch.selected .patch-wrapper {
|
|
|
28
28
|
.change-history-panel-wrapper .control-panel-header {
|
|
29
29
|
padding: 16px 0 16px 16px;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
.change-history-panel-wrapper .header-control-panel-label {
|
|
33
|
-
grid-area: 1 / 1 / 2 / 12;
|
|
34
|
-
}
|
|
35
31
|
`;
|
|
36
32
|
export {
|
|
37
|
-
|
|
33
|
+
r as default
|
|
38
34
|
};
|
|
@@ -20,8 +20,10 @@ const t = () => ({
|
|
|
20
20
|
}), c = s("guidoOnboarding", {
|
|
21
21
|
state: () => a(),
|
|
22
22
|
getters: {
|
|
23
|
+
/** @deprecated Components use the type-specific getters. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
23
24
|
getOnboarding: (n) => (o) => n.onboardings[o],
|
|
24
25
|
isActive: (n) => (o) => n.onboardings[o].isActive,
|
|
26
|
+
/** @deprecated Components use getGenericCurrentCard / getTextBlockCurrentCard. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
25
27
|
getCurrentCard: (n) => (o) => {
|
|
26
28
|
const i = n.onboardings[o];
|
|
27
29
|
return i.config[i.cardIndex];
|
|
@@ -81,6 +83,7 @@ const t = () => ({
|
|
|
81
83
|
previous(n) {
|
|
82
84
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
83
85
|
},
|
|
86
|
+
/** @deprecated No caller in src/. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
84
87
|
updateCardPosition(n, o, i) {
|
|
85
88
|
const r = this.onboardings[n].config[o];
|
|
86
89
|
r && (r.top = i.top, r.position = i.position);
|
|
@@ -97,6 +100,7 @@ const t = () => ({
|
|
|
97
100
|
async onNewVersionPopupClose() {
|
|
98
101
|
await this.setUserModalState("newVersionPopup", "true", "Guido");
|
|
99
102
|
},
|
|
103
|
+
/** @deprecated No caller in src/. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
100
104
|
isOnboardingActive() {
|
|
101
105
|
return Object.values(this.onboardings).some((n) => n.isActive);
|
|
102
106
|
},
|
|
@@ -39,16 +39,16 @@ const r = () => ({
|
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
41
|
isActiveTypeFirstInCollection: (e) => {
|
|
42
|
-
const t = i[e.selectedCollectionType];
|
|
42
|
+
const t = i[e.selectedCollectionType] ?? [];
|
|
43
43
|
return e.activeType === t[0];
|
|
44
44
|
},
|
|
45
45
|
isActiveTypeLastInCollection: (e) => {
|
|
46
|
-
const t = i[e.selectedCollectionType];
|
|
46
|
+
const t = i[e.selectedCollectionType] ?? [];
|
|
47
47
|
return e.activeType === t[t.length - 1];
|
|
48
48
|
},
|
|
49
49
|
hasTemplatesByCollectionType: (e) => {
|
|
50
50
|
const t = {};
|
|
51
|
-
return i[e.selectedCollectionType].forEach((s) => {
|
|
51
|
+
return (i[e.selectedCollectionType] ?? []).forEach((s) => {
|
|
52
52
|
t[s] = e.templates.some((c) => c.type === s);
|
|
53
53
|
}), t;
|
|
54
54
|
},
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const o = "The editor is not ready yet. Please wait for it to load and try again.", i = () => window.StripoEditorApi, r = () => {
|
|
2
|
+
const t = i();
|
|
3
|
+
if (!t)
|
|
4
|
+
throw new Error(o);
|
|
5
|
+
return t;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
o as EDITOR_NOT_READY_MESSAGE,
|
|
9
|
+
i as findEditorApi,
|
|
10
|
+
r as getEditorApi
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.19.0-beta.
|
|
3
|
+
"version": "3.19.0-beta.b05a465",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"test:e2e-mutation": "node scripts/e2e-mutation-check.mjs",
|
|
39
39
|
"type-check": "vue-tsc --noEmit --project tsconfig.config.json && vue-tsc --noEmit --project tsconfig.app.json",
|
|
40
40
|
"test": "vitest run --coverage",
|
|
41
|
+
"test:run": "vitest run",
|
|
41
42
|
"test:watch": "vitest",
|
|
42
43
|
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
43
44
|
"test:e2e:coverage": "E2E_COVERAGE=true playwright test",
|