Skip to content

Commit 61bbf49

Browse files
committed
Merge branch '4.x'
2 parents ed67606 + 5f7811b commit 61bbf49

File tree

6 files changed

+51
-36
lines changed

6 files changed

+51
-36
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/laravel/jetstream/compare/v4.2.2...master)
3+
## [Unreleased](https://github.com/laravel/jetstream/compare/v4.3.1...master)
4+
5+
## [v4.3.1](https://github.com/laravel/jetstream/compare/v4.3.0...v4.3.1) - 2024-02-29
6+
7+
* [4.x] Remove unnecessary e.preventDefault on modal close by [@Smef](https://github.com/Smef) in https://github.com/laravel/jetstream/pull/1444
8+
9+
## [v4.3.0](https://github.com/laravel/jetstream/compare/v4.2.2...v4.3.0) - 2024-02-23
10+
11+
* Update to Ziggy v2 by [@bakerkretzmar](https://github.com/bakerkretzmar) in https://github.com/laravel/jetstream/pull/1442
12+
* [4.x] Change Inertia Modal.vue component to use a native <dialog> by [@Smef](https://github.com/Smef) in https://github.com/laravel/jetstream/pull/1431
413

514
## [v4.2.2](https://github.com/laravel/jetstream/compare/v4.2.1...v4.2.2) - 2024-01-17
615

src/Console/InstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ protected function livewireRouteDefinition()
332332
protected function installInertiaStack()
333333
{
334334
// Install Inertia...
335-
if (! $this->requireComposerPackages('inertiajs/inertia-laravel:^1.0', 'tightenco/ziggy:^1.0')) {
335+
if (! $this->requireComposerPackages('inertiajs/inertia-laravel:^1.0', 'tightenco/ziggy:^2.0')) {
336336
return false;
337337
}
338338

stubs/inertia/app/Http/Middleware/HandleInertiaRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Illuminate\Http\Request;
66
use Inertia\Middleware;
7-
use Tightenco\Ziggy\Ziggy;
7+
use Tighten\Ziggy\Ziggy;
88

99
class HandleInertiaRequests extends Middleware
1010
{

stubs/inertia/resources/js/Components/Modal.vue

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { computed, onMounted, onUnmounted, watch } from 'vue';
2+
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
33
44
const props = defineProps({
55
show: {
@@ -17,12 +17,20 @@ const props = defineProps({
1717
});
1818
1919
const emit = defineEmits(['close']);
20+
const dialog = ref();
21+
const showSlot = ref(props.show);
2022
2123
watch(() => props.show, () => {
2224
if (props.show) {
2325
document.body.style.overflow = 'hidden';
26+
showSlot.value = true;
27+
dialog.value?.showModal();
2428
} else {
2529
document.body.style.overflow = null;
30+
setTimeout(() => {
31+
dialog.value?.close();
32+
showSlot.value = false;
33+
}, 200);
2634
}
2735
});
2836
@@ -57,35 +65,33 @@ const maxWidthClass = computed(() => {
5765
</script>
5866
5967
<template>
60-
<teleport to="body">
61-
<transition leave-active-class="duration-200">
62-
<div v-show="show" class="fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50" scroll-region>
63-
<transition
64-
enter-active-class="ease-out duration-300"
65-
enter-from-class="opacity-0"
66-
enter-to-class="opacity-100"
67-
leave-active-class="ease-in duration-200"
68-
leave-from-class="opacity-100"
69-
leave-to-class="opacity-0"
70-
>
71-
<div v-show="show" class="fixed inset-0 transform transition-all" @click="close">
72-
<div class="absolute inset-0 bg-gray-500 dark:bg-gray-900 opacity-75" />
73-
</div>
74-
</transition>
68+
<dialog class="z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent" ref="dialog">
69+
<div class="fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50" scroll-region>
70+
<transition
71+
enter-active-class="ease-out duration-300"
72+
enter-from-class="opacity-0"
73+
enter-to-class="opacity-100"
74+
leave-active-class="ease-in duration-200"
75+
leave-from-class="opacity-100"
76+
leave-to-class="opacity-0"
77+
>
78+
<div v-show="show" class="fixed inset-0 transform transition-all" @click="close">
79+
<div class="absolute inset-0 bg-gray-500 dark:bg-gray-900 opacity-75" />
80+
</div>
81+
</transition>
7582
76-
<transition
77-
enter-active-class="ease-out duration-300"
78-
enter-from-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
79-
enter-to-class="opacity-100 translate-y-0 sm:scale-100"
80-
leave-active-class="ease-in duration-200"
81-
leave-from-class="opacity-100 translate-y-0 sm:scale-100"
82-
leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
83-
>
84-
<div v-show="show" class="mb-6 bg-white dark:bg-gray-800 rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto" :class="maxWidthClass">
85-
<slot v-if="show" />
86-
</div>
87-
</transition>
88-
</div>
89-
</transition>
90-
</teleport>
83+
<transition
84+
enter-active-class="ease-out duration-300"
85+
enter-from-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
86+
enter-to-class="opacity-100 translate-y-0 sm:scale-100"
87+
leave-active-class="ease-in duration-200"
88+
leave-from-class="opacity-100 translate-y-0 sm:scale-100"
89+
leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
90+
>
91+
<div v-show="show" class="mb-6 bg-white dark:bg-gray-800 rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto" :class="maxWidthClass">
92+
<slot v-if="showSlot"/>
93+
</div>
94+
</transition>
95+
</div>
96+
</dialog>
9197
</template>

stubs/inertia/resources/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import '../css/app.css';
44
import { createApp, h } from 'vue';
55
import { createInertiaApp } from '@inertiajs/vue3';
66
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
7-
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
7+
import { ZiggyVue } from '../../vendor/tightenco/ziggy';
88

99
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
1010

stubs/inertia/resources/js/ssr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { renderToString } from '@vue/server-renderer';
33
import { createInertiaApp } from '@inertiajs/vue3';
44
import createServer from '@inertiajs/vue3/server';
55
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
6-
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
6+
import { ZiggyVue } from '../../vendor/tightenco/ziggy';
77

88
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
99

0 commit comments

Comments
 (0)