@useinsider/guido 3.1.1-beta.dc20933 → 3.1.1-beta.eb14b5f

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 (25) 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 +19 -17
  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/@types/generic.d.ts +1 -0
  18. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  19. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  20. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  21. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  22. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  23. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  24. package/dist/utils/tooltipUtils.js +5 -4
  25. package/package.json +2 -2
@@ -10,7 +10,7 @@ var o = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "079d2bf7"
13
+ "a5615a05"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,25 +1,27 @@
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 f, ref as a, computed as _, watch as d } from "vue";
2
+ import { useActionsApi as v } from "../../../../composables/useActionsApi.js";
3
+ import { useHtmlCompiler as h } from "../../../../composables/useHtmlCompiler.js";
4
+ import { useTranslations as g } from "../../../../composables/useTranslations.js";
5
+ import { usePreviewStore as w } from "../../../../stores/preview.js";
6
+ import { InTooltipV2 as I, InProgress as S } from "@useinsider/design-system-vue";
7
+ const C = /* @__PURE__ */ f({
6
8
  __name: "EmailSizeIndicator",
7
- setup(w) {
8
- const t = _(), o = 102, e = n(0), s = n({
9
+ setup(y) {
10
+ const o = w(), { getCompiledEmail: s } = v(), { compileHtml: r } = h(), t = 102, e = a(0), n = a({
9
11
  type: "success",
10
12
  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)
13
+ }), i = _(() => `~${e.value} KB`), m = async () => {
14
+ const { html: l } = await s({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: p } = r(l), u = new TextEncoder().encode(p).byteLength;
15
+ e.value = Math.round(u / 1024), n.value = {
16
+ type: e.value < t ? "success" : "warning",
17
+ value: Math.min(e.value, t)
16
18
  };
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 };
19
+ }, c = g();
20
+ return d(() => o.previewHtml, () => {
21
+ m();
22
+ }, { immediate: !0 }), { __sfc: !0, previewStore: o, getCompiledEmail: s, compileHtml: r, MAX_EMAIL_SIZE_IN_KB: t, htmlKB: e, progress: n, htmlSize: i, calculateProgress: m, trans: c, InProgress: S, InTooltipV2: I };
21
23
  }
22
24
  });
23
25
  export {
24
- S as default
26
+ C as default
25
27
  };
@@ -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
  };