stimulus_reflex 3.5.0.pre10 → 3.5.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of stimulus_reflex might be problematic. Click here for more details.

Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +10 -10
  3. data/README.md +3 -3
  4. data/app/assets/javascripts/stimulus_reflex.js +319 -23
  5. data/app/assets/javascripts/stimulus_reflex.umd.js +316 -25
  6. data/app/channels/stimulus_reflex/channel.rb +1 -18
  7. data/lib/generators/stimulus_reflex/stimulus_reflex_generator.rb +4 -10
  8. data/lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt +1 -1
  9. data/lib/generators/stimulus_reflex/templates/app/reflexes/application_reflex.rb.tt +1 -1
  10. data/lib/generators/stimulus_reflex/templates/config/initializers/cable_ready.rb +5 -0
  11. data/lib/install/development.rb +2 -2
  12. data/lib/install/importmap.rb +3 -3
  13. data/lib/stimulus_reflex/cable_ready_channels.rb +1 -0
  14. data/lib/stimulus_reflex/engine.rb +0 -4
  15. data/lib/stimulus_reflex/importmap.rb +3 -3
  16. data/lib/stimulus_reflex/installer.rb +2 -2
  17. data/lib/stimulus_reflex/reflex.rb +17 -8
  18. data/lib/stimulus_reflex/reflex_data.rb +6 -2
  19. data/lib/stimulus_reflex/reflex_factory.rb +2 -1
  20. data/lib/stimulus_reflex/version.rb +1 -1
  21. data/lib/stimulus_reflex/version_checker.rb +54 -0
  22. data/lib/tasks/stimulus_reflex/stimulus_reflex.rake +0 -2
  23. data/package.json +10 -8
  24. data/rollup.config.mjs +0 -19
  25. data/stimulus_reflex.gemspec +2 -2
  26. data/yarn.lock +173 -168
  27. metadata +15 -12
  28. data/app/assets/javascripts/stimulus_reflex.min.js +0 -2
  29. data/app/assets/javascripts/stimulus_reflex.min.js.map +0 -1
  30. data/app/assets/javascripts/stimulus_reflex.umd.min.js +0 -1065
  31. data/app/assets/javascripts/stimulus_reflex.umd.min.js.map +0 -1
data/yarn.lock CHANGED
@@ -21,109 +21,109 @@
21
21
  resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.4.tgz#78aea1140a50c4d193e1f06a13b7f12c5e2cbeea"
22
22
  integrity sha512-2VGCk7I9tA9Ge73Km99+Qg87w0wzW4tgUruvWAn/gfey1ZXgmxZtyIRBebk35R1O8TbK77wujVtCnpsGpRy1kg==
23
23
 
24
- "@algolia/cache-browser-local-storage@4.14.3":
25
- version "4.14.3"
26
- resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.3.tgz#b9e0da012b2f124f785134a4d468ee0841b2399d"
27
- integrity sha512-hWH1yCxgG3+R/xZIscmUrWAIBnmBFHH5j30fY/+aPkEZWt90wYILfAHIOZ1/Wxhho5SkPfwFmT7ooX2d9JeQBw==
28
- dependencies:
29
- "@algolia/cache-common" "4.14.3"
30
-
31
- "@algolia/cache-common@4.14.3":
32
- version "4.14.3"
33
- resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.14.3.tgz#a78e9faee3dfec018eab7b0996e918e06b476ac7"
34
- integrity sha512-oZJofOoD9FQOwiGTzyRnmzvh3ZP8WVTNPBLH5xU5JNF7drDbRT0ocVT0h/xB2rPHYzOeXRrLaQQBwRT/CKom0Q==
35
-
36
- "@algolia/cache-in-memory@4.14.3":
37
- version "4.14.3"
38
- resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.14.3.tgz#96cefb942aeb80e51e6a7e29f25f4f7f3439b736"
39
- integrity sha512-ES0hHQnzWjeioLQf5Nq+x1AWdZJ50znNPSH3puB/Y4Xsg4Av1bvLmTJe7SY2uqONaeMTvL0OaVcoVtQgJVw0vg==
40
- dependencies:
41
- "@algolia/cache-common" "4.14.3"
42
-
43
- "@algolia/client-account@4.14.3":
44
- version "4.14.3"
45
- resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.14.3.tgz#6d7d032a65c600339ce066505c77013d9a9e4966"
46
- integrity sha512-PBcPb0+f5Xbh5UfLZNx2Ow589OdP8WYjB4CnvupfYBrl9JyC1sdH4jcq/ri8osO/mCZYjZrQsKAPIqW/gQmizQ==
47
- dependencies:
48
- "@algolia/client-common" "4.14.3"
49
- "@algolia/client-search" "4.14.3"
50
- "@algolia/transporter" "4.14.3"
51
-
52
- "@algolia/client-analytics@4.14.3":
53
- version "4.14.3"
54
- resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.14.3.tgz#ca409d00a8fff98fdcc215dc96731039900055dc"
55
- integrity sha512-eAwQq0Hb/aauv9NhCH5Dp3Nm29oFx28sayFN2fdOWemwSeJHIl7TmcsxVlRsO50fsD8CtPcDhtGeD3AIFLNvqw==
56
- dependencies:
57
- "@algolia/client-common" "4.14.3"
58
- "@algolia/client-search" "4.14.3"
59
- "@algolia/requester-common" "4.14.3"
60
- "@algolia/transporter" "4.14.3"
61
-
62
- "@algolia/client-common@4.14.3":
63
- version "4.14.3"
64
- resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.14.3.tgz#c44e48652b2121a20d7a40cfd68d095ebb4191a8"
65
- integrity sha512-jkPPDZdi63IK64Yg4WccdCsAP4pHxSkr4usplkUZM5C1l1oEpZXsy2c579LQ0rvwCs5JFmwfNG4ahOszidfWPw==
66
- dependencies:
67
- "@algolia/requester-common" "4.14.3"
68
- "@algolia/transporter" "4.14.3"
69
-
70
- "@algolia/client-personalization@4.14.3":
71
- version "4.14.3"
72
- resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.14.3.tgz#8f71325035aa2a5fa7d1d567575235cf1d6c654f"
73
- integrity sha512-UCX1MtkVNgaOL9f0e22x6tC9e2H3unZQlSUdnVaSKpZ+hdSChXGaRjp2UIT7pxmPqNCyv51F597KEX5WT60jNg==
74
- dependencies:
75
- "@algolia/client-common" "4.14.3"
76
- "@algolia/requester-common" "4.14.3"
77
- "@algolia/transporter" "4.14.3"
78
-
79
- "@algolia/client-search@4.14.3":
80
- version "4.14.3"
81
- resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.14.3.tgz#cf1e77549f5c3e73408ffe6441ede985fde69da0"
82
- integrity sha512-I2U7xBx5OPFdPLA8AXKUPPxGY3HDxZ4r7+mlZ8ZpLbI8/ri6fnu6B4z3wcL7sgHhDYMwnAE8Xr0AB0h3Hnkp4A==
83
- dependencies:
84
- "@algolia/client-common" "4.14.3"
85
- "@algolia/requester-common" "4.14.3"
86
- "@algolia/transporter" "4.14.3"
87
-
88
- "@algolia/logger-common@4.14.3":
89
- version "4.14.3"
90
- resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.14.3.tgz#87d4725e7f56ea5a39b605771b7149fff62032a7"
91
- integrity sha512-kUEAZaBt/J3RjYi8MEBT2QEexJR2kAE2mtLmezsmqMQZTV502TkHCxYzTwY2dE7OKcUTxi4OFlMuS4GId9CWPw==
92
-
93
- "@algolia/logger-console@4.14.3":
94
- version "4.14.3"
95
- resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.14.3.tgz#1f19f8f0a5ef11f01d1f9545290eb6a89b71fb8a"
96
- integrity sha512-ZWqAlUITktiMN2EiFpQIFCJS10N96A++yrexqC2Z+3hgF/JcKrOxOdT4nSCQoEPvU4Ki9QKbpzbebRDemZt/hw==
97
- dependencies:
98
- "@algolia/logger-common" "4.14.3"
99
-
100
- "@algolia/requester-browser-xhr@4.14.3":
101
- version "4.14.3"
102
- resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.3.tgz#bcf55cba20f58fd9bc95ee55793b5219f3ce8888"
103
- integrity sha512-AZeg2T08WLUPvDncl2XLX2O67W5wIO8MNaT7z5ii5LgBTuk/rU4CikTjCe2xsUleIZeFl++QrPAi4Bdxws6r/Q==
104
- dependencies:
105
- "@algolia/requester-common" "4.14.3"
106
-
107
- "@algolia/requester-common@4.14.3":
108
- version "4.14.3"
109
- resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.14.3.tgz#2d02fbe01afb7ae5651ae8dfe62d6c089f103714"
110
- integrity sha512-RrRzqNyKFDP7IkTuV3XvYGF9cDPn9h6qEDl595lXva3YUk9YSS8+MGZnnkOMHvjkrSCKfoLeLbm/T4tmoIeclw==
111
-
112
- "@algolia/requester-node-http@4.14.3":
113
- version "4.14.3"
114
- resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.14.3.tgz#72389e1c2e5d964702451e75e368eefe85a09d8f"
115
- integrity sha512-O5wnPxtDRPuW2U0EaOz9rMMWdlhwP0J0eSL1Z7TtXF8xnUeeUyNJrdhV5uy2CAp6RbhM1VuC3sOJcIR6Av+vbA==
116
- dependencies:
117
- "@algolia/requester-common" "4.14.3"
118
-
119
- "@algolia/transporter@4.14.3":
120
- version "4.14.3"
121
- resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.14.3.tgz#5593036bd9cf2adfd077fdc3e81d2e6118660a7a"
122
- integrity sha512-2qlKlKsnGJ008exFRb5RTeTOqhLZj0bkMCMVskxoqWejs2Q2QtWmsiH98hDfpw0fmnyhzHEt0Z7lqxBYp8bW2w==
123
- dependencies:
124
- "@algolia/cache-common" "4.14.3"
125
- "@algolia/logger-common" "4.14.3"
126
- "@algolia/requester-common" "4.14.3"
24
+ "@algolia/cache-browser-local-storage@4.15.0":
25
+ version "4.15.0"
26
+ resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.15.0.tgz#84f12aec6b6aa69542a3bfd3a4ba458ed2cc8230"
27
+ integrity sha512-uxxFhTWh4JJDb2+FFSmNMfEQ8p9o2vjSpU7iW007QX3OvqljPPN68lk3bpZVaG8pwr5MU1DqpkZ71FcQdVTjgQ==
28
+ dependencies:
29
+ "@algolia/cache-common" "4.15.0"
30
+
31
+ "@algolia/cache-common@4.15.0":
32
+ version "4.15.0"
33
+ resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.15.0.tgz#a198098c4b8fa6ef661879ec22d2a2d1ad77d2bb"
34
+ integrity sha512-Me3PbI4QurAM+3D+htIE0l1xt6+bl/18SG6Wc7bPQEZAtN7DTGz22HqhKNyLF2lR/cOfpaH7umXZlZEhIHf7gQ==
35
+
36
+ "@algolia/cache-in-memory@4.15.0":
37
+ version "4.15.0"
38
+ resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.15.0.tgz#77cac4db36a0aa0837f7a7ceb760188191e35268"
39
+ integrity sha512-B9mg1wd7CKMfpkbiTQ8KlcKkH6ut/goVaI6XmDCUczOOqeuZlV34tuEi7o3Xo1j66KWr/d9pMjjGYcoVPCVeOA==
40
+ dependencies:
41
+ "@algolia/cache-common" "4.15.0"
42
+
43
+ "@algolia/client-account@4.15.0":
44
+ version "4.15.0"
45
+ resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.15.0.tgz#8e0723052169665b4449dc2f8bcf3075feb6a424"
46
+ integrity sha512-8wqI33HRZy5ydfFt6F5vMhtkOiAUhVfSCYXx4U3Go5RALqWLgVUp6wzOo0mr1z08POCkHDpbQMQvyayb1CZ/kw==
47
+ dependencies:
48
+ "@algolia/client-common" "4.15.0"
49
+ "@algolia/client-search" "4.15.0"
50
+ "@algolia/transporter" "4.15.0"
51
+
52
+ "@algolia/client-analytics@4.15.0":
53
+ version "4.15.0"
54
+ resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.15.0.tgz#6b8fe450e1bba114b0d0598cbf9acac482798a36"
55
+ integrity sha512-jrPjEeNEIIQKeA1XCZXx3f3aybtwF7wjYlnfHbLARuZ9AuHzimOKjX0ZwqvMmvTsHivpcZ2rqY+j1E8HoH1ELA==
56
+ dependencies:
57
+ "@algolia/client-common" "4.15.0"
58
+ "@algolia/client-search" "4.15.0"
59
+ "@algolia/requester-common" "4.15.0"
60
+ "@algolia/transporter" "4.15.0"
61
+
62
+ "@algolia/client-common@4.15.0":
63
+ version "4.15.0"
64
+ resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.15.0.tgz#27dd9441aedf481736696d519e55ea8e2f5a4432"
65
+ integrity sha512-PlsJMObZuYw4JlG5EhYv1PHDOv7n5mD5PzqFyoNfSOYaEPRZepa3W579ya29yOu3FZ0VGMNJmB7Q5v/+/fwvIw==
66
+ dependencies:
67
+ "@algolia/requester-common" "4.15.0"
68
+ "@algolia/transporter" "4.15.0"
69
+
70
+ "@algolia/client-personalization@4.15.0":
71
+ version "4.15.0"
72
+ resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.15.0.tgz#6f10eda827d2607ab6c2341464cd35107bf8cf99"
73
+ integrity sha512-Bf0bhRAiNL9LWurzyHRH8UBi4fDt3VbCNkInxVngKQT1uCZWXecwoPWGhcSSpdanBqFJA/1WBt+BWx7a50Bhlg==
74
+ dependencies:
75
+ "@algolia/client-common" "4.15.0"
76
+ "@algolia/requester-common" "4.15.0"
77
+ "@algolia/transporter" "4.15.0"
78
+
79
+ "@algolia/client-search@4.15.0":
80
+ version "4.15.0"
81
+ resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.15.0.tgz#2d849faae7943fcc983ac923eac767666a9e6a9a"
82
+ integrity sha512-dTwZD4u53WdmexnMcoO2Qd/+YCP3ESXKOtD2MryQ1a9dHwB2Y3Qob0kyS1PG82idwM3enbznvscI9Sf4o9PUWQ==
83
+ dependencies:
84
+ "@algolia/client-common" "4.15.0"
85
+ "@algolia/requester-common" "4.15.0"
86
+ "@algolia/transporter" "4.15.0"
87
+
88
+ "@algolia/logger-common@4.15.0":
89
+ version "4.15.0"
90
+ resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.15.0.tgz#a2cf3d3abbdd00594006164302600ba46d75059f"
91
+ integrity sha512-D8OFwn/HpvQz66goIcjxOKsYBMuxiruxJ3cA/bnc0EiDvSA2P2z6bNQWgS5gbstuTZIJmbhr+53NyOxFkmMNAA==
92
+
93
+ "@algolia/logger-console@4.15.0":
94
+ version "4.15.0"
95
+ resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.15.0.tgz#8a0948b0c16ad546af9dd14b9021f21f42737c97"
96
+ integrity sha512-pQOvVaRSEJQJRXKTnxEA6nN1hipSQadJJ4einw0nIlfMOGZh/kps1ybh8vRUlUGyfEuN/3dyFs0W3Ac7hIItlg==
97
+ dependencies:
98
+ "@algolia/logger-common" "4.15.0"
99
+
100
+ "@algolia/requester-browser-xhr@4.15.0":
101
+ version "4.15.0"
102
+ resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.15.0.tgz#38b5956d01408ad4291d89915df921ff8534cca6"
103
+ integrity sha512-va186EfALF+6msYZXaoBSxcnFCg3SoWJ+uv1yMyhQRJRe7cZSHWSVT3s40vmar90gxlBu80KMVwVlsvJhJv6ew==
104
+ dependencies:
105
+ "@algolia/requester-common" "4.15.0"
106
+
107
+ "@algolia/requester-common@4.15.0":
108
+ version "4.15.0"
109
+ resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.15.0.tgz#c68ad3dccc1de71b5be9b08a07e2baf58ec49d82"
110
+ integrity sha512-w0UUzxElbo4hrKg4QP/jiXDNbIJuAthxdlkos9nS8KAPK2XI3R9BlUjLz/ZVs4F9TDGI0mhjrNHhZ12KXcoyhg==
111
+
112
+ "@algolia/requester-node-http@4.15.0":
113
+ version "4.15.0"
114
+ resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.15.0.tgz#02f841586e620c7b4e4e555f315cd52dd815f330"
115
+ integrity sha512-eeEOhFtgwKcgAlKAZpgBRZJ0ILSEBCXxZ9uwfVWPD24W1b6z08gVoTJ6J7lCeCnJmudg+tMElDnGzHkjup9CJA==
116
+ dependencies:
117
+ "@algolia/requester-common" "4.15.0"
118
+
119
+ "@algolia/transporter@4.15.0":
120
+ version "4.15.0"
121
+ resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.15.0.tgz#c65c512206c66aadc2897337220ae5454001967e"
122
+ integrity sha512-JoWR+ixG3EmA0UPntQFN/FV5TasYcYu93d5+oKzHFeZ6Z7rtW5Im9iy/Oh/ggk1AAN5fTdqKewtbBpdaYDbKsQ==
123
+ dependencies:
124
+ "@algolia/cache-common" "4.15.0"
125
+ "@algolia/logger-common" "4.15.0"
126
+ "@algolia/requester-common" "4.15.0"
127
127
 
128
128
  "@angular/compiler@8.2.14":
129
129
  version "8.2.14"
@@ -166,9 +166,9 @@
166
166
  integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==
167
167
 
168
168
  "@babel/parser@^7.16.4":
169
- version "7.21.0"
170
- resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.0.tgz#cc09288743b867763cb927ba101ccdf0b600b7e4"
171
- integrity sha512-ONjtg4renj14A9pj3iA5T5+r5Eijxbr2eNIkMBTC74occDSsRZUpe8vowmowAjFR1imWlkD8eEmjYXiREZpGZg==
169
+ version "7.21.2"
170
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3"
171
+ integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==
172
172
 
173
173
  "@babel/runtime@^7.8.7":
174
174
  version "7.21.0"
@@ -342,7 +342,7 @@
342
342
  resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.41.4.tgz#508fd82ca40305416e130f0da7b537295ded7989"
343
343
  integrity sha512-DwS94K+M0vtG+cymxH0rslJr09qpdjyOLdCjmpKcG/nNiZQfMA1ybAaFEmwk9UaVlUG9STENFeQwyrLevJB+7g==
344
344
 
345
- "@hotwired/stimulus@>= 3.0, < 4":
345
+ "@hotwired/stimulus@^3":
346
346
  version "3.2.1"
347
347
  resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.1.tgz#e3de23623b0c52c247aba4cd5d530d257008676b"
348
348
  integrity sha512-HGlzDcf9vv/EQrMJ5ZG6VWNs8Z/xMN+1o2OhV1gKiSG6CqZt5MCBB1gRg5ILiN3U0jEAxuDTNPRfBcnZBDmupQ==
@@ -487,7 +487,7 @@
487
487
  "@types/sinon-chai" "^3.2.3"
488
488
  chai-a11y-axe "^1.3.2"
489
489
 
490
- "@rails/actioncable@>= 6.0, < 8":
490
+ "@rails/actioncable@^6 || ^7":
491
491
  version "7.0.4"
492
492
  resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.0.4.tgz#70a3ca56809f7aaabb80af2f9c01ae51e1a8ed41"
493
493
  integrity sha512-tz4oM+Zn9CYsvtyicsa/AwzKZKL+ITHWkhiu7x+xF77clh2b4Rm+s6xnOgY/sGDWoFWZmtKsE95hxBPkgQQNnQ==
@@ -742,9 +742,9 @@
742
742
  integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==
743
743
 
744
744
  "@types/node@*":
745
- version "18.14.0"
746
- resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.0.tgz#94c47b9217bbac49d4a67a967fdcdeed89ebb7d0"
747
- integrity sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A==
745
+ version "18.15.1"
746
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.1.tgz#41dc2bf78e8085a250d4670d95edb7fba621dd29"
747
+ integrity sha512-U2TWca8AeHSmbpi314QBESRk7oPjSZjDsR+c+H4ECC1l+kFgpZf8Ydhv3SJpPy51VyZHHqxlb6mTTqYNNRVAIw==
748
748
 
749
749
  "@types/parse5@^6.0.1":
750
750
  version "6.0.3"
@@ -774,9 +774,9 @@
774
774
  integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==
775
775
 
776
776
  "@types/serve-static@*":
777
- version "1.15.0"
778
- resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155"
779
- integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==
777
+ version "1.15.1"
778
+ resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.1.tgz#86b1753f0be4f9a1bee68d459fcda5be4ea52b5d"
779
+ integrity sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==
780
780
  dependencies:
781
781
  "@types/mime" "*"
782
782
  "@types/node" "*"
@@ -1121,10 +1121,10 @@
1121
1121
  "@types/mocha" "^8.2.0"
1122
1122
  "@web/test-runner-core" "^0.10.20"
1123
1123
 
1124
- "@web/test-runner@^0.15.0":
1125
- version "0.15.0"
1126
- resolved "https://registry.yarnpkg.com/@web/test-runner/-/test-runner-0.15.0.tgz#789d4599228b6e991bfeb14db4dfffb50b7ffb4a"
1127
- integrity sha512-8gliiQPRY4oDeq90i53mb5LiilCIzfW6SRGkmZ3K62c1DpOdZsCIgt7GH2OsFF8mB9rb4olK7qQ0gdmRgm27jw==
1124
+ "@web/test-runner@^0.15.1":
1125
+ version "0.15.1"
1126
+ resolved "https://registry.yarnpkg.com/@web/test-runner/-/test-runner-0.15.1.tgz#1cf973a4e7b5f68a4803fdc044584bee633b5fcc"
1127
+ integrity sha512-61L4mvDSvs8Dp3TdKe7WHc8kxHndHlGheWiIFEMgbfetJua6MZ4jyPThISIHSEq3LdAv9key2aDIdmyzk0YJ6w==
1128
1128
  dependencies:
1129
1129
  "@web/browser-logs" "^0.2.2"
1130
1130
  "@web/config-loader" "^0.1.3"
@@ -1192,24 +1192,24 @@ ajv@^6.10.0, ajv@^6.10.2:
1192
1192
  uri-js "^4.2.2"
1193
1193
 
1194
1194
  algoliasearch@^4.0.0:
1195
- version "4.14.3"
1196
- resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.14.3.tgz#f02a77a4db17de2f676018938847494b692035e7"
1197
- integrity sha512-GZTEuxzfWbP/vr7ZJfGzIl8fOsoxN916Z6FY2Egc9q2TmZ6hvq5KfAxY89pPW01oW/2HDEKA8d30f9iAH9eXYg==
1198
- dependencies:
1199
- "@algolia/cache-browser-local-storage" "4.14.3"
1200
- "@algolia/cache-common" "4.14.3"
1201
- "@algolia/cache-in-memory" "4.14.3"
1202
- "@algolia/client-account" "4.14.3"
1203
- "@algolia/client-analytics" "4.14.3"
1204
- "@algolia/client-common" "4.14.3"
1205
- "@algolia/client-personalization" "4.14.3"
1206
- "@algolia/client-search" "4.14.3"
1207
- "@algolia/logger-common" "4.14.3"
1208
- "@algolia/logger-console" "4.14.3"
1209
- "@algolia/requester-browser-xhr" "4.14.3"
1210
- "@algolia/requester-common" "4.14.3"
1211
- "@algolia/requester-node-http" "4.14.3"
1212
- "@algolia/transporter" "4.14.3"
1195
+ version "4.15.0"
1196
+ resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.15.0.tgz#8279576f06667a1d0705e8c22a17daa8e707b469"
1197
+ integrity sha512-+vgKQF5944dYsz9zhKk07JbOYeNdKisoD5GeG0woBL3nLzbn2a+nGwki60DXg7CXvaFXBcTXyJG4C+VaBVd44g==
1198
+ dependencies:
1199
+ "@algolia/cache-browser-local-storage" "4.15.0"
1200
+ "@algolia/cache-common" "4.15.0"
1201
+ "@algolia/cache-in-memory" "4.15.0"
1202
+ "@algolia/client-account" "4.15.0"
1203
+ "@algolia/client-analytics" "4.15.0"
1204
+ "@algolia/client-common" "4.15.0"
1205
+ "@algolia/client-personalization" "4.15.0"
1206
+ "@algolia/client-search" "4.15.0"
1207
+ "@algolia/logger-common" "4.15.0"
1208
+ "@algolia/logger-console" "4.15.0"
1209
+ "@algolia/requester-browser-xhr" "4.15.0"
1210
+ "@algolia/requester-common" "4.15.0"
1211
+ "@algolia/requester-node-http" "4.15.0"
1212
+ "@algolia/transporter" "4.15.0"
1213
1213
 
1214
1214
  angular-estree-parser@1.3.1:
1215
1215
  version "1.3.1"
@@ -1438,10 +1438,10 @@ bytes@3.1.2:
1438
1438
  resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
1439
1439
  integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==
1440
1440
 
1441
- cable_ready@5.0.0-pre10:
1442
- version "5.0.0-pre10"
1443
- resolved "https://registry.yarnpkg.com/cable_ready/-/cable_ready-5.0.0-pre10.tgz#e92ca5b481335dfff95ae148b7b0da86e98001c0"
1444
- integrity sha512-NevHcu5N5zzUKxyS/cYtkIY6mm7y1anQr9zxu65fqptMOBZS2fukXpz9YEn659yGKyqtCMVNrzkNtkICkBoGAQ==
1441
+ cable_ready@5.0.0-rc2:
1442
+ version "5.0.0-rc2"
1443
+ resolved "https://registry.yarnpkg.com/cable_ready/-/cable_ready-5.0.0-rc2.tgz#ccc99dfdd46a8358d6bdcbe285bed16b99220be5"
1444
+ integrity sha512-Yq5lDy8gQ7NHJIxL0ANFYn/I6/dpLZTUxDio1MfhSyrbJ21eYlieqO/2JnLey7l+FUq1JGDHT1/6egzF5e++rw==
1445
1445
  dependencies:
1446
1446
  morphdom "2.6.1"
1447
1447
 
@@ -1983,9 +1983,9 @@ errorstacks@^2.2.0:
1983
1983
  integrity sha512-5ecWhU5gt0a5G05nmQcgCxP5HperSMxLDzvWlT5U+ZSKkuDK0rJ3dbCQny6/vSCIXjwrhwSecXBbw1alr295hQ==
1984
1984
 
1985
1985
  es-module-lexer@^1.0.0:
1986
- version "1.1.1"
1987
- resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.1.1.tgz#d4fed363dcd94bf12586266f7b80bbee6d80ce6e"
1988
- integrity sha512-n3ruqU8Te7I5prBd6d0darM8ajFuVNhLWvgo04hN7goWSaSrxe7ENOZitac7akN0A2o+8fMomBDsNPvW/eE3CQ==
1986
+ version "1.2.0"
1987
+ resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.2.0.tgz#812264973b613195ba214f69a84e05b0f4241a67"
1988
+ integrity sha512-2BMfqBDeVCcOlLaL1ZAfp+D868SczNpKArrTM3dhpd7dK/OVlogzY15qpUngt+LMTq5UC/csb9vVQAgupucSbA==
1989
1989
 
1990
1990
  esbuild-android-64@0.14.54:
1991
1991
  version "0.14.54"
@@ -3911,9 +3911,9 @@ postcss@^8.1.10, postcss@^8.4.21:
3911
3911
  source-map-js "^1.0.2"
3912
3912
 
3913
3913
  preact@^10.0.0:
3914
- version "10.12.1"
3915
- resolved "https://registry.yarnpkg.com/preact/-/preact-10.12.1.tgz#8f9cb5442f560e532729b7d23d42fd1161354a21"
3916
- integrity sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==
3914
+ version "10.13.1"
3915
+ resolved "https://registry.yarnpkg.com/preact/-/preact-10.13.1.tgz#d220bd8771b8fa197680d4917f3cefc5eed88720"
3916
+ integrity sha512-KyoXVDU5OqTpG9LXlB3+y639JAGzl8JSBXLn1J9HTSB3gbKcuInga7bZnXLlxmK94ntTs1EFeZp0lrja2AuBYQ==
3917
3917
 
3918
3918
  prelude-ls@~1.1.2:
3919
3919
  version "1.1.2"
@@ -4049,9 +4049,9 @@ puppeteer-core@^13.1.3:
4049
4049
  ws "8.5.0"
4050
4050
 
4051
4051
  qs@^6.5.2:
4052
- version "6.11.0"
4053
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
4054
- integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
4052
+ version "6.11.1"
4053
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.1.tgz#6c29dff97f0c0060765911ba65cbc9764186109f"
4054
+ integrity sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==
4055
4055
  dependencies:
4056
4056
  side-channel "^1.0.4"
4057
4057
 
@@ -4068,9 +4068,9 @@ randombytes@^2.1.0:
4068
4068
  safe-buffer "^5.1.0"
4069
4069
 
4070
4070
  raw-body@^2.3.3:
4071
- version "2.5.1"
4072
- resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857"
4073
- integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==
4071
+ version "2.5.2"
4072
+ resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a"
4073
+ integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==
4074
4074
  dependencies:
4075
4075
  bytes "3.1.2"
4076
4076
  http-errors "2.0.0"
@@ -4078,9 +4078,9 @@ raw-body@^2.3.3:
4078
4078
  unpipe "1.0.0"
4079
4079
 
4080
4080
  readable-stream@^3.1.1, readable-stream@^3.4.0:
4081
- version "3.6.0"
4082
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
4083
- integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
4081
+ version "3.6.2"
4082
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
4083
+ integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
4084
4084
  dependencies:
4085
4085
  inherits "^2.0.3"
4086
4086
  string_decoder "^1.1.1"
@@ -4224,10 +4224,10 @@ rollup@^2.67.0:
4224
4224
  optionalDependencies:
4225
4225
  fsevents "~2.3.2"
4226
4226
 
4227
- rollup@^3.10.0, rollup@^3.17.1:
4228
- version "3.17.2"
4229
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.17.2.tgz#a4ecd29c488672a0606e41ef57474fad715750a9"
4230
- integrity sha512-qMNZdlQPCkWodrAZ3qnJtvCAl4vpQ8q77uEujVCCbC/6CLB7Lcmvjq7HyiOSnf4fxTT9XgsE36oLHJBH49xjqA==
4227
+ rollup@^3.10.0, rollup@^3.19.1:
4228
+ version "3.19.1"
4229
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.19.1.tgz#2b3a31ac1ff9f3afab2e523fa687fef5b0ee20fc"
4230
+ integrity sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==
4231
4231
  optionalDependencies:
4232
4232
  fsevents "~2.3.2"
4233
4233
 
@@ -4657,6 +4657,11 @@ to-regex-range@^5.0.1:
4657
4657
  dependencies:
4658
4658
  is-number "^7.0.0"
4659
4659
 
4660
+ toastify-js@^1.12.0:
4661
+ version "1.12.0"
4662
+ resolved "https://registry.yarnpkg.com/toastify-js/-/toastify-js-1.12.0.tgz#cc1c4f5c7e7380e854e20bedceb51980ea29f64d"
4663
+ integrity sha512-HeMHCO9yLPvP9k0apGSdPUWrUbLnxUKNFzgUoZp1PHCLploIX/4DSQ7V8H25ef+h4iO9n0he7ImfcndnN6nDrQ==
4664
+
4660
4665
  toidentifier@1.0.1:
4661
4666
  version "1.0.1"
4662
4667
  resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
@@ -4889,10 +4894,10 @@ vfile@^4.0.0:
4889
4894
  unist-util-stringify-position "^2.0.0"
4890
4895
  vfile-message "^2.0.0"
4891
4896
 
4892
- vite@^4.1.3:
4893
- version "4.1.3"
4894
- resolved "https://registry.yarnpkg.com/vite/-/vite-4.1.3.tgz#001a038c3a7757d532787c0de429b8368136ded5"
4895
- integrity sha512-0Zqo4/Fr/swSOBmbl+HAAhOjrqNwju+yTtoe4hQX9UsARdcuc9njyOdr6xU0DDnV7YP0RT6mgTTOiRtZgxfCxA==
4897
+ vite@^4.1.4:
4898
+ version "4.1.4"
4899
+ resolved "https://registry.yarnpkg.com/vite/-/vite-4.1.4.tgz#170d93bcff97e0ebc09764c053eebe130bfe6ca0"
4900
+ integrity sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==
4896
4901
  dependencies:
4897
4902
  esbuild "^0.16.14"
4898
4903
  postcss "^8.4.21"
@@ -4901,10 +4906,10 @@ vite@^4.1.3:
4901
4906
  optionalDependencies:
4902
4907
  fsevents "~2.3.2"
4903
4908
 
4904
- vitepress@^1.0.0-alpha.47:
4905
- version "1.0.0-alpha.47"
4906
- resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.0.0-alpha.47.tgz#3488f23d6239757208d269773eff49cf9e898b09"
4907
- integrity sha512-vj+LOY0WJtKSk98HV4qqG6p4MofmF+C8yrWHiiw+GCMfr6C+610U5D7oD2OruroIafsON6F4nBDWGK8ZyGIpXQ==
4909
+ vitepress@^1.0.0-alpha.56:
4910
+ version "1.0.0-alpha.56"
4911
+ resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.0.0-alpha.56.tgz#250a4388ddf2407ec81da7823ceab5c6822e7054"
4912
+ integrity sha512-FNoanHwmgWn4xZZcc8D34VKWcEs0F7e39xiVUahI7VzzI4VeiB+R/euYtPIUcTxIC2pRDhclw7/DO0JFYSGIpw==
4908
4913
  dependencies:
4909
4914
  "@docsearch/css" "^3.3.3"
4910
4915
  "@docsearch/js" "^3.3.3"
@@ -4913,7 +4918,7 @@ vitepress@^1.0.0-alpha.47:
4913
4918
  "@vueuse/core" "^9.13.0"
4914
4919
  body-scroll-lock "4.0.0-beta.0"
4915
4920
  shiki "^0.14.1"
4916
- vite "^4.1.3"
4921
+ vite "^4.1.4"
4917
4922
  vue "^3.2.47"
4918
4923
 
4919
4924
  vnopts@1.0.2:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0.pre10
4
+ version: 3.5.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-21 00:00:00.000000000 Z
11
+ date: 2023-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable
@@ -116,14 +116,14 @@ dependencies:
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 5.0.0.pre10
119
+ version: 5.0.0.rc2
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
- version: 5.0.0.pre10
126
+ version: 5.0.0.rc2
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: nokogiri
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -142,16 +142,22 @@ dependencies:
142
142
  name: rack
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - "~>"
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: '2.0'
147
+ version: '2'
148
+ - - "<"
149
+ - !ruby/object:Gem::Version
150
+ version: '4'
148
151
  type: :runtime
149
152
  prerelease: false
150
153
  version_requirements: !ruby/object:Gem::Requirement
151
154
  requirements:
152
- - - "~>"
155
+ - - ">="
153
156
  - !ruby/object:Gem::Version
154
- version: '2.0'
157
+ version: '2'
158
+ - - "<"
159
+ - !ruby/object:Gem::Version
160
+ version: '4'
155
161
  - !ruby/object:Gem::Dependency
156
162
  name: redis
157
163
  requirement: !ruby/object:Gem::Requirement
@@ -277,11 +283,7 @@ files:
277
283
  - README.md
278
284
  - Rakefile
279
285
  - app/assets/javascripts/stimulus_reflex.js
280
- - app/assets/javascripts/stimulus_reflex.min.js
281
- - app/assets/javascripts/stimulus_reflex.min.js.map
282
286
  - app/assets/javascripts/stimulus_reflex.umd.js
283
- - app/assets/javascripts/stimulus_reflex.umd.min.js
284
- - app/assets/javascripts/stimulus_reflex.umd.min.js.map
285
287
  - app/channels/stimulus_reflex/channel.rb
286
288
  - bin/console
287
289
  - bin/loc
@@ -362,6 +364,7 @@ files:
362
364
  - lib/stimulus_reflex/utils/logger.rb
363
365
  - lib/stimulus_reflex/utils/sanity_checker.rb
364
366
  - lib/stimulus_reflex/version.rb
367
+ - lib/stimulus_reflex/version_checker.rb
365
368
  - lib/tasks/stimulus_reflex/stimulus_reflex.rake
366
369
  - package.json
367
370
  - rollup.config.mjs
@@ -1,2 +0,0 @@
1
- import{Controller as e}from"@hotwired/stimulus";import{createConsumer as t}from"@rails/actioncable";import r,{Utils as l}from"cable_ready";let n=!0;var o={get enabled(){return n},get disabled(){return!n},get value(){return n},set(e){n=!!e},set deprecate(e){n=!!e}};let s=!1;var i={get enabled(){return s},get disabled(){return!s},get value(){return s},set(e){s=!!e},set debug(e){s=!!e}};const a={reflexAttribute:"data-reflex",reflexPermanentAttribute:"data-reflex-permanent",reflexRootAttribute:"data-reflex-root",reflexSuppressLoggingAttribute:"data-reflex-suppress-logging",reflexDatasetAttribute:"data-reflex-dataset",reflexDatasetAllAttribute:"data-reflex-dataset-all",reflexSerializeFormAttribute:"data-reflex-serialize-form",reflexFormSelectorAttribute:"data-reflex-form-selector",reflexIncludeInnerHtmlAttribute:"data-reflex-include-inner-html",reflexIncludeTextContentAttribute:"data-reflex-include-text-content"};let d={};var c={set(e){d={...a,...e.schema};for(const e in d){const t=e.slice(0,-9);Object.defineProperty(this,t,{get:()=>d[e],configurable:!0})}}};const{debounce:u,dispatch:m,xpathToElement:f,xpathToElementArray:p}=l,h=()=>{const e=window.crypto||window.msCrypto;return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^e.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))},g=(e,t=!0)=>"string"!=typeof e?"":(e=e.replace(/[\s_](.)/g,(e=>e.toUpperCase())).replace(/[\s_]/g,"").replace(/^(.)/,(e=>e.toLowerCase())),t&&(e=e.substr(0,1).toUpperCase()+e.substr(1)),e),x=f,b=p,v=(e,t={})=>m(document,e,t),y=e=>{if(""!==e.id)return"//*[@id='"+e.id+"']";if(e===document.body)return"/html/body";if("HTML"===e.nodeName)return"/html";let t=0;const r=e&&e.parentNode?e.parentNode.childNodes:[];for(var l=0;l<r.length;l++){const n=r[l];if(n===e){return`${y(e.parentNode)}/${e.tagName.toLowerCase()}[${t+1}]`}1===n.nodeType&&n.tagName===e.tagName&&t++}},E=["created","before","delivered","queued","after","finalized","success","error","halted","forbidden"];let w;const L=new Proxy({},{get:function(e,t){return E.includes(t)?Object.fromEntries(Object.entries(e).filter((([e,r])=>r.stage===t))):"last"===t?w:"all"===t?e:Reflect.get(...arguments)},set:function(e,t,r){return e[t]=r,w=r,!0}}),R=(e,t)=>{const r=e.controller[["before","after","finalize"].includes(t)?`${t}${g(e.action)}`:`${g(e.action,!1)}${g(t)}`],l=e.controller[["before","after","finalize"].includes(t)?`${t}Reflex`:`reflex${g(t)}`];"function"==typeof r&&r.call(e.controller,e.element,e.target,e.error,e.id,e.payload),"function"==typeof l&&l.call(e.controller,e.element,e.target,e.error,e.id,e.payload)},$=(e,t)=>{if(!e.controller.element.parentElement)return void(i.enabled&&!e.warned&&(console.warn(`StimulusReflex was not able execute callbacks or emit events for "${t}" or later life-cycle stages for this Reflex. The StimulusReflex Controller Element is no longer present in the DOM. Could you move the StimulusReflex Controller to an element higher in your DOM?`),e.warned=!0));e.stage=t,e.lifecycle.push(t);const r=`stimulus-reflex:${t}`,l=`${r}:${e.action}`,n={reflex:e.target,controller:e.controller,id:e.id,element:e.element,payload:e.payload},o={bubbles:!0,cancelable:!1,detail:n};e.controller.element.dispatchEvent(new CustomEvent(r,o)),e.controller.element.dispatchEvent(new CustomEvent(l,o)),window.jQuery&&(window.jQuery(e.controller.element).trigger(r,n),window.jQuery(e.controller.element).trigger(l,n))};document.addEventListener("stimulus-reflex:before",(e=>R(L[e.detail.id],"before")),!0),document.addEventListener("stimulus-reflex:queued",(e=>R(L[e.detail.id],"queued")),!0),document.addEventListener("stimulus-reflex:delivered",(e=>R(L[e.detail.id],"delivered")),!0),document.addEventListener("stimulus-reflex:success",(e=>{const t=L[e.detail.id];R(t,"success"),$(t,"after")}),!0),document.addEventListener("stimulus-reflex:nothing",(e=>$(L[e.detail.id],"success")),!0),document.addEventListener("stimulus-reflex:error",(e=>{const t=L[e.detail.id];R(t,"error"),$(t,"after")}),!0),document.addEventListener("stimulus-reflex:halted",(e=>R(L[e.detail.id],"halted")),!0),document.addEventListener("stimulus-reflex:forbidden",(e=>R(L[e.detail.id],"forbidden")),!0),document.addEventListener("stimulus-reflex:after",(e=>R(L[e.detail.id],"after")),!0),document.addEventListener("stimulus-reflex:finalize",(e=>R(L[e.detail.id],"finalize")),!0);let A={};var S={get app(){return A},set(e){A=e}};let C=!1;var O={get disabled(){return!C},set(e){C=e,o.enabled&&!C&&document.addEventListener("DOMContentLoaded",(()=>console.warn("Deprecation warning: the next version of StimulusReflex will standardize isolation mode, and the isolate option will be removed.\nPlease update your applications to assume that every tab will be isolated. Use CableReady operations to broadcast updates to other tabs and users.")),{once:!0})}};class _{constructor(e,t){this.data=e.valueOf(),this.controller=t,this.element=e.reflexElement,this.id=e.id,this.error=null,this.payload=null,this.stage="created",this.lifecycle=["created"],this.warned=!1,this.target=e.target,this.action=e.target.split("#")[1],this.selector=null,this.morph=null,this.operation=null,this.timestamp=new Date,this.cloned=!1}get getPromise(){const e=new Promise(((e,t)=>{this.promise={resolve:e,reject:t,data:this.data}}));return e.id=this.id,Object.defineProperty(e,"reflexId",{get(){return o.enabled&&console.warn("reflexId is deprecated and will be removed from v4. Use id instead."),this.id}}),e.reflex=this,i.enabled&&e.catch((()=>{})),e}}const j=e=>{if(!e.cableReady)return;if(e.version.replace(".pre","-pre")!==r.version)return void(i.enabled&&console.error(`Reflex failed due to cable_ready gem/NPM package version mismatch. Package versions must match exactly.\nNote that if you are using pre-release builds, gems use the "x.y.z.preN" version format, while NPM packages use "x.y.z-preN".\n\ncable_ready gem: ${e.version}\ncable_ready NPM: ${r.version}`));let t,l=[];for(let t=e.operations.length-1;t>=0;t--)e.operations[t].stimulusReflex&&(l.push(e.operations[t]),e.operations.splice(t,1));if(l.some((e=>e.stimulusReflex.url!==location.href))&&i.enabled)console.error("Reflex failed due to mismatched URL.");else if(l.length&&(t=l[0].stimulusReflex,t.payload=l[0].payload),t){const{id:n,payload:o}=t;let s;if(!L[n]&&O.disabled){const e=x(t.xpathController),r=x(t.xpathElement);e.reflexController=e.reflexController||{},e.reflexData=e.reflexData||{},e.reflexError=e.reflexError||{};const l=S.app.getControllerForElementAndIdentifier(e,t.reflexController);e.reflexController[n]=l,e.reflexData[n]=t,s=new _(t,l),L[n]=s,s.cloned=!0,s.element=r,l.lastReflex=s,$(s,"before"),s.getPromise}else s=L[n];s&&(s.payload=o,s.totalOperations=l.length,s.pendingOperations=l.length,s.completedOperations=0,s.piggybackOperations=e.operations,r.perform(l))}else e.operations.length&&L[e.operations[0].reflexId]&&r.perform(e.operations)};let I,D,T,N;const k=()=>{N=!0,P(),v("stimulus-reflex:connected"),Object.values(L.queued).forEach((e=>{T.send(e.data),$(e,"delivered")}))},z=()=>{N=!1,P(),v("stimulus-reflex:rejected"),Debug.enabled&&console.warn("Channel subscription was rejected.")},F=e=>{N=!1,P(),v("stimulus-reflex:disconnected",e)},P=()=>{const e=document.body.classList;e.contains("stimulus-reflex-connected")||e.contains("stimulus-reflex-disconnected")?N?e.replace("stimulus-reflex-disconnected","stimulus-reflex-connected"):e.replace("stimulus-reflex-connected","stimulus-reflex-disconnected"):e.add(N?"stimulus-reflex-connected":"stimulus-reflex-disconnected")};var M={subscribe:e=>{if(T)return;I=I||e.application.consumer||t();const{channel:r}=e.StimulusReflex,l={channel:r,...D},n=JSON.stringify(l);T=I.subscriptions.findAll(n)[0]||I.subscriptions.create(l,{received:j,connected:k,rejected:z,disconnected:F})},deliver:e=>{N?(T.send(e.data),$(e,"delivered")):$(e,"queued")},initialize:(e,t)=>{I=e,D=t,document.addEventListener("DOMContentLoaded",(()=>{N=!1,P(),o.enabled&&e&&console.warn("Deprecation warning: the next version of StimulusReflex will obtain a reference to consumer via the Stimulus application object.\nPlease add 'application.consumer = consumer' to your index.js after your Stimulus application has been established, and remove the consumer key from your StimulusReflex initialize() options object.")})),document.addEventListener("turbolinks:load",P),document.addEventListener("turbo:load",P)}};const q=e=>e.cloned?"CLONED":`in ${new Date-e.timestamp}ms`,U=e=>e.totalOperations>1?` ${e.completedOperations}/${e.totalOperations}`:"";var H=e=>{i.disabled||e.data.suppressLogging||console.log(`↑ stimulus ↑ ${e.target}`,{id:e.id,args:e.data.args,controller:e.controller.identifier,element:e.element,controllerElement:e.controller.element})},B=e=>{if(i.disabled||e.data.suppressLogging)return;const t={id:e.id,morph:e.morph,payload:e.payload};"dispatch_event"!==e.operation&&(t.operation=e.operation),console.log(`↓ reflex ↓ ${e.target} → ${e.selector||"∞"}${U(e)} ${q(e)}`,t)},Q=e=>{i.disabled||e.data.suppressLogging||console.log(`↓ reflex ↓ ${e.target} ${q(e)} %cHALTED`,"color: #ffa500;",{id:e.id,payload:e.payload})},J=e=>{i.disabled||e.data.suppressLogging||console.log(`↓ reflex ↓ ${e.target} ${q(e)} %cFORBIDDEN`,"color: #BF40BF;",{id:e.id,payload:e.payload})},V=e=>{i.disabled||e.data.suppressLogging||console.log(`↓ reflex ↓ ${e.target} ${q(e)} %cERROR: ${e.error}`,"color: #f00;",{id:e.id,payload:e.payload})};const W=(e=[])=>{const t=Array.from(new Set(e.filter((e=>e&&String(e).length)).map((e=>e.trim())))).join(" ").trim();return t.length>0?t:null},Z=e=>e&&e.length?e.split(" ").filter((e=>e.trim().length)):[],G=e=>{let t=Array.from(e.attributes).reduce(((e,t)=>(e[t.name]=t.value,e)),{});if(t.checked=!!e.checked,t.selected=!!e.selected,t.tag_name=e.tagName,e.tagName.match(/select/i)||(e=>!!["checkbox","radio"].includes(e.type)&&document.querySelectorAll(`input[type="${e.type}"][name="${e.name}"]`).length>1)(e)){const r=(e=>Array.from(e.querySelectorAll("option:checked")).concat(Array.from(document.querySelectorAll(`input[type="${e.type}"][name="${e.name}"]`)).filter((e=>e.checked))).map((e=>e.value)))(e);t.values=r,t.value=r.join(",")}else t.value=e.value;return t},K=(e,t)=>{if(!t||0===t.length)return[];let r=[e];const l=y(e);return t.forEach((e=>{try{switch(e){case"combined":o.enabled&&console.warn("In the next version of StimulusReflex, the 'combined' option to data-reflex-dataset will become 'ancestors'."),r=[...r,...b(`${l}/ancestor::*`,!0)];break;case"ancestors":r=[...r,...b(`${l}/ancestor::*`,!0)];break;case"parent":r=[...r,...b(`${l}/parent::*`)];break;case"siblings":r=[...r,...b(`${l}/preceding-sibling::*|${l}/following-sibling::*`)];break;case"children":r=[...r,...b(`${l}/child::*`)];break;case"descendants":r=[...r,...b(`${l}/descendant::*`)];break;default:r=[...r,...document.querySelectorAll(e)]}}catch(e){i.enabled&&console.error(e)}})),r},X=e=>{let t={};return e&&e.attributes&&Array.from(e.attributes).forEach((e=>{e.name.startsWith("data-")&&(t[e.name]=e.value)})),t};var Y="3.5.0-pre10";class ee{constructor(e,t,r,l,n,o,s,i,a){this.options=e,this.reflexElement=t,this.controllerElement=r,this.reflexController=l,this.permanentAttributeName=n,this.target=o,this.args=s,this.url=i,this.tabId=a}get attrs(){return this._attrs=this._attrs||this.options.attrs||G(this.reflexElement),this._attrs}get id(){return this._id=this._id||this.options.id||h(),this._id}get selectors(){return this._selectors=this._selectors||this.options.selectors||(e=>{let t=[];for(;0===t.length&&e;){let r=e.getAttribute(c.reflexRoot);if(r){0===r.length&&e.id&&(r=`#${e.id}`);const l=r.split(",").filter((e=>e.trim().length));i.enabled&&0===l.length&&console.error(`No value found for ${c.reflexRoot}. Add an #id to the element or provide a value for ${c.reflexRoot}.`,e),t=t.concat(l.filter((e=>document.querySelector(e))))}e=e.parentElement?e.parentElement.closest(`[${c.reflexRoot}]`):null}return t})(this.reflexElement),"string"==typeof this._selectors?[this._selectors]:this._selectors}get resolveLate(){return this.options.resolveLate||!1}get dataset(){return this._dataset=this._dataset||(e=>{const t=e.attributes[c.reflexDataset],r=e.attributes[c.reflexDatasetAll],l=t&&t.value.split(" ")||[],n=r&&r.value.split(" ")||[],o=K(e,l),s=K(e,n),i=o.reduce(((e,t)=>({...X(t),...e})),{}),a={dataset:{...X(e),...i},datasetAll:{}};return s.forEach((e=>{const t=X(e);Object.keys(t).forEach((e=>{const r=t[e];a.datasetAll[e]&&Array.isArray(a.datasetAll[e])?a.datasetAll[e].push(r):a.datasetAll[e]=[r]}))})),a})(this.reflexElement),this._dataset}get innerHTML(){return this.includeInnerHtml?this.reflexElement.innerHTML:""}get textContent(){return this.includeTextContent?this.reflexElement.textContent:""}get xpathController(){return y(this.controllerElement)}get xpathElement(){return y(this.reflexElement)}get formSelector(){const e=this.reflexElement.attributes[c.reflexFormSelector]?this.reflexElement.attributes[c.reflexFormSelector].value:void 0;return this.options.formSelector||e}get includeInnerHtml(){const e=this.reflexElement.attributes[c.reflexIncludeInnerHtml]||!1;return!(!this.options.includeInnerHTML&&!e)&&"false"!==e.value}get includeTextContent(){const e=this.reflexElement.attributes[c.reflexIncludeTextContent]||!1;return!(!this.options.includeTextContent&&!e)&&"false"!==e.value}get suppressLogging(){return this.options.suppressLogging||this.reflexElement.attributes[c.reflexSuppressLogging]||!1}valueOf(){return{attrs:this.attrs,dataset:this.dataset,selectors:this.selectors,id:this.id,resolveLate:this.resolveLate,suppressLogging:this.suppressLogging,xpathController:this.xpathController,xpathElement:this.xpathElement,inner_html:this.innerHTML,text_content:this.textContent,formSelector:this.formSelector,reflexController:this.reflexController,permanentAttributeName:this.permanentAttributeName,target:this.target,args:this.args,url:this.url,tabId:this.tabId,version:Y}}}let te={};var re={get plugin(){return te},set(e){te=e}};const le=e=>{const{stimulusReflex:t}=e.detail||{};if(!t)return;const r=L[t.id];r.pendingOperations--,r.pendingOperations>0||(t.resolveLate||setTimeout((()=>r.promise.resolve({element:r.element,event:e,data:r.data,payload:r.payload,id:r.id,toString:()=>""}))),setTimeout((()=>$(r,"success"))))},ne=e=>{const{stimulusReflex:t}=e.detail||{};if(!t)return;const l=L[t.id];l.completedOperations++,l.selector=e.detail.selector,l.morph=e.detail.stimulusReflex.morph,l.operation=e.type.split(":")[1].split("-").slice(1).join("_"),B(l),l.completedOperations<l.totalOperations||(t.resolveLate&&setTimeout((()=>l.promise.resolve({element:l.element,event:e,data:l.data,payload:l.payload,id:l.id,toString:()=>""}))),setTimeout((()=>$(l,"finalize"))),l.piggybackOperations.length&&r.perform(l.piggybackOperations))},oe=(e,t)=>{B(e),setTimeout((()=>e.promise.resolve({data:e.data,element:e.element,event:t,payload:e.payload,id:e.id,toString:()=>""})))},se=(e,t)=>{Q(e,t),setTimeout((()=>e.promise.resolve({data:e.data,element:e.element,event:t,payload:e.payload,id:e.id,toString:()=>""})))},ie=(e,t)=>{J(e,t),setTimeout((()=>e.promise.resolve({data:e.data,element:e.element,event:t,payload:e.payload,id:e.id,toString:()=>""})))},ae=(e,t)=>{V(e,t),setTimeout((()=>e.promise.reject({data:e.data,element:e.element,event:t,payload:e.payload,id:e.id,error:e.error,toString:()=>e.error})))},de=e=>Z(e.getAttribute(c.controller)).reduce(((t,r)=>{const l=S.app.getControllerForElementAndIdentifier(e,r);return l&&l.StimulusReflex&&t.push(l),t}),[]),ce=u((()=>{document.querySelectorAll(`[${c.reflex}]`).forEach((e=>ue(e)))}),20),ue=e=>{const t=e.getAttribute(c.controller),r=Z(t),l=e.getAttribute(c.reflex),n=Z(l),o=e.getAttribute(c.action),s=Z(o).filter((e=>!e.includes("#__perform")));n.forEach((t=>{const l=((e,t)=>t.find((t=>{if(t.identifier)return(e=>{const t=e.match(/(?:.*->)?(.*?)(?:Reflex)?#/);return t?t[1]:""})(e).replace(/([a-z0–9])([A-Z])/g,"$1-$2").replace(/(::)/g,"--").toLowerCase()===t.identifier}))||t[0])(t,(e=>{let t=[];for(;e;)t=t.concat(de(e)),e=e.parentElement;return t})(e)),n=l?l.identifier:"stimulus-reflex";s.push(`${t.split("->")[0]}->${n}#__perform`),r.push(n)}));const i=W(r),a=W(s);let d=!1;i&&e.getAttribute(c.controller)!=i&&(e.setAttribute(c.controller,i),d=!0),a&&e.getAttribute(c.action)!=a&&(e.setAttribute(c.action,a),d=!0),d&&m(e,"stimulus-reflex:ready",{reflex:l,controller:i,action:a,element:e})};class me extends e{constructor(...e){super(...e),he(this)}}const fe=h(),pe=(e,{controller:t,consumer:r,debug:l,params:n,isolate:s,deprecate:a,transport:d}={})=>{re.set(d||M),re.plugin.initialize(r,n),O.set(!!s),S.set(e),c.set(e),S.app.register("stimulus-reflex",t||me),i.set(!!l),void 0!==a&&o.set(a);new MutationObserver(ce).observe(document.documentElement,{attributeFilter:[c.reflex,c.action],childList:!0,subtree:!0}),v("stimulus-reflex:initialized")},he=(e,t={})=>{e.StimulusReflex={...t,channel:"StimulusReflex::Channel"},re.plugin.subscribe(e),Object.assign(e,{stimulate(){const e=location.href,t=this.element,r=Array.from(arguments),l=r.shift()||"StimulusReflex::Reflex#default_reflex",n=((e,t)=>e[0]&&e[0].nodeType===Node.ELEMENT_NODE?e.shift():t)(r,t);if("number"===(s=n).type&&s.validity&&s.validity.badInput)return void(i.enabled&&console.warn("Reflex aborted: invalid numeric input"));var s;const a=(e=>{const t={};if(e[0]&&"object"==typeof e[0]&&Object.keys(e[0]).filter((e=>["id","attrs","selectors","reflexId","resolveLate","serializeForm","suppressLogging","includeInnerHTML","includeTextContent"].includes(e))).length){const r=e.shift();Object.keys(r).forEach((e=>{"reflexId"===e?(o.enabled&&console.warn("reflexId option will be removed in v4. Use id instead."),t.id=r.reflexId):t[e]=r[e]}))}return t})(r),d=new ee(a,n,t,this.identifier,c.reflexPermanent,l,r,e,fe),u=d.id;t.reflexController=t.reflexController||{},t.reflexData=t.reflexData||{},t.reflexError=t.reflexError||{},t.reflexController[u]=this,t.reflexData[u]=d.valueOf();const m=new _(d,this);return L[u]=m,this.lastReflex=m,$(m,"before"),setTimeout((()=>{const{params:e}=t.reflexData[u]||{},r=n.attributes[c.reflexSerializeForm];r&&(a.serializeForm="false"!==r.value);const l=n.closest(d.formSelector)||document.querySelector(d.formSelector)||n.closest("form");o.enabled&&void 0===a.serializeForm&&l&&console.warn(`Deprecation warning: the next version of StimulusReflex will not serialize forms by default.\nPlease set ${c.reflexSerializeForm}="true" on your Reflex Controller Element or pass { serializeForm: true } as an option to stimulate.`);const s=!1===a.serializeForm?"":((e,t={})=>{if(!e)return"";const r=t.w||window,{element:l}=t,n=new r.FormData(e),o=Array.from(n,(e=>e.map(encodeURIComponent).join("="))),s=e.querySelector("input[type=submit]");return l&&l.name&&"INPUT"===l.nodeName&&"submit"===l.type?o.push(`${encodeURIComponent(l.name)}=${encodeURIComponent(l.value)}`):s&&s.name&&o.push(`${encodeURIComponent(s.name)}=${encodeURIComponent(s.value)}`),Array.from(o).join("&")})(l,{element:n});m.data={...d.valueOf(),params:e,formData:s},t.reflexData[u]=m.data,re.plugin.deliver(m)})),H(m),m.getPromise},__perform(e){let t,r=e.target;for(;r&&!t;)t=r.getAttribute(c.reflex),t&&t.trim().length||(r=r.parentElement);const l=Z(t).find((t=>t.split("->")[0]===e.type));l&&(e.preventDefault(),e.stopPropagation(),this.stimulate(l.split("->")[1],r))}}),e.reflexes||Object.defineProperty(e,"reflexes",{get(){return new Proxy(L,{get:function(e,t){return"last"===t?this.lastReflex:Object.fromEntries(Object.entries(e[t]).filter((([e,t])=>t.controller===this)))}.bind(this)})}}),ue(e.element),v("stimulus-reflex:controller-registered",{detail:{controller:e}})},ge=(e,t={})=>{he(e,t)};document.addEventListener("cable-ready:after-dispatch-event",(e=>{const{stimulusReflex:t,name:l}=e.detail||{},n=l.split("-")[2],o={nothing:oe,halted:se,forbidden:ie,error:ae};if(!t||!Object.keys(o).includes(n))return;const s=L[t.id];s.completedOperations++,s.pendingOperations--,s.selector=e.detail.selector,s.morph=e.detail.stimulusReflex.morph,s.operation=e.type.split(":")[1].split("-").slice(1).join("_"),"error"===n&&(s.error=e.detail.error),o[n](s,e),setTimeout((()=>$(s,n))),s.piggybackOperations.length&&r.perform(s.piggybackOperations)})),document.addEventListener("cable-ready:before-inner-html",le),document.addEventListener("cable-ready:before-morph",le),document.addEventListener("cable-ready:after-inner-html",ne),document.addEventListener("cable-ready:after-morph",ne),document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&ce()}));const xe={version:Y,...Object.freeze({__proto__:null,initialize:pe,reflexes:L,register:he,scanForReflexes:ce,scanForReflexesOnElement:ue,useReflex:ge}),get debug(){return i.value},set debug(e){i.set(!!e)},get deprecate(){return o.value},set deprecate(e){o.set(!!e)}};window.StimulusReflex=xe;export{xe as default,pe as initialize,L as reflexes,he as register,ce as scanForReflexes,ue as scanForReflexesOnElement,ge as useReflex};
2
- //# sourceMappingURL=stimulus_reflex.min.js.map