atome 0.5.4.1.9 → 0.5.5.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/README.md +70 -1
  4. data/Rakefile +246 -75
  5. data/app_builder_helpers/Rakefile +276 -288
  6. data/documentation/basic.md +242 -0
  7. data/documentation/deep learning/architecture.txt +3763 -0
  8. data/documentation/deep learning/atome.png +0 -0
  9. data/documentation/deep learning/basic_infos.txt +227 -0
  10. data/documentation/deep learning/example_of_users_code.rb +1810 -0
  11. data/documentation/deep learning/misc.txt +24 -0
  12. data/documentation/deep learning/ruby_js_example.rb +272 -0
  13. data/documentation/deep learning/wasm_script_help.text +14 -0
  14. data/documentation/framework/enhance_atome.md +1 -1
  15. data/documentation/tutorials/tutorials.md +7 -0
  16. data/exe/atome +308 -208
  17. data/lib/atome/atome.rb +52 -156
  18. data/lib/atome/extensions/atome.rb +129 -47
  19. data/lib/atome/extensions/mathematics.rb +20 -0
  20. data/lib/atome/extensions/ping.rb +2 -3
  21. data/lib/atome/genesis/generators/atome.rb +57 -30
  22. data/lib/atome/genesis/generators/communication.rb +9 -0
  23. data/lib/atome/genesis/generators/effect.rb +0 -1
  24. data/lib/atome/genesis/generators/event.rb +279 -43
  25. data/lib/atome/genesis/generators/geometry.rb +1 -10
  26. data/lib/atome/genesis/generators/hierarchy.rb +103 -0
  27. data/lib/atome/genesis/generators/identity.rb +45 -84
  28. data/lib/atome/genesis/generators/material.rb +31 -34
  29. data/lib/atome/genesis/generators/property.rb +31 -0
  30. data/lib/atome/genesis/generators/security.rb +31 -0
  31. data/lib/atome/genesis/generators/spatial.rb +3 -5
  32. data/lib/atome/genesis/generators/time.rb +0 -1
  33. data/lib/atome/genesis/generators/utility.rb +181 -66
  34. data/lib/atome/genesis/genesis.rb +152 -55
  35. data/lib/atome/genesis/sparkle.rb +59 -75
  36. data/lib/atome/helpers/color_helper/color/rgb/colors.rb +1 -1
  37. data/lib/atome/helpers/color_helper/color/rgb.rb +1 -1
  38. data/lib/atome/helpers/color_helper/color.rb +226 -7
  39. data/lib/atome/helpers/essentials.rb +22 -26
  40. data/lib/atome/helpers/security.rb +71 -0
  41. data/lib/atome/helpers/utilities.rb +191 -178
  42. data/lib/atome/kernel/black_matter.rb +22 -0
  43. data/lib/atome/kernel/universe.rb +123 -24
  44. data/lib/atome/presets/atome.rb +39 -35
  45. data/lib/atome/version.rb +3 -2
  46. data/lib/atome.rb +12 -12
  47. data/lib/atome_relative.rb +36 -0
  48. data/lib/{atome/renderers → platform_specific}/opal/atome_opal_extensions.rb +4 -1
  49. data/lib/{atome/renderers → platform_specific}/opal/extensions/color.rb +12 -5
  50. data/lib/{atome/renderers → platform_specific}/opal/extensions/geolocation.rb +1 -0
  51. data/lib/platform_specific/opal/extensions/js.rb +21 -0
  52. data/lib/platform_specific/opal/extensions/object.rb +6 -0
  53. data/lib/platform_specific/opal/extensions/ping.rb +31 -0
  54. data/lib/{atome/renderers → platform_specific}/opal/extensions/sha.rb +4 -2
  55. data/lib/platform_specific/wasm/atome_wasm_extensions.rb +11 -0
  56. data/lib/renderers/headless/headless.rb +18 -0
  57. data/lib/renderers/headless/index.rb +6 -0
  58. data/lib/renderers/headless/index_relative.rb +6 -0
  59. data/lib/renderers/headless/utility.rb +6 -0
  60. data/{vendor/assets/src/medias/rubies/examples/top.rb → lib/renderers/html/atome.rb} +0 -1
  61. data/lib/renderers/html/atome_html.rb +22 -0
  62. data/lib/renderers/html/effect.rb +26 -0
  63. data/lib/renderers/html/event.rb +43 -0
  64. data/lib/renderers/html/geometry.rb +31 -0
  65. data/lib/renderers/html/hierarchy.rb +233 -0
  66. data/lib/renderers/html/html.rb +1112 -0
  67. data/lib/renderers/html/identity.rb +84 -0
  68. data/lib/renderers/html/index.rb +19 -0
  69. data/lib/renderers/html/index_relative.rb +20 -0
  70. data/lib/renderers/html/material.rb +53 -0
  71. data/lib/renderers/html/property.rb +24 -0
  72. data/lib/renderers/html/spatial.rb +46 -0
  73. data/lib/renderers/html/time.rb +1 -0
  74. data/lib/renderers/html/utility.rb +38 -0
  75. data/lib/renderers/renderer.rb +16 -0
  76. data/lib/renderers/server/index.rb +4 -0
  77. data/lib/renderers/server/index_relative.rb +4 -0
  78. data/lib/renderers/server/utility.rb +4 -0
  79. data/sig/atome.rbs +6 -0
  80. data/sig/object.rbs +4 -0
  81. data/sig/universe.rbs +3 -0
  82. data/vendor/assets/Rakefile +3 -3
  83. data/vendor/assets/application/examples/a_concat.rb +16 -0
  84. data/vendor/assets/application/examples/affect.rb +8 -0
  85. data/vendor/assets/application/examples/animation.rb +96 -0
  86. data/vendor/assets/application/examples/apply.rb +8 -0
  87. data/vendor/assets/application/examples/atome.rb +5 -0
  88. data/vendor/assets/application/examples/attach.rb +34 -0
  89. data/vendor/assets/application/examples/attached.rb +38 -0
  90. data/vendor/assets/application/examples/basic_understanding.rb +52 -0
  91. data/vendor/assets/application/examples/browse.rb +17 -0
  92. data/vendor/assets/application/examples/callback.rb +20 -0
  93. data/vendor/assets/application/examples/category.rb +12 -0
  94. data/vendor/assets/application/examples/clear.rb +96 -0
  95. data/vendor/assets/application/examples/clones.rb +177 -0
  96. data/vendor/assets/application/examples/code.rb +13 -0
  97. data/vendor/assets/application/examples/color.rb +54 -0
  98. data/vendor/assets/application/examples/convert.rb +163 -0
  99. data/vendor/assets/application/examples/copy.rb +25 -0
  100. data/vendor/assets/application/examples/copybck.rb +68 -0
  101. data/vendor/assets/application/examples/debug.rb +78 -0
  102. data/vendor/assets/application/examples/delete.rb +93 -0
  103. data/vendor/assets/application/examples/display.rb +279 -0
  104. data/vendor/assets/application/examples/display_bck.rb +164 -0
  105. data/vendor/assets/application/examples/drag.rb +45 -0
  106. data/vendor/assets/application/examples/drop.rb +35 -0
  107. data/vendor/assets/application/examples/duplicate.rb +64 -0
  108. data/vendor/assets/application/examples/edit.rb +21 -0
  109. data/vendor/assets/application/examples/encode.rb +6 -0
  110. data/vendor/assets/application/examples/file.rb +50 -0
  111. data/vendor/assets/application/examples/find.rb +157 -0
  112. data/vendor/assets/application/examples/generator_and_build.rb +15 -0
  113. data/vendor/assets/application/examples/getter.rb +16 -0
  114. data/vendor/assets/application/examples/grab.rb +14 -0
  115. data/vendor/assets/application/examples/gradient.rb +35 -0
  116. data/vendor/assets/application/examples/group.rb +44 -0
  117. data/vendor/assets/application/examples/hierarchy.rb +21 -0
  118. data/vendor/assets/application/examples/history.rb +31 -0
  119. data/vendor/assets/application/examples/hypertext.rb +113 -0
  120. data/vendor/assets/application/examples/image.rb +5 -0
  121. data/vendor/assets/application/examples/keyboard.rb +59 -0
  122. data/vendor/assets/application/examples/layout.rb +227 -0
  123. data/vendor/assets/application/examples/login.rb +10 -0
  124. data/vendor/assets/application/examples/markup.rb +4 -0
  125. data/vendor/assets/application/examples/match.rb +115 -0
  126. data/vendor/assets/application/examples/messaging.rb +16 -0
  127. data/vendor/assets/application/examples/monitor.rb +14 -0
  128. data/vendor/assets/application/examples/on_resize.rb +7 -0
  129. data/vendor/assets/{src/medias/rubies/examples/get_renderer_list.rb → application/examples/online.rb} +1 -1
  130. data/vendor/assets/application/examples/over.rb +29 -0
  131. data/vendor/assets/application/examples/paint.rb +23 -0
  132. data/vendor/assets/application/examples/particles.rb +4 -0
  133. data/vendor/assets/application/examples/percent_to_px.rb +4 -0
  134. data/vendor/assets/application/examples/play.rb +50 -0
  135. data/vendor/assets/application/examples/presets.rb +33 -0
  136. data/vendor/assets/application/examples/random.rb +42 -0
  137. data/vendor/assets/application/examples/raw_html.rb +48 -0
  138. data/vendor/assets/application/examples/read.rb +11 -0
  139. data/vendor/assets/application/examples/refresh.rb +62 -0
  140. data/vendor/assets/application/examples/remove.rb +47 -0
  141. data/vendor/assets/application/examples/repeat.rb +26 -0
  142. data/vendor/assets/application/examples/resize.rb +17 -0
  143. data/vendor/assets/application/examples/scroll.rb +11 -0
  144. data/vendor/assets/application/examples/security.rb +76 -0
  145. data/vendor/assets/application/examples/selected.rb +30 -0
  146. data/vendor/assets/application/examples/shadow.rb +46 -0
  147. data/vendor/assets/application/examples/shapes.rb +6 -0
  148. data/vendor/assets/{src/medias/rubies → application}/examples/smooth.rb +5 -1
  149. data/vendor/assets/application/examples/style.rb +4 -0
  150. data/vendor/assets/application/examples/sync.rb +39 -0
  151. data/vendor/assets/application/examples/tagged.rb +24 -0
  152. data/vendor/assets/application/examples/terminal.rb +4 -0
  153. data/vendor/assets/application/examples/text.rb +5 -0
  154. data/vendor/assets/application/examples/touch.rb +38 -0
  155. data/vendor/assets/application/examples/type_mutation.rb +18 -0
  156. data/vendor/assets/application/examples/universe.rb +8 -0
  157. data/vendor/assets/application/examples/vector.rb +24 -0
  158. data/vendor/assets/application/examples/video.rb +14 -0
  159. data/vendor/assets/application/examples/wait.rb +6 -0
  160. data/vendor/assets/application/examples/www.rb +10 -0
  161. data/vendor/assets/application/index.rb +1 -1
  162. data/vendor/assets/application/test.rb +29 -0
  163. data/vendor/assets/application/works/photos.rb +672 -0
  164. data/vendor/assets/application/works/photos2.rb +218 -0
  165. data/vendor/assets/application/works/photos3.rb +343 -0
  166. data/vendor/assets/application/works/photos4.rb +34 -0
  167. data/vendor/assets/application/works/photos6.rb +6 -0
  168. data/vendor/assets/application/works/trigga.rb +0 -0
  169. data/vendor/assets/application/works/vie.rb +74 -0
  170. data/vendor/assets/server/atome_server.rb +37 -41
  171. data/vendor/assets/server/atome_server_wasm.rb +112 -0
  172. data/vendor/assets/server/capture.rb +10 -0
  173. data/vendor/assets/server/config.ru +5 -4
  174. data/vendor/assets/src/css/style.css +29 -4
  175. data/vendor/assets/src/index.html +31 -38
  176. data/vendor/assets/src/index_opal.html +42 -0
  177. data/vendor/assets/src/index_server.html +43 -0
  178. data/vendor/assets/src/index_server_wasm.html +46 -0
  179. data/vendor/assets/src/js/atome/atome.js +170 -150
  180. data/vendor/assets/src/js/atome/atome_helpers/add_font.js +46 -0
  181. data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +3 -1
  182. data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +12 -7
  183. data/vendor/assets/src/js/atome/atome_helpers/communication.js +126 -0
  184. data/vendor/assets/src/js/atome/atome_helpers/{atome_file.js → file.js} +1 -1
  185. data/vendor/assets/src/js/atome/specific/opal.js +3 -0
  186. data/vendor/assets/src/js/atome/specific/wasm.js +12 -0
  187. data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +13 -0
  188. data/vendor/assets/src/js/third_parties/fabric.min.js +1 -1
  189. data/vendor/assets/src/js/third_parties/html-to-image.min.js +2 -0
  190. data/vendor/assets/src/js/third_parties/jsencrypt.min.js +2 -0
  191. data/vendor/assets/src/js/third_parties/papaparse.min.js +7 -0
  192. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +202 -0
  193. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
  194. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  195. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
  196. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  197. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
  198. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
  199. data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  200. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
  201. data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  202. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
  203. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
  204. data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  205. data/vendor/assets/src/medias/images/logos/Facebook.svg +1 -1
  206. data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +109 -0
  207. data/vendor/assets/src/medias/images/logos/LinkedIn.svg +11 -0
  208. data/vendor/assets/src/medias/images/logos/X.svg +5 -0
  209. data/vendor/assets/src-tauri/Cargo.toml +1 -1
  210. data/vendor/assets/src-tauri/src/main.rs +59 -5
  211. data/vendor/assets/src-tauri/tauri.conf.json +1 -1
  212. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
  213. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
  214. data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
  215. data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
  216. metadata +188 -180
  217. data/lib/atome/extensions/mathematic.rb +0 -20
  218. data/lib/atome/extensions/matrix.rb +0 -346
  219. data/lib/atome/helpers/callbacks.rb +0 -133
  220. data/lib/atome/kernel/batch.rb +0 -26
  221. data/lib/atome/kernel/essentials.rb +0 -23
  222. data/lib/atome/renderers/browser/atome.rb +0 -177
  223. data/lib/atome/renderers/browser/browser.rb +0 -47
  224. data/lib/atome/renderers/browser/effect.rb +0 -23
  225. data/lib/atome/renderers/browser/event.rb +0 -96
  226. data/lib/atome/renderers/browser/geometry.rb +0 -27
  227. data/lib/atome/renderers/browser/helpers/animation_helper.rb +0 -69
  228. data/lib/atome/renderers/browser/helpers/browser_helper.rb +0 -101
  229. data/lib/atome/renderers/browser/helpers/color_helper.rb +0 -95
  230. data/lib/atome/renderers/browser/helpers/drag_helper.rb +0 -52
  231. data/lib/atome/renderers/browser/helpers/drop_helper.rb +0 -13
  232. data/lib/atome/renderers/browser/helpers/effect_helper.rb +0 -23
  233. data/lib/atome/renderers/browser/helpers/event_helper.rb +0 -76
  234. data/lib/atome/renderers/browser/helpers/image_helper.rb +0 -27
  235. data/lib/atome/renderers/browser/helpers/over_helper.rb +0 -13
  236. data/lib/atome/renderers/browser/helpers/shadow_helper.rb +0 -74
  237. data/lib/atome/renderers/browser/helpers/shape_helper.rb +0 -22
  238. data/lib/atome/renderers/browser/helpers/text_helper.rb +0 -38
  239. data/lib/atome/renderers/browser/helpers/video_helper.rb +0 -50
  240. data/lib/atome/renderers/browser/helpers/web_helper.rb +0 -26
  241. data/lib/atome/renderers/browser/identity.rb +0 -61
  242. data/lib/atome/renderers/browser/material.rb +0 -121
  243. data/lib/atome/renderers/browser/opal_add_on.rb +0 -32
  244. data/lib/atome/renderers/browser/opal_browser.rb +0 -6
  245. data/lib/atome/renderers/browser/spatial.rb +0 -59
  246. data/lib/atome/renderers/browser/time.rb +0 -3
  247. data/lib/atome/renderers/browser/utility.rb +0 -49
  248. data/lib/atome/renderers/headless/headless.rb +0 -10
  249. data/lib/atome/renderers/headless/utility.rb +0 -6
  250. data/lib/atome/renderers/html/atome.rb +0 -49
  251. data/lib/atome/renderers/html/effect.rb +0 -19
  252. data/lib/atome/renderers/html/event.rb +0 -9
  253. data/lib/atome/renderers/html/geometry.rb +0 -11
  254. data/lib/atome/renderers/html/html.rb +0 -42
  255. data/lib/atome/renderers/html/identity.rb +0 -14
  256. data/lib/atome/renderers/html/opal_browser.rb +0 -6
  257. data/lib/atome/renderers/html/spatial.rb +0 -28
  258. data/lib/atome/renderers/html/utility.rb +0 -17
  259. data/lib/atome/renderers/opal/extensions/atome.rb +0 -29
  260. data/lib/atome/renderers/opal/extensions/ping.rb +0 -18
  261. data/lib/atome/renderers/renderer.rb +0 -15
  262. data/lib/atome/renderers/server/server.rb +0 -10
  263. data/lib/atome/renderers/server/utility.rb +0 -6
  264. data/vendor/assets/aui.rb +0 -5
  265. data/vendor/assets/r&d/misc.rb +0 -219
  266. data/vendor/assets/r&d/ping.rb +0 -3
  267. data/vendor/assets/r&d/storage.rb +0 -9
  268. data/vendor/assets/r&d/view_example.rb +0 -21
  269. data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +0 -40
  270. data/vendor/assets/src/medias/javascripts/test.js +0 -1
  271. data/vendor/assets/src/medias/rubies/demos.rb +0 -63
  272. data/vendor/assets/src/medias/rubies/examples/add.rb +0 -24
  273. data/vendor/assets/src/medias/rubies/examples/animation.rb +0 -81
  274. data/vendor/assets/src/medias/rubies/examples/atome_new.rb +0 -27
  275. data/vendor/assets/src/medias/rubies/examples/attach.rb +0 -15
  276. data/vendor/assets/src/medias/rubies/examples/attached.rb +0 -15
  277. data/vendor/assets/src/medias/rubies/examples/auto_height.rb +0 -5
  278. data/vendor/assets/src/medias/rubies/examples/auto_width.rb +0 -4
  279. data/vendor/assets/src/medias/rubies/examples/batch.rb +0 -17
  280. data/vendor/assets/src/medias/rubies/examples/blur.rb +0 -4
  281. data/vendor/assets/src/medias/rubies/examples/bottom.rb +0 -3
  282. data/vendor/assets/src/medias/rubies/examples/box.rb +0 -20
  283. data/vendor/assets/src/medias/rubies/examples/center.rb +0 -21
  284. data/vendor/assets/src/medias/rubies/examples/circle.rb +0 -3
  285. data/vendor/assets/src/medias/rubies/examples/class.rb +0 -13
  286. data/vendor/assets/src/medias/rubies/examples/clear.rb +0 -10
  287. data/vendor/assets/src/medias/rubies/examples/clone.rb +0 -35
  288. data/vendor/assets/src/medias/rubies/examples/code.rb +0 -11
  289. data/vendor/assets/src/medias/rubies/examples/color.rb +0 -73
  290. data/vendor/assets/src/medias/rubies/examples/create_atome_in_atome.rb +0 -13
  291. data/vendor/assets/src/medias/rubies/examples/cursor.rb +0 -7
  292. data/vendor/assets/src/medias/rubies/examples/delete.rb +0 -42
  293. data/vendor/assets/src/medias/rubies/examples/depth.rb +0 -6
  294. data/vendor/assets/src/medias/rubies/examples/detached.rb +0 -13
  295. data/vendor/assets/src/medias/rubies/examples/drag.rb +0 -98
  296. data/vendor/assets/src/medias/rubies/examples/drop.rb +0 -26
  297. data/vendor/assets/src/medias/rubies/examples/edit.rb +0 -12
  298. data/vendor/assets/src/medias/rubies/examples/element.rb +0 -6
  299. data/vendor/assets/src/medias/rubies/examples/empty_atome.rb +0 -12
  300. data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +0 -15
  301. data/vendor/assets/src/medias/rubies/examples/grab.rb +0 -5
  302. data/vendor/assets/src/medias/rubies/examples/height.rb +0 -7
  303. data/vendor/assets/src/medias/rubies/examples/hide.rb +0 -7
  304. data/vendor/assets/src/medias/rubies/examples/id.rb +0 -14
  305. data/vendor/assets/src/medias/rubies/examples/image.rb +0 -8
  306. data/vendor/assets/src/medias/rubies/examples/left.rb +0 -7
  307. data/vendor/assets/src/medias/rubies/examples/link.rb +0 -22
  308. data/vendor/assets/src/medias/rubies/examples/markers.rb +0 -48
  309. data/vendor/assets/src/medias/rubies/examples/materials.rb +0 -15
  310. data/vendor/assets/src/medias/rubies/examples/matrix.rb +0 -102
  311. data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +0 -483
  312. data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +0 -32
  313. data/vendor/assets/src/medias/rubies/examples/monitoring.rb +0 -70
  314. data/vendor/assets/src/medias/rubies/examples/mute.rb +0 -22
  315. data/vendor/assets/src/medias/rubies/examples/on.rb +0 -26
  316. data/vendor/assets/src/medias/rubies/examples/opacity.rb +0 -5
  317. data/vendor/assets/src/medias/rubies/examples/over.rb +0 -21
  318. data/vendor/assets/src/medias/rubies/examples/pause.rb +0 -15
  319. data/vendor/assets/src/medias/rubies/examples/physical.rb +0 -19
  320. data/vendor/assets/src/medias/rubies/examples/play.rb +0 -15
  321. data/vendor/assets/src/medias/rubies/examples/read.rb +0 -11
  322. data/vendor/assets/src/medias/rubies/examples/refresh.rb +0 -8
  323. data/vendor/assets/src/medias/rubies/examples/remove.rb +0 -16
  324. data/vendor/assets/src/medias/rubies/examples/repeat.rb +0 -6
  325. data/vendor/assets/src/medias/rubies/examples/right.rb +0 -3
  326. data/vendor/assets/src/medias/rubies/examples/rotate.rb +0 -4
  327. data/vendor/assets/src/medias/rubies/examples/schedule.rb +0 -13
  328. data/vendor/assets/src/medias/rubies/examples/shadow.rb +0 -84
  329. data/vendor/assets/src/medias/rubies/examples/size.rb +0 -8
  330. data/vendor/assets/src/medias/rubies/examples/sort.rb +0 -18
  331. data/vendor/assets/src/medias/rubies/examples/style.rb +0 -4
  332. data/vendor/assets/src/medias/rubies/examples/tags.rb +0 -10
  333. data/vendor/assets/src/medias/rubies/examples/text.rb +0 -39
  334. data/vendor/assets/src/medias/rubies/examples/time.rb +0 -18
  335. data/vendor/assets/src/medias/rubies/examples/to_px.rb +0 -10
  336. data/vendor/assets/src/medias/rubies/examples/touch.rb +0 -56
  337. data/vendor/assets/src/medias/rubies/examples/vector.rb +0 -39
  338. data/vendor/assets/src/medias/rubies/examples/video.rb +0 -65
  339. data/vendor/assets/src/medias/rubies/examples/wait.rb +0 -8
  340. data/vendor/assets/src/medias/rubies/examples/web.rb +0 -13
  341. data/vendor/assets/src/medias/rubies/examples/width.rb +0 -6
  342. data/vendor/assets/src/medias/rubies/test.rb +0 -1
  343. data/vendor/assets/src/medias/rubies/text_read.rb +0 -1
  344. data/vendor/assets/src/medias/rubies/unstable/!run.rb +0 -16
  345. data/vendor/assets/src/medias/rubies/unstable/_2_solve.rb +0 -72
  346. data/vendor/assets/src/medias/rubies/unstable/_attach.rb +0 -12
  347. data/vendor/assets/src/medias/rubies/unstable/_audio.rb +0 -231
  348. data/vendor/assets/src/medias/rubies/unstable/_dataset.rb +0 -257
  349. data/vendor/assets/src/medias/rubies/unstable/_matrix.rb +0 -58
  350. data/vendor/assets/src/medias/rubies/unstable/_os.rb +0 -29
  351. data/vendor/assets/src/medias/rubies/unstable/_table2.rb +0 -108
  352. data/vendor/assets/src/medias/rubies/unstable/_vie.rb +0 -211
  353. data/vendor/assets/src/medias/rubies/users/code.rb +0 -6
  354. /data/lib/{atome/renderers → platform_specific}/opal/opal.rb +0 -0
  355. /data/lib/{atome/renderers → platform_specific}/opal/opal_parser.rb +0 -0
  356. /data/{vendor/assets/src/utilities/mode.rb → lib/renderers/html/communication.rb} +0 -0
  357. /data/{vendor/assets/src/medias/rubies/unstable/_test.rb → lib/renderers/html/security.rb} +0 -0
data/lib/atome/atome.rb CHANGED
@@ -1,171 +1,67 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # TODO : remove monitoring
4
- # TODO : remove child
5
- # TODO : remove parents
6
-
7
- # main entry here
3
+ # main Atome entry here
8
4
  class Atome
9
- # TODO : clean or delete @private_atome
10
5
  include Essentials
11
6
 
12
- private
13
-
14
- def initialize(atomes = {}, &atomes_proc)
15
-
16
- atomes.each_value do |elements|
17
-
18
- if Universe.atomes.key?(elements[:id])
19
- puts "The id #{elements[:id]} is already taken, you must change it"
20
- # `throw new Error("this id is already exist, you must change it");`
21
- else
22
- # the instance variable below contain the id all any atomes that need to be informed when changes occurs
23
- @broadcast = {}
24
- # # now we store the proc in a an atome's property called :bloc
25
- elements[:code] = atomes_proc if atomes_proc
26
-
27
- @atome = elements
28
- # we initiate the rendering suing set_type method,
29
- # eg for for browser we will call :browser_type generate method in identity.rb file
30
- collapse
31
- end
32
- end
33
- end
34
-
35
- def new_particle(element, store, render, &method_proc)
36
- Atome.define_method element do |params = nil, &user_proc|
37
- if params || params == false
38
- # the line below execute the proc created when using the build_particle method
39
- instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
40
- params = sanitize(element, params, &user_proc)
41
- create_particle(element, store, render)
42
- send("set_#{element}", params, &user_proc)
43
- elsif element == :batch # TODO : find a better solution than a condition if possible
44
- @atome[:batch]
45
- else
46
-
47
- @atome[element]
48
- # get_particle(element, &user_proc)
49
- end
50
- end
51
- end
52
-
53
- def additional_particle_methods(element, store, render, &method_proc)
54
- Atome.define_method "#{element}=" do |params = nil, &user_proc|
55
- instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
56
- params = sanitize(element, params)
57
- particle_creation(element, params, store, render, &user_proc)
58
- end
7
+ def initialize(new_atome = {}, &atomes_proc)
8
+ # the keys :renderers, :type and :id should be placed in the first position in the hash
9
+ #@broadcast = {}
10
+ @history = {}
11
+ @callback = {}
12
+ @tag = {}
13
+ @selected = false
14
+ @unit = {}
15
+ @collect = {}
16
+ @id = new_atome[:id] || identity_generator(:element)
17
+ @type = new_atome[:type] || :element
18
+ @attached = []
19
+ @category = []
20
+ @display = { mode: :default, default: {} }
21
+ # @copy = []
22
+ @html = HTML.new(@id, self)
23
+ @headless = Headless.new(@id, self)
24
+ # now we store the proc in a an atome's property called :bloc
25
+ new_atome[:code] = atomes_proc if atomes_proc
26
+ # we reorder the hash
27
+ ordered_keys = %i[renderers id type]
28
+ ordered_part = ordered_keys.map { |k| [k, new_atome[k]] }.to_h
29
+ other_part = new_atome.reject { |k, _| ordered_keys.include?(k) }
30
+ # merge the parts to obtain an re-ordered hash
31
+ reordered_atome = ordered_part.merge(other_part)
32
+
33
+ # FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
34
+ collapse(reordered_atome)
59
35
  end
60
36
 
61
- def atome_parsing(element, params, &user_proc)
62
- params = sanitize(element, params)
63
- current_atome = send(element)
64
-
65
- # The condition below check if we need to add or replace the newly created atome
66
- if current_atome && !(@atome[:add] && @atome[:add][element])
67
- detached(current_atome)
68
- @atome[element] = []
69
- end
70
- # TODO :replace with the line below but need extensive testing as it crash some demos ex: animation
71
- params = atome_common(element, params)
72
- run_optional_proc("pre_render_#{@atome[:type]}".to_sym, self, params, &user_proc)
73
- run_optional_proc("post_render_#{@atome[:type]}".to_sym, self, params, &user_proc)
74
- send("set_#{element}", params, &user_proc) # it call Atome.define_method "set_#{element}" in new_atome method
75
- end
76
-
77
- def atome_catcher(atome_catch)
78
- # puts "atome_catch is : #{atome_catch.class}"
79
- atome_catch
80
- end
81
-
82
- def new_atome(element, &method_proc)
83
- # the method define below is the slowest but params are analysed and sanitized
84
- Atome.define_method element do |params = nil, &user_proc|
85
- if params
86
- instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
87
- atome_parsing(element, params, &user_proc)
88
- else
89
- # puts "******> we are searching for the atome return(noobs) #{element} : #{id}"
90
- # puts "no atome params"
91
- atome_catcher(@atome[element])
92
- end
93
-
94
- end
95
-
96
- # the method define below is the fastest params are passed directly
97
- Atome.define_method "set_#{element}" do |params, &user_proc|
98
- # we add the newly created atome to the list of "child in it's category, eg if it's a shape we add the new atome
99
- # to the shape particles list : @atome[:shape] << params[:id]
100
- new_atome = Atome.new({ element => params }, &user_proc)
101
- # Now we return the newly created atome instead of the current atome that is the parent cf: b=box; c=b.circle
102
- # c must return the circle not the parent box
103
- # puts "******> we are searching for the atome return(set) #{element} : #{id}"
104
- # puts "no set atome params"
105
- atome_catcher(new_atome)
106
-
107
- end
108
- # the method below generate Atome method creation at Object level
109
- # create_method_at_object_level(element)
110
- end
37
+ def particle_creation(element, params, store, rendering, &user_proc)
111
38
 
112
- def new_render_engine(renderer_name, &method_proc)
113
- Atome.define_method renderer_name do |params = nil, &user_proc|
114
- instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
115
- end
116
- end
117
-
118
- def run_optional_proc(proc_name, atome = self, params, &user_proc)
119
- # params = instance_variable_get("@#{element}")
120
- option_found = Universe.get_optional_method(proc_name)
121
-
122
- # if option_found.is_a?(Proc)
123
- # # alert "#{proc_name} : #{params} "
124
- # else
125
- # puts "proc_name : #{proc_name}, \noption_found : (#{option_found})"
126
- # end
127
- atome.instance_exec(params, user_proc, atome, &option_found) if option_found.is_a?(Proc)
128
- end
129
-
130
- def store_value(element)
131
- params = instance_variable_get("@#{element}")
132
- @atome[element] = params
133
- end
134
-
135
- public
136
-
137
- # the line below is used for ephemera atomes
138
- attr_accessor :property, :value, :real_atome, :user_proc
139
- attr_reader :atome, :structure # , :at_time
140
-
141
- def set(value)
142
- @real_atome[@property] = value
143
- end
144
-
145
- def particle_creation(element, params, store, render, &user_proc)
146
- return false unless security_pass(element, params)
147
-
148
- # we create a proc holder of any new particle if user pass a bloc
149
- store_code_bloc(element, &user_proc) if user_proc
39
+ # @store_allow = false
40
+ params = particle_main(element, params, &user_proc)
150
41
  # Params is now an instance variable so it should be passed thru different methods
151
42
  instance_variable_set("@#{element}", params) if store
152
- run_optional_proc("pre_render_#{element}", self, params, &user_proc)
153
- rendering(element, params, &user_proc) if render
154
- run_optional_proc("post_render_#{element}", self, params, &user_proc)
155
- broadcasting(element)
156
- store_value(element) if store
157
- self
158
- end
43
+ # pre rendering processor
44
+ params = particle_pre(element, params, &user_proc)
45
+ # we create a proc holder of any new particle if user pass a bloc
46
+ particle_callback(element)
47
+ store_proc(element, params, &user_proc) if user_proc
48
+ render(element, params, &user_proc) if rendering
49
+ # broadcasting(element)
50
+ # post rendering processor
51
+ params = particle_post(element, params, &user_proc)
52
+ instance_variable_set("@#{element}", params) if store
53
+ # post storage processor
54
+ particle_after(element, params, &user_proc)
159
55
 
160
- def create_particle(element, store, render)
161
- Atome.define_method "set_#{element}" do |params, &user_proc|
162
- particle_creation(element, params, store, render, &user_proc)
163
- end
56
+ # self
164
57
  end
165
58
 
166
- def get(element)
167
- @atome[element]
168
- end
59
+ def inspect
60
+ filtered_vars = instance_variables.reject { |var| var == :@html_object || var == :@history }
61
+ content = filtered_vars.map do |var|
62
+ "#{var}=#{instance_variable_get(var).inspect}"
63
+ end.join(", ")
169
64
 
170
- Universe.connected
65
+ "#<#{self.class}: #{content}>"
66
+ end
171
67
  end
@@ -1,87 +1,169 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # atome extensions
3
4
  class Object
4
5
  def new(params, &bloc)
5
- generator = Genesis.generator
6
- if params.key?(:particle)
6
+ # Genesis = Genesis.Genesis
7
+ if params.key?(:atome)
8
+ Universe.add_atomes_specificities params[:atome]
9
+ Genesis.build_atome(params[:atome], &bloc)
10
+ elsif params.key?(:particle)
11
+ Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
7
12
  # render indicate if the particle needs to be rendered
8
13
  # store tell the system if it need to store the particle value
9
14
  # type help the system what type of type the particle will receive and store
10
- generator.build_particle(params[:particle], { render: params[:render], return: params[:return],
11
- store: params[:store], type: params[:type] }, &bloc)
12
- elsif params.key?(:atome)
13
- atome_return = params[:return] || params[:atome]
14
- generator.build_atome(params[:atome], &bloc)
15
+ Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
16
+ store: params[:store], type: params[:type] }, &bloc)
15
17
  elsif params.key?(:sanitizer)
16
- generator.build_sanitizer(params[:sanitizer], &bloc)
18
+ Genesis.build_sanitizer(params[:sanitizer], &bloc)
17
19
  elsif params.key?(:pre)
18
- generator.build_option("pre_render_#{params[:pre]}", &bloc)
20
+ Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
19
21
  elsif params.key?(:post)
20
- generator.build_option("post_render_#{params[:post]}", &bloc)
21
- elsif params.key?(:browser)
22
- generator.build_render("browser_#{params[:browser]}", &bloc)
22
+ Atome.instance_variable_set("@post_#{params[:post]}", bloc)
23
+ elsif params.key?(:after)
24
+ Atome.instance_variable_set("@after_#{params[:after]}", bloc)
25
+ elsif params.key?(:read)
26
+ Atome.instance_variable_set("@read_#{params[:read]}", bloc)
27
+ elsif params[:renderer]
28
+ renderer_found = params[:renderer]
29
+ if params[:specific]
30
+ Universe.set_atomes_specificities(params)
31
+ params[:specific] = "#{params[:specific]}_"
32
+ end
33
+ render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
34
+ 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
23
40
  end
24
41
  end
25
42
 
26
- def batch (atomes)
27
- grab(:black_matter).batch(atomes)
43
+ def delete (atomes)
44
+ grab(:view).delete(atomes)
28
45
  end
29
46
 
30
- def identity_generator(type = :element)
31
- "#{attach[0]}_#{type}_#{Universe.counter}"
47
+ def identity_generator(type_needed = :element)
48
+ "#{type_needed}_#{Universe.counter}"
32
49
  end
33
50
 
34
- def grab(atome_to_get)
51
+ def grab(id_to_get)
52
+ return if id_to_get == false
35
53
 
36
- Universe.atomes[atome_to_get]
54
+ id_to_get = '' if id_to_get.instance_of? Array
55
+ id_to_get = id_to_get.to_sym
56
+ Universe.atomes[id_to_get]
37
57
  end
38
58
 
39
59
  def box(params = {}, &proc)
40
60
  grab(:view).box(params, &proc)
41
61
  end
42
62
 
43
- def vector(params = {}, &proc)
44
- grab(:view).vector(params, &proc)
45
- end
46
-
47
63
  def circle(params = {}, &proc)
48
64
  grab(:view).circle(params, &proc)
49
65
  end
50
66
 
51
- def matrix(params = {}, &proc)
52
- grab(:view).matrix(params, &proc)
53
- end
54
-
55
- # def method_missing(method, *args, &block)
56
- # args.each do |atome_found|
57
- # args.each do |arg|
58
- # default_parent = Essentials.default_params[method][:attach][0] # we get the first parents
59
- # # create_method_at_object_level(element)
60
- # atome_found = grab(default_parent).send(method, arg, &block)
61
- # # we force then return of atome found else its return an hash # TODO : we may find a cleaner solution
62
- # return atome_found
63
- # end
64
- # end
65
- # end
66
-
67
67
  # the method below generate Atome method creation at Object level
68
68
  def atome_method_for_object(element)
69
-
70
69
  Object.define_method element do |params, &user_proc|
71
- default_parent = Essentials.default_params[element][:attach][0] # we get the first parents
70
+ default_parent = Essentials.default_params[element][:attach] || :view
72
71
  grab(default_parent).send(element, params, &user_proc)
73
72
  end
74
73
  end
75
74
 
76
- def atome_method_for_batch(element)
77
- Batch.define_method element do |params, &user_proc|
78
- dispatch(element, [params], &user_proc)
75
+ def wait(time, id = nil, &proc)
76
+ # we generate an uniq id
77
+ if [:kill, 'kill'].include?(time)
78
+ JS.eval("clearTimeout(window.timeoutIds['#{id}']);")
79
+ else
80
+ obj = Object.new
81
+ unique_id = obj.object_id
82
+
83
+ id ||= unique_id
84
+ time *= 1000
85
+ callback_id = "myRubyCallback_#{id}"
86
+ JS.global[callback_id.to_sym] = proc
87
+ JS.eval("if (!window.timeoutIds) { window.timeoutIds = {}; } window.timeoutIds['#{id}'] = setTimeout(function() { #{callback_id}(); }, #{time});")
79
88
  end
89
+ id
90
+ end
91
+
92
+ def repeater(counter, proc)
93
+ instance_exec(counter, &proc) if proc.is_a?(Proc)
80
94
  end
81
- def particle_method_for_batch(element)
82
- Batch.define_method element do |params, &user_proc|
83
- dispatch(element, [params], &user_proc)
95
+
96
+ def repeat_callback(params, counter)
97
+ @repeat[params].call(counter)
98
+ end
99
+
100
+ def repeat(delay = 1, repeat = 0, &proc)
101
+ @repeat ||= []
102
+ @repeat << proc
103
+ repeat_id = @repeat.length - 1
104
+ intervalId = JS.eval(<<~JS)
105
+ function repeat(action, interval, repetitions) {
106
+ let count = 0;
107
+ let intervalId = null;
108
+
109
+ function executeAction() {
110
+ if (count < repetitions) {
111
+ action(count);
112
+ count++;
113
+ } else {
114
+ clearInterval(intervalId);
115
+ }
116
+ }
117
+
118
+ executeAction(); // execute immediatly
119
+ intervalId = setInterval(executeAction, interval);
120
+ return intervalId;
121
+ }
122
+
123
+ function myAction(counter) {
124
+ rubyVMCallback("repeat_callback(#{repeat_id}, "+counter+")")
125
+ }
126
+
127
+ const intervalId = repeat(myAction, #{delay} * 1000, #{repeat});
128
+
129
+ return intervalId;
130
+ JS
131
+ intervalId
132
+
133
+ end
134
+
135
+ def stop(params)
136
+ case params
137
+ when Hash
138
+ if params.key?(:repeat)
139
+ repeater_to_stop = params[:repeat]
140
+ JS.eval(<<~JS)
141
+ clearInterval(#{repeater_to_stop});
142
+ JS
143
+ else
144
+ puts "La clé :repeat n'existe pas dans params"
145
+ end
146
+ else
147
+ puts "params n'est pas un hash"
148
+ end
149
+ end
150
+
151
+ def tagged(params)
152
+ atome_get = []
153
+ if params.instance_of? Hash
154
+ params.each do |tag_name, tag_value|
155
+ Universe.atomes.each do |atomes_id_found, atomes_found|
156
+ if atomes_found.tag&.instance_of?(Hash) && (atomes_found.tag[tag_name] == tag_value)
157
+ atome_get << atomes_id_found
158
+ end
159
+ end
160
+ end
161
+ else
162
+ Universe.atomes.each do |atomes_id_found, atomes_found|
163
+ atome_get << atomes_id_found if atomes_found.tag&.instance_of?(Hash) && atomes_found.tag[params]
164
+ end
84
165
  end
166
+ atome_get
85
167
  end
86
168
 
87
- end
169
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Basic add on
4
+ class Atome
5
+ def /(other)
6
+ value / other
7
+ end
8
+
9
+ def *(other)
10
+ value * other
11
+ end
12
+
13
+ def -(other)
14
+ value - other
15
+ end
16
+
17
+ def +(other)
18
+ value + other
19
+ end
20
+ end
@@ -5,11 +5,10 @@ class Atome
5
5
  def up?(host, _my_proc)
6
6
  check = Net::Ping::External.new(host)
7
7
  return unless check.ping?
8
-
9
- puts 'ping respond!!'
8
+ 'ping respond!!'
10
9
  end
11
10
 
12
11
  def ping(address, my_proc: false)
13
- puts up(address, my_proc) # prints "true" if ping replies
12
+ up(address, my_proc) # prints "true" if ping replies
14
13
  end
15
14
  end
@@ -1,20 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
  new({ atome: :color, type: :hash })
3
-
4
3
  new({ sanitizer: :color }) do |params|
5
- # TODO : when attaching color to a shadow it should colorized it , cf : c.shadow({color: :blue}) should work
6
4
  params = create_color_hash(params) unless params.instance_of? Hash
5
+ # the condition below is to prevent the creation of multiple unwanted colors with same property and no ID specified
6
+ unless params[:id]
7
+ uniq_value = "#{params[:red].to_s.sub('.', '_')}_#{params[:green].to_s.sub('.', '_')}_#{params[:blue].to_s.sub('.', '_')}_#{params[:alpha].to_s.sub('.', '_')}_#{params[:left].to_s.sub('.', '_')}_#{params[:top].to_s.sub('.', '_')}_#{params[:diffusion].to_s.sub('.', '_')}"
8
+ params[:id] = "#{@id}_color_#{uniq_value}".to_sym
9
+ end
7
10
  params
8
11
  end
9
-
12
+ # new({ post: :color }) do
13
+ # Atome.global_monitoring(self, [:red, :blue, :blue, :alpha, :left, :right, :diffusion], [:variable1, :variable2])
14
+ # end
10
15
  new({ atome: :image })
11
16
  new({ sanitizer: :image }) do |params|
12
17
  unless params.instance_of? Hash
13
18
  # TODO : we have to convert all image to png or maintain a database with extension
14
19
  # FIXME : temporary patch that add .png to the string if no extension is found
15
- if params.split('.').length == 1
16
- params = "#{params}.png"
17
- end
20
+ params = "#{params}.png" if params.to_s.split('.').length == 1
18
21
 
19
22
  params = { path: "./medias/images/#{params}" }
20
23
  end
@@ -22,25 +25,27 @@ new({ sanitizer: :image }) do |params|
22
25
  params
23
26
  end
24
27
  new({ atome: :video })
28
+ new({ sanitizer: :video }) do |params|
29
+ unless params.instance_of? Hash
30
+ # TODO : we have to convert all image to png or maintain a database with extension
31
+ # FIXME : temporary patch that add .mp4 to the string if no extension is found
32
+ params = "#{params}.mp4" if params.to_s.split('.').length == 1
25
33
 
26
- new({ atome: :shadow, type: :hash })
27
- new({ sanitizer: :shadow }) do |params|
28
- # TODO : when attaching color to a shadow it should colorised it , cf : c.shadow({color: :blue}) should work
29
- params = {} unless params.instance_of? Hash
30
- default_params = { red: 0, green: 0, blue: 0, alpha: 1, blur: 3, left: 3, top: 3 }
31
- new_params = default_params.merge!(params)
32
- new_params
34
+ params = { path: "./medias/videos/#{params}" }
35
+ end
36
+ # TODO : the line below should get the value from default params Essentials
37
+ params
38
+ end
39
+ new({ atome: :www })
40
+ new({ atome: :shadow }) do |params|
41
+ if params
42
+ attach_value = params.delete(:affect)
43
+ params[:affect] = attach_value
44
+ end
45
+ params
33
46
  end
47
+ new({ atome: :raw })
34
48
  new({ atome: :shape })
35
- # new({ pre: :shape }) do |params|
36
- # if params[:definition]
37
- # # if it is a vector we reorder tha params
38
- # attached = params.delete(:attached)
39
- # params = params.merge({ attached: attached })
40
- # end
41
- #
42
- # params
43
- # end
44
49
  new({ atome: :code })
45
50
  new({ atome: :audio })
46
51
  new({ atome: :element })
@@ -48,17 +53,39 @@ new({ sanitizer: :element }) do |params|
48
53
  default_params = { data: '' }
49
54
  default_params.merge!(params)
50
55
  end
51
- new({ atome: :web })
52
- new({ sanitizer: :web }) do |params|
53
- # TODO : the line below should get the value from default params Essentials
54
- temp_default = { path: 'https://www.youtube.com/embed/usQDazZKWAk' }
55
- params = temp_default.merge(params)
56
- params
57
- end
58
- new({ atome: :collector })
59
56
  new({ atome: :animation })
57
+ new({ atome: :group })
60
58
  new({ atome: :text, type: :hash })
59
+ new({ post: :text }) do |params|
60
+ data_found = params[:data]
61
+ if data_found.instance_of? Array
62
+ data_found.each_with_index do |data_found, index|
63
+ # we treat the first element
64
+ if index == 0
65
+ send(:data, data_found)
66
+ else
67
+ # we create new text's atome attached to the main one (the first element above)
68
+ text(data_found)
69
+ end
70
+
71
+ end
72
+ else
73
+ send(:data, data_found)
74
+ end
75
+ params
76
+ end
61
77
  new({ sanitizer: :text }) do |params|
78
+ # to allow text api with the form text(:hello) instead of text({data: :hello})
62
79
  params = { data: params } unless params.instance_of? Hash
63
80
  params
64
81
  end
82
+ # for later use ( physical is a css like style)
83
+ new({ atome: :human }) do |params|
84
+ Universe.add_user = params[:id]
85
+ end
86
+ new({ atome: :machine })
87
+
88
+ new({ atome: :paint })
89
+ new({ atome: :vector })
90
+
91
+
@@ -1,2 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ new({ particle: :connection }) do |params, bloc|
4
+ params = { server: params } unless params.instance_of? Hash
5
+ html.connect(params[:server], &bloc)
6
+ end
7
+
8
+ new({ particle: :message }) do |params, bloc|
9
+ params = { server: params } unless params.instance_of? Hash
10
+ html.send_message(params[:server], &bloc)
11
+ end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
3
  new({ particle: :smooth })
5
4
  new({ particle: :blur })