@useinsider/guido 1.0.3-beta.63e6005 → 1.0.3-beta.6541b5a
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 -8
- package/dist/components/Guido.vue.d.ts +2 -2
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +64 -68
- 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 +19 -19
- package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/config/migrator/couponBlockMigrator.js +64 -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/CouponBlock/block.d.ts +11 -0
- package/dist/extensions/Blocks/{Unsubscribe/template.js → CouponBlock/block.js} +30 -20
- package/dist/extensions/Blocks/{Unsubscribe/tagRegistry.js → CouponBlock/extension.js} +5 -8
- package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/settingsPanel.d.ts +1 -1
- package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/settingsPanel.js +17 -12
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +1 -2
- package/dist/static/assets/icons/coupon.svg.js +4 -0
- package/dist/stores/unsubscribe.d.ts +5 -183
- package/dist/stores/unsubscribe.js +6 -125
- 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 -108
- 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 -112
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -31
- package/dist/extensions/Blocks/Unsubscribe/block.js +0 -144
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +0 -180
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -54
- package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -32
- 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/template.d.ts +0 -12
- 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/extensions/Blocks/{Unsubscribe → CouponBlock}/extension.d.ts +0 -0
package/dist/@types/generic.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { CompilerRule } from './html-compiler';
|
|
2
|
-
type Extensions = {
|
|
3
|
-
unsubscribe?: boolean;
|
|
4
|
-
};
|
|
5
2
|
type Features = {
|
|
6
3
|
dynamicContent?: boolean;
|
|
7
4
|
saveAsTemplate?: boolean;
|
|
@@ -19,13 +16,8 @@ export type GuidoConfig = {
|
|
|
19
16
|
useHeader?: boolean;
|
|
20
17
|
emailHeader: EmailHeader;
|
|
21
18
|
partner?: Partner;
|
|
22
|
-
extensions?: Extensions;
|
|
23
19
|
features?: Features;
|
|
24
20
|
};
|
|
25
|
-
export type TemplateConfig = {
|
|
26
|
-
preselectedDynamicContentList: DynamicContent[];
|
|
27
|
-
selectedUnsubscribePages?: number[];
|
|
28
|
-
};
|
|
29
21
|
export type DynamicContent = {
|
|
30
22
|
value: string;
|
|
31
23
|
text: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DynamicContent, GuidoConfig
|
|
1
|
+
import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
|
|
2
2
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
templateId: string;
|
|
@@ -9,8 +9,8 @@ type __VLS_Props = {
|
|
|
9
9
|
username?: string;
|
|
10
10
|
html?: string;
|
|
11
11
|
css?: string;
|
|
12
|
+
preselectedDynamicContentList: DynamicContent[];
|
|
12
13
|
guidoConfig: GuidoConfig;
|
|
13
|
-
templateConfig?: TemplateConfig;
|
|
14
14
|
};
|
|
15
15
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
16
16
|
dynamicContent: {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) :
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
s,
|
|
4
|
+
var t = function() {
|
|
5
|
+
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
6
|
+
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper), r(e.LoadingWrapper)], 1);
|
|
7
|
+
}, s = [], d = /* @__PURE__ */ i(
|
|
8
|
+
o,
|
|
10
9
|
t,
|
|
10
|
+
s,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"aca05338"
|
|
14
14
|
);
|
|
15
15
|
const v = d.exports;
|
|
16
16
|
export {
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { migrate as
|
|
6
|
-
import { DefaultUsername as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import re from "../node_modules/lodash-es/merge.js";
|
|
18
|
-
const Se = /* @__PURE__ */ R({
|
|
1
|
+
import { defineComponent as H, defineAsyncComponent as E, ref as R, computed as G, watch as U, onMounted as x, onUnmounted as F } from "vue";
|
|
2
|
+
import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as z } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as B } from "../composables/useStripo.js";
|
|
5
|
+
import { migrate as P } from "../config/migrator/index.js";
|
|
6
|
+
import { DefaultUsername as K, DefaultMessageType as O, DefaultGuidoConfig as j } from "../enums/defaults.js";
|
|
7
|
+
import q from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import J from "./organisms/header/HeaderWrapper.vue.js";
|
|
9
|
+
import Q from "./organisms/LoadingWrapper.vue.js";
|
|
10
|
+
import V from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
11
|
+
import { useStripoApi as X } from "../services/stripoApi.js";
|
|
12
|
+
import { useDynamicContentStore as Y } from "../stores/dynamic-content.js";
|
|
13
|
+
import { useEditorStore as Z } from "../stores/editor.js";
|
|
14
|
+
import { usePreviewStore as $ } from "../stores/preview.js";
|
|
15
|
+
import ee from "../node_modules/lodash-es/merge.js";
|
|
16
|
+
const ye = /* @__PURE__ */ H({
|
|
19
17
|
__name: "Guido",
|
|
20
18
|
props: {
|
|
21
19
|
templateId: null,
|
|
@@ -26,50 +24,49 @@ const Se = /* @__PURE__ */ R({
|
|
|
26
24
|
username: null,
|
|
27
25
|
html: null,
|
|
28
26
|
css: null,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
preselectedDynamicContentList: null,
|
|
28
|
+
guidoConfig: null
|
|
31
29
|
},
|
|
32
30
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
31
|
+
setup(I, { expose: L, emit: o }) {
|
|
32
|
+
const r = I, _ = E(
|
|
35
33
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
36
|
-
),
|
|
34
|
+
), W = E(
|
|
37
35
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
38
|
-
),
|
|
36
|
+
), d = R(), a = Y(), m = Z(), k = $(), t = G(() => m.hasChanges), i = r.preselectedDynamicContentList || [], { getPartnerName: l, getProductType: u, isTestPartner: A } = z(), p = () => {
|
|
39
37
|
var e;
|
|
40
|
-
return (e =
|
|
38
|
+
return (e = d.value) == null ? void 0 : e.handleSave(!0);
|
|
41
39
|
}, {
|
|
42
|
-
templateId:
|
|
43
|
-
userId:
|
|
44
|
-
guidoConfig:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
productType: i,
|
|
40
|
+
templateId: g,
|
|
41
|
+
userId: f,
|
|
42
|
+
guidoConfig: y,
|
|
43
|
+
html: n = "",
|
|
44
|
+
css: v = "",
|
|
45
|
+
partnerName: s = l(),
|
|
46
|
+
productType: c = u(),
|
|
47
|
+
messageType: C = O,
|
|
48
|
+
username: h = K
|
|
49
|
+
} = r;
|
|
50
|
+
window.GuidoConfig = ee(j, y), window.GuidoConfig.partner = {
|
|
51
|
+
partnerName: s,
|
|
52
|
+
productType: c,
|
|
56
53
|
messageType: C
|
|
57
54
|
};
|
|
58
|
-
const { initPlugin:
|
|
59
|
-
emailId:
|
|
60
|
-
userId:
|
|
61
|
-
username:
|
|
62
|
-
partnerName:
|
|
63
|
-
productType:
|
|
64
|
-
preselectedDynamicContentList:
|
|
55
|
+
const { initPlugin: w } = B({
|
|
56
|
+
emailId: g,
|
|
57
|
+
userId: f,
|
|
58
|
+
username: h,
|
|
59
|
+
partnerName: s,
|
|
60
|
+
productType: c,
|
|
61
|
+
preselectedDynamicContentList: i,
|
|
65
62
|
onReady: () => {
|
|
66
63
|
console.debug("guido:ready"), o("ready");
|
|
67
64
|
}
|
|
68
|
-
}), { getDefaultTemplate:
|
|
65
|
+
}), { getDefaultTemplate: S } = X(), N = G(() => {
|
|
69
66
|
var e;
|
|
70
67
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
71
68
|
});
|
|
72
|
-
|
|
69
|
+
M({
|
|
73
70
|
onBack: () => {
|
|
74
71
|
console.debug("guido:back"), o("back");
|
|
75
72
|
},
|
|
@@ -80,47 +77,46 @@ const Se = /* @__PURE__ */ R({
|
|
|
80
77
|
console.debug("guido:save:complete", e), o("save:complete", e);
|
|
81
78
|
}
|
|
82
79
|
});
|
|
83
|
-
const
|
|
84
|
-
console.debug("dynamic-content:close", e),
|
|
85
|
-
},
|
|
80
|
+
const b = (e) => {
|
|
81
|
+
console.debug("dynamic-content:close", e), a.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
82
|
+
}, D = () => {
|
|
86
83
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
87
84
|
};
|
|
88
|
-
return
|
|
89
|
-
o("on-change",
|
|
90
|
-
}),
|
|
85
|
+
return U(() => t.value, () => {
|
|
86
|
+
o("on-change", t.value);
|
|
87
|
+
}), x(async () => {
|
|
91
88
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
92
89
|
try {
|
|
93
|
-
u.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
94
90
|
let e = {
|
|
95
|
-
html:
|
|
96
|
-
css:
|
|
91
|
+
html: n && P(n),
|
|
92
|
+
css: v,
|
|
97
93
|
forceRecreate: !0
|
|
98
94
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
99
95
|
};
|
|
100
|
-
e.html || (e = await
|
|
96
|
+
e.html || (e = await S(), e.html = P(e.html)), await w(e), a.selectedDynamicContentList = i;
|
|
101
97
|
} catch (e) {
|
|
102
98
|
console.error("Failed to initialize Stripo editor:", e);
|
|
103
99
|
}
|
|
104
100
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
105
|
-
const
|
|
106
|
-
console.debug("dynamic-content:open",
|
|
101
|
+
const T = e;
|
|
102
|
+
console.debug("dynamic-content:open", T.detail), o("dynamic-content:open", T.detail);
|
|
107
103
|
});
|
|
108
|
-
}),
|
|
104
|
+
}), F(() => {
|
|
109
105
|
try {
|
|
110
106
|
window.UIEditor.removeEditor();
|
|
111
107
|
} catch {
|
|
112
108
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
113
109
|
}
|
|
114
|
-
}),
|
|
110
|
+
}), L({
|
|
115
111
|
dynamicContent: {
|
|
116
|
-
insert:
|
|
117
|
-
close:
|
|
112
|
+
insert: b,
|
|
113
|
+
close: D
|
|
118
114
|
},
|
|
119
|
-
hasChanges:
|
|
120
|
-
saveSilent:
|
|
121
|
-
}), { __sfc: !0, PreviewContainer:
|
|
115
|
+
hasChanges: t,
|
|
116
|
+
saveSilent: p
|
|
117
|
+
}), { __sfc: !0, PreviewContainer: _, OnboardingWrapper: W, headerWrapperRef: d, dynamicContentStore: a, props: r, editorStore: m, previewStore: k, hasChanges: t, preselectedDynamicContentList: i, getPartnerName: l, getProductType: u, isTestPartner: A, saveSilent: p, templateId: g, userId: f, guidoConfig: y, html: n, css: v, partnerName: s, productType: c, messageType: C, username: h, emit: o, initPlugin: w, getDefaultTemplate: S, noHeader: N, insertDynamicContent: b, closeDynamicContent: D, Toaster: q, HeaderWrapper: J, LoadingWrapper: Q, SaveAsTemplateDrawer: V };
|
|
122
118
|
}
|
|
123
119
|
});
|
|
124
120
|
export {
|
|
125
|
-
|
|
121
|
+
ye as default
|
|
126
122
|
};
|
|
@@ -2,7 +2,7 @@ import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
|
|
|
2
2
|
interface Props {
|
|
3
3
|
id: string;
|
|
4
4
|
className?: string;
|
|
5
|
-
size?:
|
|
5
|
+
size?: string;
|
|
6
6
|
closeOnOutsideClick?: boolean;
|
|
7
7
|
descriptionStatus?: boolean;
|
|
8
8
|
descriptionText?: string;
|
|
@@ -10,11 +10,9 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var __VLS_12: {}
|
|
13
|
+
declare var __VLS_12: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
|
|
16
|
-
} & {
|
|
17
|
-
default?: (props: typeof __VLS_14) => any;
|
|
15
|
+
default?: (props: typeof __VLS_12) => any;
|
|
18
16
|
};
|
|
19
17
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
18
|
className: string;
|
|
@@ -34,7 +32,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
34
32
|
descriptionText: string;
|
|
35
33
|
}>>>, {
|
|
36
34
|
className: string;
|
|
37
|
-
size:
|
|
35
|
+
size: string;
|
|
38
36
|
closeOnOutsideClick: boolean;
|
|
39
37
|
descriptionStatus: boolean;
|
|
40
38
|
descriptionText: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import r from "./WpDrawer.vue2.js";
|
|
2
2
|
import s from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
3
|
+
var i = function() {
|
|
4
4
|
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
5
5
|
return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
|
|
6
6
|
return e.emit("cancelOrBackButtonEvent");
|
|
@@ -8,15 +8,13 @@ var u = function() {
|
|
|
8
8
|
return e.emit("onCloseEvent");
|
|
9
9
|
}, primaryButtonEvent: function(o) {
|
|
10
10
|
return e.emit("primaryButtonEvent");
|
|
11
|
-
} }, scopedSlots: t._u([
|
|
12
|
-
return [t._t("headerBottomSlot")];
|
|
13
|
-
}, proxy: !0 } : null, { key: "contentSlot", fn: function() {
|
|
11
|
+
} }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
|
|
14
12
|
return [n("div", [t._t("default")], 2)];
|
|
15
13
|
}, proxy: !0 }], null, !0) });
|
|
16
|
-
},
|
|
14
|
+
}, u = [], c = /* @__PURE__ */ s(
|
|
17
15
|
r,
|
|
18
|
-
u,
|
|
19
16
|
i,
|
|
17
|
+
u,
|
|
20
18
|
!1,
|
|
21
19
|
null,
|
|
22
20
|
null
|
|
@@ -4,16 +4,16 @@ import { useStripoEventHandler as E } from "./useStripoEventHandler.js";
|
|
|
4
4
|
import { useToaster as C } from "./useToaster.js";
|
|
5
5
|
import { displayConditions as y } from "../enums/displayConditions.js";
|
|
6
6
|
import h from "../extensions/Blocks/Checkbox/extension.js";
|
|
7
|
-
import w from "../extensions/Blocks/
|
|
8
|
-
import b from "../extensions/Blocks/
|
|
9
|
-
import
|
|
10
|
-
import { useStripoApi as
|
|
11
|
-
import
|
|
12
|
-
import { useEditorStore as
|
|
7
|
+
import w from "../extensions/Blocks/CouponBlock/extension.js";
|
|
8
|
+
import b from "../extensions/Blocks/RadioButton/extension.js";
|
|
9
|
+
import k from "../extensions/DynamicContent/extension.js";
|
|
10
|
+
import { useStripoApi as B } from "../services/stripoApi.js";
|
|
11
|
+
import V from "../static/styles/customEditorStyle.css.js";
|
|
12
|
+
import { useEditorStore as _ } from "../stores/editor.js";
|
|
13
13
|
import { dynamicContentToMergeTags as F } from "../utils/genericUtil.js";
|
|
14
14
|
const j = (s) => {
|
|
15
|
-
const { handleError: d } = C(), { getToken: c, getCustomFonts: u } =
|
|
16
|
-
const t =
|
|
15
|
+
const { handleError: d } = C(), { getToken: c, getCustomFonts: u } = B(), { handleEvent: l } = E(), m = (r, i = []) => {
|
|
16
|
+
const t = _(), { html: e, css: a, forceRecreate: g } = r;
|
|
17
17
|
window.UIEditor.initEditor(
|
|
18
18
|
document.querySelector("#guido-editor"),
|
|
19
19
|
{
|
|
@@ -30,7 +30,7 @@ const j = (s) => {
|
|
|
30
30
|
customAppearanceMergetags: !0,
|
|
31
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
33
|
+
customViewStyles: V,
|
|
34
34
|
conditionsEnabled: !0,
|
|
35
35
|
customConditionsEnabled: !0,
|
|
36
36
|
conditionCategories: y,
|
|
@@ -78,16 +78,12 @@ const j = (s) => {
|
|
|
78
78
|
t.hasChanges = !0;
|
|
79
79
|
},
|
|
80
80
|
onEvent: l,
|
|
81
|
-
ignoreClickOutsideSelectors: [
|
|
82
|
-
"#guido-dynamic-content-modal",
|
|
83
|
-
".in-on-board-wrapper",
|
|
84
|
-
".in-drawer__container"
|
|
85
|
-
],
|
|
81
|
+
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
|
|
86
82
|
extensions: [
|
|
87
|
-
|
|
83
|
+
k,
|
|
88
84
|
h,
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
b,
|
|
86
|
+
w
|
|
91
87
|
]
|
|
92
88
|
}
|
|
93
89
|
);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { usePartner as m } from "../../composables/usePartner.js";
|
|
2
|
-
import { LINK_REGEXES as
|
|
2
|
+
import { LINK_REGEXES as c, LINK_TYPES as p, URLS as E } from "../../enums/unsubscribe.js";
|
|
3
3
|
import { useUnsubscribeStore as b } from "../../stores/unsubscribe.js";
|
|
4
4
|
const S = [
|
|
5
5
|
{
|
|
6
6
|
id: "add-unsubscribe-link-values",
|
|
7
7
|
description: "Adding unsubscribe link values",
|
|
8
8
|
type: "custom",
|
|
9
|
-
processor: (
|
|
9
|
+
processor: (n) => {
|
|
10
10
|
var a, u;
|
|
11
|
-
const { getPartnerName:
|
|
12
|
-
let e =
|
|
13
|
-
const
|
|
11
|
+
const { getPartnerName: i } = m(), t = b();
|
|
12
|
+
let e = n;
|
|
13
|
+
const o = `/${i()}/email/0?user={{iid}}`, r = (a = t.selectedUnsubscribePages) == null ? void 0 : a.find((l) => l.type === p.UNSUBSCRIBE_LINK_TYPE), s = (u = t.selectedUnsubscribePages) == null ? void 0 : u.find((l) => l.type === p.PREFERENCES_LINK_TYPE);
|
|
14
14
|
return r && (e = e.replace(
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
c.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
16
|
+
E.UNSUBSCRIBE_URL + o
|
|
17
17
|
)), s && (e = e.replace(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)), e.replace(
|
|
18
|
+
c.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
19
|
+
E.PREFERENCES_URL + o
|
|
20
|
+
)), e.replace(c.UNSUBSCRIBE_LINK_REGEX, "");
|
|
21
21
|
},
|
|
22
22
|
priority: 60
|
|
23
23
|
},
|
|
@@ -25,7 +25,7 @@ const S = [
|
|
|
25
25
|
id: "remove-data-ogsb-button-styles",
|
|
26
26
|
description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
|
|
27
27
|
type: "regex",
|
|
28
|
-
pattern:
|
|
28
|
+
pattern: c.DATA_OGSB_BUTTON_CSS_REGEX,
|
|
29
29
|
replacement: "",
|
|
30
30
|
flags: "g",
|
|
31
31
|
priority: 61
|
|
@@ -34,27 +34,27 @@ const S = [
|
|
|
34
34
|
id: "format-comment-braces",
|
|
35
35
|
description: "Adding spaces around comment braces for proper formatting",
|
|
36
36
|
type: "custom",
|
|
37
|
-
processor: (
|
|
37
|
+
processor: (n) => n.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
|
|
38
38
|
priority: 62
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
id: "add-universal-link-flags",
|
|
42
42
|
description: "Adding universal link flags",
|
|
43
43
|
type: "custom",
|
|
44
|
-
processor: (
|
|
45
|
-
let
|
|
46
|
-
const
|
|
47
|
-
return
|
|
44
|
+
processor: (n) => {
|
|
45
|
+
let i = n;
|
|
46
|
+
const t = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
47
|
+
return t && t.forEach((e) => {
|
|
48
48
|
if (e.includes("insEmail=1"))
|
|
49
49
|
return;
|
|
50
50
|
if (e.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
51
|
-
const
|
|
51
|
+
const o = e.replace(/href=(["'`”])(.*?)\1/gm, (r) => {
|
|
52
52
|
const s = r.slice(6, r.length - 1).trim();
|
|
53
53
|
return r.includes("?") || r.includes("#") ? s.slice(-1) === "&" ? r.replace(s, `${s}insEmail=1`) : r.replace(s, `${s}&insEmail=1`) : r.replace(s, `${s}?insEmail=1`);
|
|
54
54
|
});
|
|
55
|
-
|
|
55
|
+
i = i.replace(e, o);
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), i;
|
|
58
58
|
},
|
|
59
59
|
priority: 63
|
|
60
60
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function migrateCouponBlock(html: string): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var m = (o, t, e) => t in o ? k(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var x = (o, t, e) => m(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import h from "../../extensions/Blocks/CouponBlock/template.js";
|
|
5
|
+
class y {
|
|
6
|
+
constructor() {
|
|
7
|
+
x(this, "parser");
|
|
8
|
+
this.parser = new DOMParser();
|
|
9
|
+
}
|
|
10
|
+
migrate(t) {
|
|
11
|
+
try {
|
|
12
|
+
const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll("td.coupon-block.ins-coupon-code:not([esd-extension-block-id])");
|
|
13
|
+
return i.length === 0 ? t : (i.forEach((s) => {
|
|
14
|
+
const n = this.extractText(s), r = this.extractAttributes(s), l = h.replace("{@COUPON_CODE}", n).replace('class="coupon-block ins-coupon-code esd-block-text esd-extension-block"', r.class).replace(
|
|
15
|
+
'esd-extension-block-id="coupon-block"',
|
|
16
|
+
`esd-extension-block-id="coupon-block"${r.block}`
|
|
17
|
+
).replace(
|
|
18
|
+
'<p class="ins-title"',
|
|
19
|
+
`<p class="ins-title"${r.text}`
|
|
20
|
+
);
|
|
21
|
+
s.outerHTML = l;
|
|
22
|
+
}), e.documentElement.outerHTML);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return console.error("CouponBlockMigrator failed:", e), t;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
extractText(t) {
|
|
28
|
+
var p;
|
|
29
|
+
const e = t.querySelector(".ins-title");
|
|
30
|
+
if (!e)
|
|
31
|
+
return "{@COUPON_CODE}";
|
|
32
|
+
const i = ((p = e.textContent) == null ? void 0 : p.trim()) || "{@COUPON_CODE}", s = e.getAttribute("style") || "", n = /font-weight\s*:\s*bold/i.test(s), r = /font-style\s*:\s*italic/i.test(s), l = /text-decoration[^;]*underline/i.test(s), u = /text-decoration[^;]*line-through/i.test(s), a = /vertical-align\s*:\s*sub/i.test(s), g = /vertical-align\s*:\s*super/i.test(s);
|
|
33
|
+
return [
|
|
34
|
+
[n, "strong"],
|
|
35
|
+
[r, "em"],
|
|
36
|
+
[l, "u"],
|
|
37
|
+
[u, "s"],
|
|
38
|
+
[a, "sub"],
|
|
39
|
+
[g, "sup"]
|
|
40
|
+
].reduce((b, [f, d]) => f ? `<${d}>${b}</${d}>` : b, i);
|
|
41
|
+
}
|
|
42
|
+
extractAttributes(t) {
|
|
43
|
+
const e = t.querySelector(".ins-title"), i = t.className.split(" ").filter((c) => c.startsWith("es-")), s = t.getAttribute("align"), n = t.getAttribute("bgcolor"), r = t.getAttribute("style"), l = e == null ? void 0 : e.getAttribute("style");
|
|
44
|
+
let u = 'class="coupon-block ins-coupon-code esd-block-text esd-extension-block';
|
|
45
|
+
i.length && (u += ` ${i.join(" ")}`), u += '"';
|
|
46
|
+
let a = "";
|
|
47
|
+
if (s && (a += ` align="${s}"`), n && (a += ` bgcolor="${n}"`), r) {
|
|
48
|
+
const c = r.replace(/background-color[^;]+;?/gi, "").replace(/;+/g, ";").trim();
|
|
49
|
+
c && (a += ` style="${c.replace(/"/g, "'")}"`);
|
|
50
|
+
}
|
|
51
|
+
let g = "";
|
|
52
|
+
if (l) {
|
|
53
|
+
const c = l.replace(/"/g, '"').replace(/font-weight\s*:\s*[^;]+;?/gi, "").replace(/font-style\s*:\s*[^;]+;?/gi, "").replace(/text-decoration\s*:\s*[^;]+;?/gi, "").replace(/vertical-align\s*:\s*[^;]+;?/gi, "").replace(/;+/g, ";").replace(/^;|;$/g, "").trim().replace(/"/g, "'");
|
|
54
|
+
c && (g = ` style="${c}"`);
|
|
55
|
+
}
|
|
56
|
+
return { class: u, block: a, text: g };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function C(o) {
|
|
60
|
+
return new y().migrate(o);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
C as migrateCouponBlock
|
|
64
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const migrate: (html: string) =>
|
|
1
|
+
export declare const migrate: (html: string) => string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
let t =
|
|
6
|
-
return t =
|
|
1
|
+
import { migrateCheckbox as r } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
|
|
3
|
+
import { migrateRadioButton as e } from "./radioButtonMigrator.js";
|
|
4
|
+
const p = (o) => {
|
|
5
|
+
let t = o;
|
|
6
|
+
return t = r(t), t = e(t), t = m(t), t;
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
p as migrate
|
|
10
10
|
};
|
package/dist/enums/defaults.js
CHANGED
|
@@ -4,9 +4,6 @@ const a = {
|
|
|
4
4
|
senderName: "",
|
|
5
5
|
subject: ""
|
|
6
6
|
},
|
|
7
|
-
extensions: {
|
|
8
|
-
unsubscribe: !0
|
|
9
|
-
},
|
|
10
7
|
features: {
|
|
11
8
|
dynamicContent: !0,
|
|
12
9
|
saveAsTemplate: !0,
|
|
@@ -16,7 +13,7 @@ const a = {
|
|
|
16
13
|
}, t = {
|
|
17
14
|
promotional: 1,
|
|
18
15
|
transactional: 2
|
|
19
|
-
}, e = "email", o = "Guido User", n = t.promotional,
|
|
16
|
+
}, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
|
|
20
17
|
email: 60,
|
|
21
18
|
architect: 49
|
|
22
19
|
}, u = [
|
|
@@ -56,8 +53,8 @@ export {
|
|
|
56
53
|
n as DefaultMessageType,
|
|
57
54
|
e as DefaultProductType,
|
|
58
55
|
o as DefaultUsername,
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
i as EditorType,
|
|
57
|
+
s as ProductIds,
|
|
61
58
|
u as TEST_PARTNER_LIST,
|
|
62
59
|
t as TemplateTypes
|
|
63
60
|
};
|
|
@@ -13,22 +13,3 @@ export declare const URLS: {
|
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const INSIDER_ID = "iid";
|
|
16
|
-
export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
|
|
17
|
-
export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
|
|
18
|
-
export declare const PAGE_TYPES: {
|
|
19
|
-
GLOBAL_UNSUBSCRIBE: number;
|
|
20
|
-
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: number;
|
|
21
|
-
SUBSCRIPTION_PREFERENCE_CENTER: number;
|
|
22
|
-
SUBSCRIPTION_PREFERENCE_CONFIRMATION: number;
|
|
23
|
-
RESUBSCRIBE: number;
|
|
24
|
-
};
|
|
25
|
-
export declare const TYPE_COLLECTIONS: {
|
|
26
|
-
[x: number]: number[];
|
|
27
|
-
};
|
|
28
|
-
export declare const TYPE_TRANSLATIONS: {
|
|
29
|
-
[x: number]: string;
|
|
30
|
-
};
|
|
31
|
-
export declare const MERGE_TAGS: {
|
|
32
|
-
[x: number]: string;
|
|
33
|
-
default: string;
|
|
34
|
-
};
|