glimmer-dsl-web 0.2.6 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +213 -12
- data/VERSION +1 -1
- data/glimmer-dsl-web.gemspec +30 -18
- data/lib/glimmer/dsl/web/a_expression.rb +17 -0
- data/lib/glimmer/dsl/web/dsl.rb +2 -0
- data/lib/glimmer/dsl/web/element_expression.rb +1 -1
- data/lib/glimmer/dsl/web/style_expression.rb +7 -2
- data/lib/glimmer/web/element_proxy.rb +2 -1
- data/lib/glimmer/web/formatting_element_proxy.rb +2 -1
- data/lib/glimmer-dsl-web/samples/hello/hello_content_data_binding.rb +2 -2
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/models/todo.rb +44 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/presenters/todo_presenter.rb +102 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/edit_todo_input.rb +55 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/new_todo_form.rb +30 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/new_todo_input.rb +41 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_filters.rb +123 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_input.rb +30 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_list.rb +88 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_list_item.rb +158 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_mvc_footer.rb +45 -0
- data/lib/glimmer-dsl-web/samples/regular/todo_mvc.rb +87 -0
- metadata +17 -5
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'glimmer-dsl-web'
|
2
|
+
|
3
|
+
require_relative 'todo_mvc/presenters/todo_presenter'
|
4
|
+
|
5
|
+
require_relative 'todo_mvc/views/new_todo_form'
|
6
|
+
require_relative 'todo_mvc/views/todo_list'
|
7
|
+
require_relative 'todo_mvc/views/todo_filters'
|
8
|
+
require_relative 'todo_mvc/views/todo_mvc_footer'
|
9
|
+
|
10
|
+
class TodoMvc
|
11
|
+
include Glimmer::Web::Component
|
12
|
+
|
13
|
+
before_render do
|
14
|
+
@presenter = TodoPresenter.new
|
15
|
+
end
|
16
|
+
|
17
|
+
after_render do
|
18
|
+
@presenter.setup_filter_routes
|
19
|
+
end
|
20
|
+
|
21
|
+
markup {
|
22
|
+
div(class: 'todomvc') {
|
23
|
+
section(class: 'todoapp') {
|
24
|
+
new_todo_form(presenter: @presenter)
|
25
|
+
|
26
|
+
todo_list(presenter: @presenter)
|
27
|
+
|
28
|
+
todo_filters(presenter: @presenter)
|
29
|
+
|
30
|
+
style {
|
31
|
+
todo_mvc_styles
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
todo_mvc_footer
|
36
|
+
|
37
|
+
on_remove do
|
38
|
+
@presenter.unsetup_filter_routes
|
39
|
+
end
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
def todo_mvc_styles
|
44
|
+
rule('body, button, html') {
|
45
|
+
margin '0'
|
46
|
+
padding '0'
|
47
|
+
}
|
48
|
+
|
49
|
+
rule('button') {
|
50
|
+
_webkit_font_smoothing 'antialiased'
|
51
|
+
_webkit_appearance 'none'
|
52
|
+
appearance 'none'
|
53
|
+
background 'none'
|
54
|
+
border '0'
|
55
|
+
color 'inherit'
|
56
|
+
font_family 'inherit'
|
57
|
+
font_size '100%'
|
58
|
+
font_weight 'inherit'
|
59
|
+
vertical_align 'baseline'
|
60
|
+
}
|
61
|
+
|
62
|
+
rule('.todoapp') {
|
63
|
+
background '#fff'
|
64
|
+
margin '130px 0 40px 0'
|
65
|
+
position 'relative'
|
66
|
+
box_shadow '0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1)'
|
67
|
+
}
|
68
|
+
|
69
|
+
media('screen and (-webkit-min-device-pixel-ratio:0)') {
|
70
|
+
rule('body') {
|
71
|
+
font "14px 'Helvetica Neue', Helvetica, Arial, sans-serif"
|
72
|
+
line_height '1.4em'
|
73
|
+
background '#f5f5f5'
|
74
|
+
color '#111111'
|
75
|
+
min_width '230px'
|
76
|
+
max_width '550px'
|
77
|
+
margin '0 auto'
|
78
|
+
_webkit_font_smoothing 'antialiased'
|
79
|
+
font_weight '300'
|
80
|
+
}
|
81
|
+
}
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
Document.ready? do
|
86
|
+
TodoMvc.render
|
87
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -134,14 +134,14 @@ dependencies:
|
|
134
134
|
requirements:
|
135
135
|
- - ">="
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
137
|
+
version: 1.0.0
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
144
|
+
version: 1.0.0
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: rake
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -281,9 +281,21 @@ files:
|
|
281
281
|
- lib/glimmer-dsl-web/samples/hello/hello_paragraph.rb
|
282
282
|
- lib/glimmer-dsl-web/samples/hello/hello_world.rb
|
283
283
|
- lib/glimmer-dsl-web/samples/regular/button_counter.rb
|
284
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc.rb
|
285
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/models/todo.rb
|
286
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/presenters/todo_presenter.rb
|
287
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/edit_todo_input.rb
|
288
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/new_todo_form.rb
|
289
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/new_todo_input.rb
|
290
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_filters.rb
|
291
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_input.rb
|
292
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_list.rb
|
293
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_list_item.rb
|
294
|
+
- lib/glimmer-dsl-web/samples/regular/todo_mvc/views/todo_mvc_footer.rb
|
284
295
|
- lib/glimmer-dsl-web/vendor/jquery.js
|
285
296
|
- lib/glimmer/config/opal_logger.rb
|
286
297
|
- lib/glimmer/data_binding/element_binding.rb
|
298
|
+
- lib/glimmer/dsl/web/a_expression.rb
|
287
299
|
- lib/glimmer/dsl/web/bind_expression.rb
|
288
300
|
- lib/glimmer/dsl/web/component_expression.rb
|
289
301
|
- lib/glimmer/dsl/web/content_data_binding_expression.rb
|
@@ -325,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
337
|
- !ruby/object:Gem::Version
|
326
338
|
version: '0'
|
327
339
|
requirements: []
|
328
|
-
rubygems_version: 3.
|
340
|
+
rubygems_version: 3.4.10
|
329
341
|
signing_key:
|
330
342
|
specification_version: 4
|
331
343
|
summary: Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework)
|