@useinsider/guido 3.18.2-beta.eedafd2 → 3.18.2-beta.ef84353
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 -1
- package/dist/@types/config/schemas.js +26 -28
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +51 -53
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useGuidoStateBridge.js +29 -24
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/useStripo.js +7 -7
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +36 -43
- package/dist/guido.css +1 -1
- package/dist/library.js +15 -13
- package/dist/public/editorState.js +4 -0
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- 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/config.d.ts +0 -30
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/stores/guido-email-editor.d.ts +27 -27
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +22 -39
- package/dist/stores/editor.js +4 -0
- package/dist/stores/guido-email-editor.js +0 -4
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +5 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
2
|
import type { FiltersResponse } from '@@/Types/recommendation';
|
|
3
|
-
/**
|
|
4
|
-
* Extracts recommendation block IDs directly from the HTML by parsing
|
|
5
|
-
* the recommendation-id attribute on block elements.
|
|
6
|
-
* This avoids depending on store state which may not be populated
|
|
7
|
-
* when the settings panel hasn't been opened yet (e.g., saved templates).
|
|
8
|
-
*/
|
|
9
|
-
export declare function getRecommendationBlockIds(html: string): string[];
|
|
10
3
|
/**
|
|
11
4
|
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
12
5
|
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
@@ -34,20 +27,6 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
|
|
|
34
27
|
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
35
28
|
*/
|
|
36
29
|
export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
|
|
37
|
-
/**
|
|
38
|
-
* Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
|
|
39
|
-
*
|
|
40
|
-
* A tag's variable name is the part before the first `|` (everything after it is the fallback).
|
|
41
|
-
* Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
|
|
42
|
-
* is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
|
|
43
|
-
* present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
|
|
44
|
-
* `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
|
|
45
|
-
*
|
|
46
|
-
* `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
|
|
47
|
-
* store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
|
|
48
|
-
* backend resolves through its own pipeline, so they must not be treated as user-authored tags.
|
|
49
|
-
*/
|
|
50
|
-
export declare function getInvalidDynamicContentTags(html: string): string[];
|
|
51
30
|
export declare const useHtmlValidator: () => {
|
|
52
31
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
53
32
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
-
type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
|
|
3
|
-
type SaveResult = SaveDetails | undefined;
|
|
4
2
|
export declare const useSave: () => {
|
|
5
|
-
save: (suppressEmit?: boolean, silent?: boolean) => Promise<
|
|
6
|
-
saveWithErrors: () => Promise<SaveResult>;
|
|
7
|
-
saveRawOnly: () => Promise<SaveResult>;
|
|
3
|
+
save: (suppressEmit?: boolean, silent?: boolean) => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined>;
|
|
8
4
|
};
|
|
9
|
-
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare const COUPON_TAG_MODIFIED_KEY = "newsletter.coupon-tag-modified";
|
|
2
|
-
/** Pure core: the tag text of every coupon block whose code was modified. */
|
|
3
|
-
export declare function findInvalidCouponBlocks(html: string): string[];
|
|
4
1
|
export declare const useCouponBlockValidator: () => {
|
|
5
2
|
validateCouponBlockTags: (html: string) => boolean;
|
|
6
3
|
};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
declare const SINGLETON_BLOCK_RULES: {
|
|
2
|
-
pageType: number;
|
|
3
|
-
messageKey: string;
|
|
4
|
-
}[];
|
|
5
|
-
export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
|
|
6
|
-
/** Pure core: the singleton rules whose page type appears more than once. */
|
|
7
|
-
export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
|
|
8
|
-
/** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
|
|
9
|
-
export declare function countUnsubBlocksWithoutPage(html: string): number;
|
|
10
1
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
11
2
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
12
3
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
13
4
|
};
|
|
14
|
-
export {};
|
|
@@ -462,11 +462,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
462
462
|
* every block's recommendationConfigs across user edits.
|
|
463
463
|
*/
|
|
464
464
|
hasInvalidBlock(): boolean;
|
|
465
|
-
/**
|
|
466
|
-
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
467
|
-
* that fails required-field validation, one drawer row each (SD-147430).
|
|
468
|
-
*/
|
|
469
|
-
invalidBlockIds(): string[];
|
|
470
465
|
fetchRecommendationProducts(): Promise<void>;
|
|
471
466
|
_doFetchProducts(): Promise<void>;
|
|
472
467
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
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';
|
|
@@ -104,7 +104,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
104
104
|
autosave: boolean;
|
|
105
105
|
allowlistEnabled: boolean;
|
|
106
106
|
linkTrackingIds: boolean;
|
|
107
|
-
allowSaveWithErrors: boolean;
|
|
108
107
|
reusableRecommendationStrategy: boolean;
|
|
109
108
|
};
|
|
110
109
|
blocks: {
|
|
@@ -246,7 +245,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
246
245
|
autosave: boolean;
|
|
247
246
|
allowlistEnabled: boolean;
|
|
248
247
|
linkTrackingIds: boolean;
|
|
249
|
-
allowSaveWithErrors: boolean;
|
|
250
248
|
reusableRecommendationStrategy: boolean;
|
|
251
249
|
};
|
|
252
250
|
blocks: {
|
|
@@ -388,7 +386,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
388
386
|
autosave: boolean;
|
|
389
387
|
allowlistEnabled: boolean;
|
|
390
388
|
linkTrackingIds: boolean;
|
|
391
|
-
allowSaveWithErrors: boolean;
|
|
392
389
|
reusableRecommendationStrategy: boolean;
|
|
393
390
|
};
|
|
394
391
|
blocks: {
|
|
@@ -530,7 +527,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
530
527
|
autosave: boolean;
|
|
531
528
|
allowlistEnabled: boolean;
|
|
532
529
|
linkTrackingIds: boolean;
|
|
533
|
-
allowSaveWithErrors: boolean;
|
|
534
530
|
reusableRecommendationStrategy: boolean;
|
|
535
531
|
};
|
|
536
532
|
blocks: {
|
|
@@ -672,7 +668,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
672
668
|
autosave: boolean;
|
|
673
669
|
allowlistEnabled: boolean;
|
|
674
670
|
linkTrackingIds: boolean;
|
|
675
|
-
allowSaveWithErrors: boolean;
|
|
676
671
|
reusableRecommendationStrategy: boolean;
|
|
677
672
|
};
|
|
678
673
|
blocks: {
|
|
@@ -814,7 +809,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
814
809
|
autosave: boolean;
|
|
815
810
|
allowlistEnabled: boolean;
|
|
816
811
|
linkTrackingIds: boolean;
|
|
817
|
-
allowSaveWithErrors: boolean;
|
|
818
812
|
reusableRecommendationStrategy: boolean;
|
|
819
813
|
};
|
|
820
814
|
blocks: {
|
|
@@ -956,7 +950,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
956
950
|
autosave: boolean;
|
|
957
951
|
allowlistEnabled: boolean;
|
|
958
952
|
linkTrackingIds: boolean;
|
|
959
|
-
allowSaveWithErrors: boolean;
|
|
960
953
|
reusableRecommendationStrategy: boolean;
|
|
961
954
|
};
|
|
962
955
|
blocks: {
|
|
@@ -1098,7 +1091,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1098
1091
|
autosave: boolean;
|
|
1099
1092
|
allowlistEnabled: boolean;
|
|
1100
1093
|
linkTrackingIds: boolean;
|
|
1101
|
-
allowSaveWithErrors: boolean;
|
|
1102
1094
|
reusableRecommendationStrategy: boolean;
|
|
1103
1095
|
};
|
|
1104
1096
|
blocks: {
|
|
@@ -1240,7 +1232,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1240
1232
|
autosave: boolean;
|
|
1241
1233
|
allowlistEnabled: boolean;
|
|
1242
1234
|
linkTrackingIds: boolean;
|
|
1243
|
-
allowSaveWithErrors: boolean;
|
|
1244
1235
|
reusableRecommendationStrategy: boolean;
|
|
1245
1236
|
};
|
|
1246
1237
|
blocks: {
|
|
@@ -1382,7 +1373,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1382
1373
|
autosave: boolean;
|
|
1383
1374
|
allowlistEnabled: boolean;
|
|
1384
1375
|
linkTrackingIds: boolean;
|
|
1385
|
-
allowSaveWithErrors: boolean;
|
|
1386
1376
|
reusableRecommendationStrategy: boolean;
|
|
1387
1377
|
};
|
|
1388
1378
|
blocks: {
|
|
@@ -1524,7 +1514,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1524
1514
|
autosave: boolean;
|
|
1525
1515
|
allowlistEnabled: boolean;
|
|
1526
1516
|
linkTrackingIds: boolean;
|
|
1527
|
-
allowSaveWithErrors: boolean;
|
|
1528
1517
|
reusableRecommendationStrategy: boolean;
|
|
1529
1518
|
};
|
|
1530
1519
|
blocks: {
|
|
@@ -1666,7 +1655,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1666
1655
|
autosave: boolean;
|
|
1667
1656
|
allowlistEnabled: boolean;
|
|
1668
1657
|
linkTrackingIds: boolean;
|
|
1669
|
-
allowSaveWithErrors: boolean;
|
|
1670
1658
|
reusableRecommendationStrategy: boolean;
|
|
1671
1659
|
};
|
|
1672
1660
|
blocks: {
|
|
@@ -1808,7 +1796,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1808
1796
|
autosave: boolean;
|
|
1809
1797
|
allowlistEnabled: boolean;
|
|
1810
1798
|
linkTrackingIds: boolean;
|
|
1811
|
-
allowSaveWithErrors: boolean;
|
|
1812
1799
|
reusableRecommendationStrategy: boolean;
|
|
1813
1800
|
};
|
|
1814
1801
|
blocks: {
|
|
@@ -1950,7 +1937,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1950
1937
|
autosave: boolean;
|
|
1951
1938
|
allowlistEnabled: boolean;
|
|
1952
1939
|
linkTrackingIds: boolean;
|
|
1953
|
-
allowSaveWithErrors: boolean;
|
|
1954
1940
|
reusableRecommendationStrategy: boolean;
|
|
1955
1941
|
};
|
|
1956
1942
|
blocks: {
|
|
@@ -2092,7 +2078,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2092
2078
|
autosave: boolean;
|
|
2093
2079
|
allowlistEnabled: boolean;
|
|
2094
2080
|
linkTrackingIds: boolean;
|
|
2095
|
-
allowSaveWithErrors: boolean;
|
|
2096
2081
|
reusableRecommendationStrategy: boolean;
|
|
2097
2082
|
};
|
|
2098
2083
|
blocks: {
|
|
@@ -2136,18 +2121,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2136
2121
|
};
|
|
2137
2122
|
} | null;
|
|
2138
2123
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
2139
|
-
/**
|
|
2140
|
-
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
2141
|
-
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
2142
|
-
*/
|
|
2143
|
-
isTransactional(): boolean;
|
|
2144
|
-
/**
|
|
2145
|
-
* Soft-save policy: may the editor persist a template with validation errors?
|
|
2146
|
-
* Default true (host sets features.allowSaveWithErrors=false for transactional +
|
|
2147
|
-
* unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
|
|
2148
|
-
* floor to false pre-init and momentarily hide the soft-save option (SD-147430).
|
|
2149
|
-
*/
|
|
2150
|
-
allowSaveWithErrors(): boolean;
|
|
2151
2124
|
/**
|
|
2152
2125
|
* Get the username
|
|
2153
2126
|
*/
|
|
@@ -2246,7 +2219,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2246
2219
|
autosave: boolean;
|
|
2247
2220
|
allowlistEnabled: boolean;
|
|
2248
2221
|
linkTrackingIds: boolean;
|
|
2249
|
-
allowSaveWithErrors: boolean;
|
|
2250
2222
|
reusableRecommendationStrategy: boolean;
|
|
2251
2223
|
};
|
|
2252
2224
|
blocks: {
|
|
@@ -2388,7 +2360,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2388
2360
|
autosave: boolean;
|
|
2389
2361
|
allowlistEnabled: boolean;
|
|
2390
2362
|
linkTrackingIds: boolean;
|
|
2391
|
-
allowSaveWithErrors: boolean;
|
|
2392
2363
|
reusableRecommendationStrategy: boolean;
|
|
2393
2364
|
};
|
|
2394
2365
|
blocks: {
|
|
@@ -2532,7 +2503,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2532
2503
|
autosave: boolean;
|
|
2533
2504
|
allowlistEnabled: boolean;
|
|
2534
2505
|
linkTrackingIds: boolean;
|
|
2535
|
-
allowSaveWithErrors: boolean;
|
|
2536
2506
|
reusableRecommendationStrategy: boolean;
|
|
2537
2507
|
};
|
|
2538
2508
|
blocks: {
|
|
@@ -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;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* cortex-fe can pick up the current editor state and forward it as
|
|
4
|
-
* `clientState.editor` on the next chat-stream POST.
|
|
5
|
-
*
|
|
6
|
-
* State + getters only — `useGuidoStateBridge` writes via `$patch`, no actions
|
|
7
|
-
* live here (architecture invariant).
|
|
8
|
-
*
|
|
9
|
-
* Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it via
|
|
10
|
-
* `pinia._s.get('guidoEmailEditor')` at runtime. The internal Guido editor
|
|
11
|
-
* store keeps id `guidoEditor` — these are intentionally separate. The
|
|
12
|
-
* internal store carries UI state that cortex-fe should not see; this public
|
|
13
|
-
* store carries the contract Guido is willing to share.
|
|
14
|
-
*/
|
|
15
|
-
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", {
|
|
1
|
+
/** The published editor snapshot — the shape a consumer reads off the shared store. */
|
|
2
|
+
export interface GuidoEmailEditorState {
|
|
16
3
|
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
17
4
|
html: string;
|
|
18
5
|
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
19
6
|
css: string;
|
|
20
7
|
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
21
8
|
lastUpdatedAt: number;
|
|
22
|
-
/** Template id from the editor config,
|
|
9
|
+
/** Template id from the editor config, so a consumer can scope per-template. */
|
|
23
10
|
templateId: string;
|
|
24
|
-
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Outbound contract Guido publishes to the host's shared Pinia singleton so a
|
|
14
|
+
* consumer can read the current editor state: cortex-fe forwards it as
|
|
15
|
+
* `clientState.editor` on the next chat-stream POST, email-fe scans it for the
|
|
16
|
+
* Array of Objects lock.
|
|
17
|
+
*
|
|
18
|
+
* Published as `@useinsider/guido/editor-state` and from the root barrel, so a
|
|
19
|
+
* consumer imports this store instead of re-declaring one under the same id.
|
|
20
|
+
*
|
|
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.
|
|
25
|
+
*
|
|
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.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", GuidoEmailEditorState, {
|
|
25
34
|
/** True once the bridge has published at least one snapshot. */
|
|
26
35
|
hasSnapshot: (state: {
|
|
27
36
|
html: string;
|
|
28
37
|
css: string;
|
|
29
38
|
lastUpdatedAt: number;
|
|
30
39
|
templateId: string;
|
|
31
|
-
} & import("pinia").PiniaCustomStateProperties<
|
|
32
|
-
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
33
|
-
html: string;
|
|
34
|
-
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
35
|
-
css: string;
|
|
36
|
-
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
37
|
-
lastUpdatedAt: number;
|
|
38
|
-
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
39
|
-
templateId: string;
|
|
40
|
-
}>) => boolean;
|
|
40
|
+
} & import("pinia").PiniaCustomStateProperties<GuidoEmailEditorState>) => boolean;
|
|
41
41
|
}, {}>;
|
|
@@ -15,36 +15,6 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
|
15
15
|
* same source), so it is reliably present regardless of how the block was added.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getHtmlReferencedUnsubscribePages(html: string): number[];
|
|
18
|
-
/**
|
|
19
|
-
* Hydrates the recommendation extension store from the persisted `esd-ext-config`
|
|
20
|
-
* JSON blob on each `.recommendation-block-v2` element in the raw editor HTML.
|
|
21
|
-
*
|
|
22
|
-
* Why this runs before `compileHtml`:
|
|
23
|
-
* The HTML compiler's `prepareRecommendationBlocks` rule asks
|
|
24
|
-
* `useRecommendation.buildCampaignUrl(id)` to assemble each block's API URL
|
|
25
|
-
* from `blockStates[id].recommendationConfigs`. That Pinia entry is normally
|
|
26
|
-
* populated by `RecommendationBlockControl._syncNodeConfigToStore`, which
|
|
27
|
-
* only fires when the user *selects* the block. Saving without ever
|
|
28
|
-
* selecting a migrated block would otherwise build the URL from empty/
|
|
29
|
-
* default state and the campaign URL would not be saved.
|
|
30
|
-
*
|
|
31
|
-
* Why we read raw HTML, not compiled HTML:
|
|
32
|
-
* Stripo's `compileEmail()` strips editor-only attributes (`esd-*`) from the
|
|
33
|
-
* compiled output, so `esd-ext-config` is gone by the time the compiler
|
|
34
|
-
* pipeline sees the HTML. The raw HTML from `getTemplateData()` preserves
|
|
35
|
-
* the attribute as the migrator wrote it.
|
|
36
|
-
*
|
|
37
|
-
* Reference data pre-load:
|
|
38
|
-
* When the template has recommendation blocks, this also pre-loads the
|
|
39
|
-
* shared reference data (languages / currency list) so the save-time
|
|
40
|
-
* required-fields validator can check each block's locale and currency
|
|
41
|
-
* against the partner's real options. Best-effort — on a fetch failure the
|
|
42
|
-
* validator degrades to its empty-list guard (`requiredFields.ts`) instead
|
|
43
|
-
* of blocking the save or stranding the Save button.
|
|
44
|
-
*/
|
|
45
|
-
declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
|
|
46
18
|
export declare const useTemplatePreparation: () => {
|
|
47
19
|
prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
|
|
48
|
-
hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
|
|
49
20
|
};
|
|
50
|
-
export {};
|