atome 0.5.7.5.4 → 0.5.7.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/deep learning/basic_infos.txt +5 -0
  3. data/lib/atome/genesis/atomes.rb +12 -0
  4. data/lib/atome/genesis/particles/event.rb +141 -97
  5. data/lib/atome/genesis/particles/identity.rb +2 -1
  6. data/lib/atome/genesis/particles/spatial.rb +25 -0
  7. data/lib/atome/genesis/particles/utility.rb +13 -5
  8. data/lib/atome/utilities/essentials.rb +5 -2
  9. data/lib/atome/version.rb +1 -1
  10. data/lib/molecules/intuition/tools.rb +1 -1
  11. data/lib/molecules/intuition/utilities.rb +3 -0
  12. data/lib/platform_specific/opal/extensions/object.rb +3 -1
  13. data/lib/platform_specific/wasm/atome_wasm_extensions.rb +2 -1
  14. data/lib/renderers/html/event.rb +20 -6
  15. data/lib/renderers/html/html.rb +753 -446
  16. data/lib/renderers/html/identity.rb +33 -6
  17. data/lib/renderers/html/spatial.rb +27 -0
  18. data/lib/renderers/html/utility.rb +4 -0
  19. data/vendor/assets/application/examples/audio.rb +25 -9
  20. data/vendor/assets/application/examples/calendar.rb +186 -0
  21. data/vendor/assets/application/examples/drop.rb +1 -0
  22. data/vendor/assets/application/examples/editor.rb +139 -0
  23. data/vendor/assets/application/examples/inspector.rb +129 -0
  24. data/vendor/assets/application/examples/keyboard.rb +20 -10
  25. data/vendor/assets/application/examples/map.rb +42 -0
  26. data/vendor/assets/application/examples/meteo.rb +8 -0
  27. data/vendor/assets/application/examples/midi.rb +4 -0
  28. data/vendor/assets/application/examples/on_resize.rb +14 -0
  29. data/vendor/assets/application/examples/over.rb +0 -1
  30. data/vendor/assets/application/examples/overflow.rb +20 -5
  31. data/vendor/assets/application/examples/particles.rb +1 -1
  32. data/vendor/assets/application/examples/preset.rb +1 -1
  33. data/vendor/assets/application/examples/resize.rb +11 -0
  34. data/vendor/assets/application/examples/tick.rb +10 -0
  35. data/vendor/assets/application/examples/tools.rb +6 -1
  36. data/vendor/assets/application/examples/touch.rb +2 -14
  37. data/vendor/assets/application/examples/trigger_abstraction.rb +165 -0
  38. data/vendor/assets/application/examples/vr.rb +3 -0
  39. data/vendor/assets/src/css/codemirror.min.css +472 -0
  40. data/vendor/assets/src/css/fonts/tui/icon.eot +0 -0
  41. data/vendor/assets/src/css/fonts/tui/icon.svg +17 -0
  42. data/vendor/assets/src/css/fonts/tui/icon.ttf +0 -0
  43. data/vendor/assets/src/css/fonts/tui/icon.woff +0 -0
  44. data/vendor/assets/src/css/fonts/tui/noto.woff +72 -0
  45. data/vendor/assets/src/css/images/leaflet/layers-2x.png +0 -0
  46. data/vendor/assets/src/css/images/leaflet/layers.png +0 -0
  47. data/vendor/assets/src/css/images/leaflet/marker-icon-2x.png +0 -0
  48. data/vendor/assets/src/css/images/leaflet/marker-icon.png +0 -0
  49. data/vendor/assets/src/css/images/leaflet/marker-shadow.png +0 -0
  50. data/vendor/assets/src/css/images/tui/ic-arrow-line-left.png +0 -0
  51. data/vendor/assets/src/css/images/tui/ic-arrow-line-left@2x.png +0 -0
  52. data/vendor/assets/src/css/images/tui/ic-arrow-line-left@3x.png +0 -0
  53. data/vendor/assets/src/css/images/tui/ic-arrow-line-right.png +0 -0
  54. data/vendor/assets/src/css/images/tui/ic-arrow-line-right@2x.png +0 -0
  55. data/vendor/assets/src/css/images/tui/ic-arrow-line-right@3x.png +0 -0
  56. data/vendor/assets/src/css/images/tui/ic-traveltime-w.png +0 -0
  57. data/vendor/assets/src/css/images/tui/ic-view-day.png +0 -0
  58. data/vendor/assets/src/css/images/tui/ic-view-day@2x.png +0 -0
  59. data/vendor/assets/src/css/images/tui/ic-view-day@3x.png +0 -0
  60. data/vendor/assets/src/css/images/tui/ic-view-month.png +0 -0
  61. data/vendor/assets/src/css/images/tui/ic-view-month@2x.png +0 -0
  62. data/vendor/assets/src/css/images/tui/ic-view-month@3x.png +0 -0
  63. data/vendor/assets/src/css/images/tui/ic-view-week.png +0 -0
  64. data/vendor/assets/src/css/images/tui/ic-view-week@2x.png +0 -0
  65. data/vendor/assets/src/css/images/tui/ic-view-week@3x.png +0 -0
  66. data/vendor/assets/src/css/images/tui/icon.png +0 -0
  67. data/vendor/assets/src/css/images/tui/img-bi.png +0 -0
  68. data/vendor/assets/src/css/images/tui/img-bi@2x.png +0 -0
  69. data/vendor/assets/src/css/images/tui/img-bi@3x.png +0 -0
  70. data/vendor/assets/src/css/leaflet.css +664 -0
  71. data/vendor/assets/src/css/monokai.min.css +127 -0
  72. data/vendor/assets/src/css/style.css +1 -1
  73. data/vendor/assets/src/css/toastui-calendar.min.css +6 -0
  74. data/vendor/assets/src/index.html +12 -1
  75. data/vendor/assets/src/index_opal.html +16 -1
  76. data/vendor/assets/src/index_server.html +11 -1
  77. data/vendor/assets/src/index_server_wasm.html +10 -1
  78. data/vendor/assets/src/index_wasm.html +12 -1
  79. data/vendor/assets/src/js/atome/specific/tauri.js +32 -0
  80. data/vendor/assets/src/js/atome/utilities/importmap.js +9 -0
  81. data/vendor/assets/src/js/atome/utilities/three_module.js +88 -0
  82. data/vendor/assets/src/js/test.js +42 -0
  83. data/vendor/assets/src/js/third_parties/Three/build/three.cjs +54216 -0
  84. data/vendor/assets/src/js/third_parties/Three/build/three.module.min.js +6 -0
  85. data/vendor/assets/src/js/third_parties/Three/build/three.webgpu.min.js +6 -0
  86. data/vendor/assets/src/js/third_parties/Three/jsm/controls/OrbitControls.js +1532 -0
  87. data/vendor/assets/src/js/third_parties/codemirror.min.js +1 -0
  88. data/vendor/assets/src/js/third_parties/leaflet.js +6 -0
  89. data/vendor/assets/src/js/third_parties/leaflet.js.map +1 -0
  90. data/vendor/assets/src/js/third_parties/ruby.min.js +1 -0
  91. data/vendor/assets/src/js/third_parties/toastui-calendar.min.js +9 -0
  92. data/vendor/assets/src/medias/images/puydesancy.jpg +0 -0
  93. data/vendor/assets/src-tauri/Cargo.toml +6 -5
  94. data/vendor/assets/src-tauri/Info.plist +12 -0
  95. data/vendor/assets/src-tauri/src/main.rs +32 -3
  96. data/vendor/assets/src-tauri/src/midi.rs +25 -0
  97. data/vendor/assets/src-tauri/tauri.conf.json +4 -4
  98. metadata +60 -3
  99. data/vendor/assets/src/js/third_parties/three.min.js +0 -6
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ # new({ atome: :map, type: :hash })
5
+
6
+ # new({particle: :longitude}) do |params, _user_proc|
7
+ # render(:map, {longitude: params })
8
+ # params
9
+ # end
10
+ #
11
+ # new({particle: :latitude}) do |params, _user_proc|
12
+ # render(:map, {latitude: params })
13
+ # params
14
+ # end
15
+
16
+ # new({ method: :map, renderer: :html, type: :int }) do |params, _user_proc|
17
+ # latitude_found=@latitude
18
+ # longitude_found=@longitude
19
+ # location_hash={longitude: longitude_found, latitude: latitude_found}.merge(params)
20
+ # html.location(location_hash)
21
+ # end
22
+
23
+
24
+
25
+ m=map({id: :hgfh, longitude: 55.9876876, latitude: 33.987687, width: 333, height: 222,})
26
+ # wait 3 do
27
+ p=map({id: :poilo, location: :auto, width: 333, height: 333, top: 333 , left: 333, zoom: 3})
28
+ # end
29
+ b=box
30
+ b.touch(true) do
31
+ m.zoom(33)
32
+ # p.zoom(3)
33
+ # wait 2 do
34
+ p.pan({ left: 370, top: 190 })
35
+ # end
36
+ end
37
+
38
+ # m=map({id: :locator, location: :auto})
39
+
40
+ # alert m.longitude
41
+
42
+
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ b = box
4
+ b.meteo('chamalieres') do |params|
5
+ text({ data: params[:main][:temp] })
6
+ puts params
7
+ end
8
+
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ puts "connect a midi devide and run atome in native mode th elook in te console"
@@ -4,4 +4,18 @@
4
4
  view = grab(:view)
5
5
  view.on(:resize) do |event|
6
6
  puts "view size is #{event}"
7
+ end
8
+
9
+ b=box
10
+ b.touch(true) do
11
+ view.on(:remove)
12
+ end
13
+
14
+
15
+ c=circle({ left: 333 })
16
+
17
+ c.touch(true) do
18
+ view.on(:resize) do |event|
19
+ puts "Now size is : #{event}"
20
+ end
7
21
  end
@@ -9,7 +9,6 @@ b.over(:enter) do
9
9
  puts "in"
10
10
  puts "enter"
11
11
  b.width= b.width+30
12
- # alert :in
13
12
  b.color(:yellow)
14
13
  end
15
14
  b.over(:leave) do
@@ -1,12 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  b = box({ id: :the_container, width: 300, height: 300 })
4
- b.box({top: 500, color: :red})
5
- cc=b.circle({ top: 160, id: :the_circle })
4
+ b.box({ top: 500, color: :red })
5
+ cc = b.circle({ top: 160, id: :the_circle })
6
6
 
7
- initial_height=cc.height
7
+ initial_height = cc.height
8
+ initial_width = cc.width
8
9
  b.overflow(:scroll) do |event|
9
10
  new_height = initial_height + event[:top]
10
11
  cc.height(new_height)
11
- {left: event[:top]}
12
- end
12
+ { left: event[:top] }
13
+ end
14
+ c = circle({ top: 370, color: :red })
15
+ c.touch(:up) do
16
+ b.overflow(:remove)
17
+ c.delete(true)
18
+ c = circle({ top: 370, left: 90, color: :green })
19
+ c.touch(true) do
20
+ b.overflow(:scroll) do |event|
21
+ puts 'removed!!'
22
+ new_width = initial_width + event[:top]
23
+ cc.width(new_width)
24
+ end
25
+ end
26
+ end
27
+
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  b = box({ left: 777 })
4
- puts "b ahas the following paticles : #{b.particles}"
4
+ puts "b contain the following particles : #{b.particles}"
@@ -16,7 +16,7 @@ puts " my_box preset is : #{my_box.preset}"
16
16
  # print in the console : [Log] my_box preset is : {:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}} (browser.script.iife.min.js, line 13)
17
17
 
18
18
 
19
- c=circle
19
+ c=circle({id: :my_circle, width: 333, height: 333})
20
20
  puts " c is : #{c.inspect }"
21
21
  # this print : [Log] c is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 @element=[object HTMLDivElement], @id="circle_16", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 ...>, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
22
22
  # it's pôssible to alter basic preset using the particle .preset
@@ -14,4 +14,15 @@ t=text({data: ' click me to unbind resize'})
14
14
  t.touch(true) do
15
15
  t.data('resize unbinded')
16
16
  m.resize(:remove)
17
+ end
18
+
19
+ c=circle({left: 99, top: 99, right: 100, height: 99})
20
+
21
+ c.touch(true) do
22
+ m.resize({ size: { min: { width: 90, height: 190 }, max: { width: 300, height: 600 } } }) do |event|
23
+ puts "ooooooo"
24
+ end
25
+ m.on(:resize) do |event|
26
+ puts 'yes'
27
+ end
17
28
  end
@@ -27,3 +27,13 @@ c.touch(true) do
27
27
  c.tick(:my_counter)
28
28
  puts c.tick[:my_counter]
29
29
  end
30
+
31
+ bb=box({left: 333})
32
+
33
+ bb.touch(true) do
34
+ if bb.tick(:my_counter)%2 == 0
35
+ bb.color(:red)
36
+ else
37
+ bb.color(:blue)
38
+ end
39
+ end
@@ -290,6 +290,7 @@ end
290
290
  # Universe.tools_root= {tools: [:blur, :box, :test, :toolbox1],toolbox: { orientation: :ew, left:90 , bottom: 9, spacing: 9} }
291
291
  Universe.tools_root = {id: :root_tools, tools: [:select,:crash_test, :box, :drag, :touch,:color, :move, :toolbox1, :rotate], toolbox: { orientation: :ew, left: 9, bottom: 9, spacing: 9 } }
292
292
  # puts "above we added an id because each tool may be in many toolbox and have an uniq ID"
293
+
293
294
  Atome.init_intuition
294
295
 
295
296
  b = box({ id: :the_test_box, selected: false, color: :blue })
@@ -320,4 +321,8 @@ circle({left: 333,top: 333, id: :c2})
320
321
  # puts "#{b.descendant_of?(:intuition)}, then dont treat!"
321
322
  #
322
323
  # end
323
- puts 'add tool preview , and maybe allow tool details to be moved'
324
+ # puts 'add tool preview , and maybe allow tool details to be moved'
325
+ # wait 2 do
326
+ # apply_tool(:rotate, grab(c2.id), )
327
+ #
328
+ # end
@@ -9,43 +9,31 @@ t.touch(:down) do |event|
9
9
  puts event[:pageX]
10
10
  puts event[:pageY]
11
11
  b.touch({ remove: :down })
12
- # b.touch({remove: :up})
13
- # b.touch({remove: :long})
14
- # b.touch({remove: :double})
15
- # b.touch({remove: :tap})
16
- # b.touch({remove: :touch})
17
- # b.touch(false) to remove all touches bindings
18
- t.data('touch down killed')
12
+ t.data('down removed !! ')
19
13
  end
20
14
 
21
15
  touch_code = lambda do
22
16
  b.color(:red)
23
17
  puts 'box tapped'
24
- # b.instance_variable_set('@touch_code', nil)
25
18
  end
26
19
  b.touch(tap: true, code: touch_code)
27
20
 
28
21
  b.touch(:long) do
29
- # puts :long
30
- # t.data('type of touch is : long ')
31
- # b.color(:black)
32
22
  { color: :cyan }
23
+ t.data('type of touch is : long ')
33
24
  end
34
25
 
35
26
  b.touch(:up) do
36
- puts :up
37
27
  t.data('type of touch is : up ')
38
28
  b.color(:orange)
39
29
  end
40
30
 
41
31
  b.touch(:down) do
42
- puts :down
43
32
  t.data('type of touch is : down ')
44
33
  b.color(:white)
45
34
  end
46
35
 
47
36
  b.touch(:double) do
48
- puts :double
49
37
  t.color(:red)
50
38
  t.data('type of touch is : double ')
51
39
  b.color(:yellowgreen)
@@ -0,0 +1,165 @@
1
+ # frozen_string_literal: true
2
+
3
+ new ({particle: :trigger})
4
+
5
+ a=circle
6
+ a.trigger({record: true})
7
+
8
+
9
+ ### wad JS
10
+ bb=box({left: 333})
11
+ bb.text(:wadjs)
12
+
13
+
14
+
15
+ ## Midi test
16
+
17
+ js_midi_code = <<~JAVASCRIPT
18
+ async function startMidi() {
19
+ try {
20
+ await window.__TAURI__.invoke('start_midi');
21
+ console.log('MIDI listener started');
22
+ } catch (error) {
23
+ console.error('Failed to start MIDI listener', error);
24
+ }
25
+ }
26
+
27
+ function listenForMidiEvents() {
28
+ window.__TAURI__.event.listen('midi-event', event => {
29
+ console.log('MIDI Event found:', event.payload);
30
+ });
31
+ }
32
+
33
+ startMidi();
34
+ listenForMidiEvents();
35
+
36
+ JAVASCRIPT
37
+ if Atome::host == 'tauri'
38
+ JS.eval(js_midi_code)
39
+ end
40
+
41
+
42
+ # Initialize window.snare
43
+
44
+ init_code = "window.snare = new Wad({source : 'medias/audios/clap.wav'});"
45
+ JS.eval(init_code)
46
+
47
+ # Define the JavaScript playSnare function
48
+ js_code = <<~JAVASCRIPT
49
+ window.playSnare = function() {
50
+ window.snare.play();
51
+ // setTimeout(function() {
52
+ // window.snare.stop();
53
+ //}, 30);
54
+ }
55
+ JAVASCRIPT
56
+
57
+ # Evaluate the JavaScript code once
58
+ JS.eval(js_code)
59
+
60
+ # Define the Ruby method to call the JavaScript function
61
+ def play_snare
62
+ JS.eval('window.playSnare()')
63
+ end
64
+
65
+ # Attach the method to the touch event
66
+ bb.touch(:down) do
67
+ play_snare
68
+ end
69
+
70
+ synthesis_code = <<~JAVASCRIPT
71
+ const synth = window.speechSynthesis;
72
+ const utterance1 = new SpeechSynthesisUtterance("Bonjour, comment allez-vous ?");
73
+ utterance1.lang = 'fr-FR';
74
+ const utterance2 = new SpeechSynthesisUtterance("hello, how are you ?");
75
+ utterance2.lang = 'en-US';
76
+ synth.speak(utterance1);
77
+ synth.speak(utterance2);
78
+ const utterance3 = new SpeechSynthesisUtterance("Hola, ¿cómo estás?");
79
+ utterance3.lang = 'es-ES';
80
+ synth.speak(utterance3);
81
+ JAVASCRIPT
82
+
83
+ bcb=box({top: 90})
84
+
85
+ bcb.touch(true) do
86
+ JS.eval(synthesis_code)
87
+ end
88
+
89
+
90
+
91
+
92
+ ######
93
+ cbc=box({top: 90, left: 90})
94
+ text({data: :result, id: :result, top: 90, left: 190})
95
+
96
+ recogniction_code = <<~JAVASCRIPT
97
+ let recognition;
98
+ let recognitionTimeout;
99
+
100
+ if (!('webkitSpeechRecognition' in window)) {
101
+ alert('Votre navigateur ne supporte pas la Web Speech API.');
102
+ return;
103
+ }
104
+
105
+ recognition = new webkitSpeechRecognition();
106
+ recognition.lang = 'fr-FR'; // Langue française
107
+ recognition.interimResults = false; // Résultats intérimaires (partiels) désactivés
108
+ recognition.maxAlternatives = 1; // Nombre maximum d'alternatives
109
+
110
+ recognition.onstart = function() {
111
+ console.log('Reconnaissance vocale démarrée.');
112
+ };
113
+
114
+ recognition.onresult = function(event) {
115
+ console.log('Résultat obtenu.');
116
+ const result = event.results[0][0].transcript;
117
+ console.log('Vous avez dit : ' + result);
118
+ document.getElementById('result').innerText = result;
119
+ };
120
+
121
+ recognition.onerror = function(event) {
122
+ console.error('Erreur de reconnaissance vocale : ', event.error);
123
+ switch(event.error) {
124
+ case 'no-speech':
125
+ console.log('Aucune parole détectée.');
126
+ break;
127
+ case 'audio-capture':
128
+ console.log('Microphone non détecté.');
129
+ break;
130
+ case 'not-allowed':
131
+ console.log('Permission de microphone refusée.');
132
+ break;
133
+ default:
134
+ console.log('Erreur inconnue.');
135
+ break;
136
+ }
137
+ clearTimeout(recognitionTimeout); // Annule le timeout en cas d'erreur
138
+ };
139
+
140
+ recognition.onend = function() {
141
+ console.log('Reconnaissance vocale terminée.');
142
+ clearTimeout(recognitionTimeout); // Nettoyage du timeout à la fin de la reconnaissance
143
+ };
144
+
145
+ // Fonction pour démarrer la reconnaissance avec gestion des timeout
146
+ function startRecognition() {
147
+ try {
148
+ recognition.start();
149
+ console.log('Reconnaissance vocale démarrée.');
150
+ recognitionTimeout = setTimeout(() => {
151
+ console.log('Timeout atteint, arrêt de la reconnaissance.');
152
+ recognition.stop();
153
+ }, 10000); // Timeout de 10 secondes
154
+ } catch (e) {
155
+ console.error('Erreur lors du démarrage de la reconnaissance : ', e.message);
156
+ }
157
+ }
158
+
159
+ startRecognition();
160
+ JAVASCRIPT
161
+
162
+ cbc.touch(true) do
163
+ JS.eval(recogniction_code)
164
+
165
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ vr({width: 700,height: 390,path: 'medias/images/puydesancy.jpg', id: :tutu})