applin-rails 0.6.0 → 0.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: 8867eef768fdce7a5c2bf8c18a83e8adc99ad18854578c82815c1d7016199866
4
- data.tar.gz: 7c4633294fc36b21e876aa93b9d3d85380eb30ef9db4bbaeacd96c83e84b3032
3
+ metadata.gz: 9549a088e20dc0e39d0152d3a13be7c4f1bcb2202ce9fd3b78c87793ddba0dff
4
+ data.tar.gz: d6c833d8898a537d2542c861273aac8a4908d7d7cbe0b39a59ad22b2b607b106
5
5
  SHA512:
6
- metadata.gz: 79ed3689644ff339a5bbcf9a3728f5903e19de48f7c184035c0f31b21f9536978482fbcad122e8413cfc419c4e5315dd889376ae9c4b32685c4d777f8ed56455
7
- data.tar.gz: 80c63c298656f77b900a5380692a59e1f9b4166893039a082b8d9577167a2fb58afbf4ec8115b1442e909aa6db2033e764dc184de94ec5deeb57d894e9ec605b
6
+ metadata.gz: 84fe8b3b2b3da47a61027ea8e7187e366e2ae82a22e9c6449780beb1113aff83abb5399208749827801ce35fd95a2ee06138cde56bac84c90e44e8ebbb4713be
7
+ data.tar.gz: 2a75e3c118c8811a43e14033fb29949d2947cc4994b45c4c14e23dc26b53bc982e2edade9d4ff8743f4368cf125b33aa5b92c760e47ee052736ef64ac9a81e5d
data/CHANGELOG.md CHANGED
@@ -0,0 +1,10 @@
1
+ ## applin Ruby Gem Changes
2
+ - v0.7.0
3
+ - Support ApplinIos 0.32.0.
4
+ - Remove on_user_error_poll action and make it a parameter of the rpc action.
5
+ - Add `modal` action.
6
+ - Add `aspect_ratio` param to `choose_photo` and `take_photo` actions.
7
+ - v0.6.0
8
+ - Support ApplinIos v0.25.0.
9
+ - Add `poll_delay_ms` to checkbox and textfield.
10
+ - Remove checkbox `rpc` field.
data/README.md CHANGED
@@ -15,12 +15,6 @@ To add the gem to your Rails application:
15
15
  * Docs: <https://www.applin.dev/docs/backend-libraries.html>
16
16
  * Example: <https://github.com/leonhard-llc/applin-rails-demo>
17
17
 
18
- ## Changes
19
- - v0.6.0
20
- - Support ApplinIos v0.25.0.
21
- - Add `poll_delay_ms` to checkbox and textfield.
22
- - Remove checkbox `rpc` field.
23
-
24
18
  ## Contributing
25
19
  Bug reports and pull requests are welcome on GitHub at <https://github.com/leonhard-llc/applin-rails>.
26
20
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Applin
4
4
  module Rails
5
- VERSION = "0.6.0"
5
+ VERSION = "0.7.0"
6
6
  end
7
7
  end
data/lib/applin.rb CHANGED
@@ -22,48 +22,52 @@ module Applin
22
22
 
23
23
  # Actions ###################################################################
24
24
 
25
- def choose_photo(upload_url:)
26
- "choose_photo:#{upload_url}"
25
+ def choose_photo(upload_url:, aspect_ratio: nil)
26
+ { typ: "choose_photo", url: upload_url, aspect_ratio: aspect_ratio }
27
27
  end
28
28
 
29
29
  def copy_to_clipboard(text)
30
- "copy_to_clipboard:#{text}"
30
+ { typ: "copy_to_clipboard", string_value: text }
31
31
  end
32
32
 
33
33
  def launch_url(url)
34
- "launch_url:#{url}"
34
+ { typ: "launch_url", url: url }
35
35
  end
36
36
 
37
37
  def logout
38
- "logout"
38
+ { typ: "logout" }
39
39
  end
40
40
 
41
- def on_user_error_poll
42
- "on_user_error_poll"
41
+ def modal_button(text:, actions:)
42
+ { text: text, actions: actions }
43
+ end
44
+
45
+ def modal(title:, buttons:, message: nil)
46
+ { typ: "modal", title: title, message: message, buttons: buttons }
43
47
  end
44
48
 
45
49
  def poll
46
- "poll"
50
+ { typ: "poll" }
47
51
  end
48
52
 
49
53
  def pop
50
- "pop"
54
+ { typ: "pop" }
51
55
  end
52
56
 
53
57
  def push(page_key)
54
- "push:#{page_key}"
58
+ { typ: "push", page: page_key }
55
59
  end
56
60
 
57
61
  def replace_all(page_key)
58
- "replace_all:#{page_key}"
62
+ { typ: "replace_all", page: page_key }
59
63
  end
60
64
 
61
- def rpc(url)
62
- "rpc:#{url}"
65
+ def rpc(url:, on_user_error_poll: nil)
66
+ { typ: "rpc", url: url, on_user_error_poll: on_user_error_poll }
63
67
  end
64
68
 
65
- def take_photo(upload_url:)
66
- "take_photo:#{upload_url}"
69
+ def take_photo(upload_url:, aspect_ratio: nil)
70
+ { typ: "take_photo", url: upload_url, aspect_ratio: aspect_ratio }
67
71
  end
68
72
 
69
73
  # Pages #####################################################################
data/sig/applin.rbs CHANGED
@@ -27,7 +27,8 @@ module Applin
27
27
  DISPOSITION_STRETCH: disposition
28
28
  VERSION: String
29
29
 
30
- type action = String
30
+ type action = { typ: String }
31
+ type modal_button = { text: String, actions: Array[action] }
31
32
  type page = { title: String }
32
33
  type widget = { typ: String }
33
34
 
@@ -43,7 +44,7 @@ module Applin
43
44
  poll_delay_ms: Numeric?,
44
45
  ) -> widget
45
46
 
46
- def choose_photo: (upload_url: String) -> action
47
+ def choose_photo: (upload_url: String, aspect_ratio: Numeric?) -> action
47
48
 
48
49
  def column: (widgets: Array[widget], align: alignment?, spacing: Numeric?) -> widget
49
50
 
@@ -69,6 +70,10 @@ module Applin
69
70
 
70
71
  def logout: -> action
71
72
 
73
+ def modal_button: (text: String, actions: Array[action]) -> modal_button
74
+
75
+ def modal: (title: String, message: String?, buttons: Array[modal_button]) -> action
76
+
72
77
  def nav_button: (text: String, actions: Array[action], badge_text: String?, photo_url: String?, sub_text: String?) -> widget
73
78
 
74
79
  def nav_page: (
@@ -80,8 +85,6 @@ module Applin
80
85
  poll_seconds: Numeric?,
81
86
  ) { () -> widget } -> page
82
87
 
83
- def on_user_error_poll: -> action
84
-
85
88
  def plain_page: (
86
89
  title: String?,
87
90
  ephemeral: bool?,
@@ -97,13 +100,13 @@ module Applin
97
100
 
98
101
  def replace_all: (String) -> action
99
102
 
100
- def rpc: (String) -> action
103
+ def rpc: (url: String, on_user_error_poll: bool?) -> action
101
104
 
102
105
  def scroll: () { () -> widget } -> widget
103
106
 
104
107
  def table: (rows: Array[Array[widget]], spacing: Numeric?) -> widget
105
108
 
106
- def take_photo: (upload_url: String) -> action
109
+ def take_photo: (upload_url: String, aspect_ratio: Numeric?) -> action
107
110
 
108
111
  def text: (String) -> widget
109
112
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: applin-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Leonhard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-21 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create mobile apps using only backend code. Applin™ is a Server-Driven
14
14
  UI (SDUI) system.