fuji_admin 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84d5ee21faecdb6bc1cfc795a561d6048b78c6fc5606a1677f1f7e3f2c98255e
4
- data.tar.gz: 752b254a7fa3769e3edc3dc7145793d1212ce9a6ff220830fb1ad42bebec468a
3
+ metadata.gz: 4ced4ed49bdd67f0df172275fee1324778c378ae9e0ee99d3977e136ce819596
4
+ data.tar.gz: feb7791cec556d78eede014b8f9e3e531bfd31512cdb6fce9f60277e28a6dd20
5
5
  SHA512:
6
- metadata.gz: f749ae04c4dbb606f8f5ee790b1af74f37fe8138ba7f71d79dc151004a0a18296784c8095da90fef088dbd23e8e0581f53f7c6986e20b2b6208667c7bbfa4b35
7
- data.tar.gz: b9798fe929298c2b856ccb858095cd270fdd542d08a03a33e5ea7191834203118be47ce8078b1cd39769e55c6163ac008d1b1c2bf5f4af61a73edefb9dae7fe1
6
+ metadata.gz: d233f8162d6fbd660000f429aaf480756385da78f4e58aa1ed73680c080afec0e117b1f143cfe6099651b03a009dc1af9cba699620ee8efa55255803dee339fd
7
+ data.tar.gz: 64b65816c0c78554be7afdc1c716133f49a98dc4c42dd37d367063f14f6e335b31ef7565294eb42f14d4e895fc01c0d7a7eda25439f2ab192461c007334ca9ef
data/README.md CHANGED
@@ -4,10 +4,6 @@ A responsive [ActiveAdmin](https://github.com/activeadmin/activeadmin) theme.
4
4
  Clean card-based layout, slide-in filter drawer, float-label inputs,
5
5
  row-action dropdowns, and a live palette switcher with 30 built-in palettes.
6
6
 
7
- Inspired by [arctic_admin](https://github.com/cprodhomme/arctic_admin) (SCSS
8
- structure) and [PrimeReact Verona](https://verona.primereact.org/) (visual
9
- language).
10
-
11
7
  ## Features
12
8
 
13
9
  - **Responsive layout** — fixed header + sidebar nav at `lg+`, auto-injected
@@ -35,12 +31,10 @@ language).
35
31
 
36
32
  ## Installation
37
33
 
38
- ### From GitHub (recommended)
39
-
40
34
  In your host app's `Gemfile`:
41
35
 
42
36
  ```ruby
43
- gem "fuji_admin", github: "BarbaricCorgi/fuji_admin"
37
+ gem "fuji_admin", "~> 0.1"
44
38
  ```
45
39
 
46
40
  Then:
@@ -49,9 +43,6 @@ Then:
49
43
  bundle install
50
44
  ```
51
45
 
52
- The Gemfile.lock pins the exact commit SHA, so CI / Docker / Kamal builds
53
- are reproducible without needing to publish to RubyGems.
54
-
55
46
  ### Asset imports
56
47
 
57
48
  In `app/assets/stylesheets/active_admin.scss`:
@@ -96,15 +87,28 @@ Clone both repos side-by-side:
96
87
  └── my_admin_app/
97
88
  ```
98
89
 
99
- Point the host's `Gemfile` at the github source (as above), then tell
100
- Bundler to resolve it locally so edits in `fuji_admin/` reflect immediately:
90
+ Bundler's `bundle config local.<gem>` override only works when the host's
91
+ Gemfile references a git source, not a published RubyGem. So for live local
92
+ editing, point the host's Gemfile at the GitHub source temporarily:
93
+
94
+ ```ruby
95
+ # Host app Gemfile — during fuji_admin development
96
+ gem "fuji_admin", github: "BarbaricCorgi/fuji_admin"
97
+ ```
98
+
99
+ Then tell Bundler to resolve it against your local checkout:
101
100
 
102
101
  ```bash
103
102
  bundle config local.fuji_admin ~/development/fuji_admin
104
103
  ```
105
104
 
106
- This is a per-machine config stored in `~/.bundle/config` — CI and
107
- production never see it and fall back to the github source.
105
+ This is a per-machine setting stored in `~/.bundle/config` — CI / Docker /
106
+ Kamal never see it and fall back to the github source. Edits in
107
+ `~/development/fuji_admin` reflect in the host app immediately.
108
+
109
+ When you're ready to ship, flip the Gemfile back to
110
+ `gem "fuji_admin", "~> 0.1"`, publish a new version (`gem build && gem push`),
111
+ and run `bundle update fuji_admin` in the host.
108
112
 
109
113
  ## Customising palettes
110
114
 
@@ -131,13 +135,6 @@ Palettes without a `theme` block get auto-derived surfaces + text by mixing
131
135
  the `primary` with white / black at runtime via `color-mix()`, so every
132
136
  palette reads as a coherent mini-theme.
133
137
 
134
- ## Credits
135
-
136
- - [arctic_admin](https://github.com/cprodhomme/arctic_admin) — SCSS
137
- structure (variables → mixins → layouts → components → pages).
138
- - [PrimeReact Verona](https://verona.primereact.org/) — visual language
139
- (layout proportions, rounded cards, float labels, filter chips).
140
-
141
138
  ## License
142
139
 
143
140
  MIT — see [LICENSE.txt](LICENSE.txt).
@@ -504,7 +504,7 @@ body.active_admin #sidebar .sidebar_section.panel:not(#filters_sidebar_section)
504
504
  right: 0;
505
505
  bottom: calc(100% + #{$space-2});
506
506
  width: 320px;
507
- max-height: #{"min(70vh, 560px)"}; // interpolated so SassC emits raw CSS min()
507
+ max-height: 70vh; // SassC rejects `min(70vh, 560px)` even when interpolated
508
508
  overflow-y: auto;
509
509
  background-color: $surface-0;
510
510
  border: 1px solid $surface-border;
@@ -1,19 +1,15 @@
1
1
  module FujiAdmin
2
- # Injects <meta> tags into ActiveAdmin's <head> so the palette JavaScript
3
- # can read the FujiAdmin config at runtime without requiring the host app
4
- # to touch its layout.
5
- #
6
- # Applied by prepending onto ActiveAdmin::Views::Pages::Base once AA is
7
- # loaded. If AA isn't present the prepend silently no-ops.
8
- module ActiveAdminPatch
9
- def build_active_admin_head
10
- super
11
- within @head do
12
- meta(name: "fuji-palette-picker", content: FujiAdmin.config.palette_picker.to_s)
13
- meta(name: "fuji-default-palette", content: FujiAdmin.config.default_palette.to_s)
14
- end
2
+ # Surfaces FujiAdmin.config to the browser by registering entries in each
3
+ # ActiveAdmin namespace's built-in `meta_tags` hash. AA renders those
4
+ # entries as <meta> tags inside <head> (lib/active_admin/views/pages/base.rb),
5
+ # so the palette JavaScript can read them on page load without any
6
+ # monkey-patching of arbre's view builders.
7
+ def self.install_meta_tags!
8
+ return unless defined?(::ActiveAdmin)
9
+
10
+ ActiveAdmin.application.namespaces.each do |namespace|
11
+ namespace.meta_tags["fuji-palette-picker"] = config.palette_picker.to_s
12
+ namespace.meta_tags["fuji-default-palette"] = config.default_palette.to_s
15
13
  end
16
14
  end
17
15
  end
18
-
19
- ActiveAdmin::Views::Pages::Base.prepend(FujiAdmin::ActiveAdminPatch) if defined?(::ActiveAdmin)
@@ -1,3 +1,3 @@
1
1
  module FujiAdmin
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/fuji_admin.rb CHANGED
@@ -16,8 +16,12 @@ module FujiAdmin
16
16
 
17
17
  module Rails
18
18
  class Engine < ::Rails::Engine
19
- initializer "fuji_admin.active_admin_patch", after: :load_config_initializers do
20
- require "fuji_admin/active_admin_patch" if defined?(::ActiveAdmin)
19
+ # Register meta tags after all initializers have run (so both
20
+ # FujiAdmin.configure and ActiveAdmin.setup have populated their state)
21
+ # and AA's namespaces are available to iterate.
22
+ config.after_initialize do
23
+ require "fuji_admin/active_admin_patch"
24
+ FujiAdmin.install_meta_tags!
21
25
  end
22
26
  end
23
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuji_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - barbariccorgi