@useinsider/guido 3.24.0-beta.82c2d5e → 3.24.0-beta.89982ef
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 -9
- package/dist/@types/config/schemas.js +37 -37
- package/dist/@types/display-condition.js +25 -0
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +82 -80
- 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/composables/useBlocksConfig.js +31 -20
- package/dist/composables/useDisplayConditions.js +117 -0
- package/dist/composables/useModuleRepair.js +23 -32
- 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 +9 -10
- package/dist/enums/academy.js +2 -2
- package/dist/enums/display-condition.js +12 -0
- 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/LinkTracking/extension.js +17 -0
- package/dist/extensions/LinkTracking/writer.js +41 -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/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +39 -0
- package/dist/src/@types/config/schemas.d.ts +4 -4
- 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/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/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useDisplayConditions.d.ts +18 -0
- package/dist/src/composables/useModuleRepair.d.ts +11 -2
- package/dist/src/enums/academy.d.ts +1 -1
- package/dist/src/enums/display-condition.d.ts +15 -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/extensions/LinkTracking/extension.d.ts +2 -0
- package/dist/src/extensions/LinkTracking/writer.d.ts +13 -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 +167 -20
- package/dist/src/stores/display-condition.d.ts +86 -0
- package/dist/src/stores/editor.d.ts +0 -27
- package/dist/src/utils/displayCondition.d.ts +11 -0
- package/dist/src/utils/linkTrackingIds.d.ts +22 -5
- 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 +0 -1
- package/dist/utils/displayCondition.js +29 -0
- package/dist/utils/linkTrackingIds.js +82 -48
- package/dist/utils/pairProductVariables.js +30 -29
- package/dist/utils/protectTableText.js +22 -0
- package/dist/utils/templatePreparation.js +67 -57
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +0 -17
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +0 -30
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +0 -16
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +0 -1
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -10
- package/dist/utils/legacyUnsubscribeConversion.js +0 -49
- /package/dist/src/components/organisms/{unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts → display-conditions/DisplayConditionCreateDrawer.vue.d.ts} +0 -0
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,8 +417,6 @@ 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>;
|
|
418
|
-
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
419
|
-
readonly legacyUnsubscribeConversion: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
420
420
|
}, undefined>;
|
|
421
421
|
/**
|
|
422
422
|
* Default block types available in Stripo
|
|
@@ -807,6 +807,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
807
807
|
readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
808
808
|
/** Custom label for back button (if shown) */
|
|
809
809
|
readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
810
|
+
/** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
|
|
811
|
+
readonly externalDisplayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
810
812
|
}, undefined>, {}>;
|
|
811
813
|
/** Feature toggles */
|
|
812
814
|
readonly features: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -836,8 +838,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
836
838
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
837
839
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
838
840
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
839
|
-
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
840
|
-
readonly legacyUnsubscribeConversion: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
841
841
|
}, undefined>, {}>;
|
|
842
842
|
/** Block configuration */
|
|
843
843
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -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
|
+
} & {};
|
|
@@ -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;
|
|
@@ -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,7 +106,6 @@ export declare const useConfig: () => {
|
|
|
105
106
|
linkTrackingIds: boolean;
|
|
106
107
|
allowSaveWithErrors: boolean;
|
|
107
108
|
reusableRecommendationStrategy: boolean;
|
|
108
|
-
legacyUnsubscribeConversion: boolean;
|
|
109
109
|
};
|
|
110
110
|
blocks: {
|
|
111
111
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -230,6 +230,7 @@ export declare const useConfig: () => {
|
|
|
230
230
|
ui: import("vue").ComputedRef<{
|
|
231
231
|
showHeader: boolean;
|
|
232
232
|
backButtonLabel?: string | undefined;
|
|
233
|
+
externalDisplayConditions: boolean;
|
|
233
234
|
} | null>;
|
|
234
235
|
features: import("vue").ComputedRef<{
|
|
235
236
|
dynamicContent: boolean;
|
|
@@ -246,7 +247,6 @@ export declare const useConfig: () => {
|
|
|
246
247
|
linkTrackingIds: boolean;
|
|
247
248
|
allowSaveWithErrors: boolean;
|
|
248
249
|
reusableRecommendationStrategy: boolean;
|
|
249
|
-
legacyUnsubscribeConversion: boolean;
|
|
250
250
|
} | null>;
|
|
251
251
|
blocks: import("vue").ComputedRef<{
|
|
252
252
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -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,8 +1,17 @@
|
|
|
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
|
|
5
|
-
*
|
|
4
|
+
* Repairs saved modules as they are dropped or copied into the editor, in one pass
|
|
5
|
+
* over the module HTML. Two independent repairs run through a single write-back:
|
|
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`).
|
|
6
15
|
*/
|
|
7
16
|
export declare const useModuleRepair: () => {
|
|
8
17
|
handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
|
|
@@ -8,7 +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
|
-
readonly LEGACY_UNSUBSCRIBE_MODULE: "https://academy.insiderone.com/docs/new-editor-add-unsubscribe-pages-into-emails";
|
|
13
13
|
};
|
|
14
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,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,13 @@
|
|
|
1
|
+
import type { DocumentTrackingIdPlan } from '@@/Utils/linkTrackingIds';
|
|
2
|
+
import type { CssNodeModifier, HtmlNodeModifier, ImmutableHtmlNode, TemplateModifier } from '@stripoinc/ui-editor-extensions';
|
|
3
|
+
export interface TrackingIdWriterApi {
|
|
4
|
+
getDocumentModifier: () => TemplateModifier<HtmlNodeModifier, CssNodeModifier>;
|
|
5
|
+
getDocumentRootHtmlNode: () => ImmutableHtmlNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const registerTrackingIdWriter: (readApi: () => TrackingIdWriterApi | undefined) => void;
|
|
8
|
+
export declare const disposeTrackingIdWriter: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* One hidden modification keeps the selection and the panel alive, unlike a document replacement.
|
|
11
|
+
* Returns false when the live document does not match the plan; the caller then falls back.
|
|
12
|
+
*/
|
|
13
|
+
export declare const writeTrackingIdsInPlace: ({ anchorIds, inComment, plan }: DocumentTrackingIdPlan) => boolean;
|
|
@@ -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
|
+
};
|