@useinsider/guido 1.0.2-beta.833da0e → 1.0.2-beta.8424df0

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 (102) hide show
  1. package/README.md +1 -43
  2. package/dist/@types/events.d.ts +0 -6
  3. package/dist/@types/generic.d.ts +0 -1
  4. package/dist/components/Guido.vue.d.ts +0 -3
  5. package/dist/components/Guido.vue.js +11 -11
  6. package/dist/components/Guido.vue2.js +61 -80
  7. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +12 -12
  8. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +8 -7
  9. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -3
  10. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  11. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  12. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -15
  13. package/dist/components/organisms/header/LeftSlot.vue.js +9 -10
  14. package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
  15. package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -15
  16. package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -3
  17. package/dist/components/organisms/header/RightSlot.vue.js +4 -6
  18. package/dist/components/organisms/header/RightSlot.vue2.js +28 -26
  19. package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
  20. package/dist/components/organisms/header/ViewOptions.vue2.js +15 -14
  21. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
  22. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
  23. package/dist/composables/useCustomInterfaceAppearance.js +19 -25
  24. package/dist/composables/useHtmlCompiler.js +9 -17
  25. package/dist/composables/usePartner.d.ts +0 -1
  26. package/dist/composables/usePartner.js +9 -16
  27. package/dist/composables/usePreviewMode.js +13 -13
  28. package/dist/composables/useStripo.js +51 -54
  29. package/dist/composables/useToaster.js +17 -17
  30. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -2
  31. package/dist/enums/defaults.d.ts +1 -6
  32. package/dist/enums/defaults.js +10 -47
  33. package/dist/guido.css +1 -1
  34. package/dist/static/styles/components/alert-message.css.js +2 -32
  35. package/dist/static/styles/components/button.css.js +2 -32
  36. package/dist/static/styles/components/wide-panel.css.js +2 -15
  37. package/dist/static/styles/variables.css.js +0 -10
  38. package/dist/stores/editor.d.ts +1 -194
  39. package/dist/stores/editor.js +2 -18
  40. package/dist/stores/preview.d.ts +8 -0
  41. package/dist/stores/preview.js +20 -12
  42. package/dist/utils/templatePreparation.js +14 -21
  43. package/package.json +2 -4
  44. package/dist/components/organisms/LoadingWrapper.vue.d.ts +0 -2
  45. package/dist/components/organisms/LoadingWrapper.vue.js +0 -18
  46. package/dist/components/organisms/LoadingWrapper.vue2.js +0 -12
  47. package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
  48. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
  49. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -37
  50. package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
  51. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
  52. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -83
  53. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
  54. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
  55. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
  56. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
  57. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -19
  58. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -43
  59. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
  60. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
  61. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -62
  62. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
  63. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
  64. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -37
  65. package/dist/composables/useHtmlValidator.d.ts +0 -3
  66. package/dist/composables/useHtmlValidator.js +0 -120
  67. package/dist/composables/useRecommendation.d.ts +0 -19
  68. package/dist/composables/useRecommendation.js +0 -27
  69. package/dist/composables/useSave.d.ts +0 -4
  70. package/dist/composables/useSave.js +0 -15
  71. package/dist/composables/useStripoEventHandler.d.ts +0 -3
  72. package/dist/composables/useStripoEventHandler.js +0 -20
  73. package/dist/config/compiler/outlookCompilerRules.js +0 -36
  74. package/dist/config/compiler/recommendationCompilerRules.d.ts +0 -2
  75. package/dist/config/compiler/recommendationCompilerRules.js +0 -83
  76. package/dist/config/compiler/socialCompilerRules.d.ts +0 -2
  77. package/dist/config/compiler/socialCompilerRules.js +0 -21
  78. package/dist/config/compiler/unsubscribeCompilerRules.d.ts +0 -2
  79. package/dist/config/compiler/unsubscribeCompilerRules.js +0 -64
  80. package/dist/enums/html-validator.d.ts +0 -6
  81. package/dist/enums/html-validator.js +0 -7
  82. package/dist/enums/onboarding.d.ts +0 -1
  83. package/dist/enums/onboarding.js +0 -8
  84. package/dist/enums/recommendation.d.ts +0 -54
  85. package/dist/enums/recommendation.js +0 -56
  86. package/dist/enums/unsubscribe.d.ts +0 -15
  87. package/dist/enums/unsubscribe.js +0 -17
  88. package/dist/mock/api/user-modal-state.d.ts +0 -2
  89. package/dist/mock/api/validator.d.ts +0 -2
  90. package/dist/services/onboardingApi.d.ts +0 -4
  91. package/dist/services/onboardingApi.js +0 -23
  92. package/dist/static/assets/onboarding-img.svg.js +0 -4
  93. package/dist/static/styles/components/loader.css.js +0 -10
  94. package/dist/static/styles/components/notification.css.js +0 -55
  95. package/dist/static/styles/components/popup.css.js +0 -68
  96. package/dist/static/styles/customEditorStyle.css.js +0 -24
  97. package/dist/stores/onboarding.d.ts +0 -1068
  98. package/dist/stores/onboarding.js +0 -95
  99. package/dist/stores/recommendation.d.ts +0 -10
  100. package/dist/stores/recommendation.js +0 -9
  101. package/dist/stores/unsubscribe.d.ts +0 -8
  102. package/dist/stores/unsubscribe.js +0 -9
@@ -1,33 +1,35 @@
1
- import { defineComponent as g, ref as l, computed as H } from "vue";
2
- import { useConfig as _ } from "../../../composables/useConfig.js";
3
- import { useExport as h } from "../../../composables/useExport.js";
4
- import { useSave as V } from "../../../composables/useSave.js";
5
- import { useTranslations as x } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as T } from "../../../stores/editor.js";
8
- import { getTooltipOptions as E } from "../../../utils/tooltipUtils.js";
9
- import { InButtonV2 as O } from "@useinsider/design-system-vue";
10
- const z = /* @__PURE__ */ g({
1
+ import { defineComponent as y, computed as p } from "vue";
2
+ import { useConfig as H } from "../../../composables/useConfig.js";
3
+ import { useExport as V } from "../../../composables/useExport.js";
4
+ import { useSaveStart as _, useSaveComplete as h } from "../../../composables/useGuidoActions.js";
5
+ import { useTranslations as w } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as T } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useEditorStore as O } from "../../../stores/editor.js";
8
+ import { usePreviewStore as g } from "../../../stores/preview.js";
9
+ import { useTemplatePreparation as x } from "../../../utils/templatePreparation.js";
10
+ import { getTooltipOptions as C } from "../../../utils/tooltipUtils.js";
11
+ import { InButtonV2 as D } from "@useinsider/design-system-vue";
12
+ const z = /* @__PURE__ */ y({
11
13
  __name: "RightSlot",
12
- setup(A, { expose: m }) {
13
- const { config: u } = _(), { exportHtml: r } = h(), { save: n } = V(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = T(), t = x(), e = l(!1), s = l(!1), c = () => {
14
- if (o.isVersionHistoryOpen) {
15
- a();
14
+ setup(A) {
15
+ const { config: m } = H(), { exportHtml: c } = V(), r = _(), s = h(), { openVersionHistory: i, closeVersionHistory: n } = T(), e = O(), o = w(), a = g(), l = () => {
16
+ if (e.isVersionHistoryOpen) {
17
+ n();
16
18
  return;
17
19
  }
18
20
  i();
19
- }, f = async () => {
20
- e.value = !0, await r(), e.value = !1;
21
- }, v = () => {
22
- o.isSaveAsTemplateDrawerOpen = !0;
23
- }, d = H(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), p = async (y) => {
24
- s.value = !0, o.loadingStatus = !0;
25
- const S = await n(y);
26
- return s.value = !1, o.loadingStatus = !1, S;
27
- };
28
- return m({
29
- handleSave: p
30
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: c, handleExport: f, handleSaveAs: v, versionHistoryTooltipText: d, handleSave: p, getTooltipOptions: E, InButtonV2: O };
21
+ }, f = () => {
22
+ e.isSaveAsTemplateDrawerOpen = !0;
23
+ }, u = p(() => e.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), v = async () => {
24
+ r();
25
+ try {
26
+ const { prepareTemplateDetails: t } = x(), d = await t();
27
+ s(d);
28
+ } catch (t) {
29
+ console.error("Failed to get template data for save:", t);
30
+ }
31
+ }, S = p(() => e.isVersionHistoryOpen || a.isPreviewModeOpen);
32
+ return { __sfc: !0, config: m, exportHtml: c, saveStart: r, saveComplete: s, openVersionHistory: i, closeVersionHistory: n, editorStore: e, trans: o, previewStore: a, handleVersionHistory: l, handleSaveAs: f, versionHistoryTooltipText: u, handleSave: v, isSaveButtonDisabled: S, getTooltipOptions: C, InButtonV2: D };
31
33
  }
32
34
  });
33
35
  export {
@@ -1,18 +1,18 @@
1
- import i from "./ViewOptions.vue2.js";
1
+ import r from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var t = this, s = t._self._c, e = t._self._setupProxy;
6
- return s("div", { staticClass: "view-options-wrapper" }, [s(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.editorStore.isViewOptionsDisabled, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } }), e.editorStore.isViewOptionsDisabled ? t._e() : s(e.InChips, { staticClass: "new-tag", attrs: { id: "guido__view-options-new-tag", styles: "stroke", value: "chips", "close-button": !1, interactive: !1, text: e.trans("settings.new") } })], 1);
7
- }, r = [], a = /* @__PURE__ */ o(
8
- i,
9
- n,
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
+ var t = this, o = t._self._c, e = t._self._setupProxy;
6
+ return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.previewStore.isPreviewModeOpen, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
10
8
  r,
9
+ s,
10
+ n,
11
11
  !1,
12
12
  null,
13
- "195ab6d4"
13
+ "aad05c54"
14
14
  );
15
- const c = a.exports;
15
+ const p = _.exports;
16
16
  export {
17
- c as default
17
+ p as default
18
18
  };
@@ -1,20 +1,21 @@
1
- import { defineComponent as n } from "vue";
2
- import { useTranslations as p } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as p } from "vue";
2
+ import { useTranslations as r } from "../../../composables/useTranslations.js";
3
3
  import { useEditorStore as s } from "../../../stores/editor.js";
4
- import { getTooltipOptions as o } from "../../../utils/tooltipUtils.js";
5
- import { InChips as r, InSegments as m } from "@useinsider/design-system-vue";
6
- const f = /* @__PURE__ */ n({
4
+ import { usePreviewStore as m } from "../../../stores/preview.js";
5
+ import { getTooltipOptions as t } from "../../../utils/tooltipUtils.js";
6
+ import { InSegments as l } from "@useinsider/design-system-vue";
7
+ const w = /* @__PURE__ */ p({
7
8
  __name: "ViewOptions",
8
- setup(l) {
9
- const e = s(), t = p(), i = [
9
+ setup(a) {
10
+ const e = s(), o = r(), i = [
10
11
  {
11
12
  text: "",
12
13
  icon: "line-desktop",
13
14
  value: "desktop",
14
15
  position: "bottom",
15
16
  align: "center",
16
- tooltipText: t("newsletter.desktop"),
17
- tooltipOptions: o("guido__view-option-desktop")
17
+ tooltipText: o("newsletter.desktop"),
18
+ tooltipOptions: t("guido__view-option-desktop")
18
19
  },
19
20
  {
20
21
  text: "",
@@ -22,13 +23,13 @@ const f = /* @__PURE__ */ n({
22
23
  value: "mobile",
23
24
  position: "bottom",
24
25
  align: "center",
25
- tooltipText: t("newsletter.mobile"),
26
- tooltipOptions: o("guido__view-option-mobile")
26
+ tooltipText: o("newsletter.mobile"),
27
+ tooltipOptions: t("guido__view-option-mobile")
27
28
  }
28
- ];
29
- return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: m, InChips: r };
29
+ ], n = m();
30
+ return { __sfc: !0, editorStore: e, trans: o, segmentList: i, previewStore: n, InSegments: l };
30
31
  }
31
32
  });
32
33
  export {
33
- f as default
34
+ w as default
34
35
  };
@@ -1,18 +1,18 @@
1
- import i from "./ViewOptions.vue2.js";
1
+ import s from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var s = this, t = s._self._c, e = s._self._setupProxy;
6
- return t("div", { staticClass: "view-options-wrapper" }, [t(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } }), t(e.InChips, { staticClass: "new-tag", attrs: { id: "guido__view-options-new-tag", styles: "stroke", value: "chips", "close-button": !1, interactive: !1, text: e.trans("settings.new") } })], 1);
7
- }, r = [], a = /* @__PURE__ */ o(
8
- i,
9
- n,
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, o = t._self._c, e = t._self._setupProxy;
6
+ return o(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
8
+ s,
10
9
  r,
10
+ n,
11
11
  !1,
12
12
  null,
13
- "d405ca59"
13
+ "421ffc13"
14
14
  );
15
- const d = a.exports;
15
+ const f = _.exports;
16
16
  export {
17
- d as default
17
+ f as default
18
18
  };
@@ -3,10 +3,10 @@ import { useTranslations as m } from "../../../../composables/useTranslations.js
3
3
  import { useVersionHistoryApi as l } from "../../../../composables/useVersionHistoryApi.js";
4
4
  import { useVersionHistoryStore as a } from "../../../../stores/version-history.js";
5
5
  import { getTooltipOptions as n } from "../../../../utils/tooltipUtils.js";
6
- import { InChips as c, InSegments as u } from "@useinsider/design-system-vue";
7
- const T = /* @__PURE__ */ p({
6
+ import { InSegments as c } from "@useinsider/design-system-vue";
7
+ const h = /* @__PURE__ */ p({
8
8
  __name: "ViewOptions",
9
- setup(_) {
9
+ setup(u) {
10
10
  const t = a(), { switchToDesktopPreview: e, switchToMobilePreview: i } = l(), o = m(), r = [
11
11
  {
12
12
  text: "",
@@ -33,9 +33,9 @@ const T = /* @__PURE__ */ p({
33
33
  return;
34
34
  }
35
35
  e();
36
- }, InSegments: u, InChips: c };
36
+ }, InSegments: c };
37
37
  }
38
38
  });
39
39
  export {
40
- T as default
40
+ h as default
41
41
  };
@@ -1,49 +1,43 @@
1
1
  import S from "../static/styles/base.css.js";
2
- import m from "../static/styles/components/alert-message.css.js";
3
- import e from "../static/styles/components/amp-block.css.js";
2
+ import e from "../static/styles/components/alert-message.css.js";
3
+ import m from "../static/styles/components/amp-block.css.js";
4
4
  import i from "../static/styles/components/base-input.css.js";
5
5
  import p from "../static/styles/components/button-group.css.js";
6
6
  import n from "../static/styles/components/button.css.js";
7
- import C from "../static/styles/components/combobox.css.js";
8
- import s from "../static/styles/components/counter.css.js";
7
+ import s from "../static/styles/components/combobox.css.js";
8
+ import C from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/loader.css.js";
11
- import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/notification.css.js";
13
- import d from "../static/styles/components/popup.css.js";
14
- import l from "../static/styles/components/switcher.css.js";
15
- import h from "../static/styles/components/tabs.css.js";
16
- import w from "../static/styles/components/tools.css.js";
17
- import y from "../static/styles/components/version-history.css.js";
18
- import B from "../static/styles/components/wide-panel.css.js";
19
- import b from "../static/styles/variables.css.js";
20
- const A = [
21
- b,
10
+ import a from "../static/styles/components/narrow-panel.css.js";
11
+ import u from "../static/styles/components/switcher.css.js";
12
+ import c from "../static/styles/components/tabs.css.js";
13
+ import d from "../static/styles/components/tools.css.js";
14
+ import l from "../static/styles/components/version-history.css.js";
15
+ import h from "../static/styles/components/wide-panel.css.js";
16
+ import w from "../static/styles/variables.css.js";
17
+ const y = [
18
+ w,
22
19
  // Must be on top
23
20
  S,
24
21
  // Must be on top
25
- m,
26
22
  e,
23
+ m,
27
24
  i,
28
25
  p,
29
26
  n,
30
- C,
31
27
  s,
28
+ C,
32
29
  f,
33
30
  a,
34
31
  u,
35
32
  c,
36
33
  d,
37
34
  l,
38
- h,
39
- w,
40
- y,
41
- B
35
+ h
42
36
  ].join(`
43
37
 
44
- `), F = () => ({ importCss: () => {
38
+ `), N = () => ({ importCss: () => {
45
39
  const o = new CSSStyleSheet();
46
- o.replaceSync(A);
40
+ o.replaceSync(y);
47
41
  const r = document.querySelector("ui-editor");
48
42
  if (!r)
49
43
  return;
@@ -51,5 +45,5 @@ const A = [
51
45
  t && (t.adoptedStyleSheets = [o]);
52
46
  } });
53
47
  export {
54
- F as useCustomInterfaceAppearance
48
+ N as useCustomInterfaceAppearance
55
49
  };
@@ -1,25 +1,17 @@
1
- import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
2
- import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
3
- import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
4
- import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
5
- import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
6
- import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
7
- import { useConfig as f } from "./useConfig.js";
8
- const h = () => {
9
- const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
10
- ...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
11
- ...s,
12
- ...n,
13
- ...p,
14
- ...u,
1
+ import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
2
+ import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
3
+ import { useConfig as s } from "./useConfig.js";
4
+ const R = () => {
5
+ const { config: e } = s(), l = e.htmlCompilerRules || [], t = [
6
+ ...!!e.ignoreDefaultHtmlCompilerRules ? [] : r,
15
7
  ...l.map((o, i) => ({
16
8
  ...o,
17
9
  priority: o.priority + 1e3 + i
18
10
  // Ensure additional rules run after default rules
19
11
  }))
20
- ], r = c(m);
21
- return { compileHtml: (o) => r.compile(o) };
12
+ ], m = p(t);
13
+ return { compileHtml: (o) => m.compile(o) };
22
14
  };
23
15
  export {
24
- h as useHtmlCompiler
16
+ R as useHtmlCompiler
25
17
  };
@@ -1,5 +1,4 @@
1
1
  export declare const usePartner: () => {
2
2
  getPartnerName: () => string;
3
3
  getProductType: () => number;
4
- isTestPartner: () => boolean;
5
4
  };
@@ -1,18 +1,11 @@
1
- import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
2
- const i = () => {
3
- const e = () => window.location.hostname.split(".")[0] || "";
4
- return {
5
- getPartnerName: e,
6
- getProductType: () => {
7
- const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
8
- return n[t] || 0;
9
- },
10
- isTestPartner: () => {
11
- const t = e();
12
- return r.includes(t);
13
- }
14
- };
15
- };
1
+ import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
2
+ const c = () => ({
3
+ getPartnerName: () => window.location.hostname.split(".")[0] || "",
4
+ getProductType: () => {
5
+ const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
6
+ return o[t] || 0;
7
+ }
8
+ });
16
9
  export {
17
- i as usePartner
10
+ c as usePartner
18
11
  };
@@ -1,26 +1,26 @@
1
1
  import { useEditorStore as n } from "../stores/editor.js";
2
- import { usePreviewStore as l } from "../stores/preview.js";
3
- import { useActionsApi as m } from "./useActionsApi.js";
4
- import { useCodeEditorApi as p } from "./useCodeEditorApi.js";
2
+ import { usePreviewStore as m } from "../stores/preview.js";
3
+ import { useActionsApi as p } from "./useActionsApi.js";
4
+ import { useCodeEditorApi as l } from "./useCodeEditorApi.js";
5
5
  const E = () => {
6
- const o = n(), e = l(), { closeCodeEditor: a } = p(), { getPreviewData: s } = m(), r = () => {
7
- o.isPreviewModeOpen = !1, e.$reset();
6
+ const i = n(), e = m(), { closeCodeEditor: s } = l(), { getPreviewData: a } = p(), r = () => {
7
+ e.isPreviewModeOpen = !1, e.$reset();
8
8
  };
9
9
  return {
10
10
  closePreviewMode: r,
11
11
  openPreviewMode: () => {
12
- o.isCodeEditorOpen && a(), o.isPreviewModeOpen = !0;
12
+ i.isCodeEditorOpen && s(), e.isPreviewModeOpen = !0;
13
13
  },
14
14
  loadPreviewData: async () => {
15
- if (!(o.loadingStatus || e.isLoaded)) {
16
- o.loadingStatus = !0;
15
+ if (!(e.isLoading || e.isLoaded)) {
16
+ e.isLoading = !0;
17
17
  try {
18
- const { html: t, ampHtml: i, ampErrors: d } = await s();
19
- e.templateHtml = t || "", e.ampHtml = i || "", e.ampErrors = d || [], e.setEmailFormat(i ? "AMP" : "html"), e.isLoaded = !0;
20
- } catch (t) {
21
- console.error("Failed to load preview data:", t), r();
18
+ const { html: o, ampHtml: t, ampErrors: d } = await a();
19
+ e.templateHtml = o || "", e.ampHtml = t || "", e.ampErrors = d || [], e.setEmailFormat(t ? "AMP" : "html"), e.isLoaded = !0;
20
+ } catch (o) {
21
+ console.error("Failed to load preview data:", o), r();
22
22
  } finally {
23
- o.loadingStatus = !1;
23
+ e.isLoading = !1;
24
24
  }
25
25
  }
26
26
  }
@@ -1,23 +1,21 @@
1
- import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as S } from "./useCustomInterfaceAppearance.js";
3
- import { useStripoEventHandler as C } from "./useStripoEventHandler.js";
4
- import { useToaster as E } from "./useToaster.js";
5
- import { displayConditions as y } from "../enums/displayConditions.js";
6
- import h from "../extensions/DynamicContent/extension.js";
7
- import { useStripoApi as w } from "../services/stripoApi.js";
8
- import b from "../static/styles/customEditorStyle.css.js";
9
- import { useEditorStore as V } from "../stores/editor.js";
10
- import { dynamicContentToMergeTags as _ } from "../utils/genericUtil.js";
11
- const R = (s) => {
12
- const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = w(), { handleEvent: l } = C(), p = (r, i = []) => {
13
- const e = V(), { html: o, css: a, forceRecreate: g } = r;
1
+ import { useActionsApi as g } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
+ import { useToaster as S } from "./useToaster.js";
4
+ import { displayConditions as C } from "../enums/displayConditions.js";
5
+ import y from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as E } from "../services/stripoApi.js";
7
+ import { useEditorStore as h } from "../stores/editor.js";
8
+ import { dynamicContentToMergeTags as w } from "../utils/genericUtil.js";
9
+ const M = (d) => {
10
+ const { handleError: a } = S(), { getToken: c, getCustomFonts: u } = E(), l = (e, r = []) => {
11
+ const i = h(), { html: t, css: s, forceRecreate: p } = e;
14
12
  window.UIEditor.initEditor(
15
13
  document.querySelector("#guido-editor"),
16
14
  {
17
- metadata: s,
18
- html: o,
19
- css: a,
20
- forceRecreate: g,
15
+ metadata: d,
16
+ html: t,
17
+ css: s,
18
+ forceRecreate: p,
21
19
  locale: "en",
22
20
  undoButtonSelector: "#guido__undo-button",
23
21
  redoButtonSelector: "#guido__redo-button",
@@ -27,78 +25,77 @@ const R = (s) => {
27
25
  customAppearanceMergetags: !0,
28
26
  customAppearanceMergetagsBorderColor: "#f1f3fe",
29
27
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
30
- customViewStyles: b,
28
+ customViewStyles: `
29
+ .esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
30
+ .esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
31
+ `,
31
32
  conditionsEnabled: !0,
32
33
  customConditionsEnabled: !0,
33
- conditionCategories: y,
34
+ conditionCategories: C,
34
35
  enableXSSSecurity: !0,
35
36
  messageSettingsEnabled: !1,
36
- selectBlockAfterDropFromSettingsPanel: !0,
37
37
  editorFonts: {
38
38
  showDefaultStandardFonts: !0,
39
39
  showDefaultNotStandardFonts: !0,
40
- customFonts: i
40
+ customFonts: r
41
41
  },
42
42
  mergeTags: [
43
43
  {
44
- entries: _(s.preselectedDynamicContentList)
44
+ entries: w(d.preselectedDynamicContentList)
45
45
  }
46
46
  ],
47
- async onTokenRefreshRequest(t) {
47
+ async onTokenRefreshRequest(o) {
48
48
  try {
49
49
  const n = await c();
50
- t(n);
50
+ o(n);
51
51
  } catch (n) {
52
- d(n, "Failed to refresh token");
52
+ a(n, "Failed to refresh token");
53
53
  }
54
54
  },
55
55
  onTemplateLoaded() {
56
56
  try {
57
- const { importCss: t } = S(), { activateCustomViewStyles: n } = f();
58
- t(), n(), s.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
59
- e.hasChanges = !1;
60
- }, 1e3);
61
- } catch (t) {
62
- d(t, "Failed to load custom interface appearance");
57
+ const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
58
+ o(), n();
59
+ } catch (o) {
60
+ a(o, "Failed to load custom interface appearance");
63
61
  }
64
62
  },
65
- onCodeEditorVisibilityChanged(t) {
66
- e.isCodeEditorOpen = t;
63
+ onCodeEditorVisibilityChanged(o) {
64
+ i.isCodeEditorOpen = o;
67
65
  },
68
- onEditorVisualModeChanged(t) {
69
- e.editorVisualMode = t.toLowerCase();
66
+ onEditorVisualModeChanged(o) {
67
+ i.editorVisualMode = o.toLowerCase();
70
68
  },
71
- onVersionHistoryVisibilityChanged(t) {
72
- e.isVersionHistoryOpen = t;
69
+ onVersionHistoryVisibilityChanged(o) {
70
+ i.isVersionHistoryOpen = o;
73
71
  },
74
72
  onDataChanged() {
75
- e.hasChanges = !0;
73
+ i.hasChanges = !0;
76
74
  },
77
- onEvent: l,
78
- ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
79
- extensions: [h]
75
+ ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
76
+ extensions: [y]
80
77
  }
81
78
  );
82
- }, m = (r) => new Promise((i, e) => {
79
+ }, m = (e) => new Promise((r, i) => {
83
80
  if (document.getElementById("UiEditorScript")) {
84
- r(), i();
81
+ e(), r();
85
82
  return;
86
83
  }
87
- const o = document.createElement("script");
88
- o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
89
- r(), i();
90
- }, o.onerror = () => {
91
- const a = new Error("Failed to load Stripo UIEditor script");
92
- e(a);
93
- }, document.body.appendChild(o);
84
+ const t = document.createElement("script");
85
+ t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
86
+ e(), r();
87
+ }, t.onerror = () => {
88
+ const s = new Error("Failed to load Stripo UIEditor script");
89
+ i(s);
90
+ }, document.body.appendChild(t);
94
91
  });
95
- return { initPlugin: async (r) => {
92
+ return { initPlugin: async (e) => {
96
93
  await m(async () => {
97
- const i = await u();
98
- p(r, i);
94
+ const r = await u();
95
+ l(e, r);
99
96
  });
100
97
  } };
101
98
  };
102
99
  export {
103
- R as useStripo
100
+ M as useStripo
104
101
  };
@@ -1,31 +1,31 @@
1
- import { ToasterTypeOptions as T } from "../enums/toaster.js";
2
- import { useToasterStore as u } from "../stores/toaster.js";
3
- import { watch as c } from "vue";
4
- const d = () => {
5
- const t = u();
6
- let o = null;
7
- const s = () => {
8
- o && (clearTimeout(o), o = null);
1
+ import { ToasterTypeOptions as u } from "../enums/toaster.js";
2
+ import { useToasterStore as T } from "../stores/toaster.js";
3
+ import { watch as c, onUnmounted as l } from "vue";
4
+ const p = () => {
5
+ const t = T();
6
+ let s = null;
7
+ const o = () => {
8
+ s && (clearTimeout(s), s = null);
9
9
  };
10
10
  function r(e = { message: "" }) {
11
- s(), t.hideToaster(), t.showToaster(e);
11
+ o(), t.hideToaster(), t.showToaster(e);
12
12
  }
13
- function i() {
14
- s(), t.hideToaster();
13
+ function n() {
14
+ o(), t.hideToaster();
15
15
  }
16
- function a(e, n) {
16
+ function i(e, a) {
17
17
  const m = e instanceof Error ? e.message : String(e);
18
- r({ type: T.Alert, message: `${n}: ${m}` });
18
+ r({ type: u.Alert, message: `${a}: ${m}` });
19
19
  }
20
20
  return c(
21
21
  () => t.shouldAutoHide,
22
22
  (e) => {
23
- s(), e && (o = setTimeout(() => {
24
- t.hideToaster(), s();
23
+ o(), e && (s = setTimeout(() => {
24
+ t.hideToaster(), o();
25
25
  }, 6e3));
26
26
  }
27
- ), { showToaster: r, hideToaster: i, handleError: a };
27
+ ), l(o), { showToaster: r, hideToaster: n, handleError: i };
28
28
  };
29
29
  export {
30
- d as useToaster
30
+ p as useToaster
31
31
  };
@@ -1,2 +0,0 @@
1
- import type { CompilerRule } from '@@/Types/html-compiler';
2
- export declare const outlookCompilerRules: CompilerRule[];
@@ -1,12 +1,7 @@
1
1
  import type { GuidoConfig } from '@@/Types/generic';
2
2
  export declare const DefaultGuidoConfig: GuidoConfig;
3
- export declare const TemplateTypes: {
4
- promotional: number;
5
- transactional: number;
6
- };
7
3
  export declare const DefaultProductType = "email";
8
4
  export declare const DefaultUsername = "Guido User";
9
- export declare const DefaultMessageType: number;
5
+ export declare const DefaultMessageType = 1;
10
6
  export declare const EditorType: number;
11
7
  export declare const ProductIds: Record<string, number>;
12
- export declare const TEST_PARTNER_LIST: string[];