cubism 0.1.0.pre6 → 0.1.0.pre7

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: 10a5083117c16883fd1794f09ed204481d6adfef8143c2f243d56030aa438054
4
- data.tar.gz: f40048d57269c6bf2d4fc4c8cdfb91f4e4021da157c35fcf0f0b8d46c59f8929
3
+ metadata.gz: 60592da9032ef659e0cc7b05906f5f0711d7dc2e6e6d764248e2a959f05630a3
4
+ data.tar.gz: ebac5554adf2599e0bc24d650f237b160681d834e9187d917dc346d153a55c36
5
5
  SHA512:
6
- metadata.gz: 8d6410ee9e19694330c836a8580de898ef4ccb560fcdd562ff1f199d83db357538952809f156d1eb29991f15d7a925dbb4cd97bacf0b498a8e037d2187de537d
7
- data.tar.gz: 400663fdce10836259b1affe8197e2c57da63358912529b4ff79bddbe052ac16251e1032b904a921467fd1290ea11100b16764c9ce61b6eaaeab9d634cf83401
6
+ metadata.gz: 59667a0621019d1909b461f5e7209127cda5e10e6ccb59c40fc876e4009934ea458e91b3f3db38cd558895419290c594379c8d3c5a66cd800a0a02da61e63a94
7
+ data.tar.gz: 5057d6a805878455811521a75422bd86e0b018f5fb0a5bc31409b765713eba8d5a9a3d0ce8eaf7795246796719e097407243f932eb1c97b006bac08d803ccf07
data/README.md CHANGED
@@ -92,8 +92,8 @@ CableReady.initialize({ consumer });
92
92
  The `cubicle_for` helper accepts the following options as keyword arguments:
93
93
 
94
94
  - `exclude_current_user (true|false)`: Whether or not to exclude the current user from the list of present users broadcasted to the view. Useful e.g. for "typing..." indicators.
95
- - `appear_trigger`: a JavaScript event name (e.g. `:focus`) to use. The default is `:connect`, i.e. register a user as "appeared"/"present" when the element connects to the DOM.
96
- - `disappear_trigger`: a JavaScript event name (e.g. `:blur`) to use. The default is `:disconnect`, i.e. remove a user form the present users list when the element disconnects from the DOM.
95
+ - `appear_trigger`: JavaScript event names (e.g. `["focus", "debounced:input]`) to use. (Can also be a singular string, which will be converted to an array). The default is `:connect`, i.e. register a user as "appeared"/"present" when the element connects to the DOM.
96
+ - `disappear_trigger`: a JavaScript event name (e.g. `:blur`) to use. (Can also be a singular string, which will be converted to an array). The default is `:disconnect`, i.e. remove a user form the present users list when the element disconnects from the DOM.
97
97
  - `trigger_root`: a CSS selector to attach the appear/disappear events to. Defaults to the `cubicle-element` itself.
98
98
  - `html_options` are passed to the TagBuilder.
99
99
 
@@ -177,4 +177,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
177
177
  <!-- markdownlint-restore -->
178
178
  <!-- prettier-ignore-end -->
179
179
 
180
- <!-- ALL-CONTRIBUTORS-LIST:END -->
180
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -9,7 +9,7 @@ module CubismHelper
9
9
  tag.cubicle_element(
10
10
  identifier: signed_stream_identifier(resource.to_gid.to_s),
11
11
  user: user.to_sgid.to_s,
12
- "appear-trigger": appear_trigger,
12
+ "appear-trigger": Array(appear_trigger).join(","),
13
13
  "disappear-trigger": disappear_trigger,
14
14
  "trigger-root": trigger_root,
15
15
  id: "cubicle-#{digested_id}",
@@ -3,22 +3,18 @@ module CubismHelper
3
3
 
4
4
  def cubicle_for(resource, user, html_options: {}, appear_trigger: :connect, disappear_trigger: nil, trigger_root: nil, exclude_current_user: true, &block)
5
5
  key = "#{block.source_location.join(":")}:#{resource.to_gid}:#{user.to_gid}"
6
- verifiable_id = CableReady.signed_stream_verifier.generate(key)
7
-
8
- Cubism.store[verifiable_id] = Cubism::BlockStoreItem.new(context: self, block: block.dup)
9
- template = capture(&block)
6
+ digested_id = ActiveSupport::Digest.hexdigest(key)
10
7
 
8
+ Cubism.store[digested_id] = Cubism::BlockStoreItem.new(context: self, block: block.dup)
11
9
  tag.cubicle_element(
12
10
  identifier: signed_stream_identifier(resource.to_gid.to_s),
13
11
  user: user.to_sgid.to_s,
14
12
  "appear-trigger": appear_trigger,
15
13
  "disappear-trigger": disappear_trigger,
16
14
  "trigger-root": trigger_root,
17
- id: "cubicle-#{verifiable_id}",
15
+ id: "cubicle-#{digested_id}",
18
16
  "exclude-current-user": exclude_current_user,
19
17
  **html_options
20
- ) do
21
- content_tag(:template, template, {slot: "template"})
22
- end
18
+ )
23
19
  end
24
20
  end
@@ -1,3 +1,3 @@
1
1
  module Cubism
2
- VERSION = "0.1.0.pre6"
2
+ VERSION = "0.1.0.pre7"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Cubism
2
- VERSION = "0.1.0.pre5"
2
+ VERSION = "0.1.0.pre6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cubism
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre6
4
+ version: 0.1.0.pre7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Rubisch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-20 00:00:00.000000000 Z
11
+ date: 2021-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails