@useinsider/guido 3.17.0 → 3.18.0-beta.0ece468
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 +6 -5
- package/dist/@types/config/schemas.js +7 -6
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +84 -78
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +23 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +122 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +46 -0
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useModuleRepair.js +33 -0
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +30 -29
- package/dist/composables/useStripo.js +15 -15
- package/dist/composables/useSyncModuleExtractor.js +15 -13
- package/dist/composables/validators/useSyncModuleBlockValidator.js +24 -0
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +31 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +40 -31
- package/dist/extensions/Blocks/Items/block.js +118 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +25 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Items/utils/constants.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +35 -29
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +241 -180
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +128 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +236 -79
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +10 -6
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +69 -30
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useModuleRepair.d.ts +18 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/composables/useSyncModuleExtractor.d.ts +2 -0
- package/dist/src/composables/validators/useSyncModuleBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +35 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +43 -0
- package/dist/src/extensions/Blocks/Items/utils/constants.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +225 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +6 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +17 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +172 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/itemsCurrencyRepair.js +39 -0
- package/dist/utils/pairProductVariables.js +58 -58
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +3 -2
- package/dist/composables/useModuleDynamicContentRepair.js +0 -37
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -13
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as f, computed as i } from "vue";
|
|
2
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { asText as c } from "../../../../utils/genericUtil.js";
|
|
4
|
+
const j = /* @__PURE__ */ f({
|
|
5
|
+
__name: "StrategyInfoBoxContent",
|
|
6
|
+
props: {
|
|
7
|
+
strategy: null
|
|
8
|
+
},
|
|
9
|
+
setup(p) {
|
|
10
|
+
const a = p, n = _(), s = i(() => n("recommendation-strategy.none")), u = i(() => {
|
|
11
|
+
const e = c(a.strategy.algorithm) === "MIXED" ? n("discovery-strategy.mixed-algorithm") : n("discovery-strategy.single-algorithm"), t = c(a.strategy.algorithm_used).split(",").map((r) => r.trim()).filter(Boolean).map((r) => n(`recommendation-algorithm-names.${r.replaceAll("_", "-").toLowerCase()}`));
|
|
12
|
+
return t.length ? `${e} · ${t.join(", ")}` : e;
|
|
13
|
+
}), d = i(() => [
|
|
14
|
+
[a.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
15
|
+
[a.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
16
|
+
[a.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
17
|
+
].filter(([e]) => Number(e) === 1).map(([, e]) => n(e)).join(", ") || s.value), l = (e) => {
|
|
18
|
+
const t = c(e).trim();
|
|
19
|
+
if (!t)
|
|
20
|
+
return "";
|
|
21
|
+
let r;
|
|
22
|
+
try {
|
|
23
|
+
r = JSON.parse(t);
|
|
24
|
+
} catch {
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(r))
|
|
28
|
+
return r.length ? String(r.length) : "";
|
|
29
|
+
if (r && typeof r == "object") {
|
|
30
|
+
const o = Object.keys(r).length;
|
|
31
|
+
return o ? String(o) : "";
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}, m = i(() => l(a.strategy.manual_merchandising) || l(a.strategy.manual_merchandising_products) || s.value), g = (e) => {
|
|
35
|
+
if (Array.isArray(e))
|
|
36
|
+
return e.length;
|
|
37
|
+
const { conditionList: t } = e ?? {};
|
|
38
|
+
return Array.isArray(t) ? t.length : 1;
|
|
39
|
+
}, y = i(() => {
|
|
40
|
+
const e = a.strategy.filters;
|
|
41
|
+
if (!e)
|
|
42
|
+
return s.value;
|
|
43
|
+
try {
|
|
44
|
+
const t = typeof e == "string" ? JSON.parse(e) : e;
|
|
45
|
+
if (!t || typeof t != "object")
|
|
46
|
+
return s.value;
|
|
47
|
+
const r = Object.values(t).reduce((o, v) => o + g(v), 0);
|
|
48
|
+
return r ? String(r) : s.value;
|
|
49
|
+
} catch {
|
|
50
|
+
return s.value;
|
|
51
|
+
}
|
|
52
|
+
}), h = i(() => [
|
|
53
|
+
{ title: n("gpt-app-builder.algorithms-and-method"), value: u.value },
|
|
54
|
+
{ title: n("gpt-app-builder.exclusions"), value: d.value },
|
|
55
|
+
{ title: n("discovery-strategy.filters"), value: y.value },
|
|
56
|
+
{ title: n("action-builder.manual-merchandising"), value: m.value }
|
|
57
|
+
]);
|
|
58
|
+
return { __sfc: !0, props: a, trans: n, none: s, algorithmsAndMethod: u, exclusions: d, asMerchandising: l, manualMerchandising: m, conditionsIn: g, filters: y, details: h };
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
j as default
|
|
63
|
+
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
|
|
2
2
|
import u from "./AMPOnboarding.vue.js";
|
|
3
3
|
import v from "./GenericOnboarding.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import S from "./
|
|
7
|
-
import h from "./
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
4
|
+
import y from "./ItemsOnboarding.vue.js";
|
|
5
|
+
import l from "./NewVersionPopup.vue.js";
|
|
6
|
+
import S from "./RecommendationStrategyOnboarding.vue.js";
|
|
7
|
+
import h from "./TextBlockOnboarding.vue.js";
|
|
8
|
+
import w from "./VersionHistoryOnboarding.vue.js";
|
|
9
|
+
import { usePartner as P } from "../../../composables/usePartner.js";
|
|
10
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
11
|
+
import { useOnboardingStore as A } from "../../../stores/onboarding.js";
|
|
12
|
+
import { usePreviewStore as H } from "../../../stores/preview.js";
|
|
13
|
+
const N = /* @__PURE__ */ b({
|
|
13
14
|
__name: "OnboardingWrapper",
|
|
14
15
|
emits: ["onboarding-finished"],
|
|
15
|
-
setup(
|
|
16
|
-
const o =
|
|
17
|
-
{ type: "newVersionPopup", component:
|
|
16
|
+
setup(M, { emit: g }) {
|
|
17
|
+
const o = A(), r = _(), s = H(), { isTestPartner: a } = P(), m = e(() => r.isStripoInitialized), p = e(() => a()), d = [
|
|
18
|
+
{ type: "newVersionPopup", component: l },
|
|
18
19
|
{ type: "genericOnboarding", component: v },
|
|
19
|
-
{ type: "textBlockOnboarding", component:
|
|
20
|
-
{ type: "versionHistoryOnboarding", component:
|
|
20
|
+
{ type: "textBlockOnboarding", component: h },
|
|
21
|
+
{ type: "versionHistoryOnboarding", component: w },
|
|
21
22
|
{ type: "ampOnboarding", component: u },
|
|
22
|
-
{ type: "itemsOnboarding", component:
|
|
23
|
-
|
|
23
|
+
{ type: "itemsOnboarding", component: y },
|
|
24
|
+
{ type: "recommendationStrategyOnboarding", component: S }
|
|
25
|
+
], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => d.filter((n) => c(n.type)));
|
|
24
26
|
return O(async () => {
|
|
25
27
|
await o.fetchUserModalState();
|
|
26
28
|
}), t(
|
|
@@ -38,9 +40,9 @@ const G = /* @__PURE__ */ b({
|
|
|
38
40
|
(n) => {
|
|
39
41
|
!n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
|
|
40
42
|
}
|
|
41
|
-
), { __sfc: !0, emit:
|
|
43
|
+
), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: f };
|
|
42
44
|
}
|
|
43
45
|
});
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
N as default
|
|
46
48
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import d from "./RecommendationStrategyOnboarding.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import g from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var m = function() {
|
|
5
|
+
var e, n, r, a, i;
|
|
6
|
+
var t = this, s = t._self._c, o = t._self._setupProxy;
|
|
7
|
+
return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.top }, on: { close: function(p) {
|
|
8
|
+
return o.onboardingStore.close(o.ONBOARDING_TYPE);
|
|
9
|
+
}, nextButtonClick: o.handleNext } }) : t._e();
|
|
10
|
+
}, c = [], _ = /* @__PURE__ */ g(
|
|
11
|
+
d,
|
|
12
|
+
m,
|
|
13
|
+
c,
|
|
14
|
+
!1,
|
|
15
|
+
null,
|
|
16
|
+
"1f4a4044"
|
|
17
|
+
);
|
|
18
|
+
const S = _.exports;
|
|
19
|
+
export {
|
|
20
|
+
S as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as c, computed as g, watch as b } from "vue";
|
|
2
|
+
import { useRibbonOffset as p } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as u } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { ACADEMY_LINKS as l } from "../../../enums/academy.js";
|
|
5
|
+
import { useOnboardingStore as f } from "../../../stores/onboarding.js";
|
|
6
|
+
import { InOnboard as O } from "@useinsider/design-system-vue";
|
|
7
|
+
const B = /* @__PURE__ */ c({
|
|
8
|
+
__name: "RecommendationStrategyOnboarding",
|
|
9
|
+
setup(_) {
|
|
10
|
+
const e = "recommendationStrategyOnboarding", n = u(), t = f(), { getTopPosition: i } = p(), r = `<a href="${l.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${n("action-builder.visit-academy")}</a>`, a = () => [
|
|
11
|
+
{
|
|
12
|
+
classes: "guido-recommendation-strategy-onboarding",
|
|
13
|
+
// Sits in the gap left of the settings panel and points at the strategy section, which
|
|
14
|
+
// starts 208px down: the panel header and its tab row are fixed chrome above it.
|
|
15
|
+
right: "426px",
|
|
16
|
+
top: i(208),
|
|
17
|
+
position: "Right Top",
|
|
18
|
+
title: n("email-editor.onboarding-recommendation-strategy-title"),
|
|
19
|
+
description: n("email-editor.onboarding-recommendation-strategy-description", {
|
|
20
|
+
academyLink: r
|
|
21
|
+
}),
|
|
22
|
+
imageSource: "",
|
|
23
|
+
backButtonClick: () => {
|
|
24
|
+
},
|
|
25
|
+
nextButtonType: "text",
|
|
26
|
+
nextButtonText: n("action-builder.ok"),
|
|
27
|
+
nextButtonClick: () => {
|
|
28
|
+
t.close(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
], m = g(() => t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
|
|
32
|
+
var o, s;
|
|
33
|
+
(s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
|
|
34
|
+
};
|
|
35
|
+
return b(
|
|
36
|
+
() => t.isActive(e),
|
|
37
|
+
(o) => {
|
|
38
|
+
o && t.setConfig(e, a());
|
|
39
|
+
},
|
|
40
|
+
{ immediate: !0 }
|
|
41
|
+
), { __sfc: !0, ONBOARDING_TYPE: e, trans: n, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: m, handleNext: d, InOnboard: O };
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
B as default
|
|
46
|
+
};
|
|
@@ -1,53 +1,67 @@
|
|
|
1
|
-
import S from "../static/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/components/
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import S from "../static/assets/icons/line-change.svg.js";
|
|
2
|
+
import i from "../static/assets/icons/line-delete.svg.js";
|
|
3
|
+
import n from "../static/assets/icons/line-plus.svg.js";
|
|
4
|
+
import p from "../static/styles/base.css.js";
|
|
5
|
+
import s from "../static/styles/components/alert-message.css.js";
|
|
6
|
+
import C from "../static/styles/components/amp-block.css.js";
|
|
7
|
+
import a from "../static/styles/components/base-input.css.js";
|
|
8
|
+
import f from "../static/styles/components/button-group.css.js";
|
|
9
|
+
import c from "../static/styles/components/button.css.js";
|
|
10
|
+
import u from "../static/styles/components/combobox.css.js";
|
|
11
|
+
import l from "../static/styles/components/counter.css.js";
|
|
12
|
+
import d from "../static/styles/components/dropdown-menu.css.js";
|
|
13
|
+
import h from "../static/styles/components/loader.css.js";
|
|
14
|
+
import g from "../static/styles/components/narrow-panel.css.js";
|
|
15
|
+
import I from "../static/styles/components/popup.css.js";
|
|
16
|
+
import w from "../static/styles/components/recommendation-strategy.css.js";
|
|
17
|
+
import y from "../static/styles/components/switcher.css.js";
|
|
18
|
+
import b from "../static/styles/components/tabs.css.js";
|
|
19
|
+
import B from "../static/styles/components/tools.css.js";
|
|
20
|
+
import $ from "../static/styles/components/version-history.css.js";
|
|
21
|
+
import P from "../static/styles/components/wide-panel.css.js";
|
|
22
|
+
import x from "../static/styles/variables.css.js";
|
|
23
|
+
function r(t, o) {
|
|
24
|
+
return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
25
|
+
}
|
|
26
|
+
const A = `:host {
|
|
27
|
+
${r("line-change", S)}
|
|
28
|
+
${r("line-delete", i)}
|
|
29
|
+
${r("line-plus", n)}
|
|
30
|
+
}`, R = [
|
|
31
|
+
x,
|
|
23
32
|
// Must be on top
|
|
24
|
-
|
|
25
|
-
e,
|
|
26
|
-
i,
|
|
33
|
+
A,
|
|
27
34
|
p,
|
|
28
|
-
|
|
35
|
+
// Must be on top
|
|
29
36
|
s,
|
|
30
37
|
C,
|
|
31
|
-
f,
|
|
32
38
|
a,
|
|
33
|
-
|
|
39
|
+
f,
|
|
34
40
|
c,
|
|
35
|
-
|
|
41
|
+
u,
|
|
36
42
|
l,
|
|
43
|
+
d,
|
|
37
44
|
h,
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
g,
|
|
46
|
+
I,
|
|
47
|
+
y,
|
|
48
|
+
b,
|
|
49
|
+
B,
|
|
50
|
+
$,
|
|
51
|
+
P,
|
|
52
|
+
w
|
|
53
|
+
// Last: overrides button.css / wide-panel.css defaults
|
|
40
54
|
].join(`
|
|
41
55
|
|
|
42
|
-
`),
|
|
56
|
+
`), Y = () => ({ importCss: () => {
|
|
43
57
|
const o = new CSSStyleSheet();
|
|
44
|
-
o.replaceSync(
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
58
|
+
o.replaceSync(R);
|
|
59
|
+
const e = document.querySelector("ui-editor");
|
|
60
|
+
if (!e)
|
|
47
61
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
62
|
+
const m = e.shadowRoot;
|
|
63
|
+
m && (m.adoptedStyleSheets = [o]);
|
|
50
64
|
} });
|
|
51
65
|
export {
|
|
52
|
-
|
|
66
|
+
Y as useCustomInterfaceAppearance
|
|
53
67
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useConfig as C } from "./useConfig.js";
|
|
2
|
+
import { useToaster as T } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as g } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as D } from "../enums/toaster.js";
|
|
5
|
+
import { buildDynamicContentLookup as f, convertModuleDynamicContent as h } from "../utils/dynamicContentConverter.js";
|
|
6
|
+
import { flattenDynamicContentList as O } from "../utils/genericUtil.js";
|
|
7
|
+
import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
|
|
8
|
+
const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
|
|
9
|
+
const { template: p, isFeatureEnabled: m } = C(), { showToaster: a } = T(), y = g();
|
|
10
|
+
return { handleModuleAdd: (e, o) => {
|
|
11
|
+
var s, l, u;
|
|
12
|
+
try {
|
|
13
|
+
if ((e == null ? void 0 : e.action) !== "ADD" && (e == null ? void 0 : e.action) !== "COPY")
|
|
14
|
+
return;
|
|
15
|
+
const t = (s = o == null ? void 0 : o.getTargetNode) == null ? void 0 : s.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
|
|
16
|
+
if (!t || typeof r != "string")
|
|
17
|
+
return;
|
|
18
|
+
let n = M(r);
|
|
19
|
+
const c = f(O((u = p.value) == null ? void 0 : u.dynamicContentList));
|
|
20
|
+
let i = [];
|
|
21
|
+
c.size > 0 && ({ html: n, unresolved: i } = h(n, c, m("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), i.length > 0 && a({
|
|
22
|
+
type: D.Warning,
|
|
23
|
+
message: y(N)
|
|
24
|
+
});
|
|
25
|
+
} catch (t) {
|
|
26
|
+
console.error("Failed to repair module on add:", t);
|
|
27
|
+
}
|
|
28
|
+
} };
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
32
|
+
R as useModuleRepair
|
|
33
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as
|
|
2
|
-
import { MinDeviceViewport as C, DefaultPadding as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as y, URLS as I } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommendation.js";
|
|
3
3
|
import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { getPartnerRecommendationParams as
|
|
4
|
+
import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
6
|
import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
|
|
7
7
|
import { useConfigStore as P } from "../stores/config.js";
|
|
8
8
|
const B = () => ({
|
|
9
9
|
calculateCardWidth: ({
|
|
10
|
-
mobileLeftPadding:
|
|
11
|
-
mobileRightPadding:
|
|
12
|
-
cardsInRow:
|
|
10
|
+
mobileLeftPadding: i,
|
|
11
|
+
mobileRightPadding: c,
|
|
12
|
+
cardsInRow: s,
|
|
13
13
|
unresponsive: n
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
return (C - e) /
|
|
15
|
+
const o = n ? s : 1, e = i + c + (o - 1) * R;
|
|
16
|
+
return (C - e) / o;
|
|
17
17
|
},
|
|
18
|
-
getRecommendationCampaignData: (
|
|
19
|
-
const
|
|
18
|
+
getRecommendationCampaignData: (i) => {
|
|
19
|
+
const c = l(), s = Number(i), n = c.blockStates[s];
|
|
20
20
|
if (!n)
|
|
21
21
|
return {
|
|
22
22
|
textTrimming: !1,
|
|
@@ -30,47 +30,54 @@ const B = () => ({
|
|
|
30
30
|
discountBeforeTextValue: "",
|
|
31
31
|
discountAfterTextValue: ""
|
|
32
32
|
};
|
|
33
|
-
const { recommendationConfigs:
|
|
33
|
+
const { recommendationConfigs: o } = n, e = o.orientation === "grid" ? "vertical" : "horizontal";
|
|
34
34
|
return {
|
|
35
|
-
textTrimming:
|
|
35
|
+
textTrimming: o.textTrimming,
|
|
36
36
|
orientation: e,
|
|
37
37
|
mobileLeftPadding: 0,
|
|
38
38
|
mobileRightPadding: 0,
|
|
39
|
-
cardsInRow:
|
|
40
|
-
unresponsive:
|
|
39
|
+
cardsInRow: o.cardsInRow,
|
|
40
|
+
unresponsive: o.unresponsive,
|
|
41
41
|
priceBeforeTextValue: "",
|
|
42
42
|
priceAfterTextValue: "",
|
|
43
43
|
discountBeforeTextValue: "",
|
|
44
44
|
discountAfterTextValue: ""
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
|
-
buildCampaignUrl: (
|
|
47
|
+
buildCampaignUrl: (i, c) => {
|
|
48
48
|
var m;
|
|
49
|
-
const
|
|
49
|
+
const s = l(), n = P(), o = Number(i);
|
|
50
50
|
let e;
|
|
51
|
-
if (
|
|
52
|
-
e =
|
|
51
|
+
if (c)
|
|
52
|
+
e = c;
|
|
53
53
|
else {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
54
|
+
const a = s.blockStates[o];
|
|
55
|
+
if (!a)
|
|
56
56
|
return "";
|
|
57
|
-
const { recommendationConfigs:
|
|
57
|
+
const { recommendationConfigs: r } = a;
|
|
58
58
|
e = {
|
|
59
|
-
strategy:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
strategy: r.strategy,
|
|
60
|
+
strategyId: r.strategyId,
|
|
61
|
+
language: r.language,
|
|
62
|
+
currencyCode: r.currencySettings.value,
|
|
63
|
+
size: r.size,
|
|
64
|
+
productIds: r.productIds,
|
|
65
|
+
filters: r.filters,
|
|
66
|
+
shuffleProducts: r.shuffleProducts
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
70
|
+
return s.recommendationCampaignUrls[i] = {
|
|
71
|
+
strategyId: e.strategyId,
|
|
72
|
+
locale: e.language,
|
|
73
|
+
currency: e.currencyCode
|
|
74
|
+
}, "";
|
|
75
|
+
const g = ((m = y().find((a) => a.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
69
76
|
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" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
70
|
-
const
|
|
71
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(
|
|
72
|
-
const p = decodeURIComponent(t.toString()), u = `${
|
|
73
|
-
return
|
|
77
|
+
const f = e.filters.filter((a) => a.isValid), d = b(f);
|
|
78
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(n.partnerName, e.strategy)).forEach(([a, r]) => t.set(a, r));
|
|
79
|
+
const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${g}?${p}`;
|
|
80
|
+
return s.recommendationCampaignUrls[i] = u, u;
|
|
74
81
|
}
|
|
75
82
|
});
|
|
76
83
|
export {
|
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as T } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as E, useSaveComplete as q } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as C } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { ToasterTypeOptions as M } from "../enums/toaster.js";
|
|
6
6
|
import { useStripoApi as D } from "../services/stripoApi.js";
|
|
7
7
|
import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
|
|
8
8
|
import { useAllowlist as P } from "./useAllowlist.js";
|
|
9
9
|
import { useHtmlValidator as U } from "./useHtmlValidator.js";
|
|
10
10
|
import { useToaster as A } from "./useToaster.js";
|
|
11
|
-
import { useCouponBlockValidator as
|
|
12
|
-
import { useLiquidValidator as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
import { useCouponBlockValidator as h } from "./validators/useCouponBlockValidator.js";
|
|
12
|
+
import { useLiquidValidator as F } from "./validators/useLiquidValidator.js";
|
|
13
|
+
import { useSyncModuleBlockValidator as O } from "./validators/useSyncModuleBlockValidator.js";
|
|
14
|
+
import { useUnsubscribeBlockValidator as W } from "./validators/useUnsubscribeBlockValidator.js";
|
|
15
|
+
const it = () => {
|
|
16
|
+
const l = E(), n = q(), { validateHtml: c } = U(), { validateLiquidSyntax: d } = F(), { validateCouponBlockTags: m } = h(), { validateUnsubscribeBlockUniqueness: u, validateUnsubscribeBlockHasTemplate: p } = W(), { validateSyncModuleBlocks: f } = O(), { callbacks: a, isFeatureEnabled: s } = T(), { extractSyncModuleData: v } = C(), { setSyncModuleUnsubscriptionPages: S } = D(), { editorSave: b } = x(), { showToaster: w } = A(), { getBlockedDomains: V, resolveToast: y } = P();
|
|
17
|
+
return { save: async (H = !1, e = !1) => {
|
|
17
18
|
var r;
|
|
18
|
-
|
|
19
|
-
const { prepareTemplateDetails:
|
|
20
|
-
if (!m(t.compiledHtml) || !u(t.compiledHtml) || !p(t.compiledHtml))
|
|
19
|
+
l();
|
|
20
|
+
const { prepareTemplateDetails: k } = L(), t = await k();
|
|
21
|
+
if (!f(t.rawHtml, e) || !m(t.compiledHtml) || !u(t.compiledHtml) || !p(t.compiledHtml))
|
|
21
22
|
return;
|
|
22
|
-
if (
|
|
23
|
+
if (s("liquidSyntax")) {
|
|
23
24
|
if (!await d(t.compiledHtml))
|
|
24
25
|
return;
|
|
25
26
|
} else if (!await c(t.compiledHtml, t.dynamicContentList, !0))
|
|
26
27
|
return;
|
|
27
|
-
if ((r =
|
|
28
|
+
if ((r = a.value) != null && r.externalValidation && !await a.value.externalValidation(t))
|
|
28
29
|
return;
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
type:
|
|
36
|
-
message:
|
|
37
|
-
actionButton:
|
|
30
|
+
if (s("allowlistEnabled")) {
|
|
31
|
+
const o = await V(t.compiledHtml, t.css);
|
|
32
|
+
if (o.length) {
|
|
33
|
+
if (!e) {
|
|
34
|
+
const i = await y(o);
|
|
35
|
+
i != null && i.message && w({
|
|
36
|
+
type: M.Warning,
|
|
37
|
+
message: i.message,
|
|
38
|
+
actionButton: i.actionButton
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
if (!await
|
|
44
|
+
if (!await b())
|
|
44
45
|
return;
|
|
45
|
-
const { unsubscribePayload:
|
|
46
|
-
return await
|
|
46
|
+
const { unsubscribePayload: B, stripoModules: g } = v(t.rawHtml);
|
|
47
|
+
return await S(B), t.modules = g, H || n({ ...t, silent: e }), t;
|
|
47
48
|
} };
|
|
48
49
|
};
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
it as useSave
|
|
51
52
|
};
|
|
@@ -3,7 +3,7 @@ import { useBlocksConfig as O } from "./useBlocksConfig.js";
|
|
|
3
3
|
import { useConfig as q } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useModuleRepair as j } from "./useModuleRepair.js";
|
|
7
7
|
import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
|
|
8
8
|
import { useStripoNotifications as $ } from "./useStripoNotifications.js";
|
|
9
9
|
import { useToaster as G } from "./useToaster.js";
|
|
@@ -17,13 +17,13 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
|
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
19
|
const Ce = () => {
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken:
|
|
21
|
-
var
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
|
+
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(
|
|
26
|
+
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
|
|
27
27
|
e.id = "UiEditorScript", e.type = "module", e.src = r, e.onload = () => i(), e.onerror = () => {
|
|
28
28
|
e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
|
|
29
29
|
}, document.body.appendChild(e);
|
|
@@ -31,12 +31,12 @@ const Ce = () => {
|
|
|
31
31
|
n = null;
|
|
32
32
|
}), n), _ = async (i, s, o, a = [], r = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const e = b(), { html:
|
|
34
|
+
const e = b(), { html: d, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1);
|
|
35
35
|
await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
38
38
|
metadata: s,
|
|
39
|
-
html:
|
|
39
|
+
html: d,
|
|
40
40
|
css: D,
|
|
41
41
|
forceRecreate: U,
|
|
42
42
|
locale: "en",
|
|
@@ -80,16 +80,16 @@ const Ce = () => {
|
|
|
80
80
|
],
|
|
81
81
|
async onTokenRefreshRequest(t) {
|
|
82
82
|
try {
|
|
83
|
-
const
|
|
84
|
-
t(
|
|
85
|
-
} catch (
|
|
86
|
-
p(
|
|
83
|
+
const l = await B();
|
|
84
|
+
t(l);
|
|
85
|
+
} catch (l) {
|
|
86
|
+
p(l, "Failed to refresh token");
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const { importCss: t } = H(), { activateCustomViewStyles:
|
|
92
|
-
t(),
|
|
91
|
+
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
|
|
92
|
+
t(), l(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -108,7 +108,7 @@ const Ce = () => {
|
|
|
108
108
|
onDataChanged() {
|
|
109
109
|
e.hasChanges = !0;
|
|
110
110
|
},
|
|
111
|
-
onEvent:
|
|
111
|
+
onEvent: v,
|
|
112
112
|
onModuleAdd: F,
|
|
113
113
|
notifications: V(),
|
|
114
114
|
ignoreClickOutsideSelectors: [
|
|
@@ -126,8 +126,8 @@ const Ce = () => {
|
|
|
126
126
|
try {
|
|
127
127
|
await f();
|
|
128
128
|
const [r, e] = await Promise.all([
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
M(),
|
|
130
|
+
T()
|
|
131
131
|
]);
|
|
132
132
|
a.syncModulesEnabled = e, await _(i, s, o, r, e);
|
|
133
133
|
} catch {
|