phlex-rails 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b847ffd983ba4161668179eb395ccbfd50ee216892ffb7124bdacaa584a9e0a
4
- data.tar.gz: e34aa3c4e6053b913f09f325ce11e16e6152afed5fecd18857a3ee634a735034
3
+ metadata.gz: ae91b70fed7b9edbe9f7c617a05a88ce362c9e8a108185e80ffbf5e1e27b519f
4
+ data.tar.gz: 16277016b898e55e5fba68ff0163cc652e2505d4785a5e487800cd2ea1111fe5
5
5
  SHA512:
6
- metadata.gz: e955615cd2b7ac990742dd35028d524f74f8f05f0799ede53f793435344d1b3c7db6b99c87fb2f3fedef50f016f53d7f3cf32070ab7894be1b86c734b93cca76
7
- data.tar.gz: 675126fe1bc74b22ee7ec284f0048ca4051a4fb3ea863fe916c8c48c745ca1ea431ed84569fda5d6b9ce046a58fd67f3b11f3e78bab25f4496074fc7e55d8e8a
6
+ metadata.gz: 9f9a3961d6f6170a700844fe41230251cc31e4df5735beada75a13df1126fa058fab550b6608c1becf900f8a7f823f344f646231bafb1dba3d4e6e664a5d9282
7
+ data.tar.gz: a1a8e6e3bb03c9c609074cdd2dca2e254b88fe8c169858157d4cbb07fafaf1396f32d29a76a6edd136693f499de5da30939a92b5148467dc3fac1b9b654bd9b0
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.1
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+
6
+ ## [1.1.0] 2023-11-24
7
+
8
+ - Dropped dependency on `rails` and now only depends on `railties`
9
+ - Fix an out of order rendering issue when yielding from a partial rendered with a block delegated from a component’s content block
10
+ - Added `flash` helper adapter in `Phlex::Rails::Helpers::Flash`
11
+ - Removed experimental form component
12
+ - Updated `phlex` dependency to `~> 1.9`
13
+
5
14
  ## [1.0.0] 2023-04-19
6
15
 
7
16
  ### Added
@@ -22,4 +31,4 @@ All notable changes to this project will be documented in this file. The format
22
31
 
23
32
  ***
24
33
 
25
- Before this changelog was introduced, changes were logged in the [release notes](https://github.com/phlex-ruby/phlex/releases).
34
+ Before this changelog was introduced, changes were logged in the [release notes](https://github.com/phlex-ruby/phlex-rails/releases).
data/Gemfile CHANGED
@@ -14,3 +14,4 @@ gem "solargraph"
14
14
  gem "view_component"
15
15
  gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
16
16
  gem "yard"
17
+ gem "rails"
@@ -14,6 +14,7 @@ module Phlex::Rails
14
14
  :to_partial_path,
15
15
  :options,
16
16
  :id,
17
+ :is_a?,
17
18
  :field_helpers,
18
19
  :multipart=,
19
20
  :field_name,
@@ -465,6 +465,13 @@ module Phlex::Rails::Helpers
465
465
  define_output_helper :file_field_tag
466
466
  end
467
467
 
468
+ module Flash
469
+ extend Phlex::Rails::HelperMacros
470
+
471
+ # @!method flash(...)
472
+ define_value_helper :flash
473
+ end
474
+
468
475
  module FontPath
469
476
  extend Phlex::Rails::HelperMacros
470
477
 
@@ -23,7 +23,7 @@ module Phlex
23
23
  when Enumerable
24
24
  return super unless renderable.is_a?(ActiveRecord::Relation)
25
25
  else
26
- @_context.target << @_view_context.render(*args, **kwargs, &block)
26
+ @_context.target << @_view_context.render(*args, **kwargs) { capture(&block) }
27
27
  end
28
28
 
29
29
  nil
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlex
4
4
  module Rails
5
- VERSION = "1.0.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlex-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Drapper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
@@ -16,16 +16,16 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '1.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '1.9'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rails
28
+ name: railties
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -105,7 +105,6 @@ files:
105
105
  - lib/phlex/rails/buffered_label_builder.rb
106
106
  - lib/phlex/rails/buffered_radio_button_builder.rb
107
107
  - lib/phlex/rails/engine.rb
108
- - lib/phlex/rails/form.rb
109
108
  - lib/phlex/rails/helper_macros.rb
110
109
  - lib/phlex/rails/helpers.rb
111
110
  - lib/phlex/rails/helpers/routes.rb
@@ -144,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
143
  - !ruby/object:Gem::Version
145
144
  version: '0'
146
145
  requirements: []
147
- rubygems_version: 3.4.6
146
+ rubygems_version: 3.4.10
148
147
  signing_key:
149
148
  specification_version: 4
150
149
  summary: A Phlex adapter for Rails
@@ -1,68 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Phlex
4
- module Rails
5
- # @api private
6
- class Form < Phlex::HTML
7
- def initialize(model)
8
- @model = model
9
- end
10
-
11
- def self.input_field(method_name, type:)
12
- define_method method_name do |field, value: @model.attributes[field.to_s], **attributes|
13
- input(
14
- name: field_name(field),
15
- type: type,
16
- value: value,
17
- **attributes
18
- )
19
- end
20
- end
21
-
22
- def template(&block)
23
- form action: @url, method: @method do
24
- authenticity_token_field
25
- yield_content(&block)
26
- end
27
- end
28
-
29
- def authenticity_token_field
30
- input(
31
- name: "authenticity_token",
32
- type: "hidden",
33
- value: helpers.form_authenticity_token
34
- )
35
- end
36
-
37
- def submit(value)
38
- input(
39
- name: "commit",
40
- type: "submit",
41
- value: value
42
- )
43
- end
44
-
45
- def url
46
- helpers.url_for(@model)
47
- end
48
-
49
- def field_name(*field)
50
- helpers.field_name(ActiveModel::Naming.param_key(@model.class), *field)
51
- end
52
-
53
- input_field :url_field, type: "url"
54
- input_field :text_field, type: "text"
55
- input_field :date_field, type: "date"
56
- input_field :time_field, type: "time"
57
- input_field :week_field, type: "week"
58
- input_field :month_field, type: "month"
59
- input_field :email_field, type: "email"
60
- input_field :color_field, type: "color"
61
- input_field :hidden_field, type: "hidden"
62
- input_field :search_field, type: "search"
63
- input_field :password_field, type: "password"
64
- input_field :telephone_field, type: "tel"
65
- input_field :datetime_local_field, type: "datetime-local"
66
- end
67
- end
68
- end