@useinsider/guido 3.6.0-beta.94e390d → 3.6.0-beta.a8be7f8

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,43 +1,40 @@
1
- import { useActionsApi as m } from "./useActionsApi.js";
2
- import { useRecommendationBlockWarning as p } from "../extensions/Blocks/Recommendation/useRecommendationBlockWarning.js";
3
- import { useStripoApi as b } from "../services/stripoApi.js";
4
- import { useEditorStore as g } from "../stores/editor.js";
5
- import { useOnboardingStore as f } from "../stores/onboarding.js";
6
- import { useUnsubscribeStore as S } from "../stores/unsubscribe.js";
7
- const k = () => {
8
- const { updateSyncModule: d, getSyncModule: r } = b(), { getTemplateData: a } = m(), { warnIfMultipleBlocks: s } = p(), n = g(), c = S(), i = async () => {
9
- try {
10
- const { html: e } = await a();
11
- s(new DOMParser().parseFromString(e, "text/html"));
12
- } catch {
13
- }
14
- }, l = {
1
+ import { useRecommendationBlockWarning as l } from "../extensions/Blocks/Recommendation/useRecommendationBlockWarning.js";
2
+ import { useStripoApi as m } from "../services/stripoApi.js";
3
+ import { useEditorStore as b } from "../stores/editor.js";
4
+ import { useOnboardingStore as p } from "../stores/onboarding.js";
5
+ import { useUnsubscribeStore as f } from "../stores/unsubscribe.js";
6
+ const h = () => {
7
+ const { updateSyncModule: r, getSyncModule: c } = m(), { warnIfMultipleBlocks: s } = l(), d = b(), i = f(), a = () => {
8
+ var o, t, n;
9
+ const e = (n = (t = (o = document.querySelector("ui-editor")) == null ? void 0 : o.shadowRoot) == null ? void 0 : t.querySelector("iframe")) == null ? void 0 : n.contentDocument;
10
+ e && s(e);
11
+ }, u = {
15
12
  block_dropped: ({ blockName: e }) => {
16
13
  if (e === "BLOCK_TEXT") {
17
- const o = f(), t = !o.shouldShowOnboarding("textBlockOnboarding"), u = o.isActive("textBlockOnboarding");
18
- if (t || u)
14
+ const o = p(), t = !o.shouldShowOnboarding("textBlockOnboarding"), n = o.isActive("textBlockOnboarding");
15
+ if (t || n)
19
16
  return;
20
17
  o.start("textBlockOnboarding");
21
18
  }
22
19
  },
23
20
  module_saved: async (e) => {
24
- n.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await d(e));
21
+ d.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await r(e));
25
22
  },
26
23
  module_dropped: async (e) => {
27
- if (await i(), !n.syncModulesEnabled)
24
+ if (a(), !d.syncModulesEnabled)
28
25
  return;
29
- const { moduleId: o } = e, t = await r(o);
30
- console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await c.fetchTemplates();
26
+ const { moduleId: o } = e, t = await c(o);
27
+ console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await i.fetchTemplates();
31
28
  },
32
29
  module_updated: async (e) => {
33
- n.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await d(e));
30
+ d.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await r(e));
34
31
  }
35
32
  };
36
33
  return { handleEvent: async (e, o) => {
37
- const t = l[e];
34
+ const t = u[e];
38
35
  console.debug("Stripo Event: ", e, o), t && await t(o);
39
36
  } };
40
37
  };
41
38
  export {
42
- k as useStripoEventHandler
39
+ h as useStripoEventHandler
43
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.6.0-beta.94e390d",
3
+ "version": "3.6.0-beta.a8be7f8",
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",