@lerx/promise-modal 0.2.9 → 0.3.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 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 index = 0; index < modalIds.length; index++) {
385
- const id = modalIds[index];
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 index = 0; index < ids.length; index++) {
512
- const id = ids[index];
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 index = 0; index < modalIds.length; index++) {
383
- const id = modalIds[index];
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 index = 0; index < ids.length; index++) {
510
- const id = ids[index];
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.2.9",
3
+ "version": "0.3.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\" \"src/**/*.tsx\"",
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,9 +65,9 @@
65
65
  "version:patch": "yarn version patch"
66
66
  },
67
67
  "dependencies": {
68
- "@winglet/common-utils": "^0.2.3",
69
- "@winglet/react-utils": "^0.2.9",
70
- "@winglet/style-utils": "^0.2.2"
68
+ "@winglet/common-utils": "^0.3.0",
69
+ "@winglet/react-utils": "^0.3.0",
70
+ "@winglet/style-utils": "^0.3.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@chromatic-com/storybook": "^4.0.1",
@@ -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",