@useinsider/guido 3.19.0-beta.fcad6e5 → 3.20.0-beta.05ce01c
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 +1 -0
- package/dist/@types/config/schemas.js +39 -37
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +70 -67
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
- package/dist/components/organisms/header/EditorActions.vue.js +5 -5
- package/dist/components/organisms/header/EditorActions.vue2.js +83 -46
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +50 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useAutoSave.js +46 -44
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useSave.js +93 -45
- package/dist/composables/useSaveValidation.js +284 -0
- package/dist/composables/useSaveValidationRollout.js +20 -0
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +203 -246
- package/dist/guido.css +1 -1
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/composables/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +4 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -8
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/config.d.ts +32 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/stores/config.js +84 -67
- package/dist/stores/save-validation.js +30 -0
- package/dist/stores/setup-settings.js +10 -0
- package/dist/utils/templatePreparation.js +39 -36
- package/package.json +1 -1
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-d0a8825a]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-d0a8825a]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-d0a8825a]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useHttp as s } from "../composables/useHttp.js";
|
|
2
|
+
const n = "/newsletter/settings/get-setup-settings", o = () => {
|
|
3
|
+
const { get: t } = s();
|
|
4
|
+
return { getSetupSettings: async () => {
|
|
5
|
+
const { data: e } = await t(n);
|
|
6
|
+
return e ?? {};
|
|
7
|
+
} };
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
o as useSettingsApi
|
|
11
|
+
};
|
|
@@ -411,6 +411,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
411
411
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
412
412
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
413
413
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
414
|
+
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
415
|
+
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
414
416
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
415
417
|
}, undefined>;
|
|
416
418
|
/**
|
|
@@ -827,6 +829,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
827
829
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
828
830
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
829
831
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
832
|
+
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
833
|
+
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
830
834
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
831
835
|
}, undefined>, {}>;
|
|
832
836
|
/** Block configuration */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SaveValidationRule } from '@@/Enums/save-validation';
|
|
2
|
+
import type { ToasterTypeOptions } from '@@/Enums/toaster';
|
|
3
|
+
/** Which action triggered the validation run. Drives telemetry only in v1. */
|
|
4
|
+
export type SaveValidationIntent = 'save' | 'back' | 'test';
|
|
5
|
+
/**
|
|
6
|
+
* A single validation failure instance, one per drawer row. Names avoid the
|
|
7
|
+
* public `ValidationError` (config validation) collision — NOT exported from
|
|
8
|
+
* library.ts.
|
|
9
|
+
*/
|
|
10
|
+
export interface SaveValidationError {
|
|
11
|
+
/** Stable discriminator for tests and de-duplication. */
|
|
12
|
+
rule: SaveValidationRule;
|
|
13
|
+
/** Final HTML-safe display string — trans() output, or an escaped server message. */
|
|
14
|
+
message: string;
|
|
15
|
+
/** Raw user content (field name / tag / src) — not i18n. */
|
|
16
|
+
detail?: string;
|
|
17
|
+
/** Mirrors the legacy toaster severity. Kept for the discriminator/tests; the drawer renders a uniform icon and never reads it. */
|
|
18
|
+
type: ToasterTypeOptions;
|
|
19
|
+
}
|
|
@@ -15,7 +15,23 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
15
15
|
close: () => void;
|
|
16
16
|
};
|
|
17
17
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
|
-
saveSilent: () => Promise<
|
|
18
|
+
saveSilent: () => Promise<{
|
|
19
|
+
dynamicContentList: import("@@/Types/generic").DynamicContent[];
|
|
20
|
+
compiledHtml: string;
|
|
21
|
+
rawHtml: string;
|
|
22
|
+
css: string;
|
|
23
|
+
ampHtml: string;
|
|
24
|
+
ampErrors: string[];
|
|
25
|
+
modules: number[];
|
|
26
|
+
recommendation: {
|
|
27
|
+
campaignUrls?: Record<string, import("../@types/recommendation").RecommendationCampaignUrlValue>;
|
|
28
|
+
configs: Record<string, string>;
|
|
29
|
+
};
|
|
30
|
+
unsubscribe: {
|
|
31
|
+
status: boolean;
|
|
32
|
+
config: number[];
|
|
33
|
+
};
|
|
34
|
+
} | undefined> | undefined;
|
|
19
35
|
setLoading: (value: boolean) => void;
|
|
20
36
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
21
37
|
"dynamic-content:open": (detail: {
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<{
|
|
3
|
+
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
+
compiledHtml: string;
|
|
5
|
+
rawHtml: string;
|
|
6
|
+
css: string;
|
|
7
|
+
ampHtml: string;
|
|
8
|
+
ampErrors: string[];
|
|
9
|
+
modules: number[];
|
|
10
|
+
recommendation: {
|
|
11
|
+
campaignUrls?: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
+
configs: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
unsubscribe: {
|
|
15
|
+
status: boolean;
|
|
16
|
+
config: number[];
|
|
17
|
+
};
|
|
18
|
+
} | undefined> | undefined;
|
|
3
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<{
|
|
3
|
+
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
+
compiledHtml: string;
|
|
5
|
+
rawHtml: string;
|
|
6
|
+
css: string;
|
|
7
|
+
ampHtml: string;
|
|
8
|
+
ampErrors: string[];
|
|
9
|
+
modules: number[];
|
|
10
|
+
recommendation: {
|
|
11
|
+
campaignUrls?: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
+
configs: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
unsubscribe: {
|
|
15
|
+
status: boolean;
|
|
16
|
+
config: number[];
|
|
17
|
+
};
|
|
18
|
+
} | undefined> | undefined;
|
|
3
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<{
|
|
3
|
+
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
+
compiledHtml: string;
|
|
5
|
+
rawHtml: string;
|
|
6
|
+
css: string;
|
|
7
|
+
ampHtml: string;
|
|
8
|
+
ampErrors: string[];
|
|
9
|
+
modules: number[];
|
|
10
|
+
recommendation: {
|
|
11
|
+
campaignUrls?: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
+
configs: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
unsubscribe: {
|
|
15
|
+
status: boolean;
|
|
16
|
+
config: number[];
|
|
17
|
+
};
|
|
18
|
+
} | undefined> | undefined;
|
|
3
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -10,11 +10,11 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var
|
|
13
|
+
declare var __VLS_13: {}, __VLS_15: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
headerBottomSlot?: (props: typeof
|
|
15
|
+
headerBottomSlot?: (props: typeof __VLS_13) => any;
|
|
16
16
|
} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_15) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
20
|
className: string;
|
|
@@ -26,6 +26,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
26
|
cancelOrBackButtonEvent: () => void;
|
|
27
27
|
onCloseEvent: () => void;
|
|
28
28
|
primaryButtonEvent: () => void;
|
|
29
|
+
secondaryButtonEvent: () => void;
|
|
29
30
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
30
31
|
className: string;
|
|
31
32
|
size: string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
type SaveSilent = () => Promise<unknown>;
|
|
2
|
-
|
|
2
|
+
interface AutoSaveOptions {
|
|
3
|
+
clearsChanges?: () => boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const useAutoSave: (saveSilent: SaveSilent, { clearsChanges }?: AutoSaveOptions) => void;
|
|
3
6
|
export {};
|
|
@@ -102,6 +102,7 @@ export declare const useConfig: () => {
|
|
|
102
102
|
autosave: boolean;
|
|
103
103
|
allowlistEnabled: boolean;
|
|
104
104
|
linkTrackingIds: boolean;
|
|
105
|
+
allowSaveWithErrors: boolean;
|
|
105
106
|
reusableRecommendationStrategy: boolean;
|
|
106
107
|
};
|
|
107
108
|
blocks: {
|
|
@@ -240,6 +241,7 @@ export declare const useConfig: () => {
|
|
|
240
241
|
autosave: boolean;
|
|
241
242
|
allowlistEnabled: boolean;
|
|
242
243
|
linkTrackingIds: boolean;
|
|
244
|
+
allowSaveWithErrors: boolean;
|
|
243
245
|
reusableRecommendationStrategy: boolean;
|
|
244
246
|
} | null>;
|
|
245
247
|
blocks: import("vue").ComputedRef<{
|
|
@@ -1,5 +1,12 @@
|
|
|
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[];
|
|
3
10
|
/**
|
|
4
11
|
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
5
12
|
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
@@ -27,6 +34,20 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
|
|
|
27
34
|
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
28
35
|
*/
|
|
29
36
|
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[];
|
|
30
51
|
export declare const useHtmlValidator: () => {
|
|
31
52
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
32
53
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
+
type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
|
|
3
|
+
type SaveResult = SaveDetails | undefined;
|
|
2
4
|
export declare const useSave: () => {
|
|
3
|
-
save: (suppressEmit?: boolean, silent?: boolean) => Promise<
|
|
5
|
+
save: (suppressEmit?: boolean, silent?: boolean) => Promise<SaveResult>;
|
|
6
|
+
saveWithErrors: () => Promise<SaveResult>;
|
|
7
|
+
saveRawOnly: () => Promise<SaveResult>;
|
|
4
8
|
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
+
import type { SaveValidationError } from '@@/Types/save-validation';
|
|
3
|
+
export declare const useSaveValidation: () => {
|
|
4
|
+
collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[]) => Promise<SaveValidationError[]>;
|
|
5
|
+
validateCurrentTemplate: () => Promise<SaveValidationError[]>;
|
|
6
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
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[];
|
|
1
4
|
export declare const useCouponBlockValidator: () => {
|
|
2
5
|
validateCouponBlockTags: (html: string) => boolean;
|
|
3
6
|
};
|
|
@@ -1,4 +1,14 @@
|
|
|
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;
|
|
1
10
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
2
11
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
3
12
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
4
13
|
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable discriminators for each save-validation rule site — one per rule that
|
|
3
|
+
* can produce a drawer row, kept in sync with the collector + legacy validator chains.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SaveValidationRule {
|
|
6
|
+
CouponTagModified = "coupon-tag-modified",
|
|
7
|
+
DuplicateUnsubBlock = "duplicate-unsub-block",
|
|
8
|
+
UnsubBlockMissingTemplate = "unsub-block-missing-template",
|
|
9
|
+
LiquidSyntax = "liquid-syntax",
|
|
10
|
+
InvalidLinks = "invalid-links",
|
|
11
|
+
LinkCheckInProgress = "link-check-in-progress",
|
|
12
|
+
CustomFieldScript = "custom-field-script",
|
|
13
|
+
EmptyHtml = "empty-html",
|
|
14
|
+
MismatchedBraces = "mismatched-braces",
|
|
15
|
+
InvalidDynamicTag = "invalid-dynamic-tag",
|
|
16
|
+
InvalidCustomField = "invalid-custom-field",
|
|
17
|
+
ConditionsSyntax = "conditions-syntax",
|
|
18
|
+
WrongEqualityOperator = "wrong-equality-operator",
|
|
19
|
+
MissingIfEndif = "missing-if-endif",
|
|
20
|
+
ConditionTagSpacing = "condition-tag-spacing",
|
|
21
|
+
BracesInsideIfTag = "braces-inside-if-tag",
|
|
22
|
+
RecommendationRequiredFields = "recommendation-required-fields",
|
|
23
|
+
RecommendationFilters = "recommendation-filters",
|
|
24
|
+
InvalidImageType = "invalid-image-type",
|
|
25
|
+
CheckboxUnsubGroup = "checkbox-unsub-group",
|
|
26
|
+
RadioButtonUnsubGroup = "radio-button-unsub-group"
|
|
27
|
+
}
|
|
@@ -22,9 +22,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
22
22
|
private storeUnsubscription;
|
|
23
23
|
private pendingNodeConfigWrite;
|
|
24
24
|
private pendingConfigFlushTimer;
|
|
25
|
-
private seenConfigVersion;
|
|
26
|
-
private fetchedConfigVersion;
|
|
27
|
-
private hasUnappliedConfigChange;
|
|
28
25
|
private algorithmControl;
|
|
29
26
|
private localeControl;
|
|
30
27
|
private currencyControl;
|
|
@@ -130,11 +127,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
130
127
|
* Debounced product fetch to prevent rapid API calls during config changes
|
|
131
128
|
*/
|
|
132
129
|
private _debouncedFetchProducts;
|
|
133
|
-
/**
|
|
134
|
-
* Fetches and renders the block's products without the panel, carrying the
|
|
135
|
-
* deferred config write so both still land as one undo entry.
|
|
136
|
-
*/
|
|
137
|
-
private _refreshProductsOutsidePanel;
|
|
138
130
|
/**
|
|
139
131
|
* Debounced content update when products arrive from API.
|
|
140
132
|
*
|
|
@@ -107,6 +107,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
107
107
|
autosave: boolean;
|
|
108
108
|
allowlistEnabled: boolean;
|
|
109
109
|
linkTrackingIds: boolean;
|
|
110
|
+
allowSaveWithErrors: boolean;
|
|
110
111
|
reusableRecommendationStrategy: boolean;
|
|
111
112
|
};
|
|
112
113
|
blocks: {
|
|
@@ -251,6 +252,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
251
252
|
autosave: boolean;
|
|
252
253
|
allowlistEnabled: boolean;
|
|
253
254
|
linkTrackingIds: boolean;
|
|
255
|
+
allowSaveWithErrors: boolean;
|
|
254
256
|
reusableRecommendationStrategy: boolean;
|
|
255
257
|
};
|
|
256
258
|
blocks: {
|
|
@@ -395,6 +397,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
395
397
|
autosave: boolean;
|
|
396
398
|
allowlistEnabled: boolean;
|
|
397
399
|
linkTrackingIds: boolean;
|
|
400
|
+
allowSaveWithErrors: boolean;
|
|
398
401
|
reusableRecommendationStrategy: boolean;
|
|
399
402
|
};
|
|
400
403
|
blocks: {
|
|
@@ -539,6 +542,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
539
542
|
autosave: boolean;
|
|
540
543
|
allowlistEnabled: boolean;
|
|
541
544
|
linkTrackingIds: boolean;
|
|
545
|
+
allowSaveWithErrors: boolean;
|
|
542
546
|
reusableRecommendationStrategy: boolean;
|
|
543
547
|
};
|
|
544
548
|
blocks: {
|
|
@@ -683,6 +687,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
683
687
|
autosave: boolean;
|
|
684
688
|
allowlistEnabled: boolean;
|
|
685
689
|
linkTrackingIds: boolean;
|
|
690
|
+
allowSaveWithErrors: boolean;
|
|
686
691
|
reusableRecommendationStrategy: boolean;
|
|
687
692
|
};
|
|
688
693
|
blocks: {
|
|
@@ -827,6 +832,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
827
832
|
autosave: boolean;
|
|
828
833
|
allowlistEnabled: boolean;
|
|
829
834
|
linkTrackingIds: boolean;
|
|
835
|
+
allowSaveWithErrors: boolean;
|
|
830
836
|
reusableRecommendationStrategy: boolean;
|
|
831
837
|
};
|
|
832
838
|
blocks: {
|
|
@@ -971,6 +977,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
971
977
|
autosave: boolean;
|
|
972
978
|
allowlistEnabled: boolean;
|
|
973
979
|
linkTrackingIds: boolean;
|
|
980
|
+
allowSaveWithErrors: boolean;
|
|
974
981
|
reusableRecommendationStrategy: boolean;
|
|
975
982
|
};
|
|
976
983
|
blocks: {
|
|
@@ -1115,6 +1122,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1115
1122
|
autosave: boolean;
|
|
1116
1123
|
allowlistEnabled: boolean;
|
|
1117
1124
|
linkTrackingIds: boolean;
|
|
1125
|
+
allowSaveWithErrors: boolean;
|
|
1118
1126
|
reusableRecommendationStrategy: boolean;
|
|
1119
1127
|
};
|
|
1120
1128
|
blocks: {
|
|
@@ -1259,6 +1267,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1259
1267
|
autosave: boolean;
|
|
1260
1268
|
allowlistEnabled: boolean;
|
|
1261
1269
|
linkTrackingIds: boolean;
|
|
1270
|
+
allowSaveWithErrors: boolean;
|
|
1262
1271
|
reusableRecommendationStrategy: boolean;
|
|
1263
1272
|
};
|
|
1264
1273
|
blocks: {
|
|
@@ -1403,6 +1412,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1403
1412
|
autosave: boolean;
|
|
1404
1413
|
allowlistEnabled: boolean;
|
|
1405
1414
|
linkTrackingIds: boolean;
|
|
1415
|
+
allowSaveWithErrors: boolean;
|
|
1406
1416
|
reusableRecommendationStrategy: boolean;
|
|
1407
1417
|
};
|
|
1408
1418
|
blocks: {
|
|
@@ -1547,6 +1557,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1547
1557
|
autosave: boolean;
|
|
1548
1558
|
allowlistEnabled: boolean;
|
|
1549
1559
|
linkTrackingIds: boolean;
|
|
1560
|
+
allowSaveWithErrors: boolean;
|
|
1550
1561
|
reusableRecommendationStrategy: boolean;
|
|
1551
1562
|
};
|
|
1552
1563
|
blocks: {
|
|
@@ -1691,6 +1702,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1691
1702
|
autosave: boolean;
|
|
1692
1703
|
allowlistEnabled: boolean;
|
|
1693
1704
|
linkTrackingIds: boolean;
|
|
1705
|
+
allowSaveWithErrors: boolean;
|
|
1694
1706
|
reusableRecommendationStrategy: boolean;
|
|
1695
1707
|
};
|
|
1696
1708
|
blocks: {
|
|
@@ -1835,6 +1847,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1835
1847
|
autosave: boolean;
|
|
1836
1848
|
allowlistEnabled: boolean;
|
|
1837
1849
|
linkTrackingIds: boolean;
|
|
1850
|
+
allowSaveWithErrors: boolean;
|
|
1838
1851
|
reusableRecommendationStrategy: boolean;
|
|
1839
1852
|
};
|
|
1840
1853
|
blocks: {
|
|
@@ -1979,6 +1992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1979
1992
|
autosave: boolean;
|
|
1980
1993
|
allowlistEnabled: boolean;
|
|
1981
1994
|
linkTrackingIds: boolean;
|
|
1995
|
+
allowSaveWithErrors: boolean;
|
|
1982
1996
|
reusableRecommendationStrategy: boolean;
|
|
1983
1997
|
};
|
|
1984
1998
|
blocks: {
|
|
@@ -2123,6 +2137,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2123
2137
|
autosave: boolean;
|
|
2124
2138
|
allowlistEnabled: boolean;
|
|
2125
2139
|
linkTrackingIds: boolean;
|
|
2140
|
+
allowSaveWithErrors: boolean;
|
|
2126
2141
|
reusableRecommendationStrategy: boolean;
|
|
2127
2142
|
};
|
|
2128
2143
|
blocks: {
|
|
@@ -2267,6 +2282,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2267
2282
|
autosave: boolean;
|
|
2268
2283
|
allowlistEnabled: boolean;
|
|
2269
2284
|
linkTrackingIds: boolean;
|
|
2285
|
+
allowSaveWithErrors: boolean;
|
|
2270
2286
|
reusableRecommendationStrategy: boolean;
|
|
2271
2287
|
};
|
|
2272
2288
|
blocks: {
|
|
@@ -2411,6 +2427,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2411
2427
|
autosave: boolean;
|
|
2412
2428
|
allowlistEnabled: boolean;
|
|
2413
2429
|
linkTrackingIds: boolean;
|
|
2430
|
+
allowSaveWithErrors: boolean;
|
|
2414
2431
|
reusableRecommendationStrategy: boolean;
|
|
2415
2432
|
};
|
|
2416
2433
|
blocks: {
|
|
@@ -2454,6 +2471,18 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2454
2471
|
};
|
|
2455
2472
|
} | null;
|
|
2456
2473
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
2474
|
+
/**
|
|
2475
|
+
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
2476
|
+
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
2477
|
+
*/
|
|
2478
|
+
isTransactional(): boolean;
|
|
2479
|
+
/**
|
|
2480
|
+
* Soft-save policy: may the editor persist a template with validation errors?
|
|
2481
|
+
* Default true (host sets features.allowSaveWithErrors=false for transactional +
|
|
2482
|
+
* unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
|
|
2483
|
+
* floor to false pre-init and momentarily hide the soft-save option (SD-147430).
|
|
2484
|
+
*/
|
|
2485
|
+
allowSaveWithErrors(): boolean;
|
|
2457
2486
|
/**
|
|
2458
2487
|
* Get the username
|
|
2459
2488
|
*/
|
|
@@ -2555,6 +2584,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2555
2584
|
autosave: boolean;
|
|
2556
2585
|
allowlistEnabled: boolean;
|
|
2557
2586
|
linkTrackingIds: boolean;
|
|
2587
|
+
allowSaveWithErrors: boolean;
|
|
2558
2588
|
reusableRecommendationStrategy: boolean;
|
|
2559
2589
|
};
|
|
2560
2590
|
blocks: {
|
|
@@ -2699,6 +2729,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2699
2729
|
autosave: boolean;
|
|
2700
2730
|
allowlistEnabled: boolean;
|
|
2701
2731
|
linkTrackingIds: boolean;
|
|
2732
|
+
allowSaveWithErrors: boolean;
|
|
2702
2733
|
reusableRecommendationStrategy: boolean;
|
|
2703
2734
|
};
|
|
2704
2735
|
blocks: {
|
|
@@ -2845,6 +2876,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2845
2876
|
autosave: boolean;
|
|
2846
2877
|
allowlistEnabled: boolean;
|
|
2847
2878
|
linkTrackingIds: boolean;
|
|
2879
|
+
allowSaveWithErrors: boolean;
|
|
2848
2880
|
reusableRecommendationStrategy: boolean;
|
|
2849
2881
|
};
|
|
2850
2882
|
blocks: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SaveValidationError, SaveValidationIntent } from '@@/Types/save-validation';
|
|
2
|
+
interface SaveValidationState {
|
|
3
|
+
errors: SaveValidationError[];
|
|
4
|
+
isDrawerOpen: boolean;
|
|
5
|
+
intent: SaveValidationIntent | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const useSaveValidationStore: import("pinia").StoreDefinition<"guidoSaveValidation", SaveValidationState, {
|
|
8
|
+
errorCount: (state: {
|
|
9
|
+
errors: {
|
|
10
|
+
rule: import("../enums/save-validation").SaveValidationRule;
|
|
11
|
+
message: string;
|
|
12
|
+
detail?: string | undefined;
|
|
13
|
+
type: import("../enums/toaster").ToasterTypeOptions;
|
|
14
|
+
}[];
|
|
15
|
+
isDrawerOpen: boolean;
|
|
16
|
+
intent: SaveValidationIntent | null;
|
|
17
|
+
} & import("pinia").PiniaCustomStateProperties<SaveValidationState>) => number;
|
|
18
|
+
}, {
|
|
19
|
+
open(errors: SaveValidationError[], intent: SaveValidationIntent): void;
|
|
20
|
+
close(): void;
|
|
21
|
+
}>;
|
|
22
|
+
export {};
|
|
@@ -15,6 +15,36 @@ 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>;
|
|
18
46
|
export declare const useTemplatePreparation: () => {
|
|
19
47
|
prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
|
|
48
|
+
hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
|
|
20
49
|
};
|
|
50
|
+
export {};
|