@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/dist/inertiaui-modal.js +97 -96
- package/dist/inertiaui-modal.umd.cjs +11 -11
- package/package.json +1 -1
- package/src/ModalRoot.jsx +2 -3
package/package.json
CHANGED
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(() => []),
|