glib-web 8.2.0 → 8.2.2

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/glib/glib_direct_uploads_controller.rb +6 -2
  3. data/app/helpers/glib/format_helper.rb +8 -12
  4. data/app/helpers/glib/json_ui/abstract_builder.rb +44 -47
  5. data/app/helpers/glib/json_ui/action_builder/popovers.rb +1 -1
  6. data/app/helpers/glib/json_ui/hash_schema.rb +182 -0
  7. data/app/helpers/glib/json_ui/list_builders.rb +2 -2
  8. data/app/helpers/glib/json_ui/menu_builder.rb +8 -3
  9. data/app/helpers/glib/json_ui/view_builder/charts.rb +14 -2
  10. data/app/helpers/glib/json_ui/view_builder/fields.rb +66 -17
  11. data/app/helpers/glib/json_ui/view_builder/panels.rb +17 -11
  12. data/app/helpers/glib/json_ui/view_builder.rb +26 -6
  13. data/app/models/glib/markdown.rb +172 -0
  14. data/app/views/json_ui/garage/actions/sheet_content.json.jbuilder +1 -1
  15. data/app/views/json_ui/garage/forms/_action_text_conversion.json.jbuilder +12 -0
  16. data/app/views/json_ui/garage/forms/action_text.json.jbuilder +23 -0
  17. data/app/views/json_ui/garage/forms/action_text_conversion.json.jbuilder +5 -0
  18. data/app/views/json_ui/garage/forms/action_text_mentions.json.jbuilder +4 -0
  19. data/app/views/json_ui/garage/forms/dialogs_form.json.jbuilder +10 -10
  20. data/app/views/json_ui/garage/forms/dirty_prompt.json.jbuilder +1 -1
  21. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +1 -1
  22. data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +1 -1
  23. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +1 -1
  24. data/app/views/json_ui/garage/test_page/charts.json.jbuilder +4 -2
  25. data/app/views/json_ui/garage/test_page/fields_actionText.json.jbuilder +104 -1
  26. data/app/views/json_ui/garage/test_page/fields_richText.json.jbuilder +45 -1
  27. data/app/views/json_ui/garage/test_page/form_dirty_fields.json.jbuilder +1 -1
  28. data/app/views/json_ui/garage/test_page/form_hidden_panels.json.jbuilder +3 -22
  29. data/app/views/json_ui/garage/views/charts.json.jbuilder +4 -2
  30. data/lib/glib/all_helpers.rb +1 -0
  31. metadata +22 -8
@@ -12,7 +12,7 @@ page.body(
12
12
  childViews: ->(res) do
13
13
  res.h2 text: 'Fields RichText'
14
14
  res.spacer height: 8
15
- res.label text: 'WYSIWYG editor with markdown or HTML output, mentions, and image uploads.'
15
+ res.label text: 'Deprecated: use fields_actionText (see doc/rich_text_migration.md). WYSIWYG editor with markdown or HTML output, mentions, and image uploads.'
16
16
  res.spacer height: 12
17
17
 
18
18
  res.panels_form(
@@ -208,6 +208,50 @@ Try @mentioning a teammate here.
208
208
  )
209
209
  end
210
210
  )
211
+
212
+ res.spacer height: 12
213
+ res.hr width: 'matchParent'
214
+ res.spacer height: 12
215
+
216
+ # An editor replaced in place by new content at the same position: the replacement's
217
+ # value must show, not the old value or old typing. A form of its own, so its dirty
218
+ # state is observable: `swap_ever_dirty` never resets, so a transient blip shows too.
219
+ res.h2 text: 'Replaced in place'
220
+ res.spacer height: 8
221
+ res.label id: 'swap_dirty_state', text: 'Form: pristine'
222
+ res.label id: 'swap_ever_dirty', text: 'Ever dirty: no'
223
+ res.spacer height: 8
224
+ res.panels_form(
225
+ url: json_ui_garage_url(path: 'forms/generic_post'),
226
+ method: 'post',
227
+ onDirty: ->(action) do
228
+ action.runMultiple childActions: ->(multiple) do
229
+ multiple.logics_set targetId: 'swap_dirty_state', data: { text: 'Form: dirty' }
230
+ multiple.logics_set targetId: 'swap_ever_dirty', data: { text: 'Ever dirty: yes' }
231
+ end
232
+ end,
233
+ onPristine: ->(action) do
234
+ action.logics_set targetId: 'swap_dirty_state', data: { text: 'Form: pristine' }
235
+ end,
236
+ childViews: ->(form) do
237
+ form.panels_vertical width: 'matchParent', id: 'rich_text_swap_panel', childViews: ->(panel) do
238
+ panel.fields_richText width: 'matchParent', name: 'user[swap]', value: 'Before swap',
239
+ placeholder: 'Before placeholder', mentionList: ['Alice Before']
240
+ end
241
+ form.button text: 'Swap to new value', onClick: ->(action) do
242
+ action.components_replaceChildren targetId: 'rich_text_swap_panel', childViews: ->(panel) do
243
+ panel.fields_richText width: 'matchParent', name: 'user[swap]', value: 'After swap',
244
+ placeholder: 'After placeholder', mentionList: ['Bob After']
245
+ end
246
+ end
247
+ form.button text: 'Swap to same value', onClick: ->(action) do
248
+ action.components_replaceChildren targetId: 'rich_text_swap_panel', childViews: ->(panel) do
249
+ panel.fields_richText width: 'matchParent', name: 'user[swap]', value: 'Before swap',
250
+ placeholder: 'Before placeholder', mentionList: ['Alice Before']
251
+ end
252
+ end
253
+ end
254
+ )
211
255
  end
212
256
  )
213
257
  end
@@ -140,7 +140,7 @@ page.body childViews: ->(body) do
140
140
  multiProgressView: { files: [{ name: 'cover.png', signed_id: 'saved-cover', url: 'https://picsum.photos/id/12/100/60' }] }
141
141
  form.spacer height: 14
142
142
 
143
- form.fields_richText id: 'dirty_rich_text', name: 'user[bio]', width: 'matchParent', label: 'Bio', value: '<p>hello</p>'
143
+ form.fields_actionText id: 'dirty_rich_text', name: 'user[bio]', width: 'matchParent', label: 'Bio', value: '<div>hello</div>'
144
144
  form.spacer height: 14
145
145
 
146
146
  # Populated from the URL hash at mount; must be absorbed into the
@@ -52,12 +52,12 @@ page.body childViews: ->(body) do
52
52
 
53
53
  form.panels_vertical width: 'matchParent', id: 'hidden_panel_a', submitWhenNotDisplayed: true, childViews: ->(panel) do
54
54
  panel.label text: 'Panel A'
55
- panel.fields_richText id: 'hidden_text_a', width: 'matchParent', name: 'user[text_a]', value: 'Alpha start', submitWhenNotDisplayed: true
55
+ panel.fields_actionText id: 'hidden_text_a', width: 'matchParent', name: 'user[text_a]', value: '<div>Alpha start</div>', submitWhenNotDisplayed: true
56
56
  end
57
57
 
58
58
  form.panels_vertical width: 'matchParent', id: 'hidden_panel_b', displayed: false, submitWhenNotDisplayed: true, childViews: ->(panel) do
59
59
  panel.label text: 'Panel B'
60
- panel.fields_richText id: 'hidden_text_b', width: 'matchParent', name: 'user[text_b]', value: 'Bravo start', submitWhenNotDisplayed: true
60
+ panel.fields_actionText id: 'hidden_text_b', width: 'matchParent', name: 'user[text_b]', value: '<div>Bravo start</div>', submitWhenNotDisplayed: true
61
61
  panel.fields_upload \
62
62
  id: 'hidden_upload_b',
63
63
  name: 'user[file_b]',
@@ -71,7 +71,7 @@ page.body childViews: ->(body) do
71
71
 
72
72
  form.panels_vertical width: 'matchParent', id: 'hidden_panel_c', displayed: false, submitWhenNotDisplayed: true, childViews: ->(panel) do
73
73
  panel.label text: 'Panel C'
74
- panel.fields_richText id: 'hidden_text_c', width: 'matchParent', name: 'user[text_c]', value: 'Charlie start', submitWhenNotDisplayed: true
74
+ panel.fields_actionText id: 'hidden_text_c', width: 'matchParent', name: 'user[text_c]', value: '<div>Charlie start</div>', submitWhenNotDisplayed: true
75
75
  end
76
76
 
77
77
  form.spacer height: 12
@@ -98,25 +98,6 @@ page.body childViews: ->(body) do
98
98
  end
99
99
  form.spacer height: 12
100
100
 
101
- # An editor replaced in place by new content at the same position:
102
- # the replacement's value must show, not the old value or old typing.
103
- form.panels_vertical width: 'matchParent', id: 'hidden_swap_panel', childViews: ->(panel) do
104
- panel.fields_richText width: 'matchParent', name: 'user[swap]', value: 'Before swap',
105
- placeholder: 'Before placeholder', mentionList: ['Alice Before']
106
- end
107
- form.button text: 'Swap to new value', onClick: ->(action) do
108
- action.components_replaceChildren targetId: 'hidden_swap_panel', childViews: ->(panel) do
109
- panel.fields_richText width: 'matchParent', name: 'user[swap]', value: 'After swap',
110
- placeholder: 'After placeholder', mentionList: ['Bob After']
111
- end
112
- end
113
- form.button text: 'Swap to same value', onClick: ->(action) do
114
- action.components_replaceChildren targetId: 'hidden_swap_panel', childViews: ->(panel) do
115
- panel.fields_richText width: 'matchParent', name: 'user[swap]', value: 'Before swap',
116
- placeholder: 'Before placeholder', mentionList: ['Alice Before']
117
- end
118
- end
119
-
120
101
  form.spacer height: 20
121
102
  form.fields_submit text: 'Submit'
122
103
  end
@@ -1,6 +1,5 @@
1
1
  default_plugins = {
2
2
  datalabels: {
3
- backgroundColor: 'skyblue',
4
3
  borderRadius: 4,
5
4
  color: 'white',
6
5
  font: {
@@ -10,6 +9,9 @@ default_plugins = {
10
9
  }
11
10
  }
12
11
 
12
+ custom_plugins = default_plugins.deep_dup
13
+ custom_plugins[:datalabels][:backgroundColor] = ['#1E5006', '#E36414']
14
+
13
15
  if params[:data_only].present?
14
16
  json_ui_page json do |page|
15
17
  page.data content: ->(data) do
@@ -54,7 +56,7 @@ else
54
56
  json.points points.map { |k, v| { x: k, y: v, label: v > 5 ? 'Greater than five' : v } }
55
57
  end
56
58
  ],
57
- plugins: default_plugins,
59
+ plugins: custom_plugins,
58
60
  colors: ['#79AC78', '#3085C3'], legend: { display: false }, formatYAxis: true
59
61
 
60
62
  # scroll.spacer height: 20
@@ -4,6 +4,7 @@ module Glib
4
4
  base.helper Glib::UrlsHelper
5
5
  base.helper Glib::FormsHelper
6
6
  base.helper Glib::EnumHelper
7
+ base.helper Glib::FormatHelper
7
8
  base.helper Glib::DynamicTextsHelper
8
9
  base.helper Glib::DynamicImagesHelper
9
10
  base.helper Glib::AppFeatureSupportHelper
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: 8.2.0
4
+ version: 8.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-11-19 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
@@ -150,6 +149,20 @@ dependencies:
150
149
  - - ">="
151
150
  - !ruby/object:Gem::Version
152
151
  version: '0'
152
+ - !ruby/object:Gem::Dependency
153
+ name: reverse_markdown
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '3.1'
159
+ type: :runtime
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '3.1'
153
166
  - !ruby/object:Gem::Dependency
154
167
  name: ostruct
155
168
  requirement: !ruby/object:Gem::Requirement
@@ -206,7 +219,6 @@ dependencies:
206
219
  - - ">="
207
220
  - !ruby/object:Gem::Version
208
221
  version: '0'
209
- description:
210
222
  email: ''
211
223
  executables: []
212
224
  extensions: []
@@ -265,6 +277,7 @@ files:
265
277
  - app/helpers/glib/json_ui/default.rb
266
278
  - app/helpers/glib/json_ui/dynamic_field_builders.rb
267
279
  - app/helpers/glib/json_ui/generic_builders.rb
280
+ - app/helpers/glib/json_ui/hash_schema.rb
268
281
  - app/helpers/glib/json_ui/json_logic_lint.rb
269
282
  - app/helpers/glib/json_ui/list_builders.rb
270
283
  - app/helpers/glib/json_ui/menu_builder.rb
@@ -295,6 +308,7 @@ files:
295
308
  - app/models/glib/country_list.rb
296
309
  - app/models/glib/dummy_job_application.rb
297
310
  - app/models/glib/dynamic_text_record.rb
311
+ - app/models/glib/markdown.rb
298
312
  - app/models/glib/model.rb
299
313
  - app/models/glib/plain_model.rb
300
314
  - app/models/glib/scheduled_job_run.rb
@@ -332,6 +346,7 @@ files:
332
346
  - app/views/json_ui/garage/content/web_panel_a.html.erb
333
347
  - app/views/json_ui/garage/content/web_panel_b.html.erb
334
348
  - app/views/json_ui/garage/empty.json.jbuilder
349
+ - app/views/json_ui/garage/forms/_action_text_conversion.json.jbuilder
335
350
  - app/views/json_ui/garage/forms/_alert_post_all_data.json.jbuilder
336
351
  - app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder
337
352
  - app/views/json_ui/garage/forms/_basic_content.json.jbuilder
@@ -340,7 +355,9 @@ files:
340
355
  - app/views/json_ui/garage/forms/_read_more_text.json.jbuilder
341
356
  - app/views/json_ui/garage/forms/action_text.json.jbuilder
342
357
  - app/views/json_ui/garage/forms/action_text_attachment.json.jbuilder
358
+ - app/views/json_ui/garage/forms/action_text_conversion.json.jbuilder
343
359
  - app/views/json_ui/garage/forms/action_text_library.json.jbuilder
360
+ - app/views/json_ui/garage/forms/action_text_mentions.json.jbuilder
344
361
  - app/views/json_ui/garage/forms/action_text_preview.json.jbuilder
345
362
  - app/views/json_ui/garage/forms/basic.json.jbuilder
346
363
  - app/views/json_ui/garage/forms/basic_post.json.jbuilder
@@ -775,10 +792,8 @@ files:
775
792
  - lib/glib/time_returning_mailer.rb
776
793
  - lib/glib/value.rb
777
794
  - lib/tasks/db.rake
778
- homepage:
779
795
  licenses: []
780
796
  metadata: {}
781
- post_install_message:
782
797
  rdoc_options: []
783
798
  require_paths:
784
799
  - lib
@@ -793,8 +808,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
793
808
  - !ruby/object:Gem::Version
794
809
  version: '0'
795
810
  requirements: []
796
- rubygems_version: 3.5.22
797
- signing_key:
811
+ rubygems_version: 4.0.6
798
812
  specification_version: 4
799
813
  summary: ''
800
814
  test_files: []