turbo-rails 0.8.0 → 0.8.1

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: 53322c9735f1d41eb97512711037e8143fcaf903a60ed69b724a03c1859e329a
4
- data.tar.gz: 2fddfbb67fc6b44ca622f2b33e7eef51130115759929f2f5e5a96fb060980582
3
+ metadata.gz: c262e76eb847e212773e7befcc963473e87b06f2bf01eefdff938cff52eb1779
4
+ data.tar.gz: ced8870cfb3301bcd13b551f47bf327400780e9a72844547a482ff3207ca4481
5
5
  SHA512:
6
- metadata.gz: 5867df95abc9376ff2f0df5be93545b2a3814853447b8a5a4c971b114066b041a8f8b9aa62faa537bdeae7402495e0395b9ae01a707dd2d8688b9f79ca51618f
7
- data.tar.gz: 30057544c5b4bbf376903bb88c12759c90829243700273228b2a521ccd96dabac185c403856b1d471e71ed7aa53802a1afdc6cd783e1ed7ae0ab83513355d1ce
6
+ metadata.gz: 29ef07542ceea019544fc6ecc3598452c21122d271c5805d211f2d932d449dc9288d09adaaf9ffcc910ddb1ab2feb53174a39adf8e80515efbe61eb2fde4833d
7
+ data.tar.gz: 12685cf32b4aef76070124bb52705b508363f330d7e465e7466c3a727d07c8b0299c15f315297390b0561b6881d5310e4e60e656fe7fe1337f3cfa3fcd5f854c
@@ -30,10 +30,17 @@ function clickCaptured(event) {
30
30
  }
31
31
 
32
32
  (function() {
33
- if ("SubmitEvent" in window) return;
34
33
  if ("submitter" in Event.prototype) return;
34
+ let prototype;
35
+ if ("SubmitEvent" in window && /Apple Computer/.test(navigator.vendor)) {
36
+ prototype = window.SubmitEvent.prototype;
37
+ } else if ("SubmitEvent" in window) {
38
+ return;
39
+ } else {
40
+ prototype = window.Event.prototype;
41
+ }
35
42
  addEventListener("click", clickCaptured, true);
36
- Object.defineProperty(Event.prototype, "submitter", {
43
+ Object.defineProperty(prototype, "submitter", {
37
44
  get() {
38
45
  if (this.type == "submit" && this.target instanceof HTMLFormElement) {
39
46
  return submittersByForm.get(this.target);
@@ -734,8 +741,8 @@ class Snapshot {
734
741
  class FormInterceptor {
735
742
  constructor(delegate, element) {
736
743
  this.submitBubbled = event => {
737
- if (event.target instanceof HTMLFormElement) {
738
- const form = event.target;
744
+ const form = event.target;
745
+ if (form instanceof HTMLFormElement && form.closest("turbo-frame, html") == this.element) {
739
746
  const submitter = event.submitter || undefined;
740
747
  if (this.delegate.shouldInterceptFormSubmission(form, submitter)) {
741
748
  event.preventDefault();
@@ -2593,7 +2600,7 @@ class Session {
2593
2600
  this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);
2594
2601
  }
2595
2602
  willSubmitForm(form, submitter) {
2596
- return this.elementDriveEnabled(form) && this.elementDriveEnabled(submitter);
2603
+ return this.elementDriveEnabled(form) && (!submitter || this.elementDriveEnabled(submitter));
2597
2604
  }
2598
2605
  formSubmitted(form, submitter) {
2599
2606
  this.navigator.submitForm(form, submitter);
@@ -2752,7 +2759,7 @@ const deprecatedLocationPropertyDescriptors = {
2752
2759
 
2753
2760
  const session = new Session;
2754
2761
 
2755
- const {navigator: navigator} = session;
2762
+ const {navigator: navigator$1} = session;
2756
2763
 
2757
2764
  function start() {
2758
2765
  session.start();
@@ -2788,7 +2795,7 @@ function setProgressBarDelay(delay) {
2788
2795
 
2789
2796
  var Turbo = Object.freeze({
2790
2797
  __proto__: null,
2791
- navigator: navigator,
2798
+ navigator: navigator$1,
2792
2799
  session: session,
2793
2800
  PageRenderer: PageRenderer,
2794
2801
  PageSnapshot: PageSnapshot,
@@ -3263,7 +3270,7 @@ var turbo_es2017Esm = Object.freeze({
3263
3270
  clearCache: clearCache,
3264
3271
  connectStreamSource: connectStreamSource,
3265
3272
  disconnectStreamSource: disconnectStreamSource,
3266
- navigator: navigator,
3273
+ navigator: navigator$1,
3267
3274
  registerAdapter: registerAdapter,
3268
3275
  renderStreamMessage: renderStreamMessage,
3269
3276
  session: session,
data/lib/turbo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-09-24 00:00:00.000000000 Z
13
+ date: 2021-09-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails