@useinsider/guido 3.17.0-beta.dc7f4d2 → 3.17.0-beta.ddd4dde
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 +5 -5
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +76 -78
- 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 +43 -74
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
- 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/useSave.js +41 -84
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Items/block.js +98 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
- package/dist/guido.css +1 -1
- 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/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/Items/block.d.ts +21 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/stores/config.d.ts +0 -5
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +6 -13
- package/dist/utils/pairProductVariables.js +60 -59
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +2 -2
- 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,21 +1,21 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as g, getOperatorOptions as
|
|
2
|
-
import { useRecommendationApi as
|
|
3
|
-
import { useConfigStore as
|
|
4
|
-
import { defineStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as C } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
|
|
3
|
+
import { useConfigStore as G } 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
|
|
6
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as F, DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
|
|
7
7
|
import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
|
|
8
8
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
9
9
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
10
|
-
import { getPartnerRecommendationParams as
|
|
11
|
-
import { sanitizeProductIds as
|
|
12
|
-
import { isFilterValid as
|
|
13
|
-
import { isConfigValid as
|
|
14
|
-
const h =
|
|
10
|
+
import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
|
|
11
|
+
import { sanitizeProductIds as N } from "../utils/productIds.js";
|
|
12
|
+
import { isFilterValid as x } from "../validation/filterSchema.js";
|
|
13
|
+
import { isConfigValid as L } from "../validation/requiredFields.js";
|
|
14
|
+
const h = y();
|
|
15
15
|
let m = null, u = null, d = null;
|
|
16
|
-
function
|
|
16
|
+
function k() {
|
|
17
17
|
return {
|
|
18
|
-
cardsInRow:
|
|
18
|
+
cardsInRow: D,
|
|
19
19
|
currencySettings: {
|
|
20
20
|
name: "USD",
|
|
21
21
|
value: "USD",
|
|
@@ -29,7 +29,7 @@ function R() {
|
|
|
29
29
|
productIds: [],
|
|
30
30
|
id: 1,
|
|
31
31
|
language: "en_US",
|
|
32
|
-
mobileCardsInRow:
|
|
32
|
+
mobileCardsInRow: F,
|
|
33
33
|
mobileLayoutEnabled: !1,
|
|
34
34
|
orientation: "grid",
|
|
35
35
|
recommendedProducts: [],
|
|
@@ -44,9 +44,9 @@ function R() {
|
|
|
44
44
|
priceHideIfSameAsDiscounted: !1
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function I() {
|
|
48
48
|
return {
|
|
49
|
-
recommendationConfigs:
|
|
49
|
+
recommendationConfigs: k(),
|
|
50
50
|
recommendationProducts: [],
|
|
51
51
|
filterStatus: !1,
|
|
52
52
|
filterSelectionDrawerStatus: !1,
|
|
@@ -64,7 +64,7 @@ const U = () => ({
|
|
|
64
64
|
blockStates: {},
|
|
65
65
|
currentRecommendationId: null,
|
|
66
66
|
configVersion: 0
|
|
67
|
-
}), H =
|
|
67
|
+
}), H = P("guidoRecommendationExtension", {
|
|
68
68
|
state: () => U(),
|
|
69
69
|
getters: {
|
|
70
70
|
// ====================================================================
|
|
@@ -75,7 +75,7 @@ const U = () => ({
|
|
|
75
75
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
76
76
|
*/
|
|
77
77
|
recommendationConfigs(t) {
|
|
78
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
78
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : k();
|
|
79
79
|
},
|
|
80
80
|
/**
|
|
81
81
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -139,7 +139,7 @@ const U = () => ({
|
|
|
139
139
|
getFilterList() {
|
|
140
140
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
141
141
|
let e;
|
|
142
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
142
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : C.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
143
143
|
text: t.displayName,
|
|
144
144
|
value: e,
|
|
145
145
|
type: t.attributeType
|
|
@@ -161,7 +161,7 @@ const U = () => ({
|
|
|
161
161
|
setCurrentBlock(t) {
|
|
162
162
|
this.blockStates[t] || (this.blockStates = {
|
|
163
163
|
...this.blockStates,
|
|
164
|
-
[t]:
|
|
164
|
+
[t]: I()
|
|
165
165
|
}), this.currentRecommendationId = t;
|
|
166
166
|
},
|
|
167
167
|
/**
|
|
@@ -229,7 +229,7 @@ const U = () => ({
|
|
|
229
229
|
decimalCount: String(e.currencyDecimalCount),
|
|
230
230
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
231
231
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
232
|
-
}, c = !this.blockStates[t], i = c ?
|
|
232
|
+
}, c = !this.blockStates[t], i = c ? I() : this.blockStates[t];
|
|
233
233
|
i.recommendationConfigs = {
|
|
234
234
|
...i.recommendationConfigs,
|
|
235
235
|
strategy: e.strategy,
|
|
@@ -267,7 +267,7 @@ const U = () => ({
|
|
|
267
267
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
268
268
|
*/
|
|
269
269
|
createDefaultFilter(t, e) {
|
|
270
|
-
const [r] = this.getFilterList, [n] =
|
|
270
|
+
const [r] = this.getFilterList, [n] = R(r == null ? void 0 : r.type);
|
|
271
271
|
return {
|
|
272
272
|
type: "standardFilter",
|
|
273
273
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
@@ -384,7 +384,7 @@ const U = () => ({
|
|
|
384
384
|
const n = [...e.recommendationConfigs.filters];
|
|
385
385
|
n[r] = {
|
|
386
386
|
...t,
|
|
387
|
-
isValid:
|
|
387
|
+
isValid: x(t)
|
|
388
388
|
}, e.recommendationConfigs.filters = n;
|
|
389
389
|
}
|
|
390
390
|
},
|
|
@@ -430,14 +430,7 @@ const U = () => ({
|
|
|
430
430
|
* every block's recommendationConfigs across user edits.
|
|
431
431
|
*/
|
|
432
432
|
hasInvalidBlock() {
|
|
433
|
-
return Object.values(this.blockStates).some((t) => !
|
|
434
|
-
},
|
|
435
|
-
/**
|
|
436
|
-
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
437
|
-
* that fails required-field validation, one drawer row each (SD-147430).
|
|
438
|
-
*/
|
|
439
|
-
invalidBlockIds() {
|
|
440
|
-
return Object.entries(this.blockStates).filter(([, t]) => !I(t.recommendationConfigs, this)).map(([t]) => t);
|
|
433
|
+
return Object.values(this.blockStates).some((t) => !L(t.recommendationConfigs, this));
|
|
441
434
|
},
|
|
442
435
|
// ====================================================================
|
|
443
436
|
// Per-Block Product Fetching
|
|
@@ -458,7 +451,7 @@ const U = () => ({
|
|
|
458
451
|
},
|
|
459
452
|
async _doFetchProducts() {
|
|
460
453
|
var p;
|
|
461
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o =
|
|
454
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = G(), s = parseInt(r.size) || 6, a = {
|
|
462
455
|
locale: r.language,
|
|
463
456
|
currency: r.currencySettings.value,
|
|
464
457
|
partnerName: o.partnerName,
|
|
@@ -466,9 +459,9 @@ const U = () => ({
|
|
|
466
459
|
details: !0,
|
|
467
460
|
campaignId: o.variationId
|
|
468
461
|
};
|
|
469
|
-
r.strategy === "manualMerchandising" ? a.productId =
|
|
462
|
+
r.strategy === "manualMerchandising" ? a.productId = N(r.productIds) : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
470
463
|
a,
|
|
471
|
-
|
|
464
|
+
v(o.partnerName, r.strategy)
|
|
472
465
|
);
|
|
473
466
|
let f;
|
|
474
467
|
try {
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-
|
|
1
|
+
.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-6e711fd7]{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-b0d3b445]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b0d3b445]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b0d3b445]{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}
|
|
@@ -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, string>;
|
|
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, string>;
|
|
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, string>;
|
|
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, string>;
|
|
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;
|
|
@@ -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
|
};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
declare const SINGLETON_BLOCK_RULES: {
|
|
2
|
-
pageType: number;
|
|
3
|
-
messageKey: string;
|
|
4
|
-
}[];
|
|
5
|
-
export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
|
|
6
|
-
/** Pure core: the singleton rules whose page type appears more than once. */
|
|
7
|
-
export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
|
|
8
|
-
/** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
|
|
9
|
-
export declare function countUnsubBlocksWithoutPage(html: string): number;
|
|
10
1
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
11
2
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
12
3
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
13
4
|
};
|
|
14
|
-
export {};
|
|
@@ -16,6 +16,8 @@ export declare const BLOCK_ID: BlockId;
|
|
|
16
16
|
* - Onboarding support
|
|
17
17
|
*/
|
|
18
18
|
export declare class ItemsBlock extends Block {
|
|
19
|
+
/** Block instances whose currency attrs were already self-healed this session (SD-147588 — undo-safe). */
|
|
20
|
+
private _currencyHealed;
|
|
19
21
|
getId(): string;
|
|
20
22
|
getIcon(): string;
|
|
21
23
|
getBlockCompositionType(): BlockCompositionType;
|
|
@@ -42,4 +44,23 @@ export declare class ItemsBlock extends Block {
|
|
|
42
44
|
* relies on this td-level fallback in pairProductVariables.
|
|
43
45
|
*/
|
|
44
46
|
private _stampProductTdDomAttributes;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the currency self-heal should run for this block. Two guards (SD-147588):
|
|
49
|
+
* 1. Config is only authoritative when the symbol was actually customized — a symbol still at
|
|
50
|
+
* the 'USD' sentinel may be a migrator default, so we trust the DOM's real value over a
|
|
51
|
+
* defaulted config and never overwrite it.
|
|
52
|
+
* 2. Heal each instance at most once per session, so the auto-fix can't fight undo (undo
|
|
53
|
+
* re-drifts the attr, which would otherwise re-trigger the heal forever).
|
|
54
|
+
*/
|
|
55
|
+
private _shouldReconcileCurrency;
|
|
56
|
+
/** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
|
|
57
|
+
private _markCurrencyHealed;
|
|
58
|
+
/**
|
|
59
|
+
* Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
|
|
60
|
+
* attrs drifted (e.g. a location toggle before the sync fix) self-heals to match the editor.
|
|
61
|
+
* Config is the source of truth — never derive from visible text. Callers gate this with
|
|
62
|
+
* `_shouldReconcileCurrency`. Returns true only when an attr actually changed, so the caller can
|
|
63
|
+
* skip an empty apply that would otherwise re-trigger onDocumentChanged and loop (SD-147588).
|
|
64
|
+
*/
|
|
65
|
+
private _reconcileCurrencyDomAttributes;
|
|
45
66
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single owner for the Items price currency export contract (SD-147588).
|
|
3
|
+
*
|
|
4
|
+
* `data-curency` is deliberately misspelled (one `r`) — it is the attribute the
|
|
5
|
+
* server-side export transform (pairProductVariables) actually reads, so every
|
|
6
|
+
* layer that writes it and the live reader (template, controls, block self-heal,
|
|
7
|
+
* pairProductVariables) MUST go through these constants. A typo fix or mapping change
|
|
8
|
+
* in one of them would otherwise silently break sync with the others and ship the wrong
|
|
9
|
+
* currency position/token to the inbox. Mirrors the Recommendation block's `CURRENCY_ATTR`.
|
|
10
|
+
*
|
|
11
|
+
* Exception: the legacy migrator reads the raw misspelled string on purpose — it parses
|
|
12
|
+
* old templates frozen with that exact attr name, so it must NOT follow a future rename here.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ITEMS_CURRENCY_ATTR: {
|
|
15
|
+
readonly POSITION: "data-curency";
|
|
16
|
+
readonly SYMBOL: "data-currency_symbol";
|
|
17
|
+
};
|
|
18
|
+
/** Currency location select value `'1'` = after (price then symbol), anything else = before. */
|
|
19
|
+
export declare function currencyPositionFromLocation(location: string | undefined): 'after' | 'before';
|
|
@@ -286,11 +286,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
286
286
|
* every block's recommendationConfigs across user edits.
|
|
287
287
|
*/
|
|
288
288
|
hasInvalidBlock(): boolean;
|
|
289
|
-
/**
|
|
290
|
-
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
291
|
-
* that fails required-field validation, one drawer row each (SD-147430).
|
|
292
|
-
*/
|
|
293
|
-
invalidBlockIds(): string[];
|
|
294
289
|
fetchRecommendationProducts(): Promise<void>;
|
|
295
290
|
_doFetchProducts(): Promise<void>;
|
|
296
291
|
}>;
|
|
@@ -2106,11 +2106,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2106
2106
|
};
|
|
2107
2107
|
} | null;
|
|
2108
2108
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
2109
|
-
/**
|
|
2110
|
-
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
2111
|
-
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
2112
|
-
*/
|
|
2113
|
-
isTransactional(): boolean;
|
|
2114
2109
|
/**
|
|
2115
2110
|
* Get the username
|
|
2116
2111
|
*/
|
|
@@ -15,36 +15,6 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
|
15
15
|
* same source), so it is reliably present regardless of how the block was added.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getHtmlReferencedUnsubscribePages(html: string): number[];
|
|
18
|
-
/**
|
|
19
|
-
* Hydrates the recommendation extension store from the persisted `esd-ext-config`
|
|
20
|
-
* JSON blob on each `.recommendation-block-v2` element in the raw editor HTML.
|
|
21
|
-
*
|
|
22
|
-
* Why this runs before `compileHtml`:
|
|
23
|
-
* The HTML compiler's `prepareRecommendationBlocks` rule asks
|
|
24
|
-
* `useRecommendation.buildCampaignUrl(id)` to assemble each block's API URL
|
|
25
|
-
* from `blockStates[id].recommendationConfigs`. That Pinia entry is normally
|
|
26
|
-
* populated by `RecommendationBlockControl._syncNodeConfigToStore`, which
|
|
27
|
-
* only fires when the user *selects* the block. Saving without ever
|
|
28
|
-
* selecting a migrated block would otherwise build the URL from empty/
|
|
29
|
-
* default state and the campaign URL would not be saved.
|
|
30
|
-
*
|
|
31
|
-
* Why we read raw HTML, not compiled HTML:
|
|
32
|
-
* Stripo's `compileEmail()` strips editor-only attributes (`esd-*`) from the
|
|
33
|
-
* compiled output, so `esd-ext-config` is gone by the time the compiler
|
|
34
|
-
* pipeline sees the HTML. The raw HTML from `getTemplateData()` preserves
|
|
35
|
-
* the attribute as the migrator wrote it.
|
|
36
|
-
*
|
|
37
|
-
* Reference data pre-load:
|
|
38
|
-
* When the template has recommendation blocks, this also pre-loads the
|
|
39
|
-
* shared reference data (languages / currency list) so the save-time
|
|
40
|
-
* required-fields validator can check each block's locale and currency
|
|
41
|
-
* against the partner's real options. Best-effort — on a fetch failure the
|
|
42
|
-
* validator degrades to its empty-list guard (`requiredFields.ts`) instead
|
|
43
|
-
* of blocking the save or stranding the Save button.
|
|
44
|
-
*/
|
|
45
|
-
declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
|
|
46
18
|
export declare const useTemplatePreparation: () => {
|
|
47
19
|
prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
|
|
48
|
-
hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
|
|
49
20
|
};
|
|
50
|
-
export {};
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../@types/config/schemas.js";
|
|
2
2
|
import "../@types/config/defaults.js";
|
|
3
|
-
import { parseConfig as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
const
|
|
3
|
+
import { parseConfig as o } from "../@types/config/validator.js";
|
|
4
|
+
import { defineStore as r } from "pinia";
|
|
5
|
+
const f = r("guido-config", {
|
|
6
6
|
state: () => ({
|
|
7
7
|
initialized: !1,
|
|
8
8
|
config: null
|
|
@@ -113,13 +113,6 @@ const g = a("guido-config", {
|
|
|
113
113
|
var e, n;
|
|
114
114
|
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
|
|
115
115
|
},
|
|
116
|
-
/**
|
|
117
|
-
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
118
|
-
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
119
|
-
*/
|
|
120
|
-
isTransactional() {
|
|
121
|
-
return this.messageType === o.TRANSACTIONAL;
|
|
122
|
-
},
|
|
123
116
|
/**
|
|
124
117
|
* Get the username
|
|
125
118
|
*/
|
|
@@ -150,7 +143,7 @@ const g = a("guido-config", {
|
|
|
150
143
|
* Initialize the config store with validated configuration
|
|
151
144
|
*/
|
|
152
145
|
init(i) {
|
|
153
|
-
const e =
|
|
146
|
+
const e = o(i);
|
|
154
147
|
this.config = e, this.initialized = !0;
|
|
155
148
|
},
|
|
156
149
|
/**
|
|
@@ -162,5 +155,5 @@ const g = a("guido-config", {
|
|
|
162
155
|
}
|
|
163
156
|
});
|
|
164
157
|
export {
|
|
165
|
-
|
|
158
|
+
f as useConfigStore
|
|
166
159
|
};
|