@useinsider/guido 3.2.0-beta.a49c53c → 3.2.0-beta.b277bd3

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.
@@ -9,35 +9,36 @@ import { localePatch as H } from "../config/i18n/index.js";
9
9
  import { displayConditions as O } from "../enums/displayConditions.js";
10
10
  import { useStripoApi as j } from "../services/stripoApi.js";
11
11
  import L from "../static/styles/customEditorStyle.css.js";
12
- import { useEditorStore as S } from "../stores/editor.js";
13
- import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
14
- const ne = (y, a) => {
15
- const { features: d, template: C, isFeatureEnabled: l } = P(), { handleError: c } = x(), { getToken: E, getCustomFonts: h, getSyncModulesStatus: w } = j(), { handleEvent: b } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], n = !1) => {
16
- var p, f, g;
17
- const e = S(), { html: o, css: k } = i, { baseBlocks: u, extensions: F } = await B(), m = ((p = d.value) == null ? void 0 : p.displayConditions) ?? !0, M = ((f = d.value) == null ? void 0 : f.modulesDisabled) ?? !1, V = ((g = C.value) == null ? void 0 : g.forceRecreate) ?? !1;
12
+ import { useEditorStore as C } from "../stores/editor.js";
13
+ import { dynamicContentToMergeTags as $ } from "../utils/genericUtil.js";
14
+ import z from "../package.json.js";
15
+ const ae = (E, l) => {
16
+ const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = j(), { handleEvent: B } = q(), { getStripoBlocksConfig: T } = I(), V = async (i, r = [], s = !1) => {
17
+ var g, S, y;
18
+ const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await T(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, F = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
19
  window.UIEditor.initEditor(
19
20
  document.querySelector("#guido-editor"),
20
21
  {
21
- metadata: y,
22
- html: o,
23
- css: k,
24
- forceRecreate: V,
22
+ metadata: E,
23
+ html: p,
24
+ css: a,
25
+ forceRecreate: v,
25
26
  locale: "en",
26
27
  undoButtonSelector: "#guido__undo-button",
27
28
  redoButtonSelector: "#guido__redo-button",
28
29
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
29
30
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
30
31
  codeEditorButtonSelector: "#guido__code-button",
31
- customAppearanceMergetags: !l("liquidSyntax"),
32
+ customAppearanceMergetags: !u("liquidSyntax"),
32
33
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
34
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
35
  customViewStyles: L,
35
- conditionsEnabled: m,
36
- customConditionsEnabled: m,
36
+ conditionsEnabled: f,
37
+ customConditionsEnabled: f,
37
38
  conditionCategories: O,
38
39
  enableXSSSecurity: !0,
39
- modulesDisabled: M,
40
- syncModulesEnabled: n,
40
+ modulesDisabled: F,
41
+ syncModulesEnabled: s,
41
42
  messageSettingsEnabled: !0,
42
43
  displayGmailAnnotations: !0,
43
44
  displayHiddenPreheader: !1,
@@ -45,7 +46,7 @@ const ne = (y, a) => {
45
46
  displayUTM: !1,
46
47
  selectElementAfterDrop: !0,
47
48
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
48
- ...u ? { baseBlocks: u } : {},
49
+ ...o ? { baseBlocks: o } : {},
49
50
  editorFonts: {
50
51
  showDefaultStandardFonts: !0,
51
52
  showDefaultNotStandardFonts: !0,
@@ -53,28 +54,28 @@ const ne = (y, a) => {
53
54
  },
54
55
  mergeTags: [
55
56
  {
56
- entries: z(
57
- a.preselectedDynamicContentList,
58
- l("liquidSyntax")
57
+ entries: $(
58
+ l.preselectedDynamicContentList,
59
+ u("liquidSyntax")
59
60
  )
60
61
  }
61
62
  ],
62
63
  async onTokenRefreshRequest(t) {
63
64
  try {
64
- const s = await E();
65
- t(s);
66
- } catch (s) {
67
- c(s, "Failed to refresh token");
65
+ const n = await w();
66
+ t(n);
67
+ } catch (n) {
68
+ m(n, "Failed to refresh token");
68
69
  }
69
70
  },
70
71
  onTemplateLoaded() {
71
72
  try {
72
- const { importCss: t } = U(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: v } = D(), { injectFullStory: A } = R();
73
- t(), s(), A(), v(), a.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
73
+ const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
74
+ t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
74
75
  e.hasChanges = !1;
75
76
  }, 1e3);
76
77
  } catch (t) {
77
- c(t, "Failed to load custom interface appearance");
78
+ m(t, "Failed to load custom interface appearance");
78
79
  }
79
80
  },
80
81
  onCodeEditorVisibilityChanged(t) {
@@ -89,38 +90,39 @@ const ne = (y, a) => {
89
90
  onDataChanged() {
90
91
  e.hasChanges = !0;
91
92
  },
92
- onEvent: b,
93
+ onEvent: B,
93
94
  ignoreClickOutsideSelectors: [
94
95
  "#guido-dynamic-content-modal",
95
96
  ".in-on-board-wrapper",
96
97
  ".in-drawer__container"
97
98
  ],
98
- extensions: F,
99
+ extensions: d,
99
100
  localePatch: H
100
101
  }
101
102
  );
102
- }, _ = (i) => new Promise((r, n) => {
103
+ }, _ = (i) => new Promise((r, s) => {
104
+ var d;
103
105
  if (document.getElementById("UiEditorScript")) {
104
106
  i(), r();
105
107
  return;
106
108
  }
107
- const e = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o = document.createElement("script");
108
- o.id = "UiEditorScript", o.type = "module", o.src = e, o.onload = () => {
109
+ const e = z.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");
110
+ o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
109
111
  i(), r();
110
112
  }, o.onerror = () => {
111
- n(new Error(`Failed to load Stripo UIEditor script from S3: ${e}`));
113
+ s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
112
114
  }, document.body.appendChild(o);
113
115
  });
114
116
  return { initPlugin: async (i) => {
115
117
  await _(async () => {
116
- const r = S(), [n, e] = await Promise.all([
117
- h(),
118
- w()
118
+ const r = C(), [s, e] = await Promise.all([
119
+ b(),
120
+ k()
119
121
  ]);
120
- r.syncModulesEnabled = e, await T(i, n, e);
122
+ r.syncModulesEnabled = e, await V(i, s, e);
121
123
  });
122
124
  } };
123
125
  };
124
126
  export {
125
- ne as useStripo
127
+ ae as useStripo
126
128
  };
@@ -0,0 +1,7 @@
1
+ const o = { stripo: { version: "2.62.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": "3.2.0-beta.a49c53c",
3
+ "version": "3.2.0-beta.b277bd3",
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",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "guido": {
88
88
  "stripo": {
89
- "version": "2.61.2"
89
+ "version": "2.62.0"
90
90
  }
91
91
  }
92
92
  }