@useinsider/guido 3.21.2 → 3.22.0-beta.0951deb
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 +41 -39
- package/dist/@types/display-condition.js +25 -0
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +81 -79
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +20 -0
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +71 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +57 -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/composables/useActionsApi.js +22 -21
- package/dist/composables/useBlocksConfig.js +32 -24
- package/dist/composables/useDisplayConditions.js +102 -0
- package/dist/composables/useFullStoryBridge.js +10 -9
- package/dist/composables/useSave.js +75 -68
- package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
- package/dist/config/migrator/fullStoryScriptMigrator.js +5 -0
- package/dist/config/migrator/index.js +11 -10
- package/dist/enums/academy.js +1 -0
- package/dist/enums/display-condition.js +12 -0
- package/dist/extensions/DisplayConditions/bridge.js +17 -0
- package/dist/extensions/DisplayConditions/constants.js +17 -0
- package/dist/extensions/DisplayConditions/control.js +178 -0
- package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
- package/dist/extensions/DisplayConditions/extension.js +28 -0
- package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
- package/dist/extensions/DisplayConditions/library.js +27 -0
- package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
- 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/services/displayConditionApi.js +39 -0
- package/dist/services/templateLibraryApi.js +36 -31
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/display-condition.d.ts +59 -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/DisplayConditionSelectDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useDisplayConditions.d.ts +16 -0
- package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
- package/dist/src/config/migrator/fullStoryScriptMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/display-condition.d.ts +15 -0
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +6 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +23 -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 +166 -0
- package/dist/src/stores/display-condition.d.ts +81 -0
- package/dist/src/utils/displayCondition.d.ts +10 -0
- package/dist/src/utils/fullStoryScripts.d.ts +6 -0
- package/dist/src/utils/protectTableText.d.ts +2 -0
- package/dist/src/utils/templatePreparation.d.ts +2 -1
- package/dist/stores/config.js +13 -6
- package/dist/stores/display-condition.js +28 -0
- package/dist/utils/displayCondition.js +26 -0
- package/dist/utils/fullStoryScripts.js +8 -0
- package/dist/utils/pairProductVariables.js +99 -90
- package/dist/utils/protectTableText.js +22 -0
- package/dist/utils/templatePreparation.js +30 -30
- package/package.json +1 -1
|
@@ -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
|
+
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { useActionsApi as h } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as S } from "../composables/useConfig.js";
|
|
3
|
+
import { useHttp as v } from "../composables/useHttp.js";
|
|
4
|
+
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as A } from "../composables/useTranslations.js";
|
|
6
|
+
import { useHtmlDocumentCountValidator as E } from "../composables/validators/useHtmlDocumentCountValidator.js";
|
|
7
|
+
import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
|
|
8
|
+
import { EditorType as H } from "../enums/defaults.js";
|
|
9
|
+
import { ToasterTypeOptions as P } from "../enums/toaster.js";
|
|
10
|
+
import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
|
+
import { useSaveAsTemplateStore as L } from "../stores/save-as-template.js";
|
|
10
12
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
11
|
-
import { isPlainObject as
|
|
12
|
-
import { useTemplatePreparation as
|
|
13
|
-
const
|
|
14
|
-
const { get: n, post: m } =
|
|
13
|
+
import { isPlainObject as q } from "../utils/genericUtil.js";
|
|
14
|
+
import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
|
|
15
|
+
const Z = () => {
|
|
16
|
+
const { get: n, post: m } = v(), { handleError: s, showToaster: l } = x(), { config: c, isFeatureEnabled: p } = S(), { validateLiquidSyntax: T } = N(), { validateSingleHtmlDocument: w } = E(), { getTemplateData: b } = h(), u = A();
|
|
15
17
|
return {
|
|
16
18
|
getCategories: async () => {
|
|
17
19
|
try {
|
|
18
20
|
const { data: e = [] } = await n("/newsletter/template-library/get-template-categories");
|
|
19
21
|
return e;
|
|
20
22
|
} catch (e) {
|
|
21
|
-
return
|
|
23
|
+
return s(e, "Failed to fetch template categories"), [];
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
26
|
checkTemplateNameAvailability: async (e) => {
|
|
@@ -35,27 +37,30 @@ const B = () => {
|
|
|
35
37
|
);
|
|
36
38
|
return t.toString();
|
|
37
39
|
} catch (t) {
|
|
38
|
-
return
|
|
40
|
+
return s(t, "Failed to create category"), "";
|
|
39
41
|
}
|
|
40
42
|
},
|
|
41
43
|
createTemplate: async () => {
|
|
42
44
|
var e, t, d, y;
|
|
43
45
|
try {
|
|
44
|
-
const { prepareTemplateDetails: i } =
|
|
45
|
-
if (
|
|
46
|
+
const { prepareTemplateDetails: i } = F(), o = L(), g = await b();
|
|
47
|
+
if (!w(g.html))
|
|
46
48
|
return !1;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
const a = await i(g);
|
|
50
|
+
if (p("liquidSyntax") && !await T(a.compiledHtml))
|
|
51
|
+
return !1;
|
|
52
|
+
const C = {
|
|
53
|
+
name: o.getTemplateName,
|
|
54
|
+
categories: o.getSelectedCategoryIds,
|
|
50
55
|
productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
51
|
-
editorType:
|
|
56
|
+
editorType: H,
|
|
52
57
|
messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
53
58
|
content: r(a.compiledHtml),
|
|
54
59
|
css: r(a.css),
|
|
55
60
|
unsubscriptionPreferencePageStatus: !1,
|
|
56
61
|
unsubscriptionPreferencePages: [],
|
|
57
62
|
recommendationCampaignUrls: r(
|
|
58
|
-
|
|
63
|
+
D().recommendationCampaignUrls
|
|
59
64
|
),
|
|
60
65
|
recommendationConfigs: r({}),
|
|
61
66
|
isGuido: !0,
|
|
@@ -67,31 +72,31 @@ const B = () => {
|
|
|
67
72
|
css: a.css,
|
|
68
73
|
dynamicContentList: a.dynamicContentList
|
|
69
74
|
})
|
|
70
|
-
}, { data:
|
|
75
|
+
}, { data: f } = await m(
|
|
71
76
|
"/newsletter/template-library/create-template",
|
|
72
|
-
|
|
77
|
+
C
|
|
73
78
|
);
|
|
74
|
-
if (!
|
|
79
|
+
if (!q(f))
|
|
75
80
|
throw new Error("Unexpected create-template response");
|
|
76
|
-
return
|
|
81
|
+
return f.type === "alert" ? (l({
|
|
77
82
|
message: u(
|
|
78
83
|
"newsletter.template-library-save-alert",
|
|
79
|
-
{ templateName:
|
|
84
|
+
{ templateName: o.getTemplateName }
|
|
80
85
|
),
|
|
81
|
-
type:
|
|
86
|
+
type: P.Error
|
|
82
87
|
}), !1) : (l({
|
|
83
88
|
message: u(
|
|
84
89
|
"newsletter.template-library-save-success",
|
|
85
|
-
{ templateName:
|
|
90
|
+
{ templateName: o.getTemplateName }
|
|
86
91
|
),
|
|
87
92
|
type: "success"
|
|
88
93
|
}), !0);
|
|
89
94
|
} catch (i) {
|
|
90
|
-
return
|
|
95
|
+
return s(i, "Failed to create template"), !1;
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
};
|
|
94
99
|
};
|
|
95
100
|
export {
|
|
96
|
-
|
|
101
|
+
Z as useTemplateLibraryApi
|
|
97
102
|
};
|
|
@@ -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
|
|
@@ -804,6 +806,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
804
806
|
readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
805
807
|
/** Custom label for back button (if shown) */
|
|
806
808
|
readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
809
|
+
/** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
|
|
810
|
+
readonly externalDisplayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
807
811
|
}, undefined>, {}>;
|
|
808
812
|
/** Feature toggles */
|
|
809
813
|
readonly features: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
export type DisplayConditionSource = 'inline' | 'saved';
|
|
43
|
+
/** Mirrors Stripo's `DisplayCondition`; kept local so Vue code does not import the Stripo package. */
|
|
44
|
+
export interface AppliedDisplayCondition {
|
|
45
|
+
id: number;
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
beforeScript: string;
|
|
49
|
+
afterScript: string;
|
|
50
|
+
extraData?: string;
|
|
51
|
+
}
|
|
52
|
+
export type DisplayConditionOpenMode = 'select' | 'create' | 'edit';
|
|
53
|
+
export interface DisplayConditionOpenDetail {
|
|
54
|
+
mode: DisplayConditionOpenMode;
|
|
55
|
+
current: AppliedDisplayCondition | null;
|
|
56
|
+
}
|
|
57
|
+
export interface DisplayConditionApplyDetail {
|
|
58
|
+
condition: AppliedDisplayCondition | null;
|
|
59
|
+
}
|
|
@@ -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: () => 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;
|
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;
|
|
@@ -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;
|
|
@@ -228,6 +229,7 @@ export declare const useConfig: () => {
|
|
|
228
229
|
ui: import("vue").ComputedRef<{
|
|
229
230
|
showHeader: boolean;
|
|
230
231
|
backButtonLabel?: string | undefined;
|
|
232
|
+
externalDisplayConditions: boolean;
|
|
231
233
|
} | null>;
|
|
232
234
|
features: import("vue").ComputedRef<{
|
|
233
235
|
dynamicContent: boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 useDisplayConditions: () => {
|
|
6
|
+
syntax: import("vue").ComputedRef<"liquid" | "pongo">;
|
|
7
|
+
handleOpen: (detail: DisplayConditionOpenDetail) => void;
|
|
8
|
+
cancel: () => void;
|
|
9
|
+
loadList: () => Promise<void>;
|
|
10
|
+
validate: (draft: DisplayConditionDraft) => DraftErrors;
|
|
11
|
+
notifyInvalid: () => void;
|
|
12
|
+
createInline: (draft: DisplayConditionDraft) => void;
|
|
13
|
+
createAndSave: (draft: DisplayConditionDraft) => Promise<DraftErrors | null>;
|
|
14
|
+
select: (row: SavedDisplayCondition) => void;
|
|
15
|
+
deleteSaved: (row: SavedDisplayCondition) => Promise<void>;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const migrateFullStoryScripts: (html: string) => string;
|
|
@@ -8,6 +8,7 @@ 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";
|
|
12
13
|
};
|
|
13
14
|
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,6 @@
|
|
|
1
|
+
import type { AppliedDisplayCondition, DisplayConditionOpenDetail } from '@@/Types/display-condition';
|
|
2
|
+
export interface ConditionRequestHandlers {
|
|
3
|
+
onApply: (condition: AppliedDisplayCondition | null) => void;
|
|
4
|
+
onCancel?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const requestDisplayCondition: (detail: DisplayConditionOpenDetail, handlers: ConditionRequestHandlers) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
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 BUILT_IN_CONDITION_CONTROLS: string[];
|
|
13
|
+
export declare const EMPTY_DESCRIPTION: string;
|
|
14
|
+
export declare const APPLIED_DESCRIPTION: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 getCondition;
|
|
14
|
+
private toggleMenu;
|
|
15
|
+
private listenOutsideClick;
|
|
16
|
+
private openDrawer;
|
|
17
|
+
private applyCondition;
|
|
18
|
+
private wire;
|
|
19
|
+
private teardown;
|
|
20
|
+
private observeCodeSize;
|
|
21
|
+
private paint;
|
|
22
|
+
private collapsedHeight;
|
|
23
|
+
}
|
|
@@ -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
|
+
};
|