atome 0.5.7.0.3 → 0.3191
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of atome might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/README.md +5 -77
- data/Rakefile +7 -502
- data/app_builder_helpers/Rakefile +235 -0
- data/documentation/framework/enhance_atome.md +1 -1
- data/documentation/installation/atome_server.md +1 -66
- data/documentation/tutorials/tutorials.md +0 -7
- data/exe/atome +157 -819
- data/lib/atome/atome_native_extensions.rb +3 -0
- data/lib/atome/extensions/geolocation.rb +1 -1
- data/lib/atome/extensions/ping.rb +11 -10
- data/lib/atome/extensions/sha.rb +6 -8
- data/lib/atome/kernel/atome_genesis.rb +93 -0
- data/lib/atome/kernel/generators/shapes.rb +7 -0
- data/lib/atome/kernel/properties/geometry.rb +120 -0
- data/lib/atome/kernel/universe.rb +24 -295
- data/lib/atome/renderers/headless/headless.rb +0 -0
- data/lib/atome/renderers/headless/properties/generator.rb +0 -0
- data/lib/atome/renderers/opal/atome_opal_extensions.rb +4 -0
- data/lib/{platform_specific → atome/renderers}/opal/extensions/geolocation.rb +1 -1
- data/lib/atome/renderers/opal/extensions/ping.rb +13 -0
- data/lib/atome/renderers/opal/extensions/sha.rb +11 -0
- data/lib/atome/renderers/opal/opal_browser.rb +8 -0
- data/lib/{platform_specific → atome/renderers}/opal/opal_parser.rb +0 -1
- data/lib/atome/renderers/opal/properties/generator.rb +6 -0
- data/lib/atome/renderers/server/server.rb +0 -0
- data/lib/atome/version.rb +1 -2
- data/lib/atome.rb +16 -35
- data/sig/atome.rbs +0 -75
- data/vendor/assets/Guardfile +4 -0
- data/vendor/assets/Rakefile +2 -12
- data/vendor/assets/application/index.rb +2 -7
- data/vendor/assets/build/css/style.css +53 -0
- data/vendor/assets/build/index.html +24 -0
- data/vendor/assets/build/js/application.js +0 -0
- data/vendor/assets/build/js/third_parties/interact.min.js +4 -0
- data/vendor/assets/build/js/third_parties/popmotion.min.js +1 -0
- data/vendor/assets/examples/misc.rb +219 -0
- data/vendor/assets/examples/ping.rb +3 -0
- data/vendor/assets/examples/storage.rb +9 -0
- data/vendor/assets/examples/view_example.rb +21 -0
- data/vendor/assets/server/atome_server.rb +96 -33
- data/vendor/assets/server/config.ru +3 -8
- metadata +69 -512
- data/CHANGELOG.md +0 -21
- data/atome.gemspec +0 -100
- data/documentation/basic.md +0 -241
- data/documentation/deep learning/architecture.txt +0 -3763
- data/documentation/deep learning/atome.png +0 -0
- data/documentation/deep learning/basic_infos.txt +0 -289
- data/documentation/deep learning/example_of_users_code.rb +0 -1810
- data/documentation/deep learning/misc.txt +0 -24
- data/documentation/deep learning/ruby_js_example.rb +0 -272
- data/documentation/deep learning/wasm_script_help.text +0 -14
- data/documentation/installation/buiding_atome.md +0 -307
- data/lib/atome/atome.rb +0 -131
- data/lib/atome/extensions/atome.rb +0 -705
- data/lib/atome/extensions/mathematics.rb +0 -20
- data/lib/atome/genesis/atomes.rb +0 -109
- data/lib/atome/genesis/genesis.rb +0 -272
- data/lib/atome/genesis/particles/atome.rb +0 -4
- data/lib/atome/genesis/particles/communication.rb +0 -43
- data/lib/atome/genesis/particles/effect.rb +0 -14
- data/lib/atome/genesis/particles/event.rb +0 -344
- data/lib/atome/genesis/particles/geometry.rb +0 -31
- data/lib/atome/genesis/particles/hierarchy.rb +0 -105
- data/lib/atome/genesis/particles/identity.rb +0 -82
- data/lib/atome/genesis/particles/material.rb +0 -119
- data/lib/atome/genesis/particles/property.rb +0 -147
- data/lib/atome/genesis/particles/security.rb +0 -77
- data/lib/atome/genesis/particles/spatial.rb +0 -98
- data/lib/atome/genesis/particles/time.rb +0 -4
- data/lib/atome/genesis/particles/utility.rb +0 -261
- data/lib/atome/genesis/presets.rb +0 -10
- data/lib/atome/genesis/sparkle.rb +0 -217
- data/lib/atome/kernel/black_matter.rb +0 -22
- data/lib/atome/presets/atome.rb +0 -79
- data/lib/atome/utilities/color_helper/color/cmyk.rb +0 -263
- data/lib/atome/utilities/color_helper/color/css.rb +0 -7
- data/lib/atome/utilities/color_helper/color/grayscale.rb +0 -197
- data/lib/atome/utilities/color_helper/color/hsl.rb +0 -240
- data/lib/atome/utilities/color_helper/color/palette/adobecolor.rb +0 -260
- data/lib/atome/utilities/color_helper/color/palette/gimp.rb +0 -104
- data/lib/atome/utilities/color_helper/color/palette/monocontrast.rb +0 -164
- data/lib/atome/utilities/color_helper/color/palette.rb +0 -4
- data/lib/atome/utilities/color_helper/color/rgb/colors.rb +0 -167
- data/lib/atome/utilities/color_helper/color/rgb/contrast.rb +0 -57
- data/lib/atome/utilities/color_helper/color/rgb/metallic.rb +0 -28
- data/lib/atome/utilities/color_helper/color/rgb.rb +0 -715
- data/lib/atome/utilities/color_helper/color/yiq.rb +0 -62
- data/lib/atome/utilities/color_helper/color.rb +0 -415
- data/lib/atome/utilities/essentials.rb +0 -70
- data/lib/atome/utilities/sanitizer.rb +0 -13
- data/lib/atome/utilities/security.rb +0 -71
- data/lib/atome/utilities/utilities.rb +0 -656
- data/lib/atome_relative.rb +0 -39
- data/lib/molecules/_deprecated_examples/site.rb +0 -34
- data/lib/molecules/init.rb +0 -31
- data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
- data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
- data/lib/molecules/intuition/utillities.rb +0 -408
- data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -11
- data/lib/platform_specific/opal/extensions/color.rb +0 -30
- data/lib/platform_specific/opal/extensions/js.rb +0 -20
- data/lib/platform_specific/opal/extensions/object.rb +0 -6
- data/lib/platform_specific/opal/extensions/ping.rb +0 -31
- data/lib/platform_specific/opal/extensions/sha.rb +0 -25
- data/lib/platform_specific/opal/opal.rb +0 -5
- data/lib/platform_specific/wasm/atome_wasm_extensions.rb +0 -11
- data/lib/renderers/headless/headless.rb +0 -18
- data/lib/renderers/headless/index.rb +0 -6
- data/lib/renderers/headless/index_relative.rb +0 -6
- data/lib/renderers/headless/utility.rb +0 -6
- data/lib/renderers/html/atome.rb +0 -2
- data/lib/renderers/html/atome_html.rb +0 -22
- data/lib/renderers/html/communication.rb +0 -3
- data/lib/renderers/html/effect.rb +0 -51
- data/lib/renderers/html/event.rb +0 -59
- data/lib/renderers/html/geometry.rb +0 -49
- data/lib/renderers/html/hierarchy.rb +0 -248
- data/lib/renderers/html/html.rb +0 -1688
- data/lib/renderers/html/identity.rb +0 -104
- data/lib/renderers/html/index.rb +0 -19
- data/lib/renderers/html/index_relative.rb +0 -20
- data/lib/renderers/html/material.rb +0 -88
- data/lib/renderers/html/property.rb +0 -52
- data/lib/renderers/html/security.rb +0 -1
- data/lib/renderers/html/spatial.rb +0 -75
- data/lib/renderers/html/time.rb +0 -1
- data/lib/renderers/html/utility.rb +0 -170
- data/lib/renderers/renderer.rb +0 -16
- data/lib/renderers/server/index.rb +0 -4
- data/lib/renderers/server/index_relative.rb +0 -4
- data/lib/renderers/server/utility.rb +0 -4
- data/sig/atome_js.rbs +0 -1
- data/sig/batch.rbs +0 -7
- data/sig/browser_helper.rbs +0 -14
- data/sig/essentials.rbs +0 -11
- data/sig/genesis.rbs +0 -3
- data/sig/global_variables.rbs +0 -1
- data/sig/matrix.rbs +0 -5
- data/sig/object.rbs +0 -7
- data/sig/universe.rbs +0 -3
- data/src/utilities/host_mode.rb +0 -5
- data/vendor/assets/application/examples/affect.rb +0 -8
- data/vendor/assets/application/examples/aid.rb +0 -10
- data/vendor/assets/application/examples/allow_copy.rb +0 -13
- data/vendor/assets/application/examples/allow_system_right_click.rb +0 -16
- data/vendor/assets/application/examples/alternate.rb +0 -36
- data/vendor/assets/application/examples/animation.rb +0 -91
- data/vendor/assets/application/examples/apply.rb +0 -8
- data/vendor/assets/application/examples/atome.rb +0 -5
- data/vendor/assets/application/examples/atome_particle_validation.rb +0 -7
- data/vendor/assets/application/examples/atome_sparkle_use.rb +0 -6
- data/vendor/assets/application/examples/atomizer.rb +0 -86
- data/vendor/assets/application/examples/attach.rb +0 -34
- data/vendor/assets/application/examples/attached.rb +0 -45
- data/vendor/assets/application/examples/b64_to_image.rb +0 -9
- data/vendor/assets/application/examples/basic_understanding.rb +0 -54
- data/vendor/assets/application/examples/behavior.rb +0 -32
- data/vendor/assets/application/examples/blur.rb +0 -26
- data/vendor/assets/application/examples/border.rb +0 -75
- data/vendor/assets/application/examples/browse.rb +0 -17
- data/vendor/assets/application/examples/categories.rb +0 -5
- data/vendor/assets/application/examples/category.rb +0 -16
- data/vendor/assets/application/examples/center.rb +0 -7
- data/vendor/assets/application/examples/clear.rb +0 -96
- data/vendor/assets/application/examples/clones&monitoring.rb +0 -105
- data/vendor/assets/application/examples/code.rb +0 -13
- data/vendor/assets/application/examples/color.rb +0 -54
- data/vendor/assets/application/examples/compute.rb +0 -16
- data/vendor/assets/application/examples/console.rb +0 -4
- data/vendor/assets/application/examples/convert.rb +0 -163
- data/vendor/assets/application/examples/copy.rb +0 -25
- data/vendor/assets/application/examples/copybck.rb +0 -68
- data/vendor/assets/application/examples/css.rb +0 -6
- data/vendor/assets/application/examples/database_handling.rb +0 -39
- data/vendor/assets/application/examples/debug.rb +0 -78
- data/vendor/assets/application/examples/delete.rb +0 -105
- data/vendor/assets/application/examples/dig.rb +0 -13
- data/vendor/assets/application/examples/display.rb +0 -279
- data/vendor/assets/application/examples/display_bck.rb +0 -164
- data/vendor/assets/application/examples/drag.rb +0 -54
- data/vendor/assets/application/examples/drop.rb +0 -35
- data/vendor/assets/application/examples/duplicate.rb +0 -70
- data/vendor/assets/application/examples/edit.rb +0 -24
- data/vendor/assets/application/examples/encode.rb +0 -6
- data/vendor/assets/application/examples/encrypt.rb +0 -6
- data/vendor/assets/application/examples/example.rb +0 -27
- data/vendor/assets/application/examples/executor.rb +0 -36
- data/vendor/assets/application/examples/file.rb +0 -16
- data/vendor/assets/application/examples/fill.rb +0 -23
- data/vendor/assets/application/examples/find.rb +0 -158
- data/vendor/assets/application/examples/fit.rb +0 -26
- data/vendor/assets/application/examples/fonts.rb +0 -15
- data/vendor/assets/application/examples/generator_and_build.rb +0 -15
- data/vendor/assets/application/examples/getter.rb +0 -16
- data/vendor/assets/application/examples/grab.rb +0 -14
- data/vendor/assets/application/examples/gradient.rb +0 -40
- data/vendor/assets/application/examples/group.rb +0 -44
- data/vendor/assets/application/examples/help.rb +0 -17
- data/vendor/assets/application/examples/hierarchy.rb +0 -21
- data/vendor/assets/application/examples/history.rb +0 -32
- data/vendor/assets/application/examples/holder.rb +0 -62
- data/vendor/assets/application/examples/hypertext.rb +0 -113
- data/vendor/assets/application/examples/image.rb +0 -5
- data/vendor/assets/application/examples/import.rb +0 -33
- data/vendor/assets/application/examples/increment.rb +0 -23
- data/vendor/assets/application/examples/infos.rb +0 -10
- data/vendor/assets/application/examples/input.rb +0 -34
- data/vendor/assets/application/examples/int8.rb +0 -17
- data/vendor/assets/application/examples/js&ruby.rb +0 -18
- data/vendor/assets/application/examples/keyboard.rb +0 -59
- data/vendor/assets/application/examples/layout.rb +0 -38
- data/vendor/assets/application/examples/list.rb +0 -72
- data/vendor/assets/application/examples/localstorage.rb +0 -19
- data/vendor/assets/application/examples/login.rb +0 -84
- data/vendor/assets/application/examples/markup.rb +0 -4
- data/vendor/assets/application/examples/match.rb +0 -115
- data/vendor/assets/application/examples/matrix.rb +0 -118
- data/vendor/assets/application/examples/monitor.rb +0 -14
- data/vendor/assets/application/examples/on_resize.rb +0 -7
- data/vendor/assets/application/examples/on_the_fly_ruby_code_loading.rb +0 -9
- data/vendor/assets/application/examples/online.rb +0 -3
- data/vendor/assets/application/examples/opacity.rb +0 -9
- data/vendor/assets/application/examples/over.rb +0 -29
- data/vendor/assets/application/examples/paint.rb +0 -29
- data/vendor/assets/application/examples/particles.rb +0 -4
- data/vendor/assets/application/examples/percent_to_px.rb +0 -4
- data/vendor/assets/application/examples/play.rb +0 -50
- data/vendor/assets/application/examples/preset.rb +0 -33
- data/vendor/assets/application/examples/random.rb +0 -42
- data/vendor/assets/application/examples/raw_html.rb +0 -48
- data/vendor/assets/application/examples/read.rb +0 -13
- data/vendor/assets/application/examples/recorder.rb +0 -74
- data/vendor/assets/application/examples/refresh.rb +0 -62
- data/vendor/assets/application/examples/remove.rb +0 -60
- data/vendor/assets/application/examples/repeat.rb +0 -26
- data/vendor/assets/application/examples/resize.rb +0 -17
- data/vendor/assets/application/examples/scroll.rb +0 -11
- data/vendor/assets/application/examples/security.rb +0 -76
- data/vendor/assets/application/examples/select_text.rb +0 -18
- data/vendor/assets/application/examples/selected.rb +0 -35
- data/vendor/assets/application/examples/server.rb +0 -24
- data/vendor/assets/application/examples/shadow.rb +0 -60
- data/vendor/assets/application/examples/shapes.rb +0 -6
- data/vendor/assets/application/examples/shortcut.rb +0 -25
- data/vendor/assets/application/examples/site.rb +0 -41
- data/vendor/assets/application/examples/size.rb +0 -17
- data/vendor/assets/application/examples/sliders.rb +0 -17
- data/vendor/assets/application/examples/smooth.rb +0 -9
- data/vendor/assets/application/examples/style.rb +0 -4
- data/vendor/assets/application/examples/sub_atome_manipulation.rb +0 -20
- data/vendor/assets/application/examples/svg_img_to_vector.rb +0 -6
- data/vendor/assets/application/examples/svg_vectorizer.rb +0 -21
- data/vendor/assets/application/examples/sync.rb +0 -38
- data/vendor/assets/application/examples/table.rb +0 -76
- data/vendor/assets/application/examples/tagged.rb +0 -24
- data/vendor/assets/application/examples/terminal.rb +0 -4
- data/vendor/assets/application/examples/test.rb +0 -584
- data/vendor/assets/application/examples/text.rb +0 -5
- data/vendor/assets/application/examples/tick.rb +0 -29
- data/vendor/assets/application/examples/tools.rb +0 -666
- data/vendor/assets/application/examples/touch.rb +0 -41
- data/vendor/assets/application/examples/type_mutation.rb +0 -18
- data/vendor/assets/application/examples/unit.rb +0 -14
- data/vendor/assets/application/examples/universe.rb +0 -8
- data/vendor/assets/application/examples/vector.rb +0 -37
- data/vendor/assets/application/examples/video.rb +0 -14
- data/vendor/assets/application/examples/wait.rb +0 -6
- data/vendor/assets/application/examples/www.rb +0 -10
- data/vendor/assets/server/atome_server_wasm.rb +0 -54
- data/vendor/assets/server/capture.rb +0 -10
- data/vendor/assets/server/database.rb +0 -63
- data/vendor/assets/server/eDen.rb +0 -302
- data/vendor/assets/server/extensions.rb +0 -13
- data/vendor/assets/src/css/style.css +0 -167
- data/vendor/assets/src/index.html +0 -45
- data/vendor/assets/src/index_opal.html +0 -40
- data/vendor/assets/src/index_server.html +0 -38
- data/vendor/assets/src/index_server_wasm.html +0 -45
- data/vendor/assets/src/index_wasm.html +0 -50
- data/vendor/assets/src/js/atome/atome.js +0 -506
- data/vendor/assets/src/js/atome/atome_helpers/add_font.js +0 -46
- data/vendor/assets/src/js/atome/atome_helpers/atome_animate.js +0 -65
- data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +0 -124
- data/vendor/assets/src/js/atome/atome_helpers/atome_drop.js +0 -12
- data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +0 -171
- data/vendor/assets/src/js/atome/atome_helpers/atome_over.js +0 -43
- data/vendor/assets/src/js/atome/atome_helpers/atome_sort.js +0 -20
- data/vendor/assets/src/js/atome/atome_helpers/atome_time.js +0 -10
- data/vendor/assets/src/js/atome/atome_helpers/atome_video.js +0 -12
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +0 -35
- data/vendor/assets/src/js/atome/atome_helpers/file.js +0 -12
- data/vendor/assets/src/js/atome/specific/opal.js +0 -111
- data/vendor/assets/src/js/atome/specific/wasm.js +0 -123
- data/vendor/assets/src/js/molecules/web.js +0 -4
- data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +0 -13
- data/vendor/assets/src/js/third_parties/fabric.min.js +0 -1
- data/vendor/assets/src/js/third_parties/html-to-image.min.js +0 -2
- data/vendor/assets/src/js/third_parties/interact.min.js +0 -3
- data/vendor/assets/src/js/third_parties/jsencrypt.min.js +0 -2
- data/vendor/assets/src/js/third_parties/papaparse.min.js +0 -7
- data/vendor/assets/src/js/third_parties/popmotion.min.js +0 -1
- data/vendor/assets/src/js/third_parties/sortable.min.js +0 -2
- data/vendor/assets/src/js/third_parties/three.min.js +0 -6
- data/vendor/assets/src/js/third_parties/w3color.js +0 -646
- data/vendor/assets/src/js/third_parties/wad.min.js +0 -9
- data/vendor/assets/src/js/third_parties/zim.min.js +0 -1
- data/vendor/assets/src/medias/audios/audio_missing.wav +0 -0
- data/vendor/assets/src/medias/audios/clap.wav +0 -0
- data/vendor/assets/src/medias/audios/cowbell.wav +0 -0
- data/vendor/assets/src/medias/audios/hihat.wav +0 -0
- data/vendor/assets/src/medias/audios/kick.wav +0 -0
- data/vendor/assets/src/medias/audios/riff.m4a +0 -0
- data/vendor/assets/src/medias/audios/snare.wav +0 -0
- data/vendor/assets/src/medias/audios/tom.wav +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +0 -202
- 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/fonts/Roboto_Slab/LICENSE.txt +0 -202
- data/vendor/assets/src/medias/fonts/Roboto_Slab/README.txt +0 -71
- data/vendor/assets/src/medias/fonts/Roboto_Slab/RobotoSlab-VariableFont_wght.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Black.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Bold.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-ExtraBold.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-ExtraLight.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Light.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Medium.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Regular.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-SemiBold.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Thin.ttf +0 -0
- data/vendor/assets/src/medias/images/atome.svg +0 -12
- data/vendor/assets/src/medias/images/ballanim.png +0 -0
- data/vendor/assets/src/medias/images/blank.png +0 -0
- data/vendor/assets/src/medias/images/green_planet.png +0 -0
- data/vendor/assets/src/medias/images/icons/Lowpass.svg +0 -8
- data/vendor/assets/src/medias/images/icons/activate.svg +0 -3
- data/vendor/assets/src/medias/images/icons/audio.svg +0 -7
- data/vendor/assets/src/medias/images/icons/band_pass.svg +0 -8
- data/vendor/assets/src/medias/images/icons/clear.svg +0 -5
- data/vendor/assets/src/medias/images/icons/color.svg +0 -5
- data/vendor/assets/src/medias/images/icons/copy.svg +0 -8
- data/vendor/assets/src/medias/images/icons/create.svg +0 -3
- data/vendor/assets/src/medias/images/icons/delete.svg +0 -8
- data/vendor/assets/src/medias/images/icons/edit-.svg +0 -4
- data/vendor/assets/src/medias/images/icons/edit.svg +0 -4
- data/vendor/assets/src/medias/images/icons/edition.svg +0 -4
- data/vendor/assets/src/medias/images/icons/email.svg +0 -13
- data/vendor/assets/src/medias/images/icons/equalizer-.svg +0 -5
- data/vendor/assets/src/medias/images/icons/equalizer.svg +0 -5
- data/vendor/assets/src/medias/images/icons/filter.svg +0 -4
- data/vendor/assets/src/medias/images/icons/folder.svg +0 -4
- data/vendor/assets/src/medias/images/icons/group.svg +0 -6
- data/vendor/assets/src/medias/images/icons/hamburger.svg +0 -8
- data/vendor/assets/src/medias/images/icons/high_pass.svg +0 -5
- data/vendor/assets/src/medias/images/icons/link.svg +0 -4
- data/vendor/assets/src/medias/images/icons/load.svg +0 -4
- data/vendor/assets/src/medias/images/icons/low_pass.svg +0 -5
- data/vendor/assets/src/medias/images/icons/mail_gray.svg +0 -6
- data/vendor/assets/src/medias/images/icons/mail_green.svg +0 -6
- data/vendor/assets/src/medias/images/icons/mail_orange.svg +0 -6
- data/vendor/assets/src/medias/images/icons/microphone.svg +0 -7
- data/vendor/assets/src/medias/images/icons/midi_in.svg +0 -4
- data/vendor/assets/src/medias/images/icons/midi_out.svg +0 -4
- data/vendor/assets/src/medias/images/icons/modules.svg +0 -11
- data/vendor/assets/src/medias/images/icons/paste.svg +0 -4
- data/vendor/assets/src/medias/images/icons/pause.svg +0 -5
- data/vendor/assets/src/medias/images/icons/play.svg +0 -7
- data/vendor/assets/src/medias/images/icons/record.svg +0 -4
- data/vendor/assets/src/medias/images/icons/save.svg +0 -5
- data/vendor/assets/src/medias/images/icons/select--.svg +0 -4
- data/vendor/assets/src/medias/images/icons/select-.svg +0 -5
- data/vendor/assets/src/medias/images/icons/select-all.svg +0 -4
- data/vendor/assets/src/medias/images/icons/select.svg +0 -4
- data/vendor/assets/src/medias/images/icons/settings.svg +0 -5
- data/vendor/assets/src/medias/images/icons/settings0.svg +0 -2
- data/vendor/assets/src/medias/images/icons/settings1.svg +0 -17
- data/vendor/assets/src/medias/images/icons/settings2.svg +0 -25
- data/vendor/assets/src/medias/images/icons/settings_old.svg +0 -6
- data/vendor/assets/src/medias/images/icons/shape.svg +0 -7
- data/vendor/assets/src/medias/images/icons/speaker.svg +0 -6
- data/vendor/assets/src/medias/images/icons/stop.svg +0 -4
- data/vendor/assets/src/medias/images/icons/tool.svg +0 -7
- data/vendor/assets/src/medias/images/icons/tools.svg +0 -9
- data/vendor/assets/src/medias/images/icons/undo.svg +0 -4
- data/vendor/assets/src/medias/images/icons/undo2.svg +0 -4
- data/vendor/assets/src/medias/images/icons/validate.svg +0 -9
- data/vendor/assets/src/medias/images/icons/vie.svg +0 -3
- data/vendor/assets/src/medias/images/icons/wave-saw.svg +0 -3
- data/vendor/assets/src/medias/images/icons/wave-sine.svg +0 -3
- data/vendor/assets/src/medias/images/icons/wave-square-.svg +0 -4
- data/vendor/assets/src/medias/images/icons/wave-square.svg +0 -3
- data/vendor/assets/src/medias/images/icons/wave-triangle.svg +0 -3
- data/vendor/assets/src/medias/images/icons/waveform-.svg +0 -4
- data/vendor/assets/src/medias/images/icons/waveform.svg +0 -7
- data/vendor/assets/src/medias/images/logos/Facebook.svg +0 -8
- data/vendor/assets/src/medias/images/logos/GitHub Black.svg +0 -7
- data/vendor/assets/src/medias/images/logos/GitHub.svg +0 -7
- data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +0 -109
- data/vendor/assets/src/medias/images/logos/LinkedIn.svg +0 -11
- data/vendor/assets/src/medias/images/logos/Orange/Facebook.svg +0 -8
- data/vendor/assets/src/medias/images/logos/Orange/TikTok.svg +0 -11
- data/vendor/assets/src/medias/images/logos/Orange/Twitter.svg +0 -8
- data/vendor/assets/src/medias/images/logos/Orange/instagram.svg +0 -8
- data/vendor/assets/src/medias/images/logos/Orange/vimeo.svg +0 -8
- data/vendor/assets/src/medias/images/logos/Orange/youtube.svg +0 -7
- data/vendor/assets/src/medias/images/logos/TikTok.svg +0 -11
- data/vendor/assets/src/medias/images/logos/Twitter.svg +0 -35
- data/vendor/assets/src/medias/images/logos/X.svg +0 -5
- data/vendor/assets/src/medias/images/logos/YouTube.svg +0 -1
- data/vendor/assets/src/medias/images/logos/apple.svg +0 -4
- data/vendor/assets/src/medias/images/logos/atome.svg +0 -12
- data/vendor/assets/src/medias/images/logos/freebsd.png +0 -0
- data/vendor/assets/src/medias/images/logos/freebsd.svg +0 -8
- data/vendor/assets/src/medias/images/logos/gray/Facebook.svg +0 -8
- data/vendor/assets/src/medias/images/logos/gray/TikTok.svg +0 -11
- data/vendor/assets/src/medias/images/logos/gray/Twitter.svg +0 -8
- data/vendor/assets/src/medias/images/logos/gray/instagram.svg +0 -8
- data/vendor/assets/src/medias/images/logos/gray/vimeo.svg +0 -8
- data/vendor/assets/src/medias/images/logos/gray/youtube.svg +0 -7
- data/vendor/assets/src/medias/images/logos/gray/youtube2.svg +0 -13
- data/vendor/assets/src/medias/images/logos/instagram.svg +0 -6
- data/vendor/assets/src/medias/images/logos/tiktok_back.svg +0 -1
- data/vendor/assets/src/medias/images/logos/vimeo.svg +0 -17
- data/vendor/assets/src/medias/images/noise.svg +0 -17
- data/vendor/assets/src/medias/images/red_planet.png +0 -0
- data/vendor/assets/src/medias/images/tile.png +0 -0
- data/vendor/assets/src/medias/texts/lorem.txt +0 -1
- data/vendor/assets/src/medias/utils/infos/color.rb +0 -29
- data/vendor/assets/src/medias/utils/infos/width.rb +0 -25
- data/vendor/assets/src/medias/videos/video_missing.mp4 +0 -0
- data/vendor/assets/src-tauri/.gitignore +0 -4
- data/vendor/assets/src-tauri/Cargo.toml +0 -27
- data/vendor/assets/src-tauri/build.rs +0 -3
- data/vendor/assets/src-tauri/icons/128x128.png +0 -0
- data/vendor/assets/src-tauri/icons/128x128@2x.png +0 -0
- data/vendor/assets/src-tauri/icons/32x32.png +0 -0
- data/vendor/assets/src-tauri/icons/Square107x107Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square142x142Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square150x150Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square284x284Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square30x30Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square310x310Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square44x44Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square71x71Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/Square89x89Logo.png +0 -0
- data/vendor/assets/src-tauri/icons/StoreLogo.png +0 -0
- data/vendor/assets/src-tauri/icons/icon.icns +0 -0
- data/vendor/assets/src-tauri/icons/icon.ico +0 -0
- data/vendor/assets/src-tauri/icons/icon.png +0 -0
- data/vendor/assets/src-tauri/src/main.rs +0 -71
- data/vendor/assets/src-tauri/tauri.conf.json +0 -70
- 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
- /data/vendor/assets/{src → build}/favicon.ico +0 -0
- /data/vendor/assets/{src/js/third_parties → build/js}/ping.min.js +0 -0
- /data/vendor/assets/{src → build}/js/third_parties/interact.min.js.map +0 -0
- /data/vendor/assets/{src → build}/js/third_parties/sha256.min.js +0 -0
@@ -1,705 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ObjectExtension
|
4
|
-
|
5
|
-
|
6
|
-
def new(params, &bloc)
|
7
|
-
# Genesis = Genesis.Genesis
|
8
|
-
if params.key?(:atome)
|
9
|
-
# if Universe.atome_list.include?(params[:atome])
|
10
|
-
# puts "atome #{params[:atome]} already exist you can't create it"
|
11
|
-
# else
|
12
|
-
Universe.add_atomes_specificities params[:atome]
|
13
|
-
Genesis.build_atome(params[:atome], &bloc)
|
14
|
-
# end
|
15
|
-
elsif params.key?(:particle)
|
16
|
-
if Universe.particle_list[params[:particle]]
|
17
|
-
puts "particle #{params[:particle]} already exist you can't create it"
|
18
|
-
else
|
19
|
-
Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
|
20
|
-
# render indicate if the particle needs to be rendered
|
21
|
-
# store tell the system if it need to store the particle value
|
22
|
-
# type help the system what type of type the particle will receive and store
|
23
|
-
Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
|
24
|
-
store: params[:store], type: params[:type],
|
25
|
-
category: params[:category] }, &bloc)
|
26
|
-
end
|
27
|
-
elsif params.key?(:sanitizer)
|
28
|
-
Genesis.build_sanitizer(params[:sanitizer], &bloc)
|
29
|
-
elsif params.key?(:pre)
|
30
|
-
Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
|
31
|
-
elsif params.key?(:post)
|
32
|
-
Atome.instance_variable_set("@post_#{params[:post]}", bloc)
|
33
|
-
elsif params.key?(:after)
|
34
|
-
Atome.instance_variable_set("@after_#{params[:after]}", bloc)
|
35
|
-
elsif params.key?(:initialized)
|
36
|
-
Atome.initialized[params[:initialized]] = bloc
|
37
|
-
elsif params.key?(:read)
|
38
|
-
Atome.instance_variable_set("@read_#{params[:read]}", bloc)
|
39
|
-
elsif params[:renderer]
|
40
|
-
renderer_found = params[:renderer]
|
41
|
-
if params[:specific]
|
42
|
-
Universe.set_atomes_specificities(params)
|
43
|
-
params[:specific] = "#{params[:specific]}_"
|
44
|
-
end
|
45
|
-
render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
|
46
|
-
Genesis.build_render(render_method, &bloc)
|
47
|
-
# elsif params.key?(:callback)
|
48
|
-
# particle_targetted = params[:callback]
|
49
|
-
# Atome.define_method("#{particle_targetted}_callback", option) do
|
50
|
-
# alert option
|
51
|
-
# bloc.call(option)
|
52
|
-
# end
|
53
|
-
elsif params.key?(:molecule)
|
54
|
-
molecule=params[:molecule]
|
55
|
-
Genesis.build_molecule(molecule, &bloc)
|
56
|
-
Universe.add_to_molecule_list(molecule)
|
57
|
-
|
58
|
-
# elsif params.key?(:applicaton)
|
59
|
-
# alert params
|
60
|
-
|
61
|
-
# molecule=params[:molecule]
|
62
|
-
# Genesis.build_molecule(molecule, &bloc)
|
63
|
-
# Universe.add_to_molecule_list(molecule)
|
64
|
-
elsif params.key?(:tool)
|
65
|
-
# we only store tools definition in the universe so it can be instanced using "A.build_tool" method when needed
|
66
|
-
|
67
|
-
tool_content = Atome.instance_exec(&bloc) if bloc.is_a?(Proc)
|
68
|
-
|
69
|
-
Universe.tools[params[:tool]]=tool_content
|
70
|
-
# Universe.tools[params[:tool]]=bloc
|
71
|
-
|
72
|
-
elsif params.key?(:template)
|
73
|
-
A.build_template(&bloc)
|
74
|
-
elsif params.key?(:code)
|
75
|
-
A.build_code(&bloc)
|
76
|
-
elsif params.key?(:test)
|
77
|
-
A.build_test(&bloc)
|
78
|
-
elsif params.key?(:preset)
|
79
|
-
Atome.preset_builder(params[:preset], &bloc)
|
80
|
-
# A.build_test(&bloc)
|
81
|
-
end
|
82
|
-
super if defined?(super)
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
86
|
-
# atome extensions
|
87
|
-
class Object
|
88
|
-
include ObjectExtension
|
89
|
-
# def new(params, &bloc)
|
90
|
-
# # Genesis = Genesis.Genesis
|
91
|
-
# if params.key?(:atome)
|
92
|
-
# if Universe.atome_list.include?(params[:atome])
|
93
|
-
# puts "atome #{params[:atome]} already exist you can't create it"
|
94
|
-
# else
|
95
|
-
# Universe.add_atomes_specificities params[:atome]
|
96
|
-
# Genesis.build_atome(params[:atome], &bloc)
|
97
|
-
# end
|
98
|
-
# elsif params.key?(:particle)
|
99
|
-
# if Universe.particle_list[params[:particle]]
|
100
|
-
# puts "particle #{params[:particle]} already exist you can't create it"
|
101
|
-
# else
|
102
|
-
# Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
|
103
|
-
# # render indicate if the particle needs to be rendered
|
104
|
-
# # store tell the system if it need to store the particle value
|
105
|
-
# # type help the system what type of type the particle will receive and store
|
106
|
-
# Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
|
107
|
-
# store: params[:store], type: params[:type],
|
108
|
-
# category: params[:category] }, &bloc)
|
109
|
-
# end
|
110
|
-
#
|
111
|
-
# elsif params.key?(:sanitizer)
|
112
|
-
# Genesis.build_sanitizer(params[:sanitizer], &bloc)
|
113
|
-
# elsif params.key?(:pre)
|
114
|
-
# Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
|
115
|
-
# elsif params.key?(:post)
|
116
|
-
# Atome.instance_variable_set("@post_#{params[:post]}", bloc)
|
117
|
-
# elsif params.key?(:after)
|
118
|
-
# Atome.instance_variable_set("@after_#{params[:after]}", bloc)
|
119
|
-
# elsif params.key?(:read)
|
120
|
-
# Atome.instance_variable_set("@read_#{params[:read]}", bloc)
|
121
|
-
# elsif params[:renderer]
|
122
|
-
# renderer_found = params[:renderer]
|
123
|
-
# if params[:specific]
|
124
|
-
# Universe.set_atomes_specificities(params)
|
125
|
-
# params[:specific] = "#{params[:specific]}_"
|
126
|
-
# end
|
127
|
-
# render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
|
128
|
-
# Genesis.build_render(render_method, &bloc)
|
129
|
-
# # elsif params.key?(:callback)
|
130
|
-
# # particle_targetted = params[:callback]
|
131
|
-
# # Atome.define_method("#{particle_targetted}_callback", option) do
|
132
|
-
# # alert option
|
133
|
-
# # bloc.call(option)
|
134
|
-
# # end
|
135
|
-
# end
|
136
|
-
# end
|
137
|
-
|
138
|
-
def reorder_particles(hash_to_reorder)
|
139
|
-
# we reorder the hash
|
140
|
-
ordered_keys = %i[renderers id alien type attach int8 unit]
|
141
|
-
|
142
|
-
ordered_part = ordered_keys.map { |k| [k, hash_to_reorder[k]] }.to_h
|
143
|
-
other_part = hash_to_reorder.reject { |k, _| ordered_keys.include?(k) }
|
144
|
-
# merge the parts to obtain an re-ordered hash
|
145
|
-
ordered_part.merge(other_part)
|
146
|
-
# reordered_hash
|
147
|
-
end
|
148
|
-
|
149
|
-
def delete (atomes)
|
150
|
-
grab(:view).delete(atomes)
|
151
|
-
end
|
152
|
-
|
153
|
-
def identity_generator
|
154
|
-
"a_#{Universe.app_identity}_#{Universe.counter}".to_sym
|
155
|
-
end
|
156
|
-
|
157
|
-
def hook(a_id)
|
158
|
-
a_id=a_id.to_sym
|
159
|
-
Universe.atomes[a_id]
|
160
|
-
end
|
161
|
-
|
162
|
-
def grab(id_to_get)
|
163
|
-
if id_to_get.instance_of? Atome
|
164
|
-
alert id_to_get.id
|
165
|
-
end
|
166
|
-
id_to_get=id_to_get.to_sym
|
167
|
-
return if id_to_get == false
|
168
|
-
aid_to_get= Universe.atomes_ids[id_to_get]
|
169
|
-
# puts id_to_get.class
|
170
|
-
# alert Universe.atomes
|
171
|
-
aid_to_get = '' if aid_to_get.instance_of? Array
|
172
|
-
# id_to_get = id_to_get.to_sym
|
173
|
-
|
174
|
-
# if id_to_get.nil? do
|
175
|
-
# if aid_to_get.nil?
|
176
|
-
# alert id_to_get
|
177
|
-
# else
|
178
|
-
|
179
|
-
# end
|
180
|
-
# end
|
181
|
-
# alert Universe.atomes[id_to_get]
|
182
|
-
Universe.atomes[aid_to_get]
|
183
|
-
end
|
184
|
-
|
185
|
-
# def box(params = {}, &proc)
|
186
|
-
# grab(:view).box(params, &proc)
|
187
|
-
# end
|
188
|
-
#
|
189
|
-
# # def intuition(params = {}, &proc)
|
190
|
-
# # grab(:view).intuition(params, &proc)
|
191
|
-
# # end
|
192
|
-
#
|
193
|
-
# def circle(params = {}, &proc)
|
194
|
-
# grab(:view).circle(params, &proc)
|
195
|
-
# end
|
196
|
-
|
197
|
-
# the method below generate Atome method creation at Object level
|
198
|
-
def atome_method_for_object(element)
|
199
|
-
Object.define_method element do |params, &user_proc|
|
200
|
-
default_parent = Essentials.default_params[element][:attach] || :view
|
201
|
-
grab(default_parent).send(element, params, &user_proc)
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
def wait(time, id = nil, &proc)
|
206
|
-
# we generate an uniq id
|
207
|
-
if [:kill, 'kill'].include?(time)
|
208
|
-
JS.eval("clearTimeout(window.timeoutIds['#{id}']);")
|
209
|
-
else
|
210
|
-
obj = Object.new
|
211
|
-
unique_id = obj.object_id
|
212
|
-
|
213
|
-
id ||= unique_id
|
214
|
-
time *= 1000
|
215
|
-
callback_id = "myRubyCallback_#{id}"
|
216
|
-
JS.global[callback_id.to_sym] = proc
|
217
|
-
JS.eval("if (!window.timeoutIds) { window.timeoutIds = {}; } window.timeoutIds['#{id}'] = setTimeout(function() { #{callback_id}(); }, #{time});")
|
218
|
-
end
|
219
|
-
id
|
220
|
-
end
|
221
|
-
|
222
|
-
def repeater(counter, proc)
|
223
|
-
instance_exec(counter, &proc) if proc.is_a?(Proc)
|
224
|
-
end
|
225
|
-
|
226
|
-
def repeat_callback(params, counter)
|
227
|
-
@repeat[params].call(counter)
|
228
|
-
end
|
229
|
-
|
230
|
-
def repeat(delay = 1, repeat = 0, &proc)
|
231
|
-
@repeat ||= []
|
232
|
-
@repeat << proc
|
233
|
-
repeat_id = @repeat.length - 1
|
234
|
-
JS.eval(<<~JS)
|
235
|
-
function repeat(action, interval, repetitions) {
|
236
|
-
let count = 0;
|
237
|
-
let intervalId = null;
|
238
|
-
|
239
|
-
function executeAction() {
|
240
|
-
if (count < repetitions) {
|
241
|
-
action(count);
|
242
|
-
count++;
|
243
|
-
} else {
|
244
|
-
clearInterval(intervalId);
|
245
|
-
}
|
246
|
-
}
|
247
|
-
|
248
|
-
executeAction(); // execute immediatly
|
249
|
-
intervalId = setInterval(executeAction, interval);
|
250
|
-
return intervalId;
|
251
|
-
}
|
252
|
-
|
253
|
-
function myAction(counter) {
|
254
|
-
atomeJsToRuby("repeat_callback(#{repeat_id}, "+counter+")")
|
255
|
-
}
|
256
|
-
|
257
|
-
const intervalId = repeat(myAction, #{delay} * 1000, #{repeat});
|
258
|
-
|
259
|
-
return intervalId;
|
260
|
-
JS
|
261
|
-
|
262
|
-
end
|
263
|
-
|
264
|
-
def stop(params)
|
265
|
-
case params
|
266
|
-
when Hash
|
267
|
-
if params.key?(:repeat)
|
268
|
-
repeater_to_stop = params[:repeat]
|
269
|
-
JS.eval(<<~JS)
|
270
|
-
clearInterval(#{repeater_to_stop});
|
271
|
-
JS
|
272
|
-
else
|
273
|
-
puts "La clé :repeat n'existe pas dans params"
|
274
|
-
end
|
275
|
-
else
|
276
|
-
puts "params n'est pas un hash"
|
277
|
-
end
|
278
|
-
end
|
279
|
-
|
280
|
-
def tagged(params)
|
281
|
-
atome_get = []
|
282
|
-
if params.instance_of? Hash
|
283
|
-
params.each do |tag_name, tag_value|
|
284
|
-
Universe.atomes.each do |atomes_id_found, atomes_found|
|
285
|
-
if atomes_found.tag&.instance_of?(Hash) && (atomes_found.tag[tag_name] == tag_value)
|
286
|
-
atome_get << atomes_id_found
|
287
|
-
end
|
288
|
-
end
|
289
|
-
end
|
290
|
-
else
|
291
|
-
Universe.atomes.each do |atomes_id_found, atomes_found|
|
292
|
-
atome_get << atomes_id_found if atomes_found.tag&.instance_of?(Hash) && atomes_found.tag[params]
|
293
|
-
end
|
294
|
-
end
|
295
|
-
atome_get
|
296
|
-
end
|
297
|
-
|
298
|
-
# shortcut
|
299
|
-
|
300
|
-
# we initialise $current_hovered_element
|
301
|
-
$current_hovered_element = nil
|
302
|
-
|
303
|
-
def shortcut(key:, option: nil, affect: :all, exclude: [], &block)
|
304
|
-
element_ids = (Array(affect) + Array(exclude)).uniq
|
305
|
-
|
306
|
-
element_ids.each do |element_id|
|
307
|
-
element = JS.global[:document].querySelector("##{element_id}")
|
308
|
-
unless element_id.to_sym == :all
|
309
|
-
element.addEventListener("mouseenter") { $current_hovered_element = element_id }
|
310
|
-
element.addEventListener("mouseleave") { $current_hovered_element = nil }
|
311
|
-
end
|
312
|
-
end
|
313
|
-
|
314
|
-
JS.global[:document].addEventListener("keydown") do |native_event|
|
315
|
-
event = Native(native_event)
|
316
|
-
key_pressed = event[:key].to_s.downcase
|
317
|
-
ctrl_pressed = event[:ctrlKey].to_s
|
318
|
-
alt_pressed = event[:altKey].to_s
|
319
|
-
meta_pressed = event[:metaKey].to_s
|
320
|
-
|
321
|
-
modifier_matched = case option
|
322
|
-
when :ctrl then ctrl_pressed
|
323
|
-
when :alt then alt_pressed
|
324
|
-
when :meta then meta_pressed
|
325
|
-
else true
|
326
|
-
end
|
327
|
-
|
328
|
-
affect_condition = affect == :all || Array(affect).include?($current_hovered_element)
|
329
|
-
exclude_condition = !Array(exclude).include?($current_hovered_element)
|
330
|
-
$current_hovered_element = :view if $current_hovered_element.nil?
|
331
|
-
if key_pressed == key.to_s.downcase && modifier_matched && affect_condition && exclude_condition
|
332
|
-
block.call(key_pressed, $current_hovered_element)
|
333
|
-
end
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
|
-
def console(debug)
|
338
|
-
if debug
|
339
|
-
console = box({ id: :console, width: :auto, height: 225, bottom: 0, top: :auto, left: 0, right: 0, depth: 30, color: { alpha: 0, red: 0, green: 0, blue: 0 } })
|
340
|
-
console_back = console.box({ id: :console_back, blur: { value: 5, affect: :back }, overflow: :auto, width: :auto, height: :auto, top: 25, bottom: 0, left: 0, right: 0, depth: 30, color: { alpha: 0.5, red: 0, green: 0, blue: 0 } })
|
341
|
-
console_top = console.box({ id: :console_top, overflow: :auto, width: :auto, height: 25, top: 0, bottom: 0, left: 0, right: 0, depth: 30, color: { alpha: 1, red: 0.3, green: 0.3, blue: 0.3 } })
|
342
|
-
|
343
|
-
console_top.touch(:double) do
|
344
|
-
console.height(25)
|
345
|
-
console.bottom(0)
|
346
|
-
console.top(:auto)
|
347
|
-
end
|
348
|
-
console_top.shadow({
|
349
|
-
id: :s1,
|
350
|
-
# affect: [:the_circle],
|
351
|
-
left: 0, top: 3, blur: 9,
|
352
|
-
invert: false,
|
353
|
-
red: 0, green: 0, blue: 0, alpha: 1
|
354
|
-
})
|
355
|
-
console.drag(:locked) do |event|
|
356
|
-
dy = event[:dy]
|
357
|
-
y = console.to_px(:top) + dy.to_f
|
358
|
-
console.top(y)
|
359
|
-
console.height(:auto)
|
360
|
-
total_height = grab(:view).to_px(:height)
|
361
|
-
# console_back.height(total_height-console.top)
|
362
|
-
end
|
363
|
-
console_output = console_back.text({ data: '', id: :console_output, component: { size: 12 } })
|
364
|
-
JS.eval <<~JS
|
365
|
-
(function() {
|
366
|
-
var oldLog = console.log;
|
367
|
-
var consoleDiv = document.getElementById("console_output");
|
368
|
-
console.log = function(message) {
|
369
|
-
if (consoleDiv) {
|
370
|
-
consoleDiv.innerHTML += '<p>' + message + '</p>';
|
371
|
-
}
|
372
|
-
oldLog.apply(console, arguments);
|
373
|
-
};
|
374
|
-
}());
|
375
|
-
JS
|
376
|
-
|
377
|
-
console_clear = console_top.circle({ id: :console_clear, color: :red, top: 3, left: 3, width: 19, height: 19 })
|
378
|
-
console_clear.touch(true) do
|
379
|
-
console_output.data("")
|
380
|
-
end
|
381
|
-
JS.global[:document].addEventListener("contextmenu") do |event|
|
382
|
-
end
|
383
|
-
# element[:style][:WebkitUserSelect] = 'none'
|
384
|
-
# element[:style][:MozUserSelect] = 'none'
|
385
|
-
else
|
386
|
-
grab(:console_back).delete(true)
|
387
|
-
JS.global[:document].addEventListener("contextmenu") do |native_event|
|
388
|
-
event = Native(native_event)
|
389
|
-
event.preventDefault
|
390
|
-
end
|
391
|
-
end
|
392
|
-
end
|
393
|
-
|
394
|
-
# import methode below
|
395
|
-
def importer_all(&proc)
|
396
|
-
JS.global[:document][:body].addEventListener('dragover') do |native_event|
|
397
|
-
event = Native(native_event)
|
398
|
-
event.preventDefault
|
399
|
-
end
|
400
|
-
|
401
|
-
JS.global[:document][:body].addEventListener('drop') do |native_event|
|
402
|
-
event = Native(native_event)
|
403
|
-
event.preventDefault
|
404
|
-
files = event[:dataTransfer][:files]
|
405
|
-
|
406
|
-
if files[:length].to_i > 0
|
407
|
-
(0...files[:length].to_i).each do |i|
|
408
|
-
file = files[i]
|
409
|
-
reader = JS.eval('let a= new FileReader(); return a')
|
410
|
-
reader.readAsText(file)
|
411
|
-
reader.addEventListener('load') do
|
412
|
-
proc.call({ content: reader[:result].to_s, name: file[:name].to_s, type: file[:type].to_s, size: file[:size].to_s })
|
413
|
-
end
|
414
|
-
reader.addEventListener('error') do
|
415
|
-
puts 'Error: ' + file[:name].to_s
|
416
|
-
end
|
417
|
-
end
|
418
|
-
end
|
419
|
-
end
|
420
|
-
end
|
421
|
-
|
422
|
-
def exception_import(atome_id, &proc)
|
423
|
-
if Universe.user_atomes.include?(atome_id.to_sym)
|
424
|
-
special_div = JS.global[:document].getElementById(atome_id)
|
425
|
-
special_div.addEventListener('dragover') do |native_event|
|
426
|
-
event = Native(native_event)
|
427
|
-
special_div[:style][:backgroundColor] = 'red'
|
428
|
-
event.preventDefault
|
429
|
-
event.stopPropagation
|
430
|
-
end
|
431
|
-
|
432
|
-
special_div.addEventListener('dragleave') do |native_event|
|
433
|
-
event = Native(native_event)
|
434
|
-
special_div[:style][:backgroundColor] = 'yellow'
|
435
|
-
event.stopPropagation
|
436
|
-
end
|
437
|
-
|
438
|
-
special_div.addEventListener('drop') do |native_event|
|
439
|
-
event = Native(native_event)
|
440
|
-
event.preventDefault
|
441
|
-
event.stopPropagation
|
442
|
-
|
443
|
-
files = event[:dataTransfer][:files]
|
444
|
-
|
445
|
-
if files[:length].to_i > 0
|
446
|
-
(0...files[:length].to_i).each do |i|
|
447
|
-
file = files[i]
|
448
|
-
reader = JS.eval('let a= new FileReader(); return a')
|
449
|
-
reader.readAsText(file)
|
450
|
-
reader.addEventListener('load') do
|
451
|
-
proc.call({ content: reader[:result].to_s, name: file[:name].to_s, type: file[:type].to_s, size: file[:size].to_s })
|
452
|
-
end
|
453
|
-
reader.addEventListener('error') do
|
454
|
-
puts 'Error: ' + file[:name].to_s
|
455
|
-
end
|
456
|
-
end
|
457
|
-
end
|
458
|
-
end
|
459
|
-
JS.global[:document][:body].addEventListener('drop') do |native_event|
|
460
|
-
event = Native(native_event)
|
461
|
-
event.preventDefault
|
462
|
-
event.stopPropagation
|
463
|
-
# puts 'File drop out of the special zonne'
|
464
|
-
end
|
465
|
-
end
|
466
|
-
end
|
467
|
-
|
468
|
-
def importer(target = :all, &proc)
|
469
|
-
if target == :all
|
470
|
-
importer_all(&proc)
|
471
|
-
else
|
472
|
-
exception_import(target, &proc)
|
473
|
-
end
|
474
|
-
end
|
475
|
-
|
476
|
-
def infos
|
477
|
-
particle_list = Universe.particle_list.dup
|
478
|
-
particle_list.delete(:password)
|
479
|
-
particle_list.delete(:selection)
|
480
|
-
infos = {}
|
481
|
-
particle_list[:css]=:poil
|
482
|
-
particle_list.each do |particle_found|
|
483
|
-
infos[particle_found[0]] = send(particle_found[0]) unless send(particle_found[0]).nil?
|
484
|
-
end
|
485
|
-
# we convert CssProxy object to hash below
|
486
|
-
infos[:css]=eval(infos[:css].to_s)
|
487
|
-
infos
|
488
|
-
end
|
489
|
-
|
490
|
-
def dig
|
491
|
-
ids = []
|
492
|
-
dig_recursive = lambda do |atome|
|
493
|
-
ids << atome.id
|
494
|
-
atome.attached.each { |attached_atome| dig_recursive.call(grab(attached_atome)) }
|
495
|
-
end
|
496
|
-
dig_recursive.call(self)
|
497
|
-
ids
|
498
|
-
end
|
499
|
-
|
500
|
-
def fit(params)
|
501
|
-
unless params.instance_of?(Hash)
|
502
|
-
params = { value: params }
|
503
|
-
end
|
504
|
-
target_size = params[:value]
|
505
|
-
axis = params[:axis]
|
506
|
-
objet_atome = self
|
507
|
-
atomes_found = objet_atome.dig
|
508
|
-
total_width = found_area_used(atomes_found)[:max][:x] - found_area_used(atomes_found)[:min][:x]
|
509
|
-
total_height = found_area_used(atomes_found)[:max][:y] - found_area_used(atomes_found)[:min][:y]
|
510
|
-
if axis == :x
|
511
|
-
ratio = target_size / total_width
|
512
|
-
# now we resize and re-position all atomes
|
513
|
-
atomes_found.each do |atome_id|
|
514
|
-
current_atome = grab(atome_id)
|
515
|
-
current_atome.left(current_atome.left * ratio)
|
516
|
-
current_atome.top(current_atome.top * ratio)
|
517
|
-
new_width = current_atome.to_px(:width) * ratio
|
518
|
-
new_height = current_atome.to_px(:height) * ratio
|
519
|
-
current_atome.width(new_width)
|
520
|
-
current_atome.height(new_height)
|
521
|
-
end
|
522
|
-
else
|
523
|
-
ratio = target_size / total_height
|
524
|
-
# now we resize and re-position all atomes
|
525
|
-
atomes_found.each do |atome_id|
|
526
|
-
current_atome = grab(atome_id)
|
527
|
-
current_atome.left(current_atome.left * ratio)
|
528
|
-
current_atome.top(current_atome.top * ratio)
|
529
|
-
current_atome.width(current_atome.to_px(:width) * ratio)
|
530
|
-
current_atome.height(current_atome.to_px(:height) * ratio)
|
531
|
-
end
|
532
|
-
end
|
533
|
-
# total_size, max_other_axis_size = calculate_total_size(objet_atome, axis)
|
534
|
-
# scale_factor = target_size.to_f / total_size
|
535
|
-
# resize_and_reposition(objet_atome, scale_factor, axis, max_other_axis_size)
|
536
|
-
end
|
537
|
-
|
538
|
-
def found_area_used(ids)
|
539
|
-
|
540
|
-
min_x, min_y = Float::INFINITY, Float::INFINITY
|
541
|
-
max_x, max_y = 0, 0
|
542
|
-
|
543
|
-
ids.each do |id|
|
544
|
-
atome = grab(id)
|
545
|
-
|
546
|
-
x = atome.compute({ particle: :left })[:value]
|
547
|
-
y = atome.compute({ particle: :top })[:value]
|
548
|
-
width = atome.to_px(:width)
|
549
|
-
height = atome.to_px(:height)
|
550
|
-
min_x = [min_x, x].min
|
551
|
-
min_y = [min_y, y].min
|
552
|
-
max_x = [max_x, x + width].max
|
553
|
-
max_y = [max_y, y + height].max
|
554
|
-
end
|
555
|
-
|
556
|
-
{ min: { x: min_x, y: min_y }, max: { x: max_x, y: max_y } }
|
557
|
-
|
558
|
-
end
|
559
|
-
|
560
|
-
def calculate_total_size(objet_atome, axis)
|
561
|
-
total_size = (axis == :x) ? objet_atome.to_px(:width) : objet_atome.to_px(:height)
|
562
|
-
max_other_axis_size = (axis == :x) ? objet_atome.to_px(:height) : objet_atome.to_px(:width)
|
563
|
-
|
564
|
-
objet_atome.attached.each do |child_id|
|
565
|
-
child = grab(child_id)
|
566
|
-
child_size = (axis == :x) ? child.to_px(:width) : child.to_px(:height)
|
567
|
-
other_axis_size = (axis == :x) ? child.to_px(:height) : child.to_px(:width)
|
568
|
-
|
569
|
-
total_size += child_size
|
570
|
-
max_other_axis_size = [max_other_axis_size, other_axis_size].max
|
571
|
-
end
|
572
|
-
|
573
|
-
[total_size, max_other_axis_size]
|
574
|
-
end
|
575
|
-
|
576
|
-
def resize_and_reposition(objet_atome, scale_factor, axis, max_other_axis_size)
|
577
|
-
current_position = 0
|
578
|
-
resize_object(objet_atome, scale_factor, axis, max_other_axis_size)
|
579
|
-
current_position += (axis == :x) ? objet_atome.to_px(:width) : objet_atome.to_px(:height)
|
580
|
-
objet_atome.attached.each do |child_id|
|
581
|
-
child = grab(child_id)
|
582
|
-
resize_object(child, scale_factor, axis, max_other_axis_size)
|
583
|
-
child.top(child.top * scale_factor)
|
584
|
-
child.left(child.left * scale_factor)
|
585
|
-
current_position += child.to_px(:height)
|
586
|
-
end
|
587
|
-
end
|
588
|
-
|
589
|
-
def resize_object(objet, scale_factor, axis, max_other_axis_size)
|
590
|
-
if axis == :x
|
591
|
-
new_width = objet.width * scale_factor
|
592
|
-
new_height = new_width / (objet.width.to_f / objet.height)
|
593
|
-
objet.width(new_width)
|
594
|
-
objet.height([new_height, max_other_axis_size].min)
|
595
|
-
else
|
596
|
-
new_height = objet.height * scale_factor
|
597
|
-
new_width = new_height / (objet.height.to_f / objet.width)
|
598
|
-
objet.height(new_height)
|
599
|
-
objet.width([new_width, max_other_axis_size].min)
|
600
|
-
end
|
601
|
-
end
|
602
|
-
|
603
|
-
def atomizer(params)
|
604
|
-
unless params.instance_of? Hash
|
605
|
-
params = { target: params }
|
606
|
-
end
|
607
|
-
id = params[:id]
|
608
|
-
if id
|
609
|
-
id_wanted = { id: id }
|
610
|
-
else
|
611
|
-
id_wanted = {}
|
612
|
-
end
|
613
|
-
basis = { alien: params[:target], renderers: [:html], type: :atomized }.merge(id_wanted)
|
614
|
-
a = Atome.new(basis)
|
615
|
-
return a
|
616
|
-
# convert any foreign object (think HTML) to a pseudo atome objet , that embed foreign objet
|
617
|
-
end
|
618
|
-
|
619
|
-
|
620
|
-
JS.eval(<<~JS)
|
621
|
-
window.preventDefaultAction = function(e) {
|
622
|
-
e.preventDefault();
|
623
|
-
}
|
624
|
-
JS
|
625
|
-
|
626
|
-
def touch_allow(allow)
|
627
|
-
if allow
|
628
|
-
# Retire l'écouteur d'événements en utilisant la fonction globale
|
629
|
-
JS.eval('document.removeEventListener("contextmenu", window.preventDefaultAction);')
|
630
|
-
else
|
631
|
-
# Ajoute l'écouteur d'événements en utilisant la fonction globale
|
632
|
-
JS.eval('document.addEventListener("contextmenu", window.preventDefaultAction);')
|
633
|
-
end
|
634
|
-
end
|
635
|
-
|
636
|
-
|
637
|
-
def allow_copy(allow)
|
638
|
-
if allow
|
639
|
-
# Rétablir la sélection et la copie de texte
|
640
|
-
JS.eval(<<~JS)
|
641
|
-
document.body.style.userSelect = 'auto'; // Permet la sélection de texte
|
642
|
-
document.removeEventListener('copy', preventDefaultAction); // Permet la copie
|
643
|
-
JS
|
644
|
-
else
|
645
|
-
# Bloquer la sélection et la copie de texte
|
646
|
-
JS.eval(<<~JS)
|
647
|
-
document.body.style.userSelect = 'none'; // Bloque la sélection de texte
|
648
|
-
document.addEventListener('copy', preventDefaultAction); // Bloque la copie
|
649
|
-
JS
|
650
|
-
end
|
651
|
-
end
|
652
|
-
|
653
|
-
# Définit la fonction preventDefaultAction dans un contexte global pour être utilisée par allow_copy
|
654
|
-
JS.eval(<<~JS)
|
655
|
-
window.preventDefaultAction = function(e) {
|
656
|
-
e.preventDefault();
|
657
|
-
}
|
658
|
-
JS
|
659
|
-
|
660
|
-
|
661
|
-
end
|
662
|
-
|
663
|
-
class CssProxy
|
664
|
-
def initialize(js, parent_key = nil, current_atome)
|
665
|
-
@js = js
|
666
|
-
@css = {}
|
667
|
-
@parent_key = parent_key
|
668
|
-
@style = {}
|
669
|
-
@current_atome = current_atome
|
670
|
-
end
|
671
|
-
|
672
|
-
def [](key)
|
673
|
-
if @parent_key
|
674
|
-
@current_atome.instance_variable_get('@css')[@parent_key]&.[](key)
|
675
|
-
else
|
676
|
-
CssProxy.new(@js, key, @current_atome)
|
677
|
-
end
|
678
|
-
end
|
679
|
-
|
680
|
-
def []=(key, value)
|
681
|
-
if @parent_key
|
682
|
-
@js[@parent_key][key] = value
|
683
|
-
@current_atome.instance_variable_set('@css', { @parent_key => { key => value } })
|
684
|
-
@css[@parent_key] = { key => value }
|
685
|
-
puts "==> Clé parente: #{@parent_key}, Clé: #{key}, Valeur: #{value}"
|
686
|
-
else
|
687
|
-
@style[key] = value
|
688
|
-
@js[key] = value
|
689
|
-
end
|
690
|
-
|
691
|
-
@js.update_style(@style) if @parent_key.nil?
|
692
|
-
end
|
693
|
-
|
694
|
-
def to_s
|
695
|
-
@current_atome.instance_variable_get('@css').to_s
|
696
|
-
end
|
697
|
-
|
698
|
-
def receptor(msg, &bloc)
|
699
|
-
parsed = JSON.parse(msg)
|
700
|
-
bloc.call(parsed)
|
701
|
-
end
|
702
|
-
|
703
|
-
end
|
704
|
-
|
705
|
-
|