@useinsider/guido 1.0.3-beta.fb2b45b → 1.0.3-beta.ff71e68
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/dist/@types/generic.d.ts +0 -9
- package/dist/components/Guido.vue.d.ts +2 -2
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +69 -74
- package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
- package/dist/components/wrappers/WpDrawer.vue.js +4 -6
- package/dist/composables/useStripo.js +13 -17
- package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
- package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.d.ts +1 -1
- package/dist/config/migrator/index.js +7 -7
- package/dist/enums/defaults.js +3 -6
- package/dist/enums/unsubscribe.d.ts +0 -19
- package/dist/enums/unsubscribe.js +6 -39
- package/dist/extensions/Blocks/Checkbox/control.js +41 -43
- package/dist/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/iconsRegistry.d.ts +1 -1
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/settingsPanel.d.ts +1 -1
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/control.js +23 -25
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +1 -2
- package/dist/stores/unsubscribe.d.ts +5 -253
- package/dist/stores/unsubscribe.js +6 -126
- package/dist/utils/templatePreparation.js +16 -17
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
- package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
- package/dist/config/migrator/unsubscribeMigrator.js +0 -124
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
- package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
- package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
- package/dist/services/unsubscribeApi.d.ts +0 -4
- package/dist/services/unsubscribeApi.js +0 -16
- package/dist/stores/config.d.ts +0 -96
- package/dist/stores/config.js +0 -17
- /package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/extension.d.ts +0 -0
|
@@ -1,50 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
const s = e(), n = {
|
|
1
|
+
const E = {
|
|
3
2
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
4
3
|
PREFERENCES_LINK_TYPE: 3
|
|
5
|
-
},
|
|
4
|
+
}, s = {
|
|
6
5
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
7
6
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
8
7
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
9
8
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
10
|
-
},
|
|
9
|
+
}, _ = {
|
|
11
10
|
UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
|
|
12
11
|
PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
|
|
13
|
-
}, _ = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", I = "/email/unsubscribe-pages", E = {
|
|
14
|
-
GLOBAL_UNSUBSCRIBE: 1,
|
|
15
|
-
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
16
|
-
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
17
|
-
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
18
|
-
RESUBSCRIBE: 5
|
|
19
|
-
}, r = {
|
|
20
|
-
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
21
|
-
E.GLOBAL_UNSUBSCRIBE,
|
|
22
|
-
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
23
|
-
E.RESUBSCRIBE
|
|
24
|
-
],
|
|
25
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]: [
|
|
26
|
-
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
27
|
-
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
28
|
-
]
|
|
29
|
-
}, i = {
|
|
30
|
-
[E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
|
|
31
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
32
|
-
[E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
|
|
33
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
|
|
34
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
35
|
-
}, B = {
|
|
36
|
-
default: "{{ins-unsubscribe-link}}",
|
|
37
|
-
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
38
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
39
12
|
};
|
|
40
13
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
B as MERGE_TAGS,
|
|
45
|
-
E as PAGE_TYPES,
|
|
46
|
-
r as TYPE_COLLECTIONS,
|
|
47
|
-
i as TYPE_TRANSLATIONS,
|
|
48
|
-
I as UNSUBSCRIBE_PAGES_LINK,
|
|
49
|
-
N as URLS
|
|
14
|
+
s as LINK_REGEXES,
|
|
15
|
+
E as LINK_TYPES,
|
|
16
|
+
_ as URLS
|
|
50
17
|
};
|
|
@@ -1,90 +1,88 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { Control as
|
|
6
|
-
const
|
|
7
|
-
class b extends
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var E = (r, s, e) => s in r ? u(r, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[s] = e;
|
|
3
|
+
var o = (r, s, e) => E(r, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { useHttp as d } from "../../../composables/useHttp.js";
|
|
5
|
+
import { Control as l, UIElementType as n, UEAttr as t, ModificationDescription as L } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
const h = "ui-elements-checkbox", a = "select", { get: p } = d();
|
|
7
|
+
class b extends l {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
o(this, "currentNode");
|
|
11
|
+
o(this, "selectedUnsubGroup");
|
|
12
|
+
o(this, "unsubList", []);
|
|
13
13
|
}
|
|
14
14
|
getId() {
|
|
15
|
-
return
|
|
15
|
+
return h;
|
|
16
16
|
}
|
|
17
17
|
_setFormValues() {
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
19
|
+
const e = Number(this.currentNode.getAttribute("id"));
|
|
20
|
+
e && (this.selectedUnsubGroup = e, this.api.updateValues({
|
|
21
|
+
[a]: this.selectedUnsubGroup
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
_getLabel(
|
|
25
|
+
_getLabel(e, i = `${Math.random()}`) {
|
|
23
26
|
return `
|
|
24
27
|
<${n.LABEL}
|
|
25
|
-
${
|
|
26
|
-
${
|
|
28
|
+
${t.LABEL.text}="${e}"
|
|
29
|
+
${t.LABEL.name}="${i}">
|
|
27
30
|
</${n.LABEL}>
|
|
28
31
|
`;
|
|
29
32
|
}
|
|
30
|
-
_getSelectItem(
|
|
33
|
+
_getSelectItem(e, i) {
|
|
31
34
|
return `
|
|
32
35
|
<${n.SELECT_ITEM}
|
|
33
|
-
${
|
|
34
|
-
${
|
|
36
|
+
${t.SELECT_ITEM.text}="${e}"
|
|
37
|
+
${t.SELECT_ITEM.value}="${i}">
|
|
35
38
|
</${n.SELECT_ITEM}>`;
|
|
36
39
|
}
|
|
37
40
|
_getSelect() {
|
|
38
|
-
return this.unsubList.map((
|
|
41
|
+
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
39
42
|
}
|
|
40
43
|
getTemplate() {
|
|
41
44
|
return `
|
|
42
45
|
<div class="checkbox-controls-container">
|
|
43
46
|
<div class="checkbox-select-container container two-columns stretch">
|
|
44
47
|
<${n.LABEL}
|
|
45
|
-
${
|
|
46
|
-
${
|
|
48
|
+
${t.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
49
|
+
${t.LABEL.name}="${Math.random()}">
|
|
47
50
|
</${n.LABEL}>
|
|
48
51
|
|
|
49
52
|
<${n.SELECTPICKER}
|
|
50
|
-
${
|
|
51
|
-
${
|
|
53
|
+
${t.SELECTPICKER.name}="${a}"
|
|
54
|
+
${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
52
55
|
${this._getSelect()}
|
|
53
56
|
</${n.SELECTPICKER}>
|
|
54
57
|
</div>
|
|
55
58
|
</div>
|
|
56
59
|
`;
|
|
57
60
|
}
|
|
58
|
-
_onSelectChange(
|
|
59
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
61
|
+
_onSelectChange(e) {
|
|
62
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new L(`Updated text to ${e}`));
|
|
60
63
|
}
|
|
61
64
|
_listenToFormUpdates() {
|
|
62
|
-
this.api.onValueChanged(
|
|
65
|
+
this.api.onValueChanged(a, (e) => this._onSelectChange(e));
|
|
63
66
|
}
|
|
64
|
-
onTemplateNodeUpdated(
|
|
65
|
-
|
|
66
|
-
const i = Number(t.getAttribute("id"));
|
|
67
|
-
i && (this.selectedUnsubGroup = i, this.api.updateValues({
|
|
68
|
-
[o]: this.selectedUnsubGroup
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
67
|
+
onTemplateNodeUpdated(e) {
|
|
68
|
+
this.currentNode = e;
|
|
71
69
|
}
|
|
72
70
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
73
71
|
async onRender() {
|
|
74
|
-
const
|
|
72
|
+
const e = await p(
|
|
75
73
|
"/unsubscribe-groups/unsubscribe-list"
|
|
76
|
-
), i =
|
|
77
|
-
[
|
|
78
|
-
[
|
|
74
|
+
), i = e.data.map((c) => ({
|
|
75
|
+
[t.SELECT_ITEM.text]: c.name,
|
|
76
|
+
[t.SELECT_ITEM.value]: c.sendGridId
|
|
79
77
|
}));
|
|
80
|
-
this.unsubList =
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
this.unsubList = e.data, this.api.setUIEAttribute(
|
|
79
|
+
a,
|
|
80
|
+
t.SELECTPICKER.items,
|
|
83
81
|
i
|
|
84
82
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
export {
|
|
88
|
-
|
|
86
|
+
h as CHECKBOX_CONTROL_BLOCK_ID,
|
|
89
87
|
b as CheckboxControl
|
|
90
88
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Block, BlockCompositionType, BlockType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare const COUPON_BLOCK_ID = "coupon-block";
|
|
3
|
+
export declare class CouponBlock extends Block {
|
|
4
|
+
constructor();
|
|
5
|
+
getId(): string;
|
|
6
|
+
getIcon(): string;
|
|
7
|
+
getBlockCompositionType(): BlockCompositionType;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getDescription(): string;
|
|
10
|
+
getBlockType(): BlockType;
|
|
11
|
+
getTemplate(): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Block as o, BlockCompositionType as e, BlockType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as r } from "./template.js";
|
|
3
|
+
const n = "coupon-block";
|
|
4
|
+
class s extends o {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
getId() {
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
getIcon() {
|
|
12
|
+
return "coupon-icon";
|
|
13
|
+
}
|
|
14
|
+
getBlockCompositionType() {
|
|
15
|
+
return e.BLOCK;
|
|
16
|
+
}
|
|
17
|
+
getName() {
|
|
18
|
+
return this.api.translate("Coupon Block");
|
|
19
|
+
}
|
|
20
|
+
getDescription() {
|
|
21
|
+
return this.api.translate("Coupon lets you add a coupon code to your message design.");
|
|
22
|
+
}
|
|
23
|
+
getBlockType() {
|
|
24
|
+
return t.BLOCK_TEXT;
|
|
25
|
+
}
|
|
26
|
+
getTemplate() {
|
|
27
|
+
return r();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
n as COUPON_BLOCK_ID,
|
|
32
|
+
s as CouponBlock
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CouponBlock as t } from "./block.js";
|
|
3
|
+
import { CouponIconsRegistry as i } from "./iconsRegistry.js";
|
|
4
|
+
import { CouponBlockSettings as n } from "./settingsPanel.js";
|
|
5
|
+
const m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
|
|
6
|
+
export {
|
|
7
|
+
m as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IconsRegistry as L } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class t extends L {
|
|
3
|
+
registerIconsSvg(C) {
|
|
4
|
+
C["coupon-icon"] = `
|
|
5
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M7.87939 0C8.56714 0.0576002 9.26998 0.793636 9.82275 1.37305L9.83057
|
|
7
|
+
1.38184C9.93483 1.49112 10.0343 1.5944 10.1265 1.68652L17.2573 8.79492C18.2493
|
|
8
|
+
9.7872 18.2493 11.3954 17.2573 12.3877L12.396 17.2471C11.9169 17.726 11.2659 17.9999
|
|
9
|
+
10.6157 18C9.96563 17.9999 9.31551 17.76 8.83643 17.2471L1.68896 10.1221C1.58907 10.0222
|
|
10
|
+
1.47548 9.91523 1.35596 9.80273C0.77939 9.26006 0.0584135 8.58144 0.00146484 7.87305L0.00439453
|
|
11
|
+
2.15625C-0.0298299 1.57462 0.209988 1.02683 0.620605 0.616211C1.03135 0.20572 1.57981 0 2.16162
|
|
12
|
+
0L7.87939 0ZM2.16162 2C2.10648 2 2.07333 2.01007 2.05908 2.01562C2.04707 2.02035 2.04069 2.02432
|
|
13
|
+
2.03467 2.03027C2.01884 2.04611 2.00915 2.05957 2.00342 2.06836L2.00439 2.09766L2.00146 7.59277C2.01413
|
|
14
|
+
7.61029 2.02975 7.63092 2.04834 7.6543C2.20264 7.84819 2.41884 8.05659 2.72705 8.34668L2.73682
|
|
15
|
+
8.35645C2.84844 8.46149 2.9808 8.58586 3.10205 8.70703L3.10303 8.70801L10.2739 15.8564L10.2983
|
|
16
|
+
15.8818C10.3564 15.9439 10.4539 15.9999 10.6157 16C10.7155 15.9998 10.8635 15.9513 10.9819
|
|
17
|
+
15.833L15.8433 10.9736C16.054 10.7626 16.0536 10.4212 15.8433 10.21L8.71436 3.10352L8.7124
|
|
18
|
+
3.10156C8.60329 2.99248 8.49054 2.8737 8.39209 2.77051L8.37549 2.75391C8.08113 2.44536 7.86049
|
|
19
|
+
2.21875 7.65479 2.05469C7.62752 2.03295 7.6037 2.01461 7.5835 2L2.16162 2ZM8.16748 9.83301C8.81172
|
|
20
|
+
9.18878 9.8571 9.18898 10.5015 9.83301L10.6265 9.71973C11.2745 9.19135 12.2304 9.22915 12.8345
|
|
21
|
+
9.83301C13.4787 10.4772 13.4795 11.5226 12.8354 12.167C12.8312 12.1713 12.8251 12.1745 12.8208
|
|
22
|
+
12.1787L11.2085 13.792C10.818 14.1825 10.185 14.1824 9.79443 13.792L8.18115 12.1797C8.1768 12.1755
|
|
23
|
+
8.17178 12.1713 8.16748 12.167C7.52346 11.5226 7.52325 10.4772 8.16748 9.83301ZM5.00146 4C5.55353
|
|
24
|
+
4.00025 6.00146 4.44787 6.00146 5C6.00146 5.55213 5.55353 5.99975 5.00146 6C4.44918 6 4.00146 5.55228
|
|
25
|
+
4.00146 5C4.00146 4.44772 4.44918 4 5.00146 4Z" fill="#666666"/>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
t as CouponIconsRegistry
|
|
33
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SettingsPanelRegistry, SettingsPanelTab } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class CouponBlockSettings extends SettingsPanelRegistry {
|
|
3
3
|
registerBlockControls(blockControlsMap: Record<string, SettingsPanelTab[]>): void;
|
|
4
4
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SettingsPanelRegistry as T, SettingsPanelTab as o, SettingsTab as O, TextControls as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { COUPON_BLOCK_ID as N } from "./block.js";
|
|
3
|
+
class _ extends T {
|
|
4
|
+
registerBlockControls(e) {
|
|
5
|
+
e[N] = [
|
|
6
|
+
new o(
|
|
7
|
+
O.SETTINGS,
|
|
8
|
+
[
|
|
9
|
+
t.FONT_FAMILY,
|
|
10
|
+
t.FONT_SIZE,
|
|
11
|
+
t.FORMAT,
|
|
12
|
+
t.FONT_COLOR,
|
|
13
|
+
t.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
14
|
+
t.ALIGN,
|
|
15
|
+
t.LINE_HEIGHT,
|
|
16
|
+
t.INTERNAL_INDENTS
|
|
17
|
+
]
|
|
18
|
+
)
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
_ as CouponBlockSettings
|
|
24
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const migrationTemplate = "\n <td \n class=\"coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block\" \n esd-extension-block-id=\"coupon-block\"\n >\n <p class=\"ins-title\" contenteditable=\"false\">{@COUPON_CODE}</p>\n </td>\n";
|
|
2
|
+
export declare function getDefaultTemplate(): string;
|
|
3
|
+
export default migrationTemplate;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = `
|
|
2
|
+
<td class="coupon-block ins-coupon-code esd-block-text coupon-block-v2">
|
|
3
|
+
<p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
|
|
4
|
+
</td>`, e = `
|
|
5
|
+
<td
|
|
6
|
+
class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
|
|
7
|
+
esd-extension-block-id="coupon-block"
|
|
8
|
+
>
|
|
9
|
+
<p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
|
|
10
|
+
</td>
|
|
11
|
+
`;
|
|
12
|
+
function t() {
|
|
13
|
+
return o;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
e as default,
|
|
17
|
+
t as getDefaultTemplate
|
|
18
|
+
};
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
var E = Object.defineProperty;
|
|
2
|
-
var c = (
|
|
3
|
-
var
|
|
2
|
+
var c = (i, s, t) => s in i ? E(i, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[s] = t;
|
|
3
|
+
var o = (i, s, t) => c(i, typeof s != "symbol" ? s + "" : s, t);
|
|
4
4
|
import { useHttp as d } from "../../../composables/useHttp.js";
|
|
5
5
|
import { Control as l, UIElementType as n, UEAttr as e, ModificationDescription as L } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
-
const p = "ui-elements-radio-button",
|
|
6
|
+
const p = "ui-elements-radio-button", a = "select", { get: h } = d();
|
|
7
7
|
class b extends l {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
o(this, "currentNode");
|
|
11
|
+
o(this, "selectedUnsubGroup");
|
|
12
|
+
o(this, "unsubList", []);
|
|
13
13
|
}
|
|
14
14
|
getId() {
|
|
15
15
|
return p;
|
|
16
16
|
}
|
|
17
17
|
_setFormValues() {
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
19
|
+
const t = Number(this.currentNode.getAttribute("id"));
|
|
20
|
+
t && (this.selectedUnsubGroup = t, this.api.updateValues({
|
|
21
|
+
[a]: this.selectedUnsubGroup
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
_getLabel(t,
|
|
25
|
+
_getLabel(t, r = `${Math.random()}`) {
|
|
23
26
|
return `
|
|
24
27
|
<${n.LABEL}
|
|
25
28
|
${e.LABEL.text}="${t}"
|
|
26
|
-
${e.LABEL.name}="${
|
|
29
|
+
${e.LABEL.name}="${r}">
|
|
27
30
|
</${n.LABEL}>
|
|
28
31
|
`;
|
|
29
32
|
}
|
|
30
|
-
_getSelectItem(t,
|
|
33
|
+
_getSelectItem(t, r) {
|
|
31
34
|
return `
|
|
32
35
|
<${n.SELECT_ITEM}
|
|
33
36
|
${e.SELECT_ITEM.text}="${t}"
|
|
34
|
-
${e.SELECT_ITEM.value}="${
|
|
37
|
+
${e.SELECT_ITEM.value}="${r}">
|
|
35
38
|
</${n.SELECT_ITEM}>`;
|
|
36
39
|
}
|
|
37
40
|
_getSelect() {
|
|
@@ -47,7 +50,7 @@ class b extends l {
|
|
|
47
50
|
</${n.LABEL}>
|
|
48
51
|
|
|
49
52
|
<${n.SELECTPICKER}
|
|
50
|
-
${e.SELECTPICKER.name}="${
|
|
53
|
+
${e.SELECTPICKER.name}="${a}"
|
|
51
54
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
52
55
|
${this._getSelect()}
|
|
53
56
|
</${n.SELECTPICKER}>
|
|
@@ -59,28 +62,23 @@ class b extends l {
|
|
|
59
62
|
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new L(`Updated text to ${t}`));
|
|
60
63
|
}
|
|
61
64
|
_listenToFormUpdates() {
|
|
62
|
-
this.api.onValueChanged(
|
|
65
|
+
this.api.onValueChanged(a, (t) => this._onSelectChange(t));
|
|
63
66
|
}
|
|
64
67
|
onTemplateNodeUpdated(t) {
|
|
65
|
-
|
|
66
|
-
const i = Number(t.getAttribute("id"));
|
|
67
|
-
i && (this.selectedUnsubGroup = i, this.api.updateValues({
|
|
68
|
-
[o]: this.selectedUnsubGroup
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
68
|
+
this.currentNode = t;
|
|
71
69
|
}
|
|
72
70
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
73
71
|
async onRender() {
|
|
74
|
-
const t = await
|
|
72
|
+
const t = await h(
|
|
75
73
|
"/unsubscribe-groups/unsubscribe-list"
|
|
76
|
-
),
|
|
74
|
+
), r = t.data.map((u) => ({
|
|
77
75
|
[e.SELECT_ITEM.text]: u.name,
|
|
78
76
|
[e.SELECT_ITEM.value]: u.sendGridId
|
|
79
77
|
}));
|
|
80
78
|
this.unsubList = t.data, this.api.setUIEAttribute(
|
|
81
|
-
|
|
79
|
+
a,
|
|
82
80
|
e.SELECTPICKER.items,
|
|
83
|
-
|
|
81
|
+
r
|
|
84
82
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
85
83
|
}
|
|
86
84
|
}
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-2c168944] .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-
|
|
1
|
+
[data-v-2c168944] .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-aca05338],.guido-editor__container[data-v-aca05338]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-aca05338]{height:calc(100vh - 75px)}.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-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|