@useinsider/guido 1.0.3-beta.a6a2da8 → 1.0.3-beta.a7c1898

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.
Files changed (110) hide show
  1. package/dist/@types/generic.d.ts +0 -9
  2. package/dist/components/Guido.vue.d.ts +2 -2
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +69 -74
  5. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  6. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  7. package/dist/composables/useStripo.js +11 -17
  8. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
  9. package/dist/config/migrator/couponBlockMigrator.js +32 -32
  10. package/dist/config/migrator/index.d.ts +1 -1
  11. package/dist/config/migrator/index.js +6 -7
  12. package/dist/enums/defaults.js +3 -6
  13. package/dist/enums/unsubscribe.d.ts +0 -19
  14. package/dist/enums/unsubscribe.js +6 -39
  15. package/dist/extensions/Blocks/Checkbox/block.d.ts +0 -1
  16. package/dist/extensions/Blocks/Checkbox/block.js +24 -15
  17. package/dist/extensions/Blocks/Checkbox/control.js +38 -24
  18. package/dist/extensions/Blocks/Checkbox/extension.js +16 -5
  19. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +25 -12
  20. package/dist/extensions/Blocks/Checkbox/template.js +16 -5
  21. package/dist/extensions/Blocks/CouponBlock/block.d.ts +0 -1
  22. package/dist/extensions/Blocks/CouponBlock/block.js +24 -14
  23. package/dist/extensions/Blocks/CouponBlock/extension.js +16 -5
  24. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +29 -16
  25. package/dist/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  26. package/dist/extensions/Blocks/CouponBlock/template.js +11 -9
  27. package/dist/extensions/Blocks/RadioButton/block.d.ts +0 -1
  28. package/dist/extensions/Blocks/RadioButton/block.js +22 -13
  29. package/dist/extensions/Blocks/RadioButton/control.js +46 -32
  30. package/dist/extensions/Blocks/RadioButton/extension.js +15 -4
  31. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +26 -13
  32. package/dist/extensions/Blocks/RadioButton/template.js +18 -7
  33. package/dist/extensions/Blocks/_Boilerplate/block.d.ts +0 -1
  34. package/dist/extensions/DynamicContent/dynamic-content.js +45 -31
  35. package/dist/extensions/DynamicContent/extension.js +18 -6
  36. package/dist/guido.css +1 -1
  37. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +75 -0
  38. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +77 -0
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +123 -0
  40. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +7 -0
  41. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +7 -0
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +12 -0
  43. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +7 -0
  44. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +119 -0
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +7 -0
  46. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +7 -0
  47. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +7 -0
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +12 -0
  49. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +7 -0
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +7 -0
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +7 -0
  52. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +24 -0
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +24 -0
  54. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +11 -0
  55. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +33 -0
  56. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +22 -0
  57. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +40 -0
  58. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +5 -0
  59. package/dist/static/assets/icons/coupon.svg.js +4 -0
  60. package/dist/stores/unsubscribe.d.ts +5 -253
  61. package/dist/stores/unsubscribe.js +6 -126
  62. package/dist/utils/templatePreparation.js +16 -17
  63. package/package.json +2 -2
  64. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  65. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  66. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  67. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  68. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  69. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  70. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  71. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  72. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  73. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  74. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  75. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  76. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  77. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  78. package/dist/extensions/Blocks/Checkbox/iconsRegistry.d.ts +0 -4
  79. package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +0 -18
  80. package/dist/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +0 -4
  81. package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +0 -33
  82. package/dist/extensions/Blocks/RadioButton/iconsRegistry.d.ts +0 -4
  83. package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +0 -14
  84. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  85. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  86. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  87. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  88. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  89. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  90. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  91. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  92. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
  93. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  94. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  95. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  96. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  97. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  98. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  99. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  100. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  101. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  102. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  103. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  104. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  105. package/dist/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
  106. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +0 -648
  107. package/dist/services/unsubscribeApi.d.ts +0 -4
  108. package/dist/services/unsubscribeApi.js +0 -16
  109. package/dist/stores/config.d.ts +0 -96
  110. package/dist/stores/config.js +0 -17
@@ -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,14 +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
- variationId?: string;
29
- };
30
21
  export type DynamicContent = {
31
22
  value: string;
32
23
  text: string;
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, GuidoConfig, TemplateConfig } from '@@/Types/generic';
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 a from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
5
- var o = this, r = o._self._c, e = o._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) : o._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() ? o._e() : r(e.OnboardingWrapper), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
7
- }, t = [], d = /* @__PURE__ */ i(
8
- a,
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
- "96687c1d"
13
+ "aca05338"
14
14
  );
15
15
  const v = d.exports;
16
16
  export {
@@ -1,22 +1,19 @@
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({
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({
20
17
  __name: "Guido",
21
18
  props: {
22
19
  templateId: null,
@@ -27,86 +24,84 @@ const Ee = /* @__PURE__ */ x({
27
24
  username: null,
28
25
  html: null,
29
26
  css: null,
30
- guidoConfig: null,
31
- templateConfig: null
27
+ preselectedDynamicContentList: null,
28
+ guidoConfig: null
32
29
  },
33
30
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
34
- setup(_, { expose: L, emit: t }) {
35
- const d = _, k = U(
31
+ setup(I, { expose: L, emit: o }) {
32
+ const r = I, _ = E(
36
33
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), A = U(
34
+ ), W = E(
38
35
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
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 = () => {
36
+ ), d = R(), a = Y(), m = Z(), k = $(), t = G(() => m.hasChanges), i = r.preselectedDynamicContentList || [], { getPartnerName: l, getProductType: u, isTestPartner: A } = z(), p = () => {
40
37
  var e;
41
- return (e = m.value) == null ? void 0 : e.handleSave(!0);
38
+ return (e = d.value) == null ? void 0 : e.handleSave(!0);
42
39
  }, {
43
- templateId: v,
44
- userId: b,
45
- guidoConfig: C,
46
- templateConfig: o,
47
- html: r = "",
48
- css: h = "",
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 = {
55
- partnerName: a,
56
- productType: i,
57
- messageType: S
58
- }, l.templateConfig = o;
59
- const { initPlugin: D } = j({
60
- emailId: v,
61
- userId: b,
62
- username: w,
63
- partnerName: a,
64
- productType: i,
65
- preselectedDynamicContentList: c,
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,
53
+ messageType: C
54
+ };
55
+ const { initPlugin: w } = B({
56
+ emailId: g,
57
+ userId: f,
58
+ username: h,
59
+ partnerName: s,
60
+ productType: c,
61
+ preselectedDynamicContentList: i,
66
62
  onReady: () => {
67
- console.debug("guido:ready"), t("ready");
63
+ console.debug("guido:ready"), o("ready");
68
64
  }
69
- }), { getDefaultTemplate: T } = ee(), R = I(() => {
65
+ }), { getDefaultTemplate: S } = X(), N = G(() => {
70
66
  var e;
71
67
  return !((e = window.GuidoConfig) != null && e.useHeader);
72
68
  });
73
- K({
69
+ M({
74
70
  onBack: () => {
75
- console.debug("guido:back"), t("back");
71
+ console.debug("guido:back"), o("back");
76
72
  },
77
73
  onSaveStart: () => {
78
- console.debug("guido:save:start"), t("save:start");
74
+ console.debug("guido:save:start"), o("save:start");
79
75
  },
80
76
  onSaveComplete: (e) => {
81
- console.debug("guido:save:complete", e), t("save:complete", e);
77
+ console.debug("guido:save:complete", e), o("save:complete", e);
82
78
  }
83
79
  });
84
- const E = (e) => {
85
- console.debug("dynamic-content:close", e), s.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
86
- }, P = () => {
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 = () => {
87
83
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
88
84
  };
89
- return M(() => n.value, () => {
90
- t("on-change", n.value);
91
- }), z(async () => {
85
+ return U(() => t.value, () => {
86
+ o("on-change", t.value);
87
+ }), x(async () => {
92
88
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
93
89
  try {
94
- u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
95
90
  let e = {
96
- html: r && await W(r),
97
- css: h,
91
+ html: n && P(n),
92
+ css: v,
98
93
  forceRecreate: !0
99
94
  // TODO: It should be false for old templates. We will communicate with Stripo
100
95
  };
101
- e.html || (e = await T(), e.html = await W(e.html)), await D(e), s.selectedDynamicContentList = c;
96
+ e.html || (e = await S(), e.html = P(e.html)), await w(e), a.selectedDynamicContentList = i;
102
97
  } catch (e) {
103
98
  console.error("Failed to initialize Stripo editor:", e);
104
99
  }
105
100
  document.addEventListener("dynamic-content:open", (e) => {
106
- const G = e;
107
- console.debug("dynamic-content:open", G.detail), t("dynamic-content:open", G.detail);
101
+ const T = e;
102
+ console.debug("dynamic-content:open", T.detail), o("dynamic-content:open", T.detail);
108
103
  });
109
- }), B(() => {
104
+ }), F(() => {
110
105
  try {
111
106
  window.UIEditor.removeEditor();
112
107
  } catch {
@@ -114,14 +109,14 @@ const Ee = /* @__PURE__ */ x({
114
109
  }
115
110
  }), L({
116
111
  dynamicContent: {
117
- insert: E,
118
- close: P
112
+ insert: b,
113
+ close: D
119
114
  },
120
- hasChanges: n,
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: $ };
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 };
123
118
  }
124
119
  });
125
120
  export {
126
- Ee as default
121
+ ye as default
127
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?: 'small' | 'medium' | 'large';
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: {}, __VLS_14: {};
13
+ declare var __VLS_12: {};
14
14
  type __VLS_Slots = {} & {
15
- headerBottomSlot?: (props: typeof __VLS_12) => any;
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: "small" | "medium" | "large";
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 u = function() {
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([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
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
- }, i = [], c = /* @__PURE__ */ s(
14
+ }, u = [], c = /* @__PURE__ */ s(
17
15
  r,
18
- u,
19
16
  i,
17
+ u,
20
18
  !1,
21
19
  null,
22
20
  null
@@ -1,20 +1,19 @@
1
1
  import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as E } from "./useCustomInterfaceAppearance.js";
3
- import { useStripoEventHandler as S } from "./useStripoEventHandler.js";
2
+ import { useCustomInterfaceAppearance as S } from "./useCustomInterfaceAppearance.js";
3
+ 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
7
  import w from "../extensions/Blocks/CouponBlock/extension.js";
8
8
  import b from "../extensions/Blocks/RadioButton/extension.js";
9
- import _ from "../extensions/Blocks/Unsubscribe/extension.js";
10
9
  import k from "../extensions/DynamicContent/extension.js";
11
10
  import { useStripoApi as B } from "../services/stripoApi.js";
12
11
  import V from "../static/styles/customEditorStyle.css.js";
13
- import { useEditorStore as F } from "../stores/editor.js";
14
- import { dynamicContentToMergeTags as x } from "../utils/genericUtil.js";
15
- const N = (s) => {
16
- const { handleError: d } = C(), { getToken: c, getCustomFonts: u } = B(), { handleEvent: l } = S(), m = (r, i = []) => {
17
- const t = F(), { html: e, css: a, forceRecreate: g } = r;
12
+ import { useEditorStore as _ } from "../stores/editor.js";
13
+ import { dynamicContentToMergeTags as F } from "../utils/genericUtil.js";
14
+ const j = (s) => {
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;
18
17
  window.UIEditor.initEditor(
19
18
  document.querySelector("#guido-editor"),
20
19
  {
@@ -45,7 +44,7 @@ const N = (s) => {
45
44
  },
46
45
  mergeTags: [
47
46
  {
48
- entries: x(s.preselectedDynamicContentList)
47
+ entries: F(s.preselectedDynamicContentList)
49
48
  }
50
49
  ],
51
50
  async onTokenRefreshRequest(o) {
@@ -58,7 +57,7 @@ const N = (s) => {
58
57
  },
59
58
  onTemplateLoaded() {
60
59
  try {
61
- const { importCss: o } = E(), { activateCustomViewStyles: n } = f();
60
+ const { importCss: o } = S(), { activateCustomViewStyles: n } = f();
62
61
  o(), n(), s.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
63
62
  t.hasChanges = !1;
64
63
  }, 1e3);
@@ -79,16 +78,11 @@ const N = (s) => {
79
78
  t.hasChanges = !0;
80
79
  },
81
80
  onEvent: l,
82
- ignoreClickOutsideSelectors: [
83
- "#guido-dynamic-content-modal",
84
- ".in-on-board-wrapper",
85
- ".in-drawer__container"
86
- ],
81
+ ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
87
82
  extensions: [
88
83
  k,
89
84
  h,
90
85
  b,
91
- _,
92
86
  w
93
87
  ]
94
88
  }
@@ -114,5 +108,5 @@ const N = (s) => {
114
108
  } };
115
109
  };
116
110
  export {
117
- N as useStripo
111
+ j as useStripo
118
112
  };
@@ -1,36 +1,23 @@
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 = [
1
+ import { usePartner as m } from "../../composables/usePartner.js";
2
+ import { LINK_REGEXES as c, LINK_TYPES as p, URLS as E } from "../../enums/unsubscribe.js";
3
+ import { useUnsubscribeStore as b } from "../../stores/unsubscribe.js";
4
+ const S = [
7
5
  {
8
6
  id: "add-unsubscribe-link-values",
9
7
  description: "Adding unsubscribe link values",
10
8
  type: "custom",
11
- processor: (t) => {
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;
9
+ processor: (n) => {
10
+ var a, u;
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
+ return r && (e = e.replace(
15
+ c.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
16
+ E.UNSUBSCRIBE_URL + o
17
+ )), s && (e = e.replace(
18
+ c.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
19
+ E.PREFERENCES_URL + o
20
+ )), e.replace(c.UNSUBSCRIBE_LINK_REGEX, "");
34
21
  },
35
22
  priority: 60
36
23
  },
@@ -38,7 +25,7 @@ const T = [
38
25
  id: "remove-data-ogsb-button-styles",
39
26
  description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
40
27
  type: "regex",
41
- pattern: l.DATA_OGSB_BUTTON_CSS_REGEX,
28
+ pattern: c.DATA_OGSB_BUTTON_CSS_REGEX,
42
29
  replacement: "",
43
30
  flags: "g",
44
31
  priority: 61
@@ -47,25 +34,25 @@ const T = [
47
34
  id: "format-comment-braces",
48
35
  description: "Adding spaces around comment braces for proper formatting",
49
36
  type: "custom",
50
- processor: (t) => t.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
37
+ processor: (n) => n.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
51
38
  priority: 62
52
39
  },
53
40
  {
54
41
  id: "add-universal-link-flags",
55
42
  description: "Adding universal link flags",
56
43
  type: "custom",
57
- processor: (t) => {
58
- let i = t;
59
- const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
- return a && a.forEach((n) => {
61
- if (n.includes("insEmail=1"))
44
+ processor: (n) => {
45
+ let i = n;
46
+ const t = i.match(/<a[^>]+>(.*?)<\/a>/gm);
47
+ return t && t.forEach((e) => {
48
+ if (e.includes("insEmail=1"))
62
49
  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`);
50
+ if (e.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
51
+ const o = e.replace(/href=(["'`”])(.*?)\1/gm, (r) => {
52
+ const s = r.slice(6, r.length - 1).trim();
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`);
67
54
  });
68
- i = i.replace(n, o);
55
+ i = i.replace(e, o);
69
56
  }
70
57
  }), i;
71
58
  },
@@ -73,5 +60,5 @@ const T = [
73
60
  }
74
61
  ];
75
62
  export {
76
- T as unsubscribeCompilerRules
63
+ S as unsubscribeCompilerRules
77
64
  };
@@ -1,8 +1,8 @@
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 {
1
+ var m = Object.defineProperty;
2
+ var h = (r, t, e) => t in r ? m(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var x = (r, t, e) => h(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import y from "../../extensions/Blocks/CouponBlock/template.js";
5
+ class k {
6
6
  constructor() {
7
7
  x(this, "parser");
8
8
  this.parser = new DOMParser();
@@ -11,17 +11,17 @@ class y {
11
11
  try {
12
12
  const e = this.parser.parseFromString(t, "text/html"), n = e.querySelectorAll("td.coupon-block.ins-coupon-code:not([esd-extension-block-id])");
13
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(
14
+ const l = this.extractText(s), c = this.extractAttributes(s), a = y.replace("{@COUPON_CODE}", l).replace('class="coupon-block ins-coupon-code esd-block-text esd-extension-block"', c.class).replace(
18
15
  'esd-extension-block-id="coupon-block"',
19
16
  `esd-extension-block-id="coupon-block"${c.block}`
20
17
  ).replace(
21
18
  '<p class="ins-title"',
22
19
  `<p class="ins-title"${c.text}`
23
- );
24
- s.outerHTML = l;
20
+ ), o = this.parser.parseFromString(
21
+ `<table id="tempDoc"><tbody><tr>${a}</tr></tbody></table>`,
22
+ "text/html"
23
+ ).querySelector(".coupon-block.ins-coupon-code");
24
+ o && s.parentNode && (s.id && (o.id = s.id), s.parentNode.replaceChild(o, s));
25
25
  }), e.documentElement.outerHTML);
26
26
  } catch (e) {
27
27
  return console.error("CouponBlockMigrator failed:", e), t;
@@ -32,35 +32,35 @@ class y {
32
32
  const e = t.querySelector(".ins-title");
33
33
  if (!e)
34
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);
35
+ const n = ((g = e.textContent) == null ? void 0 : g.trim()) || "{@COUPON_CODE}", s = e.getAttribute("style") || "", l = /font-weight\s*:\s*bold/i.test(s), c = /font-style\s*:\s*italic/i.test(s), a = /text-decoration[^;]*underline/i.test(s), p = /text-decoration[^;]*line-through/i.test(s), o = /vertical-align\s*:\s*sub/i.test(s), u = /vertical-align\s*:\s*super/i.test(s);
36
36
  return [
37
- [i, "strong"],
37
+ [l, "strong"],
38
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);
39
+ [a, "u"],
40
+ [p, "s"],
41
+ [o, "sub"],
42
+ [u, "sup"]
43
+ ].reduce((d, [f, b]) => f ? `<${b}>${d}</${b}>` : d, n);
44
44
  }
45
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, "'")}"`);
46
+ const e = t.querySelector(".ins-title"), n = t.className.split(" ").filter((i) => i.startsWith("es-")), s = t.getAttribute("align"), l = t.getAttribute("bgcolor"), c = t.getAttribute("style"), a = e == null ? void 0 : e.getAttribute("style");
47
+ let p = 'class="coupon-block ins-coupon-code esd-block-text esd-extension-block';
48
+ n.length && (p += ` ${n.join(" ")}`), p += '"';
49
+ let o = "";
50
+ if (s && (o += ` align="${s}"`), l && (o += ` bgcolor="${l}"`), c) {
51
+ const i = c.replace(/background-color[^;]+;?/gi, "").replace(/;+/g, ";").trim();
52
+ i && (o += ` style="${i.replace(/"/g, "'")}"`);
53
53
  }
54
- let p = "";
55
- if (l) {
56
- const r = l.replace(/&quot;/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}"`);
54
+ let u = "";
55
+ if (a) {
56
+ const i = a.replace(/&quot;/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
+ i && (u = ` style="${i}"`);
58
58
  }
59
- return { class: u, block: a, text: p };
59
+ return { class: p, block: o, text: u };
60
60
  }
61
61
  }
62
- function C(o) {
63
- return new y().migrate(o);
62
+ function C(r) {
63
+ return new k().migrate(r);
64
64
  }
65
65
  export {
66
66
  C as migrateCouponBlock
@@ -1 +1 @@
1
- export declare const migrate: (html: string) => Promise<string>;
1
+ export declare const migrate: (html: string) => string;
@@ -1,11 +1,10 @@
1
- import { migrateCheckbox as o } from "./checkboxMigrator.js";
2
- import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
1
+ import { migrateCheckbox as t } from "./checkboxMigrator.js";
2
+ import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
3
3
  import { migrateRadioButton as i } from "./radioButtonMigrator.js";
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;
4
+ const p = (o) => {
5
+ let r = o;
6
+ return r = t(o), r = i(o), r = e(o), r;
8
7
  };
9
8
  export {
10
- c as migrate
9
+ p as migrate
11
10
  };