@useinsider/guido 1.0.0-beta.2562d59 → 1.0.0-beta.3012b2b

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 (46) hide show
  1. package/README.md +11 -0
  2. package/dist/@types/generic.d.ts +1 -0
  3. package/dist/components/Guido.vue.js +11 -11
  4. package/dist/components/Guido.vue2.js +22 -23
  5. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -15
  6. package/dist/components/organisms/header/RightSlot.vue2.js +25 -26
  7. package/dist/components/wrappers/WpDrawer.vue.d.ts +1 -1
  8. package/dist/components/wrappers/WpModal.vue.d.ts +1 -1
  9. package/dist/composables/usePreviewMode.js +13 -14
  10. package/dist/composables/useStripo.js +36 -39
  11. package/dist/enums/defaults.js +5 -4
  12. package/dist/guido.css +1 -1
  13. package/dist/static/styles/components/wide-panel.css.js +4 -0
  14. package/dist/static/styles/customEditorStyle.css.js +18 -0
  15. package/dist/stores/editor.d.ts +0 -1
  16. package/dist/stores/editor.js +3 -4
  17. package/dist/stores/preview.js +15 -26
  18. package/package.json +1 -1
  19. package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
  20. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
  21. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -39
  22. package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
  23. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
  24. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -85
  25. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
  26. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
  27. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
  28. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
  29. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -17
  30. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -20
  31. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
  32. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
  33. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -64
  34. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
  35. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
  36. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -39
  37. package/dist/composables/useOnboardingApi.d.ts +0 -4
  38. package/dist/composables/useOnboardingApi.js +0 -23
  39. package/dist/composables/useStripoEventHandler.d.ts +0 -3
  40. package/dist/composables/useStripoEventHandler.js +0 -20
  41. package/dist/enums/onboarding.d.ts +0 -1
  42. package/dist/enums/onboarding.js +0 -8
  43. package/dist/mock/api/user-modal-state.d.ts +0 -2
  44. package/dist/static/assets/onboarding-img.svg.js +0 -4
  45. package/dist/stores/onboarding.d.ts +0 -1998
  46. package/dist/stores/onboarding.js +0 -108
package/README.md CHANGED
@@ -145,6 +145,16 @@ interface GuidoConfig {
145
145
  translationsPath: string;
146
146
  htmlCompilerRules?: CompilerRule[];
147
147
  ignoreDefaultHtmlCompilerRules?: boolean;
148
+ useHeader: boolean
149
+ emailHeader: {
150
+ senderName: string;
151
+ subject: string;
152
+ };
153
+ partner: {
154
+ partnerName: string;
155
+ productType: number;
156
+ messageType: number;
157
+ };
148
158
  features: {
149
159
  dynamicContent: boolean;
150
160
  saveAsTemplate: boolean;
@@ -158,6 +168,7 @@ interface GuidoConfig {
158
168
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
159
169
  | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
160
170
  | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
171
+ | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
161
172
  | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
162
173
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
163
174
  | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
@@ -13,6 +13,7 @@ export type GuidoConfig = {
13
13
  translationsPath: string;
14
14
  htmlCompilerRules?: CompilerRule[];
15
15
  ignoreDefaultHtmlCompilerRules?: boolean;
16
+ useHeader?: boolean;
16
17
  emailHeader: EmailHeader;
17
18
  partner?: Partner;
18
19
  features?: Features;
@@ -1,18 +1,18 @@
1
- import o from "./Guido.vue2.js";
1
+ import i from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import t from "../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
5
- var i = this, e = i._self._c, r = i._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.Toaster), e(r.SaveAsTemplateDrawer), e(r.OnboardingWrapper)], 1);
7
- }, a = [], n = /* @__PURE__ */ t(
8
- o,
9
- s,
3
+ import s from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var o = this, r = o._self._c, e = o._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": !e.guidoConfig.useHeader } }, [r(e.HeaderWrapper), e.previewStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": !e.guidoConfig.useHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer)], 1);
7
+ }, t = [], d = /* @__PURE__ */ s(
8
+ i,
10
9
  a,
10
+ t,
11
11
  !1,
12
12
  null,
13
- "2c7e0efc"
13
+ "9fa9554d"
14
14
  );
15
- const c = n.exports;
15
+ const u = d.exports;
16
16
  export {
17
- c as default
17
+ u as default
18
18
  };
@@ -2,17 +2,16 @@ import { defineComponent as I, defineAsyncComponent as P, computed as _, onMount
2
2
  import { provideGuidoActions as A } from "../composables/useGuidoActions.js";
3
3
  import { usePartner as N } from "../composables/usePartner.js";
4
4
  import { useStripo as U } from "../composables/useStripo.js";
5
- import { DefaultUsername as W, DefaultMessageType as x, DefaultGuidoConfig as M } from "../enums/defaults.js";
5
+ import { DefaultUsername as x, DefaultMessageType as M, DefaultGuidoConfig as W } from "../enums/defaults.js";
6
6
  import z from "./organisms/base/Toaster.vue.js";
7
7
  import B from "./organisms/header/HeaderWrapper.vue.js";
8
- import F from "./organisms/onboarding/OnboardingWrapper.vue.js";
9
- import H from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
10
- import { useStripoApi as K } from "../services/stripoApi.js";
11
- import { useDynamicContentStore as O } from "../stores/dynamic-content.js";
8
+ import F from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
9
+ import { useStripoApi as H } from "../services/stripoApi.js";
10
+ import { useDynamicContentStore as K } from "../stores/dynamic-content.js";
12
11
  import { useEditorStore as R } from "../stores/editor.js";
13
12
  import { usePreviewStore as j } from "../stores/preview.js";
14
13
  import q from "../node_modules/lodash-es/merge.js";
15
- const ae = /* @__PURE__ */ I({
14
+ const se = /* @__PURE__ */ I({
16
15
  __name: "Guido",
17
16
  props: {
18
17
  templateId: null,
@@ -30,30 +29,30 @@ const ae = /* @__PURE__ */ I({
30
29
  setup(b, { expose: E, emit: t }) {
31
30
  const o = b, T = P(
32
31
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
33
- ), n = O(), a = R(), c = _(() => a.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = N(), G = j(), {
32
+ ), n = K(), c = R(), a = _(() => c.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = N(), G = j(), {
34
33
  templateId: l,
35
- userId: p,
36
- guidoConfig: u,
34
+ userId: u,
35
+ guidoConfig: p,
37
36
  html: f = "",
38
37
  css: g = "",
39
- partnerName: i = m(),
40
- productType: s = d(),
41
- messageType: y = x,
42
- username: C = W
38
+ partnerName: s = m(),
39
+ productType: i = d(),
40
+ messageType: y = M,
41
+ username: C = x
43
42
  } = o;
44
- window.GuidoConfig = q(M, u), window.GuidoConfig.partner = {
45
- partnerName: i,
46
- productType: s,
43
+ window.GuidoConfig = q(W, p), window.GuidoConfig.partner = {
44
+ partnerName: s,
45
+ productType: i,
47
46
  messageType: y
48
47
  };
49
48
  const { initPlugin: v } = U({
50
49
  emailId: l,
51
- userId: p,
50
+ userId: u,
52
51
  username: C,
53
- partnerName: i,
54
- productType: s,
52
+ partnerName: s,
53
+ productType: i,
55
54
  preselectedDynamicContentList: r
56
- }), { getDefaultTemplate: w } = K();
55
+ }), { getDefaultTemplate: w } = H();
57
56
  A({
58
57
  onBack: () => {
59
58
  console.debug("guido:back"), t("back");
@@ -94,10 +93,10 @@ const ae = /* @__PURE__ */ I({
94
93
  insert: D,
95
94
  close: S
96
95
  },
97
- hasChanges: c
98
- }), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: a, hasChanges: c, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, previewStore: G, templateId: l, userId: p, guidoConfig: u, html: f, css: g, partnerName: i, productType: s, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, Toaster: z, HeaderWrapper: B, OnboardingWrapper: F, SaveAsTemplateDrawer: H };
96
+ hasChanges: a
97
+ }), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: c, hasChanges: a, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, previewStore: G, templateId: l, userId: u, guidoConfig: p, html: f, css: g, partnerName: s, productType: i, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, Toaster: z, HeaderWrapper: B, SaveAsTemplateDrawer: F };
99
98
  }
100
99
  });
101
100
  export {
102
- ae as default
101
+ se as default
103
102
  };
@@ -1,30 +1,29 @@
1
- import { defineComponent as r, computed as i } from "vue";
2
- import { useTranslations as m } from "../../../../composables/useTranslations.js";
3
- import { useOnboardingStore as s } from "../../../../stores/onboarding.js";
4
- import { usePreviewStore as p } from "../../../../stores/preview.js";
5
- import { InButtonV2 as l, InSegments as d } from "@useinsider/design-system-vue";
6
- const v = /* @__PURE__ */ r({
1
+ import { defineComponent as m, computed as n } from "vue";
2
+ import { useTranslations as r } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as i } from "../../../../stores/preview.js";
4
+ import { InButtonV2 as s, InSegments as l } from "@useinsider/design-system-vue";
5
+ const _ = /* @__PURE__ */ m({
7
6
  __name: "AmpToggle",
8
- setup(u) {
9
- const t = p(), e = s(), o = m(), a = i(() => [
7
+ setup(p) {
8
+ const t = i(), e = r(), o = n(() => [
10
9
  {
11
- text: o("dynamic-creatives.html"),
10
+ text: e("dynamic-creatives.html"),
12
11
  value: "html"
13
12
  },
14
13
  {
15
- text: o("email-editor.amp-html"),
14
+ text: e("email-editor.amp-html"),
16
15
  value: "AMP",
17
- tooltipText: t.hasAMP ? "" : o("email-editor.preview-amp-unavailable-tooltip"),
16
+ tooltipText: t.hasAMP ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
18
17
  position: "bottom",
19
18
  align: "center",
20
19
  disable: !t.hasAMP
21
20
  }
22
21
  ]);
23
- return { __sfc: !0, previewStore: t, onboardingStore: e, trans: o, segmentList: a, handleFormatChange: (n) => {
24
- t.setEmailFormat(n), n === "AMP" && e.shouldShowOnboarding("ampOnboarding") && e.start("ampOnboarding");
25
- }, InSegments: d, InButtonV2: l };
22
+ return { __sfc: !0, previewStore: t, trans: e, segmentList: o, handleFormatChange: (a) => {
23
+ t.setEmailFormat(a);
24
+ }, InSegments: l, InButtonV2: s };
26
25
  }
27
26
  });
28
27
  export {
29
- v as default
28
+ _ as default
30
29
  };
@@ -1,38 +1,37 @@
1
- import { defineComponent as H, computed as m } from "vue";
2
- import { useConfig as g } from "../../../composables/useConfig.js";
3
- import { useExport as O } from "../../../composables/useExport.js";
4
- import { useSaveStart as h, useSaveComplete as b } from "../../../composables/useGuidoActions.js";
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
5
  import { useTranslations as w } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as V } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as _ } from "../../../stores/editor.js";
8
- import { useOnboardingStore as T } from "../../../stores/onboarding.js";
9
- import { usePreviewStore as x } from "../../../stores/preview.js";
10
- import { useTemplatePreparation as A } from "../../../utils/templatePreparation.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";
11
10
  import { getTooltipOptions as C } from "../../../utils/tooltipUtils.js";
12
11
  import { InButtonV2 as D } from "@useinsider/design-system-vue";
13
- const K = /* @__PURE__ */ H({
12
+ const z = /* @__PURE__ */ y({
14
13
  __name: "RightSlot",
15
- setup(P) {
16
- const { config: c } = g(), { exportHtml: l } = O(), s = h(), i = b(), { openVersionHistory: n, closeVersionHistory: a } = V(), o = _(), e = T(), t = w(), p = x(), f = () => {
17
- if (o.isVersionHistoryOpen) {
18
- a(), e.isActive("versionHistoryOnboarding") && e.close("versionHistoryOnboarding");
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();
19
18
  return;
20
19
  }
21
- n(), e.shouldShowOnboarding("versionHistoryOnboarding") && e.start("versionHistoryOnboarding");
22
- }, d = () => {
23
- o.isSaveAsTemplateDrawerOpen = !0;
24
- }, v = m(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), u = async () => {
25
- s();
20
+ i();
21
+ }, f = () => {
22
+ e.isSaveAsTemplateDrawerOpen = !0;
23
+ }, u = p(() => e.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), v = async () => {
24
+ r();
26
25
  try {
27
- const { prepareTemplateDetails: r } = A(), S = await r();
28
- i(S);
29
- } catch (r) {
30
- console.error("Failed to get template data for save:", r);
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);
31
30
  }
32
- }, y = m(() => o.isVersionHistoryOpen || p.isPreviewModeOpen);
33
- return { __sfc: !0, config: c, exportHtml: l, saveStart: s, saveComplete: i, openVersionHistory: n, closeVersionHistory: a, editorStore: o, onboardingStore: e, trans: t, previewStore: p, handleVersionHistory: f, handleSaveAs: d, versionHistoryTooltipText: v, handleSave: u, isSaveButtonDisabled: y, getTooltipOptions: C, InButtonV2: D };
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 };
34
33
  }
35
34
  });
36
35
  export {
37
- K as default
36
+ z as default
38
37
  };
@@ -31,9 +31,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
31
31
  descriptionStatus: boolean;
32
32
  descriptionText: string;
33
33
  }>>>, {
34
+ className: string;
34
35
  size: string;
35
36
  closeOnOutsideClick: boolean;
36
- className: string;
37
37
  descriptionStatus: boolean;
38
38
  descriptionText: string;
39
39
  }>;
@@ -34,9 +34,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
34
34
  }>>>, {
35
35
  description: string;
36
36
  size: "small" | "medium" | "large";
37
+ closeOnOutsideClick: boolean;
37
38
  footerButtonOptions: FooterButtonGroup;
38
39
  closeButtonStatus: boolean;
39
- closeOnOutsideClick: boolean;
40
40
  footerStatus: boolean;
41
41
  }>;
42
42
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -1,25 +1,24 @@
1
- import { useEditorStore as p } from "../stores/editor.js";
2
- import { useOnboardingStore as m } from "../stores/onboarding.js";
3
- import { usePreviewStore as c } from "../stores/preview.js";
4
- import { useActionsApi as l } from "./useActionsApi.js";
5
- import { useCodeEditorApi as v } from "./useCodeEditorApi.js";
6
- const S = () => {
7
- const i = p(), e = c(), r = m(), { closeCodeEditor: a } = v(), { getPreviewData: s } = l(), t = () => {
8
- r.isActive("ampOnboarding") && r.close("ampOnboarding"), e.isPreviewModeOpen = !1, e.$reset();
1
+ import { useEditorStore as n } from "../stores/editor.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
+ const E = () => {
6
+ const i = n(), e = m(), { closeCodeEditor: s } = l(), { getPreviewData: a } = p(), r = () => {
7
+ e.isPreviewModeOpen = !1, e.$reset();
9
8
  };
10
9
  return {
11
- closePreviewMode: t,
10
+ closePreviewMode: r,
12
11
  openPreviewMode: () => {
13
- i.isCodeEditorOpen && a(), e.openPreviewMode();
12
+ i.isCodeEditorOpen && s(), e.isPreviewModeOpen = !0;
14
13
  },
15
14
  loadPreviewData: async () => {
16
15
  if (!(e.isLoading || e.isLoaded)) {
17
16
  e.isLoading = !0;
18
17
  try {
19
- const { html: o, ampHtml: d, ampErrors: n } = await s();
20
- e.templateHtml = o || "", e.updateAMPData({ ampHtml: d || "", ampErrors: n || [] }), e.isLoaded = !0;
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;
21
20
  } catch (o) {
22
- console.error("Failed to load preview data:", o), t();
21
+ console.error("Failed to load preview data:", o), r();
23
22
  } finally {
24
23
  e.isLoading = !1;
25
24
  }
@@ -28,5 +27,5 @@ const S = () => {
28
27
  };
29
28
  };
30
29
  export {
31
- S as usePreviewMode
30
+ E as usePreviewMode
32
31
  };
@@ -1,22 +1,22 @@
1
- import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as S } from "./useCustomInterfaceAppearance.js";
3
- import { useStripoEventHandler as E } from "./useStripoEventHandler.js";
4
- import { useToaster as C } 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 { useEditorStore as b } from "../stores/editor.js";
9
- import { dynamicContentToMergeTags as V } from "../utils/genericUtil.js";
10
- const D = (d) => {
11
- const { handleError: a } = C(), { getToken: c, getCustomFonts: u } = w(), { handleEvent: l } = E(), p = (r, i = []) => {
12
- const e = b(), { html: o, css: s, 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 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 = (d) => {
11
+ const { handleError: c } = S(), { getToken: a, getCustomFonts: u } = E(), l = (e, r = []) => {
12
+ const i = w(), { html: o, css: s, forceRecreate: p } = e;
13
13
  window.UIEditor.initEditor(
14
14
  document.querySelector("#guido-editor"),
15
15
  {
16
16
  metadata: d,
17
17
  html: o,
18
18
  css: s,
19
- forceRecreate: g,
19
+ forceRecreate: p,
20
20
  locale: "en",
21
21
  undoButtonSelector: "#guido__undo-button",
22
22
  redoButtonSelector: "#guido__redo-button",
@@ -26,78 +26,75 @@ const D = (d) => {
26
26
  customAppearanceMergetags: !0,
27
27
  customAppearanceMergetagsBorderColor: "#f1f3fe",
28
28
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
29
- customViewStyles: `
30
- .esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
31
- .esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
32
- `,
29
+ customViewStyles: h,
33
30
  conditionsEnabled: !0,
34
31
  customConditionsEnabled: !0,
35
- conditionCategories: y,
32
+ conditionCategories: C,
36
33
  enableXSSSecurity: !0,
37
34
  messageSettingsEnabled: !1,
35
+ selectBlockAfterDropFromSettingsPanel: !0,
38
36
  editorFonts: {
39
37
  showDefaultStandardFonts: !0,
40
38
  showDefaultNotStandardFonts: !0,
41
- customFonts: i
39
+ customFonts: r
42
40
  },
43
41
  mergeTags: [
44
42
  {
45
- entries: V(d.preselectedDynamicContentList)
43
+ entries: b(d.preselectedDynamicContentList)
46
44
  }
47
45
  ],
48
46
  async onTokenRefreshRequest(t) {
49
47
  try {
50
- const n = await c();
48
+ const n = await a();
51
49
  t(n);
52
50
  } catch (n) {
53
- a(n, "Failed to refresh token");
51
+ c(n, "Failed to refresh token");
54
52
  }
55
53
  },
56
54
  onTemplateLoaded() {
57
55
  try {
58
- const { importCss: t } = S(), { activateCustomViewStyles: n } = f();
59
- t(), n(), e.isStripoInitialized = !0;
56
+ const { importCss: t } = f(), { activateCustomViewStyles: n } = g();
57
+ t(), n();
60
58
  } catch (t) {
61
- a(t, "Failed to load custom interface appearance");
59
+ c(t, "Failed to load custom interface appearance");
62
60
  }
63
61
  },
64
62
  onCodeEditorVisibilityChanged(t) {
65
- e.isCodeEditorOpen = t;
63
+ i.isCodeEditorOpen = t;
66
64
  },
67
65
  onEditorVisualModeChanged(t) {
68
- e.editorVisualMode = t.toLowerCase();
66
+ i.editorVisualMode = t.toLowerCase();
69
67
  },
70
68
  onVersionHistoryVisibilityChanged(t) {
71
- e.isVersionHistoryOpen = t;
69
+ i.isVersionHistoryOpen = t;
72
70
  },
73
71
  onDataChanged() {
74
- e.hasChanges = !0;
72
+ i.hasChanges = !0;
75
73
  },
76
- onEvent: l,
77
74
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
78
- extensions: [h]
75
+ extensions: [y]
79
76
  }
80
77
  );
81
- }, m = (r) => new Promise((i, e) => {
78
+ }, m = (e) => new Promise((r, i) => {
82
79
  if (document.getElementById("UiEditorScript")) {
83
- r(), i();
80
+ e(), r();
84
81
  return;
85
82
  }
86
83
  const o = document.createElement("script");
87
84
  o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
88
- r(), i();
85
+ e(), r();
89
86
  }, o.onerror = () => {
90
87
  const s = new Error("Failed to load Stripo UIEditor script");
91
- e(s);
88
+ i(s);
92
89
  }, document.body.appendChild(o);
93
90
  });
94
- return { initPlugin: async (r) => {
91
+ return { initPlugin: async (e) => {
95
92
  await m(async () => {
96
- const i = await u();
97
- p(r, i);
93
+ const r = await u();
94
+ l(e, r);
98
95
  });
99
96
  } };
100
97
  };
101
98
  export {
102
- D as useStripo
99
+ P as useStripo
103
100
  };
@@ -8,8 +8,9 @@ const e = {
8
8
  dynamicContent: !0,
9
9
  saveAsTemplate: !0,
10
10
  versionHistory: !0
11
- }
12
- }, t = "email", s = "Guido User", a = 1, n = 2, o = {
11
+ },
12
+ useHeader: !0
13
+ }, t = "email", s = "Guido User", a = 1, r = 2, n = {
13
14
  email: 60,
14
15
  architect: 49
15
16
  };
@@ -18,6 +19,6 @@ export {
18
19
  a as DefaultMessageType,
19
20
  t as DefaultProductType,
20
21
  s as DefaultUsername,
21
- n as EditorType,
22
- o as ProductIds
22
+ r as EditorType,
23
+ n as ProductIds
23
24
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .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-aad05c54] .guido__view-option-selection-desktop svg,[data-v-aad05c54] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-aad05c54] .in-segments-wrapper__button_selected,[data-v-aad05c54] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-aad05c54] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-9521080b] .vueperslides__bullets,[data-v-6a5e254d] .vueperslides__bullets{pointer-events:none!important}.guido-editor__wrapper[data-v-2c7e0efc],.guido-editor__container[data-v-2c7e0efc]{width:100%;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}
1
+ .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-aad05c54] .guido__view-option-selection-desktop svg,[data-v-aad05c54] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-aad05c54] .in-segments-wrapper__button_selected,[data-v-aad05c54] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-aad05c54] .in-tooltip-wrapper__icon{cursor:pointer}.guido-editor__wrapper[data-v-9fa9554d],.guido-editor__container[data-v-9fa9554d]{width:100%;height:calc(100vh - 122px)}.guido-editor__no-header[data-v-9fa9554d]{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}
@@ -11,6 +11,10 @@ ue-main-tabs-panel-component .fixed-panel-header {
11
11
  color: var(--guido-color-gray-800);
12
12
  }
13
13
 
14
+ .stacked-panel {
15
+ overflow: scroll;
16
+ }
17
+
14
18
  .stacked-panel-title {
15
19
  padding: 16px;
16
20
  font-size: 16px;
@@ -0,0 +1,18 @@
1
+ const n = `.esd-x,
2
+ .esd-merge-tag {
3
+ color: #0a2ecc !important;
4
+ box-shadow: none !important;
5
+ }
6
+
7
+ .esd-merge-tag {
8
+ border: 1px solid #b5c1f1;
9
+ border-radius: 4px !important;
10
+ }
11
+
12
+ .ue-preview-control-wrapper ue-icon-component:not([disabled=true]):not(.stripo-static-icon):hover {
13
+ background: none;
14
+ }
15
+ `;
16
+ export {
17
+ n as default
18
+ };
@@ -5,5 +5,4 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
5
5
  isPreviewModeOpen: boolean;
6
6
  editorVisualMode: string;
7
7
  hasChanges: boolean;
8
- isStripoInitialized: boolean;
9
8
  }, {}, {}>;
@@ -1,15 +1,14 @@
1
1
  import { defineStore as e } from "pinia";
2
- const i = e("editor", {
2
+ const o = e("editor", {
3
3
  state: () => ({
4
4
  isCodeEditorOpen: !1,
5
5
  isSaveAsTemplateDrawerOpen: !1,
6
6
  isVersionHistoryOpen: !1,
7
7
  isPreviewModeOpen: !1,
8
8
  editorVisualMode: "desktop",
9
- hasChanges: !1,
10
- isStripoInitialized: !1
9
+ hasChanges: !1
11
10
  })
12
11
  });
13
12
  export {
14
- i as useEditorStore
13
+ o as useEditorStore
15
14
  };
@@ -1,6 +1,5 @@
1
- import { useOnboardingStore as s } from "./onboarding.js";
2
- import { defineStore as a } from "pinia";
3
- const l = () => ({
1
+ import { defineStore as t } from "pinia";
2
+ const s = () => ({
4
3
  emailFormat: "html",
5
4
  ampHtml: "",
6
5
  ampErrors: [],
@@ -9,18 +8,18 @@ const l = () => ({
9
8
  isLoaded: !1,
10
9
  isAMPErrorModalVisible: !1,
11
10
  isPreviewModeOpen: !1
12
- }), h = a("preview", {
13
- state: () => l(),
11
+ }), o = t("preview", {
12
+ state: () => s(),
14
13
  getters: {
15
- isAMPModeEnabled: (o) => o.emailFormat === "AMP",
14
+ isAMPModeEnabled: (e) => e.emailFormat === "AMP",
16
15
  previewHtml() {
17
16
  return this.isAMPModeEnabled ? this.ampHtml : this.templateHtml;
18
17
  },
19
- hasAMP: (o) => {
20
- var e;
21
- return !!((e = o.ampHtml) != null && e.trim());
18
+ hasAMP: (e) => {
19
+ var r;
20
+ return !!((r = e.ampHtml) != null && r.trim());
22
21
  },
23
- hasAMPErrors: (o) => o.ampErrors.length > 0,
22
+ hasAMPErrors: (e) => e.ampErrors.length > 0,
24
23
  showAMPErrorButton() {
25
24
  return this.isAMPModeEnabled && this.hasAMPErrors;
26
25
  },
@@ -29,18 +28,11 @@ const l = () => ({
29
28
  }
30
29
  },
31
30
  actions: {
32
- updateAMPData(o) {
33
- var r;
34
- const e = !!((r = this.ampHtml) != null && r.trim());
35
- this.ampHtml = o.ampHtml ?? "", this.ampErrors = o.ampErrors ?? [];
36
- const t = o.ampHtml ? "AMP" : "html";
37
- if (this.emailFormat = t, !e && t === "AMP") {
38
- const i = s();
39
- i.shouldShowOnboarding("ampOnboarding") && i.start("ampOnboarding");
40
- }
31
+ updateAMPData(e) {
32
+ this.ampHtml = e.ampHtml ?? "", this.ampErrors = e.ampErrors ?? [], this.emailFormat = e.ampHtml ? "AMP" : "html";
41
33
  },
42
- setEmailFormat(o) {
43
- this.emailFormat = o;
34
+ setEmailFormat(e) {
35
+ this.emailFormat = e;
44
36
  },
45
37
  closeErrorModal() {
46
38
  this.isAMPErrorModalVisible = !1;
@@ -49,10 +41,7 @@ const l = () => ({
49
41
  this.isAMPErrorModalVisible = !0;
50
42
  },
51
43
  openPreviewMode() {
52
- if (this.isPreviewModeOpen = !0, this.emailFormat === "AMP") {
53
- const o = s();
54
- o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
55
- }
44
+ this.isPreviewModeOpen = !0;
56
45
  },
57
46
  closePreviewMode() {
58
47
  this.isPreviewModeOpen = !1;
@@ -60,5 +49,5 @@ const l = () => ({
60
49
  }
61
50
  });
62
51
  export {
63
- h as usePreviewStore
52
+ o as usePreviewStore
64
53
  };