@useinsider/guido 3.7.0-beta.2037cb1 → 3.7.0-beta.516b778

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,42 +1,42 @@
1
1
  import { useActionsApi as D } from "./useActionsApi.js";
2
- import { useBlocksConfig as P } from "./useBlocksConfig.js";
3
- import { useConfig as I } from "./useConfig.js";
2
+ import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
+ import { useConfig as P } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
5
  import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
6
  import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
7
  import { useToaster as x } from "./useToaster.js";
8
8
  import { localePatch as H } from "../config/i18n/index.js";
9
9
  import { useStripoApi as O } from "../services/stripoApi.js";
10
- import z from "../static/styles/customEditorStyle.css.js";
11
- import { useEditorStore as h } from "../stores/editor.js";
12
- import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
- import $ from "../package.json.js";
14
- const se = (E, c) => {
15
- const { features: u, template: C, isFeatureEnabled: m } = I(), { handleError: l } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: F } = O(), { handleEvent: k } = q(), { getStripoBlocksConfig: v } = P(), B = async (s, r = [], o = !1) => {
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) => {
16
16
  var g, S, y;
17
- const e = h(), { html: p, css: a } = s, { baseBlocks: i, extensions: d } = await v(), f = ((g = u.value) == null ? void 0 : g.displayConditions) ?? !0, V = ((S = u.value) == null ? void 0 : S.modulesDisabled) ?? !1, _ = ((y = C.value) == null ? void 0 : y.forceRecreate) ?? !1;
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
18
  window.UIEditor.initEditor(
19
19
  document.querySelector("#guido-editor"),
20
20
  {
21
- metadata: E,
21
+ metadata: C,
22
22
  html: p,
23
23
  css: a,
24
- forceRecreate: _,
24
+ forceRecreate: v,
25
25
  locale: "en",
26
26
  undoButtonSelector: "#guido__undo-button",
27
27
  redoButtonSelector: "#guido__redo-button",
28
28
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
29
29
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
30
30
  codeEditorButtonSelector: "#guido__code-button",
31
- customAppearanceMergetags: !m("liquidSyntax"),
31
+ customAppearanceMergetags: !u("liquidSyntax"),
32
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: z,
34
+ customViewStyles: j,
35
35
  conditionsEnabled: f,
36
36
  customConditionsEnabled: f,
37
37
  enableXSSSecurity: !0,
38
- modulesDisabled: V,
39
- syncModulesEnabled: o,
38
+ modulesDisabled: _,
39
+ syncModulesEnabled: s,
40
40
  messageSettingsEnabled: !0,
41
41
  displayGmailAnnotations: !0,
42
42
  displayHiddenPreheader: !1,
@@ -45,7 +45,7 @@ const se = (E, c) => {
45
45
  selectElementAfterDrop: !0,
46
46
  sameFontSizeForOutlook: !0,
47
47
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
48
- ...i ? { baseBlocks: i } : {},
48
+ ...o ? { baseBlocks: o } : {},
49
49
  editorFonts: {
50
50
  showDefaultStandardFonts: !0,
51
51
  showDefaultNotStandardFonts: !0,
@@ -53,9 +53,9 @@ const se = (E, c) => {
53
53
  },
54
54
  mergeTags: [
55
55
  {
56
- entries: L(
57
- c.preselectedDynamicContentList,
58
- m("liquidSyntax")
56
+ entries: z(
57
+ l.preselectedDynamicContentList,
58
+ u("liquidSyntax")
59
59
  )
60
60
  }
61
61
  ],
@@ -64,17 +64,17 @@ const se = (E, c) => {
64
64
  const n = await w();
65
65
  t(n);
66
66
  } catch (n) {
67
- l(n, "Failed to refresh token");
67
+ m(n, "Failed to refresh token");
68
68
  }
69
69
  },
70
70
  onTemplateLoaded() {
71
71
  try {
72
72
  const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
73
- t(), n(), A(), M(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
73
+ t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
74
74
  e.hasChanges = !1;
75
75
  }, 1e3);
76
76
  } catch (t) {
77
- l(t, "Failed to load custom interface appearance");
77
+ m(t, "Failed to load custom interface appearance");
78
78
  }
79
79
  },
80
80
  onCodeEditorVisibilityChanged(t) {
@@ -89,7 +89,7 @@ const se = (E, c) => {
89
89
  onDataChanged() {
90
90
  e.hasChanges = !0;
91
91
  },
92
- onEvent: k,
92
+ onEvent: F,
93
93
  ignoreClickOutsideSelectors: [
94
94
  "#guido-dynamic-content-modal",
95
95
  ".in-on-board-wrapper",
@@ -99,32 +99,27 @@ const se = (E, c) => {
99
99
  localePatch: H
100
100
  }
101
101
  );
102
- }, T = (s) => new Promise((r, o) => {
102
+ }, V = (i) => new Promise((r, s) => {
103
103
  var d;
104
104
  if (document.getElementById("UiEditorScript")) {
105
- Promise.resolve(s()).then(r, o);
105
+ i(), r();
106
106
  return;
107
107
  }
108
- const e = $.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, i = document.createElement("script");
109
- i.id = "UiEditorScript", i.type = "module", i.src = a, i.onload = () => {
110
- Promise.resolve(s()).then(r, o);
111
- }, i.onerror = () => {
112
- o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
- }, document.body.appendChild(i);
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);
114
114
  });
115
- return { initPlugin: async (s) => {
116
- const r = h();
117
- try {
118
- await T(async () => {
119
- const [o, e] = await Promise.all([
120
- b(),
121
- F()
122
- ]);
123
- r.syncModulesEnabled = e, await B(s, o, e);
124
- });
125
- } catch (o) {
126
- r.loadingStatus = !1, l(o, "Failed to load the editor");
127
- }
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
+ });
128
123
  } };
129
124
  };
130
125
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.7.0-beta.2037cb1",
3
+ "version": "3.7.0-beta.516b778",
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",
@@ -27,6 +27,8 @@
27
27
  "test": "vitest run --coverage",
28
28
  "test:watch": "vitest",
29
29
  "test:visual-update": "npx playwright test --update-snapshots --reporter html",
30
+ "test:e2e:coverage": "E2E_COVERAGE=true playwright test",
31
+ "coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
30
32
  "prepare": "husky",
31
33
  "preinstall": "rm -rf ./node_modules/.vite"
32
34
  },
@@ -74,10 +76,12 @@
74
76
  "happy-dom": "15.11.7",
75
77
  "husky": "9.1.7",
76
78
  "msw": "2.10.3",
79
+ "nyc": "17.1.0",
77
80
  "sass": "1.69.7",
78
81
  "typescript": "5.5.4",
79
82
  "typescript-eslint": "8.26.0",
80
83
  "vite-plugin-dts": "4.5.4",
84
+ "vite-plugin-istanbul": "7.0.0",
81
85
  "vitest": "2.1.9",
82
86
  "vue-tsc": "2.2.10"
83
87
  },
@@ -90,6 +94,11 @@
90
94
  "msw": {
91
95
  "workerDirectory": "public"
92
96
  },
97
+ "nyc": {
98
+ "report-dir": "coverage/e2e",
99
+ "reporter": ["lcov", "text-summary"],
100
+ "all": false
101
+ },
93
102
  "guido": {
94
103
  "stripo": {
95
104
  "version": "2.65.0"