@useinsider/guido 3.0.0-beta.5c24c6a → 3.0.0-beta.6536dae
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/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +81 -91
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/extensions/Blocks/Recommendation/block.js +4 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +83 -81
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/static/styles/base.css.js +2 -7
- package/dist/static/styles/components/button.css.js +13 -7
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
3
|
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", {
|
|
6
|
+
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"a26d7792"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const v = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
v as default
|
|
20
20
|
};
|
|
@@ -1,131 +1,121 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import { ModuleFolderDefaults as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
const Re = /* @__PURE__ */ j({
|
|
1
|
+
import { defineComponent as K, defineAsyncComponent as _, ref as V, computed as P, watch as j, onMounted as q, onUnmounted as J } from "vue";
|
|
2
|
+
import { provideGuidoActions as Q } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as X } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as Y } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as Z } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as A } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
8
|
+
import $ from "./organisms/base/Toaster.vue.js";
|
|
9
|
+
import ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
10
|
+
import oe from "./organisms/header/HeaderWrapper.vue.js";
|
|
11
|
+
import te from "./organisms/LoadingWrapper.vue.js";
|
|
12
|
+
import ne from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
13
|
+
import se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
14
|
+
import { useStripoApi as re } from "../services/stripoApi.js";
|
|
15
|
+
import { useConfigStore as ce } from "../stores/config.js";
|
|
16
|
+
import { useDynamicContentStore as ae } from "../stores/dynamic-content.js";
|
|
17
|
+
import { useEditorStore as ie } from "../stores/editor.js";
|
|
18
|
+
import { usePreviewStore as me } from "../stores/preview.js";
|
|
19
|
+
import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
|
|
20
|
+
const Me = /* @__PURE__ */ K({
|
|
22
21
|
__name: "Guido",
|
|
23
22
|
props: {
|
|
24
23
|
config: null
|
|
25
24
|
},
|
|
26
25
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
26
|
+
setup(W, { expose: I, emit: t }) {
|
|
27
|
+
const v = W, O = _(
|
|
29
28
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
30
|
-
),
|
|
29
|
+
), G = _(
|
|
31
30
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
const
|
|
31
|
+
), h = V(), i = ae(), y = de(), s = ce();
|
|
32
|
+
s.init(v.config);
|
|
33
|
+
const m = ie(), H = me(), c = P(() => m.hasChanges), { isTestPartner: x } = X(), f = () => {
|
|
35
34
|
var e;
|
|
36
|
-
return (e =
|
|
35
|
+
return (e = h.value) == null ? void 0 : e.handleSave(!0);
|
|
37
36
|
}, {
|
|
38
|
-
templateId:
|
|
39
|
-
userId:
|
|
40
|
-
partnerName:
|
|
41
|
-
username:
|
|
42
|
-
template:
|
|
43
|
-
editor:
|
|
44
|
-
} =
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
emailId:
|
|
48
|
-
userId:
|
|
49
|
-
username:
|
|
50
|
-
partnerName:
|
|
51
|
-
savedModulesFolderName:
|
|
52
|
-
defaultModulesFolderName:
|
|
53
|
-
},
|
|
54
|
-
preselectedDynamicContentList:
|
|
37
|
+
templateId: d,
|
|
38
|
+
userId: b,
|
|
39
|
+
partnerName: S,
|
|
40
|
+
username: g,
|
|
41
|
+
template: o,
|
|
42
|
+
editor: n
|
|
43
|
+
} = s, a = (o == null ? void 0 : o.html) || "", D = (o == null ? void 0 : o.css) || "", l = (o == null ? void 0 : o.preselectedDynamicContent) || [], w = (n == null ? void 0 : n.savedModulesFolderName) || N.SAVED_MODULES, E = (n == null ? void 0 : n.defaultModulesFolderName) || N.DEFAULT_MODULES;
|
|
44
|
+
m.templateId = d;
|
|
45
|
+
const u = {
|
|
46
|
+
emailId: d,
|
|
47
|
+
userId: b,
|
|
48
|
+
username: g,
|
|
49
|
+
partnerName: S,
|
|
50
|
+
savedModulesFolderName: w,
|
|
51
|
+
defaultModulesFolderName: E
|
|
52
|
+
}, C = {
|
|
53
|
+
preselectedDynamicContentList: l,
|
|
55
54
|
onReady: () => {
|
|
56
|
-
console.debug("guido:ready"),
|
|
55
|
+
console.debug("guido:ready"), t("ready");
|
|
57
56
|
}
|
|
58
|
-
}, { initPlugin:
|
|
57
|
+
}, { initPlugin: T } = Y(u, C), { getDefaultTemplate: k } = re(), { cloneTimersOnSave: F, hasTimerBlocks: U } = Z(), B = P(() => {
|
|
59
58
|
var e;
|
|
60
|
-
return !((e =
|
|
59
|
+
return !((e = s.ui) != null && e.showHeader);
|
|
61
60
|
});
|
|
62
|
-
|
|
61
|
+
Q({
|
|
63
62
|
onBack: () => {
|
|
64
|
-
console.debug("guido:back"),
|
|
63
|
+
console.debug("guido:back"), t("back");
|
|
65
64
|
},
|
|
66
65
|
onSaveStart: () => {
|
|
67
|
-
console.debug("guido:save:start"),
|
|
66
|
+
console.debug("guido:save:start"), t("save:start");
|
|
68
67
|
},
|
|
69
68
|
onSaveComplete: (e) => {
|
|
70
|
-
const
|
|
71
|
-
console.debug("guido:save:complete",
|
|
69
|
+
const r = { ...e, metadata: u };
|
|
70
|
+
console.debug("guido:save:complete", r), t("save:complete", r);
|
|
72
71
|
},
|
|
73
72
|
onTestEmailClick: () => {
|
|
74
|
-
console.debug("guido:test-email:click"),
|
|
73
|
+
console.debug("guido:test-email:click"), t("test-email:click");
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
|
-
const
|
|
78
|
-
console.debug("dynamic-content:close", e),
|
|
79
|
-
},
|
|
76
|
+
const L = (e) => {
|
|
77
|
+
console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
78
|
+
}, M = () => {
|
|
80
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
80
|
};
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
j(() => c.value, () => {
|
|
82
|
+
t("on-change", c.value);
|
|
84
83
|
});
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
console.debug("dynamic-content:open",
|
|
84
|
+
const p = (e) => {
|
|
85
|
+
const r = e, { attribute: R, position: z } = r.detail;
|
|
86
|
+
console.debug("dynamic-content:open", r.detail), t("dynamic-content:open", R, z);
|
|
88
87
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var n;
|
|
92
|
-
const e = document.querySelector(oe);
|
|
93
|
-
(n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
94
|
-
};
|
|
95
|
-
return Q(async () => {
|
|
96
|
-
var n;
|
|
97
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
|
|
98
|
-
const e = (n = d.value) == null ? void 0 : n.parentElement;
|
|
99
|
-
e && (c = new ResizeObserver(h), c.observe(e));
|
|
88
|
+
return q(async () => {
|
|
89
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
100
90
|
try {
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
html:
|
|
104
|
-
css:
|
|
91
|
+
y.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
92
|
+
let e = {
|
|
93
|
+
html: a && await A(a),
|
|
94
|
+
css: D
|
|
105
95
|
};
|
|
106
|
-
|
|
107
|
-
} catch (
|
|
108
|
-
console.error("Failed to initialize Stripo editor:",
|
|
96
|
+
e.html || (e = await k(), e.html = await A(e.html)), U(e.html) && (e.html = await F(e.html)), await T(e), i.selectedDynamicContentList = l;
|
|
97
|
+
} catch (e) {
|
|
98
|
+
console.error("Failed to initialize Stripo editor:", e);
|
|
109
99
|
}
|
|
110
|
-
document.addEventListener("dynamic-content:open",
|
|
111
|
-
}),
|
|
112
|
-
|
|
100
|
+
document.addEventListener("dynamic-content:open", p);
|
|
101
|
+
}), J(() => {
|
|
102
|
+
document.removeEventListener("dynamic-content:open", p);
|
|
113
103
|
try {
|
|
114
104
|
window.UIEditor.removeEditor();
|
|
115
105
|
} catch {
|
|
116
106
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
117
107
|
}
|
|
118
|
-
|
|
119
|
-
}),
|
|
108
|
+
s.reset();
|
|
109
|
+
}), I({
|
|
120
110
|
dynamicContent: {
|
|
121
|
-
insert:
|
|
122
|
-
close:
|
|
111
|
+
insert: L,
|
|
112
|
+
close: M
|
|
123
113
|
},
|
|
124
|
-
hasChanges:
|
|
125
|
-
saveSilent:
|
|
126
|
-
}), { __sfc: !0, PreviewContainer:
|
|
114
|
+
hasChanges: c,
|
|
115
|
+
saveSilent: f
|
|
116
|
+
}), { __sfc: !0, PreviewContainer: O, OnboardingWrapper: G, headerWrapperRef: h, dynamicContentStore: i, unsubscribeStore: y, props: v, configStore: s, editorStore: m, previewStore: H, hasChanges: c, isTestPartner: x, saveSilent: f, templateId: d, userId: b, partnerName: S, username: g, templateConfig: o, editorConfig: n, html: a, css: D, preselectedDynamicContentList: l, savedModulesFolderName: w, defaultModulesFolderName: E, emit: t, metadata: u, options: C, initPlugin: T, getDefaultTemplate: k, cloneTimersOnSave: F, hasTimerBlocks: U, noHeader: B, insertDynamicContent: L, closeDynamicContent: M, handleDynamicContentOpen: p, Toaster: $, FilterSelectionDrawer: ee, HeaderWrapper: oe, LoadingWrapper: te, SaveAsTemplateDrawer: ne, UnsubscribeWrapper: se };
|
|
127
117
|
}
|
|
128
118
|
});
|
|
129
119
|
export {
|
|
130
|
-
|
|
120
|
+
Me as default
|
|
131
121
|
};
|
|
@@ -75,7 +75,8 @@ 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."
|
|
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."
|
|
79
80
|
};
|
|
80
81
|
export {
|
|
81
82
|
e as default
|
|
@@ -40,6 +40,9 @@ class T extends B {
|
|
|
40
40
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
+
allowInnerBlocksDND() {
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
43
46
|
/**
|
|
44
47
|
* Returns the template HTML for a new recommendation block.
|
|
45
48
|
* Generates a unique recommendation ID and embeds the instance class
|
|
@@ -148,7 +151,7 @@ class T extends B {
|
|
|
148
151
|
if (e && e.includes(c))
|
|
149
152
|
return t;
|
|
150
153
|
}
|
|
151
|
-
return "querySelector" in t ? t.querySelector(`.${c}`) : null;
|
|
154
|
+
return "querySelector" in t ? t.querySelector(`.${c}`) ?? null : null;
|
|
152
155
|
}
|
|
153
156
|
/**
|
|
154
157
|
* Migrate configuration from legacy format
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { EditorStatePropertyType as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import { DESKTOP_CONTAINER_SELECTOR as
|
|
7
|
-
import { SPACING_STEP as
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var w = (u, s, t) => s in u ? R(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
|
|
3
|
+
var C = (u, s, t) => w(u, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { EditorStatePropertyType as E, PreviewDeviceMode as V, ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as B } from "../../../common-control.js";
|
|
6
|
+
import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as P } from "../../constants/selectors.js";
|
|
7
|
+
import { SPACING_STEP as _, MAX_SPACING as N, MIN_SPACING as b, DEFAULT_COLUMN_SPACING as g, DEFAULT_ROW_SPACING as G } from "../../constants/layout.js";
|
|
8
8
|
import { RecommendationConfigService as d } from "../../services/configService.js";
|
|
9
|
-
import { useRecommendationExtensionStore as
|
|
10
|
-
import { safeGetStyle as
|
|
11
|
-
import { getCurrentLayout as
|
|
12
|
-
import { useDebounceFn as
|
|
9
|
+
import { useRecommendationExtensionStore as U } from "../../store/recommendation.js";
|
|
10
|
+
import { safeGetStyle as L, safeGetParent as I } from "../../utils/tagName.js";
|
|
11
|
+
import { getCurrentLayout as f, getBlockElement as x } from "../main/utils.js";
|
|
12
|
+
import { useDebounceFn as O } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
13
13
|
const W = "recommendation-spacing-control", i = {
|
|
14
14
|
COLUMN_SPACING: "columnSpacing",
|
|
15
15
|
COLUMN_SPACING_LABEL: "columnSpacingLabel",
|
|
@@ -19,46 +19,46 @@ const W = "recommendation-spacing-control", i = {
|
|
|
19
19
|
MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
|
|
20
20
|
MOBILE_ROW_SPACING: "mobileRowSpacing",
|
|
21
21
|
MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
|
|
22
|
-
},
|
|
22
|
+
}, A = {
|
|
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 M(u, s) {
|
|
29
|
+
if (!u)
|
|
30
|
+
return s;
|
|
31
|
+
const t = parseFloat(u);
|
|
32
|
+
return Number.isNaN(t) ? s : t;
|
|
33
33
|
}
|
|
34
|
-
class X extends
|
|
34
|
+
class X extends B {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
C(this, "store", U());
|
|
38
|
+
C(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
|
+
C(this, "_debouncedOnColumnSpacingChange", O((t) => {
|
|
44
44
|
this._onColumnSpacingChange(t);
|
|
45
45
|
}, 300));
|
|
46
46
|
/**
|
|
47
47
|
* Debounced version of _onRowSpacingChange
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
C(this, "_debouncedOnRowSpacingChange", O((t) => {
|
|
50
50
|
this._onRowSpacingChange(t);
|
|
51
51
|
}, 300));
|
|
52
52
|
/**
|
|
53
53
|
* Debounced version of _onMobileColumnSpacingChange
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
C(this, "_debouncedOnMobileColumnSpacingChange", O((t) => {
|
|
56
56
|
this._onMobileColumnSpacingChange(t);
|
|
57
57
|
}, 300));
|
|
58
58
|
/**
|
|
59
59
|
* Debounced version of _onMobileRowSpacingChange
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
C(this, "_debouncedOnMobileRowSpacingChange", O((t) => {
|
|
62
62
|
this._onMobileRowSpacingChange(t);
|
|
63
63
|
}, 300));
|
|
64
64
|
}
|
|
@@ -72,16 +72,16 @@ class X extends V {
|
|
|
72
72
|
this._GuLabel({ text: "Column Spacing on Desktop (px)", name: i.COLUMN_SPACING_LABEL }),
|
|
73
73
|
this._GuCounter({
|
|
74
74
|
name: i.COLUMN_SPACING,
|
|
75
|
-
minValue:
|
|
76
|
-
maxValue:
|
|
77
|
-
step:
|
|
75
|
+
minValue: b,
|
|
76
|
+
maxValue: N,
|
|
77
|
+
step: _
|
|
78
78
|
}),
|
|
79
79
|
this._GuLabel({ text: "Row Spacing on Desktop (px)", name: i.ROW_SPACING_LABEL }),
|
|
80
80
|
this._GuCounter({
|
|
81
81
|
name: i.ROW_SPACING,
|
|
82
|
-
minValue:
|
|
83
|
-
maxValue:
|
|
84
|
-
step:
|
|
82
|
+
minValue: b,
|
|
83
|
+
maxValue: N,
|
|
84
|
+
step: _
|
|
85
85
|
}),
|
|
86
86
|
this._GuLabel({
|
|
87
87
|
text: "Column Spacing on Mobile (px)",
|
|
@@ -89,16 +89,16 @@ class X extends V {
|
|
|
89
89
|
}),
|
|
90
90
|
this._GuCounter({
|
|
91
91
|
name: i.MOBILE_COLUMN_SPACING,
|
|
92
|
-
minValue:
|
|
93
|
-
maxValue:
|
|
94
|
-
step:
|
|
92
|
+
minValue: b,
|
|
93
|
+
maxValue: N,
|
|
94
|
+
step: _
|
|
95
95
|
}),
|
|
96
96
|
this._GuLabel({ text: "Row Spacing on Mobile (px)", name: i.MOBILE_ROW_SPACING_LABEL }),
|
|
97
97
|
this._GuCounter({
|
|
98
98
|
name: i.MOBILE_ROW_SPACING,
|
|
99
|
-
minValue:
|
|
100
|
-
maxValue:
|
|
101
|
-
step:
|
|
99
|
+
minValue: b,
|
|
100
|
+
maxValue: N,
|
|
101
|
+
step: _
|
|
102
102
|
})
|
|
103
103
|
])}
|
|
104
104
|
</div>
|
|
@@ -118,7 +118,7 @@ class X extends V {
|
|
|
118
118
|
* using Stripo's EditorStatePropertyType API.
|
|
119
119
|
*/
|
|
120
120
|
_isMobileMode() {
|
|
121
|
-
return this.api.getEditorState()[
|
|
121
|
+
return this.api.getEditorState()[E.previewDeviceMode] === V.MOBILE;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Updates spacing control visibility based on layout orientation, editor mode,
|
|
@@ -132,8 +132,8 @@ class X extends V {
|
|
|
132
132
|
_updateSpacingVisibility() {
|
|
133
133
|
if (!this.api)
|
|
134
134
|
return;
|
|
135
|
-
const t = d.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, n = t.layout || e ||
|
|
136
|
-
this.api.setVisibility(i.COLUMN_SPACING, o && !r &&
|
|
135
|
+
const t = d.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, n = t.layout || e || f(this.currentNode), o = n === "grid", a = n === "list", r = this._isMobileMode(), c = t.cardsInRow > 1, l = t.mobileCardsInRow > 1;
|
|
136
|
+
this.api.setVisibility(i.COLUMN_SPACING, o && !r && c), this.api.setVisibility(i.COLUMN_SPACING_LABEL, o && !r && c), this.api.setVisibility(i.ROW_SPACING, a || !r), this.api.setVisibility(i.ROW_SPACING_LABEL, a || !r), this.api.setVisibility(i.MOBILE_COLUMN_SPACING, o && r && l), this.api.setVisibility(i.MOBILE_COLUMN_SPACING_LABEL, o && r && l), this.api.setVisibility(i.MOBILE_ROW_SPACING, !a && r), this.api.setVisibility(i.MOBILE_ROW_SPACING_LABEL, !a && r);
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Reads spacing values from node config first, falls back to DOM styles.
|
|
@@ -159,20 +159,20 @@ class X extends V {
|
|
|
159
159
|
*/
|
|
160
160
|
_getStoredColumnSpacing() {
|
|
161
161
|
if (!this.currentNode)
|
|
162
|
-
return
|
|
163
|
-
const t = this.currentNode.querySelector(
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
if (!
|
|
167
|
-
return
|
|
168
|
-
const
|
|
169
|
-
return
|
|
162
|
+
return g;
|
|
163
|
+
const t = this.currentNode.querySelector(S) ?? this.currentNode;
|
|
164
|
+
if (f(this.currentNode) === "grid") {
|
|
165
|
+
const l = t.querySelector(".recommendation-attribute-row"), p = l == null ? void 0 : l.querySelector("td"), h = L(p, "padding");
|
|
166
|
+
if (!h)
|
|
167
|
+
return g;
|
|
168
|
+
const y = h.trim().split(/\s+/);
|
|
169
|
+
return y.length < 2 ? g : M(y[1], g / 2) * 2;
|
|
170
170
|
}
|
|
171
|
-
const n = t.querySelector(".product-card-wrapper"), o =
|
|
171
|
+
const n = t.querySelector(".product-card-wrapper"), o = I(n), a = L(o, "padding");
|
|
172
172
|
if (!a)
|
|
173
|
-
return
|
|
173
|
+
return g;
|
|
174
174
|
const r = a.trim().split(/\s+/);
|
|
175
|
-
return r.length < 2 ?
|
|
175
|
+
return r.length < 2 ? g : M(r[1], g / 2) * 2;
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* Gets stored row spacing from the first spacer element's height style
|
|
@@ -180,9 +180,9 @@ class X extends V {
|
|
|
180
180
|
*/
|
|
181
181
|
_getStoredRowSpacing() {
|
|
182
182
|
if (!this.currentNode)
|
|
183
|
-
return
|
|
184
|
-
const e = (this.currentNode.querySelector(
|
|
185
|
-
return
|
|
183
|
+
return G;
|
|
184
|
+
const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer"), n = L(e, "height");
|
|
185
|
+
return M(n, G);
|
|
186
186
|
}
|
|
187
187
|
// ========================================================================
|
|
188
188
|
// Desktop Spacing Handlers
|
|
@@ -199,17 +199,18 @@ class X extends V {
|
|
|
199
199
|
this.currentNode,
|
|
200
200
|
{ columnSpacing: t },
|
|
201
201
|
`Changed column spacing to ${t}px`
|
|
202
|
-
), this._storeDataAttribute(
|
|
203
|
-
const n = d.getConfig(this.currentNode).layout ||
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
).forEach((
|
|
207
|
-
o.modifyHtml(
|
|
202
|
+
), this._storeDataAttribute(A.COLUMN_SPACING, t);
|
|
203
|
+
const n = d.getConfig(this.currentNode).layout || f(this.currentNode), o = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(S);
|
|
204
|
+
c && (n === "grid" ? Array.from(
|
|
205
|
+
c.querySelectorAll(".attribute-cell")
|
|
206
|
+
).forEach((p) => {
|
|
207
|
+
o.modifyHtml(p).setStyle("padding", r);
|
|
208
208
|
}) : Array.from(
|
|
209
|
-
|
|
210
|
-
).forEach((
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
c.querySelectorAll(".product-card-wrapper")
|
|
210
|
+
).forEach((p) => {
|
|
211
|
+
const h = I(p);
|
|
212
|
+
h && o.modifyHtml(h).setStyle("padding", r);
|
|
213
|
+
}), o.apply(new m(`Update column spacing to ${t}px`)));
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
216
|
* Handles row spacing changes for desktop.
|
|
@@ -223,8 +224,8 @@ class X extends V {
|
|
|
223
224
|
this.currentNode,
|
|
224
225
|
{ rowSpacing: t },
|
|
225
226
|
`Changed row spacing to ${t}px`
|
|
226
|
-
), this._storeDataAttribute(
|
|
227
|
-
const e = this.currentNode.querySelector(
|
|
227
|
+
), this._storeDataAttribute(A.ROW_SPACING, t);
|
|
228
|
+
const e = this.currentNode.querySelector(S);
|
|
228
229
|
if (!e)
|
|
229
230
|
return;
|
|
230
231
|
const n = Array.from(
|
|
@@ -235,7 +236,7 @@ class X extends V {
|
|
|
235
236
|
const o = this.api.getDocumentModifier(), a = `${t}px`;
|
|
236
237
|
n.forEach((r) => {
|
|
237
238
|
o.modifyHtml(r).setStyle("height", a);
|
|
238
|
-
}), o.apply(new
|
|
239
|
+
}), o.apply(new m(`Update row spacing to ${t}px`));
|
|
239
240
|
}
|
|
240
241
|
// ========================================================================
|
|
241
242
|
// Mobile Spacing Handlers
|
|
@@ -252,17 +253,18 @@ class X extends V {
|
|
|
252
253
|
this.currentNode,
|
|
253
254
|
{ mobileColumnSpacing: t },
|
|
254
255
|
`Changed mobile column spacing to ${t}px`
|
|
255
|
-
), this._storeDataAttribute(
|
|
256
|
-
const n = d.getConfig(this.currentNode).layout ||
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
).forEach((
|
|
260
|
-
o.modifyHtml(
|
|
256
|
+
), this._storeDataAttribute(A.MOBILE_COLUMN_SPACING, t);
|
|
257
|
+
const n = d.getConfig(this.currentNode).layout || f(this.currentNode), o = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(P);
|
|
258
|
+
c && (n === "grid" ? Array.from(
|
|
259
|
+
c.querySelectorAll(".attribute-cell")
|
|
260
|
+
).forEach((p) => {
|
|
261
|
+
o.modifyHtml(p).setStyle("padding", r);
|
|
261
262
|
}) : Array.from(
|
|
262
|
-
|
|
263
|
-
).forEach((
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
c.querySelectorAll(".product-card-wrapper")
|
|
264
|
+
).forEach((p) => {
|
|
265
|
+
const h = I(p);
|
|
266
|
+
h && o.modifyHtml(h).setStyle("padding", r);
|
|
267
|
+
}), o.apply(new m(`Update mobile column spacing to ${t}px`)));
|
|
266
268
|
}
|
|
267
269
|
/**
|
|
268
270
|
* Handles row spacing changes for mobile.
|
|
@@ -276,8 +278,8 @@ class X extends V {
|
|
|
276
278
|
this.currentNode,
|
|
277
279
|
{ mobileRowSpacing: t },
|
|
278
280
|
`Changed mobile row spacing to ${t}px`
|
|
279
|
-
), this._storeDataAttribute(
|
|
280
|
-
const e = this.currentNode.querySelector(
|
|
281
|
+
), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
|
|
282
|
+
const e = this.currentNode.querySelector(P);
|
|
281
283
|
if (!e)
|
|
282
284
|
return;
|
|
283
285
|
const n = Array.from(
|
|
@@ -288,7 +290,7 @@ class X extends V {
|
|
|
288
290
|
const o = this.api.getDocumentModifier(), a = `${t}px`;
|
|
289
291
|
n.forEach((r) => {
|
|
290
292
|
o.modifyHtml(r).setStyle("height", a);
|
|
291
|
-
}), o.apply(new
|
|
293
|
+
}), o.apply(new m(`Update mobile row spacing to ${t}px`));
|
|
292
294
|
}
|
|
293
295
|
// ========================================================================
|
|
294
296
|
// Data Attribute Storage
|
|
@@ -298,7 +300,7 @@ class X extends V {
|
|
|
298
300
|
*/
|
|
299
301
|
_storeDataAttribute(t, e) {
|
|
300
302
|
const n = x(this.currentNode);
|
|
301
|
-
n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new
|
|
303
|
+
n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
|
|
302
304
|
}
|
|
303
305
|
// ========================================================================
|
|
304
306
|
// Event Listeners
|
|
@@ -333,7 +335,7 @@ class X extends V {
|
|
|
333
335
|
*/
|
|
334
336
|
_subscribeToEditorModeChanges() {
|
|
335
337
|
this.api.onEditorStatePropUpdated(
|
|
336
|
-
|
|
338
|
+
E.previewDeviceMode,
|
|
337
339
|
() => {
|
|
338
340
|
this._updateSpacingVisibility();
|
|
339
341
|
}
|
|
@@ -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 n(t) {
|
|
5
5
|
return typeof t == "object" && t !== null && "getTagName" in t && typeof t.getTagName == "function";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function r(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 || !r(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() ?? null;
|
|
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() : n(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
|
+
r as hasGetStyle,
|
|
40
40
|
u as hasParent,
|
|
41
41
|
c as isTableCellNode,
|
|
42
42
|
i as isTableCellTag,
|