@useinsider/guido 3.17.0-beta.dc7f4d2 → 3.17.0-beta.ddd4dde
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 +5 -5
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +76 -78
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +41 -84
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Items/block.js +98 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
- package/dist/guido.css +1 -1
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/extensions/Blocks/Items/block.d.ts +21 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/stores/config.d.ts +0 -5
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +6 -13
- package/dist/utils/pairProductVariables.js +60 -59
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +2 -2
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { currencyLocationMaps as
|
|
2
|
-
import { UEAttr as
|
|
3
|
-
import { CommonControl as
|
|
1
|
+
import { currencyLocationMaps as p } from "../../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { UEAttr as N, ModificationDescription as I } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { CommonControl as L } from "../../../common-control.js";
|
|
4
|
+
import { ITEMS_CURRENCY_ATTR as T, currencyPositionFromLocation as E } from "../../constants/currency.js";
|
|
4
5
|
import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
|
|
5
|
-
import { getItemsBlockConfig as
|
|
6
|
-
const
|
|
6
|
+
import { getItemsBlockConfig as l, setItemsBlockConfig as O, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
|
|
7
|
+
const b = m.PRICE_CURRENCY_LOCATION, c = {
|
|
7
8
|
CURRENCY_LOCATION: "currencyLocation"
|
|
8
9
|
};
|
|
9
|
-
class
|
|
10
|
+
class Y extends L {
|
|
10
11
|
getId() {
|
|
11
|
-
return
|
|
12
|
+
return b;
|
|
12
13
|
}
|
|
13
14
|
getTemplate() {
|
|
14
15
|
return `
|
|
@@ -18,32 +19,32 @@ class A extends N {
|
|
|
18
19
|
`;
|
|
19
20
|
}
|
|
20
21
|
onRender() {
|
|
21
|
-
const e =
|
|
22
|
-
this.api.setUIEAttribute(c.CURRENCY_LOCATION,
|
|
22
|
+
const e = l(this.currentNode);
|
|
23
|
+
this.api.setUIEAttribute(c.CURRENCY_LOCATION, N.SELECTPICKER.items, p), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
|
|
23
24
|
this._onCurrencyLocationChange(t);
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
onTemplateNodeUpdated(e) {
|
|
27
28
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
|
|
28
|
-
const t =
|
|
29
|
+
const t = l(this.currentNode);
|
|
29
30
|
this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
_onCurrencyLocationChange(e) {
|
|
33
|
-
if (console.debug("Currency location changed to: ", e),
|
|
34
|
+
if (console.debug("Currency location changed to: ", e), O(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
|
|
34
35
|
return;
|
|
35
36
|
const t = this._getPriceBlocks();
|
|
36
37
|
if (!t || t.length === 0)
|
|
37
38
|
return;
|
|
38
|
-
const r =
|
|
39
|
-
t.forEach((
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
39
|
+
const r = l(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = E(n), s = this.api.getDocumentModifier();
|
|
40
|
+
t.forEach((h) => {
|
|
41
|
+
const a = this._getParagraph(h);
|
|
42
|
+
if (!a)
|
|
42
43
|
return;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
`Updated currency location to ${
|
|
44
|
+
const d = a.getInnerHTML().trim() || "", C = a.getInnerText().trim() || "", u = (o == null ? void 0 : o.trim()) || "", _ = this._removeCurrencySymbol(C, u), g = this._detectSymbolInText(C) || u, R = this._buildPriceContent(_, g, n), y = d.replace(C, f(R));
|
|
45
|
+
s.modifyHtml(a).setInnerHtml(y).setAttribute(T.POSITION, i);
|
|
46
|
+
}), s.apply(new I(
|
|
47
|
+
`Updated currency location to ${i}`
|
|
47
48
|
));
|
|
48
49
|
}
|
|
49
50
|
_getPriceBlocks() {
|
|
@@ -65,8 +66,8 @@ class A extends N {
|
|
|
65
66
|
} else {
|
|
66
67
|
const o = r.match(/([^0-9.,\s]+)/);
|
|
67
68
|
if (o && o[1]) {
|
|
68
|
-
const i = o[1].trim(),
|
|
69
|
-
n = r.replace(
|
|
69
|
+
const i = o[1].trim(), s = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
|
|
70
|
+
n = r.replace(s, "").trim();
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
return n;
|
|
@@ -85,13 +86,13 @@ class A extends N {
|
|
|
85
86
|
this._GuSelect({
|
|
86
87
|
name: c.CURRENCY_LOCATION,
|
|
87
88
|
placeholder: "",
|
|
88
|
-
options:
|
|
89
|
+
options: p
|
|
89
90
|
})
|
|
90
91
|
])}
|
|
91
92
|
`;
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
b as CONTROL_BLOCK_ID,
|
|
97
|
+
Y as PriceCurrencyLocationControl
|
|
97
98
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
var R = Object.defineProperty;
|
|
2
2
|
var N = (s, c, e) => c in s ? R(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
|
|
3
3
|
var h = (s, c, e) => N(s, typeof c != "symbol" ? c + "" : c, e);
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
4
|
+
import { ModificationDescription as E } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as B } from "../../../common-control.js";
|
|
6
|
+
import { ITEMS_CURRENCY_ATTR as T } from "../../constants/currency.js";
|
|
6
7
|
import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
|
|
7
|
-
import { getItemsBlockConfig as p, setItemsBlockConfig as
|
|
8
|
-
const
|
|
8
|
+
import { getItemsBlockConfig as p, setItemsBlockConfig as Y, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
|
|
9
|
+
const x = y.PRICE_CURRENCY_SYMBOL, u = {
|
|
9
10
|
CURRENCY_SYMBOL: "currencySymbol"
|
|
10
11
|
};
|
|
11
|
-
class
|
|
12
|
+
class $ extends B {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
14
15
|
h(this, "originalPriceContents", /* @__PURE__ */ new Map());
|
|
15
16
|
}
|
|
16
17
|
getId() {
|
|
17
|
-
return
|
|
18
|
+
return x;
|
|
18
19
|
}
|
|
19
20
|
getTemplate() {
|
|
20
21
|
return `
|
|
@@ -42,7 +43,7 @@ class P extends E {
|
|
|
42
43
|
var a;
|
|
43
44
|
console.debug("Currency symbol changed to: ", e);
|
|
44
45
|
const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
|
|
45
|
-
if (
|
|
46
|
+
if (Y(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
|
|
46
47
|
return;
|
|
47
48
|
const r = this._getPriceBlocks();
|
|
48
49
|
if (!r || r.length === 0)
|
|
@@ -53,8 +54,8 @@ class P extends E {
|
|
|
53
54
|
if (!m)
|
|
54
55
|
return;
|
|
55
56
|
const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, f(S));
|
|
56
|
-
i.modifyHtml(m).setInnerHtml(b).setAttribute(
|
|
57
|
-
}), i.apply(new
|
|
57
|
+
i.modifyHtml(m).setInnerHtml(b).setAttribute(T.SYMBOL, n);
|
|
58
|
+
}), i.apply(new E(
|
|
58
59
|
`Updated currency symbol to ${n || "removed"}`
|
|
59
60
|
));
|
|
60
61
|
}
|
|
@@ -115,6 +116,6 @@ class P extends E {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
x as CONTROL_BLOCK_ID,
|
|
120
|
+
$ as PriceCurrencySymbolControl
|
|
120
121
|
};
|