@useinsider/guido 1.0.3-beta.ba79634 → 1.0.3-beta.bd6a5dd
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 +3 -32
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useHtmlValidator.js +36 -35
- package/dist/composables/useStripo.js +29 -25
- package/dist/extensions/Blocks/Checkbox/control.js +15 -14
- package/dist/extensions/Blocks/Checkbox/template.js +14 -9
- package/dist/extensions/Blocks/Items/block.js +26 -26
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +92 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +90 -83
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +63 -4
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -2
- package/dist/extensions/Blocks/Items/extension.js +7 -6
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -57
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +67 -56
- package/dist/extensions/Blocks/Items/settingsPanel.js +8 -8
- package/dist/extensions/Blocks/Items/store/items-block.js +8 -4
- package/dist/extensions/Blocks/Items/template.js +75 -72
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +35 -26
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +29 -27
- package/dist/extensions/Blocks/RadioButton/control.js +18 -17
- package/dist/extensions/Blocks/RadioButton/template.js +18 -9
- package/dist/extensions/Blocks/Unsubscribe/block.js +45 -41
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +15 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +5 -2
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +6 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +3 -4
- package/package.json +5 -10
|
@@ -1,67 +1,76 @@
|
|
|
1
|
-
import { useItemsBlockStore as
|
|
2
|
-
import { syncAttributeFromConfigBlock as
|
|
3
|
-
function
|
|
4
|
-
const o =
|
|
1
|
+
import { useItemsBlockStore as e } from "../store/items-block.js";
|
|
2
|
+
import { syncAttributeFromConfigBlock as r, createBooleanSyncConfig as i, createStringSyncConfig as s } from "./syncAttributeFromConfigBlock.js";
|
|
3
|
+
function m(t) {
|
|
4
|
+
const o = e(), n = i(
|
|
5
5
|
"PRODUCT_NAME_TRIMMING",
|
|
6
6
|
(c) => o.setNameTrimming(c),
|
|
7
7
|
!1
|
|
8
8
|
);
|
|
9
|
-
|
|
9
|
+
r(t, n);
|
|
10
10
|
}
|
|
11
11
|
function f(t) {
|
|
12
|
-
const o =
|
|
12
|
+
const o = e(), n = i(
|
|
13
13
|
"PRODUCT_PRICE_HIDE_DISCOUNT",
|
|
14
14
|
(c) => o.setHideDiscount(c),
|
|
15
15
|
!1
|
|
16
16
|
);
|
|
17
|
-
|
|
17
|
+
r(t, n);
|
|
18
18
|
}
|
|
19
19
|
function R(t) {
|
|
20
|
-
const o =
|
|
20
|
+
const o = e(), n = i(
|
|
21
21
|
"PRODUCT_PRICE_FORMATTED",
|
|
22
22
|
(c) => o.setFormattedPrice(c),
|
|
23
23
|
!0
|
|
24
24
|
);
|
|
25
|
-
|
|
25
|
+
r(t, n);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const o =
|
|
27
|
+
function O(t) {
|
|
28
|
+
const o = e(), n = s(
|
|
29
29
|
"PRODUCT_PRICE_CURRENCY_SYMBOL",
|
|
30
30
|
(c) => o.setCurrencySymbol(c),
|
|
31
31
|
""
|
|
32
32
|
);
|
|
33
|
-
|
|
33
|
+
r(t, n);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const o =
|
|
35
|
+
function _(t) {
|
|
36
|
+
const o = e(), n = s(
|
|
37
37
|
"PRODUCT_PRICE_CURRENCY_LOCATION",
|
|
38
38
|
(c) => o.setCurrencyLocation(c),
|
|
39
39
|
"0"
|
|
40
40
|
);
|
|
41
|
-
|
|
41
|
+
r(t, n);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const o =
|
|
43
|
+
function I(t) {
|
|
44
|
+
const o = e(), n = s(
|
|
45
45
|
"PRODUCT_BUTTON_LINK",
|
|
46
46
|
(c) => o.setButtonLink(c),
|
|
47
47
|
""
|
|
48
48
|
);
|
|
49
|
-
|
|
49
|
+
r(t, n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const o =
|
|
51
|
+
function T(t) {
|
|
52
|
+
const o = e(), n = s(
|
|
53
53
|
"PRODUCT_IMAGE_LINK",
|
|
54
54
|
(c) => o.setImageLink(c),
|
|
55
55
|
""
|
|
56
56
|
);
|
|
57
|
-
|
|
57
|
+
r(t, n);
|
|
58
|
+
}
|
|
59
|
+
function y(t) {
|
|
60
|
+
const o = e(), n = s(
|
|
61
|
+
"PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION",
|
|
62
|
+
(c) => o.setPriceOrientation(c),
|
|
63
|
+
"horizontal"
|
|
64
|
+
);
|
|
65
|
+
r(t, n);
|
|
58
66
|
}
|
|
59
67
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
I as syncButtonLinkFromAttributes,
|
|
69
|
+
_ as syncCurrencyLocationFromAttributes,
|
|
70
|
+
O as syncCurrencySymbolFromAttributes,
|
|
63
71
|
R as syncFormattedPriceFromAttributes,
|
|
64
72
|
f as syncHideDiscountFromAttributes,
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
T as syncImageLinkFromAttributes,
|
|
74
|
+
m as syncNameTrimmingFromAttributes,
|
|
75
|
+
y as syncPriceOrientationFromAttributes
|
|
67
76
|
};
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
1
|
+
import { ModificationDescription as p } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { configAttributes as t } from "../enums/productEnums.js";
|
|
3
|
-
import { DefaultConfigValues as
|
|
4
|
-
import { useItemsBlockStore as
|
|
5
|
-
import { getConfigBlock as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
3
|
+
import { DefaultConfigValues as i } from "../enums/settingsEnums.js";
|
|
4
|
+
import { useItemsBlockStore as s } from "../store/items-block.js";
|
|
5
|
+
import { getConfigBlock as P } from "./configBlockUtils.js";
|
|
6
|
+
function M(n, O) {
|
|
7
|
+
const e = P(n);
|
|
8
|
+
if (!e)
|
|
9
9
|
return;
|
|
10
|
-
const
|
|
10
|
+
const c = s(), {
|
|
11
11
|
itemsType: r,
|
|
12
|
-
itemIds:
|
|
12
|
+
itemIds: C,
|
|
13
13
|
orientation: T,
|
|
14
14
|
nameTrimming: _,
|
|
15
|
-
hideDiscount:
|
|
16
|
-
formattedPrice:
|
|
17
|
-
currencySymbol:
|
|
18
|
-
currencyLocation:
|
|
15
|
+
hideDiscount: E,
|
|
16
|
+
formattedPrice: R,
|
|
17
|
+
currencySymbol: N,
|
|
18
|
+
currencyLocation: m,
|
|
19
|
+
priceOrientation: I,
|
|
19
20
|
buttonLink: a,
|
|
20
21
|
imageLink: f
|
|
21
|
-
} =
|
|
22
|
+
} = c, u = {
|
|
22
23
|
"data-source": r,
|
|
23
24
|
[t.TYPE]: r,
|
|
24
|
-
[t.ITEMS_INDEX_SELECT_CONTROL_VALUE]:
|
|
25
|
+
[t.ITEMS_INDEX_SELECT_CONTROL_VALUE]: C,
|
|
25
26
|
[t.ORIENTATION]: T,
|
|
26
27
|
[t.PRODUCT_NAME_TRIMMING]: _ ? "1" : "0",
|
|
27
|
-
[t.PRODUCT_PRICE_HIDE_DISCOUNT]:
|
|
28
|
-
[t.PRODUCT_PRICE_FORMATTED]:
|
|
29
|
-
[t.PRODUCT_PRICE_CURRENCY_SYMBOL]:
|
|
30
|
-
[t.PRODUCT_PRICE_CURRENCY_LOCATION]:
|
|
28
|
+
[t.PRODUCT_PRICE_HIDE_DISCOUNT]: E ? "1" : "0",
|
|
29
|
+
[t.PRODUCT_PRICE_FORMATTED]: R ? "1" : "0",
|
|
30
|
+
[t.PRODUCT_PRICE_CURRENCY_SYMBOL]: N || "",
|
|
31
|
+
[t.PRODUCT_PRICE_CURRENCY_LOCATION]: m || "0",
|
|
32
|
+
[t.PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION]: I || "horizontal",
|
|
31
33
|
[t.PRODUCT_BUTTON_LINK]: a || "",
|
|
32
34
|
[t.PRODUCT_IMAGE_LINK]: f || "",
|
|
33
|
-
[t.NAME_CONTROL_ENABLED]:
|
|
34
|
-
[t.QUANTITY_CONTROL_ENABLED]:
|
|
35
|
-
[t.PRICE_CONTROL_OPENED]:
|
|
35
|
+
[t.NAME_CONTROL_ENABLED]: i.productNameControlEnabled,
|
|
36
|
+
[t.QUANTITY_CONTROL_ENABLED]: i.productQuantityControlEnabled,
|
|
37
|
+
[t.PRICE_CONTROL_OPENED]: i.productPriceControlOpened
|
|
36
38
|
};
|
|
37
|
-
let o =
|
|
38
|
-
Object.entries(u).forEach(([
|
|
39
|
-
o = o.setAttribute(
|
|
40
|
-
}), o.apply(new
|
|
39
|
+
let o = O.getDocumentModifier().modifyHtml(e);
|
|
40
|
+
Object.entries(u).forEach(([D, l]) => {
|
|
41
|
+
o = o.setAttribute(D, l);
|
|
42
|
+
}), o.apply(new p("Update config block attributes from control"));
|
|
41
43
|
}
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
M as updateConfigBlockAttributes
|
|
44
46
|
};
|
|
@@ -2,10 +2,10 @@ var d = Object.defineProperty;
|
|
|
2
2
|
var l = (r, n, t) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
3
|
var o = (r, n, t) => l(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { useHttp as L } from "../../../composables/useHttp.js";
|
|
5
|
-
import { DEFAULT_UNSUBSCRIBE_GROUP as
|
|
5
|
+
import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
|
|
6
6
|
import { Control as p, UIElementType as i, UEAttr as e, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
const m = "ui-elements-radio-button",
|
|
8
|
-
class
|
|
7
|
+
const m = "ui-elements-radio-button", u = "select", { get: $ } = L();
|
|
8
|
+
class S extends p {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
o(this, "currentNode");
|
|
@@ -16,15 +16,16 @@ class _ extends p {
|
|
|
16
16
|
return m;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
|
-
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
19
|
+
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const t = this.currentNode.getAttribute("id");
|
|
21
21
|
if (t) {
|
|
22
|
-
const s = t ===
|
|
23
|
-
s && (this.selectedUnsubGroup = s
|
|
24
|
-
[a]: this.selectedUnsubGroup
|
|
25
|
-
}));
|
|
22
|
+
const s = t === c.sendGridId ? t : Number(t);
|
|
23
|
+
s && (this.selectedUnsubGroup = s);
|
|
26
24
|
}
|
|
27
25
|
}
|
|
26
|
+
this.api.updateValues({
|
|
27
|
+
[u]: this.selectedUnsubGroup
|
|
28
|
+
});
|
|
28
29
|
}
|
|
29
30
|
_getLabel(t, s = `${Math.random()}`) {
|
|
30
31
|
return `
|
|
@@ -54,7 +55,7 @@ class _ extends p {
|
|
|
54
55
|
</${i.LABEL}>
|
|
55
56
|
|
|
56
57
|
<${i.SELECTPICKER}
|
|
57
|
-
${e.SELECTPICKER.name}="${
|
|
58
|
+
${e.SELECTPICKER.name}="${u}"
|
|
58
59
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
59
60
|
${this._getSelect()}
|
|
60
61
|
</${i.SELECTPICKER}>
|
|
@@ -66,27 +67,27 @@ class _ extends p {
|
|
|
66
67
|
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
|
|
67
68
|
}
|
|
68
69
|
_listenToFormUpdates() {
|
|
69
|
-
this.api.onValueChanged(
|
|
70
|
+
this.api.onValueChanged(u, (t) => this._onSelectChange(t));
|
|
70
71
|
}
|
|
71
72
|
onTemplateNodeUpdated(t) {
|
|
72
|
-
this.currentNode = t;
|
|
73
|
+
this.currentNode = t, this._setFormValues();
|
|
73
74
|
}
|
|
74
75
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
75
76
|
async onRender() {
|
|
76
77
|
const t = await $(
|
|
77
78
|
"/unsubscribe-groups/unsubscribe-list"
|
|
78
|
-
), s = [
|
|
79
|
-
[e.SELECT_ITEM.text]:
|
|
80
|
-
[e.SELECT_ITEM.value]:
|
|
79
|
+
), s = [c, ...t.data], E = s.map((a) => ({
|
|
80
|
+
[e.SELECT_ITEM.text]: a.name,
|
|
81
|
+
[e.SELECT_ITEM.value]: a.sendGridId
|
|
81
82
|
}));
|
|
82
83
|
this.unsubList = s, this.api.setUIEAttribute(
|
|
83
|
-
|
|
84
|
+
u,
|
|
84
85
|
e.SELECTPICKER.items,
|
|
85
|
-
|
|
86
|
+
E
|
|
86
87
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
export {
|
|
90
91
|
m as CONTROL_BLOCK_ID,
|
|
91
|
-
|
|
92
|
+
S as RadioButtonControl
|
|
92
93
|
};
|
|
@@ -5,7 +5,7 @@ const e = {
|
|
|
5
5
|
YES: "Yes",
|
|
6
6
|
NO: "No"
|
|
7
7
|
}, d = `
|
|
8
|
-
<td align="left" class="radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
8
|
+
<td align="left" class="radio-button radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
9
9
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
10
10
|
<tbody>
|
|
11
11
|
<tr>
|
|
@@ -75,12 +75,21 @@ const e = {
|
|
|
75
75
|
</tbody>
|
|
76
76
|
</table>
|
|
77
77
|
</td>
|
|
78
|
-
`,
|
|
79
|
-
<td
|
|
80
|
-
align="left"
|
|
81
|
-
esd-extension-block-id="radio-button-block"
|
|
78
|
+
`, a = `
|
|
79
|
+
<td
|
|
80
|
+
align="left"
|
|
81
|
+
esd-extension-block-id="radio-button-block"
|
|
82
82
|
esd-handler-name="esd-extension-RadioButtonBlock"
|
|
83
|
-
class="
|
|
83
|
+
class="
|
|
84
|
+
radio-button
|
|
85
|
+
radio-button-v2
|
|
86
|
+
esd-block-ra
|
|
87
|
+
esd-radio-button-block
|
|
88
|
+
esd-extension-block
|
|
89
|
+
es-p10t
|
|
90
|
+
es-p10b
|
|
91
|
+
es-p30r
|
|
92
|
+
es-p30l"
|
|
84
93
|
>
|
|
85
94
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
86
95
|
<tbody>
|
|
@@ -140,10 +149,10 @@ const e = {
|
|
|
140
149
|
</table>
|
|
141
150
|
</td>
|
|
142
151
|
`;
|
|
143
|
-
function
|
|
152
|
+
function l() {
|
|
144
153
|
return d.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`).replace("{-{-YES-}-}", `<p path="1">${e.YES}</p>`).replace("{-{-NO-}-}", `<p path="1">${e.NO}</p>`);
|
|
145
154
|
}
|
|
146
155
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
a as default,
|
|
157
|
+
l as getDefaultTemplate
|
|
149
158
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (n, i, e) =>
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var _ = (n, i, e) => i in n ? d(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
|
|
3
|
+
var u = (n, i, e) => _(n, typeof i != "symbol" ? i + "" : i, e);
|
|
4
4
|
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
5
|
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
-
import { Block as
|
|
6
|
+
import { Block as h, BlockCompositionType as S, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
7
|
import { getDefaultTemplate as L } from "./template.js";
|
|
8
8
|
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
|
-
import { parsePageList as
|
|
10
|
-
const
|
|
9
|
+
import { parsePageList as p } from "./utils/utils.js";
|
|
10
|
+
const g = "unsubscribe-block", v = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{ins-unsubscribe-link}}", T = {
|
|
11
11
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
12
12
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
13
13
|
};
|
|
14
|
-
class
|
|
14
|
+
class R extends h {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
u(this, "selectEventListener", null);
|
|
@@ -19,13 +19,13 @@ class D extends S {
|
|
|
19
19
|
u(this, "currentNode");
|
|
20
20
|
}
|
|
21
21
|
getId() {
|
|
22
|
-
return
|
|
22
|
+
return g;
|
|
23
23
|
}
|
|
24
24
|
getIcon() {
|
|
25
25
|
return "unsubscribe-icon";
|
|
26
26
|
}
|
|
27
27
|
getBlockCompositionType() {
|
|
28
|
-
return
|
|
28
|
+
return S.BLOCK;
|
|
29
29
|
}
|
|
30
30
|
getName() {
|
|
31
31
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -36,11 +36,8 @@ class D extends S {
|
|
|
36
36
|
getTemplate() {
|
|
37
37
|
return L();
|
|
38
38
|
}
|
|
39
|
-
onCreated(e) {
|
|
40
|
-
"getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
41
|
-
}
|
|
42
39
|
onSelect(e) {
|
|
43
|
-
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
40
|
+
this.currentNode = e, !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
44
41
|
}
|
|
45
42
|
onDelete(e) {
|
|
46
43
|
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
@@ -50,8 +47,8 @@ class D extends S {
|
|
|
50
47
|
}
|
|
51
48
|
_setupSelectEventListener() {
|
|
52
49
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
53
|
-
const
|
|
54
|
-
this._updateBlock(t,
|
|
50
|
+
const s = e, { collectionType: t, selectedPages: r } = s.detail;
|
|
51
|
+
this._updateBlock(t, r.join(","));
|
|
55
52
|
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
56
53
|
}
|
|
57
54
|
_removeSelectEventListener() {
|
|
@@ -66,38 +63,45 @@ class D extends S {
|
|
|
66
63
|
this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
67
64
|
}
|
|
68
65
|
_handleCancel() {
|
|
69
|
-
|
|
66
|
+
try {
|
|
67
|
+
if (!this.currentNode)
|
|
68
|
+
return;
|
|
69
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
|
|
70
|
+
} catch (e) {
|
|
71
|
+
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
_removeEventListeners() {
|
|
72
75
|
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
73
76
|
}
|
|
74
|
-
_updateBlock(e,
|
|
77
|
+
_updateBlock(e, s) {
|
|
75
78
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
76
79
|
return;
|
|
77
|
-
const t = this.currentNode.querySelector(
|
|
80
|
+
const t = this.currentNode.querySelector(v);
|
|
78
81
|
if (!t)
|
|
79
82
|
return;
|
|
80
|
-
const
|
|
81
|
-
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href",
|
|
83
|
+
const r = this._getMergeTag(e);
|
|
84
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new b(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, s).apply(new b("Updated unsubscribe block metadata"));
|
|
82
85
|
}
|
|
83
86
|
_getMergeTag(e) {
|
|
84
|
-
return
|
|
87
|
+
return T[e] ?? B;
|
|
85
88
|
}
|
|
86
89
|
_openDrawer() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
91
|
+
try {
|
|
92
|
+
const e = c();
|
|
93
|
+
e.typeSelectionDrawerStatus = !0;
|
|
94
|
+
} catch (e) {
|
|
95
|
+
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
96
|
+
}
|
|
93
97
|
}
|
|
94
98
|
_checkExistingBlocks() {
|
|
95
99
|
const e = c();
|
|
96
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(
|
|
100
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(f).forEach((t) => {
|
|
97
101
|
if ("getAttribute" in t) {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
const l = Number(
|
|
102
|
+
const r = t.getAttribute(o.PAGE_TYPE);
|
|
103
|
+
if (r) {
|
|
104
|
+
const l = Number(r);
|
|
101
105
|
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
@@ -106,11 +110,11 @@ class D extends S {
|
|
|
106
110
|
_loadBlockState(e) {
|
|
107
111
|
if (!("getAttribute" in e))
|
|
108
112
|
return;
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
113
|
+
const s = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
114
|
+
if (!s || !t)
|
|
111
115
|
return;
|
|
112
|
-
const
|
|
113
|
-
|
|
116
|
+
const r = c(), l = Number(s), m = p(t);
|
|
117
|
+
r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(m);
|
|
114
118
|
}
|
|
115
119
|
_resetStoreState() {
|
|
116
120
|
c().$reset();
|
|
@@ -118,14 +122,14 @@ class D extends S {
|
|
|
118
122
|
_removeBlockTemplatesFromStore(e) {
|
|
119
123
|
if (!("getAttribute" in e))
|
|
120
124
|
return;
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
125
|
+
const s = e.getAttribute(o.PAGE_LIST);
|
|
126
|
+
if (!s)
|
|
123
127
|
return;
|
|
124
|
-
const t = c(),
|
|
125
|
-
t.removeUnsubscribePages(
|
|
128
|
+
const t = c(), r = p(s);
|
|
129
|
+
t.removeUnsubscribePages(r);
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
g as UNSUBSCRIBE_BLOCK_ID,
|
|
134
|
+
R as UnsubscribeBlock
|
|
131
135
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-98181b5a]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-98181b5a]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-98181b5a]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import p from "./_MapCache.js";
|
|
2
|
+
import h from "./_setCacheAdd.js";
|
|
3
|
+
import r from "./_setCacheHas.js";
|
|
4
|
+
function e(t) {
|
|
5
|
+
var o = -1, a = t == null ? 0 : t.length;
|
|
6
|
+
for (this.__data__ = new p(); ++o < a; )
|
|
7
|
+
this.add(t[o]);
|
|
8
|
+
}
|
|
9
|
+
e.prototype.add = e.prototype.push = h;
|
|
10
|
+
e.prototype.has = r;
|
|
11
|
+
export {
|
|
12
|
+
e as default
|
|
13
|
+
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./_baseTimes.js";
|
|
2
2
|
import g from "./isArguments.js";
|
|
3
3
|
import h from "./isArray.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import b from "./isBuffer.js";
|
|
5
|
+
import A from "./_isIndex.js";
|
|
6
|
+
import c from "./isTypedArray.js";
|
|
7
|
+
var d = Object.prototype, O = d.hasOwnProperty;
|
|
8
|
+
function l(t, p) {
|
|
9
|
+
var o = h(t), i = !o && g(t), s = !o && !i && b(t), e = !o && !i && !s && c(t), n = o || i || s || e, f = n ? a(t.length, String) : [], m = f.length;
|
|
10
|
+
for (var r in t)
|
|
11
|
+
(p || O.call(t, r)) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
11
12
|
(r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
12
13
|
s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return
|
|
14
|
+
e && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
|
|
15
|
+
A(r, m))) && f.push(r);
|
|
16
|
+
return f;
|
|
16
17
|
}
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
l as default
|
|
19
20
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import a from "./_arrayPush.js";
|
|
2
|
+
import e from "./_isFlattenable.js";
|
|
3
|
+
function l(h, m, t, g, n) {
|
|
4
|
+
var o = -1, f = h.length;
|
|
5
|
+
for (t || (t = e), n || (n = []); ++o < f; ) {
|
|
6
|
+
var i = h[o];
|
|
7
|
+
t(i) ? a(n, i) : n[n.length] = i;
|
|
8
|
+
}
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
l as default
|
|
13
|
+
};
|