@useinsider/guido 3.16.0-beta.ca26c4e → 3.16.0-beta.efbb91f
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/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +78 -76
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +74 -43
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +45 -23
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +61 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useHtmlValidator.js +1 -0
- package/dist/composables/useSave.js +84 -41
- package/dist/composables/useSaveValidation.js +276 -0
- package/dist/composables/useSaveValidationRollout.js +9 -0
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/enums/recommendation.js +17 -17
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +31 -24
- package/dist/guido.css +1 -1
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/composables/useHtmlValidator.d.ts +14 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +5 -0
- package/dist/src/stores/config.d.ts +5 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/stores/config.js +13 -6
- package/dist/stores/save-validation.js +30 -0
- package/dist/utils/templatePreparation.js +28 -25
- package/package.json +1 -1
|
@@ -381,7 +381,7 @@ class H {
|
|
|
381
381
|
* Supports all block types by detecting prefix and using appropriate type:
|
|
382
382
|
*
|
|
383
383
|
* Examples:
|
|
384
|
-
* - {{ins_apr_img_1}} → https://
|
|
384
|
+
* - {{ins_apr_img_1}} → https://s3.../img_1.jpeg (CART_ITEMS)
|
|
385
385
|
* - {{browsed_item_name_2}} → 'Set of Sprite Yoga Straps' (BROWSED_ITEMS)
|
|
386
386
|
* - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
|
|
387
387
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const e = 20,
|
|
1
|
+
const e = 20, s = 320, t = "vertical", m = {
|
|
2
2
|
CART_ABANDONMENT: {
|
|
3
|
-
ins_apr_img_1: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
|
|
4
|
-
ins_apr_img_2: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
|
|
5
|
-
ins_apr_img_3: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_3.png",
|
|
6
|
-
ins_apr_img_4: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_4.png"
|
|
3
|
+
ins_apr_img_1: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
|
|
4
|
+
ins_apr_img_2: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
|
|
5
|
+
ins_apr_img_3: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_3.png",
|
|
6
|
+
ins_apr_img_4: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_4.png"
|
|
7
7
|
},
|
|
8
8
|
BROWSE_ABANDONMENT: {
|
|
9
|
-
browsed_item_img_1: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_1.jpg",
|
|
10
|
-
browsed_item_img_2: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_2.jpg",
|
|
11
|
-
browsed_item_img_3: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_3.jpg",
|
|
12
|
-
browsed_item_img_4: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_4.jpg"
|
|
9
|
+
browsed_item_img_1: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_1.jpg",
|
|
10
|
+
browsed_item_img_2: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_2.jpg",
|
|
11
|
+
browsed_item_img_3: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_3.jpg",
|
|
12
|
+
browsed_item_img_4: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_4.jpg"
|
|
13
13
|
}
|
|
14
14
|
}, i = {
|
|
15
15
|
DISCOUNT: "discount",
|
|
@@ -23,7 +23,7 @@ const e = 20, t = 320, s = "vertical", m = {
|
|
|
23
23
|
},
|
|
24
24
|
ELSE: "{% else %}",
|
|
25
25
|
END_IF: "{% endif %}"
|
|
26
|
-
},
|
|
26
|
+
}, a = {
|
|
27
27
|
ID: /recommendation-id="(.*?)"/gi,
|
|
28
28
|
ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>[\S\s]*?<\/p>/gm,
|
|
29
29
|
ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>/gm,
|
|
@@ -31,9 +31,9 @@ const e = 20, t = 320, s = "vertical", m = {
|
|
|
31
31
|
CUSTOM_FIELD: /{{(?:reco_)?[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
|
|
32
32
|
CUSTOM_FIELD_INDEXES_PART: /{{(?:reco_)?[0-9]+_[0-8]_/gm,
|
|
33
33
|
CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
|
|
34
|
-
},
|
|
34
|
+
}, n = {
|
|
35
35
|
PARAGRAPH_END_TAG: "</p>"
|
|
36
|
-
},
|
|
36
|
+
}, o = {
|
|
37
37
|
REGULAR_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:90px!important;",
|
|
38
38
|
TRIMMED_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:18px!important;",
|
|
39
39
|
ELLIPSIS: "text-overflow:ellipsis!important; white-space:nowrap!important;",
|
|
@@ -47,11 +47,11 @@ const e = 20, t = 320, s = "vertical", m = {
|
|
|
47
47
|
export {
|
|
48
48
|
i as ATTRIBUTES,
|
|
49
49
|
_ as CONDITIONS,
|
|
50
|
-
|
|
50
|
+
o as CSS,
|
|
51
51
|
m as DUMMY_IMAGE_MAPPINGS,
|
|
52
52
|
e as DefaultPadding,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
n as HTML,
|
|
54
|
+
s as MinDeviceViewport,
|
|
55
|
+
a as REGEX,
|
|
56
|
+
t as VerticalOrientation
|
|
57
57
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var n = /* @__PURE__ */ ((s) => (s.CouponTagModified = "coupon-tag-modified", s.DuplicateUnsubBlock = "duplicate-unsub-block", s.UnsubBlockMissingTemplate = "unsub-block-missing-template", s.LiquidSyntax = "liquid-syntax", s.InvalidLinks = "invalid-links", s.LinkCheckInProgress = "link-check-in-progress", s.CustomFieldScript = "custom-field-script", s.EmptyHtml = "empty-html", s.MismatchedBraces = "mismatched-braces", s.InvalidDynamicTag = "invalid-dynamic-tag", s.InvalidCustomField = "invalid-custom-field", s.ConditionsSyntax = "conditions-syntax", s.WrongEqualityOperator = "wrong-equality-operator", s.MissingIfEndif = "missing-if-endif", s.ConditionTagSpacing = "condition-tag-spacing", s.BracesInsideIfTag = "braces-inside-if-tag", s.RecommendationRequiredFields = "recommendation-required-fields", s.RecommendationFilters = "recommendation-filters", s.InvalidImageType = "invalid-image-type", s.CheckboxUnsubGroup = "checkbox-unsub-group", s.RadioButtonUnsubGroup = "radio-button-unsub-group", s))(n || {});
|
|
2
|
+
export {
|
|
3
|
+
n as SaveValidationRule
|
|
4
|
+
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import _ from "../../../../node_modules/lodash-es/flatMap.js";
|
|
2
|
+
import E from "../../../../node_modules/lodash-es/range.js";
|
|
3
|
+
const T = '<td align="center" class="ins-product-td items-block items-block-v2">', a = { PAIRS_FOR_EXTENSION: {
|
|
4
4
|
imageSrc: {
|
|
5
5
|
CART_ITEMS: {
|
|
6
6
|
ATTR: "ins_apr_img",
|
|
7
7
|
DEFAULT: [
|
|
8
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
9
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
10
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
11
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
12
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
13
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
14
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
15
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
8
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
9
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
10
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
11
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
12
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
13
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
14
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
15
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
BROWSED_ITEMS: {
|
|
19
19
|
ATTR: "browsed_item_img",
|
|
20
20
|
DEFAULT: [
|
|
21
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
22
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
23
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
24
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
25
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
26
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
27
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
28
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
21
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
22
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
23
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
24
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
25
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
26
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
27
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
28
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
PURCHASED_ITEMS: {
|
|
32
32
|
ATTR: "purchased_item_img",
|
|
33
33
|
DEFAULT: [
|
|
34
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
35
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
36
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
37
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
38
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
39
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
40
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
41
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
34
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
35
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
36
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
37
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
38
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
39
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
40
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
41
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
44
|
},
|
|
@@ -211,27 +211,27 @@ const t = '<td align="center" class="ins-product-td items-block items-block-v2">
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
} };
|
|
214
|
-
function
|
|
215
|
-
return
|
|
214
|
+
function m(e, s = 8) {
|
|
215
|
+
return E(1, s + 1).map((i) => `${e}_${i}`);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
const { PAIRS_FOR_EXTENSION: e } =
|
|
219
|
-
return
|
|
217
|
+
function r() {
|
|
218
|
+
const { PAIRS_FOR_EXTENSION: e } = a, s = [];
|
|
219
|
+
return s.push(
|
|
220
220
|
e.imageSrc.CART_ITEMS.ATTR,
|
|
221
221
|
e.imageSrc.BROWSED_ITEMS.ATTR,
|
|
222
222
|
e.imageSrc.PURCHASED_ITEMS.ATTR
|
|
223
|
-
),
|
|
223
|
+
), s.push(
|
|
224
224
|
e.name.CART_ITEMS.ATTR,
|
|
225
225
|
e.name.CART_ITEMS.HREF,
|
|
226
226
|
e.name.BROWSED_ITEMS.ATTR,
|
|
227
227
|
e.name.BROWSED_ITEMS.HREF,
|
|
228
228
|
e.name.PURCHASED_ITEMS.ATTR,
|
|
229
229
|
e.name.PURCHASED_ITEMS.HREF
|
|
230
|
-
),
|
|
230
|
+
), s.push(
|
|
231
231
|
e.quantity.CART_ITEMS.ATTR,
|
|
232
232
|
e.quantity.BROWSED_ITEMS.ATTR,
|
|
233
233
|
e.quantity.PURCHASED_ITEMS.ATTR
|
|
234
|
-
),
|
|
234
|
+
), s.push(
|
|
235
235
|
e.price.CART_ITEMS.PRICE,
|
|
236
236
|
e.price.CART_ITEMS.PRICE_FORMATTED,
|
|
237
237
|
e.price.CART_ITEMS.SINGLE_PRICE,
|
|
@@ -247,7 +247,7 @@ function R() {
|
|
|
247
247
|
e.price.PURCHASED_ITEMS.SINGLE_PRICE,
|
|
248
248
|
e.price.PURCHASED_ITEMS.SINGLE_PRICE_FORMATTED,
|
|
249
249
|
e.price.PURCHASED_ITEMS.CURRENCY
|
|
250
|
-
),
|
|
250
|
+
), s.push(
|
|
251
251
|
e.originalPrice.CART_ITEMS.PRICE,
|
|
252
252
|
e.originalPrice.CART_ITEMS.PRICE_FORMATTED,
|
|
253
253
|
e.originalPrice.CART_ITEMS.SINGLE_PRICE,
|
|
@@ -263,22 +263,22 @@ function R() {
|
|
|
263
263
|
e.originalPrice.PURCHASED_ITEMS.SINGLE_PRICE,
|
|
264
264
|
e.originalPrice.PURCHASED_ITEMS.SINGLE_PRICE_FORMATTED,
|
|
265
265
|
e.originalPrice.PURCHASED_ITEMS.CURRENCY
|
|
266
|
-
),
|
|
266
|
+
), s.push(
|
|
267
267
|
e.button.CART_ITEMS.HREF,
|
|
268
268
|
e.button.BROWSED_ITEMS.HREF,
|
|
269
269
|
e.button.PURCHASED_ITEMS.HREF
|
|
270
|
-
),
|
|
270
|
+
), s.push(
|
|
271
271
|
e.itemLink.CART_ITEMS.HREF,
|
|
272
272
|
e.itemLink.BROWSED_ITEMS.HREF,
|
|
273
273
|
e.itemLink.PURCHASED_ITEMS.HREF
|
|
274
|
-
),
|
|
274
|
+
), s;
|
|
275
275
|
}
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
(e) =>
|
|
276
|
+
const o = _(
|
|
277
|
+
r(),
|
|
278
|
+
(e) => m(e)
|
|
279
279
|
);
|
|
280
280
|
export {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
281
|
+
o as itemsBlockDynamicVariables,
|
|
282
|
+
a as productPairs,
|
|
283
|
+
T as templateFirstLine
|
|
284
284
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
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 C, PriceAttributes as y } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as G } 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
|
|
6
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as v } 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 { isFilterValid as
|
|
12
|
-
import { isConfigValid as
|
|
13
|
-
const h =
|
|
10
|
+
import { getPartnerRecommendationParams as N } from "../utils/partnerCustomizations.js";
|
|
11
|
+
import { isFilterValid as x } from "../validation/filterSchema.js";
|
|
12
|
+
import { isConfigValid as I } from "../validation/requiredFields.js";
|
|
13
|
+
const h = G();
|
|
14
14
|
let m = null, u = null, d = null;
|
|
15
|
-
function
|
|
15
|
+
function R() {
|
|
16
16
|
return {
|
|
17
|
-
cardsInRow:
|
|
17
|
+
cardsInRow: v,
|
|
18
18
|
currencySettings: {
|
|
19
19
|
name: "USD",
|
|
20
20
|
value: "USD",
|
|
@@ -28,7 +28,7 @@ function k() {
|
|
|
28
28
|
productIds: [],
|
|
29
29
|
id: 1,
|
|
30
30
|
language: "en_US",
|
|
31
|
-
mobileCardsInRow:
|
|
31
|
+
mobileCardsInRow: D,
|
|
32
32
|
mobileLayoutEnabled: !1,
|
|
33
33
|
orientation: "grid",
|
|
34
34
|
recommendedProducts: [],
|
|
@@ -43,9 +43,9 @@ function k() {
|
|
|
43
43
|
priceHideIfSameAsDiscounted: !1
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function k() {
|
|
47
47
|
return {
|
|
48
|
-
recommendationConfigs:
|
|
48
|
+
recommendationConfigs: R(),
|
|
49
49
|
recommendationProducts: [],
|
|
50
50
|
filterStatus: !1,
|
|
51
51
|
filterSelectionDrawerStatus: !1,
|
|
@@ -63,7 +63,7 @@ const L = () => ({
|
|
|
63
63
|
blockStates: {},
|
|
64
64
|
currentRecommendationId: null,
|
|
65
65
|
configVersion: 0
|
|
66
|
-
}), $ =
|
|
66
|
+
}), $ = P("guidoRecommendationExtension", {
|
|
67
67
|
state: () => L(),
|
|
68
68
|
getters: {
|
|
69
69
|
// ====================================================================
|
|
@@ -74,7 +74,7 @@ const L = () => ({
|
|
|
74
74
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
75
75
|
*/
|
|
76
76
|
recommendationConfigs(t) {
|
|
77
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
77
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : R();
|
|
78
78
|
},
|
|
79
79
|
/**
|
|
80
80
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -138,7 +138,7 @@ const L = () => ({
|
|
|
138
138
|
getFilterList() {
|
|
139
139
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
140
140
|
let e;
|
|
141
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
141
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : y.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
142
142
|
text: t.displayName,
|
|
143
143
|
value: e,
|
|
144
144
|
type: t.attributeType
|
|
@@ -160,7 +160,7 @@ const L = () => ({
|
|
|
160
160
|
setCurrentBlock(t) {
|
|
161
161
|
this.blockStates[t] || (this.blockStates = {
|
|
162
162
|
...this.blockStates,
|
|
163
|
-
[t]:
|
|
163
|
+
[t]: k()
|
|
164
164
|
}), this.currentRecommendationId = t;
|
|
165
165
|
},
|
|
166
166
|
/**
|
|
@@ -228,7 +228,7 @@ const L = () => ({
|
|
|
228
228
|
decimalCount: String(e.currencyDecimalCount),
|
|
229
229
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
230
230
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
231
|
-
}, c = !this.blockStates[t], i = c ?
|
|
231
|
+
}, c = !this.blockStates[t], i = c ? k() : this.blockStates[t];
|
|
232
232
|
i.recommendationConfigs = {
|
|
233
233
|
...i.recommendationConfigs,
|
|
234
234
|
strategy: e.strategy,
|
|
@@ -266,7 +266,7 @@ const L = () => ({
|
|
|
266
266
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
267
267
|
*/
|
|
268
268
|
createDefaultFilter(t, e) {
|
|
269
|
-
const [r] = this.getFilterList, [n] =
|
|
269
|
+
const [r] = this.getFilterList, [n] = C(r == null ? void 0 : r.type);
|
|
270
270
|
return {
|
|
271
271
|
type: "standardFilter",
|
|
272
272
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
@@ -383,7 +383,7 @@ const L = () => ({
|
|
|
383
383
|
const n = [...e.recommendationConfigs.filters];
|
|
384
384
|
n[r] = {
|
|
385
385
|
...t,
|
|
386
|
-
isValid:
|
|
386
|
+
isValid: x(t)
|
|
387
387
|
}, e.recommendationConfigs.filters = n;
|
|
388
388
|
}
|
|
389
389
|
},
|
|
@@ -429,7 +429,14 @@ const L = () => ({
|
|
|
429
429
|
* every block's recommendationConfigs across user edits.
|
|
430
430
|
*/
|
|
431
431
|
hasInvalidBlock() {
|
|
432
|
-
return Object.values(this.blockStates).some((t) => !
|
|
432
|
+
return Object.values(this.blockStates).some((t) => !I(t.recommendationConfigs, this));
|
|
433
|
+
},
|
|
434
|
+
/**
|
|
435
|
+
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
436
|
+
* that fails required-field validation, one drawer row each (SD-147430).
|
|
437
|
+
*/
|
|
438
|
+
invalidBlockIds() {
|
|
439
|
+
return Object.entries(this.blockStates).filter(([, t]) => !I(t.recommendationConfigs, this)).map(([t]) => t);
|
|
433
440
|
},
|
|
434
441
|
// ====================================================================
|
|
435
442
|
// Per-Block Product Fetching
|
|
@@ -450,7 +457,7 @@ const L = () => ({
|
|
|
450
457
|
},
|
|
451
458
|
async _doFetchProducts() {
|
|
452
459
|
var p;
|
|
453
|
-
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 =
|
|
460
|
+
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 = F(), s = parseInt(r.size) || 6, a = {
|
|
454
461
|
locale: r.language,
|
|
455
462
|
currency: r.currencySettings.value,
|
|
456
463
|
partnerName: o.partnerName,
|
|
@@ -460,7 +467,7 @@ const L = () => ({
|
|
|
460
467
|
};
|
|
461
468
|
r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
462
469
|
a,
|
|
463
|
-
|
|
470
|
+
N(o.partnerName, r.strategy)
|
|
464
471
|
);
|
|
465
472
|
let f;
|
|
466
473
|
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-ee2d4f7d] .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-44d8e7c8]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-cbfabe9a]{gap:16px}.validation-error-row[data-v-cbfabe9a]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-cbfabe9a]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-cbfabe9a]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-f02fdde0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-f02fdde0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-f02fdde0]{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}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SaveValidationRule } from '@@/Enums/save-validation';
|
|
2
|
+
import type { ToasterTypeOptions } from '@@/Enums/toaster';
|
|
3
|
+
/** Which action triggered the validation run. Drives telemetry only in v1. */
|
|
4
|
+
export type SaveValidationIntent = 'save' | 'back' | 'test';
|
|
5
|
+
/**
|
|
6
|
+
* A single validation failure instance, one per drawer row. Names avoid the
|
|
7
|
+
* public `ValidationError` (config validation) collision — NOT exported from
|
|
8
|
+
* library.ts.
|
|
9
|
+
*/
|
|
10
|
+
export interface SaveValidationError {
|
|
11
|
+
/** Stable discriminator for tests and de-duplication. */
|
|
12
|
+
rule: SaveValidationRule;
|
|
13
|
+
/** Final translated string — trans() is applied at collect time. */
|
|
14
|
+
message: string;
|
|
15
|
+
/** Raw user content (field name / tag / src) — not i18n. */
|
|
16
|
+
detail?: string;
|
|
17
|
+
/** Mirrors the legacy toaster severity. Kept for the discriminator/tests; the drawer renders a uniform icon and never reads it. */
|
|
18
|
+
type: ToasterTypeOptions;
|
|
19
|
+
}
|
|
@@ -15,7 +15,23 @@ 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<
|
|
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;
|
|
19
35
|
setLoading: (value: boolean) => void;
|
|
20
36
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
21
37
|
"dynamic-content:open": (detail: {
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
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;
|
|
3
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
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;
|
|
3
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
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;
|
|
3
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -10,11 +10,11 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var
|
|
13
|
+
declare var __VLS_13: {}, __VLS_15: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
headerBottomSlot?: (props: typeof
|
|
15
|
+
headerBottomSlot?: (props: typeof __VLS_13) => any;
|
|
16
16
|
} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_15) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
20
|
className: string;
|
|
@@ -26,6 +26,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
26
|
cancelOrBackButtonEvent: () => void;
|
|
27
27
|
onCloseEvent: () => void;
|
|
28
28
|
primaryButtonEvent: () => void;
|
|
29
|
+
secondaryButtonEvent: () => void;
|
|
29
30
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
30
31
|
className: string;
|
|
31
32
|
size: string;
|
|
@@ -27,6 +27,20 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
|
|
|
27
27
|
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
28
28
|
*/
|
|
29
29
|
export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
|
|
32
|
+
*
|
|
33
|
+
* A tag's variable name is the part before the first `|` (everything after it is the fallback).
|
|
34
|
+
* Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
|
|
35
|
+
* is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
|
|
36
|
+
* present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
|
|
37
|
+
* `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
|
|
38
|
+
*
|
|
39
|
+
* `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
|
|
40
|
+
* store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
|
|
41
|
+
* backend resolves through its own pipeline, so they must not be treated as user-authored tags.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getInvalidDynamicContentTags(html: string): string[];
|
|
30
44
|
export declare const useHtmlValidator: () => {
|
|
31
45
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
32
46
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
+
type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
|
|
3
|
+
type SaveResult = SaveDetails | undefined;
|
|
2
4
|
export declare const useSave: () => {
|
|
3
|
-
save: (suppressEmit?: boolean, silent?: boolean) => Promise<
|
|
5
|
+
save: (suppressEmit?: boolean, silent?: boolean) => Promise<SaveResult>;
|
|
6
|
+
saveWithErrors: () => Promise<SaveResult>;
|
|
7
|
+
saveRawOnly: () => Promise<SaveResult>;
|
|
4
8
|
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
+
import type { SaveValidationError } from '@@/Types/save-validation';
|
|
3
|
+
export declare const useSaveValidation: () => {
|
|
4
|
+
collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[]) => Promise<SaveValidationError[]>;
|
|
5
|
+
validateCurrentTemplate: () => Promise<SaveValidationError[]>;
|
|
6
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
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[];
|
|
1
4
|
export declare const useCouponBlockValidator: () => {
|
|
2
5
|
validateCouponBlockTags: (html: string) => boolean;
|
|
3
6
|
};
|
|
@@ -1,4 +1,14 @@
|
|
|
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;
|
|
1
10
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
2
11
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
3
12
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
4
13
|
};
|
|
14
|
+
export {};
|