@useinsider/guido 2.0.0-beta.087a24f → 2.0.0-beta.13ba613

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.
@@ -1,25 +1,26 @@
1
- import { useActionsApi as _ } from "./useActionsApi.js";
2
- import { useBlocksConfig as k } from "./useBlocksConfig.js";
3
- import { useConfig as B } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as A } from "./useStripoEventHandler.js";
6
- import { useToaster as v } from "./useToaster.js";
1
+ import { useActionsApi as T } from "./useActionsApi.js";
2
+ import { useBlocksConfig as V } from "./useBlocksConfig.js";
3
+ import { useConfig as _ } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as v } from "./useStripoEventHandler.js";
6
+ import { useToaster as A } from "./useToaster.js";
7
7
  import { displayConditions as F } from "../enums/displayConditions.js";
8
8
  import { useStripoApi as D } from "../services/stripoApi.js";
9
9
  import I from "../static/styles/customEditorStyle.css.js";
10
10
  import { useEditorStore as M } from "../stores/editor.js";
11
11
  import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
- const $ = (a) => {
13
- const { features: d } = B(), { handleError: c } = v(), { getToken: g, getCustomFonts: f } = D(), { handleEvent: y } = A(), { getStripoBlocksConfig: C } = k(), S = async (i, n = []) => {
14
- var p, m;
15
- const o = M(), { html: s, css: t, forceRecreate: h } = i, { baseBlocks: l, extensions: w } = await C(), u = ((p = d.value) == null ? void 0 : p.displayConditions) ?? !0, b = ((m = d.value) == null ? void 0 : m.modulesDisabled) ?? !1;
12
+ import P from "../package.json.js";
13
+ const K = (c) => {
14
+ const { features: l } = _(), { handleError: u } = A(), { getToken: y, getCustomFonts: S } = D(), { handleEvent: C } = v(), { getStripoBlocksConfig: E } = V(), h = async (i, n = []) => {
15
+ var g, f;
16
+ const o = M(), { html: r, css: p, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await E(), m = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, b = ((f = l.value) == null ? void 0 : f.modulesDisabled) ?? !1;
16
17
  window.UIEditor.initEditor(
17
18
  document.querySelector("#guido-editor"),
18
19
  {
19
- metadata: a,
20
- html: s,
21
- css: t,
22
- forceRecreate: h,
20
+ metadata: c,
21
+ html: r,
22
+ css: p,
23
+ forceRecreate: a,
23
24
  locale: "en",
24
25
  undoButtonSelector: "#guido__undo-button",
25
26
  redoButtonSelector: "#guido__redo-button",
@@ -30,8 +31,8 @@ const $ = (a) => {
30
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
31
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
32
33
  customViewStyles: I,
33
- conditionsEnabled: u,
34
- customConditionsEnabled: u,
34
+ conditionsEnabled: m,
35
+ customConditionsEnabled: m,
35
36
  conditionCategories: F,
36
37
  enableXSSSecurity: !0,
37
38
  modulesDisabled: b,
@@ -41,7 +42,7 @@ const $ = (a) => {
41
42
  displayTitle: !1,
42
43
  displayUTM: !1,
43
44
  selectElementAfterDrop: !0,
44
- ...l ? { baseBlocks: l } : {},
45
+ ...t ? { baseBlocks: t } : {},
45
46
  editorFonts: {
46
47
  showDefaultStandardFonts: !0,
47
48
  showDefaultNotStandardFonts: !0,
@@ -49,25 +50,25 @@ const $ = (a) => {
49
50
  },
50
51
  mergeTags: [
51
52
  {
52
- entries: U(a.preselectedDynamicContentList)
53
+ entries: U(c.preselectedDynamicContentList)
53
54
  }
54
55
  ],
55
56
  async onTokenRefreshRequest(e) {
56
57
  try {
57
- const r = await g();
58
- e(r);
59
- } catch (r) {
60
- c(r, "Failed to refresh token");
58
+ const s = await y();
59
+ e(s);
60
+ } catch (s) {
61
+ u(s, "Failed to refresh token");
61
62
  }
62
63
  },
63
64
  onTemplateLoaded() {
64
65
  try {
65
- const { importCss: e } = V(), { activateCustomViewStyles: r, updateTimerInClonedTemplate: T } = _();
66
- e(), r(), T(), a.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
66
+ const { importCss: e } = B(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: k } = T();
67
+ e(), s(), k(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
67
68
  o.hasChanges = !1;
68
69
  }, 1e3);
69
70
  } catch (e) {
70
- c(e, "Failed to load custom interface appearance");
71
+ u(e, "Failed to load custom interface appearance");
71
72
  }
72
73
  },
73
74
  onCodeEditorVisibilityChanged(e) {
@@ -82,34 +83,35 @@ const $ = (a) => {
82
83
  onDataChanged() {
83
84
  o.hasChanges = !0;
84
85
  },
85
- onEvent: y,
86
+ onEvent: C,
86
87
  ignoreClickOutsideSelectors: [
87
88
  "#guido-dynamic-content-modal",
88
89
  ".in-on-board-wrapper",
89
90
  ".in-drawer__container"
90
91
  ],
91
- extensions: w
92
+ extensions: d
92
93
  }
93
94
  );
94
- }, E = (i) => new Promise((n, o) => {
95
+ }, w = (i) => new Promise((n, o) => {
96
+ var d;
95
97
  if (document.getElementById("UiEditorScript")) {
96
98
  i(), n();
97
99
  return;
98
100
  }
99
- const s = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t = document.createElement("script");
100
- t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
101
+ const r = P.guido, a = `https://email-static.useinsider.com/guido/${(d = r == null ? void 0 : r.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
102
+ t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
101
103
  i(), n();
102
104
  }, t.onerror = () => {
103
- o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
105
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
104
106
  }, document.body.appendChild(t);
105
107
  });
106
108
  return { initPlugin: async (i) => {
107
- await E(async () => {
108
- const n = await f();
109
- await S(i, n);
109
+ await w(async () => {
110
+ const n = await S();
111
+ await h(i, n);
110
112
  });
111
113
  } };
112
114
  };
113
115
  export {
114
- $ as useStripo
116
+ K as useStripo
115
117
  };
@@ -0,0 +1,7 @@
1
+ const o = { stripo: { version: "2.52.0" } }, s = {
2
+ guido: o
3
+ };
4
+ export {
5
+ s as default,
6
+ o as guido
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.087a24f",
3
+ "version": "2.0.0-beta.13ba613",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",