atome 0.5.7.3.6 → 0.5.7.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/documentation/deep learning/architecture.txt +4 -4
  4. data/documentation/deep learning/basic_infos.txt +2 -2
  5. data/documentation/deep learning/example_of_users_code.rb +43 -43
  6. data/documentation/installation/buiding_atome.md +2 -2
  7. data/lib/atome/atome.rb +24 -56
  8. data/lib/atome/extensions/atome.rb +31 -77
  9. data/lib/atome/extensions/sha.rb +7 -7
  10. data/lib/atome/genesis/atomes.rb +1 -1
  11. data/lib/atome/genesis/genesis.rb +6 -95
  12. data/lib/atome/genesis/particles/communication.rb +1 -1
  13. data/lib/atome/genesis/particles/event.rb +0 -8
  14. data/lib/atome/genesis/particles/geometry.rb +3 -4
  15. data/lib/atome/genesis/particles/hierarchy.rb +28 -27
  16. data/lib/atome/genesis/particles/identity.rb +0 -30
  17. data/lib/atome/genesis/particles/material.rb +13 -12
  18. data/lib/atome/genesis/particles/property.rb +41 -16
  19. data/lib/atome/genesis/particles/security.rb +0 -45
  20. data/lib/atome/genesis/particles/utility.rb +77 -137
  21. data/lib/atome/genesis/sparkle.rb +3 -12
  22. data/lib/atome/kernel/black_matter.rb +2 -0
  23. data/lib/atome/kernel/universe.rb +5 -45
  24. data/lib/atome/presets/atome.rb +0 -22
  25. data/lib/atome/utilities/utilities.rb +19 -8
  26. data/lib/atome/version.rb +2 -1
  27. data/lib/molecules/init.rb +0 -14
  28. data/lib/molecules/intuition/tools.rb +24 -43
  29. data/lib/molecules/intuition/utilities.rb +261 -135
  30. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
  31. data/lib/platform_specific/opal/extensions/color.rb +0 -5
  32. data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
  33. data/lib/platform_specific/opal/extensions/object.rb +1 -1
  34. data/lib/platform_specific/opal/extensions/ping.rb +11 -20
  35. data/lib/renderers/html/effect.rb +0 -11
  36. data/lib/renderers/html/event.rb +0 -7
  37. data/lib/renderers/html/geometry.rb +0 -31
  38. data/lib/renderers/html/html.rb +32 -128
  39. data/lib/renderers/html/material.rb +0 -22
  40. data/lib/renderers/html/spatial.rb +0 -9
  41. data/lib/renderers/html/utility.rb +5 -8
  42. data/lib/renderers/renderer.rb +0 -1
  43. data/vendor/assets/application/examples/account.rb +35 -0
  44. data/vendor/assets/application/examples/actor&role.rb +23 -0
  45. data/vendor/assets/application/examples/animation.rb +1 -1
  46. data/vendor/assets/application/examples/applications.rb +26 -77
  47. data/vendor/assets/application/examples/atome.rb +1 -1
  48. data/vendor/assets/application/examples/attach.rb +7 -7
  49. data/vendor/assets/application/examples/attached.rb +13 -15
  50. data/vendor/assets/application/examples/basic_understanding.rb +1 -1
  51. data/vendor/assets/application/examples/buttons.rb +48 -0
  52. data/vendor/assets/application/examples/clear.rb +12 -12
  53. data/vendor/assets/application/examples/clones&monitoring.rb +1 -1
  54. data/vendor/assets/application/examples/delete.rb +19 -14
  55. data/vendor/assets/application/examples/detach.rb +8 -0
  56. data/vendor/assets/application/examples/dig.rb +1 -1
  57. data/vendor/assets/application/examples/display.rb +6 -6
  58. data/vendor/assets/application/examples/drag.rb +1 -1
  59. data/vendor/assets/application/examples/duplicate.rb +6 -6
  60. data/vendor/assets/application/examples/exchange.rb +17 -0
  61. data/vendor/assets/application/examples/generator_and_build.rb +3 -3
  62. data/vendor/assets/application/examples/hierarchy.rb +5 -5
  63. data/vendor/assets/application/examples/layout.rb +1 -1
  64. data/vendor/assets/application/examples/preset.rb +3 -3
  65. data/vendor/assets/application/examples/selected.rb +1 -1
  66. data/vendor/assets/application/examples/shapes.rb +1 -1
  67. data/vendor/assets/application/examples/size.rb +1 -1
  68. data/vendor/assets/application/examples/test.rb +0 -320
  69. data/vendor/assets/application/examples/tools.rb +136 -192
  70. data/vendor/assets/application/examples/unfasten.rb +23 -0
  71. data/vendor/assets/application/index.rb +1 -1
  72. data/vendor/assets/server/atome_server.rb +1 -0
  73. data/vendor/assets/server/capture.rb +0 -1
  74. data/vendor/assets/server/database.rb +0 -1
  75. data/vendor/assets/server/eDen.rb +16 -94
  76. data/vendor/assets/src/index_server_wasm.html +1 -0
  77. data/vendor/assets/src/index_wasm.html +0 -6
  78. data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
  79. data/vendor/assets/src/js/third_parties/three.min.js +1 -1
  80. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
  81. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
  82. metadata +8 -6
  83. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  84. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  85. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  86. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
@@ -21,14 +21,6 @@ new({ particle: :remove, category: :property, type: :hash }) do |params|
21
21
  data.map do |hash|
22
22
  hash.delete(hash.keys[column]) if hash.keys[column]
23
23
  end
24
- # elsif params[:all]
25
- # apply.each do |applied_atome|
26
- # if grab(applied_atome).type.to_sym == params[:all].to_sym
27
- # puts "!go"
28
- # end
29
- # end
30
- # puts "so_good #{params}"
31
- # puts "***> #{apply}"
32
24
  end
33
25
 
34
26
  params
@@ -38,7 +30,6 @@ new({ particle: :remove, category: :property, type: :hash }) do |params|
38
30
  end
39
31
 
40
32
  end
41
- # new({ particle: :remove, category: :property, type: :hash })
42
33
 
43
34
  new({ post: :remove }) do |params|
44
35
  # TODO : we have to rethink the removal of atome and particles (with exception like category) and maybe 'use particle type' to handle removal
@@ -73,7 +64,7 @@ new({ post: :remove }) do |params|
73
64
  end
74
65
  else
75
66
  # the systems send an id we have to remove it from parent too
76
- grab(params).attached.delete(id)
67
+ grab(params).fasten.delete(id)
77
68
  grab(params).affect.delete(id)
78
69
  end
79
70
  params
@@ -86,7 +77,6 @@ end
86
77
  new({ particle: :remove_classes, category: :material, type: :boolean }) do |value|
87
78
  Universe.classes[value].delete(id)
88
79
  end
89
- # new ({ particle: :opacity, category: :material, type: :int })
90
80
 
91
81
  # vector shape
92
82
  new({ particle: :definition, category: :material, type: :string })
@@ -115,7 +105,18 @@ new({ after: :pattern }) do |params|
115
105
  end
116
106
  params
117
107
  end
118
- # new({ particle: :border, category: :material, type: :int })
119
108
  new({ particle: :fill, category: :material, type: :array })
120
109
 
121
110
  new({ particle: :opacity, category: :material, type: :int })
111
+
112
+ new({ particle: :exchange }) do |params, &bloc|
113
+ params.each_key do |part_f|
114
+ part_to_remove = send(part_f)
115
+ if part_to_remove.instance_of?(Array)
116
+ part_to_remove.each do |part_to_r|
117
+ remove(part_to_r)
118
+ end
119
+ end
120
+ set(params)
121
+ end
122
+ end
@@ -11,29 +11,27 @@ def extract_rgb_alpha(color_string)
11
11
  end
12
12
 
13
13
  new({ particle: :red, category: :property, type: :string }) do
14
- # alert :ok
15
14
  # we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
16
15
  self
17
16
  end
18
17
  # FIXME we have to apply both at post and after to make it work
19
18
  # used to refresh all affected atomes
20
- new({after: :red}) do |params|
21
- a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
19
+ new({ after: :red }) do |params|
20
+ a = affect.dup # FIXME we have to dup else some items in the array array other duplicated
22
21
  a.each do |atome_to_refresh|
23
- grab(atome_to_refresh).apply(id)
24
- end
22
+ grab(atome_to_refresh).apply(id)
23
+ end
25
24
  params
26
25
  end
27
26
 
28
-
29
27
  new({ particle: :green, category: :property, type: :string }) do
30
28
  # we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
31
29
  self
32
30
  end
33
31
 
34
32
  # used to refresh all affected atomes
35
- new({after: :green}) do |params|
36
- a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
33
+ new({ after: :green }) do |params|
34
+ a = affect.dup # FIXME we have to dup else some items in the array array other duplicated
37
35
  a.each do |atome_to_refresh|
38
36
  grab(atome_to_refresh).apply(id)
39
37
  end
@@ -46,8 +44,8 @@ new({ particle: :blue, category: :property, type: :string }) do
46
44
  end
47
45
 
48
46
  # used to refresh all affected atomes
49
- new({after: :blue}) do |params|
50
- a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
47
+ new({ after: :blue }) do |params|
48
+ a = affect.dup # FIXME we have to dup else some items in the array array other duplicated
51
49
  a.each do |atome_to_refresh|
52
50
  grab(atome_to_refresh).apply(id)
53
51
  end
@@ -58,8 +56,8 @@ new({ particle: :alpha, category: :property, type: :string }) do
58
56
  self
59
57
  end
60
58
  # used to refresh all affected atomes
61
- new({after: :alpha}) do |params|
62
- a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
59
+ new({ after: :alpha }) do |params|
60
+ a = affect.dup # FIXME we have to dup else some items in the array array other duplicated
63
61
  a.each do |atome_to_refresh|
64
62
  grab(atome_to_refresh).apply(id)
65
63
  end
@@ -70,7 +68,6 @@ new({ particle: :diffusion, category: :property, type: :string }) do
70
68
  self
71
69
  end
72
70
 
73
-
74
71
  new({ particle: :clean, category: :property, type: :boolean }) do |params|
75
72
  cell = params[:cell]
76
73
  row_nb = cell[0]
@@ -91,6 +88,7 @@ new({ particle: :insert, category: :property, type: :string }) do |params|
91
88
  position_to_insert = params[:row]
92
89
  data.insert(position_to_insert, {})
93
90
  elsif params[:column]
91
+ #
94
92
  end
95
93
 
96
94
  params
@@ -130,7 +128,7 @@ new({ particle: :sort, category: :property, type: :int }) do |params|
130
128
  params
131
129
  end
132
130
 
133
- new({particle: :inside, render: false})
131
+ new({ particle: :inside, render: false })
134
132
  new({ initialized: :inside }) do |params, &user_proc|
135
133
  render(:inside, params, &user_proc)
136
134
  end
@@ -142,8 +140,35 @@ new({ particle: :value }) do |val|
142
140
  val
143
141
  end
144
142
 
145
- new({ particle: :behavior, type: :symbol, category: :property })
143
+ new({ particle: :behavior, type: :symbol, category: :property })
146
144
 
147
145
  new({ particle: :orientation, type: :symbol, category: :property })
148
146
 
149
- new({ particle: :align , type: :symbol, category: :property })
147
+ new({ particle: :align, type: :symbol, category: :property })
148
+
149
+ new({ particle: :actor, store: false }) do |params|
150
+ @actor ||= {}
151
+ if params[:remove]
152
+ params[:remove].each do |atome_id, role|
153
+ @actor[role].delete(atome_id)
154
+ end
155
+ else
156
+ params.each do |atome_id, role|
157
+ grab(atome_id).role(role)
158
+ @actor[role] ||= []
159
+ @actor[role] << atome_id
160
+ end
161
+ end
162
+ end
163
+
164
+ new({ particle: :role, store: false }) do |params|
165
+ if params.instance_of? Hash
166
+ if params.keys[0] == :remove
167
+ @role.delete(params.values[0])
168
+ end
169
+ else
170
+ @role ||= []
171
+ @role << params
172
+ end
173
+ end
174
+
@@ -27,51 +27,6 @@ end
27
27
 
28
28
  new({ read: :password }) do |params|
29
29
  # TODO : check if we have to reactive the lines below
30
- # params = Black_matter.password if params.nil?
31
- # params[:read][:atome] = Black_matter.password[:read][:atome] unless @authorisations[:write][:atome]
32
- # params[:write][:atome] = Black_matter.password[:write][:atome] unless @authorisations[:write][:atome]
33
30
 
34
31
  params
35
32
  end
36
-
37
- # def get_all_local_storage_items
38
- # Création d'un hash pour stocker les paires clé/valeur de localStorage
39
- storage_items = {}
40
-
41
- # Obtention du nombre d'éléments dans le localStorage
42
- # storage= JS.global[:localStorage]
43
- # # storage=storage.to_s
44
- # storage_array= storage.to_a
45
- # # alert storage_array.length
46
- # storage_items={}
47
- # storage_array.each_with_index do |_i, index|
48
- # key = JS.global[:localStorage].key(index)
49
- # #
50
- # # # Récupération de la valeur associée à cette clé
51
- # value = JS.global[:localStorage].getItem(key)
52
- # #
53
- # # # Stockage de la paire clé/valeur dans le hash
54
- # storage_items[key] = value
55
- # end
56
- # puts storage_items
57
-
58
- # alert Native(storage_length).class
59
- # Itération sur tous les éléments de localStorage
60
- # (0...storage_length).each do |i|
61
- # # Récupération de la clé pour l'élément actuel
62
- # key = JS.global[:localStorage].key(i)
63
- #
64
- # # Récupération de la valeur associée à cette clé
65
- # value = JS.global[:localStorage].getItem(key)
66
- #
67
- # # Stockage de la paire clé/valeur dans le hash
68
- # storage_items[key] = value
69
- # end
70
- #
71
- # # Retour du hash contenant toutes les paires clé/valeur de localStorage
72
- # storage_items
73
- # end
74
- #
75
- # # Appel de la fonction pour récupérer et afficher le contenu de localStorage
76
- # all_items = get_all_local_storage_items
77
- # puts all_items
@@ -1,20 +1,29 @@
1
1
  # frozen_string_literal: true
2
+ def delete_recursive(atome_id, force=false)
3
+ return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system]) unless force
4
+
5
+ parent_id_found = grab(atome_id).attach
6
+ parent_found = grab(parent_id_found)
7
+ new_array = parent_found.fasten.dup
8
+ new_array.delete(atome_id)
9
+ parent_found.instance_variable_set('@fasten', new_array)
10
+ grab(atome_id).fasten.each do |atome_id_found|
11
+ delete_recursive(atome_id_found, force)
12
+ end
13
+ grab(atome_id).render(:delete, { :recursive => true })
14
+ grab(atome_id).touch(:remove)
15
+ Universe.delete(grab(atome_id).aid)
16
+ end
2
17
 
3
18
  new({ particle: :renderers, category: :utility, type: :string })
4
19
  new({ particle: :code, category: :utility, type: :string, store: false }) do |params, code|
5
20
  @code[params] = code
6
21
  end
7
- # new({ particle: :run, category: :utility, type: :boolean }) do |params|
8
- # code_found = @code
9
- # instance_exec(params, &code_found) if code_found.is_a?(Proc)
10
- # end
11
-
12
22
  new({ particle: :run }) do |params, code|
13
23
  instance_exec(&params) if params.is_a?(Proc)
14
24
  code_found = @code[params]
15
25
  instance_exec(params, &code_found) if code_found.is_a?(Proc)
16
26
  end
17
-
18
27
  new({ particle: :target }) do |params|
19
28
  params.each do |atome_f, value_f|
20
29
  if value_f.instance_of?(Hash)
@@ -26,125 +35,79 @@ new({ particle: :target }) do |params|
26
35
  end
27
36
  end
28
37
  end
29
-
30
- # new({ particle: :broadcast })
31
-
32
- def delete_recursive(atome_id, force = false)
33
- return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system]) unless force
34
-
35
- parent_id_found = grab(atome_id).attach
36
- parent_found = grab(parent_id_found)
37
- new_array = parent_found.attached.dup
38
- new_array.delete(atome_id)
39
- parent_found.instance_variable_set('@attached', new_array)
40
- grab(atome_id).attached.each do |atome_id_found|
41
- delete_recursive(atome_id_found, force)
42
- end
43
- grab(atome_id).render(:delete, { :recursive => true })
44
- grab(atome_id).touch(:remove)
45
- Universe.delete(grab(atome_id).aid)
46
- end
47
-
48
38
  new({ particle: :delete, category: :utility, type: :boolean, render: false }) do |params|
39
+ if params == true
49
40
 
50
- basic_system_object = %i[view eDen black_matter intuition copy atome
51
- user_view view_color shape_color
52
- box_color invisible_color text_color circle_color back_selection
53
- text_selection nil
54
- ]
55
-
56
- unless basic_system_object.include?(id) || id.nil?
57
-
58
- if params == true
59
- # We use the tag persistent to exclude color of system object and other default colors
60
- unless @tag && (@tag[:persistent] || @tag[:system])
61
- # if we are on a matrix we delete cells found & group found
62
- cells.delete(true)
63
- group.delete(true)
64
- # now we detach the atome from it's parent
65
- # now we init rendering
66
- render(:delete, params)
67
- # the machine delete the current atome from the universe
68
- id_found = @id.to_sym
69
- if @attach
70
- parent_found = grab(@attach)
71
- parent_found.attached.delete(id_found)
72
- end
73
- @affect&.each do |affected_atome|
74
- affected_found = grab(affected_atome)
75
- affected_found.apply.delete(id_found)
76
- affected_found.refresh
77
- end
78
-
79
- # Universe.delete(@aid)
80
- end
81
- elsif params.instance_of? Hash
41
+ # We use the tag persistent to exclude color of system object and other default colors
42
+ unless @tag && (@tag[:persistent] || @tag[:system])
82
43
  # if we are on a matrix we delete cells found & group found
83
44
  cells.delete(true)
84
45
  group.delete(true)
85
- if params[:recursive]
86
- unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
87
- attached.each do |atttached_atomes|
88
- delete_recursive(atttached_atomes)
89
- end
90
- # touch(:remove)
91
- # render(:delete, params)
92
- # Universe.delete(@aid)
93
- end
94
- elsif params[:force]
95
- attached.each do |atttached_atomes|
96
- # alert "attached : #{attached}"
97
- delete_recursive(atttached_atomes, true)
98
- end
99
- # touch(:remove)
100
- # render(:delete, params)
101
- # Universe.delete(@aid)
102
- else
103
- # the machine try to find the sub particle id and remove it eg a.delete(monitor: :my_monitor) remove the monitor
104
- # with id my_monitor
105
- params.each do |param, value|
106
- atome[param][value] = nil
46
+ # now we detach the atome from it's parent
47
+ # now we init rendering
48
+ render(:delete, params)
49
+ # the machine delete the current atome from the universe
50
+ id_found = @id.to_sym
51
+ if @attach
52
+ parent_found = grab(@attach)
53
+ parent_found.fasten.delete(id_found)
54
+ end
55
+ @affect&.each do |affected_atome|
56
+ affected_found = grab(affected_atome)
57
+ affected_found.apply.delete(id_found)
58
+ affected_found.refresh
59
+ end
60
+ grab(attach).unfasten([id])
61
+ Universe.delete(@aid)
62
+ end
63
+ elsif params.instance_of? Hash
64
+ # if we are on a matrix we delete cells found & group found
65
+ cells.delete(true)
66
+ group.delete(true)
67
+ if params[:recursive]
68
+ grab(attach).unfasten([id])
69
+ unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
70
+ fasten.each do |atttached_atomes|
71
+ delete_recursive(atttached_atomes)
107
72
  end
73
+ touch(:remove)
74
+ render(:delete, params)
75
+ Universe.delete(@aid)
108
76
  end
77
+ elsif params[:force]
78
+ fasten.each do |atttached_atomes|
79
+ # alert "fasten : #{fasten}"
80
+ delete_recursive(atttached_atomes, true)
81
+ end
82
+ touch(:remove)
83
+ render(:delete, params)
84
+ # alert "Universe : #{Universe.atomes[@aid]}"
85
+ # alert "length = #{Universe.atomes.length}"
86
+ Universe.delete(@aid)
87
+ # alert "Universe : #{Universe.atomes.length}"
109
88
 
110
- elsif Universe.atome_list.include?(params)
111
- # we check if the params passed is an atome to treat it in a different way
112
- puts "write code here : #{apply} , #{attached}"
113
89
  else
114
- send(params, 0) unless params == :id
115
- end
116
- touch(:remove)
117
- drag(false)
118
- drop(false)
119
- on(false)
120
- keyboard(false)
121
- resize(:remove)
122
- overflow(:remove)
123
-
124
- render(:delete, params)
125
- Universe.delete(@aid)
126
-
127
- exclusions = %i[@history @renderers @type @tag @html]
128
-
129
- instance_variables.each do |i_var|
130
- unless exclusions.include?(i_var)
131
- instance_variable_set(i_var, nil)
90
+ # the machine try to find the sub particle id and remove it eg a.delete(monitor: :my_monitor) remove the monitor
91
+ # with id my_monitor
92
+ params.each do |param, value|
93
+ atome[param][value] = nil
132
94
  end
133
95
  end
134
96
 
135
- instance_variable_set('@renderers', [])
97
+ elsif Universe.atome_list.include?(params)
98
+ # we check if the params passed is an atome to treat it in a different way
99
+ puts "write code here : #{apply} , #{fasten}"
100
+ else
101
+ send(params, 0) unless params == :id
136
102
  end
137
-
138
103
  end
139
-
140
104
  new({ particle: :clear, category: :utility, type: :boolean })
141
-
142
105
  new({ post: :clear }) do
143
- attached_found = []
144
- attached.each do |attached_id_found|
145
- attached_found << attached_id_found
106
+ fasten_found = []
107
+ fasten.each do |fasten_id_found|
108
+ fasten_found << fasten_id_found
146
109
  end
147
- attached_found.each do |child_id_found|
110
+ fasten_found.each do |child_id_found|
148
111
  child_found = grab(child_id_found)
149
112
  # we exclude system objects
150
113
  child_found&.delete(true) unless child_found.tag && child_found.tag[:system]
@@ -159,9 +122,7 @@ new({ particle: :schedule, category: :utility, type: :string }) do |date, proc|
159
122
  send("#{renderer}_schedule", format_date, &proc)
160
123
  end
161
124
  end
162
-
163
125
  new({ particle: :cursor, category: :utility, type: :string })
164
-
165
126
  new({ particle: :preset, category: :utility, type: :string }) do |params|
166
127
 
167
128
  if params.instance_of? Hash
@@ -182,7 +143,6 @@ end
182
143
  new({ particle: :relations, category: :utility, type: :hash })
183
144
  new({ particle: :tag, render: false, category: :utility, type: :hash })
184
145
  new({ particle: :web, category: :utility, type: :string })
185
- # new({ particle: :metrics, type: :hash })
186
146
  # do not change the line below initialise is a special method
187
147
  new({ initialize: :unit, value: {} })
188
148
  new({ particle: :unit, store: false, type: :string, category: :utility }) do |params|
@@ -204,37 +164,33 @@ new({ particle: :browse, category: :utility, type: :string })
204
164
  new({ particle: :copies, category: :utility, type: :string })
205
165
  new({ particle: :temporary, category: :utility, type: :int })
206
166
  new({ particle: :atomes, category: :utility, type: :string })
207
-
208
167
  new({ particle: :match, category: :utility, type: :string }) do |params, _bloc|
209
168
  params
210
169
  end
211
-
212
170
  new({ sanitizer: :match }) do |params, _bloc|
213
171
  params[:condition] = { min: { width: 0 } } unless params[:condition]
214
172
  params
215
173
  end
216
-
217
174
  new({ particle: :invert, category: :utility, type: :boolean })
218
175
  new({ particle: :option, category: :utility, type: :string })
219
-
220
176
  new({ particle: :duplicate, category: :utility, type: :string, store: false }) do |params|
221
177
  copy_number = if @duplicate
222
178
  @duplicate.length
223
179
  else
224
180
  0
225
181
  end
226
- attached_atomes = []
227
- attached_found = attached.dup
228
- attached_found.each do |child_id_found|
182
+ fasten_atomes = []
183
+ fasten_found = fasten.dup
184
+ fasten_found.each do |child_id_found|
229
185
  child_found = grab(child_id_found)
230
186
  if child_found
231
187
  new_child = child_found.duplicate({})
232
- attached_atomes << new_child.id
188
+ fasten_atomes << new_child.id
233
189
  end
234
190
  end
235
- params[:attached] = attached_atomes
191
+ params[:fasten] = fasten_atomes
236
192
  infos_found = infos.dup
237
- keys_to_delete = %i[history callback duplicate copy paste touch_code html attached aid]
193
+ keys_to_delete = %i[history callback duplicate copy paste touch_code html fasten aid]
238
194
  keys_to_delete.each { |key| infos_found.delete(key) }
239
195
  new_atome_id = "#{@id}_copy_#{copy_number}".to_sym
240
196
  infos_found[:id] = new_atome_id
@@ -245,16 +201,13 @@ new({ particle: :duplicate, category: :utility, type: :string, store: false }) d
245
201
  new_atome
246
202
 
247
203
  end
248
-
249
204
  new({ after: :duplicate }) do |params|
250
205
  @duplicate[@duplicate.keys[@duplicate.keys.length - 1]]
251
206
  end
252
-
253
207
  new({ particle: :copy, category: :utility, type: :string }) do |items_id|
254
208
  items_id = [items_id] unless items_id.instance_of? Array
255
209
  grab(:copy).collect << items_id
256
210
  end
257
-
258
211
  new({ particle: :paste, category: :utility, type: :string }) do |params|
259
212
 
260
213
  all_copies = grab(:copy).collect
@@ -280,37 +233,28 @@ new({ particle: :paste, category: :utility, type: :string }) do |params|
280
233
  end
281
234
  new_atomes
282
235
  end
283
-
284
236
  new({ read: :paste }) do |p|
285
237
  @copy
286
238
  end
287
-
288
239
  new({ particle: :backup, category: :utility, type: :string })
289
-
290
240
  new({ particle: :import, category: :utility, type: :string })
291
-
292
241
  new({ particle: :compute, category: :utility, type: :string }) do |params|
293
242
  params = { particle: params } unless params.instance_of?(Hash)
294
243
  params[:unit] ||= :pixel
295
244
  params[:reference] ||= :view
296
245
  params
297
246
  end
298
-
299
247
  new({ particle: :get, category: :utility, type: :string }) do |params|
300
248
  cell = params[:cell]
301
249
  row_nb = cell[0]
302
250
  column_nb = cell[1]
303
251
  data[row_nb][data[row_nb].keys[column_nb]] # we get the content of the cell
304
252
  end
305
-
306
253
  new({ particle: :css, category: :utility, type: :string })
307
-
308
254
  new({ read: :css }) do
309
255
  CssProxy.new(js, nil, self)
310
256
  end
311
-
312
257
  new({ particle: :holder, category: :utility, type: :atome })
313
-
314
258
  # this particle is mainly used in conjunction with alternate particle as a 'lambda' to alternate methods
315
259
  new({ particle: :executor, category: :utility, type: :hash }) do |params|
316
260
  params.each do |method, opt|
@@ -318,16 +262,12 @@ new({ particle: :executor, category: :utility, type: :hash }) do |params|
318
262
  end
319
263
  params
320
264
  end
321
-
322
265
  new({ particle: :tick, category: :utility, store: false, type: :hash }) do |val|
323
266
  @tick[val] ||= 0
324
267
  @tick[val] = @tick[val] += 1
325
268
  @tick[val]
326
269
  end
327
-
328
270
  new({ particle: :storage, category: :utility, type: :hash })
329
271
  new({ particle: :state, category: :utility, type: :symbol })
330
-
331
272
  new({ particle: :record, category: :utility, type: :hash })
332
273
  new({ particle: :preview, category: :utility, type: :hash })
333
-
@@ -92,7 +92,6 @@ Atome.new({ renderers: default_render, id: machine_id, type: :machine, password:
92
92
  # user
93
93
  user_password = { global: :star_win, read: { atome: :star_wars }, write: { atome: :star_wars } }
94
94
 
95
- # human({ id: :anonymous, login: true, password: user_password, data: { birthday: '10/05/1996' }, selection: [], attach: :user_view })
96
95
  human({ id: identity_generator, login: true, password: user_password, data: { birthday: '10/05/1996' }, selection: [], attach: :user_view })
97
96
 
98
97
  Universe.current_machine = machine_id
@@ -161,14 +160,8 @@ def init_database
161
160
  A.sync({ action: :init_db, data: { database: :eDen } }) do |data|
162
161
  Universe.database_ready = data[:data][:message] == 'database_ready'
163
162
  end
164
- # authentication : email, pass
165
- # atome : date, particles
166
- # history : aid, particle, value, date
167
-
168
- particles = Universe.particle_list
169
163
  # now we populate the DB
170
164
  A.sync({ action: :create_db_table, data: { table: :user, type: :string } }) do |_db_state|
171
- # puts "===> #{_db_state}"
172
165
  end
173
166
  A.sync({ action: :create_db_table, data: { table: :atome } }) do |_db_state|
174
167
  end
@@ -191,13 +184,11 @@ def init_database
191
184
 
192
185
 
193
186
  # now we send localstorage content to the server
194
- puts "sending localstorage"
195
187
  Atome.send_localstorage_content
196
188
 
197
189
  end
198
190
 
199
191
  def user_login
200
- # user = Universe.current_user
201
192
  password = Black_matter.password
202
193
  sync({ action: :authentication, data: { email: 'jeezs@atome.one' } }) do |email|
203
194
  puts "email received : #{email}"
@@ -212,6 +203,6 @@ end
212
203
  # Universe.allow_sync= false # to stop data to be sync on server
213
204
  touch_allow(false) # this lock the system right click in web view
214
205
  # add a few default font
215
- # A.add_text_visual({ path: 'Roboto', name: 'Roboto-Bold' })
216
- # A.add_text_visual({ path: 'Roboto', name: 'Roboto-Thin' })
217
- # A.add_text_visual({ path: 'Roboto', name: 'Roboto-LightItalic' })
206
+ A.add_text_visual({ path: 'Roboto', name: 'Roboto-Bold' })
207
+ A.add_text_visual({ path: 'Roboto', name: 'Roboto-Thin' })
208
+ A.add_text_visual({ path: 'Roboto', name: 'Roboto-LightItalic' })
@@ -1,6 +1,8 @@
1
+
1
2
  class Black_matter
2
3
  class << self
3
4
  def encode(string)
5
+ string=string.to_s
4
6
  JS.global.sha256(string.to_s)
5
7
  end
6
8