adminizer 4.1.0-build.35 → 4.1.0-build.37

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 (32) hide show
  1. package/Readme.md +1 -1
  2. package/assets/{add-VGaP5zEb.js → add-BOMae0jC.js} +1 -1
  3. package/assets/{add-group-CU2zD7To.js → add-group-BHyaFPsj.js} +1 -1
  4. package/assets/{add-user-BkTa9shp.js → add-user-DjT6o3z9.js} +1 -1
  5. package/assets/{app-DVDnphrb.css → app-BrkasjFX.css} +1 -1
  6. package/assets/{app-layout-NY6MXzc5.js → app-layout-BC2Dk0GE.js} +1 -1
  7. package/assets/{app-shell-BjaxjNs9.js → app-shell-jCQ5EbpR.js} +1 -1
  8. package/assets/{app-sidebar-header-5IaQpngt.js → app-sidebar-header-BcGzUtnn.js} +1 -1
  9. package/assets/{app-sidebar-CLu13Pcu.js → app-sidebar-wFqi5-7E.js} +1 -1
  10. package/assets/app.js +2 -2
  11. package/assets/{catalog-C88wv-rq.js → catalog-DGH9s-S8.js} +1 -1
  12. package/assets/{dashboard-DKUwxgt4.js → dashboard-DFn55U5H.js} +1 -1
  13. package/assets/field-renderer-zGC76llY.js +1 -1
  14. package/assets/{form-BMth9K43.js → form-B9sI77wk.js} +1 -1
  15. package/assets/{home-lYdYhEcS.js → home-BmydIqzz.js} +2 -2
  16. package/assets/{list-B-EsqncQ.js → list-Dy_nWfcN.js} +1 -1
  17. package/assets/manifest.json +58 -58
  18. package/assets/{module-CsWq478Z.js → module-UO5sAKpW.js} +1 -1
  19. package/assets/{nav-footer-Vm24wf5X.js → nav-footer-_TcxXo9x.js} +1 -1
  20. package/assets/nav-main-DPeRWb5e.js +1 -0
  21. package/assets/{nav-user-DgYX0wO7.js → nav-user-G2BeH6Uu.js} +1 -1
  22. package/assets/{sidebar-DGp3i7GG.js → sidebar-CkxHTDia.js} +1 -1
  23. package/assets/{welcome-C9BMKsoY.js → welcome-Dh8vAafD.js} +1 -1
  24. package/helpers/menuHelper.d.ts +4 -0
  25. package/helpers/menuHelper.js +4 -2
  26. package/interfaces/adminpanelConfig.d.ts +8 -0
  27. package/lib/Adminizer.d.ts +1 -1
  28. package/lib/Adminizer.js +5 -6
  29. package/package.json +1 -1
  30. package/system/bindInertia.js +6 -2
  31. package/system/defaults.js +8 -2
  32. package/assets/nav-main-JVt9gzn8.js +0 -1
@@ -8,7 +8,7 @@ import { WidgetHandler } from "./v4/widgets/widgetHandler";
8
8
  import { AccessRightsHelper } from "../helpers/accessRightsHelper";
9
9
  import { ConfigHelper } from "../helpers/configHelper";
10
10
  import { AbstractAdapter } from "./v4/model/AbstractModel";
11
- import { ViteDevServer } from 'vite';
11
+ import type { ViteDevServer } from 'vite';
12
12
  import { MenuHelper } from "../helpers/menuHelper";
13
13
  import { ControlsHandler } from "./v4/controls/ControlsHandler";
14
14
  export declare class Adminizer {
package/lib/Adminizer.js CHANGED
@@ -3,7 +3,6 @@ import cookieParser from 'cookie-parser';
3
3
  import * as path from "path";
4
4
  import winston from "winston";
5
5
  import EventEmitter from 'events';
6
- import chalk from 'chalk';
7
6
  import PolicyManager from "./v4/PolicyManager";
8
7
  import Router from "./../system/Router";
9
8
  import bindAssets from "../system/bindAssets";
@@ -24,7 +23,6 @@ import { ConfigHelper } from "../helpers/configHelper";
24
23
  import { I18n } from "./v4/I18n";
25
24
  import { getDefaultConfig } from "../system/defaults";
26
25
  import bindExpressUtils from "../system/bindExpressUtils";
27
- import { createServer as createViteServer } from 'vite';
28
26
  import { bindInertia } from "../system/bindInertia";
29
27
  import { MenuHelper } from "../helpers/menuHelper";
30
28
  import { bindControls } from "../system/bindControls";
@@ -88,13 +86,14 @@ export class Adminizer {
88
86
  * @protected
89
87
  */
90
88
  async viteMiddleware() {
91
- // Create a Vite server in middleware mode
89
+ const { createServer: createViteServer } = await import('vite');
90
+ const chalk = (await import('chalk')).default;
92
91
  this.vite = await createViteServer({
93
- server: { middlewareMode: true }, // Enable middleware mode
94
- appType: 'custom', // Specify the application type
92
+ server: { middlewareMode: true },
93
+ appType: 'custom',
95
94
  });
96
- // Use Vite Middleware
97
95
  this.app.use(this.vite.middlewares);
96
+ // eslint-disable-next-line no-console
98
97
  console.log(chalk.green.bold('Vite is running in development mode!') +
99
98
  chalk.blue('\nAccess your app at http://localhost:3000'));
100
99
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.1.0-build.35",
4
+ "version": "4.1.0-build.37",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "vitest --reporter verbose",
@@ -113,7 +113,7 @@ export function bindInertia(adminizer) {
113
113
  title: menuHelper.getBrandTitle(),
114
114
  brand: menuHelper.getBrandTitle(),
115
115
  logout: menuHelper.getLogoutUrl(),
116
- logoutBtn: req.user?.locale == 'ru' ? 'Выход' : "Log out",
116
+ logoutBtn: req.i18n.__("Log out"),
117
117
  section: req.user ? [
118
118
  {
119
119
  title: req.i18n.__("Adminpanel"),
@@ -121,7 +121,11 @@ export function bindInertia(adminizer) {
121
121
  link: req.adminizer.config.routePrefix,
122
122
  icon: "rocket_launch",
123
123
  },
124
- ...(req.adminizer.configHelper.getConfig().sections)
124
+ ...((req.adminizer.configHelper.getConfig().sections || [])
125
+ .map((sec) => ({
126
+ ...sec,
127
+ title: req.i18n.__(sec.title),
128
+ })))
125
129
  ] : null,
126
130
  showVersion: req.adminizer.config.showVersion ?? false
127
131
  });
@@ -30,9 +30,12 @@ let adminpanelConfig = {
30
30
  */
31
31
  models: {
32
32
  UserAP: {
33
- title: "Users AP",
33
+ title: "Users",
34
34
  model: "userap",
35
35
  icon: "people",
36
+ navbar: {
37
+ section: "System"
38
+ },
36
39
  add: {
37
40
  controller: "../controllers/addUser"
38
41
  },
@@ -72,9 +75,12 @@ let adminpanelConfig = {
72
75
  }
73
76
  },
74
77
  GroupAP: {
75
- title: "Groups AP",
78
+ title: "Groups",
76
79
  model: "groupap",
77
80
  icon: "group_add",
81
+ navbar: {
82
+ section: "System"
83
+ },
78
84
  add: {
79
85
  controller: "../controllers/addGroup"
80
86
  },
@@ -1 +0,0 @@
1
- import{r as i,j as t,q as L,J as M}from"./app.js";import{c as v}from"./compiler-runtime-Cj7rbuyn.js";import{f as w,h as E,c as D,i as B,j as G,n as z,k as F,e as I}from"./sidebar-DGp3i7GG.js";import C from"./material-icon-BAd3Wrgn.js";import{j as q,i as J,c as Q}from"./index-BCpOvf4m.js";import{c as U,a as H}from"./index-Cq31rrfZ.js";import{u as W}from"./index-DU8vYhyh.js";import{P as y}from"./index-DN1K56yz.js";import{P as K}from"./index-lqMxC6QB.js";import{C as V}from"./chevron-right-D5q8rF7h.js";var N="Collapsible",[X,me]=U(N),[Y,R]=X(N),A=i.forwardRef((o,e)=>{const{__scopeCollapsible:n,open:s,defaultOpen:r,disabled:c,onOpenChange:p,...h}=o,[d,u]=q({prop:s,defaultProp:r??!1,onChange:p,caller:N});return t.jsx(Y,{scope:n,disabled:c,contentId:J(),open:d,onOpenToggle:i.useCallback(()=>u(f=>!f),[u]),children:t.jsx(y.div,{"data-state":_(d),"data-disabled":c?"":void 0,...h,ref:e})})});A.displayName=N;var O="CollapsibleTrigger",$=i.forwardRef((o,e)=>{const{__scopeCollapsible:n,...s}=o,r=R(O,n);return t.jsx(y.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":_(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...s,ref:e,onClick:Q(o.onClick,r.onOpenToggle)})});$.displayName=O;var S="CollapsibleContent",T=i.forwardRef((o,e)=>{const{forceMount:n,...s}=o,r=R(S,o.__scopeCollapsible);return t.jsx(K,{present:n||r.open,children:({present:c})=>t.jsx(Z,{...s,ref:e,present:c})})});T.displayName=S;var Z=i.forwardRef((o,e)=>{const{__scopeCollapsible:n,present:s,children:r,...c}=o,p=R(S,n),[h,d]=i.useState(s),u=i.useRef(null),f=W(e,u),j=i.useRef(0),a=j.current,m=i.useRef(0),b=m.current,l=p.open||h,P=i.useRef(l),g=i.useRef(void 0);return i.useEffect(()=>{const x=requestAnimationFrame(()=>P.current=!1);return()=>cancelAnimationFrame(x)},[]),H(()=>{const x=u.current;if(x){g.current=g.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const k=x.getBoundingClientRect();j.current=k.height,m.current=k.width,P.current||(x.style.transitionDuration=g.current.transitionDuration,x.style.animationName=g.current.animationName),d(s)}},[p.open,s]),t.jsx(y.div,{"data-state":_(p.open),"data-disabled":p.disabled?"":void 0,id:p.contentId,hidden:!l,...c,ref:f,style:{"--radix-collapsible-content-height":a?`${a}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...o.style},children:l&&r})});function _(o){return o?"open":"closed"}var ee=A;function te(o){const e=v.c(4);let n;e[0]!==o?({...n}=o,e[0]=o,e[1]=n):n=e[1];let s;return e[2]!==n?(s=t.jsx(ee,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=s):s=e[3],s}function ne(o){const e=v.c(4);let n;e[0]!==o?({...n}=o,e[0]=o,e[1]=n):n=e[1];let s;return e[2]!==n?(s=t.jsx($,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function se(o){const e=v.c(4);let n;e[0]!==o?({...n}=o,e[0]=o,e[1]=n):n=e[1];let s;return e[2]!==n?(s=t.jsx(T,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=s):s=e[3],s}function oe(o){const e=v.c(10),{items:n}=o;let s;e[0]!==n?(s=n===void 0?[]:n,e[0]=n,e[1]=s):s=e[1];const r=s,c=L(),p=ae;let h;e[2]!==c?(h=a=>{const m=p(c.url),b=p(a);return m===b||m.startsWith(`${b}/`)},e[2]=c,e[3]=h):h=e[3];const d=h;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(z,{children:"Platform"}),e[4]=u):u=e[4];let f;e[5]!==d||e[6]!==r?(f=r&&r.map(a=>{var m,b;return((m=a.actions)==null?void 0:m.length)>0?t.jsx(te,{asChild:!0,defaultOpen:d(a.link),className:"group/collapsible",children:t.jsxs(w,{children:[t.jsx(ne,{asChild:!0,children:t.jsxs(E,{tooltip:a.title,children:[t.jsx(C,{name:a.icon,className:"!text-[18px]"}),t.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a.title}),t.jsx(V,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),t.jsx(se,{children:t.jsx(D,{children:(b=a.actions)==null?void 0:b.map(l=>t.jsx(B,{children:t.jsx(G,{asChild:!0,isActive:d(l.link),children:l.type==="blank"?t.jsxs("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",children:[l.icon&&t.jsx(C,{name:l.icon,className:"!text-[18px]"}),t.jsx("span",{children:l.title})]}):t.jsxs(M,{href:l.link,children:[l.icon&&t.jsx(C,{name:l.icon,className:"!text-[18px]"}),t.jsx("span",{children:l.title})]})})},l.id))})})]})},a.title):t.jsx(w,{children:t.jsx(E,{asChild:!0,isActive:d(a.link),tooltip:{children:a.title},children:a.type==="blank"?t.jsxs("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:[a.icon&&t.jsx(C,{name:a.icon,className:"!text-[18px]"}),t.jsx("span",{children:a.title})]}):t.jsxs(M,{href:a.link,children:[a.icon&&t.jsx(C,{name:a.icon,className:"!text-[18px]"}),t.jsx("span",{children:a.title})]})})},a.title)}),e[5]=d,e[6]=r,e[7]=f):f=e[7];let j;return e[8]!==f?(j=t.jsxs(F,{className:"px-2 py-0",children:[u,t.jsx(I,{children:f})]}),e[8]=f,e[9]=j):j=e[9],j}function ae(o){return o.split("?")[0].replace(/\/$/,"")}const be=Object.freeze(Object.defineProperty({__proto__:null,NavMain:oe},Symbol.toStringTag,{value:"Module"}));export{T as C,oe as N,A as a,ne as b,be as n};