@webiny/app-admin 0.0.0-unstable.df7a8bb475 → 0.0.0-unstable.e2758ee1cf
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/base/Admin.js +3 -1
- package/base/Admin.js.map +1 -1
- package/base/Base/LexicalPreset.js +4 -5
- package/base/Base/LexicalPreset.js.map +1 -1
- package/base/Base/Menus.js +28 -18
- package/base/Base/Menus.js.map +1 -1
- package/base/Base.js +1 -2
- package/base/Base.js.map +1 -1
- package/components/DeveloperMode/DeveloperMode.d.ts +11 -0
- package/components/DeveloperMode/DeveloperMode.js +17 -0
- package/components/DeveloperMode/DeveloperMode.js.map +1 -0
- package/components/DeveloperMode/index.d.ts +2 -0
- package/components/DeveloperMode/index.js +3 -0
- package/components/DeveloperMode/index.js.map +1 -0
- package/components/LexicalEditor/LexicalLinkForm.d.ts +6 -0
- package/components/LexicalEditor/LexicalLinkForm.js +92 -0
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -0
- package/components/LexicalEditor/index.d.ts +1 -0
- package/components/LexicalEditor/index.js +1 -0
- package/components/LexicalEditor/index.js.map +1 -1
- package/components/Permissions/Permissions.d.ts +1 -3
- package/components/Permissions/Permissions.js +37 -31
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +1 -1
- package/components/Wcp.d.ts +2 -0
- package/components/Wcp.js +8 -1
- package/components/Wcp.js.map +1 -1
- package/components/index.d.ts +4 -1
- package/components/index.js +3 -1
- package/components/index.js.map +1 -1
- package/config/AdminConfig/Security.d.ts +3 -0
- package/config/AdminConfig/Security.js +6 -0
- package/config/AdminConfig/Security.js.map +1 -0
- package/config/AdminConfig/SecurityPermissions.d.ts +17 -0
- package/config/AdminConfig/SecurityPermissions.js +31 -0
- package/config/AdminConfig/SecurityPermissions.js.map +1 -0
- package/config/AdminConfig.d.ts +8 -1
- package/config/AdminConfig.js +8 -3
- package/config/AdminConfig.js.map +1 -1
- package/domain/Identity.js +1 -1
- package/domain/Identity.js.map +1 -1
- package/exports/admin/{buildParams.js → build-params.js} +1 -1
- package/exports/admin/build-params.js.map +1 -0
- package/exports/admin/form.d.ts +11 -0
- package/exports/admin/form.js +12 -0
- package/exports/admin/form.js.map +1 -0
- package/exports/admin/ui.d.ts +1 -0
- package/exports/admin/ui.js +1 -0
- package/exports/admin/ui.js.map +1 -1
- package/exports/admin.d.ts +4 -0
- package/exports/admin.js +4 -0
- package/exports/admin.js.map +1 -1
- package/features/wcp/ReactLicense.d.ts +1 -0
- package/features/wcp/ReactLicense.js +3 -0
- package/features/wcp/ReactLicense.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +26 -29
- package/permissions/PermissionRenderer.d.ts +6 -0
- package/permissions/PermissionRenderer.js +219 -0
- package/permissions/PermissionRenderer.js.map +1 -0
- package/permissions/PermissionValueContext.d.ts +11 -0
- package/permissions/PermissionValueContext.js +23 -0
- package/permissions/PermissionValueContext.js.map +1 -0
- package/permissions/createHasPermission.d.ts +3 -0
- package/permissions/createHasPermission.js +36 -0
- package/permissions/createHasPermission.js.map +1 -0
- package/permissions/createPermissionSchema.d.ts +2 -0
- package/permissions/createPermissionSchema.js +8 -0
- package/permissions/createPermissionSchema.js.map +1 -0
- package/permissions/index.d.ts +8 -0
- package/permissions/index.js +8 -0
- package/permissions/index.js.map +1 -0
- package/permissions/types.d.ts +242 -0
- package/permissions/types.js +3 -0
- package/permissions/types.js.map +1 -0
- package/permissions/usePermissionForm.d.ts +17 -0
- package/permissions/usePermissionForm.js +256 -0
- package/permissions/usePermissionForm.js.map +1 -0
- package/permissions/usePermissions.d.ts +3 -0
- package/permissions/usePermissions.js +180 -0
- package/permissions/usePermissions.js.map +1 -0
- package/types.d.ts +0 -7
- package/types.js.map +1 -1
- package/base/Base/LexicalPreset/LinkEditForm.d.ts +0 -6
- package/base/Base/LexicalPreset/LinkEditForm.js +0 -63
- package/base/Base/LexicalPreset/LinkEditForm.js.map +0 -1
- package/exports/admin/buildParams.js.map +0 -1
- package/extensions/AdminBuildParam.d.ts +0 -11
- package/extensions/AdminBuildParam.js +0 -184
- package/extensions/AdminBuildParam.js.map +0 -1
- package/extensions/AdminExtension.d.ts +0 -11
- package/extensions/AdminExtension.js +0 -105
- package/extensions/AdminExtension.js.map +0 -1
- package/extensions/index.d.ts +0 -23
- package/extensions/index.js +0 -7
- package/extensions/index.js.map +0 -1
- package/plugins/PermissionRendererPlugin.d.ts +0 -22
- package/plugins/PermissionRendererPlugin.js +0 -19
- package/plugins/PermissionRendererPlugin.js.map +0 -1
- /package/exports/admin/{buildParams.d.ts → build-params.d.ts} +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { defineExtension, zodSrcPath } from "@webiny/project/extensions/index.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { Node, Project } from "ts-morph";
|
|
5
|
-
import crypto from "crypto";
|
|
6
|
-
export const AdminExtension = defineExtension({
|
|
7
|
-
type: "Admin/Extension",
|
|
8
|
-
tags: {
|
|
9
|
-
runtimeContext: "app-build",
|
|
10
|
-
appName: "admin"
|
|
11
|
-
},
|
|
12
|
-
description: "Extend the Admin application with custom functionality.",
|
|
13
|
-
multiple: true,
|
|
14
|
-
paramsSchema: ({
|
|
15
|
-
project
|
|
16
|
-
}) => {
|
|
17
|
-
return z.object({
|
|
18
|
-
src: zodSrcPath({
|
|
19
|
-
project
|
|
20
|
-
}),
|
|
21
|
-
exportName: z.string().optional()
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
async build(params, ctx) {
|
|
25
|
-
const extensionsTsxFilePath = ctx.project.paths.workspaceFolder.join("apps", "admin", "src", "Extensions.tsx").toString();
|
|
26
|
-
const {
|
|
27
|
-
src: extensionFilePath
|
|
28
|
-
} = params;
|
|
29
|
-
|
|
30
|
-
// Resolve to absolute path for file operations.
|
|
31
|
-
let absoluteExtensionFilePath;
|
|
32
|
-
if (extensionFilePath.startsWith("/extensions/")) {
|
|
33
|
-
// Resolve from project root.
|
|
34
|
-
absoluteExtensionFilePath = ctx.project.paths.rootFolder.join(extensionFilePath).toString();
|
|
35
|
-
} else {
|
|
36
|
-
// Treat as absolute path.
|
|
37
|
-
absoluteExtensionFilePath = extensionFilePath;
|
|
38
|
-
}
|
|
39
|
-
const extensionFileName = path.basename(absoluteExtensionFilePath);
|
|
40
|
-
|
|
41
|
-
// Export name can be customized or defaults to the file name without extension.
|
|
42
|
-
const exportName = params.exportName ?? path.parse(extensionFileName).name;
|
|
43
|
-
|
|
44
|
-
// Generate a constant hash-based component name to avoid using timestamps.
|
|
45
|
-
const hash = crypto.createHash("sha256").update(extensionFilePath).digest("hex");
|
|
46
|
-
const componentName = `AdminExtension_${hash.slice(-10)}`;
|
|
47
|
-
const project = new Project();
|
|
48
|
-
const importPath = path.relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
|
|
49
|
-
project.addSourceFileAtPath(extensionsTsxFilePath);
|
|
50
|
-
const source = project.getSourceFileOrThrow(extensionsTsxFilePath);
|
|
51
|
-
const existingImportDeclaration = source.getImportDeclaration(importPath);
|
|
52
|
-
if (existingImportDeclaration) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Check if the extension file has a default export or named export
|
|
57
|
-
const extensionProject = new Project();
|
|
58
|
-
extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
|
|
59
|
-
const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
|
|
60
|
-
const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;
|
|
61
|
-
let index = 1;
|
|
62
|
-
const importDeclarations = source.getImportDeclarations();
|
|
63
|
-
if (importDeclarations.length) {
|
|
64
|
-
const last = importDeclarations[importDeclarations.length - 1];
|
|
65
|
-
index = last.getChildIndex() + 1;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Import as default export if available, otherwise import named export
|
|
69
|
-
if (hasDefaultExport) {
|
|
70
|
-
source.insertImportDeclaration(index, {
|
|
71
|
-
defaultImport: componentName,
|
|
72
|
-
moduleSpecifier: importPath
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
source.insertImportDeclaration(index, {
|
|
76
|
-
namedImports: [{
|
|
77
|
-
name: exportName,
|
|
78
|
-
alias: componentName
|
|
79
|
-
}],
|
|
80
|
-
moduleSpecifier: importPath
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
const extensionsIdentifier = source.getFirstDescendant(node => {
|
|
84
|
-
if (!Node.isIdentifier(node)) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
return node.getText() === "Extensions";
|
|
88
|
-
});
|
|
89
|
-
if (!extensionsIdentifier) {
|
|
90
|
-
throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change the name of the component?`);
|
|
91
|
-
}
|
|
92
|
-
const extensionsArrowFn = extensionsIdentifier.getNextSibling(node => Node.isArrowFunction(node));
|
|
93
|
-
if (!extensionsArrowFn) {
|
|
94
|
-
throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change its definition? It should be an arrow function.`);
|
|
95
|
-
}
|
|
96
|
-
const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {
|
|
97
|
-
return Node.isJsxFragment(node);
|
|
98
|
-
});
|
|
99
|
-
const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment.getFullText().replace("<>", "").replace("</>", "").trim();
|
|
100
|
-
extensionsArrowFnFragment.replaceWithText(`<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`);
|
|
101
|
-
await source.save();
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=AdminExtension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineExtension","zodSrcPath","z","path","Node","Project","crypto","AdminExtension","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","src","exportName","string","optional","build","params","ctx","extensionsTsxFilePath","paths","workspaceFolder","join","toString","extensionFilePath","absoluteExtensionFilePath","startsWith","rootFolder","extensionFileName","basename","parse","name","hash","createHash","update","digest","componentName","slice","importPath","relative","dirname","replace","addSourceFileAtPath","source","getSourceFileOrThrow","existingImportDeclaration","getImportDeclaration","extensionProject","extensionSource","hasDefaultExport","getDefaultExportSymbol","undefined","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","namedImports","alias","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","extensionsArrowFnFragmentChildrenText","getFullText","trim","replaceWithText","save"],"sources":["AdminExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"@webiny/project/extensions/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { type JsxFragment, Node, Project } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const AdminExtension = defineExtension({\n type: \"Admin/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Extend the Admin application with custom functionality.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n let absoluteExtensionFilePath: string;\n if (extensionFilePath.startsWith(\"/extensions/\")) {\n // Resolve from project root.\n absoluteExtensionFilePath = ctx.project.paths.rootFolder\n .join(extensionFilePath)\n .toString();\n } else {\n // Treat as absolute path.\n absoluteExtensionFilePath = extensionFilePath;\n }\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name can be customized or defaults to the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Generate a constant hash-based component name to avoid using timestamps.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const componentName = `AdminExtension_${hash.slice(-10)}`;\n\n const project = new Project();\n\n const importPath = path\n .relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n // Check if the extension file has a default export or named export\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Import as default export if available, otherwise import named export\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: componentName,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: componentName }],\n moduleSpecifier: importPath\n });\n }\n\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change the name of the component?`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n if (!extensionsArrowFn) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change its definition? It should be an arrow function.`\n );\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n }) as JsxFragment;\n\n const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n extensionsArrowFnFragment.replaceWithText(\n `<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`\n );\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,QAAQ,qCAAqC;AACjF,SAASC,CAAC,QAAQ,KAAK;AACvB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAA2BC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AAC1D,OAAOC,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,cAAc,GAAGP,eAAe,CAAC;EAC1CQ,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAQ,CAAC;EACvDC,WAAW,EAAE,yDAAyD;EACtEC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC3B,OAAOb,CAAC,CAACc,MAAM,CAAC;MACZC,GAAG,EAAEhB,UAAU,CAAC;QAAEc;MAAQ,CAAC,CAAC;MAC5BG,UAAU,EAAEhB,CAAC,CAACiB,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;IACpC,CAAC,CAAC;EACN,CAAC;EACD,MAAMC,KAAKA,CAACC,MAAM,EAAEC,GAAG,EAAE;IACrB,MAAMC,qBAAqB,GAAGD,GAAG,CAACR,OAAO,CAACU,KAAK,CAACC,eAAe,CAC1DC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAC9CC,QAAQ,CAAC,CAAC;IAEf,MAAM;MAAEX,GAAG,EAAEY;IAAkB,CAAC,GAAGP,MAAM;;IAEzC;IACA,IAAIQ,yBAAiC;IACrC,IA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AAiB,EAAE;MACpB,MAAM,IAAID,KAAK,CACX,uDAAuDjD,qBAAqB,yEAChF,CAAC;IACL;IAEA,MAAMqD,yBAAyB,GAAGH,iBAAiB,CAACL,kBAAkB,CAACC,IAAI,IAAI;MAC3E,OAAOlE,IAAI,CAAC0E,aAAa,CAACR,IAAI,CAAC;IACnC,CAAC,CAAgB;IAEjB,MAAMS,qCAAqC,GAAGF,yBAAyB,CAClEG,WAAW,CAAC,CAAC,CACblC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CACjBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAClBmC,IAAI,CAAC,CAAC;IAEXJ,yBAAyB,CAACK,eAAe,CACrC,MAAMzC,aAAa,KAAKsC,qCAAqC,KACjE,CAAC;IAED,MAAM/B,MAAM,CAACmC,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/extensions/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AdminExtension } from "./AdminExtension.js";
|
|
2
|
-
import { AdminBuildParam } from "./AdminBuildParam.js";
|
|
3
|
-
export { AdminExtension };
|
|
4
|
-
export { AdminBuildParam };
|
|
5
|
-
export declare const definitions: (import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
6
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
7
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
9
|
-
src: string;
|
|
10
|
-
exportName?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
src: string;
|
|
13
|
-
exportName?: string | undefined;
|
|
14
|
-
}>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
15
|
-
paramName: import("zod").ZodString;
|
|
16
|
-
value: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodArray<import("zod").ZodAny, "many">, import("zod").ZodNumber, import("zod").ZodBoolean]>;
|
|
17
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
18
|
-
value: string | number | boolean | any[] | Record<string, any>;
|
|
19
|
-
paramName: string;
|
|
20
|
-
}, {
|
|
21
|
-
value: string | number | boolean | any[] | Record<string, any>;
|
|
22
|
-
paramName: string;
|
|
23
|
-
}>>)[];
|
package/extensions/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AdminExtension } from "./AdminExtension.js";
|
|
2
|
-
import { AdminBuildParam } from "./AdminBuildParam.js";
|
|
3
|
-
export { AdminExtension };
|
|
4
|
-
export { AdminBuildParam };
|
|
5
|
-
export const definitions = [AdminExtension.def, AdminBuildParam.def];
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/extensions/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AdminExtension","AdminBuildParam","definitions","def"],"sources":["index.ts"],"sourcesContent":["import { AdminExtension } from \"./AdminExtension.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\n\nexport { AdminExtension };\nexport { AdminBuildParam };\n\nexport const definitions = [AdminExtension.def, AdminBuildParam.def];\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SAASC,eAAe;AAExB,SAASD,cAAc;AACvB,SAASC,eAAe;AAExB,OAAO,MAAMC,WAAW,GAAG,CAACF,cAAc,CAACG,GAAG,EAAEF,eAAe,CAACE,GAAG,CAAC","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
interface Permission {
|
|
4
|
-
name: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
interface RenderParams {
|
|
8
|
-
value: Permission[];
|
|
9
|
-
onChange: (value: Permission[]) => void;
|
|
10
|
-
}
|
|
11
|
-
interface Config {
|
|
12
|
-
render(props: RenderParams): React.ReactElement;
|
|
13
|
-
system?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare class PermissionRendererPlugin extends Plugin {
|
|
16
|
-
static readonly type: string;
|
|
17
|
-
private readonly _config;
|
|
18
|
-
constructor(config?: Config);
|
|
19
|
-
get system(): boolean;
|
|
20
|
-
render(props: RenderParams): React.ReactElement | null;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
export class PermissionRendererPlugin extends Plugin {
|
|
3
|
-
static type = "admin-app-permissions-renderer";
|
|
4
|
-
constructor(config) {
|
|
5
|
-
super();
|
|
6
|
-
this._config = config || {};
|
|
7
|
-
}
|
|
8
|
-
get system() {
|
|
9
|
-
return Boolean(this._config.system);
|
|
10
|
-
}
|
|
11
|
-
render(props) {
|
|
12
|
-
if (!this._config.render) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return this._config.render(props);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=PermissionRendererPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","PermissionRendererPlugin","type","constructor","config","_config","system","Boolean","render","props"],"sources":["PermissionRendererPlugin.ts"],"sourcesContent":["import type React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\ninterface Permission {\n name: string;\n [key: string]: any;\n}\n\ninterface RenderParams {\n value: Permission[];\n onChange: (value: Permission[]) => void;\n}\n\ninterface Config {\n render(props: RenderParams): React.ReactElement;\n system?: boolean;\n}\n\nexport class PermissionRendererPlugin extends Plugin {\n public static override readonly type: string = \"admin-app-permissions-renderer\";\n private readonly _config: Partial<Config>;\n\n public constructor(config?: Config) {\n super();\n this._config = config || {};\n }\n\n get system(): boolean {\n return Boolean(this._config.system);\n }\n\n public render(props: RenderParams): React.ReactElement | null {\n if (!this._config.render) {\n return null;\n }\n return this._config.render(props);\n }\n}\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,iBAAiB;AAiBxC,OAAO,MAAMC,wBAAwB,SAASD,MAAM,CAAC;EACjD,OAAgCE,IAAI,GAAW,gCAAgC;EAGxEC,WAAWA,CAACC,MAAe,EAAE;IAChC,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,MAAM,IAAI,CAAC,CAAC;EAC/B;EAEA,IAAIE,MAAMA,CAAA,EAAY;IAClB,OAAOC,OAAO,CAAC,IAAI,CAACF,OAAO,CAACC,MAAM,CAAC;EACvC;EAEOE,MAAMA,CAACC,KAAmB,EAA6B;IAC1D,IAAI,CAAC,IAAI,CAACJ,OAAO,CAACG,MAAM,EAAE;MACtB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACH,OAAO,CAACG,MAAM,CAACC,KAAK,CAAC;EACrC;AACJ","ignoreList":[]}
|
|
File without changes
|