atome 0.5.6.8.6 → 0.5.7.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/basic.md +7 -8
  3. data/documentation/deep learning/basic_infos.txt +6 -6
  4. data/documentation/installation/atome_server.md +66 -1
  5. data/documentation/installation/buiding_atome.md +307 -0
  6. data/lib/atome/atome.rb +2 -3
  7. data/lib/atome/extensions/atome.rb +38 -12
  8. data/lib/atome/genesis/atomes.rb +1 -1
  9. data/lib/atome/genesis/genesis.rb +11 -11
  10. data/lib/atome/genesis/particles/event.rb +58 -50
  11. data/lib/atome/genesis/particles/identity.rb +3 -0
  12. data/lib/atome/genesis/particles/property.rb +2 -1
  13. data/lib/atome/genesis/particles/utility.rb +18 -11
  14. data/lib/atome/genesis/presets.rb +10 -0
  15. data/lib/atome/genesis/sparkle.rb +11 -9
  16. data/lib/atome/kernel/universe.rb +22 -11
  17. data/lib/atome/presets/atome.rb +20 -17
  18. data/lib/atome/utilities/essentials.rb +5 -5
  19. data/lib/atome/utilities/utilities.rb +168 -15
  20. data/lib/atome/version.rb +1 -1
  21. data/lib/atome.rb +1 -0
  22. data/lib/atome_relative.rb +1 -0
  23. data/lib/molecules/init.rb +22 -42
  24. data/lib/molecules/intuition/_deprecated_inputs.rb +111 -0
  25. data/lib/molecules/intuition/utillities.rb +116 -29
  26. data/lib/renderers/html/event.rb +20 -4
  27. data/lib/renderers/html/html.rb +145 -161
  28. data/lib/renderers/html/identity.rb +10 -2
  29. data/lib/renderers/html/utility.rb +64 -8
  30. data/vendor/assets/application/examples/b64_to_image.rb +9 -0
  31. data/vendor/assets/application/examples/drag.rb +9 -2
  32. data/vendor/assets/application/examples/matrix.rb +77 -114
  33. data/vendor/assets/application/examples/recorder.rb +74 -0
  34. data/vendor/assets/application/examples/site.rb +41 -0
  35. data/vendor/assets/application/examples/sub_atome_manipulation.rb +0 -2
  36. data/vendor/assets/application/examples/svg_img_to_vector.rb +6 -0
  37. data/vendor/assets/application/examples/svg_vectorizer.rb +21 -0
  38. data/vendor/assets/application/examples/table.rb +1 -1
  39. data/vendor/assets/application/examples/test.rb +572 -0
  40. data/vendor/assets/application/examples/tools.rb +650 -304
  41. data/vendor/assets/application/examples/vector.rb +16 -3
  42. data/vendor/assets/server/atome_server.rb +3 -2
  43. data/vendor/assets/server/atome_server_wasm.rb +2 -2
  44. data/vendor/assets/server/eDen.rb +135 -14
  45. data/vendor/assets/src/index.html +1 -1
  46. data/vendor/assets/src/index_opal.html +1 -1
  47. data/vendor/assets/src/index_server.html +1 -1
  48. data/vendor/assets/src/index_server_wasm.html +1 -1
  49. data/vendor/assets/src/index_wasm.html +1 -1
  50. data/vendor/assets/src/js/atome/atome.js +250 -49
  51. data/vendor/assets/src/js/atome/atome_helpers/communication.js +4 -4
  52. data/vendor/assets/src/js/atome/specific/opal.js +19 -3
  53. data/vendor/assets/src/js/atome/specific/wasm.js +18 -3
  54. data/vendor/assets/src/js/molecules/web.js +1 -1
  55. data/vendor/assets/src/medias/images/icons/Lowpass.svg +8 -0
  56. data/vendor/assets/src/medias/images/icons/activate.svg +3 -0
  57. data/vendor/assets/src/medias/images/icons/audio.svg +7 -0
  58. data/vendor/assets/src/medias/images/icons/band_pass.svg +8 -0
  59. data/vendor/assets/src/medias/images/icons/clear.svg +5 -0
  60. data/vendor/assets/src/medias/images/icons/color.svg +5 -0
  61. data/vendor/assets/src/medias/images/icons/copy.svg +8 -0
  62. data/vendor/assets/src/medias/images/icons/create.svg +3 -0
  63. data/vendor/assets/src/medias/images/icons/delete.svg +8 -0
  64. data/vendor/assets/src/medias/images/icons/edit-.svg +4 -0
  65. data/vendor/assets/src/medias/images/icons/edit.svg +4 -0
  66. data/vendor/assets/src/medias/images/icons/edition.svg +4 -0
  67. data/vendor/assets/src/medias/images/icons/equalizer-.svg +5 -0
  68. data/vendor/assets/src/medias/images/icons/equalizer.svg +5 -0
  69. data/vendor/assets/src/medias/images/icons/filter.svg +4 -0
  70. data/vendor/assets/src/medias/images/icons/folder.svg +4 -0
  71. data/vendor/assets/src/medias/images/icons/group.svg +6 -0
  72. data/vendor/assets/src/medias/images/icons/hamburger.svg +8 -0
  73. data/vendor/assets/src/medias/images/icons/high_pass.svg +5 -0
  74. data/vendor/assets/src/medias/images/icons/link.svg +4 -0
  75. data/vendor/assets/src/medias/images/icons/load.svg +4 -0
  76. data/vendor/assets/src/medias/images/icons/low_pass.svg +5 -0
  77. data/vendor/assets/src/medias/images/icons/microphone.svg +7 -0
  78. data/vendor/assets/src/medias/images/icons/midi_in.svg +4 -0
  79. data/vendor/assets/src/medias/images/icons/midi_out.svg +4 -0
  80. data/vendor/assets/src/medias/images/icons/modules.svg +11 -0
  81. data/vendor/assets/src/medias/images/icons/paste.svg +4 -0
  82. data/vendor/assets/src/medias/images/icons/pause.svg +5 -0
  83. data/vendor/assets/src/medias/images/icons/play.svg +7 -0
  84. data/vendor/assets/src/medias/images/icons/record.svg +4 -0
  85. data/vendor/assets/src/medias/images/icons/save.svg +5 -0
  86. data/vendor/assets/src/medias/images/icons/select--.svg +4 -0
  87. data/vendor/assets/src/medias/images/icons/select-.svg +5 -0
  88. data/vendor/assets/src/medias/images/icons/select-all.svg +4 -0
  89. data/vendor/assets/src/medias/images/icons/select.svg +4 -0
  90. data/vendor/assets/src/medias/images/icons/settings.svg +5 -0
  91. data/vendor/assets/src/medias/images/icons/settings0.svg +2 -0
  92. data/vendor/assets/src/medias/images/icons/settings1.svg +17 -0
  93. data/vendor/assets/src/medias/images/icons/settings2.svg +25 -0
  94. data/vendor/assets/src/medias/images/icons/settings_old.svg +6 -0
  95. data/vendor/assets/src/medias/images/icons/shape.svg +7 -0
  96. data/vendor/assets/src/medias/images/icons/speaker.svg +6 -0
  97. data/vendor/assets/src/medias/images/icons/stop.svg +4 -0
  98. data/vendor/assets/src/medias/images/icons/tool.svg +7 -0
  99. data/vendor/assets/src/medias/images/icons/tools.svg +9 -0
  100. data/vendor/assets/src/medias/images/icons/undo2.svg +4 -0
  101. data/vendor/assets/src/medias/images/icons/validate.svg +9 -0
  102. data/vendor/assets/src/medias/images/icons/vie.svg +3 -0
  103. data/vendor/assets/src/medias/images/icons/wave-saw.svg +3 -0
  104. data/vendor/assets/src/medias/images/icons/wave-sine.svg +3 -0
  105. data/vendor/assets/src/medias/images/icons/wave-square-.svg +4 -0
  106. data/vendor/assets/src/medias/images/icons/wave-square.svg +3 -0
  107. data/vendor/assets/src/medias/images/icons/wave-triangle.svg +3 -0
  108. data/vendor/assets/src/medias/images/icons/waveform-.svg +4 -0
  109. data/vendor/assets/src/medias/images/icons/waveform.svg +7 -0
  110. metadata +68 -6
  111. data/lib/molecules/intuition/inputs.rb +0 -111
  112. /data/lib/molecules/{examples → _deprecated_examples}/site.rb +0 -0
  113. /data/lib/molecules/intuition/{toolbox.rb → _deprecated_toolbox.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6370fa14baff09e6137332d6c1acb28c9af1471300c1abca20886ed3393b82a0
4
- data.tar.gz: de3ecad7c62684abe3f6cb210d819a670d61d2818461856bc05afc03230fd806
3
+ metadata.gz: '0969d3c09cad0d5f55a4945f77f58615952416ee927c25260c8f02cba5012681'
4
+ data.tar.gz: 4bf07124488234a077250506c0bf76698f3b0648e557243112489d4787b39141
5
5
  SHA512:
6
- metadata.gz: 93703fda1d4a8b00dcbf7430bae2bdeacf2530e02e36e5d99c29dc175ac8d10fa4a7c1f5be6b176943f9a834f90bc75b388082c7e85d02b1e26cf579cf311663
7
- data.tar.gz: d878ddaf5a47323cc31ad8ddf061ddf15b4c7293e49f5312b0892949f44d7e0094a853be4d6796c5c4689985df0394c73fc679d017709249cc0957634619462b
6
+ metadata.gz: b6f62fe357b0e0fcde26fca7fe3842f4ac6d66a96dc4ae78f6c129adb402bb37d361f9384d61db635ec8ace5177e97dadc1094f4d875873910863412b6ace81c
7
+ data.tar.gz: 3e0d1bf658d8567f465616675806743e41704035d861ae3f7e39fb4edca4fb9a53023ffd0d249719d65f9d7a8ff6857773ed2666bc3f54aedbdb6a256d3a26a0
@@ -127,7 +127,7 @@ Join us in making multimedia object modeling more efficient, flexible, and power
127
127
 
128
128
  -
129
129
 
130
- <img src="./documentation/images/3.png" width="666" />
130
+ <img src="../documentation/images/3.png" width="666" />
131
131
 
132
132
 
133
133
  Atome is powerful engine dedicated to the creation of cross-platform applications, web application and digital medias.
@@ -153,7 +153,6 @@ Cross platform ecosystem
153
153
 
154
154
  Open source technology included
155
155
  -
156
-
157
156
  - Ruby : is the language used to script all atome's apis (https://www.ruby-lang.org)
158
157
 
159
158
  [comment]: <> (<img src="https://github.com/atomecorp/atome/raw/master/documentation/images/logos/ruby.png" width="100" />)
@@ -182,14 +181,14 @@ Open source technology included
182
181
 
183
182
  [comment]: <> (<img src="https://avatars.githubusercontent.com/u/54536011?s=200&v=4" width="100" />)
184
183
 
185
- <img src="./documentation/images/logos/ruby.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
184
+ <img src="../documentation/images/logos/ruby.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
186
185
 
187
- [//]: # (<img src="./documentation/images/logos/cordova.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)
188
- <img src="./documentation/images/logos/opal.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
189
- <img src="./documentation/images/logos/roda.svg" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
190
- <img src="./documentation/images/logos/freebsd.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
191
- <img src="./documentation/images/logos/puma.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
192
186
 
187
+ [//]: # (<img src="./documentation/images/logos/cordova.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)
188
+ <img src="../documentation/images/logos/opal.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
189
+ <img src="../documentation/images/logos/roda.svg" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
190
+ <img src="../documentation/images/logos/freebsd.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
191
+ <img src="../documentation/images/logos/puma.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
193
192
  [//]: # (<img src="./documentation/images/logos/tauri.png" width="100" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)
194
193
 
195
194
  ## Installation
@@ -183,17 +183,17 @@ s.shell_code[:shell]
183
183
 
184
184
  Callback from javascript :
185
185
  In : vendor/assets/src/js/specific/ there’s two methods used to handle callback
186
- The easier method to send the callback to ruby is to use rubyVMCallback like this :
186
+ The easier method to send the callback to ruby is to use atomeJsToRuby like this :
187
187
 
188
188
  With javascript you can call the internal ‘automatically created ‘ method : termninal_callback and send them the data getter from javascript like this :
189
- rubyVMCallback(‘particle_callback', "('" + js_data + "')")
189
+ atomeJsToRuby(‘particle_callback', "('" + js_data + "')")
190
190
  Exemple with terminal particle:
191
- rubyVMCallback('termninal_callback', "('" + cmd_result + "')")
191
+ atomeJsToRuby('termninal_callback', "('" + cmd_result + "')")
192
192
  Or call the callback like this :
193
- rubyVMCallback( " instance_variable_set(‘@terminal_code’, "’" +data+  "’" )")
194
- rubyVMCallback("callback(:terminal) ")
193
+ atomeJsToRuby( " instance_variable_set(‘@terminal_code’, "’" +data+  "’" )")
194
+ atomeJsToRuby("callback(:terminal) ")
195
195
 
196
- One is called wasm.js directory and one called opal.js both have the same method : rubyVMCallback
196
+ One is called wasm.js directory and one called opal.js both have the same method : atomeJsToRuby
197
197
 
198
198
  On the js side there’s a special method call ‘callback’ in atome.js file , this method handle all the needed code to create a callback, this method is call like this:
199
199
  callback(particle, value)
@@ -181,4 +181,69 @@ Connect on port 443 with HTTPS to accept wss certificate.
181
181
  [comment]: <> ( docker run --name=mediasoup-demo -p 4443:4443/tcp -p 40000-49999:40000-49999/udp -p 40000-49999:40000-49999/tcp -p 3000-3001:3000-3001/tcp --init -v c:/Tmp/mediasoup/certs:/service/certs -e HTTPS_CERT_FULLCHAIN="/service/certs/fullchain.pem" -e HTTPS_CERT_PRIVKEY="/service/certs/privkey.pem" -e MEDIASOUP_ANNOUNCED_IP="192.168.103.92" -e MEDIASOUP_LISTEN_IP="0.0.0.0" mediasoup-demo:v3)
182
182
 
183
183
 
184
- [comment]: <> (Wait 10 mn for server starting...)
184
+ [comment]: <> (Wait 10 mn for server starting...)
185
+
186
+
187
+ Freebsd mail server install :
188
+
189
+ Setting up a mail server on FreeBSD similar to what you might find in cPanel involves multiple components, as cPanel utilizes a software stack that includes mail servers, databases, web servers, and more. For setting up a mail server, you typically need the following components:
190
+
191
+ - **MTA (Mail Transfer Agent)**: Software for routing and delivering email. Popular choices include Postfix and Exim (used by cPanel).
192
+ - **MDA (Mail Delivery Agent)**: Software for storing and retrieving emails. Dovecot is a common choice.
193
+ - **Webmail**: A web user interface to access emails. RoundCube and Horde are common examples.
194
+ - **Antispam and Antivirus**: SpamAssassin for antispam, ClamAV for antivirus are commonly used options.
195
+
196
+ Here's a high-level overview to set up a mail server on FreeBSD:
197
+
198
+ ### 1. Update the System
199
+ First, ensure your FreeBSD system is up to date:
200
+
201
+ ```shell
202
+ pkg update && pkg upgrade
203
+ ```
204
+
205
+ ### 2. Install Postfix (MTA)
206
+ Install Postfix as the MTA:
207
+
208
+ ```shell
209
+ pkg install postfix
210
+ ```
211
+
212
+ Configure Postfix by editing its configuration file (`/usr/local/etc/postfix/main.cf`). You'll need to set the mail domain, hostname, and other network and security settings.
213
+
214
+ ### 3. Install Dovecot (MDA)
215
+ Install Dovecot to handle email delivery and access:
216
+
217
+ ```shell
218
+ pkg install dovecot
219
+ ```
220
+
221
+ Configure Dovecot by adjusting the configuration files in `/usr/local/etc/dovecot/`. You'll need to set up authentication mechanisms, email storage locations, etc.
222
+
223
+ ### 4. Install Webmail Interface
224
+ Install RoundCube or another webmail client:
225
+
226
+ ```shell
227
+ pkg install roundcube
228
+ ```
229
+
230
+ Configure RoundCube by editing its configuration file, typically located in `/usr/local/www/roundcube/config/`.
231
+
232
+ ### 5. Set Up Antispam and Antivirus
233
+ Install SpamAssassin and ClamAV:
234
+
235
+ ```shell
236
+ pkg install spamassassin clamav
237
+ ```
238
+
239
+ Configure each service to integrate with your MTA and MDA. This may involve editing Postfix and Dovecot's configuration files to include filters and antivirus checks.
240
+
241
+ ### 6. Test Your Configuration
242
+ - Test Postfix by sending emails from the command line.
243
+ - Test Dovecot by logging in via an email client or RoundCube.
244
+ - Ensure SpamAssassin and ClamAV are working by sending test emails that should be marked as spam or contain malicious attachments.
245
+
246
+ ### Important Note:
247
+ Setting up a mail server is complex and involves many aspects, particularly regarding securing and optimizing your server. Make sure to refer to the official documentation of each software and consider security best practices, such as using SSL/TLS, properly setting up DNS records (SPF, DKIM, DMARC), and establishing appropriate access control lists.
248
+
249
+ This guide provides a very basic overview, and you should refer to the specific FreeBSD, Postfix, Dovecot, RoundCube, SpamAssassin, and ClamAV documentation for detailed instructions and advanced configuration options.
@@ -0,0 +1,307 @@
1
+ <span align="right">
2
+
3
+ [Main menu](../atome.md)
4
+ -
5
+ </span>
6
+ <span align="left">
7
+
8
+ [back](./kickstart.md)
9
+
10
+ </span>
11
+
12
+
13
+ Install atome prerequisites
14
+ -
15
+
16
+ #Install atome (OSX)
17
+
18
+ IMPORTANT :
19
+ For tauri in prod in "exe/atome" in :
20
+ def build_for_osx(destination).. type:
21
+
22
+ `cd #{destination};cargo tauri build`
23
+ for dev type :
24
+
25
+ `cd #{destination};cargo tauri dev`
26
+
27
+
28
+ Install rust & tauri
29
+
30
+ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
31
+ brew install openssl
32
+ cargo install tauri-cli --force
33
+
34
+ Install Homebew
35
+
36
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
37
+
38
+ Install rbenv, wasi-vfs, wasmtime :
39
+ brew install rbenv
40
+ # brew install wasmtime
41
+ => please check as it is certainly useless because we have in vendor/src-wasm/wasm/wasi_vfs_...,
42
+ if need to install use : brew install wasi-vfs
43
+
44
+ brew install npm
45
+ npm install --save ruby-3_2-wasm-wasi@latest
46
+
47
+ Install ruby :
48
+ rbenv install -l
49
+ rbenv install 3.2.2
50
+
51
+ nano ~/.zshrc => add : eval "$(rbenv init - zsh)"
52
+ rbenv shell 3.2.2
53
+ rbenv global 3.2.2
54
+ gem update --system
55
+ gem update
56
+
57
+ Get atome gem :
58
+ git clone https://github.com/atomecorp/atome.git
59
+
60
+ In the terminal at atome root , type:
61
+ bundle install
62
+ Bundle update
63
+
64
+ Ruby wasm time allow local use of ruby wasm :
65
+ 1 - download :
66
+ https://cdn.jsdelivr.net/npm/@ruby/3.2-wasm-wasi@2.3.0/dist/browser.script.iife2.js
67
+ 2 - change
68
+
69
+
70
+ # how to Install on windows :
71
+
72
+ # Install ruby :
73
+ https://rubyinstaller.org/downloads install with devkit
74
+ # check install using :
75
+ ruby -v
76
+ gem list
77
+
78
+ # update gem using the two following commands
79
+ gem update --system
80
+ gem update
81
+
82
+ #install node:
83
+ https://nodejs.org/en/download
84
+ # check install using :
85
+ node -v
86
+
87
+ #install wasi :
88
+ npm install --save ruby-3_2-wasm-wasi@latest
89
+
90
+ #install rust :
91
+ https://www.rust-lang.org/tools/install use rustup
92
+ # check install using :
93
+ rustc --version
94
+
95
+
96
+ #install tauri:
97
+ npm install --save-dev @tauri-apps/cli
98
+ # check install using :
99
+ npm fund
100
+
101
+ #install wasmtime :
102
+ https://wasmtime.dev/
103
+ # check install using :
104
+ ruby wastime --version
105
+
106
+ #install git :
107
+ https://git-scm.com/
108
+
109
+
110
+ # Get atome framework :
111
+ git clone https://github.com/atomecorp/atome.git
112
+
113
+ # go in the cloned directory the in the terminal at atome root , type:
114
+ bundle install
115
+ Bundle update
116
+
117
+ # to check we build atome gem
118
+ rake build_gem
119
+
120
+ # in the terminal type
121
+ gem list
122
+ # check atome is part of the list of the gems
123
+
124
+ # then in the folder of your choice create a new atome app using :
125
+ atome create my_app
126
+ cd my_app
127
+ atome run browser
128
+
129
+
130
+ getter setter for atome are situated in lib/atome/genesis/genesis.rb : def new_atome(element, &method_proc)
131
+ the getter return a group from the collected atomes ( all included atomes)
132
+
133
+
134
+
135
+ # Third parties's javascript libraries are located at different location
136
+ # If you need to update it or add a JS library you need to clone : https://github.com/atomecorp/atome_third_parties_js.git
137
+
138
+ The importance of the type :
139
+
140
+ When a new atome is created the rendering occurs when it’s type is set : see : lib/atome/generators/identity.rb
141
+
142
+ ##### rendering a new atome type
143
+
144
+ Rendering special atomes (color, shadow)that that only affect materials atome(shape, text)
145
+
146
+ When crating a new atome the first thing the system is looking at Is ‘type’ so to render, go to identity.rb in your current render folder (ex :html) and create renderer for the current atom type ex :
147
+ new({ method: :type, type: :string, specific: :shape, renderer: :html }) do |_value, _user_proc|
148
+ html.shape(@atome[:id])
149
+ end
150
+
151
+
152
+ Paths:
153
+
154
+ new render here : /Users/jean-ericgodard/Documents/Work/codes/atome/lib/atome/extensions/atome.rb
155
+ class Object
156
+ def new(params, &bloc)
157
+
158
+ rendering call here: /Users/jean-ericgodard/Documents/Work/codes/atome/lib/renderers/renderer.rb
159
+
160
+ Automatic renderer generation here: /Users/jean-ericgodard/Documents/Work/codes/atome/lib/atome/extensions/atome.rb :
161
+ class Object
162
+ def new(params, &bloc)
163
+
164
+ renderers are build here : /Users/jean-ericgodard/Documents/Work/codes/atome/lib/atome/genesis/genesis.rb
165
+ def build_render(renderer_name, &method_proc)
166
+
167
+ remove condition /Users/jean-ericgodard/Documents/Work/codes/atome/lib/renderers/renderer.rb in def rendering
168
+
169
+ New particle example :
170
+
171
+ new({ particle: :shell })
172
+ # automatically create a @shell instance variable in the atome to store the value
173
+ Usage :
174
+
175
+ s=shape({})
176
+ s.shell(‘pwd’)
177
+ s.shape => ‘pwd’
178
+
179
+ Callback :
180
+
181
+
182
+ Important : all atome particle have a pros associated often use for callback when needed :
183
+ to acces this code use "particle_name_code" ex for touch to access the callbacks use : touch_code
184
+ s.shell(‘pwd’) do |method_return|
185
+ puts method_return
186
+ end
187
+ # note that automatically create a @shell_code instance variable in the atome to store proc
188
+
189
+ Also atome automatically create a call back method suffix with ‘_callback’ ex: shell_callback
190
+ If you call this method the bloc will be executed with the value as parameters
191
+
192
+ This automatic method could be override using : new({callback: :shell}) do |params, bloc|
193
+ # …write what you want …
194
+ end
195
+
196
+ To get the proc you’ll need to use :
197
+ s.shell_code[:shell]
198
+ # please note that s.shell_code return a hash because a single particle may hold many proc (by default the method_code return the default code )
199
+
200
+
201
+
202
+ Callback from javascript :
203
+ In : vendor/assets/src/js/specific/ there’s two methods used to handle callback
204
+ The easier method to send the callback to ruby is to use atomeJsToRuby like this :
205
+
206
+ With javascript you can call the internal ‘automatically created ‘ method : termninal_callback and send them the data getter from javascript like this :
207
+ atomeJsToRuby(‘particle_callback', "('" + js_data + "')")
208
+ Exemple with terminal particle:
209
+ atomeJsToRuby('termninal_callback', "('" + cmd_result + "')")
210
+ Or call the callback like this :
211
+ atomeJsToRuby( " instance_variable_set(‘@terminal_code’, "’" +data+  "’" )")
212
+ atomeJsToRuby("callback(:terminal) ")
213
+
214
+ One is called wasm.js directory and one called opal.js both have the same method : atomeJsToRuby
215
+
216
+ On the js side there’s a special method call ‘callback’ in atome.js file , this method handle all the needed code to create a callback, this method is call like this:
217
+ callback(particle, value)
218
+ Ex : callback('terminal', ‘cmd’)
219
+
220
+
221
+ The power of ‘A’
222
+ # the constant A is used to access any atomes methods without having to create a new atome
223
+ Ex :
224
+ A.monitor({ atomes: [:the_box, :the_cirle], particles: [:left] }) do |atome, particle, value|
225
+ puts "changes : #{atome.id}, #{particle}, #{value}"
226
+ end
227
+
228
+ to prevent a particle data to be saved you can use :
229
+
230
+ new ({particle: :build, store: false}) do
231
+
232
+ # …..
233
+ end
234
+ To save manually you can use the store method , like this :
235
+
236
+ store({build: :my_data })
237
+
238
+ The modifier atomes (color, shadow)
239
+ Here is the mechanism of such atome:
240
+
241
+
242
+ Important:
243
+
244
+ Each Each particles and atome is store as an :
245
+ - Particle as an Instant variable in the object itself , get the value of the article simply using : atome.particle
246
+ - Each particle as a hash in the the instance variable @atome within the atome you can retrieve any particle content using : @atome[:particle]
247
+ - The atome object is also available in html in the @atome instance variable
248
+ - Atome object is also available in the class Universe within @atomes , to retrieve it use Universe.atomes[atome_id]
249
+
250
+ It may need a bit more optimization
251
+
252
+
253
+ Atomes have a special method to monitor all attached /affected atomes , call : Atome.global_monitoring
254
+ Code at : helpers/utilities.rb /def global_monitoring
255
+ Usage :
256
+ Atome.global_monitoring(self, [:red, :blue, :blue, :alpha, :left, :right, :diffusion], [:variable1, :variable2])
257
+
258
+ The ephemera @new_atome to allow access to data send to the atome at init time
259
+
260
+ Important : for atomes that needs to be attached or apply to
261
+ This happen in the method in presets/atome.rb : atome_common
262
+ at this line :
263
+ if params[:type] == :color || basic_params[:type] == :color || params[:type] == :shadow || basic_params[:type] == :shadow
264
+
265
+
266
+ Sanitizer , pre, post , after in atome/helpers/utilities.rb
267
+
268
+ Sanitizer :
269
+ Particle : allow to modify params send by user before parsing creation (context is the current atome)
270
+ Atome : allow to modify params send by user before parsing creation
271
+
272
+ To remove : in material.b add it to : « new({post: :remove}) do |params| »
273
+
274
+
275
+ Pre :
276
+ Particle : after params parsing and before rendering (context is the current atome)
277
+ Atome : after params parsing and before atome creation (context is the parent atome)
278
+
279
+ Post
280
+ Particle : after params parsing and after rendering (context is the current atome)
281
+ Atome: after params parsing and after atome creation (context is the current atome)
282
+
283
+ After :
284
+ Particle : only after rendering and storage (context is the current atome)
285
+
286
+ read:
287
+ To alter a particle before getting the value
288
+
289
+
290
+
291
+ pay attention to atome category material vs modifier
292
+ color, shadow and paint are modifier
293
+ while shape, image, vector, video audio are materials
294
+
295
+ there is some specific treatment/code here :
296
+ in presets/atome, atome_common:
297
+ if %i[color shadow paint].include?(atome_preset)
298
+
299
+ and in genesis, new_atome :
300
+ : if %i[color shadow paint].include?(element)
301
+
302
+
303
+
304
+
305
+ atome expert and atome developers
306
+ expert develop atome core
307
+ developers create solution with atome framework
data/lib/atome/atome.rb CHANGED
@@ -39,6 +39,7 @@ class Atome
39
39
  # @callback = {}
40
40
  @tag = {}
41
41
  @tick={}
42
+ @storage={}
42
43
  @behavior = {}
43
44
  @selected = false
44
45
  #@metrics = {}
@@ -47,7 +48,7 @@ class Atome
47
48
  @collect = {}
48
49
  @int8 = {}
49
50
  @css = {}
50
- @aid = identity_generator
51
+ @aid= new_atome[:aid] || identity_generator
51
52
  @controller_proc=[]
52
53
  @id = new_atome[:id] || @aid
53
54
  Universe.atomes.each do |_aid,atome_f|
@@ -89,8 +90,6 @@ class Atome
89
90
  # # instance_exec(p_found, &bloc) if bloc.is_a?(Proc)
90
91
  # end
91
92
  # end
92
-
93
-
94
93
  end
95
94
 
96
95
  def js
@@ -24,7 +24,6 @@ module ObjectExtension
24
24
  store: params[:store], type: params[:type],
25
25
  category: params[:category] }, &bloc)
26
26
  end
27
-
28
27
  elsif params.key?(:sanitizer)
29
28
  Genesis.build_sanitizer(params[:sanitizer], &bloc)
30
29
  elsif params.key?(:pre)
@@ -55,6 +54,30 @@ module ObjectExtension
55
54
  molecule=params[:molecule]
56
55
  Genesis.build_molecule(molecule, &bloc)
57
56
  Universe.add_to_molecule_list(molecule)
57
+
58
+ # elsif params.key?(:applicaton)
59
+ # alert params
60
+
61
+ # molecule=params[:molecule]
62
+ # Genesis.build_molecule(molecule, &bloc)
63
+ # Universe.add_to_molecule_list(molecule)
64
+ elsif params.key?(:tool)
65
+ # we only store tools definition in the universe so it can be instanced using "A.build_tool" method when needed
66
+
67
+ tool_content = Atome.instance_exec(&bloc) if bloc.is_a?(Proc)
68
+
69
+ Universe.tools[params[:tool]]=tool_content
70
+ # Universe.tools[params[:tool]]=bloc
71
+
72
+ elsif params.key?(:template)
73
+ A.build_template(&bloc)
74
+ elsif params.key?(:code)
75
+ A.build_code(&bloc)
76
+ elsif params.key?(:test)
77
+ A.build_test(&bloc)
78
+ elsif params.key?(:preset)
79
+ Atome.preset_builder(params[:preset], &bloc)
80
+ # A.build_test(&bloc)
58
81
  end
59
82
  super if defined?(super)
60
83
  end
@@ -137,6 +160,9 @@ class Object
137
160
  end
138
161
 
139
162
  def grab(id_to_get)
163
+ if id_to_get.instance_of? Atome
164
+ alert id_to_get.id
165
+ end
140
166
  id_to_get=id_to_get.to_sym
141
167
  return if id_to_get == false
142
168
  aid_to_get= Universe.atomes_ids[id_to_get]
@@ -156,17 +182,17 @@ class Object
156
182
  Universe.atomes[aid_to_get]
157
183
  end
158
184
 
159
- def box(params = {}, &proc)
160
- grab(:view).box(params, &proc)
161
- end
162
-
163
- # def intuition(params = {}, &proc)
164
- # grab(:view).intuition(params, &proc)
185
+ # def box(params = {}, &proc)
186
+ # grab(:view).box(params, &proc)
187
+ # end
188
+ #
189
+ # # def intuition(params = {}, &proc)
190
+ # # grab(:view).intuition(params, &proc)
191
+ # # end
192
+ #
193
+ # def circle(params = {}, &proc)
194
+ # grab(:view).circle(params, &proc)
165
195
  # end
166
-
167
- def circle(params = {}, &proc)
168
- grab(:view).circle(params, &proc)
169
- end
170
196
 
171
197
  # the method below generate Atome method creation at Object level
172
198
  def atome_method_for_object(element)
@@ -225,7 +251,7 @@ class Object
225
251
  }
226
252
 
227
253
  function myAction(counter) {
228
- rubyVMCallback("repeat_callback(#{repeat_id}, "+counter+")")
254
+ atomeJsToRuby("repeat_callback(#{repeat_id}, "+counter+")")
229
255
  }
230
256
 
231
257
  const intervalId = repeat(myAction, #{delay} * 1000, #{repeat});
@@ -101,7 +101,7 @@ end
101
101
  new({ atome: :machine })
102
102
  new({ atome: :paint })
103
103
  new({ atome: :vector })
104
- new({ atome: :matrix })
104
+ new({ atome: :table })
105
105
  new({ atome: :atomized, type: :hash })
106
106
 
107
107
 
@@ -50,13 +50,11 @@ class Genesis
50
50
  new_atome(atome_name, &atome_proc)
51
51
 
52
52
  end
53
+
53
54
  def build_molecule(molecule_name, &molecule_proc)
54
55
  new_molecule(molecule_name, &molecule_proc)
55
56
  end
56
57
 
57
-
58
-
59
-
60
58
  def auto_render_generator(element)
61
59
  Universe.renderer_list.each do |render_engine|
62
60
  build_render("#{render_engine}_#{element}",)
@@ -164,9 +162,9 @@ class Genesis
164
162
  else
165
163
  # collected_atomes = attached
166
164
  # if @attached
167
- attached.each do |attached_atome|
168
- collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
169
- end
165
+ attached.each do |attached_atome|
166
+ collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
167
+ end
170
168
  # end
171
169
 
172
170
  end
@@ -187,7 +185,7 @@ class Genesis
187
185
  if Universe.atomes[params[:id]]
188
186
  # if atome id already exist we grab the previous one
189
187
  # this prevent the creation of new atome if the atome already exist
190
- previous_atome= grab(params[:id])
188
+ previous_atome = grab(params[:id])
191
189
  # now we must re-affect affected atomes
192
190
  previous_atome.affect(params[:affect])
193
191
  previous_atome
@@ -202,12 +200,14 @@ class Genesis
202
200
  def new_molecule(molecule, &method_proc)
203
201
 
204
202
  Molecule.define_method molecule do |params, &user_proc|
205
- m= instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
206
- m
203
+ object_to_return = instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
204
+ # new_objet = Object.new
205
+ # # we store the molecule into an instance variable in a basic ruby object
206
+ # new_objet.instance_variable_set(:@molecule, object_to_return)
207
+ # new_objet
208
+ object_to_return
207
209
  end
208
210
 
209
-
210
-
211
211
  # # the method define below is the slowest but params are analysed and sanitized
212
212
  # Atome.define_method element do |params = nil, &user_proc|
213
213
  # instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)