@useinsider/guido 1.0.2-beta.e5fcba7 → 1.0.2-beta.efc8835

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 (73) hide show
  1. package/README.md +1 -30
  2. package/dist/@types/events.d.ts +0 -6
  3. package/dist/@types/generic.d.ts +0 -4
  4. package/dist/components/Guido.vue.d.ts +1 -2
  5. package/dist/components/Guido.vue.js +2 -2
  6. package/dist/components/Guido.vue2.js +54 -60
  7. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -3
  9. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  10. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  11. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -15
  12. package/dist/components/organisms/header/LeftSlot.vue.js +10 -10
  13. package/dist/components/organisms/header/LeftSlot.vue2.js +10 -23
  14. package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -3
  15. package/dist/components/organisms/header/RightSlot.vue.js +3 -5
  16. package/dist/components/organisms/header/RightSlot.vue2.js +19 -23
  17. package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
  18. package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
  19. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
  20. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
  21. package/dist/composables/useCustomInterfaceAppearance.js +18 -22
  22. package/dist/composables/useHtmlValidator.d.ts +1 -2
  23. package/dist/composables/useHtmlValidator.js +75 -85
  24. package/dist/composables/usePartner.d.ts +0 -1
  25. package/dist/composables/usePartner.js +9 -16
  26. package/dist/composables/useSave.d.ts +1 -2
  27. package/dist/composables/useSave.js +8 -9
  28. package/dist/composables/useStripo.js +26 -30
  29. package/dist/composables/useVersionHistoryApi.js +9 -10
  30. package/dist/enums/defaults.d.ts +0 -1
  31. package/dist/enums/defaults.js +10 -42
  32. package/dist/guido.css +1 -1
  33. package/dist/static/styles/components/alert-message.css.js +2 -32
  34. package/dist/static/styles/components/button.css.js +2 -32
  35. package/dist/static/styles/components/wide-panel.css.js +1 -5
  36. package/dist/static/styles/customEditorStyle.css.js +0 -6
  37. package/dist/static/styles/variables.css.js +0 -10
  38. package/dist/stores/dynamic-content.d.ts +0 -12
  39. package/dist/stores/dynamic-content.js +6 -7
  40. package/dist/stores/editor.d.ts +0 -21
  41. package/dist/stores/editor.js +1 -2
  42. package/dist/utils/genericUtil.js +6 -9
  43. package/package.json +1 -1
  44. package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
  45. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
  46. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -37
  47. package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
  48. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
  49. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -83
  50. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
  51. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
  52. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
  53. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
  54. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -19
  55. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -43
  56. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
  57. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
  58. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -74
  59. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
  60. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
  61. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -37
  62. package/dist/composables/useStripoEventHandler.d.ts +0 -3
  63. package/dist/composables/useStripoEventHandler.js +0 -20
  64. package/dist/enums/onboarding.d.ts +0 -1
  65. package/dist/enums/onboarding.js +0 -8
  66. package/dist/mock/api/user-modal-state.d.ts +0 -2
  67. package/dist/services/onboardingApi.d.ts +0 -4
  68. package/dist/services/onboardingApi.js +0 -23
  69. package/dist/static/assets/onboarding-img.svg.js +0 -4
  70. package/dist/static/styles/components/notification.css.js +0 -55
  71. package/dist/static/styles/components/popup.css.js +0 -68
  72. package/dist/stores/onboarding.d.ts +0 -1068
  73. package/dist/stores/onboarding.js +0 -95
@@ -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,34 +1,32 @@
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
10
  import a from "../static/styles/components/loader.css.js";
11
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,
12
+ import c from "../static/styles/components/switcher.css.js";
13
+ import d from "../static/styles/components/tabs.css.js";
14
+ import l from "../static/styles/components/tools.css.js";
15
+ import h from "../static/styles/components/version-history.css.js";
16
+ import w from "../static/styles/components/wide-panel.css.js";
17
+ import y from "../static/styles/variables.css.js";
18
+ const B = [
19
+ y,
22
20
  // Must be on top
23
21
  S,
24
22
  // Must be on top
25
- m,
26
23
  e,
24
+ m,
27
25
  i,
28
26
  p,
29
27
  n,
30
- C,
31
28
  s,
29
+ C,
32
30
  f,
33
31
  a,
34
32
  u,
@@ -36,14 +34,12 @@ const A = [
36
34
  d,
37
35
  l,
38
36
  h,
39
- w,
40
- y,
41
- B
37
+ w
42
38
  ].join(`
43
39
 
44
- `), F = () => ({ importCss: () => {
40
+ `), R = () => ({ importCss: () => {
45
41
  const o = new CSSStyleSheet();
46
- o.replaceSync(A);
42
+ o.replaceSync(B);
47
43
  const r = document.querySelector("ui-editor");
48
44
  if (!r)
49
45
  return;
@@ -51,5 +47,5 @@ const A = [
51
47
  t && (t.adoptedStyleSheets = [o]);
52
48
  } });
53
49
  export {
54
- F as useCustomInterfaceAppearance
50
+ R as useCustomInterfaceAppearance
55
51
  };
@@ -1,4 +1,3 @@
1
- import type { DynamicContent } from '@@/Types/generic';
2
1
  export declare const useHtmlValidator: () => {
3
- validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
2
+ validateHtml: (html: string, customFields: string[], isOnSaveValidation?: boolean) => Promise<boolean>;
4
3
  };
@@ -1,129 +1,119 @@
1
- import { useConfig as H } from "./useConfig.js";
2
- import { TemplateTypes as O } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as V, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as c } from "../enums/toaster.js";
1
+ import { useConfig as V } from "./useConfig.js";
2
+ import { TemplateTypes as H } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as O, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
4
+ import { ToasterTypeOptions as r } from "../enums/toaster.js";
5
5
  import { useRecommendationStore as D } from "../stores/recommendation.js";
6
6
  import { base64EncodeWithSpecialChars as P } from "../utils/base64.js";
7
- import { useHttp as $ } from "./useHttp.js";
7
+ import { useHttp as X } from "./useHttp.js";
8
8
  import { useToaster as j } from "./useToaster.js";
9
- import { useTranslations as X } from "./useTranslations.js";
9
+ import { useTranslations as z } from "./useTranslations.js";
10
10
  const tt = () => {
11
11
  var d;
12
- const { showToaster: r } = j(), { post: y } = $(), { config: h } = H(), o = X(), m = D(), u = ((d = h.partner) == null ? void 0 : d.messageType) === O.transactional, C = async (t) => {
12
+ const { showToaster: a } = j(), { post: y } = X(), { config: C } = V(), i = z(), m = D(), f = ((d = C.partner) == null ? void 0 : d.messageType) === H.transactional, h = async (t) => {
13
13
  const e = await y(
14
14
  "/newsletter/template-library/check-template-html-body",
15
15
  { html: P(t) }
16
- ), { status: n, message: a } = e.data;
17
- return n || r({
18
- type: c.Alert,
19
- message: n === void 0 ? a : o("newsletter.invalid-url-link-for-toaster")
20
- }), o(_), a === o(R) && r({
21
- type: c.Alert,
22
- message: o("newsletter.already-in-progress")
16
+ ), { status: n, message: c } = e.data;
17
+ return n || a({
18
+ type: r.Alert,
19
+ message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
20
+ }), i(_), c === i(R) && a({
21
+ type: r.Alert,
22
+ message: i("newsletter.already-in-progress")
23
23
  }), n;
24
24
  }, v = (t) => !["if", "endif", "else", "elif", "now"].includes(t.toLowerCase()), w = (t) => ["if", "endif"].includes(t.toLowerCase()), S = (t, s) => {
25
25
  const e = t.match(/({%(.*?)%})/g);
26
26
  let n = !0;
27
- return e !== null && !u && e.forEach((a) => {
28
- const i = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
- if (i && i.length > 0) {
30
- const [l] = i;
31
- v(l) && !s.includes(l) && (r({
32
- type: c.Warning,
33
- message: o("custom-fields.invalid-custom-fields")
27
+ return e !== null && !f && e.forEach((c) => {
28
+ const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
+ if (o && o.length > 0) {
30
+ const [l] = o;
31
+ v(l) && !s.includes(l) && (a({
32
+ type: r.Warning,
33
+ message: i("custom-fields.invalid-custom-fields")
34
34
  }), n = !1);
35
35
  }
36
36
  }), n;
37
37
  }, E = async (t, s, e) => {
38
- const n = e ? await C(t) : !0;
38
+ const n = e ? await h(t) : !0;
39
39
  return S(t, s) && n;
40
- }, T = (t) => t.length > 0 ? !0 : (r({
41
- type: c.Warning,
42
- message: o("newsletter.html-content-is-empty")
43
- }), !1), A = (t) => {
40
+ }, T = (t) => t.length > 0 ? !0 : (a({
41
+ type: r.Warning,
42
+ message: i("newsletter.html-content-is-empty")
43
+ }), !1), I = (t) => {
44
44
  const s = (t.match(/{/gm) || []).length, e = (t.match(/}/gm) || []).length;
45
- return s > e && r({
46
- type: c.Warning,
47
- message: o("custom-fields.missing-closing-braces")
48
- }), s < e && r({
49
- type: c.Warning,
50
- message: o("custom-fields.missing-opening-braces")
45
+ return s > e && a({
46
+ type: r.Warning,
47
+ message: i("custom-fields.missing-closing-braces")
48
+ }), s < e && a({
49
+ type: r.Warning,
50
+ message: i("custom-fields.missing-opening-braces")
51
51
  }), s === e;
52
- }, I = (t) => {
52
+ }, A = (t) => {
53
53
  const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
54
- return s || r({
55
- type: c.Warning,
56
- message: o("custom-fields.invalid-custom-fields")
54
+ return s || a({
55
+ type: r.Warning,
56
+ message: i("custom-fields.invalid-custom-fields")
57
57
  }), s;
58
- }, F = (t, s) => {
58
+ }, W = (t, s) => {
59
59
  const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
60
- if (e && !u) {
61
- const n = new Set(s.map((i) => i.toLowerCase())), a = [];
62
- if (e.forEach((i) => {
63
- const l = i.slice(2, -2).trim().toLowerCase();
64
- (!n.has(l) || l === "") && a.push(l);
65
- }), a.length > 0) {
66
- const i = `
67
- <ul>
68
- ${a.map((l) => `<li>${l}</li>`).join("")}
69
- </ul>
70
- `;
71
- return r({
72
- type: c.Alert,
73
- message: o("custom-fields.invalid-custom-fields") + i
74
- }), !1;
75
- }
60
+ if (e && !f) {
61
+ const n = s.map((o) => o.toLowerCase()), c = e.some((o) => {
62
+ const l = o.replace("{{", "").replace("}}", "").trim().toLowerCase();
63
+ return !n.includes(l) || l === "";
64
+ });
65
+ return c && a({
66
+ type: r.Warning,
67
+ message: i("custom-fields.invalid-custom-fields")
68
+ }), !c;
76
69
  }
77
70
  return !0;
78
- }, W = (t) => {
71
+ }, x = (t) => {
79
72
  const s = t.match(/{%(.*?)%}/g), e = [];
80
73
  let n = !0;
81
- if (s && s.forEach((a) => {
82
- const i = a.match(V), l = a.match(B), k = (i == null ? void 0 : i.join("")) || "";
83
- (!i || a !== k) && !l && (r({
84
- type: c.Alert,
85
- message: o("newsletter.display-conditions-invalid-syntax")
86
- }), n = !1), i && i.forEach((f) => {
87
- f.trim() === "=" && (r({
88
- type: c.Alert,
89
- message: o("custom-conditions.wrong-equality-operators")
74
+ if (s && s.forEach((c) => {
75
+ const o = c.match(O), l = c.match(B), L = (o == null ? void 0 : o.join("")) || "";
76
+ (!o || c !== L) && !l && (a({
77
+ type: r.Alert,
78
+ message: i("newsletter.display-conditions-invalid-syntax")
79
+ }), n = !1), o && o.forEach((u) => {
80
+ u.trim() === "=" && (a({
81
+ type: r.Alert,
82
+ message: i("custom-conditions.wrong-equality-operators")
90
83
  }), n = !1);
91
- const g = f.match(/^[a-zA-Z]*$/g);
84
+ const g = u.match(/^[a-zA-Z]*$/g);
92
85
  g && g.forEach((p) => {
93
86
  w(p) && e.push(p);
94
87
  });
95
88
  });
96
89
  }), e.length) {
97
- const a = e.filter((l) => l === "if"), i = e.filter((l) => l === "endif");
98
- a.length !== i.length && (r({
99
- type: c.Alert,
100
- message: o("custom-conditions.missing-if-endif-tag")
90
+ const c = e.filter((l) => l === "if"), o = e.filter((l) => l === "endif");
91
+ c.length !== o.length && (a({
92
+ type: r.Alert,
93
+ message: i("custom-conditions.missing-if-endif-tag")
101
94
  }), n = !1);
102
95
  }
103
96
  return n;
104
97
  }, b = (t) => {
105
98
  const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
106
- return n || r({
107
- type: c.Warning,
108
- message: o("custom-conditions.no-space-after-braces")
99
+ return n || a({
100
+ type: r.Warning,
101
+ message: i("custom-conditions.no-space-after-braces")
109
102
  }), n;
110
- }, x = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (r({
111
- type: c.Warning,
112
- message: o("custom-conditions.no-braces-inside-if-tag")
113
- }), !1) : !0, L = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (r({
114
- type: c.Alert,
115
- message: o("newsletter.fill-all-necessary-fields")
116
- }), !1) : !0, N = (t) => {
103
+ }, N = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (a({
104
+ type: r.Warning,
105
+ message: i("custom-conditions.no-braces-inside-if-tag")
106
+ }), !1) : !0, k = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (a({
107
+ type: r.Alert,
108
+ message: i("newsletter.fill-all-necessary-fields")
109
+ }), !1) : !0, F = (t) => {
117
110
  const s = /src="[^"]*\.(svg|pst)"/gm;
118
- return t.match(s) === null ? !0 : (r({
119
- type: c.Alert,
120
- message: o("newsletter.invalid-image-type")
111
+ return t.match(s) === null ? !0 : (a({
112
+ type: r.Alert,
113
+ message: i("newsletter.invalid-image-type")
121
114
  }), !1);
122
115
  };
123
- return { validateHtml: async (t, s, e = !1) => {
124
- const n = s.map((i) => i.value);
125
- return await E(t, n, e) && T(t) && A(t) && I(t) && F(t, n) && W(t) && b(t) && x(t) && L() && N(t);
126
- } };
116
+ return { validateHtml: async (t, s, e = !1) => await E(t, s, e) && T(t) && I(t) && A(t) && W(t, s) && x(t) && b(t) && N(t) && k() && F(t) };
127
117
  };
128
118
  export {
129
119
  tt as useHtmlValidator
@@ -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,4 +1,3 @@
1
- import { SavedTemplateDetails } from '@@/Types/stripo';
2
1
  export declare const useSave: () => {
3
- save: (isSilent?: boolean) => Promise<SavedTemplateDetails | undefined>;
2
+ save: () => Promise<void>;
4
3
  };
@@ -1,15 +1,14 @@
1
- import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
1
+ import { useSaveStart as r, useSaveComplete as i } from "./useGuidoActions.js";
2
+ import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
3
3
  import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = m(), { validateHtml: s } = l();
6
- return { save: async (o = !1) => {
4
+ const d = () => {
5
+ const e = r(), a = i(), { validateHtml: s } = l();
6
+ return { save: async () => {
7
7
  e();
8
- const { prepareTemplateDetails: r } = n(), t = await r();
9
- if (await s(t.compiledHtml, t.dynamicContentList, !0))
10
- return o || a(t), t;
8
+ const { prepareTemplateDetails: o } = m(), t = await o();
9
+ await s(t.compiledHtml, [], !0) && a(t);
11
10
  } };
12
11
  };
13
12
  export {
14
- f as useSave
13
+ d as useSave
15
14
  };
@@ -1,23 +1,22 @@
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";
1
+ import { useActionsApi as g } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
+ import { useToaster as S } from "./useToaster.js";
5
4
  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;
5
+ import C from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as E } from "../services/stripoApi.js";
7
+ import h from "../static/styles/customEditorStyle.css.js";
8
+ import { useEditorStore as w } from "../stores/editor.js";
9
+ import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
10
+ const P = (s) => {
11
+ const { handleError: c } = S(), { getToken: a, getCustomFonts: u } = E(), l = (r, i = []) => {
12
+ const e = w(), { html: o, css: d, forceRecreate: p } = r;
14
13
  window.UIEditor.initEditor(
15
14
  document.querySelector("#guido-editor"),
16
15
  {
17
16
  metadata: s,
18
17
  html: o,
19
- css: a,
20
- forceRecreate: g,
18
+ css: d,
19
+ forceRecreate: p,
21
20
  locale: "en",
22
21
  undoButtonSelector: "#guido__undo-button",
23
22
  redoButtonSelector: "#guido__redo-button",
@@ -27,7 +26,7 @@ const R = (s) => {
27
26
  customAppearanceMergetags: !0,
28
27
  customAppearanceMergetagsBorderColor: "#f1f3fe",
29
28
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
30
- customViewStyles: b,
29
+ customViewStyles: h,
31
30
  conditionsEnabled: !0,
32
31
  customConditionsEnabled: !0,
33
32
  conditionCategories: y,
@@ -41,25 +40,23 @@ const R = (s) => {
41
40
  },
42
41
  mergeTags: [
43
42
  {
44
- entries: _(s.preselectedDynamicContentList)
43
+ entries: b(s.preselectedDynamicContentList)
45
44
  }
46
45
  ],
47
46
  async onTokenRefreshRequest(t) {
48
47
  try {
49
- const n = await c();
48
+ const n = await a();
50
49
  t(n);
51
50
  } catch (n) {
52
- d(n, "Failed to refresh token");
51
+ c(n, "Failed to refresh token");
53
52
  }
54
53
  },
55
54
  onTemplateLoaded() {
56
55
  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);
56
+ const { importCss: t } = f(), { activateCustomViewStyles: n } = g();
57
+ t(), n(), s.onReady(), e.loadingStatus = !1;
61
58
  } catch (t) {
62
- d(t, "Failed to load custom interface appearance");
59
+ c(t, "Failed to load custom interface appearance");
63
60
  }
64
61
  },
65
62
  onCodeEditorVisibilityChanged(t) {
@@ -74,9 +71,8 @@ const R = (s) => {
74
71
  onDataChanged() {
75
72
  e.hasChanges = !0;
76
73
  },
77
- onEvent: l,
78
- ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
79
- extensions: [h]
74
+ ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
75
+ extensions: [C]
80
76
  }
81
77
  );
82
78
  }, m = (r) => new Promise((i, e) => {
@@ -88,17 +84,17 @@ const R = (s) => {
88
84
  o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
89
85
  r(), i();
90
86
  }, o.onerror = () => {
91
- const a = new Error("Failed to load Stripo UIEditor script");
92
- e(a);
87
+ const d = new Error("Failed to load Stripo UIEditor script");
88
+ e(d);
93
89
  }, document.body.appendChild(o);
94
90
  });
95
91
  return { initPlugin: async (r) => {
96
92
  await m(async () => {
97
93
  const i = await u();
98
- p(r, i);
94
+ l(r, i);
99
95
  });
100
96
  } };
101
97
  };
102
98
  export {
103
- R as useStripo
99
+ P as useStripo
104
100
  };
@@ -1,16 +1,15 @@
1
1
  import { ToasterTypeOptions as t } from "../enums/toaster.js";
2
- import { useEditorStore as w } from "../stores/editor.js";
3
- import { useVersionHistoryStore as y } from "../stores/version-history.js";
4
- import { useToaster as a } from "./useToaster.js";
5
- const u = () => {
6
- const i = y(), n = w(), { showToaster: s } = a(), p = (e) => {
7
- i.$reset(), i.updateState(e), n.isVersionHistoryOpen = !0;
8
- }, c = () => {
9
- i.$reset(), n.isVersionHistoryOpen = !1;
2
+ import { useVersionHistoryStore as c } from "../stores/version-history.js";
3
+ import { useToaster as w } from "./useToaster.js";
4
+ const S = () => {
5
+ const i = c(), { showToaster: s } = w(), n = (e) => {
6
+ i.$reset(), i.updateState(e);
7
+ }, p = () => {
8
+ i.$reset();
10
9
  };
11
10
  return {
12
11
  openVersionHistory: () => {
13
- window.StripoEditorApi.versionHistoryApi.openVersionHistory(p, c);
12
+ window.StripoEditorApi.versionHistoryApi.openVersionHistory(n, p);
14
13
  },
15
14
  closeVersionHistory: () => {
16
15
  window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
@@ -51,5 +50,5 @@ const u = () => {
51
50
  };
52
51
  };
53
52
  export {
54
- u as useVersionHistoryApi
53
+ S as useVersionHistoryApi
55
54
  };
@@ -9,4 +9,3 @@ export declare const DefaultUsername = "Guido User";
9
9
  export declare const DefaultMessageType: number;
10
10
  export declare const EditorType: number;
11
11
  export declare const ProductIds: Record<string, number>;
12
- export declare const TEST_PARTNER_LIST: string[];
@@ -1,4 +1,4 @@
1
- const a = {
1
+ const t = {
2
2
  translationsPath: "window.trans.en",
3
3
  emailHeader: {
4
4
  senderName: "",
@@ -10,51 +10,19 @@ const a = {
10
10
  versionHistory: !0
11
11
  },
12
12
  useHeader: !0
13
- }, t = {
13
+ }, e = {
14
14
  promotional: 1,
15
15
  transactional: 2
16
- }, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
16
+ }, a = "email", o = "Guido User", s = e.promotional, n = 2, r = {
17
17
  email: 60,
18
18
  architect: 49
19
- }, u = [
20
- "alfredtesting",
21
- "electio",
22
- "eurekatest",
23
- "gachapontestpart",
24
- "gluautomation1",
25
- "gluautomation2",
26
- "gluautomation3",
27
- "gluautomation4",
28
- "inone",
29
- "inshoppingcart",
30
- "krakentest",
31
- "leeroy",
32
- "newsletteruat",
33
- "ozaspava",
34
- "piratesquad",
35
- "qaautomation1",
36
- "qaautomation2",
37
- "qaautomation3",
38
- "qaautomation4",
39
- "roiautomation",
40
- "seleniumautomation",
41
- "seleniumautomation1",
42
- "seleniumautomation2",
43
- "seleniumautomation3",
44
- "shopbagg",
45
- "shopifytest",
46
- "singlepageqa",
47
- "testqa",
48
- "vikingsankara",
49
- "stripoeditorlivetest"
50
- ];
19
+ };
51
20
  export {
52
- a as DefaultGuidoConfig,
53
- n as DefaultMessageType,
54
- e as DefaultProductType,
21
+ t as DefaultGuidoConfig,
22
+ s as DefaultMessageType,
23
+ a as DefaultProductType,
55
24
  o as DefaultUsername,
56
- i as EditorType,
57
- s as ProductIds,
58
- u as TEST_PARTNER_LIST,
59
- t as TemplateTypes
25
+ n as EditorType,
26
+ r as ProductIds,
27
+ e as TemplateTypes
60
28
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- [data-v-2c168944] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-cc1f9260],.guido-editor__container[data-v-cc1f9260]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-cc1f9260]{height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ [data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-ad3cf7cc] .guido__view-option-selection-desktop svg,[data-v-ad3cf7cc] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-ad3cf7cc] .in-segments-wrapper__button_selected,[data-v-ad3cf7cc] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-ad3cf7cc] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-2d4cd446]{height:calc(100% - 75px);top:75px}.guido-editor__wrapper[data-v-e45e9eab],.guido-editor__container[data-v-e45e9eab]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-e45e9eab]{height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}