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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile +3 -1
- data/README.md +70 -1
- data/Rakefile +246 -75
- data/app_builder_helpers/Rakefile +276 -288
- data/documentation/basic.md +242 -0
- data/documentation/deep learning/architecture.txt +3763 -0
- data/documentation/deep learning/atome.png +0 -0
- data/documentation/deep learning/basic_infos.txt +227 -0
- data/documentation/deep learning/example_of_users_code.rb +1810 -0
- data/documentation/deep learning/misc.txt +24 -0
- data/documentation/deep learning/ruby_js_example.rb +272 -0
- data/documentation/deep learning/wasm_script_help.text +14 -0
- data/documentation/framework/enhance_atome.md +1 -1
- data/documentation/tutorials/tutorials.md +7 -0
- data/exe/atome +308 -208
- data/lib/atome/atome.rb +52 -156
- data/lib/atome/extensions/atome.rb +129 -47
- data/lib/atome/extensions/mathematics.rb +20 -0
- data/lib/atome/extensions/ping.rb +2 -3
- data/lib/atome/genesis/generators/atome.rb +57 -30
- data/lib/atome/genesis/generators/communication.rb +9 -0
- data/lib/atome/genesis/generators/effect.rb +0 -1
- data/lib/atome/genesis/generators/event.rb +279 -43
- data/lib/atome/genesis/generators/geometry.rb +1 -10
- data/lib/atome/genesis/generators/hierarchy.rb +103 -0
- data/lib/atome/genesis/generators/identity.rb +45 -84
- data/lib/atome/genesis/generators/material.rb +31 -34
- data/lib/atome/genesis/generators/property.rb +31 -0
- data/lib/atome/genesis/generators/security.rb +31 -0
- data/lib/atome/genesis/generators/spatial.rb +3 -5
- data/lib/atome/genesis/generators/time.rb +0 -1
- data/lib/atome/genesis/generators/utility.rb +181 -66
- data/lib/atome/genesis/genesis.rb +152 -55
- data/lib/atome/genesis/sparkle.rb +59 -75
- data/lib/atome/helpers/color_helper/color/rgb/colors.rb +1 -1
- data/lib/atome/helpers/color_helper/color/rgb.rb +1 -1
- data/lib/atome/helpers/color_helper/color.rb +226 -7
- data/lib/atome/helpers/essentials.rb +22 -26
- data/lib/atome/helpers/security.rb +71 -0
- data/lib/atome/helpers/utilities.rb +191 -178
- data/lib/atome/kernel/black_matter.rb +22 -0
- data/lib/atome/kernel/universe.rb +123 -24
- data/lib/atome/presets/atome.rb +39 -35
- data/lib/atome/version.rb +3 -2
- data/lib/atome.rb +12 -12
- data/lib/atome_relative.rb +36 -0
- data/lib/{atome/renderers → platform_specific}/opal/atome_opal_extensions.rb +4 -1
- data/lib/{atome/renderers → platform_specific}/opal/extensions/color.rb +12 -5
- data/lib/{atome/renderers → platform_specific}/opal/extensions/geolocation.rb +1 -0
- data/lib/platform_specific/opal/extensions/js.rb +21 -0
- data/lib/platform_specific/opal/extensions/object.rb +6 -0
- data/lib/platform_specific/opal/extensions/ping.rb +31 -0
- data/lib/{atome/renderers → platform_specific}/opal/extensions/sha.rb +4 -2
- data/lib/platform_specific/wasm/atome_wasm_extensions.rb +11 -0
- data/lib/renderers/headless/headless.rb +18 -0
- data/lib/renderers/headless/index.rb +6 -0
- data/lib/renderers/headless/index_relative.rb +6 -0
- data/lib/renderers/headless/utility.rb +6 -0
- data/{vendor/assets/src/medias/rubies/examples/top.rb → lib/renderers/html/atome.rb} +0 -1
- data/lib/renderers/html/atome_html.rb +22 -0
- data/lib/renderers/html/effect.rb +26 -0
- data/lib/renderers/html/event.rb +43 -0
- data/lib/renderers/html/geometry.rb +31 -0
- data/lib/renderers/html/hierarchy.rb +233 -0
- data/lib/renderers/html/html.rb +1112 -0
- data/lib/renderers/html/identity.rb +84 -0
- data/lib/renderers/html/index.rb +19 -0
- data/lib/renderers/html/index_relative.rb +20 -0
- data/lib/renderers/html/material.rb +53 -0
- data/lib/renderers/html/property.rb +24 -0
- data/lib/renderers/html/spatial.rb +46 -0
- data/lib/renderers/html/time.rb +1 -0
- data/lib/renderers/html/utility.rb +38 -0
- data/lib/renderers/renderer.rb +16 -0
- data/lib/renderers/server/index.rb +4 -0
- data/lib/renderers/server/index_relative.rb +4 -0
- data/lib/renderers/server/utility.rb +4 -0
- data/sig/atome.rbs +6 -0
- data/sig/object.rbs +4 -0
- data/sig/universe.rbs +3 -0
- data/vendor/assets/Rakefile +3 -3
- data/vendor/assets/application/examples/a_concat.rb +16 -0
- data/vendor/assets/application/examples/affect.rb +8 -0
- data/vendor/assets/application/examples/animation.rb +96 -0
- data/vendor/assets/application/examples/apply.rb +8 -0
- data/vendor/assets/application/examples/atome.rb +5 -0
- data/vendor/assets/application/examples/attach.rb +34 -0
- data/vendor/assets/application/examples/attached.rb +38 -0
- data/vendor/assets/application/examples/basic_understanding.rb +52 -0
- data/vendor/assets/application/examples/browse.rb +17 -0
- data/vendor/assets/application/examples/callback.rb +20 -0
- data/vendor/assets/application/examples/category.rb +12 -0
- data/vendor/assets/application/examples/clear.rb +96 -0
- data/vendor/assets/application/examples/clones.rb +177 -0
- data/vendor/assets/application/examples/code.rb +13 -0
- data/vendor/assets/application/examples/color.rb +54 -0
- data/vendor/assets/application/examples/convert.rb +163 -0
- data/vendor/assets/application/examples/copy.rb +25 -0
- data/vendor/assets/application/examples/copybck.rb +68 -0
- data/vendor/assets/application/examples/debug.rb +78 -0
- data/vendor/assets/application/examples/delete.rb +93 -0
- data/vendor/assets/application/examples/display.rb +279 -0
- data/vendor/assets/application/examples/display_bck.rb +164 -0
- data/vendor/assets/application/examples/drag.rb +45 -0
- data/vendor/assets/application/examples/drop.rb +35 -0
- data/vendor/assets/application/examples/duplicate.rb +64 -0
- data/vendor/assets/application/examples/edit.rb +21 -0
- data/vendor/assets/application/examples/encode.rb +6 -0
- data/vendor/assets/application/examples/file.rb +50 -0
- data/vendor/assets/application/examples/find.rb +157 -0
- data/vendor/assets/application/examples/generator_and_build.rb +15 -0
- data/vendor/assets/application/examples/getter.rb +16 -0
- data/vendor/assets/application/examples/grab.rb +14 -0
- data/vendor/assets/application/examples/gradient.rb +35 -0
- data/vendor/assets/application/examples/group.rb +44 -0
- data/vendor/assets/application/examples/hierarchy.rb +21 -0
- data/vendor/assets/application/examples/history.rb +31 -0
- data/vendor/assets/application/examples/hypertext.rb +113 -0
- data/vendor/assets/application/examples/image.rb +5 -0
- data/vendor/assets/application/examples/keyboard.rb +59 -0
- data/vendor/assets/application/examples/layout.rb +227 -0
- data/vendor/assets/application/examples/login.rb +10 -0
- data/vendor/assets/application/examples/markup.rb +4 -0
- data/vendor/assets/application/examples/match.rb +115 -0
- data/vendor/assets/application/examples/messaging.rb +16 -0
- data/vendor/assets/application/examples/monitor.rb +14 -0
- data/vendor/assets/application/examples/on_resize.rb +7 -0
- data/vendor/assets/{src/medias/rubies/examples/get_renderer_list.rb → application/examples/online.rb} +1 -1
- data/vendor/assets/application/examples/over.rb +29 -0
- data/vendor/assets/application/examples/paint.rb +23 -0
- data/vendor/assets/application/examples/particles.rb +4 -0
- data/vendor/assets/application/examples/percent_to_px.rb +4 -0
- data/vendor/assets/application/examples/play.rb +50 -0
- data/vendor/assets/application/examples/presets.rb +33 -0
- data/vendor/assets/application/examples/random.rb +42 -0
- data/vendor/assets/application/examples/raw_html.rb +48 -0
- data/vendor/assets/application/examples/read.rb +11 -0
- data/vendor/assets/application/examples/refresh.rb +62 -0
- data/vendor/assets/application/examples/remove.rb +47 -0
- data/vendor/assets/application/examples/repeat.rb +26 -0
- data/vendor/assets/application/examples/resize.rb +17 -0
- data/vendor/assets/application/examples/scroll.rb +11 -0
- data/vendor/assets/application/examples/security.rb +76 -0
- data/vendor/assets/application/examples/selected.rb +30 -0
- data/vendor/assets/application/examples/shadow.rb +46 -0
- data/vendor/assets/application/examples/shapes.rb +6 -0
- data/vendor/assets/{src/medias/rubies → application}/examples/smooth.rb +5 -1
- data/vendor/assets/application/examples/style.rb +4 -0
- data/vendor/assets/application/examples/sync.rb +39 -0
- data/vendor/assets/application/examples/tagged.rb +24 -0
- data/vendor/assets/application/examples/terminal.rb +4 -0
- data/vendor/assets/application/examples/text.rb +5 -0
- data/vendor/assets/application/examples/touch.rb +38 -0
- data/vendor/assets/application/examples/type_mutation.rb +18 -0
- data/vendor/assets/application/examples/universe.rb +8 -0
- data/vendor/assets/application/examples/vector.rb +24 -0
- data/vendor/assets/application/examples/video.rb +14 -0
- data/vendor/assets/application/examples/wait.rb +6 -0
- data/vendor/assets/application/examples/www.rb +10 -0
- data/vendor/assets/application/index.rb +1 -1
- data/vendor/assets/application/test.rb +29 -0
- data/vendor/assets/application/works/photos.rb +672 -0
- data/vendor/assets/application/works/photos2.rb +218 -0
- data/vendor/assets/application/works/photos3.rb +343 -0
- data/vendor/assets/application/works/photos4.rb +34 -0
- data/vendor/assets/application/works/photos6.rb +6 -0
- data/vendor/assets/application/works/trigga.rb +0 -0
- data/vendor/assets/application/works/vie.rb +74 -0
- data/vendor/assets/server/atome_server.rb +37 -41
- data/vendor/assets/server/atome_server_wasm.rb +112 -0
- data/vendor/assets/server/capture.rb +10 -0
- data/vendor/assets/server/config.ru +5 -4
- data/vendor/assets/src/css/style.css +29 -4
- data/vendor/assets/src/index.html +31 -38
- data/vendor/assets/src/index_opal.html +42 -0
- data/vendor/assets/src/index_server.html +43 -0
- data/vendor/assets/src/index_server_wasm.html +46 -0
- data/vendor/assets/src/js/atome/atome.js +170 -150
- data/vendor/assets/src/js/atome/atome_helpers/add_font.js +46 -0
- data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +3 -1
- data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +12 -7
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +126 -0
- data/vendor/assets/src/js/atome/atome_helpers/{atome_file.js → file.js} +1 -1
- data/vendor/assets/src/js/atome/specific/opal.js +3 -0
- data/vendor/assets/src/js/atome/specific/wasm.js +12 -0
- data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +13 -0
- data/vendor/assets/src/js/third_parties/fabric.min.js +1 -1
- data/vendor/assets/src/js/third_parties/html-to-image.min.js +2 -0
- data/vendor/assets/src/js/third_parties/jsencrypt.min.js +2 -0
- data/vendor/assets/src/js/third_parties/papaparse.min.js +7 -0
- data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +202 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- data/vendor/assets/src/medias/images/logos/Facebook.svg +1 -1
- data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +109 -0
- data/vendor/assets/src/medias/images/logos/LinkedIn.svg +11 -0
- data/vendor/assets/src/medias/images/logos/X.svg +5 -0
- data/vendor/assets/src-tauri/Cargo.toml +1 -1
- data/vendor/assets/src-tauri/src/main.rs +59 -5
- data/vendor/assets/src-tauri/tauri.conf.json +1 -1
- data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
- metadata +188 -180
- data/lib/atome/extensions/mathematic.rb +0 -20
- data/lib/atome/extensions/matrix.rb +0 -346
- data/lib/atome/helpers/callbacks.rb +0 -133
- data/lib/atome/kernel/batch.rb +0 -26
- data/lib/atome/kernel/essentials.rb +0 -23
- data/lib/atome/renderers/browser/atome.rb +0 -158
- data/lib/atome/renderers/browser/browser.rb +0 -47
- data/lib/atome/renderers/browser/effect.rb +0 -23
- data/lib/atome/renderers/browser/event.rb +0 -96
- data/lib/atome/renderers/browser/geometry.rb +0 -27
- data/lib/atome/renderers/browser/helpers/animation_helper.rb +0 -69
- data/lib/atome/renderers/browser/helpers/browser_helper.rb +0 -101
- data/lib/atome/renderers/browser/helpers/color_helper.rb +0 -80
- data/lib/atome/renderers/browser/helpers/drag_helper.rb +0 -52
- data/lib/atome/renderers/browser/helpers/drop_helper.rb +0 -13
- data/lib/atome/renderers/browser/helpers/effect_helper.rb +0 -23
- data/lib/atome/renderers/browser/helpers/event_helper.rb +0 -76
- data/lib/atome/renderers/browser/helpers/image_helper.rb +0 -27
- data/lib/atome/renderers/browser/helpers/over_helper.rb +0 -13
- data/lib/atome/renderers/browser/helpers/shadow_helper.rb +0 -74
- data/lib/atome/renderers/browser/helpers/shape_helper.rb +0 -22
- data/lib/atome/renderers/browser/helpers/text_helper.rb +0 -38
- data/lib/atome/renderers/browser/helpers/video_helper.rb +0 -50
- data/lib/atome/renderers/browser/helpers/web_helper.rb +0 -26
- data/lib/atome/renderers/browser/identity.rb +0 -61
- data/lib/atome/renderers/browser/material.rb +0 -121
- data/lib/atome/renderers/browser/opal_add_on.rb +0 -31
- data/lib/atome/renderers/browser/opal_browser.rb +0 -6
- data/lib/atome/renderers/browser/spatial.rb +0 -59
- data/lib/atome/renderers/browser/time.rb +0 -3
- data/lib/atome/renderers/browser/utility.rb +0 -49
- data/lib/atome/renderers/headless/headless.rb +0 -10
- data/lib/atome/renderers/headless/utility.rb +0 -6
- data/lib/atome/renderers/html/atome.rb +0 -49
- data/lib/atome/renderers/html/effect.rb +0 -19
- data/lib/atome/renderers/html/event.rb +0 -9
- data/lib/atome/renderers/html/geometry.rb +0 -11
- data/lib/atome/renderers/html/html.rb +0 -42
- data/lib/atome/renderers/html/identity.rb +0 -14
- data/lib/atome/renderers/html/opal_browser.rb +0 -6
- data/lib/atome/renderers/html/spatial.rb +0 -28
- data/lib/atome/renderers/html/utility.rb +0 -17
- data/lib/atome/renderers/opal/extensions/atome.rb +0 -29
- data/lib/atome/renderers/opal/extensions/ping.rb +0 -18
- data/lib/atome/renderers/renderer.rb +0 -15
- data/lib/atome/renderers/server/server.rb +0 -10
- data/lib/atome/renderers/server/utility.rb +0 -6
- data/vendor/assets/aui.rb +0 -5
- data/vendor/assets/r&d/misc.rb +0 -219
- data/vendor/assets/r&d/ping.rb +0 -3
- data/vendor/assets/r&d/storage.rb +0 -9
- data/vendor/assets/r&d/view_example.rb +0 -21
- data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +0 -40
- data/vendor/assets/src/medias/javascripts/test.js +0 -1
- data/vendor/assets/src/medias/rubies/demos.rb +0 -63
- data/vendor/assets/src/medias/rubies/examples/add.rb +0 -24
- data/vendor/assets/src/medias/rubies/examples/animation.rb +0 -81
- data/vendor/assets/src/medias/rubies/examples/atome_new.rb +0 -27
- data/vendor/assets/src/medias/rubies/examples/attach.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/attached.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/auto_height.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/auto_width.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/batch.rb +0 -17
- data/vendor/assets/src/medias/rubies/examples/blur.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/bottom.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/box.rb +0 -20
- data/vendor/assets/src/medias/rubies/examples/center.rb +0 -21
- data/vendor/assets/src/medias/rubies/examples/circle.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/class.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/clear.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/clone.rb +0 -35
- data/vendor/assets/src/medias/rubies/examples/code.rb +0 -11
- data/vendor/assets/src/medias/rubies/examples/color.rb +0 -73
- data/vendor/assets/src/medias/rubies/examples/create_atome_in_atome.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/cursor.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/delete.rb +0 -42
- data/vendor/assets/src/medias/rubies/examples/depth.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/detached.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/drag.rb +0 -98
- data/vendor/assets/src/medias/rubies/examples/drop.rb +0 -26
- data/vendor/assets/src/medias/rubies/examples/edit.rb +0 -12
- data/vendor/assets/src/medias/rubies/examples/element.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/empty_atome.rb +0 -12
- data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/grab.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/height.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/hide.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/id.rb +0 -14
- data/vendor/assets/src/medias/rubies/examples/image.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/left.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/link.rb +0 -22
- data/vendor/assets/src/medias/rubies/examples/markers.rb +0 -48
- data/vendor/assets/src/medias/rubies/examples/materials.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/matrix.rb +0 -102
- data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +0 -483
- data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +0 -32
- data/vendor/assets/src/medias/rubies/examples/monitoring.rb +0 -70
- data/vendor/assets/src/medias/rubies/examples/mute.rb +0 -22
- data/vendor/assets/src/medias/rubies/examples/on.rb +0 -26
- data/vendor/assets/src/medias/rubies/examples/opacity.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/over.rb +0 -21
- data/vendor/assets/src/medias/rubies/examples/pause.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/physical.rb +0 -19
- data/vendor/assets/src/medias/rubies/examples/play.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/read.rb +0 -11
- data/vendor/assets/src/medias/rubies/examples/refresh.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/remove.rb +0 -16
- data/vendor/assets/src/medias/rubies/examples/repeat.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/right.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/rotate.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/schedule.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/shadow.rb +0 -84
- data/vendor/assets/src/medias/rubies/examples/size.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/sort.rb +0 -18
- data/vendor/assets/src/medias/rubies/examples/style.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/tags.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/text.rb +0 -39
- data/vendor/assets/src/medias/rubies/examples/time.rb +0 -18
- data/vendor/assets/src/medias/rubies/examples/to_px.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/touch.rb +0 -56
- data/vendor/assets/src/medias/rubies/examples/vector.rb +0 -39
- data/vendor/assets/src/medias/rubies/examples/video.rb +0 -65
- data/vendor/assets/src/medias/rubies/examples/wait.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/web.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/width.rb +0 -6
- data/vendor/assets/src/medias/rubies/test.rb +0 -1
- data/vendor/assets/src/medias/rubies/text_read.rb +0 -1
- data/vendor/assets/src/medias/rubies/unstable/!run.rb +0 -16
- data/vendor/assets/src/medias/rubies/unstable/_2_solve.rb +0 -72
- data/vendor/assets/src/medias/rubies/unstable/_attach.rb +0 -12
- data/vendor/assets/src/medias/rubies/unstable/_audio.rb +0 -231
- data/vendor/assets/src/medias/rubies/unstable/_dataset.rb +0 -257
- data/vendor/assets/src/medias/rubies/unstable/_matrix.rb +0 -58
- data/vendor/assets/src/medias/rubies/unstable/_os.rb +0 -29
- data/vendor/assets/src/medias/rubies/unstable/_table2.rb +0 -108
- data/vendor/assets/src/medias/rubies/unstable/_vie.rb +0 -211
- data/vendor/assets/src/medias/rubies/users/code.rb +0 -6
- /data/lib/{atome/renderers → platform_specific}/opal/opal.rb +0 -0
- /data/lib/{atome/renderers → platform_specific}/opal/opal_parser.rb +0 -0
- /data/{vendor/assets/src/utilities/mode.rb → lib/renderers/html/communication.rb} +0 -0
- /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
|
-
#
|
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
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
|
-
|
113
|
-
|
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
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
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
|
-
|
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
|
167
|
-
|
168
|
-
|
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
|
-
|
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
|
-
|
6
|
-
if params.key?(:
|
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
|
-
|
11
|
-
|
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
|
-
|
18
|
+
Genesis.build_sanitizer(params[:sanitizer], &bloc)
|
17
19
|
elsif params.key?(:pre)
|
18
|
-
|
20
|
+
Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
|
19
21
|
elsif params.key?(:post)
|
20
|
-
|
21
|
-
elsif params.key?(:
|
22
|
-
|
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
|
27
|
-
grab(:
|
43
|
+
def delete (atomes)
|
44
|
+
grab(:view).delete(atomes)
|
28
45
|
end
|
29
46
|
|
30
|
-
def identity_generator(
|
31
|
-
"#{
|
47
|
+
def identity_generator(type_needed = :element)
|
48
|
+
"#{type_needed}_#{Universe.counter}"
|
32
49
|
end
|
33
50
|
|
34
|
-
def grab(
|
51
|
+
def grab(id_to_get)
|
52
|
+
return if id_to_get == false
|
35
53
|
|
36
|
-
|
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]
|
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
|
77
|
-
|
78
|
-
|
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
|
-
|
82
|
-
|
83
|
-
|
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
|
@@ -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
|
-
|
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
|
-
|
27
|
-
|
28
|
-
# TODO :
|
29
|
-
params
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|