turbo_ready 0.0.2 → 0.0.3

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: 2d5f99ef840d096ab4458b6db45d5a6c23095682bbcbc5e38abfc35fb5c8d10f
4
- data.tar.gz: d8b9c54b756d76a34c3ed8da778e10cd9984e204db3a6112409f8d0a69b8d382
3
+ metadata.gz: f2831ed42b7371306d36de27061338a9d5c6dbd23ba257ab02cc894c3bbfbfa4
4
+ data.tar.gz: 010bdaf46c2bea84bd831fc93eb3b02ac7c8d5ab2601648dede36915e04842d6
5
5
  SHA512:
6
- metadata.gz: 73c9b0777e7d94cc56cbe1ac85365dd668f50e416906720e1e86c328e6e9eefea14644d27db2be9da804a3ca905de712105079cf00a19494d65462738d839fd2
7
- data.tar.gz: e79069264ecaba47c22be128d505221f80ef9f88c38a36419692c3415895450ff600b8920bcd18c2d1259608269575f9f544ccd41d6d0b293705c7f9400e46a8
6
+ metadata.gz: b97572923e5389547b7a043babd63c79f064b254cf3ccd1674460a8bee2cf89fb7aa262171a4ed7f3e982c776f714f070ad61fab3a68c8aedb06db72ee8822cb
7
+ data.tar.gz: 665fde65402233946cd6562e32f40af1698d5c825d0c8b494c55508948a3bda7913d9397c7a9050949766374ca919bd0e2c219dc5b4b716121c76c39eaa76222
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_ready (0.0.2)
4
+ turbo_ready (0.0.3)
5
5
  rails (>= 6.1)
6
6
  turbo-rails (>= 1.1)
7
7
 
@@ -132,6 +132,8 @@ GEM
132
132
  racc (~> 1.4)
133
133
  nokogiri (1.13.8-arm64-darwin)
134
134
  racc (~> 1.4)
135
+ nokogiri (1.13.8-x86_64-linux)
136
+ racc (~> 1.4)
135
137
  parallel (1.22.1)
136
138
  parser (3.1.2.1)
137
139
  ast (~> 2.4.1)
@@ -237,6 +239,7 @@ GEM
237
239
  PLATFORMS
238
240
  aarch64-linux-musl
239
241
  arm64-darwin-21
242
+ x86_64-linux
240
243
 
241
244
  DEPENDENCIES
242
245
  magic_frozen_string_literal
@@ -1,2 +1,2 @@
1
- function l(){let r=JSON.parse(this.templateContent.textContent),{id:h,method:o,args:n,receiver:c,selector:a}=r,e=[self];switch(a&&(e=Array.from(document.querySelectorAll(a))),c&&(e=e.map(i=>{let t=i,s=c.split(".");for(;s.length>0;)t=t[s.shift()];return t})),o){case"dispatchEvent":let i=new CustomEvent(n[0],n[1]||{});e.forEach(t=>t.dispatchEvent(i));break;default:e.forEach(t=>t[o].apply(t,n))}}function f(){streamActions.invoke=l}var p={initialize:f};export{p as default};
1
+ function l(){let n=JSON.parse(this.templateContent.textContent),{id:h,method:c,args:i,receiver:a,selector:r}=n,t=[self];switch(r&&(t=Array.from(document.querySelectorAll(r))),a&&(t=t.map(o=>{let e=o,s=a.split(".");for(;s.length>0;)e=e[s.shift()];return e})),c){case"dispatchEvent":let o=new CustomEvent(i[0],i[1]||{});t.forEach(e=>e.dispatchEvent(o));break;default:t.forEach(e=>e[c].apply(e,i))}}function f(n){n.invoke=l}var p={initialize:f};export{p as default};
2
2
  //# sourceMappingURL=turbo_ready.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../javascript/turbo_ready.js"],
4
- "sourcesContent": ["function invoke () {\n const payload = JSON.parse(this.templateContent.textContent)\n const { id, method, args, receiver, selector } = payload\n let receivers = [self]\n if (selector) receivers = Array.from(document.querySelectorAll(selector))\n\n if (receiver) {\n receivers = receivers.map(r => {\n let context = r\n const chain = receiver.split('.')\n while (chain.length > 0) context = context[chain.shift()]\n return context\n })\n }\n\n switch (method) {\n case 'dispatchEvent':\n const evt = new CustomEvent(args[0], args[1] || {})\n receivers.forEach(r => r.dispatchEvent(evt))\n break\n default:\n receivers.forEach(r => r[method].apply(r, args))\n }\n}\n\nfunction initialize () {\n streamActions.invoke = invoke\n}\n\nexport default { initialize }\n"],
5
- "mappings": "AAAA,SAASA,GAAU,CACjB,IAAMC,EAAU,KAAK,MAAM,KAAK,gBAAgB,WAAW,EACrD,CAAE,GAAAC,EAAI,OAAAC,EAAQ,KAAAC,EAAM,SAAAC,EAAU,SAAAC,CAAS,EAAIL,EAC7CM,EAAY,CAAC,IAAI,EAYrB,OAXID,IAAUC,EAAY,MAAM,KAAK,SAAS,iBAAiBD,CAAQ,CAAC,GAEpED,IACFE,EAAYA,EAAU,IAAIC,GAAK,CAC7B,IAAIC,EAAUD,EACRE,EAAQL,EAAS,MAAM,GAAG,EAChC,KAAOK,EAAM,OAAS,GAAGD,EAAUA,EAAQC,EAAM,MAAM,GACvD,OAAOD,CACT,CAAC,GAGKN,OACD,gBACH,IAAMQ,EAAM,IAAI,YAAYP,EAAK,GAAIA,EAAK,IAAM,CAAC,CAAC,EAClDG,EAAU,QAAQC,GAAKA,EAAE,cAAcG,CAAG,CAAC,EAC3C,cAEAJ,EAAU,QAAQC,GAAKA,EAAEL,GAAQ,MAAMK,EAAGJ,CAAI,CAAC,EAErD,CAEA,SAASQ,GAAc,CACrB,cAAc,OAASZ,CACzB,CAEA,IAAOa,EAAQ,CAAE,WAAAD,CAAW",
6
- "names": ["invoke", "payload", "id", "method", "args", "receiver", "selector", "receivers", "r", "context", "chain", "evt", "initialize", "turbo_ready_default"]
4
+ "sourcesContent": ["function invoke () {\n const payload = JSON.parse(this.templateContent.textContent)\n const { id, method, args, receiver, selector } = payload\n let receivers = [self]\n if (selector) receivers = Array.from(document.querySelectorAll(selector))\n\n if (receiver) {\n receivers = receivers.map(r => {\n let context = r\n const chain = receiver.split('.')\n while (chain.length > 0) context = context[chain.shift()]\n return context\n })\n }\n\n switch (method) {\n case 'dispatchEvent':\n const evt = new CustomEvent(args[0], args[1] || {})\n receivers.forEach(r => r.dispatchEvent(evt))\n break\n default:\n receivers.forEach(r => r[method].apply(r, args))\n }\n}\n\nfunction initialize (streamActions) {\n streamActions.invoke = invoke\n}\n\nexport default { initialize }\n"],
5
+ "mappings": "AAAA,SAASA,GAAU,CACjB,IAAMC,EAAU,KAAK,MAAM,KAAK,gBAAgB,WAAW,EACrD,CAAE,GAAAC,EAAI,OAAAC,EAAQ,KAAAC,EAAM,SAAAC,EAAU,SAAAC,CAAS,EAAIL,EAC7CM,EAAY,CAAC,IAAI,EAYrB,OAXID,IAAUC,EAAY,MAAM,KAAK,SAAS,iBAAiBD,CAAQ,CAAC,GAEpED,IACFE,EAAYA,EAAU,IAAIC,GAAK,CAC7B,IAAIC,EAAUD,EACRE,EAAQL,EAAS,MAAM,GAAG,EAChC,KAAOK,EAAM,OAAS,GAAGD,EAAUA,EAAQC,EAAM,MAAM,GACvD,OAAOD,CACT,CAAC,GAGKN,OACD,gBACH,IAAMQ,EAAM,IAAI,YAAYP,EAAK,GAAIA,EAAK,IAAM,CAAC,CAAC,EAClDG,EAAU,QAAQC,GAAKA,EAAE,cAAcG,CAAG,CAAC,EAC3C,cAEAJ,EAAU,QAAQC,GAAKA,EAAEL,GAAQ,MAAMK,EAAGJ,CAAI,CAAC,EAErD,CAEA,SAASQ,EAAYC,EAAe,CAClCA,EAAc,OAASb,CACzB,CAEA,IAAOc,EAAQ,CAAE,WAAAF,CAAW",
6
+ "names": ["invoke", "payload", "id", "method", "args", "receiver", "selector", "receivers", "r", "context", "chain", "evt", "initialize", "streamActions", "turbo_ready_default"]
7
7
  }
@@ -23,7 +23,7 @@ function invoke () {
23
23
  }
24
24
  }
25
25
 
26
- function initialize () {
26
+ function initialize (streamActions) {
27
27
  streamActions.invoke = invoke
28
28
  }
29
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurboReady
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo_ready",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Take full control of the DOM with Turbo Streams",
5
5
  "main": "app/assets/builds/turbo_ready.js",
6
6
  "repository": "https://github.com/hopsoft/turbo_ready",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_ready
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Hopkins (hopsoft)