atome 0.5.3.8.8 → 0.5.4.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +52 -17
- data/app_builder_helpers/Rakefile +20 -3
- data/exe/atome +33 -1
- data/lib/atome/atome.rb +43 -57
- data/lib/atome/extensions/atome.rb +82 -52
- data/lib/atome/extensions/mathematic.rb +8 -12
- data/lib/atome/extensions/matrix.rb +138 -210
- data/lib/atome/genesis/generators/atome.rb +8 -134
- data/lib/atome/genesis/generators/communication.rb +0 -1
- data/lib/atome/genesis/generators/effect.rb +0 -6
- data/lib/atome/genesis/generators/event.rb +64 -77
- data/lib/atome/genesis/generators/geometry.rb +0 -18
- data/lib/atome/genesis/generators/identity.rb +6 -33
- data/lib/atome/genesis/generators/material.rb +3 -54
- data/lib/atome/genesis/generators/utility.rb +63 -58
- data/lib/atome/genesis/genesis.rb +8 -0
- data/lib/atome/genesis/sparkle.rb +35 -16
- data/lib/atome/helpers/callbacks.rb +47 -1
- data/lib/atome/helpers/essentials.rb +1 -1
- data/lib/atome/helpers/sanitizer.rb +0 -10
- data/lib/atome/helpers/utilities.rb +74 -28
- data/lib/atome/kernel/batch.rb +13 -35
- data/lib/atome/kernel/universe.rb +2 -0
- data/lib/atome/presets/atome.rb +4 -12
- data/lib/atome/renderers/browser/atome.rb +1 -1
- data/lib/atome/renderers/browser/browser.rb +2 -0
- data/lib/atome/renderers/browser/event.rb +18 -0
- data/lib/atome/renderers/browser/helpers/drag_helper.rb +13 -0
- data/lib/atome/renderers/browser/helpers/drop_helper.rb +13 -0
- data/lib/atome/renderers/browser/helpers/event_helper.rb +16 -11
- data/lib/atome/renderers/browser/helpers/over_helper.rb +13 -0
- data/lib/atome/renderers/browser/helpers/text_helper.rb +5 -1
- data/lib/atome/renderers/browser/spatial.rb +3 -2
- data/lib/atome/renderers/browser/utility.rb +7 -7
- data/lib/atome/version.rb +2 -2
- data/lib/atome.rb +1 -0
- data/sig/atome.rbs +16 -0
- data/sig/batch.rbs +7 -0
- data/sig/browser_helper.rbs +14 -0
- data/sig/matrix.rbs +5 -0
- data/sig/object.rbs +3 -0
- data/vendor/assets/aui.rb +5 -0
- data/vendor/assets/src/index.html +15 -3
- data/vendor/assets/src/js/atome/atome.js +1 -1
- data/vendor/assets/src/js/atome/atome_helpers/atome_animate.js +1 -1
- data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +40 -0
- data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +40 -3
- data/vendor/assets/src/js/atome/atome_helpers/atome_drop.js +12 -0
- data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +166 -0
- data/vendor/assets/src/js/atome/atome_helpers/atome_file.js +6 -1
- data/vendor/assets/src/js/atome/atome_helpers/atome_over.js +43 -0
- data/vendor/assets/src/medias/rubies/demos.rb +63 -0
- data/vendor/assets/src/medias/rubies/examples/add.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/animation.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/atome_new.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/attach.rb +10 -10
- data/vendor/assets/src/medias/rubies/examples/attached.rb +2 -3
- data/vendor/assets/src/medias/rubies/examples/batch.rb +17 -0
- data/vendor/assets/src/medias/rubies/examples/blur.rb +2 -2
- data/vendor/assets/src/medias/rubies/examples/box.rb +2 -2
- data/vendor/assets/src/medias/rubies/examples/code.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/color.rb +3 -3
- data/vendor/assets/src/medias/rubies/examples/delete.rb +17 -1
- data/vendor/assets/src/medias/rubies/examples/detached.rb +3 -3
- data/vendor/assets/src/medias/rubies/examples/drag.rb +52 -1
- data/vendor/assets/src/medias/rubies/examples/drop.rb +26 -0
- data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/markers.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/matrix.rb +102 -0
- data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +483 -0
- data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +32 -0
- data/vendor/assets/src/medias/rubies/examples/monitoring.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/mute.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/on.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/over.rb +6 -4
- data/vendor/assets/src/medias/rubies/examples/pause.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/physical.rb +19 -0
- data/vendor/assets/src/medias/rubies/examples/play.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/repeat.rb +3 -2
- data/vendor/assets/src/medias/rubies/examples/shadow.rb +1 -1
- data/vendor/assets/src/medias/rubies/examples/sort.rb +3 -4
- data/vendor/assets/src/medias/rubies/examples/tags.rb +10 -0
- data/vendor/assets/src/medias/rubies/examples/text.rb +4 -4
- data/vendor/assets/src/medias/rubies/examples/time.rb +2 -2
- data/vendor/assets/src/medias/rubies/examples/video.rb +2 -2
- data/vendor/assets/src/medias/rubies/{examples → unstable}/_2_solve.rb +1 -1
- data/vendor/assets/src/medias/rubies/{examples → unstable}/_audio.rb +1 -1
- data/vendor/assets/src/medias/rubies/{examples → unstable}/_dataset.rb +4 -4
- data/vendor/assets/src/medias/rubies/{examples → unstable}/_table2.rb +2 -2
- data/vendor/assets/src/medias/rubies/{examples → unstable}/_vie.rb +2 -2
- data/vendor/assets/src/utilities/mode.rb +0 -0
- data/vendor/assets/src-tauri/tauri.conf.json +2 -2
- metadata +32 -14
- data/vendor/assets/src/medias/rubies/examples/table.rb +0 -479
- /data/vendor/assets/src/medias/rubies/{examples → unstable}/!run.rb +0 -0
- /data/vendor/assets/src/medias/rubies/{examples → unstable}/_attach.rb +0 -0
- /data/vendor/assets/src/medias/rubies/{examples → unstable}/_matrix.rb +0 -0
- /data/vendor/assets/src/medias/rubies/{examples → unstable}/_os.rb +0 -0
- /data/vendor/assets/src/medias/rubies/{examples → unstable}/_test.rb +0 -0
@@ -5,6 +5,7 @@ class Atome
|
|
5
5
|
private
|
6
6
|
|
7
7
|
attr_accessor :drag_start_proc, :drag_move_proc, :drag_end_proc,
|
8
|
+
:drop_action_proc,:over_action_proc,
|
8
9
|
:play_start_proc, :play_active_proc, :play_end_proc,
|
9
10
|
:animation_start_proc, :animation_active_proc, :animation_stop_proc
|
10
11
|
|
@@ -15,7 +16,10 @@ class Atome
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def read_callback(file, proc)
|
18
|
-
|
19
|
+
file_content=file.split('</head><body>')[1].split('</body></html>')[0]
|
20
|
+
# FIXME : found why '> is converted to >'
|
21
|
+
file_content=file_content.gsub(">", ">")
|
22
|
+
instance_exec(file_content, &proc) if proc.is_a?(Proc)
|
19
23
|
end
|
20
24
|
|
21
25
|
def time_callback(current_time, markers)
|
@@ -29,6 +33,7 @@ class Atome
|
|
29
33
|
end
|
30
34
|
end
|
31
35
|
|
36
|
+
# drag callbacks
|
32
37
|
def drag_start_callback(page_x, page_y, left_val, top_val)
|
33
38
|
@atome[:left] = left_val
|
34
39
|
@atome[:top] = top_val
|
@@ -46,10 +51,51 @@ class Atome
|
|
46
51
|
def drag_end_callback(page_x, page_y, left_val, top_val)
|
47
52
|
@atome[:left] = left_val
|
48
53
|
@atome[:top] = top_val
|
54
|
+
# alert :loo
|
55
|
+
# #now we rest the position
|
56
|
+
# self.left(left_val)
|
57
|
+
# self.top(top_val)
|
49
58
|
proc = @drag_end_proc
|
50
59
|
instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
|
51
60
|
end
|
52
61
|
|
62
|
+
# drop callbacks
|
63
|
+
def drop_action_callback( data_found, _full_event)
|
64
|
+
proc = @drop_action_proc
|
65
|
+
instance_exec(data_found, &proc) if proc.is_a?(Proc)
|
66
|
+
end
|
67
|
+
|
68
|
+
# def over_action_callback( data_found, _full_event)
|
69
|
+
# proc = @enter_action_proc
|
70
|
+
# instance_exec(data_found, &proc) if proc.is_a?(Proc)
|
71
|
+
# end
|
72
|
+
|
73
|
+
# drop callbacks
|
74
|
+
def enter_action_callback( data_found, _full_event)
|
75
|
+
proc = @enter_action_proc
|
76
|
+
instance_exec( data_found,&proc) if proc.is_a?(Proc)
|
77
|
+
end
|
78
|
+
|
79
|
+
def leave_action_callback(data_found)
|
80
|
+
proc = @leave_action_proc
|
81
|
+
instance_exec( data_found,&proc) if proc.is_a?(Proc)
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
# def drag_move_callback(page_x, page_y, left_val, top_val)
|
86
|
+
# proc = @drag_move_proc
|
87
|
+
# @atome[:left] = left_val
|
88
|
+
# @atome[:top] = top_val
|
89
|
+
# instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
|
90
|
+
# end
|
91
|
+
#
|
92
|
+
# def drag_end_callback(page_x, page_y, left_val, top_val)
|
93
|
+
# @atome[:left] = left_val
|
94
|
+
# @atome[:top] = top_val
|
95
|
+
# proc = @drag_end_proc
|
96
|
+
# instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
|
97
|
+
# end
|
98
|
+
|
53
99
|
# sort callbacks
|
54
100
|
def sort_callback(atome)
|
55
101
|
sort_proc = @sort_proc
|
@@ -5,7 +5,7 @@ module Essentials
|
|
5
5
|
@default_params = {
|
6
6
|
# Warning : type must be define first
|
7
7
|
render_engines: [:browser],
|
8
|
-
collector: { type: :element, attach: [:black_matter] },
|
8
|
+
# collector: { type: :element, attach: [:black_matter] },
|
9
9
|
image: { type: :image, attach: [:view] },
|
10
10
|
web: { type: :web, attach: [:view] },
|
11
11
|
video: { type: :video, attach: [:view] },
|
@@ -10,14 +10,4 @@ class Atome
|
|
10
10
|
{ red: split_data[0].to_f / 100, green: split_data[1].to_f / 100, blue: split_data[2].to_f / 100 }
|
11
11
|
end
|
12
12
|
|
13
|
-
# def found_parents_and_renderers
|
14
|
-
# if @atome
|
15
|
-
# parent_found = [@atome[:id]]
|
16
|
-
# render_found = @atome[:renderers]
|
17
|
-
# else
|
18
|
-
# parent_found = []
|
19
|
-
# render_found = Essentials.default_params[:render_engines]
|
20
|
-
# end
|
21
|
-
# { parent: parent_found, renderers: render_found }
|
22
|
-
# end
|
23
13
|
end
|
@@ -4,6 +4,37 @@
|
|
4
4
|
class Atome
|
5
5
|
private
|
6
6
|
|
7
|
+
# local server messaging
|
8
|
+
def self.controller_sender(message)
|
9
|
+
return if $host == :browser
|
10
|
+
|
11
|
+
json_msg = message.to_json
|
12
|
+
atome_js.JS.controller_sender(json_msg)
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
def response_listener(hashed_msg)
|
17
|
+
js_action = hashed_msg.JS[:action]
|
18
|
+
js_body = hashed_msg.JS[:body]
|
19
|
+
send(js_action, js_body)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.controller_listener
|
23
|
+
|
24
|
+
return if $host == :browser
|
25
|
+
|
26
|
+
atome_js.JS.controller_listener()
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
# def self.mode=(val)
|
31
|
+
# @atome_mode=val
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# def self.mode
|
35
|
+
# "@atome_mode"
|
36
|
+
# end
|
37
|
+
|
7
38
|
def collapse
|
8
39
|
@atome.each do |element, value|
|
9
40
|
send(element, value)
|
@@ -69,8 +100,8 @@ class Atome
|
|
69
100
|
end
|
70
101
|
|
71
102
|
def <<(particle)
|
72
|
-
|
73
|
-
real_atome[property] <<
|
103
|
+
|
104
|
+
real_atome[property] << particle
|
74
105
|
end
|
75
106
|
|
76
107
|
def add_to_integer(_atome_found, _particle_found, &_user_proc)
|
@@ -137,15 +168,15 @@ class Atome
|
|
137
168
|
collapse
|
138
169
|
end
|
139
170
|
|
140
|
-
def collector(params = {}, &bloc)
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
end
|
171
|
+
# def collector(params = {}, &bloc)
|
172
|
+
# atome_type = :collector
|
173
|
+
# # generated_render = params[:renderers] || []
|
174
|
+
# # generated_id = params[:id] || identity_generator(atome_type)
|
175
|
+
# #
|
176
|
+
# # generated_parents = params[:parents] || [id]
|
177
|
+
# params = atome_common(atome_type, params)
|
178
|
+
# Batch.new({ atome_type => params }, &bloc)
|
179
|
+
# end
|
149
180
|
|
150
181
|
def each(&proc)
|
151
182
|
value.each do |val|
|
@@ -154,7 +185,7 @@ class Atome
|
|
154
185
|
end
|
155
186
|
|
156
187
|
def include?(value)
|
157
|
-
self.
|
188
|
+
self.include?(value)
|
158
189
|
end
|
159
190
|
|
160
191
|
def each_with_index(*args, &block)
|
@@ -167,21 +198,21 @@ class Atome
|
|
167
198
|
# elsif value[range].instance_of?(Atome)
|
168
199
|
# return value[range]
|
169
200
|
elsif value[range].instance_of?(Array)
|
170
|
-
collector_object = Object.collector({})
|
171
|
-
collected_atomes = []
|
172
|
-
value[range].each do |atome_found|
|
173
|
-
|
174
|
-
end
|
175
|
-
collector_object.data(collected_atomes)
|
176
|
-
|
177
|
-
return collector_object
|
201
|
+
# collector_object = Object.collector({})
|
202
|
+
# collected_atomes = []
|
203
|
+
# value[range].each do |atome_found|
|
204
|
+
# collected_atomes << atome_found
|
205
|
+
# end
|
206
|
+
# collector_object.data(collected_atomes)
|
207
|
+
Batch.new(value[range])
|
208
|
+
# return collector_object
|
178
209
|
end
|
179
210
|
|
180
211
|
end
|
181
212
|
|
182
213
|
def []=(params, value)
|
183
214
|
# TODO : it may miss some code, see above
|
184
|
-
self
|
215
|
+
self[params] = value
|
185
216
|
end
|
186
217
|
|
187
218
|
def set(params)
|
@@ -201,7 +232,7 @@ class Atome
|
|
201
232
|
end
|
202
233
|
|
203
234
|
def materials
|
204
|
-
# TODO: the code below need a rewrite, we must find a new
|
235
|
+
# TODO: the code below need a rewrite, we must find a new algorithm to avoid all those conditions
|
205
236
|
images_found = atome[:image] || []
|
206
237
|
videos_found = atome[:video] || []
|
207
238
|
shapes_found = atome[:shape] || []
|
@@ -210,15 +241,30 @@ class Atome
|
|
210
241
|
images_found.concat(videos_found).concat(shapes_found).concat(web_found).concat(texts_found)
|
211
242
|
end
|
212
243
|
|
244
|
+
|
245
|
+
def physical
|
246
|
+
types=[:text, :image, :video, :shape, :web]
|
247
|
+
atomes_found=[]
|
248
|
+
types.each do |type|
|
249
|
+
ids_found = self.send(type)
|
250
|
+
next unless ids_found
|
251
|
+
|
252
|
+
ids_found.each do |id_found|
|
253
|
+
atomes_found << id_found
|
254
|
+
end
|
255
|
+
end
|
256
|
+
atomes_found
|
257
|
+
end
|
258
|
+
|
213
259
|
def detach_atome(atome_id_to_detach)
|
214
260
|
atome_to_detach = grab(atome_id_to_detach)
|
215
261
|
# TODO: remove the condition below and find why it try to detach an atome that doesn't exist
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
262
|
+
return unless atome_to_detach
|
263
|
+
atome_type_found = atome_to_detach.atome[:type]
|
264
|
+
atome_id_found = atome_to_detach.atome[:id]
|
265
|
+
@atome[atome_type_found].delete(atome_id_found)
|
266
|
+
@atome[:attached].delete(atome_id_to_detach)
|
267
|
+
|
222
268
|
end
|
223
269
|
|
224
270
|
end
|
data/lib/atome/kernel/batch.rb
CHANGED
@@ -1,48 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# this class is used to allow batch treatment
|
3
4
|
class Batch
|
4
|
-
|
5
5
|
def each(&proc)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
def id(val = nil)
|
12
|
-
if val
|
13
|
-
@id = val
|
14
|
-
else
|
15
|
-
@id
|
6
|
+
@data.each do |val|
|
7
|
+
atome_found = grab(val)
|
8
|
+
instance_exec(atome_found, &proc) if proc.is_a?(Proc)
|
16
9
|
end
|
17
10
|
end
|
18
11
|
|
19
12
|
def initialize(params)
|
20
|
-
@
|
21
|
-
|
13
|
+
@data = params
|
14
|
+
# self
|
22
15
|
end
|
23
16
|
|
24
|
-
def dispatch
|
17
|
+
def dispatch(method, args, &block)
|
25
18
|
@data.each do |atome_found|
|
26
|
-
|
19
|
+
args.each do |arg|
|
20
|
+
grab(atome_found).send(method, arg, &block)
|
21
|
+
end
|
27
22
|
end
|
23
|
+
# we return self to allow method chaining
|
24
|
+
self
|
28
25
|
end
|
29
|
-
|
30
|
-
# TODO: automatise collector methods creation when creating a new atome type
|
31
|
-
def color(args, &block)
|
32
|
-
|
33
|
-
dispatch(:color, args, &block)
|
34
|
-
end
|
35
|
-
|
36
|
-
def shadow(args, &block)
|
37
|
-
dispatch(:color, args, &block)
|
38
|
-
end
|
39
|
-
|
40
|
-
def method_missing(method, *args, &block)
|
41
|
-
dispatch(method, args, &block)
|
42
|
-
end
|
43
|
-
|
44
|
-
def data(collection)
|
45
|
-
@data = collection
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
26
|
+
end
|
@@ -19,7 +19,9 @@ class Universe
|
|
19
19
|
|
20
20
|
def add_optional_method(method_name, &method_proc)
|
21
21
|
# this method is used to add optional methods
|
22
|
+
# puts "3 => #{method_name}"
|
22
23
|
instance_variable_get('@options').merge!({ method_name => method_proc })
|
24
|
+
# puts "====> #{instance_variable_get('@options')[method_name]}"
|
23
25
|
end
|
24
26
|
|
25
27
|
def get_optional_method(method_name)
|
data/lib/atome/presets/atome.rb
CHANGED
@@ -7,36 +7,28 @@
|
|
7
7
|
|
8
8
|
class Atome
|
9
9
|
def atome_common(atome_type, params)
|
10
|
-
|
11
|
-
|
12
10
|
# TODO : optimise the whole code below and make it rubocop friendly
|
13
11
|
essential_params = Essentials.default_params[atome_type] || {}
|
14
|
-
# puts "==== > #{essential_params.merge(params)}"
|
15
12
|
essential_params[:type] = essential_params[:type] || :element
|
16
13
|
essential_params[:renderers] = essential_params[:renderers] || @atome[:renderers]
|
17
14
|
essential_params[:id] = params[:id] || identity_generator(atome_type)
|
18
15
|
essential_params[:attach] = params[:attach] || [@atome[:id]] || [:view]
|
19
|
-
# puts "==== > #{essential_params.merge(params)}"
|
20
16
|
essential_params.merge(params)
|
21
17
|
end
|
22
18
|
|
23
19
|
def box(params = {}, &bloc)
|
24
|
-
# default_renderer = Essentials.default_params[:render_engines]
|
25
20
|
atome_type = :box
|
26
|
-
# generated_render = params[:renderers] || default_renderer
|
27
|
-
# generated_id = params[:id] || identity_generator(:box)
|
28
|
-
# generated_parents = params[:attach] || [id.value]
|
29
21
|
params = atome_common(atome_type, params)
|
30
22
|
Atome.new({ atome_type => params }, &bloc)
|
31
23
|
end
|
32
24
|
|
33
25
|
def circle(params = {}, &bloc)
|
34
|
-
# default_renderer = Essentials.default_params[:render_engines]
|
35
26
|
atome_type = :circle
|
36
|
-
#
|
37
|
-
|
38
|
-
# generated_parents = params[:attach] || [id.value]
|
27
|
+
# puts "counter#{Universe.counter}"
|
28
|
+
|
39
29
|
params = atome_common(atome_type, params)
|
30
|
+
# puts "params ==> #{params} : #{Universe.counter}"
|
31
|
+
|
40
32
|
Atome.new({ atome_type => params }, &bloc)
|
41
33
|
end
|
42
34
|
|
@@ -19,7 +19,7 @@ end
|
|
19
19
|
|
20
20
|
generator.build_render(:browser_color) do |_value|
|
21
21
|
@browser_type = :style
|
22
|
-
# puts "1 - for the id : #{id} the
|
22
|
+
# puts "1 - for the id : #{id} the browser type is ::::> #{@browser_type}"
|
23
23
|
id_found = @atome[:id]
|
24
24
|
type_found = @atome[:type]
|
25
25
|
# we remove previous unused style tag
|
@@ -13,6 +13,8 @@ require 'atome/renderers/browser/helpers/browser_helper'
|
|
13
13
|
require 'atome/renderers/browser/helpers/animation_helper'
|
14
14
|
require 'atome/renderers/browser/helpers/color_helper'
|
15
15
|
require 'atome/renderers/browser/helpers/drag_helper'
|
16
|
+
require 'atome/renderers/browser/helpers/drop_helper'
|
17
|
+
# require 'atome/renderers/browser/helpers/over_helper'
|
16
18
|
require 'atome/renderers/browser/helpers/effect_helper'
|
17
19
|
require 'atome/renderers/browser/helpers/event_helper'
|
18
20
|
require 'atome/renderers/browser/helpers/image_helper'
|
@@ -16,6 +16,15 @@ generator.build_render(:browser_over) do |value, proc|
|
|
16
16
|
BrowserHelper.send("browser_over_#{value}", @browser_object,self, proc)
|
17
17
|
end
|
18
18
|
|
19
|
+
# generator.build_render(:browser_over) do |options, proc|
|
20
|
+
# # puts "method : #{options}, params : #{options}"
|
21
|
+
# options.each do |method, params|
|
22
|
+
# atome_id = @atome[:id]
|
23
|
+
# BrowserHelper.send("browser_over_#{method}", params, atome_id, self, proc)
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
|
27
|
+
|
19
28
|
generator.build_render(:browser_play) do |value, proc|
|
20
29
|
# first we reinit the 'at' event so the condition will be met again
|
21
30
|
# @at_time[:used] = nil
|
@@ -62,6 +71,15 @@ generator.build_render(:browser_drag) do |options, proc|
|
|
62
71
|
end
|
63
72
|
end
|
64
73
|
|
74
|
+
generator.build_render(:browser_drop) do |options, proc|
|
75
|
+
# puts "method : #{options}, params : #{options}"
|
76
|
+
options.each do |method, params|
|
77
|
+
atome_id = @atome[:id]
|
78
|
+
BrowserHelper.send("browser_drop_#{method}", params, atome_id, self, proc)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
|
65
83
|
generator.build_render(:browser_sort) do |options, _proc|
|
66
84
|
atome_js.JS.sort(options, @atome[:id], self)
|
67
85
|
end
|
@@ -3,11 +3,19 @@
|
|
3
3
|
# for browser rendering
|
4
4
|
|
5
5
|
module BrowserHelper
|
6
|
+
|
7
|
+
# drag helper
|
6
8
|
def self.browser_drag_move(params, atome_id, atome, proc)
|
7
9
|
atome.drag_move_proc = proc
|
8
10
|
atome_js.JS.drag(params, atome_id, atome)
|
9
11
|
end
|
10
12
|
|
13
|
+
# def self.browser_drag_end(params, atome_id, atome, proc)
|
14
|
+
# # alert :kool
|
15
|
+
# # atome.drag_move_proc = proc
|
16
|
+
# # atome_js.JS.drag(params, atome_id, atome)
|
17
|
+
# end
|
18
|
+
|
11
19
|
def self.browser_drag_lock(params, atome_id, atome, _proc)
|
12
20
|
atome_js.JS.lock(params, atome_id, atome)
|
13
21
|
end
|
@@ -36,4 +44,9 @@ module BrowserHelper
|
|
36
44
|
def self.browser_drag_end(_params, _atome_id, atome, proc)
|
37
45
|
atome.drag_end_proc = proc
|
38
46
|
end
|
47
|
+
|
48
|
+
def self.browser_drag_start(_params, _atome_id, atome, proc)
|
49
|
+
atome.drag_start_proc = proc
|
50
|
+
end
|
51
|
+
|
39
52
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# for browser rendering
|
4
|
+
|
5
|
+
module BrowserHelper
|
6
|
+
|
7
|
+
#drop helper
|
8
|
+
def self.browser_drop_action(params, atome_id, atome, proc)
|
9
|
+
atome.drop_action_proc = proc
|
10
|
+
atome_js.JS.drop(params, atome_id, atome)
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
# for browser rendering
|
4
4
|
module BrowserHelper
|
5
5
|
|
6
|
-
def self.touch_helper_callback(event,atome, proc)
|
6
|
+
def self.touch_helper_callback(event, atome, proc)
|
7
7
|
atome.instance_exec(event, &proc) if proc.is_a?(Proc)
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.browser_touch_true(browser_object,atome, proc)
|
10
|
+
def self.browser_touch_true(browser_object, atome, proc)
|
11
11
|
`
|
12
12
|
interact('#'+#{browser_object})
|
13
13
|
.on('tap', function (event) {
|
@@ -16,7 +16,7 @@ Opal.BrowserHelper.$touch_helper_callback(event,#{atome},#{proc});
|
|
16
16
|
`
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.browser_touch_long(browser_object,atome, proc)
|
19
|
+
def self.browser_touch_long(browser_object, atome, proc)
|
20
20
|
`
|
21
21
|
interact('#'+#{browser_object})
|
22
22
|
.on('hold', function (event) {
|
@@ -25,7 +25,7 @@ Opal.BrowserHelper.$touch_helper_callback(event,#{atome},#{proc});
|
|
25
25
|
`
|
26
26
|
end
|
27
27
|
|
28
|
-
def self.browser_touch_double(browser_object,atome, proc)
|
28
|
+
def self.browser_touch_double(browser_object, atome, proc)
|
29
29
|
`
|
30
30
|
interact('#'+#{browser_object})
|
31
31
|
.on('doubletap', function (event) {
|
@@ -34,7 +34,7 @@ Opal.BrowserHelper.$touch_helper_callback(event,#{atome},#{proc});
|
|
34
34
|
`
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.browser_touch_down(browser_object,atome, proc)
|
37
|
+
def self.browser_touch_down(browser_object, atome, proc)
|
38
38
|
|
39
39
|
`
|
40
40
|
interact('#'+#{browser_object})
|
@@ -45,7 +45,7 @@ Opal.BrowserHelper.$touch_helper_callback(event,#{atome},#{proc});
|
|
45
45
|
`
|
46
46
|
end
|
47
47
|
|
48
|
-
def self.browser_touch_up(browser_object, atome,proc)
|
48
|
+
def self.browser_touch_up(browser_object, atome, proc)
|
49
49
|
`
|
50
50
|
interact('#'+#{browser_object})
|
51
51
|
.on('up', function (event) {
|
@@ -54,15 +54,20 @@ Opal.BrowserHelper.$touch_helper_callback(event,#{atome},#{proc});
|
|
54
54
|
`
|
55
55
|
end
|
56
56
|
|
57
|
-
def self.browser_over_enter(browser_object,atome
|
58
|
-
browser_object.on :
|
59
|
-
atome.
|
57
|
+
def self.browser_over_enter(browser_object, atome)
|
58
|
+
browser_object.on :mouseenter do |event|
|
59
|
+
atome.enter_action_callback( event)
|
60
|
+
# atome.instance_exec(event, &proc) if proc.is_a?(Proc)
|
61
|
+
# atome_id = atome.id
|
62
|
+
# atome_js.JS.over_enter(atome_id, atome, proc, :enter)
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
63
|
-
def self.browser_over_leave(browser_object, atome
|
66
|
+
def self.browser_over_leave(browser_object, atome)
|
64
67
|
browser_object.on :mouseout do |event|
|
65
|
-
atome.
|
68
|
+
atome.leave_action_callback(event)
|
69
|
+
# atome.instance_exec(event, &proc) if proc.is_a?(Proc)
|
70
|
+
# atome_js.JS.over_leave(atome_id, atome,proc,:leave)
|
66
71
|
end
|
67
72
|
end
|
68
73
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# for browser rendering
|
4
|
+
|
5
|
+
# module BrowserHelper
|
6
|
+
#
|
7
|
+
# #drop helper
|
8
|
+
# def self.browser_over_action(params, atome_id, atome, proc)
|
9
|
+
# # atome.over_action_proc = proc
|
10
|
+
# atome_js.JS.over(params, atome_id, atome)
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# end
|
@@ -27,7 +27,11 @@ module BrowserHelper
|
|
27
27
|
def self.browser_data_shape(_value,_atome_send)
|
28
28
|
|
29
29
|
end
|
30
|
-
def self.
|
30
|
+
def self.browser_data_color(_value,_atome_send)
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.browser_data_find(value,_atome_send)
|
31
35
|
|
32
36
|
end
|
33
37
|
|
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
generator = Genesis.generator
|
4
4
|
|
5
|
-
|
5
|
+
|
6
|
+
new({ browser: :left, type: :integer }) do |value, _user_proc|
|
6
7
|
BrowserHelper.send("browser_left_#{@atome[:type]}", value, @browser_object, @atome)
|
7
8
|
end
|
8
9
|
|
@@ -52,7 +53,7 @@ generator.build_render(:browser_center) do |value, _user_proc|
|
|
52
53
|
|
53
54
|
end
|
54
55
|
|
55
|
-
new ({browser: :depth}) do |value|
|
56
|
+
new ({ browser: :depth }) do |value|
|
56
57
|
@browser_object.style['z-index'] = value
|
57
58
|
end
|
58
59
|
|
@@ -7,13 +7,13 @@ generator.build_render(:browser_delete) do |params|
|
|
7
7
|
browser_object&.remove if params == true
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
10
|
+
# do not use browser_clear
|
11
|
+
# #
|
12
|
+
# # generator.build_render(:browser_clear) do
|
13
|
+
# # @atome[:attached].each do |child_found|
|
14
|
+
# # grab(child_found).browser_object&.remove
|
15
|
+
# # end
|
16
|
+
# # end
|
17
17
|
|
18
18
|
generator.build_render(:browser_path) do |value|
|
19
19
|
BrowserHelper.send("browser_path_#{@atome[:type]}", value, @browser_object, @atome)
|
data/lib/atome/version.rb
CHANGED
data/lib/atome.rb
CHANGED
data/sig/atome.rbs
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
module Atome
|
2
2
|
VERSION: String
|
3
3
|
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
4
|
+
def *: -> untyped
|
5
|
+
|
6
|
+
def +: -> untyped
|
7
|
+
|
8
|
+
def -: -> untyped
|
9
|
+
|
10
|
+
def /: -> untyped
|
11
|
+
|
4
12
|
def add: -> untyped
|
5
13
|
|
6
14
|
def add_to_array: -> untyped
|
@@ -25,6 +33,8 @@ module Atome
|
|
25
33
|
|
26
34
|
def build_sanitizer: -> untyped
|
27
35
|
|
36
|
+
def calculate_sha: -> untyped
|
37
|
+
|
28
38
|
def circle: -> untyped
|
29
39
|
|
30
40
|
def detach_atome: -> untyped
|
@@ -33,6 +43,8 @@ module Atome
|
|
33
43
|
|
34
44
|
def format_matrix: -> untyped
|
35
45
|
|
46
|
+
def geolocation: -> untyped
|
47
|
+
|
36
48
|
def get_column: -> untyped
|
37
49
|
|
38
50
|
def get_column_or_row: -> untyped
|
@@ -41,10 +53,14 @@ module Atome
|
|
41
53
|
|
42
54
|
def matrix: -> untyped
|
43
55
|
|
56
|
+
def ping: -> untyped
|
57
|
+
|
44
58
|
def set: -> untyped
|
45
59
|
|
46
60
|
def sort_callback: -> untyped
|
47
61
|
|
62
|
+
def up?: -> untyped
|
63
|
+
|
48
64
|
def visuals: -> untyped
|
49
65
|
|
50
66
|
private
|