@useinsider/guido 2.0.0-beta.4f6e85f → 2.0.0-beta.522e9d9
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 +0 -2
- package/dist/@types/config/schemas.js +39 -55
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +17 -15
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +12 -11
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
- package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
- package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
- package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
- package/dist/components/organisms/header/RightSlot.vue.js +12 -12
- package/dist/components/organisms/header/RightSlot.vue2.js +26 -20
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
- package/dist/composables/useConfig.js +27 -29
- package/dist/composables/useSave.js +11 -13
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/index.js +8 -9
- package/dist/enums/academy.js +8 -0
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +20 -21
- package/dist/extensions/Blocks/Items/block.js +40 -39
- package/dist/extensions/Blocks/Items/controls/button/link.js +29 -22
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -66
- package/dist/extensions/Blocks/Items/controls/image/link.js +30 -23
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +17 -19
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +29 -31
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +19 -21
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +27 -29
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +143 -152
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -43
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -4
- package/dist/extensions/Blocks/Items/extension.js +6 -7
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +49 -58
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +59 -48
- package/dist/extensions/Blocks/Items/settingsPanel.js +26 -27
- package/dist/extensions/Blocks/Items/store/items-block.js +7 -11
- package/dist/extensions/Blocks/Items/template.js +129 -366
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +76 -0
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +46 -0
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +30 -29
- package/dist/extensions/Blocks/controlFactories.js +45 -55
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +285 -364
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +10 -6
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +0 -30
- package/dist/src/@types/config/types.d.ts +1 -7
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -8
- package/dist/src/enums/academy.d.ts +12 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -9
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +26 -24
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -22
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +50 -0
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +10 -9
- package/dist/src/stores/config.d.ts +1 -164
- package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
- package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
- package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/stores/config.js +0 -7
- package/dist/utils/pairProductVariables.js +58 -61
- package/package.json +3 -3
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
- package/dist/config/migrator/itemsBlockMigrator.js +0 -342
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +0 -93
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -184
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -18
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -73
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ModificationDescription as F, UIElementType as
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var I = (r, e, t) => e in r ? _(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var P = (r, e, t) => I(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ModificationDescription as F, UIElementType as m, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as h } from "../../../common-control.js";
|
|
6
|
-
import { ItemsBlockControlId as
|
|
6
|
+
import { ItemsBlockControlId as l, ItemsBlockId as A } from "../../enums/controlEnums.js";
|
|
7
7
|
import { productPairs as T } from "../../enums/productEnums.js";
|
|
8
|
-
import { useItemsBlockStore as
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { useItemsBlockStore as u } from "../../store/items-block.js";
|
|
9
|
+
import { syncFormattedPriceFromAttributes as g } from "../../utils/syncAttributesFromConfigBlock.js";
|
|
10
|
+
import { updateConfigBlockAttributes as D } from "../../utils/updateAttributes.js";
|
|
11
|
+
const f = l.PRICE_FORMATTED_PRICE, n = {
|
|
11
12
|
FORMATTED_PRICE: "formattedPrice"
|
|
12
13
|
};
|
|
13
|
-
class
|
|
14
|
+
class y extends h {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
|
-
|
|
17
|
+
P(this, "store", u());
|
|
17
18
|
}
|
|
18
19
|
getId() {
|
|
19
|
-
return
|
|
20
|
+
return f;
|
|
20
21
|
}
|
|
21
22
|
getTemplate() {
|
|
22
23
|
return `
|
|
23
|
-
<div class="
|
|
24
|
+
<div class="${l.PRICE_FORMATTED_PRICE}">
|
|
24
25
|
${this._getFormattedPrice()}
|
|
25
26
|
</div>
|
|
26
27
|
`;
|
|
27
28
|
}
|
|
28
29
|
onRender() {
|
|
29
|
-
this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (
|
|
30
|
-
this._onFormattedPriceChange(
|
|
30
|
+
this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (t) => {
|
|
31
|
+
this._onFormattedPriceChange(t);
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
onTemplateNodeUpdated(
|
|
34
|
-
super.onTemplateNodeUpdated(
|
|
35
|
-
() =>
|
|
36
|
-
const r = f(this.currentNode);
|
|
37
|
-
r && this.store.setFormattedPrice(r.priceFormatted ?? !0);
|
|
38
|
-
},
|
|
34
|
+
onTemplateNodeUpdated(t) {
|
|
35
|
+
super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
|
|
36
|
+
() => g(this.currentNode),
|
|
39
37
|
() => {
|
|
40
38
|
this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
|
|
41
39
|
}
|
|
42
40
|
);
|
|
43
41
|
}
|
|
44
|
-
_onFormattedPriceChange(
|
|
45
|
-
if (console.debug("Formatted price changed to: ",
|
|
42
|
+
_onFormattedPriceChange(t) {
|
|
43
|
+
if (console.debug("Formatted price changed to: ", t), this.store.setFormattedPrice(t), D(this.currentNode, this.api), !this.currentNode)
|
|
46
44
|
return;
|
|
47
|
-
const { itemsType:
|
|
45
|
+
const { itemsType: s } = this.store, i = T.PAIRS_FOR_EXTENSION.price[s], o = T.PAIRS_FOR_EXTENSION.originalPrice[s], [c, a] = t ? [i.DEFAULT_PRICE, i.DEFAULT_PRICE_FORMATTED] : [i.DEFAULT_PRICE_FORMATTED, i.DEFAULT_PRICE], [p, R] = t ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE];
|
|
48
46
|
this._updatePriceBlock(
|
|
49
47
|
this.currentNode,
|
|
50
48
|
c,
|
|
51
49
|
a,
|
|
52
50
|
"price"
|
|
53
51
|
);
|
|
54
|
-
const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${
|
|
55
|
-
E && this._updatePriceBlock(E,
|
|
52
|
+
const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${A.ORIGINAL_PRICE}"]`);
|
|
53
|
+
E && this._updatePriceBlock(E, p, R, "original price");
|
|
56
54
|
}
|
|
57
|
-
_updatePriceBlock(
|
|
58
|
-
const c =
|
|
59
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
55
|
+
_updatePriceBlock(t, s, i, o) {
|
|
56
|
+
const c = t.getInnerHTML().replace(s, i), a = `Updated ${o} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
|
|
57
|
+
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(c).apply(new F(a));
|
|
60
58
|
}
|
|
61
59
|
_getFormattedPrice() {
|
|
62
60
|
return `
|
|
63
|
-
<div class="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
<div class="container">
|
|
62
|
+
<div class="display-flex align-items-center justify-content-between">
|
|
63
|
+
<${m.LABEL}
|
|
64
|
+
${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
|
|
65
|
+
>
|
|
66
|
+
</${m.LABEL}>
|
|
67
|
+
${this._GuToggle(n.FORMATTED_PRICE)}
|
|
68
|
+
</div>
|
|
69
69
|
</div>
|
|
70
70
|
`;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
f as CONTROL_BLOCK_ID,
|
|
75
|
+
y as PriceFormattedPriceControl
|
|
76
76
|
};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (i, e, t) => e in i ?
|
|
3
|
-
var
|
|
4
|
-
import { UIElementType as
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var a = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var o = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { UIElementType as n, UEAttr as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as u } from "../../../common-control.js";
|
|
6
|
-
import { ItemsBlockControlId as
|
|
7
|
-
import { useItemsBlockStore as
|
|
8
|
-
import {
|
|
9
|
-
|
|
6
|
+
import { ItemsBlockControlId as r } from "../../enums/controlEnums.js";
|
|
7
|
+
import { useItemsBlockStore as D } from "../../store/items-block.js";
|
|
8
|
+
import { syncHideDiscountFromAttributes as p } from "../../utils/syncAttributesFromConfigBlock.js";
|
|
9
|
+
import { updateConfigBlockAttributes as I } from "../../utils/updateAttributes.js";
|
|
10
|
+
const l = r.PRICE_HIDE_DISCOUNT, s = {
|
|
10
11
|
HIDE_DISCOUNT: "hideDiscount"
|
|
11
12
|
};
|
|
12
|
-
class
|
|
13
|
+
class N extends u {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
|
-
|
|
16
|
+
o(this, "store", D());
|
|
16
17
|
}
|
|
17
18
|
getId() {
|
|
18
19
|
return l;
|
|
19
20
|
}
|
|
20
21
|
getTemplate() {
|
|
21
22
|
return `
|
|
22
|
-
<div class="
|
|
23
|
+
<div class="${r.PRICE_HIDE_DISCOUNT}">
|
|
23
24
|
${this._getHideDiscount()}
|
|
24
25
|
</div>
|
|
25
26
|
`;
|
|
@@ -31,26 +32,23 @@ class T extends u {
|
|
|
31
32
|
}
|
|
32
33
|
onTemplateNodeUpdated(t) {
|
|
33
34
|
super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
|
|
34
|
-
() =>
|
|
35
|
-
const o = p(this.currentNode);
|
|
36
|
-
o && this.store.setHideDiscount(o.priceHideDiscount ?? !0);
|
|
37
|
-
},
|
|
35
|
+
() => p(this.currentNode),
|
|
38
36
|
() => {
|
|
39
37
|
this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount });
|
|
40
38
|
}
|
|
41
39
|
);
|
|
42
40
|
}
|
|
43
41
|
_onHideDiscountChange(t) {
|
|
44
|
-
this.store.setHideDiscount(t),
|
|
42
|
+
this.store.setHideDiscount(t), I(this.currentNode, this.api), this.api.updateValues({ [s.HIDE_DISCOUNT]: t });
|
|
45
43
|
}
|
|
46
44
|
_getHideDiscount() {
|
|
47
45
|
return `
|
|
48
|
-
|
|
46
|
+
<div class="container">
|
|
49
47
|
<div class="display-flex align-items-center justify-content-between">
|
|
50
|
-
<${
|
|
51
|
-
${
|
|
48
|
+
<${n.LABEL}
|
|
49
|
+
${c.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
|
|
52
50
|
>
|
|
53
|
-
</${
|
|
51
|
+
</${n.LABEL}>
|
|
54
52
|
${this._GuToggle(s.HIDE_DISCOUNT)}
|
|
55
53
|
</div>
|
|
56
54
|
</div>
|
|
@@ -59,5 +57,5 @@ class T extends u {
|
|
|
59
57
|
}
|
|
60
58
|
export {
|
|
61
59
|
l as CONTROL_BLOCK_ID,
|
|
62
|
-
|
|
60
|
+
N as PriceHideDiscountControl
|
|
63
61
|
};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var m = (n, o, t) =>
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
2
|
+
var y = (n, o, t) => o in n ? I(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
|
|
3
|
+
var m = (n, o, t) => y(n, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { ModificationDescription as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as E } from "../../../common-control.js";
|
|
6
6
|
import { ItemsBlockControlId as O } from "../../enums/controlEnums.js";
|
|
7
|
-
import { SETTINGS_ENUMS as
|
|
8
|
-
import { useItemsBlockStore as
|
|
9
|
-
import {
|
|
7
|
+
import { SETTINGS_ENUMS as N } from "../../enums/settingsEnums.js";
|
|
8
|
+
import { useItemsBlockStore as f } from "../../store/items-block.js";
|
|
9
|
+
import { syncPriceOrientationFromAttributes as T } from "../../utils/syncAttributesFromConfigBlock.js";
|
|
10
|
+
import { updateConfigBlockAttributes as P } from "../../utils/updateAttributes.js";
|
|
10
11
|
const _ = O.PRICE_ORIENTATION, p = {
|
|
11
12
|
PRICE_ORIENTATION: "priceOrientation"
|
|
12
|
-
},
|
|
13
|
+
}, C = [
|
|
13
14
|
{ icon: "vertical-orientation", value: "vertical" },
|
|
14
15
|
{ icon: "horizontal-orientation", value: "horizontal" }
|
|
15
16
|
];
|
|
16
|
-
class
|
|
17
|
+
class v extends E {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
19
|
-
m(this, "store",
|
|
20
|
+
m(this, "store", f());
|
|
20
21
|
}
|
|
21
22
|
getId() {
|
|
22
23
|
return _;
|
|
23
24
|
}
|
|
24
25
|
getTemplate() {
|
|
25
26
|
return `
|
|
26
|
-
<div class="
|
|
27
|
+
<div class="${O.PRICE_ORIENTATION}">
|
|
27
28
|
${this._getPriceOrientation()}
|
|
28
29
|
</div>
|
|
29
30
|
`;
|
|
30
31
|
}
|
|
31
32
|
onRender() {
|
|
32
33
|
this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation }), this.api.onValueChanged(p.PRICE_ORIENTATION, (t) => {
|
|
33
|
-
|
|
34
|
+
this._onPriceOrientationChange(t);
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
onTemplateNodeUpdated(t) {
|
|
37
38
|
super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
|
|
38
39
|
() => {
|
|
39
|
-
|
|
40
|
-
i && this.store.setPriceOrientation(i.priceOrientation || "horizontal");
|
|
40
|
+
T(this.currentNode);
|
|
41
41
|
},
|
|
42
42
|
() => {
|
|
43
43
|
this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation });
|
|
@@ -45,26 +45,24 @@ class H extends y {
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
_onPriceOrientationChange(t) {
|
|
48
|
-
if (this.store.setPriceOrientation(t),
|
|
49
|
-
priceOrientation: t
|
|
50
|
-
}), !this.currentNode)
|
|
48
|
+
if (console.debug("Price orientation changed to: ", t), this.store.setPriceOrientation(t), P(this.currentNode, this.api), !this.currentNode)
|
|
51
49
|
return;
|
|
52
|
-
const { orientation: i } = this.store, r = i ===
|
|
50
|
+
const { orientation: i } = this.store, r = i === N.ORIENTATION.VERTICAL, e = t === "horizontal";
|
|
53
51
|
r ? this._updateVerticalLayout(e) : this._updateHorizontalLayout(e);
|
|
54
52
|
}
|
|
55
|
-
|
|
53
|
+
_updateHorizontalLayout(t) {
|
|
56
54
|
var c, l, d, a;
|
|
57
55
|
const i = ((l = (c = this.currentNode) == null ? void 0 : c.closest(".ins-product-td")) == null ? void 0 : l.querySelectorAll(".product-price-class")) || [], r = ((a = (d = this.currentNode) == null ? void 0 : d.closest(".ins-product-td")) == null ? void 0 : a.querySelectorAll(".product-original-price-class")) || [];
|
|
58
56
|
if (!i || !r)
|
|
59
57
|
return;
|
|
60
58
|
const e = t ? "50%" : "100%", s = this.api.getDocumentModifier();
|
|
61
|
-
i.forEach((
|
|
62
|
-
s.modifyHtml(
|
|
63
|
-
}), r.forEach((
|
|
64
|
-
s.modifyHtml(
|
|
65
|
-
}), s.apply(new
|
|
59
|
+
i.forEach((u) => {
|
|
60
|
+
s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
|
|
61
|
+
}), r.forEach((u) => {
|
|
62
|
+
s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
|
|
63
|
+
}), s.apply(new h(`Updated original price element width to ${e}`));
|
|
66
64
|
}
|
|
67
|
-
|
|
65
|
+
_updateVerticalLayout(t) {
|
|
68
66
|
var s, c, l, d;
|
|
69
67
|
const i = ((c = (s = this.currentNode) == null ? void 0 : s.closest(".ins-product-td")) == null ? void 0 : c.querySelectorAll(".horizontal-price")) || [], r = (d = (l = this.currentNode) == null ? void 0 : l.closest(".ins-product-td")) == null ? void 0 : d.querySelector(".vertical-price");
|
|
70
68
|
if (!i || !r || i.length === 0)
|
|
@@ -72,9 +70,9 @@ class H extends y {
|
|
|
72
70
|
const e = this.api.getDocumentModifier();
|
|
73
71
|
t ? (i.forEach((a) => {
|
|
74
72
|
e.modifyHtml(a).setStyle("display", "table-cell");
|
|
75
|
-
}), e.modifyHtml(r).setStyle("display", "none")
|
|
73
|
+
}), e.modifyHtml(r).setStyle("display", "none").apply(new h("Hide vertical price element"))) : (i.forEach((a) => {
|
|
76
74
|
e.modifyHtml(a).setStyle("display", "none");
|
|
77
|
-
}), e.modifyHtml(r).setStyle("display", "table-cell")
|
|
75
|
+
}), e.modifyHtml(r).setStyle("display", "table-cell").apply(new h("Show vertical price element")));
|
|
78
76
|
}
|
|
79
77
|
_getPriceOrientation() {
|
|
80
78
|
return `
|
|
@@ -82,7 +80,7 @@ class H extends y {
|
|
|
82
80
|
this._GuLabel({ text: "Price Orientation" }),
|
|
83
81
|
this._GuRadioButton({
|
|
84
82
|
name: p.PRICE_ORIENTATION,
|
|
85
|
-
buttons:
|
|
83
|
+
buttons: C
|
|
86
84
|
})
|
|
87
85
|
])}
|
|
88
86
|
`;
|
|
@@ -90,5 +88,5 @@ class H extends y {
|
|
|
90
88
|
}
|
|
91
89
|
export {
|
|
92
90
|
_ as CONTROL_BLOCK_ID,
|
|
93
|
-
|
|
91
|
+
v as PriceOrientationControl
|
|
94
92
|
};
|