@astral/ui 4.104.1 → 4.104.2
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/components/Notification/Notification.js +3 -0
- package/components/Notification/utils/getNotifyOptions/getNotifyOptions.js +7 -2
- package/node/components/Notification/Notification.js +3 -0
- package/node/components/Notification/utils/getNotifyOptions/getNotifyOptions.js +6 -1
- package/package.json +1 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { NOTIFY_CONTAINER_ID, NOTIFY_STATIC_CONTAINER_ID, } from '../../constants';
|
|
1
|
+
import { NOTIFY_CONTAINER_ID, NOTIFY_STATIC_CONTAINER_ID, notifyClassnames, } from '../../constants';
|
|
2
|
+
const checkHasStackContainer = () => typeof document !== 'undefined' &&
|
|
3
|
+
Boolean(document.querySelector(`.${notifyClassnames.stackHost}`));
|
|
2
4
|
const getContainerId = ({ containerId, isStatic, }) => {
|
|
3
5
|
if (containerId) {
|
|
4
6
|
return containerId;
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
if (isStatic && checkHasStackContainer()) {
|
|
9
|
+
return NOTIFY_STATIC_CONTAINER_ID;
|
|
10
|
+
}
|
|
11
|
+
return NOTIFY_CONTAINER_ID;
|
|
7
12
|
};
|
|
8
13
|
export const getNotifyOptions = ({ isStatic, containerId, hideProgressBar, autoClose, ...options }) => ({
|
|
9
14
|
containerId: getContainerId({ containerId, isStatic }),
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNotifyOptions = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
|
+
const checkHasStackContainer = () => typeof document !== 'undefined' &&
|
|
6
|
+
Boolean(document.querySelector(`.${constants_1.notifyClassnames.stackHost}`));
|
|
5
7
|
const getContainerId = ({ containerId, isStatic, }) => {
|
|
6
8
|
if (containerId) {
|
|
7
9
|
return containerId;
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
if (isStatic && checkHasStackContainer()) {
|
|
12
|
+
return constants_1.NOTIFY_STATIC_CONTAINER_ID;
|
|
13
|
+
}
|
|
14
|
+
return constants_1.NOTIFY_CONTAINER_ID;
|
|
10
15
|
};
|
|
11
16
|
const getNotifyOptions = ({ isStatic, containerId, hideProgressBar, autoClose, ...options }) => ({
|
|
12
17
|
containerId: getContainerId({ containerId, isStatic }),
|