@useinsider/guido 3.18.1-beta.fefef3c → 3.18.2-beta.38f9e20
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 +3 -21
- package/dist/@types/config/schemas.js +51 -59
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +53 -55
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +57 -82
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +22 -24
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +24 -28
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/composables/useCustomInterfaceAppearance.js +42 -46
- package/dist/composables/useHttp.js +24 -22
- package/dist/enums/extensions/recommendationBlock.js +14 -17
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +85 -80
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +28 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +44 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +48 -93
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +29 -28
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +84 -93
- package/dist/services/templateLibraryApi.js +17 -14
- package/dist/src/@types/config/schemas.d.ts +0 -16
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +13 -54
- package/dist/src/services/recommendationApi.d.ts +1 -2
- package/dist/src/stores/config.d.ts +0 -322
- package/dist/src/stores/onboarding.d.ts +10 -808
- package/dist/src/utils/genericUtil.d.ts +6 -0
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
- package/dist/stores/config.js +60 -74
- package/dist/stores/onboarding.js +36 -46
- package/dist/utils/genericUtil.js +63 -54
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +54 -52
- package/package.json +7 -7
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -46
- package/dist/composables/useLegacyStrategyConversion.js +0 -61
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -72
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -44
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
- package/dist/static/assets/icons/line-info.svg.js +0 -5
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
4
|
+
import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
+
import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
8
|
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
9
|
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
10
|
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
-
import { useUnsubscribeStore as
|
|
11
|
+
import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
|
|
12
|
+
import { isPlainObject as _ } from "./genericUtil.js";
|
|
12
13
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
-
function
|
|
14
|
-
const i = new DOMParser().parseFromString(
|
|
15
|
-
return i.forEach((
|
|
16
|
-
const o =
|
|
14
|
+
function M(l) {
|
|
15
|
+
const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), t = [];
|
|
16
|
+
return i.forEach((c) => {
|
|
17
|
+
const o = c.getAttribute(T.PAGE_LIST);
|
|
17
18
|
o && t.push(...R(o));
|
|
18
19
|
}), [...new Set(t)];
|
|
19
20
|
}
|
|
20
|
-
async function
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
async function q(l) {
|
|
22
|
+
const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
23
|
+
if (a.length === 0)
|
|
23
24
|
return;
|
|
24
|
-
const i =
|
|
25
|
-
|
|
26
|
-
var r,
|
|
27
|
-
const
|
|
25
|
+
const i = A();
|
|
26
|
+
a.forEach((t) => {
|
|
27
|
+
var r, d, g, f, s, y;
|
|
28
|
+
const c = t.getAttribute("recommendation-id"), o = c ? Number(c) : NaN;
|
|
28
29
|
if (!Number.isFinite(o))
|
|
29
30
|
return;
|
|
30
31
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -36,28 +37,29 @@ async function M(m) {
|
|
|
36
37
|
} catch {
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
if (!
|
|
40
|
+
if (!_(e))
|
|
40
41
|
return;
|
|
41
|
-
const
|
|
42
|
+
const b = {
|
|
42
43
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
44
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
45
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy: L(e.strategy) ||
|
|
46
|
-
strategyId: e.strategyId ??
|
|
47
|
-
language: e.language ??
|
|
48
|
-
size: e.size ??
|
|
46
|
+
strategy: L(e.strategy) || n.strategy,
|
|
47
|
+
strategyId: e.strategyId ?? n.strategyId,
|
|
48
|
+
language: e.language ?? n.language,
|
|
49
|
+
size: e.size ?? n.size,
|
|
49
50
|
// Spread the default arrays so each block gets a fresh reference
|
|
50
51
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
51
|
-
productIds: e.productIds ?? [...
|
|
52
|
-
filters: e.filters ?? [...
|
|
53
|
-
shuffleProducts: e.shuffleProducts ??
|
|
54
|
-
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ??
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
productIds: e.productIds ?? [...n.productIds],
|
|
53
|
+
filters: e.filters ?? [...n.filters],
|
|
54
|
+
shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
|
|
55
|
+
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? m.code,
|
|
56
|
+
currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
|
|
57
|
+
currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
|
|
58
|
+
currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
|
|
59
|
+
currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
|
|
60
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
|
|
59
61
|
};
|
|
60
|
-
i.seedBlockUrlConfig(o,
|
|
62
|
+
i.seedBlockUrlConfig(o, b);
|
|
61
63
|
});
|
|
62
64
|
try {
|
|
63
65
|
await i.fetchRecommendationCreateData();
|
|
@@ -68,51 +70,51 @@ async function M(m) {
|
|
|
68
70
|
);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
+
const te = () => {
|
|
74
|
+
const l = N(), u = z(), a = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: c } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
73
75
|
return {
|
|
74
76
|
prepareTemplateDetails: async () => {
|
|
75
|
-
let { html: r, css:
|
|
77
|
+
let { html: r, css: d, syncModulesIds: g = [] } = await t();
|
|
76
78
|
if (e("linkTrackingIds"))
|
|
77
79
|
try {
|
|
78
|
-
const { html:
|
|
79
|
-
u.trackIdSessionFloor = H, F && (r =
|
|
80
|
-
} catch (
|
|
81
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (r = h, await c(h, d));
|
|
82
|
+
} catch (h) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", h);
|
|
82
84
|
}
|
|
83
|
-
const { html: f, ampHtml:
|
|
85
|
+
const { html: f, ampHtml: s = "", ampErrors: y = [] } = await i({
|
|
84
86
|
minimize: !0,
|
|
85
87
|
resetDataSavedFlag: !1
|
|
86
88
|
});
|
|
87
|
-
|
|
88
|
-
const { compiledHtml: I, stats:
|
|
89
|
+
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await q(r);
|
|
90
|
+
const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, P = l.getSelectedDynamicContentList, E = A(), C = M(r);
|
|
89
91
|
return console.debug("HTML Compilation Stats:", {
|
|
90
|
-
originalSize:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
92
|
+
originalSize: S.originalSize,
|
|
93
|
+
compiledSize: S.compiledSize,
|
|
94
|
+
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
93
95
|
appliedRules: w,
|
|
94
|
-
executionTime: `${
|
|
96
|
+
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
95
97
|
}), {
|
|
96
|
-
dynamicContentList:
|
|
98
|
+
dynamicContentList: P,
|
|
97
99
|
compiledHtml: I,
|
|
98
100
|
rawHtml: r,
|
|
99
|
-
css:
|
|
101
|
+
css: d,
|
|
100
102
|
ampHtml: D,
|
|
101
|
-
ampErrors:
|
|
103
|
+
ampErrors: y,
|
|
102
104
|
modules: g.map(Number),
|
|
103
105
|
recommendation: {
|
|
104
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: E.recommendationCampaignUrls,
|
|
105
107
|
configs: {}
|
|
106
108
|
},
|
|
107
109
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
110
|
+
status: C.length > 0,
|
|
111
|
+
config: C
|
|
110
112
|
}
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
116
|
};
|
|
115
117
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
M as getHtmlReferencedUnsubscribePages,
|
|
119
|
+
te as useTemplatePreparation
|
|
118
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.2-beta.38f9e20",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"author": "",
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
50
|
+
"@stripoinc/ui-editor-extensions": "3.10.0",
|
|
51
51
|
"@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
|
|
52
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
53
|
"@vueuse/core": "11.3.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@typescript-eslint/parser": "7.18.0",
|
|
78
78
|
"@useinsider/eslint-config": "1.5.3",
|
|
79
79
|
"@vitejs/plugin-vue2": "2.3.1",
|
|
80
|
-
"@vitest/coverage-v8": "
|
|
80
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
81
81
|
"eslint": "8.57.1",
|
|
82
82
|
"eslint-config-airbnb-base": "15.0.0",
|
|
83
83
|
"eslint-config-airbnb-typescript": "18.0.0",
|
|
@@ -90,17 +90,17 @@
|
|
|
90
90
|
"happy-dom": "15.11.7",
|
|
91
91
|
"husky": "9.1.7",
|
|
92
92
|
"msw": "2.10.3",
|
|
93
|
-
"nyc": "
|
|
93
|
+
"nyc": "18.0.0",
|
|
94
94
|
"sass": "1.69.7",
|
|
95
95
|
"typescript": "5.5.4",
|
|
96
96
|
"typescript-eslint": "8.26.0",
|
|
97
97
|
"vite-plugin-dts": "4.5.4",
|
|
98
98
|
"vite-plugin-istanbul": "7.0.0",
|
|
99
|
-
"vitest": "
|
|
99
|
+
"vitest": "4.1.11",
|
|
100
100
|
"vue-tsc": "2.2.10"
|
|
101
101
|
},
|
|
102
102
|
"overrides": {
|
|
103
|
-
"axios": "1.
|
|
103
|
+
"axios": "1.20.0",
|
|
104
104
|
"flatted": "3.4.2",
|
|
105
105
|
"micromatch": "4.0.8",
|
|
106
106
|
"path-to-regexp": "6.3.0"
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"guido": {
|
|
120
120
|
"stripo": {
|
|
121
|
-
"version": "2.
|
|
121
|
+
"version": "2.76.0"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import s from "./LegacyStrategyUpdatedModal.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var r = function() {
|
|
5
|
-
var t = this, a = t._self._c, e = t._self._setupProxy;
|
|
6
|
-
return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
|
|
7
|
-
}, l = [], n = /* @__PURE__ */ o(
|
|
8
|
-
s,
|
|
9
|
-
r,
|
|
10
|
-
l,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"da2225a1"
|
|
14
|
-
);
|
|
15
|
-
const m = n.exports;
|
|
16
|
-
export {
|
|
17
|
-
m as default
|
|
18
|
-
};
|
package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineComponent as i, computed as s } from "vue";
|
|
2
|
-
import p from "../../../wrappers/WpModal.vue.js";
|
|
3
|
-
import { useTranslations as d } from "../../../../composables/useTranslations.js";
|
|
4
|
-
import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
-
const M = /* @__PURE__ */ i({
|
|
6
|
-
__name: "LegacyStrategyUpdatedModal",
|
|
7
|
-
setup(l) {
|
|
8
|
-
const e = d(), t = g(), n = s(() => ({
|
|
9
|
-
primaryButton: {
|
|
10
|
-
type: "primary",
|
|
11
|
-
labelText: e("action-builder.ok")
|
|
12
|
-
}
|
|
13
|
-
})), m = s(() => {
|
|
14
|
-
var r;
|
|
15
|
-
const { strategyId: a } = t.recommendationConfigs;
|
|
16
|
-
return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
|
|
17
|
-
}), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
|
|
18
|
-
return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
|
|
19
|
-
t.closeLegacyStrategyUpdatedModal();
|
|
20
|
-
}, WpModal: p };
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
M as default
|
|
25
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import s from "./RecommendationLegacyStrategyOnboarding.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import c from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var d = function() {
|
|
5
|
-
var t, n, r, a, i;
|
|
6
|
-
var o = this, g = o._self._c, e = o._self._setupProxy;
|
|
7
|
-
return e.isVisible ? g(e.InOnboard, { key: "guido__recommendation-legacy-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (t = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__recommendation-legacy-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": e.onboardingStore.onboardings.recommendationLegacyStrategyOnboarding.config, "pointer-position": (r = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (a = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : i.top }, on: { close: function(p) {
|
|
8
|
-
return e.onboardingStore.close(e.ONBOARDING_TYPE);
|
|
9
|
-
}, nextButtonClick: e.handleNext } }) : o._e();
|
|
10
|
-
}, m = [], l = /* @__PURE__ */ c(
|
|
11
|
-
s,
|
|
12
|
-
d,
|
|
13
|
-
m,
|
|
14
|
-
!1,
|
|
15
|
-
null,
|
|
16
|
-
"19d8cb42"
|
|
17
|
-
);
|
|
18
|
-
const f = l.exports;
|
|
19
|
-
export {
|
|
20
|
-
f as default
|
|
21
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { defineComponent as d, computed as g, watch as l } from "vue";
|
|
2
|
-
import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
|
|
3
|
-
import { useTranslations as p } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { ACADEMY_LINKS as u } from "../../../enums/academy.js";
|
|
5
|
-
import { useOnboardingStore as y } from "../../../stores/onboarding.js";
|
|
6
|
-
import { InOnboard as f } from "@useinsider/design-system-vue";
|
|
7
|
-
const A = /* @__PURE__ */ d({
|
|
8
|
-
__name: "RecommendationLegacyStrategyOnboarding",
|
|
9
|
-
setup(O) {
|
|
10
|
-
const n = "recommendationLegacyStrategyOnboarding", o = p(), t = y(), { getTopPosition: i } = b(), r = `<a href="${u.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${o("action-builder.visit-academy")}</a>`, a = () => [
|
|
11
|
-
{
|
|
12
|
-
classes: "guido-recommendation-legacy-strategy-onboarding",
|
|
13
|
-
right: "40px",
|
|
14
|
-
top: i(485),
|
|
15
|
-
position: "Top Right",
|
|
16
|
-
title: o("email-editor.onboarding-recommendation-strategy-legacy-title"),
|
|
17
|
-
description: o("email-editor.onboarding-recommendation-strategy-legacy-description", {
|
|
18
|
-
academyLink: r
|
|
19
|
-
}),
|
|
20
|
-
imageSource: "",
|
|
21
|
-
backButtonClick: () => {
|
|
22
|
-
},
|
|
23
|
-
nextButtonType: "text",
|
|
24
|
-
nextButtonText: o("action-builder.ok"),
|
|
25
|
-
nextButtonClick: () => {
|
|
26
|
-
t.close(n);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
], s = g(
|
|
30
|
-
() => t.onboardings.recommendationLegacyStrategyOnboarding.config.length > 0 && t.onboardings.recommendationLegacyStrategyOnboarding.isActive
|
|
31
|
-
), m = () => {
|
|
32
|
-
var e, c;
|
|
33
|
-
(c = (e = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : e.nextButtonClick) == null || c.call(e);
|
|
34
|
-
};
|
|
35
|
-
return l(
|
|
36
|
-
() => t.isActive(n),
|
|
37
|
-
(e) => {
|
|
38
|
-
e && t.setConfig(n, a());
|
|
39
|
-
},
|
|
40
|
-
{ immediate: !0 }
|
|
41
|
-
), { __sfc: !0, ONBOARDING_TYPE: n, trans: o, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: s, handleNext: m, InOnboard: f };
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
A as default
|
|
46
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
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,61 +0,0 @@
|
|
|
1
|
-
import { useRecommendation as f } from "./useRecommendation.js";
|
|
2
|
-
import { useToaster as S } from "./useToaster.js";
|
|
3
|
-
import { useTranslations as I } from "./useTranslations.js";
|
|
4
|
-
import { ToasterTypeOptions as C } from "../enums/toaster.js";
|
|
5
|
-
import "../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
6
|
-
import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
7
|
-
import { useRecommendationExtensionStore as v } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
-
import { resolveMigrationTarget as b, buildLegacyMigrationPayload as R } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
|
|
9
|
-
import { commitBlockChangeOutsidePanel as T } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
|
|
10
|
-
import { useConfigStore as h } from "../stores/config.js";
|
|
11
|
-
const V = () => {
|
|
12
|
-
const t = v(), o = h(), { buildCampaignUrl: s } = f(), { showToaster: m } = S(), g = I();
|
|
13
|
-
return { convertLegacyStrategy: async () => {
|
|
14
|
-
const e = t.currentRecommendationId;
|
|
15
|
-
if (e === null || !t.isLegacyStrategyBlock || t.legacyConversionLoading)
|
|
16
|
-
return "";
|
|
17
|
-
const { strategy: d, productIds: l, filters: y } = t.recommendationConfigs, i = b({
|
|
18
|
-
campaignId: o.campaignId,
|
|
19
|
-
templateLibraryId: o.templateLibraryId
|
|
20
|
-
}), p = R({
|
|
21
|
-
blockId: e,
|
|
22
|
-
url: s(String(e)),
|
|
23
|
-
campaignId: o.campaignId,
|
|
24
|
-
variationId: o.variationId,
|
|
25
|
-
strategy: d,
|
|
26
|
-
productIds: l,
|
|
27
|
-
filters: y,
|
|
28
|
-
attributes: t.getFilterList,
|
|
29
|
-
target: i
|
|
30
|
-
});
|
|
31
|
-
let r;
|
|
32
|
-
try {
|
|
33
|
-
r = await t.convertLegacyStrategy(p, i);
|
|
34
|
-
} catch (n) {
|
|
35
|
-
return console.error("[useLegacyStrategyConversion] migration failed", n), m({
|
|
36
|
-
type: C.Error,
|
|
37
|
-
message: g("email-editor.legacy-strategy-update-failed")
|
|
38
|
-
}), "";
|
|
39
|
-
}
|
|
40
|
-
const c = t.currentRecommendationId === e;
|
|
41
|
-
if (c)
|
|
42
|
-
try {
|
|
43
|
-
await t.fetchRecommendationProducts();
|
|
44
|
-
} catch (n) {
|
|
45
|
-
console.error("[useLegacyStrategyConversion] product refetch failed", n);
|
|
46
|
-
}
|
|
47
|
-
const a = t.blockStates[e];
|
|
48
|
-
if (!a)
|
|
49
|
-
return r;
|
|
50
|
-
const { size: u } = a.recommendationConfigs;
|
|
51
|
-
return T(
|
|
52
|
-
e,
|
|
53
|
-
{ strategyId: r, size: u, configVersion: L },
|
|
54
|
-
a.recommendationProducts,
|
|
55
|
-
"Converted legacy recommendation strategy"
|
|
56
|
-
), c && t.openLegacyStrategyUpdatedModal(), r;
|
|
57
|
-
} };
|
|
58
|
-
};
|
|
59
|
-
export {
|
|
60
|
-
V as useLegacyStrategyConversion
|
|
61
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { OP_ANY_OF as p } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
-
import "../constants/selectors.js";
|
|
3
|
-
import { CURRENT_CONFIG_VERSION as l } from "../constants/defaultConfig.js";
|
|
4
|
-
import { parseTagList as I } from "./filterUtil.js";
|
|
5
|
-
import { sanitizeProductIds as N } from "./productIds.js";
|
|
6
|
-
const b = "String", f = "manualMerchandising";
|
|
7
|
-
function A({ strategyId: t, nodeConfigVersion: o }) {
|
|
8
|
-
return !t && o < l;
|
|
9
|
-
}
|
|
10
|
-
const m = (t) => {
|
|
11
|
-
const o = String(t ?? "").trim();
|
|
12
|
-
return /^[1-9]\d*$/.test(o) ? o : null;
|
|
13
|
-
};
|
|
14
|
-
function O({ campaignId: t, templateLibraryId: o }) {
|
|
15
|
-
if (m(t))
|
|
16
|
-
return { scope: "campaign" };
|
|
17
|
-
const e = m(o);
|
|
18
|
-
return e ? { scope: "template", templateId: e } : { scope: "campaign" };
|
|
19
|
-
}
|
|
20
|
-
const d = (t) => t === "|" ? "or" : "and", y = (t, o) => {
|
|
21
|
-
var e;
|
|
22
|
-
return {
|
|
23
|
-
conditionLogic: d(t.innerGroupOperator),
|
|
24
|
-
attribute: {
|
|
25
|
-
attributeName: t.attribute,
|
|
26
|
-
attributeType: ((e = o.find((r) => r.value === t.attribute)) == null ? void 0 : e.type) || b
|
|
27
|
-
},
|
|
28
|
-
operator: { operator: t.operator === p ? "=" : t.operator },
|
|
29
|
-
value: t.operator === p ? I(t.value).join(p) : t.value
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
function L(t, o) {
|
|
33
|
-
const e = /* @__PURE__ */ new Map();
|
|
34
|
-
return t.filter((r) => r.isValid).forEach((r) => {
|
|
35
|
-
e.set(r.filterGroup, [...e.get(r.filterGroup) ?? [], r]);
|
|
36
|
-
}), [...e.keys()].sort((r, n) => r - n).map((r) => {
|
|
37
|
-
const n = [...e.get(r) ?? []].sort((i, a) => i.filterNumber - a.filterNumber);
|
|
38
|
-
return {
|
|
39
|
-
groupLogic: d(n[0].outerGroupOperator),
|
|
40
|
-
conditionList: n.map((i) => y(i, o))
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function S({
|
|
45
|
-
blockId: t,
|
|
46
|
-
url: o,
|
|
47
|
-
campaignId: e,
|
|
48
|
-
variationId: r,
|
|
49
|
-
strategy: n,
|
|
50
|
-
productIds: i,
|
|
51
|
-
filters: a,
|
|
52
|
-
attributes: g,
|
|
53
|
-
target: u
|
|
54
|
-
}) {
|
|
55
|
-
const s = L(a, g), c = n === f ? N(i).split(",").filter(Boolean) : [];
|
|
56
|
-
return {
|
|
57
|
-
...u.scope === "template" ? { templateId: Number.parseInt(u.templateId) } : {
|
|
58
|
-
campaignId: Number.parseInt(e) || 0,
|
|
59
|
-
variationId: Number.parseInt(r) || 0
|
|
60
|
-
},
|
|
61
|
-
blockId: String(t),
|
|
62
|
-
url: o,
|
|
63
|
-
...s.length ? { filters: s } : {},
|
|
64
|
-
...c.length ? { productIds: c } : {}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
S as buildLegacyMigrationPayload,
|
|
69
|
-
A as isLegacyStrategyConfig,
|
|
70
|
-
O as resolveMigrationTarget,
|
|
71
|
-
L as toMigrationFilterGroups
|
|
72
|
-
};
|
package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Filter, RrsMigrationFilterGroup, RrsMigrationPayload, RrsMigrationTarget } from '@@/Types/recommendation';
|
|
2
|
-
type FilterAttribute = {
|
|
3
|
-
value: string;
|
|
4
|
-
type: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* A block authored before reusable strategies: it still carries a plain feed
|
|
8
|
-
* configuration (compiled into a feed URL string) instead of a strategy id.
|
|
9
|
-
* Blocks created under RRS stamp `CURRENT_CONFIG_VERSION`, so the version is
|
|
10
|
-
* what separates "never converted" from "not assigned yet".
|
|
11
|
-
*/
|
|
12
|
-
export declare function isLegacyStrategyConfig({ strategyId, nodeConfigVersion }: {
|
|
13
|
-
strategyId: string;
|
|
14
|
-
nodeConfigVersion: number;
|
|
15
|
-
}): boolean;
|
|
16
|
-
export declare function resolveMigrationTarget({ campaignId, templateLibraryId }: {
|
|
17
|
-
campaignId?: string;
|
|
18
|
-
templateLibraryId?: string;
|
|
19
|
-
}): RrsMigrationTarget;
|
|
20
|
-
/**
|
|
21
|
-
* Groups the block's valid filters the way the feed URL groups them, in the
|
|
22
|
-
* shape the migration endpoint validates. The URL's filter DSL states no
|
|
23
|
-
* attribute type and cannot express a mixed-operator group, which is exactly
|
|
24
|
-
* what this override exists to supply.
|
|
25
|
-
*/
|
|
26
|
-
export declare function toMigrationFilterGroups(filters: Filter[], attributes: FilterAttribute[]): RrsMigrationFilterGroup[];
|
|
27
|
-
interface MigrationInputs {
|
|
28
|
-
blockId: number;
|
|
29
|
-
url: string;
|
|
30
|
-
campaignId: string;
|
|
31
|
-
variationId: string;
|
|
32
|
-
strategy: string;
|
|
33
|
-
productIds: string[];
|
|
34
|
-
filters: Filter[];
|
|
35
|
-
attributes: FilterAttribute[];
|
|
36
|
-
target: RrsMigrationTarget;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The server names and de-duplicates the strategy, so nothing here derives a name. The two
|
|
40
|
-
* routes take different identity fields — the campaign one names from `campaignId`/`variationId`
|
|
41
|
-
* (0 for modules, which carry no numeric campaign), the template one from `templateId`.
|
|
42
|
-
*/
|
|
43
|
-
export declare function buildLegacyMigrationPayload({ blockId, url, campaignId, variationId, strategy, productIds, filters, attributes, target, }: MigrationInputs): RrsMigrationPayload;
|
|
44
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const C = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.9403 5.51003L17.6328 11.0273C17.8845 11.3769 18.0068 11.8382 17.9997 12.2963L18 12.3333C18 13.2538 17.4627 14 16.8 14H15V15C15 15.5523 14.5523 16 14 16H10C9.44772 16 9 15.5523 9 15V14H7.2C6.53726 14 6 13.2538 6 12.3333L6.00029 12.2963C5.9932 11.8382 6.11551 11.3769 6.36722 11.0273L11.0597 5.51003C11.3182 5.15101 11.6615 4.98153 12 5.00159C12.3386 4.98153 12.6818 5.15101 12.9403 5.51003Z"/><path d="M10 18C9.44772 18 9 18.4477 9 19C9 19.5523 9.44772 20 10 20H14C14.5523 20 15 19.5523 15 19C15 18.4477 14.5523 18 14 18H10Z"/></svg>
|
|
2
|
-
`;
|
|
3
|
-
export {
|
|
4
|
-
C as default
|
|
5
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const C = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4C14.1217 4 16.1566 4.84285 17.6569 6.34315C19.1571 7.84344 20 9.87827 20 12C20 14.1217 19.1571 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20C9.87827 20 7.84344 19.1571 6.34315 17.6569C4.84285 16.1566 4 14.1217 4 12C4 9.87827 4.84285 7.84344 6.34315 6.34315C7.84344 4.84285 9.87827 4 12 4ZM12 5.6C10.3026 5.6 8.67475 6.27428 7.47452 7.47452C6.27428 8.67475 5.6 10.3026 5.6 12C5.6 13.6974 6.27428 15.3253 7.47452 16.5255C8.67475 17.7257 10.3026 18.4 12 18.4C13.6974 18.4 15.3253 17.7257 16.5255 16.5255C17.7257 15.3253 18.4 13.6974 18.4 12C18.4 10.3026 17.7257 8.67475 16.5255 7.47452C15.3253 6.27428 13.6974 5.6 12 5.6ZM11.496 10.448C11.928 10.448 12.264 10.552 12.496 10.768C12.736 10.976 12.848 11.248 12.848 11.584V11.688L12.824 11.944C12.816 12.064 12.8 12.176 12.776 12.28L12.736 12.432L12.288 14.024L12.248 14.152C12.1976 14.376 12.1629 14.6032 12.144 14.832C12.144 15.04 12.192 15.184 12.288 15.264C12.384 15.344 12.544 15.376 12.776 15.376C12.888 15.376 13.016 15.36 13.152 15.32L13.392 15.24L13.448 15.216L13.328 15.712L12.848 15.896L12.584 15.992L12.464 16.032C12.248 16.112 12 16.144 11.72 16.144C11.28 16.144 10.944 16.04 10.696 15.824C10.5803 15.7241 10.488 15.5998 10.4258 15.4602C10.3636 15.3205 10.3329 15.1689 10.336 15.016C10.3355 14.787 10.3624 14.5587 10.416 14.336L10.448 14.176L10.896 12.576L10.936 12.424L11 12.144C11.024 12.008 11.04 11.88 11.04 11.768C11.04 11.56 11 11.424 10.912 11.344C10.832 11.264 10.672 11.224 10.432 11.224C10.312 11.224 10.192 11.24 10.072 11.272L9.856 11.352L9.76 11.376L9.88 10.888L10.168 10.776C10.36 10.696 10.544 10.632 10.728 10.576C11 10.496 11.256 10.448 11.496 10.448ZM12.496 7.536C12.792 7.536 13.04 7.632 13.248 7.832C13.464 8.024 13.568 8.264 13.568 8.544C13.568 8.816 13.464 9.056 13.248 9.248C13.04 9.44 12.792 9.544 12.496 9.544C12.2 9.544 11.944 9.44 11.736 9.248C11.52 9.056 11.416 8.816 11.416 8.544C11.416 8.264 11.52 8.024 11.736 7.824C11.944 7.632 12.2 7.536 12.496 7.536Z"/></svg>
|
|
2
|
-
`;
|
|
3
|
-
export {
|
|
4
|
-
C as default
|
|
5
|
-
};
|