@useinsider/guido 3.9.0-beta.ba394b1 → 3.9.0-beta.fc7d209
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.
- package/dist/composables/useCustomInterfaceAppearance.js +18 -16
- package/dist/composables/useStripo.js +37 -39
- package/dist/enums/toaster.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +22 -21
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +62 -4
- package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +7 -7
- package/dist/extensions/Blocks/common-control.js +58 -45
- package/dist/services/templateLibraryApi.js +8 -9
- package/dist/src/enums/toaster.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +1 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +7 -0
- package/dist/src/stores/toaster.d.ts +3 -2
- package/dist/static/styles/components/notification.css.js +74 -0
- package/dist/stores/toaster.js +10 -10
- package/package.json +2 -2
- package/dist/composables/useStripoNotifications.js +0 -26
- package/dist/src/composables/useStripoNotifications.d.ts +0 -10
|
@@ -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
|
|
8
|
-
import
|
|
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/
|
|
13
|
-
import d from "../static/styles/components/
|
|
14
|
-
import l from "../static/styles/components/
|
|
15
|
-
import h from "../static/styles/components/
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/components/
|
|
18
|
-
import B from "../static/styles/
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
`),
|
|
44
|
+
`), F = () => ({ importCss: () => {
|
|
43
45
|
const o = new CSSStyleSheet();
|
|
44
|
-
o.replaceSync(
|
|
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
|
-
|
|
54
|
+
F as useCustomInterfaceAppearance
|
|
53
55
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useStripoEventHandler as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
12
|
-
import { useStripoApi as
|
|
13
|
-
import
|
|
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
|
|
16
|
-
import
|
|
17
|
-
const
|
|
18
|
-
const { features: c, template: w, isFeatureEnabled: u } =
|
|
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,
|
|
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:
|
|
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:
|
|
36
|
+
customViewStyles: G,
|
|
38
37
|
conditionsEnabled: f,
|
|
39
38
|
customConditionsEnabled: f,
|
|
40
39
|
enableXSSSecurity: !0,
|
|
41
|
-
modulesDisabled:
|
|
42
|
-
syncModulesEnabled:
|
|
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:
|
|
54
|
+
customFonts: r
|
|
56
55
|
},
|
|
57
56
|
mergeTags: [
|
|
58
57
|
{
|
|
59
|
-
entries:
|
|
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 } =
|
|
76
|
-
o(), n(),
|
|
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:
|
|
101
|
+
localePatch: z
|
|
104
102
|
}
|
|
105
103
|
);
|
|
106
|
-
},
|
|
104
|
+
}, _ = (s) => new Promise((r, i) => {
|
|
107
105
|
var d;
|
|
108
106
|
if (document.getElementById("UiEditorScript")) {
|
|
109
|
-
Promise.resolve(s()).then(
|
|
107
|
+
Promise.resolve(s()).then(r, i);
|
|
110
108
|
return;
|
|
111
109
|
}
|
|
112
|
-
const e =
|
|
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(
|
|
112
|
+
Promise.resolve(s()).then(r, i);
|
|
115
113
|
}, t.onerror = () => {
|
|
116
|
-
|
|
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
|
|
118
|
+
const r = C();
|
|
121
119
|
try {
|
|
122
|
-
await
|
|
123
|
-
const [
|
|
120
|
+
await _(async () => {
|
|
121
|
+
const [i, e] = await Promise.all([
|
|
124
122
|
k(),
|
|
125
123
|
B()
|
|
126
124
|
]);
|
|
127
|
-
|
|
125
|
+
r.syncModulesEnabled = e, await V(s, i, e);
|
|
128
126
|
});
|
|
129
127
|
} catch {
|
|
130
|
-
|
|
131
|
-
type:
|
|
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
|
-
|
|
140
|
+
ce as useStripo
|
|
143
141
|
};
|
package/dist/enums/toaster.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
c as ToasterTypeOptions
|
|
4
4
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UEAttr as
|
|
5
|
-
import { CommonControl as
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var h = (s, o, t) => o in s ? d(s, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[o] = t;
|
|
3
|
+
var c = (s, o, t) => h(s, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as m } from "../../../common-control.js";
|
|
6
6
|
import { RecommendationConfigService as n } from "../../services/configService.js";
|
|
7
|
-
import { useRecommendationExtensionStore as
|
|
8
|
-
import { mapLegacyStrategy as
|
|
9
|
-
const
|
|
7
|
+
import { useRecommendationExtensionStore as u } from "../../store/recommendation.js";
|
|
8
|
+
import { mapLegacyStrategy as p } from "../../utils/legacyStrategyMap.js";
|
|
9
|
+
const C = "recommendation-algorithm-control", i = {
|
|
10
10
|
ALGORITHM: "strategy",
|
|
11
11
|
PRODUCT_IDS: "productIds"
|
|
12
12
|
};
|
|
13
|
-
class
|
|
13
|
+
class y extends m {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
// Store is used ONLY for API-fetched data (algorithms list), not for config
|
|
17
|
-
|
|
17
|
+
c(this, "store", u());
|
|
18
18
|
}
|
|
19
19
|
getId() {
|
|
20
|
-
return
|
|
20
|
+
return C;
|
|
21
21
|
}
|
|
22
22
|
getTemplate() {
|
|
23
23
|
return `
|
|
@@ -30,10 +30,10 @@ class R extends d {
|
|
|
30
30
|
options: this.store.getActivePredictiveAlgorithms
|
|
31
31
|
}),
|
|
32
32
|
this._GuLabel({ text: this.api.translate("Product Ids"), name: `${i.PRODUCT_IDS}_label` }),
|
|
33
|
-
this.
|
|
33
|
+
this._GuMultiSelect({
|
|
34
34
|
name: i.PRODUCT_IDS,
|
|
35
35
|
placeholder: this.api.translate("Enter Product Ids"),
|
|
36
|
-
className: "
|
|
36
|
+
className: "product-ids-multiselect"
|
|
37
37
|
})
|
|
38
38
|
])}
|
|
39
39
|
</div>
|
|
@@ -46,10 +46,11 @@ class R extends d {
|
|
|
46
46
|
super.onTemplateNodeUpdated(t), this._initializeSelectItems(), this._setFormValues();
|
|
47
47
|
}
|
|
48
48
|
_setFormValues() {
|
|
49
|
-
const t = n.getConfig(this.currentNode), e =
|
|
49
|
+
const t = n.getConfig(this.currentNode), e = p(t.strategy) ?? t.strategy;
|
|
50
50
|
this._setProductIdsVisibility(e), this.api.updateValues({
|
|
51
51
|
[i.ALGORITHM]: e,
|
|
52
|
-
[
|
|
52
|
+
// MULTIPLE_SELECT consumes a string[] directly (was a comma-joined string).
|
|
53
|
+
[i.PRODUCT_IDS]: t.productIds
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
_initializeSelectItems() {
|
|
@@ -59,7 +60,7 @@ class R extends d {
|
|
|
59
60
|
try {
|
|
60
61
|
this.api.setUIEAttribute(
|
|
61
62
|
i.ALGORITHM,
|
|
62
|
-
|
|
63
|
+
g.SELECTPICKER.items,
|
|
63
64
|
t
|
|
64
65
|
);
|
|
65
66
|
} catch (r) {
|
|
@@ -81,13 +82,13 @@ class R extends d {
|
|
|
81
82
|
_onProductIdsChange(t) {
|
|
82
83
|
if (!this.currentNode)
|
|
83
84
|
return;
|
|
84
|
-
const e = t
|
|
85
|
-
n.updateConfig(
|
|
85
|
+
const e = [...new Set((t ?? []).map((a) => String(a).trim()).filter(Boolean))], r = n.getConfig(this.currentNode).productIds;
|
|
86
|
+
r.length === e.length && r.every((a, l) => a === e[l]) || (n.updateConfig(
|
|
86
87
|
this.api,
|
|
87
88
|
this.currentNode,
|
|
88
89
|
{ productIds: e },
|
|
89
90
|
"Updated product IDs"
|
|
90
|
-
), this.store.patchCurrentBlockConfig({ productIds: e });
|
|
91
|
+
), this.store.patchCurrentBlockConfig({ productIds: e }));
|
|
91
92
|
}
|
|
92
93
|
_listenToFormUpdates() {
|
|
93
94
|
this.api.onValueChanged(i.ALGORITHM, (t) => {
|
|
@@ -98,6 +99,6 @@ class R extends d {
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
C as ALGORITHM_CONTROL_ID,
|
|
103
|
+
y as AlgorithmControl
|
|
103
104
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
const n = `/* Utils */
|
|
2
|
-
.es-180w {
|
|
2
|
+
.es-180w {
|
|
3
|
+
width: 180px;
|
|
4
|
+
}
|
|
3
5
|
|
|
4
6
|
/* Recommendation Controls - Main settings panel separators */
|
|
5
|
-
.recommendation-controls-container
|
|
7
|
+
.recommendation-controls-container>div {
|
|
6
8
|
border-bottom: 1px solid #eee;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
.recommendation-controls-container
|
|
11
|
+
.recommendation-controls-container>div:first-child {
|
|
10
12
|
padding-top: 0;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
.recommendation-controls-container
|
|
15
|
+
.recommendation-controls-container>div:last-child {
|
|
14
16
|
border-bottom: none;
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -289,6 +291,62 @@ ue-orderable.orderable-disabled .droppable-icon {
|
|
|
289
291
|
font-weight: 400;
|
|
290
292
|
line-height: 16px;
|
|
291
293
|
}
|
|
294
|
+
|
|
295
|
+
/* product ID multiselect — initial */
|
|
296
|
+
.product-ids-multiselect {
|
|
297
|
+
background-color: var(--guido-color-gray-0);
|
|
298
|
+
border: 1px solid var(--guido-color-gray-300);
|
|
299
|
+
width: 180px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* product ID multiselect — hover */
|
|
303
|
+
.product-ids-multiselect:hover {
|
|
304
|
+
border-color: var(--guido-color-primary-500);
|
|
305
|
+
background-color: var(--guido-color-gray-0) !important;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* product ID multiselect — selected (.on) */
|
|
309
|
+
.product-ids-multiselect.on,
|
|
310
|
+
.product-ids-multiselect.on:hover {
|
|
311
|
+
border-color: var(--guido-color-primary-500);
|
|
312
|
+
box-shadow: 0 0 0 3px var(--guido-color-primary-200) !important;
|
|
313
|
+
background-color: var(--guido-color-gray-0) !important;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.product-ids-multiselect .multiple-wrapper .multiple-item {
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
border-radius: 4px;
|
|
320
|
+
border: 1px solid #B5C1F1;
|
|
321
|
+
background-color: #F1F3FE;
|
|
322
|
+
font-size: 13px;
|
|
323
|
+
color: #0A2ECC;
|
|
324
|
+
line-height: 16px;
|
|
325
|
+
box-shadow: none;
|
|
326
|
+
padding: 0 4px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* Close (×): always visible, moved to the right, split off by a left border (Figma).
|
|
330
|
+
Label is a text node (can't be ordered) so the icon gets order:1 to sit after it;
|
|
331
|
+
Stripo toggles visibility inline on hover, hence !important to keep it shown. */
|
|
332
|
+
.product-ids-multiselect .multiple-wrapper .multiple-item .multiple-item-remove-icon {
|
|
333
|
+
visibility: visible !important;
|
|
334
|
+
opacity: 1;
|
|
335
|
+
position: static !important;
|
|
336
|
+
order: 1;
|
|
337
|
+
margin-left: 4px;
|
|
338
|
+
border-left: 1px solid #B5C1F1;
|
|
339
|
+
color: var(--guido-color-primary-500);
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
width: 16px;
|
|
342
|
+
height: 16px;
|
|
343
|
+
padding: 4px 0 4px 3px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.product-ids-multiselect .multiple-wrapper .multiple-item:hover {
|
|
347
|
+
background-color: #F1F3FE;
|
|
348
|
+
padding: 0 4px;
|
|
349
|
+
}
|
|
292
350
|
`;
|
|
293
351
|
export {
|
|
294
352
|
n as default
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useToaster as
|
|
1
|
+
import { useToaster as r } from "../../../composables/useToaster.js";
|
|
2
2
|
import { useTranslations as s } from "../../../composables/useTranslations.js";
|
|
3
|
-
import { ToasterTypeOptions as
|
|
3
|
+
import { ToasterTypeOptions as n } from "../../../enums/toaster.js";
|
|
4
4
|
import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
|
|
5
|
-
const
|
|
6
|
-
const { showToaster: o } =
|
|
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:
|
|
10
|
-
message: t(
|
|
9
|
+
type: n.Dark,
|
|
10
|
+
message: t(a)
|
|
11
11
|
});
|
|
12
12
|
} };
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
f as useRecommendationBlockWarning
|
|
16
16
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var i = (s,
|
|
3
|
-
var
|
|
2
|
+
var i = (s, a, e) => a in s ? c(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
|
|
3
|
+
var T = (s, a, e) => i(s, typeof a != "symbol" ? a + "" : a, e);
|
|
4
4
|
import { Control as I, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
-
class
|
|
5
|
+
class _ extends I {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
T(this, "currentNode");
|
|
9
|
+
T(this, "lastBlockInstanceId", null);
|
|
10
10
|
}
|
|
11
11
|
getContainer() {
|
|
12
12
|
var e;
|
|
@@ -47,15 +47,15 @@ class d extends I {
|
|
|
47
47
|
const t = this.getBlockInstanceId();
|
|
48
48
|
if (!t)
|
|
49
49
|
return !1;
|
|
50
|
-
const
|
|
51
|
-
return e(),
|
|
50
|
+
const E = t !== this.lastBlockInstanceId;
|
|
51
|
+
return e(), E && (this.lastBlockInstanceId = t), E;
|
|
52
52
|
}
|
|
53
|
-
_GuLabel({ text: e, name: t = "", hint:
|
|
53
|
+
_GuLabel({ text: e, name: t = "", hint: E }) {
|
|
54
54
|
return `
|
|
55
55
|
<${n.LABEL}
|
|
56
56
|
${$.LABEL.text}="${e}"
|
|
57
57
|
${$.LABEL.name}="${t || `${e} Label`}"
|
|
58
|
-
${
|
|
58
|
+
${E ? `${$.LABEL.hint}="${E}"` : ""}>
|
|
59
59
|
</${n.LABEL}>
|
|
60
60
|
`;
|
|
61
61
|
}
|
|
@@ -73,7 +73,7 @@ class d extends I {
|
|
|
73
73
|
* Use in getTemplate() — the icon is registered in a hidden store so Stripo initializes it.
|
|
74
74
|
* Pair with _setInfoMessageValue() in onRender() to set the text content.
|
|
75
75
|
*/
|
|
76
|
-
_GuOnPageMessage({ name: e, icon: t = "not-found", type:
|
|
76
|
+
_GuOnPageMessage({ name: e, icon: t = "not-found", type: E = "info" }) {
|
|
77
77
|
return `
|
|
78
78
|
<div data-info-message="${e}" style="display: none; padding: 16px 16px 0;">
|
|
79
79
|
<div class="icon-store" style="display: none;">
|
|
@@ -81,7 +81,7 @@ class d extends I {
|
|
|
81
81
|
${this._GuIcon({ src: t, className: "icon" })}
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
84
|
-
${this._GuMessage({ name: e, type:
|
|
84
|
+
${this._GuMessage({ name: e, type: E })}
|
|
85
85
|
</div>
|
|
86
86
|
`;
|
|
87
87
|
}
|
|
@@ -91,7 +91,7 @@ class d extends I {
|
|
|
91
91
|
* and combines it with the text in Stripo's alert-message layout.
|
|
92
92
|
*/
|
|
93
93
|
_setInfoMessageValue(e, t) {
|
|
94
|
-
const
|
|
94
|
+
const E = this.getContainer(), o = E.querySelector(`[data-icon-key="${e}"]`), r = o == null ? void 0 : o.querySelector("ue-icon-component"), l = (r == null ? void 0 : r.outerHTML) ?? "";
|
|
95
95
|
this.api.setUIEAttribute(
|
|
96
96
|
e,
|
|
97
97
|
"value",
|
|
@@ -104,8 +104,8 @@ class d extends I {
|
|
|
104
104
|
</div>
|
|
105
105
|
`
|
|
106
106
|
);
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const u = E.querySelector(`[data-info-message="${e}"]`);
|
|
108
|
+
u && (u.style.display = "");
|
|
109
109
|
}
|
|
110
110
|
_GuToggle(e) {
|
|
111
111
|
return `
|
|
@@ -121,59 +121,59 @@ class d extends I {
|
|
|
121
121
|
${$.SELECT_ITEM.value}="${t}">
|
|
122
122
|
</${n.SELECT_ITEM}>`;
|
|
123
123
|
}
|
|
124
|
-
_GuSelect({ name: e, placeholder: t, options:
|
|
124
|
+
_GuSelect({ name: e, placeholder: t, options: E, className: o = "es-180w" }) {
|
|
125
125
|
return `
|
|
126
126
|
<${n.SELECTPICKER}
|
|
127
|
-
class="${
|
|
127
|
+
class="${o}"
|
|
128
128
|
${$.SELECTPICKER.name}="${e}"
|
|
129
129
|
${$.SELECTPICKER.placeholder}="${t}">
|
|
130
|
-
${
|
|
130
|
+
${E.map((r) => this._GuSelectItem(r)).join("")}
|
|
131
131
|
</${n.SELECTPICKER}>
|
|
132
132
|
`;
|
|
133
133
|
}
|
|
134
|
-
_GuTextInput({ name: e, placeholder: t, className:
|
|
134
|
+
_GuTextInput({ name: e, placeholder: t, className: E = "", disabled: o = !1 }) {
|
|
135
135
|
return `
|
|
136
136
|
<${n.TEXT}
|
|
137
|
-
class=${
|
|
137
|
+
class=${E}
|
|
138
138
|
${$.TEXT.name}="${e}"
|
|
139
139
|
placeholder="${t || e}"
|
|
140
|
-
${
|
|
140
|
+
${o ? `${$.TEXT.disabled}="true"` : ""}>
|
|
141
141
|
</${n.TEXT}>
|
|
142
142
|
`;
|
|
143
143
|
}
|
|
144
|
-
_GuCounter({ name: e, maxValue: t, minValue:
|
|
144
|
+
_GuCounter({ name: e, maxValue: t, minValue: E = 1, step: o = 1 }) {
|
|
145
145
|
return `
|
|
146
146
|
<${n.COUNTER}
|
|
147
147
|
${$.COUNTER.name}="${e}"
|
|
148
|
-
${$.COUNTER.minValue}="${
|
|
148
|
+
${$.COUNTER.minValue}="${E}"
|
|
149
149
|
${$.COUNTER.maxValue}="${t}"
|
|
150
|
-
${$.COUNTER.step}="${
|
|
150
|
+
${$.COUNTER.step}="${o}">
|
|
151
151
|
</${n.COUNTER}>
|
|
152
152
|
`;
|
|
153
153
|
}
|
|
154
|
-
_GuRadioButtonItem({ text: e, value: t, icon:
|
|
154
|
+
_GuRadioButtonItem({ text: e, value: t, icon: E }) {
|
|
155
155
|
return `
|
|
156
156
|
<${n.RADIO_ITEM}
|
|
157
157
|
${$.RADIO_ITEM.value}="${t}"
|
|
158
158
|
${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
|
|
159
|
-
${
|
|
159
|
+
${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
|
|
160
160
|
</${n.RADIO_ITEM}>
|
|
161
161
|
`;
|
|
162
162
|
}
|
|
163
|
-
_GuRadioButton({ name: e, buttons: t, id:
|
|
163
|
+
_GuRadioButton({ name: e, buttons: t, id: E = "" }) {
|
|
164
164
|
return `
|
|
165
165
|
<${n.RADIO_BUTTONS}
|
|
166
|
-
${
|
|
166
|
+
${E ? `id="${E}"` : ""}
|
|
167
167
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
168
|
-
${t.map((
|
|
168
|
+
${t.map((o) => this._GuRadioButtonItem(o)).join("")}
|
|
169
169
|
</${n.RADIO_BUTTONS}>
|
|
170
170
|
`;
|
|
171
171
|
}
|
|
172
|
-
_GuButton({ name: e, label: t, id:
|
|
172
|
+
_GuButton({ name: e, label: t, id: E = "" }) {
|
|
173
173
|
return `
|
|
174
174
|
<${n.BUTTON}
|
|
175
175
|
${$.BUTTON.name}="${e}"
|
|
176
|
-
${
|
|
176
|
+
${E ? `id="${E}"` : ""}
|
|
177
177
|
${$.BUTTON.caption}="${t}"}>
|
|
178
178
|
</${n.BUTTON}>
|
|
179
179
|
`;
|
|
@@ -191,10 +191,10 @@ class d extends I {
|
|
|
191
191
|
* @param param0
|
|
192
192
|
* @returns It returns a button with an icon.
|
|
193
193
|
*/
|
|
194
|
-
_GuIconButton({ name: e, icon: t, className:
|
|
194
|
+
_GuIconButton({ name: e, icon: t, className: E = "" }) {
|
|
195
195
|
return `
|
|
196
196
|
<${n.BUTTON}
|
|
197
|
-
class="${
|
|
197
|
+
class="${E}"
|
|
198
198
|
${$.BUTTON.name}="${e}"
|
|
199
199
|
${$.BUTTON.icon}="${t}">
|
|
200
200
|
</${n.BUTTON}>
|
|
@@ -222,19 +222,19 @@ class d extends I {
|
|
|
222
222
|
* @returns HTML string for the orderable control
|
|
223
223
|
*/
|
|
224
224
|
_GuOrderable(e, t) {
|
|
225
|
-
let
|
|
226
|
-
t.forEach((
|
|
225
|
+
let E = "";
|
|
226
|
+
t.forEach((r) => {
|
|
227
227
|
const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
228
|
-
|
|
229
|
-
<${n.ORDERABLE_ITEM} ${l}="${
|
|
230
|
-
${
|
|
228
|
+
E += `
|
|
229
|
+
<${n.ORDERABLE_ITEM} ${l}="${r.key}">
|
|
230
|
+
${r.content}
|
|
231
231
|
</${n.ORDERABLE_ITEM}>
|
|
232
232
|
`;
|
|
233
233
|
});
|
|
234
|
-
const
|
|
234
|
+
const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
|
|
235
235
|
return `
|
|
236
|
-
<${n.ORDERABLE} ${
|
|
237
|
-
${
|
|
236
|
+
<${n.ORDERABLE} ${o}="${e}">
|
|
237
|
+
${E}
|
|
238
238
|
</${n.ORDERABLE}>
|
|
239
239
|
`;
|
|
240
240
|
}
|
|
@@ -275,16 +275,16 @@ class d extends I {
|
|
|
275
275
|
`;
|
|
276
276
|
}
|
|
277
277
|
_GuRadioButtons(e, t) {
|
|
278
|
-
const
|
|
278
|
+
const E = t.map((o) => `
|
|
279
279
|
<${n.RADIO_ITEM}
|
|
280
|
-
${$.RADIO_ITEM.text}="${
|
|
281
|
-
${$.RADIO_ITEM.value}="${
|
|
280
|
+
${$.RADIO_ITEM.text}="${o.text}"
|
|
281
|
+
${$.RADIO_ITEM.value}="${o.value}">
|
|
282
282
|
</${n.RADIO_ITEM}>
|
|
283
283
|
`).join("");
|
|
284
284
|
return `
|
|
285
285
|
<${n.RADIO_BUTTONS}
|
|
286
286
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
287
|
-
${
|
|
287
|
+
${E}
|
|
288
288
|
</${n.RADIO_BUTTONS}>
|
|
289
289
|
`;
|
|
290
290
|
}
|
|
@@ -296,7 +296,20 @@ class d extends I {
|
|
|
296
296
|
</${n.CHECKBOX}>
|
|
297
297
|
`;
|
|
298
298
|
}
|
|
299
|
+
// Tag/chips input (Stripo MULTIPLE_SELECT): add-by-Enter, remove-by-×.
|
|
300
|
+
// Value is read/written as a string[] via updateValues / onValueChanged.
|
|
301
|
+
_GuMultiSelect({ name: e, placeholder: t = "", className: E = "", disabled: o = !1 }) {
|
|
302
|
+
const r = [E, o ? "" : "click-enabled"].filter(Boolean).join(" ");
|
|
303
|
+
return `
|
|
304
|
+
<${n.MULTIPLE_SELECT}
|
|
305
|
+
class="${r}"
|
|
306
|
+
${$.MULTIPLE_SELECT.name}="${e}"
|
|
307
|
+
${$.MULTIPLE_SELECT.placeholder}="${t}"
|
|
308
|
+
${o ? `${$.MULTIPLE_SELECT.disabled}="true"` : ""}>
|
|
309
|
+
</${n.MULTIPLE_SELECT}>
|
|
310
|
+
`;
|
|
311
|
+
}
|
|
299
312
|
}
|
|
300
313
|
export {
|
|
301
|
-
|
|
314
|
+
_ as CommonControl
|
|
302
315
|
};
|
|
@@ -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 {
|
|
8
|
-
import {
|
|
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
|
|
12
|
-
const
|
|
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 } =
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
92
|
+
$ as useTemplateLibraryApi
|
|
94
93
|
};
|
|
@@ -24,6 +24,6 @@ export declare class AlgorithmControl extends CommonControl {
|
|
|
24
24
|
_initializeSelectItems(): void;
|
|
25
25
|
_setProductIdsVisibility(strategy?: string): void;
|
|
26
26
|
_onAlgorithmChange(value: string): void;
|
|
27
|
-
_onProductIdsChange(value: string): void;
|
|
27
|
+
_onProductIdsChange(value: string[]): void;
|
|
28
28
|
_listenToFormUpdates(): void;
|
|
29
29
|
}
|
|
@@ -6,6 +6,12 @@ interface TextInputProps {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
+
interface MultiSelectProps {
|
|
10
|
+
name: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
9
15
|
interface LabelProps {
|
|
10
16
|
text: string;
|
|
11
17
|
name?: string;
|
|
@@ -145,5 +151,6 @@ export declare abstract class CommonControl extends Control {
|
|
|
145
151
|
value: string;
|
|
146
152
|
}[]): string;
|
|
147
153
|
_GuCheckbox(name: string, caption: string): string;
|
|
154
|
+
_GuMultiSelect({ name, placeholder, className, disabled }: MultiSelectProps): string;
|
|
148
155
|
}
|
|
149
156
|
export {};
|
|
@@ -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
|
|
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
|
+
};
|
package/dist/stores/toaster.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ToasterTypeOptions as e } from "../enums/toaster.js";
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
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
|
-
}),
|
|
11
|
-
state: () =>
|
|
11
|
+
}), n = i("guidoToaster", {
|
|
12
|
+
state: () => a(),
|
|
12
13
|
getters: {
|
|
13
|
-
|
|
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
|
|
18
|
-
this.status = !0, this.text = s, this.type = t, this.actionButton = o
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "3.9.0-beta.fc7d209",
|
|
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.
|
|
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",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useToaster as d } from "./useToaster.js";
|
|
2
|
-
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
3
|
-
const g = () => {
|
|
4
|
-
const { showToaster: l, hideToaster: u } = d();
|
|
5
|
-
let s = null;
|
|
6
|
-
const n = (o, t, i, e, f = !0) => {
|
|
7
|
-
s = i;
|
|
8
|
-
const r = e != null && e.action ? { text: e.action.label, onClick: e.action.func } : void 0;
|
|
9
|
-
l({ type: o, message: t, actionButton: r, autoHide: (e == null ? void 0 : e.autoClose) ?? f });
|
|
10
|
-
};
|
|
11
|
-
return { getStripoNotifications: () => ({
|
|
12
|
-
info: (o, t, i) => n(c.Info, o, t, i),
|
|
13
|
-
success: (o, t, i) => n(c.Success, o, t, i),
|
|
14
|
-
warn: (o, t, i) => n(c.Warning, o, t, i),
|
|
15
|
-
error: (o, t, i) => n(c.Alert, o, t, i),
|
|
16
|
-
// A loader marks an in-progress operation; Stripo dismisses it via hide(id)
|
|
17
|
-
// when finished, so it must not auto-hide.
|
|
18
|
-
loader: (o, t, i) => n(c.Info, o, t, i, !1),
|
|
19
|
-
hide: (o) => {
|
|
20
|
-
s === o && (u(), s = null);
|
|
21
|
-
}
|
|
22
|
-
}) };
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
g as useStripoNotifications
|
|
26
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
};
|