vident-phlex 0.13.0 → 0.14.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d2eb7fd9d6cba8eb697bc9130549cad5d556319d4a6508028acd427cc201e00
4
- data.tar.gz: 579a7b1f85faa6b7b454250597af08c94c98bd4bee60d175cd519da73fe341cd
3
+ metadata.gz: aa0502ec2809b770cd71a170844ac6e7223f3307f2bacc0603bb0d39995141d5
4
+ data.tar.gz: d99fce5bab3840865e8ce3410ee07c63d07759d5c29883cb784d181cce3530ee
5
5
  SHA512:
6
- metadata.gz: cc7d27b86eb3aa73eb473de3a8c3e3f1f71320decf095e1d32db52e94bbbe07b5116e9a7db56b2a658e15408d8398e01d5c30fe9a5516eb0c891bccfdebde5b6
7
- data.tar.gz: cc9ec485603603263de00081bccddf52f1770e200dc7434b7ed4eabb70cbf1383bf10e5a2fd2b732b6fd109755a17112e9272788a0442f73bc2d6e72c75d1c46
6
+ metadata.gz: 0511ba57c147f702a898e564b532a46c11c33d3e998883cf7037b7f0c87e66843a156d296e6f4aea3c52d1df048f2ab350b7ae31109fd1e3bf4a50f1283fc63b
7
+ data.tar.gz: 608c330eb0014aab4f4fa4287cc7c69e7c089cd74ccbcc92bc1251bd77522ea1459d51f9d2f0fc0c833487ad0285d66624b890295dc3b5f2ef5f74a104359f6c
data/CHANGELOG.md CHANGED
@@ -5,8 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  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
+ ## [0.14.0] - 2025-09-17
8
9
 
9
- ## [Unreleased]
10
+ ## Breaking
11
+
12
+ Drop support for `better_html`
13
+
14
+ ## [0.13.0] - 2024-04-07
15
+
16
+ ### Breaking
17
+
18
+ - `data_maps` has been renamed to `values` and support has been added for the Stimulus 2+ Values API.
19
+ - `root`/`parent_element` no longer takes options, to define attributes for it, you can use `root_element_attributes` or the view component helper `root_component_attributes`. This change means
20
+ that root elements can be instantiated outside of `render` which is useful if you refer to the instance in the components body block
10
21
 
11
22
  ### Added
12
23
 
data/README.md CHANGED
@@ -4,16 +4,21 @@ Vident is a collection of gems that provide a set of tools for building web appl
4
4
 
5
5
  ## Included Gems
6
6
 
7
+ The core gems:
8
+
7
9
  - `vident`: The core Vident library
8
- - `vident-better_html`: Better HTML integration for Vident
9
10
  - `vident-phlex`: Phlex integration for Vident
11
+ - `vident-view_component`: ViewComponent integration for Vident
12
+
13
+ Note that you can use both `Phlex` and `ViewComponent` in the same application if desired.
14
+
15
+ And then optional extra features:
16
+
10
17
  - `vident-tailwind`: Tailwind CSS integration for Vident
11
18
  - `vident-typed`: Type system for Vident components
12
19
  - `vident-typed-minitest`: Minitest integration for typed Vident components
13
20
  - `vident-typed-phlex`: Phlex integration for typed Vident components
14
21
  - `vident-typed-view_component`: ViewComponent integration for typed Vident
15
- - `vident-view_component`: ViewComponent integration for Vident
16
- - `vident-view_component-caching`: Caching support for Vident ViewComponents
17
22
 
18
23
  ## Directory Structure
19
24
 
@@ -24,12 +29,6 @@ vident/
24
29
  ├── lib/ # All gem code
25
30
  │ ├── vident.rb # Core entry point
26
31
  │ ├── vident-phlex.rb # Gem entry points
27
- │ ├── vident-better_html.rb
28
- │ ├── vident/ # Shared code
29
- │ ├── base.rb
30
- │ ├── phlex/ # Phlex integration
31
- │ ├── better_html/ # Better HTML integration
32
- │ └── ...
33
32
  ├── test/ # All tests
34
33
  │ ├── vident/ # Core tests
35
34
  │ ├── vident-phlex/ # Tests for each gem
@@ -98,172 +97,6 @@ The gems are available as open source under the terms of the [MIT License](LICEN
98
97
 
99
98
  # Component Documentation
100
99
 
101
- ## gem: vident-better_html
102
-
103
- # Vident::BetterHtml
104
- Short description and motivation.
105
-
106
- ### Usage
107
- How to use my plugin.
108
-
109
- ```ruby
110
- BetterHtml.config = BetterHtml::Config.new(YAML.load(File.read(".better-html.yml")))
111
-
112
- BetterHtml.configure do |config|
113
- config.template_exclusion_filter = proc { |filename| !filename.start_with?(Rails.root.to_s) }
114
- end
115
- # ViewComponent needs to do this hack to work in certain cases
116
- # see https://github.com/Shopify/better-html/pull/98
117
- class BetterHtml::HtmlAttributes
118
- alias_method :to_s_without_html_safe, :to_s
119
-
120
- def to_s
121
- to_s_without_html_safe.html_safe
122
- end
123
- end
124
- ```
125
-
126
- ### Installation
127
- Add this line to your application's Gemfile:
128
-
129
- ```ruby
130
- gem "vident-better_html"
131
- ```
132
-
133
- And then execute:
134
- ```bash
135
- $ bundle
136
- ```
137
-
138
- Or install it yourself as:
139
- ```bash
140
- $ gem install vident-better_html
141
- ```
142
-
143
- ---
144
-
145
- ## gem: vident-phlex
146
-
147
- # Vident::Phlex
148
-
149
- [Phlex](https://phlex.fun/) powered [Vident](https://github.com/stevegeek/vident) components.
150
-
151
- ```ruby
152
- class ApplicationComponent < ::Vident::Phlex::HTML
153
- end
154
- ```
155
-
156
- For more details see [vident](https://github.com/stevegeek/vident).
157
-
158
- ### Usage
159
- How to use my plugin.
160
-
161
- ### Installation
162
- Add this line to your application's Gemfile:
163
-
164
- ```ruby
165
- gem "vident-phlex"
166
- ```
167
-
168
- And then execute:
169
- ```bash
170
- $ bundle
171
- ```
172
-
173
- Or install it yourself as:
174
- ```bash
175
- $ gem install vident-phlex
176
- ```
177
-
178
- ---
179
-
180
- ## gem: vident-tailwind
181
-
182
- # Vident::Tailwind
183
- Short description and motivation.
184
-
185
- ### Usage
186
- How to use my plugin.
187
-
188
- ### Installation
189
- Add this line to your application's Gemfile:
190
-
191
- ```ruby
192
- gem "vident-tailwind"
193
- ```
194
-
195
- And then execute:
196
- ```bash
197
- $ bundle
198
- ```
199
-
200
- Or install it yourself as:
201
- ```bash
202
- $ gem install vident-tailwind
203
- ```
204
-
205
- ---
206
-
207
- ## gem: vident-typed-minitest
208
-
209
- # Vident::Typed::Minitest
210
- Short description and motivation.
211
-
212
- ### Usage
213
- How to use my plugin.
214
-
215
- ### Installation
216
- Add this line to your application's Gemfile:
217
-
218
- ```ruby
219
- gem "vident-typed-minitest"
220
- ```
221
-
222
- And then execute:
223
- ```bash
224
- $ bundle
225
- ```
226
-
227
- Or install it yourself as:
228
- ```bash
229
- $ gem install vident-typed-minitest
230
- ```
231
-
232
- ---
233
-
234
- ## gem: vident-typed-phlex
235
-
236
- # Vident::Typed::Phlex
237
-
238
- Adds typed attributes to Vident Phlex based components.
239
-
240
- ```ruby
241
- class ApplicationComponent < ::Vident::Typed::Phlex::HTML
242
- end
243
- ```
244
-
245
- For more details see [vident](https://github.com/stevegeek/vident).
246
-
247
- ### Usage
248
- How to use my plugin.
249
-
250
- ### Installation
251
- Add this line to your application's Gemfile:
252
-
253
- ```ruby
254
- gem "vident-typed-phlex"
255
- ```
256
-
257
- And then execute:
258
- ```bash
259
- $ bundle
260
- ```
261
-
262
- Or install it yourself as:
263
- ```bash
264
- $ gem install vident-typed-phlex
265
- ```
266
-
267
100
  ---
268
101
 
269
102
  ## gem: vident-typed-view_component
@@ -643,59 +476,6 @@ $ gem install vident-typed-view_component
643
476
 
644
477
  ---
645
478
 
646
- ## gem: vident-typed
647
-
648
- # Vident::Typed
649
- Short description and motivation.
650
-
651
- ### Usage
652
- How to use my plugin.
653
-
654
- ### Installation
655
- Add this line to your application's Gemfile:
656
-
657
- ```ruby
658
- gem "vident-typed"
659
- ```
660
-
661
- And then execute:
662
- ```bash
663
- $ bundle
664
- ```
665
-
666
- Or install it yourself as:
667
- ```bash
668
- $ gem install vident-typed
669
- ```
670
-
671
- ---
672
-
673
- ## gem: vident-view_component-caching
674
-
675
- # Vident::ViewComponent::Caching
676
- Short description and motivation.
677
-
678
- ### Usage
679
- How to use my plugin.
680
-
681
- ### Installation
682
- Add this line to your application's Gemfile:
683
-
684
- ```ruby
685
- gem "vident-view_component-caching"
686
- ```
687
-
688
- And then execute:
689
- ```bash
690
- $ bundle
691
- ```
692
-
693
- Or install it yourself as:
694
- ```bash
695
- $ gem install vident-view_component-caching
696
- ```
697
-
698
- ---
699
479
 
700
480
  ## gem: vident-view_component
701
481
 
@@ -863,4 +643,156 @@ $ bundle
863
643
  Or install it yourself as:
864
644
  ```bash
865
645
  $ gem install vident-view_component
866
- ```
646
+ ```
647
+
648
+ ## gem: vident-phlex
649
+
650
+ # Vident::Phlex
651
+
652
+ [Phlex](https://phlex.fun/) powered [Vident](https://github.com/stevegeek/vident) components.
653
+
654
+ ```ruby
655
+ class ApplicationComponent < ::Vident::Phlex::HTML
656
+ end
657
+ ```
658
+
659
+ For more details see [vident](https://github.com/stevegeek/vident).
660
+
661
+ ### Usage
662
+ How to use my plugin.
663
+
664
+ ### Installation
665
+ Add this line to your application's Gemfile:
666
+
667
+ ```ruby
668
+ gem "vident-phlex"
669
+ ```
670
+
671
+ And then execute:
672
+ ```bash
673
+ $ bundle
674
+ ```
675
+
676
+ Or install it yourself as:
677
+ ```bash
678
+ $ gem install vident-phlex
679
+ ```
680
+
681
+ ---
682
+
683
+ ## gem: vident-tailwind
684
+
685
+ # Vident::Tailwind
686
+ Short description and motivation.
687
+
688
+ ### Usage
689
+ How to use my plugin.
690
+
691
+ ### Installation
692
+ Add this line to your application's Gemfile:
693
+
694
+ ```ruby
695
+ gem "vident-tailwind"
696
+ ```
697
+
698
+ And then execute:
699
+ ```bash
700
+ $ bundle
701
+ ```
702
+
703
+ Or install it yourself as:
704
+ ```bash
705
+ $ gem install vident-tailwind
706
+ ```
707
+
708
+ ---
709
+
710
+ ## gem: vident-typed-minitest
711
+
712
+ # Vident::Typed::Minitest
713
+ Short description and motivation.
714
+
715
+ ### Usage
716
+ How to use my plugin.
717
+
718
+ ### Installation
719
+ Add this line to your application's Gemfile:
720
+
721
+ ```ruby
722
+ gem "vident-typed-minitest"
723
+ ```
724
+
725
+ And then execute:
726
+ ```bash
727
+ $ bundle
728
+ ```
729
+
730
+ Or install it yourself as:
731
+ ```bash
732
+ $ gem install vident-typed-minitest
733
+ ```
734
+
735
+ ---
736
+
737
+ ## gem: vident-typed-phlex
738
+
739
+ # Vident::Typed::Phlex
740
+
741
+ Adds typed attributes to Vident Phlex based components.
742
+
743
+ ```ruby
744
+ class ApplicationComponent < ::Vident::Typed::Phlex::HTML
745
+ end
746
+ ```
747
+
748
+ For more details see [vident](https://github.com/stevegeek/vident).
749
+
750
+ ### Usage
751
+ How to use my plugin.
752
+
753
+ ### Installation
754
+ Add this line to your application's Gemfile:
755
+
756
+ ```ruby
757
+ gem "vident-typed-phlex"
758
+ ```
759
+
760
+ And then execute:
761
+ ```bash
762
+ $ bundle
763
+ ```
764
+
765
+ Or install it yourself as:
766
+ ```bash
767
+ $ gem install vident-typed-phlex
768
+ ```
769
+
770
+ ---
771
+
772
+
773
+ ## gem: vident-typed
774
+
775
+ # Vident::Typed
776
+ Short description and motivation.
777
+
778
+ ### Usage
779
+ How to use my plugin.
780
+
781
+ ### Installation
782
+ Add this line to your application's Gemfile:
783
+
784
+ ```ruby
785
+ gem "vident-typed"
786
+ ```
787
+
788
+ And then execute:
789
+ ```bash
790
+ $ bundle
791
+ ```
792
+
793
+ Or install it yourself as:
794
+ ```bash
795
+ $ gem install vident-typed
796
+ ```
797
+
798
+ ---
@@ -5,14 +5,6 @@ module Vident
5
5
  class RootComponent < ::Phlex::HTML
6
6
  include ::Vident::RootComponent
7
7
 
8
- if Gem.loaded_specs.has_key? "better_html"
9
- begin
10
- include ::Vident::BetterHtml::RootComponent
11
- rescue
12
- raise "if `better_html`` is being used you must install `vident-better_html"
13
- end
14
- end
15
-
16
8
  STANDARD_ELEMENTS = [:a, :abbr, :address, :article, :aside, :b, :bdi, :bdo, :blockquote, :body, :button, :caption, :cite, :code, :colgroup, :data, :datalist, :dd, :del, :details, :dfn, :dialog, :div, :dl, :dt, :em, :fieldset, :figcaption, :figure, :footer, :form, :g, :h1, :h2, :h3, :h4, :h5, :h6, :head, :header, :hgroup, :html, :i, :iframe, :ins, :kbd, :label, :legend, :li, :main, :map, :mark, :menuitem, :meter, :nav, :noscript, :object, :ol, :optgroup, :option, :output, :p, :path, :picture, :pre, :progress, :q, :rp, :rt, :ruby, :s, :samp, :script, :section, :select, :slot, :small, :span, :strong, :style, :sub, :summary, :sup, :svg, :table, :tbody, :td, :template_tag, :textarea, :tfoot, :th, :thead, :time, :title, :tr, :u, :ul, :video, :wbr].freeze
17
9
  VOID_ELEMENTS = [:area, :br, :embed, :hr, :img, :input, :link, :meta, :param, :source, :track, :col].freeze
18
10
 
@@ -47,7 +39,7 @@ module Vident
47
39
  def generate_tag(tag_type, content, **options, &block)
48
40
  # FIXME: Content was generated by the block, we assume its safe but that might not be true!
49
41
  method_name = (tag_type == :template) ? :template_tag : tag_type
50
- block = proc { unsafe_raw content } if !block && content
42
+ block = proc { raw content.html_safe } if !block && content
51
43
  send(method_name, **options, &block)
52
44
  end
53
45
  end
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: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Ierodiaconou
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-07 00:00:00.000000000 Z
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: 0.13.0
58
+ version: 0.14.0
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: 0.13.0
65
+ version: 0.14.0
66
66
  - !ruby/object:Gem::Dependency
67
67
  name: phlex
68
68
  requirement: !ruby/object:Gem::Requirement
@@ -72,7 +72,7 @@ dependencies:
72
72
  version: 1.5.0
73
73
  - - "<"
74
74
  - !ruby/object:Gem::Version
75
- version: '2'
75
+ version: '3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  version: 1.5.0
83
83
  - - "<"
84
84
  - !ruby/object:Gem::Version
85
- version: '2'
85
+ version: '3'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: phlex-rails
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -92,7 +92,7 @@ dependencies:
92
92
  version: 0.8.1
93
93
  - - "<"
94
94
  - !ruby/object:Gem::Version
95
- version: '2'
95
+ version: '3'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
@@ -102,7 +102,7 @@ dependencies:
102
102
  version: 0.8.1
103
103
  - - "<"
104
104
  - !ruby/object:Gem::Version
105
- version: '2'
105
+ version: '3'
106
106
  description: Vident with Phlex
107
107
  email:
108
108
  - stevegeek@gmail.com
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.6.2
143
+ rubygems_version: 3.6.7
144
144
  specification_version: 4
145
145
  summary: Vident with Phlex
146
146
  test_files: []