@useinsider/guido 3.17.0-beta.bc6e089 → 3.17.0-beta.c3ab4de
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/@types/config/schemas.js +15 -13
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +7 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
- package/dist/composables/useAccessibilityApi.js +31 -0
- package/dist/composables/useCustomInterfaceAppearance.js +31 -28
- package/dist/config/i18n/en/labels.json.js +28 -4
- package/dist/config/migrator/itemsBlockMigrator.js +156 -204
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +17 -18
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +55 -58
- package/dist/extensions/Blocks/Items/enums/productEnums.js +9 -14
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +9 -11
- package/dist/extensions/Blocks/Items/template.js +206 -214
- package/dist/guido.css +1 -1
- package/dist/node_modules/@vueuse/core/index.js +102 -0
- package/dist/node_modules/@vueuse/shared/index.js +40 -28
- package/dist/sprite.svg +6 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -3
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/editor.d.ts +76 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/timeUtil.d.ts +10 -0
- package/dist/static/styles/components/accessibility.css.js +137 -0
- package/dist/static/styles/variables.css.js +1 -0
- package/dist/stores/editor.js +4 -1
- package/dist/stores/onboarding.js +16 -11
- package/dist/utils/pairProductVariables.js +70 -70
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +1 -1
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +0 -20
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +0 -44
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { useOnboardingApi as s } from "../services/onboardingApi.js";
|
|
2
2
|
import { defineStore as e } from "pinia";
|
|
3
|
-
const
|
|
3
|
+
const r = () => ({
|
|
4
4
|
cardIndex: 0,
|
|
5
5
|
isActive: !1,
|
|
6
6
|
config: []
|
|
7
7
|
}), a = () => ({
|
|
8
8
|
onboardings: {
|
|
9
|
-
newVersionPopup:
|
|
10
|
-
genericOnboarding:
|
|
11
|
-
textBlockOnboarding:
|
|
12
|
-
versionHistoryOnboarding:
|
|
13
|
-
ampOnboarding:
|
|
14
|
-
itemsOnboarding:
|
|
9
|
+
newVersionPopup: r(),
|
|
10
|
+
genericOnboarding: r(),
|
|
11
|
+
textBlockOnboarding: r(),
|
|
12
|
+
versionHistoryOnboarding: r(),
|
|
13
|
+
ampOnboarding: r(),
|
|
14
|
+
itemsOnboarding: r(),
|
|
15
|
+
editorTabBarOnboarding: r()
|
|
15
16
|
},
|
|
16
17
|
userModalState: {},
|
|
17
18
|
isFetched: !1
|
|
@@ -44,6 +45,10 @@ const t = () => ({
|
|
|
44
45
|
const { itemsOnboarding: i } = n.onboardings;
|
|
45
46
|
return i.config[i.cardIndex];
|
|
46
47
|
},
|
|
48
|
+
getEditorTabBarCurrentCard: (n) => {
|
|
49
|
+
const { editorTabBarOnboarding: i } = n.onboardings;
|
|
50
|
+
return i.config[i.cardIndex];
|
|
51
|
+
},
|
|
47
52
|
shouldShowOnboarding: (n) => (i) => {
|
|
48
53
|
const o = n.userModalState.Guido;
|
|
49
54
|
return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
|
|
@@ -72,8 +77,8 @@ const t = () => ({
|
|
|
72
77
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
73
78
|
},
|
|
74
79
|
updateCardPosition(n, i, o) {
|
|
75
|
-
const
|
|
76
|
-
|
|
80
|
+
const t = this.onboardings[n].config[i];
|
|
81
|
+
t && (t.top = o.top, t.position = o.position);
|
|
77
82
|
},
|
|
78
83
|
setConfig(n, i) {
|
|
79
84
|
this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
@@ -101,8 +106,8 @@ const t = () => ({
|
|
|
101
106
|
}
|
|
102
107
|
},
|
|
103
108
|
async setUserModalState(n, i, o) {
|
|
104
|
-
const { setUserModalState:
|
|
105
|
-
await
|
|
109
|
+
const { setUserModalState: t } = s();
|
|
110
|
+
await t(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
});
|
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
import { escapeReplacement as
|
|
4
|
-
import { preserveTextStyles as
|
|
5
|
-
import { unwrapProductNameLinks as
|
|
6
|
-
const
|
|
2
|
+
import { DefaultConfigValues as V } from "../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
3
|
+
import { escapeReplacement as G } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
|
|
4
|
+
import { preserveTextStyles as F } from "./preserveTextStyles.js";
|
|
5
|
+
import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
|
|
6
|
+
const x = {
|
|
7
7
|
CART_ITEMS: "ins_apr",
|
|
8
8
|
BROWSED_ITEMS: "browsed_item",
|
|
9
9
|
PURCHASED_ITEMS: "purchased_item"
|
|
10
|
-
},
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
for (;
|
|
14
|
-
|
|
15
|
-
return g.some((
|
|
10
|
+
}, N = (S) => S.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
11
|
+
function v(S, H, g) {
|
|
12
|
+
let $ = H;
|
|
13
|
+
for (; $ > 0 && /\s/.test(S[$ - 1]); )
|
|
14
|
+
$ -= 1;
|
|
15
|
+
return g.some((I) => S.endsWith(I, $));
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
Object.entries(
|
|
17
|
+
function J(S) {
|
|
18
|
+
const H = N(S), g = new DOMParser().parseFromString(H, "text/html");
|
|
19
|
+
X(g);
|
|
20
|
+
const $ = L.PAIRS_FOR_EXTENSION;
|
|
21
|
+
Object.entries($).forEach(([n, d]) => {
|
|
22
22
|
g.querySelectorAll(".ins-product-td").forEach((r) => {
|
|
23
23
|
const E = r.getAttribute("data-number") || "1", m = r.getAttribute("data-type") || "CART_ITEMS";
|
|
24
24
|
r.querySelectorAll(`[product-attr="${n}"]`).forEach((t) => {
|
|
25
|
-
var
|
|
25
|
+
var T, P, D;
|
|
26
26
|
const R = t.getAttribute("data-type") || m, o = t.getAttribute("data-number") || E, f = d[R];
|
|
27
27
|
if (f)
|
|
28
28
|
switch (n) {
|
|
29
29
|
case "imageSrc": {
|
|
30
|
-
let e = null,
|
|
31
|
-
if (t.tagName === "IMG" ? (e = t,
|
|
30
|
+
let e = null, s = null;
|
|
31
|
+
if (t.tagName === "IMG" ? (e = t, s = e.closest("a")) : (e = t.querySelector("img"), s = t.querySelector("a") || t.closest("a")), !e)
|
|
32
32
|
break;
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const u = b.split("/").pop() || "", y =
|
|
38
|
-
return
|
|
39
|
-
}) && (e.src = `{{${
|
|
33
|
+
const a = f.DEFAULT, l = f.ATTR;
|
|
34
|
+
if (a && e.src) {
|
|
35
|
+
const i = e.src;
|
|
36
|
+
a.some((b) => {
|
|
37
|
+
const u = b.split("/").pop() || "", y = i.split("/").pop() || "";
|
|
38
|
+
return i.includes(b) || i.includes(u) || y === u;
|
|
39
|
+
}) && (e.src = `{{${l}_${o}}}`);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const _ =
|
|
46
|
-
(u === "#" || u === "" || u.endsWith("#!") || u.endsWith(b) || u === `${window.location.href}${b}` || !u || u === window.location.href) && (
|
|
41
|
+
const c = (P = (T = $.name) == null ? void 0 : T[R]) == null ? void 0 : P.ATTR;
|
|
42
|
+
if (c && e.setAttribute("alt", `{{${c}_${o}}}`), s) {
|
|
43
|
+
const i = (D = $.itemLink) == null ? void 0 : D[R];
|
|
44
|
+
if (i) {
|
|
45
|
+
const _ = i.HREF, b = i.DEFAULT_HREF || "#!", u = s.href;
|
|
46
|
+
(u === "#" || u === "" || u.endsWith("#!") || u.endsWith(b) || u === `${window.location.href}${b}` || !u || u === window.location.href) && (s.href = `{{${_}_${o}}}`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
51
51
|
case "name": {
|
|
52
|
-
const e = f,
|
|
53
|
-
t.textContent && (t.innerHTML =
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
(
|
|
52
|
+
const e = f, s = e.ATTR, a = e.DEFAULT_HREF || "#!", l = e.HREF;
|
|
53
|
+
t.textContent && (t.innerHTML = F(t, `{{${s}_${o}}}`));
|
|
54
|
+
const c = t.closest("a") || (t.tagName === "A" ? t : null);
|
|
55
|
+
if (c && l) {
|
|
56
|
+
const i = c.href, _ = `${window.location.href}${a}`;
|
|
57
|
+
(i === _ || i.endsWith(a)) && (c.href = `{{${l}_${o}}}`);
|
|
58
58
|
}
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case "price":
|
|
62
62
|
case "originalPrice": {
|
|
63
|
-
const e = f,
|
|
63
|
+
const e = f, s = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), l = s === "true", c = a === "true", i = t.getAttribute("data-curency") || "before";
|
|
64
64
|
let _;
|
|
65
|
-
|
|
65
|
+
c ? _ = l ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : _ = l ? e.PRICE_FORMATTED : e.PRICE;
|
|
66
66
|
const b = e.CURRENCY;
|
|
67
67
|
let u = `{{${_}_${o}}}`;
|
|
68
|
-
const y = (t.getAttribute("data-currency_symbol") || "").trim(),
|
|
68
|
+
const y = (t.getAttribute("data-currency_symbol") || "").trim(), W = y !== "" && y !== V.productPriceCurrencySymbolControlValue;
|
|
69
69
|
let C = "";
|
|
70
|
-
|
|
70
|
+
W ? C = y : b && (C = `{{${b}_${o}}}`), C && (u = i === "after" ? `${u} ${C}` : `${C} ${u}`), t.innerHTML = F(t, u);
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
case "quantity": {
|
|
74
|
-
const e = f,
|
|
75
|
-
|
|
74
|
+
const e = f, s = e.ATTR, a = e.DEFAULT;
|
|
75
|
+
t.textContent && t.textContent.trim() === a && (t.innerHTML = F(t, `{{${s}_${o}}}`));
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
case "button": {
|
|
79
|
-
const e = f,
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
(
|
|
79
|
+
const e = f, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t.tagName === "A" ? t : t.querySelector("a");
|
|
80
|
+
if (l) {
|
|
81
|
+
const c = l.href || "", i = `${window.location.href}${a}`;
|
|
82
|
+
(c === "" || c === "#" || c === i || c.endsWith(a) || c.endsWith("#!") || c === window.location.href) && (l.href = `{{${s}_${o}}}`);
|
|
83
83
|
}
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
case "itemLink": {
|
|
87
|
-
const e = f,
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
(
|
|
87
|
+
const e = f, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t;
|
|
88
|
+
if (l.href) {
|
|
89
|
+
const c = l.href, i = `${window.location.href}${a}`;
|
|
90
|
+
(c === i || c.endsWith(a)) && (l.href = `{{${s}_${o}}}`);
|
|
91
91
|
}
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
default: {
|
|
95
95
|
if ("ATTR" in f) {
|
|
96
96
|
const e = f.ATTR;
|
|
97
|
-
t.textContent && (t.innerHTML =
|
|
97
|
+
t.textContent && (t.innerHTML = F(t, `{{${e}_${o}}}`));
|
|
98
98
|
}
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
@@ -102,9 +102,9 @@ function K(S) {
|
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
|
-
const
|
|
106
|
-
` : "",
|
|
107
|
-
|
|
105
|
+
const I = H.match(/<!DOCTYPE[^>]*>/i), O = I ? `${I[0]}
|
|
106
|
+
` : "", q = g.querySelectorAll(".ins-product-td"), M = [];
|
|
107
|
+
q.forEach((n) => {
|
|
108
108
|
const d = n.getAttribute("data-type") || "CART_ITEMS", p = n.getAttribute("data-number") || "1", r = n.outerHTML;
|
|
109
109
|
M.push({
|
|
110
110
|
element: n,
|
|
@@ -115,36 +115,36 @@ function K(S) {
|
|
|
115
115
|
});
|
|
116
116
|
let A = O + g.documentElement.outerHTML;
|
|
117
117
|
M.reverse().forEach(({ outerHtml: n, type: d, number: p }) => {
|
|
118
|
-
const r =
|
|
118
|
+
const r = x[d], E = r ? `${r}_total_product_kind` : "";
|
|
119
119
|
if (E) {
|
|
120
|
-
const
|
|
121
|
-
A = A.replace(n,
|
|
120
|
+
const h = parseInt(p) - 1, o = `${`{% if ${E} > ${h} %}`}${n}{% endif %}`;
|
|
121
|
+
A = A.replace(n, G(o));
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
|
-
const
|
|
125
|
-
return
|
|
124
|
+
const U = g.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set();
|
|
125
|
+
return U.forEach((n) => {
|
|
126
126
|
var t;
|
|
127
127
|
const d = n.getAttribute("data-number"), p = n.getAttribute("data-type");
|
|
128
|
-
if (!d || !
|
|
128
|
+
if (!d || !x[p])
|
|
129
129
|
return;
|
|
130
130
|
const r = n.closest(".product-original-price-class");
|
|
131
131
|
if (!r || k.has(r))
|
|
132
132
|
return;
|
|
133
133
|
k.add(r);
|
|
134
|
-
const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"),
|
|
135
|
-
|
|
134
|
+
const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), h = w.get(E) ?? { number: d, type: p, wrap: [] };
|
|
135
|
+
h.wrap.push(m !== "false"), w.set(E, h);
|
|
136
136
|
}), w.forEach(({ number: n, type: d, wrap: p }, r) => {
|
|
137
137
|
if (r.includes("{% if") || !p.some(Boolean))
|
|
138
138
|
return;
|
|
139
|
-
const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE,
|
|
140
|
-
let R = "", o = 0, f = 0,
|
|
141
|
-
for (;
|
|
142
|
-
const
|
|
143
|
-
R += A.slice(o,
|
|
139
|
+
const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, h = `{% if ${E}_${n} != ${m}_${n} %}`, t = [h, N(h)];
|
|
140
|
+
let R = "", o = 0, f = 0, T = A.indexOf(r);
|
|
141
|
+
for (; T !== -1; ) {
|
|
142
|
+
const P = p[f] === !0 && !v(A, T, t);
|
|
143
|
+
R += A.slice(o, T) + (P ? `${h}${r}{% endif %}` : r), o = T + r.length, f += 1, T = A.indexOf(r, o);
|
|
144
144
|
}
|
|
145
145
|
A = R + A.slice(o);
|
|
146
146
|
}), A.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
147
147
|
}
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
J as pairProductVariables
|
|
150
150
|
};
|
package/dist/utils/timeUtil.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
7
|
+
o as autoSaveTimestamp
|
|
19
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.17.0-beta.
|
|
3
|
+
"version": "3.17.0-beta.c3ab4de",
|
|
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",
|
|
@@ -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
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SETTINGS_ENUMS as L } from "../enums/settingsEnums.js";
|
|
2
|
-
const c = "130px", O = "100%", t = (e) => e === L.ORIENTATION.HORIZONTAL ? c : O, n = {
|
|
3
|
-
VERTICAL: "es-p5b es-p5t",
|
|
4
|
-
HORIZONTAL: "es-p5l es-p5r"
|
|
5
|
-
}, o = "data-items-cell-pad", R = (e) => `${o}="${e ? "v" : "h"}"`, E = (e) => e ? ` ${n.VERTICAL}` : ` ${n.HORIZONTAL}`, N = (e, A) => {
|
|
6
|
-
if (!e.includes(o))
|
|
7
|
-
return e;
|
|
8
|
-
const T = A ? n.HORIZONTAL : n.VERTICAL, s = A ? n.VERTICAL : n.HORIZONTAL, I = A ? "v" : "h";
|
|
9
|
-
return e.replace(T, s).replace(new RegExp(`${o}="[hv]"`), `${o}="${I}"`);
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
n as BLOCK_CELL_PADDING,
|
|
13
|
-
o as BLOCK_CELL_PAD_ATTR,
|
|
14
|
-
c as NAME_HORIZONTAL_MAX_WIDTH,
|
|
15
|
-
O as NAME_VERTICAL_MAX_WIDTH,
|
|
16
|
-
R as blockCellPadMarker,
|
|
17
|
-
E as blockCellPaddingFor,
|
|
18
|
-
t as nameMaxWidthFor,
|
|
19
|
-
N as reorientBlockCellPadding
|
|
20
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single owner for the Items card orientation-dependent layout contract (SD-149368).
|
|
3
|
-
*
|
|
4
|
-
* Two things depend on a card's orientation and are written across several layers:
|
|
5
|
-
*
|
|
6
|
-
* 1. Name column width — a horizontal card lays the name in a narrow side-by-side
|
|
7
|
-
* column, so it is capped; a vertical card gives it a full-width row.
|
|
8
|
-
* 2. Block-cell padding — the collapsible price / original-price block-cell carries its
|
|
9
|
-
* own inter-cell spacing (horizontal cards pad left/right, vertical cards pad
|
|
10
|
-
* top/bottom) so a hidden element removes its own spacing instead of leaving a gap.
|
|
11
|
-
*
|
|
12
|
-
* Every layer that writes these — template render, layouts/horizontal.html,
|
|
13
|
-
* NameTrimmingControl (trimming toggle) and settingsControl (orientation change) — MUST
|
|
14
|
-
* derive them here, or a migrated / re-toggled card silently drifts out of sync with
|
|
15
|
-
* freshly generated markup (convention B1: cross-layer literals live in one module).
|
|
16
|
-
*/
|
|
17
|
-
export declare const NAME_HORIZONTAL_MAX_WIDTH = "130px";
|
|
18
|
-
export declare const NAME_VERTICAL_MAX_WIDTH = "100%";
|
|
19
|
-
/** Name max-width for a card orientation. Non-horizontal (incl. undefined) → full width. */
|
|
20
|
-
export declare const nameMaxWidthFor: (orientation?: string) => string;
|
|
21
|
-
/** Orientation-dependent inter-cell padding classes for a collapsible block-cell. */
|
|
22
|
-
export declare const BLOCK_CELL_PADDING: {
|
|
23
|
-
readonly VERTICAL: "es-p5b es-p5t";
|
|
24
|
-
readonly HORIZONTAL: "es-p5l es-p5r";
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Attribute the block-cell carries to mark its LAYOUT-owned padding orientation ('v'|'h').
|
|
28
|
-
* The orientation toggle keys off this marker so it only ever rewrites the padding the
|
|
29
|
-
* layout itself baked — a user's own es-p* padding classes are never matched or clobbered
|
|
30
|
-
* (SD-149368 F1), and a cell without the marker is left untouched rather than mis-swapped.
|
|
31
|
-
*/
|
|
32
|
-
export declare const BLOCK_CELL_PAD_ATTR = "data-items-cell-pad";
|
|
33
|
-
/** Marker attribute (`data-items-cell-pad="v|h"`) for a block-cell in the given orientation. */
|
|
34
|
-
export declare const blockCellPadMarker: (isVertical: boolean) => string;
|
|
35
|
-
/** Padding classes (leading space included) for a block-cell in the given orientation. */
|
|
36
|
-
export declare const blockCellPaddingFor: (isVertical: boolean) => string;
|
|
37
|
-
/**
|
|
38
|
-
* Rewrites a block-cell's LAYOUT-owned padding classes to the target orientation, keyed off
|
|
39
|
-
* the BLOCK_CELL_PAD_ATTR marker. The orientation-change rebuild re-injects existing cells
|
|
40
|
-
* via getOuterHTML(), which still carry the previous orientation's padding — swap only the
|
|
41
|
-
* layout pair (and flip the marker) so price/original-price cells stay padded after a toggle
|
|
42
|
-
* (SD-149368 F3), while a user's own padding and any unmarked cell are left alone (F1).
|
|
43
|
-
*/
|
|
44
|
-
export declare const reorientBlockCellPadding: (html: string, toVertical: boolean) => string;
|
/package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts}
RENAMED
|
File without changes
|