@useinsider/guido 3.23.0 → 3.24.0-beta.2a3ba08

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 (95) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +20 -17
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +110 -97
  5. package/dist/components/organisms/AutoSaveController.vue2.js +20 -10
  6. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  7. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  9. package/dist/components/organisms/header/EditorActions.vue2.js +58 -73
  10. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  11. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +99 -0
  12. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  13. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  14. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  16. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  17. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  18. package/dist/components/organisms/header/RightSlot.vue.js +11 -10
  19. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  20. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  21. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  22. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  23. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  24. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  25. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  26. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  27. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
  28. package/dist/composables/useAccessibilityApi.js +51 -0
  29. package/dist/composables/useCustomInterfaceAppearance.js +42 -41
  30. package/dist/composables/useModuleRepair.js +14 -12
  31. package/dist/config/i18n/en/labels.json.js +36 -4
  32. package/dist/config/i18n/en/tooltips.json.js +2 -1
  33. package/dist/config/migrator/index.js +16 -15
  34. package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
  35. package/dist/extensions/Blocks/Items/block.js +115 -77
  36. package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
  37. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +33 -22
  38. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
  39. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
  40. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
  41. package/dist/extensions/Blocks/Items/controls/priceFormat.js +145 -0
  42. package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
  43. package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
  44. package/dist/extensions/Blocks/Items/extension.js +9 -8
  45. package/dist/extensions/Blocks/Items/items.css.js +19 -0
  46. package/dist/extensions/Blocks/Items/settingsPanel.js +34 -25
  47. package/dist/extensions/Blocks/Items/template.js +250 -212
  48. package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
  49. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
  50. package/dist/guido.css +1 -1
  51. package/dist/package.json.js +2 -2
  52. package/dist/sprite.svg +10 -0
  53. package/dist/src/@types/config/schemas.d.ts +6 -0
  54. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
  55. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  56. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
  57. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
  58. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  59. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  60. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  61. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  62. package/dist/src/composables/useActionsApi.d.ts +2 -2
  63. package/dist/src/composables/useConfig.d.ts +4 -0
  64. package/dist/src/config/migrator/index.d.ts +4 -1
  65. package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
  66. package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
  67. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
  68. package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +23 -0
  69. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
  70. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  71. package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
  72. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
  73. package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +61 -0
  74. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
  75. package/dist/src/stores/autosave.d.ts +73 -1
  76. package/dist/src/stores/config.d.ts +40 -0
  77. package/dist/src/stores/editor.d.ts +109 -0
  78. package/dist/src/stores/onboarding.d.ts +966 -35
  79. package/dist/src/stores/version-history.d.ts +1 -1
  80. package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
  81. package/dist/src/utils/templatePreparation.d.ts +1 -1
  82. package/dist/src/utils/timeUtil.d.ts +5 -8
  83. package/dist/static/stripo-runtime-manifest.json.js +1 -1
  84. package/dist/static/styles/components/accessibility.css.js +234 -0
  85. package/dist/static/styles/variables.css.js +2 -0
  86. package/dist/stores/autosave.js +12 -7
  87. package/dist/stores/editor.js +8 -3
  88. package/dist/stores/onboarding.js +48 -22
  89. package/dist/utils/itemsCurrencyRepair.js +29 -24
  90. package/dist/utils/pairProductVariables.js +119 -99
  91. package/dist/utils/timeUtil.js +6 -17
  92. package/package.json +2 -2
  93. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  94. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  95. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
@@ -1,108 +1,128 @@
1
- import { ITEMS_CURRENCY_ATTR as U, isCustomCurrencySymbol as Y } from "../extensions/Blocks/Items/constants/currency.js";
2
- import { productPairs as M } from "../extensions/Blocks/Items/enums/productEnums.js";
3
- import { escapeReplacement as B } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
4
- import { preserveTextStyles as L } from "./preserveTextStyles.js";
1
+ import { isNewPriceFormatRoot as G, ITEMS_PRICE_FORMAT_ATTR as N, currencyPositionFromLocation as Y, ITEMS_CURRENCY_ATTR as U, isCustomCurrencySymbol as B } from "../extensions/Blocks/Items/constants/currency.js";
2
+ import { productPairs as k } from "../extensions/Blocks/Items/enums/productEnums.js";
3
+ import { escapeReplacement as v } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
4
+ import { preserveTextStyles as w } from "./preserveTextStyles.js";
5
5
  import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
6
6
  const q = {
7
7
  CART_ITEMS: "ins_apr",
8
8
  BROWSED_ITEMS: "browsed_item",
9
9
  PURCHASED_ITEMS: "purchased_item"
10
- }, W = ($) => $.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
11
- function v($, C, A) {
12
- let d = C;
13
- for (; d > 0 && /\s/.test($[d - 1]); )
14
- d -= 1;
15
- return A.some((E) => $.endsWith(E, d));
10
+ }, W = (r) => r.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
11
+ function j(r, h, p) {
12
+ let u = h;
13
+ for (; u > 0 && /\s/.test(r[u - 1]); )
14
+ u -= 1;
15
+ return p.some((A) => r.endsWith(A, u));
16
16
  }
17
- const j = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
18
- function Q($, C) {
19
- var d;
20
- const A = $.ownerDocument.createTreeWalker($, NodeFilter.SHOW_COMMENT);
21
- for (let E = A.nextNode(); E; E = A.nextNode())
22
- (d = E.nodeValue) != null && d.includes("[if mso]") && (E.nodeValue = E.nodeValue.replace(j, (k, P) => `${P}href="${C}"`));
17
+ const Q = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
18
+ function z(r, h) {
19
+ var u;
20
+ const p = r.ownerDocument.createTreeWalker(r, NodeFilter.SHOW_COMMENT);
21
+ for (let A = p.nextNode(); A; A = p.nextNode())
22
+ (u = A.nodeValue) != null && u.includes("[if mso]") && (A.nodeValue = A.nodeValue.replace(Q, (L, P) => `${P}href="${h}"`));
23
23
  }
24
- function et($) {
25
- const C = W($), A = new DOMParser().parseFromString(C, "text/html");
26
- X(A);
27
- const d = M.PAIRS_FOR_EXTENSION;
28
- Object.entries(d).forEach(([o, p]) => {
29
- A.querySelectorAll(".ins-product-td").forEach((r) => {
30
- const _ = r.getAttribute("data-number") || "1", y = r.getAttribute("data-type") || "CART_ITEMS";
31
- r.querySelectorAll(`[product-attr="${o}"]`).forEach((t) => {
32
- var S, I, O, x;
33
- const m = t.getAttribute("data-type") || y, n = t.getAttribute("data-number") || _, f = p[m];
24
+ function J(r) {
25
+ return {
26
+ isFormatted: r.getAttribute("data-formated") === "true",
27
+ isSinglePrice: r.getAttribute("data-single_price") === "true",
28
+ currencyPosition: r.getAttribute(U.POSITION) || "before",
29
+ configuredSymbol: (r.getAttribute(U.SYMBOL) || "").trim()
30
+ };
31
+ }
32
+ function K(r) {
33
+ return {
34
+ isFormatted: !1,
35
+ isSinglePrice: r.getAttribute(N.SINGLE_PRICE) === "true",
36
+ currencyPosition: Y(
37
+ r.getAttribute(N.ALIGNMENT) ?? void 0
38
+ ),
39
+ configuredSymbol: (r.getAttribute(N.SYMBOL) || "").trim()
40
+ };
41
+ }
42
+ function Z(r, h, p) {
43
+ const { isFormatted: u, isSinglePrice: A, currencyPosition: L, configuredSymbol: P } = p;
44
+ let y;
45
+ A ? y = u ? r.SINGLE_PRICE_FORMATTED : r.SINGLE_PRICE : y = u ? r.PRICE_FORMATTED : r.PRICE;
46
+ const E = r.CURRENCY;
47
+ let F = `{{${y}_${h}}}`, R = "";
48
+ return B(P) ? R = P : E && (R = `{{${E}_${h}}}`), R && (F = L === "after" ? `${F} ${R}` : `${R} ${F}`), F;
49
+ }
50
+ function ct(r) {
51
+ const h = W(r), p = new DOMParser().parseFromString(h, "text/html");
52
+ X(p);
53
+ const u = k.PAIRS_FOR_EXTENSION;
54
+ Object.entries(u).forEach(([o, T]) => {
55
+ p.querySelectorAll(".ins-product-td").forEach((n) => {
56
+ const S = n.getAttribute("data-number") || "1", I = n.getAttribute("data-type") || "CART_ITEMS";
57
+ n.querySelectorAll(`[product-attr="${o}"]`).forEach((t) => {
58
+ var b, M, D, x;
59
+ const m = t.getAttribute("data-type") || I, c = t.getAttribute("data-number") || S, f = T[m];
34
60
  if (f)
35
61
  switch (o) {
36
62
  case "imageSrc": {
37
- let e = null, s = null;
38
- if (t.tagName === "IMG" ? (e = t, s = e.closest("a")) : (e = t.querySelector("img"), s = t.querySelector("a") || t.closest("a")), !e)
63
+ let e = null, i = null;
64
+ if (t.tagName === "IMG" ? (e = t, i = e.closest("a")) : (e = t.querySelector("img"), i = t.querySelector("a") || t.closest("a")), !e)
39
65
  break;
40
- const l = f.DEFAULT, c = f.ATTR;
41
- if (l && e.src) {
42
- const a = e.src;
43
- l.some((g) => {
44
- const u = g.split("/").pop() || "", H = a.split("/").pop() || "";
45
- return a.includes(g) || a.includes(u) || H === u;
46
- }) && (e.src = `{{${c}_${n}}}`);
66
+ const d = f.DEFAULT, a = f.ATTR;
67
+ if (d && e.src) {
68
+ const l = e.src;
69
+ d.some((C) => {
70
+ const $ = C.split("/").pop() || "", V = l.split("/").pop() || "";
71
+ return l.includes(C) || l.includes($) || V === $;
72
+ }) && (e.src = `{{${a}_${c}}}`);
47
73
  }
48
- const i = (I = (S = d.name) == null ? void 0 : S[m]) == null ? void 0 : I.ATTR;
49
- if (i && e.setAttribute("alt", `{{${i}_${n}}}`), s) {
50
- const a = (O = d.itemLink) == null ? void 0 : O[m];
51
- if (a) {
52
- const b = a.HREF, g = a.DEFAULT_HREF || "#!", u = s.href;
53
- (u === "#" || u === "" || u.endsWith("#!") || u.endsWith(g) || u === `${window.location.href}${g}` || !u || u === window.location.href) && (s.href = `{{${b}_${n}}}`);
74
+ const s = (M = (b = u.name) == null ? void 0 : b[m]) == null ? void 0 : M.ATTR;
75
+ if (s && e.setAttribute("alt", `{{${s}_${c}}}`), i) {
76
+ const l = (D = u.itemLink) == null ? void 0 : D[m];
77
+ if (l) {
78
+ const H = l.HREF, C = l.DEFAULT_HREF || "#!", $ = i.href;
79
+ ($ === "#" || $ === "" || $.endsWith("#!") || $.endsWith(C) || $ === `${window.location.href}${C}` || !$ || $ === window.location.href) && (i.href = `{{${H}_${c}}}`);
54
80
  }
55
81
  }
56
82
  break;
57
83
  }
58
84
  case "name": {
59
- const e = f, s = e.ATTR, l = e.DEFAULT_HREF || "#!", c = e.HREF;
60
- t.textContent && (t.innerHTML = L(t, `{{${s}_${n}}}`));
61
- const i = t.closest("a") || (t.tagName === "A" ? t : null);
62
- if (i && c) {
63
- const a = i.href, b = `${window.location.href}${l}`;
64
- (a === b || a.endsWith(l)) && (i.href = `{{${c}_${n}}}`);
85
+ const e = f, i = e.ATTR, d = e.DEFAULT_HREF || "#!", a = e.HREF;
86
+ t.textContent && (t.innerHTML = w(t, `{{${i}_${c}}}`));
87
+ const s = t.closest("a") || (t.tagName === "A" ? t : null);
88
+ if (s && a) {
89
+ const l = s.href, H = `${window.location.href}${d}`;
90
+ (l === H || l.endsWith(d)) && (s.href = `{{${a}_${c}}}`);
65
91
  }
66
92
  break;
67
93
  }
68
94
  case "price":
69
95
  case "originalPrice": {
70
- const e = f, s = t.getAttribute("data-formated"), l = t.getAttribute("data-single_price"), c = s === "true", i = l === "true", a = t.getAttribute(U.POSITION) || "before";
71
- let b;
72
- i ? b = c ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : b = c ? e.PRICE_FORMATTED : e.PRICE;
73
- const g = e.CURRENCY;
74
- let u = `{{${b}_${n}}}`;
75
- const H = (t.getAttribute(U.SYMBOL) || "").trim(), G = Y(H);
76
- let F = "";
77
- G ? F = H : g && (F = `{{${g}_${n}}}`), F && (u = a === "after" ? `${u} ${F}` : `${F} ${u}`), t.innerHTML = L(t, u);
96
+ const e = f, i = G(n) ? K(n) : J(t);
97
+ t.innerHTML = w(t, Z(e, c, i));
78
98
  break;
79
99
  }
80
100
  case "quantity": {
81
- const e = f, s = e.ATTR, l = [e.DEFAULT, ...e.LEGACY_DEFAULTS], c = (x = t.textContent) == null ? void 0 : x.trim();
82
- c && l.includes(c) && (t.innerHTML = L(t, `{{${s}_${n}}}`));
101
+ const e = f, i = e.ATTR, d = [e.DEFAULT, ...e.LEGACY_DEFAULTS], a = (x = t.textContent) == null ? void 0 : x.trim();
102
+ a && d.includes(a) && (t.innerHTML = w(t, `{{${i}_${c}}}`));
83
103
  break;
84
104
  }
85
105
  case "button": {
86
- const e = f, s = e.HREF, l = e.DEFAULT_HREF || "#!", c = t.tagName === "A" ? t : t.querySelector("a");
87
- if (c) {
88
- const i = c.href || "", a = `${window.location.href}${l}`;
89
- (i === "" || i === "#" || i === a || i.endsWith(l) || i.endsWith("#!") || i === window.location.href) && (c.href = `{{${s}_${n}}}`);
106
+ const e = f, i = e.HREF, d = e.DEFAULT_HREF || "#!", a = t.tagName === "A" ? t : t.querySelector("a");
107
+ if (a) {
108
+ const s = a.href || "", l = `${window.location.href}${d}`;
109
+ (s === "" || s === "#" || s === l || s.endsWith(d) || s.endsWith("#!") || s === window.location.href) && (a.href = `{{${i}_${c}}}`);
90
110
  }
91
- Q(t, `{{${s}_${n}}}`);
111
+ z(t, `{{${i}_${c}}}`);
92
112
  break;
93
113
  }
94
114
  case "itemLink": {
95
- const e = f, s = e.HREF, l = e.DEFAULT_HREF || "#!", c = t;
96
- if (c.href) {
97
- const i = c.href, a = `${window.location.href}${l}`;
98
- (i === a || i.endsWith(l)) && (c.href = `{{${s}_${n}}}`);
115
+ const e = f, i = e.HREF, d = e.DEFAULT_HREF || "#!", a = t;
116
+ if (a.href) {
117
+ const s = a.href, l = `${window.location.href}${d}`;
118
+ (s === l || s.endsWith(d)) && (a.href = `{{${i}_${c}}}`);
99
119
  }
100
120
  break;
101
121
  }
102
122
  default: {
103
123
  if ("ATTR" in f) {
104
124
  const e = f.ATTR;
105
- t.textContent && (t.innerHTML = L(t, `{{${e}_${n}}}`));
125
+ t.textContent && (t.innerHTML = w(t, `{{${e}_${c}}}`));
106
126
  }
107
127
  break;
108
128
  }
@@ -110,49 +130,49 @@ function et($) {
110
130
  });
111
131
  });
112
132
  });
113
- const E = C.match(/<!DOCTYPE[^>]*>/i), k = E ? `${E[0]}
114
- ` : "", P = A.querySelectorAll(".ins-product-td"), N = [];
133
+ const A = h.match(/<!DOCTYPE[^>]*>/i), L = A ? `${A[0]}
134
+ ` : "", P = p.querySelectorAll(".ins-product-td"), y = [];
115
135
  P.forEach((o) => {
116
- const p = o.getAttribute("data-type") || "CART_ITEMS", T = o.getAttribute("data-number") || "1", r = o.outerHTML;
117
- N.push({
136
+ const T = o.getAttribute("data-type") || "CART_ITEMS", _ = o.getAttribute("data-number") || "1", n = o.outerHTML;
137
+ y.push({
118
138
  element: o,
119
- outerHtml: r,
120
- type: p,
121
- number: T
139
+ outerHtml: n,
140
+ type: T,
141
+ number: _
122
142
  });
123
143
  });
124
- let h = k + A.documentElement.outerHTML;
125
- N.reverse().forEach(({ outerHtml: o, type: p, number: T }) => {
126
- const r = q[p], _ = r ? `${r}_total_product_kind` : "";
127
- if (_) {
128
- const R = parseInt(T) - 1, n = `${`{% if ${_} > ${R} %}`}${o}{% endif %}`;
129
- h = h.replace(o, B(n));
144
+ let E = L + p.documentElement.outerHTML;
145
+ y.reverse().forEach(({ outerHtml: o, type: T, number: _ }) => {
146
+ const n = q[T], S = n ? `${n}_total_product_kind` : "";
147
+ if (S) {
148
+ const g = parseInt(_) - 1, c = `${`{% if ${S} > ${g} %}`}${o}{% endif %}`;
149
+ E = E.replace(o, v(c));
130
150
  }
131
151
  });
132
- const V = A.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set();
133
- return V.forEach((o) => {
152
+ const F = p.querySelectorAll('[product-attr="originalPrice"][data-type]'), R = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Set();
153
+ return F.forEach((o) => {
134
154
  var t;
135
- const p = o.getAttribute("data-number"), T = o.getAttribute("data-type");
136
- if (!p || !q[T])
155
+ const T = o.getAttribute("data-number"), _ = o.getAttribute("data-type");
156
+ if (!T || !q[_])
137
157
  return;
138
- const r = o.closest(".product-original-price-class");
139
- if (!r || D.has(r))
158
+ const n = o.closest(".product-original-price-class");
159
+ if (!n || O.has(n))
140
160
  return;
141
- D.add(r);
142
- const _ = r.outerHTML, y = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), R = w.get(_) ?? { number: p, type: T, wrap: [] };
143
- R.wrap.push(y !== "false"), w.set(_, R);
144
- }), w.forEach(({ number: o, type: p, wrap: T }, r) => {
145
- if (r.includes("{% if") || !T.some(Boolean))
161
+ O.add(n);
162
+ const S = n.outerHTML, I = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), g = R.get(S) ?? { number: T, type: _, wrap: [] };
163
+ g.wrap.push(I !== "false"), R.set(S, g);
164
+ }), R.forEach(({ number: o, type: T, wrap: _ }, n) => {
165
+ if (n.includes("{% if") || !_.some(Boolean))
146
166
  return;
147
- const _ = M.PAIRS_FOR_EXTENSION.price[p].PRICE, y = M.PAIRS_FOR_EXTENSION.originalPrice[p].PRICE, R = `{% if ${_}_${o} != ${y}_${o} %}`, t = [R, W(R)];
148
- let m = "", n = 0, f = 0, S = h.indexOf(r);
149
- for (; S !== -1; ) {
150
- const I = T[f] === !0 && !v(h, S, t);
151
- m += h.slice(n, S) + (I ? `${R}${r}{% endif %}` : r), n = S + r.length, f += 1, S = h.indexOf(r, n);
167
+ const S = k.PAIRS_FOR_EXTENSION.price[T].PRICE, I = k.PAIRS_FOR_EXTENSION.originalPrice[T].PRICE, g = `{% if ${S}_${o} != ${I}_${o} %}`, t = [g, W(g)];
168
+ let m = "", c = 0, f = 0, b = E.indexOf(n);
169
+ for (; b !== -1; ) {
170
+ const M = _[f] === !0 && !j(E, b, t);
171
+ m += E.slice(c, b) + (M ? `${g}${n}{% endif %}` : n), c = b + n.length, f += 1, b = E.indexOf(n, c);
152
172
  }
153
- h = m + h.slice(n);
154
- }), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
173
+ E = m + E.slice(c);
174
+ }), E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
155
175
  }
156
176
  export {
157
- et as pairProductVariables
177
+ ct as pairProductVariables
158
178
  };
@@ -1,19 +1,8 @@
1
- const r = (t) => {
2
- const e = -t.getTimezoneOffset(), o = e >= 0 ? "+" : "-", n = Math.abs(e), s = Math.floor(n / 60), i = n % 60;
3
- return i === 0 ? `UTC${o}${s}` : `UTC${o}${s}:${String(i).padStart(2, "0")}`;
4
- }, a = () => {
5
- var e;
6
- const { timeZone: t } = new Intl.DateTimeFormat().resolvedOptions();
7
- return ((e = t.split("/").pop()) == null ? void 0 : e.replace(/_/g, " ")) ?? t;
8
- }, c = (t, e = !1) => {
9
- const o = t.toLocaleTimeString([], {
10
- hour: "2-digit",
11
- hour12: !1,
12
- minute: "2-digit",
13
- second: "2-digit"
14
- });
15
- return e ? `${o} (${r(t)} ${a()})` : o;
16
- };
1
+ const g = (t) => String(t).padStart(2, "0"), a = (t, e) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), o = (t, e = /* @__PURE__ */ new Date()) => ({
2
+ isToday: a(t, e),
3
+ time: `${g(t.getHours())}:${g(t.getMinutes())}`,
4
+ date: `${g(t.getDate())}.${g(t.getMonth() + 1)}.${t.getFullYear()}`
5
+ });
17
6
  export {
18
- c as formatLocalTime
7
+ o as autoSaveTimestamp
19
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.23.0",
3
+ "version": "3.24.0-beta.2a3ba08",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "guido": {
130
130
  "stripo": {
131
- "version": "2.81.1"
131
+ "version": "2.83.1"
132
132
  }
133
133
  }
134
134
  }
@@ -1,22 +0,0 @@
1
- import o from "./AutoSaveToggle.vue2.js";
2
- /* empty css */
3
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var e = this, a = e._self._c, t = e._self._setupProxy;
6
- return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
7
- t.isHovered = !0;
8
- }, mouseleave: function(s) {
9
- t.isHovered = !1;
10
- } } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === t.AUTOSAVE_STATUS.SAVING ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
11
- }, l = [], r = /* @__PURE__ */ i(
12
- o,
13
- n,
14
- l,
15
- !1,
16
- null,
17
- "2c964af4"
18
- );
19
- const d = r.exports;
20
- export {
21
- d as default
22
- };
@@ -1,19 +0,0 @@
1
- import { defineComponent as i, ref as f, computed as u } from "vue";
2
- import { useConfig as l } from "../../../composables/useConfig.js";
3
- import { useTranslations as p } from "../../../composables/useTranslations.js";
4
- import { useAutosaveStore as c, AUTOSAVE_STATUS as t } from "../../../stores/autosave.js";
5
- import { useEditorStore as S } from "../../../stores/editor.js";
6
- import { formatLocalTime as d } from "../../../utils/timeUtil.js";
7
- import { InToggle as g, InLoading as _, InInfoBox as A } from "@useinsider/design-system-vue";
8
- const U = /* @__PURE__ */ i({
9
- __name: "AutoSaveToggle",
10
- setup(v) {
11
- const { isFeatureEnabled: e } = l(), r = S(), o = c(), s = p(), n = f(!1), a = u(() => o.status !== t.SAVED || !o.lastSavedAt ? "" : d(o.lastSavedAt));
12
- return { __sfc: !0, isFeatureEnabled: e, editorStore: r, autosaveStore: o, trans: s, isHovered: n, lastSavedLabel: a, toggle: (m) => {
13
- o.isOn = m;
14
- }, AUTOSAVE_STATUS: t, InInfoBox: A, InLoading: _, InToggle: g };
15
- }
16
- });
17
- export {
18
- U as default
19
- };