adminizer 4.3.0-build.115 → 4.3.0-build.117
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.
- package/assets/{add-CR18s1fq.js → add-184PjeSO.js} +1 -1
- package/assets/{add-form-BA-MI8Fw.js → add-form-By91jsv1.js} +1 -1
- package/assets/{app-DYA_YmVb.css → app-AZGOzyLJ.css} +1 -1
- package/assets/app.js +5 -5
- package/assets/{catalog-_IS5QK1i.js → catalog-DXyw2KnJ.js} +1 -1
- package/assets/{field-renderer-DBKkDhBG.js → field-renderer-CiCkOwxl.js} +2 -2
- package/assets/{form-CD-aoFGD.js → form--0esJdCP.js} +1 -1
- package/assets/{form-DMAgS9Z2.js → form-CTDP9qtV.js} +1 -1
- package/assets/{home-BbLn2iuZ.js → home-CsjT3Uxk.js} +2 -2
- package/assets/{list-eG7X4aSC.js → list-DhrnZd-J.js} +1 -1
- package/assets/{list-table-Bc_4C3bv.js → list-table-BPpHDVPf.js} +4 -4
- package/assets/manifest.json +20 -20
- package/assets/{media-manager-Dl0AQjLB.js → media-manager-Ek8GGhXT.js} +3 -3
- package/assets/{pagination-render-D9ogYx-T.js → pagination-render-io0M2m2O.js} +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/interfaces/adminpanelConfig.d.ts +2 -0
- package/lib/Adminizer.js +3 -2
- package/lib/catalog/Navigation.d.ts +2 -3
- package/lib/catalog/Navigation.js +1 -1
- package/package.json +1 -1
- package/system/bindNavigation.d.ts +1 -1
- package/system/bindNavigation.js +33 -35
- package/ui/lib/utils.d.ts +1 -0
- package/ui/lib/utils.js +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,
|
|
1
|
+
import{j as r,bI as p,bJ as m,bK as o,bL as a,bM as x,bN as b}from"./app.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";const N=({pagination:s,pageChange:t,currentPage:n})=>{const l=n!==1&&s.last_page>1,i=n!==s.last_page&&s.last_page>1;return r.jsx(p,{children:r.jsxs(m,{className:"flex-wrap",children:[r.jsx(o,{className:`${l?"":"opacity-40 pointer-events-none"}`,children:r.jsx(a,{className:"px-6 cursor-pointer bg-secondary hover:bg-muted-foreground/15",onClick:e=>{e.preventDefault(),t(1)},children:"First"})}),r.jsx(o,{children:r.jsx(x,{className:`cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${s.prev_page_url?"":"opacity-50 pointer-events-none"}`,onClick:e=>{e.preventDefault(),s.prev_page_url&&t(n-1)}})}),s.links.map((e,c)=>e.label==="Previous"||e.label==="Next"?null:r.jsx(o,{children:r.jsx(a,{className:`cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${e.active?"!bg-primary dark:!bg-muted-foreground !text-primary-foreground dark:!text-ring":""}`,onClick:u=>{u.preventDefault();const d=parseInt(e.label);t(d)},isActive:e.active,children:e.label})},c)),r.jsx(o,{children:r.jsx(b,{className:`cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${s.next_page_url?"":"opacity-50 pointer-events-none"}`,onClick:e=>{e.preventDefault(),s.next_page_url&&t(n+1)}})}),r.jsx(o,{className:`${i?"":"opacity-40 pointer-events-none"}`,children:r.jsx(a,{className:"px-6 cursor-pointer bg-secondary hover:bg-muted-foreground/15",onClick:e=>{e.preventDefault(),t(s.last_page)},children:"Last"})})]})})};export{N as default};
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -347,6 +347,7 @@ export interface TuiEditorFieldConfig extends BaseFieldConfig {
|
|
|
347
347
|
export interface MediaManagerOptionsField {
|
|
348
348
|
id: 'default' | string;
|
|
349
349
|
group: string;
|
|
350
|
+
accept: string[];
|
|
350
351
|
config?: Record<string, any>;
|
|
351
352
|
}
|
|
352
353
|
interface RangeType {
|
|
@@ -456,6 +457,7 @@ export interface NavigationConfig {
|
|
|
456
457
|
allowContentInGroup?: boolean;
|
|
457
458
|
items: NavigationItemTypeConfig[];
|
|
458
459
|
movingGroupsRootOnly?: boolean;
|
|
460
|
+
bindAfter: boolean;
|
|
459
461
|
}
|
|
460
462
|
export interface MediaManagerConfig {
|
|
461
463
|
fileStoragePath: string;
|
package/lib/Adminizer.js
CHANGED
|
@@ -8,7 +8,7 @@ import Router from "./../system/Router";
|
|
|
8
8
|
import bindAssets from "../system/bindAssets";
|
|
9
9
|
import bindDev from "../system/bindDev";
|
|
10
10
|
import bindDashboardWidgets from "../system/bindDashboardWidgets";
|
|
11
|
-
import bindNavigation from "../system/bindNavigation";
|
|
11
|
+
import { bindNavigation } from "../system/bindNavigation";
|
|
12
12
|
import bindMediaManager from "../system/bindMediaManager";
|
|
13
13
|
import bindAccessRights from "../system/bindAccessRights";
|
|
14
14
|
import bindAuthorization from "../system/bindAuthorization";
|
|
@@ -208,7 +208,8 @@ export class Adminizer {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
await bindDashboardWidgets(this);
|
|
211
|
-
|
|
211
|
+
if (!this.config.navigation?.bindAfter)
|
|
212
|
+
bindNavigation(this);
|
|
212
213
|
bindMediaManager(this);
|
|
213
214
|
await bindAccessRights(this);
|
|
214
215
|
if (I18n.appendLocale) {
|
|
@@ -7,13 +7,13 @@ export interface NavItem extends Item {
|
|
|
7
7
|
targetBlank?: boolean;
|
|
8
8
|
visible?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare class StorageService {
|
|
10
|
+
export declare class StorageService {
|
|
11
11
|
protected storageMap: Map<string | number, NavItem>;
|
|
12
12
|
protected id: string;
|
|
13
13
|
protected model: string;
|
|
14
14
|
protected readonly adminizer: Adminizer;
|
|
15
15
|
constructor(adminizer: Adminizer, id: string, model: string);
|
|
16
|
-
|
|
16
|
+
initModel(): Promise<void>;
|
|
17
17
|
getId(): string;
|
|
18
18
|
buildTree(): Promise<any>;
|
|
19
19
|
populateFromTree(tree: any[]): Promise<void>;
|
|
@@ -41,4 +41,3 @@ export declare class Navigation extends AbstractCatalog {
|
|
|
41
41
|
constructor(adminizer: Adminizer, config: NavigationConfig);
|
|
42
42
|
getIdList(): Promise<string[]>;
|
|
43
43
|
}
|
|
44
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Adminizer } from "../lib/Adminizer";
|
|
2
|
-
export
|
|
2
|
+
export declare function bindNavigation(adminizer: Adminizer): Promise<void>;
|
package/system/bindNavigation.js
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
import { Navigation } from "../lib/catalog/Navigation";
|
|
2
|
-
export
|
|
3
|
-
adminizer.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
export async function bindNavigation(adminizer) {
|
|
3
|
+
if (adminizer.config.navigation) {
|
|
4
|
+
try {
|
|
5
|
+
adminizer.config.navigation.model = adminizer.config.navigation.model ? adminizer.config.navigation.model : 'NavigationAP';
|
|
6
|
+
let navigation = new Navigation(adminizer, adminizer.config.navigation);
|
|
7
|
+
adminizer.catalogHandler.add(navigation);
|
|
8
|
+
adminizer.config.models[adminizer.config.navigation.model.toLowerCase()] = {
|
|
9
|
+
add: false,
|
|
10
|
+
edit: {
|
|
11
|
+
controller: '../controllers/navigation/edit',
|
|
12
|
+
},
|
|
13
|
+
fields: {
|
|
14
|
+
createdAt: false,
|
|
15
|
+
updatedAt: false
|
|
16
|
+
},
|
|
17
|
+
navbar: {
|
|
18
|
+
visible: false
|
|
19
|
+
},
|
|
20
|
+
icon: 'storage',
|
|
21
|
+
identifierField: "",
|
|
22
|
+
list: {
|
|
14
23
|
fields: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
navbar: {
|
|
19
|
-
visible: false
|
|
24
|
+
tree: false,
|
|
25
|
+
id: false,
|
|
20
26
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
remove: false,
|
|
31
|
-
title: adminizer.config.navigation.model,
|
|
32
|
-
tools: []
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
console.log('bindNavigation Error: ', e);
|
|
37
|
-
}
|
|
27
|
+
},
|
|
28
|
+
model: adminizer.config.navigation.model.toLowerCase(),
|
|
29
|
+
remove: false,
|
|
30
|
+
title: adminizer.config.navigation.model,
|
|
31
|
+
tools: []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
console.log('bindNavigation Error: ', e);
|
|
38
36
|
}
|
|
39
|
-
}
|
|
37
|
+
}
|
|
40
38
|
}
|
package/ui/lib/utils.d.ts
CHANGED
package/ui/lib/utils.js
CHANGED
|
@@ -3,3 +3,19 @@ import { twMerge } from "tailwind-merge";
|
|
|
3
3
|
export function cn(...inputs) {
|
|
4
4
|
return twMerge(clsx(inputs));
|
|
5
5
|
}
|
|
6
|
+
export function simpleSanitizeHtml(html) {
|
|
7
|
+
return html
|
|
8
|
+
// Удаляем script теги
|
|
9
|
+
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
|
|
10
|
+
// Удаляем iframe, embed, object
|
|
11
|
+
.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, '')
|
|
12
|
+
.replace(/<embed\b[^<]*(?:(?!<\/embed>)<[^<]*)*<\/embed>/gi, '')
|
|
13
|
+
.replace(/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi, '')
|
|
14
|
+
// Удаляем опасные атрибуты событий
|
|
15
|
+
.replace(/ on\w+="[^"]*"/g, '')
|
|
16
|
+
.replace(/ on\w+='[^']*'/g, '')
|
|
17
|
+
.replace(/ on\w+=[^ >]+/g, '')
|
|
18
|
+
// Удаляем javascript: ссылки
|
|
19
|
+
.replace(/href="javascript:[^"]*"/gi, 'href="#"')
|
|
20
|
+
.replace(/href='javascript:[^']*'/gi, 'href="#"');
|
|
21
|
+
}
|