@useinsider/guido 1.4.4-beta.c341e0d → 1.4.4-beta.dc62a4d
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 +664 -295
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +92 -64
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +15 -18
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +28 -25
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +19 -22
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
- package/dist/composables/useBlocksConfig.js +20 -23
- package/dist/composables/useConfig.js +5 -51
- package/dist/composables/useGuidoActions.js +28 -18
- package/dist/composables/useHtmlCompiler.js +19 -20
- package/dist/composables/useHtmlValidator.js +41 -41
- package/dist/composables/usePartner.js +9 -19
- package/dist/composables/useStripo.js +11 -11
- package/dist/composables/useTranslations.js +2 -3
- package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
- package/dist/enums/defaults.js +67 -3
- package/dist/enums/unsubscribe.js +20 -23
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +11 -12
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/guido.css +1 -1
- package/dist/library.js +2 -12
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/node_modules/valibot/dist/index.js +103 -476
- package/dist/services/templateLibraryApi.js +18 -18
- package/dist/src/@types/generic.d.ts +45 -4
- package/dist/src/components/Guido.vue.d.ts +13 -13
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +2 -184
- package/dist/src/composables/useGuidoActions.d.ts +10 -0
- package/dist/src/composables/usePartner.d.ts +0 -8
- package/dist/src/enums/defaults.d.ts +6 -4
- package/dist/src/enums/unsubscribe.d.ts +1 -5
- package/dist/src/library.d.ts +1 -3
- package/dist/src/stores/config.d.ts +102 -1547
- package/dist/stores/config.js +9 -141
- package/package.json +1 -1
- package/dist/@types/config/defaults.js +0 -44
- package/dist/@types/config/schemas.js +0 -229
- package/dist/@types/config/validator.js +0 -56
- package/dist/src/@types/config/defaults.d.ts +0 -68
- package/dist/src/@types/config/index.d.ts +0 -14
- package/dist/src/@types/config/schemas.d.ts +0 -505
- package/dist/src/@types/config/types.d.ts +0 -142
- package/dist/src/@types/config/validator.d.ts +0 -119
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { PAGE_TYPES as l, ACADEMY_LINK as
|
|
7
|
-
import { useUnsubscribeStore as
|
|
8
|
-
import { InSegments as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as h, ref as b, computed as m, watch as _ } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useToaster as B } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as N } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as U } from "../../../enums/toaster.js";
|
|
6
|
+
import { PAGE_TYPES as l, ACADEMY_LINK as w, UNSUBSCRIBE_PAGES_LINK as P, TYPE_TRANSLATIONS as R } from "../../../enums/unsubscribe.js";
|
|
7
|
+
import { useUnsubscribeStore as D } from "../../../stores/unsubscribe.js";
|
|
8
|
+
import { InSegments as I } from "@useinsider/design-system-vue";
|
|
9
|
+
const z = /* @__PURE__ */ h({
|
|
10
10
|
__name: "UnsubscribeTypeSelection",
|
|
11
|
-
setup(
|
|
12
|
-
const e =
|
|
11
|
+
setup(G) {
|
|
12
|
+
const e = N(), { showToaster: f } = B(), t = D(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
|
|
13
13
|
"unsubscription-preference.select-unsubscribe-page-description",
|
|
14
|
-
{ action: `<a href="${
|
|
14
|
+
{ action: `<a href="${w}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
|
|
15
15
|
), T = m(() => [
|
|
16
16
|
{
|
|
17
17
|
description: e("unsubscription-preference.type-global-unsubscribe-description"),
|
|
@@ -62,7 +62,7 @@ const K = /* @__PURE__ */ v({
|
|
|
62
62
|
p || r.push(Number(c));
|
|
63
63
|
}), r.length === 0)
|
|
64
64
|
return !0;
|
|
65
|
-
const
|
|
65
|
+
const a = r.map((c) => R[c]);
|
|
66
66
|
let u = "";
|
|
67
67
|
if (r.length === 1)
|
|
68
68
|
u = e("unsubscription-preference.create-page-to-continue", {
|
|
@@ -81,12 +81,12 @@ const K = /* @__PURE__ */ v({
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
return f({
|
|
84
|
-
type:
|
|
84
|
+
type: U.Warning,
|
|
85
85
|
message: u,
|
|
86
86
|
actionButton: {
|
|
87
87
|
text: "Go to Unsubscribe Pages",
|
|
88
88
|
onClick: () => {
|
|
89
|
-
window.location.href =
|
|
89
|
+
window.location.href = P;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}), !1;
|
|
@@ -99,9 +99,9 @@ const K = /* @__PURE__ */ v({
|
|
|
99
99
|
};
|
|
100
100
|
return _(() => t.typeSelectionDrawerStatus, (s) => {
|
|
101
101
|
s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
|
|
102
|
-
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer:
|
|
102
|
+
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: v, InSegments: I };
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
z as default
|
|
107
107
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var s
|
|
5
|
-
var e = this,
|
|
6
|
-
return (
|
|
7
|
-
},
|
|
1
|
+
import o from "./UnsubscribeWrapper.vue2.js";
|
|
2
|
+
import t from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var _ = function() {
|
|
4
|
+
var s;
|
|
5
|
+
var e = this, n = e._self._c, r = e._self._setupProxy;
|
|
6
|
+
return (s = r.config.extensions) != null && s.unsubscribe ? n("div", [n(r.UnsubscribeTypeSelection), n(r.UnsubscribePageSelection)], 1) : e._e();
|
|
7
|
+
}, c = [], i = /* @__PURE__ */ t(
|
|
8
|
+
o,
|
|
8
9
|
_,
|
|
9
10
|
c,
|
|
10
|
-
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
13
|
null
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const l = i.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
l as default
|
|
18
18
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const r = {
|
|
1
|
+
const l = {
|
|
3
2
|
"amp-accordion": "ampAccordionEnabled",
|
|
4
3
|
"amp-carousel": "ampCarouselEnabled",
|
|
5
4
|
"amp-form-controls": "ampFormControlsEnabled",
|
|
@@ -24,28 +23,26 @@ const r = {
|
|
|
24
23
|
}, a = (n) => {
|
|
25
24
|
if (!n || !n.length)
|
|
26
25
|
return {};
|
|
27
|
-
const
|
|
28
|
-
return n.forEach((
|
|
29
|
-
const t =
|
|
30
|
-
t && (
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
n.map(async (
|
|
34
|
-
const t = c[
|
|
26
|
+
const o = {};
|
|
27
|
+
return n.forEach((e) => {
|
|
28
|
+
const t = l[e];
|
|
29
|
+
t && (o[t] = !1);
|
|
30
|
+
}), o;
|
|
31
|
+
}, r = async (n) => !n || !n.length ? [] : (await Promise.all(
|
|
32
|
+
n.map(async (e) => {
|
|
33
|
+
const t = c[e];
|
|
35
34
|
return t ? (await t()).default : null;
|
|
36
35
|
})
|
|
37
|
-
)).filter((
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
};
|
|
36
|
+
)).filter((e) => e !== null), s = () => ({
|
|
37
|
+
getStripoBlocksConfig: async () => {
|
|
38
|
+
var e;
|
|
39
|
+
const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
|
|
40
|
+
return {
|
|
41
|
+
baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
|
|
42
|
+
extensions: await r(o == null ? void 0 : o.includeCustoms)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
49
46
|
export {
|
|
50
|
-
|
|
47
|
+
s as useBlocksConfig
|
|
51
48
|
};
|
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
config: t,
|
|
6
|
-
initialized: o,
|
|
7
|
-
identity: r,
|
|
8
|
-
partner: i,
|
|
9
|
-
template: n,
|
|
10
|
-
editor: a,
|
|
11
|
-
ui: s,
|
|
12
|
-
features: u,
|
|
13
|
-
blocks: d,
|
|
14
|
-
compiler: p,
|
|
15
|
-
templateId: c,
|
|
16
|
-
userId: f,
|
|
17
|
-
variationId: m,
|
|
18
|
-
partnerName: g,
|
|
19
|
-
productType: l,
|
|
20
|
-
messageType: b,
|
|
21
|
-
username: C,
|
|
22
|
-
showHeader: y
|
|
23
|
-
} = I(e);
|
|
24
|
-
return {
|
|
25
|
-
// State refs
|
|
26
|
-
config: t,
|
|
27
|
-
initialized: o,
|
|
28
|
-
// Section refs
|
|
29
|
-
identity: r,
|
|
30
|
-
partner: i,
|
|
31
|
-
template: n,
|
|
32
|
-
editor: a,
|
|
33
|
-
ui: s,
|
|
34
|
-
features: u,
|
|
35
|
-
blocks: d,
|
|
36
|
-
compiler: p,
|
|
37
|
-
// Convenience refs
|
|
38
|
-
templateId: c,
|
|
39
|
-
userId: f,
|
|
40
|
-
variationId: m,
|
|
41
|
-
partnerName: g,
|
|
42
|
-
productType: l,
|
|
43
|
-
messageType: b,
|
|
44
|
-
username: C,
|
|
45
|
-
showHeader: y,
|
|
46
|
-
// Methods
|
|
47
|
-
getConfig: () => t.value,
|
|
48
|
-
isFeatureEnabled: (E) => e.isFeatureEnabled(E)
|
|
49
|
-
};
|
|
50
|
-
};
|
|
1
|
+
import { DefaultGuidoConfig as o } from "../enums/defaults.js";
|
|
2
|
+
const t = () => ({
|
|
3
|
+
config: typeof window > "u" ? o : window.GuidoConfig || o
|
|
4
|
+
});
|
|
51
5
|
export {
|
|
52
|
-
|
|
6
|
+
t as useConfig
|
|
53
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { provideValue as o, useInjectedValue as
|
|
2
|
-
const
|
|
3
|
-
o(
|
|
4
|
-
},
|
|
1
|
+
import { provideValue as o, useInjectedValue as r } from "./useProvideInject.js";
|
|
2
|
+
const t = Symbol.for("guido.back"), n = Symbol.for("guido.save.before"), a = Symbol.for("guido.save.start"), c = Symbol.for("guido.save.complete"), s = Symbol.for("guido.test.email.click"), u = (e) => {
|
|
3
|
+
o(t, e.onBack), o(n, e.onSaveBefore), o(a, e.onSaveStart), o(c, e.onSaveComplete), o(s, e.onTestEmailClick);
|
|
4
|
+
}, d = () => {
|
|
5
5
|
try {
|
|
6
|
-
return t
|
|
6
|
+
return r(t);
|
|
7
7
|
} catch {
|
|
8
8
|
throw new Error(
|
|
9
9
|
"useBack: No back handler provided. Make sure Guido component is in the component tree."
|
|
@@ -11,23 +11,31 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), c = Symb
|
|
|
11
11
|
}
|
|
12
12
|
}, l = () => {
|
|
13
13
|
try {
|
|
14
|
-
return
|
|
14
|
+
return r(n);
|
|
15
|
+
} catch {
|
|
16
|
+
throw new Error(
|
|
17
|
+
"useSaveBefore: No save before handler provided. Make sure Guido component is in the component tree."
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}, m = () => {
|
|
21
|
+
try {
|
|
22
|
+
return r(a);
|
|
15
23
|
} catch {
|
|
16
24
|
throw new Error(
|
|
17
25
|
"useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
|
|
18
26
|
);
|
|
19
27
|
}
|
|
20
|
-
},
|
|
28
|
+
}, p = () => {
|
|
21
29
|
try {
|
|
22
|
-
return
|
|
30
|
+
return r(c);
|
|
23
31
|
} catch {
|
|
24
32
|
throw new Error(
|
|
25
33
|
"useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
|
|
26
34
|
);
|
|
27
35
|
}
|
|
28
|
-
},
|
|
36
|
+
}, v = () => {
|
|
29
37
|
try {
|
|
30
|
-
return
|
|
38
|
+
return r(s);
|
|
31
39
|
} catch {
|
|
32
40
|
throw new Error(
|
|
33
41
|
"useTestEmailClick: No test email click handler provided. Make sure Guido component is in the component tree."
|
|
@@ -35,13 +43,15 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), c = Symb
|
|
|
35
43
|
}
|
|
36
44
|
};
|
|
37
45
|
export {
|
|
38
|
-
|
|
46
|
+
t as BACK_KEY,
|
|
47
|
+
n as SAVE_BEFORE_KEY,
|
|
39
48
|
c as SAVE_COMPLETE_KEY,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
m as
|
|
49
|
+
a as SAVE_START_KEY,
|
|
50
|
+
s as TEST_EMAIL_CLICK_KEY,
|
|
51
|
+
u as provideGuidoActions,
|
|
52
|
+
d as useBack,
|
|
53
|
+
l as useSaveBefore,
|
|
54
|
+
p as useSaveComplete,
|
|
55
|
+
m as useSaveStart,
|
|
56
|
+
v as useTestEmailClick
|
|
47
57
|
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { outlookCompilerRules as
|
|
4
|
-
import { recommendationCompilerRules as
|
|
5
|
-
import { socialCompilerRules as
|
|
6
|
-
import { unsubscribeCompilerRules as
|
|
7
|
-
import { createHtmlCompiler as
|
|
8
|
-
import { useConfig as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...!!((l = e.value) != null && l.ignoreDefaultRules) ? [] : p,
|
|
13
|
-
...n,
|
|
14
|
-
...R,
|
|
1
|
+
import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as p } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { outlookCompilerRules as s } from "../config/compiler/outlookCompilerRules.js";
|
|
4
|
+
import { recommendationCompilerRules as u } from "../config/compiler/recommendationCompilerRules.js";
|
|
5
|
+
import { socialCompilerRules as n } from "../config/compiler/socialCompilerRules.js";
|
|
6
|
+
import { unsubscribeCompilerRules as c } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
7
|
+
import { createHtmlCompiler as f } from "../utils/htmlCompiler.js";
|
|
8
|
+
import { useConfig as R } from "./useConfig.js";
|
|
9
|
+
const x = () => {
|
|
10
|
+
const { config: e } = R(), m = e.htmlCompilerRules || [], l = [
|
|
11
|
+
...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
|
|
15
12
|
...u,
|
|
16
13
|
...c,
|
|
17
|
-
...
|
|
18
|
-
...
|
|
14
|
+
...p,
|
|
15
|
+
...s,
|
|
16
|
+
...n,
|
|
17
|
+
...m.map((o, i) => ({
|
|
19
18
|
...o,
|
|
20
|
-
priority: o.priority + 1e3 +
|
|
19
|
+
priority: o.priority + 1e3 + i
|
|
21
20
|
// Ensure additional rules run after default rules
|
|
22
21
|
}))
|
|
23
|
-
],
|
|
24
|
-
return { compileHtml: (o) =>
|
|
22
|
+
], r = f(l);
|
|
23
|
+
return { compileHtml: (o) => r.compile(o) };
|
|
25
24
|
};
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
x as useHtmlCompiler
|
|
28
27
|
};
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
1
|
+
import { useConfig as V } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as D } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
|
|
4
4
|
import { ToasterTypeOptions as l } from "../enums/toaster.js";
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import { useRecommendationStore as
|
|
7
|
-
import { base64EncodeWithSpecialChars as
|
|
8
|
-
import { useHttp as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
const
|
|
12
|
-
var d
|
|
13
|
-
const { showToaster: c } =
|
|
14
|
-
const t = await
|
|
5
|
+
import { itemsBlockDynamicVariables as G } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationStore as $ } from "../stores/recommendation.js";
|
|
7
|
+
import { base64EncodeWithSpecialChars as j } from "../utils/base64.js";
|
|
8
|
+
import { useHttp as q } from "./useHttp.js";
|
|
9
|
+
import { useToaster as M } from "./useToaster.js";
|
|
10
|
+
import { useTranslations as X } from "./useTranslations.js";
|
|
11
|
+
const ie = () => {
|
|
12
|
+
var d;
|
|
13
|
+
const { showToaster: c } = M(), { post: y } = q(), { config: h } = V(), a = X(), m = $(), u = ((d = h.partner) == null ? void 0 : d.messageType) === D.transactional, v = async (e) => {
|
|
14
|
+
const t = await y(
|
|
15
15
|
"/newsletter/template-library/check-template-html-body",
|
|
16
|
-
{ html:
|
|
16
|
+
{ html: j(e) }
|
|
17
17
|
), { status: n, message: r } = t.data;
|
|
18
18
|
return n || c({
|
|
19
19
|
type: l.Alert,
|
|
20
20
|
message: n === void 0 ? r : a("newsletter.invalid-url-link-for-toaster")
|
|
21
|
-
}), a(
|
|
21
|
+
}), a(R), r === a(_) && c({
|
|
22
22
|
type: l.Alert,
|
|
23
23
|
message: a("newsletter.already-in-progress")
|
|
24
24
|
}), n;
|
|
25
|
-
},
|
|
25
|
+
}, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), w = (e) => ["if", "endif"].includes(e.toLowerCase()), S = (e, s) => {
|
|
26
26
|
const t = e.match(/({%(.*?)%})/g);
|
|
27
27
|
let n = !0;
|
|
28
28
|
return t !== null && !u && t.forEach((r) => {
|
|
29
29
|
const i = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
30
30
|
if (i && i.length > 0) {
|
|
31
31
|
const [o] = i;
|
|
32
|
-
|
|
32
|
+
C(o) && !s.includes(o) && (c({
|
|
33
33
|
type: l.Warning,
|
|
34
34
|
message: a("custom-fields.invalid-custom-fields")
|
|
35
35
|
}), n = !1);
|
|
36
36
|
}
|
|
37
37
|
}), n;
|
|
38
|
-
},
|
|
39
|
-
const n = t ? await
|
|
40
|
-
return
|
|
41
|
-
},
|
|
38
|
+
}, b = async (e, s, t) => {
|
|
39
|
+
const n = t ? await v(e) : !0;
|
|
40
|
+
return S(e, s) && n;
|
|
41
|
+
}, E = (e) => e.length > 0 ? !0 : (c({
|
|
42
42
|
type: l.Warning,
|
|
43
43
|
message: a("newsletter.html-content-is-empty")
|
|
44
|
-
}), !1),
|
|
44
|
+
}), !1), A = (e) => {
|
|
45
45
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
46
46
|
return s > t && c({
|
|
47
47
|
type: l.Warning,
|
|
@@ -50,13 +50,13 @@ const oe = () => {
|
|
|
50
50
|
type: l.Warning,
|
|
51
51
|
message: a("custom-fields.missing-opening-braces")
|
|
52
52
|
}), s === t;
|
|
53
|
-
},
|
|
53
|
+
}, x = (e) => {
|
|
54
54
|
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
55
55
|
return s || c({
|
|
56
56
|
type: l.Warning,
|
|
57
57
|
message: a("custom-fields.invalid-custom-fields")
|
|
58
58
|
}), s;
|
|
59
|
-
},
|
|
59
|
+
}, k = (e, s) => {
|
|
60
60
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
61
61
|
if (t && !u) {
|
|
62
62
|
const n = new Set(s.map((i) => i.toLowerCase())), r = [];
|
|
@@ -76,22 +76,22 @@ const oe = () => {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
return !0;
|
|
79
|
-
},
|
|
79
|
+
}, T = (e) => {
|
|
80
80
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
81
81
|
let n = !0;
|
|
82
82
|
if (s && s.forEach((r) => {
|
|
83
|
-
const i = r.match(
|
|
84
|
-
(!i || r !==
|
|
83
|
+
const i = r.match(H), o = r.match(P), B = (i == null ? void 0 : i.join("")) || "";
|
|
84
|
+
(!i || r !== B) && !o && (c({
|
|
85
85
|
type: l.Alert,
|
|
86
86
|
message: a("newsletter.display-conditions-invalid-syntax")
|
|
87
|
-
}), n = !1), i && i.forEach((
|
|
88
|
-
|
|
87
|
+
}), n = !1), i && i.forEach((f) => {
|
|
88
|
+
f.trim() === "=" && (c({
|
|
89
89
|
type: l.Alert,
|
|
90
90
|
message: a("custom-conditions.wrong-equality-operators")
|
|
91
91
|
}), n = !1);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const g = f.match(/^[a-zA-Z]*$/g);
|
|
93
|
+
g && g.forEach((p) => {
|
|
94
|
+
w(p) && t.push(p);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
}), t.length) {
|
|
@@ -102,25 +102,25 @@ const oe = () => {
|
|
|
102
102
|
}), n = !1);
|
|
103
103
|
}
|
|
104
104
|
return n;
|
|
105
|
-
},
|
|
105
|
+
}, F = (e) => {
|
|
106
106
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
107
107
|
return n || c({
|
|
108
108
|
type: l.Warning,
|
|
109
109
|
message: a("custom-conditions.no-space-after-braces")
|
|
110
110
|
}), n;
|
|
111
|
-
},
|
|
111
|
+
}, I = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (c({
|
|
112
112
|
type: l.Warning,
|
|
113
113
|
message: a("custom-conditions.no-braces-inside-if-tag")
|
|
114
|
-
}), !1) : !0,
|
|
114
|
+
}), !1) : !0, W = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (c({
|
|
115
115
|
type: l.Alert,
|
|
116
116
|
message: a("newsletter.fill-all-necessary-fields")
|
|
117
|
-
}), !1) : !0,
|
|
117
|
+
}), !1) : !0, L = (e) => {
|
|
118
118
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
119
119
|
return e.match(s) === null ? !0 : (c({
|
|
120
120
|
type: l.Alert,
|
|
121
121
|
message: a("newsletter.invalid-image-type")
|
|
122
122
|
}), !1);
|
|
123
|
-
},
|
|
123
|
+
}, N = (e) => {
|
|
124
124
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
125
125
|
return Array.from(n).find((i) => {
|
|
126
126
|
var o;
|
|
@@ -129,7 +129,7 @@ const oe = () => {
|
|
|
129
129
|
type: l.Alert,
|
|
130
130
|
message: a("unsubscribe-templates.select-checkbox-groups")
|
|
131
131
|
}), !1) : !0;
|
|
132
|
-
},
|
|
132
|
+
}, O = (e) => {
|
|
133
133
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
134
134
|
return Array.from(n).find((i) => {
|
|
135
135
|
var o;
|
|
@@ -140,10 +140,10 @@ const oe = () => {
|
|
|
140
140
|
}), !1) : !0;
|
|
141
141
|
};
|
|
142
142
|
return { validateHtml: async (e, s, t = !1) => {
|
|
143
|
-
const n = [...s.map((i) => i.value),
|
|
144
|
-
return await
|
|
143
|
+
const n = [...s.map((i) => i.value), ...G];
|
|
144
|
+
return await b(e, n, t) && E(e) && A(e) && x(e) && k(e, n) && T(e) && F(e) && I(e) && W() && L(e) && N(e) && O(e);
|
|
145
145
|
} };
|
|
146
146
|
};
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
ie as useHtmlValidator
|
|
149
149
|
};
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const T = () => {
|
|
5
|
-
const e = i(), n = () => e.initialized && e.partnerName ? e.partnerName : window.location.hostname.split(".")[0] || "";
|
|
1
|
+
import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
|
|
2
|
+
const i = () => {
|
|
3
|
+
const e = () => window.location.hostname.split(".")[0] || "";
|
|
6
4
|
return {
|
|
7
|
-
getPartnerName:
|
|
5
|
+
getPartnerName: e,
|
|
8
6
|
getProductType: () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const r = window.location.pathname.split("/").filter(Boolean)[0] || "email";
|
|
12
|
-
return {
|
|
13
|
-
email: t.EMAIL,
|
|
14
|
-
architect: t.ARCHITECT,
|
|
15
|
-
unsubscribePages: t.UNSUBSCRIBE_PAGES
|
|
16
|
-
}[r] || t.EMAIL;
|
|
7
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
|
|
8
|
+
return n[t] || 0;
|
|
17
9
|
},
|
|
18
|
-
getMessageType: () => e.initialized ? e.messageType : 1,
|
|
19
|
-
getUsername: () => e.initialized ? e.username : "Guido User",
|
|
20
10
|
isTestPartner: () => {
|
|
21
|
-
const
|
|
22
|
-
return
|
|
11
|
+
const t = e();
|
|
12
|
+
return r.includes(t);
|
|
23
13
|
}
|
|
24
14
|
};
|
|
25
15
|
};
|
|
26
16
|
export {
|
|
27
|
-
|
|
17
|
+
i as usePartner
|
|
28
18
|
};
|
|
@@ -7,19 +7,19 @@ import { useToaster as B } from "./useToaster.js";
|
|
|
7
7
|
import { displayConditions as T } from "../enums/displayConditions.js";
|
|
8
8
|
import { useStripoApi as A } from "../services/stripoApi.js";
|
|
9
9
|
import F from "../static/styles/customEditorStyle.css.js";
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { dynamicContentToMergeTags as
|
|
12
|
-
import
|
|
10
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
|
|
12
|
+
import v from "../package.json.js";
|
|
13
13
|
const J = (c) => {
|
|
14
|
-
const {
|
|
15
|
-
var m;
|
|
16
|
-
const t =
|
|
14
|
+
const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = A(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = b(), E = async (i, r = []) => {
|
|
15
|
+
var m, g;
|
|
16
|
+
const t = M(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: d } = await C();
|
|
17
17
|
window.UIEditor.initEditor(
|
|
18
18
|
document.querySelector("#guido-editor"),
|
|
19
19
|
{
|
|
20
20
|
metadata: c,
|
|
21
21
|
html: n,
|
|
22
|
-
css:
|
|
22
|
+
css: p,
|
|
23
23
|
forceRecreate: a,
|
|
24
24
|
locale: "en",
|
|
25
25
|
undoButtonSelector: "#guido__undo-button",
|
|
@@ -31,8 +31,8 @@ const J = (c) => {
|
|
|
31
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
33
|
customViewStyles: F,
|
|
34
|
-
conditionsEnabled:
|
|
35
|
-
customConditionsEnabled:
|
|
34
|
+
conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
|
|
35
|
+
customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
|
|
36
36
|
conditionCategories: T,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
38
|
messageSettingsEnabled: !0,
|
|
@@ -49,7 +49,7 @@ const J = (c) => {
|
|
|
49
49
|
},
|
|
50
50
|
mergeTags: [
|
|
51
51
|
{
|
|
52
|
-
entries:
|
|
52
|
+
entries: U(c.preselectedDynamicContentList)
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
async onTokenRefreshRequest(o) {
|
|
@@ -97,7 +97,7 @@ const J = (c) => {
|
|
|
97
97
|
i(), r();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const n =
|
|
100
|
+
const n = v.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
|
|
101
101
|
e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
|
|
102
102
|
i(), r();
|
|
103
103
|
}, e.onerror = () => {
|
|
@@ -2,11 +2,10 @@ import memoize from "../node_modules/lodash-es/memoize.js";
|
|
|
2
2
|
import { ref } from "vue";
|
|
3
3
|
import { useConfig } from "./useConfig.js";
|
|
4
4
|
const useTranslations = () => {
|
|
5
|
-
|
|
6
|
-
const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || "window.trans.en", translations = ref(eval(translationsPath)), trans = (n, t) => {
|
|
5
|
+
const { config } = useConfig(), translations = ref(eval(config.translationsPath)), trans = (n, t) => {
|
|
7
6
|
const r = translations.value[n];
|
|
8
7
|
return r ? t ? Object.entries(t).reduce(
|
|
9
|
-
(
|
|
8
|
+
(e, [o, s]) => e.replace(new RegExp(`{${o}}`, "g"), String(s)),
|
|
10
9
|
r
|
|
11
10
|
) : r : (console.warn(`Translation key not found: ${n}`), n);
|
|
12
11
|
};
|
|
@@ -10,7 +10,7 @@ const D = [
|
|
|
10
10
|
description: "Adding unsubscribe link values",
|
|
11
11
|
type: "custom",
|
|
12
12
|
processor: (t) => {
|
|
13
|
-
const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.
|
|
13
|
+
const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
|
|
14
14
|
if (!a)
|
|
15
15
|
return t;
|
|
16
16
|
let e = t;
|