atome 0.5.6.1.4 → 0.5.6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +44 -0
- data/documentation/deep learning/basic_infos.txt +6 -0
- data/exe/atome +0 -2
- data/lib/atome/atome.rb +1 -1
- data/lib/atome/extensions/atome.rb +33 -23
- data/lib/atome/extensions/sha.rb +8 -8
- data/lib/atome/genesis/generators/atome.rb +1 -1
- data/lib/atome/genesis/generators/communication.rb +14 -20
- data/lib/atome/genesis/generators/effect.rb +2 -2
- data/lib/atome/genesis/generators/event.rb +25 -25
- data/lib/atome/genesis/generators/geometry.rb +3 -3
- data/lib/atome/genesis/generators/hierarchy.rb +6 -6
- data/lib/atome/genesis/generators/identity.rb +13 -13
- data/lib/atome/genesis/generators/material.rb +24 -11
- data/lib/atome/genesis/generators/property.rb +8 -24
- data/lib/atome/genesis/generators/security.rb +1 -1
- data/lib/atome/genesis/generators/spatial.rb +13 -13
- data/lib/atome/genesis/generators/time.rb +1 -1
- data/lib/atome/genesis/generators/utility.rb +39 -37
- data/lib/atome/genesis/genesis.rb +2 -1
- data/lib/atome/genesis/sparkle.rb +31 -11
- data/lib/atome/helpers/utilities.rb +108 -49
- data/lib/atome/kernel/universe.rb +13 -9
- data/lib/atome/version.rb +1 -1
- data/lib/eVe/eVe.rb +1 -1
- data/lib/eVe/eVe_relative.rb +1 -1
- data/lib/platform_specific/opal/extensions/sha.rb +25 -14
- data/lib/renderers/html/html.rb +6 -7
- data/vendor/assets/application/examples/atome_particle_validation.rb +7 -0
- data/vendor/assets/application/examples/attach.rb +3 -3
- data/vendor/assets/application/examples/border.rb +1 -1
- data/vendor/assets/application/examples/categories.rb +5 -0
- data/vendor/assets/application/examples/clones&monitoring.rb +105 -0
- data/vendor/assets/application/examples/database_handling.rb +23 -0
- data/vendor/assets/application/examples/display_bck.rb +1 -1
- data/vendor/assets/application/examples/drag.rb +3 -1
- data/vendor/assets/application/examples/encrypt.rb +6 -0
- data/vendor/assets/application/examples/find.rb +1 -1
- data/vendor/assets/application/examples/import.rb +2 -2
- data/vendor/assets/application/examples/read.rb +2 -0
- data/vendor/assets/application/examples/shadow.rb +2 -1
- data/vendor/assets/server/atome_server.rb +106 -16
- data/vendor/assets/server/atome_server_wasm.rb +1 -1
- data/vendor/assets/src/index.html +21 -21
- data/vendor/assets/src/index_server.html +11 -5
- data/vendor/assets/src/index_server_wasm.html +11 -4
- data/vendor/assets/src/js/atome/atome.js +1 -1
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +39 -30
- metadata +7 -4
- data/vendor/assets/application/examples/a_concat.rb +0 -19
- data/vendor/assets/application/examples/clones.rb +0 -177
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc8ade696d1fa0d4ebc29a7ffbb336e1537d1f2b5c83c7772a6651f2b4558d0d
|
4
|
+
data.tar.gz: 0b849380beee8851a6e3571bb4f9df756524b0dab2746e146c5f35dc1b545ea3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16319a956d2d2221eeb0b19ad60c305e811ae2fdec974e99ec33db58f6d1a11e3d71ea08bd73c1cfae4fb19c81aa3170c39ba64435fa155054bdea212e9bc908
|
7
|
+
data.tar.gz: 01df5f2b3923c04e05028ba711b9c83fdf431755685507dab92072eba959b1ee37e50a14dfe0c373f55f277def9c349e41fe76727f4b9828fcda389cc345b4f9
|
data/Rakefile
CHANGED
@@ -216,6 +216,50 @@ task :test_server do
|
|
216
216
|
build_for_opal_server(destination, project_name, 9292, :production)
|
217
217
|
end
|
218
218
|
|
219
|
+
|
220
|
+
task :opal_server_rebuild do
|
221
|
+
project_name = :test
|
222
|
+
source = '.'
|
223
|
+
destination = './tmp'
|
224
|
+
script_source = './test/application'
|
225
|
+
create_application(source, destination, project_name)
|
226
|
+
# the line below is to add addition script to the application folder (useful for test per example)
|
227
|
+
add_to_application_folder(script_source, destination, project_name)
|
228
|
+
# build opal
|
229
|
+
build_opal_library(source, destination, project_name)
|
230
|
+
# build parser
|
231
|
+
build_opal_parser(source, destination, project_name)
|
232
|
+
# build atome kernel
|
233
|
+
build_atome_kernel_for_opal(source, destination, project_name)
|
234
|
+
# build host_mode
|
235
|
+
build_host_mode(destination, project_name, 'puma-roda')
|
236
|
+
# build Opal extensions
|
237
|
+
build_opal_extensions(source, destination, project_name)
|
238
|
+
# build application
|
239
|
+
build_opal_application(source, destination, project_name)
|
240
|
+
# build and open the app
|
241
|
+
threads = []
|
242
|
+
threads << Thread.new do
|
243
|
+
|
244
|
+
sleep 1
|
245
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
246
|
+
# code to exec for Windows
|
247
|
+
`start http://localhost:9292`
|
248
|
+
# `start #{destination}\\#{project_name}\\src\\index_server.html`
|
249
|
+
|
250
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
251
|
+
# code to exec for MacOS
|
252
|
+
`open http://localhost:9292`
|
253
|
+
else
|
254
|
+
# code to exec for Unix/Linux
|
255
|
+
`open http://localhost:9292`
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
# build_for_opal_server(destination, project_name, 9292, :production)
|
261
|
+
end
|
262
|
+
|
219
263
|
task :test_osx do
|
220
264
|
project_name = :test
|
221
265
|
source = '.'
|
@@ -160,6 +160,9 @@ s.shape => ‘pwd’
|
|
160
160
|
|
161
161
|
Callback :
|
162
162
|
|
163
|
+
|
164
|
+
Important : all atome particle have a pros associated often use for callback when needed :
|
165
|
+
to acces this code use "particle_name_code" ex for touch to access the callbacks use : touch_code
|
163
166
|
s.shell(‘pwd’) do |method_return|
|
164
167
|
puts method_return
|
165
168
|
end
|
@@ -281,3 +284,6 @@ in presets/atome, atome_common:
|
|
281
284
|
|
282
285
|
|
283
286
|
|
287
|
+
atome expert and atome developers
|
288
|
+
expert develop atome core
|
289
|
+
developers create solution with atome framework
|
data/exe/atome
CHANGED
@@ -383,9 +383,7 @@ STR
|
|
383
383
|
File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
|
384
384
|
f.write(ru_file)
|
385
385
|
end
|
386
|
-
puts 'o-a'
|
387
386
|
`cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
|
388
|
-
puts 'o-b'
|
389
387
|
else
|
390
388
|
# code to exec with Unix/Linux
|
391
389
|
File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
|
data/lib/atome/atome.rb
CHANGED
@@ -5,15 +5,25 @@ class Object
|
|
5
5
|
def new(params, &bloc)
|
6
6
|
# Genesis = Genesis.Genesis
|
7
7
|
if params.key?(:atome)
|
8
|
-
Universe.
|
9
|
-
|
8
|
+
if Universe.atome_list.include?(params[:atome])
|
9
|
+
puts "atome #{params[:atome]} already exist you can't create it"
|
10
|
+
else
|
11
|
+
Universe.add_atomes_specificities params[:atome]
|
12
|
+
Genesis.build_atome(params[:atome], &bloc)
|
13
|
+
end
|
10
14
|
elsif params.key?(:particle)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
if Universe.particle_list[params[:particle]]
|
16
|
+
puts "particle #{params[:particle]} already exist you can't create it"
|
17
|
+
else
|
18
|
+
Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
|
19
|
+
# render indicate if the particle needs to be rendered
|
20
|
+
# store tell the system if it need to store the particle value
|
21
|
+
# type help the system what type of type the particle will receive and store
|
22
|
+
Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
|
23
|
+
store: params[:store], type: params[:type],
|
24
|
+
category: params[:category] }, &bloc)
|
25
|
+
end
|
26
|
+
|
17
27
|
elsif params.key?(:sanitizer)
|
18
28
|
Genesis.build_sanitizer(params[:sanitizer], &bloc)
|
19
29
|
elsif params.key?(:pre)
|
@@ -32,17 +42,18 @@ class Object
|
|
32
42
|
end
|
33
43
|
render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
|
34
44
|
Genesis.build_render(render_method, &bloc)
|
35
|
-
elsif params.key?(:callback)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
45
|
+
# elsif params.key?(:callback)
|
46
|
+
# particle_targetted = params[:callback]
|
47
|
+
# Atome.define_method("#{particle_targetted}_callback", option) do
|
48
|
+
# alert option
|
49
|
+
# bloc.call(option)
|
50
|
+
# end
|
40
51
|
end
|
41
52
|
end
|
42
53
|
|
43
54
|
def reorder_particles(hash_to_reorder)
|
44
55
|
# we reorder the hash
|
45
|
-
ordered_keys =
|
56
|
+
ordered_keys = %i[renderers id alien type attach int8 unit]
|
46
57
|
|
47
58
|
ordered_part = ordered_keys.map { |k| [k, hash_to_reorder[k]] }.to_h
|
48
59
|
other_part = hash_to_reorder.reject { |k, _| ordered_keys.include?(k) }
|
@@ -488,7 +499,7 @@ class Object
|
|
488
499
|
else
|
489
500
|
id_wanted = {}
|
490
501
|
end
|
491
|
-
basis = { alien: params[:target],renderers: [:html],
|
502
|
+
basis = { alien: params[:target], renderers: [:html], type: :atomized }.merge(id_wanted)
|
492
503
|
a = Atome.new(basis)
|
493
504
|
return a
|
494
505
|
# convert any foreign object (think HTML) to a pseudo atome objet , that embed foreign objet
|
@@ -496,17 +507,15 @@ class Object
|
|
496
507
|
|
497
508
|
end
|
498
509
|
|
499
|
-
|
500
510
|
class CssProxy
|
501
511
|
def initialize(js, parent_key = nil, current_atome)
|
502
512
|
@js = js
|
503
|
-
@css={}
|
513
|
+
@css = {}
|
504
514
|
@parent_key = parent_key
|
505
515
|
@style = {}
|
506
|
-
@current_atome=current_atome
|
516
|
+
@current_atome = current_atome
|
507
517
|
end
|
508
518
|
|
509
|
-
|
510
519
|
def [](key)
|
511
520
|
if @parent_key
|
512
521
|
@current_atome.instance_variable_get('@css')[@parent_key]&.[](key)
|
@@ -515,13 +524,11 @@ class CssProxy
|
|
515
524
|
end
|
516
525
|
end
|
517
526
|
|
518
|
-
|
519
|
-
|
520
527
|
def []=(key, value)
|
521
528
|
if @parent_key
|
522
529
|
@js[@parent_key][key] = value
|
523
|
-
@current_atome.instance_variable_set('@css',{@parent_key => {key => value}})
|
524
|
-
@css[@parent_key]={key => value}
|
530
|
+
@current_atome.instance_variable_set('@css', { @parent_key => { key => value } })
|
531
|
+
@css[@parent_key] = { key => value }
|
525
532
|
puts "==> Clé parente: #{@parent_key}, Clé: #{key}, Valeur: #{value}"
|
526
533
|
else
|
527
534
|
@style[key] = value
|
@@ -535,4 +542,7 @@ class CssProxy
|
|
535
542
|
@current_atome.instance_variable_get('@css').to_s
|
536
543
|
end
|
537
544
|
|
545
|
+
|
546
|
+
|
547
|
+
|
538
548
|
end
|
data/lib/atome/extensions/sha.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# to create a hash
|
4
|
-
class Atome
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
1
|
+
# # frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# # to create a hash
|
4
|
+
# class Atome
|
5
|
+
# def calculate_sha(string)
|
6
|
+
# Digest::SHA256.hexdigest(string)
|
7
|
+
# end
|
8
|
+
# end
|
@@ -1,36 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :connection }) do |params, bloc|
|
4
|
-
|
5
|
-
# type = { server: params }
|
6
|
-
params[:user] = Universe.current_user
|
7
|
-
params[:pass] = Black_matter.password
|
8
|
-
params[:atomes] = Universe.atome_list
|
9
|
-
params[:particles] = Universe.particle_list
|
3
|
+
new({ particle: :connection, category: :communication, type: :hash }) do |params, bloc|
|
4
|
+
|
10
5
|
# FIXME : html method shouldn't be here
|
11
6
|
html.connect(params, &bloc)
|
12
|
-
# test below
|
13
|
-
# wait 1 do
|
14
|
-
# message({message: 'cd ..;cd server;ls; pwd', action: :terminal })
|
15
|
-
# end
|
16
7
|
end
|
17
8
|
|
18
|
-
new({ particle: :message }) do |params, bloc|
|
19
|
-
|
20
|
-
params =
|
21
|
-
params[:
|
22
|
-
|
9
|
+
new({ particle: :message, category: :communication, type: :hash }) do |params, bloc|
|
10
|
+
params = { data: params } unless params.instance_of? Hash
|
11
|
+
params[:user] = 'dfghg4df5gdfgh654'
|
12
|
+
params[:pass] = 'gfhkzrhgzr4h98948'
|
13
|
+
instance_variable_set('@message_code', {}) unless instance_variable_get('@message_code')
|
14
|
+
store_proc= instance_variable_get('@message_code')
|
15
|
+
mmessage_id= "msg_#{store_proc.length}"
|
16
|
+
store_proc[mmessage_id]=bloc
|
17
|
+
html.send_message(params)
|
23
18
|
|
24
|
-
html.send_message(params, &bloc)
|
25
19
|
end
|
26
20
|
|
27
|
-
new({ particle: :controller }) do |msg|
|
21
|
+
new({ particle: :controller, category: :communication, type: :hash }) do |msg|
|
28
22
|
Atome.controller_sender(msg)
|
29
23
|
end
|
30
24
|
|
31
|
-
new({ particle: :int8 })
|
25
|
+
new({ particle: :int8, category: :communication, type: :int })
|
32
26
|
|
33
|
-
new({ particle: :language }) do |params|
|
27
|
+
new({ particle: :language, category: :communication, type: :string }) do |params|
|
34
28
|
@data = int8[params]
|
35
29
|
params
|
36
30
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :smooth })
|
3
|
+
new({ particle: :smooth, category: :effect, type: :int })
|
4
4
|
|
5
5
|
|
6
|
-
new({ particle: :blur }) do |params|
|
6
|
+
new({ particle: :blur, category: :effect, type: :int }) do |params|
|
7
7
|
# alert params
|
8
8
|
{ value: params, affect: :self } unless params.instance_of?(Hash)
|
9
9
|
# params
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :touch, type: :hash, store: false })
|
3
|
+
new({ particle: :touch, category: :event, type: :hash, store: false })
|
4
4
|
new({ sanitizer: :touch }) do |params, user_bloc|
|
5
5
|
# TODO: factorise code below
|
6
6
|
@touch ||= {}
|
@@ -44,7 +44,7 @@ new({ sanitizer: :touch }) do |params, user_bloc|
|
|
44
44
|
params
|
45
45
|
|
46
46
|
end
|
47
|
-
new({ particle: :play, store: false })
|
47
|
+
new({ particle: :play, category: :event, type: :boolean, store: false })
|
48
48
|
new({ sanitizer: :play }) do |params, user_bloc|
|
49
49
|
@play ||= {}
|
50
50
|
@play_code ||= {}
|
@@ -78,9 +78,9 @@ new({ sanitizer: :play }) do |params, user_bloc|
|
|
78
78
|
|
79
79
|
params
|
80
80
|
end
|
81
|
-
new({ particle: :pause })
|
82
|
-
new({ particle: :time })
|
83
|
-
new({ particle: :on, store: false })
|
81
|
+
new({ particle: :pause, category: :event, type: :boolean })
|
82
|
+
new({ particle: :time, category: :event, type: :int })
|
83
|
+
new({ particle: :on, category: :event, type: :boolean, store: false })
|
84
84
|
new({ sanitizer: :on }) do |params, user_bloc|
|
85
85
|
@on ||= {}
|
86
86
|
@on_code ||= {}
|
@@ -107,9 +107,9 @@ new({ sanitizer: :on }) do |params, user_bloc|
|
|
107
107
|
@on[params] = option
|
108
108
|
params
|
109
109
|
end
|
110
|
-
new({ particle: :fullscreen })
|
111
|
-
new({ particle: :mute })
|
112
|
-
new({ particle: :drag, store: false })
|
110
|
+
new({ particle: :fullscreen, category: :event, type: :boolean })
|
111
|
+
new({ particle: :mute, category: :event, type: :boolean })
|
112
|
+
new({ particle: :drag, category: :event, type: :boolean, store: false })
|
113
113
|
new({ sanitizer: :drag }) do |params, user_bloc|
|
114
114
|
@drag ||= {}
|
115
115
|
@drag_code ||= {}
|
@@ -156,7 +156,7 @@ new({ sanitizer: :drag }) do |params, user_bloc|
|
|
156
156
|
@drag[params] = option
|
157
157
|
params
|
158
158
|
end
|
159
|
-
new({ particle: :drop, store: false })
|
159
|
+
new({ particle: :drop, category: :event, type: :boolean, store: false })
|
160
160
|
new({ sanitizer: :drop }) do |params, user_bloc|
|
161
161
|
@drop ||= {}
|
162
162
|
@drop_code ||= {}
|
@@ -191,7 +191,7 @@ new({ sanitizer: :drop }) do |params, user_bloc|
|
|
191
191
|
@drop[params] = option
|
192
192
|
params
|
193
193
|
end
|
194
|
-
new({ particle: :over, type: :hash, store: false })
|
194
|
+
new({ particle: :over, category: :event, type: :hash, store: false })
|
195
195
|
new({ sanitizer: :over }) do |params, user_bloc|
|
196
196
|
|
197
197
|
# TODO: factorise code below
|
@@ -233,25 +233,25 @@ end
|
|
233
233
|
# @sort_proc = sort_proc
|
234
234
|
# end
|
235
235
|
|
236
|
-
new({ particle: :targets })
|
237
|
-
new({ particle: :start })
|
236
|
+
new({ particle: :targets, category: :event, type: :string })
|
237
|
+
new({ particle: :start, category: :event, type: :boolean })
|
238
238
|
new({ pre: :start }) do |_value, user_proc|
|
239
239
|
@animation_start_proc = user_proc
|
240
240
|
end
|
241
|
-
new({ particle: :stop })
|
241
|
+
new({ particle: :stop, category: :event, type: :boolean })
|
242
242
|
new({ pre: :stop }) do |_value, user_proc|
|
243
243
|
@animation_stop_proc = user_proc
|
244
244
|
end
|
245
|
-
new({ particle: :begin })
|
246
|
-
new({ particle: :end })
|
247
|
-
new({ particle: :duration })
|
248
|
-
new({ particle: :mass })
|
249
|
-
new({ particle: :damping })
|
250
|
-
new({ particle: :stiffness })
|
251
|
-
new({ particle: :velocity })
|
252
|
-
new({ particle: :repeat })
|
253
|
-
new({ particle: :ease })
|
254
|
-
new(particle: :keyboard, type: :hash, store: false)
|
245
|
+
new({ particle: :begin, category: :event, type: :time })
|
246
|
+
new({ particle: :end, category: :event, type: :time })
|
247
|
+
new({ particle: :duration, category: :event, type: :int })
|
248
|
+
new({ particle: :mass, category: :event, type: :int })
|
249
|
+
new({ particle: :damping, category: :event, type: :int })
|
250
|
+
new({ particle: :stiffness, category: :event, type: :int })
|
251
|
+
new({ particle: :velocity, category: :event, type: :int })
|
252
|
+
new({ particle: :repeat, category: :event, type: :boolean })
|
253
|
+
new({ particle: :ease, category: :event, type: :boolean })
|
254
|
+
new(particle: :keyboard, category: :event, type: :hash, store: false)
|
255
255
|
new({ sanitizer: :keyboard }) do |params, user_bloc|
|
256
256
|
@keyboard ||= {}
|
257
257
|
@keyboard_code ||= {}
|
@@ -289,7 +289,7 @@ new({ sanitizer: :keyboard }) do |params, user_bloc|
|
|
289
289
|
|
290
290
|
params
|
291
291
|
end
|
292
|
-
new({ particle: :resize, store: false })
|
292
|
+
new({ particle: :resize, category: :event, type: :boolean, store: false })
|
293
293
|
new({ sanitizer: :resize }) do |params, user_bloc|
|
294
294
|
@resize ||= { }
|
295
295
|
@resize_code ||= {}
|
@@ -316,7 +316,7 @@ new({ sanitizer: :resize }) do |params, user_bloc|
|
|
316
316
|
|
317
317
|
params
|
318
318
|
end
|
319
|
-
new({ particle: :overflow }) do |params, bloc|
|
319
|
+
new({ particle: :overflow, category: :event, type: :boolean }) do |params, bloc|
|
320
320
|
@overflow_code ||= {}
|
321
321
|
instance_variable_get('@overflow_code')[:overflow] = bloc
|
322
322
|
params
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :width })
|
4
|
-
new({ particle: :height })
|
3
|
+
new({ particle: :width, category: :geometry, type: :int })
|
4
|
+
new({ particle: :height, category: :geometry, type: :int })
|
5
5
|
|
6
|
-
new({ particle: :size }) do |params|
|
6
|
+
new({ particle: :size, category: :geometry, type: :int }) do |params|
|
7
7
|
params = { value: params } unless params.instance_of? Hash
|
8
8
|
params[:recursive] ||= false
|
9
9
|
params[:reference] ||= :x
|
@@ -30,12 +30,12 @@ def attachment_common(child_id, parents_id, direction, &user_proc)
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
new({ particle: :attach, render: false }) do |parents_id, &user_proc|
|
33
|
+
new({ particle: :attach, category: :hierarchy, type: :string, render: false }) do |parents_id, &user_proc|
|
34
34
|
attachment_common(@id, parents_id, :attach, &user_proc)
|
35
35
|
parents_id
|
36
36
|
end
|
37
37
|
|
38
|
-
new({ particle: :attached, render: false }) do |children_ids, &user_proc|
|
38
|
+
new({ particle: :attached, category: :hierarchy, type: :string, render: false }) do |children_ids, &user_proc|
|
39
39
|
children_ids = [children_ids] unless children_ids.instance_of?(Array)
|
40
40
|
parents_id = @id
|
41
41
|
children_ids.each do |children_id|
|
@@ -48,7 +48,7 @@ new({ sanitizer: :attached }) do |children_ids|
|
|
48
48
|
children_ids
|
49
49
|
end
|
50
50
|
|
51
|
-
new({ particle: :apply, render: false, store: false }) do |parents_ids, &user_proc|
|
51
|
+
new({ particle: :apply, category: :hierarchy, type: :string, render: false, store: false }) do |parents_ids, &user_proc|
|
52
52
|
# TODO: optimize the 2 lines below:
|
53
53
|
@apply ||= []
|
54
54
|
parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
|
@@ -77,7 +77,7 @@ new({ particle: :apply, render: false, store: false }) do |parents_ids, &user_pr
|
|
77
77
|
parents_ids
|
78
78
|
end
|
79
79
|
|
80
|
-
new({ particle: :affect, render: false }) do |children_ids, &user_proc|
|
80
|
+
new({ particle: :affect, category: :hierarchy, type: :string, render: false }) do |children_ids, &user_proc|
|
81
81
|
children_ids = [children_ids] unless children_ids.instance_of? Array
|
82
82
|
children_ids.each do |child_id|
|
83
83
|
child_found = grab(child_id)
|
@@ -86,7 +86,7 @@ new({ particle: :affect, render: false }) do |children_ids, &user_proc|
|
|
86
86
|
children_ids
|
87
87
|
end
|
88
88
|
|
89
|
-
new({ particle: :detached, store: false }) # unfastened
|
89
|
+
new({ particle: :detached, category: :hierarchy, type: :string, store: false }) # unfastened
|
90
90
|
new({ sanitizer: :detached }) do |values|
|
91
91
|
# unfastened
|
92
92
|
if values.instance_of? Array
|
@@ -100,4 +100,4 @@ new({ sanitizer: :detached }) do |values|
|
|
100
100
|
end
|
101
101
|
values
|
102
102
|
end
|
103
|
-
new({ particle: :collect })
|
103
|
+
new({ particle: :collect, category: :hierarchy, type: :string })
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :real })
|
4
|
-
new({ particle: :type })
|
5
|
-
new({ particle: :id })
|
3
|
+
new({ particle: :real, category: :identity, type: :string })
|
4
|
+
new({ particle: :type, category: :identity, type: :string })
|
5
|
+
new({ particle: :id, category: :identity, type: :int })
|
6
6
|
new({ sanitizer: :id }) do |params|
|
7
7
|
# first we sanitize the the id below
|
8
8
|
params = params.to_sym
|
@@ -13,8 +13,8 @@ new({ sanitizer: :id }) do |params|
|
|
13
13
|
end
|
14
14
|
params
|
15
15
|
end
|
16
|
-
new({ particle: :name })
|
17
|
-
new({ particle: :active })
|
16
|
+
new({ particle: :name, category: :identity, type: :string })
|
17
|
+
new({ particle: :active, category: :identity, type: :boolean })
|
18
18
|
# new({ particle: :entangled, type: :array })
|
19
19
|
# new({ particle: :clones }) do |clones_found|
|
20
20
|
# clones_found.each_with_index do |clone_found, index|
|
@@ -30,18 +30,18 @@ new({ particle: :active })
|
|
30
30
|
# end
|
31
31
|
# end
|
32
32
|
# end
|
33
|
-
new({ particle: :markup })
|
34
|
-
new({particle: :bundle})
|
35
|
-
new({ particle: :data })
|
33
|
+
new({ particle: :markup, category: :identity, type: :string })
|
34
|
+
new({particle: :bundle, category: :identity, type: :string})
|
35
|
+
new({ particle: :data, category: :identity, type: :string })
|
36
36
|
|
37
|
-
new({particle: :category, store: false}) do |category_names|
|
37
|
+
new({particle: :category, category: :identity, type: :string, store: false}) do |category_names|
|
38
38
|
category_names=[category_names] unless category_names.instance_of? Array
|
39
39
|
category_names.each do |category_name|
|
40
40
|
@category << category_name
|
41
41
|
end
|
42
42
|
end
|
43
43
|
# The selection particle is used by current user to store selected atomes
|
44
|
-
new(particle: :selection)
|
44
|
+
new(particle: :selection, category: :identity, type: :string)
|
45
45
|
|
46
46
|
new({ read: :selection }) do |params_get|
|
47
47
|
selector = grab(:selector)
|
@@ -49,7 +49,7 @@ new({ read: :selection }) do |params_get|
|
|
49
49
|
selector
|
50
50
|
end
|
51
51
|
|
52
|
-
new(particle: :selected) do |params|
|
52
|
+
new(particle: :selected, category: :identity, type: :boolean) do |params|
|
53
53
|
if params == true
|
54
54
|
grab(Universe.current_user).selection << @id
|
55
55
|
elsif params == false
|
@@ -60,5 +60,5 @@ new(particle: :selected) do |params|
|
|
60
60
|
params
|
61
61
|
end
|
62
62
|
|
63
|
-
new({ particle: :format })
|
64
|
-
new({ particle: :alien }) #special particel that old alien object
|
63
|
+
new({ particle: :format, category: :identity, type: :string })
|
64
|
+
new({ particle: :alien, category: :identity, type: :string }) #special particel that old alien object
|
@@ -1,17 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :component })
|
3
|
+
new({ particle: :component, category: :material, type: :string })
|
4
4
|
|
5
|
-
new({ particle: :edit })
|
6
|
-
new({ particle: :style })
|
5
|
+
new({ particle: :edit, category: :material, type: :boolean })
|
6
|
+
new({ particle: :style, category: :material, type: :string })
|
7
7
|
new({ pre: :style }) do |styles_send, _user_proc|
|
8
8
|
styles_send.each do |particle_send, value|
|
9
9
|
send(particle_send, value)
|
10
10
|
end
|
11
11
|
end
|
12
|
-
new({ particle: :hide })
|
12
|
+
new({ particle: :hide, category: :material, type: :boolean })
|
13
13
|
|
14
|
-
new({ particle: :remove })
|
14
|
+
new({ particle: :remove, category: :property, type: :hash }) do |params|
|
15
|
+
|
16
|
+
if params[:row]
|
17
|
+
data.delete_at(params[:row])
|
18
|
+
|
19
|
+
elsif params[:column]
|
20
|
+
column = params[:column]
|
21
|
+
data.map do |hash|
|
22
|
+
hash.delete(hash.keys[column]) if hash.keys[column]
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
end
|
26
|
+
params
|
27
|
+
end
|
15
28
|
|
16
29
|
new({ post: :remove }) do |params|
|
17
30
|
# TODO : we have to rethink the removal of atome and particles (with exception like category) and maybe 'use particle type' to handle removal
|
@@ -40,17 +53,17 @@ new({ post: :remove }) do |params|
|
|
40
53
|
params
|
41
54
|
end
|
42
55
|
|
43
|
-
new({ particle: :classes }) do |value|
|
56
|
+
new({ particle: :classes, category: :material, type: :json }) do |value|
|
44
57
|
Universe.classes[value] ||= []
|
45
58
|
Universe.classes[value] |= [id]
|
46
59
|
end
|
47
|
-
new({ particle: :remove_classes }) do |value|
|
60
|
+
new({ particle: :remove_classes, category: :material, type: :boolean }) do |value|
|
48
61
|
Universe.classes[value].delete(id)
|
49
62
|
end
|
50
|
-
new ({ particle: :opacity })
|
63
|
+
new ({ particle: :opacity, category: :material, type: :int })
|
51
64
|
|
52
65
|
# vector shape
|
53
|
-
new({ particle: :definition })
|
66
|
+
new({ particle: :definition, category: :material, type: :string })
|
54
67
|
|
55
68
|
new({ sanitizer: :definition }) do |params|
|
56
69
|
# we remove the unwanted svg tags
|
@@ -58,5 +71,5 @@ new({ sanitizer: :definition }) do |params|
|
|
58
71
|
params
|
59
72
|
end
|
60
73
|
|
61
|
-
new({ particle: :gradient })
|
62
|
-
new({ particle: :border })
|
74
|
+
new({ particle: :gradient, category: :material, type: :int })
|
75
|
+
new({ particle: :border, category: :material, type: :int })
|