vident-phlex 1.0.0.alpha4 → 1.0.0.beta2
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 +20 -0
- data/README.md +6 -6
- data/lib/vident/phlex/html.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4466b6e94b193580be755d18af0d75b075b31bc1a5cfb96911aa04302ca7604
|
|
4
|
+
data.tar.gz: '038b7d3c7fd7633372cde14d268a671067edf2299a13805269e4a934d89a5202'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b92de4dca48fff939f1fe933d913ccc7f84f734593fa81072251d904e4171f70901ae1a4e13c41c7cd4635305715e9b879dbac31329390b422a0ea166fc16d12
|
|
7
|
+
data.tar.gz: ceea7b4cabf7aa0e2711ce9048b3f531ba71513ad2e0591c4135ee26e25037a9755a9712e66b43707125cab56b0f85ab78a16055a8802f1774862766165ae620
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [1.0.0.beta2] - 2026-04-16
|
|
10
|
+
|
|
11
|
+
### Breaking
|
|
12
|
+
|
|
13
|
+
- Renamed the `tag(...)` helper to `child_element(...)` (and the internal `Vident::TagHelper` module to `Vident::ChildElementHelper`). The old name shadowed Rails' own `tag(name, options)` positional API, which breaks Rails helpers like `hidden_field_tag` and `image_tag` when called inside vident components. Rename any `component.tag(...)` calls to `component.child_element(...)`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `stimulus_outlet` parser now accepts `(String, String)` arguments so string-keyed outlets produced by the DSL actually render.
|
|
18
|
+
|
|
19
|
+
## [1.0.0.beta1] - 2026-04-16
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- `tag(...)` singular stimulus kwargs (e.g. `stimulus_action: [:click, :foo]`) no longer splat `[event, handler]` tuples into two bare handlers (#19).
|
|
24
|
+
- `vident-view_component`'s `tag(...)` now emits void elements (`:input`, `:img`, `:br`, etc.) without a closing tag (#19).
|
|
25
|
+
- `vident-view_component`'s `tag(...)` without a block no longer renders the options hash as element content (#19).
|
|
26
|
+
- `stimulus_targets:` prop now accepts `Array` entries (e.g. `[[controller_path, :name]]`), matching `stimulus_actions:` (#20).
|
|
27
|
+
- `stimulus do ... outlets(...)` DSL now accepts a positional `Hash`, allowing string keys (e.g. stimulus identifiers containing `--`) that cannot be Ruby kwarg keys (#21).
|
|
28
|
+
|
|
9
29
|
## [1.0.0.alpha4] - 2025-12-12
|
|
10
30
|
|
|
11
31
|
- Update to `view_component` 4
|
data/README.md
CHANGED
|
@@ -93,7 +93,7 @@ class ButtonComponent < Vident::ViewComponent::Base
|
|
|
93
93
|
def call
|
|
94
94
|
root_element do |component|
|
|
95
95
|
# Wire up targets etc
|
|
96
|
-
component.
|
|
96
|
+
component.child_element(:span, stimulus_target: :status) do
|
|
97
97
|
@text
|
|
98
98
|
end
|
|
99
99
|
end
|
|
@@ -483,13 +483,13 @@ or you can use tag helpers to generate HTML with Stimulus attributes:
|
|
|
483
483
|
<% end %>
|
|
484
484
|
<%= content_tag(:span, class: "...", data: {**greeter.stimulus_target(:output)}) %>
|
|
485
485
|
|
|
486
|
-
<%# OR use the vident
|
|
486
|
+
<%# OR use the vident child_element helper %>
|
|
487
487
|
|
|
488
|
-
<%= greeter.
|
|
489
|
-
<%= greeter.
|
|
488
|
+
<%= greeter.child_element(:input, stimulus_target: :name, type: "text", class: "...") %>
|
|
489
|
+
<%= greeter.child_element(:button, stimulus_action: [:click, :greet], class: "...") do %>
|
|
490
490
|
<%= @cta %>
|
|
491
491
|
<% end %>
|
|
492
|
-
<%= greeter.
|
|
492
|
+
<%= greeter.child_element(:span, stimulus_target: :output, class: "...") %>
|
|
493
493
|
```
|
|
494
494
|
|
|
495
495
|
or in your Phlex templates:
|
|
@@ -498,7 +498,7 @@ or in your Phlex templates:
|
|
|
498
498
|
root_element do |greeter|
|
|
499
499
|
input(type: "text", data: {**greeter.stimulus_target(:name)}, class: %(...))
|
|
500
500
|
trigger_or_default(greeter)
|
|
501
|
-
greeter.
|
|
501
|
+
greeter.child_element(:span, stimulus_target: :output, class: "ml-4 #{greeter.class_list_for_stimulus_classes(:pre_click)}") do
|
|
502
502
|
plain %( ... )
|
|
503
503
|
end
|
|
504
504
|
end
|
data/lib/vident/phlex/html.rb
CHANGED
|
@@ -51,7 +51,7 @@ module Vident
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
def
|
|
54
|
+
def generate_child_element(tag_type, stimulus_data_attributes, options, &block)
|
|
55
55
|
options[:data] ||= {}
|
|
56
56
|
options[:data].merge!(stimulus_data_attributes)
|
|
57
57
|
check_valid_html_tag!(tag_type)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vident-phlex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.
|
|
4
|
+
version: 1.0.0.beta2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Ierodiaconou
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: railties
|
|
@@ -55,14 +55,14 @@ dependencies:
|
|
|
55
55
|
requirements:
|
|
56
56
|
- - "~>"
|
|
57
57
|
- !ruby/object:Gem::Version
|
|
58
|
-
version: 1.0.0.
|
|
58
|
+
version: 1.0.0.beta2
|
|
59
59
|
type: :runtime
|
|
60
60
|
prerelease: false
|
|
61
61
|
version_requirements: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
|
63
63
|
- - "~>"
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version: 1.0.0.
|
|
65
|
+
version: 1.0.0.beta2
|
|
66
66
|
- !ruby/object:Gem::Dependency
|
|
67
67
|
name: phlex
|
|
68
68
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
139
|
version: '0'
|
|
140
140
|
requirements: []
|
|
141
|
-
rubygems_version:
|
|
141
|
+
rubygems_version: 4.0.3
|
|
142
142
|
specification_version: 4
|
|
143
143
|
summary: Vident with Phlex
|
|
144
144
|
test_files: []
|