swal_rails 0.3.1.beta2 → 0.3.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 +49 -38
- data/gemfiles/rails_7_2.gemfile +3 -3
- data/gemfiles/rails_8_0.gemfile +3 -3
- data/gemfiles/rails_8_1.gemfile +3 -3
- data/gemfiles/rails_8_1_sprockets.gemfile +3 -3
- data/lib/generators/swal_rails/install/templates/initializer.rb +2 -1
- data/lib/swal_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9c8d829f1cd2f384c7a40bde0a723bd3a3fd04dccb6fea15b3bd6c543e2a3a7
|
|
4
|
+
data.tar.gz: d1b4801ab03a209a14051665b0d410c35971dcc2e0bb17ca16d72e724f446a0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a72b02157f593c15a9886e2e7c20ebcf6140048cd7f231742096f91215f28cb9273c50b9772405c8d611450d68b89715805f3015393ac15177e28cc981354f22
|
|
7
|
+
data.tar.gz: e4590aa66cbd7429b85b5d4a194911a3c1011144f96903293b40eb02ddc72ebb8153da0c0e0bb6fb0b41b327058bfb6a81e81108a66287845af7e4169fcfcf41
|
data/CHANGELOG.md
CHANGED
|
@@ -6,44 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
-
## [0.3.
|
|
9
|
+
## [0.3.2] - 2026-04-25
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:unprocessable_entity` for `flash.now` payloads) trigger `turbo:render`
|
|
15
|
-
but not `turbo:load`, so the `swal-flash` meta tag emitted in the new
|
|
16
|
-
body never reached the runtime. The existing `data-swal-consumed`
|
|
17
|
-
guard on the meta tag dedupes the double-fire on full navigations.
|
|
18
|
-
- Stacked-mode clones now render at SA2's standard toast width (360px,
|
|
19
|
-
capped at viewport width minus 2rem) instead of stretching to the full
|
|
20
|
-
page. The fix applies CSS to `#swal-rails-stack` mirroring SA2's
|
|
21
|
-
internal `body.swal2-toast-shown .swal2-container` rules — necessary
|
|
22
|
-
because the cloned popups live outside SA2's container hierarchy.
|
|
23
|
-
- Confirm `:turbo_override` / `:both` now writes to
|
|
24
|
-
`Turbo.config.forms.confirm` first (Turbo 8.1+) and only falls back to
|
|
25
|
-
the deprecated `Turbo.setConfirmMethod`. Silences the Turbo deprecation
|
|
26
|
-
warning logged on every page load.
|
|
27
|
-
|
|
28
|
-
### Changed
|
|
29
|
-
- `default_options` no longer ships with `focusConfirm: true` /
|
|
30
|
-
`returnFocus: true`. Both are already SA2's internal defaults, so
|
|
31
|
-
behavior is unchanged — but listing them explicitly made SA2 warn
|
|
32
|
-
("incompatible with toasts") on every toast fire. The generator
|
|
33
|
-
template is updated to match.
|
|
34
|
-
- `flash_map[:alert]` and `flash_map[:error]` now default to a toast
|
|
35
|
-
(top-end, 4s, error icon) instead of a blocking modal. This makes every
|
|
36
|
-
built-in flash key a toast out of the box — more consistent and more in
|
|
37
|
-
line with how Rails apps typically use `flash[:alert]`. Users who want
|
|
38
|
-
the old modal behavior can still opt in:
|
|
39
|
-
`config.flash_map[:alert] = { icon: "error", toast: false }`.
|
|
11
|
+
First stable release on top of the `0.3.1.beta1` + `0.3.1.beta2`
|
|
12
|
+
prereleases. End users upgrading from `0.3.0` should read the
|
|
13
|
+
consolidated entry below.
|
|
40
14
|
|
|
41
15
|
### Added
|
|
42
16
|
- `config.flash_array_mode` (`:sequential` default | `:stacked`) — how a
|
|
43
17
|
multi-entry flash payload is played. Sequential waits for each Swal to
|
|
44
|
-
close before firing the next
|
|
45
|
-
|
|
46
|
-
|
|
18
|
+
close before firing the next; stacked renders every toast in parallel in
|
|
19
|
+
a fixed top-right container with a configurable delay between each
|
|
20
|
+
appearance.
|
|
47
21
|
- `config.flash_stack_delay` (ms, default 500) — gap between stacked
|
|
48
22
|
toasts in `:stacked` mode.
|
|
49
23
|
- `swal_flash(key, messages, mode:, delay:, now:, **options)` helper,
|
|
@@ -53,15 +27,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
53
27
|
- Reserved meta-keys `_arrayMode` / `_stackDelay` on flash entry options,
|
|
54
28
|
stripped by the JS runtime before being passed to `Swal.fire`.
|
|
55
29
|
|
|
56
|
-
## [0.3.1.beta1] - 2026-04-21
|
|
57
|
-
|
|
58
30
|
### Changed
|
|
59
|
-
-
|
|
31
|
+
- `flash_map[:alert]` and `flash_map[:error]` now default to a toast
|
|
32
|
+
(top-end, 4s, error icon) instead of a blocking modal. Every built-in
|
|
33
|
+
flash key is a toast out of the box — more consistent and in line with
|
|
34
|
+
how Rails apps typically use `flash[:alert]`. The old modal behavior is
|
|
35
|
+
still opt-in: `config.flash_map[:alert] = { icon: "error", toast: false }`.
|
|
36
|
+
- `default_options` no longer ships with `focusConfirm: true` /
|
|
37
|
+
`returnFocus: true`. Both are SA2's internal defaults already, so
|
|
38
|
+
behavior is unchanged — but listing them explicitly made SA2 warn
|
|
39
|
+
("incompatible with toasts") on every toast fire. Generator template
|
|
40
|
+
updated to match.
|
|
41
|
+
- Generator initializer comment for `:turbo_override` now mentions
|
|
42
|
+
`Turbo.config.forms.confirm` (Turbo 8.1+) with a fallback to the legacy
|
|
43
|
+
`setConfirmMethod`.
|
|
60
44
|
- Release workflow now publishes to RubyGems via [Trusted Publishing](https://guides.rubygems.org/trusted-publishing/) (OIDC), no long-lived API key.
|
|
45
|
+
- First public release on [RubyGems.org](https://rubygems.org/gems/swal_rails). Prior `0.x` tags lived on GitHub Packages only.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
- Flash runtime also boots on `turbo:render`, not just `turbo:load`. Form
|
|
49
|
+
submissions that render in place (`render :index, status:
|
|
50
|
+
:unprocessable_entity` for `flash.now` payloads) trigger `turbo:render`
|
|
51
|
+
but not `turbo:load`, so the `swal-flash` meta tag emitted in the new
|
|
52
|
+
body never reached the runtime. The `data-swal-consumed` guard on the
|
|
53
|
+
meta tag dedupes the double-fire on full navigations.
|
|
54
|
+
- Stacked-mode clones render at SA2's standard toast width (360px, capped
|
|
55
|
+
at `calc(100vw - 2rem)`) instead of stretching to the full page. CSS on
|
|
56
|
+
`#swal-rails-stack` mirrors SA2's `body.swal2-toast-shown .swal2-container`
|
|
57
|
+
rules — necessary because the cloned popups live outside SA2's container
|
|
58
|
+
hierarchy.
|
|
59
|
+
- Confirm `:turbo_override` / `:both` writes to `Turbo.config.forms.confirm`
|
|
60
|
+
first (Turbo 8.1+) and falls back to the deprecated
|
|
61
|
+
`Turbo.setConfirmMethod`. Silences the Turbo deprecation warning.
|
|
61
62
|
|
|
62
63
|
### Security
|
|
63
|
-
- `.gitignore` hardened preventively against `.env`, `master.key`,
|
|
64
|
-
|
|
64
|
+
- `.gitignore` hardened preventively against `.env`, `master.key`,
|
|
65
|
+
`config/credentials/*.key`, `*.pem`, `*.key`.
|
|
66
|
+
- Gemspec pins `allowed_push_host` to `https://rubygems.org` as a safety
|
|
67
|
+
net against accidental push to other hosts.
|
|
68
|
+
|
|
69
|
+
## [0.3.1.beta2] - 2026-04-24
|
|
70
|
+
|
|
71
|
+
Prerelease snapshot — superseded by [0.3.2].
|
|
72
|
+
|
|
73
|
+
## [0.3.1.beta1] - 2026-04-21
|
|
74
|
+
|
|
75
|
+
Prerelease snapshot — superseded by [0.3.2].
|
|
65
76
|
|
|
66
77
|
## [0.3.0] - 2026-04-21
|
|
67
78
|
|
data/gemfiles/rails_7_2.gemfile
CHANGED
|
@@ -14,12 +14,12 @@ group :development, :test do
|
|
|
14
14
|
gem "appraisal", "~> 2.5"
|
|
15
15
|
gem "capybara", "~> 3.40"
|
|
16
16
|
gem "cuprite", "~> 0.15"
|
|
17
|
-
gem "puma", "~>
|
|
17
|
+
gem "puma", "~> 8.0"
|
|
18
18
|
gem "rspec", "~> 3.12"
|
|
19
|
-
gem "rspec-rails", "~>
|
|
19
|
+
gem "rspec-rails", "~> 8.0"
|
|
20
20
|
gem "rubocop", "~> 1.60", require: false
|
|
21
21
|
gem "rubocop-rspec", require: false
|
|
22
|
-
gem "sqlite3", "~>
|
|
22
|
+
gem "sqlite3", "~> 2.9"
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
gemspec path: "../"
|
data/gemfiles/rails_8_0.gemfile
CHANGED
|
@@ -14,12 +14,12 @@ group :development, :test do
|
|
|
14
14
|
gem "appraisal", "~> 2.5"
|
|
15
15
|
gem "capybara", "~> 3.40"
|
|
16
16
|
gem "cuprite", "~> 0.15"
|
|
17
|
-
gem "puma", "~>
|
|
17
|
+
gem "puma", "~> 8.0"
|
|
18
18
|
gem "rspec", "~> 3.12"
|
|
19
|
-
gem "rspec-rails", "~>
|
|
19
|
+
gem "rspec-rails", "~> 8.0"
|
|
20
20
|
gem "rubocop", "~> 1.60", require: false
|
|
21
21
|
gem "rubocop-rspec", require: false
|
|
22
|
-
gem "sqlite3", "~>
|
|
22
|
+
gem "sqlite3", "~> 2.9"
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
gemspec path: "../"
|
data/gemfiles/rails_8_1.gemfile
CHANGED
|
@@ -14,12 +14,12 @@ group :development, :test do
|
|
|
14
14
|
gem "appraisal", "~> 2.5"
|
|
15
15
|
gem "capybara", "~> 3.40"
|
|
16
16
|
gem "cuprite", "~> 0.15"
|
|
17
|
-
gem "puma", "~>
|
|
17
|
+
gem "puma", "~> 8.0"
|
|
18
18
|
gem "rspec", "~> 3.12"
|
|
19
|
-
gem "rspec-rails", "~>
|
|
19
|
+
gem "rspec-rails", "~> 8.0"
|
|
20
20
|
gem "rubocop", "~> 1.60", require: false
|
|
21
21
|
gem "rubocop-rspec", require: false
|
|
22
|
-
gem "sqlite3", "~>
|
|
22
|
+
gem "sqlite3", "~> 2.9"
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
gemspec path: "../"
|
|
@@ -14,12 +14,12 @@ group :development, :test do
|
|
|
14
14
|
gem "appraisal", "~> 2.5"
|
|
15
15
|
gem "capybara", "~> 3.40"
|
|
16
16
|
gem "cuprite", "~> 0.15"
|
|
17
|
-
gem "puma", "~>
|
|
17
|
+
gem "puma", "~> 8.0"
|
|
18
18
|
gem "rspec", "~> 3.12"
|
|
19
|
-
gem "rspec-rails", "~>
|
|
19
|
+
gem "rspec-rails", "~> 8.0"
|
|
20
20
|
gem "rubocop", "~> 1.60", require: false
|
|
21
21
|
gem "rubocop-rspec", require: false
|
|
22
|
-
gem "sqlite3", "~>
|
|
22
|
+
gem "sqlite3", "~> 2.9"
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
gemspec path: "../"
|
|
@@ -4,7 +4,8 @@ SwalRails.configure do |config|
|
|
|
4
4
|
# How confirmation modals are wired.
|
|
5
5
|
# :off — do nothing, use Swal manually
|
|
6
6
|
# :data_attribute — intercept clicks/submits on [data-swal-confirm] (default, non-intrusive)
|
|
7
|
-
# :turbo_override — replace Turbo.
|
|
7
|
+
# :turbo_override — replace Turbo.config.forms.confirm globally (Turbo 8.1+),
|
|
8
|
+
# falls back to legacy Turbo.setConfirmMethod on older Turbo
|
|
8
9
|
# :both — both mechanisms at once
|
|
9
10
|
config.confirm_mode = :<%= options[:confirm_mode] %>
|
|
10
11
|
|
data/lib/swal_rails/version.rb
CHANGED