@useinsider/guido 3.1.1-beta.57fcdc6 → 3.1.1-beta.58e1771

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.
Files changed (23) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +1 -1
  2. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +17 -16
  3. package/dist/extensions/Blocks/Recommendation/block.js +1 -1
  4. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  5. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
  6. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
  7. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
  8. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
  9. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
  10. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  11. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
  12. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
  13. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
  14. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  15. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
  16. package/dist/guido.css +1 -1
  17. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  18. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  19. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  20. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  21. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  22. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  23. package/package.json +1 -1
@@ -10,7 +10,7 @@ var o = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "079d2bf7"
13
+ "870ebbaf"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,25 +1,26 @@
1
- import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
- import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
5
- const S = /* @__PURE__ */ c({
1
+ import { defineComponent as u, ref as a, computed as p, watch as _ } from "vue";
2
+ import { useActionsApi as f } from "../../../../composables/useActionsApi.js";
3
+ import { useTranslations as v } from "../../../../composables/useTranslations.js";
4
+ import { usePreviewStore as d } from "../../../../stores/preview.js";
5
+ import { InTooltipV2 as h, InProgress as g } from "@useinsider/design-system-vue";
6
+ const B = /* @__PURE__ */ u({
6
7
  __name: "EmailSizeIndicator",
7
8
  setup(w) {
8
- const t = _(), o = 102, e = n(0), s = n({
9
+ const o = d(), { getCompiledEmail: s } = f(), t = 102, e = a(0), r = a({
9
10
  type: "success",
10
11
  value: 0
11
- }), a = l(() => `~${e.value} KB`), r = () => {
12
- const m = new Blob([t.previewHtml]).size;
13
- e.value = Math.round(m / 1024), s.value = {
14
- type: e.value < o ? "success" : "warning",
15
- value: Math.min(e.value, o)
12
+ }), i = p(() => `~${e.value} KB`), n = async () => {
13
+ const { html: c } = await s({ minimize: !0, resetDataSavedFlag: !1 }), l = new TextEncoder().encode(c).byteLength;
14
+ e.value = Math.round(l / 1024), r.value = {
15
+ type: e.value < t ? "success" : "warning",
16
+ value: Math.min(e.value, t)
16
17
  };
17
- }, i = p();
18
- return u(() => t.previewHtml, () => {
19
- r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
18
+ }, m = v();
19
+ return _(() => o.previewHtml, () => {
20
+ n();
21
+ }, { immediate: !0 }), { __sfc: !0, previewStore: o, getCompiledEmail: s, MAX_EMAIL_SIZE_IN_KB: t, htmlKB: e, progress: r, htmlSize: i, calculateProgress: n, trans: m, InProgress: g, InTooltipV2: h };
21
22
  }
22
23
  });
23
24
  export {
24
- S as default
25
+ B as default
25
26
  };
@@ -169,7 +169,7 @@ class q extends b {
169
169
  if (e && e.includes(a))
170
170
  return t;
171
171
  }
172
- return "querySelector" in t ? t.querySelector(`.${a}`) : null;
172
+ return "querySelector" in t ? t.querySelector(`.${a}`) ?? null : null;
173
173
  }
174
174
  /**
175
175
  * Migrate configuration from legacy format
@@ -1,26 +1,42 @@
1
- const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", t = ".ins-recommendation-mobile-container", n = ".ins-recommendation-mobile-row", R = {
1
+ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", t = ".ins-recommendation-mobile-row", r = {
2
2
  CURRENCY: "currency",
3
3
  SYMBOL: "currency-symbol",
4
4
  ALIGNMENT: "currency-alignment",
5
5
  THOUSAND_SEPARATOR: "currency-thousand-separator",
6
6
  DECIMAL_SEPARATOR: "currency-decimal-separator",
7
7
  DECIMAL_COUNT: "currency-decimal-count"
8
- }, r = "productImage", O = "productName", _ = "productPrice", e = "productOldPrice", s = "productOmnibusPrice", C = "productOmnibusDiscount", E = "productButton", A = "customAttr:", i = "data-custom-attributes", u = "product-attr";
8
+ }, R = "productImage", _ = "productName", e = "productPrice", O = "productOldPrice", s = "productOmnibusPrice", i = "productOmnibusDiscount", E = "productButton", A = "customAttr:", C = "data-custom-attributes", u = "product-attr", m = /* @__PURE__ */ new Set([
9
+ "name",
10
+ // productName
11
+ "price",
12
+ // productPrice
13
+ "original_price",
14
+ // productOldPrice
15
+ "image_url",
16
+ // productImage
17
+ "url",
18
+ // productButton
19
+ "omnibus_price",
20
+ // productOmnibusPrice
21
+ "omnibus_discount"
22
+ // productOmnibusDiscount
23
+ ]);
9
24
  export {
10
25
  A as ATTR_CUSTOM_PREFIX,
11
- i as ATTR_DATA_CUSTOM_ATTRIBUTES,
26
+ C as ATTR_DATA_CUSTOM_ATTRIBUTES,
12
27
  u as ATTR_PRODUCT_ATTR,
13
28
  E as ATTR_PRODUCT_BUTTON,
14
- r as ATTR_PRODUCT_IMAGE,
15
- O as ATTR_PRODUCT_NAME,
16
- e as ATTR_PRODUCT_OLD_PRICE,
17
- C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
29
+ R as ATTR_PRODUCT_IMAGE,
30
+ _ as ATTR_PRODUCT_NAME,
31
+ O as ATTR_PRODUCT_OLD_PRICE,
32
+ i as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
18
33
  s as ATTR_PRODUCT_OMNIBUS_PRICE,
19
- _ as ATTR_PRODUCT_PRICE,
34
+ e as ATTR_PRODUCT_PRICE,
20
35
  T as BLOCK_ROOT_SELECTOR,
36
+ m as BUILT_IN_DEFAULT_ATTRIBUTES,
21
37
  c as CONTAINER_SELECTOR,
22
- R as CURRENCY_ATTR,
38
+ r as CURRENCY_ATTR,
23
39
  o as DESKTOP_CONTAINER_SELECTOR,
24
- t as MOBILE_CONTAINER_SELECTOR,
25
- n as MOBILE_ROW_SELECTOR
40
+ n as MOBILE_CONTAINER_SELECTOR,
41
+ t as MOBILE_ROW_SELECTOR
26
42
  };