@useinsider/guido 1.0.0-beta.35d2ac4 → 1.0.0-beta.3bcd23c

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 (72) hide show
  1. package/README.md +24 -384
  2. package/dist/@types/generic.d.ts +0 -8
  3. package/dist/components/Guido.vue.d.ts +3 -13
  4. package/dist/components/Guido.vue.js +8 -8
  5. package/dist/components/Guido.vue2.js +34 -63
  6. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue2.js +8 -10
  8. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  9. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -17
  10. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  11. package/dist/components/organisms/header/RightSlot.vue2.js +14 -28
  12. package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
  13. package/dist/composables/useActionsApi.d.ts +0 -2
  14. package/dist/composables/useActionsApi.js +36 -47
  15. package/dist/composables/useExport.d.ts +1 -1
  16. package/dist/composables/useExport.js +20 -35
  17. package/dist/composables/useStripo.js +14 -15
  18. package/dist/composables/useTemplates.d.ts +5 -0
  19. package/dist/composables/useTemplates.js +27 -0
  20. package/dist/extensions/DynamicContent/dynamic-content-modal.js +13 -13
  21. package/dist/extensions/DynamicContent/dynamic-content.js +10 -10
  22. package/dist/guido.css +1 -1
  23. package/dist/services/stripoApi.d.ts +1 -2
  24. package/dist/services/stripoApi.js +7 -27
  25. package/dist/static/templates/default/index.html.js +5 -0
  26. package/dist/static/templates/default/style.css.js +119 -0
  27. package/dist/stores/editor.d.ts +0 -4
  28. package/dist/stores/editor.js +3 -7
  29. package/package.json +2 -2
  30. package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +0 -16
  31. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +0 -21
  32. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +0 -30
  33. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +0 -16
  34. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
  35. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -43
  36. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +0 -16
  37. package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
  38. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -33
  39. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +0 -18
  40. package/dist/components/organisms/design-preview/EmailView.vue.js +0 -19
  41. package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
  42. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +0 -17
  43. package/dist/components/organisms/design-preview/InboxView.vue.js +0 -19
  44. package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
  45. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +0 -17
  46. package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
  47. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -23
  48. package/dist/components/organisms/header/AmpToggle.vue.d.ts +0 -2
  49. package/dist/components/organisms/header/AmpToggle.vue.js +0 -17
  50. package/dist/components/organisms/header/AmpToggle.vue2.js +0 -48
  51. package/dist/composables/useDebounce.d.ts +0 -4
  52. package/dist/composables/useDebounce.js +0 -12
  53. package/dist/composables/useGuidoActions.d.ts +0 -46
  54. package/dist/composables/useGuidoActions.js +0 -37
  55. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  56. package/dist/composables/useHtmlCompiler.js +0 -16
  57. package/dist/composables/useMobileGmailFit.d.ts +0 -5
  58. package/dist/composables/useMobileGmailFit.js +0 -69
  59. package/dist/composables/useProvideInject.d.ts +0 -14
  60. package/dist/composables/useProvideInject.js +0 -17
  61. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  62. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  63. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  64. package/dist/enums/emailPreview.d.ts +0 -3
  65. package/dist/enums/emailPreview.js +0 -6
  66. package/dist/enums/gmailMobilePreview.d.ts +0 -7
  67. package/dist/enums/gmailMobilePreview.js +0 -17
  68. package/dist/inbox-mockup.svg +0 -39
  69. package/dist/mock/api/default-template.d.ts +0 -2
  70. package/dist/phone-mockup.svg +0 -31
  71. package/dist/utils/htmlCompiler.d.ts +0 -12
  72. package/dist/utils/htmlCompiler.js +0 -70
@@ -1,15 +1,13 @@
1
- import { defineComponent as r } from "vue";
2
- import { useBack as e } from "../../../composables/useGuidoActions.js";
3
- import { useEditorStore as m } from "../../../stores/editor.js";
4
- import { InButtonV2 as n } from "@useinsider/design-system-vue";
5
- import s from "./version-history/RestoreButton.vue.js";
6
- const c = /* @__PURE__ */ r({
1
+ import { defineComponent as t } from "vue";
2
+ import { useEditorStore as o } from "../../../stores/editor.js";
3
+ import { InButtonV2 as r } from "@useinsider/design-system-vue";
4
+ import e from "./version-history/RestoreButton.vue.js";
5
+ const _ = /* @__PURE__ */ t({
7
6
  __name: "LeftSlot",
8
- setup(f) {
9
- const o = m(), t = e();
10
- return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
7
+ setup(m) {
8
+ return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
11
9
  }
12
10
  });
13
11
  export {
14
- c as default
12
+ _ as default
15
13
  };
@@ -1,8 +1,8 @@
1
1
  import s from "./MiddleSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var o = this, e = o._self._c, t = o._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.isPreviewModeOpen ? t.trans("newsletter.close-email-preview") : t.trans("newsletter.email-preview") }, on: { click: t.handlePreviewClick } }), e(t.ViewOptions, { staticClass: "ml-3" }), e(t.AmpToggle)], 1);
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
6
  }, l = [], r = /* @__PURE__ */ i(
7
7
  s,
8
8
  n,
@@ -11,7 +11,7 @@ var n = function() {
11
11
  null,
12
12
  null
13
13
  );
14
- const u = r.exports;
14
+ const p = r.exports;
15
15
  export {
16
- u as default
16
+ p as default
17
17
  };
@@ -1,25 +1,22 @@
1
- import { defineComponent as s, computed as n } from "vue";
2
- import { useTranslations as p } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as m } from "../../../stores/editor.js";
4
- import { InButtonV2 as c } from "@useinsider/design-system-vue";
5
- import d from "./AmpToggle.vue.js";
6
- import f from "./version-history/VersionHistory.vue.js";
7
- import a from "./version-history/ViewOptions.vue.js";
8
- import l from "./ViewOptions.vue.js";
9
- const T = /* @__PURE__ */ s({
1
+ import { defineComponent as r } from "vue";
2
+ import { useTranslations as s } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as n } from "../../../stores/editor.js";
4
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
+ import m from "./version-history/VersionHistory.vue.js";
6
+ import p from "./version-history/ViewOptions.vue.js";
7
+ import f from "./ViewOptions.vue.js";
8
+ const y = /* @__PURE__ */ r({
10
9
  __name: "MiddleSlot",
11
- setup(u) {
12
- const o = m(), t = p(), e = () => {
13
- o.isPreviewModeOpen = !o.isPreviewModeOpen;
14
- }, i = n(() => o.isPreviewModeOpen);
15
- return { __sfc: !0, editorStore: o, trans: t, handlePreviewClick: e, isPreviewModeOpen: i, getTooltipOptions: (r) => ({
16
- id: `${r}-tooltip`,
10
+ setup(a) {
11
+ const o = n(), t = s();
12
+ return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
+ id: `${i}-tooltip`,
17
14
  dynamicPosition: !1,
18
15
  staticPosition: "bottom center",
19
16
  iconStatus: !1
20
- }), InButtonV2: c, AmpToggle: d, VersionHistory: f, VersionHistoryViewOptions: a, ViewOptions: l };
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
21
18
  }
22
19
  });
23
20
  export {
24
- T as default
21
+ y as default
25
22
  };
@@ -2,7 +2,7 @@ import o from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen || t.editorStore.isPreviewModeOpen }, on: { click: t.handleSave } })], 1);
5
+ return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
6
6
  }, r = [], a = /* @__PURE__ */ i(
7
7
  o,
8
8
  n,
@@ -1,35 +1,21 @@
1
- import { defineComponent as m } from "vue";
2
- import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
- import { useExport as c } from "../../../composables/useExport.js";
4
- import { useSaveStart as l, useSaveComplete as f } from "../../../composables/useGuidoActions.js";
5
- import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as d } from "../../../stores/editor.js";
7
- import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
- const E = /* @__PURE__ */ m({
1
+ import { defineComponent as s } from "vue";
2
+ import { useExport as i } from "../../../composables/useExport.js";
3
+ import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
4
+ import { useEditorStore as p } from "../../../stores/editor.js";
5
+ import { InButtonV2 as m } from "@useinsider/design-system-vue";
6
+ const d = /* @__PURE__ */ s({
9
7
  __name: "RightSlot",
10
- setup(h) {
11
- const { exportHtml: a } = c(), { getCompiledEmail: t } = p(), e = l(), r = f(), { openVersionHistory: s, closeVersionHistory: n } = u(), i = d();
12
- return { __sfc: !0, exportHtml: a, getCompiledEmail: t, saveStart: e, saveComplete: r, openVersionHistory: s, closeVersionHistory: n, editorStore: i, handleVersionHistory: () => {
13
- if (i.isVersionHistoryOpen) {
14
- n();
8
+ setup(f) {
9
+ const { exportHtml: e } = i(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
10
+ return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
11
+ if (t.isVersionHistoryOpen) {
12
+ r();
15
13
  return;
16
14
  }
17
- s();
18
- }, handleSave: async () => {
19
- e();
20
- try {
21
- const { html: o } = await t();
22
- r({
23
- html: o || "",
24
- css: ""
25
- // CSS is embedded in HTML from Stripo
26
- });
27
- } catch (o) {
28
- console.error("Failed to get template data for save:", o);
29
- }
30
- }, InButtonV2: S };
15
+ o();
16
+ }, InButtonV2: m };
31
17
  }
32
18
  });
33
19
  export {
34
- E as default
20
+ d as default
35
21
  };
@@ -1,16 +1,16 @@
1
1
  import r from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
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.editorStore.isPreviewModeOpen, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
- }, n = [], _ = /* @__PURE__ */ i(
6
+ return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
+ }, i = [], _ = /* @__PURE__ */ s(
8
8
  r,
9
- s,
10
9
  n,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "f90d31ea"
13
+ "0fff376c"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,7 +1,5 @@
1
- import type { CompileEmailOptions } from '@@/Types/stripo';
2
1
  import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
3
2
  export declare const useActionsApi: () => {
4
3
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
5
4
  activateCustomViewStyles: (isActive?: boolean) => void;
6
- getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
7
5
  };
@@ -1,49 +1,38 @@
1
- const w = () => {
2
- const a = (e = {}) => new Promise((t, s) => {
3
- const m = { ...{
4
- minimize: !0,
5
- utmEntity: {
6
- utmSource: "",
7
- utmMedium: "",
8
- utmCampaign: "",
9
- utmContent: "",
10
- utmTerm: "",
11
- customUtms: [
12
- {
13
- name1: "val1",
14
- name2: "val2"
15
- }
16
- ]
17
- },
18
- mergeTags: ["Tag1", "Tag2"],
19
- forseAmp: !1,
20
- resetDataSavedFlag: !1,
21
- disableLineHeightsReplace: !0
22
- }, ...e }, o = {
23
- callback: (i, n, l, r, c) => {
24
- i ? s(i) : t({
25
- html: n,
26
- ampHtml: l,
27
- ampErrors: r,
28
- displayConditions: c
29
- });
30
- },
31
- ...m
32
- };
33
- window.StripoEditorApi.actionsApi.compileEmail(o);
34
- });
35
- return { getCompiledEmail: a, activateCustomViewStyles: (e = !0) => {
36
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(e);
37
- }, getPreviewData: async (e) => {
38
- const t = await a({ minimize: !1, resetDataSavedFlag: !1, ...e });
39
- return {
40
- html: t.html,
41
- ampHtml: t.ampHtml ?? "",
42
- ampErrors: t.ampErrors ?? null,
43
- displayConditions: t.displayConditions
44
- };
45
- } };
46
- };
1
+ const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
+ const s = { ...{
3
+ minimize: !0,
4
+ utmEntity: {
5
+ utmSource: "",
6
+ utmMedium: "",
7
+ utmCampaign: "",
8
+ utmContent: "",
9
+ utmTerm: "",
10
+ customUtms: [
11
+ {
12
+ name1: "val1",
13
+ name2: "val2"
14
+ }
15
+ ]
16
+ },
17
+ mergeTags: ["Tag1", "Tag2"],
18
+ forseAmp: !1,
19
+ resetDataSavedFlag: !1,
20
+ disableLineHeightsReplace: !0
21
+ }, ...t }, o = {
22
+ callback: (e, m, l, n, c) => {
23
+ e ? a(e) : i({
24
+ html: m,
25
+ ampHtml: l,
26
+ ampErrors: n,
27
+ displayConditions: c
28
+ });
29
+ },
30
+ ...s
31
+ };
32
+ window.StripoEditorApi.actionsApi.compileEmail(o);
33
+ }), activateCustomViewStyles: (t = !0) => {
34
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
+ } });
47
36
  export {
48
- w as useActionsApi
37
+ g as useActionsApi
49
38
  };
@@ -1,3 +1,3 @@
1
1
  export declare const useExport: () => {
2
- exportHtml: (compile?: boolean) => Promise<void>;
2
+ exportHtml: () => Promise<void>;
3
3
  };
@@ -1,45 +1,30 @@
1
1
  import { useActionsApi as l } from "./useActionsApi.js";
2
- import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
3
- import { useToaster as d } from "./useToaster.js";
4
- const h = () => {
5
- const a = (s, o, r) => {
6
- const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
7
- e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
8
- }, c = (s) => {
9
- const o = /* @__PURE__ */ new Date(), r = String(o.getDate()).padStart(2, "0"), i = String(o.getMonth() + 1).padStart(2, "0"), t = o.getFullYear(), e = String(o.getHours()).padStart(2, "0"), n = String(o.getMinutes()).padStart(2, "0");
10
- return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
2
+ import { useToaster as m } from "./useToaster.js";
3
+ const u = () => {
4
+ const a = (r, t, e) => {
5
+ const n = new Blob([r], { type: e }), s = URL.createObjectURL(n), o = document.createElement("a");
6
+ o.href = s, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(s);
7
+ }, c = (r) => {
8
+ const t = /* @__PURE__ */ new Date(), e = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), s = t.getFullYear(), o = String(t.getHours()).padStart(2, "0"), i = String(t.getMinutes()).padStart(2, "0");
9
+ return `${r}_${e}-${n}-${s}_${o}-${i}.html`;
11
10
  };
12
- return { exportHtml: async (s = !0) => {
13
- const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
11
+ return { exportHtml: async () => {
12
+ const { getCompiledEmail: r } = l(), { showToaster: t } = m();
14
13
  try {
15
- const { html: t } = await o();
16
- if (t) {
17
- let e = t;
18
- if (s) {
19
- const n = i(t);
20
- e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
21
- originalSize: n.stats.originalSize,
22
- compiledSize: n.stats.compiledSize,
23
- reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
24
- appliedRules: n.appliedRules,
25
- executionTime: `${n.stats.executionTime.toFixed(2)}ms`
26
- });
27
- }
28
- a(e, c("HTML"), "text/html");
29
- } else
30
- r({
31
- type: "error",
32
- message: "No HTML content to download"
33
- });
34
- } catch (t) {
35
- const e = t instanceof Error ? t.message : String(t);
36
- r({
14
+ const { html: e } = await r();
15
+ e ? a(e, c("HTML"), "text/html") : t({
37
16
  type: "error",
38
- message: `Error compiling email: ${e}`
17
+ message: "No HTML content to download"
18
+ });
19
+ } catch (e) {
20
+ const n = e instanceof Error ? e.message : String(e);
21
+ t({
22
+ type: "error",
23
+ message: `Error compiling email: ${n}`
39
24
  });
40
25
  }
41
26
  } };
42
27
  };
43
28
  export {
44
- h as useExport
29
+ u as useExport
45
30
  };
@@ -1,20 +1,19 @@
1
- import { useActionsApi as g } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
- import { useToaster as E } from "./useToaster.js";
4
- import { displayConditions as S } from "../enums/displayConditions.js";
5
- import y from "../extensions/DynamicContent/extension.js";
6
- import { useStripoApi as C } from "../services/stripoApi.js";
7
- import { useEditorStore as w } from "../stores/editor.js";
8
- const A = (a) => {
9
- const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = C(), l = (e, r = []) => {
10
- const i = w(), { html: t, css: s, forceRecreate: m } = e;
1
+ import { useActionsApi as m } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as g } from "./useCustomInterfaceAppearance.js";
3
+ import { useToaster as f } from "./useToaster.js";
4
+ import { displayConditions as E } from "../enums/displayConditions.js";
5
+ import S from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as y } from "../services/stripoApi.js";
7
+ import { useEditorStore as C } from "../stores/editor.js";
8
+ const x = (a) => {
9
+ const { handleError: d } = f(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
10
+ const i = C(), { html: t, css: s } = e;
11
11
  window.UIEditor.initEditor(
12
12
  document.querySelector("#guido-editor"),
13
13
  {
14
14
  metadata: a,
15
15
  html: t,
16
16
  css: s,
17
- forceRecreate: m,
18
17
  locale: "en",
19
18
  undoButtonSelector: "#guido__undo-button",
20
19
  redoButtonSelector: "#guido__redo-button",
@@ -30,7 +29,7 @@ const A = (a) => {
30
29
  `,
31
30
  conditionsEnabled: !0,
32
31
  customConditionsEnabled: !0,
33
- conditionCategories: S,
32
+ conditionCategories: E,
34
33
  messageSettingsEnabled: !1,
35
34
  editorFonts: {
36
35
  showDefaultStandardFonts: !0,
@@ -47,7 +46,7 @@ const A = (a) => {
47
46
  },
48
47
  onTemplateLoaded() {
49
48
  try {
50
- const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
49
+ const { importCss: o } = g(), { activateCustomViewStyles: n } = m();
51
50
  o(), n();
52
51
  } catch (o) {
53
52
  d(o, "Failed to load custom interface appearance");
@@ -63,7 +62,7 @@ const A = (a) => {
63
62
  i.isVersionHistoryOpen = o;
64
63
  },
65
64
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
66
- extensions: [y]
65
+ extensions: [S]
67
66
  }
68
67
  );
69
68
  }, p = (e) => new Promise((r, i) => {
@@ -87,5 +86,5 @@ const A = (a) => {
87
86
  } };
88
87
  };
89
88
  export {
90
- A as useStripo
89
+ x as useStripo
91
90
  };
@@ -0,0 +1,5 @@
1
+ import type { Template } from '@@/Types/stripo';
2
+ export declare const useTemplates: () => {
3
+ getDefaultTemplate: () => Promise<Template>;
4
+ getTemplate: (templateName: string) => Promise<Template>;
5
+ };
@@ -0,0 +1,27 @@
1
+ const s = () => {
2
+ const t = async () => {
3
+ const [e, a] = await Promise.all([
4
+ // eslint-disable-next-line import/extensions
5
+ import("../static/templates/default/index.html.js"),
6
+ import("../static/templates/default/style.css.js")
7
+ ]);
8
+ return {
9
+ html: e.default,
10
+ css: a.default
11
+ };
12
+ };
13
+ return {
14
+ getDefaultTemplate: t,
15
+ getTemplate: async (e) => {
16
+ switch (e) {
17
+ case "default":
18
+ return t();
19
+ default:
20
+ return t();
21
+ }
22
+ }
23
+ };
24
+ };
25
+ export {
26
+ s as useTemplates
27
+ };
@@ -1,27 +1,27 @@
1
1
  var i = Object.defineProperty;
2
- var d = (t, e, n) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var a = (t, e, n) => d(t, typeof e != "symbol" ? e + "" : e, n);
4
- class y {
2
+ var d = (e, t, n) => t in e ? i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var a = (e, t, n) => d(e, typeof t != "symbol" ? t + "" : t, n);
4
+ class u {
5
5
  constructor() {
6
6
  a(this, "selectedDynamicContent", null);
7
7
  a(this, "dataSelectCallback", () => {
8
8
  });
9
9
  }
10
- openMergeTagsLibrary(e, n) {
11
- this.dataSelectCallback = n, this.selectedDynamicContent = e;
12
- const s = new CustomEvent("dynamic-content:open", {
10
+ openMergeTagsLibrary(t, n) {
11
+ this.dataSelectCallback = n, this.selectedDynamicContent = t;
12
+ const o = new CustomEvent("dynamic-content:open", {
13
13
  detail: {
14
- attribute: e
14
+ attribute: t
15
15
  }
16
16
  });
17
- document.dispatchEvent(s);
18
- const o = (l) => {
19
- const c = l.detail;
20
- this.selectedDynamicContent = c, c.text && c.value && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", o);
17
+ document.dispatchEvent(o);
18
+ const l = (s) => {
19
+ const c = s.detail;
20
+ this.selectedDynamicContent = c || null, c && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", l);
21
21
  };
22
- document.addEventListener("dynamic-content:close", o);
22
+ document.addEventListener("dynamic-content:close", l);
23
23
  }
24
24
  }
25
25
  export {
26
- y as ExternalMergeTagsLibrary
26
+ u as ExternalMergeTagsLibrary
27
27
  };
@@ -2,14 +2,14 @@ var l = Object.defineProperty;
2
2
  var o = (i, t, e) => t in i ? l(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
3
  var r = (i, t, e) => o(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { d as n } from "../../_virtual/index.js";
5
- import { ExternalMergeTagsLibrary as c } from "./dynamic-content-modal.js";
6
- const a = "external-dynamic-content-ui-element", m = "button-add-dynamic-content";
7
- class d extends n.UIElementTagRegistry {
5
+ import { ExternalMergeTagsLibrary as m } from "./dynamic-content-modal.js";
6
+ const a = "external-dynamic-content-ui-element", g = "button-add-dynamic-content";
7
+ class y extends n.UIElementTagRegistry {
8
8
  registerUiElements(t) {
9
9
  t[n.UIElementType.MERGETAGS] = a;
10
10
  }
11
11
  }
12
- class b extends n.UIElement {
12
+ class E extends n.UIElement {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  r(this, "mergeTagsButton", null);
@@ -33,12 +33,12 @@ class b extends n.UIElement {
33
33
  this.openMergeTagLibrary();
34
34
  }
35
35
  openMergeTagLibrary() {
36
- this.mergeTagsLibrary || (this.mergeTagsLibrary = new c()), this.mergeTagsLibrary.openMergeTagsLibrary(
36
+ this.mergeTagsLibrary || (this.mergeTagsLibrary = new m()), this.mergeTagsLibrary.openMergeTagsLibrary(
37
37
  this.selectedDynamicContent,
38
38
  (e) => {
39
39
  this.api.onValueChanged({
40
- label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
41
- value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
40
+ label: e.text,
41
+ value: e.value
42
42
  });
43
43
  }
44
44
  );
@@ -49,7 +49,7 @@ class b extends n.UIElement {
49
49
  <${n.UIElementType.BUTTON}
50
50
  id="guido__btn-add-dynamic-content"
51
51
  class="btn btn-primary"
52
- ${n.UEAttr.BUTTON.name}="${m}">
52
+ ${n.UEAttr.BUTTON.name}="${g}">
53
53
  <${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
54
54
  </${n.UIElementType.ICON}>
55
55
  ${this.api.translate("Add Dynamic Content")}
@@ -58,6 +58,6 @@ class b extends n.UIElement {
58
58
  }
59
59
  }
60
60
  export {
61
- d as DynamicContentTagRegistry,
62
- b as DynamicContentUiElementExtension
61
+ y as DynamicContentTagRegistry,
62
+ E as DynamicContentUiElementExtension
63
63
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- [data-v-95dad178] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-95dad178],[data-v-95dad178] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-f90d31ea] .guido__view-option-selection-desktop svg,[data-v-f90d31ea] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-f90d31ea] .in-segments-wrapper__button_selected,[data-v-f90d31ea] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-7836f831],.guido-editor__container[data-v-7836f831]{width:100%;height:calc(100vh - 75px)}
1
+ .version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-67f97212],.guido-editor__container[data-v-67f97212]{width:100%;height:calc(100vh - 75px)}
@@ -1,8 +1,7 @@
1
- import type { CustomFont, Template } from '@@/Types/stripo';
1
+ import type { CustomFont } from '@@/Types/stripo';
2
2
  export declare const useStripoApi: () => {
3
3
  getToken: () => Promise<string>;
4
4
  getCustomFonts: () => Promise<(CustomFont & {
5
5
  active: boolean;
6
6
  })[]>;
7
- getDefaultTemplate: () => Promise<Template>;
8
7
  };
@@ -1,45 +1,25 @@
1
- import { useHttp as a } from "../composables/useHttp.js";
2
- import { useToaster as s } from "../composables/useToaster.js";
1
+ import { useHttp as s } from "../composables/useHttp.js";
2
+ import { useToaster as n } from "../composables/useToaster.js";
3
3
  const m = () => {
4
- const { get: r } = a(), { handleError: o } = s();
4
+ const { get: o } = s(), { handleError: r } = n();
5
5
  return {
6
6
  getToken: async () => {
7
7
  try {
8
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await r(`/stripo/get-user-token?test=${t}`);
8
+ const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await o(`/stripo/get-user-token?test=${t}`);
9
9
  return e.body.token;
10
10
  } catch (t) {
11
- return o(t, "Failed to fetch token"), "";
11
+ return r(t, "Failed to fetch token"), "";
12
12
  }
13
13
  },
14
14
  getCustomFonts: async () => {
15
15
  try {
16
- const { data: t = [] } = await r("/stripo/get-partner-custom-fonts");
16
+ const { data: t = [] } = await o("/stripo/get-partner-custom-fonts");
17
17
  return t.map((e) => ({
18
18
  ...e,
19
19
  active: !0
20
20
  }));
21
21
  } catch (t) {
22
- return o(t, "Failed to fetch custom fonts"), [];
23
- }
24
- },
25
- getDefaultTemplate: async () => {
26
- const t = {
27
- html: "",
28
- css: "",
29
- forceRecreate: !0
30
- };
31
- try {
32
- const { data: e } = await r("/stripo/default-template");
33
- try {
34
- return {
35
- ...JSON.parse(e),
36
- forceRecreate: !0
37
- };
38
- } catch {
39
- return t;
40
- }
41
- } catch (e) {
42
- return o(e, "Failed to fetch default template"), t;
22
+ return r(t, "Failed to fetch custom fonts"), [];
43
23
  }
44
24
  }
45
25
  };