@useinsider/guido 3.9.0-beta.551c1df → 3.9.0-beta.7168aa8

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.
@@ -4,20 +4,21 @@ import e from "../static/styles/components/amp-block.css.js";
4
4
  import i from "../static/styles/components/base-input.css.js";
5
5
  import p from "../static/styles/components/button-group.css.js";
6
6
  import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
7
+ import C from "../static/styles/components/combobox.css.js";
8
+ import s from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
10
  import a from "../static/styles/components/loader.css.js";
11
11
  import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/popup.css.js";
13
- import d from "../static/styles/components/switcher.css.js";
14
- import l from "../static/styles/components/tabs.css.js";
15
- import h from "../static/styles/components/tools.css.js";
16
- import w from "../static/styles/components/version-history.css.js";
17
- import y from "../static/styles/components/wide-panel.css.js";
18
- import B from "../static/styles/variables.css.js";
19
- const b = [
20
- B,
12
+ import c from "../static/styles/components/notification.css.js";
13
+ import d from "../static/styles/components/popup.css.js";
14
+ import l from "../static/styles/components/switcher.css.js";
15
+ import h from "../static/styles/components/tabs.css.js";
16
+ import w from "../static/styles/components/tools.css.js";
17
+ import y from "../static/styles/components/version-history.css.js";
18
+ import B from "../static/styles/components/wide-panel.css.js";
19
+ import b from "../static/styles/variables.css.js";
20
+ const A = [
21
+ b,
21
22
  // Must be on top
22
23
  S,
23
24
  // Must be on top
@@ -26,8 +27,8 @@ const b = [
26
27
  i,
27
28
  p,
28
29
  n,
29
- s,
30
30
  C,
31
+ s,
31
32
  f,
32
33
  a,
33
34
  u,
@@ -36,12 +37,13 @@ const b = [
36
37
  l,
37
38
  h,
38
39
  w,
39
- y
40
+ y,
41
+ B
40
42
  ].join(`
41
43
 
42
- `), v = () => ({ importCss: () => {
44
+ `), F = () => ({ importCss: () => {
43
45
  const o = new CSSStyleSheet();
44
- o.replaceSync(b);
46
+ o.replaceSync(A);
45
47
  const r = document.querySelector("ui-editor");
46
48
  if (!r)
47
49
  return;
@@ -49,5 +51,5 @@ const b = [
49
51
  t && (t.adoptedStyleSheets = [o]);
50
52
  } });
51
53
  export {
52
- v as useCustomInterfaceAppearance
54
+ F as useCustomInterfaceAppearance
53
55
  };
@@ -1,30 +1,29 @@
1
- import { useActionsApi as U } from "./useActionsApi.js";
2
- import { useBlocksConfig as R } from "./useBlocksConfig.js";
3
- import { useConfig as x } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as O } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as q } from "./useFullStoryBridge.js";
6
- import { useStripoEventHandler as H } from "./useStripoEventHandler.js";
7
- import { useStripoNotifications as N } from "./useStripoNotifications.js";
8
- import { useToaster as z } from "./useToaster.js";
9
- import { localePatch as L } from "../config/i18n/index.js";
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";
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";
10
9
  import { en as h } from "../config/i18n/en/index.js";
11
- import { ToasterTypeOptions as $ } from "../enums/toaster.js";
12
- import { useStripoApi as G } from "../services/stripoApi.js";
13
- import J from "../static/styles/customEditorStyle.css.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";
14
13
  import { useEditorStore as C } from "../stores/editor.js";
15
- import { dynamicContentToMergeTags as X } from "../utils/genericUtil.js";
16
- import j from "../package.json.js";
17
- const pe = (E, l) => {
18
- const { features: c, template: w, isFeatureEnabled: u } = x(), { handleError: m, showToaster: b } = z(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = G(), { handleEvent: F } = H(), { getStripoBlocksConfig: v } = R(), { getStripoNotifications: V } = N(), _ = async (s, i = [], r = !1) => {
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) => {
19
18
  var g, S, y;
20
- const e = C(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, M = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, P = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
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;
21
20
  await window.UIEditor.initEditor(
22
21
  document.querySelector("#guido-editor"),
23
22
  {
24
23
  metadata: E,
25
24
  html: p,
26
25
  css: a,
27
- forceRecreate: P,
26
+ forceRecreate: M,
28
27
  locale: "en",
29
28
  undoButtonSelector: "#guido__undo-button",
30
29
  redoButtonSelector: "#guido__redo-button",
@@ -34,12 +33,12 @@ const pe = (E, l) => {
34
33
  customAppearanceMergetags: !u("liquidSyntax"),
35
34
  customAppearanceMergetagsBorderColor: "#f1f3fe",
36
35
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
37
- customViewStyles: J,
36
+ customViewStyles: G,
38
37
  conditionsEnabled: f,
39
38
  customConditionsEnabled: f,
40
39
  enableXSSSecurity: !0,
41
- modulesDisabled: M,
42
- syncModulesEnabled: r,
40
+ modulesDisabled: A,
41
+ syncModulesEnabled: i,
43
42
  messageSettingsEnabled: !0,
44
43
  displayGmailAnnotations: !0,
45
44
  displayHiddenPreheader: !1,
@@ -52,11 +51,11 @@ const pe = (E, l) => {
52
51
  editorFonts: {
53
52
  showDefaultStandardFonts: !0,
54
53
  showDefaultNotStandardFonts: !0,
55
- customFonts: i
54
+ customFonts: r
56
55
  },
57
56
  mergeTags: [
58
57
  {
59
- entries: X(
58
+ entries: J(
60
59
  l.preselectedDynamicContentList,
61
60
  u("liquidSyntax")
62
61
  )
@@ -72,8 +71,8 @@ const pe = (E, l) => {
72
71
  },
73
72
  onTemplateLoaded() {
74
73
  try {
75
- const { importCss: o } = O(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: D } = U(), { injectFullStory: I } = q();
76
- o(), n(), I(), D(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
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(() => {
77
76
  e.hasChanges = !1;
78
77
  }, 1e3);
79
78
  } catch (o) {
@@ -93,42 +92,41 @@ const pe = (E, l) => {
93
92
  e.hasChanges = !0;
94
93
  },
95
94
  onEvent: F,
96
- notifications: V(),
97
95
  ignoreClickOutsideSelectors: [
98
96
  "#guido-dynamic-content-modal",
99
97
  ".in-on-board-wrapper",
100
98
  ".in-drawer__container"
101
99
  ],
102
100
  extensions: d,
103
- localePatch: L
101
+ localePatch: z
104
102
  }
105
103
  );
106
- }, A = (s) => new Promise((i, r) => {
104
+ }, _ = (s) => new Promise((r, i) => {
107
105
  var d;
108
106
  if (document.getElementById("UiEditorScript")) {
109
- Promise.resolve(s()).then(i, r);
107
+ Promise.resolve(s()).then(r, i);
110
108
  return;
111
109
  }
112
- const e = j.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");
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");
113
111
  t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
114
- Promise.resolve(s()).then(i, r);
112
+ Promise.resolve(s()).then(r, i);
115
113
  }, t.onerror = () => {
116
- r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
114
+ i(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
117
115
  }, document.body.appendChild(t);
118
116
  });
119
117
  return { initPlugin: async (s) => {
120
- const i = C();
118
+ const r = C();
121
119
  try {
122
- await A(async () => {
123
- const [r, e] = await Promise.all([
120
+ await _(async () => {
121
+ const [i, e] = await Promise.all([
124
122
  k(),
125
123
  B()
126
124
  ]);
127
- i.syncModulesEnabled = e, await _(s, r, e);
125
+ r.syncModulesEnabled = e, await V(s, i, e);
128
126
  });
129
127
  } catch {
130
- i.loadingStatus = !1, b({
131
- type: $.Alert,
128
+ r.loadingStatus = !1, b({
129
+ type: L.Alert,
132
130
  message: h["An error has occurred. Please report the error code to support."],
133
131
  actionButton: {
134
132
  text: h["Reload page"],
@@ -139,5 +137,5 @@ const pe = (E, l) => {
139
137
  } };
140
138
  };
141
139
  export {
142
- pe as useStripo
140
+ ce as useStripo
143
141
  };
@@ -1,12 +1,15 @@
1
1
  const e = {
2
2
  transactional: 2
3
- }, o = 2, t = 13, s = {
3
+ }, s = 2, a = 13, t = "https://email-static.useinsider.com", o = `${t}/templates/campaign/default.html`, l = `${t}/templates/campaign/default.css`, E = {
4
4
  SAVED_MODULES: "savedModules",
5
5
  DEFAULT_MODULES: "defaultModules"
6
6
  };
7
7
  export {
8
- o as EditorType,
9
- t as MAX_DEFAULT_TEMPLATE_ID,
10
- s as ModuleFolderDefaults,
8
+ l as BLANK_TEMPLATE_CSS_URL,
9
+ o as BLANK_TEMPLATE_HTML_URL,
10
+ t as EMAIL_STATIC_BASE_URL,
11
+ s as EditorType,
12
+ a as MAX_DEFAULT_TEMPLATE_ID,
13
+ E as ModuleFolderDefaults,
11
14
  e as TemplateTypes
12
15
  };
@@ -1,4 +1,4 @@
1
- var n = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "error", r.Info = "information", r))(n || {});
1
+ var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
2
2
  export {
3
- n as ToasterTypeOptions
3
+ c as ToasterTypeOptions
4
4
  };
@@ -1,16 +1,16 @@
1
- import { useToaster as n } from "../../../composables/useToaster.js";
1
+ import { useToaster as r } from "../../../composables/useToaster.js";
2
2
  import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { ToasterTypeOptions as r } from "../../../enums/toaster.js";
3
+ import { ToasterTypeOptions as n } from "../../../enums/toaster.js";
4
4
  import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
5
- const c = "newsletter.multiple-reco-blocks-warning", u = () => {
6
- const { showToaster: o } = n(), t = s();
5
+ const a = "newsletter.multiple-reco-blocks-warning", f = () => {
6
+ const { showToaster: o } = r(), t = s();
7
7
  return { warnIfMultipleBlocks: (e) => {
8
8
  i(e) > 1 && o({
9
- type: r.Info,
10
- message: t(c)
9
+ type: n.Dark,
10
+ message: t(a)
11
11
  });
12
12
  } };
13
13
  };
14
14
  export {
15
- u as useRecommendationBlockWarning
15
+ f as useRecommendationBlockWarning
16
16
  };
@@ -1,58 +1,77 @@
1
- import { useHttp as d } from "../composables/useHttp.js";
2
- import { useToaster as m } from "../composables/useToaster.js";
3
- import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
4
- import f from "../static/templates/empty/index.html.js";
5
- import g from "../static/templates/empty/style.css.js";
6
- const E = () => {
7
- const { get: s, post: c } = d(), { handleError: r } = m();
1
+ import { useHttp as y } from "../composables/useHttp.js";
2
+ import { useToaster as g } from "../composables/useToaster.js";
3
+ import { MAX_DEFAULT_TEMPLATE_ID as w, BLANK_TEMPLATE_HTML_URL as T, BLANK_TEMPLATE_CSS_URL as M } from "../enums/defaults.js";
4
+ const S = {
5
+ html: '<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><div class="es-wrapper"></div></body></html>',
6
+ css: ""
7
+ };
8
+ let o = null;
9
+ const A = () => {
10
+ const { get: s, post: i } = y(), { handleError: a } = g(), p = async () => {
11
+ try {
12
+ const { data: t } = await s("/stripo/get-user-token");
13
+ return t.body.token;
14
+ } catch (t) {
15
+ return a(t, "Failed to fetch token"), "";
16
+ }
17
+ }, m = async () => {
18
+ try {
19
+ const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
20
+ return t.map((e) => ({
21
+ ...e,
22
+ active: !0
23
+ }));
24
+ } catch (t) {
25
+ return a(t, "Failed to fetch custom fonts"), [];
26
+ }
27
+ }, f = async () => {
28
+ try {
29
+ const { data: t } = await s("/newsletter/settings/synchronisation-in-modules-status");
30
+ return t.status;
31
+ } catch (t) {
32
+ return a(t, "Failed to fetch sync modules status"), !1;
33
+ }
34
+ }, c = async () => {
35
+ if (o)
36
+ return o;
37
+ try {
38
+ const [t, e] = await Promise.all([
39
+ fetch(T).then((r) => {
40
+ if (!r.ok)
41
+ throw new Error(`Blank template HTML request failed: ${r.status}`);
42
+ return r.text();
43
+ }),
44
+ fetch(M).then((r) => {
45
+ if (!r.ok)
46
+ throw new Error(`Blank template CSS request failed: ${r.status}`);
47
+ return r.text();
48
+ })
49
+ ]);
50
+ return o = { html: t, css: e }, o;
51
+ } catch (t) {
52
+ return a(t, "Failed to fetch blank template"), S;
53
+ }
54
+ };
8
55
  return {
9
- getToken: async () => {
10
- try {
11
- const { data: t } = await s("/stripo/get-user-token");
12
- return t.body.token;
13
- } catch (t) {
14
- return r(t, "Failed to fetch token"), "";
15
- }
16
- },
17
- getCustomFonts: async () => {
18
- try {
19
- const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
20
- return t.map((e) => ({
21
- ...e,
22
- active: !0
23
- }));
24
- } catch (t) {
25
- return r(t, "Failed to fetch custom fonts"), [];
26
- }
27
- },
56
+ getToken: p,
57
+ getCustomFonts: m,
28
58
  getDefaultTemplate: async () => {
29
- const t = {
30
- html: f,
31
- css: g
32
- };
33
- try {
34
- const e = new URLSearchParams(window.location.search), u = e.get("default-template"), p = e.get("master"), a = u ? parseInt(u) : 0, i = a >= 1 && a <= y ? a : 0;
35
- if (!i && !p)
36
- return t;
37
- const l = `/stripo/default-template/${i}`, { data: n } = await s(l), o = typeof n == "string" ? JSON.parse(n) : n;
38
- return !o || typeof o != "object" || !("html" in o) || !("css" in o) ? t : o;
39
- } catch (e) {
40
- return r(e, "Failed to fetch default template"), t;
41
- }
42
- },
43
- getSyncModulesStatus: async () => {
44
59
  try {
45
- const { data: t } = await s("/newsletter/settings/synchronisation-in-modules-status");
46
- return t.status;
60
+ const t = new URLSearchParams(window.location.search), e = t.get("default-template"), r = t.get("master"), u = e ? parseInt(e) : 0, d = u >= 1 && u <= w ? u : 0;
61
+ if (!d && !r)
62
+ return await c();
63
+ const h = `/stripo/default-template/${d}`, { data: l } = await s(h), n = typeof l == "string" ? JSON.parse(l) : l;
64
+ return !n || typeof n != "object" || !("html" in n) || !("css" in n) ? await c() : n;
47
65
  } catch (t) {
48
- return r(t, "Failed to fetch sync modules status"), !1;
66
+ return a(t, "Failed to fetch default template"), c();
49
67
  }
50
68
  },
69
+ getSyncModulesStatus: f,
51
70
  updateSyncModule: async (t) => {
52
71
  try {
53
- return await c(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
72
+ return await i(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
54
73
  } catch (e) {
55
- return r(e, "Failed to update sync module"), !1;
74
+ return a(e, "Failed to update sync module"), !1;
56
75
  }
57
76
  },
58
77
  getSyncModule: async (t) => {
@@ -60,7 +79,7 @@ const E = () => {
60
79
  const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
61
80
  return e;
62
81
  } catch (e) {
63
- return r(e, "Failed to get sync module"), {
82
+ return a(e, "Failed to get sync module"), {
64
83
  id: 0,
65
84
  stripoId: 0,
66
85
  unsubscriptionPreferencePages: []
@@ -71,13 +90,13 @@ const E = () => {
71
90
  if (t.length === 0)
72
91
  return !0;
73
92
  try {
74
- return await c("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
93
+ return await i("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
75
94
  } catch (e) {
76
- return r(e, "Failed to set unsubscription preference pages"), !1;
95
+ return a(e, "Failed to set unsubscription preference pages"), !1;
77
96
  }
78
97
  }
79
98
  };
80
99
  };
81
100
  export {
82
- E as useStripoApi
101
+ A as useStripoApi
83
102
  };
@@ -4,12 +4,11 @@ import { useToaster as C } from "../composables/useToaster.js";
4
4
  import { useTranslations as h } from "../composables/useTranslations.js";
5
5
  import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
6
6
  import { EditorType as v } from "../enums/defaults.js";
7
- import { ToasterTypeOptions as N } from "../enums/toaster.js";
8
- import { useRecommendationExtensionStore as x } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { useSaveAsTemplateStore as A } from "../stores/save-as-template.js";
7
+ import { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { useSaveAsTemplateStore as x } from "../stores/save-as-template.js";
10
9
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
11
- import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
12
- const j = () => {
10
+ import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
11
+ const $ = () => {
13
12
  const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
14
13
  return {
15
14
  getCategories: async () => {
@@ -40,7 +39,7 @@ const j = () => {
40
39
  createTemplate: async () => {
41
40
  var e, t, d, y;
42
41
  try {
43
- const { prepareTemplateDetails: i } = E(), s = A(), a = await i();
42
+ const { prepareTemplateDetails: i } = A(), s = x(), a = await i();
44
43
  if (p("liquidSyntax") && !await g(a.compiledHtml))
45
44
  return !1;
46
45
  const f = {
@@ -54,7 +53,7 @@ const j = () => {
54
53
  unsubscriptionPreferencePageStatus: !1,
55
54
  unsubscriptionPreferencePages: [],
56
55
  recommendationCampaignUrls: r(
57
- x().recommendationCampaignUrls
56
+ N().recommendationCampaignUrls
58
57
  ),
59
58
  recommendationConfigs: r({}),
60
59
  isGuido: !0,
@@ -75,7 +74,7 @@ const j = () => {
75
74
  "newsletter.template-library-save-alert",
76
75
  { templateName: s.getTemplateName }
77
76
  ),
78
- type: N.Alert
77
+ type: "alert"
79
78
  }), !1) : (l({
80
79
  message: u(
81
80
  "newsletter.template-library-save-success",
@@ -90,5 +89,5 @@ const j = () => {
90
89
  };
91
90
  };
92
91
  export {
93
- j as useTemplateLibraryApi
92
+ $ as useTemplateLibraryApi
94
93
  };
@@ -8,6 +8,9 @@ export declare const TemplateTypes: {
8
8
  };
9
9
  export declare const EditorType: number;
10
10
  export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
11
+ export declare const EMAIL_STATIC_BASE_URL = "https://email-static.useinsider.com";
12
+ export declare const BLANK_TEMPLATE_HTML_URL = "https://email-static.useinsider.com/templates/campaign/default.html";
13
+ export declare const BLANK_TEMPLATE_CSS_URL = "https://email-static.useinsider.com/templates/campaign/default.css";
11
14
  export declare const ProductIds: Record<string, number>;
12
15
  export declare const ModuleFolderDefaults: {
13
16
  readonly SAVED_MODULES: "savedModules";
@@ -1,6 +1,6 @@
1
1
  export declare enum ToasterTypeOptions {
2
2
  Success = "success",
3
3
  Warning = "warning",
4
- Alert = "error",
5
- Info = "information"
4
+ Alert = "alert",
5
+ Dark = "dark"
6
6
  }
@@ -4,14 +4,15 @@ export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToas
4
4
  status: boolean;
5
5
  type: import("@@/Types/toaster").ToasterType;
6
6
  text: string;
7
+ icon: string;
8
+ withIcon: boolean;
7
9
  withoutLeftMargin: boolean;
8
- autoHide: boolean;
9
10
  actionButton?: {
10
11
  text: string;
11
12
  onClick: () => void;
12
13
  } | undefined;
13
14
  } & import("pinia").PiniaCustomStateProperties<ToasterState>) => boolean;
14
15
  }, {
15
- showToaster(this: ToasterState, { type, message, actionButton, autoHide }: ToasterOptions): void;
16
+ showToaster(this: ToasterState, { type, message, actionButton }: ToasterOptions): void;
16
17
  hideToaster(this: ToasterState): void;
17
18
  }>;
@@ -0,0 +1,74 @@
1
+ const n = `ue-notifications-container {
2
+ left: 96px;
3
+ margin: 0;
4
+ bottom: 32px;
5
+ top: unset;
6
+ width: unset;
7
+ position: fixed;
8
+ }
9
+
10
+ ue-notifications-container ue-message + ue-message {
11
+ margin-bottom: 24px;
12
+ }
13
+
14
+ ue-notifications-container .alert-message-wrapper {
15
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07);
16
+ border: none;
17
+ padding: 16px 24px;
18
+ }
19
+
20
+ ue-notifications-container .alert-message-wrapper.info,
21
+ ue-notifications-container .alert-message-wrapper.loader {
22
+ background-color: var(--guido-color-background-toaster-info) !important;
23
+ color: inherit;
24
+ }
25
+
26
+ .alert-message-wrapper .alert-message-main {
27
+ align-items: center;
28
+ }
29
+
30
+ ue-notifications-container ue-caption .caption {
31
+ color: var(--guido-color-white) !important;
32
+ }
33
+
34
+ ue-block-thumb-hint {
35
+ text-align: left;
36
+ }
37
+
38
+ ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-content {
39
+ width: calc(100% - 64px);
40
+ }
41
+
42
+ ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-text {
43
+ font-size: 15px;
44
+ font-weight: 600;
45
+ }
46
+
47
+ ue-notifications-container .alert-message-text,
48
+ ue-notifications-container .alert-message-wrapper ue-icon-component.icon,
49
+ ue-notifications-container .alert-message-wrapper ue-icon-component.icon-button {
50
+ color: var(--guido-color-white);
51
+ }
52
+
53
+ ue-notifications-container ue-message ue-button.close {
54
+ margin: 0 0 0 16px;
55
+ }
56
+
57
+ ue-notifications-container .alert-message-wrapper.success {
58
+ background: var(--guido-color-background-toaster-success);
59
+ color: inherit;
60
+ }
61
+
62
+ ue-notifications-container .alert-message-wrapper.error {
63
+ background: var(--guido-color-background-toaster-error);
64
+ color: inherit;
65
+ }
66
+
67
+ ue-notifications-container .alert-message-wrapper.warn {
68
+ background: var(--guido-color-background-toaster-warn);
69
+ color: inherit;
70
+ }
71
+ `;
72
+ export {
73
+ n as default
74
+ };
@@ -1,21 +1,21 @@
1
1
  import { ToasterTypeOptions as e } from "../enums/toaster.js";
2
- import { defineStore as a } from "pinia";
3
- const u = () => ({
2
+ import { defineStore as i } from "pinia";
3
+ const a = () => ({
4
4
  status: !1,
5
5
  type: e.Success,
6
6
  text: "",
7
+ icon: "",
8
+ withIcon: !0,
7
9
  withoutLeftMargin: !1,
8
- autoHide: !0,
9
10
  actionButton: void 0
10
- }), h = a("guidoToaster", {
11
- state: () => u(),
11
+ }), n = i("guidoToaster", {
12
+ state: () => a(),
12
13
  getters: {
13
- // A toast without auto-hide (e.g. Stripo `loader`) stays until hideToaster.
14
- shouldAutoHide: (t) => t.status && !!t.text && t.autoHide
14
+ shouldAutoHide: (t) => t.status && !!t.text
15
15
  },
16
16
  actions: {
17
- showToaster({ type: t = e.Success, message: s, actionButton: o, autoHide: i = !0 }) {
18
- this.status = !0, this.text = s, this.type = t, this.actionButton = o, this.autoHide = i;
17
+ showToaster({ type: t = e.Success, message: s, actionButton: o }) {
18
+ this.status = !0, this.text = s, this.type = t, this.actionButton = o;
19
19
  },
20
20
  hideToaster() {
21
21
  this.status = !1;
@@ -23,5 +23,5 @@ const u = () => ({
23
23
  }
24
24
  });
25
25
  export {
26
- h as useToasterStore
26
+ n as useToasterStore
27
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.9.0-beta.551c1df",
3
+ "version": "3.9.0-beta.7168aa8",
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",
@@ -37,7 +37,7 @@
37
37
  "license": "ISC",
38
38
  "dependencies": {
39
39
  "@stripoinc/ui-editor-extensions": "3.8.0",
40
- "@useinsider/design-system-vue": "1.3.0",
40
+ "@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
41
41
  "@vueuse/core": "11.3.0",
42
42
  "lodash-es": "4.17.21",
43
43
  "pinia": "2.3.1",