@useinsider/guido 1.0.3-beta.2143901 → 1.0.3-beta.2155d71
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/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +61 -60
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +12 -13
- package/dist/composables/useStripo.js +35 -32
- package/dist/config/compiler/unsubscribeCompilerRules.js +39 -26
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/unsubscribeMigrator.js +61 -49
- package/dist/enums/unsubscribe.js +15 -11
- package/dist/extensions/Blocks/Checkbox/control.js +55 -53
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/control.js +44 -42
- package/dist/extensions/Blocks/Unsubscribe/block.js +5 -5
- package/dist/extensions/Blocks/Unsubscribe/extension.js +7 -6
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +27 -11
- package/dist/guido.css +1 -1
- package/dist/package.json.js +7 -0
- package/dist/{@types → src/@types}/generic.d.ts +2 -1
- package/dist/src/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/{enums → src/enums}/unsubscribe.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/src/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/DynamicContent/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +96 -0
- package/dist/{stores → src/stores}/unsubscribe.d.ts +72 -2
- package/dist/stores/config.js +17 -0
- package/dist/stores/unsubscribe.js +43 -42
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +6 -1
- /package/dist/{@types → src/@types}/events.d.ts +0 -0
- /package/dist/{@types → src/@types}/save-as-template.d.ts +0 -0
- /package/dist/{App.vue.d.ts → src/App.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/Guido.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/LoadingWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/base/Toaster.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/LeftSlot.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/MiddleSlot.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/RightSlot.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/ViewOptions.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/RestoreButton.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/ViewOptions.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/wrappers/WpDrawer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/wrappers/WpModal.vue.d.ts +0 -0
- /package/dist/{composables → src/composables}/useActionsApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useApiExample.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCodeEditorApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useConfig.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCustomInterfaceAppearance.d.ts +0 -0
- /package/dist/{composables → src/composables}/useDebounce.d.ts +0 -0
- /package/dist/{composables → src/composables}/useExport.d.ts +0 -0
- /package/dist/{composables → src/composables}/useGuidoActions.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlCompiler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlValidator.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHttp.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePartner.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePreviewMode.d.ts +0 -0
- /package/dist/{composables → src/composables}/useProvideInject.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRecommendation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useResponsivePreview.d.ts +0 -0
- /package/dist/{composables → src/composables}/useSave.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripo.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripoEventHandler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useToaster.d.ts +0 -0
- /package/dist/{composables → src/composables}/useTranslations.d.ts +0 -0
- /package/dist/{composables → src/composables}/useValidation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useVersionHistoryApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/validators/saveAsTemplate.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/htmlCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/outlookCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/recommendationCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/socialCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/checkboxMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/index.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/radioButtonMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/unsubscribeMigrator.d.ts +0 -0
- /package/dist/{enums → src/enums}/defaults.d.ts +0 -0
- /package/dist/{enums → src/enums}/displayConditions.d.ts +0 -0
- /package/dist/{enums → src/enums}/html-validator.d.ts +0 -0
- /package/dist/{enums → src/enums}/onboarding.d.ts +0 -0
- /package/dist/{enums → src/enums}/preview.d.ts +0 -0
- /package/dist/{enums → src/enums}/recommendation.d.ts +0 -0
- /package/dist/{enums → src/enums}/toaster.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/template.d.ts +0 -0
- /package/dist/{extensions/Blocks/RadioButton → src/extensions/Blocks/CouponBlock}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/control.d.ts +0 -0
- /package/dist/{extensions/Blocks/Unsubscribe → src/extensions/Blocks/RadioButton}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/elements/preview.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/tagRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/utils/constants.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/utils/utils.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
- /package/dist/{extensions/DynamicContent → src/extensions/Blocks/_Boilerplate}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content.d.ts +0 -0
- /package/dist/{library.d.ts → src/library.d.ts} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{mock → src/mock}/api/auth.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/custom-fonts.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/default-template.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/template-library.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/unsubscribe.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/user-modal-state.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/validator.d.ts +0 -0
- /package/dist/{mock → src/mock}/browser.d.ts +0 -0
- /package/dist/{mock → src/mock}/handlers.d.ts +0 -0
- /package/dist/{services → src/services}/onboardingApi.d.ts +0 -0
- /package/dist/{services → src/services}/stripoApi.d.ts +0 -0
- /package/dist/{services → src/services}/templateLibraryApi.d.ts +0 -0
- /package/dist/{services → src/services}/unsubscribeApi.d.ts +0 -0
- /package/dist/{stores → src/stores}/dynamic-content.d.ts +0 -0
- /package/dist/{stores → src/stores}/editor.d.ts +0 -0
- /package/dist/{stores → src/stores}/onboarding.d.ts +0 -0
- /package/dist/{stores → src/stores}/preview.d.ts +0 -0
- /package/dist/{stores → src/stores}/recommendation.d.ts +0 -0
- /package/dist/{stores → src/stores}/save-as-template.d.ts +0 -0
- /package/dist/{stores → src/stores}/toaster.d.ts +0 -0
- /package/dist/{stores → src/stores}/version-history.d.ts +0 -0
- /package/dist/{utils → src/utils}/arrayUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/base64.d.ts +0 -0
- /package/dist/{utils → src/utils}/dateUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/genericUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/htmlCompiler.d.ts +0 -0
- /package/dist/{utils → src/utils}/templatePreparation.d.ts +0 -0
- /package/dist/{utils → src/utils}/tooltipUtils.d.ts +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
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 { useStripoApi as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
1
|
+
import { defineComponent as x, defineAsyncComponent as U, ref as F, computed as I, watch as M, onMounted as z, onUnmounted as B } from "vue";
|
|
2
|
+
import { provideGuidoActions as K } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as O } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as j } from "../composables/useStripo.js";
|
|
5
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
6
|
+
import { DefaultUsername as q, DefaultMessageType as J, DefaultGuidoConfig as Q } from "../enums/defaults.js";
|
|
7
|
+
import V from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import X from "./organisms/header/HeaderWrapper.vue.js";
|
|
9
|
+
import Y from "./organisms/LoadingWrapper.vue.js";
|
|
10
|
+
import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
11
|
+
import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
12
|
+
import { useStripoApi as ee } from "../services/stripoApi.js";
|
|
13
|
+
import { useConfigStore as oe } from "../stores/config.js";
|
|
14
|
+
import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
|
|
15
|
+
import { useEditorStore as ne } from "../stores/editor.js";
|
|
16
|
+
import { usePreviewStore as re } from "../stores/preview.js";
|
|
17
|
+
import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
|
|
18
|
+
import ae from "../node_modules/lodash-es/merge.js";
|
|
19
|
+
const Ee = /* @__PURE__ */ x({
|
|
19
20
|
__name: "Guido",
|
|
20
21
|
props: {
|
|
21
22
|
templateId: null,
|
|
@@ -30,97 +31,97 @@ const Se = /* @__PURE__ */ R({
|
|
|
30
31
|
templateConfig: null
|
|
31
32
|
},
|
|
32
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
|
|
33
|
-
setup(
|
|
34
|
-
const d =
|
|
34
|
+
setup(_, { expose: L, emit: t }) {
|
|
35
|
+
const d = _, k = U(
|
|
35
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
36
|
-
),
|
|
37
|
+
), A = U(
|
|
37
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
38
|
-
), m =
|
|
39
|
+
), m = F(), s = te(), u = se(), l = oe(), p = ne(), N = re(), n = I(() => p.hasChanges), { getPartnerName: g, getProductType: f, isTestPartner: H } = O(), y = () => {
|
|
39
40
|
var e;
|
|
40
41
|
return (e = m.value) == null ? void 0 : e.handleSave(!0);
|
|
41
42
|
}, {
|
|
42
|
-
templateId:
|
|
43
|
-
userId:
|
|
44
|
-
guidoConfig:
|
|
45
|
-
templateConfig:
|
|
43
|
+
templateId: v,
|
|
44
|
+
userId: b,
|
|
45
|
+
guidoConfig: C,
|
|
46
|
+
templateConfig: o,
|
|
46
47
|
html: r = "",
|
|
47
48
|
css: h = "",
|
|
48
|
-
partnerName: a =
|
|
49
|
-
productType: i =
|
|
50
|
-
messageType:
|
|
51
|
-
username: w =
|
|
52
|
-
} = d, c = (
|
|
53
|
-
window.GuidoConfig =
|
|
49
|
+
partnerName: a = g(),
|
|
50
|
+
productType: i = f(),
|
|
51
|
+
messageType: S = J,
|
|
52
|
+
username: w = q
|
|
53
|
+
} = d, c = (o == null ? void 0 : o.preselectedDynamicContentList) || [];
|
|
54
|
+
window.GuidoConfig = ae(Q, C), window.GuidoConfig.partner = {
|
|
54
55
|
partnerName: a,
|
|
55
56
|
productType: i,
|
|
56
|
-
messageType:
|
|
57
|
-
};
|
|
58
|
-
const { initPlugin:
|
|
59
|
-
emailId:
|
|
60
|
-
userId:
|
|
57
|
+
messageType: S
|
|
58
|
+
}, l.templateConfig = o;
|
|
59
|
+
const { initPlugin: D } = j({
|
|
60
|
+
emailId: v,
|
|
61
|
+
userId: b,
|
|
61
62
|
username: w,
|
|
62
63
|
partnerName: a,
|
|
63
64
|
productType: i,
|
|
64
65
|
preselectedDynamicContentList: c,
|
|
65
66
|
onReady: () => {
|
|
66
|
-
console.debug("guido:ready"),
|
|
67
|
+
console.debug("guido:ready"), t("ready");
|
|
67
68
|
}
|
|
68
|
-
}), { getDefaultTemplate:
|
|
69
|
+
}), { getDefaultTemplate: T } = ee(), R = I(() => {
|
|
69
70
|
var e;
|
|
70
71
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
71
72
|
});
|
|
72
|
-
|
|
73
|
+
K({
|
|
73
74
|
onBack: () => {
|
|
74
|
-
console.debug("guido:back"),
|
|
75
|
+
console.debug("guido:back"), t("back");
|
|
75
76
|
},
|
|
76
77
|
onSaveStart: () => {
|
|
77
|
-
console.debug("guido:save:start"),
|
|
78
|
+
console.debug("guido:save:start"), t("save:start");
|
|
78
79
|
},
|
|
79
80
|
onSaveComplete: (e) => {
|
|
80
|
-
console.debug("guido:save:complete", e),
|
|
81
|
+
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
|
-
const
|
|
84
|
+
const E = (e) => {
|
|
84
85
|
console.debug("dynamic-content:close", e), s.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
85
|
-
},
|
|
86
|
+
}, P = () => {
|
|
86
87
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
87
88
|
};
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
}),
|
|
89
|
+
return M(() => n.value, () => {
|
|
90
|
+
t("on-change", n.value);
|
|
91
|
+
}), z(async () => {
|
|
91
92
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
92
93
|
try {
|
|
93
|
-
u.selectedUnsubscribePages = (
|
|
94
|
+
u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
94
95
|
let e = {
|
|
95
|
-
html: r && await
|
|
96
|
+
html: r && await W(r),
|
|
96
97
|
css: h,
|
|
97
98
|
forceRecreate: !0
|
|
98
99
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
99
100
|
};
|
|
100
|
-
e.html || (e = await
|
|
101
|
+
e.html || (e = await T(), e.html = await W(e.html)), await D(e), s.selectedDynamicContentList = c;
|
|
101
102
|
} catch (e) {
|
|
102
103
|
console.error("Failed to initialize Stripo editor:", e);
|
|
103
104
|
}
|
|
104
105
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
105
|
-
const
|
|
106
|
-
console.debug("dynamic-content:open",
|
|
106
|
+
const G = e;
|
|
107
|
+
console.debug("dynamic-content:open", G.detail), t("dynamic-content:open", G.detail);
|
|
107
108
|
});
|
|
108
|
-
}),
|
|
109
|
+
}), B(() => {
|
|
109
110
|
try {
|
|
110
111
|
window.UIEditor.removeEditor();
|
|
111
112
|
} catch {
|
|
112
113
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
113
114
|
}
|
|
114
|
-
}),
|
|
115
|
+
}), L({
|
|
115
116
|
dynamicContent: {
|
|
116
|
-
insert:
|
|
117
|
-
close:
|
|
117
|
+
insert: E,
|
|
118
|
+
close: P
|
|
118
119
|
},
|
|
119
120
|
hasChanges: n,
|
|
120
|
-
saveSilent:
|
|
121
|
-
}), { __sfc: !0, PreviewContainer:
|
|
121
|
+
saveSilent: y
|
|
122
|
+
}), { __sfc: !0, PreviewContainer: k, OnboardingWrapper: A, headerWrapperRef: m, dynamicContentStore: s, unsubscribeStore: u, props: d, configStore: l, editorStore: p, previewStore: N, hasChanges: n, getPartnerName: g, getProductType: f, isTestPartner: H, saveSilent: y, templateId: v, userId: b, guidoConfig: C, templateConfig: o, html: r, css: h, partnerName: a, productType: i, messageType: S, username: w, preselectedDynamicContentList: c, emit: t, initPlugin: D, getDefaultTemplate: T, noHeader: R, insertDynamicContent: E, closeDynamicContent: P, Toaster: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
|
|
122
123
|
}
|
|
123
124
|
});
|
|
124
125
|
export {
|
|
125
|
-
|
|
126
|
+
Ee as default
|
|
126
127
|
};
|
|
@@ -9,7 +9,7 @@ import { InSegments as I } from "@useinsider/design-system-vue";
|
|
|
9
9
|
const z = /* @__PURE__ */ h({
|
|
10
10
|
__name: "UnsubscribeTypeSelection",
|
|
11
11
|
setup(G) {
|
|
12
|
-
const e = N(), { showToaster: f } = B(), t = D(), n = b(!1), i = b(!0),
|
|
12
|
+
const e = N(), { showToaster: f } = B(), t = D(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
|
|
13
13
|
"unsubscription-preference.select-unsubscribe-page-description",
|
|
14
14
|
{ action: `<a href="${w}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
|
|
15
15
|
), T = m(() => [
|
|
@@ -19,6 +19,7 @@ const z = /* @__PURE__ */ h({
|
|
|
19
19
|
text: e("unsubscription-preference.type-global-unsubscribe"),
|
|
20
20
|
value: l.GLOBAL_UNSUBSCRIBE,
|
|
21
21
|
disable: t.isGlobalUnsubscribeDisabled,
|
|
22
|
+
position: "bottom",
|
|
22
23
|
tooltipText: t.isGlobalUnsubscribeDisabled ? e("unsubscription-preference.global-unsub-added") : ""
|
|
23
24
|
},
|
|
24
25
|
{
|
|
@@ -54,20 +55,20 @@ const z = /* @__PURE__ */ h({
|
|
|
54
55
|
s();
|
|
55
56
|
}, 500);
|
|
56
57
|
}, E = (s) => {
|
|
57
|
-
|
|
58
|
+
o.value = s;
|
|
58
59
|
}, g = () => {
|
|
59
|
-
const s = t.hasTemplatesByCollectionType,
|
|
60
|
+
const s = t.hasTemplatesByCollectionType, r = [];
|
|
60
61
|
if (Object.entries(s).forEach(([c, p]) => {
|
|
61
|
-
p ||
|
|
62
|
-
}),
|
|
62
|
+
p || r.push(Number(c));
|
|
63
|
+
}), r.length === 0)
|
|
63
64
|
return !0;
|
|
64
|
-
const a =
|
|
65
|
+
const a = r.map((c) => R[c]);
|
|
65
66
|
let u = "";
|
|
66
|
-
if (
|
|
67
|
+
if (r.length === 1)
|
|
67
68
|
u = e("unsubscription-preference.create-page-to-continue", {
|
|
68
69
|
page: a[0]
|
|
69
70
|
});
|
|
70
|
-
else if (
|
|
71
|
+
else if (r.length === 2)
|
|
71
72
|
u = e("unsubscription-preference.create-pages-to-continue", {
|
|
72
73
|
page1: a[0],
|
|
73
74
|
page2: a[1]
|
|
@@ -90,17 +91,15 @@ const z = /* @__PURE__ */ h({
|
|
|
90
91
|
}
|
|
91
92
|
}), !1;
|
|
92
93
|
}, C = async () => {
|
|
93
|
-
if (n.value = !0, await t.fetchTemplates(), t.setCollection(
|
|
94
|
+
if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !g()) {
|
|
94
95
|
n.value = !1, d();
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
98
|
n.value = !1, t.typeSelectionDrawerStatus = !1, t.pageSelectionDrawerStatus = !0;
|
|
98
99
|
};
|
|
99
100
|
return _(() => t.typeSelectionDrawerStatus, (s) => {
|
|
100
|
-
s && (i.value = !0,
|
|
101
|
-
|
|
102
|
-
}, 1e3));
|
|
103
|
-
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: r, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: v, InSegments: I };
|
|
101
|
+
s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
|
|
102
|
+
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: v, InSegments: I };
|
|
104
103
|
}
|
|
105
104
|
});
|
|
106
105
|
export {
|
|
@@ -4,23 +4,25 @@ 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/
|
|
7
|
+
import w from "../extensions/Blocks/CouponBlock/extension.js";
|
|
8
|
+
import b from "../extensions/Blocks/RadioButton/extension.js";
|
|
9
|
+
import V from "../extensions/Blocks/Unsubscribe/extension.js";
|
|
9
10
|
import _ from "../extensions/DynamicContent/extension.js";
|
|
10
11
|
import { useStripoApi as k } from "../services/stripoApi.js";
|
|
11
12
|
import B from "../static/styles/customEditorStyle.css.js";
|
|
12
|
-
import { useEditorStore as
|
|
13
|
-
import { dynamicContentToMergeTags as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import { useEditorStore as F } from "../stores/editor.js";
|
|
14
|
+
import { dynamicContentToMergeTags as x } from "../utils/genericUtil.js";
|
|
15
|
+
import A from "../package.json.js";
|
|
16
|
+
const N = (a) => {
|
|
17
|
+
const { handleError: d } = C(), { getToken: u, getCustomFonts: m } = k(), { handleEvent: p } = E(), l = (r, i = []) => {
|
|
18
|
+
const t = F(), { html: n, css: c, forceRecreate: s } = r;
|
|
17
19
|
window.UIEditor.initEditor(
|
|
18
20
|
document.querySelector("#guido-editor"),
|
|
19
21
|
{
|
|
20
|
-
metadata:
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
23
|
-
forceRecreate:
|
|
22
|
+
metadata: a,
|
|
23
|
+
html: n,
|
|
24
|
+
css: c,
|
|
25
|
+
forceRecreate: s,
|
|
24
26
|
locale: "en",
|
|
25
27
|
undoButtonSelector: "#guido__undo-button",
|
|
26
28
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -44,21 +46,21 @@ const j = (s) => {
|
|
|
44
46
|
},
|
|
45
47
|
mergeTags: [
|
|
46
48
|
{
|
|
47
|
-
entries:
|
|
49
|
+
entries: x(a.preselectedDynamicContentList)
|
|
48
50
|
}
|
|
49
51
|
],
|
|
50
52
|
async onTokenRefreshRequest(o) {
|
|
51
53
|
try {
|
|
52
|
-
const
|
|
53
|
-
o(
|
|
54
|
-
} catch (
|
|
55
|
-
d(
|
|
54
|
+
const e = await u();
|
|
55
|
+
o(e);
|
|
56
|
+
} catch (e) {
|
|
57
|
+
d(e, "Failed to refresh token");
|
|
56
58
|
}
|
|
57
59
|
},
|
|
58
60
|
onTemplateLoaded() {
|
|
59
61
|
try {
|
|
60
|
-
const { importCss: o } = S(), { activateCustomViewStyles:
|
|
61
|
-
o(),
|
|
62
|
+
const { importCss: o } = S(), { activateCustomViewStyles: e } = f();
|
|
63
|
+
o(), e(), a.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
62
64
|
t.hasChanges = !1;
|
|
63
65
|
}, 1e3);
|
|
64
66
|
} catch (o) {
|
|
@@ -77,7 +79,7 @@ const j = (s) => {
|
|
|
77
79
|
onDataChanged() {
|
|
78
80
|
t.hasChanges = !0;
|
|
79
81
|
},
|
|
80
|
-
onEvent:
|
|
82
|
+
onEvent: p,
|
|
81
83
|
ignoreClickOutsideSelectors: [
|
|
82
84
|
"#guido-dynamic-content-modal",
|
|
83
85
|
".in-on-board-wrapper",
|
|
@@ -86,31 +88,32 @@ const j = (s) => {
|
|
|
86
88
|
extensions: [
|
|
87
89
|
_,
|
|
88
90
|
h,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
b,
|
|
92
|
+
V,
|
|
93
|
+
w
|
|
91
94
|
]
|
|
92
95
|
}
|
|
93
96
|
);
|
|
94
|
-
},
|
|
97
|
+
}, g = (r) => new Promise((i, t) => {
|
|
98
|
+
var e;
|
|
95
99
|
if (document.getElementById("UiEditorScript")) {
|
|
96
100
|
r(), i();
|
|
97
101
|
return;
|
|
98
102
|
}
|
|
99
|
-
const e = document.createElement("script");
|
|
100
|
-
|
|
103
|
+
const n = A.guido, s = `https://email-static.useinsider.com/guido/${(e = n == null ? void 0 : n.stripo) == null ? void 0 : e.version}/UIEditor.js`, o = document.createElement("script");
|
|
104
|
+
o.id = "UiEditorScript", o.type = "module", o.src = s, o.onload = () => {
|
|
101
105
|
r(), i();
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, document.body.appendChild(e);
|
|
106
|
+
}, o.onerror = () => {
|
|
107
|
+
t(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
108
|
+
}, document.body.appendChild(o);
|
|
106
109
|
});
|
|
107
110
|
return { initPlugin: async (r) => {
|
|
108
|
-
await
|
|
109
|
-
const i = await
|
|
110
|
-
|
|
111
|
+
await g(async () => {
|
|
112
|
+
const i = await m();
|
|
113
|
+
l(r, i);
|
|
111
114
|
});
|
|
112
115
|
} };
|
|
113
116
|
};
|
|
114
117
|
export {
|
|
115
|
-
|
|
118
|
+
N as useStripo
|
|
116
119
|
};
|
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as l, LINK_TYPES as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { usePartner as U } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as l, LINK_TYPES as b, URLS as f } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as B } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as N } from "../../stores/config.js";
|
|
5
|
+
import { useUnsubscribeStore as I } from "../../stores/unsubscribe.js";
|
|
6
|
+
const T = [
|
|
5
7
|
{
|
|
6
8
|
id: "add-unsubscribe-link-values",
|
|
7
9
|
description: "Adding unsubscribe link values",
|
|
8
10
|
type: "custom",
|
|
9
11
|
processor: (t) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
|
|
13
|
+
if (!u)
|
|
14
|
+
return t;
|
|
15
|
+
let o = t;
|
|
16
|
+
const e = `/${i()}/email/${u}?user={{iid}}`;
|
|
17
|
+
return new DOMParser().parseFromString(o, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
|
|
18
|
+
var g;
|
|
19
|
+
const d = p.getAttribute("data-unsubscribe-page-list");
|
|
20
|
+
if (!d)
|
|
21
|
+
return;
|
|
22
|
+
const S = B(d), m = ((g = n.templates) == null ? void 0 : g.filter(
|
|
23
|
+
(c) => S.includes(c.id)
|
|
24
|
+
)) ?? [], R = m.some((c) => c.type === b.UNSUBSCRIBE_LINK_TYPE), _ = m.some((c) => c.type === b.PREFERENCES_LINK_TYPE), E = p.outerHTML;
|
|
25
|
+
let s = E;
|
|
26
|
+
R && (s = s.replace(
|
|
27
|
+
l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
28
|
+
f.UNSUBSCRIBE_URL + e
|
|
29
|
+
)), _ && (s = s.replace(
|
|
30
|
+
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
31
|
+
f.PREFERENCES_URL + e
|
|
32
|
+
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
|
|
33
|
+
}), o;
|
|
21
34
|
},
|
|
22
35
|
priority: 60
|
|
23
36
|
},
|
|
@@ -42,23 +55,23 @@ const S = [
|
|
|
42
55
|
description: "Adding universal link flags",
|
|
43
56
|
type: "custom",
|
|
44
57
|
processor: (t) => {
|
|
45
|
-
let
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
if (
|
|
58
|
+
let i = t;
|
|
59
|
+
const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
60
|
+
return a && a.forEach((n) => {
|
|
61
|
+
if (n.includes("insEmail=1"))
|
|
49
62
|
return;
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
return
|
|
63
|
+
if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
64
|
+
const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
|
|
65
|
+
const r = e.slice(6, e.length - 1).trim();
|
|
66
|
+
return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
|
|
54
67
|
});
|
|
55
|
-
|
|
68
|
+
i = i.replace(n, o);
|
|
56
69
|
}
|
|
57
|
-
}),
|
|
70
|
+
}), i;
|
|
58
71
|
},
|
|
59
72
|
priority: 63
|
|
60
73
|
}
|
|
61
74
|
];
|
|
62
75
|
export {
|
|
63
|
-
|
|
76
|
+
T as unsubscribeCompilerRules
|
|
64
77
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
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"), n = e.querySelectorAll("td.coupon-block.ins-coupon-code:not([esd-extension-block-id])");
|
|
13
|
+
return n.length === 0 ? t : (n.forEach((s) => {
|
|
14
|
+
const i = this.extractText(s), c = this.extractAttributes(s), l = h.replace("{@COUPON_CODE}", i).replace(
|
|
15
|
+
'class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"',
|
|
16
|
+
c.class
|
|
17
|
+
).replace(
|
|
18
|
+
'esd-extension-block-id="coupon-block"',
|
|
19
|
+
`esd-extension-block-id="coupon-block"${c.block}`
|
|
20
|
+
).replace(
|
|
21
|
+
'<p class="ins-title"',
|
|
22
|
+
`<p class="ins-title"${c.text}`
|
|
23
|
+
);
|
|
24
|
+
s.outerHTML = l;
|
|
25
|
+
}), e.documentElement.outerHTML);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
return console.error("CouponBlockMigrator failed:", e), t;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
extractText(t) {
|
|
31
|
+
var g;
|
|
32
|
+
const e = t.querySelector(".ins-title");
|
|
33
|
+
if (!e)
|
|
34
|
+
return "{@COUPON_CODE}";
|
|
35
|
+
const n = ((g = e.textContent) == null ? void 0 : g.trim()) || "{@COUPON_CODE}", s = e.getAttribute("style") || "", i = /font-weight\s*:\s*bold/i.test(s), c = /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), p = /vertical-align\s*:\s*super/i.test(s);
|
|
36
|
+
return [
|
|
37
|
+
[i, "strong"],
|
|
38
|
+
[c, "em"],
|
|
39
|
+
[l, "u"],
|
|
40
|
+
[u, "s"],
|
|
41
|
+
[a, "sub"],
|
|
42
|
+
[p, "sup"]
|
|
43
|
+
].reduce((b, [f, d]) => f ? `<${d}>${b}</${d}>` : b, n);
|
|
44
|
+
}
|
|
45
|
+
extractAttributes(t) {
|
|
46
|
+
const e = t.querySelector(".ins-title"), n = t.className.split(" ").filter((r) => r.startsWith("es-")), s = t.getAttribute("align"), i = t.getAttribute("bgcolor"), c = t.getAttribute("style"), l = e == null ? void 0 : e.getAttribute("style");
|
|
47
|
+
let u = 'class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block';
|
|
48
|
+
n.length && (u += ` ${n.join(" ")}`), u += '"';
|
|
49
|
+
let a = "";
|
|
50
|
+
if (s && (a += ` align="${s}"`), i && (a += ` bgcolor="${i}"`), c) {
|
|
51
|
+
const r = c.replace(/background-color[^;]+;?/gi, "").replace(/;+/g, ";").trim();
|
|
52
|
+
r && (a += ` style="${r.replace(/"/g, "'")}"`);
|
|
53
|
+
}
|
|
54
|
+
let p = "";
|
|
55
|
+
if (l) {
|
|
56
|
+
const r = 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, "'");
|
|
57
|
+
r && (p = ` style="${r}"`);
|
|
58
|
+
}
|
|
59
|
+
return { class: u, block: a, text: p };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function C(o) {
|
|
63
|
+
return new y().migrate(o);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
C as migrateCouponBlock
|
|
67
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
1
|
+
import { migrateCheckbox as o } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
|
|
2
3
|
import { migrateRadioButton as i } from "./radioButtonMigrator.js";
|
|
3
|
-
import { migrateUnsubscribe as
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
return
|
|
4
|
+
import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
|
|
5
|
+
const c = async (t) => {
|
|
6
|
+
let r = t;
|
|
7
|
+
return r = o(r), r = i(r), r = await e(r), r = m(r), r;
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
c as migrate
|
|
10
11
|
};
|