@useinsider/guido 3.2.0-beta.479e47d → 3.2.0-beta.488f8eb
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 +117 -1
- package/dist/@types/config/schemas.js +153 -95
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +90 -88
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/composables/useAutoSave.js +71 -0
- package/dist/composables/useHtmlValidator.js +41 -36
- package/dist/composables/useRecommendation.js +46 -26
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +19 -16
- package/dist/composables/useStripo.js +14 -16
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/config/compiler/recommendationCompilerRules.js +25 -25
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +104 -71
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
- package/dist/config/migrator/recommendation/extractors.js +27 -0
- package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
- package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
- package/dist/config/migrator/recommendation/themeMapper.js +93 -0
- package/dist/config/migrator/recommendationMigrator.js +74 -290
- package/dist/enums/extensions/recommendationBlock.js +2 -1
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/Recommendation/block.js +35 -32
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +25 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
- package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +130 -81
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
- package/dist/node_modules/valibot/dist/index.js +450 -235
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +5 -4
- package/dist/src/@types/config/defaults.d.ts +5 -1
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +217 -0
- package/dist/src/@types/config/types.d.ts +9 -1
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +58 -0
- package/dist/src/composables/useRecommendation.d.ts +10 -1
- package/dist/src/composables/useRecommendation.test.d.ts +1 -0
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +41 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/autosave.d.ts +12 -0
- package/dist/src/stores/config.d.ts +522 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/src/utils/htmlEscape.test.d.ts +1 -0
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/stores/autosave.js +17 -0
- package/dist/stores/editor.js +3 -1
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/htmlEscape.js +13 -0
- package/dist/utils/pairProductVariables.js +89 -88
- package/dist/utils/templatePreparation.js +72 -32
- package/dist/utils/timeUtil.js +19 -0
- package/package.json +7 -3
- package/dist/enums/displayConditions.js +0 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, computed as d, watch as m } from "vue";
|
|
2
|
+
import { useRibbonOffset as l } from "../../../composables/useRibbonOffset.js";
|
|
2
3
|
import { useTranslations as x } from "../../../composables/useTranslations.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useOnboardingStore as
|
|
5
|
-
import { InOnboard as
|
|
6
|
-
const E = /* @__PURE__ */
|
|
4
|
+
import { UI_EDITOR_SELECTOR as T, CARD_COMPOSITION_TAB_SELECTOR as O, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
|
|
5
|
+
import { useOnboardingStore as k } from "../../../stores/onboarding.js";
|
|
6
|
+
import { InOnboard as B } from "@useinsider/design-system-vue";
|
|
7
|
+
const E = /* @__PURE__ */ b({
|
|
7
8
|
__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))
|
|
9
|
+
setup(C) {
|
|
10
|
+
const i = x(), o = k(), { getTopPosition: n } = l(), r = (t) => {
|
|
11
|
+
const e = document.querySelector(T);
|
|
12
|
+
if (!(e != null && e.shadowRoot))
|
|
15
13
|
return;
|
|
16
|
-
const { shadowRoot: s } =
|
|
17
|
-
|
|
18
|
-
},
|
|
14
|
+
const { shadowRoot: s } = e, c = s.querySelector(t);
|
|
15
|
+
c && c.click();
|
|
16
|
+
}, a = d(() => [
|
|
19
17
|
{
|
|
20
18
|
classes: "guido-items-onboarding-card-1",
|
|
21
19
|
right: "426px",
|
|
22
20
|
top: n(90),
|
|
23
21
|
position: "Right Top",
|
|
24
|
-
title:
|
|
25
|
-
description:
|
|
22
|
+
title: i("email-editor.onboarding-items-title"),
|
|
23
|
+
description: i("email-editor.onboarding-items-description"),
|
|
26
24
|
imageSource: "",
|
|
27
25
|
backButtonClick: () => {
|
|
28
26
|
},
|
|
29
27
|
nextButtonType: "text",
|
|
30
|
-
nextButtonText:
|
|
28
|
+
nextButtonText: i("products.next"),
|
|
31
29
|
nextButtonClick: () => {
|
|
32
30
|
o.next("itemsOnboarding");
|
|
33
31
|
}
|
|
@@ -37,16 +35,16 @@ const E = /* @__PURE__ */ l({
|
|
|
37
35
|
right: "426px",
|
|
38
36
|
top: n(218),
|
|
39
37
|
position: "Right Top",
|
|
40
|
-
title:
|
|
41
|
-
description:
|
|
38
|
+
title: i("email-editor.onboarding-items-item-type-title"),
|
|
39
|
+
description: i("email-editor.onboarding-items-item-type-description"),
|
|
42
40
|
imageSource: "",
|
|
43
41
|
backButtonType: "text",
|
|
44
|
-
backButtonText:
|
|
42
|
+
backButtonText: i("ds-steps.back"),
|
|
45
43
|
backButtonClick: () => {
|
|
46
44
|
o.previous("itemsOnboarding");
|
|
47
45
|
},
|
|
48
46
|
nextButtonType: "text",
|
|
49
|
-
nextButtonText:
|
|
47
|
+
nextButtonText: i("products.next"),
|
|
50
48
|
nextButtonClick: () => {
|
|
51
49
|
o.next("itemsOnboarding");
|
|
52
50
|
}
|
|
@@ -56,42 +54,42 @@ const E = /* @__PURE__ */ l({
|
|
|
56
54
|
right: "426px",
|
|
57
55
|
top: n(140),
|
|
58
56
|
position: "Right Top",
|
|
59
|
-
title:
|
|
60
|
-
description:
|
|
57
|
+
title: i("email-editor.onboarding-items-composition-title"),
|
|
58
|
+
description: i("email-editor.onboarding-items-composition-description"),
|
|
61
59
|
imageSource: "",
|
|
62
60
|
backButtonType: "text",
|
|
63
|
-
backButtonText:
|
|
61
|
+
backButtonText: i("ds-steps.back"),
|
|
64
62
|
backButtonClick: () => {
|
|
65
63
|
o.previous("itemsOnboarding");
|
|
66
64
|
},
|
|
67
65
|
nextButtonType: "text",
|
|
68
|
-
nextButtonText:
|
|
66
|
+
nextButtonText: i("action-builder.ok"),
|
|
69
67
|
nextButtonClick: () => {
|
|
70
68
|
o.close("itemsOnboarding");
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
]), g =
|
|
74
|
-
var t,
|
|
75
|
-
(
|
|
76
|
-
},
|
|
77
|
-
var t,
|
|
78
|
-
(
|
|
71
|
+
]), g = d(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
|
|
72
|
+
var t, e;
|
|
73
|
+
(e = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
|
|
74
|
+
}, u = () => {
|
|
75
|
+
var t, e;
|
|
76
|
+
(e = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
|
|
79
77
|
};
|
|
80
|
-
return
|
|
78
|
+
return m(
|
|
81
79
|
() => o.isActive("itemsOnboarding"),
|
|
82
80
|
(t) => {
|
|
83
|
-
t && o.setConfig("itemsOnboarding",
|
|
81
|
+
t && o.setConfig("itemsOnboarding", a.value);
|
|
84
82
|
},
|
|
85
83
|
{ immediate: !0 }
|
|
86
|
-
),
|
|
84
|
+
), m(
|
|
87
85
|
() => o.onboardings.itemsOnboarding.cardIndex,
|
|
88
|
-
(t,
|
|
86
|
+
(t, e) => {
|
|
89
87
|
if (!o.isActive("itemsOnboarding"))
|
|
90
88
|
return;
|
|
91
|
-
const s = `${
|
|
92
|
-
s === "1-2" && r(
|
|
89
|
+
const s = `${e}-${t}`;
|
|
90
|
+
s === "1-2" && r(O), s === "2-1" && r(f);
|
|
93
91
|
}
|
|
94
|
-
), { __sfc: !0, trans:
|
|
92
|
+
), { __sfc: !0, trans: i, onboardingStore: o, getTopPosition: n, switchTab: r, onboardingCardsConfig: a, isVisible: g, handleNext: p, handleBack: u, InOnboard: B };
|
|
95
93
|
}
|
|
96
94
|
});
|
|
97
95
|
export {
|
|
@@ -1,74 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as l, computed as c, watch as g } from "vue";
|
|
2
|
+
import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as x } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useOnboardingStore as u } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as p } from "@useinsider/design-system-vue";
|
|
6
|
+
const O = /* @__PURE__ */ l({
|
|
6
7
|
__name: "TextBlockOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
|
|
10
|
-
return {
|
|
11
|
-
settings: {
|
|
12
|
-
top: `${r}px`,
|
|
13
|
-
position: r + d + g > n ? "Right Bottom" : "Right Top"
|
|
14
|
-
},
|
|
15
|
-
dynamic: {
|
|
16
|
-
top: `${s}px`,
|
|
17
|
-
position: s + d + g > n ? "Right Bottom" : "Right Top"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}), c = a(() => [
|
|
8
|
+
setup(k) {
|
|
9
|
+
const n = x(), o = u(), { getTopPosition: i } = b(), r = c(() => [
|
|
21
10
|
{
|
|
22
11
|
classes: "guido-text-block-onboarding-settings",
|
|
23
12
|
right: "426px",
|
|
24
|
-
top:
|
|
25
|
-
position:
|
|
26
|
-
title:
|
|
27
|
-
description:
|
|
13
|
+
top: i(90),
|
|
14
|
+
position: "Right Top",
|
|
15
|
+
title: n("email-editor.onboarding-text-block-title"),
|
|
16
|
+
description: n("email-editor.onboarding-text-block-description"),
|
|
28
17
|
imageSource: "",
|
|
29
18
|
backButtonClick: () => {
|
|
30
19
|
},
|
|
31
20
|
nextButtonType: "text",
|
|
32
|
-
nextButtonText:
|
|
21
|
+
nextButtonText: n("products.next"),
|
|
33
22
|
nextButtonClick: () => {
|
|
34
23
|
o.next("textBlockOnboarding");
|
|
35
24
|
}
|
|
36
25
|
},
|
|
37
26
|
{
|
|
38
27
|
classes: "guido-text-block-onboarding-dynamic",
|
|
39
|
-
right: "
|
|
40
|
-
top:
|
|
41
|
-
position:
|
|
42
|
-
title:
|
|
43
|
-
description:
|
|
28
|
+
right: "409px",
|
|
29
|
+
top: i(607),
|
|
30
|
+
position: "Right Top",
|
|
31
|
+
title: n("email-editor.onboarding-dynamic-content-title"),
|
|
32
|
+
description: n("email-editor.onboarding-dynamic-content-description"),
|
|
44
33
|
imageSource: "",
|
|
45
34
|
backButtonType: "text",
|
|
46
|
-
backButtonText:
|
|
35
|
+
backButtonText: n("ds-steps.back"),
|
|
47
36
|
backButtonClick: () => {
|
|
48
37
|
o.previous("textBlockOnboarding");
|
|
49
38
|
},
|
|
50
39
|
nextButtonType: "text",
|
|
51
|
-
nextButtonText:
|
|
40
|
+
nextButtonText: n("action-builder.ok"),
|
|
52
41
|
nextButtonClick: () => {
|
|
53
42
|
o.close("textBlockOnboarding");
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
|
-
]),
|
|
57
|
-
var t,
|
|
58
|
-
(
|
|
59
|
-
},
|
|
60
|
-
var t,
|
|
61
|
-
(
|
|
45
|
+
]), a = c(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), s = () => {
|
|
46
|
+
var t, e;
|
|
47
|
+
(e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
|
|
48
|
+
}, d = () => {
|
|
49
|
+
var t, e;
|
|
50
|
+
(e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
|
|
62
51
|
};
|
|
63
|
-
return
|
|
52
|
+
return g(
|
|
64
53
|
() => o.isActive("textBlockOnboarding"),
|
|
65
54
|
(t) => {
|
|
66
|
-
t && o.setConfig("textBlockOnboarding",
|
|
55
|
+
t && o.setConfig("textBlockOnboarding", r.value);
|
|
67
56
|
},
|
|
68
57
|
{ immediate: !0 }
|
|
69
|
-
), { __sfc: !0, trans:
|
|
58
|
+
), { __sfc: !0, trans: n, onboardingStore: o, getTopPosition: i, onboardingCardsConfig: r, isVisible: a, handleNext: s, handleBack: d, InOnboard: p };
|
|
70
59
|
}
|
|
71
60
|
});
|
|
72
61
|
export {
|
|
73
|
-
|
|
62
|
+
O as default
|
|
74
63
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as g, computed as s, watch as b } from "vue";
|
|
2
|
+
import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useOnboardingStore as m } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as p } from "@useinsider/design-system-vue";
|
|
6
|
+
const k = /* @__PURE__ */ g({
|
|
6
7
|
__name: "VersionHistoryOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const t =
|
|
8
|
+
setup(f) {
|
|
9
|
+
const t = l(), n = m(), { getTopPosition: r } = u(), e = s(() => [
|
|
9
10
|
{
|
|
10
11
|
classes: "guido-version-history-onboarding",
|
|
11
12
|
left: "409px",
|
|
12
|
-
top:
|
|
13
|
+
top: r(192),
|
|
13
14
|
position: "Left Top",
|
|
14
15
|
title: t("email-editor.onboarding-version-history-title"),
|
|
15
16
|
description: t("email-editor.onboarding-version-history-description"),
|
|
@@ -20,18 +21,18 @@ const C = /* @__PURE__ */ c({
|
|
|
20
21
|
nextButtonText: t("action-builder.ok"),
|
|
21
22
|
nextButtonClick: () => void n.close("versionHistoryOnboarding")
|
|
22
23
|
}
|
|
23
|
-
]),
|
|
24
|
+
]), a = s(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), d = () => {
|
|
24
25
|
var o, i;
|
|
25
26
|
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.nextButtonClick) == null || i.call(o);
|
|
26
|
-
},
|
|
27
|
+
}, c = () => {
|
|
27
28
|
var o, i;
|
|
28
29
|
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.backButtonClick) == null || i.call(o);
|
|
29
30
|
};
|
|
30
|
-
return
|
|
31
|
-
o && n.setConfig("versionHistoryOnboarding",
|
|
32
|
-
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n,
|
|
31
|
+
return b(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
|
|
32
|
+
o && n.setConfig("versionHistoryOnboarding", e.value);
|
|
33
|
+
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, getTopPosition: r, onboardingCardsConfig: e, isVisible: a, handleNext: d, handleBack: c, InOnboard: p };
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
k as default
|
|
37
38
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useConfig as m } from "./useConfig.js";
|
|
2
|
+
import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
|
|
3
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
4
|
+
import { computed as f, watch as p, onUnmounted as y } from "vue";
|
|
5
|
+
const I = 18e4, r = 6e4, T = (b) => {
|
|
6
|
+
const { isFeatureEnabled: S } = m(), a = E(), t = A();
|
|
7
|
+
let i = null, c = 0;
|
|
8
|
+
const u = f(
|
|
9
|
+
() => S("autosave") && t.isOn
|
|
10
|
+
), g = () => a.hasChanges && a.isInSaveableState, h = () => ({
|
|
11
|
+
hasChanges: a.hasChanges,
|
|
12
|
+
isInSaveableState: a.isInSaveableState
|
|
13
|
+
}), l = async (e) => {
|
|
14
|
+
if (!u.value) {
|
|
15
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!g()) {
|
|
19
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (t.status === s.SAVING) {
|
|
23
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
|
|
27
|
+
try {
|
|
28
|
+
if (await b() === void 0) {
|
|
29
|
+
console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
a.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
|
|
33
|
+
} catch (o) {
|
|
34
|
+
console.debug("guido:autosave:error", { trigger: e, error: o }), t.status = s.ERROR;
|
|
35
|
+
}
|
|
36
|
+
}, n = () => {
|
|
37
|
+
const { visibilityState: e } = document;
|
|
38
|
+
if (console.debug("guido:autosave:visibility-change", {
|
|
39
|
+
visibilityState: e,
|
|
40
|
+
isActive: u.value
|
|
41
|
+
}), e !== "hidden")
|
|
42
|
+
return;
|
|
43
|
+
const o = Date.now() - c;
|
|
44
|
+
if (o < r) {
|
|
45
|
+
console.debug("guido:autosave:visibility-debounced", {
|
|
46
|
+
sinceLastMs: o,
|
|
47
|
+
debounceMs: r
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
c = Date.now(), l("visibility");
|
|
52
|
+
}, d = () => {
|
|
53
|
+
i && (clearInterval(i), i = null);
|
|
54
|
+
}, v = () => {
|
|
55
|
+
document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
|
|
56
|
+
};
|
|
57
|
+
p(
|
|
58
|
+
u,
|
|
59
|
+
(e) => {
|
|
60
|
+
console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
|
|
61
|
+
console.debug("guido:autosave:interval-tick"), l("interval");
|
|
62
|
+
}, I), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), v(), t.status = s.IDLE);
|
|
63
|
+
},
|
|
64
|
+
{ immediate: !0 }
|
|
65
|
+
), y(() => {
|
|
66
|
+
d(), v(), t.status = s.IDLE, t.lastSavedAt = null;
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
T as useAutoSave
|
|
71
|
+
};
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
1
|
+
import { useConfig as _ } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as H } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
|
|
4
4
|
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
8
|
+
import { useRecommendationStore as K } from "../stores/recommendation.js";
|
|
9
|
+
import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
|
|
10
|
+
import { useHttp as U } from "./useHttp.js";
|
|
11
|
+
import { useToaster as Y } from "./useToaster.js";
|
|
12
|
+
import { useTranslations as Z } from "./useTranslations.js";
|
|
13
|
+
const J = /recommendation-id="(\d+)"/g;
|
|
14
|
+
function Q(a) {
|
|
15
|
+
return [...a.matchAll(J)].map((u) => u[1]);
|
|
14
16
|
}
|
|
15
|
-
function
|
|
17
|
+
function ee(a, u) {
|
|
16
18
|
return u.some((d) => a.startsWith(`${d}_`));
|
|
17
19
|
}
|
|
18
|
-
const
|
|
20
|
+
const ge = () => {
|
|
19
21
|
var y, h;
|
|
20
|
-
const { showToaster: a } =
|
|
22
|
+
const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
|
|
21
23
|
const t = await u(
|
|
22
24
|
"/newsletter/template-library/check-template-html-body",
|
|
23
|
-
{ html:
|
|
25
|
+
{ html: z(e) }
|
|
24
26
|
), { status: n, message: l } = t.data;
|
|
25
27
|
return n || a({
|
|
26
28
|
type: c.Alert,
|
|
27
29
|
message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
|
|
28
|
-
}), r(
|
|
30
|
+
}), r(M), l === r($) && a({
|
|
29
31
|
type: c.Alert,
|
|
30
32
|
message: r("newsletter.already-in-progress")
|
|
31
33
|
}), n;
|
|
32
|
-
}, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()),
|
|
34
|
+
}, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
|
|
33
35
|
const t = e.match(/({%(.*?)%})/g);
|
|
34
36
|
let n = !0;
|
|
35
37
|
return t !== null && !p && t.forEach((l) => {
|
|
@@ -42,13 +44,13 @@ const ce = () => {
|
|
|
42
44
|
}), n = !1);
|
|
43
45
|
}
|
|
44
46
|
}), n;
|
|
45
|
-
},
|
|
47
|
+
}, k = async (e, s, t) => {
|
|
46
48
|
const n = t ? await b(e) : !0;
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
+
return A(e, s) && n;
|
|
50
|
+
}, x = (e) => e.length > 0 ? !0 : (a({
|
|
49
51
|
type: c.Warning,
|
|
50
52
|
message: r("newsletter.html-content-is-empty")
|
|
51
|
-
}), !1),
|
|
53
|
+
}), !1), I = (e) => {
|
|
52
54
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
53
55
|
return s > t && a({
|
|
54
56
|
type: c.Warning,
|
|
@@ -57,7 +59,7 @@ const ce = () => {
|
|
|
57
59
|
type: c.Warning,
|
|
58
60
|
message: r("custom-fields.missing-opening-braces")
|
|
59
61
|
}), s === t;
|
|
60
|
-
},
|
|
62
|
+
}, F = (e) => {
|
|
61
63
|
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
62
64
|
return s || a({
|
|
63
65
|
type: c.Warning,
|
|
@@ -66,10 +68,10 @@ const ce = () => {
|
|
|
66
68
|
}, T = (e, s) => {
|
|
67
69
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
68
70
|
if (t && !p) {
|
|
69
|
-
const n = new Set(s.map((i) => i.toLowerCase())), l =
|
|
71
|
+
const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
|
|
70
72
|
if (t.forEach((i) => {
|
|
71
73
|
const m = i.slice(2, -2).trim().toLowerCase();
|
|
72
|
-
(!n.has(m) || m === "") && !
|
|
74
|
+
(!n.has(m) || m === "") && !ee(m, l) && o.push(m);
|
|
73
75
|
}), o.length > 0) {
|
|
74
76
|
const i = `
|
|
75
77
|
<ul>
|
|
@@ -83,11 +85,11 @@ const ce = () => {
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
return !0;
|
|
86
|
-
},
|
|
88
|
+
}, R = (e) => {
|
|
87
89
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
88
90
|
let n = !0;
|
|
89
91
|
if (s && s.forEach((l) => {
|
|
90
|
-
const o = l.match(
|
|
92
|
+
const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
|
|
91
93
|
(!o || l !== m) && !i && (a({
|
|
92
94
|
type: c.Alert,
|
|
93
95
|
message: r("newsletter.display-conditions-invalid-syntax")
|
|
@@ -98,7 +100,7 @@ const ce = () => {
|
|
|
98
100
|
}), n = !1);
|
|
99
101
|
const v = f.match(/^[a-zA-Z]*$/g);
|
|
100
102
|
v && v.forEach((C) => {
|
|
101
|
-
|
|
103
|
+
E(C) && t.push(C);
|
|
102
104
|
});
|
|
103
105
|
});
|
|
104
106
|
}), t.length) {
|
|
@@ -109,25 +111,28 @@ const ce = () => {
|
|
|
109
111
|
}), n = !1);
|
|
110
112
|
}
|
|
111
113
|
return n;
|
|
112
|
-
},
|
|
114
|
+
}, B = (e) => {
|
|
113
115
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
114
116
|
return n || a({
|
|
115
117
|
type: c.Warning,
|
|
116
118
|
message: r("custom-conditions.no-space-after-braces")
|
|
117
119
|
}), n;
|
|
118
|
-
},
|
|
120
|
+
}, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
|
|
119
121
|
type: c.Warning,
|
|
120
122
|
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
123
|
+
}), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
|
|
124
|
+
type: c.Alert,
|
|
125
|
+
message: r(j)
|
|
121
126
|
}), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
|
|
122
127
|
type: c.Alert,
|
|
123
128
|
message: r("newsletter.fill-all-necessary-fields")
|
|
124
|
-
}), !1) : !0,
|
|
129
|
+
}), !1) : !0, D = (e) => {
|
|
125
130
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
126
131
|
return e.match(s) === null ? !0 : (a({
|
|
127
132
|
type: c.Alert,
|
|
128
133
|
message: r("newsletter.invalid-image-type")
|
|
129
134
|
}), !1);
|
|
130
|
-
},
|
|
135
|
+
}, L = (e) => {
|
|
131
136
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
132
137
|
return Array.from(n).find((o) => {
|
|
133
138
|
var i;
|
|
@@ -136,7 +141,7 @@ const ce = () => {
|
|
|
136
141
|
type: c.Alert,
|
|
137
142
|
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
138
143
|
}), !1) : !0;
|
|
139
|
-
},
|
|
144
|
+
}, V = (e) => {
|
|
140
145
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
141
146
|
return Array.from(n).find((o) => {
|
|
142
147
|
var i;
|
|
@@ -150,12 +155,12 @@ const ce = () => {
|
|
|
150
155
|
var o, i;
|
|
151
156
|
const n = [
|
|
152
157
|
...s.map((m) => m.value),
|
|
153
|
-
...
|
|
158
|
+
...q,
|
|
154
159
|
...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
|
|
155
160
|
];
|
|
156
|
-
return await
|
|
161
|
+
return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
|
|
157
162
|
} };
|
|
158
163
|
};
|
|
159
164
|
export {
|
|
160
|
-
|
|
165
|
+
ge as useHtmlValidator
|
|
161
166
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { RecommendationFeedSourceMaps as
|
|
1
|
+
import { RecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { useConfigStore as
|
|
6
|
-
const
|
|
3
|
+
import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { useConfigStore as x } from "../stores/config.js";
|
|
6
|
+
const w = () => ({
|
|
7
7
|
calculateCardWidth: ({
|
|
8
|
-
mobileLeftPadding:
|
|
9
|
-
mobileRightPadding:
|
|
10
|
-
cardsInRow:
|
|
11
|
-
unresponsive:
|
|
8
|
+
mobileLeftPadding: s,
|
|
9
|
+
mobileRightPadding: a,
|
|
10
|
+
cardsInRow: c,
|
|
11
|
+
unresponsive: n
|
|
12
12
|
}) => {
|
|
13
|
-
const r =
|
|
13
|
+
const r = n ? c : 1, e = s + a + (r - 1) * b;
|
|
14
14
|
return (R - e) / r;
|
|
15
15
|
},
|
|
16
|
-
getRecommendationCampaignData: (
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
16
|
+
getRecommendationCampaignData: (s) => {
|
|
17
|
+
const a = m(), c = Number(s), n = a.blockStates[c];
|
|
18
|
+
if (!n)
|
|
19
19
|
return {
|
|
20
20
|
textTrimming: !1,
|
|
21
21
|
orientation: "vertical",
|
|
@@ -28,7 +28,7 @@ const N = () => ({
|
|
|
28
28
|
discountBeforeTextValue: "",
|
|
29
29
|
discountAfterTextValue: ""
|
|
30
30
|
};
|
|
31
|
-
const { recommendationConfigs: r } =
|
|
31
|
+
const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
32
32
|
return {
|
|
33
33
|
textTrimming: r.textTrimming,
|
|
34
34
|
orientation: e,
|
|
@@ -42,19 +42,39 @@ const N = () => ({
|
|
|
42
42
|
discountAfterTextValue: ""
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
|
-
buildCampaignUrl: (
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
buildCampaignUrl: (s, a) => {
|
|
46
|
+
var l;
|
|
47
|
+
const c = m(), n = x(), r = Number(s);
|
|
48
|
+
let e;
|
|
49
|
+
if (a)
|
|
50
|
+
e = a;
|
|
51
|
+
else {
|
|
52
|
+
const i = c.blockStates[r];
|
|
53
|
+
if (!i)
|
|
54
|
+
return "";
|
|
55
|
+
const { recommendationConfigs: o } = i;
|
|
56
|
+
e = {
|
|
57
|
+
strategy: o.strategy,
|
|
58
|
+
language: o.language,
|
|
59
|
+
currencyCode: o.currencySettings.value,
|
|
60
|
+
size: o.size,
|
|
61
|
+
productIds: o.productIds,
|
|
62
|
+
filters: o.filters,
|
|
63
|
+
shuffleProducts: o.shuffleProducts
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const f = ((l = I.find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
67
|
+
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising") {
|
|
68
|
+
const i = parseInt(e.size) || 6;
|
|
69
|
+
t.set("productId", e.productIds.slice(0, i).join(","));
|
|
70
|
+
} else e.strategy === "similarViewed" && t.set("productId", "{itemId}");
|
|
71
|
+
e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
72
|
+
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
73
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
|
|
74
|
+
const p = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
75
|
+
return c.recommendationCampaignUrls[s] = u, u;
|
|
56
76
|
}
|
|
57
77
|
});
|
|
58
78
|
export {
|
|
59
|
-
|
|
79
|
+
w as useRecommendation
|
|
60
80
|
};
|