@useinsider/guido 1.0.3-beta.52ded25 → 1.0.3-beta.538b804
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 -3
- 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/useStripo.js +25 -29
- package/dist/extensions/Blocks/Checkbox/control.js +14 -15
- package/dist/extensions/Blocks/Checkbox/template.js +9 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +2 -2
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +66 -57
- package/dist/extensions/Blocks/Items/settingsPanel.js +29 -28
- package/dist/extensions/Blocks/RadioButton/control.js +17 -18
- package/dist/extensions/Blocks/RadioButton/template.js +9 -18
- package/dist/guido.css +1 -1
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +2 -1
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -600,9 +600,6 @@ Create a `.env` file with the following variables: (You can get env variables fr
|
|
|
600
600
|
VITE_STRIPO_PLUGIN_ID=your_plugin_id
|
|
601
601
|
VITE_STRIPO_SECRET_KEY=your_secret_key
|
|
602
602
|
VITE_STRIPO_ROLE=your_role
|
|
603
|
-
|
|
604
|
-
# Playwright Test Configuration (Optional - for local debugging only)
|
|
605
|
-
HEADED=false # Set to 'true' to run tests with visible browser
|
|
606
603
|
```
|
|
607
604
|
|
|
608
605
|
### Project Structure
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as
|
|
1
|
+
import { defineComponent as H, ref as p, computed as _ } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
|
10
10
|
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
|
-
setup(k, { expose:
|
|
14
|
-
const { config:
|
|
15
|
-
if (
|
|
13
|
+
setup(k, { expose: m }) {
|
|
14
|
+
const { config: c } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), t = C(), o = T(), e = p(!1), s = p(!1), u = x(), f = () => {
|
|
15
|
+
if (t.isVersionHistoryOpen) {
|
|
16
16
|
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
i();
|
|
20
|
-
},
|
|
20
|
+
}, v = async () => {
|
|
21
21
|
e.value = !0, await r(), e.value = !1;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
s.value = !0,
|
|
26
|
-
const g = await n(
|
|
27
|
-
return s.value = !1,
|
|
22
|
+
}, d = () => {
|
|
23
|
+
t.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
+
}, y = _(() => t.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), l = async (S) => {
|
|
25
|
+
s.value = !0, t.loadingStatus = !0;
|
|
26
|
+
const g = await n(S);
|
|
27
|
+
return s.value = !1, t.loadingStatus = !1, g;
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return m({
|
|
30
30
|
handleSave: l
|
|
31
|
-
}), { __sfc: !0, config:
|
|
31
|
+
}), { __sfc: !0, config: c, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: t, trans: o, isExporting: e, isSaving: s, testEmailClick: u, handleVersionHistory: f, handleExport: v, handleSaveAs: d, versionHistoryTooltipText: y, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as h } from "./useActionsApi.js";
|
|
2
2
|
import { useBlocksConfig as b } from "./useBlocksConfig.js";
|
|
3
3
|
import { useConfig as k } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
|
|
6
6
|
import { useToaster as B } from "./useToaster.js";
|
|
7
|
-
import { displayConditions as
|
|
8
|
-
import { useStripoApi as
|
|
9
|
-
import
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { dynamicContentToMergeTags as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts:
|
|
7
|
+
import { displayConditions as A } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as F } from "../services/stripoApi.js";
|
|
9
|
+
import T from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as v } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as I } from "../utils/genericUtil.js";
|
|
12
|
+
import M from "../package.json.js";
|
|
13
|
+
const N = (d) => {
|
|
14
|
+
const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: S } = F(), { handleEvent: C } = _(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
|
|
15
15
|
var m, g;
|
|
16
|
-
const t =
|
|
16
|
+
const t = v(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: c } = await y();
|
|
17
17
|
window.UIEditor.initEditor(
|
|
18
18
|
document.querySelector("#guido-editor"),
|
|
19
19
|
{
|
|
20
|
-
metadata:
|
|
20
|
+
metadata: d,
|
|
21
21
|
html: n,
|
|
22
22
|
css: p,
|
|
23
23
|
forceRecreate: a,
|
|
@@ -30,16 +30,12 @@ const J = (c) => {
|
|
|
30
30
|
customAppearanceMergetags: !0,
|
|
31
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
33
|
+
customViewStyles: T,
|
|
34
34
|
conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
|
|
35
35
|
customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
|
|
36
|
-
conditionCategories:
|
|
36
|
+
conditionCategories: A,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
|
-
messageSettingsEnabled: !
|
|
39
|
-
displayGmailAnnotations: !0,
|
|
40
|
-
displayHiddenPreheader: !1,
|
|
41
|
-
displayTitle: !1,
|
|
42
|
-
displayUTM: !1,
|
|
38
|
+
messageSettingsEnabled: !1,
|
|
43
39
|
selectElementAfterDrop: !0,
|
|
44
40
|
...e ? { baseBlocks: e } : {},
|
|
45
41
|
editorFonts: {
|
|
@@ -49,7 +45,7 @@ const J = (c) => {
|
|
|
49
45
|
},
|
|
50
46
|
mergeTags: [
|
|
51
47
|
{
|
|
52
|
-
entries:
|
|
48
|
+
entries: I(d.preselectedDynamicContentList)
|
|
53
49
|
}
|
|
54
50
|
],
|
|
55
51
|
async onTokenRefreshRequest(o) {
|
|
@@ -62,8 +58,8 @@ const J = (c) => {
|
|
|
62
58
|
},
|
|
63
59
|
onTemplateLoaded() {
|
|
64
60
|
try {
|
|
65
|
-
const { importCss: o } = V(), { activateCustomViewStyles: s } =
|
|
66
|
-
o(), s(),
|
|
61
|
+
const { importCss: o } = V(), { activateCustomViewStyles: s } = h();
|
|
62
|
+
o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
67
63
|
t.hasChanges = !1;
|
|
68
64
|
}, 1e3);
|
|
69
65
|
} catch (o) {
|
|
@@ -82,22 +78,22 @@ const J = (c) => {
|
|
|
82
78
|
onDataChanged() {
|
|
83
79
|
t.hasChanges = !0;
|
|
84
80
|
},
|
|
85
|
-
onEvent:
|
|
81
|
+
onEvent: C,
|
|
86
82
|
ignoreClickOutsideSelectors: [
|
|
87
83
|
"#guido-dynamic-content-modal",
|
|
88
84
|
".in-on-board-wrapper",
|
|
89
85
|
".in-drawer__container"
|
|
90
86
|
],
|
|
91
|
-
extensions:
|
|
87
|
+
extensions: c
|
|
92
88
|
}
|
|
93
89
|
);
|
|
94
|
-
},
|
|
95
|
-
var
|
|
90
|
+
}, w = (i) => new Promise((r, t) => {
|
|
91
|
+
var c;
|
|
96
92
|
if (document.getElementById("UiEditorScript")) {
|
|
97
93
|
i(), r();
|
|
98
94
|
return;
|
|
99
95
|
}
|
|
100
|
-
const n =
|
|
96
|
+
const n = M.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
|
|
101
97
|
e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
|
|
102
98
|
i(), r();
|
|
103
99
|
}, e.onerror = () => {
|
|
@@ -105,12 +101,12 @@ const J = (c) => {
|
|
|
105
101
|
}, document.body.appendChild(e);
|
|
106
102
|
});
|
|
107
103
|
return { initPlugin: async (i) => {
|
|
108
|
-
await
|
|
109
|
-
const r = await
|
|
104
|
+
await w(async () => {
|
|
105
|
+
const r = await S();
|
|
110
106
|
await E(i, r);
|
|
111
107
|
});
|
|
112
108
|
} };
|
|
113
109
|
};
|
|
114
110
|
export {
|
|
115
|
-
|
|
111
|
+
N as useStripo
|
|
116
112
|
};
|
|
@@ -2,9 +2,9 @@ var d = Object.defineProperty;
|
|
|
2
2
|
var l = (r, n, e) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
|
|
3
3
|
var o = (r, n, e) => l(r, typeof n != "symbol" ? n + "" : n, e);
|
|
4
4
|
import { useHttp as L } from "../../../composables/useHttp.js";
|
|
5
|
-
import { DEFAULT_UNSUBSCRIBE_GROUP as
|
|
5
|
+
import { DEFAULT_UNSUBSCRIBE_GROUP as u } from "../../../enums/unsubscribe.js";
|
|
6
6
|
import { Control as h, UIElementType as i, UEAttr as t, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
const m = "ui-elements-checkbox",
|
|
7
|
+
const m = "ui-elements-checkbox", a = "select", { get: C } = L();
|
|
8
8
|
class S extends h {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -16,16 +16,15 @@ class S extends h {
|
|
|
16
16
|
return m;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
|
-
if (this.
|
|
19
|
+
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const e = this.currentNode.getAttribute("id");
|
|
21
21
|
if (e) {
|
|
22
|
-
const s = e ===
|
|
23
|
-
s && (this.selectedUnsubGroup = s
|
|
22
|
+
const s = e === u.sendGridId ? e : Number(e);
|
|
23
|
+
s && (this.selectedUnsubGroup = s, this.api.updateValues({
|
|
24
|
+
[a]: this.selectedUnsubGroup
|
|
25
|
+
}));
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
|
-
this.api.updateValues({
|
|
27
|
-
[u]: this.selectedUnsubGroup
|
|
28
|
-
});
|
|
29
28
|
}
|
|
30
29
|
_getLabel(e, s = `${Math.random()}`) {
|
|
31
30
|
return `
|
|
@@ -55,7 +54,7 @@ class S extends h {
|
|
|
55
54
|
</${i.LABEL}>
|
|
56
55
|
|
|
57
56
|
<${i.SELECTPICKER}
|
|
58
|
-
${t.SELECTPICKER.name}="${
|
|
57
|
+
${t.SELECTPICKER.name}="${a}"
|
|
59
58
|
${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
60
59
|
${this._getSelect()}
|
|
61
60
|
</${i.SELECTPICKER}>
|
|
@@ -67,21 +66,21 @@ class S extends h {
|
|
|
67
66
|
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
|
|
68
67
|
}
|
|
69
68
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
69
|
+
this.api.onValueChanged(a, (e) => this._onSelectChange(e));
|
|
71
70
|
}
|
|
72
71
|
onTemplateNodeUpdated(e) {
|
|
73
|
-
this.currentNode = e
|
|
72
|
+
this.currentNode = e;
|
|
74
73
|
}
|
|
75
74
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
75
|
async onRender() {
|
|
77
76
|
const e = await C(
|
|
78
77
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s = [
|
|
80
|
-
[t.SELECT_ITEM.text]:
|
|
81
|
-
[t.SELECT_ITEM.value]:
|
|
78
|
+
), s = [u, ...e.data], E = s.map((c) => ({
|
|
79
|
+
[t.SELECT_ITEM.text]: c.name,
|
|
80
|
+
[t.SELECT_ITEM.value]: c.sendGridId
|
|
82
81
|
}));
|
|
83
82
|
this.unsubList = s, this.api.setUIEAttribute(
|
|
84
|
-
|
|
83
|
+
a,
|
|
85
84
|
t.SELECTPICKER.items,
|
|
86
85
|
E
|
|
87
86
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
@@ -3,7 +3,7 @@ const e = {
|
|
|
3
3
|
TITLE: "Unsubscribe From All Email Lists",
|
|
4
4
|
DESCRIPTION: "You will still receive important transactional and billing-related emails."
|
|
5
5
|
}, l = `
|
|
6
|
-
<td align="left" class="checkbox-block
|
|
6
|
+
<td align="left" class="checkbox-block-v2 esd-block-checkbox es-p20">
|
|
7
7
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
8
8
|
<tbody>
|
|
9
9
|
<tr>
|
|
@@ -26,16 +26,11 @@ const e = {
|
|
|
26
26
|
</tbody>
|
|
27
27
|
</table>
|
|
28
28
|
</td>
|
|
29
|
-
`,
|
|
30
|
-
<td
|
|
31
|
-
align="left"
|
|
32
|
-
esd-extension-block-id="checkbox-block"
|
|
33
|
-
class="
|
|
34
|
-
checkbox-block
|
|
35
|
-
checkbox-block-v2
|
|
36
|
-
esd-block-checkbox
|
|
37
|
-
esd-checkbox-block
|
|
38
|
-
esd-extension-block es-p20"
|
|
29
|
+
`, i = `
|
|
30
|
+
<td
|
|
31
|
+
align="left"
|
|
32
|
+
esd-extension-block-id="checkbox-block"
|
|
33
|
+
class="checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20"
|
|
39
34
|
>
|
|
40
35
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
41
36
|
<tbody>
|
|
@@ -60,10 +55,10 @@ const e = {
|
|
|
60
55
|
</table>
|
|
61
56
|
</td>
|
|
62
57
|
`;
|
|
63
|
-
function
|
|
58
|
+
function c() {
|
|
64
59
|
return l.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`);
|
|
65
60
|
}
|
|
66
61
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
i as default,
|
|
63
|
+
c as getDefaultTemplate
|
|
69
64
|
};
|
|
@@ -44,11 +44,11 @@ class R extends c {
|
|
|
44
44
|
}
|
|
45
45
|
_applyTrimmingStyles(e) {
|
|
46
46
|
var m;
|
|
47
|
-
const o = (m = this.currentNode) == null ? void 0 : m.querySelector("p
|
|
47
|
+
const o = (m = this.currentNode) == null ? void 0 : m.querySelector("p");
|
|
48
48
|
if (!o)
|
|
49
49
|
return;
|
|
50
50
|
const p = e !== void 0 ? e : this.store.nameTrimming, T = this.store.orientation === I.ORIENTATION.VERTICAL;
|
|
51
|
-
p ? this.api.getDocumentModifier().modifyHtml(o).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", T ? "130px" : "
|
|
51
|
+
p ? this.api.getDocumentModifier().modifyHtml(o).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", T ? "130px" : "600px").apply(new n("Text Trimming Enabled")) : this.api.getDocumentModifier().modifyHtml(o).removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow").removeStyle("max-width").apply(new n("Text Trimming Disabled"));
|
|
52
52
|
}
|
|
53
53
|
_getTextTrimming() {
|
|
54
54
|
return `
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UEAttr as
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var P = (T, u, e) => u in T ? M(T, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[u] = e;
|
|
3
|
+
var b = (T, u, e) => P(T, typeof u != "symbol" ? u + "" : u, e);
|
|
4
|
+
import { UEAttr as C, ModificationDescription as d } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as D } from "../../common-control.js";
|
|
6
6
|
import { ItemsBlockId as m } from "../enums/controlEnums.js";
|
|
7
7
|
import { productPairs as p, templateFirstLine as A } from "../enums/productEnums.js";
|
|
8
|
-
import { ItemTypeOptions as R, OrientationOptions as
|
|
9
|
-
import
|
|
8
|
+
import { ItemTypeOptions as R, OrientationOptions as x, ItemInCartOptions as g, SETTINGS_ENUMS as S } from "../enums/settingsEnums.js";
|
|
9
|
+
import L from "../layouts/horizontal.html.js";
|
|
10
10
|
import H from "../layouts/vertical.html.js";
|
|
11
11
|
import { useItemsBlockStore as U } from "../store/items-block.js";
|
|
12
12
|
import { getDefaultTemplate as F } from "../template.js";
|
|
13
13
|
import { syncCurrencySymbolFromAttributes as $, syncCurrencyLocationFromAttributes as k, syncFormattedPriceFromAttributes as q } from "../utils/syncAttributesFromConfigBlock.js";
|
|
14
14
|
import { updateConfigBlockAttributes as f } from "../utils/updateAttributes.js";
|
|
15
|
-
const w = "ui-elements-items-block",
|
|
15
|
+
const w = "ui-elements-items-block", s = {
|
|
16
16
|
ITEMS_TYPE: "itemsType",
|
|
17
17
|
ORIENTATION: "orientation",
|
|
18
18
|
ITEM_IDS: "itemIds"
|
|
@@ -20,7 +20,7 @@ const w = "ui-elements-items-block", o = {
|
|
|
20
20
|
class Z extends D {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
-
|
|
23
|
+
b(this, "store", U());
|
|
24
24
|
}
|
|
25
25
|
getId() {
|
|
26
26
|
return w;
|
|
@@ -36,9 +36,9 @@ class Z extends D {
|
|
|
36
36
|
}
|
|
37
37
|
onRender() {
|
|
38
38
|
this.api.updateValues({
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
39
|
+
[s.ORIENTATION]: this.store.orientation,
|
|
40
|
+
[s.ITEMS_TYPE]: this.store.itemsType,
|
|
41
|
+
[s.ITEM_IDS]: this.store.itemIds
|
|
42
42
|
}), this._listenToFormUpdates();
|
|
43
43
|
}
|
|
44
44
|
onTemplateNodeUpdated(e) {
|
|
@@ -48,9 +48,9 @@ class Z extends D {
|
|
|
48
48
|
},
|
|
49
49
|
() => {
|
|
50
50
|
this.api.updateValues({
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
51
|
+
[s.ORIENTATION]: this.store.orientation,
|
|
52
|
+
[s.ITEMS_TYPE]: this.store.itemsType,
|
|
53
|
+
[s.ITEM_IDS]: this.store.itemIds
|
|
54
54
|
}), this._initializeSelectItems();
|
|
55
55
|
}
|
|
56
56
|
);
|
|
@@ -64,7 +64,7 @@ class Z extends D {
|
|
|
64
64
|
${this._GuOneColumn([
|
|
65
65
|
this._GuLabel({ text: "Item Type" }),
|
|
66
66
|
this._GuSelect({
|
|
67
|
-
name:
|
|
67
|
+
name: s.ITEMS_TYPE,
|
|
68
68
|
className: "es-100",
|
|
69
69
|
placeholder: "Select Item Type",
|
|
70
70
|
options: R
|
|
@@ -77,8 +77,8 @@ class Z extends D {
|
|
|
77
77
|
${this._GuTwoColumns([
|
|
78
78
|
this._GuLabel({ text: "Orientation" }),
|
|
79
79
|
this._GuRadioButton({
|
|
80
|
-
name:
|
|
81
|
-
buttons:
|
|
80
|
+
name: s.ORIENTATION,
|
|
81
|
+
buttons: x
|
|
82
82
|
})
|
|
83
83
|
])}
|
|
84
84
|
`;
|
|
@@ -88,7 +88,7 @@ class Z extends D {
|
|
|
88
88
|
${this._GuTwoColumns([
|
|
89
89
|
this._GuLabel({ text: "Item in Cart" }),
|
|
90
90
|
this._GuSelect({
|
|
91
|
-
name:
|
|
91
|
+
name: s.ITEM_IDS,
|
|
92
92
|
className: "es-100",
|
|
93
93
|
placeholder: "Select Item In Cart",
|
|
94
94
|
options: []
|
|
@@ -97,43 +97,43 @@ class Z extends D {
|
|
|
97
97
|
`;
|
|
98
98
|
}
|
|
99
99
|
_onOrientationChange(e) {
|
|
100
|
-
console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [
|
|
100
|
+
console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), this._recalculateTrimming();
|
|
101
101
|
}
|
|
102
|
-
_onItemsTypeChange(e) {
|
|
103
|
-
const
|
|
104
|
-
|
|
102
|
+
_onItemsTypeChange(e, i) {
|
|
103
|
+
const { itemIds: t } = this.store, r = S.ITEMS_TYPE[e], n = g[i].findIndex((a) => a.value === t), o = g[e][n];
|
|
104
|
+
r && (this.store.setItemsType(r), this.store.setItemIds(o.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(r), this._initializeSelectItems(), this._reFillTemplate());
|
|
105
105
|
}
|
|
106
106
|
_onItemIdsChange(e) {
|
|
107
|
-
console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [
|
|
107
|
+
console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [s.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
|
|
108
108
|
}
|
|
109
109
|
_initializeSelectItems() {
|
|
110
110
|
this.api.setUIEAttribute(
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
s.ITEMS_TYPE,
|
|
112
|
+
C.SELECTPICKER.items,
|
|
113
113
|
R
|
|
114
114
|
);
|
|
115
115
|
const { itemsType: e, itemIds: i } = this.store;
|
|
116
116
|
this.api.updateValues({
|
|
117
|
-
[
|
|
117
|
+
[s.ITEMS_TYPE]: e
|
|
118
118
|
});
|
|
119
|
-
const t =
|
|
119
|
+
const t = g[e];
|
|
120
120
|
this.api.setUIEAttribute(
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
s.ITEM_IDS,
|
|
122
|
+
C.SELECTPICKER.items,
|
|
123
123
|
t
|
|
124
124
|
), this.api.updateValues({
|
|
125
|
-
[
|
|
125
|
+
[s.ITEM_IDS]: i
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
_listenToFormUpdates() {
|
|
129
129
|
this.api.onValueChanged(
|
|
130
|
-
|
|
131
|
-
(e) => this._onItemsTypeChange(e)
|
|
130
|
+
s.ITEMS_TYPE,
|
|
131
|
+
(e, i) => this._onItemsTypeChange(e, i)
|
|
132
132
|
), this.api.onValueChanged(
|
|
133
|
-
|
|
133
|
+
s.ORIENTATION,
|
|
134
134
|
(e) => this._onOrientationChange(e)
|
|
135
135
|
), this.api.onValueChanged(
|
|
136
|
-
|
|
136
|
+
s.ITEM_IDS,
|
|
137
137
|
(e) => this._onItemIdsChange(e)
|
|
138
138
|
);
|
|
139
139
|
}
|
|
@@ -144,7 +144,7 @@ class Z extends D {
|
|
|
144
144
|
itemIds: t,
|
|
145
145
|
currencySymbol: r,
|
|
146
146
|
currencyLocation: n,
|
|
147
|
-
formattedPrice:
|
|
147
|
+
formattedPrice: o
|
|
148
148
|
} = this.store;
|
|
149
149
|
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(F({
|
|
150
150
|
orientation: e,
|
|
@@ -152,11 +152,11 @@ class Z extends D {
|
|
|
152
152
|
itemId: t,
|
|
153
153
|
currencySymbol: r,
|
|
154
154
|
currencyLocation: n,
|
|
155
|
-
formattedPrice:
|
|
155
|
+
formattedPrice: o
|
|
156
156
|
})).apply(new d("Updated template"));
|
|
157
157
|
}
|
|
158
158
|
_getTemplateData() {
|
|
159
|
-
const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r =
|
|
159
|
+
const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = g[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
|
|
160
160
|
return {
|
|
161
161
|
imageSrc: p.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
|
|
162
162
|
name: p.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
|
|
@@ -188,7 +188,7 @@ class Z extends D {
|
|
|
188
188
|
const t = this._getParagraphFromBlock(i);
|
|
189
189
|
if (!t)
|
|
190
190
|
return;
|
|
191
|
-
const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol:
|
|
191
|
+
const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, l = (o == null ? void 0 : o.trim()) || "", c = this._removeCurrencySymbol(n, l), I = this._replacePriceNumber(c, e), h = this._buildPriceContent(I, l, a), _ = r.replace(n, h);
|
|
192
192
|
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(_).apply(new d("Updated price"));
|
|
193
193
|
}
|
|
194
194
|
_updateOriginalPrice(e) {
|
|
@@ -204,8 +204,8 @@ class Z extends D {
|
|
|
204
204
|
const r = t.querySelector("s");
|
|
205
205
|
if (!r)
|
|
206
206
|
return;
|
|
207
|
-
const n = r.getInnerHTML() || "",
|
|
208
|
-
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(
|
|
207
|
+
const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: l } = this.store, c = (a == null ? void 0 : a.trim()) || "", I = this._removeCurrencySymbol(o, c), h = this._replacePriceNumber(I, e), _ = this._buildPriceContent(h, c, l), N = `<s>${n.replace(o, _)}</s>`;
|
|
208
|
+
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(N).apply(new d("Updated original price"));
|
|
209
209
|
}
|
|
210
210
|
_updateQuantity(e) {
|
|
211
211
|
var a;
|
|
@@ -213,37 +213,46 @@ class Z extends D {
|
|
|
213
213
|
if (!t)
|
|
214
214
|
return;
|
|
215
215
|
const r = t.getStyle("display") === "none", n = t.getInnerText().trim();
|
|
216
|
-
let
|
|
217
|
-
|
|
216
|
+
let o = t.getInnerHTML();
|
|
217
|
+
o = o.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(o).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
|
|
218
|
+
}
|
|
219
|
+
_updateButton(e) {
|
|
220
|
+
var n;
|
|
221
|
+
const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`);
|
|
222
|
+
if (!i)
|
|
223
|
+
return;
|
|
224
|
+
const t = i.getInnerText().trim();
|
|
225
|
+
let r = i.getInnerHTML();
|
|
226
|
+
r = r.replace(t, e), this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(r).apply(new d("Updated button"));
|
|
218
227
|
}
|
|
219
228
|
/**
|
|
220
229
|
* @todo Optimize template reordering for performance.
|
|
221
230
|
* @description Reorders the template structure based on current orientation and visibility settings.
|
|
222
231
|
*/
|
|
223
232
|
_reOrderTemplate() {
|
|
224
|
-
var
|
|
225
|
-
const e = (
|
|
233
|
+
var I, h, _, E, N, y, O;
|
|
234
|
+
const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), i = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${m.NAME}"]`), t = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(
|
|
226
235
|
`[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
|
|
227
|
-
), n = (
|
|
228
|
-
if (!e || !i || !t || !r || !n || !
|
|
236
|
+
), n = (N = this.currentNode) == null ? void 0 : N.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), o = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`), a = (O = this.currentNode) == null ? void 0 : O.querySelector("esd-config-block");
|
|
237
|
+
if (!e || !i || !t || !r || !n || !o || !a)
|
|
229
238
|
return;
|
|
230
239
|
const { orientation: l } = this.store;
|
|
231
|
-
let c = l === S.ORIENTATION.VERTICAL ? H :
|
|
232
|
-
c = c.replace("{-{-TEMPLATE_FIRST_LINE-}-}", A).replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}",
|
|
240
|
+
let c = l === S.ORIENTATION.VERTICAL ? H : L;
|
|
241
|
+
c = c.replace("{-{-TEMPLATE_FIRST_LINE-}-}", A).replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), c = c.trim().replace(A, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(c).apply(new d("Reordered template"));
|
|
233
242
|
}
|
|
234
243
|
_updateDataTypeAttributes(e) {
|
|
235
244
|
if (!this.currentNode)
|
|
236
245
|
return;
|
|
237
246
|
const i = this.currentNode.closest(".ins-product-td"), t = this.api.getDocumentModifier();
|
|
238
247
|
i && t.modifyHtml(i).setAttribute("data-type", e), this.currentNode.querySelectorAll("[data-type]").forEach((n) => {
|
|
239
|
-
const
|
|
240
|
-
t.modifyHtml(
|
|
248
|
+
const o = n;
|
|
249
|
+
t.modifyHtml(o).setAttribute("data-type", e);
|
|
241
250
|
}), t.apply(new d("Updated data-type attribute"));
|
|
242
251
|
}
|
|
243
252
|
_updateDataNumberAttributes(e) {
|
|
244
253
|
if (!this.currentNode)
|
|
245
254
|
return;
|
|
246
|
-
const { itemsType: i } = this.store, t =
|
|
255
|
+
const { itemsType: i } = this.store, t = g[i].findIndex((l) => l.value === e);
|
|
247
256
|
let r = "1";
|
|
248
257
|
if (t >= 0)
|
|
249
258
|
r = String(t + 1);
|
|
@@ -254,15 +263,15 @@ class Z extends D {
|
|
|
254
263
|
r = c;
|
|
255
264
|
}
|
|
256
265
|
}
|
|
257
|
-
const n = this.currentNode.closest(".ins-product-td"),
|
|
258
|
-
n &&
|
|
266
|
+
const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
|
|
267
|
+
n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((l) => {
|
|
259
268
|
const c = l;
|
|
260
|
-
|
|
261
|
-
}),
|
|
269
|
+
o.modifyHtml(c).setAttribute("data-number", r);
|
|
270
|
+
}), o.apply(new d("Updated data-number attribute"));
|
|
262
271
|
}
|
|
263
272
|
_reFillTemplate() {
|
|
264
273
|
const e = this._getTemplateData();
|
|
265
|
-
this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity);
|
|
274
|
+
this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity), this._updateButton(e.button);
|
|
266
275
|
}
|
|
267
276
|
_recalculateTrimming() {
|
|
268
277
|
var r;
|
|
@@ -292,7 +301,7 @@ class Z extends D {
|
|
|
292
301
|
} else {
|
|
293
302
|
const n = t.match(/([^0-9.,\s]+)/);
|
|
294
303
|
if (n && n[1]) {
|
|
295
|
-
const
|
|
304
|
+
const o = n[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(o)}\\s*`);
|
|
296
305
|
r = t.replace(a, "").trim();
|
|
297
306
|
}
|
|
298
307
|
}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as
|
|
2
|
-
import { BLOCK_ID as
|
|
3
|
-
import { COMPOSITION_CONTROL_BLOCK_ID as
|
|
4
|
-
import { CONTROL_BLOCK_ID as
|
|
1
|
+
import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as N, ContainerControls as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as R } from "./block.js";
|
|
3
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as A } from "./controls/cardComposition.js";
|
|
4
|
+
import { CONTROL_BLOCK_ID as L } from "./controls/settingsControl.js";
|
|
5
5
|
import { ItemsBlockId as E, ItemsBlockControlId as I } from "./enums/controlEnums.js";
|
|
6
|
-
class
|
|
7
|
-
registerBlockControls(
|
|
8
|
-
|
|
6
|
+
class n extends O {
|
|
7
|
+
registerBlockControls(_) {
|
|
8
|
+
_[R] = [
|
|
9
9
|
new T(
|
|
10
|
-
|
|
10
|
+
N.SETTINGS,
|
|
11
11
|
[
|
|
12
|
-
|
|
12
|
+
L,
|
|
13
|
+
S.EXTERNAL_INDENTS
|
|
13
14
|
]
|
|
14
15
|
),
|
|
15
16
|
new T(
|
|
16
17
|
"Card Composition",
|
|
17
18
|
[
|
|
18
|
-
|
|
19
|
+
A
|
|
19
20
|
]
|
|
20
21
|
).withLabel("Card Composition")
|
|
21
|
-
],
|
|
22
|
+
], _[E.ORIGINAL_PRICE] = [
|
|
22
23
|
new T(
|
|
23
|
-
|
|
24
|
+
N.SETTINGS,
|
|
24
25
|
[
|
|
25
26
|
I.ORIGINAL_PRICE_STYLE,
|
|
26
27
|
I.ORIGINAL_PRICE_ALIGN,
|
|
@@ -28,16 +29,16 @@ class U extends O {
|
|
|
28
29
|
]
|
|
29
30
|
),
|
|
30
31
|
new T(
|
|
31
|
-
|
|
32
|
+
N.STYLES,
|
|
32
33
|
[
|
|
33
34
|
I.ORIGINAL_PRICE_COLOR,
|
|
34
35
|
I.ORIGINAL_PRICE_FONT_FAMILY,
|
|
35
36
|
I.ORIGINAL_PRICE_SIZE
|
|
36
37
|
]
|
|
37
38
|
)
|
|
38
|
-
],
|
|
39
|
+
], _[E.PRICE] = [
|
|
39
40
|
new T(
|
|
40
|
-
|
|
41
|
+
N.SETTINGS,
|
|
41
42
|
[
|
|
42
43
|
I.PRICE_STYLE,
|
|
43
44
|
I.PRICE_ALIGN,
|
|
@@ -49,16 +50,16 @@ class U extends O {
|
|
|
49
50
|
]
|
|
50
51
|
),
|
|
51
52
|
new T(
|
|
52
|
-
|
|
53
|
+
N.STYLES,
|
|
53
54
|
[
|
|
54
55
|
I.PRICE_COLOR,
|
|
55
56
|
I.PRICE_FONT_FAMILY,
|
|
56
57
|
I.PRICE_SIZE
|
|
57
58
|
]
|
|
58
59
|
)
|
|
59
|
-
],
|
|
60
|
+
], _[E.NAME] = [
|
|
60
61
|
new T(
|
|
61
|
-
|
|
62
|
+
N.SETTINGS,
|
|
62
63
|
[
|
|
63
64
|
I.NAME_STYLE,
|
|
64
65
|
I.NAME_ALIGN,
|
|
@@ -67,23 +68,23 @@ class U extends O {
|
|
|
67
68
|
]
|
|
68
69
|
),
|
|
69
70
|
new T(
|
|
70
|
-
|
|
71
|
+
N.STYLES,
|
|
71
72
|
[
|
|
72
73
|
I.NAME_FONT_FAMILY,
|
|
73
74
|
I.NAME_SIZE,
|
|
74
75
|
I.NAME_COLOR
|
|
75
76
|
]
|
|
76
77
|
)
|
|
77
|
-
],
|
|
78
|
+
], _[E.QUANTITY] = [
|
|
78
79
|
new T(
|
|
79
|
-
|
|
80
|
+
N.SETTINGS,
|
|
80
81
|
[
|
|
81
82
|
I.QUANTITY_FONT_FAMILY,
|
|
82
83
|
I.QUANTITY_STYLE
|
|
83
84
|
]
|
|
84
85
|
),
|
|
85
86
|
new T(
|
|
86
|
-
|
|
87
|
+
N.STYLES,
|
|
87
88
|
[
|
|
88
89
|
I.QUANTITY_ALIGN,
|
|
89
90
|
I.QUANTITY_SIZE,
|
|
@@ -91,18 +92,18 @@ class U extends O {
|
|
|
91
92
|
I.QUANTITY_PADDINGS
|
|
92
93
|
]
|
|
93
94
|
)
|
|
94
|
-
],
|
|
95
|
+
], _[E.IMAGE] = [
|
|
95
96
|
new T(
|
|
96
|
-
|
|
97
|
+
N.SETTINGS,
|
|
97
98
|
[
|
|
98
99
|
I.IMAGE_LINK,
|
|
99
100
|
I.IMAGE_SIZE,
|
|
100
101
|
I.IMAGE_MARGINS
|
|
101
102
|
]
|
|
102
103
|
)
|
|
103
|
-
],
|
|
104
|
+
], _[E.BUTTON] = [
|
|
104
105
|
new T(
|
|
105
|
-
|
|
106
|
+
N.SETTINGS,
|
|
106
107
|
[
|
|
107
108
|
I.BUTTON_LINK,
|
|
108
109
|
I.BUTTON_TEXT,
|
|
@@ -112,7 +113,7 @@ class U extends O {
|
|
|
112
113
|
]
|
|
113
114
|
),
|
|
114
115
|
new T(
|
|
115
|
-
|
|
116
|
+
N.STYLES,
|
|
116
117
|
[
|
|
117
118
|
I.BUTTON_COLOR,
|
|
118
119
|
I.BUTTON_FONT_FAMILY,
|
|
@@ -127,5 +128,5 @@ class U extends O {
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
export {
|
|
130
|
-
|
|
131
|
+
n as SettingsPanel
|
|
131
132
|
};
|
|
@@ -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 E } 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", a = "select", { get: $ } = L();
|
|
8
|
+
class _ extends p {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
o(this, "currentNode");
|
|
@@ -16,16 +16,15 @@ class S extends p {
|
|
|
16
16
|
return m;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
|
-
if (this.
|
|
19
|
+
if (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
|
|
22
|
+
const s = t === E.sendGridId ? t : Number(t);
|
|
23
|
+
s && (this.selectedUnsubGroup = s, this.api.updateValues({
|
|
24
|
+
[a]: this.selectedUnsubGroup
|
|
25
|
+
}));
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
|
-
this.api.updateValues({
|
|
27
|
-
[u]: this.selectedUnsubGroup
|
|
28
|
-
});
|
|
29
28
|
}
|
|
30
29
|
_getLabel(t, s = `${Math.random()}`) {
|
|
31
30
|
return `
|
|
@@ -55,7 +54,7 @@ class S extends p {
|
|
|
55
54
|
</${i.LABEL}>
|
|
56
55
|
|
|
57
56
|
<${i.SELECTPICKER}
|
|
58
|
-
${e.SELECTPICKER.name}="${
|
|
57
|
+
${e.SELECTPICKER.name}="${a}"
|
|
59
58
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
60
59
|
${this._getSelect()}
|
|
61
60
|
</${i.SELECTPICKER}>
|
|
@@ -67,27 +66,27 @@ class S extends p {
|
|
|
67
66
|
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
|
|
68
67
|
}
|
|
69
68
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
69
|
+
this.api.onValueChanged(a, (t) => this._onSelectChange(t));
|
|
71
70
|
}
|
|
72
71
|
onTemplateNodeUpdated(t) {
|
|
73
|
-
this.currentNode = t
|
|
72
|
+
this.currentNode = t;
|
|
74
73
|
}
|
|
75
74
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
75
|
async onRender() {
|
|
77
76
|
const t = await $(
|
|
78
77
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s = [
|
|
80
|
-
[e.SELECT_ITEM.text]:
|
|
81
|
-
[e.SELECT_ITEM.value]:
|
|
78
|
+
), s = [E, ...t.data], c = s.map((u) => ({
|
|
79
|
+
[e.SELECT_ITEM.text]: u.name,
|
|
80
|
+
[e.SELECT_ITEM.value]: u.sendGridId
|
|
82
81
|
}));
|
|
83
82
|
this.unsubList = s, this.api.setUIEAttribute(
|
|
84
|
-
|
|
83
|
+
a,
|
|
85
84
|
e.SELECTPICKER.items,
|
|
86
|
-
|
|
85
|
+
c
|
|
87
86
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
export {
|
|
91
90
|
m as CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
91
|
+
_ as RadioButtonControl
|
|
93
92
|
};
|
|
@@ -5,7 +5,7 @@ const e = {
|
|
|
5
5
|
YES: "Yes",
|
|
6
6
|
NO: "No"
|
|
7
7
|
}, d = `
|
|
8
|
-
<td align="left" class="radio-button
|
|
8
|
+
<td align="left" class="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,21 +75,12 @@ 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
|
+
`, l = `
|
|
79
|
+
<td
|
|
80
|
+
align="left"
|
|
81
|
+
esd-extension-block-id="radio-button-block"
|
|
82
82
|
esd-handler-name="esd-extension-RadioButtonBlock"
|
|
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"
|
|
83
|
+
class="radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l"
|
|
93
84
|
>
|
|
94
85
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
95
86
|
<tbody>
|
|
@@ -149,10 +140,10 @@ const e = {
|
|
|
149
140
|
</table>
|
|
150
141
|
</td>
|
|
151
142
|
`;
|
|
152
|
-
function
|
|
143
|
+
function a() {
|
|
153
144
|
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>`);
|
|
154
145
|
}
|
|
155
146
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
l as default,
|
|
148
|
+
a as getDefaultTemplate
|
|
158
149
|
};
|
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-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-23c413c9],.guido-editor__container[data-v-23c413c9]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-23c413c9]{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}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"checkbox-block\"\n class=\"
|
|
1
|
+
declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
2
2
|
/**
|
|
3
3
|
* @returns The template for the default checkbox block
|
|
4
4
|
*/
|
|
@@ -13,7 +13,7 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
13
13
|
_getOrientation(): string;
|
|
14
14
|
_getItemInCart(): string;
|
|
15
15
|
_onOrientationChange(value: string): void;
|
|
16
|
-
_onItemsTypeChange(value: string): void;
|
|
16
|
+
_onItemsTypeChange(value: string, oldValue: string): void;
|
|
17
17
|
_onItemIdsChange(value: string): void;
|
|
18
18
|
_initializeSelectItems(): void;
|
|
19
19
|
_listenToFormUpdates(): void;
|
|
@@ -31,6 +31,7 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
31
31
|
_updatePrice(price: string): void;
|
|
32
32
|
_updateOriginalPrice(originalPrice: string): void;
|
|
33
33
|
_updateQuantity(quantity: string): void;
|
|
34
|
+
_updateButton(button: string): void;
|
|
34
35
|
/**
|
|
35
36
|
* @todo Optimize template reordering for performance.
|
|
36
37
|
* @description Reorders the template structure based on current orientation and visibility settings.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"
|
|
1
|
+
declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"radio-button-block\" \n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
2
2
|
/**
|
|
3
3
|
* @returns The template for the default checkbox block
|
|
4
4
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.538b804",
|
|
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",
|
|
@@ -41,12 +41,10 @@
|
|
|
41
41
|
"vue": "2.7.14"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@commitlint/cli": "20.2.0",
|
|
45
|
-
"@commitlint/config-conventional": "20.2.0",
|
|
46
44
|
"@cspell/eslint-plugin": "8.17.5",
|
|
47
45
|
"@eslint/eslintrc": "3.3.0",
|
|
48
46
|
"@eslint/js": "8.57.1",
|
|
49
|
-
"@playwright/test": "1.
|
|
47
|
+
"@playwright/test": "1.55.0",
|
|
50
48
|
"@stylistic/eslint-plugin": "3.1.0",
|
|
51
49
|
"@stylistic/eslint-plugin-migrate": "3.1.0",
|
|
52
50
|
"@types/eslint": "8.56.12",
|