headmin 0.3.4 → 0.4.2
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 +4 -4
- data/.github/workflows/ci.yml +27 -0
- data/.gitignore +14 -0
- data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
- data/.nvmrc +1 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +7 -4
- data/Gemfile.lock +191 -25
- data/README.md +7 -0
- data/Rakefile +1 -7
- data/app/assets/javascripts/headmin/config/i18n.js +9 -9
- data/app/assets/javascripts/headmin/controllers/autocomplete_controller.js +318 -0
- data/app/assets/javascripts/headmin/controllers/blocks_controller.js +74 -79
- data/app/assets/javascripts/headmin/controllers/date_range_controller.js +24 -24
- data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +23 -25
- data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +237 -237
- data/app/assets/javascripts/headmin/controllers/filter_controller.js +44 -44
- data/app/assets/javascripts/headmin/controllers/filters_controller.js +57 -61
- data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +29 -29
- data/app/assets/javascripts/headmin/controllers/hello_controller.js +3 -3
- data/app/assets/javascripts/headmin/controllers/notification_controller.js +7 -6
- data/app/assets/javascripts/headmin/controllers/popup_controller.js +57 -51
- data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +36 -9
- data/app/assets/javascripts/headmin/controllers/repeater_controller.js +122 -125
- data/app/assets/javascripts/headmin/controllers/select_controller.js +40 -39
- data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +100 -101
- data/app/assets/javascripts/headmin/controllers/table_controller.js +115 -115
- data/app/assets/javascripts/headmin/index.js +38 -35
- data/app/assets/javascripts/headmin.js +295 -37
- data/app/assets/stylesheets/headmin/forms/autocomplete.scss +21 -0
- data/app/assets/stylesheets/headmin/forms/file.scss +46 -0
- data/app/assets/stylesheets/headmin/forms/repeater.scss +62 -0
- data/app/assets/stylesheets/headmin/forms/search.scss +12 -0
- data/app/assets/stylesheets/headmin/forms.scss +11 -0
- data/app/assets/stylesheets/headmin/general.scss +14 -0
- data/app/assets/stylesheets/headmin/overrides/bootstrap.scss +5 -3
- data/app/assets/stylesheets/headmin/overrides/redactorx.scss +74 -0
- data/app/assets/stylesheets/headmin/popup.scss +1 -0
- data/app/assets/stylesheets/headmin/syntax.scss +36 -349
- data/app/assets/stylesheets/headmin/table.scss +1 -1
- data/app/assets/stylesheets/headmin/utilities/buttons.scss +19 -0
- data/app/assets/stylesheets/headmin/utilities/dropzone.scss +72 -0
- data/app/assets/stylesheets/headmin/utilities.scss +2 -68
- data/app/assets/stylesheets/headmin.css +209 -205
- data/app/assets/stylesheets/headmin.scss +1 -1
- data/app/helpers/headmin/admin_helper.rb +0 -1
- data/app/helpers/headmin/form_helper.rb +2 -8
- data/app/models/concerns/headmin/blockable.rb +1 -1
- data/app/models/concerns/headmin/field.rb +4 -1
- data/app/models/concerns/headmin/fieldable.rb +138 -44
- data/app/models/concerns/headmin/form/autocompletable.rb +38 -0
- data/app/models/concerns/headmin/form/hintable.rb +19 -0
- data/app/models/concerns/headmin/form/input_groupable.rb +23 -0
- data/app/models/concerns/headmin/form/labelable.rb +33 -0
- data/app/models/concerns/headmin/form/listable.rb +28 -0
- data/app/models/concerns/headmin/form/placeholderable.rb +13 -0
- data/app/models/concerns/headmin/form/validatable.rb +40 -0
- data/app/models/concerns/headmin/form/wrappable.rb +21 -0
- data/app/models/headmin/.DS_Store +0 -0
- data/app/models/headmin/blocks_view.rb +15 -0
- data/app/models/headmin/form/blocks_view.rb +29 -0
- data/app/models/headmin/form/checkbox_view.rb +52 -0
- data/app/models/headmin/form/date_range_view.rb +25 -0
- data/app/models/headmin/form/date_view.rb +45 -0
- data/app/models/headmin/form/email_view.rb +48 -0
- data/app/models/headmin/form/file_view.rb +116 -0
- data/app/models/headmin/form/flatpickr_range_view.rb +102 -0
- data/app/models/headmin/form/flatpickr_view.rb +37 -0
- data/app/models/headmin/form/hidden_view.rb +10 -0
- data/app/models/headmin/form/hint_view.rb +6 -0
- data/app/models/headmin/form/input_group_view.rb +19 -0
- data/app/models/headmin/form/label_view.rb +24 -0
- data/app/models/headmin/form/number_view.rb +49 -0
- data/app/models/headmin/form/password_view.rb +44 -0
- data/app/models/headmin/form/redactorx_view.rb +59 -0
- data/app/models/headmin/form/search_view.rb +48 -0
- data/app/models/headmin/form/select_view.rb +62 -0
- data/app/models/headmin/form/switch_view.rb +23 -0
- data/app/models/headmin/form/text_view.rb +48 -0
- data/app/models/headmin/form/textarea_view.rb +44 -0
- data/app/models/headmin/form/url_view.rb +48 -0
- data/app/models/headmin/form/wrapper_view.rb +19 -0
- data/app/models/headmin/form/wysiwyg_view.rb +17 -0
- data/app/models/headmin/{thumbnail.rb → thumbnail_view.rb} +6 -1
- data/app/models/view_model.rb +58 -0
- data/app/views/headmin/_blocks.html.erb +13 -9
- data/app/views/headmin/_heading.html.erb +7 -1
- data/app/views/headmin/_thumbnail.html.erb +1 -37
- data/app/views/headmin/forms/_autocomplete.html.erb +11 -0
- data/app/views/headmin/forms/_blocks.html.erb +16 -17
- data/app/views/headmin/forms/_checkbox.html.erb +24 -29
- data/app/views/headmin/forms/_datalist.html.erb +3 -0
- data/app/views/headmin/forms/_date.html.erb +24 -24
- data/app/views/headmin/forms/_date_range.html.erb +19 -21
- data/app/views/headmin/forms/_email.html.erb +27 -32
- data/app/views/headmin/forms/_errors.html.erb +2 -3
- data/app/views/headmin/forms/_file.html.erb +84 -181
- data/app/views/headmin/forms/_flatpickr.html.erb +19 -20
- data/app/views/headmin/forms/_flatpickr_range.html.erb +28 -37
- data/app/views/headmin/forms/_hidden.html.erb +9 -10
- data/app/views/headmin/forms/_hint.html.erb +16 -0
- data/app/views/headmin/forms/_input_group.html.erb +21 -0
- data/app/views/headmin/forms/_label.html.erb +5 -13
- data/app/views/headmin/forms/_number.html.erb +23 -35
- data/app/views/headmin/forms/_password.html.erb +21 -30
- data/app/views/headmin/forms/_redactorx.html.erb +21 -40
- data/app/views/headmin/forms/_repeater.html.erb +55 -60
- data/app/views/headmin/forms/_search.html.erb +43 -0
- data/app/views/headmin/forms/_select.html.erb +24 -49
- data/app/views/headmin/forms/_switch.html.erb +29 -0
- data/app/views/headmin/forms/_text.html.erb +42 -96
- data/app/views/headmin/forms/_textarea.html.erb +21 -32
- data/app/views/headmin/forms/_url.html.erb +26 -31
- data/app/views/headmin/forms/_validation.html.erb +10 -13
- data/app/views/headmin/forms/_wrapper.html.erb +9 -0
- data/app/views/headmin/forms/_wysiwyg.html.erb +28 -0
- data/app/views/headmin/forms/autocomplete/_item.html.erb +3 -0
- data/app/views/headmin/forms/autocomplete/_list.html.erb +3 -0
- data/app/views/headmin/forms/fields/_file.html.erb +1 -1
- data/app/views/headmin/forms/fields/_files.html.erb +17 -0
- data/app/views/headmin/forms/fields/_group.html.erb +9 -2
- data/app/views/headmin/forms/repeater/_row.html.erb +4 -4
- data/bin/console +0 -1
- data/config/locales/headmin/forms/en.yml +1 -12
- data/config/locales/headmin/forms/nl.yml +1 -12
- data/esbuild-css.js +18 -18
- data/esbuild-js.js +8 -8
- data/headmin.gemspec +1 -3
- data/lib/generators/templates/controllers/auth/confirmations_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/passwords_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/registrations_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/sessions_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/unlocks_controller.rb +0 -2
- data/lib/headmin/version.rb +1 -3
- data/lib/headmin.rb +0 -2
- data/package-lock.json +5359 -0
- data/package.json +12 -4
- data/view_model_benchmark.rb +74 -0
- data/yarn-error.log +17 -12
- data/yarn.lock +1575 -31
- metadata +64 -25
- data/app/assets/stylesheets/headmin/form.scss +0 -132
- data/app/assets/stylesheets/headmin/overrides/redactorx.css +0 -3
- data/app/helpers/headmin/documentation_helper.rb +0 -35
- data/app/models/headmin/documentation_renderer.rb +0 -32
- data/app/models/headmin/form/base.rb +0 -78
- data/app/models/headmin/form/text.rb +0 -51
- data/app/services/block_service.rb +0 -72
- data/app/views/headmin/_card.html.erb +0 -52
- data/app/views/headmin/forms/_actions.html.erb +0 -28
- data/app/views/headmin/forms/_base.html.erb +0 -114
- data/app/views/headmin/forms/_image.html.erb +0 -21
- data/app/views/headmin/forms/_video.html.erb +0 -21
- data/app/views/headmin/forms/actions/_destroy.html.erb +0 -13
- data/app/views/headmin/forms/actions/_save.html.erb +0 -12
- data/app/views/headmin/forms/actions/_view.html.erb +0 -15
- data/app/views/headmin/forms/fields/_image.html.erb +0 -17
- data/docs/blocks-and-fields.md +0 -54
- data/docs/blocks.md +0 -48
- data/docs/devise.md +0 -41
- data/docs/fields.md +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2df34e0f6abc35cd855cab3059a40f7716b336df77abdbd4ea9609fc3cf6e5e
|
4
|
+
data.tar.gz: 2c2c5953560f608e6d479bcb7de506ce8da701be8d56b5fbf72cfcaf3a9478ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a7d48956fb48e286cd0fd2ac043741256c2e573ffb024cc4ae7fffb2e39c54d4db380efb4308f6816649f43e3fde68fabda7d104211cbcdf8f387d6c7d384b
|
7
|
+
data.tar.gz: 33afd17085196473000927125f9186e5b5703575373cdee9be982e6ca32db31ce09aef1fdf3ebf65b2efb9e31b16595fb6b5076ea65e7872f2ecaf49f260ea12
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- '*'
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
steps:
|
14
|
+
- name: Install libvips
|
15
|
+
run: sudo apt-get install -y libvips
|
16
|
+
- uses: actions/checkout@master
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
bundler: default
|
21
|
+
bundler-cache: true
|
22
|
+
- name: StandardRb check
|
23
|
+
run: bundle exec standardrb
|
24
|
+
- name: Run tests
|
25
|
+
env:
|
26
|
+
RAILS_ENV: test
|
27
|
+
run: bundle exec rake test
|
data/.gitignore
CHANGED
@@ -8,6 +8,20 @@
|
|
8
8
|
/tmp/
|
9
9
|
/node_modules/
|
10
10
|
|
11
|
+
# Ignore dummy app
|
12
|
+
/test/dummy/log/*
|
13
|
+
/test/dummy/tmp/*
|
14
|
+
/test/dummy/db/*.sqlite3
|
15
|
+
/test/dummy/db/*.sqlite3-*
|
16
|
+
!/test/dummy/log/.keep
|
17
|
+
!/test/dummy/tmp/.keep
|
18
|
+
/test/dummy/tmp/pids/*
|
19
|
+
!/test/dummy/tmp/pids/
|
20
|
+
!/test/dummy/tmp/pids/.keep
|
21
|
+
/test/dummy/storage/*
|
22
|
+
!/test/dummy/storage/.keep
|
23
|
+
/test/dummy/public/assets
|
24
|
+
|
11
25
|
# Ingore editors
|
12
26
|
/.idea
|
13
27
|
/headmin.iml
|
File without changes
|
data/.nvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
lts/gallium
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,36 @@
|
|
1
1
|
# Headmin Changelog
|
2
2
|
|
3
|
+
## 0.4.2
|
4
|
+
- FEATURE: New field type "files" to allow simple gallery creation
|
5
|
+
- FIX: Fields hash with duplicate keys no longer mix up
|
6
|
+
- BREAK: Image field is now deprecated. Use the file field instead
|
7
|
+
- BREAK: Field uses "has_many_attached :files" instead of "has_one_attache :file" now. Rename "file" to "files" in `active_storage_attachments`
|
8
|
+
- BREAK: You need to set a File object in the fields_hash, instead of creating an intermediate Blob instance
|
9
|
+
|
10
|
+
## 0.4
|
11
|
+
- FEATURE: Introduction of a `ViewModel` class to clean up the component views. This allows for a cleaner abstraction and better testing.
|
12
|
+
- FEATURE: New `wysiwyg` component which currently defaults to Redactor X. Redactor X will be swapped with a free open source version in the 1.0 release.
|
13
|
+
- FEATURE: `headmin/forms/redactorx` now accepts `hybrid: true` to hide the controls
|
14
|
+
- FEATURE: `headmin/forms/wysiwyg` accepts a `toolbar: false` to thide the top toolbar
|
15
|
+
- FEATURE: Validation highlighting has been added to all form fields
|
16
|
+
- FEATURE: Autocomplete suggestions added to `headmin/forms/text`, `headmin/forms/url`, `headmin/forms/email` and `headmin/forms/search`
|
17
|
+
- FIX: Readonly inputs didn't show the default greyed out background color
|
18
|
+
- FIX: Top corners of repeaters were square
|
19
|
+
- FIX: Square corners on group fields are now round
|
20
|
+
- BREAK: Passing the names of the blocks in `headmin/forms/blocks` is now required. The `allow` parameter is deprecated in favor of `names`.
|
21
|
+
- BREAK: `headmin/card` has been removed
|
22
|
+
- BREAK: `headmin/forms/actions` and all of its child components have been removed
|
23
|
+
- BREAK: `$font-weight-medium` has been removed from headmin overrides variables. We don't want to introduce new variable names that look like they are part of Bootstrap.
|
24
|
+
- BREAK: `headmin/forms/date_range` has a different way of setting attribute specific values. We now have a `:start` and `:end` attribute that accept all possible input options for their respective inputs. Both have a required `:attribute` parameter now.
|
25
|
+
|
26
|
+
```erb
|
27
|
+
# Old
|
28
|
+
<%= render "headmin/forms/date_range", form: form, start_attribute: :start_date, end_attribute: :end_date %>
|
29
|
+
|
30
|
+
# New
|
31
|
+
<%= render "headmin/forms/date_range", form: form, start: {attribute: :start_date}, end: {attribute: :end_date} %>
|
32
|
+
```
|
33
|
+
|
3
34
|
## 0.3
|
4
35
|
|
5
36
|
- Support for import maps added
|
data/Gemfile
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
source "https://rubygems.org"
|
4
2
|
|
5
3
|
# Specify your gem's dependencies in headmin.gemspec
|
6
4
|
gemspec
|
7
5
|
|
8
|
-
gem "
|
9
|
-
|
6
|
+
gem "capybara", ">= 3.26"
|
10
7
|
gem "minitest", "~> 5.0"
|
8
|
+
gem "minitest-spec-rails", "~> 6.1"
|
9
|
+
gem "rails", "~> 7.0"
|
10
|
+
gem "rake", "~> 13.0"
|
11
|
+
gem "sprockets-rails", "~> 3.4"
|
12
|
+
gem "sqlite3", "~> 1.4"
|
11
13
|
gem "standard", "~> 1.7"
|
14
|
+
gem "debug"
|
data/Gemfile.lock
CHANGED
@@ -1,79 +1,245 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
headmin (0.
|
4
|
+
headmin (0.4.1)
|
5
5
|
closure_tree (~> 7.4)
|
6
6
|
inline_svg (~> 1.7)
|
7
7
|
redcarpet (~> 3.5)
|
8
|
-
rouge (~> 3.
|
8
|
+
rouge (~> 3.28)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
actioncable (7.0.2.4)
|
14
|
+
actionpack (= 7.0.2.4)
|
15
|
+
activesupport (= 7.0.2.4)
|
16
|
+
nio4r (~> 2.0)
|
17
|
+
websocket-driver (>= 0.6.1)
|
18
|
+
actionmailbox (7.0.2.4)
|
19
|
+
actionpack (= 7.0.2.4)
|
20
|
+
activejob (= 7.0.2.4)
|
21
|
+
activerecord (= 7.0.2.4)
|
22
|
+
activestorage (= 7.0.2.4)
|
23
|
+
activesupport (= 7.0.2.4)
|
24
|
+
mail (>= 2.7.1)
|
25
|
+
net-imap
|
26
|
+
net-pop
|
27
|
+
net-smtp
|
28
|
+
actionmailer (7.0.2.4)
|
29
|
+
actionpack (= 7.0.2.4)
|
30
|
+
actionview (= 7.0.2.4)
|
31
|
+
activejob (= 7.0.2.4)
|
32
|
+
activesupport (= 7.0.2.4)
|
33
|
+
mail (~> 2.5, >= 2.5.4)
|
34
|
+
net-imap
|
35
|
+
net-pop
|
36
|
+
net-smtp
|
37
|
+
rails-dom-testing (~> 2.0)
|
38
|
+
actionpack (7.0.2.4)
|
39
|
+
actionview (= 7.0.2.4)
|
40
|
+
activesupport (= 7.0.2.4)
|
41
|
+
rack (~> 2.0, >= 2.2.0)
|
42
|
+
rack-test (>= 0.6.3)
|
43
|
+
rails-dom-testing (~> 2.0)
|
44
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
45
|
+
actiontext (7.0.2.4)
|
46
|
+
actionpack (= 7.0.2.4)
|
47
|
+
activerecord (= 7.0.2.4)
|
48
|
+
activestorage (= 7.0.2.4)
|
49
|
+
activesupport (= 7.0.2.4)
|
50
|
+
globalid (>= 0.6.0)
|
51
|
+
nokogiri (>= 1.8.5)
|
52
|
+
actionview (7.0.2.4)
|
53
|
+
activesupport (= 7.0.2.4)
|
54
|
+
builder (~> 3.1)
|
55
|
+
erubi (~> 1.4)
|
56
|
+
rails-dom-testing (~> 2.0)
|
57
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
58
|
+
activejob (7.0.2.4)
|
59
|
+
activesupport (= 7.0.2.4)
|
60
|
+
globalid (>= 0.3.6)
|
61
|
+
activemodel (7.0.2.4)
|
62
|
+
activesupport (= 7.0.2.4)
|
63
|
+
activerecord (7.0.2.4)
|
64
|
+
activemodel (= 7.0.2.4)
|
65
|
+
activesupport (= 7.0.2.4)
|
66
|
+
activestorage (7.0.2.4)
|
67
|
+
actionpack (= 7.0.2.4)
|
68
|
+
activejob (= 7.0.2.4)
|
69
|
+
activerecord (= 7.0.2.4)
|
70
|
+
activesupport (= 7.0.2.4)
|
71
|
+
marcel (~> 1.0)
|
72
|
+
mini_mime (>= 1.1.0)
|
73
|
+
activesupport (7.0.2.4)
|
19
74
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
75
|
i18n (>= 1.6, < 2)
|
21
76
|
minitest (>= 5.1)
|
22
77
|
tzinfo (~> 2.0)
|
78
|
+
addressable (2.8.0)
|
79
|
+
public_suffix (>= 2.0.2, < 5.0)
|
23
80
|
ast (2.4.2)
|
81
|
+
builder (3.2.4)
|
82
|
+
capybara (3.36.0)
|
83
|
+
addressable
|
84
|
+
matrix
|
85
|
+
mini_mime (>= 0.1.3)
|
86
|
+
nokogiri (~> 1.8)
|
87
|
+
rack (>= 1.6.0)
|
88
|
+
rack-test (>= 0.6.3)
|
89
|
+
regexp_parser (>= 1.5, < 3.0)
|
90
|
+
xpath (~> 3.2)
|
24
91
|
closure_tree (7.4.0)
|
25
92
|
activerecord (>= 4.2.10)
|
26
93
|
with_advisory_lock (>= 4.0.0)
|
27
|
-
concurrent-ruby (1.1.
|
28
|
-
|
94
|
+
concurrent-ruby (1.1.10)
|
95
|
+
crass (1.0.6)
|
96
|
+
debug (1.5.0)
|
97
|
+
irb (>= 1.3.6)
|
98
|
+
reline (>= 0.2.7)
|
99
|
+
digest (3.1.0)
|
100
|
+
erubi (1.10.0)
|
101
|
+
globalid (1.0.0)
|
102
|
+
activesupport (>= 5.0)
|
103
|
+
i18n (1.10.0)
|
29
104
|
concurrent-ruby (~> 1.0)
|
30
105
|
inline_svg (1.8.0)
|
31
106
|
activesupport (>= 3.0)
|
32
107
|
nokogiri (>= 1.6)
|
33
|
-
|
34
|
-
|
108
|
+
io-console (0.5.11)
|
109
|
+
irb (1.4.1)
|
110
|
+
reline (>= 0.3.0)
|
111
|
+
loofah (2.16.0)
|
112
|
+
crass (~> 1.0.2)
|
113
|
+
nokogiri (>= 1.5.9)
|
114
|
+
mail (2.7.1)
|
115
|
+
mini_mime (>= 0.1.1)
|
116
|
+
marcel (1.0.2)
|
117
|
+
matrix (0.4.2)
|
118
|
+
method_source (1.0.0)
|
119
|
+
mini_mime (1.1.2)
|
120
|
+
minitest (5.15.0)
|
121
|
+
minitest-spec-rails (6.1.0)
|
122
|
+
minitest (>= 5.0)
|
123
|
+
railties (>= 4.1)
|
124
|
+
net-imap (0.2.3)
|
125
|
+
digest
|
126
|
+
net-protocol
|
127
|
+
strscan
|
128
|
+
net-pop (0.1.1)
|
129
|
+
digest
|
130
|
+
net-protocol
|
131
|
+
timeout
|
132
|
+
net-protocol (0.1.3)
|
133
|
+
timeout
|
134
|
+
net-smtp (0.3.1)
|
135
|
+
digest
|
136
|
+
net-protocol
|
137
|
+
timeout
|
138
|
+
nio4r (2.5.8)
|
139
|
+
nokogiri (1.13.4-arm64-darwin)
|
35
140
|
racc (~> 1.4)
|
36
|
-
|
37
|
-
|
141
|
+
nokogiri (1.13.4-x86_64-darwin)
|
142
|
+
racc (~> 1.4)
|
143
|
+
nokogiri (1.13.4-x86_64-linux)
|
144
|
+
racc (~> 1.4)
|
145
|
+
parallel (1.22.1)
|
146
|
+
parser (3.1.2.0)
|
38
147
|
ast (~> 2.4.1)
|
148
|
+
public_suffix (4.0.7)
|
39
149
|
racc (1.6.0)
|
150
|
+
rack (2.2.3)
|
151
|
+
rack-test (1.1.0)
|
152
|
+
rack (>= 1.0, < 3)
|
153
|
+
rails (7.0.2.4)
|
154
|
+
actioncable (= 7.0.2.4)
|
155
|
+
actionmailbox (= 7.0.2.4)
|
156
|
+
actionmailer (= 7.0.2.4)
|
157
|
+
actionpack (= 7.0.2.4)
|
158
|
+
actiontext (= 7.0.2.4)
|
159
|
+
actionview (= 7.0.2.4)
|
160
|
+
activejob (= 7.0.2.4)
|
161
|
+
activemodel (= 7.0.2.4)
|
162
|
+
activerecord (= 7.0.2.4)
|
163
|
+
activestorage (= 7.0.2.4)
|
164
|
+
activesupport (= 7.0.2.4)
|
165
|
+
bundler (>= 1.15.0)
|
166
|
+
railties (= 7.0.2.4)
|
167
|
+
rails-dom-testing (2.0.3)
|
168
|
+
activesupport (>= 4.2.0)
|
169
|
+
nokogiri (>= 1.6)
|
170
|
+
rails-html-sanitizer (1.4.2)
|
171
|
+
loofah (~> 2.3)
|
172
|
+
railties (7.0.2.4)
|
173
|
+
actionpack (= 7.0.2.4)
|
174
|
+
activesupport (= 7.0.2.4)
|
175
|
+
method_source
|
176
|
+
rake (>= 12.2)
|
177
|
+
thor (~> 1.0)
|
178
|
+
zeitwerk (~> 2.5)
|
40
179
|
rainbow (3.1.1)
|
41
|
-
rake (13.0.
|
180
|
+
rake (13.0.6)
|
42
181
|
redcarpet (3.5.1)
|
43
|
-
regexp_parser (2.
|
182
|
+
regexp_parser (2.3.1)
|
183
|
+
reline (0.3.1)
|
184
|
+
io-console (~> 0.5)
|
44
185
|
rexml (3.2.5)
|
45
|
-
rouge (3.
|
46
|
-
rubocop (1.
|
186
|
+
rouge (3.28.0)
|
187
|
+
rubocop (1.28.2)
|
47
188
|
parallel (~> 1.10)
|
48
189
|
parser (>= 3.1.0.0)
|
49
190
|
rainbow (>= 2.2.2, < 4.0)
|
50
191
|
regexp_parser (>= 1.8, < 3.0)
|
51
192
|
rexml
|
52
|
-
rubocop-ast (>= 1.
|
193
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
53
194
|
ruby-progressbar (~> 1.7)
|
54
195
|
unicode-display_width (>= 1.4.0, < 3.0)
|
55
|
-
rubocop-ast (1.
|
56
|
-
parser (>= 3.
|
57
|
-
rubocop-performance (1.13.
|
196
|
+
rubocop-ast (1.17.0)
|
197
|
+
parser (>= 3.1.1.0)
|
198
|
+
rubocop-performance (1.13.3)
|
58
199
|
rubocop (>= 1.7.0, < 2.0)
|
59
200
|
rubocop-ast (>= 0.4.0)
|
60
201
|
ruby-progressbar (1.11.0)
|
61
|
-
|
62
|
-
|
63
|
-
|
202
|
+
sprockets (4.0.3)
|
203
|
+
concurrent-ruby (~> 1.0)
|
204
|
+
rack (> 1, < 3)
|
205
|
+
sprockets-rails (3.4.2)
|
206
|
+
actionpack (>= 5.2)
|
207
|
+
activesupport (>= 5.2)
|
208
|
+
sprockets (>= 3.0.0)
|
209
|
+
sqlite3 (1.4.2)
|
210
|
+
standard (1.11.0)
|
211
|
+
rubocop (= 1.28.2)
|
212
|
+
rubocop-performance (= 1.13.3)
|
213
|
+
strscan (3.0.1)
|
214
|
+
thor (1.2.1)
|
215
|
+
timeout (0.2.0)
|
64
216
|
tzinfo (2.0.4)
|
65
217
|
concurrent-ruby (~> 1.0)
|
66
218
|
unicode-display_width (2.1.0)
|
219
|
+
websocket-driver (0.7.5)
|
220
|
+
websocket-extensions (>= 0.1.0)
|
221
|
+
websocket-extensions (0.1.5)
|
67
222
|
with_advisory_lock (4.6.0)
|
68
223
|
activerecord (>= 4.2)
|
224
|
+
xpath (3.2.0)
|
225
|
+
nokogiri (~> 1.8)
|
226
|
+
zeitwerk (2.5.4)
|
69
227
|
|
70
228
|
PLATFORMS
|
229
|
+
arm64-darwin-21
|
71
230
|
x86_64-darwin-19
|
231
|
+
x86_64-linux
|
72
232
|
|
73
233
|
DEPENDENCIES
|
234
|
+
capybara (>= 3.26)
|
235
|
+
debug
|
74
236
|
headmin!
|
75
237
|
minitest (~> 5.0)
|
238
|
+
minitest-spec-rails (~> 6.1)
|
239
|
+
rails (~> 7.0)
|
76
240
|
rake (~> 13.0)
|
241
|
+
sprockets-rails (~> 3.4)
|
242
|
+
sqlite3 (~> 1.4)
|
77
243
|
standard (~> 1.7)
|
78
244
|
|
79
245
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@ A complete library of commonly used components to build an admin interface in yo
|
|
4
4
|
|
5
5
|
[](https://rubygems.org/gems/headmin)
|
6
6
|
[](https://www.npmjs.com/package/headmin)
|
7
|
+
[](https://github.com/frontierdotbe/headmin/actions/workflows/ci.yml)
|
7
8
|
|
8
9
|
## Installation
|
9
10
|
|
@@ -88,6 +89,12 @@ When adding new dependencies, make sure you add them to the `package.json` file
|
|
88
89
|
|
89
90
|
## Testing
|
90
91
|
|
92
|
+
Run tests with
|
93
|
+
|
94
|
+
```shell
|
95
|
+
rake test
|
96
|
+
```
|
97
|
+
|
91
98
|
If you want to test a specific feature in a staging environment without releasing the gem, you can refer to the remote
|
92
99
|
repo in your Gemfile and package.json.
|
93
100
|
|
data/Rakefile
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require "bundler/gem_tasks"
|
4
2
|
require "rake/testtask"
|
5
3
|
|
@@ -9,8 +7,4 @@ Rake::TestTask.new(:test) do |t|
|
|
9
7
|
t.test_files = FileList["test/**/*_test.rb"]
|
10
8
|
end
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
RuboCop::RakeTask.new
|
15
|
-
|
16
|
-
task default: %i[test rubocop]
|
10
|
+
task default: %i[test]
|
@@ -1,11 +1,11 @@
|
|
1
1
|
export default class {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
return window.I18n.locale
|
2
|
+
static get locale () {
|
3
|
+
if (window.I18n === undefined) {
|
4
|
+
const locale = document.querySelector('html').getAttribute('lang')
|
5
|
+
window.I18n = {
|
6
|
+
locale: locale || 'en'
|
7
|
+
}
|
10
8
|
}
|
11
|
-
|
9
|
+
return window.I18n.locale
|
10
|
+
}
|
11
|
+
}
|