interfacets 0.9.99 → 0.99999
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 +4 -4
- data/LICENSE +9 -17
- data/lib/interfacets/client/actor.rb +2 -1
- data/lib/interfacets/client/assets.rb +77 -64
- data/lib/interfacets/client/bus.rb +28 -9
- data/lib/interfacets/client/channels/api.rb +138 -39
- data/lib/interfacets/client/channels/audio.rb +13 -10
- data/lib/interfacets/client/channels/base.rb +2 -2
- data/lib/interfacets/client/channels/pubsub.rb +69 -0
- data/lib/interfacets/client/channels/react/builder.rb +42 -72
- data/lib/interfacets/client/channels/react/channel.rb +7 -5
- data/lib/interfacets/client/channels/react/evaluator.rb +6 -4
- data/lib/interfacets/client/channels/timer.rb +8 -7
- data/lib/interfacets/client/channels/url.rb +39 -6
- data/lib/interfacets/client/registry.rb +3 -2
- data/lib/interfacets/client/slots.rb +45 -0
- data/lib/interfacets/client/system.rb +20 -15
- data/lib/interfacets/client/template.rb +90 -0
- data/lib/interfacets/client/utils/mruby_patches.rb +7 -3
- data/lib/interfacets/client/utils/open_struct.rb +2 -4
- data/lib/interfacets/component_registry.rb +34 -29
- data/lib/interfacets/component_schema_parser.rb +8 -4
- data/lib/interfacets/mruby/build_config.rb +8 -4
- data/lib/interfacets/mruby/entrypoint.rb +2 -2
- data/lib/interfacets/server/api.rb +44 -7
- data/lib/interfacets/server/assets.rb +58 -23
- data/lib/interfacets/server/basic_router.rb +29 -19
- data/lib/interfacets/server/bus.rb +5 -6
- data/lib/interfacets/server/registry.rb +17 -10
- data/lib/interfacets/shared/basic_routable.rb +7 -4
- data/lib/interfacets/shared/entities/bus.rb +619 -185
- data/lib/interfacets/shared/entities/changeset.rb +432 -0
- data/lib/interfacets/shared/entities/collection_proxy.rb +132 -72
- data/lib/interfacets/shared/entities/specs/handlers.rb +58 -37
- data/lib/interfacets/shared/entities/specs.rb +184 -18
- data/lib/interfacets/shared/entity.rb +113 -23
- data/lib/interfacets/shared/entity_dsl.rb +138 -20
- data/lib/interfacets/shared/facet.rb +128 -68
- data/lib/interfacets/shared/generated_store.rb +69 -34
- data/lib/interfacets/shared/refreshable.rb +85 -0
- data/lib/interfacets/shared/utils.rb +36 -32
- data/lib/interfacets/shared/validations.rb +746 -26
- data/lib/interfacets/shared/view.rb +74 -28
- data/lib/interfacets/test/component_registry.rb +31 -12
- data/lib/interfacets/test/js/inline_bus.rb +51 -25
- data/lib/interfacets/test/js/nodo_bus.rb +21 -10
- data/lib/interfacets/test/js/receivers/api.rb +14 -12
- data/lib/interfacets/test/js/receivers/audio.rb +61 -0
- data/lib/interfacets/test/js/receivers/pubsub.rb +50 -0
- data/lib/interfacets/test/js/receivers/react/node/xml_parser.rb +33 -5
- data/lib/interfacets/test/js/receivers/react/node.rb +69 -15
- data/lib/interfacets/test/js/receivers/react.rb +13 -4
- data/lib/interfacets/test/js/receivers/timer.rb +12 -8
- data/lib/interfacets/test/js/receivers/url.rb +47 -11
- data/lib/interfacets/test/ui_simulator.rb +88 -18
- data/lib/interfacets/test/validation_engine.rb +82 -49
- data/lib/interfacets/test.rb +1 -3
- data/lib/interfacets/version.rb +1 -1
- data/lib/interfacets.rb +11 -3
- metadata +31 -28
- data/.rubocop.yml +0 -180
- data/.tmp +0 -5
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -14
- data/lib/interfacets/client/channels/page_visibility.rb +0 -21
- data/lib/interfacets/client/channels/react/dom.rb +0 -91
- data/lib/interfacets/client/channels/speech_to_text.rb +0 -100
- data/lib/interfacets/client/config.rb +0 -22
- data/lib/interfacets/client/delegator.rb +0 -37
- data/lib/interfacets/server/assets/facet.rb +0 -63
- data/lib/interfacets/server/config.rb +0 -87
- data/lib/interfacets/server/facets/deserializer.rb +0 -25
- data/lib/interfacets/server/facets/schema/serializer.rb +0 -54
- data/lib/interfacets/server/facets/serializer.rb +0 -50
data/lib/interfacets/version.rb
CHANGED
data/lib/interfacets.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
3
|
+
require("zeitwerk")
|
|
4
|
+
require("active_support/concern")
|
|
5
5
|
|
|
6
6
|
module Interfacets
|
|
7
7
|
class << self
|
|
@@ -14,7 +14,11 @@ module Interfacets
|
|
|
14
14
|
Zeitwerk::Loader
|
|
15
15
|
.for_gem
|
|
16
16
|
.tap { _1.ignore("#{__dir__}/interfacets/mruby") }
|
|
17
|
-
.tap {
|
|
17
|
+
.tap {
|
|
18
|
+
_1.ignore(
|
|
19
|
+
"#{__dir__}/interfacets/client/utils"
|
|
20
|
+
)
|
|
21
|
+
}
|
|
18
22
|
.tap { _1.enable_reloading if enable_reloading? }
|
|
19
23
|
.tap(&:setup)
|
|
20
24
|
)
|
|
@@ -33,3 +37,7 @@ end
|
|
|
33
37
|
unless Interfacets.enable_reloading?
|
|
34
38
|
Interfacets.loader
|
|
35
39
|
end
|
|
40
|
+
|
|
41
|
+
require_relative(
|
|
42
|
+
"interfacets/shared/entities/changeset"
|
|
43
|
+
)
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: interfacets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.99999'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pete Kinnecom
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -25,45 +24,54 @@ dependencies:
|
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '7.0'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
27
|
+
name: json_schemer
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '2.
|
|
32
|
+
version: '2.0'
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '2.
|
|
39
|
+
version: '2.0'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
41
|
+
name: ostruct
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
44
|
- - ">="
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
46
|
+
version: '0'
|
|
48
47
|
type: :runtime
|
|
49
48
|
prerelease: false
|
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
50
|
requirements:
|
|
52
51
|
- - ">="
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
55
|
-
|
|
53
|
+
version: '0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: zeitwerk
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '2.5'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '2.5'
|
|
56
68
|
email:
|
|
57
69
|
- git@k7u7.com
|
|
58
70
|
executables: []
|
|
59
71
|
extensions: []
|
|
60
72
|
extra_rdoc_files: []
|
|
61
73
|
files:
|
|
62
|
-
- ".rubocop.yml"
|
|
63
|
-
- ".tmp"
|
|
64
74
|
- LICENSE
|
|
65
|
-
- LICENSE.txt
|
|
66
|
-
- Rakefile
|
|
67
75
|
- lib/interfacets.rb
|
|
68
76
|
- lib/interfacets/client.rb
|
|
69
77
|
- lib/interfacets/client/actor.rb
|
|
@@ -72,18 +80,16 @@ files:
|
|
|
72
80
|
- lib/interfacets/client/channels/api.rb
|
|
73
81
|
- lib/interfacets/client/channels/audio.rb
|
|
74
82
|
- lib/interfacets/client/channels/base.rb
|
|
75
|
-
- lib/interfacets/client/channels/
|
|
83
|
+
- lib/interfacets/client/channels/pubsub.rb
|
|
76
84
|
- lib/interfacets/client/channels/react/builder.rb
|
|
77
85
|
- lib/interfacets/client/channels/react/channel.rb
|
|
78
|
-
- lib/interfacets/client/channels/react/dom.rb
|
|
79
86
|
- lib/interfacets/client/channels/react/evaluator.rb
|
|
80
|
-
- lib/interfacets/client/channels/speech_to_text.rb
|
|
81
87
|
- lib/interfacets/client/channels/timer.rb
|
|
82
88
|
- lib/interfacets/client/channels/url.rb
|
|
83
|
-
- lib/interfacets/client/config.rb
|
|
84
|
-
- lib/interfacets/client/delegator.rb
|
|
85
89
|
- lib/interfacets/client/registry.rb
|
|
90
|
+
- lib/interfacets/client/slots.rb
|
|
86
91
|
- lib/interfacets/client/system.rb
|
|
92
|
+
- lib/interfacets/client/template.rb
|
|
87
93
|
- lib/interfacets/client/utils/active_support_concern.rb
|
|
88
94
|
- lib/interfacets/client/utils/mruby_patches.rb
|
|
89
95
|
- lib/interfacets/client/utils/open_struct.rb
|
|
@@ -96,16 +102,12 @@ files:
|
|
|
96
102
|
- lib/interfacets/mruby/init.c
|
|
97
103
|
- lib/interfacets/server/api.rb
|
|
98
104
|
- lib/interfacets/server/assets.rb
|
|
99
|
-
- lib/interfacets/server/assets/facet.rb
|
|
100
105
|
- lib/interfacets/server/basic_router.rb
|
|
101
106
|
- lib/interfacets/server/bus.rb
|
|
102
|
-
- lib/interfacets/server/config.rb
|
|
103
|
-
- lib/interfacets/server/facets/deserializer.rb
|
|
104
|
-
- lib/interfacets/server/facets/schema/serializer.rb
|
|
105
|
-
- lib/interfacets/server/facets/serializer.rb
|
|
106
107
|
- lib/interfacets/server/registry.rb
|
|
107
108
|
- lib/interfacets/shared/basic_routable.rb
|
|
108
109
|
- lib/interfacets/shared/entities/bus.rb
|
|
110
|
+
- lib/interfacets/shared/entities/changeset.rb
|
|
109
111
|
- lib/interfacets/shared/entities/collection_proxy.rb
|
|
110
112
|
- lib/interfacets/shared/entities/specs.rb
|
|
111
113
|
- lib/interfacets/shared/entities/specs/handlers.rb
|
|
@@ -113,6 +115,7 @@ files:
|
|
|
113
115
|
- lib/interfacets/shared/entity_dsl.rb
|
|
114
116
|
- lib/interfacets/shared/facet.rb
|
|
115
117
|
- lib/interfacets/shared/generated_store.rb
|
|
118
|
+
- lib/interfacets/shared/refreshable.rb
|
|
116
119
|
- lib/interfacets/shared/utils.rb
|
|
117
120
|
- lib/interfacets/shared/validations.rb
|
|
118
121
|
- lib/interfacets/shared/view.rb
|
|
@@ -121,6 +124,8 @@ files:
|
|
|
121
124
|
- lib/interfacets/test/js/inline_bus.rb
|
|
122
125
|
- lib/interfacets/test/js/nodo_bus.rb
|
|
123
126
|
- lib/interfacets/test/js/receivers/api.rb
|
|
127
|
+
- lib/interfacets/test/js/receivers/audio.rb
|
|
128
|
+
- lib/interfacets/test/js/receivers/pubsub.rb
|
|
124
129
|
- lib/interfacets/test/js/receivers/react.rb
|
|
125
130
|
- lib/interfacets/test/js/receivers/react/node.rb
|
|
126
131
|
- lib/interfacets/test/js/receivers/react/node/xml_parser.rb
|
|
@@ -132,13 +137,12 @@ files:
|
|
|
132
137
|
- lib/interfacets/version.rb
|
|
133
138
|
homepage: https://github.com/petekinnecom/interfacets
|
|
134
139
|
licenses:
|
|
135
|
-
-
|
|
140
|
+
- WTFPL
|
|
136
141
|
metadata:
|
|
137
142
|
allowed_push_host: https://rubygems.org
|
|
138
143
|
homepage_uri: https://github.com/petekinnecom/interfacets
|
|
139
144
|
source_code_uri: https://github.com/petekinnecom/interfacets
|
|
140
145
|
rubygems_mfa_required: 'true'
|
|
141
|
-
post_install_message:
|
|
142
146
|
rdoc_options: []
|
|
143
147
|
require_paths:
|
|
144
148
|
- lib
|
|
@@ -153,8 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
157
|
- !ruby/object:Gem::Version
|
|
154
158
|
version: '0'
|
|
155
159
|
requirements: []
|
|
156
|
-
rubygems_version: 3.
|
|
157
|
-
signing_key:
|
|
160
|
+
rubygems_version: 3.6.9
|
|
158
161
|
specification_version: 4
|
|
159
162
|
summary: Use ruby in the browser to build your frontend
|
|
160
163
|
test_files: []
|
data/.rubocop.yml
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
NewCops: enable
|
|
3
|
-
Exclude: [ "bin/*" ]
|
|
4
|
-
|
|
5
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
|
6
|
-
Enabled: false
|
|
7
|
-
|
|
8
|
-
Layout/MultilineMethodCallBraceLayout:
|
|
9
|
-
Enabled: true
|
|
10
|
-
EnforcedStyle: new_line
|
|
11
|
-
|
|
12
|
-
Layout/MultilineMethodCallIndentation:
|
|
13
|
-
Enabled: true
|
|
14
|
-
EnforcedStyle: indented
|
|
15
|
-
|
|
16
|
-
Layout/MultilineMethodArgumentLineBreaks:
|
|
17
|
-
Enabled: true
|
|
18
|
-
|
|
19
|
-
Layout/MultilineMethodParameterLineBreaks:
|
|
20
|
-
Enabled: true
|
|
21
|
-
|
|
22
|
-
Layout/FirstMethodArgumentLineBreak:
|
|
23
|
-
Enabled: true
|
|
24
|
-
|
|
25
|
-
Layout/FirstMethodParameterLineBreak:
|
|
26
|
-
Enabled: true
|
|
27
|
-
|
|
28
|
-
Style/MethodCallWithArgsParentheses:
|
|
29
|
-
Enabled: true
|
|
30
|
-
|
|
31
|
-
Layout/ArgumentAlignment:
|
|
32
|
-
Enabled: true
|
|
33
|
-
EnforcedStyle: with_fixed_indentation
|
|
34
|
-
|
|
35
|
-
Lint/UnusedMethodArgument:
|
|
36
|
-
Enabled: false
|
|
37
|
-
|
|
38
|
-
Style/NumberedParameters:
|
|
39
|
-
Enabled: false
|
|
40
|
-
|
|
41
|
-
Style/OpenStructUse:
|
|
42
|
-
Enabled: false
|
|
43
|
-
|
|
44
|
-
Lint/EmptyBlock:
|
|
45
|
-
Enabled: false
|
|
46
|
-
|
|
47
|
-
Style/ExponentialNotation:
|
|
48
|
-
Enabled: false
|
|
49
|
-
|
|
50
|
-
Layout/MultilineAssignmentLayout:
|
|
51
|
-
Enabled: true
|
|
52
|
-
EnforcedStyle: new_line
|
|
53
|
-
|
|
54
|
-
Layout/ExtraSpacing:
|
|
55
|
-
Enabled: true
|
|
56
|
-
AllowForAlignment: false
|
|
57
|
-
|
|
58
|
-
Metrics/AbcSize:
|
|
59
|
-
Enabled: false
|
|
60
|
-
|
|
61
|
-
Metrics/BlockLength:
|
|
62
|
-
Enabled: false
|
|
63
|
-
|
|
64
|
-
Metrics/ClassLength:
|
|
65
|
-
Enabled: false
|
|
66
|
-
|
|
67
|
-
Metrics/CyclomaticComplexity:
|
|
68
|
-
Enabled: false
|
|
69
|
-
|
|
70
|
-
Metrics/MethodLength:
|
|
71
|
-
Enabled: false
|
|
72
|
-
|
|
73
|
-
Metrics/ModuleLength:
|
|
74
|
-
Enabled: false
|
|
75
|
-
|
|
76
|
-
Metrics/PerceivedComplexity:
|
|
77
|
-
Enabled: false
|
|
78
|
-
|
|
79
|
-
Naming/MethodParameterName:
|
|
80
|
-
Enabled: false
|
|
81
|
-
|
|
82
|
-
Naming/PredicateName:
|
|
83
|
-
Enabled: false
|
|
84
|
-
|
|
85
|
-
Naming/VariableNumber:
|
|
86
|
-
EnforcedStyle: snake_case
|
|
87
|
-
|
|
88
|
-
Security/Eval:
|
|
89
|
-
Enabled: false
|
|
90
|
-
|
|
91
|
-
Style/Alias:
|
|
92
|
-
Enabled: false
|
|
93
|
-
|
|
94
|
-
Style/BlockDelimiters:
|
|
95
|
-
Enabled: false
|
|
96
|
-
EnforcedStyle: semantic
|
|
97
|
-
|
|
98
|
-
Style/CaseLikeIf:
|
|
99
|
-
Enabled: false
|
|
100
|
-
|
|
101
|
-
Style/CombinableLoops:
|
|
102
|
-
Enabled: false
|
|
103
|
-
|
|
104
|
-
Style/Documentation:
|
|
105
|
-
Enabled: false
|
|
106
|
-
|
|
107
|
-
Style/EmptyLambdaParameter:
|
|
108
|
-
Enabled: false
|
|
109
|
-
|
|
110
|
-
Style/EvenOdd:
|
|
111
|
-
Enabled: false
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Style/GuardClause:
|
|
115
|
-
Enabled: false
|
|
116
|
-
|
|
117
|
-
Style/IfUnlessModifier:
|
|
118
|
-
Enabled: false
|
|
119
|
-
|
|
120
|
-
Style/Lambda:
|
|
121
|
-
Enabled: false
|
|
122
|
-
|
|
123
|
-
Style/ModuleFunction:
|
|
124
|
-
Enabled: false
|
|
125
|
-
|
|
126
|
-
Style/MultilineBlockChain:
|
|
127
|
-
Enabled: false
|
|
128
|
-
|
|
129
|
-
Style/MultilineMemoization:
|
|
130
|
-
Enabled: true
|
|
131
|
-
EnforcedStyle: braces
|
|
132
|
-
|
|
133
|
-
Style/ParenthesesAroundCondition:
|
|
134
|
-
Enabled: true
|
|
135
|
-
AllowInMultilineConditions: true
|
|
136
|
-
|
|
137
|
-
Style/RaiseArgs:
|
|
138
|
-
Enabled: true
|
|
139
|
-
EnforcedStyle: compact
|
|
140
|
-
|
|
141
|
-
Style/RedundantParentheses:
|
|
142
|
-
Enabled: false
|
|
143
|
-
|
|
144
|
-
Style/RedundantSelf:
|
|
145
|
-
Enabled: false
|
|
146
|
-
|
|
147
|
-
Style/StringLiterals:
|
|
148
|
-
Enabled: true
|
|
149
|
-
EnforcedStyle: double_quotes
|
|
150
|
-
|
|
151
|
-
Style/StringLiteralsInInterpolation:
|
|
152
|
-
Enabled: true
|
|
153
|
-
EnforcedStyle: double_quotes
|
|
154
|
-
|
|
155
|
-
Style/SymbolArray:
|
|
156
|
-
Enabled: true
|
|
157
|
-
EnforcedStyle: brackets
|
|
158
|
-
|
|
159
|
-
Style/TrailingCommaInArguments:
|
|
160
|
-
Enabled: true
|
|
161
|
-
EnforcedStyleForMultiline: consistent_comma
|
|
162
|
-
|
|
163
|
-
Style/TrailingCommaInArrayLiteral:
|
|
164
|
-
Enabled: true
|
|
165
|
-
EnforcedStyleForMultiline: consistent_comma
|
|
166
|
-
|
|
167
|
-
Style/TrailingCommaInHashLiteral:
|
|
168
|
-
Enabled: true
|
|
169
|
-
EnforcedStyleForMultiline: consistent_comma
|
|
170
|
-
|
|
171
|
-
Style/WordArray:
|
|
172
|
-
Enabled: true
|
|
173
|
-
EnforcedStyle: brackets
|
|
174
|
-
|
|
175
|
-
Layout/LineLength:
|
|
176
|
-
Max: 100
|
|
177
|
-
AllowedPatterns: ['^(\s*#)']
|
|
178
|
-
|
|
179
|
-
Style/DocumentDynamicEvalDefinition:
|
|
180
|
-
Enabled: false
|
data/.tmp
DELETED
data/LICENSE.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Pete Kinnecom
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "minitest/test_task"
|
|
5
|
-
|
|
6
|
-
Minitest::TestTask.create do |t|
|
|
7
|
-
t.warning = false
|
|
8
|
-
t.test_globs = (
|
|
9
|
-
Rake::FileList["test/**/test_*.rb", "test/**/*_test.rb"]
|
|
10
|
-
.exclude("test/fixtures/**/*")
|
|
11
|
-
)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
task default: :test
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Interfacets
|
|
4
|
-
module Client
|
|
5
|
-
module Channels
|
|
6
|
-
class PageVisibility
|
|
7
|
-
include Channels::Base
|
|
8
|
-
|
|
9
|
-
type("interfacets:page-visibility")
|
|
10
|
-
|
|
11
|
-
def configure(facet:); end
|
|
12
|
-
|
|
13
|
-
def handle(facet:, event:)
|
|
14
|
-
facet.visibility_change(event.dig("payload", "state"))
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def render(_facet); end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Interfacets
|
|
4
|
-
module Client
|
|
5
|
-
module Channels
|
|
6
|
-
module React
|
|
7
|
-
class Dom
|
|
8
|
-
attr_accessor :children, :handlers, :facet
|
|
9
|
-
|
|
10
|
-
def initialize(facet:)
|
|
11
|
-
@children = []
|
|
12
|
-
@portals = []
|
|
13
|
-
@handlers = {}
|
|
14
|
-
@facet = facet
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def reset
|
|
18
|
-
@children = []
|
|
19
|
-
@portals = []
|
|
20
|
-
@handlers = {}
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def handle(facet:, payload:)
|
|
24
|
-
handler_id = payload.fetch("id")
|
|
25
|
-
handler = handlers.fetch(handler_id)
|
|
26
|
-
callback = handler.fetch(:callback)
|
|
27
|
-
og_facet = handler.fetch(:facet)
|
|
28
|
-
|
|
29
|
-
Evaluator.call(og_facet, callback, payload["event"])
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def register_handler(id:, callback:, facet:)
|
|
33
|
-
@handlers[id] = { facet:, callback: }
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
type: "interfacets:react-dom:memoized-action",
|
|
37
|
-
payload: { id: },
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def string_node(str)
|
|
43
|
-
@children << {
|
|
44
|
-
type: "interfacets:string-node",
|
|
45
|
-
attributes: { value: str },
|
|
46
|
-
}
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def call(type, str = nil, **attrs)
|
|
50
|
-
raise("cannot pass both a block and a string") if str && block_given?
|
|
51
|
-
raise if type == :facet
|
|
52
|
-
|
|
53
|
-
new_element = {
|
|
54
|
-
type:,
|
|
55
|
-
children: [],
|
|
56
|
-
attributes: (
|
|
57
|
-
attrs.transform_values { |value|
|
|
58
|
-
if value.is_a?(Proc)
|
|
59
|
-
register_handler(
|
|
60
|
-
id: value.object_id.to_s,
|
|
61
|
-
callback: value,
|
|
62
|
-
facet:,
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
type: "interfacets:react-dom:action",
|
|
67
|
-
payload: { id: value.object_id.to_s },
|
|
68
|
-
}
|
|
69
|
-
else
|
|
70
|
-
value
|
|
71
|
-
end
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if block_given? || str
|
|
77
|
-
# recurse
|
|
78
|
-
original_children = @children
|
|
79
|
-
@children = new_element[:children]
|
|
80
|
-
yield if block_given?
|
|
81
|
-
string_node(str) if str
|
|
82
|
-
@children = original_children
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
@children << new_element
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
end
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Interfacets
|
|
4
|
-
module Client
|
|
5
|
-
module Channels
|
|
6
|
-
class SpeechToText
|
|
7
|
-
include Channels::Base
|
|
8
|
-
|
|
9
|
-
type("speechToText")
|
|
10
|
-
|
|
11
|
-
class Builder
|
|
12
|
-
attr_accessor :facet
|
|
13
|
-
attr_accessor :entity
|
|
14
|
-
|
|
15
|
-
def initialize
|
|
16
|
-
@event = {}
|
|
17
|
-
@callbacks = {}
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def flush_event
|
|
21
|
-
@event.tap { @event = {} }
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def record(
|
|
25
|
-
on_done: ->(*, **) {},
|
|
26
|
-
on_progress: ->(*,**) {},
|
|
27
|
-
on_submit: ->(*, **) {}
|
|
28
|
-
)
|
|
29
|
-
id = SecureRandom.uuid
|
|
30
|
-
@event = {
|
|
31
|
-
id:,
|
|
32
|
-
type: "record",
|
|
33
|
-
}
|
|
34
|
-
@callbacks[id] = {
|
|
35
|
-
on_progress:,
|
|
36
|
-
on_done:,
|
|
37
|
-
on_submit:,
|
|
38
|
-
}
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def callbacks
|
|
42
|
-
@callbacks ||= {}
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def event
|
|
46
|
-
@event ||= {}
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
attr_reader :helper
|
|
51
|
-
|
|
52
|
-
def prepare(entity)
|
|
53
|
-
@builder ||= Builder.new
|
|
54
|
-
@builder.entity = entity
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def builder(stream = "default")
|
|
58
|
-
@builder
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def handle(event:, entity:, **)
|
|
62
|
-
callback_id = event.dig("payload", "id")
|
|
63
|
-
|
|
64
|
-
case event.fetch("type")
|
|
65
|
-
when "text-result"
|
|
66
|
-
builder
|
|
67
|
-
.callbacks
|
|
68
|
-
.delete(callback_id)
|
|
69
|
-
.fetch(:on_done)
|
|
70
|
-
.then do
|
|
71
|
-
entity.instance_exec(event.dig("payload", "text"), &_1)
|
|
72
|
-
end
|
|
73
|
-
when "text-progress"
|
|
74
|
-
builder
|
|
75
|
-
.callbacks
|
|
76
|
-
.fetch(callback_id)
|
|
77
|
-
.fetch(:on_progress)
|
|
78
|
-
.then do
|
|
79
|
-
entity.instance_exec(event.dig("payload", "text"), &_1)
|
|
80
|
-
end
|
|
81
|
-
when "text-submit"
|
|
82
|
-
builder
|
|
83
|
-
.callbacks
|
|
84
|
-
.fetch(callback_id)
|
|
85
|
-
.fetch(:on_submit)
|
|
86
|
-
.then do
|
|
87
|
-
entity.instance_exec(event.dig("payload", "text"), &_1)
|
|
88
|
-
end
|
|
89
|
-
else
|
|
90
|
-
raise "unknown event type: #{event.inspect}"
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def result
|
|
95
|
-
{ streams: { default: @builder.flush_event } }
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Interfacets
|
|
4
|
-
module Client
|
|
5
|
-
class Config
|
|
6
|
-
attr_accessor(
|
|
7
|
-
:mount_point,
|
|
8
|
-
:root_url
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
def url_for(path:)
|
|
12
|
-
[
|
|
13
|
-
root_url,
|
|
14
|
-
mount_point,
|
|
15
|
-
path,
|
|
16
|
-
]
|
|
17
|
-
.map { _1.sub(%r{/$}, "").sub(%r{^/}, "") }
|
|
18
|
-
.join("/")
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Interfacets
|
|
4
|
-
module Client
|
|
5
|
-
# alias: CrappyDelegator
|
|
6
|
-
class Delegator
|
|
7
|
-
def initialize(obj)
|
|
8
|
-
@__obj__ = obj
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def __getobj__
|
|
12
|
-
@__obj__
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def respond_to_missing?(...)
|
|
16
|
-
@__obj__.send(:respond_to_missing?, ...)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def method_missing(method, *a, **p, &)
|
|
20
|
-
@__obj__.send(method, *a, **p, &)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# delegation helpers
|
|
24
|
-
def inspect
|
|
25
|
-
[self.class.name, __getobj__.inspect].join(" -> ")
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def to_s
|
|
29
|
-
inspect
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def presence
|
|
33
|
-
self
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|