bullet_train 1.32.0 → 1.34.0

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: 98e09fbe309f588d3d549b3b5b802490b3630fd95005f2466d860316c38ce112
4
- data.tar.gz: 9cd579e00d8f4c5e8c93944590bda85ddf8511f11501bb71d5a42ad1a3024e24
3
+ metadata.gz: f74254bfbcc983a2ed2fbdab69dbaa872dc49a86f5a73e7b8b43e7878f2e1ae4
4
+ data.tar.gz: b5bbc3302df6e353bd86535087317b562bbba274e943fed5b9edf0e47cb3a62e
5
5
  SHA512:
6
- metadata.gz: 70187dc9eb184db7fa8b7291297558fec0ce3411974a534fe008e7a3ab1d65af69b6c1f2569bbb77a64736ccaf79ac7cddf184d1d9833176f1e9595a33a32bb7
7
- data.tar.gz: 06f616f253c27690dc07f24c9a7f5f39f0bdf7a435280c1bda3f48a6d363624642d038d08ef8f088d83c66f31399bffc1d05a1b1344bb68d4243867b03f200d5
6
+ metadata.gz: 544b025b243fc8f09b4e710258481715e6276e98a061f6256687aa90777ff88b15e9da2b17b29f485c49be5c78016797c7022ae9494f3503b313fa670f0b7666
7
+ data.tar.gz: 14c932887fdaf6c184da191f638be7b46f48cc18fd897f700a5b4c8646c804d21ad8ef4952af0c59e81349361777f8d384f1c1c7deeaaeb33d82d548b90e50d0
@@ -9,7 +9,7 @@ export default class extends Controller {
9
9
  document.execCommand('copy')
10
10
  this.buttonTarget.innerHTML = '<i id="copied" class="fas fa-check w-4 h-4 block text-green-600"></i>'
11
11
  setTimeout(function () {
12
- document.getElementById('copied').innerHTML = '<i class="far fa-copy w-4 h-4 block text-slate-600"></i>'
12
+ document.getElementById('copied').innerHTML = '<i class="far fa-copy w-4 h-4 block text-base-600"></i>'
13
13
  }, 1500)
14
14
  }
15
15
  }
@@ -23,10 +23,10 @@
23
23
  <% Membership.assignable_roles.each do |role| %>
24
24
  <% if current_membership.can_manage_role?(role) %>
25
25
  <div class="flex items-top">
26
- <%= fields.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-primary-500 focus:ring-primary-500 border-slate-300 rounded mt-0.5"}, role.id, nil %>
26
+ <%= fields.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-primary-500 focus:ring-primary-500 border-base-300 rounded mt-0.5"}, role.id, nil %>
27
27
  <label for="invitation_membership_attributes_role_ids_<%= role.id %>" class="ml-2 block select-none">
28
28
  <span><%= t('invitations.form.invite_as', role_key: t("memberships.fields.role_ids.options.#{role.key}.label")) %></span>
29
- <div class="mt-0.5 text-slate-400 font-light leading-normal">
29
+ <div class="mt-0.5 text-base-400 font-light leading-normal">
30
30
  <%= t("memberships.fields.role_ids.options.#{role.key}.description") %>
31
31
  </div>
32
32
  </label>
@@ -26,10 +26,10 @@
26
26
  <% Membership.assignable_roles.each do |role| %>
27
27
  <% if role.manageable_by?(current_membership.roles) %>
28
28
  <div class="flex items-top">
29
- <%= form.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-primary-500 focus:ring-primary-500 border-slate-300 rounded mt-0.5"}, role.id, nil %>
29
+ <%= form.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-primary-500 focus:ring-primary-500 border-base-300 rounded mt-0.5"}, role.id, nil %>
30
30
  <label for="membership_role_ids_<%= role.id %>" class="ml-2 block select-none">
31
31
  <%= t('.grant_privileges_of', role_key: t(".fields.role_ids.options.#{role.key}.label")) %>
32
- <div class="mt-0.5 text-slate-400 font-light leading-normal">
32
+ <div class="mt-0.5 text-base-400 font-light leading-normal">
33
33
  <%= t(".fields.role_ids.options.#{role.key}.description") %>
34
34
  </div>
35
35
  </label>
@@ -1,7 +1,7 @@
1
1
  <tr data-id="<%= membership.id %>">
2
2
  <td class="px-6 py-4 whitespace-nowrap">
3
3
  <%= link_to [:account, membership], class: 'block flex items-center group hover:no-underline no-underline' do %>
4
- <div class="flex-shrink-0 h-10 w-10">
4
+ <div class="shrink-0 h-10 w-10">
5
5
  <%= image_tag membership_profile_photo_url(membership), title: membership.label_string, class: 'h-10 w-10 rounded-full' %>
6
6
  </div>
7
7
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  <td class="px-6 py-4 whitespace-nowrap">
26
26
  <%= link_to [:account, membership], class: 'block flex items-center group hover:no-underline no-underline' do %>
27
- <div class="flex-shrink-0 h-10 w-10">
27
+ <div class="shrink-0 h-10 w-10">
28
28
  <%= image_tag membership_profile_photo_url(membership), title: membership.label_string, class: 'h-10 w-10 rounded-full' %>
29
29
  </div>
30
30
 
@@ -34,7 +34,7 @@
34
34
 
35
35
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"/>
36
36
  </head>
37
- <body class="<%= BulletTrain::Themes::Light.background || "bg-gradient-to-br from-secondary-200 to-primary-400 dark:from-primary-900 dark:to-primary-600" %> text-slate-700 text-sm font-normal dark:text-slate-300">
37
+ <body class="<%= BulletTrain::Themes::Light.background || "bg-gradient-to-br from-secondary-200 to-primary-400 dark:from-primary-900 dark:to-primary-600" %> text-base-700 text-sm font-normal dark:text-base-300">
38
38
  <div class="md:p-5">
39
39
  <div class="min-h-screen md:h-auto overflow-hidden md:rounded-lg flex shadow"
40
40
  data-controller="mobile-menu"
@@ -42,7 +42,7 @@
42
42
  >
43
43
 
44
44
  <% menu = capture do %>
45
- <div class="flex items-center flex-shrink-0 p-4 bg-blue-700 md:rounded-tl-lg">
45
+ <div class="flex items-center shrink-0 p-4 bg-blue-700 md:rounded-tl-lg">
46
46
  <%= image_tag image_path("logo/logo.png"), class: 'h-5 w-auto mx-auto' %>
47
47
 
48
48
  <div class="lg:hidden absolute right-0">
@@ -171,6 +171,12 @@
171
171
  <i class="fal fa-brackets-curly ti ti-view-list-alt"></i>
172
172
  <% end %>
173
173
  <% end %>
174
+
175
+ <%= render 'account/shared/menu/item', url: '/docs/contributing.md', label: 'Contributing' do |p| %>
176
+ <% p.content_for :icon do %>
177
+ <i class="fal fa-github-alt ti ti-github"></i>
178
+ <% end %>
179
+ <% end %>
174
180
  <% end %>
175
181
 
176
182
  <%= render 'account/shared/menu/section', title: 'Accounts & Teams' do %>
@@ -353,20 +359,20 @@
353
359
  >
354
360
  <%= menu %>
355
361
  </div>
356
- <div class="flex-shrink-0 w-14" aria-hidden="true"></div>
362
+ <div class="shrink-0 w-14" aria-hidden="true"></div>
357
363
  </div>
358
364
  </div>
359
365
 
360
- <div class="hidden lg:flex lg:flex-shrink-0 overflow-y-auto bg-gradient-to-b from-primary-700 to-primary-800 dark:from-slate-800 dark:to-slate-800">
366
+ <div class="hidden lg:flex lg:shrink-0 overflow-y-auto bg-gradient-to-b from-primary-700 to-primary-800 dark:from-base-800 dark:to-base-800">
361
367
  <div class="w-64">
362
368
  <%= menu %>
363
369
  </div>
364
370
  </div>
365
371
 
366
- <div class="flex flex-col w-0 flex-1 overflow-y-auto bg-slate-100 dark:bg-slate-800 lg:border-l dark:border-slate-500">
372
+ <div class="flex flex-col w-0 flex-1 overflow-y-auto bg-base-100 dark:bg-base-800 lg:border-l dark:border-base-500">
367
373
  <main class="flex-1 relative z-0 overflow-y-auto focus:outline-none" tabindex="0">
368
374
 
369
- <button class="lg:hidden h-12 w-12 ml-1 flex-none inline-flex items-center justify-center rounded-md text-slate-500 hover:text-slate-900 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue"
375
+ <button class="lg:hidden h-12 w-12 ml-1 flex-none inline-flex items-center justify-center rounded-md text-base-500 hover:text-base-900 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue"
370
376
  data-action="mobile-menu#open"
371
377
  >
372
378
  <span class="sr-only">Open Application Menu</span>
@@ -4,7 +4,7 @@
4
4
  <%= render 'shared/layouts/head' %>
5
5
  </head>
6
6
 
7
- <body class="min-h-screen <%= BulletTrain::Themes::Light.background %> text-slate-700 text-sm font-normal dark:text-slate-300">
7
+ <body class="min-h-screen <%= BulletTrain::Themes::Light.background %> text-base-700 text-sm font-normal dark:text-base-300">
8
8
  <%= yield %>
9
9
  </body>
10
10
  </html>
@@ -69,6 +69,7 @@ en:
69
69
  notifications:
70
70
  not_found: not found
71
71
  all_fields_required: All of these fields are required.
72
+ validation_error: Please correct the errors below.
72
73
  dates:
73
74
  today: Today
74
75
  day:
@@ -0,0 +1,94 @@
1
+ # Contributing to Bullet Train
2
+
3
+ To contribute to Bullet Train there are two main repos that are involved:
4
+
5
+ * [The starter repo](https://github.com/bullet-train-co/bullet_train) - This is the repo that you clone to start a new Bullet Train app.
6
+ * [The `core` repo](https://github.com/bullet-train-co/bullet_train-core) - This is where all (OK, most) of the gems live.
7
+
8
+ ## Linking Ruby gems
9
+
10
+ When working on bug fixes or new features it can be useful to use a local copy of the `core` gems instead of the published versions.
11
+ You can do this in either the starter repo itself, or in a "downstream app" that has been created from the starter repo.
12
+
13
+ We have a convenience script in the starter repo at `bin/hack` which helps get things setup for you.
14
+
15
+ `bin/hack` supports two different models of organizing your filesystem for `core` development.
16
+
17
+ 1. The "nested repo approach" - If you run `bin/hack` with no arguments it will clone the `core` repo into your project at `local/bullet_train-core`.
18
+ It will also attempt to open that repo in your editor/IDE.
19
+ 2. The "peer repo approach" - If you already have the `core` repo cloned you can pass the `--link` option to `bin/hack` followed by a path to `core`.
20
+ For instance `bin/hack --link ../bullet_train-core`.
21
+
22
+ In either case `bin/hack` will modify the `Gemfile` in your project and change the lines for all of the `bullet_train*` gems to point to a local copy.
23
+
24
+ Lines that start like this:
25
+
26
+ ```ruby
27
+ gem "bullet_train", BULLET_TRAIN_VERSION
28
+ ```
29
+
30
+ Will become this:
31
+
32
+ ```ruby
33
+ gem "bullet_train", path: "../bullet_train-core/bullet_train"
34
+ ```
35
+
36
+ Once that's done you can start/restart your dev server and then chnages you make within your `core` repo will be reflected in your local app.
37
+
38
+ ## Linking Javascript packages
39
+
40
+ If you need to make changes to any of the Javascript packages from the `core` gems the process is a little bit different.
41
+
42
+ We use `yalc` to handle the details of making a local package available to your local app.
43
+
44
+ First you need to go into the directory for the gem/package that you're working with, then build the JS package, and make it available to local projects using `yalc push`.
45
+ (Don't worry, you're not pushing to anywhere other than your local dev environment.)
46
+
47
+ So, if you're working with the `bullet_train-fields` JS package you'd do this:
48
+
49
+ ```
50
+ cd bullet_train-core/bullet_train-fields
51
+ yarn build
52
+ yarn yalc push
53
+ ```
54
+
55
+ After pushing you should see a line in your terminal that looks something like this:
56
+
57
+ ```
58
+ @bullet-train/fields@1.32.0 published in store.
59
+ ```
60
+
61
+ Next you can link that package into your local app or starter repo. (You'll be bouncing between the gem directory and your app directory, so it's convenient to use two different terminal sessions for this.)
62
+ Go into your app or starter repo directory and then use `yalc link` to connect your local package.
63
+
64
+ ```
65
+ cd bullet_train
66
+ yarn yalc link @bullet-train/fields
67
+ ```
68
+
69
+ Now your local app will be running with the JS code from your local copy.
70
+
71
+ As you're making changes you can test them out in your local app by building and pushing the package again.
72
+
73
+ So, for this example, back in the `bullet_train-core/bullet_train-fields` directory you can run:
74
+
75
+ ```
76
+ yarn build; yarn yalc push
77
+ ```
78
+
79
+ Now in addition to seeing a line about the package being published to the store, you should also seem some lines about it being pushed into your local app.
80
+
81
+ ```
82
+ @bullet-train/fields@1.32.0 published in store.
83
+ Pushing @bullet-train/fields@1.32.0 in /Users/jgreen/projects/bullet-train-co/bullet_train
84
+ Package @bullet-train/fields@1.32.0 linked ==> /Users/jgreen/projects/bullet-train-co/bullet_train/node_modules/@bullet-train/fields
85
+ ```
86
+
87
+ Each time that you rebuild and re-push the package the file watcher in your project (or starter repo) should notice the change and rebuild your assets.
88
+
89
+ ## Managing cross-repo pull requests
90
+
91
+ Sometimes a particular change will require modifications to both the starter repo and the `core` repo. In these cases you should use the same branch
92
+ name in both repos. That will allow CI to hook them together and run tests in the right way.
93
+
94
+ Happy hacking!
@@ -181,12 +181,26 @@ rails generate model Project team:references multiple_buttons:jsonb
181
181
  ## Formating `date` and `date_and_time`
182
182
  After Super Scaffolding a `date` or `date_and_time` field, you can pass a format for the object like so:
183
183
 
184
- ```
184
+ ```erb
185
185
  <%= render 'shared/attributes/date', attribute: date_object, format: :short %>
186
186
  ```
187
187
 
188
188
  Please refer to the [Ruby on Rails documentation](https://guides.rubyonrails.org/i18n.html#adding-date-time-formats) for more information.
189
189
 
190
+ ## Setting a `language` for `code_editor` fields
191
+
192
+ When rendering the `code_editor` attribute you can pass in a language to affect syntax highlighting and what not.
193
+
194
+ ```erb
195
+ <%= render 'shared/fields/code_editor', method: :source, language: "ruby" %>
196
+ ```
197
+
198
+ During Super Scaffolding you can pass in the language when declaring the attribute and it will be added to your form:
199
+
200
+ ````
201
+ rails generate super_scaffold:field Project source:code_editor{language=ruby}
202
+ ````
203
+
190
204
  ## Dynamic Forms and Dependent Fields
191
205
 
192
206
  To dynamically update your forms on field changes, Bullet Train introduces two new concepts:
data/docs/index.md CHANGED
@@ -24,6 +24,8 @@
24
24
  - [Test Suite](/docs/testing.md)
25
25
  - [Magic Test: Point-and-Click Test Writing](https://github.com/bullet-train-co/magic_test) <i class="ti ti-new-window ml-2"></i>
26
26
  - [Application Options](/docs/application-options.md)
27
+ - [Application Hash](/docs/application-hash.md)
28
+ - [Contributing to Bullet Train](/docs/contributing.md)
27
29
 
28
30
  ## Accounts & Teams
29
31
  - [Authentication](/docs/authentication.md)
data/docs/themes.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # Themes
2
2
 
3
+ ## Changing your color scheme
4
+
5
+ The first thing you may want to do is to change the color scheme for your app. The place to do that is in `config/initializers/theme.rb`.
6
+
7
+ There you can set a primary `color` value, as well as a `secondary_color` if you want to add some variation.
8
+ If you don't set a `secondary_color` it will be set the same as the primary `color`.
9
+
10
+ ```ruby
11
+ # The application's main color scheme.
12
+ BulletTrain::Themes::Light.color = :green
13
+ BulletTrain::Themes::Light.secondary_color = :red
14
+ ```
15
+
16
+ Any of the [default color schemes provided by Tailwind CSS](https://v3.tailwindcss.com/docs/customizing-colors#default-color-palette) should work for the primary and secondary colors.
17
+
18
+ ### Dark and Light Mode
19
+
20
+ Bullet Train themes include support for both dark and light color schemes. Users can toggle between dark mode, light mode, or system preference in their Account Details (accessible from the user menu). This preference is per-device and stored in the browser's `LocalStorage`.
21
+
22
+ You can force your app to either light or dark mode by setting the `force_color_scheme_to` option in `theme.rb`.
23
+
24
+ ```ruby
25
+ # Force the color scheme to :light or :dark.
26
+ # Defaults to nil, which offers users the ability to choose their preference in Account Details.
27
+ BulletTrain::Themes::Light.force_color_scheme_to = :light
28
+ ```
29
+
30
+ If you're building custom components that need to respond to color scheme changes, see [Responding to Color Scheme Changes](/docs/javascript.md#responding-to-color-scheme-changes) in the JavaScript documentation.
31
+
32
+ ### Changing the background color
33
+
34
+ <div class="rounded-md border bg-amber-100 border-amber-200 py-4 px-5 mb-3 not-prose">
35
+ <h3 class="text-sm text-amber-800 font-light mb-2">
36
+ Note: This section is likely to change soon. The following only applies to apps that are upgraded to Bullet Train `1.33.0` or later.
37
+ </h3>
38
+ </div>
39
+
40
+ Starting in Bullet Train version `1.33.0` we've added a way to change the `base` color, which affects the background color of many elements.
41
+
42
+ To customize this you can add a block like this to `tailwind.config.js`:
43
+
44
+ ```javascript
45
+ themeConfig.theme.extend.colors = ({colors}) => ({
46
+ base: colors.stone,
47
+ primary: colors.blue,
48
+ secondary: colors.blue,
49
+ })
50
+ ```
51
+
52
+ Here you need to include `primary` and `secondary` as well as `base`. The settings in `tailwind.config.js` will **mostly** clobber the settings
53
+ in `theme.rb`, but not entirely. So for the best results you should make sure that those two files agree about the primary and secondary colors.
54
+
55
+ ## The Theme Subsystem
56
+
3
57
  Bullet Train has a theme subsystem designed to allow you the flexibility to either extend or completely replace the stock “Light” UI theme.
4
58
  To reduce duplication of code across themes, Bullet Train implements the following three packages:
5
59
  1. `bullet_train-themes`
@@ -132,12 +186,6 @@ This allows the theme engine to resolve which theme in the inheritance chain wil
132
186
 
133
187
  You're going to have to call your theme something and there are practical reasons to not call it something generic. If you're pursuing a heavily customized design, consider allowing the designer or designers who are creating the look-and-feel of your application to name their own masterpiece. Giving it a distinct name will really help differentiate things when you're ready to start introducing additional facets to your application or a totally new look-and-feel down the road.
134
188
 
135
- ## Dark and Light Mode
136
-
137
- Bullet Train themes include support for both dark and light color schemes. Users can toggle between dark mode, light mode, or system preference in their Account Details (accessible from the user menu). This preference is per-device and stored in the browser's `LocalStorage`.
138
-
139
- If you're building custom components that need to respond to color scheme changes, see [Responding to Color Scheme Changes](/docs/javascript.md#responding-to-color-scheme-changes) in the JavaScript documentation.
140
-
141
189
  ## Additional Themes Documentation
142
190
 
143
191
  * [Installing Bullet Train Themes on Other Rails Projects](/docs/themes/on-other-rails-projects.md)
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.32.0"
2
+ VERSION = "1.34.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.0
4
+ version: 1.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
@@ -597,6 +597,7 @@ files:
597
597
  - docs/authentication.md
598
598
  - docs/billing/stripe.md
599
599
  - docs/billing/usage.md
600
+ - docs/contributing.md
600
601
  - docs/desktop.md
601
602
  - docs/docker.md
602
603
  - docs/field-partials.md