panda-core 0.2.4 → 0.4.1

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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/tailwind/application.css +104 -7
  3. data/app/components/panda/core/UI/badge.rb +107 -0
  4. data/app/components/panda/core/UI/button.rb +89 -0
  5. data/app/components/panda/core/UI/card.rb +88 -0
  6. data/app/components/panda/core/admin/button_component.rb +46 -28
  7. data/app/components/panda/core/admin/container_component.rb +52 -4
  8. data/app/components/panda/core/admin/flash_message_component.rb +74 -9
  9. data/app/components/panda/core/admin/form_error_component.rb +48 -0
  10. data/app/components/panda/core/admin/form_input_component.rb +50 -0
  11. data/app/components/panda/core/admin/form_select_component.rb +68 -0
  12. data/app/components/panda/core/admin/heading_component.rb +52 -24
  13. data/app/components/panda/core/admin/panel_component.rb +33 -4
  14. data/app/components/panda/core/admin/slideover_component.rb +8 -4
  15. data/app/components/panda/core/admin/statistics_component.rb +19 -0
  16. data/app/components/panda/core/admin/tab_bar_component.rb +101 -0
  17. data/app/components/panda/core/admin/table_component.rb +90 -9
  18. data/app/components/panda/core/admin/tag_component.rb +21 -16
  19. data/app/components/panda/core/admin/user_activity_component.rb +43 -0
  20. data/app/components/panda/core/admin/user_display_component.rb +78 -0
  21. data/app/components/panda/core/base.rb +122 -0
  22. data/app/controllers/panda/core/admin/base_controller.rb +68 -0
  23. data/app/controllers/panda/core/admin/dashboard_controller.rb +5 -3
  24. data/app/controllers/panda/core/admin/my_profile_controller.rb +3 -3
  25. data/app/controllers/panda/core/admin/sessions_controller.rb +9 -6
  26. data/app/helpers/panda/core/sessions_helper.rb +1 -1
  27. data/app/javascript/panda/core/vendor/@hotwired--stimulus.js +4 -0
  28. data/app/javascript/panda/core/vendor/@hotwired--turbo.js +160 -0
  29. data/app/javascript/panda/core/vendor/@rails--actioncable--src.js +4 -0
  30. data/app/models/panda/core/user.rb +17 -13
  31. data/app/views/layouts/panda/core/admin.html.erb +40 -3
  32. data/app/views/layouts/panda/core/admin_simple.html.erb +5 -0
  33. data/app/views/panda/core/admin/dashboard/_default_content.html.erb +4 -4
  34. data/app/views/panda/core/admin/dashboard/show.html.erb +2 -2
  35. data/app/views/panda/core/admin/my_profile/edit.html.erb +13 -27
  36. data/app/views/panda/core/admin/sessions/new.html.erb +7 -7
  37. data/app/views/panda/core/admin/shared/_breadcrumbs.html.erb +27 -34
  38. data/app/views/panda/core/admin/shared/_flash.html.erb +4 -30
  39. data/app/views/panda/core/admin/shared/_sidebar.html.erb +36 -20
  40. data/app/views/panda/core/shared/_header.html.erb +13 -5
  41. data/config/importmap.rb +11 -6
  42. data/config/routes.rb +2 -4
  43. data/db/migrate/20250810120000_add_current_theme_to_panda_core_users.rb +7 -0
  44. data/lib/panda/core/asset_loader.rb +23 -8
  45. data/lib/panda/core/configuration.rb +12 -9
  46. data/lib/panda/core/debug.rb +47 -0
  47. data/lib/panda/core/engine.rb +43 -6
  48. data/lib/panda/core/version.rb +1 -1
  49. data/lib/panda/core.rb +1 -0
  50. metadata +93 -14
  51. data/app/components/panda/core/admin/container_component.html.erb +0 -12
  52. data/app/components/panda/core/admin/flash_message_component.html.erb +0 -31
  53. data/app/components/panda/core/admin/panel_component.html.erb +0 -7
  54. data/app/components/panda/core/admin/slideover_component.html.erb +0 -9
  55. data/app/components/panda/core/admin/table_component.html.erb +0 -29
  56. data/app/controllers/panda/core/admin_controller.rb +0 -30
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
- - Tasty Bamboo
7
+ - Otaina Limited
8
8
  - James Inman
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2025-10-27 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: importmap-rails
@@ -165,6 +164,62 @@ dependencies:
165
164
  - - ">="
166
165
  - !ruby/object:Gem::Version
167
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: phlex
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '2.3'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '2.3'
181
+ - !ruby/object:Gem::Dependency
182
+ name: phlex-rails
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '2.3'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '2.3'
195
+ - !ruby/object:Gem::Dependency
196
+ name: literal
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.8'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.8'
209
+ - !ruby/object:Gem::Dependency
210
+ name: tailwind_merge
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '1.3'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '1.3'
168
223
  - !ruby/object:Gem::Dependency
169
224
  name: pg
170
225
  requirement: !ruby/object:Gem::Requirement
@@ -193,6 +248,20 @@ dependencies:
193
248
  - - ">="
194
249
  - !ruby/object:Gem::Version
195
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rails-controller-testing
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
196
265
  - !ruby/object:Gem::Dependency
197
266
  name: capybara
198
267
  requirement: !ruby/object:Gem::Requirement
@@ -364,7 +433,7 @@ dependencies:
364
433
  description: Shared development tools, configurations, and utilities for Panda CMS
365
434
  and its related projects
366
435
  email:
367
- - bamboo@pandacms.io
436
+ - james@otaina.co.uk
368
437
  executables: []
369
438
  extensions: []
370
439
  extra_rdoc_files: []
@@ -375,24 +444,30 @@ files:
375
444
  - app/assets/tailwind/application.css
376
445
  - app/assets/tailwind/tailwind.config.js
377
446
  - app/builders/panda/core/form_builder.rb
447
+ - app/components/panda/core/UI/badge.rb
448
+ - app/components/panda/core/UI/button.rb
449
+ - app/components/panda/core/UI/card.rb
378
450
  - app/components/panda/core/admin/button_component.rb
379
- - app/components/panda/core/admin/container_component.html.erb
380
451
  - app/components/panda/core/admin/container_component.rb
381
- - app/components/panda/core/admin/flash_message_component.html.erb
382
452
  - app/components/panda/core/admin/flash_message_component.rb
453
+ - app/components/panda/core/admin/form_error_component.rb
454
+ - app/components/panda/core/admin/form_input_component.rb
455
+ - app/components/panda/core/admin/form_select_component.rb
383
456
  - app/components/panda/core/admin/heading_component.rb
384
- - app/components/panda/core/admin/panel_component.html.erb
385
457
  - app/components/panda/core/admin/panel_component.rb
386
- - app/components/panda/core/admin/slideover_component.html.erb
387
458
  - app/components/panda/core/admin/slideover_component.rb
388
- - app/components/panda/core/admin/table_component.html.erb
459
+ - app/components/panda/core/admin/statistics_component.rb
460
+ - app/components/panda/core/admin/tab_bar_component.rb
389
461
  - app/components/panda/core/admin/table_component.rb
390
462
  - app/components/panda/core/admin/tag_component.rb
463
+ - app/components/panda/core/admin/user_activity_component.rb
464
+ - app/components/panda/core/admin/user_display_component.rb
465
+ - app/components/panda/core/base.rb
391
466
  - app/constraints/panda/core/admin_constraint.rb
467
+ - app/controllers/panda/core/admin/base_controller.rb
392
468
  - app/controllers/panda/core/admin/dashboard_controller.rb
393
469
  - app/controllers/panda/core/admin/my_profile_controller.rb
394
470
  - app/controllers/panda/core/admin/sessions_controller.rb
395
- - app/controllers/panda/core/admin_controller.rb
396
471
  - app/controllers/panda/core/application_controller.rb
397
472
  - app/helpers/panda/core/asset_helper.rb
398
473
  - app/helpers/panda/core/sessions_helper.rb
@@ -400,11 +475,15 @@ files:
400
475
  - app/javascript/panda/core/controllers/index.js
401
476
  - app/javascript/panda/core/controllers/theme_form_controller.js
402
477
  - app/javascript/panda/core/tailwindcss-stimulus-components.js
478
+ - app/javascript/panda/core/vendor/@hotwired--stimulus.js
479
+ - app/javascript/panda/core/vendor/@hotwired--turbo.js
480
+ - app/javascript/panda/core/vendor/@rails--actioncable--src.js
403
481
  - app/models/panda/core/application_record.rb
404
482
  - app/models/panda/core/breadcrumb.rb
405
483
  - app/models/panda/core/current.rb
406
484
  - app/models/panda/core/user.rb
407
485
  - app/views/layouts/panda/core/admin.html.erb
486
+ - app/views/layouts/panda/core/admin_simple.html.erb
408
487
  - app/views/panda/core/admin/dashboard/_default_content.html.erb
409
488
  - app/views/panda/core/admin/dashboard/show.html.erb
410
489
  - app/views/panda/core/admin/my_profile/edit.html.erb
@@ -419,6 +498,7 @@ files:
419
498
  - config/initializers/panda_core.rb
420
499
  - config/routes.rb
421
500
  - db/migrate/20250809000001_create_panda_core_users.rb
501
+ - db/migrate/20250810120000_add_current_theme_to_panda_core_users.rb
422
502
  - lib/generators/panda/core/authentication/templates/reek_spec.rb
423
503
  - lib/generators/panda/core/dev_tools/USAGE
424
504
  - lib/generators/panda/core/dev_tools/templates/lefthook.yml
@@ -433,6 +513,7 @@ files:
433
513
  - lib/panda/core/authentication.rb
434
514
  - lib/panda/core/component_registry.rb
435
515
  - lib/panda/core/configuration.rb
516
+ - lib/panda/core/debug.rb
436
517
  - lib/panda/core/engine.rb
437
518
  - lib/panda/core/media.rb
438
519
  - lib/panda/core/notifications.rb
@@ -458,7 +539,6 @@ metadata:
458
539
  homepage_uri: https://github.com/tastybamboo/panda-core
459
540
  source_code_uri: https://github.com/tastybamboo/panda-core
460
541
  changelog_uri: https://github.com/tastybamboo/panda-core/blob/main/CHANGELOG.md
461
- post_install_message:
462
542
  rdoc_options: []
463
543
  require_paths:
464
544
  - lib
@@ -473,8 +553,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
553
  - !ruby/object:Gem::Version
474
554
  version: '0'
475
555
  requirements: []
476
- rubygems_version: 3.5.22
477
- signing_key:
556
+ rubygems_version: 3.6.9
478
557
  specification_version: 4
479
558
  summary: Core libraries and development tools for Tasty Bamboo projects
480
559
  test_files: []
@@ -1,12 +0,0 @@
1
- <main class="overflow-auto flex-1 h-full min-h-full max-h-full">
2
- <div class="overflow-auto px-2 pt-4 mx-auto sm:px-6 lg:px-6">
3
- <%= heading %>
4
- <%= tab_bar %>
5
- <section class="flex-auto h-[calc(100vh-10rem)]">
6
- <div class="flex-1 mt-4 w-full h-full">
7
- <%= content %>
8
- </div>
9
- <%= slideover %>
10
- </section>
11
- </div>
12
- </main>
@@ -1,31 +0,0 @@
1
- <div class="fixed top-2 right-2 z-[9999] p-2 space-y-4 w-full max-w-sm sm:items-end"
2
- data-controller="alert"
3
- <% if @temporary %> data-alert-dismiss-after-value="3000"<% end %>
4
- data-transition-enter="ease-in-out duration-500"
5
- data-transition-enter-from="translate-x-full opacity-0"
6
- data-transition-enter-to="translate-x-0 opacity-100"
7
- data-transition-leave="ease-in-out duration-500"
8
- data-transition-leave-from="translate-x-0 opacity-100"
9
- data-transition-leave-to="translate-x-full opacity-0">
10
- <div class="overflow-hidden w-full max-w-sm bg-white rounded-lg ring-1 ring-black ring-opacity-5 shadow-lg">
11
- <div class="p-4">
12
- <div class="flex items-start">
13
- <div class="flex-shrink-0">
14
- <i class="fa-regular text-xl <%= icon_css %> <%= text_colour_css %>"></i>
15
- </div>
16
- <div class="flex-1 pt-0.5 ml-3 w-0">
17
- <p class="mb-1 text-sm font-medium flash-message-title <%= text_colour_css %>"><%= kind.to_s.titleize %></p>
18
- <p class="mt-1 mb-0 text-sm text-gray-500 flash-message-text"><%= message %></p>
19
- </div>
20
- <div class="flex flex-shrink-0 ml-4">
21
- <button data-action="alert#close" type="button" class="inline-flex text-gray-400 bg-white rounded-md transition duration-150 ease-in-out hover:text-gray-500 focus:ring-2 focus:ring-offset-2 focus:outline-none focus:ring-sky-500">
22
- <span class="sr-only">Close</span>
23
- <svg class="w-5 h-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
24
- <path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" />
25
- </svg>
26
- </button>
27
- </div>
28
- </div>
29
- </div>
30
- </div>
31
- </div>
@@ -1,7 +0,0 @@
1
- <div class="col-span-3 mt-5 rounded-lg shadow-md bg-gray-500 shadow-inherit/20">
2
- <%= heading %>
3
-
4
- <div class="p-4 text-black bg-white rounded-b-lg">
5
- <%= content %>
6
- </div>
7
- </div>
@@ -1,9 +0,0 @@
1
- <% content_for :sidebar do %>
2
- <aside class="hidden overflow-y-auto w-96 h-full bg-white lg:block">
3
- <%= content %>
4
- </aside>
5
- <% end %>
6
-
7
- <% content_for :sidebar_title do %>
8
- <%= title %>
9
- <% end %>
@@ -1,29 +0,0 @@
1
- <div class="table overflow-x-auto mb-12 w-full rounded-lg border border-gray-500">
2
- <div class="table-header-group">
3
- <div class="table-row text-base font-medium text-white bg-gray-500">
4
- <% columns.each_with_index do |column, i| %>
5
- <div class="table-cell sticky top-0 z-10 p-4 <% if i.zero? %>rounded-tl-md<% elsif i == columns.size - 1 %>rounded-tr-md<% end %>"><%= column.label %></div>
6
- <% end %>
7
- </div>
8
- </div>
9
-
10
- <% if @rows.any? %>
11
- <div class="table-row-group">
12
- <% @rows.each do |row| %>
13
- <div class="table-row relative bg-gray-500/5 hover:bg-gray-500/20" data-post-id="<%= row.id %>">
14
- <% @columns.each do |column| %>
15
- <div class="table-cell py-5 px-3 h-20 text-sm align-middle whitespace-nowrap border-b border-gray-500/20">
16
- <%= view_context.capture(row, &column.cell) %>
17
- </div>
18
- <% end %>
19
- </div>
20
- <% end %>
21
- </div>
22
- </div>
23
- <% else %>
24
- </div>
25
- <div class="text-center mx-12 block border border-dashed py-12 rounded-lg">
26
- <h3 class="py-1 text-xl font-semibold text-gray-900">No <%= @term.pluralize %></h3>
27
- <p class="py-1 text-base text-gray-500">Get started by creating a new <%= @term %>.</p>
28
- </div>
29
- <% end %>
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Panda
4
- module Core
5
- class AdminController < ApplicationController
6
- layout "panda/core/admin"
7
-
8
- # Automatically require admin authentication for all admin controllers
9
- before_action :authenticate_admin_user!
10
- before_action :set_initial_breadcrumb
11
-
12
- private
13
-
14
- def set_initial_breadcrumb
15
- # Use configured breadcrumb or default
16
- if Core.configuration.initial_admin_breadcrumb
17
- label, path = Core.configuration.initial_admin_breadcrumb.call(self)
18
- add_breadcrumb label, path
19
- else
20
- add_breadcrumb "Admin", admin_root_path
21
- end
22
- end
23
-
24
- # Legacy method for compatibility
25
- def set_admin_breadcrumb
26
- set_initial_breadcrumb
27
- end
28
- end
29
- end
30
- end