@inertiaui/modal-react 0.5.2 → 0.5.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inertiaui/modal-react",
3
3
  "author": "Pascal Baljet <pascal@protone.media>",
4
- "version": "0.5.2",
4
+ "version": "0.5.4",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "type": "module",
package/src/ModalRoot.jsx CHANGED
@@ -6,6 +6,7 @@ import { mergeDataIntoQueryString } from '@inertiajs/core'
6
6
  import { createContext, useContext } from 'react'
7
7
  import ModalRenderer from './ModalRenderer'
8
8
  import { waitFor } from './helpers'
9
+ import { getConfig } from './config'
9
10
 
10
11
  const ModalStackContext = createContext(null)
11
12
  ModalStackContext.displayName = 'ModalStackContext'
@@ -128,7 +129,6 @@ export const ModalStackProvider = ({ children }) => {
128
129
  }
129
130
 
130
131
  close = () => {
131
- console.log('Closing', this.id)
132
132
  updateStack((prevStack) =>
133
133
  prevStack.map((modal) => {
134
134
  if (modal.id === this.id && modal.isOpen) {
@@ -145,7 +145,6 @@ export const ModalStackProvider = ({ children }) => {
145
145
  }
146
146
 
147
147
  afterLeave = () => {
148
- console.log('After leave', this.id)
149
148
  if (this.isOpen) {
150
149
  return
151
150
  }
@@ -269,6 +268,7 @@ export const ModalStackProvider = ({ children }) => {
269
268
  options.onClose,
270
269
  options.onAfterLeave,
271
270
  options.queryStringArrayFormat ?? 'brackets',
271
+ options.navigate ?? getConfig('navigate'),
272
272
  )
273
273
 
274
274
  const visit = (
@@ -375,7 +375,6 @@ export const ModalStackProvider = ({ children }) => {
375
375
  push,
376
376
  pushFromResponseData,
377
377
  closeAll: () => {
378
- console.log('Closing all modals', { stack, localStackCopy })
379
378
  localStackCopy.reverse().forEach((modal) => modal.close())
380
379
  },
381
380
  reset: () => updateStack(() => []),