@useinsider/guido 3.16.0-beta.0faee0c → 3.16.0

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.
@@ -16,22 +16,22 @@ import { useEditorStore as b } from "../stores/editor.js";
16
16
  import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
17
  import Z from "../package.json.js";
18
18
  let n = null;
19
- const Ce = () => {
20
- const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: M, getCustomFonts: T, getSyncModulesStatus: v } = K(), { handleEvent: B } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
19
+ const Ct = () => {
20
+ const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = K(), { handleEvent: F } = z(), { handleModuleAdd: M } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
21
21
  var l;
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  i();
24
24
  return;
25
25
  }
26
- const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, e = document.createElement("script");
27
- e.id = "UiEditorScript", e.type = "module", e.src = r, e.onload = () => i(), e.onerror = () => {
28
- e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
29
- }, document.body.appendChild(e);
26
+ const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, t = document.createElement("script");
27
+ t.id = "UiEditorScript", t.type = "module", t.src = r, t.onload = () => i(), t.onerror = () => {
28
+ t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
29
+ }, document.body.appendChild(t);
30
30
  }), n.catch(() => {
31
31
  n = null;
32
32
  }), n), _ = async (i, s, o, a = [], r = !1) => {
33
33
  var y, E, h, C;
34
- const e = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
34
+ const t = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
35
35
  await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
@@ -57,7 +57,6 @@ const Ce = () => {
57
57
  messageSettingsEnabled: !0,
58
58
  displayGmailAnnotations: !0,
59
59
  displayHiddenPreheader: !1,
60
- keepModuleStylesEnabled: !0,
61
60
  displayTitle: !1,
62
61
  displayUTM: !1,
63
62
  selectElementAfterDrop: !0,
@@ -78,38 +77,38 @@ const Ce = () => {
78
77
  )
79
78
  }
80
79
  ],
81
- async onTokenRefreshRequest(t) {
80
+ async onTokenRefreshRequest(e) {
82
81
  try {
83
- const d = await M();
84
- t(d);
82
+ const d = await T();
83
+ e(d);
85
84
  } catch (d) {
86
85
  p(d, "Failed to refresh token");
87
86
  }
88
87
  },
89
88
  onTemplateLoaded() {
90
89
  try {
91
- const { importCss: t } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
92
- t(), d(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
93
- e.hasChanges = !1;
90
+ const { importCss: e } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
91
+ e(), d(), x(), I(), o.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
92
+ t.hasChanges = !1;
94
93
  }, 1e3);
95
- } catch (t) {
96
- p(t, "Failed to load custom interface appearance");
94
+ } catch (e) {
95
+ p(e, "Failed to load custom interface appearance");
97
96
  }
98
97
  },
99
- onCodeEditorVisibilityChanged(t) {
100
- e.isCodeEditorOpen = t;
98
+ onCodeEditorVisibilityChanged(e) {
99
+ t.isCodeEditorOpen = e;
101
100
  },
102
- onEditorVisualModeChanged(t) {
103
- e.editorVisualMode = t.toLowerCase();
101
+ onEditorVisualModeChanged(e) {
102
+ t.editorVisualMode = e.toLowerCase();
104
103
  },
105
- onVersionHistoryVisibilityChanged(t) {
106
- e.isVersionHistoryOpen = t;
104
+ onVersionHistoryVisibilityChanged(e) {
105
+ t.isVersionHistoryOpen = e;
107
106
  },
108
107
  onDataChanged() {
109
- e.hasChanges = !0;
108
+ t.hasChanges = !0;
110
109
  },
111
- onEvent: B,
112
- onModuleAdd: F,
110
+ onEvent: F,
111
+ onModuleAdd: M,
113
112
  notifications: V(),
114
113
  ignoreClickOutsideSelectors: [
115
114
  "#guido-dynamic-content-modal",
@@ -125,11 +124,11 @@ const Ce = () => {
125
124
  const a = b();
126
125
  try {
127
126
  await f();
128
- const [r, e] = await Promise.all([
129
- T(),
130
- v()
127
+ const [r, t] = await Promise.all([
128
+ v(),
129
+ B()
131
130
  ]);
132
- a.syncModulesEnabled = e, await _(i, s, o, r, e);
131
+ a.syncModulesEnabled = t, await _(i, s, o, r, t);
133
132
  } catch {
134
133
  a.loadingStatus = !1, k({
135
134
  type: X.Error,
@@ -146,5 +145,5 @@ const Ce = () => {
146
145
  } };
147
146
  };
148
147
  export {
149
- Ce as useStripo
148
+ Ct as useStripo
150
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.16.0-beta.0faee0c",
3
+ "version": "3.16.0",
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",