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
@@ -1,160 +1,180 @@
1
- const atomeJS = Object.assign(atomeAnimate,atomeCommunication,atomeDrag,atomeDrop,atomeFile,atomeSort, atomeTime, atomeVideo);
2
- // This const is used to store and get all atome created canvas by id
3
- const Atome_canvas={}
4
- // // class AtomeDrag {
5
- // // constructor() {
6
- // // }
7
- // //
8
- // // drag(atome_drag_id) {
9
- // // // target elements with the "draggable" class
10
- // // self.current_obj = Opal.Utilities.$grab(atome_drag_id)
11
- // // interact('.'+atome_drag_id)
12
- // // .draggable({
13
- // // // enable inertial throwing
14
- // // startAxis: 'x',
15
- // // lockAxis: 'x',
16
- // // // lockAxis: ''+lock_axis,
17
- // // inertia: true,
18
- // // // keep the element within the area of it's parent
19
- // // modifiers: [
20
- // // interact.modifiers.restrictRect({
21
- // // restriction: 'parent',
22
- // // endOnly: true
23
- // // })
24
- // // ],
25
- // // // enable autoScroll
26
- // // autoScroll: true,
27
- // //
28
- // // listeners: {
29
- // // // call this function on every dragmove event
30
- // //
31
- // // move: dragMoveListener,
32
- // // start(event) {
33
- // // //TODO: optimise this passing the proc to the drag callback
34
- // // // lets get the current atome Object
35
- // // // self.current_obj = Opal.Utilities.$grab(atome_drag_id)
36
- // // // now get the grab proc
37
- // // self.proc_meth = current_obj.bloc
38
- // // },
39
- // // // call this function on every dragend event
40
- // // end(event) {
41
- // // }
42
- // // }
43
- // // })
44
- // //
45
- // // function dragMoveListener(event) {
46
- // // const target = event.target
47
- // // // the code below can be conditioned to receive the drag event without moving the object
48
- // // // keep the dragged position in the data-x/data-y attributes
49
- // // const x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx;
50
- // // const y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy
51
- // // // translate the element
52
- // // target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'
53
- // // // update the position attributes
54
- // // target.setAttribute('data-x', x)
55
- // // target.setAttribute('data-y', y)
56
- // // // CallBack here
57
- // // self.current_obj.$dragCallback(event.pageX, event.pageY, event.rect.left, event.rect.top, self.current_obj, self.proc_meth);
58
- // // }
59
- // // }
60
- // //
61
- // // }
62
- //
63
- // // Usage:
64
- // // let atomeDrag = new AtomeDrag();
65
- // // atomeDrag.drag('atome_id', 'options');
66
- // // const Atomeanimation = {}
67
- //
68
- //
69
- //
70
- // // TODO: put in a class
71
- //
72
- //
73
- // const atome = {
74
- // jsSchedule: function (years, months, days, hours, minutes, seconds, atome, proc) {
75
- // const now = new Date();
76
- // const formatDate = new Date(years, months - 1, days, hours, minutes, seconds);
77
- // const diffTime = Math.abs(formatDate - now);
78
- // setTimeout(function () {
79
- // atome.$schedule_callback(proc);
80
- // }, diffTime);
81
- // },
82
- // jsReader: function (file, atome, proc) {
83
- // fetch('medias/' + file)
84
- // .then(response => response.text())
85
- // .then(text => atome.$read_callback(text, proc))
86
- // },
87
- // js_Fullscreen: function (atome_id){
88
- // let elem = document.getElementById(atome_id)
89
- // if (elem.requestFullscreen) {
90
- // elem.requestFullscreen();
91
- // } else if (elem.webkitRequestFullscreen) { /* Safari */
92
- // elem.webkitEnterFullscreen();
93
- // } else if (elem.msRequestFullscreen) { /* IE11 */
94
- // elem.msRequestFullscreen();
95
- // }
96
- //
97
- // }
1
+ const atomeJS = Object.assign(communication, File);
2
+
3
+ // generic callback method
4
+
5
+
6
+ async function callback(callback_method, cmd) {
7
+ let ruby_callback_method = 'A.callback(:' + callback_method + ')'
8
+ let instance_variable_to_set = '@' + callback_method + '_code'
9
+ let cmd_result;
10
+ try {
11
+ let response;
12
+ response = await 'ok'
13
+ cmd_result = response;
14
+ } catch (error) {
15
+ cmd_result = error;
16
+ }
17
+ rubyVMCallback("Atome.instance_variable_set('" + instance_variable_to_set + "','" + cmd_result + "')")
18
+ rubyVMCallback(ruby_callback_method)
19
+ }
20
+
21
+ //read file
22
+
23
+
24
+ async function readFile(atome_id, filePath) {
25
+ let fileContent;
26
+ try {
27
+ fileContent = await window.__TAURI__.invoke('read_file', {filePath: filePath});
28
+ } catch (error) {
29
+ fileContent = error;
30
+ }
31
+ // alert(fileContent);
32
+ rubyVMCallback("grab(:" + atome_id + ").callback({ read: '" + fileContent + "' })");
33
+ rubyVMCallback("grab(:" + atome_id + ").call(:read)");
34
+ }
35
+
36
+
37
+ // list folder
38
+
39
+ // almost works
40
+ async function browseFile(atome_id, directoryPath) {
41
+ let directoryContent;
42
+ try {
43
+ directoryContent = await window.__TAURI__.invoke('list_directory_content', {directoryPath: directoryPath});
44
+ } catch (error) {
45
+ directoryContent = error;
46
+ }
47
+ rubyVMCallback("grab(:" + atome_id + ").callback({ browse: '" + directoryContent + "' })");
48
+ rubyVMCallback("grab(:" + atome_id + ").call(:browse)");
49
+ }
50
+
51
+
52
+ // change dir
53
+
54
+ async function changeCurrentDirectory(atome_id, newPath) {
55
+ let result;
56
+ try {
57
+ // Utilisez Tauri pour changer le répertoire de travail courant
58
+ result = await window.__TAURI__.invoke('change_dir', {path: newPath});
59
+ } catch (error) {
60
+ result = error;
61
+ }
62
+ alert(result);
63
+ }
64
+
65
+
66
+
67
+
68
+ // Terminal
69
+
70
+ async function terminal(atome_id, cmd) {
71
+ let cmd_result;
72
+ try {
73
+ const command = cmd;
74
+ let response;
75
+ response = await window.__TAURI__.invoke('execute_command', {command});
76
+ cmd_result = response;
77
+ } catch (error) {
78
+ cmd_result = error;
79
+ }
80
+ cmd_result = cmd_result.replace(/\r?\n/g, "");
81
+
82
+ rubyVMCallback("grab(:" + atome_id + ").callback({ terminal: '" + cmd_result + "' })");
83
+ rubyVMCallback("grab(:" + atome_id + ").call(:terminal)");
84
+
85
+ }
86
+
87
+
88
+ function distant_terminal(id, cmd) {
89
+ let myd_data_test = 'Terminal particle will soon be implemented when using a non native mode\nYou can switch to OSX to test';
90
+ let call_back_to_send = `grab(:${id}).callback({terminal: "${myd_data_test}"})`
91
+ let call = `grab(:${id}).call(:terminal)`
92
+ rubyVMCallback(call_back_to_send)
93
+ rubyVMCallback(call)
94
+ }
95
+
96
+
97
+ // we check if we are in tauri context
98
+ // if (typeof window.__TAURI__ !== 'undefined') {
99
+ // callExecuteCommand('pwd');
98
100
  //
101
+ // } else {
99
102
  // }
100
103
 
101
104
 
102
- ///////////////////////////////////////////////////////////
103
- // //// example ruby equivalent in js ///
104
- // Opal.queue(function (Opal) {/* Generated by Opal 1.6.0 */
105
- // const $klass = Opal.klass, $defs = Opal.defs, $def = Opal.def;
106
- // // The line below create the AtomicJS cons to simplify access to js object from ruby
107
- //
108
- // // var $const_set = Opal.const_set, $nesting = [], nil = Opal.nil;
109
- // // return $const_set($nesting[0], 'AtomicJS', atome)
110
- //
111
- // (function ($base, $super) {
112
- // const self = $klass($base, $super, 'AtomeJS');
113
- // $def(self, '$initialize', function $$initialize(val) {
114
- // // Init code below
115
- // }, 1);
116
- //
117
- // $defs(self, '$check_this', function $$check_this(val) {
118
- // // getter code below
119
- // // alert ('Suoer cool!!'+val)
120
- // // alert(atomeJS)
121
- // return (val);
122
- // }, 0);
123
- //
124
- // $def(self, '$way', function $way() {
125
- // // getter code below
126
- // return (self.my_var);
127
- // }, 0);
128
- //
129
- // return $def(self, '$way=', function $way(val) {
130
- // //self method example
131
- // return (self.my_var = val);
132
- // }, 0);
133
- //
134
- //
135
- // })();
136
- //
137
- // // new class below
138
- // return (function ($base, $super) {
139
- // const self = $klass($base, $super, 'Atome');
140
- //
141
- // $defs(self, '$verif', function $$verif(val) {
142
- // //self method example
143
- // return (val);
144
- // }, 0);
105
+ // 'ls -l'
106
+
107
+
108
+ //read/write
109
+ //
110
+ // // Créer un fichier
111
+ // async function createAndWriteFile(filePath, contentToWrite) {
112
+ // try {
113
+ // await window.__TAURI__.invoke('write_file', {
114
+ // file_path: filePath,
115
+ // content: contentToWrite
116
+ // });
117
+ // console.log('File written successfully.');
118
+ // } catch (error) {
119
+ // console.error('Error writing to file:', error);
120
+ // }
121
+ // }
145
122
  //
146
- // $def(self, '$new_method', function $way() {
147
- // // getter code below
148
- // return (self.new_method);
149
- // }, 0);
123
+ // // Lire un fichier
124
+ // async function readAndDisplayFile(filePath) {
125
+ // try {
126
+ // const fileContent = await window.__TAURI__.invoke('read_file', {
127
+ // file_path: filePath
128
+ // });
129
+ // console.log('File content:', fileContent);
130
+ // } catch (error) {
131
+ // console.error('Error reading file:', error);
132
+ // }
133
+ // }
150
134
  //
135
+ // // Utiliser les fonctions pour créer et lire le fichier
136
+ // const filePath = 'example.txt'; // Remplacez ceci par le chemin du fichier souhaité
137
+ // const contentToWrite = 'This is some content to write to the file.';
151
138
  //
152
- // return $def(self, '$new_method=', function $way(val) {
153
- // //setter code below
154
- // return (self.atome = val);
155
- // }, 0);
139
+ // // Créer un fichier avec le contenu
140
+ // createAndWriteFile(filePath, contentToWrite);
156
141
  //
157
- // })();
158
- // });
142
+ // // Lire le fichier
143
+ // readAndDisplayFile(filePath);
144
+
145
+ function createSvgElement(tagName, attributes) {
146
+ var elem = document.createElementNS('http://www.w3.org/2000/svg', tagName);
147
+ for (var attr in attributes) {
148
+ if (attributes.hasOwnProperty(attr)) {
149
+ elem.setAttribute(attr, attributes[attr]);
150
+ }
151
+ }
152
+ return elem;
153
+ }
154
+
155
+
156
+ function sanitizeString(str) {
157
+ return str.replace(/'/g, "\\'");
158
+ }
159
+ function fileread(){
160
+ var inputElement = document.createElement("input");
161
+ inputElement.type = "file";
162
+
163
+ inputElement.addEventListener("change", function(event) {
164
+ var file = event.target.files[0];
165
+ var reader = new FileReader();
166
+
167
+ reader.onload = function(event) {
168
+ var content = event.target.result;
169
+ var sanitizedContent = sanitizeString(content);
170
+ rubyVMCallback("input_callback('"+sanitizedContent+"')");
171
+ };
172
+
173
+ reader.readAsText(file);
174
+ });
159
175
 
176
+ // Ajout de l'élément input à la div
177
+ var viewDiv = document.querySelector("#support");
178
+ viewDiv.appendChild(inputElement);
179
+ }
160
180
 
@@ -0,0 +1,46 @@
1
+ // Fonction pour ajouter la police dynamiquement
2
+ function ajouterPoliceDynamiquement(font_name,type,path) {
3
+ // Créer une nouvelle balise <style>
4
+ const styleElement = document.getElementById('atomic_style');
5
+
6
+ // Ajouter la règle @font-face à la balise <style>
7
+ styleElement.textContent = `
8
+ @font-face {
9
+ font-family: ${font_name};
10
+ src: url('${path}') format('truetype');
11
+ }
12
+ `;
13
+
14
+ // Ajouter la balise <style> à la balise <head> du document
15
+ document.head.appendChild(styleElement);
16
+
17
+ // Appliquer la police au corps du document
18
+ // document.body.style.fontFamily = font_name+','+type;
19
+ }
20
+
21
+ // Appeler la fonction pour ajouter et appliquer la police
22
+ ajouterPoliceDynamiquement('Ruboto','ThinItalic','medias/fonts/Roboto/Roboto-ThinItalic.ttf');
23
+
24
+ /////////////////
25
+
26
+ // setTimeout(function () {
27
+ // const viewDiv = document.getElementById('view');
28
+ //
29
+ // // Vérifier si la div existe
30
+ // if (viewDiv) {
31
+ // // Ajouter le texte à la div
32
+ // viewDiv.innerText = "Ceci est un texte ajouté à la div 'view'.";
33
+ //
34
+ // // Appliquer la police et la taille du texte
35
+ // viewDiv.style.fontFamily = 'Ruboto, thin';
36
+ // viewDiv.style.fontSize = '36px';
37
+ // } else {
38
+ // console.error("La div avec l'ID 'view' n'a pas été trouvée.");
39
+ // }
40
+ // }, 3000);
41
+
42
+
43
+
44
+
45
+
46
+
@@ -1,5 +1,7 @@
1
1
  const atomeDrag = {
2
-
2
+ check: function (options, atome_id, _atome) {
3
+ alert('full_success')
4
+ },
3
5
  drag: function (options, atome_id, atome) {
4
6
 
5
7
  let element = document.getElementById(atome_id)
@@ -1,5 +1,4 @@
1
-
2
- function mouse_interaction(element, atome){
1
+ function mouse_interaction(element, atome) {
3
2
  interact(element).dropzone({
4
3
  listeners: {
5
4
  dragenter(event) {
@@ -60,8 +59,8 @@ function mouse_interaction(element, atome){
60
59
  }
61
60
 
62
61
 
63
- function file_drop(atome_id, atome){
64
- const dropzone = document.querySelector('#'+atome_id)
62
+ function file_drop(atome_id, atome) {
63
+ const dropzone = document.querySelector('#' + atome_id)
65
64
  dropzone.addEventListener('dragover', evt => evt.preventDefault())
66
65
  dropzone.addEventListener('drop', async evt => {
67
66
  evt.preventDefault()
@@ -71,14 +70,19 @@ function file_drop(atome_id, atome){
71
70
  reader.readAsDataURL(file);
72
71
  reader.onloadend = function () {
73
72
  const base64data = reader.result;
74
- let type_found = file.type.split('/')[0]
75
- atome.$drop_action_callback(Opal.hash({path: file.filepath,type: type_found,size: file.size,data: base64data}));
73
+ let type_found = file.type.split('/')[0]
74
+ atome.$drop_action_callback(Opal.hash({
75
+ path: file.filepath,
76
+ type: type_found,
77
+ size: file.size,
78
+ data: base64data
79
+ }));
76
80
  }
77
81
  }
78
82
  })
79
83
 
80
84
 
81
- async function getFilesFromDataTransferItems (dataTransferItems, options = { raw: false }) {
85
+ async function getFilesFromDataTransferItems(dataTransferItems, options = {raw: false}) {
82
86
  const checkErr = (err) => {
83
87
  if (getFilesFromDataTransferItems.didShowInfo) return
84
88
  if (err.name !== 'EncodingError') return
@@ -164,3 +168,4 @@ function file_drop(atome_id, atome){
164
168
  else module.exports.getFilesFromDataTransferItems = getFilesFromDataTransferItems
165
169
 
166
170
  }
171
+
@@ -0,0 +1,126 @@
1
+ const communication = {
2
+ // websocket: new WebSocket('ws://localhost:9292'),
3
+ websocket: null,
4
+ initialize: function () {
5
+ this.websocket = new WebSocket('ws://localhost:9292')
6
+ // this.websocket = new WebSocket(address);
7
+
8
+ this.websocket.onopen = function (event) {
9
+ rubyVMCallback("puts 'Connected to WebSocket'")
10
+ };
11
+
12
+ this.websocket.onmessage = function (event) {
13
+ rubyVMCallback("puts 'object ruby callback : " + event.data + "'")
14
+ };
15
+
16
+ this.websocket.onclose = function (event) {
17
+ rubyVMCallback("puts 'WebSocket closed'")
18
+
19
+ };
20
+
21
+ this.websocket.onerror = function (event) {
22
+ // to prevent error disturbing the console
23
+ event.preventDefault();
24
+ console.log('connection lost!')
25
+ };
26
+ },
27
+ controller_sender: function (msg) {
28
+ let json_msg = JSON.parse(msg);
29
+
30
+ if (window.webkit) {
31
+ try {
32
+ window.webkit.messageHandlers.toggleMessageHandler.postMessage(json_msg);
33
+ } catch (error) {
34
+ console.log('no server, unable to post message')
35
+ }
36
+
37
+ } else {
38
+ try {
39
+ window.chrome.webview.postMessage(json_msg);
40
+ } catch (error) {
41
+ console.log('no server, unable to post message')
42
+ }
43
+ }
44
+ },
45
+ controller_listener: function () {
46
+ if (window.webkit) {
47
+ try {
48
+ ///
49
+ } catch (error) {
50
+ console.log('no server, unable to receive message')
51
+ }
52
+ } else {
53
+
54
+ try {
55
+ window.chrome.webview.addEventListener('message', arg => {
56
+ Opal.Object.$response_listener(arg.data)
57
+ });
58
+ } catch (error) {
59
+ console.log('no server, unable to receive message')
60
+ }
61
+
62
+
63
+ }
64
+ },
65
+ connect: function (address) {
66
+ this.websocket = new WebSocket(address);
67
+
68
+ this.websocket.onopen = function (event) {
69
+ rubyVMCallback("puts 'Connected to WebSocket'")
70
+ };
71
+
72
+ this.websocket.onmessage = function (event) {
73
+ rubyVMCallback("puts 'object ruby callback : " + event.data + "'")
74
+
75
+ };
76
+
77
+ this.websocket.onclose = function (event) {
78
+ rubyVMCallback("puts 'WebSocket closed'")
79
+
80
+ };
81
+
82
+ this.websocket.onerror = function (event) {
83
+ // to prevent error disturbing the console
84
+ event.preventDefault();
85
+ console.log('connection lost!')
86
+ };
87
+
88
+ },
89
+ ws_sender: function (address) {
90
+ this.websocket.send("Hello, WebSocket! !look look")
91
+ },
92
+ }
93
+
94
+ /////////////////////////// connection ws
95
+
96
+
97
+ function connect(address) {
98
+
99
+ // alert('kool');
100
+ websocket = new WebSocket(address);
101
+
102
+ websocket.onopen = function (event) {
103
+ rubyVMCallback("puts 'Connected to WebSocket'")
104
+
105
+ };
106
+
107
+ websocket.onmessage = function (event) {
108
+ rubyVMCallback("puts 'object ruby callback : " + event.data + "'")
109
+ };
110
+
111
+ websocket.onclose = function (event) {
112
+ rubyVMCallback("puts 'WebSocket closed'")
113
+ };
114
+
115
+ websocket.onerror = function (event) {
116
+ // to prevent error disturbing the console
117
+ event.preventDefault();
118
+ console.log('connection lost!')
119
+ };
120
+
121
+ }
122
+
123
+ function ws_sender() {
124
+ websocket.send("the Hello, WebSocket!!!")
125
+ }
126
+
@@ -1,4 +1,4 @@
1
- const atomeFile = {
1
+ const file = {
2
2
 
3
3
 
4
4
  reader: function(file, atome, proc) {
@@ -0,0 +1,3 @@
1
+ function rubyVMCallback(rubycode) {
2
+ Opal.eval(rubycode);
3
+ }
@@ -0,0 +1,12 @@
1
+ function rubyVMCallback(rubycode) {
2
+ rubyVM.eval(rubycode);
3
+ }
4
+
5
+
6
+ // var checkInterval = setInterval(function () {
7
+ // if (typeof rubyVM !== "undefined") {
8
+ // clearInterval(checkInterval); // Arrêtez la vérification une fois rubyVM trouvé
9
+ // rubyVM.eval('text("rubyvm is ready")');
10
+ // }
11
+ // }, 100);
12
+ //