@useinsider/guido 3.7.1-beta.ac21e59 → 3.7.1-beta.cb7d58e

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,29 +1,27 @@
1
- import { useActionsApi as I } from "./useActionsApi.js";
2
- import { useBlocksConfig as U } from "./useBlocksConfig.js";
3
- import { useConfig as R } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as x } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as O } from "./useFullStoryBridge.js";
1
+ import { useActionsApi as D } from "./useActionsApi.js";
2
+ import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
+ import { useConfig as P } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
6
  import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
- import { useToaster as H } from "./useToaster.js";
8
- import { localePatch as z } from "../config/i18n/index.js";
9
- import { en as h } from "../config/i18n/en/index.js";
10
- import { ToasterTypeOptions as L } from "../enums/toaster.js";
11
- import { useStripoApi as $ } from "../services/stripoApi.js";
12
- import G from "../static/styles/customEditorStyle.css.js";
13
- import { useEditorStore as C } from "../stores/editor.js";
14
- import { dynamicContentToMergeTags as J } from "../utils/genericUtil.js";
15
- import N from "../package.json.js";
16
- const ce = (E, l) => {
17
- const { features: c, template: w, isFeatureEnabled: u } = R(), { handleError: m, showToaster: b } = H(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = $(), { handleEvent: F } = q(), { getStripoBlocksConfig: v } = U(), V = async (s, r = [], i = !1) => {
7
+ import { useToaster as x } from "./useToaster.js";
8
+ import { localePatch as H } from "../config/i18n/index.js";
9
+ import { useStripoApi as O } from "../services/stripoApi.js";
10
+ import j from "../static/styles/customEditorStyle.css.js";
11
+ import { useEditorStore as E } from "../stores/editor.js";
12
+ import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
13
+ import L from "../package.json.js";
14
+ const se = (C, l) => {
15
+ const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: F } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], s = !1) => {
18
16
  var g, S, y;
19
- const e = C(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, A = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, M = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
20
- await window.UIEditor.initEditor(
17
+ const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await B(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, _ = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
+ window.UIEditor.initEditor(
21
19
  document.querySelector("#guido-editor"),
22
20
  {
23
- metadata: E,
21
+ metadata: C,
24
22
  html: p,
25
23
  css: a,
26
- forceRecreate: M,
24
+ forceRecreate: v,
27
25
  locale: "en",
28
26
  undoButtonSelector: "#guido__undo-button",
29
27
  redoButtonSelector: "#guido__redo-button",
@@ -33,12 +31,12 @@ const ce = (E, l) => {
33
31
  customAppearanceMergetags: !u("liquidSyntax"),
34
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
35
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
36
- customViewStyles: G,
34
+ customViewStyles: j,
37
35
  conditionsEnabled: f,
38
36
  customConditionsEnabled: f,
39
37
  enableXSSSecurity: !0,
40
- modulesDisabled: A,
41
- syncModulesEnabled: i,
38
+ modulesDisabled: _,
39
+ syncModulesEnabled: s,
42
40
  messageSettingsEnabled: !0,
43
41
  displayGmailAnnotations: !0,
44
42
  displayHiddenPreheader: !1,
@@ -47,7 +45,7 @@ const ce = (E, l) => {
47
45
  selectElementAfterDrop: !0,
48
46
  sameFontSizeForOutlook: !0,
49
47
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
50
- ...t ? { baseBlocks: t } : {},
48
+ ...o ? { baseBlocks: o } : {},
51
49
  editorFonts: {
52
50
  showDefaultStandardFonts: !0,
53
51
  showDefaultNotStandardFonts: !0,
@@ -55,38 +53,38 @@ const ce = (E, l) => {
55
53
  },
56
54
  mergeTags: [
57
55
  {
58
- entries: J(
56
+ entries: z(
59
57
  l.preselectedDynamicContentList,
60
58
  u("liquidSyntax")
61
59
  )
62
60
  }
63
61
  ],
64
- async onTokenRefreshRequest(o) {
62
+ async onTokenRefreshRequest(t) {
65
63
  try {
66
- const n = await T();
67
- o(n);
64
+ const n = await w();
65
+ t(n);
68
66
  } catch (n) {
69
67
  m(n, "Failed to refresh token");
70
68
  }
71
69
  },
72
70
  onTemplateLoaded() {
73
71
  try {
74
- const { importCss: o } = x(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: P } = I(), { injectFullStory: D } = O();
75
- o(), n(), D(), P(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
72
+ const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
73
+ t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
76
74
  e.hasChanges = !1;
77
75
  }, 1e3);
78
- } catch (o) {
79
- m(o, "Failed to load custom interface appearance");
76
+ } catch (t) {
77
+ m(t, "Failed to load custom interface appearance");
80
78
  }
81
79
  },
82
- onCodeEditorVisibilityChanged(o) {
83
- e.isCodeEditorOpen = o;
80
+ onCodeEditorVisibilityChanged(t) {
81
+ e.isCodeEditorOpen = t;
84
82
  },
85
- onEditorVisualModeChanged(o) {
86
- e.editorVisualMode = o.toLowerCase();
83
+ onEditorVisualModeChanged(t) {
84
+ e.editorVisualMode = t.toLowerCase();
87
85
  },
88
- onVersionHistoryVisibilityChanged(o) {
89
- e.isVersionHistoryOpen = o;
86
+ onVersionHistoryVisibilityChanged(t) {
87
+ e.isVersionHistoryOpen = t;
90
88
  },
91
89
  onDataChanged() {
92
90
  e.hasChanges = !0;
@@ -98,44 +96,32 @@ const ce = (E, l) => {
98
96
  ".in-drawer__container"
99
97
  ],
100
98
  extensions: d,
101
- localePatch: z
99
+ localePatch: H
102
100
  }
103
101
  );
104
- }, _ = (s) => new Promise((r, i) => {
102
+ }, V = (i) => new Promise((r, s) => {
105
103
  var d;
106
104
  if (document.getElementById("UiEditorScript")) {
107
- Promise.resolve(s()).then(r, i);
105
+ i(), r();
108
106
  return;
109
107
  }
110
- const e = N.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
111
- t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
112
- Promise.resolve(s()).then(r, i);
113
- }, t.onerror = () => {
114
- i(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
115
- }, document.body.appendChild(t);
108
+ const e = L.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
109
+ o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
110
+ i(), r();
111
+ }, o.onerror = () => {
112
+ s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
+ }, document.body.appendChild(o);
116
114
  });
117
- return { initPlugin: async (s) => {
118
- const r = C();
119
- try {
120
- await _(async () => {
121
- const [i, e] = await Promise.all([
122
- k(),
123
- B()
124
- ]);
125
- r.syncModulesEnabled = e, await V(s, i, e);
126
- });
127
- } catch {
128
- r.loadingStatus = !1, b({
129
- type: L.Alert,
130
- message: h["An error has occurred. Please report the error code to support."],
131
- actionButton: {
132
- text: h["Reload page"],
133
- onClick: () => window.location.reload()
134
- }
135
- });
136
- }
115
+ return { initPlugin: async (i) => {
116
+ await V(async () => {
117
+ const r = E(), [s, e] = await Promise.all([
118
+ b(),
119
+ k()
120
+ ]);
121
+ r.syncModulesEnabled = e, await T(i, s, e);
122
+ });
137
123
  } };
138
124
  };
139
125
  export {
140
- ce as useStripo
126
+ se as useStripo
141
127
  };
@@ -1,5 +1,4 @@
1
1
  const e = "Your version has been restored successfully.", o = "Restore Image", t = "Cancel", a = {
2
- "Reload page": "Reload page",
3
2
  "The image has been deleted.": "The image has been deleted successfully.",
4
3
  "Aim for the drop zone!": "Drag and drop your image inside the upload area to continue.",
5
4
  "Image processing": "The image upload is in progress. This may take some time.",
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.65.0" } }, s = {
1
+ const o = { stripo: { version: "2.66.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.7.1-beta.ac21e59",
3
+ "version": "3.7.1-beta.cb7d58e",
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",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  "guido": {
94
94
  "stripo": {
95
- "version": "2.65.0"
95
+ "version": "2.66.0"
96
96
  }
97
97
  }
98
98
  }