glib-web 6.5.1 → 6.7.0

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: 530b28412dbe8757ccb9cf80e746d3d9891f8d403ee013a2c505a4bc6681b8ac
4
- data.tar.gz: 6754295e8de270915d25603a432197b7e50d372d6c4a227f6bd581b0ede0cb65
3
+ metadata.gz: c367b3b3e866dd9b73204e7d0cfe4b84e6148283b683c83068a52140c91ae987
4
+ data.tar.gz: a375dce696ed47b95d76e1f45091b004bb2c3aeafba70ebe0a31f0db37401d5a
5
5
  SHA512:
6
- metadata.gz: 54a71bbd3cfb00f390dd5908e356db7bcb5f4576e66c3bef6be29e05841bd7a7c4e014344cab7784c9e0dec549ed4e83b46e77b214b5545d55b31e70ac26dd18
7
- data.tar.gz: 47975dd0401a0b59cf404aa8bcaba12b9560bd0760fe4aa428c3516d10555749b21eea7ae71fdab38cb7516929cd0cde518099f9b4eeae35ab50eeccdcfb40d5
6
+ metadata.gz: 1dda92d5d21302e9b4064305b9732bcf39fed88a6e904873ba2d4ccb1cfb7dcfec00e88b3792a91574c26b37212d02fd0ce3a1d4e0a7efdd5556effa366d0ddf
7
+ data.tar.gz: b5abf3dccb58e18a81da0885fd6c7781da4906f9e329d767359c53a14352b20314506f42e6c2eb5742e483ef48a7cbaeebed43d4793d6de828cde8037080b474
@@ -3,5 +3,11 @@ class Glib::JsonUi::ViewBuilder
3
3
  class Video < View
4
4
  url :url
5
5
  end
6
+
7
+ class Docx < View
8
+ url :url
9
+ string :loadingText
10
+ string :errorText
11
+ end
6
12
  end
7
13
  end
@@ -73,6 +73,7 @@ nav_groups = {
73
73
  'calendar',
74
74
  'charts',
75
75
  'image',
76
+ 'multimedia_docx',
76
77
  'multimedia_video',
77
78
  'progressCircle',
78
79
  'switch'
@@ -0,0 +1,107 @@
1
+ json.title 'Test Page (Multimedia Docx)'
2
+
3
+ page = json_ui_page json
4
+
5
+ render 'json_ui/garage/test_page/header', json: json, page: page
6
+
7
+ sample_url = "#{request.base_url}/sample.docx"
8
+ # A second URL lets the actions/events section verify the viewer re-renders
9
+ # when `url` changes without remounting.
10
+ alt_url = "#{request.base_url}/sample.docx?variant=alt"
11
+ missing_url = "#{request.base_url}/does-not-exist.docx"
12
+
13
+ page.body(
14
+ childViews: ->(body) do
15
+
16
+ body.panels_responsive(
17
+ padding: glib_json_padding_body,
18
+ childViews: ->(res) do
19
+ res.h2 text: 'Overview'
20
+ res.p text: 'Multimedia docx renders a .docx document client-side via docx-preview. ' \
21
+ 'NOTE: it fetches the raw file to the browser, so it is NOT a view-only guarantee.'
22
+ res.spacer height: 12
23
+ res.hr width: 'matchParent'
24
+ res.spacer height: 12
25
+
26
+ res.h2 text: 'Basic example'
27
+ res.spacer height: 8
28
+ res.multimedia_docx(
29
+ id: 'multimedia_docx_main',
30
+ width: 'matchParent',
31
+ url: sample_url
32
+ )
33
+
34
+ res.spacer height: 12
35
+ res.hr width: 'matchParent'
36
+ res.spacer height: 12
37
+
38
+ res.h2 text: 'Actions and events'
39
+ res.label text: 'Swap the source URL to confirm the viewer re-renders in place.'
40
+ res.spacer height: 8
41
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
42
+ flow.button(
43
+ text: 'Sample',
44
+ onClick: ->(action) do
45
+ action.components_set(
46
+ targetId: 'multimedia_docx_main',
47
+ data: { url: sample_url }
48
+ )
49
+ end
50
+ )
51
+ flow.spacer width: 6
52
+ flow.button(
53
+ text: 'Reload same',
54
+ onClick: ->(action) do
55
+ action.components_set(
56
+ targetId: 'multimedia_docx_main',
57
+ data: { url: alt_url }
58
+ )
59
+ end
60
+ )
61
+ end
62
+
63
+ res.spacer height: 12
64
+ res.hr width: 'matchParent'
65
+ res.spacer height: 12
66
+
67
+ res.h2 text: 'Edge and advanced'
68
+ res.label text: 'A missing URL falls back to the error message.'
69
+ res.spacer height: 8
70
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
71
+ flow.button(
72
+ text: 'No URL',
73
+ onClick: ->(action) do
74
+ action.components_set(
75
+ targetId: 'multimedia_docx_main',
76
+ data: { url: nil }
77
+ )
78
+ end
79
+ )
80
+ flow.spacer width: 6
81
+ flow.button(
82
+ text: 'Broken URL',
83
+ onClick: ->(action) do
84
+ action.components_set(
85
+ targetId: 'multimedia_docx_main',
86
+ data: { url: missing_url }
87
+ )
88
+ end
89
+ )
90
+ flow.spacer width: 6
91
+ flow.button(
92
+ text: 'Custom messages',
93
+ onClick: ->(action) do
94
+ action.components_set(
95
+ targetId: 'multimedia_docx_main',
96
+ data: {
97
+ url: missing_url,
98
+ errorText: 'This document could not be loaded.'
99
+ }
100
+ )
101
+ end
102
+ )
103
+ end
104
+ end
105
+ )
106
+ end
107
+ )
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.5.1
4
+ version: 6.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-08-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activestorage
@@ -178,7 +177,6 @@ dependencies:
178
177
  - - ">="
179
178
  - !ruby/object:Gem::Version
180
179
  version: '0'
181
- description:
182
180
  email: ''
183
181
  executables: []
184
182
  extensions: []
@@ -473,6 +471,7 @@ files:
473
471
  - app/views/json_ui/garage/test_page/logics_run.json.jbuilder
474
472
  - app/views/json_ui/garage/test_page/logics_run_multi_form.json.jbuilder
475
473
  - app/views/json_ui/garage/test_page/logics_set.json.jbuilder
474
+ - app/views/json_ui/garage/test_page/multimedia_docx.json.jbuilder
476
475
  - app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder
477
476
  - app/views/json_ui/garage/test_page/pagination.json.jbuilder
478
477
  - app/views/json_ui/garage/test_page/panels.json.jbuilder
@@ -576,10 +575,8 @@ files:
576
575
  - lib/glib/time_returning_mailer.rb
577
576
  - lib/glib/value.rb
578
577
  - lib/tasks/db.rake
579
- homepage:
580
578
  licenses: []
581
579
  metadata: {}
582
- post_install_message:
583
580
  rdoc_options: []
584
581
  require_paths:
585
582
  - lib
@@ -594,8 +591,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
594
591
  - !ruby/object:Gem::Version
595
592
  version: '0'
596
593
  requirements: []
597
- rubygems_version: 3.4.6
598
- signing_key:
594
+ rubygems_version: 4.0.6
599
595
  specification_version: 4
600
596
  summary: ''
601
597
  test_files: []