@lerx/promise-modal 0.2.9 → 0.4.0
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/index.cjs +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +9 -10
package/dist/index.cjs
CHANGED
|
@@ -381,8 +381,8 @@ const useActiveModalCount = (validate = defaultValidate, refreshKey = 0) => {
|
|
|
381
381
|
const { modalIds, getModalNode } = useModalManagerContext();
|
|
382
382
|
return react.useMemo(() => {
|
|
383
383
|
let count = 0;
|
|
384
|
-
for (let
|
|
385
|
-
const id = modalIds[
|
|
384
|
+
for (let i = 0, l = modalIds.length; i < l; i++) {
|
|
385
|
+
const id = modalIds[i];
|
|
386
386
|
if (validate(getModalNode(id)))
|
|
387
387
|
count++;
|
|
388
388
|
}
|
|
@@ -508,8 +508,8 @@ const ModalManagerContextProvider = react.memo(({ usePathname, children, }) => {
|
|
|
508
508
|
modalDictionary.current.set(modal.id, modal);
|
|
509
509
|
setModalIds((ids) => {
|
|
510
510
|
const aliveIds = [];
|
|
511
|
-
for (let
|
|
512
|
-
const id = ids[
|
|
511
|
+
for (let i = 0, l = ids.length; i < l; i++) {
|
|
512
|
+
const id = ids[i];
|
|
513
513
|
const destroyed = !modalDictionary.current.get(id)?.alive;
|
|
514
514
|
if (destroyed)
|
|
515
515
|
modalDictionary.current.delete(id);
|
package/dist/index.mjs
CHANGED
|
@@ -379,8 +379,8 @@ const useActiveModalCount = (validate = defaultValidate, refreshKey = 0) => {
|
|
|
379
379
|
const { modalIds, getModalNode } = useModalManagerContext();
|
|
380
380
|
return useMemo(() => {
|
|
381
381
|
let count = 0;
|
|
382
|
-
for (let
|
|
383
|
-
const id = modalIds[
|
|
382
|
+
for (let i = 0, l = modalIds.length; i < l; i++) {
|
|
383
|
+
const id = modalIds[i];
|
|
384
384
|
if (validate(getModalNode(id)))
|
|
385
385
|
count++;
|
|
386
386
|
}
|
|
@@ -506,8 +506,8 @@ const ModalManagerContextProvider = memo(({ usePathname, children, }) => {
|
|
|
506
506
|
modalDictionary.current.set(modal.id, modal);
|
|
507
507
|
setModalIds((ids) => {
|
|
508
508
|
const aliveIds = [];
|
|
509
|
-
for (let
|
|
510
|
-
const id = ids[
|
|
509
|
+
for (let i = 0, l = ids.length; i < l; i++) {
|
|
510
|
+
const id = ids[i];
|
|
511
511
|
const destroyed = !modalDictionary.current.get(id)?.alive;
|
|
512
512
|
if (destroyed)
|
|
513
513
|
modalDictionary.current.delete(id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lerx/promise-modal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Universal React modal utility that can be used outside React components with promise-based results for alert, confirm, and prompt modals",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"build-storybook": "storybook build",
|
|
52
52
|
"build:publish:npm": "yarn build && yarn publish:npm",
|
|
53
53
|
"build:types": "tsc -p ./tsconfig.declarations.json && tsc-alias -p ./tsconfig.declarations.json",
|
|
54
|
-
"format": "prettier --write \"src/**/*.ts
|
|
54
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
55
55
|
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
56
56
|
"make-dependency-graph": "npx depcruise src --config .dependency-cruiser.js --output-type dot > dependency-graph.dot && dot -Tpng dependency-graph.dot -o dependency-graph.png",
|
|
57
57
|
"publish:npm": "yarn npm publish --access public",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"version:patch": "yarn version patch"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@winglet/common-utils": "^0.
|
|
69
|
-
"@winglet/react-utils": "^0.
|
|
70
|
-
"@winglet/style-utils": "^0.
|
|
68
|
+
"@winglet/common-utils": "^0.4.0",
|
|
69
|
+
"@winglet/react-utils": "^0.4.0",
|
|
70
|
+
"@winglet/style-utils": "^0.4.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@chromatic-com/storybook": "^4.0
|
|
73
|
+
"@chromatic-com/storybook": "^4.1.0",
|
|
74
74
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
75
75
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
76
76
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"@size-limit/preset-app": "^11.1.6",
|
|
79
79
|
"@size-limit/preset-big-lib": "^11.1.6",
|
|
80
80
|
"@size-limit/preset-small-lib": "^11.1.6",
|
|
81
|
-
"@storybook/addon-docs": "^9.
|
|
82
|
-
"@storybook/react-vite": "^9.
|
|
81
|
+
"@storybook/addon-docs": "^9.1.1",
|
|
82
|
+
"@storybook/react-vite": "^9.1.1",
|
|
83
83
|
"@testing-library/dom": "^10.4.0",
|
|
84
84
|
"@testing-library/jest-dom": "^6.6.3",
|
|
85
85
|
"@testing-library/react": "^16.1.0",
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"antd": "^5.22.5",
|
|
91
91
|
"dependency-cruiser": "^16.7.0",
|
|
92
92
|
"jsdom": "^25.0.1",
|
|
93
|
-
"prettier": "^3.5.3",
|
|
94
93
|
"react": "^19.0.0",
|
|
95
94
|
"react-dom": "^19.0.0",
|
|
96
95
|
"rollup": "^4.42.0",
|
|
@@ -98,7 +97,7 @@
|
|
|
98
97
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
99
98
|
"rollup-plugin-visualizer": "^5.12.0",
|
|
100
99
|
"size-limit": "^11.2.0",
|
|
101
|
-
"storybook": "^9.
|
|
100
|
+
"storybook": "^9.1.1",
|
|
102
101
|
"tsc-alias": "^1.8.16",
|
|
103
102
|
"typescript": "^5.7.2",
|
|
104
103
|
"vite": "^6.3.5",
|