app_rail-steps 0.2.13 → 0.2.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37eaa53b308c4e7a4b06bc73be9409006f6f3a354e1075c1f8c89ec9ff631d9a
4
- data.tar.gz: b8f9f5055a8e39f3e45588ac01074f2d6cb8bc5b194ebf12ba062070d4f7b9de
3
+ metadata.gz: d500e8081e8600e20549d14ebcbf13e4fa4d1fc838b909d07c727eb0c29e388a
4
+ data.tar.gz: a7b9bc43c513fdb60505bf3da67d124e715fef139d1ecaa0ae82f132cf1e31fb
5
5
  SHA512:
6
- metadata.gz: 3613ddaaab8d7329e9ebb44528447e4626c03a7a7b03b522243a62f804e430b689b5c2dffc0da5db388844d5758e5048bbae3790037fa0b23d3fb18701f0cad4
7
- data.tar.gz: 4f85744e064a06f3ddc23211c7c6b795c2c92154e6afa7c67db250ff3de4c773b866860dc8fab5e942892b09fc2fccb826cf511031fa6c096347e2fb3655fbdd
6
+ metadata.gz: 7ca1c468461b68616e91e52d934cb2b2a4eec8a907f9e2d4a2064cb26c59029ff01ad0616f6bb468219878a9fc53151f2a260fa025b00174b693f83c0b087cc8
7
+ data.tar.gz: 07b91e1f0595504db72e615ef0976d79de63dcf5c4fa7e9f6b4e995b891934443fa7866dd8405f725caa83fda173ef13769a096a9ddb2daa7ea5af623fd38f08
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-steps (0.2.13)
4
+ app_rail-steps (0.2.15)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,7 +3,7 @@
3
3
  module AppRail
4
4
  module Steps
5
5
  module BackgroundLocation
6
- module Regions
6
+ module Region
7
7
  def ar_background_location_region(id:, latitude:, longitude:, radius: 100, event: :entryAndExit)
8
8
  {
9
9
  id: id.to_s,
@@ -19,15 +19,21 @@ module AppRail
19
19
  }.compact
20
20
  end
21
21
 
22
- def ar_core_stack_image(preview_url:, attachment_url: preview_url, image_style: :full_width, content_mode: :scale_aspect_fill)
22
+ def ar_core_stack_image(
23
+ image_url:,
24
+ full_screen_image_url: nil,
25
+ image_style: :full_width,
26
+ content_mode: :scale_aspect_fill
27
+ )
23
28
  validate_content_mode!(content_mode)
24
29
  validate_image_style!(image_style)
25
30
 
26
31
  {
27
32
  type: :image,
28
33
  contentMode: camelcase_converter(content_mode.to_s, first_letter: :lower),
29
- previewURL: preview_url,
30
- url: attachment_url,
34
+ previewURL: image_url,
35
+ fullScreenImageURL: full_screen_image_url,
36
+ fullScreenImageOnTap: !full_screen_image_url.nil?,
31
37
  imageStyle: camelcase_converter(image_style.to_s, first_letter: :lower)
32
38
  }
33
39
  end
@@ -37,7 +43,7 @@ module AppRail
37
43
  unsplash_id = image_url.split("/").last
38
44
  image_url = "https://source.unsplash.com/#{unsplash_id}/800x600"
39
45
  end
40
- ar_core_stack_image(preview_url: image_url, attachment_url: image_url)
46
+ ar_core_stack_image(image_url: image_url, full_screen_image_url: image_url)
41
47
  end
42
48
 
43
49
  def ar_core_stack_video(preview_url:, attachment_url:)
@@ -52,12 +58,22 @@ module AppRail
52
58
  materialIconName: material_icon_name }.compact
53
59
  end
54
60
 
55
- def ar_core_stack_delete_button(url:, label: "Delete", method: :delete, style: :danger, on_success: :backward)
61
+ def ar_core_stack_delete_button(url:, label: "Delete", method: :delete, style: :danger, on_success: :backward, confirm_title: "Delete?", confirm_text: "Are you sure?", sf_symbol_name: :trash, material_icon_name: :delete)
56
62
  ar_core_stack_validate_on_success!(on_success)
57
63
  ar_core_stack_validate_button_style!(style)
58
64
 
59
- { type: :button, label: label, url: url, method: method, style: style, onSuccess: on_success,
60
- sfSymbolName: "trash", materialIconName: "delete" }.compact
65
+ {
66
+ type: :button,
67
+ label: label,
68
+ url: url,
69
+ method: method,
70
+ style: style,
71
+ onSuccess: on_success,
72
+ sfSymbolName: sf_symbol_name,
73
+ materialIconName: material_icon_name,
74
+ confirmTitle: confirm_title,
75
+ confirmText: confirm_text
76
+ }.compact
61
77
  end
62
78
 
63
79
  def ar_core_stack_url_button(url:, label:, method: :put, style: :primary, confirm_title: nil, confirm_text: nil, on_success: :reload, sf_symbol_name: nil, material_icon_name: nil)
@@ -5,9 +5,9 @@ require_relative "core/stack"
5
5
  require_relative "core_forms/form"
6
6
  require_relative "core_forms/question"
7
7
  require_relative "maps/map"
8
- require_relative "styled_content/grid"
9
- require_relative "styled_content/stack"
8
+ require_relative "grid/grid"
10
9
  require_relative "charts/dashboard"
10
+ require_relative "background_location/region"
11
11
 
12
12
  module AppRail
13
13
  module Steps
@@ -17,9 +17,9 @@ module AppRail
17
17
  include Steps::CoreForms::Form
18
18
  include Steps::CoreForms::Question
19
19
  include Steps::Maps::Map
20
- include Steps::StyledContent::Grid
21
- include Steps::StyledContent::Stack
20
+ include Steps::Grid::Grid
22
21
  include Steps::Charts::Dashboard
22
+ include Steps::BackgroundLocation::Region
23
23
 
24
24
  def camelcase_converter(string, first_letter: :upper)
25
25
  string = string.split("_").map(&:capitalize).join
@@ -2,7 +2,7 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- module StyledContent
5
+ module Grid
6
6
  module Grid
7
7
  def ar_styled_content_grid_large_section(id:, text:)
8
8
  raise "Missing id" if id.nil?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- VERSION = "0.2.13"
5
+ VERSION = "0.2.16"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_rail-steps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-25 00:00:00.000000000 Z
11
+ date: 2022-09-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -27,16 +27,15 @@ files:
27
27
  - Rakefile
28
28
  - app_rail-steps.gemspec
29
29
  - lib/app_rail/steps.rb
30
- - lib/app_rail/steps/background_location/regions.rb
30
+ - lib/app_rail/steps/background_location/region.rb
31
31
  - lib/app_rail/steps/charts/dashboard.rb
32
32
  - lib/app_rail/steps/core/list.rb
33
33
  - lib/app_rail/steps/core/stack.rb
34
34
  - lib/app_rail/steps/core_forms/form.rb
35
35
  - lib/app_rail/steps/core_forms/question.rb
36
36
  - lib/app_rail/steps/displayable.rb
37
+ - lib/app_rail/steps/grid/grid.rb
37
38
  - lib/app_rail/steps/maps/map.rb
38
- - lib/app_rail/steps/styled_content/grid.rb
39
- - lib/app_rail/steps/styled_content/stack.rb
40
39
  - lib/app_rail/steps/version.rb
41
40
  homepage: https://github.com/FutureWorkshops/app_rail-steps
42
41
  licenses:
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module AppRail
4
- module Steps
5
- module StyledContent
6
- module Stack
7
- BUTTON_STYLES = %i[primary outline danger textOnly].freeze
8
- ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
9
-
10
- def ar_styled_content_stack_title(title:)
11
- raise "Missing title" if title.nil?
12
-
13
- { id: id, title: title, type: :title }
14
- end
15
-
16
- def ar_styled_content_stack_text(text:)
17
- raise "Missing text" if text.nil?
18
-
19
- { text: text, type: :text }
20
- end
21
-
22
- def ar_styled_content_stack_list_item(text:, detail_text: nil, preview_url: nil)
23
- raise "Missing text" if text.nil?
24
-
25
- { text: text, detailText: detail_text, type: :listItem, imageURL: preview_url }.compact
26
- end
27
-
28
- # Remove `modal_workflow_name` argument once V1 is no longer being used
29
- def ar_styled_content_stack_button(label:, url: nil, method: :nil, on_success: :none, style: :primary, modal_workflow_name: nil, link_id: nil, link_url: nil, sf_symbol_name: nil, apple_system_url: nil, android_deep_link: nil, confirm_title: nil, confirm_text: nil, share_text: nil, share_image_url: nil)
30
- raise "Missing label" if label.nil?
31
-
32
- ar_styled_content_stack_validate_on_success!(on_success)
33
- ar_styled_content_stack_validate_button_style!(style)
34
-
35
- { type: :button, label: label, url: url, method: method, onSuccess: on_success, style: style,
36
- modalWorkflow: modal_workflow_name, linkId: link_id, linkURL: link_url, sfSymbolName: sf_symbol_name, appleSystemURL: apple_system_url, androidDeepLink: android_deep_link, confirmTitle: confirm_title, confirmText: confirm_text, shareText: share_text, shareImageURL: share_image_url }.compact
37
- end
38
-
39
- private
40
-
41
- def ar_styled_content_stack_validate_on_success!(on_success)
42
- raise "Unknown on_success action" unless ON_SUCCESS_OPTIONS.include?(on_success)
43
- end
44
-
45
- def ar_styled_content_stack_validate_button_style!(style)
46
- raise "Unknown style" unless BUTTON_STYLES.include?(style)
47
- end
48
- end
49
- end
50
- end
51
- end