@useinsider/guido 3.10.0-beta.cbd47be → 3.10.0-beta.dfe1fa6

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,16 +1,16 @@
1
- import { useToaster as r } from "../../../composables/useToaster.js";
1
+ import { useToaster as n } from "../../../composables/useToaster.js";
2
2
  import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { ToasterTypeOptions as n } from "../../../enums/toaster.js";
3
+ import { ToasterTypeOptions as r } from "../../../enums/toaster.js";
4
4
  import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
5
- const a = "newsletter.multiple-reco-blocks-warning", f = () => {
6
- const { showToaster: o } = r(), t = s();
5
+ const c = "newsletter.multiple-reco-blocks-warning", u = () => {
6
+ const { showToaster: o } = n(), t = s();
7
7
  return { warnIfMultipleBlocks: (e) => {
8
8
  i(e) > 1 && o({
9
- type: n.Dark,
10
- message: t(a)
9
+ type: r.Info,
10
+ message: t(c)
11
11
  });
12
12
  } };
13
13
  };
14
14
  export {
15
- f as useRecommendationBlockWarning
15
+ u as useRecommendationBlockWarning
16
16
  };
@@ -26,7 +26,7 @@ const u = (e) => new Promise((t) => {
26
26
  } catch (o) {
27
27
  console.error(`Failed to fetch blank template (attempt ${r}/${a}):`, o), r < a && await u(r * f);
28
28
  }
29
- return e({ type: p.Alert, message: t("errors-pages.undefined-response") }), { html: "", css: "" };
29
+ return e({ type: p.Error, message: t("errors-pages.undefined-response") }), { html: "", css: "" };
30
30
  } };
31
31
  };
32
32
  export {
@@ -4,11 +4,12 @@ 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 { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { useSaveAsTemplateStore as x } from "../stores/save-as-template.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 E } from "../stores/save-as-template.js";
9
10
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
10
11
  import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
11
- const $ = () => {
12
+ const j = () => {
12
13
  const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
13
14
  return {
14
15
  getCategories: async () => {
@@ -39,7 +40,7 @@ const $ = () => {
39
40
  createTemplate: async () => {
40
41
  var e, t, d, y;
41
42
  try {
42
- const { prepareTemplateDetails: i } = A(), s = x(), a = await i();
43
+ const { prepareTemplateDetails: i } = A(), s = E(), a = await i();
43
44
  if (p("liquidSyntax") && !await g(a.compiledHtml))
44
45
  return !1;
45
46
  const f = {
@@ -53,7 +54,7 @@ const $ = () => {
53
54
  unsubscriptionPreferencePageStatus: !1,
54
55
  unsubscriptionPreferencePages: [],
55
56
  recommendationCampaignUrls: r(
56
- N().recommendationCampaignUrls
57
+ x().recommendationCampaignUrls
57
58
  ),
58
59
  recommendationConfigs: r({}),
59
60
  isGuido: !0,
@@ -74,7 +75,7 @@ const $ = () => {
74
75
  "newsletter.template-library-save-alert",
75
76
  { templateName: s.getTemplateName }
76
77
  ),
77
- type: "alert"
78
+ type: N.Error
78
79
  }), !1) : (l({
79
80
  message: u(
80
81
  "newsletter.template-library-save-success",
@@ -89,5 +90,5 @@ const $ = () => {
89
90
  };
90
91
  };
91
92
  export {
92
- $ as useTemplateLibraryApi
93
+ j as useTemplateLibraryApi
93
94
  };
@@ -0,0 +1,10 @@
1
+ import type { StripoNotifications } from '@@/Types/stripo';
2
+ /**
3
+ * Adapter that routes Stripo's in-editor notifications through Guido's own
4
+ * InToasts-based toaster, so the editor only ever shows one toaster style.
5
+ * Passed to `initEditor` as the `notifications` config (Stripo then delegates
6
+ * rendering to us instead of drawing its native <ue-notifications-container>).
7
+ */
8
+ export declare const useStripoNotifications: () => {
9
+ getStripoNotifications: () => StripoNotifications;
10
+ };
@@ -1,6 +1,6 @@
1
1
  export declare enum ToasterTypeOptions {
2
2
  Success = "success",
3
3
  Warning = "warning",
4
- Alert = "alert",
5
- Dark = "dark"
4
+ Error = "error",
5
+ Info = "information"
6
6
  }
@@ -4,15 +4,14 @@ 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;
9
7
  withoutLeftMargin: boolean;
8
+ autoHide: boolean;
10
9
  actionButton?: {
11
10
  text: string;
12
11
  onClick: () => void;
13
12
  } | undefined;
14
13
  } & import("pinia").PiniaCustomStateProperties<ToasterState>) => boolean;
15
14
  }, {
16
- showToaster(this: ToasterState, { type, message, actionButton }: ToasterOptions): void;
15
+ showToaster(this: ToasterState, { type, message, actionButton, autoHide }: ToasterOptions): void;
17
16
  hideToaster(this: ToasterState): void;
18
17
  }>;
@@ -96,6 +96,13 @@ ue-control-panel,
96
96
  min-height: auto;
97
97
  }
98
98
 
99
+ /* Hide the "Press ESC to deselect" keyboard hint Stripo 2.69 adds to every block's settings
100
+ header (SD-145833) — no plugin option toggles it. The sibling close (X) is a <ue-button>,
101
+ so scoping to a bare <button> in .panel-close-hint leaves the close button intact. */
102
+ .control-panel-header .panel-close-hint > button {
103
+ display: none !important;
104
+ }
105
+
99
106
  .container.droppable-header-container ue-button:last-child {
100
107
  margin-right: 0;
101
108
  }
@@ -1,21 +1,21 @@
1
1
  import { ToasterTypeOptions as e } from "../enums/toaster.js";
2
- import { defineStore as i } from "pinia";
3
- const a = () => ({
2
+ import { defineStore as a } from "pinia";
3
+ const u = () => ({
4
4
  status: !1,
5
5
  type: e.Success,
6
6
  text: "",
7
- icon: "",
8
- withIcon: !0,
9
7
  withoutLeftMargin: !1,
8
+ autoHide: !0,
10
9
  actionButton: void 0
11
- }), n = i("guidoToaster", {
12
- state: () => a(),
10
+ }), h = a("guidoToaster", {
11
+ state: () => u(),
13
12
  getters: {
14
- shouldAutoHide: (t) => t.status && !!t.text
13
+ // A toast without auto-hide (e.g. Stripo `loader`) stays until hideToaster.
14
+ shouldAutoHide: (t) => t.status && !!t.text && t.autoHide
15
15
  },
16
16
  actions: {
17
- showToaster({ type: t = e.Success, message: s, actionButton: o }) {
18
- this.status = !0, this.text = s, this.type = t, this.actionButton = o;
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;
19
19
  },
20
20
  hideToaster() {
21
21
  this.status = !1;
@@ -23,5 +23,5 @@ const a = () => ({
23
23
  }
24
24
  });
25
25
  export {
26
- n as useToasterStore
26
+ h as useToasterStore
27
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.10.0-beta.cbd47be",
3
+ "version": "3.10.0-beta.dfe1fa6",
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.1.0-beta.73ec2fa",
40
+ "@useinsider/design-system-vue": "1.3.0",
41
41
  "@vueuse/core": "11.3.0",
42
42
  "lodash-es": "4.17.21",
43
43
  "pinia": "2.3.1",
@@ -1,74 +0,0 @@
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
- };