@useinsider/guido 1.0.2-beta.73c3522 → 1.0.2-beta.78d0643

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 (71) hide show
  1. package/README.md +1 -31
  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 -3
  5. package/dist/components/Guido.vue.js +2 -2
  6. package/dist/components/Guido.vue2.js +55 -66
  7. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +15 -14
  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/RightSlot.vue.d.ts +1 -3
  13. package/dist/components/organisms/header/RightSlot.vue.js +3 -5
  14. package/dist/components/organisms/header/RightSlot.vue2.js +27 -25
  15. package/dist/components/organisms/header/ViewOptions.vue.js +4 -4
  16. package/dist/components/organisms/header/ViewOptions.vue2.js +14 -14
  17. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
  18. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
  19. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +13 -13
  20. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +23 -21
  21. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -12
  22. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +26 -24
  23. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +1 -1
  24. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -36
  25. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +15 -15
  26. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +18 -16
  27. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +14 -14
  28. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
  29. package/dist/composables/useHtmlCompiler.js +9 -17
  30. package/dist/composables/usePreviewMode.js +15 -14
  31. package/dist/composables/useStripo.js +25 -27
  32. package/dist/composables/useStripoEventHandler.js +8 -8
  33. package/dist/composables/useToaster.js +17 -17
  34. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -2
  35. package/dist/enums/defaults.d.ts +1 -5
  36. package/dist/enums/defaults.js +10 -14
  37. package/dist/guido.css +1 -1
  38. package/dist/services/onboardingApi.d.ts +2 -2
  39. package/dist/services/onboardingApi.js +9 -9
  40. package/dist/stores/dynamic-content.d.ts +0 -12
  41. package/dist/stores/dynamic-content.js +6 -7
  42. package/dist/stores/onboarding.d.ts +592 -133
  43. package/dist/stores/onboarding.js +57 -40
  44. package/dist/stores/preview.js +14 -6
  45. package/dist/utils/genericUtil.js +6 -9
  46. package/dist/utils/templatePreparation.js +14 -21
  47. package/package.json +2 -4
  48. package/dist/composables/useHtmlValidator.d.ts +0 -3
  49. package/dist/composables/useHtmlValidator.js +0 -120
  50. package/dist/composables/useRecommendation.d.ts +0 -19
  51. package/dist/composables/useRecommendation.js +0 -27
  52. package/dist/composables/useSave.d.ts +0 -4
  53. package/dist/composables/useSave.js +0 -15
  54. package/dist/config/compiler/outlookCompilerRules.js +0 -36
  55. package/dist/config/compiler/recommendationCompilerRules.d.ts +0 -2
  56. package/dist/config/compiler/recommendationCompilerRules.js +0 -83
  57. package/dist/config/compiler/socialCompilerRules.d.ts +0 -2
  58. package/dist/config/compiler/socialCompilerRules.js +0 -21
  59. package/dist/config/compiler/unsubscribeCompilerRules.d.ts +0 -2
  60. package/dist/config/compiler/unsubscribeCompilerRules.js +0 -64
  61. package/dist/enums/html-validator.d.ts +0 -6
  62. package/dist/enums/html-validator.js +0 -7
  63. package/dist/enums/recommendation.d.ts +0 -54
  64. package/dist/enums/recommendation.js +0 -56
  65. package/dist/enums/unsubscribe.d.ts +0 -15
  66. package/dist/enums/unsubscribe.js +0 -17
  67. package/dist/mock/api/validator.d.ts +0 -2
  68. package/dist/stores/recommendation.d.ts +0 -10
  69. package/dist/stores/recommendation.js +0 -9
  70. package/dist/stores/unsubscribe.d.ts +0 -8
  71. package/dist/stores/unsubscribe.js +0 -9
@@ -1,22 +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 S } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
+ import { useStripoEventHandler as E } from "./useStripoEventHandler.js";
4
+ import { useToaster as C } from "./useToaster.js";
5
5
  import { displayConditions as y } from "../enums/displayConditions.js";
6
6
  import h from "../extensions/DynamicContent/extension.js";
7
7
  import { useStripoApi as w } from "../services/stripoApi.js";
8
8
  import b from "../static/styles/customEditorStyle.css.js";
9
9
  import { useEditorStore as V } from "../stores/editor.js";
10
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;
11
+ const x = (a) => {
12
+ const { handleError: d } = C(), { getToken: c, getCustomFonts: u } = w(), { handleEvent: l } = E(), p = (r, i = []) => {
13
+ const o = V(), { html: e, css: s, forceRecreate: g } = r;
14
14
  window.UIEditor.initEditor(
15
15
  document.querySelector("#guido-editor"),
16
16
  {
17
- metadata: s,
18
- html: o,
19
- css: a,
17
+ metadata: a,
18
+ html: e,
19
+ css: s,
20
20
  forceRecreate: g,
21
21
  locale: "en",
22
22
  undoButtonSelector: "#guido__undo-button",
@@ -41,7 +41,7 @@ const R = (s) => {
41
41
  },
42
42
  mergeTags: [
43
43
  {
44
- entries: _(s.preselectedDynamicContentList)
44
+ entries: _(a.preselectedDynamicContentList)
45
45
  }
46
46
  ],
47
47
  async onTokenRefreshRequest(t) {
@@ -54,43 +54,41 @@ const R = (s) => {
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);
57
+ const { importCss: t } = f(), { activateCustomViewStyles: n } = S();
58
+ t(), n(), o.isStripoInitialized = !0, o.loadingStatus = !1;
61
59
  } catch (t) {
62
60
  d(t, "Failed to load custom interface appearance");
63
61
  }
64
62
  },
65
63
  onCodeEditorVisibilityChanged(t) {
66
- e.isCodeEditorOpen = t;
64
+ o.isCodeEditorOpen = t;
67
65
  },
68
66
  onEditorVisualModeChanged(t) {
69
- e.editorVisualMode = t.toLowerCase();
67
+ o.editorVisualMode = t.toLowerCase();
70
68
  },
71
69
  onVersionHistoryVisibilityChanged(t) {
72
- e.isVersionHistoryOpen = t;
70
+ o.isVersionHistoryOpen = t;
73
71
  },
74
72
  onDataChanged() {
75
- e.hasChanges = !0;
73
+ o.hasChanges = !0;
76
74
  },
77
75
  onEvent: l,
78
76
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
79
77
  extensions: [h]
80
78
  }
81
79
  );
82
- }, m = (r) => new Promise((i, e) => {
80
+ }, m = (r) => new Promise((i, o) => {
83
81
  if (document.getElementById("UiEditorScript")) {
84
82
  r(), i();
85
83
  return;
86
84
  }
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 = () => {
85
+ const e = document.createElement("script");
86
+ e.id = "UiEditorScript", e.type = "module", e.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", e.onload = () => {
89
87
  r(), i();
90
- }, o.onerror = () => {
91
- const a = new Error("Failed to load Stripo UIEditor script");
92
- e(a);
93
- }, document.body.appendChild(o);
88
+ }, e.onerror = () => {
89
+ const s = new Error("Failed to load Stripo UIEditor script");
90
+ o(s);
91
+ }, document.body.appendChild(e);
94
92
  });
95
93
  return { initPlugin: async (r) => {
96
94
  await m(async () => {
@@ -100,5 +98,5 @@ const R = (s) => {
100
98
  } };
101
99
  };
102
100
  export {
103
- R as useStripo
101
+ x as useStripo
104
102
  };
@@ -1,20 +1,20 @@
1
- import { useOnboardingStore as i } from "../stores/onboarding.js";
2
- const c = () => {
3
- const e = {
1
+ import { useOnboardingStore as r } from "../stores/onboarding.js";
2
+ const d = () => {
3
+ const o = {
4
4
  block_dropped: ({ blockName: t }) => {
5
5
  if (t === "BLOCK_TEXT") {
6
- const n = i(), o = !n.shouldShowOnboarding("textBlockOnboarding"), r = n.isActive("textBlockOnboarding");
7
- if (o || r)
6
+ const n = r();
7
+ if (!n.shouldShowOnboarding("textBlockOnboarding") || n.isActive("textBlockOnboarding"))
8
8
  return;
9
9
  n.start("textBlockOnboarding");
10
10
  }
11
11
  }
12
12
  };
13
13
  return { handleEvent: async (t, n) => {
14
- const o = e[t];
15
- o && await o(n);
14
+ const e = o[t];
15
+ e && await e(n);
16
16
  } };
17
17
  };
18
18
  export {
19
- c as useStripoEventHandler
19
+ d as useStripoEventHandler
20
20
  };
@@ -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,8 @@
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
8
  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,13 +10,10 @@ const a = {
10
10
  versionHistory: !0
11
11
  },
12
12
  useHeader: !0
13
- }, t = {
14
- promotional: 1,
15
- transactional: 2
16
- }, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
13
+ }, a = "email", e = "Guido User", o = 1, n = 2, i = {
17
14
  email: 60,
18
15
  architect: 49
19
- }, u = [
16
+ }, s = [
20
17
  "alfredtesting",
21
18
  "electio",
22
19
  "eurekatest",
@@ -49,12 +46,11 @@ const a = {
49
46
  "stripoeditorlivetest"
50
47
  ];
51
48
  export {
52
- a as DefaultGuidoConfig,
53
- n as DefaultMessageType,
54
- e as DefaultProductType,
55
- o as DefaultUsername,
56
- i as EditorType,
57
- s as ProductIds,
58
- u as TEST_PARTNER_LIST,
59
- t as TemplateTypes
49
+ t as DefaultGuidoConfig,
50
+ o as DefaultMessageType,
51
+ a as DefaultProductType,
52
+ e as DefaultUsername,
53
+ n as EditorType,
54
+ i as ProductIds,
55
+ s as TEST_PARTNER_LIST
60
56
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
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}.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-2473c29f] .vueperslides__bullets,[data-v-a77a2dd4] .vueperslides__bullets{pointer-events:none!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}.view-options-wrapper[data-v-35d10bcf]{position:relative;display:inline-block}.new-tag[data-v-35d10bcf]{height:24px;position:absolute;top:-8px;right:-16px;background-color:#dae1fb;color:#0a2ecc;font-size:13px;font-weight:400;padding:4px;border-radius:4px;z-index:10;pointer-events:none;border:1px solid #B5C1F1;line-height:16px}[data-v-35d10bcf] .guido__view-option-selection-desktop svg,[data-v-35d10bcf] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-35d10bcf] .in-segments-wrapper__button_selected,[data-v-35d10bcf] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-35d10bcf] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-2d4cd446]{height:calc(100% - 75px);top:75px}.guido-editor__wrapper[data-v-b74952a6],.guido-editor__container[data-v-b74952a6]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-b74952a6]{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-037dda0b] .vueperslides__bullets,[data-v-ff363cd1] .vueperslides__bullets{pointer-events:none!important}
@@ -1,4 +1,4 @@
1
1
  export declare const useOnboardingApi: () => {
2
- fetchUserModalState: () => Promise<unknown>;
3
- setUserModalState: (modal: string, state: string, page: string) => Promise<unknown>;
2
+ fetchUserModalState: () => Promise<import("@@/Composables/useHttp").HttpResponse<unknown>>;
3
+ setUserModalState: (modal: string, state: string, page: string) => Promise<import("@@/Composables/useHttp").HttpResponse<unknown>>;
4
4
  };
@@ -1,23 +1,23 @@
1
1
  import { useHttp as a } from "../composables/useHttp.js";
2
- const l = () => {
2
+ const d = () => {
3
3
  const { get: r } = a();
4
4
  return {
5
5
  fetchUserModalState: async () => {
6
6
  try {
7
- return (await r("/user-modal-state/get")).data;
8
- } catch (t) {
9
- throw console.error("fetchUserModalState error:", t), t;
7
+ return await r("/user-modal-state/get");
8
+ } catch (e) {
9
+ throw console.error("fetchUserModalState error:", e), e;
10
10
  }
11
11
  },
12
- setUserModalState: async (t, o, s) => {
12
+ setUserModalState: async (e, o, s) => {
13
13
  try {
14
- return (await r(`/user-modal-state/set?modal=${t}&state=${o}&page=${s}`)).data;
15
- } catch (e) {
16
- throw console.error("setUserModalState error:", e), e;
14
+ return await r(`/user-modal-state/set?modal=${e}&state=${o}&page=${s}`);
15
+ } catch (t) {
16
+ throw console.error("setUserModalState error:", t), t;
17
17
  }
18
18
  }
19
19
  };
20
20
  };
21
21
  export {
22
- l as useOnboardingApi
22
+ d as useOnboardingApi
23
23
  };
@@ -8,19 +8,11 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dy
8
8
  value: string;
9
9
  text: string;
10
10
  fallback?: string | undefined;
11
- format?: {
12
- key: string;
13
- value: string;
14
- } | undefined;
15
11
  };
16
12
  selectedDynamicContentList: {
17
13
  value: string;
18
14
  text: string;
19
15
  fallback?: string | undefined;
20
- format?: {
21
- key: string;
22
- value: string;
23
- } | undefined;
24
16
  }[];
25
17
  } & import("pinia").PiniaCustomStateProperties<{
26
18
  selectedDynamicContent: DynamicContent;
@@ -29,10 +21,6 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dy
29
21
  text: string;
30
22
  value: string;
31
23
  fallback: string | undefined;
32
- format: {
33
- key: string;
34
- value: string;
35
- } | undefined;
36
24
  }[];
37
25
  }, {
38
26
  setSelectedDynamicContent(dynamicContent: DynamicContent): void;
@@ -6,16 +6,15 @@ const s = a("dynamicContent", {
6
6
  selectedDynamicContentList: []
7
7
  }),
8
8
  actions: {
9
- setSelectedDynamicContent(t) {
10
- this.selectedDynamicContent = t, this.selectedDynamicContentList.push(t);
9
+ setSelectedDynamicContent(e) {
10
+ this.selectedDynamicContent = e, this.selectedDynamicContentList.push(e);
11
11
  }
12
12
  },
13
13
  getters: {
14
- getSelectedDynamicContentList: (t) => n(t.selectedDynamicContentList).map((e) => ({
15
- text: e.text,
16
- value: e.value,
17
- fallback: e.fallback,
18
- format: e.format
14
+ getSelectedDynamicContentList: (e) => n(e.selectedDynamicContentList).map((t) => ({
15
+ text: t.text,
16
+ value: t.value,
17
+ fallback: t.fallback
19
18
  })) || []
20
19
  }
21
20
  });