atome 0.5.4.1.7 → 0.5.5.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (358) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -1
  3. data/Gemfile +3 -1
  4. data/README.md +70 -1
  5. data/Rakefile +246 -75
  6. data/app_builder_helpers/Rakefile +276 -288
  7. data/documentation/basic.md +242 -0
  8. data/documentation/deep learning/architecture.txt +3763 -0
  9. data/documentation/deep learning/atome.png +0 -0
  10. data/documentation/deep learning/basic_infos.txt +227 -0
  11. data/documentation/deep learning/example_of_users_code.rb +1810 -0
  12. data/documentation/deep learning/misc.txt +24 -0
  13. data/documentation/deep learning/ruby_js_example.rb +272 -0
  14. data/documentation/deep learning/wasm_script_help.text +14 -0
  15. data/documentation/framework/enhance_atome.md +1 -1
  16. data/documentation/tutorials/tutorials.md +7 -0
  17. data/exe/atome +308 -208
  18. data/lib/atome/atome.rb +52 -156
  19. data/lib/atome/extensions/atome.rb +129 -47
  20. data/lib/atome/extensions/mathematics.rb +20 -0
  21. data/lib/atome/extensions/ping.rb +2 -3
  22. data/lib/atome/genesis/generators/atome.rb +57 -30
  23. data/lib/atome/genesis/generators/communication.rb +9 -0
  24. data/lib/atome/genesis/generators/effect.rb +0 -1
  25. data/lib/atome/genesis/generators/event.rb +279 -43
  26. data/lib/atome/genesis/generators/geometry.rb +1 -10
  27. data/lib/atome/genesis/generators/hierarchy.rb +103 -0
  28. data/lib/atome/genesis/generators/identity.rb +45 -84
  29. data/lib/atome/genesis/generators/material.rb +31 -34
  30. data/lib/atome/genesis/generators/property.rb +31 -0
  31. data/lib/atome/genesis/generators/security.rb +31 -0
  32. data/lib/atome/genesis/generators/spatial.rb +3 -5
  33. data/lib/atome/genesis/generators/time.rb +0 -1
  34. data/lib/atome/genesis/generators/utility.rb +181 -66
  35. data/lib/atome/genesis/genesis.rb +152 -55
  36. data/lib/atome/genesis/sparkle.rb +59 -75
  37. data/lib/atome/helpers/color_helper/color/rgb/colors.rb +1 -1
  38. data/lib/atome/helpers/color_helper/color/rgb.rb +1 -1
  39. data/lib/atome/helpers/color_helper/color.rb +226 -7
  40. data/lib/atome/helpers/essentials.rb +22 -26
  41. data/lib/atome/helpers/security.rb +71 -0
  42. data/lib/atome/helpers/utilities.rb +191 -178
  43. data/lib/atome/kernel/black_matter.rb +22 -0
  44. data/lib/atome/kernel/universe.rb +123 -24
  45. data/lib/atome/presets/atome.rb +39 -35
  46. data/lib/atome/version.rb +3 -2
  47. data/lib/atome.rb +12 -12
  48. data/lib/atome_relative.rb +36 -0
  49. data/lib/{atome/renderers → platform_specific}/opal/atome_opal_extensions.rb +4 -1
  50. data/lib/{atome/renderers → platform_specific}/opal/extensions/color.rb +12 -5
  51. data/lib/{atome/renderers → platform_specific}/opal/extensions/geolocation.rb +1 -0
  52. data/lib/platform_specific/opal/extensions/js.rb +21 -0
  53. data/lib/platform_specific/opal/extensions/object.rb +6 -0
  54. data/lib/platform_specific/opal/extensions/ping.rb +31 -0
  55. data/lib/{atome/renderers → platform_specific}/opal/extensions/sha.rb +4 -2
  56. data/lib/platform_specific/wasm/atome_wasm_extensions.rb +11 -0
  57. data/lib/renderers/headless/headless.rb +18 -0
  58. data/lib/renderers/headless/index.rb +6 -0
  59. data/lib/renderers/headless/index_relative.rb +6 -0
  60. data/lib/renderers/headless/utility.rb +6 -0
  61. data/{vendor/assets/src/medias/rubies/examples/top.rb → lib/renderers/html/atome.rb} +0 -1
  62. data/lib/renderers/html/atome_html.rb +22 -0
  63. data/lib/renderers/html/effect.rb +26 -0
  64. data/lib/renderers/html/event.rb +43 -0
  65. data/lib/renderers/html/geometry.rb +31 -0
  66. data/lib/renderers/html/hierarchy.rb +233 -0
  67. data/lib/renderers/html/html.rb +1112 -0
  68. data/lib/renderers/html/identity.rb +84 -0
  69. data/lib/renderers/html/index.rb +19 -0
  70. data/lib/renderers/html/index_relative.rb +20 -0
  71. data/lib/renderers/html/material.rb +53 -0
  72. data/lib/renderers/html/property.rb +24 -0
  73. data/lib/renderers/html/spatial.rb +46 -0
  74. data/lib/renderers/html/time.rb +1 -0
  75. data/lib/renderers/html/utility.rb +38 -0
  76. data/lib/renderers/renderer.rb +16 -0
  77. data/lib/renderers/server/index.rb +4 -0
  78. data/lib/renderers/server/index_relative.rb +4 -0
  79. data/lib/renderers/server/utility.rb +4 -0
  80. data/sig/atome.rbs +6 -0
  81. data/sig/object.rbs +4 -0
  82. data/sig/universe.rbs +3 -0
  83. data/vendor/assets/Rakefile +3 -3
  84. data/vendor/assets/application/examples/a_concat.rb +16 -0
  85. data/vendor/assets/application/examples/affect.rb +8 -0
  86. data/vendor/assets/application/examples/animation.rb +96 -0
  87. data/vendor/assets/application/examples/apply.rb +8 -0
  88. data/vendor/assets/application/examples/atome.rb +5 -0
  89. data/vendor/assets/application/examples/attach.rb +34 -0
  90. data/vendor/assets/application/examples/attached.rb +38 -0
  91. data/vendor/assets/application/examples/basic_understanding.rb +52 -0
  92. data/vendor/assets/application/examples/browse.rb +17 -0
  93. data/vendor/assets/application/examples/callback.rb +20 -0
  94. data/vendor/assets/application/examples/category.rb +12 -0
  95. data/vendor/assets/application/examples/clear.rb +96 -0
  96. data/vendor/assets/application/examples/clones.rb +177 -0
  97. data/vendor/assets/application/examples/code.rb +13 -0
  98. data/vendor/assets/application/examples/color.rb +54 -0
  99. data/vendor/assets/application/examples/convert.rb +163 -0
  100. data/vendor/assets/application/examples/copy.rb +25 -0
  101. data/vendor/assets/application/examples/copybck.rb +68 -0
  102. data/vendor/assets/application/examples/debug.rb +78 -0
  103. data/vendor/assets/application/examples/delete.rb +93 -0
  104. data/vendor/assets/application/examples/display.rb +279 -0
  105. data/vendor/assets/application/examples/display_bck.rb +164 -0
  106. data/vendor/assets/application/examples/drag.rb +45 -0
  107. data/vendor/assets/application/examples/drop.rb +35 -0
  108. data/vendor/assets/application/examples/duplicate.rb +64 -0
  109. data/vendor/assets/application/examples/edit.rb +21 -0
  110. data/vendor/assets/application/examples/encode.rb +6 -0
  111. data/vendor/assets/application/examples/file.rb +50 -0
  112. data/vendor/assets/application/examples/find.rb +157 -0
  113. data/vendor/assets/application/examples/generator_and_build.rb +15 -0
  114. data/vendor/assets/application/examples/getter.rb +16 -0
  115. data/vendor/assets/application/examples/grab.rb +14 -0
  116. data/vendor/assets/application/examples/gradient.rb +35 -0
  117. data/vendor/assets/application/examples/group.rb +44 -0
  118. data/vendor/assets/application/examples/hierarchy.rb +21 -0
  119. data/vendor/assets/application/examples/history.rb +31 -0
  120. data/vendor/assets/application/examples/hypertext.rb +113 -0
  121. data/vendor/assets/application/examples/image.rb +5 -0
  122. data/vendor/assets/application/examples/keyboard.rb +59 -0
  123. data/vendor/assets/application/examples/layout.rb +227 -0
  124. data/vendor/assets/application/examples/login.rb +10 -0
  125. data/vendor/assets/application/examples/markup.rb +4 -0
  126. data/vendor/assets/application/examples/match.rb +115 -0
  127. data/vendor/assets/application/examples/messaging.rb +16 -0
  128. data/vendor/assets/application/examples/monitor.rb +14 -0
  129. data/vendor/assets/application/examples/on_resize.rb +7 -0
  130. data/vendor/assets/{src/medias/rubies/examples/get_renderer_list.rb → application/examples/online.rb} +1 -1
  131. data/vendor/assets/application/examples/over.rb +29 -0
  132. data/vendor/assets/application/examples/paint.rb +23 -0
  133. data/vendor/assets/application/examples/particles.rb +4 -0
  134. data/vendor/assets/application/examples/percent_to_px.rb +4 -0
  135. data/vendor/assets/application/examples/play.rb +50 -0
  136. data/vendor/assets/application/examples/presets.rb +33 -0
  137. data/vendor/assets/application/examples/random.rb +42 -0
  138. data/vendor/assets/application/examples/raw_html.rb +48 -0
  139. data/vendor/assets/application/examples/read.rb +11 -0
  140. data/vendor/assets/application/examples/refresh.rb +62 -0
  141. data/vendor/assets/application/examples/remove.rb +47 -0
  142. data/vendor/assets/application/examples/repeat.rb +26 -0
  143. data/vendor/assets/application/examples/resize.rb +17 -0
  144. data/vendor/assets/application/examples/scroll.rb +11 -0
  145. data/vendor/assets/application/examples/security.rb +76 -0
  146. data/vendor/assets/application/examples/selected.rb +30 -0
  147. data/vendor/assets/application/examples/shadow.rb +46 -0
  148. data/vendor/assets/application/examples/shapes.rb +6 -0
  149. data/vendor/assets/{src/medias/rubies → application}/examples/smooth.rb +5 -1
  150. data/vendor/assets/application/examples/style.rb +4 -0
  151. data/vendor/assets/application/examples/sync.rb +39 -0
  152. data/vendor/assets/application/examples/tagged.rb +24 -0
  153. data/vendor/assets/application/examples/terminal.rb +4 -0
  154. data/vendor/assets/application/examples/text.rb +5 -0
  155. data/vendor/assets/application/examples/touch.rb +38 -0
  156. data/vendor/assets/application/examples/type_mutation.rb +18 -0
  157. data/vendor/assets/application/examples/universe.rb +8 -0
  158. data/vendor/assets/application/examples/vector.rb +24 -0
  159. data/vendor/assets/application/examples/video.rb +14 -0
  160. data/vendor/assets/application/examples/wait.rb +6 -0
  161. data/vendor/assets/application/examples/www.rb +10 -0
  162. data/vendor/assets/application/index.rb +1 -1
  163. data/vendor/assets/application/test.rb +29 -0
  164. data/vendor/assets/application/works/photos.rb +672 -0
  165. data/vendor/assets/application/works/photos2.rb +218 -0
  166. data/vendor/assets/application/works/photos3.rb +343 -0
  167. data/vendor/assets/application/works/photos4.rb +34 -0
  168. data/vendor/assets/application/works/photos6.rb +6 -0
  169. data/vendor/assets/application/works/trigga.rb +0 -0
  170. data/vendor/assets/application/works/vie.rb +74 -0
  171. data/vendor/assets/server/atome_server.rb +37 -41
  172. data/vendor/assets/server/atome_server_wasm.rb +112 -0
  173. data/vendor/assets/server/capture.rb +10 -0
  174. data/vendor/assets/server/config.ru +5 -4
  175. data/vendor/assets/src/css/style.css +29 -4
  176. data/vendor/assets/src/index.html +31 -38
  177. data/vendor/assets/src/index_opal.html +42 -0
  178. data/vendor/assets/src/index_server.html +43 -0
  179. data/vendor/assets/src/index_server_wasm.html +46 -0
  180. data/vendor/assets/src/js/atome/atome.js +170 -150
  181. data/vendor/assets/src/js/atome/atome_helpers/add_font.js +46 -0
  182. data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +3 -1
  183. data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +12 -7
  184. data/vendor/assets/src/js/atome/atome_helpers/communication.js +126 -0
  185. data/vendor/assets/src/js/atome/atome_helpers/{atome_file.js → file.js} +1 -1
  186. data/vendor/assets/src/js/atome/specific/opal.js +3 -0
  187. data/vendor/assets/src/js/atome/specific/wasm.js +12 -0
  188. data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +13 -0
  189. data/vendor/assets/src/js/third_parties/fabric.min.js +1 -1
  190. data/vendor/assets/src/js/third_parties/html-to-image.min.js +2 -0
  191. data/vendor/assets/src/js/third_parties/jsencrypt.min.js +2 -0
  192. data/vendor/assets/src/js/third_parties/papaparse.min.js +7 -0
  193. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +202 -0
  194. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
  195. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  196. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
  197. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  198. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
  199. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
  200. data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  201. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
  202. data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  203. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
  204. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
  205. data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  206. data/vendor/assets/src/medias/images/logos/Facebook.svg +1 -1
  207. data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +109 -0
  208. data/vendor/assets/src/medias/images/logos/LinkedIn.svg +11 -0
  209. data/vendor/assets/src/medias/images/logos/X.svg +5 -0
  210. data/vendor/assets/src-tauri/Cargo.toml +1 -1
  211. data/vendor/assets/src-tauri/src/main.rs +59 -5
  212. data/vendor/assets/src-tauri/tauri.conf.json +1 -1
  213. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
  214. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
  215. data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
  216. data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
  217. metadata +188 -180
  218. data/lib/atome/extensions/mathematic.rb +0 -20
  219. data/lib/atome/extensions/matrix.rb +0 -346
  220. data/lib/atome/helpers/callbacks.rb +0 -133
  221. data/lib/atome/kernel/batch.rb +0 -26
  222. data/lib/atome/kernel/essentials.rb +0 -23
  223. data/lib/atome/renderers/browser/atome.rb +0 -158
  224. data/lib/atome/renderers/browser/browser.rb +0 -47
  225. data/lib/atome/renderers/browser/effect.rb +0 -23
  226. data/lib/atome/renderers/browser/event.rb +0 -96
  227. data/lib/atome/renderers/browser/geometry.rb +0 -27
  228. data/lib/atome/renderers/browser/helpers/animation_helper.rb +0 -69
  229. data/lib/atome/renderers/browser/helpers/browser_helper.rb +0 -101
  230. data/lib/atome/renderers/browser/helpers/color_helper.rb +0 -80
  231. data/lib/atome/renderers/browser/helpers/drag_helper.rb +0 -52
  232. data/lib/atome/renderers/browser/helpers/drop_helper.rb +0 -13
  233. data/lib/atome/renderers/browser/helpers/effect_helper.rb +0 -23
  234. data/lib/atome/renderers/browser/helpers/event_helper.rb +0 -76
  235. data/lib/atome/renderers/browser/helpers/image_helper.rb +0 -27
  236. data/lib/atome/renderers/browser/helpers/over_helper.rb +0 -13
  237. data/lib/atome/renderers/browser/helpers/shadow_helper.rb +0 -74
  238. data/lib/atome/renderers/browser/helpers/shape_helper.rb +0 -22
  239. data/lib/atome/renderers/browser/helpers/text_helper.rb +0 -38
  240. data/lib/atome/renderers/browser/helpers/video_helper.rb +0 -50
  241. data/lib/atome/renderers/browser/helpers/web_helper.rb +0 -26
  242. data/lib/atome/renderers/browser/identity.rb +0 -61
  243. data/lib/atome/renderers/browser/material.rb +0 -121
  244. data/lib/atome/renderers/browser/opal_add_on.rb +0 -31
  245. data/lib/atome/renderers/browser/opal_browser.rb +0 -6
  246. data/lib/atome/renderers/browser/spatial.rb +0 -59
  247. data/lib/atome/renderers/browser/time.rb +0 -3
  248. data/lib/atome/renderers/browser/utility.rb +0 -49
  249. data/lib/atome/renderers/headless/headless.rb +0 -10
  250. data/lib/atome/renderers/headless/utility.rb +0 -6
  251. data/lib/atome/renderers/html/atome.rb +0 -49
  252. data/lib/atome/renderers/html/effect.rb +0 -19
  253. data/lib/atome/renderers/html/event.rb +0 -9
  254. data/lib/atome/renderers/html/geometry.rb +0 -11
  255. data/lib/atome/renderers/html/html.rb +0 -42
  256. data/lib/atome/renderers/html/identity.rb +0 -14
  257. data/lib/atome/renderers/html/opal_browser.rb +0 -6
  258. data/lib/atome/renderers/html/spatial.rb +0 -28
  259. data/lib/atome/renderers/html/utility.rb +0 -17
  260. data/lib/atome/renderers/opal/extensions/atome.rb +0 -29
  261. data/lib/atome/renderers/opal/extensions/ping.rb +0 -18
  262. data/lib/atome/renderers/renderer.rb +0 -15
  263. data/lib/atome/renderers/server/server.rb +0 -10
  264. data/lib/atome/renderers/server/utility.rb +0 -6
  265. data/vendor/assets/aui.rb +0 -5
  266. data/vendor/assets/r&d/misc.rb +0 -219
  267. data/vendor/assets/r&d/ping.rb +0 -3
  268. data/vendor/assets/r&d/storage.rb +0 -9
  269. data/vendor/assets/r&d/view_example.rb +0 -21
  270. data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +0 -40
  271. data/vendor/assets/src/medias/javascripts/test.js +0 -1
  272. data/vendor/assets/src/medias/rubies/demos.rb +0 -63
  273. data/vendor/assets/src/medias/rubies/examples/add.rb +0 -24
  274. data/vendor/assets/src/medias/rubies/examples/animation.rb +0 -81
  275. data/vendor/assets/src/medias/rubies/examples/atome_new.rb +0 -27
  276. data/vendor/assets/src/medias/rubies/examples/attach.rb +0 -15
  277. data/vendor/assets/src/medias/rubies/examples/attached.rb +0 -15
  278. data/vendor/assets/src/medias/rubies/examples/auto_height.rb +0 -5
  279. data/vendor/assets/src/medias/rubies/examples/auto_width.rb +0 -4
  280. data/vendor/assets/src/medias/rubies/examples/batch.rb +0 -17
  281. data/vendor/assets/src/medias/rubies/examples/blur.rb +0 -4
  282. data/vendor/assets/src/medias/rubies/examples/bottom.rb +0 -3
  283. data/vendor/assets/src/medias/rubies/examples/box.rb +0 -20
  284. data/vendor/assets/src/medias/rubies/examples/center.rb +0 -21
  285. data/vendor/assets/src/medias/rubies/examples/circle.rb +0 -3
  286. data/vendor/assets/src/medias/rubies/examples/class.rb +0 -13
  287. data/vendor/assets/src/medias/rubies/examples/clear.rb +0 -10
  288. data/vendor/assets/src/medias/rubies/examples/clone.rb +0 -35
  289. data/vendor/assets/src/medias/rubies/examples/code.rb +0 -11
  290. data/vendor/assets/src/medias/rubies/examples/color.rb +0 -73
  291. data/vendor/assets/src/medias/rubies/examples/create_atome_in_atome.rb +0 -13
  292. data/vendor/assets/src/medias/rubies/examples/cursor.rb +0 -7
  293. data/vendor/assets/src/medias/rubies/examples/delete.rb +0 -42
  294. data/vendor/assets/src/medias/rubies/examples/depth.rb +0 -6
  295. data/vendor/assets/src/medias/rubies/examples/detached.rb +0 -13
  296. data/vendor/assets/src/medias/rubies/examples/drag.rb +0 -98
  297. data/vendor/assets/src/medias/rubies/examples/drop.rb +0 -26
  298. data/vendor/assets/src/medias/rubies/examples/edit.rb +0 -12
  299. data/vendor/assets/src/medias/rubies/examples/element.rb +0 -6
  300. data/vendor/assets/src/medias/rubies/examples/empty_atome.rb +0 -12
  301. data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +0 -15
  302. data/vendor/assets/src/medias/rubies/examples/grab.rb +0 -5
  303. data/vendor/assets/src/medias/rubies/examples/height.rb +0 -7
  304. data/vendor/assets/src/medias/rubies/examples/hide.rb +0 -7
  305. data/vendor/assets/src/medias/rubies/examples/id.rb +0 -14
  306. data/vendor/assets/src/medias/rubies/examples/image.rb +0 -8
  307. data/vendor/assets/src/medias/rubies/examples/left.rb +0 -7
  308. data/vendor/assets/src/medias/rubies/examples/link.rb +0 -22
  309. data/vendor/assets/src/medias/rubies/examples/markers.rb +0 -48
  310. data/vendor/assets/src/medias/rubies/examples/materials.rb +0 -15
  311. data/vendor/assets/src/medias/rubies/examples/matrix.rb +0 -102
  312. data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +0 -483
  313. data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +0 -32
  314. data/vendor/assets/src/medias/rubies/examples/monitoring.rb +0 -70
  315. data/vendor/assets/src/medias/rubies/examples/mute.rb +0 -22
  316. data/vendor/assets/src/medias/rubies/examples/on.rb +0 -26
  317. data/vendor/assets/src/medias/rubies/examples/opacity.rb +0 -5
  318. data/vendor/assets/src/medias/rubies/examples/over.rb +0 -21
  319. data/vendor/assets/src/medias/rubies/examples/pause.rb +0 -15
  320. data/vendor/assets/src/medias/rubies/examples/physical.rb +0 -19
  321. data/vendor/assets/src/medias/rubies/examples/play.rb +0 -15
  322. data/vendor/assets/src/medias/rubies/examples/read.rb +0 -11
  323. data/vendor/assets/src/medias/rubies/examples/refresh.rb +0 -8
  324. data/vendor/assets/src/medias/rubies/examples/remove.rb +0 -16
  325. data/vendor/assets/src/medias/rubies/examples/repeat.rb +0 -6
  326. data/vendor/assets/src/medias/rubies/examples/right.rb +0 -3
  327. data/vendor/assets/src/medias/rubies/examples/rotate.rb +0 -4
  328. data/vendor/assets/src/medias/rubies/examples/schedule.rb +0 -13
  329. data/vendor/assets/src/medias/rubies/examples/shadow.rb +0 -84
  330. data/vendor/assets/src/medias/rubies/examples/size.rb +0 -8
  331. data/vendor/assets/src/medias/rubies/examples/sort.rb +0 -18
  332. data/vendor/assets/src/medias/rubies/examples/style.rb +0 -4
  333. data/vendor/assets/src/medias/rubies/examples/tags.rb +0 -10
  334. data/vendor/assets/src/medias/rubies/examples/text.rb +0 -39
  335. data/vendor/assets/src/medias/rubies/examples/time.rb +0 -18
  336. data/vendor/assets/src/medias/rubies/examples/to_px.rb +0 -10
  337. data/vendor/assets/src/medias/rubies/examples/touch.rb +0 -56
  338. data/vendor/assets/src/medias/rubies/examples/vector.rb +0 -39
  339. data/vendor/assets/src/medias/rubies/examples/video.rb +0 -65
  340. data/vendor/assets/src/medias/rubies/examples/wait.rb +0 -8
  341. data/vendor/assets/src/medias/rubies/examples/web.rb +0 -13
  342. data/vendor/assets/src/medias/rubies/examples/width.rb +0 -6
  343. data/vendor/assets/src/medias/rubies/test.rb +0 -1
  344. data/vendor/assets/src/medias/rubies/text_read.rb +0 -1
  345. data/vendor/assets/src/medias/rubies/unstable/!run.rb +0 -16
  346. data/vendor/assets/src/medias/rubies/unstable/_2_solve.rb +0 -72
  347. data/vendor/assets/src/medias/rubies/unstable/_attach.rb +0 -12
  348. data/vendor/assets/src/medias/rubies/unstable/_audio.rb +0 -231
  349. data/vendor/assets/src/medias/rubies/unstable/_dataset.rb +0 -257
  350. data/vendor/assets/src/medias/rubies/unstable/_matrix.rb +0 -58
  351. data/vendor/assets/src/medias/rubies/unstable/_os.rb +0 -29
  352. data/vendor/assets/src/medias/rubies/unstable/_table2.rb +0 -108
  353. data/vendor/assets/src/medias/rubies/unstable/_vie.rb +0 -211
  354. data/vendor/assets/src/medias/rubies/users/code.rb +0 -6
  355. /data/lib/{atome/renderers → platform_specific}/opal/opal.rb +0 -0
  356. /data/lib/{atome/renderers → platform_specific}/opal/opal_parser.rb +0 -0
  357. /data/{vendor/assets/src/utilities/mode.rb → lib/renderers/html/communication.rb} +0 -0
  358. /data/{vendor/assets/src/medias/rubies/unstable/_test.rb → lib/renderers/html/security.rb} +0 -0
@@ -1,346 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Matrix
4
-
5
- def matrix(params = {}, &bloc)
6
-
7
- params = matrix_sanitizer(params)
8
-
9
- columns_data = if params[:columns]
10
- params.delete(:columns)
11
- else
12
- { count: 4 }
13
- end
14
-
15
- rows_data = if params[:rows]
16
- params.delete(:rows)
17
- else
18
- { count: 4 }
19
- end
20
-
21
- cells_data = if params[:cells]
22
- params.delete(:cells)
23
- else
24
- { particles: { margin: 9, color: :lightgray } }
25
- end
26
- cells_color = cells_data[:particles].delete(:color)
27
- # we grab Black matter to avoid coloring the view
28
- cells_color_id = grab(:black_matter).color(cells_color).id
29
- cells_shadow = cells_data[:particles].delete(:shadow)
30
- cells_shadow_id = grab(:black_matter).shadow(cells_shadow).id
31
- exceptions_data = params.delete(:exceptions)
32
- default_renderer = Essentials.default_params[:render_engines]
33
- atome_type = :matrix
34
- # generated_render = params[:renderers] || default_renderer
35
- # TODO: maybe change the code below and don't use identity_generator directly!!!
36
- generated_id = params[:id] || identity_generator(:matrix)
37
- params = atome_common(:matrix, params)
38
- the_matrix = Atome.new(atome_type => params, &bloc)
39
-
40
- # the_matrix = Atome.new(matrix: { type: :shape, id: :my_table, renderers: [:browser], parents: [] }, &bloc)
41
- # example = Atome.new(code: { type: :code, renderers: [:headless], parents: [], children: [] })
42
- # TODO: use the standard atome creation method (generator.build_atome(:collector)),
43
- # TODO suite => For now its impossible to make it draggable because it return the created box not the matrix
44
- # get necessary params
45
- matrix_id = params[:id]
46
- matrix_width = params[:width]
47
- matrix_height = params[:height]
48
- columns = columns_data[:count]
49
- rows = rows_data[:count]
50
- margin = cells_data[:particles].delete(:margin)
51
- the_matrix.instance_variable_set('@columns', columns)
52
- the_matrix.instance_variable_set('@rows', rows)
53
- the_matrix.instance_variable_set('@margin', margin)
54
- the_matrix.instance_variable_set('@cell_style', cells_data[:particles])
55
- the_matrix.instance_variable_set('@matrix_width', matrix_width)
56
- the_matrix.instance_variable_set('@matrix_height', matrix_height)
57
- the_matrix.instance_variable_set('@cells', [])
58
- rows = rows_data[:count]
59
- columns = columns_data[:count]
60
-
61
- # exceptions reorganisation
62
- if exceptions_data
63
- columns_exceptions = exceptions_data[:columns] ||= {}
64
- columns_fusion_exceptions = columns_exceptions[:fusion] ||= {}
65
- columns_divided_exceptions = columns_exceptions[:divided] ||= {}
66
- rows_exceptions = exceptions_data[:rows] ||= {}
67
- rows_fusion_exceptions = rows_exceptions[:fusion] ||= {}
68
- rows_divided_exceptions = rows_exceptions[:divided] ||= {}
69
- exceptions = { columns_fusion: columns_fusion_exceptions,
70
- columns_divided: columns_divided_exceptions,
71
- rows_fusion: rows_fusion_exceptions,
72
- rows_divided: rows_divided_exceptions }
73
-
74
- else
75
- exceptions = {
76
- columns_fusion: {},
77
- columns_divided: {},
78
- rows_fusion: {},
79
- rows_divided: {}
80
- }
81
-
82
- end
83
- the_matrix.instance_variable_set('@exceptions', exceptions)
84
-
85
- # let's create the matrix background
86
- # cells creation below
87
- number_of_cells = rows * columns
88
- number_of_cells.times do |index|
89
- current_matrix = grab(matrix_id)
90
- current_cell_id = "#{matrix_id}_#{index}"
91
- current_cell = current_matrix.box({ id: current_cell_id })
92
- the_matrix.instance_variable_set('@cell_style', cells_data[:particles])
93
- current_matrix.instance_variable_get('@cells') << current_cell_id
94
-
95
- current_cell.attached([cells_shadow_id])
96
- current_cell.attached([cells_color_id])
97
- apply_style(current_cell, cells_data[:particles])
98
-
99
- end
100
- # lets create the columns and rows
101
- the_matrix.format_matrix(matrix_id, matrix_width, matrix_height, rows, columns, margin, exceptions)
102
-
103
- the_matrix
104
- end
105
-
106
- def matrix_sanitizer(params)
107
-
108
- default_params = {
109
-
110
- left: 33, top: 33, width: 369, height: 369, smooth: 8, color: :gray,
111
- columns: { count: 4 },
112
- rows: { count: 4 },
113
- cells: { particles: { margin: 9, color: :lightgray, smooth: 9, shadow: { blur: 9, left: 3, top: 3 } }
114
- }
115
- }
116
- default_params.merge(params)
117
- end
118
-
119
- def cells(cell_nb, &proc)
120
- if cell_nb
121
- collected_atomes = []
122
- cell_nb.each do |cell_found|
123
- if cell_found.instance_of?(Integer)
124
- cell_found = cells[cell_found]
125
- collected_atomes << cell_found
126
- else
127
- collected_atomes << cell_found
128
- end
129
- end
130
- instance_exec(collected_atomes, &proc) if proc.is_a?(Proc)
131
- else
132
- instance_exec(@cells, &proc) if proc.is_a?(Proc)
133
- @cells
134
- end
135
-
136
- end
137
-
138
- def cell(cell_nb)
139
- grab("#{id}_#{cell_nb}")
140
- end
141
-
142
- def columns(column_requested, &proc)
143
- number_of_cells = @columns * @rows
144
- column_content = get_column_or_row(number_of_cells, @columns, column_requested, true)
145
- cells_found = []
146
- column_content.each do |cell_nb|
147
- atome_found = grab("#{id}_#{cell_nb}")
148
- instance_exec(atome_found, &proc) if proc.is_a?(Proc)
149
- cells_found << grab("#{id}_#{cell_nb}")
150
- end
151
- element({ data: cells_found })
152
- end
153
-
154
- def rows(row_requested, &proc)
155
- number_of_cells = @columns * @rows
156
- column_content = get_column_or_row(number_of_cells, @columns, row_requested, false)
157
- cells_found = []
158
- column_content.each do |cell_nb|
159
- atome_found = grab("#{id}_#{cell_nb}")
160
- instance_exec(atome_found, &proc) if proc.is_a?(Proc)
161
- cells_found << grab("#{id}_#{cell_nb}")
162
- end
163
- element({ data: cells_found })
164
- end
165
-
166
- def fusion(params)
167
- number_of_cells = @columns * @rows
168
- if params[:columns]
169
- @exceptions[:columns_fusion] = params[:columns].merge(@exceptions[:columns_fusion])
170
- params[:columns].each do |column_to_alter, value|
171
- cell_height = (@matrix_height - @margin * (@rows + 1)) / @rows
172
- cells_in_column = get_column_or_row(number_of_cells, @columns, column_to_alter, true)
173
- cells_to_alter = cells_in_column[value[0]..value[1]]
174
- cells_to_alter.each_with_index do |cell_nb, index|
175
- current_cell = grab("#{id}_#{cell_nb}")
176
- if index.zero?
177
- current_cell.height(cell_height * cells_to_alter.length + @margin * (cells_to_alter.length - 1))
178
- else
179
- current_cell.hide(true)
180
- end
181
- end
182
- end
183
- else
184
- @exceptions[:rows_fusion] = params[:rows].merge(@exceptions[:rows_fusion])
185
- params[:rows].each do |row_to_alter, value|
186
- cell_width = (@matrix_width - @margin * (@columns + 1)) / @columns
187
- cells_in_column = get_column_or_row(number_of_cells, @columns, row_to_alter, false)
188
- cells_to_alter = cells_in_column[value[0]..value[1]]
189
-
190
- cells_to_alter.each_with_index do |cell_nb, index|
191
- current_cell = grab("#{id}_#{cell_nb}")
192
- if index.zero?
193
- current_cell.width(cell_width * cells_to_alter.length + @margin * (cells_to_alter.length - 1))
194
- else
195
- current_cell.hide(true)
196
- end
197
- end
198
- end
199
- end
200
- end
201
-
202
- def divide(params)
203
- number_of_cells = @columns * @rows
204
- if params[:columns]
205
- params[:columns].each do |column_to_alter, value|
206
- cells_in_column = get_column_or_row(number_of_cells, @columns, column_to_alter, true)
207
- # we get the nth first element
208
- cells_to_alter = cells_in_column.take(value)
209
- cells_in_column.each_with_index do |cell_nb, index|
210
- current_cell = grab("#{id}_#{cell_nb}")
211
- if cells_to_alter.include?(cell_nb)
212
- current_cell.height(@matrix_height / value - (@margin + value))
213
- current_cell.top(current_cell.height * index + @margin * (index + 1))
214
- else
215
- current_cell.hide(true)
216
- end
217
- end
218
- end
219
- else
220
- params[:rows].each do |row_to_alter, value|
221
- cells_in_row = get_column_or_row(number_of_cells, @columns, row_to_alter, false)
222
- # we get the nth first element
223
- cells_to_alter = cells_in_row.take(value)
224
- cells_in_row.each_with_index do |cell_nb, index|
225
- current_cell = grab("#{id}_#{cell_nb}")
226
- if cells_to_alter.include?(cell_nb)
227
- current_cell.width(@matrix_width / value - @margin - (@margin / value))
228
- current_cell.left(current_cell.width * index + @margin * (index + 1))
229
- else
230
- current_cell.hide(true)
231
- end
232
- end
233
- end
234
- end
235
- end
236
-
237
- def first(item, &proc)
238
- if item[:columns]
239
- columns(0, &proc)
240
- else
241
- rows(0, &proc)
242
- end
243
- end
244
-
245
- def last(item, &proc)
246
- if item[:columns]
247
- columns(@columns - 1, &proc)
248
- else
249
- rows(@rows - 1, &proc)
250
- end
251
- end
252
-
253
- def format_matrix(matrix_id, matrix_width, matrix_height, nb_of_rows, nb_of_cols, margin, exceptions = {})
254
- cell_width = (matrix_width - margin * (nb_of_cols + 1)) / nb_of_cols
255
- cell_height = (matrix_height - margin * (nb_of_rows + 1)) / nb_of_rows
256
- ratio = cell_height / cell_width
257
- i = 0
258
- nb_of_rows.times do |row_index|
259
- nb_of_cols.times do |col_index|
260
- # Calculate the x and y position of the cell
261
- x = (col_index + 1) * margin + col_index * cell_width
262
- y = (row_index + 1) * margin + row_index * cell_height
263
- current_cell = grab("#{matrix_id}_#{i}")
264
- current_cell.materials.each do |child|
265
- grab(child).width(cell_width) if grab(child)
266
- grab(child).height(cell_width) if grab(child)
267
- end
268
- current_cell.width = cell_width
269
- current_cell.height = cell_height
270
- current_cell.left(x)
271
- current_cell.top(y)
272
- i += 1
273
- end
274
- end
275
-
276
- # exceptions management
277
- return unless exceptions
278
-
279
- fusion({ columns: exceptions[:columns_fusion] }) if exceptions[:columns_fusion]
280
-
281
- end
282
-
283
- def apply_style(current_cell, style)
284
- current_cell.set(style)
285
- end
286
-
287
- def add_columns(nb)
288
- prev_nb_of_cells = @columns * @rows
289
- nb_of_cells_to_adds = nb * @rows
290
- new_nb_of_cells = prev_nb_of_cells + nb_of_cells_to_adds
291
- new_nb_of_cells.times do |index|
292
- if index < prev_nb_of_cells
293
- grab("#{id}_#{index}").delete(true)
294
- end
295
- current_cell = box({ id: "#{id}_#{index}" })
296
- apply_style(current_cell, @cell_style)
297
- end
298
- @columns += nb
299
- format_matrix(id, @matrix_width, @matrix_height, @rows, @columns, @margin, @exceptions)
300
- end
301
-
302
- def add_rows(nb)
303
- prev_nb_of_cells = @columns * @rows
304
- nb_of_cells_to_adds = nb * @columns
305
- new_nb_of_cells = prev_nb_of_cells + nb_of_cells_to_adds
306
- new_nb_of_cells.times do |index|
307
- if index < prev_nb_of_cells
308
- grab("#{id}_#{index}").delete(true)
309
- end
310
- current_cell = box({ id: "#{id}_#{index}" })
311
- apply_style(current_cell, @cell_style)
312
- end
313
- @rows += nb
314
- format_matrix(id, @matrix_width, @matrix_height, @rows, @columns, @margin, @exceptions)
315
- end
316
-
317
- def resize(width, height)
318
- @matrix_width = width
319
- @matrix_height = height
320
- grab(id).width(width)
321
- grab(id).height(height)
322
- format_matrix(id, @matrix_width, @matrix_height, @rows, @columns, @margin, @exceptions)
323
- end
324
-
325
- def get_column_or_row(length, num_columns, index, is_column)
326
- # Compute the number of line
327
- num_rows = length / num_columns
328
- if is_column
329
- result = []
330
- (0...num_rows).each do |row|
331
- result << (index + row * num_columns)
332
- end
333
- result
334
- else
335
- start_index = index * num_columns
336
- end_index = start_index + num_columns - 1
337
- (start_index..end_index).to_a
338
- end
339
- end
340
- end
341
-
342
- class Atome
343
- include Matrix
344
- end
345
-
346
-
@@ -1,133 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # callbacks methods here
4
- class Atome
5
- private
6
-
7
- attr_accessor :drag_start_proc, :drag_move_proc, :drag_end_proc,
8
- :drop_action_proc,:over_action_proc,
9
- :play_start_proc, :play_active_proc, :play_end_proc,
10
- :animation_start_proc, :animation_active_proc, :animation_stop_proc
11
-
12
- public
13
-
14
- def schedule_callback(proc)
15
- instance_exec(&proc) if proc.is_a?(Proc)
16
- end
17
-
18
- def read_callback(file, proc)
19
- file_content=file.split('</head><body>')[1].split('</body></html>')[0]
20
- # FIXME : found why '> is converted to &gt;'
21
- file_content=file_content.gsub("&gt;", ">")
22
- instance_exec(file_content, &proc) if proc.is_a?(Proc)
23
- end
24
-
25
- def time_callback(current_time, markers)
26
- @atome[:time] = current_time
27
- markers.each_value do |marker|
28
- # check if the current time matches the time of the marker, thanks to chat GPT for the example
29
- if current_time >= marker[:begin] && current_time < marker[:end]
30
- code_found = marker[:code]
31
- instance_exec(current_time, &code_found) if code_found.is_a?(Proc)
32
- end
33
- end
34
- end
35
-
36
- # drag callbacks
37
- def drag_start_callback(page_x, page_y, left_val, top_val)
38
- @atome[:left] = left_val
39
- @atome[:top] = top_val
40
- proc = @drag_start_proc
41
- instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
42
- end
43
-
44
- def drag_move_callback(page_x, page_y, left_val, top_val)
45
- proc = @drag_move_proc
46
- @atome[:left] = left_val
47
- @atome[:top] = top_val
48
- instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
49
- end
50
-
51
- def drag_end_callback(page_x, page_y, left_val, top_val)
52
- @atome[:left] = left_val
53
- @atome[:top] = top_val
54
- # alert :loo
55
- # #now we rest the position
56
- # self.left(left_val)
57
- # self.top(top_val)
58
- proc = @drag_end_proc
59
- instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
60
- end
61
-
62
- # drop callbacks
63
- def drop_action_callback( data_found, _full_event)
64
- proc = @drop_action_proc
65
- instance_exec(data_found, &proc) if proc.is_a?(Proc)
66
- end
67
-
68
- # def over_action_callback( data_found, _full_event)
69
- # proc = @enter_action_proc
70
- # instance_exec(data_found, &proc) if proc.is_a?(Proc)
71
- # end
72
-
73
- # drop callbacks
74
- def enter_action_callback( data_found, _full_event)
75
- proc = @enter_action_proc
76
- instance_exec( data_found,&proc) if proc.is_a?(Proc)
77
- end
78
-
79
- def leave_action_callback(data_found)
80
- proc = @leave_action_proc
81
- instance_exec( data_found,&proc) if proc.is_a?(Proc)
82
- end
83
-
84
-
85
- # def drag_move_callback(page_x, page_y, left_val, top_val)
86
- # proc = @drag_move_proc
87
- # @atome[:left] = left_val
88
- # @atome[:top] = top_val
89
- # instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
90
- # end
91
- #
92
- # def drag_end_callback(page_x, page_y, left_val, top_val)
93
- # @atome[:left] = left_val
94
- # @atome[:top] = top_val
95
- # proc = @drag_end_proc
96
- # instance_exec({ pageX: page_x, pageY: page_y, left: left_val, top: top_val }, &proc) if proc.is_a?(Proc)
97
- # end
98
-
99
- # sort callbacks
100
- def sort_callback(atome)
101
- sort_proc = @sort_proc
102
- instance_exec(atome, &sort_proc) if sort_proc.is_a?(Proc)
103
- end
104
-
105
- # animation
106
- def browser_animate_callback(particle_found, value, animation_hash, original_particle, animation_atome)
107
- anim_proc = animation_hash[:code]
108
- # we exec the callback bloc from :animate
109
- instance_exec({ original_particle => value }, &anim_proc) if anim_proc.is_a?(Proc)
110
- # we exec the callback bloc from :play
111
- play_proc = animation_atome.play_active_proc
112
- instance_exec({ @atome[particle_found] => value }, &play_proc) if play_proc.is_a?(Proc)
113
- # we animate:
114
- browser_object.style[particle_found] = value if browser_object
115
- # we update the atome property
116
- @atome[original_particle] = value
117
- end
118
-
119
- def play_start_callback(_particle_found, _start_value, animation_hash, original_particle, atome_found)
120
- value = animation_hash[:begin][original_particle]
121
- value = atome_found.atome[original_particle] if value == :self
122
- start_proc = @animation_start_proc
123
- @atome[original_particle] = value
124
- instance_exec({ original_particle => value }, &start_proc) if start_proc.is_a?(Proc)
125
- end
126
-
127
- def play_stop_callback(_particle_found, _end_value, animation_hash, original_particle, _atome_found)
128
- value = animation_hash[:end][original_particle]
129
- end_proc = @animation_stop_proc
130
- @atome[original_particle] = value
131
- instance_exec({ original_particle => value }, &end_proc) if end_proc.is_a?(Proc)
132
- end
133
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # this class is used to allow batch treatment
4
- class Batch
5
- def each(&proc)
6
- @data.each do |val|
7
- atome_found = grab(val)
8
- instance_exec(atome_found, &proc) if proc.is_a?(Proc)
9
- end
10
- end
11
-
12
- def initialize(params)
13
- @data = params
14
- # self
15
- end
16
-
17
- def dispatch(method, args, &block)
18
- @data.each do |atome_found|
19
- args.each do |arg|
20
- grab(atome_found).send(method, arg, &block)
21
- end
22
- end
23
- # we return self to allow method chaining
24
- self
25
- end
26
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Essentials method here
4
- class Atome
5
- private
6
-
7
- def get(element)
8
- @atome[element]
9
- end
10
-
11
- def value
12
- @atome
13
- end
14
-
15
- def to_s
16
- if @value
17
- @result = @value.to_s
18
- elsif @atome
19
- @result = @atome.to_s
20
- end
21
- @result.to_s
22
- end
23
- end
@@ -1,158 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # TODO : remove the DOM const and the parents methods there's just there to satisfy Rubocop
4
- # start dummy code
5
- DOM = :nil
6
-
7
- def parents(_val) end
8
-
9
- generator = Genesis.generator
10
-
11
- generator.build_render(:browser_shape) do
12
- # if @definition
13
- # alert "why we never pass here??????"
14
- # else
15
- @browser_type = :div
16
- id_found = @atome[:id]
17
- DOM do
18
- div(id: id_found).atome
19
- end.append_to(BrowserHelper.browser_document[:user_view])
20
- @browser_object = BrowserHelper.browser_document[id_found]
21
- # end
22
-
23
- end
24
-
25
- generator.build_render(:browser_color) do |_value|
26
- puts " @atome[:id] : #{@atome[:id]}"
27
- @browser_type = :style
28
- # puts "1 - for the id : #{id} the browser type is ::::> #{@browser_type}"
29
- id_found = @atome[:id]
30
- # type_found = @atome[:type]
31
- # we remove previous unused style tag
32
- BrowserHelper.browser_document[id]&.remove
33
- red_found = @atome[:red]
34
- blue_found = @atome[:blue]
35
- green_found = @atome[:green]
36
- alpha_found = @atome[:alpha]
37
- ########################### old code ###########################
38
- # BrowserHelper.browser_document.head << Browser.DOM("<style atome='#{type_found}'
39
- # id='#{id_found}'>.#{id_found}{
40
- # poil
41
- # //background-color: rgba(#{red_found * 255},#{green_found * 255},#{blue_found * 255},#{alpha_found});
42
- # //fill: rgba(#{red_found * 255},#{green_found * 255},#{blue_found * 255},#{alpha_found}),
43
- # //stroke: rgba(#{red_found * 255},#{green_found * 255},#{blue_found * 255},#{alpha_found})
44
- #
45
- # }</style>")
46
-
47
- ########################### new code ###########################
48
- atomic_style = BrowserHelper.browser_document['#atomic_style']
49
-
50
- class_content = <<STR
51
- .#{id_found} {
52
- background-color: rgba(#{red_found * 255}, #{green_found * 255}, #{blue_found * 255}, #{alpha_found});
53
- fill: rgba(#{red_found * 255}, #{green_found * 255}, #{blue_found * 255}, #{alpha_found});
54
- stroke: rgba(#{red_found * 255}, #{green_found * 255}, #{blue_found * 255}, #{alpha_found});
55
- }
56
- STR
57
-
58
- if atomic_style
59
- if atomic_style.text.include?(".#{id_found}")
60
- # if the class exist , update it's content with the new class
61
- regex = /(\.#{id_found}\s*{)([\s\S]*?)(})/m
62
- atomic_style.text = atomic_style.text.gsub(regex, class_content)
63
- else
64
- # if the class doesn't exist, add it to the end of the tag <style>
65
- atomic_style.text += class_content
66
- end
67
- end
68
- ########################### new code end ###########################
69
-
70
- # TODO: use the code below to modify the style tag
71
- @browser_object = BrowserHelper.browser_document[id_found]
72
- end
73
-
74
- generator.build_render(:browser_shadow) do |_value|
75
- @browser_type = :style
76
- id_found = @atome[:id]
77
- # type_found = @atome[:type]
78
- # we remove previous unused style tag
79
- BrowserHelper.browser_document[id]&.remove
80
- red_found = @atome[:red]
81
- blue_found = @atome[:blue]
82
- green_found = @atome[:green]
83
- alpha_found = @atome[:alpha]
84
- blur = @atome[:blur]
85
- left = @atome[:left]
86
- top = @atome[:top]
87
- inset = @atome[:direction]
88
- ############ old code
89
- # BrowserHelper.browser_document.head << Browser.DOM("<style atome='#{type_found}'
90
- # id='#{id_found}'>.#{id_found}{box-shadow: #{left}px #{top}px #{blur}px #{inset} rgba(#{red_found * 255},
91
- # #{green_found * 255},#{blue_found * 255},#{alpha_found})}</style>")
92
- # # TODO/ use the code below to modify the style tag
93
- # @browser_object = BrowserHelper.browser_document[id_found]
94
-
95
- ########## new code
96
- atomic_style = BrowserHelper.browser_document['#atomic_style']
97
-
98
- class_content = <<STR
99
- .#{id_found} {
100
- box-shadow: #{left}px #{top}px #{blur}px #{inset} rgba(#{red_found * 255},#{green_found * 255},#{blue_found * 255},
101
- #{alpha_found});
102
- filter: drop-shadow(#{left}px #{top}px #{blur}px rgba(#{red_found * 255},#{green_found * 255},#{blue_found * 255},
103
- #{alpha_found}));
104
- }
105
- STR
106
-
107
- if atomic_style
108
- if atomic_style.text.include?(".#{id_found}")
109
- # if the class exist , update it's content with the new class
110
- regex = /(\.#{id_found}\s*{)([\s\S]*?)(})/m
111
- atomic_style.text = atomic_style.text.gsub(regex, class_content)
112
- else
113
- # if the class doesn't exist, add it to the end of the tag <style>
114
- atomic_style.text += class_content
115
- end
116
- end
117
- #
118
- # @browser_object = BrowserHelper.browser_document[id_found]
119
-
120
- end
121
-
122
- generator.build_render(:browser_image) do |_user_prc|
123
- @browser_type = :div
124
- id_found = @atome[:id]
125
- DOM do
126
- img({ id: id_found }).atome
127
- end.append_to(BrowserHelper.browser_document[:user_view])
128
- @browser_object = BrowserHelper.browser_document[id_found]
129
- end
130
-
131
- generator.build_render(:browser_text) do |_value, _user_proc|
132
- id_found = @atome[:id]
133
- DOM do
134
- div(id: id_found).atome.text
135
- end.append_to(BrowserHelper.browser_document[:user_view])
136
- @browser_object = BrowserHelper.browser_document[id_found]
137
- @browser_type = :div
138
- end
139
-
140
- generator.build_render(:browser_web) do
141
- @browser_type = :div
142
- id_found = @atome[:id]
143
- DOM do
144
- iframe({ id: id_found }).atome
145
- end.append_to(BrowserHelper.browser_document[:user_view])
146
- @browser_object = BrowserHelper.browser_document[id_found]
147
- @browser_object.attributes[:allow] = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture'
148
- @browser_object.attributes[:allowfullscreen] = true
149
- end
150
-
151
- generator.build_render(:browser_video) do |_value, _user_proc|
152
- @browser_type = :div
153
- id_found = @atome[:id]
154
- DOM do
155
- video({ id: id_found, autoplay: false, loop: false, muted: false }).atome
156
- end.append_to(BrowserHelper.browser_document[:user_view])
157
- @browser_object = BrowserHelper.browser_document[id_found]
158
- end