@useinsider/guido 3.18.2-beta.eedafd2 → 3.18.2-beta.ef84353
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 +20 -1
- package/dist/@types/config/schemas.js +26 -28
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +51 -53
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useGuidoStateBridge.js +29 -24
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/useStripo.js +7 -7
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +36 -43
- package/dist/guido.css +1 -1
- package/dist/library.js +15 -13
- package/dist/public/editorState.js +4 -0
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/library.d.ts +2 -0
- package/dist/src/public/editorState.d.ts +14 -0
- package/dist/src/public/trackingIds.d.ts +6 -2
- package/dist/src/stores/config.d.ts +0 -30
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/stores/guido-email-editor.d.ts +27 -27
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +22 -39
- package/dist/stores/editor.js +4 -0
- package/dist/stores/guido-email-editor.js +0 -4
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +5 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as L } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as O } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useModuleRepair as j } from "./useModuleRepair.js";
|
|
@@ -17,7 +17,7 @@ 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 } =
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = O(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = L(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
21
|
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
@@ -88,8 +88,8 @@ const Ce = () => {
|
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } =
|
|
92
|
-
t(), l(),
|
|
91
|
+
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = x(), { injectFullStory: q } = N();
|
|
92
|
+
t(), l(), q(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -106,7 +106,7 @@ const Ce = () => {
|
|
|
106
106
|
e.isVersionHistoryOpen = t;
|
|
107
107
|
},
|
|
108
108
|
onDataChanged() {
|
|
109
|
-
e.hasChanges = !0;
|
|
109
|
+
e.hasChanges = !0, e.changeSeq += 1;
|
|
110
110
|
},
|
|
111
111
|
onEvent: v,
|
|
112
112
|
onModuleAdd: F,
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
2
|
-
import { COUPON_PLACEHOLDER_DEFAULT as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
]),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}), !1) : !0 };
|
|
1
|
+
import { ToasterTypeOptions as c } from "../../enums/toaster.js";
|
|
2
|
+
import { COUPON_PLACEHOLDER_DEFAULT as i, COUPON_PLACEHOLDER_LIQUID as l } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
3
|
+
import { useToaster as m } from "../useToaster.js";
|
|
4
|
+
import { useTranslations as p } from "../useTranslations.js";
|
|
5
|
+
const u = /* @__PURE__ */ new Set([
|
|
6
|
+
i,
|
|
7
|
+
l
|
|
8
|
+
]), A = () => {
|
|
9
|
+
const { showToaster: t } = m(), r = p();
|
|
10
|
+
return { validateCouponBlockTags: (e) => {
|
|
11
|
+
const n = new DOMParser().parseFromString(e, "text/html");
|
|
12
|
+
return Array.from(n.querySelectorAll(".coupon-block")).find((s) => {
|
|
13
|
+
var o;
|
|
14
|
+
const a = ((o = s.textContent) == null ? void 0 : o.trim()) ?? "";
|
|
15
|
+
return !u.has(a);
|
|
16
|
+
}) ? (t({
|
|
17
|
+
type: c.Warning,
|
|
18
|
+
message: r("newsletter.coupon-tag-modified")
|
|
19
|
+
}), !1) : !0;
|
|
20
|
+
} };
|
|
22
21
|
};
|
|
23
22
|
export {
|
|
24
|
-
|
|
25
|
-
u as findInvalidCouponBlocks,
|
|
26
|
-
T as useCouponBlockValidator
|
|
23
|
+
A as useCouponBlockValidator
|
|
27
24
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { ToasterTypeOptions as i } from "../../enums/toaster.js";
|
|
2
2
|
import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
|
|
3
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
3
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
4
|
+
import { useToaster as E } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as m } from "../useTranslations.js";
|
|
6
6
|
const T = [
|
|
7
7
|
{
|
|
8
8
|
pageType: u.GLOBAL_UNSUBSCRIBE,
|
|
@@ -12,37 +12,30 @@ const T = [
|
|
|
12
12
|
pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
13
13
|
messageKey: "unsubscription-preference.duplicate-pref-center"
|
|
14
14
|
}
|
|
15
|
-
], g = "unsubscription-preference.duplicate-both",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return !n || !e;
|
|
28
|
-
}).length;
|
|
29
|
-
}
|
|
30
|
-
const y = () => {
|
|
31
|
-
const { showToaster: r } = p(), s = l();
|
|
32
|
-
return { validateUnsubscribeBlockUniqueness: (e) => {
|
|
33
|
-
const o = m(e);
|
|
34
|
-
return o.length ? (r({
|
|
35
|
-
type: c.Error,
|
|
36
|
-
message: s(o.length > 1 ? g : o[0].messageKey)
|
|
15
|
+
], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
|
|
16
|
+
const { showToaster: c } = E(), p = m();
|
|
17
|
+
return { validateUnsubscribeBlockUniqueness: (n) => {
|
|
18
|
+
const o = new DOMParser().parseFromString(n, "text/html"), r = /* @__PURE__ */ new Map();
|
|
19
|
+
o.querySelectorAll(l).forEach((e) => {
|
|
20
|
+
const s = Number(e.getAttribute(a.PAGE_TYPE));
|
|
21
|
+
r.set(s, (r.get(s) ?? 0) + 1);
|
|
22
|
+
});
|
|
23
|
+
const t = T.filter((e) => (r.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
|
|
24
|
+
return t.length ? (c({
|
|
25
|
+
type: i.Error,
|
|
26
|
+
message: p(t.length > 1 ? g : t[0])
|
|
37
27
|
}), !1) : !0;
|
|
38
|
-
}, validateUnsubscribeBlockHasTemplate: (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
}, validateUnsubscribeBlockHasTemplate: (n) => {
|
|
29
|
+
const o = new DOMParser().parseFromString(n, "text/html");
|
|
30
|
+
return Array.from(o.querySelectorAll(l)).some((t) => {
|
|
31
|
+
const e = t.getAttribute(a.PAGE_TYPE), s = t.getAttribute(a.PAGE_LIST);
|
|
32
|
+
return !e || !s;
|
|
33
|
+
}) ? (c({
|
|
34
|
+
type: i.Warning,
|
|
35
|
+
message: p(b)
|
|
36
|
+
}), !1) : !0;
|
|
37
|
+
} };
|
|
42
38
|
};
|
|
43
39
|
export {
|
|
44
|
-
|
|
45
|
-
b as countUnsubBlocksWithoutPage,
|
|
46
|
-
m as findDuplicateUnsubPageTypes,
|
|
47
|
-
y as useUnsubscribeBlockValidator
|
|
40
|
+
P as useUnsubscribeBlockValidator
|
|
48
41
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as
|
|
2
|
-
import { useRecommendationApi as
|
|
3
|
-
import { useConfigStore as
|
|
4
|
-
import { defineStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as b, getOperatorOptions as G, PriceAttributes as v } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as D } from "../../../../services/recommendationApi.js";
|
|
3
|
+
import { useConfigStore as F } from "../../../../stores/config.js";
|
|
4
|
+
import { defineStore as P } from "pinia";
|
|
5
5
|
import "../constants/selectors.js";
|
|
6
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
7
|
-
import { DEFAULT_NODE_CONFIG as
|
|
8
|
-
import { getDefaultProducts as
|
|
9
|
-
import { generateCompleteFilterQuery as
|
|
10
|
-
import { getPartnerRecommendationParams as
|
|
6
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as _, DEFAULT_CARDS_IN_ROW as U } from "../constants/layout.js";
|
|
7
|
+
import { DEFAULT_NODE_CONFIG as N, EXCLUDED_ALGORITHM_IDS as L } from "../constants/defaultConfig.js";
|
|
8
|
+
import { getDefaultProducts as R } from "../templates/utils.js";
|
|
9
|
+
import { generateCompleteFilterQuery as k } from "../utils/filterUtil.js";
|
|
10
|
+
import { getPartnerRecommendationParams as x } from "../utils/partnerCustomizations.js";
|
|
11
11
|
import { sanitizeProductIds as A } from "../utils/productIds.js";
|
|
12
|
-
import { isFilterValid as
|
|
13
|
-
import { isConfigValid as
|
|
14
|
-
const u =
|
|
12
|
+
import { isFilterValid as B } from "../validation/filterSchema.js";
|
|
13
|
+
import { isConfigValid as M } from "../validation/requiredFields.js";
|
|
14
|
+
const u = D();
|
|
15
15
|
let f = null, g = null, h = null, S = null;
|
|
16
16
|
const p = /* @__PURE__ */ new Map();
|
|
17
|
-
function
|
|
17
|
+
function w() {
|
|
18
18
|
return {
|
|
19
|
-
cardsInRow:
|
|
19
|
+
cardsInRow: U,
|
|
20
20
|
currencySettings: {
|
|
21
21
|
name: "USD",
|
|
22
22
|
value: "USD",
|
|
@@ -30,7 +30,7 @@ function v() {
|
|
|
30
30
|
productIds: [],
|
|
31
31
|
id: 1,
|
|
32
32
|
language: "en_US",
|
|
33
|
-
mobileCardsInRow:
|
|
33
|
+
mobileCardsInRow: _,
|
|
34
34
|
mobileLayoutEnabled: !1,
|
|
35
35
|
orientation: "grid",
|
|
36
36
|
recommendedProducts: [],
|
|
@@ -46,9 +46,9 @@ function v() {
|
|
|
46
46
|
priceHideIfSameAsDiscounted: !1
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function C() {
|
|
50
50
|
return {
|
|
51
|
-
recommendationConfigs:
|
|
51
|
+
recommendationConfigs: w(),
|
|
52
52
|
recommendationProducts: [],
|
|
53
53
|
filterStatus: !1,
|
|
54
54
|
filterSelectionDrawerStatus: !1,
|
|
@@ -60,7 +60,7 @@ function w() {
|
|
|
60
60
|
syncedConfigFingerprint: null
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const z = () => ({
|
|
64
64
|
recommendationCampaignUrls: {},
|
|
65
65
|
activePredictiveAlgorithms: [],
|
|
66
66
|
languages: {},
|
|
@@ -72,8 +72,8 @@ const O = () => ({
|
|
|
72
72
|
blockStates: {},
|
|
73
73
|
currentRecommendationId: null,
|
|
74
74
|
configVersion: 0
|
|
75
|
-
}), Y =
|
|
76
|
-
state: () =>
|
|
75
|
+
}), Y = P("guidoRecommendationExtension", {
|
|
76
|
+
state: () => z(),
|
|
77
77
|
getters: {
|
|
78
78
|
// ====================================================================
|
|
79
79
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -83,7 +83,7 @@ const O = () => ({
|
|
|
83
83
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
84
84
|
*/
|
|
85
85
|
recommendationConfigs(t) {
|
|
86
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
86
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : w();
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
89
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -138,8 +138,8 @@ const O = () => ({
|
|
|
138
138
|
return [...new Set(t.map((e) => e.filterGroup))].sort((e, r) => e - r);
|
|
139
139
|
},
|
|
140
140
|
getActivePredictiveAlgorithms: (t) => {
|
|
141
|
-
const e =
|
|
142
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
141
|
+
const e = b(), r = [];
|
|
142
|
+
return t.activePredictiveAlgorithms.filter((n) => !L.includes(n)).forEach((n) => {
|
|
143
143
|
r.push(...e.filter((s) => s.id === n));
|
|
144
144
|
}), r.map((n) => ({
|
|
145
145
|
text: n.name,
|
|
@@ -157,7 +157,7 @@ const O = () => ({
|
|
|
157
157
|
getFilterList() {
|
|
158
158
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
159
159
|
let e;
|
|
160
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
160
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : v.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
161
161
|
text: t.displayName,
|
|
162
162
|
value: e,
|
|
163
163
|
type: t.attributeType
|
|
@@ -179,7 +179,7 @@ const O = () => ({
|
|
|
179
179
|
setCurrentBlock(t) {
|
|
180
180
|
this.blockStates[t] || (this.blockStates = {
|
|
181
181
|
...this.blockStates,
|
|
182
|
-
[t]:
|
|
182
|
+
[t]: C()
|
|
183
183
|
}), this.currentRecommendationId = t;
|
|
184
184
|
},
|
|
185
185
|
/**
|
|
@@ -247,7 +247,7 @@ const O = () => ({
|
|
|
247
247
|
decimalCount: String(e.currencyDecimalCount),
|
|
248
248
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
249
249
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
250
|
-
}, s = !this.blockStates[t], i = s ?
|
|
250
|
+
}, s = !this.blockStates[t], i = s ? C() : this.blockStates[t];
|
|
251
251
|
i.recommendationConfigs = {
|
|
252
252
|
...i.recommendationConfigs,
|
|
253
253
|
strategy: e.strategy,
|
|
@@ -381,7 +381,7 @@ const O = () => ({
|
|
|
381
381
|
});
|
|
382
382
|
},
|
|
383
383
|
removeStrategy() {
|
|
384
|
-
this.patchCurrentBlockConfig({ strategyId: "", size:
|
|
384
|
+
this.patchCurrentBlockConfig({ strategyId: "", size: N.size });
|
|
385
385
|
},
|
|
386
386
|
// ====================================================================
|
|
387
387
|
// Shared Data Fetching (fetched once, used by all blocks)
|
|
@@ -453,7 +453,7 @@ const O = () => ({
|
|
|
453
453
|
const n = [...e.recommendationConfigs.filters];
|
|
454
454
|
n[r] = {
|
|
455
455
|
...t,
|
|
456
|
-
isValid:
|
|
456
|
+
isValid: B(t)
|
|
457
457
|
}, e.recommendationConfigs.filters = n;
|
|
458
458
|
}
|
|
459
459
|
},
|
|
@@ -491,7 +491,7 @@ const O = () => ({
|
|
|
491
491
|
}), e.recommendationConfigs.filters = r;
|
|
492
492
|
},
|
|
493
493
|
generateFilterQuery() {
|
|
494
|
-
return
|
|
494
|
+
return k(this.recommendationConfigs.filters);
|
|
495
495
|
},
|
|
496
496
|
/**
|
|
497
497
|
* Validation-only check invoked at save-CTA time. Defined as an action
|
|
@@ -499,14 +499,7 @@ const O = () => ({
|
|
|
499
499
|
* every block's recommendationConfigs across user edits.
|
|
500
500
|
*/
|
|
501
501
|
hasInvalidBlock() {
|
|
502
|
-
return Object.values(this.blockStates).some((t) => !
|
|
503
|
-
},
|
|
504
|
-
/**
|
|
505
|
-
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
506
|
-
* that fails required-field validation, one drawer row each (SD-147430).
|
|
507
|
-
*/
|
|
508
|
-
invalidBlockIds() {
|
|
509
|
-
return Object.entries(this.blockStates).filter(([, t]) => !C(t.recommendationConfigs, this)).map(([t]) => t);
|
|
502
|
+
return Object.values(this.blockStates).some((t) => !M(t.recommendationConfigs, this));
|
|
510
503
|
},
|
|
511
504
|
// ====================================================================
|
|
512
505
|
// Per-Block Product Fetching
|
|
@@ -527,12 +520,12 @@ const O = () => ({
|
|
|
527
520
|
},
|
|
528
521
|
async _doFetchProducts() {
|
|
529
522
|
var d;
|
|
530
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n =
|
|
523
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = F();
|
|
531
524
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
532
525
|
await this._doFetchStrategyProducts(t);
|
|
533
526
|
return;
|
|
534
527
|
}
|
|
535
|
-
const s = r.filters.filter((m) => m.isValid), i =
|
|
528
|
+
const s = r.filters.filter((m) => m.isValid), i = k(s), o = ((d = b().find((m) => m.key === r.strategy)) == null ? void 0 : d.path) || "", c = parseInt(r.size) || 6, a = {
|
|
536
529
|
locale: r.language,
|
|
537
530
|
currency: r.currencySettings.value,
|
|
538
531
|
partnerName: n.partnerName,
|
|
@@ -542,7 +535,7 @@ const O = () => ({
|
|
|
542
535
|
};
|
|
543
536
|
r.strategy === "manualMerchandising" ? a.productId = A(r.productIds) : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), i && (a.filter = i), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
544
537
|
a,
|
|
545
|
-
|
|
538
|
+
x(n.partnerName, r.strategy)
|
|
546
539
|
);
|
|
547
540
|
let l;
|
|
548
541
|
try {
|
|
@@ -564,7 +557,7 @@ const O = () => ({
|
|
|
564
557
|
);
|
|
565
558
|
if (i) {
|
|
566
559
|
s = parseInt(String(i.size ?? "")) || s;
|
|
567
|
-
const o = r.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(i, o)).replaceAll("{locale}", r.language).replaceAll("{currency}", o), l = a.indexOf("?"), d = l === -1 ? a : a.slice(0, l), m = (l === -1 ? "" : a.slice(l + 1)).split("&").filter((
|
|
560
|
+
const o = r.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(i, o)).replaceAll("{locale}", r.language).replaceAll("{currency}", o), l = a.indexOf("?"), d = l === -1 ? a : a.slice(0, l), m = (l === -1 ? "" : a.slice(l + 1)).split("&").filter((I) => I && !I.startsWith("user_id=")), y = m.length ? `${d}?${m.join("&")}` : d;
|
|
568
561
|
y && (n = await u.fetchRecommendationProductsByUrl(y));
|
|
569
562
|
}
|
|
570
563
|
} catch {
|
|
@@ -575,10 +568,10 @@ const O = () => ({
|
|
|
575
568
|
_setBlockProducts(t, e, r) {
|
|
576
569
|
if (!this.blockStates[t])
|
|
577
570
|
return;
|
|
578
|
-
const n = e.length > 0 ? e :
|
|
571
|
+
const n = e.length > 0 ? e : R(r);
|
|
579
572
|
this.blockStates[t].recommendationProducts = [
|
|
580
573
|
...n.slice(0, r),
|
|
581
|
-
...
|
|
574
|
+
...R(Math.max(0, r - n.length))
|
|
582
575
|
];
|
|
583
576
|
}
|
|
584
577
|
}
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-050dfa52]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-050dfa52]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-050dfa52]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
package/dist/library.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { MessageType as
|
|
1
|
+
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
+
import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { assignTrackingIds as
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
|
|
5
|
+
import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
|
|
6
|
+
import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
a as Guido,
|
|
9
|
+
t as MessageType,
|
|
10
|
+
d as ProductType,
|
|
11
|
+
u as assignTrackingIds,
|
|
12
|
+
s as getValidationErrors,
|
|
12
13
|
p as isValidConfig,
|
|
13
14
|
g as parseConfig,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
m as parseConfigSafe,
|
|
16
|
+
x as readTrackFloor,
|
|
17
|
+
T as readTrackSeq,
|
|
18
|
+
C as useGuidoEmailEditorStore,
|
|
19
|
+
n as validateConfig
|
|
18
20
|
};
|
|
@@ -395,8 +395,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
395
395
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
396
396
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
397
397
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
398
|
-
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
399
|
-
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
400
398
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
401
399
|
}, undefined>;
|
|
402
400
|
/**
|
|
@@ -797,8 +795,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
797
795
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
798
796
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
799
797
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
800
|
-
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
801
|
-
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
802
798
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
803
799
|
}, undefined>, {}>;
|
|
804
800
|
/** Block configuration */
|
|
@@ -15,23 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
15
15
|
close: () => void;
|
|
16
16
|
};
|
|
17
17
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
|
-
saveSilent: () => Promise<
|
|
19
|
-
dynamicContentList: import("@@/Types/generic").DynamicContent[];
|
|
20
|
-
compiledHtml: string;
|
|
21
|
-
rawHtml: string;
|
|
22
|
-
css: string;
|
|
23
|
-
ampHtml: string;
|
|
24
|
-
ampErrors: string[];
|
|
25
|
-
modules: number[];
|
|
26
|
-
recommendation: {
|
|
27
|
-
campaignUrls: Record<string, import("../@types/recommendation").RecommendationCampaignUrlValue>;
|
|
28
|
-
configs: Record<string, string>;
|
|
29
|
-
};
|
|
30
|
-
unsubscribe: {
|
|
31
|
-
status: boolean;
|
|
32
|
-
config: number[];
|
|
33
|
-
};
|
|
34
|
-
} | undefined> | undefined;
|
|
18
|
+
saveSilent: () => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
35
19
|
setLoading: (value: boolean) => void;
|
|
36
20
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
37
21
|
"dynamic-content:open": (detail: {
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -10,11 +10,11 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var
|
|
13
|
+
declare var __VLS_12: {}, __VLS_14: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
headerBottomSlot?: (props: typeof
|
|
15
|
+
headerBottomSlot?: (props: typeof __VLS_12) => any;
|
|
16
16
|
} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_14) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
20
|
className: string;
|
|
@@ -26,7 +26,6 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
26
|
cancelOrBackButtonEvent: () => void;
|
|
27
27
|
onCloseEvent: () => void;
|
|
28
28
|
primaryButtonEvent: () => void;
|
|
29
|
-
secondaryButtonEvent: () => void;
|
|
30
29
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
31
30
|
className: string;
|
|
32
31
|
size: string;
|
|
@@ -99,7 +99,6 @@ export declare const useConfig: () => {
|
|
|
99
99
|
autosave: boolean;
|
|
100
100
|
allowlistEnabled: boolean;
|
|
101
101
|
linkTrackingIds: boolean;
|
|
102
|
-
allowSaveWithErrors: boolean;
|
|
103
102
|
reusableRecommendationStrategy: boolean;
|
|
104
103
|
};
|
|
105
104
|
blocks: {
|
|
@@ -235,7 +234,6 @@ export declare const useConfig: () => {
|
|
|
235
234
|
autosave: boolean;
|
|
236
235
|
allowlistEnabled: boolean;
|
|
237
236
|
linkTrackingIds: boolean;
|
|
238
|
-
allowSaveWithErrors: boolean;
|
|
239
237
|
reusableRecommendationStrategy: boolean;
|
|
240
238
|
} | null>;
|
|
241
239
|
blocks: import("vue").ComputedRef<{
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Outbound bridge — publishes the current editor's html/css to the shared
|
|
3
|
-
* Pinia store `guidoEmailEditor
|
|
4
|
-
*
|
|
3
|
+
* Pinia store `guidoEmailEditor`. cortex-fe reads it at chat-stream submit
|
|
4
|
+
* time and forwards it as `clientState.editor`, which is what enables
|
|
5
5
|
* sub-case 1.3 (refine an already-loaded template via the email-agent).
|
|
6
6
|
*
|
|
7
7
|
* The bridge writes on three triggers:
|
|
8
8
|
*
|
|
9
9
|
* 1. Stripo finishes initializing — first snapshot.
|
|
10
|
-
* 2.
|
|
11
|
-
* Stripo edit doesn't thrash the store.
|
|
10
|
+
* 2. Every document change, via the `changeSeq` counter — debounced 500 ms
|
|
11
|
+
* so a streaming Stripo edit doesn't thrash the store.
|
|
12
12
|
* 3. Editor `hasChanges` flips back to false (post-save / autosave) —
|
|
13
13
|
* immediate, since this is the canonical "saved" snapshot.
|
|
14
14
|
*
|
|
15
15
|
* `getTemplateData()` is a Stripo iframe call; it must not run before
|
|
16
16
|
* `isStripoInitialized` is true. The bridge guards against that.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The store is written even with no reader attached — it has zero overhead,
|
|
19
|
+
* and a late reader still finds consistent state.
|
|
20
|
+
*
|
|
21
|
+
* Readers are not optional any more, so treat the publish timing as part of
|
|
22
|
+
* the contract: the store ships as `@useinsider/guido/editor-state`, and
|
|
23
|
+
* email-fe imports it to scan the live html for its Array of Objects lock.
|
|
24
|
+
* Weakening a trigger here silently breaks that lock in the consumer.
|
|
21
25
|
*/
|
|
22
26
|
export declare const useGuidoStateBridge: () => void;
|