@useinsider/guido 3.12.0 → 3.13.0-beta.ef18f66
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/README.md +16 -1
- package/dist/@types/config/schemas.js +27 -25
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +110 -101
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +1 -1
- package/dist/composables/useAllowlist.js +50 -0
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useSave.js +42 -23
- package/dist/composables/useStripo.js +72 -69
- package/dist/composables/useUserRole.js +12 -0
- package/dist/enums/roles.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +12 -12
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +7 -7
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/allowlistApi.js +15 -0
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/Guido.vue.d.ts +18 -2
- package/dist/src/composables/useAllowlist.d.ts +6 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/composables/useStripo.d.ts +3 -2
- package/dist/src/composables/useUserRole.d.ts +3 -0
- package/dist/src/enums/roles.d.ts +9 -0
- 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/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/services/allowlistApi.d.ts +4 -0
- package/dist/src/stores/config.d.ts +21 -1
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/stores/config.js +21 -19
- package/dist/utils/pairProductVariables.js +44 -43
- package/dist/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.js +1 -1
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +2 -2
- /package/dist/src/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.d.ts +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { preserveTextStyles as m } from "../../../../../utils/preserveTextStyles.js";
|
|
2
|
+
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
4
|
+
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
|
+
import { RecommendationControlId as T } from "../../constants/controlIds.js";
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as f } from "../../constants/selectors.js";
|
|
7
7
|
const i = "data-text-after", u = "", p = ".omnibus-text-after";
|
|
8
|
-
class g extends
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
|
-
return
|
|
10
|
+
return T.OMNIBUS_DISCOUNT_TEXT_AFTER;
|
|
11
11
|
}
|
|
12
12
|
getTemplate() {
|
|
13
13
|
return `
|
|
@@ -44,11 +44,11 @@ class g extends c {
|
|
|
44
44
|
_onTextChange(t) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const e = this.currentNode.closest(
|
|
47
|
+
const e = this.currentNode.closest(f);
|
|
48
48
|
if (!e || !("querySelectorAll" in e))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
51
|
-
e.querySelectorAll(`[esd-extension-block-id="${
|
|
51
|
+
e.querySelectorAll(`[esd-extension-block-id="${d.OMNIBUS_DISCOUNT}"]`)
|
|
52
52
|
);
|
|
53
53
|
if (!n.length)
|
|
54
54
|
return;
|
|
@@ -57,10 +57,10 @@ class g extends c {
|
|
|
57
57
|
o.modifyHtml(s).setAttribute(i, t);
|
|
58
58
|
const r = s.querySelector(p);
|
|
59
59
|
if (r) {
|
|
60
|
-
const a =
|
|
60
|
+
const a = m(r, t);
|
|
61
61
|
o.modifyHtml(r).setInnerHtml(a);
|
|
62
62
|
}
|
|
63
|
-
}), o.apply(new
|
|
63
|
+
}), o.apply(new c("Update omnibus discount text after"));
|
|
64
64
|
}
|
|
65
65
|
_listenToFormUpdates() {
|
|
66
66
|
this.api.onValueChanged("omnibusDiscountTextAfter", (t) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { preserveTextStyles as a } from "../../../../../utils/preserveTextStyles.js";
|
|
2
|
+
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
4
|
+
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
|
+
import { RecommendationControlId as T } from "../../constants/controlIds.js";
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as f } from "../../constants/selectors.js";
|
|
7
7
|
const i = "data-text-before", u = "", p = ".omnibus-text-before";
|
|
8
|
-
class g extends
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
|
-
return
|
|
10
|
+
return T.OMNIBUS_DISCOUNT_TEXT_BEFORE;
|
|
11
11
|
}
|
|
12
12
|
getTemplate() {
|
|
13
13
|
return `
|
|
@@ -44,11 +44,11 @@ class g extends c {
|
|
|
44
44
|
_onTextChange(t) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const e = this.currentNode.closest(
|
|
47
|
+
const e = this.currentNode.closest(f);
|
|
48
48
|
if (!e || !("querySelectorAll" in e))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
51
|
-
e.querySelectorAll(`[esd-extension-block-id="${
|
|
51
|
+
e.querySelectorAll(`[esd-extension-block-id="${d.OMNIBUS_DISCOUNT}"]`)
|
|
52
52
|
);
|
|
53
53
|
if (!n.length)
|
|
54
54
|
return;
|
|
@@ -57,10 +57,10 @@ class g extends c {
|
|
|
57
57
|
o.modifyHtml(s).setAttribute(i, t);
|
|
58
58
|
const r = s.querySelector(p);
|
|
59
59
|
if (r) {
|
|
60
|
-
const m =
|
|
60
|
+
const m = a(r, t);
|
|
61
61
|
o.modifyHtml(r).setInnerHtml(m);
|
|
62
62
|
}
|
|
63
|
-
}), o.apply(new
|
|
63
|
+
}), o.apply(new c("Update omnibus discount text before"));
|
|
64
64
|
}
|
|
65
65
|
_listenToFormUpdates() {
|
|
66
66
|
this.api.onValueChanged("omnibusDiscountTextBefore", (t) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { preserveTextStyles as u } from "../../../../../utils/preserveTextStyles.js";
|
|
2
|
+
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
4
|
+
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
|
+
import { RecommendationControlId as T } from "../../constants/controlIds.js";
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as p } from "../../constants/selectors.js";
|
|
7
7
|
const s = "data-text-after", a = "", f = ".omnibus-text-after";
|
|
8
|
-
class g extends
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
|
-
return
|
|
10
|
+
return T.OMNIBUS_PRICE_TEXT_AFTER;
|
|
11
11
|
}
|
|
12
12
|
getTemplate() {
|
|
13
13
|
return `
|
|
@@ -44,11 +44,11 @@ class g extends c {
|
|
|
44
44
|
_onTextChange(t) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const e = this.currentNode.closest(
|
|
47
|
+
const e = this.currentNode.closest(p);
|
|
48
48
|
if (!e || !("querySelectorAll" in e))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
51
|
-
e.querySelectorAll(`[esd-extension-block-id="${
|
|
51
|
+
e.querySelectorAll(`[esd-extension-block-id="${d.OMNIBUS_PRICE}"]`)
|
|
52
52
|
);
|
|
53
53
|
if (!n.length)
|
|
54
54
|
return;
|
|
@@ -57,10 +57,10 @@ class g extends c {
|
|
|
57
57
|
r.modifyHtml(i).setAttribute(s, t);
|
|
58
58
|
const o = i.querySelector(f);
|
|
59
59
|
if (o) {
|
|
60
|
-
const m =
|
|
60
|
+
const m = u(o, t);
|
|
61
61
|
r.modifyHtml(o).setInnerHtml(m);
|
|
62
62
|
}
|
|
63
|
-
}), r.apply(new
|
|
63
|
+
}), r.apply(new c("Update omnibus price text after"));
|
|
64
64
|
}
|
|
65
65
|
_listenToFormUpdates() {
|
|
66
66
|
this.api.onValueChanged("omnibusPriceTextAfter", (t) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { preserveTextStyles as u } from "../../../../../utils/preserveTextStyles.js";
|
|
2
|
+
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
4
|
+
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
|
+
import { RecommendationControlId as p } from "../../constants/controlIds.js";
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as T } from "../../constants/selectors.js";
|
|
7
7
|
const s = "data-text-before", a = "", f = ".omnibus-text-before";
|
|
8
|
-
class g extends
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
|
-
return
|
|
10
|
+
return p.OMNIBUS_PRICE_TEXT_BEFORE;
|
|
11
11
|
}
|
|
12
12
|
getTemplate() {
|
|
13
13
|
return `
|
|
@@ -44,11 +44,11 @@ class g extends c {
|
|
|
44
44
|
_onTextChange(e) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const t = this.currentNode.closest(
|
|
47
|
+
const t = this.currentNode.closest(T);
|
|
48
48
|
if (!t || !("querySelectorAll" in t))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
51
|
-
t.querySelectorAll(`[esd-extension-block-id="${
|
|
51
|
+
t.querySelectorAll(`[esd-extension-block-id="${d.OMNIBUS_PRICE}"]`)
|
|
52
52
|
);
|
|
53
53
|
if (!n.length)
|
|
54
54
|
return;
|
|
@@ -57,10 +57,10 @@ class g extends c {
|
|
|
57
57
|
o.modifyHtml(i).setAttribute(s, e);
|
|
58
58
|
const r = i.querySelector(f);
|
|
59
59
|
if (r) {
|
|
60
|
-
const m =
|
|
60
|
+
const m = u(r, e);
|
|
61
61
|
o.modifyHtml(r).setInnerHtml(m);
|
|
62
62
|
}
|
|
63
|
-
}), o.apply(new
|
|
63
|
+
}), o.apply(new c("Update omnibus price text before"));
|
|
64
64
|
}
|
|
65
65
|
_listenToFormUpdates() {
|
|
66
66
|
this.api.onValueChanged("omnibusPriceTextBefore", (e) => {
|
|
@@ -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,8 +1,8 @@
|
|
|
1
|
+
import { extractWrapperTags as C } from "../../../../utils/preserveTextStyles.js";
|
|
1
2
|
import { RecommendationBlockId as c } from "../constants/blockIds.js";
|
|
2
|
-
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_OMNIBUS_PRICE as
|
|
3
|
+
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_OMNIBUS_PRICE as A, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_BUTTON as P, ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_ATTR as x } from "../constants/selectors.js";
|
|
3
4
|
import { CSS_CLASS_TEXT_TRIM as B } from "../controls/shared/textTrimCssRules.js";
|
|
4
5
|
import { toCustomCompositionKey as v } from "../templates/utils.js";
|
|
5
|
-
import { extractWrapperTags as R } from "./preserveTextStyles.js";
|
|
6
6
|
import { hasQuerySelectorAll as _, hasGetAttribute as l, hasGetStyle as I, hasGetComputedStyle as U } from "./tagName.js";
|
|
7
7
|
const s = [
|
|
8
8
|
"font-size",
|
|
@@ -42,8 +42,8 @@ const s = [
|
|
|
42
42
|
{ attrKey: E, blockId: c.NAME, kind: "text" },
|
|
43
43
|
{ attrKey: p, blockId: c.PRICE, kind: "text" },
|
|
44
44
|
{ attrKey: y, blockId: c.OLD_PRICE, kind: "text" },
|
|
45
|
-
{ attrKey:
|
|
46
|
-
{ attrKey:
|
|
45
|
+
{ attrKey: A, blockId: c.OMNIBUS_PRICE, kind: "text" },
|
|
46
|
+
{ attrKey: R, blockId: c.OMNIBUS_DISCOUNT, kind: "text" },
|
|
47
47
|
{ attrKey: P, blockId: c.BUTTON, kind: "button" },
|
|
48
48
|
{ attrKey: q, blockId: c.IMAGE, kind: "image" }
|
|
49
49
|
];
|
|
@@ -75,11 +75,11 @@ function g(t, e) {
|
|
|
75
75
|
function w(t) {
|
|
76
76
|
const e = t.querySelector("p"), r = {};
|
|
77
77
|
a(r, t, s), a(r, e, s), a(r, t.querySelector("strong"), s), a(r, t.querySelector("em"), s), a(r, t.querySelector("s"), s);
|
|
78
|
-
const n = h(r), { openTags: o, closeTags: i } =
|
|
78
|
+
const n = h(r), { openTags: o, closeTags: i } = C(O(e));
|
|
79
79
|
return !n && !o ? null : { pStyle: n || void 0, openTags: o, closeTags: i };
|
|
80
80
|
}
|
|
81
81
|
function $(t) {
|
|
82
|
-
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N), o = g(r, M), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } =
|
|
82
|
+
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N), o = g(r, M), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } = C(O(r)), m = L(r);
|
|
83
83
|
return !n && !o && !u && !T && !m ? null : {
|
|
84
84
|
buttonBorderStyle: n || void 0,
|
|
85
85
|
buttonAnchorStyle: o || void 0,
|
|
@@ -184,7 +184,7 @@ function J(t) {
|
|
|
184
184
|
function Z(t) {
|
|
185
185
|
const e = {};
|
|
186
186
|
return f(t, (r, n) => {
|
|
187
|
-
if (n !==
|
|
187
|
+
if (n !== A && n !== R || !l(r))
|
|
188
188
|
return;
|
|
189
189
|
const o = r.getAttribute("data-text-before"), i = r.getAttribute("data-text-after");
|
|
190
190
|
(o != null || i != null) && (e[n] = { before: o ?? void 0, after: i ?? void 0 });
|
|
@@ -5,9 +5,10 @@ const s = {
|
|
|
5
5
|
PAGE_TYPE: "data-unsubscribe-page-type",
|
|
6
6
|
PAGE_LIST: "data-unsubscribe-page-list",
|
|
7
7
|
BLOCK_ID: "data-unsubscribe-block-id"
|
|
8
|
-
}, c = ".unsubscribe-block-v2";
|
|
8
|
+
}, c = ".unsubscribe-block-v2", u = 'a[data-unsubscribe-link="true"], a.unsubscribe-link';
|
|
9
9
|
export {
|
|
10
10
|
b as DATA_ATTRIBUTES,
|
|
11
11
|
c as UNSUBSCRIBE_BLOCK_SELECTOR,
|
|
12
|
-
s as UNSUBSCRIBE_EVENTS
|
|
12
|
+
s as UNSUBSCRIBE_EVENTS,
|
|
13
|
+
u as UNSUBSCRIBE_LINK_SELECTOR
|
|
13
14
|
};
|