atome 0.5.3.8.1 → 0.5.3.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +3 -3
  3. data/lib/atome/atome.rb +49 -46
  4. data/lib/atome/extensions/atome.rb +2 -2
  5. data/lib/atome/extensions/matrix.rb +27 -16
  6. data/lib/atome/genesis/generators/atome.rb +128 -85
  7. data/lib/atome/genesis/generators/identity.rb +82 -51
  8. data/lib/atome/genesis/generators/spatial.rb +8 -8
  9. data/lib/atome/genesis/generators/utility.rb +26 -17
  10. data/lib/atome/genesis/genesis.rb +7 -4
  11. data/lib/atome/genesis/sparkle.rb +6 -6
  12. data/lib/atome/helpers/essentials.rb +21 -18
  13. data/lib/atome/helpers/sanitizer.rb +10 -10
  14. data/lib/atome/helpers/utilities.rb +81 -29
  15. data/lib/atome/kernel/batch.rb +0 -1
  16. data/lib/atome/kernel/universe.rb +1 -1
  17. data/lib/atome/presets/atome.rb +22 -23
  18. data/lib/atome/renderers/browser/atome.rb +2 -1
  19. data/lib/atome/renderers/browser/helpers/browser_helper.rb +17 -0
  20. data/lib/atome/renderers/browser/helpers/text_helper.rb +10 -2
  21. data/lib/atome/renderers/browser/identity.rb +23 -5
  22. data/lib/atome/renderers/browser/utility.rb +5 -4
  23. data/lib/atome/renderers/renderer.rb +1 -0
  24. data/lib/atome/version.rb +1 -1
  25. data/sig/atome.rbs +20 -0
  26. data/sig/essentials.rbs +11 -0
  27. data/vendor/assets/src/medias/images/icons/email.svg +12 -12
  28. data/vendor/assets/src/medias/rubies/examples/add.rb +2 -3
  29. data/vendor/assets/src/medias/rubies/examples/animation.rb +2 -2
  30. data/vendor/assets/src/medias/rubies/examples/atome_new.rb +18 -6
  31. data/vendor/assets/src/medias/rubies/examples/{parents.rb → attach.rb} +6 -6
  32. data/vendor/assets/src/medias/rubies/examples/attached.rb +4 -4
  33. data/vendor/assets/src/medias/rubies/examples/box.rb +1 -1
  34. data/vendor/assets/src/medias/rubies/examples/code.rb +1 -1
  35. data/vendor/assets/src/medias/rubies/examples/color.rb +20 -4
  36. data/vendor/assets/src/medias/rubies/examples/delete.rb +2 -2
  37. data/vendor/assets/src/medias/rubies/examples/drag.rb +1 -1
  38. data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +1 -1
  39. data/vendor/assets/src/medias/rubies/examples/image.rb +2 -2
  40. data/vendor/assets/src/medias/rubies/examples/link.rb +7 -5
  41. data/vendor/assets/src/medias/rubies/examples/markers.rb +1 -1
  42. data/vendor/assets/src/medias/rubies/examples/materials.rb +15 -0
  43. data/vendor/assets/src/medias/rubies/examples/monitoring.rb +44 -18
  44. data/vendor/assets/src/medias/rubies/examples/read.rb +2 -2
  45. data/vendor/assets/src/medias/rubies/examples/shadow.rb +1 -1
  46. data/vendor/assets/src/medias/rubies/examples/table.rb +2 -2
  47. data/vendor/assets/src/medias/rubies/examples/text.rb +4 -4
  48. data/vendor/assets/src/medias/rubies/examples/time.rb +1 -1
  49. data/vendor/assets/src/medias/rubies/examples/web.rb +2 -2
  50. metadata +7 -5
  51. /data/vendor/assets/src/medias/rubies/examples/{matrix.rb → _matrix.rb} +0 -0
@@ -1,26 +1,45 @@
1
1
  # frozen_string_literal: true
2
+ bb=text({data: :hello })
3
+ #
4
+ bb.touch(true) do
5
+ bb.left(333)
6
+ end
7
+
8
+ # alert grab(:view).attached
9
+ bb.monitor({ atomes: grab(:view).attached, particles: [:left] }) do |_atome, _element, value|
10
+ puts "the left value of #{id} was change to : #{value}"
11
+ end
2
12
 
3
13
  a = text({ data: "open the console!" })
4
14
  a.right(44).left(66)
5
-
6
- b = Atome.new(shape: { type: :shape, id: :my_shape, children: [], parents: [:view], renderers: [:browser],
7
- left: 0, right: 33
15
+ color({red: 1, id: :the_red_col})
16
+ b = Atome.new(shape: { type: :shape, id: :my_shape, attach: [:view], renderers: [:browser],
17
+ left: 0, right: 33, attached: :the_red_col, width: 33, height: 33
8
18
  })
9
19
 
10
- c = Atome.new(shape: { type: :shape, id: :my_pix, children: [], parents: [:view], renderers: [:browser],
11
- left: 50, right: 78
20
+ c = Atome.new(shape: { type: :shape, id: :my_pix, attach: [:view], renderers: [:browser],
21
+ left: 50, right: 78, attached: :the_red_col, width: 33, height: 33
12
22
  })
13
23
 
14
- a.monitor({ atomes: grab(:view).children, particles: [:left] }) do |atome, element, value|
15
- puts "monitoring: #{atome.id}, #{element}, #{value}"
16
- end
24
+
25
+
17
26
 
18
27
  b.left(936)
19
- b.left(777)
20
- c.left(888)
28
+ wait 0.5 do
29
+ b.left(777)
30
+ wait 0.5 do
31
+ c.left(888)
32
+ end
33
+ end
34
+
35
+ puts a.monitor
21
36
 
22
37
  # test 2
23
38
  aa = text({ data: 'touch me and look in the console', top: 99, width: 399, left: 120 })
39
+
40
+
41
+ bb=box({ id: :the_boxy })
42
+
24
43
  aa.touch(true) do
25
44
  aa.color(:red)
26
45
  aa.left(333)
@@ -28,17 +47,24 @@ aa.touch(true) do
28
47
  aa.right(4)
29
48
  aa.height(199)
30
49
  end
50
+ bb.drag(true)
51
+ bb.monitor({ atomes: grab(:view).attached, particles: [:left] }) do |_atome, _element, value|
52
+ puts "the left value of #{id} was change to : #{value}"
53
+ end
31
54
 
32
- aa.box({ id: :theboxy })
33
-
34
- aa.monitor({ atomes: grab(:view).children, particles: [:left] }) do |_atome, _element, value|
35
- puts "the left value was change to : #{value}"
55
+ bb.monitor({ atomes: grab(:view).attached, particles: [:top] }) do |_atome, _element, value|
56
+ puts "the top value of #{id} was change to : #{value}"
36
57
  end
37
58
 
38
- aa.monitor({ atomes: grab(:view).children, particles: [:width] }) do |_atome, _element, value|
39
- puts "the width's value was change to : #{value}"
59
+ bb.monitor({ atomes: grab(:view).attached, particles: [:width] }) do |_atome, _element, value|
60
+ puts "the width's value of #{id} was change to : #{value}"
40
61
  end
41
62
 
42
- aa.monitor({ atomes: grab(:view).children, particles: [:left], id: :my_monitorer }) do |_atome, _element, value|
43
- puts "the second monitor left value was log to : #{value}"
63
+ bb.monitor({ atomes: grab(:view).attached, particles: [:left], id: :my_monitorer }) do |_atome, _element, value|
64
+ puts "the second monitor left value of #{id} was log to : #{value}"
44
65
  end
66
+ # puts aa.monitor
67
+ bb.top(66)
68
+ a.monitor({ atomes: grab(:view).attached, particles: [:left] }) do |atome, element, value|
69
+ puts "monitoring #{id} : #{atome.id}, #{element}, #{value}"
70
+ end
@@ -4,8 +4,8 @@ puts "Attention this method only work with a server due to security restriction
4
4
  a=box
5
5
  text("touch the box to read the file")
6
6
  a.touch(true) do
7
- a.read('rubies/examples/image.rb') do |params|
8
- text({data: params, visual:{size: 9}})
7
+ a.read('texts/lorem.txt') do |params|
8
+ text({data: params, visual:{size: 16}})
9
9
  end
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ b = box({ id: :the_box, left: 99, top: 99 })
5
5
 
6
6
 
7
7
 
8
- s = b.shadow({ renderers: [:browser], id: :shadow2, type: :shadow, parents: [], children: [],
8
+ s = b.shadow({ renderers: [:browser], id: :shadow2, type: :shadow, parents: [],
9
9
  left: 3, top: 9, blur: 3, direction: :inset,
10
10
  red: 0, green: 0, blue: 0, alpha: 1
11
11
  })
@@ -96,8 +96,8 @@ m.last(:rows) do |el|
96
96
  el.color(:violet)
97
97
  end
98
98
  m.divide( rows: {1 => 3})
99
- m.cell(9).box({left: 0, top: 0, id: :poireau, width: 66, height: 66})
100
- m.cell(9).content([box({ left: 0, top: 0, id: :poireau, width: 66, height: 66 })])
99
+ m.cell(9).box({left: 0, top: 0, id: :the_big_one, width: 66, height: 66})
100
+ m.cell(9).content([box({ left: 0, top: 0, id: :another_one, width: 66, height: 66 })])
101
101
  # puts m.cell(9).content
102
102
  m.relations({ relation_1: {
103
103
  # start: {cell_id => out_nb},
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  my_text = Atome.new(
4
- text: { renderers: [:browser], id: :text1, type: :text, parents: [:view], children: [], visual: { size: 33 },
4
+ text: { renderers: [:browser], id: :text1, type: :text, parents: [:view], visual: { size: 33 },
5
5
  data: 'My first text!', left: 120, top: 33, width: 199, height: 33,
6
6
 
7
7
  }
8
8
  )
9
9
 
10
- Atome.new(color: { renderers: [:browser], id: :c31, type: :color, parents: [:text1], children: [],
10
+ Atome.new(color: { renderers: [:browser], id: :c31, type: :color, parents: [:text1],
11
11
  red: 0.6, green: 0.6, blue: 0.6, alpha: 1 })
12
12
 
13
13
  wait 1 do
@@ -17,7 +17,7 @@ end
17
17
  text({ id: :the_text, left: 0 })
18
18
 
19
19
  text2=Atome.new(
20
- text: { renderers: [:browser], id: :text2, type: :text, parents: [:view], children: [], visual: { size: 33 },
20
+ text: { renderers: [:browser], id: :text2, type: :text, parents: [:view], visual: { size: 33 },
21
21
  data: 'My second text!', left: 333, top: 33, width: 199, height: 33,
22
22
 
23
23
  }
@@ -25,7 +25,7 @@ text2=Atome.new(
25
25
 
26
26
 
27
27
 
28
- Atome.new(color: { renderers: [:browser], id: :c33, type: :color, parents: [:text2], children: [],
28
+ Atome.new(color: { renderers: [:browser], id: :c33, type: :color, parents: [:text2],
29
29
  red: 0.6, green: 0.6, blue: 0.1, alpha: 1 })
30
30
  wait 2 do
31
31
  text2.data(:ok)
@@ -2,7 +2,7 @@
2
2
 
3
3
  my_video = Atome.new(
4
4
  video: { renderers: [:browser], id: :video1, type: :video, parents: [:view],
5
- time: 33, path: './medias/videos/avengers.mp4', left: 333, top: 33, width: 777
5
+ time: 33, path: './medias/videos/avengers.mp4', left: 69, top: 33, width: 777
6
6
  }
7
7
  ) do |params|
8
8
  puts "video callback here #{params}"
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Atome.new(
4
- image: { renderers: [:browser], id: :image1, type: :image, parents: [:view], path: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg", left: 99, top: 320, width: 199, height: 199,
4
+ image: { renderers: [:browser], id: :image1, type: :image, attach: [:view], path: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg", left: 99, top: 320, width: 199, height: 199,
5
5
  }
6
6
  )
7
7
 
8
8
  Atome.new(
9
- web: { renderers: [:browser], id: :youtube1, type: :web, parents: [:view], path: "https://www.youtube.com/embed/usQDazZKWAk", left: 33, top: 33, width: 199, height: 199,
9
+ web: { renderers: [:browser], id: :youtube1, type: :web, attach: [:view], path: "https://www.youtube.com/embed/usQDazZKWAk", left: 33, top: 33, width: 199, height: 199,
10
10
  }
11
11
  )
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3.8.1
4
+ version: 0.5.3.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Eric Godard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-16 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arduino_firmata
@@ -480,6 +480,7 @@ files:
480
480
  - lib/atome/version.rb
481
481
  - sig/atome.rbs
482
482
  - sig/atome_js.rbs
483
+ - sig/essentials.rbs
483
484
  - sig/genesis.rbs
484
485
  - vendor/assets/Guardfile
485
486
  - vendor/assets/Rakefile
@@ -598,6 +599,7 @@ files:
598
599
  - vendor/assets/src/medias/rubies/examples/_attach.rb
599
600
  - vendor/assets/src/medias/rubies/examples/_audio.rb
600
601
  - vendor/assets/src/medias/rubies/examples/_dataset.rb
602
+ - vendor/assets/src/medias/rubies/examples/_matrix.rb
601
603
  - vendor/assets/src/medias/rubies/examples/_os.rb
602
604
  - vendor/assets/src/medias/rubies/examples/_table2.rb
603
605
  - vendor/assets/src/medias/rubies/examples/_test.rb
@@ -605,6 +607,7 @@ files:
605
607
  - vendor/assets/src/medias/rubies/examples/add.rb
606
608
  - vendor/assets/src/medias/rubies/examples/animation.rb
607
609
  - vendor/assets/src/medias/rubies/examples/atome_new.rb
610
+ - vendor/assets/src/medias/rubies/examples/attach.rb
608
611
  - vendor/assets/src/medias/rubies/examples/attached.rb
609
612
  - vendor/assets/src/medias/rubies/examples/auto_height.rb
610
613
  - vendor/assets/src/medias/rubies/examples/auto_width.rb
@@ -637,13 +640,12 @@ files:
637
640
  - vendor/assets/src/medias/rubies/examples/left.rb
638
641
  - vendor/assets/src/medias/rubies/examples/link.rb
639
642
  - vendor/assets/src/medias/rubies/examples/markers.rb
640
- - vendor/assets/src/medias/rubies/examples/matrix.rb
643
+ - vendor/assets/src/medias/rubies/examples/materials.rb
641
644
  - vendor/assets/src/medias/rubies/examples/monitoring.rb
642
645
  - vendor/assets/src/medias/rubies/examples/mute.rb
643
646
  - vendor/assets/src/medias/rubies/examples/on.rb
644
647
  - vendor/assets/src/medias/rubies/examples/opacity.rb
645
648
  - vendor/assets/src/medias/rubies/examples/over.rb
646
- - vendor/assets/src/medias/rubies/examples/parents.rb
647
649
  - vendor/assets/src/medias/rubies/examples/pause.rb
648
650
  - vendor/assets/src/medias/rubies/examples/play.rb
649
651
  - vendor/assets/src/medias/rubies/examples/read.rb
@@ -698,7 +700,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
698
700
  - !ruby/object:Gem::Version
699
701
  version: '0'
700
702
  requirements: []
701
- rubygems_version: 3.4.1
703
+ rubygems_version: 3.4.8
702
704
  signing_key:
703
705
  specification_version: 4
704
706
  summary: the creative framework