@useinsider/guido 1.0.3-beta.538b804 → 1.0.3-beta.552f8c9
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 +32 -0
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +4 -4
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +41 -44
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useHtmlValidator.js +35 -36
- package/dist/enums/onboarding.js +2 -3
- package/dist/enums/unsubscribe.js +26 -27
- package/dist/extensions/Blocks/Items/block.js +26 -26
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +57 -151
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +1 -1
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +124 -165
- package/dist/extensions/Blocks/Items/enums/productEnums.js +5 -83
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +1 -7
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +56 -57
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +55 -54
- package/dist/extensions/Blocks/Items/settingsPanel.js +45 -71
- package/dist/extensions/Blocks/Items/template.js +59 -138
- package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +7 -20
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -7
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -8
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -9
- package/package.json +9 -2
- package/dist/config/compiler/itemsCompilerRules.js +0 -14
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/src/utils/pairProductVariables.d.ts +0 -7
- package/dist/utils/environmentUtil.js +0 -4
- package/dist/utils/pairProductVariables.js +0 -136
package/README.md
CHANGED
|
@@ -787,3 +787,35 @@ ISC License
|
|
|
787
787
|
- Playwright integrationBoilerplate/control.ts
|
|
788
788
|
- Commitlint & Precommit Hooks integration
|
|
789
789
|
- Get Pre-built display conditions from API
|
|
790
|
+
|
|
791
|
+
Recommendation Block:
|
|
792
|
+
- [ ] Validations for Filters
|
|
793
|
+
- [ ] DOM Rerender after Filters change
|
|
794
|
+
- [ ] Change currencySymbol as Input Type
|
|
795
|
+
- [ ] Apply filter query to request
|
|
796
|
+
- [ ] Drawer loading bug
|
|
797
|
+
- [ ] Drawer send request when apply filters
|
|
798
|
+
- [ ] Clear all feature for Drawer
|
|
799
|
+
- [ ] Stripo's controls should be effect specific DOM item -- Try extending CommonControl class
|
|
800
|
+
- [ ] Show toaster message if uses multiple recommendation blocks in same template
|
|
801
|
+
- [ ] Change filter button text as Change Filters
|
|
802
|
+
- [ ] Migration template for Recommendation Block
|
|
803
|
+
- [ ] Recommendation Algorithm default value should be mostPopular
|
|
804
|
+
- [ ] Default fields for empty template like currency, title etc.
|
|
805
|
+
- [ ] Recommendation Block Icon Registry should be updated
|
|
806
|
+
- [ ] AMP Block Icon should be updated
|
|
807
|
+
- [ ] Padding feature for between Product Rows
|
|
808
|
+
|
|
809
|
+
Items Block Phase 2:
|
|
810
|
+
[ ] Writing configs to esd-config-data DOM.
|
|
811
|
+
[ ] Build on save feature should be working
|
|
812
|
+
[ ] Data Migration feature should be working
|
|
813
|
+
|
|
814
|
+
Tech Debts:
|
|
815
|
+
[ ] Merge Custom Blocks into a single File
|
|
816
|
+
[ ] Move Custom Blocks names to an enum file
|
|
817
|
+
[ ] Template Replacement should be optimized for version history
|
|
818
|
+
[ ] Code Optimization for Items Block inner blocks reordering
|
|
819
|
+
[ ] Image Size & Margins controls has an error on console
|
|
820
|
+
[ ] Feed Text Trimming feature to toggle settings
|
|
821
|
+
[ ] Formatted Price feature to toggle settings
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import g from "./ItemsOnboarding.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import m from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
4
|
+
var c = function() {
|
|
5
5
|
var e, n, r, i, s, a;
|
|
6
6
|
var o = this, d = o._self._c, t = o._self._setupProxy;
|
|
7
7
|
return t.isVisible ? d(t.InOnboard, { key: "guido__items-onboard", staticClass: "w-21-s p-a z-11", class: (e = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__items-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : r.left, "pages-config": t.onboardingStore.onboardings.itemsOnboarding.config, "pointer-position": (i = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : i.position, "right-position": (s = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : s.right, "top-position": (a = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: t.handleBack, close: function(b) {
|
|
8
8
|
return t.onboardingStore.close("itemsOnboarding");
|
|
9
9
|
}, nextButtonClick: t.handleNext } }) : o._e();
|
|
10
|
-
},
|
|
10
|
+
}, l = [], p = /* @__PURE__ */ m(
|
|
11
11
|
g,
|
|
12
|
-
l,
|
|
13
12
|
c,
|
|
13
|
+
l,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
16
|
+
"c8bd3ee6"
|
|
17
17
|
);
|
|
18
18
|
const I = p.exports;
|
|
19
19
|
export {
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import {
|
|
4
|
-
import { useOnboardingStore as
|
|
5
|
-
import { InOnboard as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as u, computed as c, watch as d } from "vue";
|
|
2
|
+
import { useTranslations as b } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { UI_EDITOR_SELECTOR as l, CARD_COMPOSITION_TAB_SELECTOR as x, SETTINGS_TAB_SELECTOR as T } from "../../../enums/onboarding.js";
|
|
4
|
+
import { useOnboardingStore as k } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as B } from "@useinsider/design-system-vue";
|
|
6
|
+
const I = /* @__PURE__ */ u({
|
|
7
7
|
__name: "ItemsOnboarding",
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
}), n = (t) => `${t + c.value}px`, r = (t) => {
|
|
13
|
-
const i = document.querySelector(O);
|
|
14
|
-
if (!(i != null && i.shadowRoot))
|
|
8
|
+
setup(C) {
|
|
9
|
+
const i = b(), o = k(), r = (t) => {
|
|
10
|
+
const e = document.querySelector(l);
|
|
11
|
+
if (!(e != null && e.shadowRoot))
|
|
15
12
|
return;
|
|
16
|
-
const { shadowRoot:
|
|
17
|
-
|
|
18
|
-
},
|
|
13
|
+
const { shadowRoot: n } = e, a = n.querySelector(t);
|
|
14
|
+
a && a.click();
|
|
15
|
+
}, s = c(() => [
|
|
19
16
|
{
|
|
20
17
|
classes: "guido-items-onboarding-card-1",
|
|
21
18
|
right: "426px",
|
|
22
|
-
top:
|
|
19
|
+
top: "90px",
|
|
23
20
|
position: "Right Top",
|
|
24
|
-
title:
|
|
25
|
-
description:
|
|
21
|
+
title: i("email-editor.onboarding-items-title"),
|
|
22
|
+
description: i("email-editor.onboarding-items-description"),
|
|
26
23
|
imageSource: "",
|
|
27
24
|
backButtonClick: () => {
|
|
28
25
|
},
|
|
29
26
|
nextButtonType: "text",
|
|
30
|
-
nextButtonText:
|
|
27
|
+
nextButtonText: i("products.next"),
|
|
31
28
|
nextButtonClick: () => {
|
|
32
29
|
o.next("itemsOnboarding");
|
|
33
30
|
}
|
|
@@ -35,18 +32,18 @@ const E = /* @__PURE__ */ l({
|
|
|
35
32
|
{
|
|
36
33
|
classes: "guido-items-onboarding-card-2",
|
|
37
34
|
right: "426px",
|
|
38
|
-
top:
|
|
35
|
+
top: "218px",
|
|
39
36
|
position: "Right Top",
|
|
40
|
-
title:
|
|
41
|
-
description:
|
|
37
|
+
title: i("email-editor.onboarding-items-item-type-title"),
|
|
38
|
+
description: i("email-editor.onboarding-items-item-type-description"),
|
|
42
39
|
imageSource: "",
|
|
43
40
|
backButtonType: "text",
|
|
44
|
-
backButtonText:
|
|
41
|
+
backButtonText: i("ds-steps.back"),
|
|
45
42
|
backButtonClick: () => {
|
|
46
43
|
o.previous("itemsOnboarding");
|
|
47
44
|
},
|
|
48
45
|
nextButtonType: "text",
|
|
49
|
-
nextButtonText:
|
|
46
|
+
nextButtonText: i("products.next"),
|
|
50
47
|
nextButtonClick: () => {
|
|
51
48
|
o.next("itemsOnboarding");
|
|
52
49
|
}
|
|
@@ -54,46 +51,46 @@ const E = /* @__PURE__ */ l({
|
|
|
54
51
|
{
|
|
55
52
|
classes: "guido-items-onboarding-card-3",
|
|
56
53
|
right: "426px",
|
|
57
|
-
top:
|
|
54
|
+
top: "140px",
|
|
58
55
|
position: "Right Top",
|
|
59
|
-
title:
|
|
60
|
-
description:
|
|
56
|
+
title: i("email-editor.onboarding-items-composition-title"),
|
|
57
|
+
description: i("email-editor.onboarding-items-composition-description"),
|
|
61
58
|
imageSource: "",
|
|
62
59
|
backButtonType: "text",
|
|
63
|
-
backButtonText:
|
|
60
|
+
backButtonText: i("ds-steps.back"),
|
|
64
61
|
backButtonClick: () => {
|
|
65
62
|
o.previous("itemsOnboarding");
|
|
66
63
|
},
|
|
67
64
|
nextButtonType: "text",
|
|
68
|
-
nextButtonText:
|
|
65
|
+
nextButtonText: i("action-builder.ok"),
|
|
69
66
|
nextButtonClick: () => {
|
|
70
67
|
o.close("itemsOnboarding");
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
|
-
]),
|
|
74
|
-
var t,
|
|
75
|
-
(
|
|
76
|
-
},
|
|
77
|
-
var t,
|
|
78
|
-
(
|
|
70
|
+
]), m = c(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
|
|
71
|
+
var t, e;
|
|
72
|
+
(e = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
|
|
73
|
+
}, g = () => {
|
|
74
|
+
var t, e;
|
|
75
|
+
(e = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
|
|
79
76
|
};
|
|
80
|
-
return
|
|
77
|
+
return d(
|
|
81
78
|
() => o.isActive("itemsOnboarding"),
|
|
82
79
|
(t) => {
|
|
83
|
-
t && o.setConfig("itemsOnboarding",
|
|
80
|
+
t && o.setConfig("itemsOnboarding", s.value);
|
|
84
81
|
},
|
|
85
82
|
{ immediate: !0 }
|
|
86
|
-
),
|
|
83
|
+
), d(
|
|
87
84
|
() => o.onboardings.itemsOnboarding.cardIndex,
|
|
88
|
-
(t,
|
|
85
|
+
(t, e) => {
|
|
89
86
|
if (!o.isActive("itemsOnboarding"))
|
|
90
87
|
return;
|
|
91
|
-
const
|
|
92
|
-
|
|
88
|
+
const n = `${e}-${t}`;
|
|
89
|
+
n === "1-2" && r(x), n === "2-1" && r(T);
|
|
93
90
|
}
|
|
94
|
-
), { __sfc: !0, trans:
|
|
91
|
+
), { __sfc: !0, trans: i, onboardingStore: o, switchTab: r, onboardingCardsConfig: s, isVisible: m, handleNext: p, handleBack: g, InOnboard: B };
|
|
95
92
|
}
|
|
96
93
|
});
|
|
97
94
|
export {
|
|
98
|
-
|
|
95
|
+
I as default
|
|
99
96
|
};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const { config: e } = R(), m = e.htmlCompilerRules || [], l = [
|
|
2
|
+
import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
|
|
3
|
+
import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
|
|
4
|
+
import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
|
|
5
|
+
import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
6
|
+
import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
|
|
7
|
+
import { useConfig as f } from "./useConfig.js";
|
|
8
|
+
const h = () => {
|
|
9
|
+
const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
|
|
11
10
|
...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
|
|
12
|
-
...u,
|
|
13
|
-
...c,
|
|
14
|
-
...p,
|
|
15
11
|
...s,
|
|
16
12
|
...n,
|
|
17
|
-
...
|
|
13
|
+
...p,
|
|
14
|
+
...u,
|
|
15
|
+
...l.map((o, i) => ({
|
|
18
16
|
...o,
|
|
19
17
|
priority: o.priority + 1e3 + i
|
|
20
18
|
// Ensure additional rules run after default rules
|
|
21
19
|
}))
|
|
22
|
-
], r =
|
|
20
|
+
], r = c(m);
|
|
23
21
|
return { compileHtml: (o) => r.compile(o) };
|
|
24
22
|
};
|
|
25
23
|
export {
|
|
26
|
-
|
|
24
|
+
h as useHtmlCompiler
|
|
27
25
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
1
|
+
import { useConfig as H } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as V } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as D, 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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const ie = () => {
|
|
5
|
+
import { useRecommendationStore as G } from "../stores/recommendation.js";
|
|
6
|
+
import { base64EncodeWithSpecialChars as $ } from "../utils/base64.js";
|
|
7
|
+
import { useHttp as j } from "./useHttp.js";
|
|
8
|
+
import { useToaster as q } from "./useToaster.js";
|
|
9
|
+
import { useTranslations as M } from "./useTranslations.js";
|
|
10
|
+
const se = () => {
|
|
12
11
|
var d;
|
|
13
|
-
const { showToaster: c } =
|
|
12
|
+
const { showToaster: c } = q(), { post: y } = j(), { config: h } = H(), a = M(), m = G(), u = ((d = h.partner) == null ? void 0 : d.messageType) === V.transactional, v = async (e) => {
|
|
14
13
|
const t = await y(
|
|
15
14
|
"/newsletter/template-library/check-template-html-body",
|
|
16
|
-
{ html:
|
|
15
|
+
{ html: $(e) }
|
|
17
16
|
), { status: n, message: r } = t.data;
|
|
18
17
|
return n || c({
|
|
19
18
|
type: l.Alert,
|
|
@@ -26,10 +25,10 @@ const ie = () => {
|
|
|
26
25
|
const t = e.match(/({%(.*?)%})/g);
|
|
27
26
|
let n = !0;
|
|
28
27
|
return t !== null && !u && t.forEach((r) => {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const [
|
|
32
|
-
C(
|
|
28
|
+
const o = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
29
|
+
if (o && o.length > 0) {
|
|
30
|
+
const [i] = o;
|
|
31
|
+
C(i) && !s.includes(i) && (c({
|
|
33
32
|
type: l.Warning,
|
|
34
33
|
message: a("custom-fields.invalid-custom-fields")
|
|
35
34
|
}), n = !1);
|
|
@@ -59,19 +58,19 @@ const ie = () => {
|
|
|
59
58
|
}, k = (e, s) => {
|
|
60
59
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
61
60
|
if (t && !u) {
|
|
62
|
-
const n = new Set(s.map((
|
|
63
|
-
if (t.forEach((
|
|
64
|
-
const
|
|
65
|
-
(!n.has(
|
|
61
|
+
const n = new Set(s.map((o) => o.toLowerCase())), r = [];
|
|
62
|
+
if (t.forEach((o) => {
|
|
63
|
+
const i = o.slice(2, -2).trim().toLowerCase();
|
|
64
|
+
(!n.has(i) || i === "") && r.push(i);
|
|
66
65
|
}), r.length > 0) {
|
|
67
|
-
const
|
|
66
|
+
const o = `
|
|
68
67
|
<ul>
|
|
69
|
-
${r.map((
|
|
68
|
+
${r.map((i) => `<li>${i}</li>`).join("")}
|
|
70
69
|
</ul>
|
|
71
70
|
`;
|
|
72
71
|
return c({
|
|
73
72
|
type: l.Alert,
|
|
74
|
-
message: a("custom-fields.invalid-custom-fields") +
|
|
73
|
+
message: a("custom-fields.invalid-custom-fields") + o
|
|
75
74
|
}), !1;
|
|
76
75
|
}
|
|
77
76
|
}
|
|
@@ -80,11 +79,11 @@ const ie = () => {
|
|
|
80
79
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
81
80
|
let n = !0;
|
|
82
81
|
if (s && s.forEach((r) => {
|
|
83
|
-
const
|
|
84
|
-
(!
|
|
82
|
+
const o = r.match(D), i = r.match(P), B = (o == null ? void 0 : o.join("")) || "";
|
|
83
|
+
(!o || r !== B) && !i && (c({
|
|
85
84
|
type: l.Alert,
|
|
86
85
|
message: a("newsletter.display-conditions-invalid-syntax")
|
|
87
|
-
}), n = !1),
|
|
86
|
+
}), n = !1), o && o.forEach((f) => {
|
|
88
87
|
f.trim() === "=" && (c({
|
|
89
88
|
type: l.Alert,
|
|
90
89
|
message: a("custom-conditions.wrong-equality-operators")
|
|
@@ -95,8 +94,8 @@ const ie = () => {
|
|
|
95
94
|
});
|
|
96
95
|
});
|
|
97
96
|
}), t.length) {
|
|
98
|
-
const r = t.filter((
|
|
99
|
-
r.length !==
|
|
97
|
+
const r = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
|
|
98
|
+
r.length !== o.length && (c({
|
|
100
99
|
type: l.Alert,
|
|
101
100
|
message: a("custom-conditions.missing-if-endif-tag")
|
|
102
101
|
}), n = !1);
|
|
@@ -122,28 +121,28 @@ const ie = () => {
|
|
|
122
121
|
}), !1);
|
|
123
122
|
}, N = (e) => {
|
|
124
123
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
125
|
-
return Array.from(n).find((
|
|
126
|
-
var
|
|
127
|
-
return !((
|
|
124
|
+
return Array.from(n).find((o) => {
|
|
125
|
+
var i;
|
|
126
|
+
return !((i = o.id) != null && i.trim());
|
|
128
127
|
}) ? (c({
|
|
129
128
|
type: l.Alert,
|
|
130
129
|
message: a("unsubscribe-templates.select-checkbox-groups")
|
|
131
130
|
}), !1) : !0;
|
|
132
131
|
}, O = (e) => {
|
|
133
132
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
134
|
-
return Array.from(n).find((
|
|
135
|
-
var
|
|
136
|
-
return !((
|
|
133
|
+
return Array.from(n).find((o) => {
|
|
134
|
+
var i;
|
|
135
|
+
return !((i = o.id) != null && i.trim());
|
|
137
136
|
}) ? (c({
|
|
138
137
|
type: l.Alert,
|
|
139
138
|
message: a("unsubscribe-templates.select-radio-button-groups")
|
|
140
139
|
}), !1) : !0;
|
|
141
140
|
};
|
|
142
141
|
return { validateHtml: async (e, s, t = !1) => {
|
|
143
|
-
const n =
|
|
142
|
+
const n = s.map((o) => o.value);
|
|
144
143
|
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
144
|
} };
|
|
146
145
|
};
|
|
147
146
|
export {
|
|
148
|
-
|
|
147
|
+
se as useHtmlValidator
|
|
149
148
|
};
|
package/dist/enums/onboarding.js
CHANGED
|
@@ -2,11 +2,10 @@ const e = [
|
|
|
2
2
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
|
|
3
3
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
|
|
4
4
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
|
|
5
|
-
], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = "
|
|
5
|
+
], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = "https://academy.useinsider.com/docs/email-drag-drop-editor";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
o as ACADEMY_LINK,
|
|
8
8
|
n as CARD_COMPOSITION_TAB_SELECTOR,
|
|
9
|
-
o as RIBBON_SELECTOR,
|
|
10
9
|
e as SERVICE_HOVER_SELECTORS,
|
|
11
10
|
s as SETTINGS_TAB_SELECTOR,
|
|
12
11
|
t as UI_EDITOR_SELECTOR
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
|
|
3
|
-
const e = n(), I = {
|
|
1
|
+
import { useTranslations as e } from "../composables/useTranslations.js";
|
|
2
|
+
const s = e(), R = {
|
|
4
3
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
5
4
|
PREFERENCES_LINK_TYPE: 3
|
|
6
|
-
},
|
|
5
|
+
}, S = {
|
|
7
6
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
8
7
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
9
8
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
10
9
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
11
|
-
},
|
|
12
|
-
UNSUBSCRIBE_URL:
|
|
13
|
-
PREFERENCES_URL:
|
|
14
|
-
},
|
|
10
|
+
}, N = {
|
|
11
|
+
UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
|
|
12
|
+
PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
|
|
13
|
+
}, I = "iid", _ = {
|
|
15
14
|
name: "Global Unsubscribe",
|
|
16
15
|
sendGridId: "G"
|
|
17
|
-
},
|
|
16
|
+
}, i = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
|
|
18
17
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
19
18
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
20
19
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
21
20
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
22
21
|
RESUBSCRIBE: 5
|
|
23
|
-
},
|
|
22
|
+
}, B = {
|
|
24
23
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
25
24
|
E.GLOBAL_UNSUBSCRIBE,
|
|
26
25
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -30,27 +29,27 @@ const e = n(), I = {
|
|
|
30
29
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
31
30
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
32
31
|
]
|
|
33
|
-
},
|
|
34
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
35
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
36
|
-
[E.RESUBSCRIBE]:
|
|
37
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
38
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
39
|
-
},
|
|
32
|
+
}, C = {
|
|
33
|
+
[E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
|
|
34
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
35
|
+
[E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
|
|
36
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
|
|
37
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
38
|
+
}, c = {
|
|
40
39
|
default: "{{ins-unsubscribe-link}}",
|
|
41
40
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
42
41
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
43
42
|
};
|
|
44
43
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
i as ACADEMY_LINK,
|
|
45
|
+
_ as DEFAULT_UNSUBSCRIBE_GROUP,
|
|
46
|
+
I as INSIDER_ID,
|
|
47
|
+
S as LINK_REGEXES,
|
|
48
|
+
R as LINK_TYPES,
|
|
49
|
+
c as MERGE_TAGS,
|
|
51
50
|
E as PAGE_TYPES,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
B as TYPE_COLLECTIONS,
|
|
52
|
+
C as TYPE_TRANSLATIONS,
|
|
53
|
+
r as UNSUBSCRIBE_PAGES_LINK,
|
|
54
|
+
N as URLS
|
|
56
55
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { useOnboardingStore as
|
|
2
|
-
import { Block as
|
|
1
|
+
import { useOnboardingStore as f } from "../../../stores/onboarding.js";
|
|
2
|
+
import { Block as _, BlockCompositionType as g, ModificationDescription as u } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
3
|
import { configAttributes as t } from "./enums/productEnums.js";
|
|
4
4
|
import { DefaultConfigValues as e, SETTINGS_ENUMS as l } from "./enums/settingsEnums.js";
|
|
5
|
-
import { useItemsBlockStore as
|
|
6
|
-
import { getDefaultTemplate as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class x extends R {
|
|
5
|
+
import { useItemsBlockStore as d } from "./store/items-block.js";
|
|
6
|
+
import { getDefaultTemplate as D } from "./template.js";
|
|
7
|
+
const y = "items-block";
|
|
8
|
+
class V extends _ {
|
|
10
9
|
getId() {
|
|
11
|
-
return
|
|
10
|
+
return y;
|
|
12
11
|
}
|
|
13
12
|
getIcon() {
|
|
14
13
|
return "items-icon";
|
|
15
14
|
}
|
|
16
15
|
getBlockCompositionType() {
|
|
17
|
-
return
|
|
16
|
+
return g.CONTAINER;
|
|
18
17
|
}
|
|
19
18
|
getName() {
|
|
20
19
|
return this.api.translate("Items");
|
|
@@ -23,13 +22,14 @@ class x extends R {
|
|
|
23
22
|
return this.api.translate("Items lets you display personalized products based on user behavior.");
|
|
24
23
|
}
|
|
25
24
|
getTemplate() {
|
|
26
|
-
|
|
25
|
+
const r = d();
|
|
26
|
+
return D({
|
|
27
27
|
orientation: l.ORIENTATION.HORIZONTAL,
|
|
28
28
|
itemsType: l.ITEMS_TYPE.CART_ITEMS,
|
|
29
29
|
itemId: "{{Abandoned Cart Item (1) Url}}",
|
|
30
|
-
currencySymbol:
|
|
31
|
-
currencyLocation:
|
|
32
|
-
formattedPrice:
|
|
30
|
+
currencySymbol: r.currencySymbol,
|
|
31
|
+
currencyLocation: r.currencyLocation,
|
|
32
|
+
formattedPrice: r.formattedPrice
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
allowInnerBlocksDND() {
|
|
@@ -39,29 +39,29 @@ class x extends R {
|
|
|
39
39
|
const n = r.querySelector("esd-config-block");
|
|
40
40
|
if (!n)
|
|
41
41
|
return;
|
|
42
|
-
const o = n,
|
|
43
|
-
if (Number(
|
|
44
|
-
if (!
|
|
45
|
-
const i =
|
|
46
|
-
this.api.getDocumentModifier().modifyHtml(o).setAttribute(t.BLOCK_INSTANCE_ID, i).apply(new
|
|
42
|
+
const o = n, c = o.getAttribute("data-initialized") || "0", a = o.getAttribute(t.BLOCK_INSTANCE_ID), s = () => String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
43
|
+
if (Number(c)) {
|
|
44
|
+
if (!a) {
|
|
45
|
+
const i = s();
|
|
46
|
+
this.api.getDocumentModifier().modifyHtml(o).setAttribute(t.BLOCK_INSTANCE_ID, i).apply(new u("Assign block instance ID to legacy block"));
|
|
47
47
|
}
|
|
48
48
|
} else {
|
|
49
|
-
const i = e.itemsType,
|
|
50
|
-
this.api.getDocumentModifier().modifyHtml(o).setAttribute("data-source", i).setAttribute(t.TYPE, i).setAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE,
|
|
49
|
+
const i = e.itemsType, m = e.cartItemsSelectControlValue, I = e.cardOrientationControlValue, C = e.productNameTrimmingControlValue, T = e.productPriceHideDiscountControlValue, E = e.productPriceFormattedControlValue, b = e.productPriceCurrencySymbolControlValue, O = e.productPriceCurrencyLocationControlValue, A = e.productButtonLinkControlValue, N = e.productImageLinkControlValue, p = s();
|
|
50
|
+
this.api.getDocumentModifier().modifyHtml(o).setAttribute("data-source", i).setAttribute(t.TYPE, i).setAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE, m).setAttribute(t.ORIENTATION, I).setAttribute(t.PRODUCT_NAME_TRIMMING, C).setAttribute(t.PRODUCT_PRICE_HIDE_DISCOUNT, T).setAttribute(t.PRODUCT_PRICE_FORMATTED, E).setAttribute(t.PRODUCT_PRICE_CURRENCY_SYMBOL, b).setAttribute(t.PRODUCT_PRICE_CURRENCY_LOCATION, O).setAttribute(t.PRODUCT_BUTTON_LINK, A).setAttribute(t.PRODUCT_IMAGE_LINK, N).setAttribute(t.BLOCK_INSTANCE_ID, p).setAttribute("data-initialized", "1").setAttribute(t.NAME_CONTROL_ENABLED, e.productNameControlEnabled).setAttribute(
|
|
51
51
|
t.QUANTITY_CONTROL_ENABLED,
|
|
52
52
|
e.productQuantityControlEnabled
|
|
53
|
-
).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).
|
|
53
|
+
).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).apply(new u("Initialize config block attributes with defaults")), f().startOnboarding("itemsOnboarding");
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
onSelect(r) {
|
|
57
|
-
const n = r.querySelector("esd-config-block"), o =
|
|
57
|
+
const n = r.querySelector("esd-config-block"), o = d();
|
|
58
58
|
if (!n)
|
|
59
59
|
return;
|
|
60
|
-
const
|
|
61
|
-
o.setItemsType(
|
|
60
|
+
const c = n, a = c.getAttribute(t.TYPE) || e.itemsType, s = c.getAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE) || e.cartItemsSelectControlValue, i = c.getAttribute(t.ORIENTATION) || e.cardOrientationControlValue;
|
|
61
|
+
o.setItemsType(a), o.setItemIds(s), o.setOrientation(i);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
y as BLOCK_ID,
|
|
66
|
+
V as ItemsBlock
|
|
67
67
|
};
|