@useinsider/guido 3.26.0-beta.19d84af → 3.26.0-beta.511b49f
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 +10 -0
- package/dist/@types/config/schemas.js +98 -94
- package/dist/@types/display-condition.js +25 -0
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +105 -95
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +17 -0
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +17 -0
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +45 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +36 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +28 -27
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +42 -27
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +30 -0
- package/dist/composables/useBlocksConfig.js +29 -20
- package/dist/composables/useCustomInterfaceAppearance.js +50 -50
- package/dist/composables/useDisplayConditions.js +116 -0
- package/dist/composables/useFullStoryBridge.js +10 -9
- package/dist/composables/useModuleRepair.js +33 -24
- package/dist/composables/useTranslations.js +2 -1
- package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
- package/dist/config/migrator/index.js +8 -7
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
- package/dist/enums/academy.js +3 -1
- package/dist/enums/display-condition.js +12 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -40
- package/dist/extensions/Blocks/common-control.js +19 -19
- package/dist/extensions/DisplayConditions/bridge.js +25 -0
- package/dist/extensions/DisplayConditions/constants.js +26 -0
- package/dist/extensions/DisplayConditions/control.js +215 -0
- package/dist/extensions/DisplayConditions/display-conditions.css.js +226 -0
- package/dist/extensions/DisplayConditions/extension.js +28 -0
- package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
- package/dist/extensions/DisplayConditions/library.js +30 -0
- package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -17
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
- package/dist/node_modules/valibot/dist/index.js +297 -261
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +39 -0
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/@types/display-condition.d.ts +61 -0
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +18 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useDisplayConditions.d.ts +18 -0
- package/dist/src/composables/useModuleRepair.d.ts +2 -11
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +2 -0
- package/dist/src/enums/display-condition.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +23 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +25 -0
- package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
- package/dist/src/mock/api/display-conditions.d.ts +2 -0
- package/dist/src/services/displayConditionApi.d.ts +8 -0
- package/dist/src/stores/config.d.ts +190 -0
- package/dist/src/stores/display-condition.d.ts +86 -0
- package/dist/src/stores/editor.d.ts +27 -0
- package/dist/src/stores/onboarding.d.ts +1 -0
- package/dist/src/utils/displayCondition.d.ts +11 -0
- package/dist/src/utils/editorShadowRoot.d.ts +1 -0
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +10 -0
- package/dist/src/utils/protectTableText.d.ts +2 -0
- package/dist/static/styles/variables.css.js +1 -0
- package/dist/stores/config.js +13 -6
- package/dist/stores/display-condition.js +29 -0
- package/dist/stores/editor.js +1 -0
- package/dist/stores/onboarding.js +4 -1
- package/dist/utils/displayCondition.js +29 -0
- package/dist/utils/editorShadowRoot.js +8 -0
- package/dist/utils/legacyUnsubscribeConversion.js +49 -0
- package/dist/utils/pairProductVariables.js +29 -28
- package/dist/utils/protectTableText.js +22 -0
- package/package.json +1 -1
package/dist/package.json.js
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useHttp as p } from "../composables/useHttp.js";
|
|
2
|
+
import { SavedDisplayConditionSchema as y, DisplayConditionListResponseSchema as S } from "../@types/display-condition.js";
|
|
3
|
+
import { parse as r } from "../node_modules/valibot/dist/index.js";
|
|
4
|
+
const s = "/email-proxy/v1/display-conditions", u = 100, P = () => {
|
|
5
|
+
const { get: c, post: m, delete: l } = p(), i = async (t, e) => {
|
|
6
|
+
const o = new URLSearchParams({
|
|
7
|
+
page: String(e),
|
|
8
|
+
limit: String(u),
|
|
9
|
+
sortColumn: "id",
|
|
10
|
+
sortDirection: "desc",
|
|
11
|
+
"filter[syntax]": t
|
|
12
|
+
}), { data: n } = await c(`${s}?${o.toString()}`);
|
|
13
|
+
return r(S, n);
|
|
14
|
+
};
|
|
15
|
+
return { list: async (t) => {
|
|
16
|
+
const e = await i(t, 1), o = await Promise.all(Array.from(
|
|
17
|
+
{ length: Math.max(e.meta.lastPage - 1, 0) },
|
|
18
|
+
(a, d) => i(t, d + 2)
|
|
19
|
+
)), n = [e, ...o].flatMap((a) => a.data);
|
|
20
|
+
return [...new Map(n.map((a) => [a.id, a])).values()];
|
|
21
|
+
}, create: async (t, e) => {
|
|
22
|
+
const { data: o } = await m(s, {
|
|
23
|
+
name: t.name.trim(),
|
|
24
|
+
description: t.description.trim() || null,
|
|
25
|
+
syntax: e,
|
|
26
|
+
method: "codeOnly",
|
|
27
|
+
codeBefore: t.codeBefore,
|
|
28
|
+
codeAfter: t.codeAfter
|
|
29
|
+
});
|
|
30
|
+
return r(y, o.data);
|
|
31
|
+
}, remove: async (t) => {
|
|
32
|
+
await l(`${s}/${t}`);
|
|
33
|
+
} };
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
u as DISPLAY_CONDITIONS_PAGE_LIMIT,
|
|
37
|
+
s as DISPLAY_CONDITIONS_URL,
|
|
38
|
+
P as useDisplayConditionApi
|
|
39
|
+
};
|
|
@@ -384,6 +384,8 @@ export declare const UISchema: v.ObjectSchema<{
|
|
|
384
384
|
readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
385
385
|
/** Custom label for back button (if shown) */
|
|
386
386
|
readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
387
|
+
/** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
|
|
388
|
+
readonly externalDisplayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
387
389
|
}, undefined>;
|
|
388
390
|
/**
|
|
389
391
|
* Features configuration - enable/disable editor features
|
|
@@ -415,6 +417,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
415
417
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
416
418
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
417
419
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
420
|
+
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
421
|
+
readonly legacyUnsubscribeConversion: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
418
422
|
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
419
423
|
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
420
424
|
/** Warn on save when the design carries an Insider unsubscribe link or code (host sets true for SFMC accounts) */
|
|
@@ -809,6 +813,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
809
813
|
readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
810
814
|
/** Custom label for back button (if shown) */
|
|
811
815
|
readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
816
|
+
/** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
|
|
817
|
+
readonly externalDisplayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
812
818
|
}, undefined>, {}>;
|
|
813
819
|
/** Feature toggles */
|
|
814
820
|
readonly features: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -838,6 +844,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
838
844
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
839
845
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
840
846
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
847
|
+
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
848
|
+
readonly legacyUnsubscribeConversion: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
841
849
|
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
842
850
|
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
843
851
|
/** Warn on save when the design carries an Insider unsubscribe link or code (host sets true for SFMC accounts) */
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const DisplayConditionSyntaxSchema: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
3
|
+
export declare const DisplayConditionMethodSchema: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
4
|
+
export declare const SavedDisplayConditionSchema: v.ObjectSchema<{
|
|
5
|
+
readonly id: v.NumberSchema<undefined>;
|
|
6
|
+
readonly name: v.StringSchema<undefined>;
|
|
7
|
+
readonly description: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
8
|
+
readonly syntax: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
9
|
+
readonly method: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
10
|
+
readonly codeBefore: v.StringSchema<undefined>;
|
|
11
|
+
readonly codeAfter: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
12
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
+
}, undefined>;
|
|
14
|
+
export declare const DisplayConditionListResponseSchema: v.ObjectSchema<{
|
|
15
|
+
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
16
|
+
readonly id: v.NumberSchema<undefined>;
|
|
17
|
+
readonly name: v.StringSchema<undefined>;
|
|
18
|
+
readonly description: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
19
|
+
readonly syntax: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
20
|
+
readonly method: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
21
|
+
readonly codeBefore: v.StringSchema<undefined>;
|
|
22
|
+
readonly codeAfter: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
23
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
+
}, undefined>, undefined>;
|
|
25
|
+
readonly meta: v.ObjectSchema<{
|
|
26
|
+
readonly totalCount: v.NumberSchema<undefined>;
|
|
27
|
+
readonly perPage: v.NumberSchema<undefined>;
|
|
28
|
+
readonly currentPage: v.NumberSchema<undefined>;
|
|
29
|
+
readonly lastPage: v.NumberSchema<undefined>;
|
|
30
|
+
}, undefined>;
|
|
31
|
+
}, undefined>;
|
|
32
|
+
export type DisplayConditionSyntax = v.InferOutput<typeof DisplayConditionSyntaxSchema>;
|
|
33
|
+
export type DisplayConditionMethod = v.InferOutput<typeof DisplayConditionMethodSchema>;
|
|
34
|
+
export type SavedDisplayCondition = v.InferOutput<typeof SavedDisplayConditionSchema>;
|
|
35
|
+
export type DisplayConditionListResponse = v.InferOutput<typeof DisplayConditionListResponseSchema>;
|
|
36
|
+
export interface DisplayConditionDraft {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
codeBefore: string;
|
|
40
|
+
codeAfter: string;
|
|
41
|
+
}
|
|
42
|
+
/** Mirrors Stripo's `DisplayCondition`; kept local so Vue code does not import the Stripo package. */
|
|
43
|
+
export interface AppliedDisplayCondition {
|
|
44
|
+
id: number;
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
beforeScript: string;
|
|
48
|
+
afterScript: string;
|
|
49
|
+
extraData?: string;
|
|
50
|
+
type?: string;
|
|
51
|
+
}
|
|
52
|
+
export type DisplayConditionOpenMode = 'select' | 'create' | 'edit';
|
|
53
|
+
export type DisplayConditionListState = 'error' | 'empty' | 'no-result';
|
|
54
|
+
export interface DisplayConditionOpenDetail {
|
|
55
|
+
mode: DisplayConditionOpenMode;
|
|
56
|
+
current: AppliedDisplayCondition | null;
|
|
57
|
+
}
|
|
58
|
+
export interface DisplayConditionApplyDetail {
|
|
59
|
+
condition: AppliedDisplayCondition | null;
|
|
60
|
+
applied?: boolean;
|
|
61
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
10
|
+
placeholder: string;
|
|
11
|
+
error: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}>, {
|
|
14
|
+
read: () => Promise<string>;
|
|
15
|
+
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
16
|
+
input: (value: string) => void;
|
|
17
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
18
|
+
placeholder: string;
|
|
19
|
+
error: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
}>>>, {
|
|
22
|
+
error: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_PrettifyLocal<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts
ADDED
|
@@ -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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DisplayConditionListState } from '@@/Types/display-condition';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
state: DisplayConditionListState;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
6
|
+
retry: () => void;
|
|
7
|
+
create: () => void;
|
|
8
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
|
+
type __VLS_TypePropsToOption<T> = {
|
|
12
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
13
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
14
|
+
} : {
|
|
15
|
+
type: import('vue').PropType<T[K]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts
ADDED
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -89,6 +89,7 @@ export declare const useConfig: () => {
|
|
|
89
89
|
ui: {
|
|
90
90
|
showHeader: boolean;
|
|
91
91
|
backButtonLabel?: string | undefined;
|
|
92
|
+
externalDisplayConditions: boolean;
|
|
92
93
|
};
|
|
93
94
|
features: {
|
|
94
95
|
dynamicContent: boolean;
|
|
@@ -105,6 +106,7 @@ export declare const useConfig: () => {
|
|
|
105
106
|
linkTrackingIds: boolean;
|
|
106
107
|
allowSaveWithErrors: boolean;
|
|
107
108
|
reusableRecommendationStrategy: boolean;
|
|
109
|
+
legacyUnsubscribeConversion: boolean;
|
|
108
110
|
itemsPriceFormatting: boolean;
|
|
109
111
|
blockUnsubscribeLinks: boolean;
|
|
110
112
|
};
|
|
@@ -231,6 +233,7 @@ export declare const useConfig: () => {
|
|
|
231
233
|
ui: import("vue").ComputedRef<{
|
|
232
234
|
showHeader: boolean;
|
|
233
235
|
backButtonLabel?: string | undefined;
|
|
236
|
+
externalDisplayConditions: boolean;
|
|
234
237
|
} | null>;
|
|
235
238
|
features: import("vue").ComputedRef<{
|
|
236
239
|
dynamicContent: boolean;
|
|
@@ -247,6 +250,7 @@ export declare const useConfig: () => {
|
|
|
247
250
|
linkTrackingIds: boolean;
|
|
248
251
|
allowSaveWithErrors: boolean;
|
|
249
252
|
reusableRecommendationStrategy: boolean;
|
|
253
|
+
legacyUnsubscribeConversion: boolean;
|
|
250
254
|
itemsPriceFormatting: boolean;
|
|
251
255
|
blockUnsubscribeLinks: boolean;
|
|
252
256
|
} | null>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DisplayConditionDraft, DisplayConditionOpenDetail, SavedDisplayCondition } from '@@/Types/display-condition';
|
|
2
|
+
export type DraftField = keyof DisplayConditionDraft;
|
|
3
|
+
export type DraftErrors = Partial<Record<DraftField, string>>;
|
|
4
|
+
export type CreateIntent = 'inline' | 'save';
|
|
5
|
+
export declare const DISPLAY_CONDITIONS_TRANS_KEY = "email-editor.display-conditions";
|
|
6
|
+
export declare const useDisplayConditions: () => {
|
|
7
|
+
syntax: import("vue").ComputedRef<"liquid" | "pongo">;
|
|
8
|
+
handleOpen: (detail: DisplayConditionOpenDetail) => void;
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
loadList: () => Promise<void>;
|
|
11
|
+
validate: (draft: DisplayConditionDraft) => DraftErrors;
|
|
12
|
+
notifyInvalid: () => void;
|
|
13
|
+
describeWithAcademyLink: (descriptionKey: "create-description" | "select-description") => string;
|
|
14
|
+
createInline: (draft: DisplayConditionDraft) => void;
|
|
15
|
+
createAndSave: (draft: DisplayConditionDraft) => Promise<DraftErrors | null>;
|
|
16
|
+
select: (row: SavedDisplayCondition) => void;
|
|
17
|
+
deleteSaved: (row: SavedDisplayCondition) => Promise<void>;
|
|
18
|
+
};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import type { ModuleAddData, ModuleModifier } from '@@/Types/stripo';
|
|
2
2
|
export declare const UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY = "dynamic-content.unresolved-attributes-on-drop";
|
|
3
3
|
/**
|
|
4
|
-
* Repairs saved modules
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - Dynamic content: saved modules serialize merge-tag chips by their display label
|
|
8
|
-
* (`{{ Phone Number }}`); this maps them back to their canonical token
|
|
9
|
-
* (`{{phone_number}}`) using the account's dynamic-content list.
|
|
10
|
-
* - Items currency: v2 Items blocks can carry price `data-curency` /
|
|
11
|
-
* `data-currency_symbol` attrs that drifted from their `esd-ext-config`; these are
|
|
12
|
-
* healed from config (the export contract reads those exact attrs).
|
|
13
|
-
*
|
|
14
|
-
* Wired into Stripo via the `onModuleAdd` init callback (see `useStripo`).
|
|
4
|
+
* Repairs dropped/copied saved modules (items currency, linkless legacy unsubscribe → text block,
|
|
5
|
+
* dynamic-content labels → tokens) in one write-back; wired via Stripo's `onModuleAdd` (see `useStripo`).
|
|
15
6
|
*/
|
|
16
7
|
export declare const useModuleRepair: () => {
|
|
17
8
|
handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const migrateLegacyUnsubscribeText: (html: string) => string;
|
|
@@ -8,6 +8,8 @@ export declare const ACADEMY_LINKS: {
|
|
|
8
8
|
readonly EMAIL_EDITOR: "https://academy.insiderone.com/docs/email-drag-and-drop-editor";
|
|
9
9
|
readonly GLOBAL_UNSUBSCRIBE: "https://academy.insiderone.com/docs/global-unsubscribe-preference-center";
|
|
10
10
|
readonly AMP_FOR_EMAILS: "https://academy.insiderone.com/docs/amp-for-emails";
|
|
11
|
+
readonly EMAIL_DISPLAY_CONDITIONS: "https://academy.insiderone.com/docs/new-editor-add-display-conditions-to-an-email";
|
|
11
12
|
readonly EMAIL_RECOMMENDATION_BLOCK: "https://academy.insiderone.com/docs/new-editor-email-recommendation-block";
|
|
13
|
+
readonly LEGACY_UNSUBSCRIBE_MODULE: "https://academy.insiderone.com/docs/new-editor-add-unsubscribe-pages-into-emails";
|
|
12
14
|
};
|
|
13
15
|
export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum DisplayConditionEvent {
|
|
2
|
+
OPEN = "display-condition:open",
|
|
3
|
+
APPLY = "display-condition:apply",
|
|
4
|
+
CANCEL = "display-condition:cancel"
|
|
5
|
+
}
|
|
6
|
+
export declare enum DisplayConditionSourceType {
|
|
7
|
+
INLINE = "inline",
|
|
8
|
+
SAVED = "saved"
|
|
9
|
+
}
|
|
10
|
+
export declare const DISPLAY_CONDITION_LIMITS: {
|
|
11
|
+
readonly NAME_MIN: 2;
|
|
12
|
+
readonly NAME_MAX: 40;
|
|
13
|
+
readonly DESCRIPTION_MAX: 200;
|
|
14
|
+
readonly CODE_MAX: 65535;
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AppliedDisplayCondition, DisplayConditionOpenDetail } from '@@/Types/display-condition';
|
|
2
|
+
export interface ConditionRequestHandlers {
|
|
3
|
+
onApply: (condition: AppliedDisplayCondition | null) => boolean;
|
|
4
|
+
onCancel?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const disposeDisplayConditionRequest: () => void;
|
|
7
|
+
export declare const requestDisplayCondition: (detail: DisplayConditionOpenDetail, handlers: ConditionRequestHandlers) => () => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BlockType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare const CONDITIONS_TAB_ID = "conditions";
|
|
3
|
+
export declare const CONDITIONS_CONTROL_ID = "guido-display-conditions-control";
|
|
4
|
+
export declare const MAX_COLLAPSED_LINES = 10;
|
|
5
|
+
export declare const CONDITION_BLOCK_TYPES: readonly [BlockType.STRIPE, BlockType.STRUCTURE, BlockType.CONTAINER];
|
|
6
|
+
export declare const CONDITION_ICONS: {
|
|
7
|
+
readonly PLUS: "guido-display-condition-plus";
|
|
8
|
+
readonly EDIT: "guido-display-condition-edit";
|
|
9
|
+
readonly TRASH: "guido-display-condition-trash";
|
|
10
|
+
readonly CHEVRON: "guido-display-condition-chevron";
|
|
11
|
+
};
|
|
12
|
+
export declare const CONDITION_BUTTONS: {
|
|
13
|
+
readonly ADD: "guidoDisplayConditionAdd";
|
|
14
|
+
readonly CREATE: "guidoDisplayConditionCreate";
|
|
15
|
+
readonly SELECT: "guidoDisplayConditionSelect";
|
|
16
|
+
readonly SHOW_MORE: "guidoDisplayConditionShowMore";
|
|
17
|
+
readonly SHOW_LESS: "guidoDisplayConditionShowLess";
|
|
18
|
+
readonly EDIT: "guidoDisplayConditionEdit";
|
|
19
|
+
readonly REMOVE: "guidoDisplayConditionRemove";
|
|
20
|
+
};
|
|
21
|
+
export declare const BUILT_IN_CONDITION_CONTROLS: string[];
|
|
22
|
+
export declare const EMPTY_DESCRIPTION: string;
|
|
23
|
+
export declare const APPLIED_DESCRIPTION: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { CommonControl } from '@@/Extensions/Blocks/common-control';
|
|
3
|
+
export declare class DisplayConditionsControl extends CommonControl {
|
|
4
|
+
private expanded;
|
|
5
|
+
private listeners;
|
|
6
|
+
private resizeObserver;
|
|
7
|
+
private detachOutsideClick;
|
|
8
|
+
getId(): string;
|
|
9
|
+
getTemplate(): string;
|
|
10
|
+
onRender(): void;
|
|
11
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
12
|
+
onDestroy(): void;
|
|
13
|
+
private setExpanded;
|
|
14
|
+
private getCondition;
|
|
15
|
+
private toggleMenu;
|
|
16
|
+
private listenOutsideClick;
|
|
17
|
+
private openDrawer;
|
|
18
|
+
private removeCondition;
|
|
19
|
+
private applyCondition;
|
|
20
|
+
private wire;
|
|
21
|
+
private teardown;
|
|
22
|
+
private observeCodeSize;
|
|
23
|
+
private paint;
|
|
24
|
+
private collapsedHeight;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DisplayCondition, ExternalDisplayConditionSelectedCB } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { ExternalDisplayConditionsLibrary } from '@stripoinc/ui-editor-extensions';
|
|
3
|
+
export declare class DisplayConditionsLibrary extends ExternalDisplayConditionsLibrary {
|
|
4
|
+
getCategoryName(): string;
|
|
5
|
+
openExternalDisplayConditionsDialog(currentCondition: DisplayCondition, successCallback: ExternalDisplayConditionSelectedCB, cancelCallback: () => void): void;
|
|
6
|
+
getIsContextActionEnabled(): boolean;
|
|
7
|
+
getContextActionIndex(): number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SettingsPanelTab as SettingsPanelTabType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { SettingsPanelRegistry } from '@stripoinc/ui-editor-extensions';
|
|
3
|
+
export declare class DisplayConditionsSettingsPanel extends SettingsPanelRegistry {
|
|
4
|
+
registerBlockControls(blockControlsMap: Record<string, SettingsPanelTabType[]>): void;
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DisplayConditionDraft, DisplayConditionSyntax, SavedDisplayCondition } from '@@/Types/display-condition';
|
|
2
|
+
export declare const DISPLAY_CONDITIONS_URL = "/email-proxy/v1/display-conditions";
|
|
3
|
+
export declare const DISPLAY_CONDITIONS_PAGE_LIMIT = 100;
|
|
4
|
+
export declare const useDisplayConditionApi: () => {
|
|
5
|
+
list: (syntax: DisplayConditionSyntax) => Promise<SavedDisplayCondition[]>;
|
|
6
|
+
create: (draft: DisplayConditionDraft, syntax: DisplayConditionSyntax) => Promise<SavedDisplayCondition>;
|
|
7
|
+
remove: (id: number) => Promise<void>;
|
|
8
|
+
};
|