@useinsider/guido 3.1.1-beta.0b09ab4 → 3.1.1-beta.3adf172
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/config/compiler/unsubscribeCompilerRules.js +37 -37
- package/dist/config/i18n/en/tooltips.json.js +1 -2
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +79 -81
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/static/styles/components/button.css.js +7 -13
- package/dist/static/styles/components/narrow-panel.css.js +0 -52
- package/dist/utils/templatePreparation.js +16 -14
- package/package.json +3 -3
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import { useDynamicContentStore as
|
|
6
|
-
import { useUnsubscribeStore as
|
|
7
|
-
const
|
|
1
|
+
import { usePartner as y } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as p, LINK_TYPES as S, INSIDER_ID as m, URLS as R } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as I } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as N } from "../../stores/config.js";
|
|
5
|
+
import { useDynamicContentStore as U } from "../../stores/dynamic-content.js";
|
|
6
|
+
import { useUnsubscribeStore as C } from "../../stores/unsubscribe.js";
|
|
7
|
+
const G = [
|
|
8
8
|
{
|
|
9
9
|
id: "add-unsubscribe-link-values",
|
|
10
10
|
description: "Adding unsubscribe link values",
|
|
11
11
|
type: "custom",
|
|
12
12
|
processor: (t) => {
|
|
13
|
-
const { getPartnerName: i } =
|
|
13
|
+
const { getPartnerName: i } = y(), o = N(), s = U(), d = C(), a = o.variationId;
|
|
14
14
|
if (!a)
|
|
15
15
|
return t;
|
|
16
16
|
let e = t;
|
|
17
|
-
const r = `/${i()}/email/${a}?user={{iid}}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const r = `/${i()}/email/${a}?user={{iid}}`, E = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]");
|
|
18
|
+
let c = !1, l = !1;
|
|
19
|
+
return E.forEach((f) => {
|
|
20
|
+
var b;
|
|
21
|
+
const u = f.getAttribute("data-unsubscribe-page-list");
|
|
22
|
+
if (!u)
|
|
22
23
|
return;
|
|
23
|
-
const
|
|
24
|
-
(
|
|
25
|
-
)) ?? []
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}), e;
|
|
24
|
+
const _ = I(u), g = ((b = d.templates) == null ? void 0 : b.filter(
|
|
25
|
+
(n) => _.includes(n.id)
|
|
26
|
+
)) ?? [];
|
|
27
|
+
c = c || g.some((n) => n.type === S.UNSUBSCRIBE_LINK_TYPE), l = l || g.some((n) => n.type === S.PREFERENCES_LINK_TYPE);
|
|
28
|
+
}), (c || l) && (s.selectedDynamicContentList.some((u) => u.value === m) || s.selectedDynamicContentList.push({
|
|
29
|
+
text: m,
|
|
30
|
+
value: m,
|
|
31
|
+
fallback: ""
|
|
32
|
+
})), c && (e = e.replace(
|
|
33
|
+
p.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
34
|
+
R.UNSUBSCRIBE_URL + r
|
|
35
|
+
)), l && (e = e.replace(
|
|
36
|
+
p.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
37
|
+
R.PREFERENCES_URL + r
|
|
38
|
+
)), E.length && (e = e.replace(p.UNSUBSCRIBE_LINK_REGEX, "")), e;
|
|
39
39
|
},
|
|
40
40
|
priority: 60
|
|
41
41
|
},
|
|
@@ -43,7 +43,7 @@ const D = [
|
|
|
43
43
|
id: "remove-data-ogsb-button-styles",
|
|
44
44
|
description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
|
|
45
45
|
type: "regex",
|
|
46
|
-
pattern:
|
|
46
|
+
pattern: p.DATA_OGSB_BUTTON_CSS_REGEX,
|
|
47
47
|
replacement: "",
|
|
48
48
|
flags: "g",
|
|
49
49
|
priority: 61
|
|
@@ -61,16 +61,16 @@ const D = [
|
|
|
61
61
|
type: "custom",
|
|
62
62
|
processor: (t) => {
|
|
63
63
|
let i = t;
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
if (
|
|
64
|
+
const o = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
65
|
+
return o && o.forEach((s) => {
|
|
66
|
+
if (s.includes("insEmail=1"))
|
|
67
67
|
return;
|
|
68
|
-
if (
|
|
69
|
-
const a =
|
|
68
|
+
if (s.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
69
|
+
const a = s.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
|
|
70
70
|
const r = e.slice(6, e.length - 1).trim();
|
|
71
71
|
return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
|
|
72
72
|
});
|
|
73
|
-
i = i.replace(
|
|
73
|
+
i = i.replace(s, a);
|
|
74
74
|
}
|
|
75
75
|
}), i;
|
|
76
76
|
},
|
|
@@ -78,5 +78,5 @@ const D = [
|
|
|
78
78
|
}
|
|
79
79
|
];
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
G as unsubscribeCompilerRules
|
|
82
82
|
};
|
|
@@ -75,8 +75,7 @@ const e = {
|
|
|
75
75
|
"The image with the invalid link cannot be saved to the image gallery": "Enter a valid image link to continue.",
|
|
76
76
|
"The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
|
|
77
77
|
"The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
|
|
78
|
-
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
|
|
79
|
-
"Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
|
|
78
|
+
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
|
|
80
79
|
};
|
|
81
80
|
export {
|
|
82
81
|
e as default
|
|
@@ -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}`)
|
|
172
|
+
return "querySelector" in t ? t.querySelector(`.${a}`) : null;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Migrate configuration from legacy format
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import { DESKTOP_CONTAINER_SELECTOR as
|
|
7
|
-
import { SPACING_STEP as
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var P = (u, c, t) => c in u ? G(u, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[c] = t;
|
|
3
|
+
var h = (u, c, t) => P(u, typeof c != "symbol" ? c + "" : c, t);
|
|
4
|
+
import { ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as R } from "../../../common-control.js";
|
|
6
|
+
import { DESKTOP_CONTAINER_SELECTOR as m, MOBILE_CONTAINER_SELECTOR as M } from "../../constants/selectors.js";
|
|
7
|
+
import { SPACING_STEP as S, MAX_SPACING as _, MIN_SPACING as N, DEFAULT_COLUMN_SPACING as C, DEFAULT_ROW_SPACING as E } from "../../constants/layout.js";
|
|
8
8
|
import { RecommendationConfigService as p } from "../../services/configService.js";
|
|
9
9
|
import { useRecommendationExtensionStore as V } from "../../store/recommendation.js";
|
|
10
|
-
import { safeGetStyle as
|
|
11
|
-
import { getCurrentLayout as
|
|
12
|
-
import { useDebounceFn as
|
|
10
|
+
import { safeGetStyle as A, safeGetParent as w } from "../../utils/tagName.js";
|
|
11
|
+
import { getCurrentLayout as b, getBlockElement as B } from "../main/utils.js";
|
|
12
|
+
import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
13
13
|
const U = "recommendation-spacing-control", n = {
|
|
14
14
|
COLUMN_SPACING: "columnSpacing",
|
|
15
15
|
COLUMN_SPACING_LABEL: "columnSpacingLabel",
|
|
@@ -19,46 +19,46 @@ const U = "recommendation-spacing-control", n = {
|
|
|
19
19
|
MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
|
|
20
20
|
MOBILE_ROW_SPACING: "mobileRowSpacing",
|
|
21
21
|
MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
|
|
22
|
-
},
|
|
22
|
+
}, O = {
|
|
23
23
|
COLUMN_SPACING: "data-column-spacing",
|
|
24
24
|
ROW_SPACING: "data-row-spacing",
|
|
25
25
|
MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
|
|
26
26
|
MOBILE_ROW_SPACING: "data-mobile-row-spacing"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
if (!
|
|
30
|
-
return
|
|
31
|
-
const t = parseFloat(
|
|
32
|
-
return Number.isNaN(t) ?
|
|
28
|
+
function L(u, c) {
|
|
29
|
+
if (!u)
|
|
30
|
+
return c;
|
|
31
|
+
const t = parseFloat(u);
|
|
32
|
+
return Number.isNaN(t) ? c : t;
|
|
33
33
|
}
|
|
34
|
-
class j extends
|
|
34
|
+
class j extends R {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
h(this, "store", V());
|
|
38
|
+
h(this, "unsubscribeOrientation", null);
|
|
39
39
|
/**
|
|
40
40
|
* Debounced version of _onColumnSpacingChange
|
|
41
41
|
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
h(this, "_debouncedOnColumnSpacingChange", f((t) => {
|
|
44
44
|
this._onColumnSpacingChange(t);
|
|
45
45
|
}, 300));
|
|
46
46
|
/**
|
|
47
47
|
* Debounced version of _onRowSpacingChange
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
h(this, "_debouncedOnRowSpacingChange", f((t) => {
|
|
50
50
|
this._onRowSpacingChange(t);
|
|
51
51
|
}, 300));
|
|
52
52
|
/**
|
|
53
53
|
* Debounced version of _onMobileColumnSpacingChange
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
h(this, "_debouncedOnMobileColumnSpacingChange", f((t) => {
|
|
56
56
|
this._onMobileColumnSpacingChange(t);
|
|
57
57
|
}, 300));
|
|
58
58
|
/**
|
|
59
59
|
* Debounced version of _onMobileRowSpacingChange
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
h(this, "_debouncedOnMobileRowSpacingChange", f((t) => {
|
|
62
62
|
this._onMobileRowSpacingChange(t);
|
|
63
63
|
}, 300));
|
|
64
64
|
}
|
|
@@ -75,9 +75,9 @@ class j extends w {
|
|
|
75
75
|
}),
|
|
76
76
|
this._GuCounter({
|
|
77
77
|
name: n.COLUMN_SPACING,
|
|
78
|
-
minValue:
|
|
79
|
-
maxValue:
|
|
80
|
-
step:
|
|
78
|
+
minValue: N,
|
|
79
|
+
maxValue: _,
|
|
80
|
+
step: S
|
|
81
81
|
}),
|
|
82
82
|
this._GuLabel({
|
|
83
83
|
text: this.api.translate("Row Spacing (px)"),
|
|
@@ -85,9 +85,9 @@ class j extends w {
|
|
|
85
85
|
}),
|
|
86
86
|
this._GuCounter({
|
|
87
87
|
name: n.ROW_SPACING,
|
|
88
|
-
minValue:
|
|
89
|
-
maxValue:
|
|
90
|
-
step:
|
|
88
|
+
minValue: N,
|
|
89
|
+
maxValue: _,
|
|
90
|
+
step: S
|
|
91
91
|
}),
|
|
92
92
|
this._GuLabel({
|
|
93
93
|
text: this.api.translate("Column Spacing on Mobile (px)"),
|
|
@@ -95,9 +95,9 @@ class j extends w {
|
|
|
95
95
|
}),
|
|
96
96
|
this._GuCounter({
|
|
97
97
|
name: n.MOBILE_COLUMN_SPACING,
|
|
98
|
-
minValue:
|
|
99
|
-
maxValue:
|
|
100
|
-
step:
|
|
98
|
+
minValue: N,
|
|
99
|
+
maxValue: _,
|
|
100
|
+
step: S
|
|
101
101
|
}),
|
|
102
102
|
this._GuLabel({
|
|
103
103
|
text: this.api.translate("Row Spacing on Mobile (px)"),
|
|
@@ -105,9 +105,9 @@ class j extends w {
|
|
|
105
105
|
}),
|
|
106
106
|
this._GuCounter({
|
|
107
107
|
name: n.MOBILE_ROW_SPACING,
|
|
108
|
-
minValue:
|
|
109
|
-
maxValue:
|
|
110
|
-
step:
|
|
108
|
+
minValue: N,
|
|
109
|
+
maxValue: _,
|
|
110
|
+
step: S
|
|
111
111
|
})
|
|
112
112
|
])}
|
|
113
113
|
</div>
|
|
@@ -132,13 +132,13 @@ class j extends w {
|
|
|
132
132
|
_updateSpacingVisibility() {
|
|
133
133
|
if (!this.api)
|
|
134
134
|
return;
|
|
135
|
-
const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e ||
|
|
135
|
+
const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || b(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, l = t.mobileCardsInRow > 1;
|
|
136
136
|
this.api.setVisibility(n.COLUMN_SPACING, i && r), this.api.setVisibility(n.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(n.ROW_SPACING, !0), this.api.setVisibility(n.ROW_SPACING_LABEL, !0), this.api.setVisibility(
|
|
137
137
|
n.MOBILE_COLUMN_SPACING,
|
|
138
|
-
i && a &&
|
|
138
|
+
i && a && l
|
|
139
139
|
), this.api.setVisibility(
|
|
140
140
|
n.MOBILE_COLUMN_SPACING_LABEL,
|
|
141
|
-
i && a &&
|
|
141
|
+
i && a && l
|
|
142
142
|
), this.api.setVisibility(n.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(n.MOBILE_ROW_SPACING_LABEL, i && a);
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
@@ -165,20 +165,20 @@ class j extends w {
|
|
|
165
165
|
*/
|
|
166
166
|
_getStoredColumnSpacing() {
|
|
167
167
|
if (!this.currentNode)
|
|
168
|
-
return
|
|
169
|
-
const t = this.currentNode.querySelector(
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
173
|
-
return
|
|
174
|
-
const
|
|
175
|
-
return
|
|
168
|
+
return C;
|
|
169
|
+
const t = this.currentNode.querySelector(m) ?? this.currentNode;
|
|
170
|
+
if (b(this.currentNode) === "grid") {
|
|
171
|
+
const d = t.querySelector(".recommendation-attribute-row"), s = d == null ? void 0 : d.querySelector("td"), I = A(s, "padding");
|
|
172
|
+
if (!I)
|
|
173
|
+
return C;
|
|
174
|
+
const y = I.trim().split(/\s+/);
|
|
175
|
+
return y.length < 2 ? C : L(y[1], C / 2) * 2;
|
|
176
176
|
}
|
|
177
|
-
const o = t.querySelector(".product-card-wrapper"), i =
|
|
177
|
+
const o = t.querySelector(".product-card-wrapper"), i = w(o), a = A(i, "padding");
|
|
178
178
|
if (!a)
|
|
179
|
-
return
|
|
179
|
+
return C;
|
|
180
180
|
const r = a.trim().split(/\s+/);
|
|
181
|
-
return r.length < 2 ?
|
|
181
|
+
return r.length < 2 ? C : L(r[1], C / 2) * 2;
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* Gets stored row spacing from the first spacer element's height style
|
|
@@ -186,9 +186,9 @@ class j extends w {
|
|
|
186
186
|
*/
|
|
187
187
|
_getStoredRowSpacing() {
|
|
188
188
|
if (!this.currentNode)
|
|
189
|
-
return
|
|
190
|
-
const e = (this.currentNode.querySelector(
|
|
191
|
-
return
|
|
189
|
+
return E;
|
|
190
|
+
const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer"), o = A(e, "height");
|
|
191
|
+
return L(o, E);
|
|
192
192
|
}
|
|
193
193
|
// ========================================================================
|
|
194
194
|
// Desktop Spacing Handlers
|
|
@@ -205,18 +205,17 @@ class j extends w {
|
|
|
205
205
|
this.currentNode,
|
|
206
206
|
{ columnSpacing: t },
|
|
207
207
|
`Changed column spacing to ${t}px`
|
|
208
|
-
), this._storeDataAttribute(
|
|
209
|
-
const o = p.getConfig(this.currentNode).layout ||
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
).forEach((
|
|
213
|
-
i.modifyHtml(
|
|
208
|
+
), this._storeDataAttribute(O.COLUMN_SPACING, t);
|
|
209
|
+
const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(m);
|
|
210
|
+
l && (o === "grid" ? Array.from(
|
|
211
|
+
l.querySelectorAll(".attribute-cell")
|
|
212
|
+
).forEach((s) => {
|
|
213
|
+
i.modifyHtml(s).setStyle("padding", r);
|
|
214
214
|
}) : Array.from(
|
|
215
|
-
|
|
216
|
-
).forEach((
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}), i.apply(new m(`Update column spacing to ${t}px`)));
|
|
215
|
+
l.querySelectorAll(".product-card-wrapper")
|
|
216
|
+
).forEach((s) => {
|
|
217
|
+
"parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
|
|
218
|
+
}), i.apply(new g(`Update column spacing to ${t}px`)));
|
|
220
219
|
}
|
|
221
220
|
/**
|
|
222
221
|
* Handles row spacing changes for desktop.
|
|
@@ -230,8 +229,8 @@ class j extends w {
|
|
|
230
229
|
this.currentNode,
|
|
231
230
|
{ rowSpacing: t },
|
|
232
231
|
`Changed row spacing to ${t}px`
|
|
233
|
-
), this._storeDataAttribute(
|
|
234
|
-
const e = this.currentNode.querySelector(
|
|
232
|
+
), this._storeDataAttribute(O.ROW_SPACING, t);
|
|
233
|
+
const e = this.currentNode.querySelector(m);
|
|
235
234
|
if (!e)
|
|
236
235
|
return;
|
|
237
236
|
const o = Array.from(
|
|
@@ -242,7 +241,7 @@ class j extends w {
|
|
|
242
241
|
const i = this.api.getDocumentModifier(), a = `${t}px`;
|
|
243
242
|
o.forEach((r) => {
|
|
244
243
|
i.modifyHtml(r).setStyle("height", a);
|
|
245
|
-
}), i.apply(new
|
|
244
|
+
}), i.apply(new g(`Update row spacing to ${t}px`));
|
|
246
245
|
}
|
|
247
246
|
// ========================================================================
|
|
248
247
|
// Mobile Spacing Handlers
|
|
@@ -259,18 +258,17 @@ class j extends w {
|
|
|
259
258
|
this.currentNode,
|
|
260
259
|
{ mobileColumnSpacing: t },
|
|
261
260
|
`Changed mobile column spacing to ${t}px`
|
|
262
|
-
), this._storeDataAttribute(
|
|
263
|
-
const o = p.getConfig(this.currentNode).layout ||
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
).forEach((
|
|
267
|
-
i.modifyHtml(
|
|
261
|
+
), this._storeDataAttribute(O.MOBILE_COLUMN_SPACING, t);
|
|
262
|
+
const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(M);
|
|
263
|
+
l && (o === "grid" ? Array.from(
|
|
264
|
+
l.querySelectorAll(".attribute-cell")
|
|
265
|
+
).forEach((s) => {
|
|
266
|
+
i.modifyHtml(s).setStyle("padding", r);
|
|
268
267
|
}) : Array.from(
|
|
269
|
-
|
|
270
|
-
).forEach((
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}), i.apply(new m(`Update mobile column spacing to ${t}px`)));
|
|
268
|
+
l.querySelectorAll(".product-card-wrapper")
|
|
269
|
+
).forEach((s) => {
|
|
270
|
+
"parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
|
|
271
|
+
}), i.apply(new g(`Update mobile column spacing to ${t}px`)));
|
|
274
272
|
}
|
|
275
273
|
/**
|
|
276
274
|
* Handles row spacing changes for mobile.
|
|
@@ -284,8 +282,8 @@ class j extends w {
|
|
|
284
282
|
this.currentNode,
|
|
285
283
|
{ mobileRowSpacing: t },
|
|
286
284
|
`Changed mobile row spacing to ${t}px`
|
|
287
|
-
), this._storeDataAttribute(
|
|
288
|
-
const e = this.currentNode.querySelector(
|
|
285
|
+
), this._storeDataAttribute(O.MOBILE_ROW_SPACING, t);
|
|
286
|
+
const e = this.currentNode.querySelector(M);
|
|
289
287
|
if (!e)
|
|
290
288
|
return;
|
|
291
289
|
const o = Array.from(
|
|
@@ -296,7 +294,7 @@ class j extends w {
|
|
|
296
294
|
const i = this.api.getDocumentModifier(), a = `${t}px`;
|
|
297
295
|
o.forEach((r) => {
|
|
298
296
|
i.modifyHtml(r).setStyle("height", a);
|
|
299
|
-
}), i.apply(new
|
|
297
|
+
}), i.apply(new g(`Update mobile row spacing to ${t}px`));
|
|
300
298
|
}
|
|
301
299
|
// ========================================================================
|
|
302
300
|
// Data Attribute Storage
|
|
@@ -306,7 +304,7 @@ class j extends w {
|
|
|
306
304
|
*/
|
|
307
305
|
_storeDataAttribute(t, e) {
|
|
308
306
|
const o = B(this.currentNode);
|
|
309
|
-
o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new
|
|
307
|
+
o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new g(`Store ${t}`));
|
|
310
308
|
}
|
|
311
309
|
// ========================================================================
|
|
312
310
|
// Event Listeners
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
function a(t) {
|
|
2
2
|
return typeof t == "object" && t !== null && "tagName" in t && typeof t.tagName == "string";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function r(t) {
|
|
5
5
|
return typeof t == "object" && t !== null && "getTagName" in t && typeof t.getTagName == "function";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function n(t) {
|
|
8
8
|
return typeof t == "object" && t !== null && "getStyle" in t && typeof t.getStyle == "function";
|
|
9
9
|
}
|
|
10
10
|
function u(t) {
|
|
@@ -14,13 +14,13 @@ function g(t) {
|
|
|
14
14
|
return typeof t == "object" && t !== null && "tagName" in t && t.tagName === "TD";
|
|
15
15
|
}
|
|
16
16
|
function p(t, e) {
|
|
17
|
-
return !t || !
|
|
17
|
+
return !t || !n(t) ? null : t.getStyle(e);
|
|
18
18
|
}
|
|
19
19
|
function N(t) {
|
|
20
|
-
return !t || !u(t) ? null : t.parent()
|
|
20
|
+
return !t || !u(t) ? null : t.parent();
|
|
21
21
|
}
|
|
22
22
|
function l(t, e = "UNKNOWN") {
|
|
23
|
-
return t ? a(t) ? t.tagName.toUpperCase() :
|
|
23
|
+
return t ? a(t) ? t.tagName.toUpperCase() : r(t) ? t.getTagName().toUpperCase() : e : e;
|
|
24
24
|
}
|
|
25
25
|
const f = /* @__PURE__ */ new Set(["TD", "BLOCK_IMAGE", "BLOCK_BUTTON"]);
|
|
26
26
|
function i(t) {
|
|
@@ -36,7 +36,7 @@ function s(t) {
|
|
|
36
36
|
export {
|
|
37
37
|
s as getTableDisplayValue,
|
|
38
38
|
l as getTagName,
|
|
39
|
-
|
|
39
|
+
n as hasGetStyle,
|
|
40
40
|
u as hasParent,
|
|
41
41
|
c as isTableCellNode,
|
|
42
42
|
i as isTableCellTag,
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as e, SettingsPanelTab as
|
|
1
|
+
import { SettingsPanelRegistry as e, SettingsPanelTab as N, SettingsTab as t, TextControls as O } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { UNSUBSCRIBE_BLOCK_ID as I } from "./block.js";
|
|
3
3
|
import { UNSUBSCRIBE_CONTROL_ID as _ } from "./control.js";
|
|
4
|
-
class
|
|
4
|
+
class R extends e {
|
|
5
5
|
registerBlockControls(T) {
|
|
6
6
|
T[I] = [
|
|
7
|
-
new
|
|
7
|
+
new N(
|
|
8
8
|
t.SETTINGS,
|
|
9
9
|
[
|
|
10
10
|
_,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
O.FORMAT,
|
|
12
|
+
O.ALIGN,
|
|
13
|
+
O.LINE_HEIGHT,
|
|
14
|
+
O.DIRECTION,
|
|
15
|
+
O.INTERNAL_INDENTS,
|
|
16
|
+
O.HIDDEN_NODE
|
|
17
17
|
]
|
|
18
18
|
),
|
|
19
|
-
new
|
|
19
|
+
new N(
|
|
20
20
|
t.STYLES,
|
|
21
21
|
[
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
O.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
23
|
+
O.FONT_FAMILY,
|
|
24
|
+
O.FONT_SIZE,
|
|
25
|
+
O.FONT_COLOR,
|
|
26
|
+
O.FONT_BACKGROUND_COLOR,
|
|
27
|
+
O.LINKS_COLOR
|
|
27
28
|
]
|
|
28
29
|
)
|
|
29
30
|
];
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
R as SettingsPanel
|
|
34
35
|
};
|