@snack-uikit/toaster 0.11.25 → 0.11.26
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/CHANGELOG.md +10 -0
- package/dist/cjs/components/ToastSystemEvent/ToastSystemEvent.js +1 -1
- package/dist/cjs/components/ToastUpload/ToastUpload.js +2 -2
- package/dist/cjs/components/ToastUpload/utils/formatPercent.js +1 -1
- package/dist/cjs/components/ToasterContainer/ToasterContainer.js +1 -1
- package/dist/cjs/helpers.js +4 -4
- package/dist/cjs/testIds.js +23 -23
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.11.26 (2026-03-27)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/link@0.17.20]($PUBLIC_PROJECT_URL/blob/master/packages/link/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/truncate-string@0.7.11]($PUBLIC_PROJECT_URL/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## 0.11.25 (2026-03-17)
|
|
7
17
|
|
|
8
18
|
### Only dependencies have been changed
|
|
@@ -102,7 +102,7 @@ function ToastSystemEvent(_a) {
|
|
|
102
102
|
"data-test-id": testIds_1.TOAST_SYSTEM_EVENT_TEST_IDS.progressbar,
|
|
103
103
|
className: styles_module_scss_1.default.progress,
|
|
104
104
|
style: {
|
|
105
|
-
animationDuration:
|
|
105
|
+
animationDuration: `${constants_1.AUTO_CLOSE_TIME[constants_1.TOASTER_TYPE.SystemEvent]}ms`
|
|
106
106
|
}
|
|
107
107
|
}), Array.isArray(action) && action.length > 0 && (0, jsx_runtime_1.jsx)("div", {
|
|
108
108
|
className: styles_module_scss_1.default.footer,
|
|
@@ -58,7 +58,7 @@ function ToastUpload(_a) {
|
|
|
58
58
|
const {
|
|
59
59
|
t
|
|
60
60
|
} = (0, locale_1.useLocale)('ToastUpload');
|
|
61
|
-
const showingTitle = title || t(
|
|
61
|
+
const showingTitle = title || t(`title.${status}`);
|
|
62
62
|
const handleCloseClick = e => {
|
|
63
63
|
e.stopPropagation();
|
|
64
64
|
onCloseClick ? onCloseClick(e, closeToast) : closeToast === null || closeToast === void 0 ? void 0 : closeToast();
|
|
@@ -113,7 +113,7 @@ function ToastUpload(_a) {
|
|
|
113
113
|
}), (0, jsx_runtime_1.jsx)("span", {
|
|
114
114
|
className: styles_module_scss_1.default.totalCounter,
|
|
115
115
|
"data-test-id": testIds_1.TOAST_UPLOAD_TEST_IDS.counter,
|
|
116
|
-
children:
|
|
116
|
+
children: `${progress.current}/${progress.total}`
|
|
117
117
|
}), (0, jsx_runtime_1.jsx)("span", {
|
|
118
118
|
className: styles_module_scss_1.default.totalPercentage,
|
|
119
119
|
"data-test-id": testIds_1.TOAST_UPLOAD_TEST_IDS.progress,
|
|
@@ -38,7 +38,7 @@ function ToasterContainer(_ref) {
|
|
|
38
38
|
status,
|
|
39
39
|
containerId
|
|
40
40
|
} = _ref2;
|
|
41
|
-
if (containerId ===
|
|
41
|
+
if (containerId === `${constants_1.TOASTER_CONTAINER_PREFIX}${constants_1.TOASTER_TYPE.SystemEvent}`) {
|
|
42
42
|
if (status === 'added') {
|
|
43
43
|
setIsCloseAllButtonHidden(false);
|
|
44
44
|
setNotificationCounter(prev => prev + 1);
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -25,12 +25,12 @@ function getToasterContainer(_ref) {
|
|
|
25
25
|
toasterParent,
|
|
26
26
|
containerProps
|
|
27
27
|
} = _ref;
|
|
28
|
-
const containerId = (containerProps === null || containerProps === void 0 ? void 0 : containerProps.containerId) ||
|
|
28
|
+
const containerId = (containerProps === null || containerProps === void 0 ? void 0 : containerProps.containerId) || `${constants_1.TOASTER_CONTAINER_PREFIX}${type}`;
|
|
29
29
|
const toasterContainerProps = Object.assign(Object.assign(Object.assign({}, constants_1.TOASTER_CONTAINER_DEFAULT_PROPS[type]), containerProps || {}), {
|
|
30
30
|
containerId
|
|
31
31
|
});
|
|
32
|
-
const toasterRootId =
|
|
33
|
-
let rootInDOM = toasterParent ? toasterParent.querySelector(
|
|
32
|
+
const toasterRootId = `${constants_1.TOASTER_ROOT_ID}__${type}`;
|
|
33
|
+
let rootInDOM = toasterParent ? toasterParent.querySelector(`#${toasterRootId}`) : null;
|
|
34
34
|
if (!rootInDOM && toasterParent && (0, utils_1.isBrowser)()) {
|
|
35
35
|
rootInDOM = document.createElement('div');
|
|
36
36
|
rootInDOM.id = toasterRootId;
|
|
@@ -55,7 +55,7 @@ function getToastOptions(_ref2) {
|
|
|
55
55
|
(_a = toastOptions === null || toastOptions === void 0 ? void 0 : toastOptions.onClose) === null || _a === void 0 ? void 0 : _a.call(toastOptions, data === null || data === void 0 ? void 0 : data.id);
|
|
56
56
|
},
|
|
57
57
|
autoClose: (toasterProps === null || toasterProps === void 0 ? void 0 : toasterProps.loading) ? false : constants_1.AUTO_CLOSE_TIME[type],
|
|
58
|
-
containerId: containerId ||
|
|
58
|
+
containerId: containerId || `${constants_1.TOASTER_CONTAINER_PREFIX}${type}`
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
function getToastComponent(_ref3) {
|
package/dist/cjs/testIds.js
CHANGED
|
@@ -6,36 +6,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TOAST_UPLOAD_TEST_IDS = exports.TOAST_USER_ACTION_TEST_IDS = exports.TOAST_SYSTEM_EVENT_TEST_IDS = void 0;
|
|
7
7
|
const TOAST_SYSTEM_EVENT_TEST_ID = 'toast-system-event';
|
|
8
8
|
exports.TOAST_SYSTEM_EVENT_TEST_IDS = {
|
|
9
|
-
icon:
|
|
9
|
+
icon: `${TOAST_SYSTEM_EVENT_TEST_ID}__icon`,
|
|
10
10
|
main: TOAST_SYSTEM_EVENT_TEST_ID,
|
|
11
|
-
title:
|
|
12
|
-
description:
|
|
13
|
-
buttonClose:
|
|
14
|
-
buttonAction:
|
|
15
|
-
link:
|
|
16
|
-
progressbar:
|
|
17
|
-
buttonCloseColumn:
|
|
11
|
+
title: `${TOAST_SYSTEM_EVENT_TEST_ID}__title`,
|
|
12
|
+
description: `${TOAST_SYSTEM_EVENT_TEST_ID}__description`,
|
|
13
|
+
buttonClose: `${TOAST_SYSTEM_EVENT_TEST_ID}__button-close`,
|
|
14
|
+
buttonAction: `${TOAST_SYSTEM_EVENT_TEST_ID}__button-action`,
|
|
15
|
+
link: `${TOAST_SYSTEM_EVENT_TEST_ID}__link`,
|
|
16
|
+
progressbar: `${TOAST_SYSTEM_EVENT_TEST_ID}__progressbar`,
|
|
17
|
+
buttonCloseColumn: `${TOAST_SYSTEM_EVENT_TEST_ID}button-close-column`
|
|
18
18
|
};
|
|
19
19
|
const TOAST_USER_ACTION_TEST_ID = 'toast-user-action';
|
|
20
20
|
exports.TOAST_USER_ACTION_TEST_IDS = {
|
|
21
21
|
main: TOAST_USER_ACTION_TEST_ID,
|
|
22
|
-
label:
|
|
23
|
-
icon:
|
|
24
|
-
loader:
|
|
25
|
-
link:
|
|
22
|
+
label: `${TOAST_USER_ACTION_TEST_ID}__label`,
|
|
23
|
+
icon: `${TOAST_USER_ACTION_TEST_ID}__icon`,
|
|
24
|
+
loader: `${TOAST_USER_ACTION_TEST_ID}__loader`,
|
|
25
|
+
link: `${TOAST_USER_ACTION_TEST_ID}__link`
|
|
26
26
|
};
|
|
27
27
|
const TOAST_UPLOAD_TEST_ID = 'toast-upload';
|
|
28
28
|
exports.TOAST_UPLOAD_TEST_IDS = {
|
|
29
29
|
main: TOAST_UPLOAD_TEST_ID,
|
|
30
|
-
close:
|
|
31
|
-
title:
|
|
32
|
-
description:
|
|
33
|
-
counter:
|
|
34
|
-
progress:
|
|
35
|
-
list:
|
|
36
|
-
collapseButton:
|
|
37
|
-
progressBar:
|
|
38
|
-
uploadItem:
|
|
39
|
-
uploadItemLink:
|
|
40
|
-
uploadItemCancel:
|
|
30
|
+
close: `${TOAST_UPLOAD_TEST_ID}__close`,
|
|
31
|
+
title: `${TOAST_UPLOAD_TEST_ID}__title`,
|
|
32
|
+
description: `${TOAST_UPLOAD_TEST_ID}__description`,
|
|
33
|
+
counter: `${TOAST_UPLOAD_TEST_ID}__counter`,
|
|
34
|
+
progress: `${TOAST_UPLOAD_TEST_ID}__progress`,
|
|
35
|
+
list: `${TOAST_UPLOAD_TEST_ID}__list`,
|
|
36
|
+
collapseButton: `${TOAST_UPLOAD_TEST_ID}__collapseButton`,
|
|
37
|
+
progressBar: `${TOAST_UPLOAD_TEST_ID}__progressBar`,
|
|
38
|
+
uploadItem: `${TOAST_UPLOAD_TEST_ID}__uploadItem`,
|
|
39
|
+
uploadItemLink: `${TOAST_UPLOAD_TEST_ID}__uploadItemLink`,
|
|
40
|
+
uploadItemCancel: `${TOAST_UPLOAD_TEST_ID}__uploadItemCancel`
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Toaster",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.26",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@snack-uikit/icons": "0.27.7",
|
|
40
|
-
"@snack-uikit/link": "0.17.
|
|
40
|
+
"@snack-uikit/link": "0.17.20",
|
|
41
41
|
"@snack-uikit/loaders": "0.9.10",
|
|
42
42
|
"@snack-uikit/progress-bar": "0.1.11",
|
|
43
43
|
"@snack-uikit/scroll": "0.10.8",
|
|
44
|
-
"@snack-uikit/truncate-string": "0.7.
|
|
44
|
+
"@snack-uikit/truncate-string": "0.7.11",
|
|
45
45
|
"@snack-uikit/utils": "4.0.1",
|
|
46
46
|
"classnames": "2.5.1",
|
|
47
47
|
"react-draggable": "4.4.6",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@snack-uikit/locale": "*"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "1f7164e6cecf3ccd35444c100907479607cf10f0"
|
|
55
55
|
}
|