bullet_train 1.0.62 → 1.0.65

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: 188f9aba4071a8ef1db98f58161fa6de1a628a14aac6d014603d4f26b8329485
4
- data.tar.gz: 89634b98cbf891e2abdab6aa7402981ce84baafcf4856232e1d7c71ce0bcd528
3
+ metadata.gz: c30074cbe6cd194cda6fd2b215caf5c153ecd373eddd77fc723f7d745ad79f4f
4
+ data.tar.gz: 86aa3740165a51f3536bc069270d564cea27a38d8d3c98613af003427d9ef901
5
5
  SHA512:
6
- metadata.gz: 0c8f25a33a221d65680d5617bf28b2d2ebb136576a193075664ad37704675ebf31f98b60eceeb923835ebec208a49ba973aaa63964a0bd401e250768cf2b73c0
7
- data.tar.gz: 350ab842c7f67119fe65ffc1cc80e03e354bd00ad45187b4fdd722f5439fbb56d0a507187c6c619859397c06b1b3c531e2edad43dfad4fd955e5054fd1cf7625
6
+ metadata.gz: 0f45b46df6956c956f229954713ec766d8ba6f65ec8e60ef9a2a4c0a0e5e609e73a3f35184d472625d8bbb176a63ff0d6ffd4b3efd1021e8f28d434765c2dc82
7
+ data.tar.gz: abfd89a30564c60c898803fe66831fbd82696e00321785263dfca871c1daef9a27fa2b45c8a13cbfece313d5afcf993596f5bb871f0b21af971e54214fff1a2f
@@ -7,6 +7,7 @@ module Controllers::Base
7
7
  include InvitationsHelper
8
8
 
9
9
  include DeviseCurrentAttributes
10
+ include Pagy::Backend
10
11
 
11
12
  around_action :set_locale
12
13
  layout :layout_by_resource
@@ -0,0 +1,6 @@
1
+ # TODO Why is this required?
2
+ require "pagy"
3
+
4
+ module Helpers::Base
5
+ include Pagy::Frontend
6
+ end
@@ -0,0 +1,6 @@
1
+ ActiveSupport::Inflector.inflections(:en) do |inflect|
2
+ # "_by" is a particularly common suffix for associations in Bullet Train applications (e.g. `created_by`, etc.)
3
+ # but it gets pluralized incorrectly as "_bies". This should fix both Super Scaffolding for those fields and
4
+ # the resulting invocations of the scope validator that are generated by Super Scaffolding.
5
+ inflect.irregular "by", "bys"
6
+ end
@@ -108,6 +108,11 @@ rake db:migrate
108
108
 
109
109
  As you can see, when we're using `crud-field`, we don't need to supply the chain of ownership back to `Team`.
110
110
 
111
+ If you want to scaffold a new field to use for read-only purposes, add the following option to omit the field from the form and all other files that apply:
112
+ ```
113
+ bin/super-scaffold crud-field Project description:trix_editor{readonly}
114
+ ```
115
+
111
116
  ### 4. Adding Option Fields with Fixed, Translatable Options
112
117
 
113
118
  Continuing with the earlier example, let's address the following new requirement:
@@ -92,7 +92,16 @@ module BulletTrain
92
92
  result[:absolute_path] = class_path || partial_path || locale_path || file_path
93
93
 
94
94
  if result[:absolute_path]
95
- base_path = "bullet_train" + result[:absolute_path].partition("/bullet_train").last
95
+ if result[:absolute_path].include?("devise")
96
+ # The annotated path for devise doesn't actually return an absolute path,
97
+ # so we have to do some extra steps to get the correct string.
98
+ relative_partial_path = result[:absolute_path]
99
+ # If it's a devise partial, it should be coming from bullet_train-base
100
+ base_path = "#{`bundle show bullet_train`.chomp}/" + relative_partial_path
101
+ result[:absolute_path] = base_path
102
+ else
103
+ base_path = "bullet_train" + result[:absolute_path].partition("/bullet_train").last
104
+ end
96
105
 
97
106
  # Try to calculate which package the file is from, and what it's path is within that project.
98
107
  ["app", "config", "lib"].each do |directory|
@@ -127,7 +136,7 @@ module BulletTrain
127
136
 
128
137
  def partial_path
129
138
  annotated_path = ApplicationController.render(template: "bullet_train/partial_resolver", layout: nil, assigns: {needle: @needle}).lines[1].chomp
130
- if annotated_path =~ /<!-- BEGIN (.*) -->/
139
+ if annotated_path =~ /<!-- BEGIN (\S*) -->/
131
140
  $1
132
141
  else
133
142
  raise "It looks like `config.action_view.annotate_rendered_view_with_filenames` isn't enabled?"
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.62"
2
+ VERSION = "1.0.65"
3
3
  end
@@ -79,64 +79,64 @@ namespace :bullet_train do
79
79
  # TODO Extract this into a YAML file.
80
80
  framework_packages = {
81
81
  "bullet_train" => {
82
- git: "https://github.com/bullet-train-co/bullet_train-base",
82
+ git: "bullet-train-co/bullet_train-base",
83
83
  npm: "@bullet-train/bullet-train"
84
84
  },
85
85
  "bullet_train-api" => {
86
- git: "https://github.com/bullet-train-co/bullet_train-api",
86
+ git: "bullet-train-co/bullet_train-api",
87
87
  },
88
88
  "bullet_train-fields" => {
89
- git: "https://github.com/bullet-train-co/bullet_train-fields",
89
+ git: "bullet-train-co/bullet_train-fields",
90
90
  npm: "@bullet-train/fields"
91
91
  },
92
92
  "bullet_train-has_uuid" => {
93
- git: "https://github.com/bullet-train-co/bullet_train-has_uuid",
93
+ git: "bullet-train-co/bullet_train-has_uuid",
94
94
  },
95
95
  "bullet_train-incoming_webhooks" => {
96
- git: "https://github.com/bullet-train-co/bullet_train-incoming_webhooks",
96
+ git: "bullet-train-co/bullet_train-incoming_webhooks",
97
97
  },
98
98
  "bullet_train-integrations" => {
99
- git: "https://github.com/bullet-train-co/bullet_train-integrations",
99
+ git: "bullet-train-co/bullet_train-integrations",
100
100
  },
101
101
  "bullet_train-integrations-stripe" => {
102
- git: "https://github.com/bullet-train-co/bullet_train-base-integrations-stripe",
102
+ git: "bullet-train-co/bullet_train-base-integrations-stripe",
103
103
  },
104
104
  "bullet_train-obfuscates_id" => {
105
- git: "https://github.com/bullet-train-co/bullet_train-obfuscates_id",
105
+ git: "bullet-train-co/bullet_train-obfuscates_id",
106
106
  },
107
107
  "bullet_train-outgoing_webhooks" => {
108
- git: "https://github.com/bullet-train-co/bullet_train-outgoing_webhooks",
108
+ git: "bullet-train-co/bullet_train-outgoing_webhooks",
109
109
  },
110
110
  "bullet_train-outgoing_webhooks-core" => {
111
- git: "https://github.com/bullet-train-co/bullet_train-outgoing_webhooks-core",
111
+ git: "bullet-train-co/bullet_train-outgoing_webhooks-core",
112
112
  },
113
113
  "bullet_train-scope_questions" => {
114
- git: "https://github.com/bullet-train-co/bullet_train-scope_questions",
114
+ git: "bullet-train-co/bullet_train-scope_questions",
115
115
  },
116
116
  "bullet_train-scope_validator" => {
117
- git: "https://github.com/bullet-train-co/bullet_train-scope_validator",
117
+ git: "bullet-train-co/bullet_train-scope_validator",
118
118
  },
119
119
  "bullet_train-sortable" => {
120
- git: "https://github.com/bullet-train-co/bullet_train-sortable",
120
+ git: "bullet-train-co/bullet_train-sortable",
121
121
  npm: "@bullet-train/bullet-train-sortable"
122
122
  },
123
123
  "bullet_train-super_scaffolding" => {
124
- git: "https://github.com/bullet-train-co/bullet_train-super_scaffolding",
124
+ git: "bullet-train-co/bullet_train-super_scaffolding",
125
125
  },
126
126
  "bullet_train-super_load_and_authorize_resource" => {
127
- git: "https://github.com/bullet-train-co/bullet_train-super_load_and_authorize_resource",
127
+ git: "bullet-train-co/bullet_train-super_load_and_authorize_resource",
128
128
  },
129
129
  "bullet_train-themes" => {
130
- git: "https://github.com/bullet-train-co/bullet_train-themes",
130
+ git: "bullet-train-co/bullet_train-themes",
131
131
  },
132
132
  "bullet_train-themes-base" => {
133
- git: "https://github.com/bullet-train-co/bullet_train-themes-base",
133
+ git: "bullet-train-co/bullet_train-themes-base",
134
134
  },
135
135
  "bullet_train-themes-light" => {
136
- git: "https://github.com/bullet-train-co/bullet_train-themes-light",
136
+ git: "bullet-train-co/bullet_train-themes-light",
137
137
  },
138
138
  "bullet_train-themes-tailwind_css" => {
139
- git: "https://github.com/bullet-train-co/bullet_train-themes-tailwind_css",
139
+ git: "bullet-train-co/bullet_train-themes-tailwind_css",
140
140
  },
141
141
  }
142
142
 
@@ -169,7 +169,7 @@ namespace :bullet_train do
169
169
  # TODO We should check whether the local copy is in a clean state, and if it is, check out `main`.
170
170
  # TODO We should also pull `origin/main` to make sure we're on the most up-to-date version of the package.
171
171
  else
172
- stream "git clone #{details[:git]} local/#{gem}"
172
+ stream "git clone git@github.com:#{details[:git]}.git local/#{gem}"
173
173
  end
174
174
 
175
175
  # TODO Ask them whether they want to check out a specific branch to work on. (List available remote branches.)
@@ -210,12 +210,12 @@ namespace :bullet_train do
210
210
  puts ""
211
211
  if details[:npm]
212
212
  puts "This package also has an npm package, so we'll link that up as well.".blue
213
- stream "cd local/#{gem} && yarn install && yarn link && cd ../.. && yarn link \"#{details[:npm]}\""
213
+ stream "cd local/#{gem} && yarn install && npx yalc link && cd ../.. && npx yalc link \"#{details[:npm]}\""
214
214
 
215
215
  puts ""
216
216
  puts "And now we're going to watch for any changes you make to the JavaScript and recompile as we go.".blue
217
217
  puts "When you're done, you can hit <Control + C> and we'll clean all off this up.".blue
218
- stream "cd local/#{gem} && yarn build --watch"
218
+ stream "cd local/#{gem} && yarn watch"
219
219
  else
220
220
  puts "This package has no npm package, so we'll just hang out here and do nothing. However, when you hit <Enter> here, we'll start the process of cleaning all of this up.".blue
221
221
  $stdin.gets
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.62
4
+ version: 1.0.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-01 00:00:00.000000000 Z
11
+ date: 2022-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -193,7 +193,7 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
- name: pry
196
+ name: awesome_print
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
@@ -207,7 +207,7 @@ dependencies:
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
- name: pry-stack_explorer
210
+ name: microscope
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
@@ -221,7 +221,7 @@ dependencies:
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
- name: awesome_print
224
+ name: http_accept_language
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - ">="
@@ -235,21 +235,21 @@ dependencies:
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
237
  - !ruby/object:Gem::Dependency
238
- name: microscope
238
+ name: cable_ready
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ">="
241
+ - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: '0'
243
+ version: 5.0.0.pre9
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - ">="
248
+ - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: '0'
250
+ version: 5.0.0.pre9
251
251
  - !ruby/object:Gem::Dependency
252
- name: http_accept_language
252
+ name: hiredis
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
255
  - - ">="
@@ -263,21 +263,21 @@ dependencies:
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
- name: cable_ready
266
+ name: nice_partials
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
- - - '='
269
+ - - "~>"
270
270
  - !ruby/object:Gem::Version
271
- version: 5.0.0.pre9
271
+ version: '0.1'
272
272
  type: :runtime
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - '='
276
+ - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: 5.0.0.pre9
278
+ version: '0.1'
279
279
  - !ruby/object:Gem::Dependency
280
- name: hiredis
280
+ name: premailer-rails
281
281
  requirement: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - ">="
@@ -291,21 +291,21 @@ dependencies:
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  - !ruby/object:Gem::Dependency
294
- name: nice_partials
294
+ name: figaro
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - "~>"
297
+ - - ">="
298
298
  - !ruby/object:Gem::Version
299
- version: '0.1'
299
+ version: '0'
300
300
  type: :runtime
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
- - - "~>"
304
+ - - ">="
305
305
  - !ruby/object:Gem::Version
306
- version: '0.1'
306
+ version: '0'
307
307
  - !ruby/object:Gem::Dependency
308
- name: premailer-rails
308
+ name: valid_email
309
309
  requirement: !ruby/object:Gem::Requirement
310
310
  requirements:
311
311
  - - ">="
@@ -319,7 +319,7 @@ dependencies:
319
319
  - !ruby/object:Gem::Version
320
320
  version: '0'
321
321
  - !ruby/object:Gem::Dependency
322
- name: figaro
322
+ name: commonmarker
323
323
  requirement: !ruby/object:Gem::Requirement
324
324
  requirements:
325
325
  - - ">="
@@ -333,7 +333,7 @@ dependencies:
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0'
335
335
  - !ruby/object:Gem::Dependency
336
- name: valid_email
336
+ name: extended_email_reply_parser
337
337
  requirement: !ruby/object:Gem::Requirement
338
338
  requirements:
339
339
  - - ">="
@@ -347,13 +347,13 @@ dependencies:
347
347
  - !ruby/object:Gem::Version
348
348
  version: '0'
349
349
  - !ruby/object:Gem::Dependency
350
- name: commonmarker
350
+ name: pry
351
351
  requirement: !ruby/object:Gem::Requirement
352
352
  requirements:
353
353
  - - ">="
354
354
  - !ruby/object:Gem::Version
355
355
  version: '0'
356
- type: :runtime
356
+ type: :development
357
357
  prerelease: false
358
358
  version_requirements: !ruby/object:Gem::Requirement
359
359
  requirements:
@@ -361,13 +361,13 @@ dependencies:
361
361
  - !ruby/object:Gem::Version
362
362
  version: '0'
363
363
  - !ruby/object:Gem::Dependency
364
- name: extended_email_reply_parser
364
+ name: pry-stack_explorer
365
365
  requirement: !ruby/object:Gem::Requirement
366
366
  requirements:
367
367
  - - ">="
368
368
  - !ruby/object:Gem::Version
369
369
  version: '0'
370
- type: :runtime
370
+ type: :development
371
371
  prerelease: false
372
372
  version_requirements: !ruby/object:Gem::Requirement
373
373
  requirements:
@@ -388,6 +388,20 @@ dependencies:
388
388
  - - ">="
389
389
  - !ruby/object:Gem::Version
390
390
  version: '0'
391
+ - !ruby/object:Gem::Dependency
392
+ name: pagy
393
+ requirement: !ruby/object:Gem::Requirement
394
+ requirements:
395
+ - - ">="
396
+ - !ruby/object:Gem::Version
397
+ version: '0'
398
+ type: :runtime
399
+ prerelease: false
400
+ version_requirements: !ruby/object:Gem::Requirement
401
+ requirements:
402
+ - - ">="
403
+ - !ruby/object:Gem::Version
404
+ version: '0'
391
405
  description: Bullet Train
392
406
  email:
393
407
  - andrew.culver@gmail.com
@@ -399,8 +413,6 @@ files:
399
413
  - README.md
400
414
  - Rakefile
401
415
  - app/assets/config/bullet_train_manifest.js
402
- - app/assets/javascripts/bullet-train.js
403
- - app/assets/javascripts/bullet-train.js.map
404
416
  - app/controllers/account/invitations_controller.rb
405
417
  - app/controllers/account/memberships_controller.rb
406
418
  - app/controllers/account/onboarding/user_details_controller.rb
@@ -436,6 +448,7 @@ files:
436
448
  - app/helpers/account/users_helper.rb
437
449
  - app/helpers/attributes_helper.rb
438
450
  - app/helpers/base_helper.rb
451
+ - app/helpers/concerns/helpers/base.rb
439
452
  - app/helpers/email_helper.rb
440
453
  - app/helpers/images_helper.rb
441
454
  - app/helpers/invitation_only_helper.rb
@@ -524,6 +537,7 @@ files:
524
537
  - app/views/public/home/docs.html.erb
525
538
  - app/views/user_mailer/invited.html.erb
526
539
  - app/views/user_mailer/welcome.html.erb
540
+ - config/initializers/concerns/inflections_base.rb
527
541
  - config/locales/en/base.yml
528
542
  - config/locales/en/devise.en.yml
529
543
  - config/locales/en/doorkeeper.en.yml
@@ -1,2 +0,0 @@
1
- import{Controller as e}from"stimulus";function t(e){var t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var i=function(e){function t(){return e.apply(this,arguments)||this}return r(t,e),t.prototype.copy=function(){this.inputTarget.value=this.sourceTarget.innerText,this.inputTarget.select(),document.execCommand("copy"),this.buttonTarget.innerHTML='<i id="copied" class="fas fa-check w-4 h-4 block text-green-600"></i>',setTimeout(function(){document.getElementById("copied").innerHTML='<i class="far fa-copy w-4 h-4 block text-gray-600"></i>'},1500)},t}(e);i.targets=["source","input","button"];var o=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).removeTrailingNewlines=function(e){e.element.innerHTML.match(/<br><\/div>$/)&&(e.element.innerHTML=e.element.innerHTML.slice(0,-10)+"</div>",t.removeTrailingNewlines(e))},t.removeTrailingWhitespace=function(e){e.element.innerHTML.match(/&nbsp;<\/div>$/)?(e.element.innerHTML=e.element.innerHTML.slice(0,-12)+"</div>",t.removeTrailingWhitespace(e)):e.element.innerHTML.match(/&nbsp; <\/div>$/)&&(e.element.innerHTML=e.element.innerHTML.slice(0,-13)+"</div>",t.removeTrailingWhitespace(e))},t}r(t,e);var n=t.prototype;return n.resetOnSuccess=function(e){e.detail.success&&e.target.reset()},n.stripTrix=function(){var e=this;this.trixFieldTargets.forEach(function(t){e.removeTrailingNewlines(t.editor),e.removeTrailingWhitespace(t.editor),t.parentElement.querySelector("input").value=t.innerHTML})},n.submitOnReturn=function(e){if((e.metaKey||e.ctrlKey)&&13==e.keyCode){e.preventDefault();var t=e.target.closest("form");this.submitForm(t)}},n.submitForm=function(e){e.requestSubmit?e.requestSubmit():e.querySelector("[type=submit]").click()},t}(e);o.targets=["trixField","scroll"];var a=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n,i,o=t.prototype;return o.toggle=function(){var e=this.isWrapperHidden?this.showEventNameValue:this.hideEventNameValue;this.isWrapperHidden&&this.showWrapper(),this.wrapperTarget.dispatchEvent(new CustomEvent(e))},o.showWrapper=function(){this.wrapperTarget.classList.remove(this.hiddenClass)},o.hideWrapper=function(){this.wrapperTarget.classList.add(this.hiddenClass)},n=t,(i=[{key:"isWrapperHidden",get:function(){return this.wrapperTarget.classList.contains(this.hiddenClass)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(e);a.targets=["wrapper"],a.classes=["hidden"],a.values={showEventName:String,hideEventName:String};var s=[[i,"clipboard_controller.js"],[o,"form_controller.js"],[a,"mobile_menu_controller.js"]].map(function(e){var r=e[0];return{identifier:t(e[1]),controllerConstructor:r}});document.addEventListener("turbo:load",function(){navigator.userAgent.toLocaleLowerCase().includes("electron")&&document.body.classList.add("electron")});export{s as controllerDefinitions};
2
- //# sourceMappingURL=bullet-train.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bullet-train.js","sources":["../../../node_modules/@stimulus/webpack-helpers/dist/index.js","../../javascript/controllers/clipboard_controller.js","../../javascript/controllers/form_controller.js","../../javascript/controllers/mobile_menu_controller.js","../../javascript/controllers/index.js","../../javascript/electron/index.js"],"sourcesContent":["export function definitionsFromContext(context) {\n return context.keys()\n .map(function (key) { return definitionForModuleWithContextAndKey(context, key); })\n .filter(function (value) { return value; });\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n var identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n var controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return { identifier: identifier, controllerConstructor: controllerConstructor };\n }\n}\nexport function identifierForContextKey(key) {\n var logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n//# sourceMappingURL=index.js.map","import { Controller } from 'stimulus'\n\nexport default class extends Controller {\n static targets = ['source', 'input', 'button']\n\n copy() {\n this.inputTarget.value = this.sourceTarget.innerText\n this.inputTarget.select()\n document.execCommand('copy')\n this.buttonTarget.innerHTML = '<i id=\"copied\" class=\"fas fa-check w-4 h-4 block text-green-600\"></i>'\n setTimeout(function () {\n document.getElementById('copied').innerHTML = '<i class=\"far fa-copy w-4 h-4 block text-gray-600\"></i>'\n }, 1500)\n }\n}\n","import { Controller } from 'stimulus'\n\n// TODO Some of this feels really specific to the conversation messages form. Should we rename this controller?\nexport default class extends Controller {\n static targets = ['trixField', 'scroll']\n\n resetOnSuccess(e){\n if(e.detail.success) {\n e.target.reset();\n }\n }\n\n stripTrix(){\n this.trixFieldTargets.forEach(element => {\n this.removeTrailingNewlines(element.editor)\n this.removeTrailingWhitespace(element.editor)\n // When doing this as part of the form submission, Trix does not update the input element's value attribute fast enough.\n // In order to submit the stripped value, we manually update it here to fix the race condition\n element.parentElement.querySelector(\"input\").value = element.innerHTML\n })\n }\n\n submitOnReturn(e) {\n if((e.metaKey || e.ctrlKey) && e.keyCode == 13) {\n e.preventDefault();\n let form = e.target.closest(\"form\")\n this.submitForm(form)\n }\n }\n\n removeTrailingNewlines = (trixEditor) => {\n if (trixEditor.element.innerHTML.match(/<br><\\/div>$/)) {\n trixEditor.element.innerHTML = trixEditor.element.innerHTML.slice(0, -10) + \"</div>\"\n this.removeTrailingNewlines(trixEditor)\n }\n }\n\n removeTrailingWhitespace = (trixEditor) => {\n if (trixEditor.element.innerHTML.match(/&nbsp;<\\/div>$/)) {\n trixEditor.element.innerHTML = trixEditor.element.innerHTML.slice(0, -12) + \"</div>\"\n this.removeTrailingWhitespace(trixEditor)\n } else if (trixEditor.element.innerHTML.match(/&nbsp; <\\/div>$/)) {\n trixEditor.element.innerHTML = trixEditor.element.innerHTML.slice(0, -13) + \"</div>\"\n this.removeTrailingWhitespace(trixEditor)\n }\n }\n\n submitForm(form) {\n // Right now, Safari and IE don't support the requestSubmit method which is required for Turbo\n // Doing form.submit() doesn't actually fire the submit event which Turbo needs\n if (form.requestSubmit) {\n form.requestSubmit()\n } else {\n form.querySelector(\"[type=submit]\").click()\n }\n }\n}\n","import { Controller } from \"stimulus\"\n\nexport default class extends Controller {\n static targets = [ \"wrapper\"]\n static classes = [ \"hidden\" ] // necessary because stimulus-reveal will mess with the [hidden] attribute on the wrapper\n static values = {\n showEventName: String,\n hideEventName: String,\n }\n\n toggle() {\n const eventName = this.isWrapperHidden? this.showEventNameValue: this.hideEventNameValue\n if (this.isWrapperHidden) {\n this.showWrapper()\n }\n \n this.wrapperTarget.dispatchEvent(new CustomEvent(eventName))\n }\n \n get isWrapperHidden() {\n return this.wrapperTarget.classList.contains(this.hiddenClass)\n }\n \n showWrapper() {\n this.wrapperTarget.classList.remove(this.hiddenClass)\n }\n \n hideWrapper() {\n this.wrapperTarget.classList.add(this.hiddenClass)\n }\n}","import { identifierForContextKey } from \"@stimulus/webpack-helpers\"\n\nimport ClipboardController from './clipboard_controller'\nimport FormController from './form_controller'\nimport MobileMenuController from './mobile_menu_controller'\n\nexport const controllerDefinitions = [\n [ClipboardController, 'clipboard_controller.js'],\n [FormController, 'form_controller.js'],\n [MobileMenuController, 'mobile_menu_controller.js'],\n].map(function(d) {\n const key = d[1]\n const controller = d[0]\n return {\n identifier: identifierForContextKey(key),\n controllerConstructor: controller\n }\n})\n","document.addEventListener(\"turbo:load\", () => {\n if (navigator.userAgent.toLocaleLowerCase().includes('electron')) {\n document.body.classList.add('electron')\n }\n})"],"names":["identifierForContextKey","key","logicalName","match","replace","copy","this","inputTarget","value","sourceTarget","innerText","select","document","execCommand","buttonTarget","innerHTML","setTimeout","getElementById","Controller","targets","removeTrailingNewlines","trixEditor","element","slice","_this","removeTrailingWhitespace","resetOnSuccess","e","detail","success","target","reset","stripTrix","trixFieldTargets","forEach","_this2","editor","parentElement","querySelector","submitOnReturn","metaKey","ctrlKey","keyCode","preventDefault","form","closest","submitForm","requestSubmit","click","toggle","eventName","isWrapperHidden","showEventNameValue","hideEventNameValue","showWrapper","wrapperTarget","dispatchEvent","CustomEvent","classList","remove","hiddenClass","hideWrapper","add","contains","classes","values","showEventName","String","hideEventName","controllerDefinitions","ClipboardController","FormController","MobileMenuController","map","d","controller","identifier","controllerConstructor","addEventListener","navigator","userAgent","toLocaleLowerCase","includes","body"],"mappings":"sCAiBO,SAASA,EAAwBC,GACpC,IAAIC,GAAeD,EAAIE,MAAM,2CAA6C,IAAI,GAC9E,GAAID,EACA,OAAOA,EAAYE,QAAQ,KAAM,KAAKA,QAAQ,MAAO,yRCf3DC,KAAA,WACEC,KAAKC,YAAYC,MAAQF,KAAKG,aAAaC,UAC3CJ,KAAKC,YAAYI,SACjBC,SAASC,YAAY,QACrBP,KAAKQ,aAAaC,UAAY,wEAC9BC,WAAW,WACTJ,SAASK,eAAe,UAAUF,UAAY,2DAC7C,UAVsBG,KACpBC,QAAU,CAAC,SAAU,QAAS,oKC2BrCC,uBAAyB,SAACC,GACpBA,EAAWC,QAAQP,UAAUZ,MAAM,kBACrCkB,EAAWC,QAAQP,UAAYM,EAAWC,QAAQP,UAAUQ,MAAM,GAAI,IAAM,SAC5EC,EAAKJ,uBAAuBC,OAIhCI,yBAA2B,SAACJ,GACtBA,EAAWC,QAAQP,UAAUZ,MAAM,mBACrCkB,EAAWC,QAAQP,UAAYM,EAAWC,QAAQP,UAAUQ,MAAM,GAAI,IAAM,SAC5EC,EAAKC,yBAAyBJ,IACrBA,EAAWC,QAAQP,UAAUZ,MAAM,qBAC5CkB,EAAWC,QAAQP,UAAYM,EAAWC,QAAQP,UAAUQ,MAAM,GAAI,IAAM,SAC5EC,EAAKC,yBAAyBJ,yCArClCK,eAAA,SAAeC,GACVA,EAAEC,OAAOC,SACVF,EAAEG,OAAOC,WAIbC,UAAA,sBACE1B,KAAK2B,iBAAiBC,QAAQ,SAAAZ,GAC5Ba,EAAKf,uBAAuBE,EAAQc,QACpCD,EAAKV,yBAAyBH,EAAQc,QAGtCd,EAAQe,cAAcC,cAAc,SAAS9B,MAAQc,EAAQP,eAIjEwB,eAAA,SAAeZ,GACb,IAAIA,EAAEa,SAAWb,EAAEc,UAA0B,IAAbd,EAAEe,QAAe,CAC/Cf,EAAEgB,iBACF,IAAIC,EAAOjB,EAAEG,OAAOe,QAAQ,QAC5BvC,KAAKwC,WAAWF,OAqBpBE,WAAA,SAAWF,GAGLA,EAAKG,cACPH,EAAKG,gBAELH,EAAKN,cAAc,iBAAiBU,YAlDb9B,KACpBC,QAAU,CAAC,YAAa,oHCM/B8B,OAAA,WACE,IAAMC,EAAY5C,KAAK6C,gBAAiB7C,KAAK8C,mBAAoB9C,KAAK+C,mBAClE/C,KAAK6C,iBACP7C,KAAKgD,cAGPhD,KAAKiD,cAAcC,cAAc,IAAIC,YAAYP,OAOnDI,YAAA,WACEhD,KAAKiD,cAAcG,UAAUC,OAAOrD,KAAKsD,gBAG3CC,YAAA,WACEvD,KAAKiD,cAAcG,UAAUI,IAAIxD,KAAKsD,iDATxC,WACE,YAAYL,cAAcG,UAAUK,SAASzD,KAAKsD,4PAlBzB1C,KACpBC,QAAU,CAAE,aACZ6C,QAAU,CAAE,YACZC,OAAS,CACdC,cAAeC,OACfC,cAAeD,QCDNE,IAAAA,EAAwB,CACnC,CAACC,EAAqB,2BACtB,CAACC,EAAgB,sBACjB,CAACC,EAAsB,8BACvBC,IAAI,SAASC,GACb,IACMC,EAAaD,EAAE,GACrB,MAAO,CACLE,WAAY5E,EAHF0E,EAAE,IAIZG,sBAAuBF,KCf3B/D,SAASkE,iBAAiB,aAAc,WAClCC,UAAUC,UAAUC,oBAAoBC,SAAS,aACnDtE,SAASuE,KAAKzB,UAAUI,IAAI"}