atome 0.5.3.2 → 0.5.3.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +8 -3
- data/app_builder_helpers/Rakefile +9 -3
- data/exe/atome +11 -18
- data/lib/atome/atome.rb +29 -19
- data/lib/atome/extensions/atome.rb +23 -1
- data/lib/atome/extensions/matrix.rb +71 -63
- data/lib/atome/genesis/generators/atome.rb +149 -22
- data/lib/atome/genesis/generators/effect.rb +8 -3
- data/lib/atome/genesis/generators/event.rb +77 -34
- data/lib/atome/genesis/generators/geometry.rb +21 -5
- data/lib/atome/genesis/generators/identity.rb +110 -57
- data/lib/atome/genesis/generators/material.rb +74 -16
- data/lib/atome/genesis/generators/spatial.rb +8 -9
- data/lib/atome/genesis/generators/time.rb +1 -1
- data/lib/atome/genesis/generators/utility.rb +66 -39
- data/lib/atome/genesis/genesis.rb +7 -5
- data/lib/atome/genesis/sparkle.rb +8 -2
- data/lib/atome/helpers/essentials.rb +2 -6
- data/lib/atome/helpers/utilities.rb +15 -0
- data/lib/atome/kernel/universe.rb +2 -2
- data/lib/atome/presets/atome.rb +60 -61
- data/lib/atome/renderers/browser/event.rb +6 -3
- data/lib/atome/renderers/browser/geometry.rb +18 -10
- data/lib/atome/renderers/browser/helpers/browser_helper.rb +9 -0
- data/lib/atome/renderers/browser/helpers/color_helper.rb +4 -4
- data/lib/atome/renderers/browser/helpers/event_helper.rb +24 -12
- data/lib/atome/renderers/browser/helpers/shape_helper.rb +4 -4
- data/lib/atome/renderers/browser/helpers/text_helper.rb +4 -4
- data/lib/atome/renderers/browser/helpers/video_helper.rb +1 -1
- data/lib/atome/renderers/browser/helpers/web_helper.rb +4 -4
- data/lib/atome/renderers/browser/identity.rb +4 -0
- data/lib/atome/renderers/browser/material.rb +20 -1
- data/lib/atome/renderers/browser/spatial.rb +4 -0
- data/lib/atome/version.rb +1 -1
- data/sig/atome.rbs +12 -0
- data/sig/genesis.rbs +3 -0
- data/vendor/assets/application/index.rb +2 -0
- data/vendor/assets/src/index.html +1 -1
- data/vendor/assets/src/js/atome/atome.js +2 -1
- data/vendor/assets/src/medias/images/icons/email.svg +13 -0
- data/vendor/assets/src/medias/images/icons/mail_gray.svg +6 -0
- data/vendor/assets/src/medias/images/icons/mail_green.svg +6 -0
- data/vendor/assets/src/medias/images/icons/mail_orange.svg +6 -0
- data/vendor/assets/src/medias/images/icons/undo.svg +4 -0
- data/vendor/assets/src/medias/images/logos/Orange/Facebook.svg +8 -0
- data/vendor/assets/src/medias/images/logos/Orange/TikTok.svg +11 -0
- data/vendor/assets/src/medias/images/logos/Orange/Twitter.svg +8 -0
- data/vendor/assets/src/medias/images/logos/Orange/instagram.svg +8 -0
- data/vendor/assets/src/medias/images/logos/Orange/vimeo.svg +8 -0
- data/vendor/assets/src/medias/images/logos/Orange/youtube.svg +7 -0
- data/vendor/assets/src/medias/images/logos/gray/Facebook.svg +8 -0
- data/vendor/assets/src/medias/images/logos/gray/TikTok.svg +11 -0
- data/vendor/assets/src/medias/images/logos/gray/Twitter.svg +8 -0
- data/vendor/assets/src/medias/images/logos/gray/instagram.svg +8 -0
- data/vendor/assets/src/medias/images/logos/gray/vimeo.svg +8 -0
- data/vendor/assets/src/medias/images/logos/gray/youtube.svg +7 -0
- data/vendor/assets/src/medias/images/logos/gray/youtube2.svg +13 -0
- data/vendor/assets/src/medias/images/logos/vimeo.svg +17 -0
- data/vendor/assets/src/medias/rubies/examples/_table2.rb +108 -0
- data/vendor/assets/src/medias/rubies/examples/add.rb +1 -3
- data/vendor/assets/src/medias/rubies/examples/attached.rb +16 -0
- data/vendor/assets/src/medias/rubies/examples/class.rb +13 -0
- data/vendor/assets/src/medias/rubies/examples/code.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/depth.rb +6 -0
- data/vendor/assets/src/medias/rubies/examples/detached.rb +13 -0
- data/vendor/assets/src/medias/rubies/examples/matrix.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/opacity.rb +5 -0
- data/vendor/assets/src/medias/rubies/examples/over.rb +19 -0
- data/vendor/assets/src/medias/rubies/examples/read.rb +1 -0
- data/vendor/assets/src/medias/rubies/examples/schedule.rb +5 -2
- data/vendor/assets/src/medias/rubies/examples/text.rb +12 -11
- data/vendor/assets/src/medias/rubies/examples/time.rb +5 -1
- metadata +31 -10
- data/vendor/assets/src/medias/images/cache.svg +0 -10
- data/vendor/assets/src/medias/images/eyes.jpg +0 -0
- data/vendor/assets/src/medias/images/killer.jpg +0 -0
- data/vendor/assets/src/medias/images/logos/GitHub-Mark.eps +0 -7696
- data/vendor/assets/src/medias/images/poisson.jpg +0 -0
- data/vendor/assets/src/medias/images/sky.jpg +0 -0
@@ -1,12 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
generator.build_atome(:animation)
|
6
|
-
generator.build_atome(:color)
|
7
|
-
generator.build_sanitizer(:color) do |params|
|
3
|
+
new({ atome: :color })
|
4
|
+
new({ sanitizer: :color }) do |params|
|
8
5
|
parent_found = found_parents_and_renderers[:parent]
|
9
|
-
parent_found = [:
|
6
|
+
parent_found = [:black_matter] if parent_found == [:view]
|
10
7
|
render_found = found_parents_and_renderers[:renderers]
|
11
8
|
default_params = { renderers: render_found, id: "color_#{Universe.atomes.length}", type: :color,
|
12
9
|
attach: parent_found,
|
@@ -16,17 +13,32 @@ generator.build_sanitizer(:color) do |params|
|
|
16
13
|
atome[:color] = new_params
|
17
14
|
new_params
|
18
15
|
end
|
19
|
-
|
20
|
-
|
16
|
+
new({ atome: :image })
|
17
|
+
new({ sanitizer: :image }) do |params|
|
18
|
+
unless params.instance_of? Hash
|
19
|
+
# TODO : we have to convert all image to png or maintain a database with extension
|
20
|
+
params = { path: "./medias/images/#{params}" }
|
21
|
+
end
|
22
|
+
default_renderer = Essentials.default_params[:render_engines]
|
23
|
+
generated_id = params[:id] || "image_#{Universe.atomes.length}"
|
24
|
+
generated_render = params[:renderers] || default_renderer
|
25
|
+
generated_parents = params[:parents] || id.value
|
26
|
+
# TODO : the line below should get the value from default params Essentials
|
27
|
+
temp_default = { renderers: generated_render, id: generated_id, type: :image, parents: [generated_parents],
|
28
|
+
children: [], width: 99, height: 99, path: './medias/images/atome.svg' }
|
29
|
+
params = temp_default.merge(params)
|
30
|
+
params
|
31
|
+
end
|
32
|
+
new({ atome: :video })
|
33
|
+
new({ sanitizer: :video }) do |params|
|
21
34
|
parent_found = found_parents_and_renderers[:parent]
|
22
35
|
render_found = found_parents_and_renderers[:renderers]
|
23
36
|
default_params = { renderers: render_found, id: "video_#{Universe.atomes.length}", type: :video,
|
24
37
|
parents: parent_found }
|
25
38
|
default_params.merge!(params)
|
26
39
|
end
|
27
|
-
|
28
|
-
|
29
|
-
generator.build_sanitizer(:shadow) do |params|
|
40
|
+
new({ atome: :shadow })
|
41
|
+
new({ sanitizer: :shadow }) do |params|
|
30
42
|
parent_found = found_parents_and_renderers[:parent]
|
31
43
|
parent_found = [:user_view] if parent_found == [:view]
|
32
44
|
render_found = found_parents_and_renderers[:renderers]
|
@@ -35,20 +47,135 @@ generator.build_sanitizer(:shadow) do |params|
|
|
35
47
|
red: 0, green: 0, blue: 0, alpha: 1, blur: 3, left: 3, top: 3 }
|
36
48
|
default_params.merge!(params)
|
37
49
|
end
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
generator.build_atome(:audio)
|
44
|
-
generator.build_atome(:element)
|
45
|
-
generator.build_atome(:web)
|
46
|
-
generator.build_sanitizer(:element) do |params|
|
50
|
+
new({ atome: :shape })
|
51
|
+
new({ atome: :code })
|
52
|
+
new({ atome: :audio })
|
53
|
+
new({ atome: :element })
|
54
|
+
new({ sanitizer: :element })do |params|
|
47
55
|
parent_found = found_parents_and_renderers[:parent]
|
48
56
|
render_found = []
|
49
57
|
default_params = { renderers: render_found, id: "element_#{Universe.atomes.length}", type: :element,
|
50
|
-
parents: parent_found }
|
58
|
+
parents: parent_found, data: '' }
|
51
59
|
default_params.merge!(params)
|
52
60
|
end
|
61
|
+
new({ atome: :web })
|
62
|
+
new({ sanitizer: :web })do |params|
|
63
|
+
default_renderer = Essentials.default_params[:render_engines]
|
64
|
+
|
65
|
+
generated_id = params[:id] || "web_#{Universe.atomes.length}"
|
66
|
+
generated_render = params[:renderers] || default_renderer
|
67
|
+
generated_parents = params[:parents] || id.value
|
68
|
+
# TODO : the line below should get the value from default params Essentials
|
69
|
+
temp_default = { renderers: generated_render, id: generated_id, type: :web, parents: [generated_parents],
|
70
|
+
children: [], width: 120, height: 120, path: 'https://www.youtube.com/embed/usQDazZKWAk' }
|
71
|
+
params = temp_default.merge(params)
|
72
|
+
params
|
73
|
+
end
|
74
|
+
new({ atome: :collector })
|
75
|
+
new({ atome: :animation })
|
76
|
+
new({ sanitizer: :animation }) do |params|
|
77
|
+
default_renderer = Essentials.default_params[:render_engines]
|
78
|
+
atome_type = :animation
|
79
|
+
generated_render = params[:renderers] || default_renderer
|
80
|
+
generated_id = params[:id] || "#{atome_type}_#{Universe.atomes.length}"
|
81
|
+
generated_parents = params[:parents] || []
|
82
|
+
generated_children = params[:children] || []
|
83
|
+
params = atome_common(atome_type, generated_id, generated_render, generated_parents, generated_children, params)
|
84
|
+
params
|
85
|
+
end
|
86
|
+
new({ atome: :text })
|
87
|
+
new({ sanitizer: :text }) do |params|
|
88
|
+
params = { data: params } unless params.instance_of? Hash
|
89
|
+
default_renderer = Essentials.default_params[:render_engines]
|
90
|
+
atome_type = :text
|
91
|
+
generated_render = params[:renderers] || default_renderer
|
92
|
+
generated_id = params[:id] || "#{atome_type}_#{Universe.atomes.length}"
|
93
|
+
generated_parents = params[:parents] || [id.value]
|
94
|
+
generated_children = params[:children] || []
|
95
|
+
params = atome_common(atome_type, generated_id, generated_render, generated_parents, generated_children, params)
|
96
|
+
params
|
97
|
+
end
|
98
|
+
|
53
99
|
|
54
|
-
generator.
|
100
|
+
# generator = Genesis.generator
|
101
|
+
#
|
102
|
+
# generator.build_atome(:animation)
|
103
|
+
# generator.build_atome(:color)
|
104
|
+
# generator.build_sanitizer(:color) do |params|
|
105
|
+
# parent_found = found_parents_and_renderers[:parent]
|
106
|
+
# parent_found = [:black_matter] if parent_found == [:view]
|
107
|
+
# render_found = found_parents_and_renderers[:renderers]
|
108
|
+
# default_params = { renderers: render_found, id: "color_#{Universe.atomes.length}", type: :color,
|
109
|
+
# attach: parent_found,
|
110
|
+
# red: 0, green: 0, blue: 0, alpha: 1 }
|
111
|
+
# params = create_color_hash(params) unless params.instance_of? Hash
|
112
|
+
# new_params = default_params.merge!(params)
|
113
|
+
# atome[:color] = new_params
|
114
|
+
# new_params
|
115
|
+
# end
|
116
|
+
#
|
117
|
+
# generator.build_atome(:video)
|
118
|
+
# generator.build_sanitizer(:video) do |params|
|
119
|
+
# parent_found = found_parents_and_renderers[:parent]
|
120
|
+
# render_found = found_parents_and_renderers[:renderers]
|
121
|
+
# default_params = { renderers: render_found, id: "video_#{Universe.atomes.length}", type: :video,
|
122
|
+
# parents: parent_found }
|
123
|
+
# default_params.merge!(params)
|
124
|
+
# end
|
125
|
+
# generator.build_atome(:shadow)
|
126
|
+
# generator.build_sanitizer(:shadow) do |params|
|
127
|
+
# parent_found = found_parents_and_renderers[:parent]
|
128
|
+
# parent_found = [:user_view] if parent_found == [:view]
|
129
|
+
# render_found = found_parents_and_renderers[:renderers]
|
130
|
+
# default_params = { renderers: render_found, id: "shadow_#{Universe.atomes.length}", type: :shadow,
|
131
|
+
# attach: parent_found,
|
132
|
+
# red: 0, green: 0, blue: 0, alpha: 1, blur: 3, left: 3, top: 3 }
|
133
|
+
# default_params.merge!(params)
|
134
|
+
# end
|
135
|
+
# generator.build_atome(:shape)
|
136
|
+
# generator.build_atome(:text)
|
137
|
+
# generator.build_atome(:code)
|
138
|
+
# generator.build_atome(:audio)
|
139
|
+
# generator.build_atome(:element)
|
140
|
+
# generator.build_sanitizer(:element) do |params|
|
141
|
+
# parent_found = found_parents_and_renderers[:parent]
|
142
|
+
# render_found = []
|
143
|
+
# default_params = { renderers: render_found, id: "element_#{Universe.atomes.length}", type: :element,
|
144
|
+
# parents: parent_found, data: '' }
|
145
|
+
# default_params.merge!(params)
|
146
|
+
# end
|
147
|
+
# generator.build_atome(:collector)
|
148
|
+
# generator.build_atome(:web)
|
149
|
+
# generator.build_sanitizer(:web) do |params|
|
150
|
+
# default_renderer = Essentials.default_params[:render_engines]
|
151
|
+
#
|
152
|
+
# generated_id = params[:id] || "web_#{Universe.atomes.length}"
|
153
|
+
# generated_render = params[:renderers] || default_renderer
|
154
|
+
# generated_parents = params[:parents] || id.value
|
155
|
+
# # TODO : the line below should get the value from default params Essentials
|
156
|
+
# temp_default = { renderers: generated_render, id: generated_id, type: :web, parents: [generated_parents],
|
157
|
+
# children: [], width: 120, height: 120, path: 'https://www.youtube.com/embed/usQDazZKWAk' }
|
158
|
+
# params = temp_default.merge(params)
|
159
|
+
# params
|
160
|
+
# end
|
161
|
+
# generator.build_sanitizer(:animation) do |params|
|
162
|
+
# default_renderer = Essentials.default_params[:render_engines]
|
163
|
+
# atome_type = :animation
|
164
|
+
# generated_render = params[:renderers] || default_renderer
|
165
|
+
# generated_id = params[:id] || "#{atome_type}_#{Universe.atomes.length}"
|
166
|
+
# generated_parents = params[:parents] || []
|
167
|
+
# generated_children = params[:children] || []
|
168
|
+
# params = atome_common(atome_type, generated_id, generated_render, generated_parents, generated_children, params)
|
169
|
+
# params
|
170
|
+
# end
|
171
|
+
# generator.build_sanitizer(:text) do |params|
|
172
|
+
# params = { data: params } unless params.instance_of? Hash
|
173
|
+
# default_renderer = Essentials.default_params[:render_engines]
|
174
|
+
# atome_type = :text
|
175
|
+
# generated_render = params[:renderers] || default_renderer
|
176
|
+
# generated_id = params[:id] || "#{atome_type}_#{Universe.atomes.length}"
|
177
|
+
# generated_parents = params[:parents] || [id.value]
|
178
|
+
# generated_children = params[:children] || []
|
179
|
+
# params = atome_common(atome_type, generated_id, generated_render, generated_parents, generated_children, params)
|
180
|
+
# params
|
181
|
+
# end
|
@@ -1,6 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
generator = Genesis.generator
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
new({ particle: :smooth })
|
5
|
+
new({ particle: :blur })
|
6
|
+
|
7
|
+
|
8
|
+
# generator = Genesis.generator
|
9
|
+
#
|
10
|
+
# generator.build_particle(:smooth)
|
11
|
+
# generator.build_particle(:blur)
|
@@ -1,50 +1,93 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
generator = Genesis.generator
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
generator.build_particle(:play) do
|
4
|
+
|
5
|
+
new({particle: :touch })
|
6
|
+
new({particle: :play }) do
|
9
7
|
@atome[:pause] = :false
|
10
8
|
end
|
11
|
-
|
12
|
-
|
9
|
+
new({particle: :time })
|
10
|
+
new({particle: :pause }) do
|
13
11
|
@atome[:play] = :false
|
14
12
|
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# drag
|
21
|
-
generator.build_particle(:drag)
|
22
|
-
generator.build_sanitizer(:drag) do |params|
|
13
|
+
new({particle: :on })
|
14
|
+
new({particle: :fullscreen })
|
15
|
+
new({particle: :mute })
|
16
|
+
new({particle: :drag })
|
17
|
+
new({ sanitizer: :drag }) do |params|
|
23
18
|
params = { move: true } if params == true
|
24
19
|
params
|
25
20
|
end
|
26
|
-
|
27
|
-
generator.build_particle(:sort) do |_value, sort_proc|
|
21
|
+
new({particle: :sort }) do |_value, sort_proc|
|
28
22
|
@sort_proc = sort_proc
|
29
23
|
end
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
generator.build_particle(:start)
|
34
|
-
generator.build_option(:pre_render_start) do |_value, user_proc|
|
24
|
+
new({particle: :targets })
|
25
|
+
new({particle: :start })
|
26
|
+
new({pre: :start }) do |_value, user_proc|
|
35
27
|
@animation_start_proc = user_proc
|
36
28
|
end
|
37
|
-
|
38
|
-
|
29
|
+
new({particle: :stop })
|
30
|
+
new({pre: :stop }) do |_value, user_proc|
|
39
31
|
@animation_stop_proc = user_proc
|
40
32
|
end
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
33
|
+
new({particle: :begin })
|
34
|
+
new({particle: :end })
|
35
|
+
new({particle: :duration })
|
36
|
+
new({particle: :mass })
|
37
|
+
new({particle: :damping })
|
38
|
+
new({particle: :stiffness })
|
39
|
+
new({particle: :velocity })
|
40
|
+
new({particle: :repeat })
|
41
|
+
new({particle: :ease })
|
42
|
+
new({particle: :unbind })
|
43
|
+
new({particle: :over })
|
44
|
+
|
45
|
+
|
46
|
+
# generator = Genesis.generator
|
47
|
+
#
|
48
|
+
# # touch
|
49
|
+
# generator.build_particle(:touch)
|
50
|
+
# # video
|
51
|
+
# generator.build_particle(:play) do
|
52
|
+
# @atome[:pause] = :false
|
53
|
+
# end
|
54
|
+
# generator.build_particle(:time)
|
55
|
+
# generator.build_particle(:pause) do
|
56
|
+
# @atome[:play] = :false
|
57
|
+
# end
|
58
|
+
# generator.build_particle(:on)
|
59
|
+
# generator.build_particle(:fullscreen)
|
60
|
+
# generator.build_particle(:mute)
|
61
|
+
# # TODO : add the at event to ny particle : (width, left, ...) maybe use monitor particle
|
62
|
+
# # generator.build_particle(:at)
|
63
|
+
# # drag
|
64
|
+
# generator.build_particle(:drag)
|
65
|
+
# generator.build_sanitizer(:drag) do |params|
|
66
|
+
# params = { move: true } if params == true
|
67
|
+
# params
|
68
|
+
# end
|
69
|
+
# # sort
|
70
|
+
# generator.build_particle(:sort) do |_value, sort_proc|
|
71
|
+
# @sort_proc = sort_proc
|
72
|
+
# end
|
73
|
+
# # animation
|
74
|
+
# generator.build_particle(:targets)
|
75
|
+
# generator.build_particle(:start)
|
76
|
+
# generator.build_option(:pre_render_start) do |_value, user_proc|
|
77
|
+
# @animation_start_proc = user_proc
|
78
|
+
# end
|
79
|
+
# generator.build_particle(:stop)
|
80
|
+
# generator.build_option(:pre_render_stop) do |_value, user_proc|
|
81
|
+
# @animation_stop_proc = user_proc
|
82
|
+
# end
|
83
|
+
# generator.build_particle(:begin)
|
84
|
+
# generator.build_particle(:end)
|
85
|
+
# generator.build_particle(:duration)
|
86
|
+
# generator.build_particle(:mass)
|
87
|
+
# generator.build_particle(:damping)
|
88
|
+
# generator.build_particle(:stiffness)
|
89
|
+
# generator.build_particle(:velocity)
|
90
|
+
# generator.build_particle(:repeat)
|
91
|
+
# generator.build_particle(:ease)
|
92
|
+
# generator.build_particle(:unbind)
|
93
|
+
# generator.build_particle(:over)
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
generator.build_particle(:height)
|
7
|
-
generator.build_particle(:size) do |params|
|
3
|
+
new({particle: :width })
|
4
|
+
new({particle: :height })
|
5
|
+
new({particle: :size }) do |params|
|
8
6
|
atome_width = atome[:width]
|
9
7
|
atome_height = atome[:height]
|
10
8
|
aspect_ratio = atome_width / atome_height
|
@@ -16,3 +14,21 @@ generator.build_particle(:size) do |params|
|
|
16
14
|
height(params)
|
17
15
|
end
|
18
16
|
end
|
17
|
+
|
18
|
+
|
19
|
+
# generator = Genesis.generator
|
20
|
+
#
|
21
|
+
# generator.build_particle(:width)
|
22
|
+
# generator.build_particle(:height)
|
23
|
+
# generator.build_particle(:size) do |params|
|
24
|
+
# atome_width = atome[:width]
|
25
|
+
# atome_height = atome[:height]
|
26
|
+
# aspect_ratio = atome_width / atome_height
|
27
|
+
# if atome_width > atome_height
|
28
|
+
# width(params)
|
29
|
+
# height(params / aspect_ratio)
|
30
|
+
# else
|
31
|
+
# width(params * aspect_ratio)
|
32
|
+
# height(params)
|
33
|
+
# end
|
34
|
+
# end
|
@@ -1,40 +1,48 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
generator.build_particle(:children)
|
8
|
-
generator.build_option(:pre_render_parents) do |parents_ids|
|
9
|
-
parents_ids.each do |parents_id|
|
10
|
-
parents_id = parents_id.value if parents_id.instance_of? Atome
|
11
|
-
parents_found = grab(parents_id)
|
12
|
-
family(parents_id)
|
13
|
-
parents_found.atome[:children] << atome[:id]
|
3
|
+
new({ particle: :attached })
|
4
|
+
new({ sanitizer: :attached }) do |params|
|
5
|
+
unless params.instance_of? Array
|
6
|
+
params = [params]
|
14
7
|
end
|
8
|
+
params
|
15
9
|
end
|
16
|
-
|
17
|
-
generator.build_option(:pre_render_children) do |children_ids|
|
10
|
+
new({ pre: :attached }) do |children_ids|
|
18
11
|
children_ids.each do |child_id|
|
19
12
|
child_id = child_id.value if child_id.instance_of? Atome
|
20
13
|
child_found = grab(child_id)
|
21
|
-
parents_found
|
14
|
+
parents_found = @atome[:id]
|
22
15
|
child_found.family(parents_found)
|
16
|
+
# parents_found.atome[:attach] = [] unless parents_found.atome[:attach]
|
17
|
+
child_found.atome[:attach] = [parents_found]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
new({ particle: :type })
|
21
|
+
new({ particle: :children })
|
22
|
+
new({ pre: :children }) do |children_ids|
|
23
|
+
children_ids.each do |child_id|
|
24
|
+
child_id = child_id.value if child_id.instance_of? Atome
|
25
|
+
child_found = grab(child_id)
|
26
|
+
parents_found = @atome[:id]
|
27
|
+
# FIXME : broadcast may malfunction because of the commented line below,
|
28
|
+
# FIXME suite : if uncomment object hierreachy is broken (cf Vie Project)
|
29
|
+
# child_found.family(parents_found)
|
23
30
|
child_found.atome[:parents] = [parents_found]
|
24
31
|
end
|
25
32
|
end
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
new({ particle: :parents })
|
34
|
+
new({ pre: :parents }) do |parents_ids|
|
35
|
+
parents_ids.each do |parents_id|
|
36
|
+
parents_id = parents_id.value if parents_id.instance_of? Atome
|
37
|
+
parents_found = grab(parents_id)
|
38
|
+
family(parents_id)
|
39
|
+
parents_found.atome[:children] << atome[:id]
|
40
|
+
end
|
34
41
|
end
|
35
|
-
|
36
|
-
|
37
|
-
|
42
|
+
new({ particle: :family })
|
43
|
+
new({ particle: :link })
|
44
|
+
new({ particle: :id })
|
45
|
+
new({ sanitizer: :id }) do |params|
|
38
46
|
if @atome[:id] != params
|
39
47
|
Universe.update_atome_id(params, self, @atome[:id])
|
40
48
|
else
|
@@ -42,15 +50,10 @@ generator.build_sanitizer(:id) do |params|
|
|
42
50
|
end
|
43
51
|
params
|
44
52
|
end
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
generator.build_particle(:attach)
|
51
|
-
generator.build_particle(:attached)
|
52
|
-
|
53
|
-
generator.build_option(:pre_render_attach) do |parents_ids|
|
53
|
+
new({ particle: :name })
|
54
|
+
new({ particle: :active })
|
55
|
+
new({ particle: :attach })
|
56
|
+
new({ pre: :attach }) do |parents_ids|
|
54
57
|
parents_ids.each do |parents_id|
|
55
58
|
parents_id = parents_id.value if parents_id.instance_of? Atome
|
56
59
|
parents_found = grab(parents_id)
|
@@ -59,31 +62,81 @@ generator.build_option(:pre_render_attach) do |parents_ids|
|
|
59
62
|
parents_found.atome[:attached] << atome[:id]
|
60
63
|
end
|
61
64
|
end
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
# parents_found.atome[:attach] = [] unless parents_found.atome[:attach]
|
70
|
-
child_found.atome[:attach] = [parents_found]
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
generator.build_particle(:intricate, {type: :array })
|
75
|
-
|
76
|
-
|
77
|
-
generator.build_particle(:clones) do |clones_found|
|
78
|
-
clones_found.each_with_index do |clone_found, index|
|
79
|
-
particles_intricated= clone_found[:intricate] ||= []
|
80
|
-
clone_id="#{particles[:id]}_clone_#{index}"
|
81
|
-
original_id=atome[:id]
|
65
|
+
new({ particle: :detached })
|
66
|
+
new({ particle: :intricate, type: :array })
|
67
|
+
new({ particle: :clones }) do |clones_found|
|
68
|
+
clones_found.each_with_index do |clone_found, index|
|
69
|
+
particles_intricated = clone_found[:intricate] ||= []
|
70
|
+
clone_id = "#{particles[:id]}_clone_#{index}"
|
71
|
+
original_id = atome[:id]
|
82
72
|
clone_found[:id] = clone_id
|
83
73
|
clone_found = particles.merge(clone_found)
|
84
|
-
cloned_atome=Atome.new({ clone: clone_found })
|
85
|
-
cloned_atome.monitor({ atomes: [original_id], particles: particles_intricated}) do |_atome, particle, value|
|
86
|
-
cloned_atome.send(particle,value)
|
74
|
+
cloned_atome = Atome.new({ clone: clone_found })
|
75
|
+
cloned_atome.monitor({ atomes: [original_id], particles: particles_intricated }) do |_atome, particle, value|
|
76
|
+
cloned_atome.send(particle, value)
|
87
77
|
end
|
88
78
|
end
|
89
79
|
end
|
80
|
+
|
81
|
+
# generator = Genesis.generator
|
82
|
+
#
|
83
|
+
# generator.build_particle(:type)
|
84
|
+
# generator.build_particle(:parents)
|
85
|
+
# generator.build_particle(:children)
|
86
|
+
# generator.build_option(:pre_render_parents) do |parents_ids|
|
87
|
+
# parents_ids.each do |parents_id|
|
88
|
+
# parents_id = parents_id.value if parents_id.instance_of? Atome
|
89
|
+
# parents_found = grab(parents_id)
|
90
|
+
# family(parents_id)
|
91
|
+
# parents_found.atome[:children] << atome[:id]
|
92
|
+
# end
|
93
|
+
# end
|
94
|
+
# generator.build_option(:pre_render_children) do |children_ids|
|
95
|
+
# children_ids.each do |child_id|
|
96
|
+
# child_id = child_id.value if child_id.instance_of? Atome
|
97
|
+
# child_found = grab(child_id)
|
98
|
+
# parents_found = @atome[:id]
|
99
|
+
# # FIXME : broadcast may malfunction because of the commented line below,
|
100
|
+
# # FIXME suite : if uncomment object hierreachy is broken (cf Vie Project)
|
101
|
+
# # child_found.family(parents_found)
|
102
|
+
# child_found.atome[:parents] = [parents_found]
|
103
|
+
# end
|
104
|
+
# end
|
105
|
+
# generator.build_particle(:family, { render: true, store: false })
|
106
|
+
# generator.build_particle(:link) do |child_id|
|
107
|
+
# child_found = grab(child_id)
|
108
|
+
# child_found.atome[:parents] << @atome[:id]
|
109
|
+
# child_found.refresh
|
110
|
+
# end
|
111
|
+
# generator.build_particle(:id)
|
112
|
+
# generator.build_sanitizer(:id)
|
113
|
+
# generator.build_particle(:name)
|
114
|
+
# generator.build_particle(:active)
|
115
|
+
# generator.build_particle(:attach)
|
116
|
+
# generator.build_option(:pre_render_attach) do |parents_ids|
|
117
|
+
# parents_ids.each do |parents_id|
|
118
|
+
# parents_id = parents_id.value if parents_id.instance_of? Atome
|
119
|
+
# parents_found = grab(parents_id)
|
120
|
+
# family(parents_id)
|
121
|
+
# parents_found.atome[:attached] = [] unless parents_found.atome[:attached]
|
122
|
+
# parents_found.atome[:attached] << atome[:id]
|
123
|
+
# end
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
# generator.build_particle(:detached) do |attach_to_remove|
|
127
|
+
# attached.value.delete(attach_to_remove)
|
128
|
+
# end
|
129
|
+
# generator.build_particle(:intricate, { type: :array })
|
130
|
+
# generator.build_particle(:clones) do |clones_found|
|
131
|
+
# clones_found.each_with_index do |clone_found, index|
|
132
|
+
# particles_intricated = clone_found[:intricate] ||= []
|
133
|
+
# clone_id = "#{particles[:id]}_clone_#{index}"
|
134
|
+
# original_id = atome[:id]
|
135
|
+
# clone_found[:id] = clone_id
|
136
|
+
# clone_found = particles.merge(clone_found)
|
137
|
+
# cloned_atome = Atome.new({ clone: clone_found })
|
138
|
+
# cloned_atome.monitor({ atomes: [original_id], particles: particles_intricated }) do |_atome, particle, value|
|
139
|
+
# cloned_atome.send(particle, value)
|
140
|
+
# end
|
141
|
+
# end
|
142
|
+
# end
|