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
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
def extract_rgb_alpha(color_string)
|
4
|
+
match_data = color_string.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)/)
|
5
|
+
red = match_data[1].to_i
|
6
|
+
green = match_data[2].to_i
|
7
|
+
blue = match_data[3].to_i
|
8
|
+
alpha = match_data[4] ? match_data[4].to_f : nil
|
9
|
+
{ red: red, green: green, blue: blue, alpha: alpha }
|
10
|
+
end
|
11
|
+
|
12
|
+
new({ particle: :red }) do
|
13
|
+
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
14
|
+
self
|
15
|
+
end
|
16
|
+
new({ particle: :green }) do
|
17
|
+
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
18
|
+
self
|
19
|
+
end
|
20
|
+
new({ particle: :blue }) do
|
21
|
+
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
22
|
+
self
|
23
|
+
end
|
24
|
+
new({ particle: :alpha }) do
|
25
|
+
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
26
|
+
self
|
27
|
+
end
|
28
|
+
new({ particle: :diffusion }) do
|
29
|
+
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
30
|
+
self
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
new ({ particle: :password })
|
4
|
+
new ({ sanitizer: :password }) do |params|
|
5
|
+
|
6
|
+
params = { read: params, write: params } unless params.instance_of? Hash
|
7
|
+
|
8
|
+
# encoding below
|
9
|
+
params[:read]&.each do |k, v|
|
10
|
+
params[:read][k] = Black_matter.encode(v)
|
11
|
+
end
|
12
|
+
params[:write]&.each do |k, v|
|
13
|
+
params[:write][k] = Black_matter.encode(v)
|
14
|
+
end
|
15
|
+
|
16
|
+
params[:read] = Black_matter.password unless params[:read]
|
17
|
+
params[:write] = Black_matter.password unless params[:write]
|
18
|
+
|
19
|
+
if type == :human
|
20
|
+
# we store the hashed password into the Universe for easier access
|
21
|
+
Black_matter.set_password(params)
|
22
|
+
end
|
23
|
+
params
|
24
|
+
end
|
25
|
+
|
26
|
+
new({ read: :password }) do |params|
|
27
|
+
params = Black_matter.password if params.nil?
|
28
|
+
params[:read][:atome]=Black_matter.password[:read][:atome] unless @authorisations[:write][:atome]
|
29
|
+
params[:write][:atome]=Black_matter.password[:write][:atome] unless @authorisations[:write][:atome]
|
30
|
+
params
|
31
|
+
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
new({ particle: :left, type: :integer })
|
4
|
-
instance_exec(&user_proc) if user_proc.is_a?(Proc)
|
5
|
-
end
|
3
|
+
new({ particle: :left, type: :integer })
|
6
4
|
new({ particle: :right, type: :integer })
|
7
5
|
new({ particle: :top, type: :integer })
|
8
6
|
new({ particle: :bottom, type: :integer })
|
9
7
|
new({ particle: :rotate, type: :integer })
|
10
8
|
new({ particle: :direction, type: :string })
|
11
9
|
new({ particle: :center, type: :string})
|
12
|
-
new
|
13
|
-
|
10
|
+
new({particle: :depth, type: :integer})
|
11
|
+
new({ particle: :position })
|
@@ -3,89 +3,76 @@
|
|
3
3
|
new({ particle: :renderers })
|
4
4
|
new({ particle: :code })
|
5
5
|
new({ particle: :run }) do |params|
|
6
|
-
code_found = @
|
6
|
+
code_found = @code
|
7
7
|
instance_exec(params, &code_found) if code_found.is_a?(Proc)
|
8
8
|
end
|
9
|
-
new({ particle: :broadcast })
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
# new({ particle: :broadcast })
|
10
|
+
|
11
|
+
def delete_recursive(atome_id)
|
12
|
+
return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system])
|
13
|
+
|
14
|
+
parent_id_found = grab(atome_id).attach
|
15
|
+
parent_found = grab(parent_id_found)
|
16
|
+
new_array = parent_found.attached.dup
|
17
|
+
new_array.delete(atome_id)
|
18
|
+
parent_found.instance_variable_set('@attached', new_array)
|
19
|
+
grab(atome_id).attached.each do |atome_id_found|
|
20
|
+
delete_recursive(atome_id_found)
|
21
|
+
end
|
22
|
+
grab(atome_id).render(:delete, { :recursive => true })
|
23
|
+
grab(atome_id).touch(:remove)
|
24
|
+
Universe.delete(atome_id)
|
25
|
+
end
|
26
|
+
|
27
|
+
new({ particle: :delete, render: false }) do |params|
|
13
28
|
if params == true
|
14
29
|
# We use the tag persistent to exclude color of system object and other default colors
|
15
|
-
unless tag && tag[:persistent]
|
30
|
+
unless @tag && (@tag[:persistent] || @tag[:system])
|
16
31
|
# now we detach the atome from it's parent
|
17
32
|
# now we init rendering
|
18
|
-
|
33
|
+
render(:delete, params)
|
19
34
|
# the machine delete the current atome from the universe
|
20
|
-
id_found = @
|
21
|
-
|
22
|
-
|
23
|
-
parents_found.each do |parent_id_found|
|
24
|
-
parent_found = grab(parent_id_found)
|
25
|
-
next unless parent_found
|
26
|
-
|
27
|
-
previous_parent_type_child = parent_found.atome[type]
|
28
|
-
previous_parent_attached_child = parent_found.atome[:attached]
|
29
|
-
# FIXME : find why we can't use delete on the array nut must use an iterator
|
30
|
-
new_type_container = []
|
31
|
-
previous_parent_type_child.each do |atome_found|
|
32
|
-
new_type_container << atome_found unless atome_found == id_found
|
33
|
-
end
|
34
|
-
parent_found.atome[type] = new_type_container
|
35
|
-
# FIXME : find why we can't use delete on the array nut must use an iterator
|
36
|
-
new_attached_container = []
|
37
|
-
previous_parent_attached_child.each do |atome_found|
|
38
|
-
new_attached_container << atome_found unless atome_found == id_found
|
39
|
-
end
|
40
|
-
parent_found.atome[:attached] = new_attached_container
|
41
|
-
|
42
|
-
end
|
43
|
-
|
35
|
+
id_found = @id.to_sym
|
36
|
+
parent_found = grab(@attach)
|
37
|
+
parent_found.attached.delete(id_found)
|
44
38
|
end
|
39
|
+
elsif params.instance_of? Hash
|
45
40
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
41
|
+
if params[:recursive]
|
42
|
+
unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
|
43
|
+
attached.each do |atttached_atomes|
|
44
|
+
delete_recursive(atttached_atomes)
|
45
|
+
end
|
46
|
+
touch(:remove)
|
47
|
+
render(:delete, params)
|
48
|
+
Universe.delete(@id)
|
49
|
+
end
|
50
|
+
else
|
51
|
+
# the machine try to find the sub particle id and remove it eg a.delete(monitor: :my_monitor) remove the monitor
|
52
|
+
# with id my_monitor
|
53
|
+
params.each do |param, value|
|
54
|
+
atome[param][value] = nil
|
58
55
|
end
|
59
56
|
end
|
60
|
-
|
61
|
-
elsif
|
62
|
-
#
|
63
|
-
#
|
64
|
-
params.each do |param, value|
|
65
|
-
atome[param][value] = nil
|
66
|
-
end
|
57
|
+
|
58
|
+
elsif Universe.atome_list.include?(params)
|
59
|
+
# we check if the params passed is an atome to treat it in a different way
|
60
|
+
puts "write code here : #{apply} , #{attached}"
|
67
61
|
else
|
68
|
-
send(params, 0)
|
62
|
+
send(params, 0) unless params == :id
|
69
63
|
end
|
70
64
|
end
|
71
|
-
|
72
65
|
new({ particle: :clear })
|
73
66
|
new({ post: :clear }) do
|
74
|
-
|
75
67
|
attached_found = []
|
76
|
-
|
68
|
+
attached.each do |attached_id_found|
|
77
69
|
attached_found << attached_id_found
|
78
70
|
end
|
79
71
|
attached_found.each do |child_id_found|
|
80
|
-
# puts "===>> should be deleted : #{child_id_found}"
|
81
72
|
child_found = grab(child_id_found)
|
82
|
-
|
83
|
-
child_found
|
84
|
-
|
85
|
-
# Universe.delete(child_id_found)
|
73
|
+
# we exclude system objects
|
74
|
+
child_found&.delete(true) unless child_found.tag && child_found.tag[:system]
|
86
75
|
end
|
87
|
-
# attached([])
|
88
|
-
# puts "params are => #{id}"
|
89
76
|
end
|
90
77
|
new({ particle: :path })
|
91
78
|
new({ particle: :schedule }) do |date, proc|
|
@@ -102,13 +89,141 @@ new({ particle: :read }) do |file, proc|
|
|
102
89
|
end
|
103
90
|
end
|
104
91
|
new({ particle: :cursor })
|
105
|
-
|
92
|
+
|
93
|
+
new({ particle: :preset }) do |params|
|
94
|
+
|
95
|
+
if params.instance_of? Hash
|
96
|
+
Essentials.new_default_params(params)
|
97
|
+
params_to_send = params
|
98
|
+
else
|
99
|
+
params_to_send = Essentials.default_params[params].dup
|
100
|
+
# we remove preset to avoid infinite loop
|
101
|
+
params_to_send.delete(:preset)
|
102
|
+
params_to_send.delete(:type)
|
103
|
+
params_to_send.each do |particle_found, value|
|
104
|
+
send(particle_found, value)
|
105
|
+
end
|
106
|
+
params_to_send = { params => params_to_send }
|
107
|
+
end
|
108
|
+
params_to_send
|
109
|
+
end
|
106
110
|
new({ particle: :relations, type: :hash })
|
107
111
|
new({ particle: :tag, render: false, type: :hash })
|
108
|
-
new({ particle: :
|
109
|
-
new({
|
110
|
-
|
111
|
-
|
112
|
+
new({ particle: :web })
|
113
|
+
new({ particle: :unit, type: :hash })
|
114
|
+
new({ initialize: :unit, value: {} })
|
115
|
+
new({ particle: :login }) do |params|
|
116
|
+
set_current_user(id) if params
|
117
|
+
end
|
118
|
+
new({ particle: :hypertext })
|
119
|
+
new({ particle: :hyperedit })
|
120
|
+
new({ particle: :terminal })
|
121
|
+
new({ particle: :read })
|
122
|
+
new({ particle: :browse })
|
123
|
+
new({ particle: :copies })
|
124
|
+
new({ particle: :temporary })
|
125
|
+
new({ particle: :atomes })
|
112
126
|
|
127
|
+
new({ particle: :match }) do |params, _bloc|
|
128
|
+
params
|
129
|
+
end
|
130
|
+
|
131
|
+
new({ sanitizer: :match }) do |params, _bloc|
|
132
|
+
params[:condition] = { min: { width: 0 } } unless params[:condition]
|
133
|
+
params
|
134
|
+
end
|
135
|
+
|
136
|
+
new({ particle: :invert })
|
137
|
+
new({ particle: :option })
|
138
|
+
|
139
|
+
new({ particle: :duplicate, store: false }) do |params|
|
140
|
+
copy_number = if @duplicate
|
141
|
+
@duplicate.length
|
142
|
+
else
|
143
|
+
0
|
144
|
+
end
|
145
|
+
new_atome_id = "#{@id}_copy_#{copy_number}"
|
146
|
+
new_atome = Atome.new({ type: @type, renderers: @renderers, id: new_atome_id })
|
147
|
+
|
148
|
+
attached_atomes = []
|
149
|
+
attached_found = attached.dup
|
150
|
+
particles_found = instance_variables.dup
|
151
|
+
|
152
|
+
keys_to_delete = [:@history, :@callback, :@duplicate, :@copy, :@paste, :@touch_code, :@html, :@attached, :@id]
|
153
|
+
keys_to_delete.each { |key| particles_found.delete(key) }
|
154
|
+
params[:id] = new_atome_id
|
155
|
+
|
156
|
+
particles_found.each do |particle_found|
|
157
|
+
particle_name = particle_found.to_s.sub('@', '')
|
158
|
+
|
159
|
+
particle_content = self.send(particle_name)
|
160
|
+
# FIXME: find a better to attach object when false is found
|
161
|
+
particle_content = :view if particle_content == false
|
162
|
+
new_atome.set(particle_name => particle_content)
|
163
|
+
# new_atome.instance_variable_set('@touch_code',touch_code)
|
164
|
+
end
|
165
|
+
|
166
|
+
attached_found.each do |child_id_found|
|
167
|
+
child_found = grab(child_id_found)
|
168
|
+
if child_found
|
169
|
+
new_child = child_found.duplicate({})
|
170
|
+
attached_atomes << new_child.id
|
171
|
+
end
|
172
|
+
end
|
173
|
+
params[:attached] = attached_atomes
|
174
|
+
# FIXME: below dunno why we have to add this manually
|
175
|
+
new_atome.height(@height)
|
176
|
+
new_atome.width(@width)
|
177
|
+
if params.instance_of? Hash
|
178
|
+
params.each do |k, v|
|
179
|
+
new_atome.send(k, v)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
@duplicate ||= {}
|
184
|
+
@duplicate[new_atome_id] = new_atome
|
185
|
+
|
186
|
+
new_atome
|
187
|
+
end
|
188
|
+
|
189
|
+
new({ after: :duplicate }) do |params|
|
190
|
+
@duplicate[@duplicate.keys[@duplicate.keys.length - 1]]
|
191
|
+
end
|
192
|
+
|
193
|
+
new({ particle: :copy }) do |items_id|
|
194
|
+
unless items_id.instance_of? Array
|
195
|
+
items_id = [items_id]
|
196
|
+
end
|
197
|
+
grab(:copy).collect << items_id
|
198
|
+
end
|
199
|
+
|
200
|
+
|
201
|
+
new({ particle: :paste }) do |params|
|
202
|
+
|
203
|
+
all_copies = grab(:copy).collect
|
204
|
+
if params == true
|
205
|
+
copies_found = all_copies.last
|
206
|
+
elsif params.instance_of? Integer
|
207
|
+
copies_found = all_copies[params.to_i]
|
208
|
+
elsif params.instance_of? Array
|
209
|
+
copies_found = [all_copies[params[0]][params[1]]]
|
210
|
+
end
|
211
|
+
new_atomes = []
|
212
|
+
applies_found = []
|
213
|
+
copies_found.each do |copy_found|
|
214
|
+
new_atome = grab(copy_found).duplicate({attach: @id })
|
215
|
+
new_atomes << new_atome.id
|
216
|
+
# FIXME: below start to patch because apply is not apply , so we store it and apply it again
|
217
|
+
applies_found << new_atome.apply
|
218
|
+
end
|
219
|
+
|
220
|
+
# FIXME: end here the patch because apply is not apply , so we store it and apply it again
|
221
|
+
new_atomes.each_with_index do |id_found, index|
|
222
|
+
grab(id_found).apply(applies_found[index])
|
223
|
+
end
|
224
|
+
new_atomes
|
113
225
|
end
|
114
226
|
|
227
|
+
new({ read: :paste }) do |p|
|
228
|
+
@copy
|
229
|
+
end
|
@@ -3,71 +3,168 @@
|
|
3
3
|
# allow to access Atome class using only a uniq atome
|
4
4
|
class Genesis
|
5
5
|
class << self
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
def create_particle(element, store, render)
|
8
|
+
Atome.define_method "set_#{element}" do |params, &user_proc|
|
9
|
+
particle_creation(element, params, store, render, &user_proc)
|
10
|
+
end
|
8
11
|
end
|
9
|
-
end
|
10
|
-
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
render = options[:render]
|
20
|
-
render = true if options[:render].nil?
|
21
|
-
|
22
|
-
# we add the new method to the particle's collection of methods
|
23
|
-
Universe.add_to_particle_list(particle_name, type)
|
24
|
-
# the line below create an empty particle method for each renderer, eg: browser_left, headless_width, ...
|
25
|
-
# the line below create the corresponding particle method for Batch class
|
26
|
-
particle_method_for_batch(particle_name)
|
27
|
-
auto_render_generator(particle_name) if render
|
28
|
-
new_particle(particle_name, store, render, &particle_proc)
|
29
|
-
# the line below create all alternatives methods such as create 'method='
|
30
|
-
additional_particle_methods(particle_name, store, render, &particle_proc)
|
31
|
-
end
|
13
|
+
def build_particle(particle_name, options = {}, &particle_proc)
|
14
|
+
type = options[:type]
|
15
|
+
type = :string if options[:type].nil?
|
16
|
+
store = options[:store]
|
17
|
+
store = true if options[:store].nil?
|
18
|
+
render = options[:render]
|
19
|
+
render = true if options[:render].nil?
|
32
20
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
unless Essentials.default_params[atome_name]
|
43
|
-
# if it doesn't exist
|
44
|
-
# we create default params for the new created atome, adding the hash to : module essential, @default_params
|
45
|
-
Essentials.new_default_params(atome_name => { type: atome_name, attach: [:view] })
|
21
|
+
# we add the new method to the particle's collection of methods
|
22
|
+
Universe.add_to_particle_list(particle_name, type)
|
23
|
+
# the line below create an empty particle method for each renderer, eg: browser_left, headless_width, ...
|
24
|
+
# the line below create the corresponding particle method for Batch class
|
25
|
+
# particle_method_for_batch(particle_name)
|
26
|
+
auto_render_generator(particle_name) if render
|
27
|
+
new_particle(particle_name, store, render, &particle_proc)
|
28
|
+
# the line below create all alternatives methods such as create 'method='
|
29
|
+
additional_particle_methods(particle_name, store, render, &particle_proc)
|
46
30
|
end
|
47
31
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
32
|
+
def build_atome(atome_name, &atome_proc)
|
33
|
+
# we add the new method to the atome's collection of methods
|
34
|
+
Universe.add_to_atome_list(atome_name)
|
35
|
+
# the method below generate Atome method creation at Object level,
|
36
|
+
# so a syntax like : 'text(:hello)' is possible instead of the mandatory : grab(:view).text(:hello)
|
37
|
+
atome_method_for_object(atome_name)
|
38
|
+
# the line below create the corresponding atome method for Batch class
|
39
|
+
# atome_method_for_batch(atome_name)
|
40
|
+
unless Essentials.default_params[atome_name]
|
41
|
+
# we create default params for the new created atome, adding the hash to : module essential, @default_params
|
42
|
+
# FIXME : the hash : attach: [:view] means that newly atome will systematically be attached to the wview instaed of the parent:
|
43
|
+
# ex : b.www will attach to view not b!
|
44
|
+
Essentials.new_default_params(atome_name => { type: atome_name })
|
45
|
+
end
|
52
46
|
|
53
|
-
|
47
|
+
# the line below create an empty atome method for each renderer, eg: browser_shape, headless_color, ...
|
48
|
+
auto_render_generator(atome_name)
|
49
|
+
new_atome(atome_name, &atome_proc)
|
54
50
|
|
55
|
-
def auto_render_generator(element)
|
56
|
-
Universe.renderer_list.each do |render_engine|
|
57
|
-
build_render("#{render_engine}_#{element}")
|
58
51
|
end
|
59
|
-
end
|
60
52
|
|
61
|
-
|
62
|
-
|
63
|
-
|
53
|
+
def auto_render_generator(element)
|
54
|
+
Universe.renderer_list.each do |render_engine|
|
55
|
+
build_render("#{render_engine}_#{element}",)
|
56
|
+
end
|
57
|
+
end
|
64
58
|
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
def build_render(renderer_name, &method_proc)
|
60
|
+
Atome.define_method renderer_name do |params = nil, &user_proc|
|
61
|
+
instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def build_sanitizer(method_name, &method_proc)
|
66
|
+
Universe.add_sanitizer_method(method_name.to_sym, &method_proc)
|
67
|
+
end
|
68
|
+
|
69
|
+
def build_option(method_name, method_proc)
|
70
|
+
Universe.add_optional_method(method_name.to_sym, method_proc)
|
71
|
+
end
|
72
|
+
|
73
|
+
def new_particle(element, store, render, &_method_proc)
|
74
|
+
Atome.define_method element do |params = nil, &user_proc|
|
75
|
+
@history[element] ||= []
|
76
|
+
if (params || params == false) && write_auth(element)
|
77
|
+
params = particle_sanitizer(element, params, &user_proc)
|
78
|
+
# the line below execute the main code when creating a new particle
|
79
|
+
# ex : new({ particle: :my_particle } do....
|
80
|
+
# instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
|
81
|
+
Genesis.create_particle(element, store, render)
|
82
|
+
# TODO: try to optimise and find a better way wo we can remove the condition below
|
83
|
+
if @type == :group && !%i[type id collect layout].include?(element)
|
84
|
+
collect.each do |collected_found|
|
85
|
+
grab(collected_found).send(element, params, &user_proc)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
computed_params= send("set_#{element}", params, &user_proc) # sent to : create_particle / Atome.define_method "set_#{element}"
|
90
|
+
|
91
|
+
# we historicize all write action below
|
92
|
+
# we add the changes to the stack that must be synchronised
|
93
|
+
Universe.historicize(@id, :write, element, params)
|
94
|
+
computed_params
|
95
|
+
elsif params || params == false
|
96
|
+
"send a valid password to write #{element} value"
|
97
|
+
elsif read_auth(element)
|
98
|
+
# particle getter below
|
99
|
+
value_found = instance_variable_get("@#{element}")
|
100
|
+
# uncomment below to historicize all read action
|
101
|
+
# Universe.historicize(@id, :read, element, value_found)
|
102
|
+
# we add the optional read plugin
|
103
|
+
value_found = particle_read(element, value_found, &user_proc)
|
104
|
+
value_found
|
105
|
+
# TODO : create a fast method to get particle: eg:
|
106
|
+
# Atome.define_method "set_#{element}" ... => send("set_#{element}"
|
107
|
+
else
|
108
|
+
"send a valid password to read #{element} value"
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def additional_particle_methods(element, store, rendering, &method_proc)
|
115
|
+
# it allow the creation of method like top=, rotate=, ...
|
116
|
+
Atome.define_method "#{element}=" do |params = nil, &user_proc|
|
117
|
+
instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
|
118
|
+
params = particle_sanitizer(element, params)
|
119
|
+
particle_creation(element, params, store, rendering, &user_proc)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def new_atome(element, &method_proc)
|
124
|
+
|
125
|
+
# the method define below is the slowest but params are analysed and sanitized
|
126
|
+
Atome.define_method element do |params = nil, &user_proc|
|
127
|
+
instance_exec(params, user_proc, &method_proc) if method_proc.is_a?(Proc)
|
128
|
+
if params
|
129
|
+
params = atome_sanitizer(element, params, &user_proc)
|
130
|
+
atome_processor(element, params, &user_proc)
|
131
|
+
else
|
132
|
+
# when no params passed whe assume teh user want a getter,
|
133
|
+
# as getter should give us all atome of a given within the atome
|
134
|
+
# ex : puts a.shape => return all atome with the type 'shape' in this atome
|
135
|
+
collected_atomes = []
|
136
|
+
# attached.each do |attached_atome|
|
137
|
+
# collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
|
138
|
+
# end
|
139
|
+
# TODO : add category for atome( material/physical vs modifier : color, shadow, .. vs shape, image ..)
|
140
|
+
# then add condition same things fo code in presets/atome atome_common
|
141
|
+
if %i[color shadow paint].include?(element)
|
142
|
+
# we do the same for apply to be able to retrieve 'color' and other atome that apply instead of being attached
|
143
|
+
apply.each do |attached_atome|
|
144
|
+
collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
|
145
|
+
end
|
146
|
+
else
|
147
|
+
# collected_atomes = attached
|
148
|
+
attached.each do |attached_atome|
|
149
|
+
collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
|
150
|
+
end
|
151
|
+
end
|
152
|
+
collected_atomes
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# the method define below is the fastest params are passed directly
|
157
|
+
Atome.define_method "set_#{element}" do |params, &user_proc|
|
158
|
+
# we generate the corresponding module here:
|
159
|
+
# Object.const_set(element, Module.new)
|
160
|
+
# 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
|
161
|
+
# to the shape particles list : @!atome[:shape] << params[:id]
|
162
|
+
Atome.new(params, &user_proc)
|
163
|
+
# Now we return the newly created atome instead of the current atome that is the parent cf: b=box; c=b.circle
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
68
167
|
|
69
|
-
def build_option(method_name, &method_proc)
|
70
|
-
#puts "2 => #{method_name}"
|
71
|
-
Universe.add_optional_method(method_name.to_sym, &method_proc)
|
72
168
|
end
|
169
|
+
|
73
170
|
end
|