@useinsider/guido 3.21.2-beta.ccc7173 → 3.21.2-beta.d38b210
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/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/composables/useBlocksConfig.js +32 -24
- package/dist/composables/useDisplayConditions.js +102 -0
- 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/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/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/stores/unsubscribe.d.ts +0 -10
- package/dist/src/utils/displayCondition.d.ts +10 -0
- package/dist/src/utils/protectTableText.d.ts +2 -0
- package/dist/stores/config.js +13 -6
- package/dist/stores/display-condition.js +28 -0
- package/dist/stores/unsubscribe.js +24 -28
- package/dist/utils/displayCondition.js +26 -0
- package/dist/utils/pairProductVariables.js +15 -14
- package/dist/utils/protectTableText.js +22 -0
- 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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -94,6 +94,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
94
94
|
ui: {
|
|
95
95
|
showHeader: boolean;
|
|
96
96
|
backButtonLabel?: string | undefined;
|
|
97
|
+
externalDisplayConditions: boolean;
|
|
97
98
|
};
|
|
98
99
|
features: {
|
|
99
100
|
dynamicContent: boolean;
|
|
@@ -239,6 +240,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
239
240
|
ui: {
|
|
240
241
|
showHeader: boolean;
|
|
241
242
|
backButtonLabel?: string | undefined;
|
|
243
|
+
externalDisplayConditions: boolean;
|
|
242
244
|
};
|
|
243
245
|
features: {
|
|
244
246
|
dynamicContent: boolean;
|
|
@@ -384,6 +386,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
384
386
|
ui: {
|
|
385
387
|
showHeader: boolean;
|
|
386
388
|
backButtonLabel?: string | undefined;
|
|
389
|
+
externalDisplayConditions: boolean;
|
|
387
390
|
};
|
|
388
391
|
features: {
|
|
389
392
|
dynamicContent: boolean;
|
|
@@ -529,6 +532,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
529
532
|
ui: {
|
|
530
533
|
showHeader: boolean;
|
|
531
534
|
backButtonLabel?: string | undefined;
|
|
535
|
+
externalDisplayConditions: boolean;
|
|
532
536
|
};
|
|
533
537
|
features: {
|
|
534
538
|
dynamicContent: boolean;
|
|
@@ -674,6 +678,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
674
678
|
ui: {
|
|
675
679
|
showHeader: boolean;
|
|
676
680
|
backButtonLabel?: string | undefined;
|
|
681
|
+
externalDisplayConditions: boolean;
|
|
677
682
|
};
|
|
678
683
|
features: {
|
|
679
684
|
dynamicContent: boolean;
|
|
@@ -819,6 +824,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
819
824
|
ui: {
|
|
820
825
|
showHeader: boolean;
|
|
821
826
|
backButtonLabel?: string | undefined;
|
|
827
|
+
externalDisplayConditions: boolean;
|
|
822
828
|
};
|
|
823
829
|
features: {
|
|
824
830
|
dynamicContent: boolean;
|
|
@@ -964,6 +970,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
964
970
|
ui: {
|
|
965
971
|
showHeader: boolean;
|
|
966
972
|
backButtonLabel?: string | undefined;
|
|
973
|
+
externalDisplayConditions: boolean;
|
|
967
974
|
};
|
|
968
975
|
features: {
|
|
969
976
|
dynamicContent: boolean;
|
|
@@ -1109,6 +1116,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1109
1116
|
ui: {
|
|
1110
1117
|
showHeader: boolean;
|
|
1111
1118
|
backButtonLabel?: string | undefined;
|
|
1119
|
+
externalDisplayConditions: boolean;
|
|
1112
1120
|
};
|
|
1113
1121
|
features: {
|
|
1114
1122
|
dynamicContent: boolean;
|
|
@@ -1254,6 +1262,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1254
1262
|
ui: {
|
|
1255
1263
|
showHeader: boolean;
|
|
1256
1264
|
backButtonLabel?: string | undefined;
|
|
1265
|
+
externalDisplayConditions: boolean;
|
|
1257
1266
|
};
|
|
1258
1267
|
features: {
|
|
1259
1268
|
dynamicContent: boolean;
|
|
@@ -1399,6 +1408,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1399
1408
|
ui: {
|
|
1400
1409
|
showHeader: boolean;
|
|
1401
1410
|
backButtonLabel?: string | undefined;
|
|
1411
|
+
externalDisplayConditions: boolean;
|
|
1402
1412
|
};
|
|
1403
1413
|
features: {
|
|
1404
1414
|
dynamicContent: boolean;
|
|
@@ -1544,6 +1554,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1544
1554
|
ui: {
|
|
1545
1555
|
showHeader: boolean;
|
|
1546
1556
|
backButtonLabel?: string | undefined;
|
|
1557
|
+
externalDisplayConditions: boolean;
|
|
1547
1558
|
};
|
|
1548
1559
|
features: {
|
|
1549
1560
|
dynamicContent: boolean;
|
|
@@ -1689,6 +1700,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1689
1700
|
ui: {
|
|
1690
1701
|
showHeader: boolean;
|
|
1691
1702
|
backButtonLabel?: string | undefined;
|
|
1703
|
+
externalDisplayConditions: boolean;
|
|
1692
1704
|
};
|
|
1693
1705
|
features: {
|
|
1694
1706
|
dynamicContent: boolean;
|
|
@@ -1834,6 +1846,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1834
1846
|
ui: {
|
|
1835
1847
|
showHeader: boolean;
|
|
1836
1848
|
backButtonLabel?: string | undefined;
|
|
1849
|
+
externalDisplayConditions: boolean;
|
|
1837
1850
|
};
|
|
1838
1851
|
features: {
|
|
1839
1852
|
dynamicContent: boolean;
|
|
@@ -1979,6 +1992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1979
1992
|
ui: {
|
|
1980
1993
|
showHeader: boolean;
|
|
1981
1994
|
backButtonLabel?: string | undefined;
|
|
1995
|
+
externalDisplayConditions: boolean;
|
|
1982
1996
|
};
|
|
1983
1997
|
features: {
|
|
1984
1998
|
dynamicContent: boolean;
|
|
@@ -2124,6 +2138,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2124
2138
|
ui: {
|
|
2125
2139
|
showHeader: boolean;
|
|
2126
2140
|
backButtonLabel?: string | undefined;
|
|
2141
|
+
externalDisplayConditions: boolean;
|
|
2127
2142
|
};
|
|
2128
2143
|
features: {
|
|
2129
2144
|
dynamicContent: boolean;
|
|
@@ -2269,6 +2284,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2269
2284
|
ui: {
|
|
2270
2285
|
showHeader: boolean;
|
|
2271
2286
|
backButtonLabel?: string | undefined;
|
|
2287
|
+
externalDisplayConditions: boolean;
|
|
2272
2288
|
};
|
|
2273
2289
|
features: {
|
|
2274
2290
|
dynamicContent: boolean;
|
|
@@ -2414,6 +2430,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2414
2430
|
ui: {
|
|
2415
2431
|
showHeader: boolean;
|
|
2416
2432
|
backButtonLabel?: string | undefined;
|
|
2433
|
+
externalDisplayConditions: boolean;
|
|
2417
2434
|
};
|
|
2418
2435
|
features: {
|
|
2419
2436
|
dynamicContent: boolean;
|
|
@@ -2571,6 +2588,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2571
2588
|
ui: {
|
|
2572
2589
|
showHeader: boolean;
|
|
2573
2590
|
backButtonLabel?: string | undefined;
|
|
2591
|
+
externalDisplayConditions: boolean;
|
|
2574
2592
|
};
|
|
2575
2593
|
features: {
|
|
2576
2594
|
dynamicContent: boolean;
|
|
@@ -2716,6 +2734,153 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2716
2734
|
ui: {
|
|
2717
2735
|
showHeader: boolean;
|
|
2718
2736
|
backButtonLabel?: string | undefined;
|
|
2737
|
+
externalDisplayConditions: boolean;
|
|
2738
|
+
};
|
|
2739
|
+
features: {
|
|
2740
|
+
dynamicContent: boolean;
|
|
2741
|
+
saveAsTemplate: boolean;
|
|
2742
|
+
versionHistory: boolean;
|
|
2743
|
+
testMessage: boolean;
|
|
2744
|
+
displayConditions: boolean;
|
|
2745
|
+
unsubscribe: boolean;
|
|
2746
|
+
modulesDisabled: boolean;
|
|
2747
|
+
liquidSyntax: boolean;
|
|
2748
|
+
autosave: boolean;
|
|
2749
|
+
allowlistEnabled: boolean;
|
|
2750
|
+
linkTrackingIds: boolean;
|
|
2751
|
+
allowSaveWithErrors: boolean;
|
|
2752
|
+
reusableRecommendationStrategy: boolean;
|
|
2753
|
+
};
|
|
2754
|
+
blocks: {
|
|
2755
|
+
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")[];
|
|
2756
|
+
includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
|
|
2757
|
+
};
|
|
2758
|
+
compiler: {
|
|
2759
|
+
customRules: ({
|
|
2760
|
+
type: "replace";
|
|
2761
|
+
search: string;
|
|
2762
|
+
replacement: string;
|
|
2763
|
+
replaceAll?: boolean | undefined;
|
|
2764
|
+
id: string;
|
|
2765
|
+
description?: string | undefined;
|
|
2766
|
+
priority: number;
|
|
2767
|
+
} | {
|
|
2768
|
+
type: "regex";
|
|
2769
|
+
pattern: string;
|
|
2770
|
+
replacement: string;
|
|
2771
|
+
flags?: string | undefined;
|
|
2772
|
+
id: string;
|
|
2773
|
+
description?: string | undefined;
|
|
2774
|
+
priority: number;
|
|
2775
|
+
} | {
|
|
2776
|
+
type: "remove";
|
|
2777
|
+
targets: string[];
|
|
2778
|
+
id: string;
|
|
2779
|
+
description?: string | undefined;
|
|
2780
|
+
priority: number;
|
|
2781
|
+
} | {
|
|
2782
|
+
type: "custom";
|
|
2783
|
+
processor: (html: string) => string;
|
|
2784
|
+
id: string;
|
|
2785
|
+
description?: string | undefined;
|
|
2786
|
+
priority: number;
|
|
2787
|
+
})[];
|
|
2788
|
+
ignoreDefaultRules: boolean;
|
|
2789
|
+
};
|
|
2790
|
+
callbacks: {
|
|
2791
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
2792
|
+
};
|
|
2793
|
+
} | null;
|
|
2794
|
+
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
|
|
2795
|
+
/**
|
|
2796
|
+
* Check if the Insider display-condition UI replaces Stripo's
|
|
2797
|
+
*/
|
|
2798
|
+
externalDisplayConditions: (state: {
|
|
2799
|
+
initialized: boolean;
|
|
2800
|
+
config: {
|
|
2801
|
+
identity: {
|
|
2802
|
+
templateId: string;
|
|
2803
|
+
userId: string;
|
|
2804
|
+
variationId?: string | undefined;
|
|
2805
|
+
campaignId?: string | undefined;
|
|
2806
|
+
templateLibraryId?: string | undefined;
|
|
2807
|
+
};
|
|
2808
|
+
partner: {
|
|
2809
|
+
name: string;
|
|
2810
|
+
productType: 60 | 49 | 97;
|
|
2811
|
+
messageType: 1 | 2;
|
|
2812
|
+
username: string;
|
|
2813
|
+
fallbackFont?: {
|
|
2814
|
+
name: string;
|
|
2815
|
+
family: string;
|
|
2816
|
+
} | undefined;
|
|
2817
|
+
};
|
|
2818
|
+
template: {
|
|
2819
|
+
html: string;
|
|
2820
|
+
css: string;
|
|
2821
|
+
preselectedDynamicContent: {
|
|
2822
|
+
text: string;
|
|
2823
|
+
value: string;
|
|
2824
|
+
fallback?: string | undefined;
|
|
2825
|
+
format?: {
|
|
2826
|
+
key: string;
|
|
2827
|
+
value: string;
|
|
2828
|
+
} | undefined;
|
|
2829
|
+
}[];
|
|
2830
|
+
dynamicContentList: {
|
|
2831
|
+
[x: string]: import("../library").DynamicContentNode[];
|
|
2832
|
+
};
|
|
2833
|
+
customFieldAttributes: string[];
|
|
2834
|
+
selectedUnsubscribePages: number[];
|
|
2835
|
+
forceRecreate: boolean;
|
|
2836
|
+
trackIdCounter: number;
|
|
2837
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2838
|
+
migration: {
|
|
2839
|
+
recommendationConfigs: {
|
|
2840
|
+
[x: string]: {
|
|
2841
|
+
id?: number | undefined;
|
|
2842
|
+
decimalCount?: string | number | undefined;
|
|
2843
|
+
productIds?: unknown[] | undefined;
|
|
2844
|
+
sendProductRequestFlag?: boolean | undefined;
|
|
2845
|
+
shuffleProducts?: boolean | undefined;
|
|
2846
|
+
filters?: unknown[] | undefined;
|
|
2847
|
+
currency?: string | undefined;
|
|
2848
|
+
currencySettings?: unknown;
|
|
2849
|
+
language?: string | undefined;
|
|
2850
|
+
strategy?: string | undefined;
|
|
2851
|
+
recommendedProducts?: unknown[] | undefined;
|
|
2852
|
+
cardsInRow?: number | undefined;
|
|
2853
|
+
mobileRightPadding?: number | undefined;
|
|
2854
|
+
mobileLeftPadding?: number | undefined;
|
|
2855
|
+
unresponsive?: boolean | undefined;
|
|
2856
|
+
orientation?: string | undefined;
|
|
2857
|
+
textTrimming?: boolean | undefined;
|
|
2858
|
+
blockType?: string | undefined;
|
|
2859
|
+
size?: string | number | undefined;
|
|
2860
|
+
verticalResponsiveness?: boolean | undefined;
|
|
2861
|
+
isPriceMovedToNextLine?: boolean | undefined;
|
|
2862
|
+
isPriceDeletedForZeroSale?: boolean | undefined;
|
|
2863
|
+
} & {
|
|
2864
|
+
[key: string]: unknown;
|
|
2865
|
+
};
|
|
2866
|
+
};
|
|
2867
|
+
};
|
|
2868
|
+
};
|
|
2869
|
+
editor: {
|
|
2870
|
+
locale: string;
|
|
2871
|
+
translationsPath: string;
|
|
2872
|
+
migrationDate: number;
|
|
2873
|
+
emailHeader: {
|
|
2874
|
+
senderName: string;
|
|
2875
|
+
subject: string;
|
|
2876
|
+
};
|
|
2877
|
+
savedModulesFolderName: string;
|
|
2878
|
+
defaultModulesFolderName: string;
|
|
2879
|
+
};
|
|
2880
|
+
ui: {
|
|
2881
|
+
showHeader: boolean;
|
|
2882
|
+
backButtonLabel?: string | undefined;
|
|
2883
|
+
externalDisplayConditions: boolean;
|
|
2719
2884
|
};
|
|
2720
2885
|
features: {
|
|
2721
2886
|
dynamicContent: boolean;
|
|
@@ -2863,6 +3028,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2863
3028
|
ui: {
|
|
2864
3029
|
showHeader: boolean;
|
|
2865
3030
|
backButtonLabel?: string | undefined;
|
|
3031
|
+
externalDisplayConditions: boolean;
|
|
2866
3032
|
};
|
|
2867
3033
|
features: {
|
|
2868
3034
|
dynamicContent: boolean;
|