@useinsider/guido 3.1.1-beta.e2f9e0a → 3.1.1-beta.e4aa789
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 +9 -7
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useHtmlCompiler.js +18 -16
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useSave.js +23 -17
- package/dist/composables/useStripo.js +44 -41
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +158 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +49 -46
- package/dist/enums/displayConditions.js +82 -78
- package/dist/enums/extensions/recommendationBlock.js +96 -39
- package/dist/enums/recommendation.js +2 -2
- package/dist/enums/unsubscribe.js +17 -16
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -3
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +12 -14
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/displayConditions.d.ts +5 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +8 -1
- package/dist/src/enums/unsubscribe.d.ts +8 -3
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/utils/genericUtil.js +42 -20
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useHttp as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useConfig as w } from "../composables/useConfig.js";
|
|
2
|
+
import { useHttp as b } from "../composables/useHttp.js";
|
|
3
|
+
import { useToaster as h } from "../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as C } from "../composables/useTranslations.js";
|
|
5
|
+
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
|
+
import { EditorType as v } from "../enums/defaults.js";
|
|
7
|
+
import { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
+
import { useSaveAsTemplateStore as x } from "../stores/save-as-template.js";
|
|
9
|
+
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
10
|
+
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
11
|
+
const $ = () => {
|
|
12
|
+
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = h(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = C();
|
|
12
13
|
return {
|
|
13
14
|
getCategories: async () => {
|
|
14
15
|
try {
|
|
@@ -26,7 +27,7 @@ const R = () => {
|
|
|
26
27
|
},
|
|
27
28
|
createCategory: async (e) => {
|
|
28
29
|
try {
|
|
29
|
-
const { data: { id: t } } = await
|
|
30
|
+
const { data: { id: t } } = await m(
|
|
30
31
|
"/newsletter/template-library/create-category",
|
|
31
32
|
{ name: e }
|
|
32
33
|
);
|
|
@@ -36,55 +37,56 @@ const R = () => {
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
createTemplate: async () => {
|
|
39
|
-
var e, t,
|
|
40
|
+
var e, t, d, y;
|
|
40
41
|
try {
|
|
41
|
-
const { prepareTemplateDetails:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const { prepareTemplateDetails: i } = A(), s = x(), a = await i();
|
|
43
|
+
if (p("liquidSyntax") && !await g(a.compiledHtml))
|
|
44
|
+
return !1;
|
|
45
|
+
const f = {
|
|
46
|
+
name: s.getTemplateName,
|
|
47
|
+
categories: s.getSelectedCategoryIds,
|
|
48
|
+
productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
49
|
+
editorType: v,
|
|
50
|
+
messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
51
|
+
content: r(a.compiledHtml),
|
|
52
|
+
css: r(a.css),
|
|
49
53
|
unsubscriptionPreferencePageStatus: !1,
|
|
50
54
|
unsubscriptionPreferencePages: [],
|
|
51
|
-
recommendationCampaignUrls:
|
|
52
|
-
|
|
55
|
+
recommendationCampaignUrls: r(
|
|
56
|
+
N().recommendationCampaignUrls
|
|
53
57
|
),
|
|
54
|
-
recommendationConfigs:
|
|
58
|
+
recommendationConfigs: r({}),
|
|
55
59
|
isGuido: !0,
|
|
56
|
-
|
|
60
|
+
// eslint-disable-next-line camelcase
|
|
61
|
+
template_engine: p("liquidSyntax") ? 1 : 0,
|
|
62
|
+
stripoConfig: r({
|
|
57
63
|
editor: "stripo",
|
|
58
|
-
html:
|
|
59
|
-
css:
|
|
64
|
+
html: a.rawHtml,
|
|
65
|
+
css: a.css
|
|
60
66
|
})
|
|
61
|
-
}, { data: { type:
|
|
67
|
+
}, { data: { type: T } } = await m(
|
|
62
68
|
"/newsletter/template-library/create-template",
|
|
63
|
-
|
|
69
|
+
f
|
|
64
70
|
);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
i({
|
|
76
|
-
message: p(
|
|
71
|
+
return T === "alert" ? (l({
|
|
72
|
+
message: u(
|
|
73
|
+
"newsletter.template-library-save-alert",
|
|
74
|
+
{ templateName: s.getTemplateName }
|
|
75
|
+
),
|
|
76
|
+
type: "alert"
|
|
77
|
+
}), !1) : (l({
|
|
78
|
+
message: u(
|
|
77
79
|
"newsletter.template-library-save-success",
|
|
78
|
-
{ templateName:
|
|
80
|
+
{ templateName: s.getTemplateName }
|
|
79
81
|
),
|
|
80
82
|
type: "success"
|
|
81
|
-
});
|
|
82
|
-
} catch (
|
|
83
|
-
o(
|
|
83
|
+
}), !0);
|
|
84
|
+
} catch (i) {
|
|
85
|
+
return o(i, "Failed to create template"), !1;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
89
|
};
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
$ as useTemplateLibraryApi
|
|
90
92
|
};
|
|
@@ -176,6 +176,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
176
176
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
177
177
|
/** Disable modules panel in the editor */
|
|
178
178
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
|
+
/** Enable Liquid template syntax */
|
|
180
|
+
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
181
|
}, undefined>;
|
|
180
182
|
/**
|
|
181
183
|
* Default block types available in Stripo
|
|
@@ -497,6 +499,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
497
499
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
498
500
|
/** Disable modules panel in the editor */
|
|
499
501
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
502
|
+
/** Enable Liquid template syntax */
|
|
503
|
+
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
500
504
|
}, undefined>, {}>;
|
|
501
505
|
/** Block configuration */
|
|
502
506
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -61,6 +61,7 @@ export declare const useConfig: () => {
|
|
|
61
61
|
displayConditions: boolean;
|
|
62
62
|
unsubscribe: boolean;
|
|
63
63
|
modulesDisabled: boolean;
|
|
64
|
+
liquidSyntax: boolean;
|
|
64
65
|
};
|
|
65
66
|
blocks: {
|
|
66
67
|
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")[];
|
|
@@ -157,6 +158,7 @@ export declare const useConfig: () => {
|
|
|
157
158
|
displayConditions: boolean;
|
|
158
159
|
unsubscribe: boolean;
|
|
159
160
|
modulesDisabled: boolean;
|
|
161
|
+
liquidSyntax: boolean;
|
|
160
162
|
} | null>;
|
|
161
163
|
blocks: import("vue").ComputedRef<{
|
|
162
164
|
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")[];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param alignment - Currency alignment from block config: 'before' or 'after'
|
|
7
7
|
* @returns Formatted price string with currency variable in correct position
|
|
8
8
|
*/
|
|
9
|
-
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string): string;
|
|
9
|
+
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string, prefix?: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* Transforms recommendation block HTML by replacing product data with
|
|
12
12
|
* template variables.
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { ConditionCategories } from '@@/Types/condition-categories';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Get display conditions lazily so translations resolve at access time.
|
|
4
|
+
* Must be called within a Vue component context or after Pinia is initialized.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getDisplayConditions: () => ConditionCategories;
|
|
@@ -3,7 +3,14 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const QUERY_PARAMS: {
|
|
7
|
+
CLIENT_ID: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Get recommendation feed source maps lazily so translated names resolve at access time.
|
|
11
|
+
* Must be called within a Vue component context or after Pinia is initialized.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getRecommendationFeedSourceMaps: () => RecommendationFeedItem[];
|
|
7
14
|
export declare const PriceAttributes: string[];
|
|
8
15
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
9
16
|
export declare const currencyOperators: TextValueObject[];
|
|
@@ -13,9 +13,14 @@ export declare const URLS: {
|
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const INSIDER_ID = "iid";
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export declare const DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID = "G";
|
|
17
|
+
/**
|
|
18
|
+
* Get the default unsubscribe group lazily so the translated name resolves at access time.
|
|
19
|
+
* Must be called within a Vue component context or after Pinia is initialized.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getDefaultUnsubscribeGroup: () => {
|
|
22
|
+
name: string;
|
|
23
|
+
sendGridId: string;
|
|
19
24
|
};
|
|
20
25
|
export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
|
|
21
26
|
export declare const PAGE_TYPES: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const COUPON_PLACEHOLDER_DEFAULT = "{@COUPON_CODE}";
|
|
2
|
+
export declare const COUPON_PLACEHOLDER_LIQUID = "{{ins_coupon_code}}";
|
|
1
3
|
declare const migrationTemplate = "\n <td\n class=\"coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block\"\n esd-extension-block-id=\"coupon-block\"\n >\n <p class=\"ins-title\" contenteditable=\"false\">{@COUPON_CODE}</p>\n </td>\n";
|
|
2
4
|
export declare function getDefaultTemplate(): string;
|
|
3
5
|
export default migrationTemplate;
|
|
@@ -3,5 +3,5 @@ export declare const useTemplateLibraryApi: () => {
|
|
|
3
3
|
getCategories: () => Promise<Category[]>;
|
|
4
4
|
checkTemplateNameAvailability: (value: string) => Promise<boolean>;
|
|
5
5
|
createCategory: (category: string) => Promise<string>;
|
|
6
|
-
createTemplate: () => Promise<
|
|
6
|
+
createTemplate: () => Promise<boolean>;
|
|
7
7
|
};
|
|
@@ -66,6 +66,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
66
66
|
displayConditions: boolean;
|
|
67
67
|
unsubscribe: boolean;
|
|
68
68
|
modulesDisabled: boolean;
|
|
69
|
+
liquidSyntax: boolean;
|
|
69
70
|
};
|
|
70
71
|
blocks: {
|
|
71
72
|
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")[];
|
|
@@ -168,6 +169,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
168
169
|
displayConditions: boolean;
|
|
169
170
|
unsubscribe: boolean;
|
|
170
171
|
modulesDisabled: boolean;
|
|
172
|
+
liquidSyntax: boolean;
|
|
171
173
|
};
|
|
172
174
|
blocks: {
|
|
173
175
|
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")[];
|
|
@@ -270,6 +272,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
270
272
|
displayConditions: boolean;
|
|
271
273
|
unsubscribe: boolean;
|
|
272
274
|
modulesDisabled: boolean;
|
|
275
|
+
liquidSyntax: boolean;
|
|
273
276
|
};
|
|
274
277
|
blocks: {
|
|
275
278
|
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")[];
|
|
@@ -372,6 +375,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
372
375
|
displayConditions: boolean;
|
|
373
376
|
unsubscribe: boolean;
|
|
374
377
|
modulesDisabled: boolean;
|
|
378
|
+
liquidSyntax: boolean;
|
|
375
379
|
};
|
|
376
380
|
blocks: {
|
|
377
381
|
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")[];
|
|
@@ -474,6 +478,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
474
478
|
displayConditions: boolean;
|
|
475
479
|
unsubscribe: boolean;
|
|
476
480
|
modulesDisabled: boolean;
|
|
481
|
+
liquidSyntax: boolean;
|
|
477
482
|
};
|
|
478
483
|
blocks: {
|
|
479
484
|
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")[];
|
|
@@ -576,6 +581,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
576
581
|
displayConditions: boolean;
|
|
577
582
|
unsubscribe: boolean;
|
|
578
583
|
modulesDisabled: boolean;
|
|
584
|
+
liquidSyntax: boolean;
|
|
579
585
|
};
|
|
580
586
|
blocks: {
|
|
581
587
|
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")[];
|
|
@@ -678,6 +684,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
678
684
|
displayConditions: boolean;
|
|
679
685
|
unsubscribe: boolean;
|
|
680
686
|
modulesDisabled: boolean;
|
|
687
|
+
liquidSyntax: boolean;
|
|
681
688
|
};
|
|
682
689
|
blocks: {
|
|
683
690
|
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")[];
|
|
@@ -780,6 +787,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
780
787
|
displayConditions: boolean;
|
|
781
788
|
unsubscribe: boolean;
|
|
782
789
|
modulesDisabled: boolean;
|
|
790
|
+
liquidSyntax: boolean;
|
|
783
791
|
};
|
|
784
792
|
blocks: {
|
|
785
793
|
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")[];
|
|
@@ -882,6 +890,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
882
890
|
displayConditions: boolean;
|
|
883
891
|
unsubscribe: boolean;
|
|
884
892
|
modulesDisabled: boolean;
|
|
893
|
+
liquidSyntax: boolean;
|
|
885
894
|
};
|
|
886
895
|
blocks: {
|
|
887
896
|
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")[];
|
|
@@ -984,6 +993,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
984
993
|
displayConditions: boolean;
|
|
985
994
|
unsubscribe: boolean;
|
|
986
995
|
modulesDisabled: boolean;
|
|
996
|
+
liquidSyntax: boolean;
|
|
987
997
|
};
|
|
988
998
|
blocks: {
|
|
989
999
|
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")[];
|
|
@@ -1086,6 +1096,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1086
1096
|
displayConditions: boolean;
|
|
1087
1097
|
unsubscribe: boolean;
|
|
1088
1098
|
modulesDisabled: boolean;
|
|
1099
|
+
liquidSyntax: boolean;
|
|
1089
1100
|
};
|
|
1090
1101
|
blocks: {
|
|
1091
1102
|
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")[];
|
|
@@ -1188,6 +1199,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1188
1199
|
displayConditions: boolean;
|
|
1189
1200
|
unsubscribe: boolean;
|
|
1190
1201
|
modulesDisabled: boolean;
|
|
1202
|
+
liquidSyntax: boolean;
|
|
1191
1203
|
};
|
|
1192
1204
|
blocks: {
|
|
1193
1205
|
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")[];
|
|
@@ -1290,6 +1302,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1290
1302
|
displayConditions: boolean;
|
|
1291
1303
|
unsubscribe: boolean;
|
|
1292
1304
|
modulesDisabled: boolean;
|
|
1305
|
+
liquidSyntax: boolean;
|
|
1293
1306
|
};
|
|
1294
1307
|
blocks: {
|
|
1295
1308
|
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")[];
|
|
@@ -1392,6 +1405,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1392
1405
|
displayConditions: boolean;
|
|
1393
1406
|
unsubscribe: boolean;
|
|
1394
1407
|
modulesDisabled: boolean;
|
|
1408
|
+
liquidSyntax: boolean;
|
|
1395
1409
|
};
|
|
1396
1410
|
blocks: {
|
|
1397
1411
|
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")[];
|
|
@@ -1494,6 +1508,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1494
1508
|
displayConditions: boolean;
|
|
1495
1509
|
unsubscribe: boolean;
|
|
1496
1510
|
modulesDisabled: boolean;
|
|
1511
|
+
liquidSyntax: boolean;
|
|
1497
1512
|
};
|
|
1498
1513
|
blocks: {
|
|
1499
1514
|
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")[];
|
|
@@ -1596,6 +1611,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1596
1611
|
displayConditions: boolean;
|
|
1597
1612
|
unsubscribe: boolean;
|
|
1598
1613
|
modulesDisabled: boolean;
|
|
1614
|
+
liquidSyntax: boolean;
|
|
1599
1615
|
};
|
|
1600
1616
|
blocks: {
|
|
1601
1617
|
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")[];
|
|
@@ -1698,6 +1714,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1698
1714
|
displayConditions: boolean;
|
|
1699
1715
|
unsubscribe: boolean;
|
|
1700
1716
|
modulesDisabled: boolean;
|
|
1717
|
+
liquidSyntax: boolean;
|
|
1701
1718
|
};
|
|
1702
1719
|
blocks: {
|
|
1703
1720
|
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")[];
|
|
@@ -1800,6 +1817,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1800
1817
|
displayConditions: boolean;
|
|
1801
1818
|
unsubscribe: boolean;
|
|
1802
1819
|
modulesDisabled: boolean;
|
|
1820
|
+
liquidSyntax: boolean;
|
|
1803
1821
|
};
|
|
1804
1822
|
blocks: {
|
|
1805
1823
|
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")[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DynamicContent, MergeTag } from '@@/Types/generic';
|
|
2
2
|
export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
|
|
3
|
-
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[]) => MergeTag[];
|
|
3
|
+
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
|
|
4
4
|
export declare const getCsrfToken: () => string;
|
|
5
5
|
/**
|
|
6
6
|
* URL Parameter utilities
|
|
@@ -1,25 +1,47 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
text:
|
|
4
|
-
value:
|
|
1
|
+
const s = (e) => {
|
|
2
|
+
const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, c = {
|
|
3
|
+
text: e.label,
|
|
4
|
+
value: n || ""
|
|
5
5
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [, l,
|
|
8
|
-
|
|
6
|
+
if (a.length >= 2) {
|
|
7
|
+
const [, l, r] = a;
|
|
8
|
+
if (l.startsWith("default:")) {
|
|
9
|
+
let t = l.slice(8).trim();
|
|
10
|
+
t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
|
|
11
|
+
} else {
|
|
12
|
+
const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
|
|
13
|
+
t ? c.format = t : r || (c.fallback = l), r && (c.fallback = r);
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return c;
|
|
17
|
+
}, u = (e, f = !1) => e.map((a) => {
|
|
18
|
+
if (a.format)
|
|
19
|
+
return {
|
|
20
|
+
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
21
|
+
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
22
|
+
};
|
|
23
|
+
if (f) {
|
|
24
|
+
if (!a.fallback)
|
|
25
|
+
return {
|
|
26
|
+
label: a.text,
|
|
27
|
+
value: `{{ ${a.value} }}`
|
|
28
|
+
};
|
|
29
|
+
const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
|
+
return {
|
|
31
|
+
label: `${a.text} | ${a.fallback}`,
|
|
32
|
+
value: `{{ ${a.value} | default: ${c} }}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
|
+
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
|
+
};
|
|
39
|
+
}), o = () => {
|
|
40
|
+
var e;
|
|
41
|
+
return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
|
|
20
42
|
};
|
|
21
43
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
u as dynamicContentToMergeTags,
|
|
45
|
+
o as getCsrfToken,
|
|
46
|
+
s as mergeTagToDynamicContent
|
|
25
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.e4aa789",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|