atome 0.5.6.1.1 → 0.5.6.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +48 -4
  3. data/documentation/deep learning/basic_infos.txt +6 -0
  4. data/exe/atome +76 -2
  5. data/lib/atome/atome.rb +1 -1
  6. data/lib/atome/extensions/atome.rb +33 -23
  7. data/lib/atome/extensions/sha.rb +8 -8
  8. data/lib/atome/genesis/generators/atome.rb +1 -1
  9. data/lib/atome/genesis/generators/communication.rb +15 -16
  10. data/lib/atome/genesis/generators/effect.rb +2 -2
  11. data/lib/atome/genesis/generators/event.rb +25 -25
  12. data/lib/atome/genesis/generators/geometry.rb +3 -3
  13. data/lib/atome/genesis/generators/hierarchy.rb +6 -6
  14. data/lib/atome/genesis/generators/identity.rb +13 -13
  15. data/lib/atome/genesis/generators/material.rb +24 -11
  16. data/lib/atome/genesis/generators/property.rb +8 -24
  17. data/lib/atome/genesis/generators/security.rb +1 -1
  18. data/lib/atome/genesis/generators/spatial.rb +13 -13
  19. data/lib/atome/genesis/generators/time.rb +1 -1
  20. data/lib/atome/genesis/generators/utility.rb +39 -37
  21. data/lib/atome/genesis/genesis.rb +2 -1
  22. data/lib/atome/genesis/sparkle.rb +31 -11
  23. data/lib/atome/helpers/utilities.rb +115 -59
  24. data/lib/atome/kernel/universe.rb +13 -9
  25. data/lib/atome/version.rb +1 -1
  26. data/lib/eVe/eVe.rb +1 -1
  27. data/lib/eVe/eVe_relative.rb +1 -1
  28. data/lib/platform_specific/opal/extensions/sha.rb +25 -14
  29. data/lib/renderers/html/html.rb +6 -7
  30. data/vendor/assets/application/examples/atome_particle_validation.rb +7 -0
  31. data/vendor/assets/application/examples/attach.rb +3 -3
  32. data/vendor/assets/application/examples/border.rb +1 -1
  33. data/vendor/assets/application/examples/categories.rb +5 -0
  34. data/vendor/assets/application/examples/clones&monitoring.rb +105 -0
  35. data/vendor/assets/application/examples/database_handling.rb +20 -0
  36. data/vendor/assets/application/examples/display_bck.rb +1 -1
  37. data/vendor/assets/application/examples/drag.rb +3 -1
  38. data/vendor/assets/application/examples/encrypt.rb +6 -0
  39. data/vendor/assets/application/examples/find.rb +1 -1
  40. data/vendor/assets/application/examples/import.rb +2 -2
  41. data/vendor/assets/application/examples/read.rb +2 -0
  42. data/vendor/assets/application/examples/shadow.rb +2 -1
  43. data/vendor/assets/server/atome_server.rb +104 -21
  44. data/vendor/assets/server/atome_server_wasm.rb +3 -3
  45. data/vendor/assets/src/index.html +21 -21
  46. data/vendor/assets/src/index_server.html +11 -4
  47. data/vendor/assets/src/index_server_wasm.html +11 -3
  48. data/vendor/assets/src/js/atome/atome.js +1 -1
  49. data/vendor/assets/src/js/atome/atome_helpers/communication.js +40 -29
  50. metadata +7 -35
  51. data/Guardfile +0 -0
  52. data/server/atome_server.rb +0 -293
  53. data/server/atome_server_wasm.rb +0 -112
  54. data/server/capture.rb +0 -10
  55. data/server/config.ru +0 -13
  56. data/src/css/style.css +0 -162
  57. data/src-tauri/.gitignore +0 -4
  58. data/src-tauri/Cargo.toml +0 -27
  59. data/src-tauri/build.rs +0 -3
  60. data/src-tauri/icons/128x128.png +0 -0
  61. data/src-tauri/icons/128x128@2x.png +0 -0
  62. data/src-tauri/icons/32x32.png +0 -0
  63. data/src-tauri/icons/Square107x107Logo.png +0 -0
  64. data/src-tauri/icons/Square142x142Logo.png +0 -0
  65. data/src-tauri/icons/Square150x150Logo.png +0 -0
  66. data/src-tauri/icons/Square284x284Logo.png +0 -0
  67. data/src-tauri/icons/Square30x30Logo.png +0 -0
  68. data/src-tauri/icons/Square310x310Logo.png +0 -0
  69. data/src-tauri/icons/Square44x44Logo.png +0 -0
  70. data/src-tauri/icons/Square71x71Logo.png +0 -0
  71. data/src-tauri/icons/Square89x89Logo.png +0 -0
  72. data/src-tauri/icons/StoreLogo.png +0 -0
  73. data/src-tauri/icons/icon.icns +0 -0
  74. data/src-tauri/icons/icon.ico +0 -0
  75. data/src-tauri/icons/icon.png +0 -0
  76. data/src-tauri/src/main.rs +0 -71
  77. data/src-tauri/tauri.conf.json +0 -70
  78. data/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
  79. data/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
  80. data/src-wasm/wasm/wasi-vfs-unix +0 -0
  81. data/src-wasm/wasm/wasi-vfs.exe +0 -0
  82. data/vendor/assets/application/examples/a_concat.rb +0 -19
  83. data/vendor/assets/application/examples/clones.rb +0 -177
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b95189cdeb5fd525c61044cb540b3ff487ab48afdaaf162cc8330d5dc01edd5b
4
- data.tar.gz: a7b2cc31314513f94123cf12f9223eb892fd3275c4f0e73d4921775ba1f58e0e
3
+ metadata.gz: c9f271978fff8b31e480fd6d7dd63b4714f22f658c602a2725234bdb747e29bc
4
+ data.tar.gz: 7d61a71ff963c9b68b15dbbbe0a6469865d1aa82e958dca9b5cfffc4ad5ffd8c
5
5
  SHA512:
6
- metadata.gz: ff8cf89846a9b8abf0210356b2fd3b80a084e92bb309ee0ec263ca154d559ac84c8499da7e9161f91785ad46babb45a9c7d2d68f990b2f5a3cc7ca52cf24c0da
7
- data.tar.gz: 98e1d3e237e35adba9c1319b814c0c3c7b04620e513cf9ece38770f21f683b93c3235ff88822bd84c6b3d76c118ed8b6a864067da4afc73686476ea907644334
6
+ metadata.gz: c9b78286af7e45b82ab00792ab2a4a11ec008c2fee10cd110666cd38a9ae11c1b5d8e6bc520854f3e033018a05046fb4d92296da7360522d4d9ef4a1ec0de1ea
7
+ data.tar.gz: 365f481ee7933540065b259b4ea5d3b55515dc0b2b96f0dfc57231c55c927b54e307a41a551b208c8825e81dfe535b9be006b2dd05330ecfa78be32678d31c02
data/Rakefile CHANGED
@@ -161,7 +161,7 @@ task :test_opal do
161
161
 
162
162
  puts 'atome opal is build and running!'
163
163
  end
164
- task :server_wasm do
164
+ task :test_server_wasm do
165
165
  project_name = :test
166
166
  source = '.'
167
167
  destination = './tmp'
@@ -171,7 +171,7 @@ task :server_wasm do
171
171
  create_application(source, destination, project_name)
172
172
  wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
173
173
  puts 'atome wasm is build and running!'
174
- build_for_server(destination, project_name, 9292, :production)
174
+ build_for_wasm_server(destination, project_name, 9292, :production)
175
175
 
176
176
  end
177
177
  task :test_server do
@@ -213,7 +213,51 @@ task :test_server do
213
213
  end
214
214
 
215
215
  end
216
- build_for_server(destination, project_name, 9292, :production)
216
+ build_for_opal_server(destination, project_name, 9292, :production)
217
+ end
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)
217
261
  end
218
262
 
219
263
  task :test_osx do
@@ -292,7 +336,7 @@ task :osx_server do
292
336
  destination = './tmp'
293
337
  threads = []
294
338
  threads << Thread.new do
295
- build_for_server(destination, project_name, 9292, :production)
339
+ build_for_opal_server(destination, project_name, 9292, :production)
296
340
  end
297
341
  build_for_osx(destination)
298
342
 
@@ -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
@@ -353,7 +353,7 @@ def build_for_osx(destination, mode = :dev)
353
353
 
354
354
  end
355
355
 
356
- def build_for_server(destination, project_name, port, production)
356
+ def build_for_opal_server(destination, project_name, port, production)
357
357
  if production
358
358
  prod = '--env production'
359
359
  ru_file = <<STR
@@ -394,6 +394,55 @@ STR
394
394
 
395
395
  end
396
396
 
397
+
398
+ def build_for_wasm_server(destination, project_name, port, production)
399
+ if production
400
+ prod = '--env production'
401
+ ru_file = <<STR
402
+ require 'roda'
403
+ require './atome_server_wasm.rb'
404
+ run App.app.freeze
405
+ STR
406
+ else
407
+ ru_file = <<STR
408
+ require 'roda'
409
+ require 'rack/unreloader'
410
+ Unreloader = Rack::Unreloader.new(subclasses: %w[Roda]) { App }
411
+ Unreloader.require './atome_server_wasm.rb'
412
+ run Unreloader
413
+ require './atome_server.rb'
414
+ STR
415
+ end
416
+
417
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
418
+
419
+ # code to exec with Windows
420
+ File.open("#{destination}\\#{project_name}\\server\\config.ru", "w") do |f|
421
+ f.write(ru_file)
422
+ end
423
+ `cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}`
424
+ elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
425
+ # code to exec with MacOS
426
+ File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
427
+ f.write(ru_file)
428
+ end
429
+ puts 'w-a'
430
+
431
+ `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
432
+ puts 'w-b'
433
+
434
+ else
435
+ puts 'e'
436
+ # code to exec with Unix/Linux
437
+ File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
438
+ f.write(ru_file)
439
+ end
440
+ `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
441
+ end
442
+ puts 'f'
443
+
444
+ end
445
+
397
446
  # utils
398
447
  def ensure_rb_extension(filename)
399
448
  filename.end_with?('.rb') ? filename : "#{filename}.rb"
@@ -703,13 +752,38 @@ else
703
752
  # end
704
753
  end
705
754
  threads << Thread.new do
706
- build_for_server(destination, project_name, 9292, false)
755
+ build_for_opal_server(destination, project_name, 9292, false)
707
756
  end
708
757
 
709
758
  threads.each(&:join)
710
759
 
711
760
  end
712
761
 
762
+ if ARGV.include?('wasm_server')
763
+ puts 'building Server'
764
+ build_opal_application(nil, destination, project_name)
765
+ build_host_mode(destination, project_name, 'web-opal')
766
+ threads = []
767
+ # threads << Thread.new do
768
+ # # sleep 1
769
+ # # if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
770
+ # # # code to exec with Windows
771
+ # # `start "" "#{destination}\\#{project_name}\\src\\index_server.html`
772
+ # # elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
773
+ # # # code to exec with MacOS
774
+ # # `open http://localhost:9292`
775
+ # # else
776
+ # # # code to exec with Unix/Linux
777
+ # # `open http://localhost:9292`
778
+ # # end
779
+ # end
780
+ threads << Thread.new do
781
+ build_for_wasm_server(destination, project_name, 9292, false)
782
+ end
783
+ threads.each(&:join)
784
+ puts 'wasm server is running'
785
+ end
786
+
713
787
  if ARGV.include?('server_refresh')
714
788
  puts 're building Server'
715
789
  build_opal_application(nil, destination, project_name)
data/lib/atome/atome.rb CHANGED
@@ -11,7 +11,7 @@ class Atome
11
11
  # the keys :renderers, :type and :id should be placed in the first position in the hash
12
12
  @history = {}
13
13
  # @language = :english
14
- @callback = {}
14
+ # @callback = {}
15
15
  @tag = {}
16
16
  @selected = false
17
17
  #@metrics = {}
@@ -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.add_atomes_specificities params[:atome]
9
- Genesis.build_atome(params[:atome], &bloc)
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
- Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
12
- # render indicate if the particle needs to be rendered
13
- # store tell the system if it need to store the particle value
14
- # type help the system what type of type the particle will receive and store
15
- Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
16
- store: params[:store], type: params[:type] }, &bloc)
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
- particle_targetted = params[:callback]
37
- Atome.define_method "#{particle_targetted}_callback" do
38
- bloc.call
39
- end
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 = %i[renderers id alien type attach int8 unit]
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], type: :atomized }.merge(id_wanted)
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
@@ -1,8 +1,8 @@
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
+ # # 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
@@ -96,7 +96,7 @@ new({ atome: :matrix })
96
96
  new({ atome: :atomized, type: :hash })
97
97
 
98
98
  # new({ atome: :color, type: :model })
99
- new({ atome: :color, type: :template })
99
+ # new({ atome: :color, type: :template })
100
100
 
101
101
 
102
102
 
@@ -1,31 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- new({ particle: :connection }) do |params, bloc|
4
- # params = { server: params }
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
+
5
+ # FIXME : html method shouldn't be here
10
6
  html.connect(params, &bloc)
11
7
  end
12
8
 
13
- new({ particle: :message }) do |params, bloc|
14
-
15
- params = { message: params } unless params.instance_of? Hash
16
- params[:user] = Universe.current_user
17
- params[:pass] = Black_matter.password
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)
18
18
 
19
- html.send_message(params, &bloc)
20
19
  end
21
20
 
22
- new({ particle: :controller }) do |msg|
21
+ new({ particle: :controller, category: :communication, type: :hash }) do |msg|
23
22
  Atome.controller_sender(msg)
24
23
  end
25
24
 
26
- new({ particle: :int8 })
25
+ new({ particle: :int8, category: :communication, type: :int })
27
26
 
28
- new({ particle: :language }) do |params|
27
+ new({ particle: :language, category: :communication, type: :string }) do |params|
29
28
  @data = int8[params]
30
29
  params
31
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