@useinsider/guido 3.12.0-beta.98baf2f → 3.12.0-beta.ab050f8
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/composables/useStripoEventHandler.js +9 -12
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +11 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/controlFactories.js +235 -171
- package/dist/services/stripoApi.js +27 -28
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -0
- package/package.json +1 -1
|
@@ -3,33 +3,30 @@ import { useEditorStore as u } from "../stores/editor.js";
|
|
|
3
3
|
import { useOnboardingStore as l } from "../stores/onboarding.js";
|
|
4
4
|
import { useUnsubscribeStore as b } from "../stores/unsubscribe.js";
|
|
5
5
|
const v = () => {
|
|
6
|
-
const { updateSyncModule:
|
|
6
|
+
const { updateSyncModule: d, getSyncModule: r } = i(), n = u(), s = b(), a = {
|
|
7
7
|
block_dropped: ({ blockName: e }) => {
|
|
8
8
|
if (e === "BLOCK_TEXT") {
|
|
9
|
-
const o = l(), t = !o.shouldShowOnboarding("textBlockOnboarding"),
|
|
10
|
-
if (t ||
|
|
9
|
+
const o = l(), t = !o.shouldShowOnboarding("textBlockOnboarding"), c = o.isActive("textBlockOnboarding");
|
|
10
|
+
if (t || c)
|
|
11
11
|
return;
|
|
12
12
|
o.start("textBlockOnboarding");
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
module_saved: async (e) => {
|
|
16
|
-
|
|
16
|
+
n.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await d(e));
|
|
17
17
|
},
|
|
18
18
|
module_dropped: async (e) => {
|
|
19
|
-
if (!
|
|
19
|
+
if (!n.syncModulesEnabled)
|
|
20
20
|
return;
|
|
21
|
-
const { moduleId: o,
|
|
22
|
-
|
|
23
|
-
return;
|
|
24
|
-
const n = await s(o);
|
|
25
|
-
console.debug("[module_dropped] Sync module data:", n), n.unsubscriptionPreferencePages.length && await a.fetchTemplates();
|
|
21
|
+
const { moduleId: o } = e, t = await r(o);
|
|
22
|
+
console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await s.fetchTemplates();
|
|
26
23
|
},
|
|
27
24
|
module_updated: async (e) => {
|
|
28
|
-
|
|
25
|
+
n.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await d(e));
|
|
29
26
|
}
|
|
30
27
|
};
|
|
31
28
|
return { handleEvent: async (e, o) => {
|
|
32
|
-
const t =
|
|
29
|
+
const t = a[e];
|
|
33
30
|
console.debug("Stripo Event: ", e, o), t && await t(o);
|
|
34
31
|
} };
|
|
35
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BLOCK_BACKGROUND = "recommendation-block-background-color-control", c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
3
|
+
import { BLOCK_ROOT_SELECTOR as t } from "../../constants/selectors.js";
|
|
4
|
+
const C = ".esd-block-text", m = o(
|
|
5
|
+
r.BLOCK_BACKGROUND,
|
|
6
|
+
t,
|
|
7
|
+
C
|
|
8
|
+
);
|
|
9
|
+
export {
|
|
10
|
+
m as BlockBackgroundColorControl
|
|
11
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
1
|
+
import { ExtensionBuilder as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import n from "./canvasPreview.css.js";
|
|
4
4
|
import { RecommendationBlockControl as i } from "./controls/main/index.js";
|
|
@@ -6,42 +6,44 @@ import "./constants/selectors.js";
|
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./utils/captureStyleTemplates.js";
|
|
8
8
|
import { NameControls as e } from "./controls/name/index.js";
|
|
9
|
-
import { PriceControls as
|
|
10
|
-
import { OldPriceControls as
|
|
9
|
+
import { PriceControls as l } from "./controls/price/index.js";
|
|
10
|
+
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
11
11
|
import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
|
|
12
12
|
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
13
13
|
import { ButtonControls as c } from "./controls/button/index.js";
|
|
14
|
-
import { ImageControls as
|
|
15
|
-
import { CustomAttributeControls as
|
|
14
|
+
import { ImageControls as C } from "./controls/image/index.js";
|
|
15
|
+
import { CustomAttributeControls as f } from "./controls/customAttribute/index.js";
|
|
16
16
|
import { SpacingControl as d } from "./controls/spacing/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import { BlockBackgroundColorControl as u } from "./controls/blockBackground/index.js";
|
|
18
|
+
import { CardBackgroundColorControl as g } from "./controls/cardBackground/index.js";
|
|
19
|
+
import { RecommendationCardCompositionControl as y } from "./controls/cardComposition/index.js";
|
|
20
|
+
import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
|
|
20
21
|
import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
|
|
21
22
|
import R from "./recommendation.css.js";
|
|
22
23
|
import { SettingsPanel as S } from "./settingsPanel.js";
|
|
23
|
-
const
|
|
24
|
+
const k = [
|
|
24
25
|
e,
|
|
25
|
-
s,
|
|
26
26
|
l,
|
|
27
|
+
s,
|
|
27
28
|
p,
|
|
28
29
|
a,
|
|
29
30
|
c,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
31
|
+
C,
|
|
32
|
+
f
|
|
33
|
+
], w = [
|
|
33
34
|
i,
|
|
34
35
|
u,
|
|
35
|
-
d,
|
|
36
36
|
g,
|
|
37
|
-
|
|
37
|
+
d,
|
|
38
|
+
y,
|
|
39
|
+
B
|
|
38
40
|
], b = [
|
|
39
|
-
...
|
|
40
|
-
...
|
|
41
|
-
],
|
|
42
|
-
(o,
|
|
43
|
-
new
|
|
41
|
+
...w,
|
|
42
|
+
...k.flatMap((o) => Object.values(o))
|
|
43
|
+
], W = b.reduce(
|
|
44
|
+
(o, r) => o.addControl(r),
|
|
45
|
+
new t().addBlock(m).withSettingsPanelRegistry(S)
|
|
44
46
|
).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
W as default
|
|
47
49
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as
|
|
2
|
-
import { BLOCK_ID as
|
|
1
|
+
import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as I, ContainerControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as R } from "./block.js";
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
|
-
import { CONTROL_BLOCK_ID as
|
|
6
|
+
import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
|
|
7
7
|
import "./store/recommendation.js";
|
|
8
8
|
import "./utils/captureStyleTemplates.js";
|
|
9
9
|
import "./controls/name/index.js";
|
|
@@ -13,37 +13,38 @@ import "./controls/omnibusPrice/index.js";
|
|
|
13
13
|
import "./controls/omnibusDiscount/index.js";
|
|
14
14
|
import "./controls/button/index.js";
|
|
15
15
|
import "./controls/image/index.js";
|
|
16
|
-
import { SPACING_CONTROL_ID as
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
16
|
+
import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
|
|
17
|
+
import "./controls/blockBackground/index.js";
|
|
18
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
|
|
19
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
19
20
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
20
|
-
class
|
|
21
|
-
registerBlockControls(
|
|
22
|
-
|
|
21
|
+
class s extends E {
|
|
22
|
+
registerBlockControls(O) {
|
|
23
|
+
O[R] = [
|
|
23
24
|
new _(
|
|
24
|
-
|
|
25
|
+
I.SETTINGS,
|
|
25
26
|
[
|
|
26
|
-
|
|
27
|
+
U,
|
|
27
28
|
C.EXTERNAL_INDENTS
|
|
28
29
|
]
|
|
29
30
|
),
|
|
30
31
|
new _(
|
|
31
|
-
|
|
32
|
+
I.STYLES,
|
|
32
33
|
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
T.BLOCK_BACKGROUND,
|
|
35
|
+
L,
|
|
36
|
+
A
|
|
36
37
|
]
|
|
37
38
|
),
|
|
38
39
|
new _(
|
|
39
40
|
"Card Composition",
|
|
40
41
|
[
|
|
41
|
-
|
|
42
|
+
D
|
|
42
43
|
]
|
|
43
44
|
).withLabel(this.api.translate("Card Composition"))
|
|
44
|
-
],
|
|
45
|
+
], O[S.NAME] = [
|
|
45
46
|
new _(
|
|
46
|
-
|
|
47
|
+
I.SETTINGS,
|
|
47
48
|
[
|
|
48
49
|
N,
|
|
49
50
|
T.NAME_STYLE,
|
|
@@ -53,7 +54,7 @@ class d extends E {
|
|
|
53
54
|
]
|
|
54
55
|
),
|
|
55
56
|
new _(
|
|
56
|
-
|
|
57
|
+
I.STYLES,
|
|
57
58
|
[
|
|
58
59
|
T.NAME_BACKGROUND,
|
|
59
60
|
T.NAME_FONT_FAMILY,
|
|
@@ -61,9 +62,9 @@ class d extends E {
|
|
|
61
62
|
T.NAME_COLOR
|
|
62
63
|
]
|
|
63
64
|
)
|
|
64
|
-
],
|
|
65
|
+
], O[S.PRICE] = [
|
|
65
66
|
new _(
|
|
66
|
-
|
|
67
|
+
I.SETTINGS,
|
|
67
68
|
[
|
|
68
69
|
N,
|
|
69
70
|
T.PRICE_STYLE,
|
|
@@ -72,7 +73,7 @@ class d extends E {
|
|
|
72
73
|
]
|
|
73
74
|
),
|
|
74
75
|
new _(
|
|
75
|
-
|
|
76
|
+
I.STYLES,
|
|
76
77
|
[
|
|
77
78
|
T.PRICE_BACKGROUND,
|
|
78
79
|
T.PRICE_FONT_FAMILY,
|
|
@@ -80,9 +81,9 @@ class d extends E {
|
|
|
80
81
|
T.PRICE_COLOR
|
|
81
82
|
]
|
|
82
83
|
)
|
|
83
|
-
],
|
|
84
|
+
], O[S.OLD_PRICE] = [
|
|
84
85
|
new _(
|
|
85
|
-
|
|
86
|
+
I.SETTINGS,
|
|
86
87
|
[
|
|
87
88
|
N,
|
|
88
89
|
T.OLD_PRICE_STYLE,
|
|
@@ -91,7 +92,7 @@ class d extends E {
|
|
|
91
92
|
]
|
|
92
93
|
),
|
|
93
94
|
new _(
|
|
94
|
-
|
|
95
|
+
I.STYLES,
|
|
95
96
|
[
|
|
96
97
|
T.OLD_PRICE_BACKGROUND,
|
|
97
98
|
T.OLD_PRICE_FONT_FAMILY,
|
|
@@ -99,9 +100,9 @@ class d extends E {
|
|
|
99
100
|
T.OLD_PRICE_COLOR
|
|
100
101
|
]
|
|
101
102
|
)
|
|
102
|
-
],
|
|
103
|
+
], O[S.OMNIBUS_PRICE] = [
|
|
103
104
|
new _(
|
|
104
|
-
|
|
105
|
+
I.SETTINGS,
|
|
105
106
|
[
|
|
106
107
|
N,
|
|
107
108
|
T.OMNIBUS_PRICE_TEXT_BEFORE,
|
|
@@ -112,7 +113,7 @@ class d extends E {
|
|
|
112
113
|
]
|
|
113
114
|
),
|
|
114
115
|
new _(
|
|
115
|
-
|
|
116
|
+
I.STYLES,
|
|
116
117
|
[
|
|
117
118
|
T.OMNIBUS_PRICE_BACKGROUND,
|
|
118
119
|
T.OMNIBUS_PRICE_FONT_FAMILY,
|
|
@@ -120,9 +121,9 @@ class d extends E {
|
|
|
120
121
|
T.OMNIBUS_PRICE_COLOR
|
|
121
122
|
]
|
|
122
123
|
)
|
|
123
|
-
],
|
|
124
|
+
], O[S.OMNIBUS_DISCOUNT] = [
|
|
124
125
|
new _(
|
|
125
|
-
|
|
126
|
+
I.SETTINGS,
|
|
126
127
|
[
|
|
127
128
|
N,
|
|
128
129
|
T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
|
|
@@ -133,7 +134,7 @@ class d extends E {
|
|
|
133
134
|
]
|
|
134
135
|
),
|
|
135
136
|
new _(
|
|
136
|
-
|
|
137
|
+
I.STYLES,
|
|
137
138
|
[
|
|
138
139
|
T.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
139
140
|
T.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
@@ -141,9 +142,9 @@ class d extends E {
|
|
|
141
142
|
T.OMNIBUS_DISCOUNT_COLOR
|
|
142
143
|
]
|
|
143
144
|
)
|
|
144
|
-
],
|
|
145
|
+
], O[S.BUTTON] = [
|
|
145
146
|
new _(
|
|
146
|
-
|
|
147
|
+
I.SETTINGS,
|
|
147
148
|
[
|
|
148
149
|
N,
|
|
149
150
|
T.BUTTON_TEXT,
|
|
@@ -153,7 +154,7 @@ class d extends E {
|
|
|
153
154
|
]
|
|
154
155
|
),
|
|
155
156
|
new _(
|
|
156
|
-
|
|
157
|
+
I.STYLES,
|
|
157
158
|
[
|
|
158
159
|
T.BUTTON_COLOR,
|
|
159
160
|
T.BUTTON_FONT_FAMILY,
|
|
@@ -164,9 +165,9 @@ class d extends E {
|
|
|
164
165
|
T.BUTTON_BORDER
|
|
165
166
|
]
|
|
166
167
|
)
|
|
167
|
-
],
|
|
168
|
+
], O[S.CUSTOM_ATTRIBUTE] = [
|
|
168
169
|
new _(
|
|
169
|
-
|
|
170
|
+
I.SETTINGS,
|
|
170
171
|
[
|
|
171
172
|
T.CUSTOM_ATTR_STYLE,
|
|
172
173
|
T.CUSTOM_ATTR_ALIGN,
|
|
@@ -175,7 +176,7 @@ class d extends E {
|
|
|
175
176
|
]
|
|
176
177
|
),
|
|
177
178
|
new _(
|
|
178
|
-
|
|
179
|
+
I.STYLES,
|
|
179
180
|
[
|
|
180
181
|
T.CUSTOM_ATTR_BACKGROUND,
|
|
181
182
|
T.CUSTOM_ATTR_FONT_FAMILY,
|
|
@@ -183,9 +184,9 @@ class d extends E {
|
|
|
183
184
|
T.CUSTOM_ATTR_COLOR
|
|
184
185
|
]
|
|
185
186
|
)
|
|
186
|
-
],
|
|
187
|
+
], O[S.IMAGE] = [
|
|
187
188
|
new _(
|
|
188
|
-
|
|
189
|
+
I.SETTINGS,
|
|
189
190
|
[
|
|
190
191
|
N,
|
|
191
192
|
T.IMAGE_SIZE,
|
|
@@ -196,5 +197,5 @@ class d extends E {
|
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
export {
|
|
199
|
-
|
|
200
|
+
s as SettingsPanel
|
|
200
201
|
};
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { TextAlignBuiltInControl as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return class extends
|
|
1
|
+
import { TextAlignBuiltInControl as C, TextColorBuiltInControl as T, TextSizeBuiltInControl as B, TextStyleBuiltInControl as m, TextFontFamilyBuiltInControl as y, ButtonBackgroundColorBuiltInControl as g, TextPaddingsBuiltInControl as A, ImageSizeBuiltInControl as S, ImageMarginsBuiltInControl as I, ButtonAlignBuiltInControl as b, ButtonBorderBuiltInControl as k, ButtonBorderRadiusBuiltInControl as N, ButtonColorBuiltInControl as h, ButtonFontFamilyBuiltInControl as q, ButtonMarginsBuiltInControl as p, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as F, ButtonTextSizeBuiltInControl as v, ButtonTextStyleAndFontColorBuiltInControl as M, ButtonFitToContainerBuiltInControl as R, TextLineSpacingBuiltInControl as _ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const O = "buttonTextStyleForm", f = "backgroundColor", x = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]), E = ["elementColor", f], K = "esd-extension-block-id";
|
|
3
|
+
function U(r, e, o) {
|
|
4
|
+
return class extends C {
|
|
5
5
|
getId() {
|
|
6
|
-
return
|
|
6
|
+
return r;
|
|
7
7
|
}
|
|
8
|
-
getTargetNodes(
|
|
9
|
-
if (!
|
|
10
|
-
return [
|
|
11
|
-
const t =
|
|
12
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
8
|
+
getTargetNodes(n) {
|
|
9
|
+
if (!e || !o)
|
|
10
|
+
return [n];
|
|
11
|
+
const t = n.closest(o);
|
|
12
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return class extends
|
|
16
|
+
function Y(r, e, o) {
|
|
17
|
+
return class extends T {
|
|
18
18
|
getId() {
|
|
19
|
-
return
|
|
19
|
+
return r;
|
|
20
20
|
}
|
|
21
|
-
getTargetNodes(
|
|
22
|
-
if (!
|
|
23
|
-
return [
|
|
24
|
-
const t =
|
|
25
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
21
|
+
getTargetNodes(n) {
|
|
22
|
+
if (!e || !o)
|
|
23
|
+
return [n];
|
|
24
|
+
const t = n.closest(o);
|
|
25
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return class extends
|
|
29
|
+
function G(r, e, o) {
|
|
30
|
+
return class extends B {
|
|
31
31
|
getId() {
|
|
32
|
-
return
|
|
32
|
+
return r;
|
|
33
33
|
}
|
|
34
|
-
getTargetNodes(
|
|
35
|
-
if (!
|
|
36
|
-
return [
|
|
37
|
-
const t =
|
|
38
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
34
|
+
getTargetNodes(n) {
|
|
35
|
+
if (!e || !o)
|
|
36
|
+
return [n];
|
|
37
|
+
const t = n.closest(o);
|
|
38
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return class extends
|
|
42
|
+
function H(r, e, o) {
|
|
43
|
+
return class extends m {
|
|
44
44
|
getId() {
|
|
45
|
-
return
|
|
45
|
+
return r;
|
|
46
46
|
}
|
|
47
|
-
getTargetNodes(
|
|
48
|
-
if (!
|
|
49
|
-
return [
|
|
50
|
-
const t =
|
|
51
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
47
|
+
getTargetNodes(n) {
|
|
48
|
+
if (!e || !o)
|
|
49
|
+
return [n];
|
|
50
|
+
const t = n.closest(o);
|
|
51
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return class extends
|
|
55
|
+
function V(r, e, o) {
|
|
56
|
+
return class extends y {
|
|
57
57
|
getId() {
|
|
58
|
-
return
|
|
58
|
+
return r;
|
|
59
59
|
}
|
|
60
|
-
getTargetNodes(
|
|
61
|
-
if (!
|
|
62
|
-
return [
|
|
63
|
-
const t =
|
|
64
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
60
|
+
getTargetNodes(n) {
|
|
61
|
+
if (!e || !o)
|
|
62
|
+
return [n];
|
|
63
|
+
const t = n.closest(o);
|
|
64
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return class extends
|
|
68
|
+
function w(r, e, o) {
|
|
69
|
+
return class extends g {
|
|
70
70
|
getId() {
|
|
71
|
-
return
|
|
71
|
+
return r;
|
|
72
72
|
}
|
|
73
|
-
getTargetNodes(
|
|
74
|
-
if (!
|
|
75
|
-
return [
|
|
76
|
-
const t =
|
|
77
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
73
|
+
getTargetNodes(n) {
|
|
74
|
+
if (!e || !o)
|
|
75
|
+
return [n];
|
|
76
|
+
const t = n.closest(o);
|
|
77
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Mirrors the picked background onto each target cell as an INLINE style.
|
|
@@ -85,148 +85,211 @@ function L(o, n, r) {
|
|
|
85
85
|
* (SD-143023). Writing the inline here keeps it the single source of truth and in
|
|
86
86
|
* sync on every edit. Merged into the parent control's single patch (no extra apply).
|
|
87
87
|
*/
|
|
88
|
-
getAdditionalModifications(
|
|
89
|
-
const t = this.getTargetNodes(
|
|
88
|
+
getAdditionalModifications(n) {
|
|
89
|
+
const t = this.getTargetNodes(n);
|
|
90
90
|
if (!t.length)
|
|
91
91
|
return;
|
|
92
|
-
const s = this.api.getValues()[
|
|
92
|
+
const s = this.api.getValues()[f], i = !s || x.has(s), l = this.api.getDocumentModifier();
|
|
93
93
|
return t.forEach((u) => {
|
|
94
|
-
const
|
|
95
|
-
i ?
|
|
96
|
-
}),
|
|
94
|
+
const c = l.modifyHtml(u);
|
|
95
|
+
i ? c.removeStyle("background-color") : c.setStyle("background-color", s);
|
|
96
|
+
}), l;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
100
|
+
function L(r) {
|
|
101
|
+
const e = E.find((n) => n in r);
|
|
102
|
+
if (!e)
|
|
103
|
+
return;
|
|
104
|
+
const o = r[e];
|
|
105
|
+
return typeof o == "string" ? o : "";
|
|
106
|
+
}
|
|
107
|
+
function z(r, e) {
|
|
108
|
+
return e.startsWith(".") && "hasClass" in r && r.hasClass(e.slice(1));
|
|
109
|
+
}
|
|
110
|
+
function a(r, e) {
|
|
111
|
+
try {
|
|
112
|
+
return z(r, e) ? r : r.closest(e) ?? void 0;
|
|
113
|
+
} catch {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function D(r, e) {
|
|
118
|
+
if (!("querySelectorAll" in r))
|
|
119
|
+
return [];
|
|
120
|
+
try {
|
|
121
|
+
return r.querySelectorAll(e).filter((o) => "getAttribute" in o && !o.getAttribute(K));
|
|
122
|
+
} catch {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function W(r, e, o) {
|
|
127
|
+
return class extends g {
|
|
102
128
|
getId() {
|
|
103
|
-
return
|
|
129
|
+
return r;
|
|
130
|
+
}
|
|
131
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
132
|
+
getLabels() {
|
|
133
|
+
return { title: this.api.translate("Block Background Color") };
|
|
134
|
+
}
|
|
135
|
+
getTargetNodes(n) {
|
|
136
|
+
const t = a(n, e);
|
|
137
|
+
return t ? [t] : [];
|
|
104
138
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
141
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
142
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
143
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
144
|
+
*/
|
|
145
|
+
getAdditionalModifications(n) {
|
|
146
|
+
const t = a(n, e);
|
|
147
|
+
if (!t)
|
|
148
|
+
return;
|
|
149
|
+
const s = L(this.api.getValues());
|
|
150
|
+
if (s === void 0)
|
|
151
|
+
return;
|
|
152
|
+
const i = !s || x.has(s), l = this.api.getDocumentModifier();
|
|
153
|
+
return [
|
|
154
|
+
t,
|
|
155
|
+
...D(t, o)
|
|
156
|
+
].forEach((c) => {
|
|
157
|
+
const d = l.modifyHtml(c);
|
|
158
|
+
i ? d.removeStyle("background-color").removeAttribute("bgcolor") : d.setStyle("background-color", s).setAttribute("bgcolor", s);
|
|
159
|
+
}), l;
|
|
110
160
|
}
|
|
111
161
|
};
|
|
112
162
|
}
|
|
113
|
-
function
|
|
114
|
-
return class extends
|
|
163
|
+
function X(r, e, o) {
|
|
164
|
+
return class extends A {
|
|
115
165
|
getId() {
|
|
116
|
-
return
|
|
166
|
+
return r;
|
|
117
167
|
}
|
|
118
|
-
getTargetNodes(
|
|
119
|
-
|
|
168
|
+
getTargetNodes(n) {
|
|
169
|
+
if (!e || !o)
|
|
170
|
+
return [n];
|
|
171
|
+
const t = n.closest(o);
|
|
172
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
120
173
|
}
|
|
121
174
|
};
|
|
122
175
|
}
|
|
123
|
-
function
|
|
124
|
-
return class extends
|
|
176
|
+
function j(r, e, o) {
|
|
177
|
+
return class extends _ {
|
|
125
178
|
getId() {
|
|
126
|
-
return
|
|
179
|
+
return r;
|
|
127
180
|
}
|
|
128
|
-
getTargetNodes(
|
|
129
|
-
|
|
130
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
181
|
+
getTargetNodes(n) {
|
|
182
|
+
return [n];
|
|
131
183
|
}
|
|
132
184
|
};
|
|
133
185
|
}
|
|
134
|
-
function
|
|
186
|
+
function J(r, e, o = ".ins-recommendation-product-container") {
|
|
135
187
|
return class extends b {
|
|
136
188
|
getId() {
|
|
137
|
-
return
|
|
189
|
+
return r;
|
|
138
190
|
}
|
|
139
|
-
getTargetNodes(
|
|
140
|
-
const t =
|
|
141
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
191
|
+
getTargetNodes(n) {
|
|
192
|
+
const t = n.closest(o);
|
|
193
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
142
194
|
}
|
|
143
195
|
};
|
|
144
196
|
}
|
|
145
|
-
function
|
|
146
|
-
return class extends
|
|
197
|
+
function Q(r, e, o = ".ins-recommendation-product-container") {
|
|
198
|
+
return class extends h {
|
|
147
199
|
getId() {
|
|
148
|
-
return
|
|
200
|
+
return r;
|
|
149
201
|
}
|
|
150
|
-
getTargetNodes(
|
|
151
|
-
const t =
|
|
152
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
202
|
+
getTargetNodes(n) {
|
|
203
|
+
const t = n.closest(o);
|
|
204
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
153
205
|
}
|
|
154
206
|
};
|
|
155
207
|
}
|
|
156
|
-
function
|
|
157
|
-
return class extends
|
|
208
|
+
function Z(r, e, o = ".ins-recommendation-product-container") {
|
|
209
|
+
return class extends k {
|
|
158
210
|
getId() {
|
|
159
|
-
return
|
|
211
|
+
return r;
|
|
160
212
|
}
|
|
161
|
-
getTargetNodes(
|
|
162
|
-
const t =
|
|
163
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
213
|
+
getTargetNodes(n) {
|
|
214
|
+
const t = n.closest(o);
|
|
215
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
164
216
|
}
|
|
165
217
|
};
|
|
166
218
|
}
|
|
167
|
-
function
|
|
219
|
+
function tt(r, e, o = ".ins-recommendation-product-container") {
|
|
168
220
|
return class extends N {
|
|
169
221
|
getId() {
|
|
170
|
-
return
|
|
222
|
+
return r;
|
|
171
223
|
}
|
|
172
|
-
getTargetNodes(
|
|
173
|
-
const t =
|
|
174
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
224
|
+
getTargetNodes(n) {
|
|
225
|
+
const t = n.closest(o);
|
|
226
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
175
227
|
}
|
|
176
228
|
};
|
|
177
229
|
}
|
|
178
|
-
function
|
|
230
|
+
function et(r, e, o = ".ins-recommendation-product-container") {
|
|
179
231
|
return class extends q {
|
|
180
232
|
getId() {
|
|
181
|
-
return
|
|
233
|
+
return r;
|
|
234
|
+
}
|
|
235
|
+
getTargetNodes(n) {
|
|
236
|
+
const t = n.closest(o);
|
|
237
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function nt(r, e, o = ".ins-recommendation-product-container") {
|
|
242
|
+
return class extends p {
|
|
243
|
+
getId() {
|
|
244
|
+
return r;
|
|
182
245
|
}
|
|
183
|
-
getTargetNodes(
|
|
184
|
-
const t =
|
|
185
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
246
|
+
getTargetNodes(n) {
|
|
247
|
+
const t = n.closest(o);
|
|
248
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
186
249
|
}
|
|
187
250
|
};
|
|
188
251
|
}
|
|
189
|
-
function
|
|
252
|
+
function rt(r, e, o = ".ins-recommendation-product-container") {
|
|
190
253
|
return class extends $ {
|
|
191
254
|
getId() {
|
|
192
|
-
return
|
|
255
|
+
return r;
|
|
193
256
|
}
|
|
194
|
-
getTargetNodes(
|
|
195
|
-
const t =
|
|
196
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
257
|
+
getTargetNodes(n) {
|
|
258
|
+
const t = n.closest(o);
|
|
259
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
197
260
|
}
|
|
198
261
|
};
|
|
199
262
|
}
|
|
200
|
-
function
|
|
201
|
-
return class extends
|
|
263
|
+
function ot(r, e, o = ".ins-recommendation-product-container") {
|
|
264
|
+
return class extends F {
|
|
202
265
|
getId() {
|
|
203
|
-
return
|
|
266
|
+
return r;
|
|
204
267
|
}
|
|
205
|
-
getTargetNodes(
|
|
206
|
-
const t =
|
|
207
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
268
|
+
getTargetNodes(n) {
|
|
269
|
+
const t = n.closest(o);
|
|
270
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
208
271
|
}
|
|
209
272
|
};
|
|
210
273
|
}
|
|
211
|
-
function
|
|
212
|
-
return class extends
|
|
274
|
+
function st(r, e, o = ".ins-recommendation-product-container") {
|
|
275
|
+
return class extends v {
|
|
213
276
|
getId() {
|
|
214
|
-
return
|
|
277
|
+
return r;
|
|
215
278
|
}
|
|
216
|
-
getTargetNodes(
|
|
217
|
-
const t =
|
|
218
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
279
|
+
getTargetNodes(n) {
|
|
280
|
+
const t = n.closest(o);
|
|
281
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
219
282
|
}
|
|
220
283
|
};
|
|
221
284
|
}
|
|
222
|
-
function
|
|
223
|
-
return class extends
|
|
285
|
+
function it(r, e, o) {
|
|
286
|
+
return class extends M {
|
|
224
287
|
getId() {
|
|
225
|
-
return
|
|
288
|
+
return r;
|
|
226
289
|
}
|
|
227
|
-
getTargetNodes(
|
|
228
|
-
const t =
|
|
229
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
290
|
+
getTargetNodes(n) {
|
|
291
|
+
const t = n.closest(o);
|
|
292
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
230
293
|
}
|
|
231
294
|
/**
|
|
232
295
|
* Propagates Bold/Italic to ALL product buttons, not just the focused one.
|
|
@@ -238,58 +301,58 @@ function Z(o, n, r) {
|
|
|
238
301
|
* (`buttonTextStyleForm.{bold,italic}`) because the patched node isn't updated yet
|
|
239
302
|
* when this runs. Returned modifications are merged into the parent control's patch.
|
|
240
303
|
*/
|
|
241
|
-
getAdditionalModifications(
|
|
242
|
-
const t =
|
|
304
|
+
getAdditionalModifications(n) {
|
|
305
|
+
const t = n.closest(o);
|
|
243
306
|
if (!t)
|
|
244
307
|
return;
|
|
245
|
-
const s = t.querySelectorAll(`[esd-extension-block-id="${
|
|
308
|
+
const s = t.querySelectorAll(`[esd-extension-block-id="${e}"] a.es-button`);
|
|
246
309
|
if (!s.length)
|
|
247
310
|
return;
|
|
248
|
-
const i = this.api.getValues()[
|
|
311
|
+
const i = this.api.getValues()[O];
|
|
249
312
|
if (!i)
|
|
250
313
|
return;
|
|
251
|
-
const
|
|
314
|
+
const l = i.bold ? "bold" : "normal", u = i.italic ? "italic" : "normal", c = this.api.getDocumentModifier();
|
|
252
315
|
return s.forEach((d) => {
|
|
253
|
-
|
|
254
|
-
}),
|
|
316
|
+
c.modifyHtml(d).setStyle("font-weight", l).setStyle("font-style", u);
|
|
317
|
+
}), c;
|
|
255
318
|
}
|
|
256
319
|
};
|
|
257
320
|
}
|
|
258
|
-
function
|
|
259
|
-
return class extends
|
|
321
|
+
function lt(r, e, o) {
|
|
322
|
+
return class extends R {
|
|
260
323
|
getId() {
|
|
261
|
-
return
|
|
324
|
+
return r;
|
|
262
325
|
}
|
|
263
|
-
getTargetNodes(
|
|
264
|
-
const t =
|
|
265
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
326
|
+
getTargetNodes(n) {
|
|
327
|
+
const t = n.closest(o);
|
|
328
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
266
329
|
}
|
|
267
330
|
};
|
|
268
331
|
}
|
|
269
|
-
function
|
|
270
|
-
return class extends
|
|
332
|
+
function ct(r, e, o) {
|
|
333
|
+
return class extends S {
|
|
271
334
|
getId() {
|
|
272
|
-
return
|
|
335
|
+
return r;
|
|
273
336
|
}
|
|
274
|
-
getTargetNodes(
|
|
337
|
+
getTargetNodes(n) {
|
|
275
338
|
try {
|
|
276
|
-
const t =
|
|
277
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
339
|
+
const t = n.closest(o);
|
|
340
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
278
341
|
} catch {
|
|
279
342
|
return [];
|
|
280
343
|
}
|
|
281
344
|
}
|
|
282
345
|
};
|
|
283
346
|
}
|
|
284
|
-
function
|
|
285
|
-
return class extends
|
|
347
|
+
function ut(r, e, o) {
|
|
348
|
+
return class extends I {
|
|
286
349
|
getId() {
|
|
287
|
-
return
|
|
350
|
+
return r;
|
|
288
351
|
}
|
|
289
|
-
getTargetNodes(
|
|
352
|
+
getTargetNodes(n) {
|
|
290
353
|
try {
|
|
291
|
-
const t =
|
|
292
|
-
return t ? t.querySelectorAll(`[esd-extension-block-id="${
|
|
354
|
+
const t = n.closest(o);
|
|
355
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
293
356
|
} catch {
|
|
294
357
|
return [];
|
|
295
358
|
}
|
|
@@ -297,25 +360,26 @@ function nt(o, n, r) {
|
|
|
297
360
|
};
|
|
298
361
|
}
|
|
299
362
|
export {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
363
|
+
W as createBlockBackgroundColorControl,
|
|
364
|
+
J as createButtonAlignControl,
|
|
365
|
+
Z as createButtonBorderControl,
|
|
366
|
+
tt as createButtonBorderRadiusControl,
|
|
367
|
+
Q as createButtonColorControl,
|
|
368
|
+
lt as createButtonFitToContainerControl,
|
|
369
|
+
et as createButtonFontFamilyControl,
|
|
370
|
+
nt as createButtonMarginsControl,
|
|
371
|
+
rt as createButtonPaddingsControl,
|
|
372
|
+
ot as createButtonTextControl,
|
|
373
|
+
st as createButtonTextSizeControl,
|
|
374
|
+
it as createButtonTextStyleAndFontColorControl,
|
|
375
|
+
ut as createImageMarginsControl,
|
|
376
|
+
ct as createImageSizeControl,
|
|
377
|
+
X as createPaddingsControl,
|
|
378
|
+
U as createTextAlignControl,
|
|
379
|
+
w as createTextBackgroundColorControl,
|
|
380
|
+
Y as createTextColorControl,
|
|
381
|
+
V as createTextFontFamilyControl,
|
|
382
|
+
j as createTextLineSpacingControl,
|
|
383
|
+
G as createTextSizeControl,
|
|
384
|
+
H as createTextStyleControl
|
|
321
385
|
};
|
|
@@ -2,78 +2,77 @@ import { useHttp as d } from "../composables/useHttp.js";
|
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
4
|
import { useBlankTemplate as f } from "./blankTemplate.js";
|
|
5
|
-
const
|
|
6
|
-
const { get:
|
|
5
|
+
const D = () => {
|
|
6
|
+
const { get: s, post: u } = d(), { handleError: r } = m(), { getBlankTemplate: o } = f();
|
|
7
7
|
return {
|
|
8
8
|
getToken: async () => {
|
|
9
9
|
try {
|
|
10
|
-
const { data: t } = await
|
|
10
|
+
const { data: t } = await s("/stripo/get-user-token");
|
|
11
11
|
return t.body.token;
|
|
12
12
|
} catch (t) {
|
|
13
|
-
return
|
|
13
|
+
return r(t, "Failed to fetch token"), "";
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
getCustomFonts: async () => {
|
|
17
17
|
try {
|
|
18
|
-
const { data: t = [] } = await
|
|
18
|
+
const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
|
|
19
19
|
return t.map((e) => ({
|
|
20
20
|
...e,
|
|
21
21
|
active: !0
|
|
22
22
|
}));
|
|
23
23
|
} catch (t) {
|
|
24
|
-
return
|
|
24
|
+
return r(t, "Failed to fetch custom fonts"), [];
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
getDefaultTemplate: async () => {
|
|
28
28
|
try {
|
|
29
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
30
|
-
if (!
|
|
31
|
-
return await
|
|
32
|
-
const p = `/stripo/default-template/${
|
|
33
|
-
return !
|
|
29
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), l = t.get("master"), n = e ? parseInt(e) : 0, i = n >= 1 && n <= y ? n : 0;
|
|
30
|
+
if (!i && !l)
|
|
31
|
+
return await o();
|
|
32
|
+
const p = `/stripo/default-template/${i}`, { data: c } = await s(p), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
33
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await o() : a;
|
|
34
34
|
} catch (t) {
|
|
35
|
-
return
|
|
35
|
+
return r(t, "Failed to fetch default template"), o();
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
getSyncModulesStatus: async () => {
|
|
39
39
|
try {
|
|
40
|
-
const { data: t } = await
|
|
40
|
+
const { data: t } = await s("/newsletter/settings/synchronisation-in-modules-status");
|
|
41
41
|
return t.status;
|
|
42
42
|
} catch (t) {
|
|
43
|
-
return
|
|
43
|
+
return r(t, "Failed to fetch sync modules status"), !1;
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
updateSyncModule: async (t) => {
|
|
47
47
|
try {
|
|
48
|
-
return await
|
|
48
|
+
return await u(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
|
|
49
49
|
} catch (e) {
|
|
50
|
-
return
|
|
50
|
+
return r(e, "Failed to update sync module"), !1;
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
getSyncModule: async (t) => {
|
|
54
|
-
const e = {
|
|
55
|
-
id: 0,
|
|
56
|
-
stripoId: 0,
|
|
57
|
-
unsubscriptionPreferencePages: []
|
|
58
|
-
};
|
|
59
54
|
try {
|
|
60
|
-
const { data:
|
|
61
|
-
return
|
|
62
|
-
} catch (
|
|
63
|
-
return
|
|
55
|
+
const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
|
|
56
|
+
return e;
|
|
57
|
+
} catch (e) {
|
|
58
|
+
return r(e, "Failed to get sync module"), {
|
|
59
|
+
id: 0,
|
|
60
|
+
stripoId: 0,
|
|
61
|
+
unsubscriptionPreferencePages: []
|
|
62
|
+
};
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
65
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
67
66
|
if (t.length === 0)
|
|
68
67
|
return !0;
|
|
69
68
|
try {
|
|
70
|
-
return await
|
|
69
|
+
return await u("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
|
|
71
70
|
} catch (e) {
|
|
72
|
-
return
|
|
71
|
+
return r(e, "Failed to set unsubscription preference pages"), !1;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
75
|
};
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
D as useStripoApi
|
|
79
78
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* These IDs are returned by the getId() method of each control
|
|
4
4
|
*/
|
|
5
5
|
export declare enum RecommendationControlId {
|
|
6
|
+
BLOCK_BACKGROUND = "recommendation-block-background-color-control",
|
|
6
7
|
BUTTON_ALIGN = "recommendation-block-button-align-control",
|
|
7
8
|
BUTTON_BORDER = "recommendation-block-button-border-control",
|
|
8
9
|
BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BlockBackgroundColorControl: {
|
|
2
|
+
new (): {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getLabels(): {
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
8
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
9
|
+
getParentControlId(): string;
|
|
10
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
11
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
12
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -20,6 +20,7 @@ export { ButtonControls } from './button';
|
|
|
20
20
|
export { ImageControls } from './image';
|
|
21
21
|
export { CustomAttributeControls } from './customAttribute';
|
|
22
22
|
export { SpacingControl, SPACING_CONTROL_ID } from './spacing';
|
|
23
|
+
export { BlockBackgroundColorControl } from './blockBackground';
|
|
23
24
|
export { CardBackgroundColorControl, CARD_BACKGROUND_COLOR_CONTROL_ID } from './cardBackground';
|
|
24
25
|
export { RecommendationCardCompositionControl, COMPOSITION_CONTROL_BLOCK_ID } from './cardComposition';
|
|
25
26
|
export { SyncInfoMessageControl, SYNC_INFO_MESSAGE_CONTROL_ID } from './syncInfoMessage';
|
|
@@ -115,6 +115,36 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
115
115
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Factory function to create a background color control for a whole extension block.
|
|
120
|
+
*
|
|
121
|
+
* Stripo's built-in block-background control resolves its own target and descends to the
|
|
122
|
+
* nearest `.esd-block-text`, which inside a Recommendation block is the title cell rather
|
|
123
|
+
* than the block itself (SD-145082). Overriding `getTargetNodes` moves that resolution here.
|
|
124
|
+
*/
|
|
125
|
+
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string,
|
|
126
|
+
/** Extra cells inside the block to keep in sync — e.g. a title cell holding a pre-fix color. */
|
|
127
|
+
additionalTargetSelector?: string): {
|
|
128
|
+
new (): {
|
|
129
|
+
getId(): string;
|
|
130
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
131
|
+
getLabels(): {
|
|
132
|
+
title: string;
|
|
133
|
+
};
|
|
134
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
135
|
+
/**
|
|
136
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
137
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
138
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
139
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
140
|
+
*/
|
|
141
|
+
getAdditionalModifications(root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
142
|
+
getParentControlId(): string;
|
|
143
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
144
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
145
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
118
148
|
/**
|
|
119
149
|
* Factory function to create paddings controls for different block elements
|
|
120
150
|
* When targetBlockId and containerSelector are not provided, applies directly to root
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.ab050f8",
|
|
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",
|