atome 0.5.7.3.5 → 0.5.7.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d7593f1e5f01474e9e5445f3af74ca576521aa07623acc289a2df9946d38447
4
- data.tar.gz: 157a8892017ec1c64a7193d261ae21c2c0361c8fef232ceeda18181a02e470b8
3
+ metadata.gz: bdac6b85c37bdf4d8e6842a2b423912931a8d33dd693aa03dd90d46a8c91e16f
4
+ data.tar.gz: d52b45f795e5c583a548a29a6d979ffc4fd6671907070c1b28f0234351a83131
5
5
  SHA512:
6
- metadata.gz: 49dff402a4d28eaf636d76574701b7739b4e33d961b1402936469facd548234c17c4d4e4733aecbea7c1a5e31d8089bbbdd5a8b4c2cf008d8c6b220af8be6f6a
7
- data.tar.gz: 0ab6747de306ebcd4d0e06974bc0f6ecdbad1eb59477c2b96aca7be4bfaaf5851bb507d5cdb04f8ea8e6fdf5196842b5c1d8bd083aafa07bcc53c8e882d68e88
6
+ metadata.gz: 276797c37915a64902cd3491ec29111aa17364e7aa87b7eeff16f3c7901428a9cd5f94117c459e5e9f11acfd7d39ccccbd5e8aea0baa8f96f57ec3f930710b8f
7
+ data.tar.gz: 88e5562ae2ad330ae11c895e905296c56498f09868c0b881242b17d2c268c9aadd915e35b804610d54a9f3d68c3c6091d21483e3aff52f21186496ba6825b6e5
@@ -84,7 +84,13 @@ end
84
84
  # atome extensions
85
85
  class Object
86
86
  include ObjectExtension
87
-
87
+ def flash(msg)
88
+ flash_box=box({width: 235, height: 112})
89
+ flash_box.text(msg)
90
+ flash_box.touch(true) do
91
+ flash_box.delete({ recursive: true })
92
+ end
93
+ end
88
94
  def reorder_particles(hash_to_reorder)
89
95
  # we reorder the hash
90
96
  ordered_keys = %i[renderers id alien type attach int8 unit]
data/lib/atome/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.7.3.5'
5
+ VERSION = '0.5.7.3.6'
6
6
  end
@@ -428,46 +428,127 @@ new(molecule: :matrix) do |params, &bloc|
428
428
  matrix_back
429
429
  end
430
430
 
431
- new(molecule: :page) do |params, &bloc|
432
- b = box({ color: :red, left: 99, drag: true })
433
- b.remove(:box_color)
434
- b.text(params)
431
+ new(molecule: :application) do |params, &bloc|
432
+ params ||= {}
433
+
434
+ color({ id: :app_color, red: 0.1, green: 0.3, blue: 0.1 })
435
+ # TODO : remove the patch below when possible
436
+ id_f = if params[:id]
437
+ params.delete(:id)
438
+ else
439
+ identity_generator
440
+ end
441
+ main_app = box({ id: id_f, width: :auto, height: :auto, top: 0, bottom: 0, left: 0, right: 0, apply: :app_color,
442
+ category: :application })
443
+ main_app.remove(:box_color)
444
+ main_app.instance_variable_set('@pages', {})
445
+ menu = params.delete(:menu)
446
+ main_app.box(menu.merge({ id: "#{id_f}_menu" })) if menu
447
+ params.each do |part_f, val_f|
448
+ main_app.send(part_f, val_f)
449
+ end
450
+ main_app
435
451
  end
436
452
 
437
- new(molecule: :application) do |params, &bloc|
453
+ new(molecule: :page) do |params, &bloc|
454
+ if params[:id]
455
+ id_f = params.delete(:id)
456
+ page_name=params.delete(:name)
457
+ @pages[id_f.to_sym] = params
458
+ else
459
+ puts "must send an id"
460
+ end
461
+ page_name= page_name || id_f
462
+ menu_f= grab("#{@id}_menu")
463
+ page_title=menu_f.text({ data: page_name })
464
+ page_title.touch(:down) do
465
+ show(id_f)
466
+ end
467
+
468
+ end
438
469
 
439
- main_page = box({ drag: true, width: :auto, height: :auto, top: 0, bottom: 0, left: 0, right: 0 })
470
+ new(molecule: :show) do |page_id, &bloc|
471
+ params = @pages[page_id.to_sym]
472
+ params ||= {}
473
+ footer = params.delete(:footer)
474
+ header = params.delete(:header)
475
+ left_side_bar = params.delete(:left_side_bar)
476
+ right_side_bar = params.delete(:right_side_bar)
477
+ # modules = params.delete(:modules)
478
+ basic_size = 30
479
+ attached.each do |page_id_found|
480
+ page_found = grab(page_id_found)
481
+ # puts "#{page_id_found} : #{page_found}"
482
+ page_found.delete({ recursive: true }) if page_found && page_found.category.include?(:page)
483
+ end
484
+ color({ id: :page_color, red: 0.1, green: 0.1, blue: 0.1 })
485
+ # TODO : remove the patch below when possible
486
+ id_f = if params[:id]
487
+ params.delete(:id)
488
+ else
489
+ "#{id_f}_#{identity_generator}"
490
+ end
491
+ main_page = box({ width: :auto, depth: -1, height: :auto, id: id_f, top: 0, bottom: 0, left: 0, right: 0, apply: :page_color, category: :page })
440
492
  main_page.remove(:box_color)
441
- main_page
442
493
 
443
- # def new(params, &bloc)
444
- # if params[:page]
445
- # site_found = grab(params[:page][:application])
446
- # site_found.clear(true)
447
- # page_id = params[:page][:name]
448
- # site_found.box({ id: page_id })
449
- # elsif params[:application]
450
- #
451
- # footer_header_size = 33
452
- # footer_header_color = color({ red: 0, green: 0, blue: 0, id: :footer_header_color })
453
- #
454
- # if params[:header]
455
- # top = footer_header_size
456
- # header = box({ left: 0, right: 0, width: :auto, top: 0, height: top, id: :header })
457
- # # header.attach(:footer_header_color)
458
- # else
459
- # top = 0
460
- # end
461
- # if params[:footer]
462
- # bottom = footer_header_size
463
- # box({ left: 0, right: 0, width: :auto, top: :auto, bottom: 0, height: bottom, id: :footer })
464
- # else
465
- # bottom = 0
466
- # end
467
- # box({ left: 0, right: 0, width: :auto, top: top, bottom: bottom, height: :auto, id: params[:application] })
468
- # elsif params[:module]
469
- #
470
- # end
471
- # super if defined?(super)
472
- # end
494
+ main_page.set(params)
495
+
496
+ if footer
497
+ new_footer = box({ left: 0, depth: -1, right: 0, width: :auto, top: :auto, bottom: 0, height: basic_size, category: :footer, id: "#{id_f}_footer" })
498
+ new_footer.remove(:box_color)
499
+ new_footer.set(footer)
500
+ end
501
+
502
+ if header
503
+ new_header = box({ left: 0, right: 0, depth: -1, width: :auto, top: 0, height: basic_size, category: :header, id: "#{id_f}_header" })
504
+ new_header.remove(:box_color)
505
+ new_header.set(header)
506
+ end
507
+
508
+ if right_side_bar
509
+ new_right_side_bar = box({ left: :auto, depth: -1, right: 0, width: basic_size, top: 0, bottom: 0, height: :auto, category: :right_side_bar, id: "#{id_f}_right_side_bar" })
510
+ new_right_side_bar.remove(:box_color)
511
+ new_right_side_bar.set(right_side_bar)
512
+ end
513
+
514
+ if left_side_bar
515
+ new_left_side_bar = box({ left: 0, right: :auto, depth: -1, width: basic_size, top: 0, bottom: 0, height: :auto, category: :left_side_bar, id: "#{id_f}_left_side_bar" })
516
+ new_left_side_bar.remove(:box_color)
517
+ new_left_side_bar.set(left_side_bar)
518
+ end
519
+
520
+ attached.each do |item_id_found|
521
+ item_found = grab(item_id_found)
522
+ if item_found&.category&.include?(:footer)
523
+ main_page.height(:auto)
524
+ main_page.bottom(item_found.height)
525
+ end
526
+ if item_found&.category&.include?(:header)
527
+ main_page.height(:auto)
528
+ main_page.top(item_found.height)
529
+ end
530
+
531
+ if item_found&.category&.include?(:right_side_bar)
532
+ main_page.width(:auto)
533
+ main_page.left(item_found.width)
534
+ if footer
535
+ grab("#{id_f}_footer").right(basic_size)
536
+ end
537
+ if header
538
+ grab("#{id_f}_header").right(basic_size)
539
+ end
540
+ end
541
+
542
+ if item_found&.category&.include?(:left_side_bar)
543
+ main_page.width(:auto)
544
+ main_page.right(item_found.width)
545
+ if footer
546
+ grab("#{id_f}_footer").left(basic_size)
547
+ end
548
+ if header
549
+ grab("#{id_f}_header").left(basic_size)
550
+ end
551
+ end
552
+ end
553
+ main_page
473
554
  end
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ a = application({
5
+ id: :arp,
6
+ margin: 3,
7
+ # circle: { id: :test, color: :red },
8
+ menu: { width: 220, height: 33, depth: 333, color: :black },
9
+ })
10
+
11
+ page1_code = lambda do |back|
12
+ alert :kooly
13
+ end
14
+
15
+ verif = lambda do
16
+ b = box({ id: :ty, left: 90, top: 90 })
17
+ b.touch(true) do
18
+ alert grab(:mod_1).touch
19
+ end
20
+
21
+ # a=grab('page2').circle({id: :heu, color: :black})
22
+ # a.color(:red)
23
+ # alert 'ok'
24
+ end
25
+
26
+ page1 = {
27
+ id: :page1,
28
+ color: :cyan,
29
+ name: :accueil,
30
+ footer: { color: :green, height: 22 },
31
+ header: { color: :yellow },
32
+ left_side_bar: { color: :yellowgreen },
33
+ right_side_bar: { color: :blue },
34
+ # box: { id: :mod_1, touch: {tap: true, code: page1_code} }
35
+ }
36
+
37
+ color({ id: :titi, red: 1 })
38
+ page2 = { id: :page2,
39
+ color: :white,
40
+ # apply: :titi,
41
+ run: verif,
42
+ # drag: true,
43
+ box: { id: :mod_1, left: 333, top: 123, touch: { down: true, code: page1_code } }
44
+
45
+ }
46
+
47
+ page3 = { id: :page3,
48
+ color: :red,
49
+ # run: verif,
50
+ # box: { id: :mod_1,left: 333, touch: {tap: :down, code: page1_code} }
51
+ }
52
+
53
+ page0 = { id: :page0,
54
+ color: :purple,
55
+
56
+ }
57
+ a.page(page1)
58
+ a.page(page2)
59
+ a.page(page3)
60
+ # wait 1 do
61
+ # a.page(page2)
62
+ # wait 1 do
63
+ # a.page(page1)
64
+ # puts 'second load'
65
+ # wait 5 do
66
+ # a.page(page3)
67
+ # wait 5 do
68
+ # a.page(page2)
69
+ # puts 'third load'
70
+ # end
71
+ # end
72
+ # end
73
+ # end
74
+ # c=grab(:page1).circle({left: 99})
75
+ # c.touch(true) do
76
+ # alert grab(:mod_1).inspect
77
+ # end
78
+
79
+ # wait 1 do
80
+ # a.page(page2)
81
+ # end
82
+ # wait 2 do
83
+ # a.page(page1)
84
+ # end
85
+ #
86
+ # wait 3 do
87
+ # a.page(page2)
88
+ # end
89
+ #
90
+ # # wait 5 do
91
+ # # a.page(page0)
92
+ # # end
93
+ # #
94
+ # # wait 6 do
95
+ # # a.page(page1)
96
+ # # end
97
+
98
+ # wait 4 do
99
+ # cc=box
100
+ # cc.touch(true) do
101
+ # alert grab(:heu).inspect
102
+ # end
103
+ # end
104
+
105
+ # a=lambda do |_val|
106
+ # grab(:testing).color(:red)
107
+ # wait 1 do
108
+ # grab(:testing).delete({recursive: true})
109
+ # end
110
+ # end
111
+ #
112
+ # c=circle
113
+ # c.touch(true) do
114
+ # b=box({id: :testing, left: 99})
115
+ # b.touch({ tap: true , code: a})
116
+ # end
117
+ # wait 1 do
118
+ a.show(:page1)
119
+ # # alert :kool
120
+ # end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
3
  ######## check
5
4
 
6
5
  # Relaunch all tasks
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.7.3.5
4
+ version: 0.5.7.3.6
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: 2024-06-10 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -536,6 +536,7 @@ files:
536
536
  - vendor/assets/application/examples/allow_system_right_click.rb
537
537
  - vendor/assets/application/examples/alternate.rb
538
538
  - vendor/assets/application/examples/animation.rb
539
+ - vendor/assets/application/examples/applications.rb
539
540
  - vendor/assets/application/examples/apply.rb
540
541
  - vendor/assets/application/examples/atome.rb
541
542
  - vendor/assets/application/examples/atome_particle_validation.rb