@useinsider/guido 3.18.1-beta.e39fb14 → 3.18.1-beta.e609a33
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 +0 -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/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +34 -41
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +39 -37
- 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/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/stores/config.d.ts +0 -30
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +22 -39
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +1 -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,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 b, getOperatorOptions as G, PriceAttributes 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 P } from "../../../../stores/config.js";
|
|
4
|
+
import { defineStore as F } 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, h = null, g = 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,
|
|
@@ -59,7 +59,7 @@ function w() {
|
|
|
59
59
|
filterSnapshot: null
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const z = () => ({
|
|
63
63
|
recommendationCampaignUrls: {},
|
|
64
64
|
activePredictiveAlgorithms: [],
|
|
65
65
|
languages: {},
|
|
@@ -71,8 +71,8 @@ const O = () => ({
|
|
|
71
71
|
blockStates: {},
|
|
72
72
|
currentRecommendationId: null,
|
|
73
73
|
configVersion: 0
|
|
74
|
-
}), Y =
|
|
75
|
-
state: () =>
|
|
74
|
+
}), Y = F("guidoRecommendationExtension", {
|
|
75
|
+
state: () => z(),
|
|
76
76
|
getters: {
|
|
77
77
|
// ====================================================================
|
|
78
78
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -82,7 +82,7 @@ const O = () => ({
|
|
|
82
82
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
83
83
|
*/
|
|
84
84
|
recommendationConfigs(t) {
|
|
85
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
85
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : w();
|
|
86
86
|
},
|
|
87
87
|
/**
|
|
88
88
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -138,7 +138,7 @@ const O = () => ({
|
|
|
138
138
|
},
|
|
139
139
|
getActivePredictiveAlgorithms: (t) => {
|
|
140
140
|
const e = b(), r = [];
|
|
141
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
141
|
+
return t.activePredictiveAlgorithms.filter((n) => !L.includes(n)).forEach((n) => {
|
|
142
142
|
r.push(...e.filter((s) => s.id === n));
|
|
143
143
|
}), r.map((n) => ({
|
|
144
144
|
text: n.name,
|
|
@@ -156,7 +156,7 @@ const O = () => ({
|
|
|
156
156
|
getFilterList() {
|
|
157
157
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
158
158
|
let e;
|
|
159
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
159
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : v.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
160
160
|
text: t.displayName,
|
|
161
161
|
value: e,
|
|
162
162
|
type: t.attributeType
|
|
@@ -178,7 +178,7 @@ const O = () => ({
|
|
|
178
178
|
setCurrentBlock(t) {
|
|
179
179
|
this.blockStates[t] || (this.blockStates = {
|
|
180
180
|
...this.blockStates,
|
|
181
|
-
[t]:
|
|
181
|
+
[t]: C()
|
|
182
182
|
}), this.currentRecommendationId = t;
|
|
183
183
|
},
|
|
184
184
|
/**
|
|
@@ -246,7 +246,7 @@ const O = () => ({
|
|
|
246
246
|
decimalCount: String(e.currencyDecimalCount),
|
|
247
247
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
248
248
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
249
|
-
}, s = !this.blockStates[t], i = s ?
|
|
249
|
+
}, s = !this.blockStates[t], i = s ? C() : this.blockStates[t];
|
|
250
250
|
i.recommendationConfigs = {
|
|
251
251
|
...i.recommendationConfigs,
|
|
252
252
|
strategy: e.strategy,
|
|
@@ -380,7 +380,7 @@ const O = () => ({
|
|
|
380
380
|
});
|
|
381
381
|
},
|
|
382
382
|
removeStrategy() {
|
|
383
|
-
this.patchCurrentBlockConfig({ strategyId: "", size:
|
|
383
|
+
this.patchCurrentBlockConfig({ strategyId: "", size: N.size });
|
|
384
384
|
},
|
|
385
385
|
// ====================================================================
|
|
386
386
|
// Shared Data Fetching (fetched once, used by all blocks)
|
|
@@ -452,7 +452,7 @@ const O = () => ({
|
|
|
452
452
|
const n = [...e.recommendationConfigs.filters];
|
|
453
453
|
n[r] = {
|
|
454
454
|
...t,
|
|
455
|
-
isValid:
|
|
455
|
+
isValid: B(t)
|
|
456
456
|
}, e.recommendationConfigs.filters = n;
|
|
457
457
|
}
|
|
458
458
|
},
|
|
@@ -490,7 +490,7 @@ const O = () => ({
|
|
|
490
490
|
}), e.recommendationConfigs.filters = r;
|
|
491
491
|
},
|
|
492
492
|
generateFilterQuery() {
|
|
493
|
-
return
|
|
493
|
+
return k(this.recommendationConfigs.filters);
|
|
494
494
|
},
|
|
495
495
|
/**
|
|
496
496
|
* Validation-only check invoked at save-CTA time. Defined as an action
|
|
@@ -498,14 +498,7 @@ const O = () => ({
|
|
|
498
498
|
* every block's recommendationConfigs across user edits.
|
|
499
499
|
*/
|
|
500
500
|
hasInvalidBlock() {
|
|
501
|
-
return Object.values(this.blockStates).some((t) => !
|
|
502
|
-
},
|
|
503
|
-
/**
|
|
504
|
-
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
505
|
-
* that fails required-field validation, one drawer row each (SD-147430).
|
|
506
|
-
*/
|
|
507
|
-
invalidBlockIds() {
|
|
508
|
-
return Object.entries(this.blockStates).filter(([, t]) => !C(t.recommendationConfigs, this)).map(([t]) => t);
|
|
501
|
+
return Object.values(this.blockStates).some((t) => !M(t.recommendationConfigs, this));
|
|
509
502
|
},
|
|
510
503
|
// ====================================================================
|
|
511
504
|
// Per-Block Product Fetching
|
|
@@ -526,12 +519,12 @@ const O = () => ({
|
|
|
526
519
|
},
|
|
527
520
|
async _doFetchProducts() {
|
|
528
521
|
var d;
|
|
529
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n =
|
|
522
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = P();
|
|
530
523
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
531
524
|
await this._doFetchStrategyProducts(t);
|
|
532
525
|
return;
|
|
533
526
|
}
|
|
534
|
-
const s = r.filters.filter((m) => m.isValid), i =
|
|
527
|
+
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 = {
|
|
535
528
|
locale: r.language,
|
|
536
529
|
currency: r.currencySettings.value,
|
|
537
530
|
partnerName: n.partnerName,
|
|
@@ -541,7 +534,7 @@ const O = () => ({
|
|
|
541
534
|
};
|
|
542
535
|
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(
|
|
543
536
|
a,
|
|
544
|
-
|
|
537
|
+
x(n.partnerName, r.strategy)
|
|
545
538
|
);
|
|
546
539
|
let l;
|
|
547
540
|
try {
|
|
@@ -574,10 +567,10 @@ const O = () => ({
|
|
|
574
567
|
_setBlockProducts(t, e, r) {
|
|
575
568
|
if (!this.blockStates[t])
|
|
576
569
|
return;
|
|
577
|
-
const n = e.length > 0 ? e :
|
|
570
|
+
const n = e.length > 0 ? e : R(r);
|
|
578
571
|
this.blockStates[t].recommendationProducts = [
|
|
579
572
|
...n.slice(0, r),
|
|
580
|
-
...
|
|
573
|
+
...R(Math.max(0, r - n.length))
|
|
581
574
|
];
|
|
582
575
|
}
|
|
583
576
|
}
|
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}
|
|
@@ -4,91 +4,93 @@ import { useToaster as C } from "../composables/useToaster.js";
|
|
|
4
4
|
import { useTranslations as h } from "../composables/useTranslations.js";
|
|
5
5
|
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
6
|
import { EditorType as v } from "../enums/defaults.js";
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
7
|
+
import { ToasterTypeOptions as x } from "../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
9
|
import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
|
|
10
|
-
import { base64EncodeWithSpecialChars as
|
|
11
|
-
import { useTemplatePreparation as
|
|
12
|
-
const
|
|
13
|
-
const { get:
|
|
10
|
+
import { base64EncodeWithSpecialChars as s } from "../utils/base64.js";
|
|
11
|
+
import { useTemplatePreparation as N } from "../utils/templatePreparation.js";
|
|
12
|
+
const _ = () => {
|
|
13
|
+
const { get: m, post: c } = b(), { handleError: i, showToaster: l } = C(), { config: p, isFeatureEnabled: u } = w(), { validateLiquidSyntax: f } = S(), y = h();
|
|
14
14
|
return {
|
|
15
15
|
getCategories: async () => {
|
|
16
16
|
try {
|
|
17
|
-
const { data: e = [] } = await
|
|
17
|
+
const { data: e = [] } = await m("/newsletter/template-library/get-template-categories");
|
|
18
18
|
return e;
|
|
19
19
|
} catch (e) {
|
|
20
|
-
return
|
|
20
|
+
return i(e, "Failed to fetch template categories"), [];
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
checkTemplateNameAvailability: async (e) => {
|
|
24
|
-
const { data: { status: t = !1 } } = await
|
|
24
|
+
const { data: { status: t = !1 } } = await m(
|
|
25
25
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
26
26
|
);
|
|
27
27
|
return !t;
|
|
28
28
|
},
|
|
29
29
|
createCategory: async (e) => {
|
|
30
30
|
try {
|
|
31
|
-
const { data: { id: t } } = await
|
|
31
|
+
const { data: { id: t } } = await c(
|
|
32
32
|
"/newsletter/template-library/create-category",
|
|
33
33
|
{ name: e }
|
|
34
34
|
);
|
|
35
35
|
return t.toString();
|
|
36
36
|
} catch (t) {
|
|
37
|
-
return
|
|
37
|
+
return i(t, "Failed to create category"), "";
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
createTemplate: async () => {
|
|
41
|
-
var e, t, d,
|
|
41
|
+
var e, t, d, g;
|
|
42
42
|
try {
|
|
43
|
-
const { prepareTemplateDetails:
|
|
44
|
-
if (
|
|
43
|
+
const { prepareTemplateDetails: n } = N(), o = E(), a = await n();
|
|
44
|
+
if (u("liquidSyntax") && !await f(a.compiledHtml))
|
|
45
45
|
return !1;
|
|
46
|
-
const
|
|
47
|
-
name:
|
|
48
|
-
categories:
|
|
49
|
-
productId: ((t = (e =
|
|
46
|
+
const T = {
|
|
47
|
+
name: o.getTemplateName,
|
|
48
|
+
categories: o.getSelectedCategoryIds,
|
|
49
|
+
productId: ((t = (e = p.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
50
50
|
editorType: v,
|
|
51
|
-
messageType: ((
|
|
52
|
-
content:
|
|
53
|
-
css:
|
|
51
|
+
messageType: ((g = (d = p.value) == null ? void 0 : d.partner) == null ? void 0 : g.messageType) || 0,
|
|
52
|
+
content: s(a.compiledHtml),
|
|
53
|
+
css: s(a.css),
|
|
54
54
|
unsubscriptionPreferencePageStatus: !1,
|
|
55
55
|
unsubscriptionPreferencePages: [],
|
|
56
|
-
recommendationCampaignUrls:
|
|
57
|
-
|
|
56
|
+
recommendationCampaignUrls: s(
|
|
57
|
+
A().recommendationCampaignUrls
|
|
58
58
|
),
|
|
59
|
-
recommendationConfigs:
|
|
59
|
+
recommendationConfigs: s({}),
|
|
60
60
|
isGuido: !0,
|
|
61
61
|
// eslint-disable-next-line camelcase
|
|
62
|
-
template_engine:
|
|
63
|
-
stripoConfig:
|
|
62
|
+
template_engine: u("liquidSyntax") ? 1 : 0,
|
|
63
|
+
stripoConfig: s({
|
|
64
64
|
editor: "stripo",
|
|
65
65
|
html: a.rawHtml,
|
|
66
66
|
css: a.css,
|
|
67
67
|
dynamicContentList: a.dynamicContentList
|
|
68
68
|
})
|
|
69
|
-
}, { data:
|
|
69
|
+
}, { data: r } = await c(
|
|
70
70
|
"/newsletter/template-library/create-template",
|
|
71
|
-
|
|
71
|
+
T
|
|
72
72
|
);
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
if (!r || typeof r != "object" || Array.isArray(r) || r instanceof Blob)
|
|
74
|
+
throw new Error("Unexpected create-template response");
|
|
75
|
+
return r.type === "alert" ? (l({
|
|
76
|
+
message: y(
|
|
75
77
|
"newsletter.template-library-save-alert",
|
|
76
|
-
{ templateName:
|
|
78
|
+
{ templateName: o.getTemplateName }
|
|
77
79
|
),
|
|
78
|
-
type:
|
|
80
|
+
type: x.Error
|
|
79
81
|
}), !1) : (l({
|
|
80
|
-
message:
|
|
82
|
+
message: y(
|
|
81
83
|
"newsletter.template-library-save-success",
|
|
82
|
-
{ templateName:
|
|
84
|
+
{ templateName: o.getTemplateName }
|
|
83
85
|
),
|
|
84
86
|
type: "success"
|
|
85
87
|
}), !0);
|
|
86
|
-
} catch (
|
|
87
|
-
return
|
|
88
|
+
} catch (n) {
|
|
89
|
+
return i(n, "Failed to create template"), !1;
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
};
|
|
91
93
|
};
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
_ as useTemplateLibraryApi
|
|
94
96
|
};
|
|
@@ -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,12 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
2
|
import type { FiltersResponse } from '@@/Types/recommendation';
|
|
3
|
-
/**
|
|
4
|
-
* Extracts recommendation block IDs directly from the HTML by parsing
|
|
5
|
-
* the recommendation-id attribute on block elements.
|
|
6
|
-
* This avoids depending on store state which may not be populated
|
|
7
|
-
* when the settings panel hasn't been opened yet (e.g., saved templates).
|
|
8
|
-
*/
|
|
9
|
-
export declare function getRecommendationBlockIds(html: string): string[];
|
|
10
3
|
/**
|
|
11
4
|
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
12
5
|
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
@@ -34,20 +27,6 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
|
|
|
34
27
|
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
35
28
|
*/
|
|
36
29
|
export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
|
|
37
|
-
/**
|
|
38
|
-
* Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
|
|
39
|
-
*
|
|
40
|
-
* A tag's variable name is the part before the first `|` (everything after it is the fallback).
|
|
41
|
-
* Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
|
|
42
|
-
* is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
|
|
43
|
-
* present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
|
|
44
|
-
* `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
|
|
45
|
-
*
|
|
46
|
-
* `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
|
|
47
|
-
* store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
|
|
48
|
-
* backend resolves through its own pipeline, so they must not be treated as user-authored tags.
|
|
49
|
-
*/
|
|
50
|
-
export declare function getInvalidDynamicContentTags(html: string): string[];
|
|
51
30
|
export declare const useHtmlValidator: () => {
|
|
52
31
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
53
32
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
-
type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
|
|
3
|
-
type SaveResult = SaveDetails | undefined;
|
|
4
2
|
export declare const useSave: () => {
|
|
5
|
-
save: (suppressEmit?: boolean, silent?: boolean) => Promise<
|
|
6
|
-
saveWithErrors: () => Promise<SaveResult>;
|
|
7
|
-
saveRawOnly: () => Promise<SaveResult>;
|
|
3
|
+
save: (suppressEmit?: boolean, silent?: boolean) => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined>;
|
|
8
4
|
};
|
|
9
|
-
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare const COUPON_TAG_MODIFIED_KEY = "newsletter.coupon-tag-modified";
|
|
2
|
-
/** Pure core: the tag text of every coupon block whose code was modified. */
|
|
3
|
-
export declare function findInvalidCouponBlocks(html: string): string[];
|
|
4
1
|
export declare const useCouponBlockValidator: () => {
|
|
5
2
|
validateCouponBlockTags: (html: string) => boolean;
|
|
6
3
|
};
|