ultimate_turbo_modal 2.0.0 → 2.0.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +12 -11
- data/VERSION +1 -1
- data/javascript/modal_controller.js +21 -0
- data/javascript/package-lock.json +1162 -0
- data/javascript/package.json +2 -1
- data/javascript/rollup.config.js +12 -1
- data/javascript/scripts/release-npm.sh +3 -5
- data/javascript/scripts/update-version.js +2 -2
- data/javascript/yarn.lock +110 -95
- data/lib/phlex/deferred_render_with_main_content.rb +1 -1
- data/lib/ultimate_turbo_modal/base.rb +29 -22
- data/script/build_and_release.sh +34 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb5a2d990486959d808b557642c17ada12d887416c4158d42550e9655dbe6b2f
|
4
|
+
data.tar.gz: dc3ee5b170cd735bc87a0a67a693a9a68c36c8b9cc9bde371a2a7bca0c512744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5474e9849437b9e97496ba1af522d449c7c3dc26cda3e296c603acc3356f53c1ef24527cb96ecbd42e9713553940d1dd54890297fb9fa2d98f62763b39b1424e
|
7
|
+
data.tar.gz: af196848be428193650a240b3ad78512b175cf294f76821fb279546630ecbcb0d0bb3029e97d538382bc1c7c8c7005a3d03ed3354487321a0890132edf729c7e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [2.0.2] - 2025-04-11
|
2
|
+
|
3
|
+
- Warn if the NPM package and Ruby Gem versions don't match.
|
4
|
+
|
5
|
+
## [2.0.1] - 2025-04-11
|
6
|
+
|
7
|
+
- Properly call `raw` for Phlex 2, and `unsafe_raw` for Phlex 1. Thanks @cavenk!
|
8
|
+
|
1
9
|
## [2.0.0] - 2025-04-07 - Breaking changes!
|
2
10
|
|
3
11
|
- Much simplified installation with a Rails generator
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -22,17 +22,6 @@ $ bundle exec rails g ultimate_turbo_modal:install
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
### Upgrading from version 1.x
|
26
|
-
|
27
|
-
- Remove the two `setupUltimateTurboModal`-related lines from `app/javascript/controllers/index.js`:
|
28
|
-
|
29
|
-
- Remove anything UTMR-specific in `tailwind.config.js`.
|
30
|
-
|
31
|
-
- Remove the optional Idiomorph tweaks:
|
32
|
-
- `<script src="https://unpkg.com/idiomorph"></script>` from your HTML
|
33
|
-
- `addEventListener("turbo:before-frame-render", (event) => {...` from `application.js`
|
34
|
-
- Update the gem to the newest version and follow the installation instructions above.
|
35
|
-
|
36
25
|
## Features and capabilities
|
37
26
|
|
38
27
|
- Extremely easy to use
|
@@ -163,6 +152,18 @@ You can set a custom title and footer by passing a block. For example
|
|
163
152
|
|
164
153
|
|
165
154
|
|
155
|
+
|
156
|
+
## Upgrading from version 1.x
|
157
|
+
|
158
|
+
- Remove the two `setupUltimateTurboModal`-related lines from `app/javascript/controllers/index.js`:
|
159
|
+
|
160
|
+
- Remove anything UTMR-specific in `tailwind.config.js`.
|
161
|
+
|
162
|
+
- Remove the optional Idiomorph tweaks:
|
163
|
+
- `<script src="https://unpkg.com/idiomorph"></script>` from your HTML
|
164
|
+
- `addEventListener("turbo:before-frame-render", (event) => {...` from `application.js`
|
165
|
+
- Update the gem to the newest version and follow the installation instructions above.
|
166
|
+
|
166
167
|
## Thanks
|
167
168
|
|
168
169
|
Thanks to [@joeldrapper](https://github.com/joeldrapper) and [@konnorrogers](https://github.com/KonnorRogers) for all the help!
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.2
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import { Controller } from '@hotwired/stimulus';
|
2
2
|
import { enter, leave } from 'el-transition';
|
3
3
|
|
4
|
+
// This placeholder will be replaced by rollup
|
5
|
+
const PACKAGE_VERSION = '__PACKAGE_VERSION__';
|
6
|
+
|
4
7
|
export default class extends Controller {
|
5
8
|
static targets = ["container", "content"]
|
6
9
|
static values = {
|
@@ -10,6 +13,9 @@ export default class extends Controller {
|
|
10
13
|
|
11
14
|
connect() {
|
12
15
|
let _this = this;
|
16
|
+
|
17
|
+
this.#checkVersions();
|
18
|
+
|
13
19
|
this.showModal();
|
14
20
|
|
15
21
|
this.turboFrame = this.element.closest('turbo-frame');
|
@@ -105,4 +111,19 @@ export default class extends Controller {
|
|
105
111
|
#resetHistoryAdvanced() {
|
106
112
|
document.body.removeAttribute("data-turbo-modal-history-advanced");
|
107
113
|
}
|
114
|
+
|
115
|
+
#checkVersions() {
|
116
|
+
const gemVersion = this.element.dataset.utmrVersion;
|
117
|
+
|
118
|
+
if (!gemVersion) {
|
119
|
+
// If the attribute isn't set (e.g., in production), skip the check.
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
|
123
|
+
if (gemVersion !== PACKAGE_VERSION) {
|
124
|
+
console.warn(
|
125
|
+
`[UltimateTurboModal] Version Mismatch!\n\nGem Version: ${gemVersion}\nJS Version: ${PACKAGE_VERSION}\n\nPlease ensure both the 'ultimate_turbo_modal' gem and the 'ultimate-turbo-modal' npm package are updated to the same version.\nElement:`, this.element
|
126
|
+
);
|
127
|
+
}
|
128
|
+
}
|
108
129
|
}
|