@useinsider/guido 3.16.0-beta.f1a5d40 → 3.16.0-beta.ff4f1bd
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 +12 -6
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +31 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +61 -0
- package/dist/composables/useRecommendation.js +43 -36
- package/dist/config/migrator/recommendationMigrator.js +6 -4
- package/dist/enums/extensions/recommendationBlock.js +25 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +13 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +112 -90
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +106 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +188 -53
- package/dist/guido.css +1 -1
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index-5JHlb8rM.js +524 -0
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +8450 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +174 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +381 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +236 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +70 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +350 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +371 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +152 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +141 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +1047 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +96050 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +2042 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +166 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +1098 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +55 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +265 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +184 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +50 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +453 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +145 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +176 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +266 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +114 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +200 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +451 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +49 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +119 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +4309 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +129 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +503 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +253 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +107 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +134 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +464 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +28 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +23 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +29 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +109 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +2339 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +16 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +17 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +188 -0
- package/dist/services/recommendationApi.js +77 -28
- package/dist/src/@types/config/schemas.d.ts +12 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +6 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +26 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +199 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/mock/api/recommendation-strategies.d.ts +41 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/utils/templatePreparation.js +37 -34
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
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 d, DEFAULT_NODE_CONFIG as
|
|
4
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
5
|
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
@@ -11,20 +11,20 @@ import { useEditorStore as z } from "../stores/editor.js";
|
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
13
|
function O(m) {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const o =
|
|
14
|
+
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
|
+
return i.forEach((s) => {
|
|
16
|
+
const o = s.getAttribute(A.PAGE_LIST);
|
|
17
17
|
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
20
|
async function M(m) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
|
+
if (n.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const i = C();
|
|
25
|
+
n.forEach((t) => {
|
|
26
26
|
var r, l, g, f, c;
|
|
27
|
-
const
|
|
27
|
+
const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
|
|
28
28
|
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -42,24 +42,27 @@ async function M(m) {
|
|
|
42
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy: L(e.strategy) ||
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
strategy: L(e.strategy) || a.strategy,
|
|
46
|
+
// esd-ext-config is the source of truth for the assigned RRS —
|
|
47
|
+
// a strategy-backed block must survive save/reopen from it alone.
|
|
48
|
+
strategyId: e.strategyId ?? a.strategyId,
|
|
49
|
+
language: e.language ?? a.language,
|
|
50
|
+
size: e.size ?? a.size,
|
|
48
51
|
// Spread the default arrays so each block gets a fresh reference
|
|
49
52
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
50
|
-
productIds: e.productIds ?? [...
|
|
51
|
-
filters: e.filters ?? [...
|
|
52
|
-
shuffleProducts: e.shuffleProducts ??
|
|
53
|
+
productIds: e.productIds ?? [...a.productIds],
|
|
54
|
+
filters: e.filters ?? [...a.filters],
|
|
55
|
+
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
53
56
|
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
|
|
54
57
|
currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
|
|
55
58
|
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
|
|
56
59
|
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
|
|
57
60
|
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
|
|
58
61
|
};
|
|
59
|
-
|
|
62
|
+
i.seedBlockUrlConfig(o, h);
|
|
60
63
|
});
|
|
61
64
|
try {
|
|
62
|
-
await
|
|
65
|
+
await i.fetchRecommendationCreateData();
|
|
63
66
|
} catch (t) {
|
|
64
67
|
console.warn(
|
|
65
68
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -68,39 +71,39 @@ async function M(m) {
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
const Z = () => {
|
|
71
|
-
const m = N(), u = z(),
|
|
74
|
+
const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
72
75
|
return {
|
|
73
76
|
prepareTemplateDetails: async () => {
|
|
74
77
|
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
75
78
|
if (e("linkTrackingIds"))
|
|
76
79
|
try {
|
|
77
|
-
const { html:
|
|
78
|
-
u.trackIdSessionFloor =
|
|
79
|
-
} catch (
|
|
80
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
|
|
82
|
+
} catch (S) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", S);
|
|
81
84
|
}
|
|
82
|
-
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await
|
|
85
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
|
|
83
86
|
minimize: !0,
|
|
84
87
|
resetDataSavedFlag: !1
|
|
85
88
|
});
|
|
86
|
-
|
|
87
|
-
const { compiledHtml:
|
|
89
|
+
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
|
|
90
|
+
const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
|
|
88
91
|
return console.debug("HTML Compilation Stats:", {
|
|
89
|
-
originalSize:
|
|
90
|
-
compiledSize:
|
|
91
|
-
reduction: `${
|
|
92
|
-
appliedRules:
|
|
93
|
-
executionTime: `${
|
|
92
|
+
originalSize: y.originalSize,
|
|
93
|
+
compiledSize: y.compiledSize,
|
|
94
|
+
reduction: `${y.reductionPercentage.toFixed(2)}%`,
|
|
95
|
+
appliedRules: w,
|
|
96
|
+
executionTime: `${y.executionTime.toFixed(2)}ms`
|
|
94
97
|
}), {
|
|
95
|
-
dynamicContentList:
|
|
96
|
-
compiledHtml:
|
|
98
|
+
dynamicContentList: E,
|
|
99
|
+
compiledHtml: I,
|
|
97
100
|
rawHtml: r,
|
|
98
101
|
css: l,
|
|
99
|
-
ampHtml:
|
|
102
|
+
ampHtml: D,
|
|
100
103
|
ampErrors: T,
|
|
101
104
|
modules: g.map(Number),
|
|
102
105
|
recommendation: {
|
|
103
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: P.recommendationCampaignUrls,
|
|
104
107
|
configs: {}
|
|
105
108
|
},
|
|
106
109
|
unsubscribe: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.16.0-beta.
|
|
3
|
+
"version": "3.16.0-beta.ff4f1bd",
|
|
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",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"start": "vite",
|
|
26
26
|
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --project tsconfig.app.json",
|
|
27
27
|
"preview": "vite preview",
|
|
28
|
-
"lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ &&
|
|
28
|
+
"lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ && bun run type-check",
|
|
29
29
|
"lint:fix": "NODE_OPTIONS=--max-old-space-size=2048 eslint --fix ./",
|
|
30
30
|
"lint:e2e-quality": "node scripts/lint-e2e-quality.mjs",
|
|
31
31
|
"lint:e2e-quality:ci": "node scripts/lint-e2e-quality.mjs --ci",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
51
|
+
"@useinsider/design-system-organisms": "0.0.3-beta.fd01ebd",
|
|
51
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
52
53
|
"@vueuse/core": "11.3.0",
|
|
53
54
|
"lodash-es": "4.17.21",
|