evc_rails 0.1.4 → 0.2.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: e15aa81852a8394bcc2a904cff923f3d5a5f588c618a2c0c6112f33203b0bd2c
4
- data.tar.gz: cdd1c962213f4c2a6593a522ac2aee9cc793858f4759c218242169a26fd40ace
3
+ metadata.gz: 1595c9c520d1639384e46e39fce8f611edbe3b27707a9f99ab412bb25a1741f0
4
+ data.tar.gz: 23ec6c266ec28a617b0d39d255f33fd5cff58c3db6461dd4382237b8d1989ef2
5
5
  SHA512:
6
- metadata.gz: 91a5a791151b6e2290dc3a20a8e95980a0821bf2526314a3b07724e85dda06f11a6149bfd9d808eb4af9e67da90d80616ddb9fa799d2c61ebc0e908e4cb627ce
7
- data.tar.gz: 0bc11c9d4026d5357b5d86089884eff7d30bf82a66823ec164aa3600cbf2ca6774c835c18175a132225acd9204cd95879f76a5698fbc80e355a46ba1ac771e85
6
+ metadata.gz: 78e5db590a2dd0b84df663fc836b51c24156bf6f5af40d278f8a5a9ec2cd89aa9ddf1fc83a957613ecc980ebfd54e2fa4d84c33e48f910d2c48514d0869789b7
7
+ data.tar.gz: c2765e0f368bce11454d9bf95461739a62ef0b89a1d1940c6e069f305499a20e4aeba6dabb4bd017ebc4f1bbefbd60294e0f8ecf53c24e377662a04d16e21cce
data/README.md CHANGED
@@ -166,12 +166,12 @@ end
166
166
 
167
167
  ```erb
168
168
  <Card>
169
- <Card::Header>
169
+ <WithHeader>
170
170
  <h1>Welcome</h1>
171
- </Card::Header>
172
- <Card::Body>
171
+ </WithHeader>
172
+ <WithBody>
173
173
  <p>This is the body content.</p>
174
- </Card::Body>
174
+ </WithBody>
175
175
  </Card>
176
176
  ```
177
177
 
@@ -199,9 +199,9 @@ end
199
199
 
200
200
  ```erb
201
201
  <List>
202
- <List::Item>Item 1</List::Item>
203
- <List::Item>Item 2</List::Item>
204
- <List::Item>Item 3</List::Item>
202
+ <WithItem>Item 1</WithItem>
203
+ <WithItem>Item 2</WithItem>
204
+ <WithItem>Item 3</WithItem>
205
205
  </List>
206
206
  ```
207
207
 
@@ -215,6 +215,33 @@ Becomes:
215
215
  <% end %>
216
216
  ```
217
217
 
218
+ #### Complex Slot Examples
219
+
220
+ ```erb
221
+ <Navigation>
222
+ <WithLink href={learning_path} text="Learning Path" />
223
+ <WithLink href={courses_path} text="All Courses" />
224
+ <WithLink text="Reports">
225
+ <WithSublink href={reports_users_path} text="Users" />
226
+ <WithSublink href={reports_activity_path} text="Activity" />
227
+ </WithLink>
228
+ <WithFooter>
229
+ <div>Footer content</div>
230
+ </WithFooter>
231
+ </Navigation>
232
+ ```
233
+
234
+ #### Backward Compatibility
235
+
236
+ The old `Component::slotname` syntax is still supported for backward compatibility:
237
+
238
+ ```erb
239
+ <Card>
240
+ <Card::header>Title</Card::header>
241
+ <Card::body>Content</Card::body>
242
+ </Card>
243
+ ```
244
+
218
245
  ### Complex Nesting
219
246
 
220
247
  ```erb
@@ -109,14 +109,23 @@ module EvcRails
109
109
  # Add content before the tag
110
110
  result << source[pos...match.begin(0)] if pos < match.begin(0)
111
111
 
112
- # Determine if this is a slot (e.g., Card::Header inside Card)
112
+ # Determine if this is a slot (e.g., WithHeader, WithPost, or Card::Header inside Card)
113
113
  parent = stack.last
114
114
  is_slot = false
115
115
  slot_name = nil
116
116
  slot_parent = nil
117
117
  if parent
118
118
  parent_tag = parent[0]
119
- if tag_name.start_with?("#{parent_tag}::")
119
+
120
+ # Check for WithSlotName syntax (e.g., WithHeader, WithPost)
121
+ if tag_name.start_with?("With")
122
+ is_slot = true
123
+ slot_name = tag_name[4..-1].downcase # Remove "With" prefix and convert to lowercase
124
+ slot_parent = parent_tag
125
+ # Mark parent as having a slot
126
+ parent[6] = true
127
+ # Check for Component::slotname syntax (backward compatibility)
128
+ elsif tag_name.start_with?("#{parent_tag}::")
120
129
  is_slot = true
121
130
  slot_name = tag_name.split("::").last.downcase
122
131
  slot_parent = parent_tag
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EvcRails
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evc_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - scttymn