@webiny/app-file-manager 6.4.5 → 6.6.0-alpha.0
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/app.js +13 -2
- package/app.js.map +1 -1
- package/domain/tagsHelpers.d.ts +2 -2
- package/domain/types.d.ts +0 -8
- package/features/permissions/abstractions.d.ts +2 -2
- package/features/permissions/feature.d.ts +3 -3
- package/modules/AiEnrichment/AiImageEnrichmentEventHandler.d.ts +18 -0
- package/modules/AiEnrichment/AiImageEnrichmentEventHandler.js +33 -0
- package/modules/AiEnrichment/AiImageEnrichmentEventHandler.js.map +1 -0
- package/modules/AiEnrichment/feature.d.ts +1 -0
- package/modules/AiEnrichment/feature.js +11 -0
- package/modules/AiEnrichment/feature.js.map +1 -0
- package/modules/AiEnrichment/index.d.ts +2 -0
- package/modules/AiEnrichment/index.js +9 -0
- package/modules/AiEnrichment/index.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.d.ts +16 -0
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.js +33 -0
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.d.ts +24 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.js +37 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileInputRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/FileInputRenderer.js +19 -0
- package/modules/HeadlessCms/fieldType/FileInputRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileInputsRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/FileInputsRenderer.js +19 -0
- package/modules/HeadlessCms/fieldType/FileInputsRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/feature.d.ts +1 -0
- package/modules/HeadlessCms/fieldType/feature.js +17 -0
- package/modules/HeadlessCms/fieldType/feature.js.map +1 -0
- package/package.json +19 -29
- package/presentation/FileDetails/FileDetailsPresenter.test.js +1 -0
- package/presentation/FileDetails/FileDetailsPresenter.test.js.map +1 -1
- package/presentation/FileDetails/components/Content.d.ts +5 -4
- package/presentation/FileList/FileListDataSource.d.ts +8 -12
- package/presentation/FileList/FileListDataSource.js +15 -88
- package/presentation/FileList/FileListDataSource.js.map +1 -1
- package/presentation/FileList/FileListPresenter.test.js +7 -2
- package/presentation/FileList/FileListPresenter.test.js.map +1 -1
- package/presentation/FileList/FileManagerPresenter.d.ts +1 -0
- package/presentation/FileList/FileManagerPresenter.js +9 -1
- package/presentation/FileList/FileManagerPresenter.js.map +1 -1
- package/presentation/FileList/abstractions.d.ts +2 -0
- package/presentation/FileList/abstractions.js.map +1 -1
- package/presentation/FileList/components/BulkActions/index.d.ts +0 -1
- package/presentation/FileList/components/BulkActions/index.js +0 -1
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.d.ts +9 -8
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.js +3 -9
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.js.map +1 -1
- package/presentation/FileList/components/Grid/FileGrid.js +1 -1
- package/presentation/FileList/components/Grid/FileGrid.js.map +1 -1
- package/presentation/FileList/components/Grid/FileGrid.test.js +18 -7
- package/presentation/FileList/components/Grid/FileGrid.test.js.map +1 -1
- package/presentation/FileList/components/Table/FileTable.js +1 -1
- package/presentation/FileList/components/Table/FileTable.js.map +1 -1
- package/presentation/FileList/components/Table/FileTable.test.js +9 -4
- package/presentation/FileList/components/Table/FileTable.test.js.map +1 -1
- package/presentation/FileManager/FileManagerView.js +8 -6
- package/presentation/FileManager/FileManagerView.js.map +1 -1
- package/presentation/FileManager/RouteParamsSync.d.ts +2 -0
- package/presentation/FileManager/RouteParamsSync.js +30 -0
- package/presentation/FileManager/RouteParamsSync.js.map +1 -0
- package/presentation/config/DefaultFileManagerConfig.js +1 -4
- package/presentation/config/DefaultFileManagerConfig.js.map +1 -1
- package/presentation/config/FileManagerViewConfig.d.ts +19 -25
- package/presentation/config/configComponents/Browser/BulkAction.d.ts +10 -8
- package/presentation/config/configComponents/Browser/BulkAction.js +3 -9
- package/presentation/config/configComponents/Browser/BulkAction.js.map +1 -1
- package/presentation/config/configComponents/Browser/FileAction.d.ts +2 -1
- package/presentation/config/configComponents/Browser/FolderAction.d.ts +2 -1
- package/presentation/config/configComponents/Browser/Table/Column.d.ts +9 -8
- package/presentation/config/configComponents/Browser/Table/index.d.ts +9 -9
- package/presentation/config/configComponents/Browser/index.d.ts +20 -20
- package/presentation/config/configComponents/Browser/index.js +0 -8
- package/presentation/config/configComponents/Browser/index.js.map +1 -1
- package/presentation/config/configComponents/FileDetails/index.d.ts +4 -2
- package/presentation/fieldRenderers/CmsFilePickerRenderer.d.ts +13 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.js +29 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.d.ts +13 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js +51 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js.map +1 -0
- package/routes.d.ts +1 -0
- package/routes.js +2 -1
- package/routes.js.map +1 -1
- package/modules/HeadlessCms/fileField.d.ts +0 -2
- package/modules/HeadlessCms/fileField.js +0 -44
- package/modules/HeadlessCms/fileField.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/fileField.d.ts +0 -2
- package/modules/HeadlessCms/fileRenderer/fileField.js +0 -53
- package/modules/HeadlessCms/fileRenderer/fileField.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.d.ts +0 -2
- package/modules/HeadlessCms/fileRenderer/fileFields.js +0 -73
- package/modules/HeadlessCms/fileRenderer/fileFields.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/utils.d.ts +0 -2
- package/modules/HeadlessCms/fileRenderer/utils.js +0 -15
- package/modules/HeadlessCms/fileRenderer/utils.js.map +0 -1
- package/modules/HeadlessCms/index.d.ts +0 -1
- package/modules/HeadlessCms/index.js +0 -14
- package/modules/HeadlessCms/index.js.map +0 -1
- package/modules/Settings/graphql.d.ts +0 -12
- package/modules/Settings/graphql.js +0 -36
- package/modules/Settings/graphql.js.map +0 -1
- package/modules/Settings/views/FileManagerSettings.d.ts +0 -2
- package/modules/Settings/views/FileManagerSettings.js +0 -134
- package/modules/Settings/views/FileManagerSettings.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.d.ts +0 -7
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js +0 -15
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.d.ts +0 -15
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js +0 -44
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.d.ts +0 -15
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js +0 -52
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.d.ts +0 -61
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js +0 -111
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.d.ts +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.js +0 -372
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.d.ts +0 -8
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.js +0 -31
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.d.ts +0 -11
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js +0 -33
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/index.d.ts +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/index.js +0 -1
- package/presentation/FileList/components/BulkActions/BulkActionEdit.d.ts +0 -4
- package/presentation/FileList/components/BulkActions/BulkActionEdit.js +0 -105
- package/presentation/FileList/components/BulkActions/BulkActionEdit.js.map +0 -1
- package/presentation/config/configComponents/Browser/FolderFieldDecorator.d.ts +0 -7
- package/presentation/config/configComponents/Browser/FolderFieldDecorator.js +0 -11
- package/presentation/config/configComponents/Browser/FolderFieldDecorator.js.map +0 -1
package/app.js
CHANGED
|
@@ -4,8 +4,8 @@ import { FolderTreeFieldRenderer } from "@webiny/app-aco/presentation/folderTree
|
|
|
4
4
|
import { SettingsModule } from "./modules/Settings/index.js";
|
|
5
5
|
import { FileModelModule } from "./modules/FileModelModule.js";
|
|
6
6
|
import { DefaultFileManagerConfig } from "./presentation/config/DefaultFileManagerConfig.js";
|
|
7
|
-
import { HeadlessCmsModule } from "./modules/HeadlessCms/index.js";
|
|
8
7
|
import { EnterpriseModule } from "./modules/Enterprise/index.js";
|
|
8
|
+
import { AiEnrichmentModule } from "./modules/AiEnrichment/index.js";
|
|
9
9
|
import { SecurityPermissions } from "./modules/SecurityPermissions.js";
|
|
10
10
|
import { FileUrlFormatterModule } from "./modules/FileUrlFormatter.js";
|
|
11
11
|
import { FmPermissionsFeature } from "./features/permissions/feature.js";
|
|
@@ -22,6 +22,9 @@ import { FileManagerPresenterFeature } from "./presentation/FileList/index.js";
|
|
|
22
22
|
import { FileManagerRoutes } from "./modules/FileManagerRoutes.js";
|
|
23
23
|
import { FileManagerRendererDecorator } from "./presentation/FileManager/FileManagerRenderer.js";
|
|
24
24
|
import { FileModelProviderFeature } from "./features/fileModel/index.js";
|
|
25
|
+
import { FileFieldTypeFeature } from "./modules/HeadlessCms/fieldType/feature.js";
|
|
26
|
+
import { CmsFilePickerRenderer } from "./presentation/fieldRenderers/CmsFilePickerRenderer.js";
|
|
27
|
+
import { CmsMultiFilePickerRenderer } from "./presentation/fieldRenderers/CmsMultiFilePickerRenderer.js";
|
|
25
28
|
const FileManager = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
26
29
|
feature: FileModelProviderFeature
|
|
27
30
|
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
@@ -51,7 +54,15 @@ const FileManager = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null,
|
|
|
51
54
|
}), /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
52
55
|
name: "folderTree",
|
|
53
56
|
component: FolderTreeFieldRenderer
|
|
54
|
-
})
|
|
57
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
58
|
+
name: "cmsFilePicker",
|
|
59
|
+
component: CmsFilePickerRenderer
|
|
60
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
61
|
+
name: "cmsMultiFilePicker",
|
|
62
|
+
component: CmsMultiFilePickerRenderer
|
|
63
|
+
})), /*#__PURE__*/ react.createElement(FileManagerRoutes, null), /*#__PURE__*/ react.createElement(SettingsModule, null), /*#__PURE__*/ react.createElement(FileManagerRendererDecorator, null), /*#__PURE__*/ react.createElement(DefaultFileManagerConfig, null), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
64
|
+
feature: FileFieldTypeFeature
|
|
65
|
+
}), /*#__PURE__*/ react.createElement(EnterpriseModule, null), /*#__PURE__*/ react.createElement(AiEnrichmentModule, null), /*#__PURE__*/ react.createElement(SecurityPermissions, null), /*#__PURE__*/ react.createElement(FileUrlFormatterModule, null));
|
|
55
66
|
export { FileManager };
|
|
56
67
|
|
|
57
68
|
//# sourceMappingURL=app.js.map
|
package/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sources":["../src/app.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig, RegisterFeature } from \"@webiny/app-admin\";\nimport { FolderTreeFieldRenderer } from \"@webiny/app-aco/presentation/folderTree/FolderTreeFieldRenderer.js\";\nimport { SettingsModule } from \"~/modules/Settings/index.js\";\nimport { FileModelModule } from \"~/modules/FileModelModule.js\";\nimport { DefaultFileManagerConfig } from \"~/presentation/config/DefaultFileManagerConfig.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../src/app.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig, RegisterFeature } from \"@webiny/app-admin\";\nimport { FolderTreeFieldRenderer } from \"@webiny/app-aco/presentation/folderTree/FolderTreeFieldRenderer.js\";\nimport { SettingsModule } from \"~/modules/Settings/index.js\";\nimport { FileModelModule } from \"~/modules/FileModelModule.js\";\nimport { DefaultFileManagerConfig } from \"~/presentation/config/DefaultFileManagerConfig.js\";\nimport { EnterpriseModule } from \"~/modules/Enterprise/index.js\";\nimport { AiEnrichmentModule } from \"~/modules/AiEnrichment/index.js\";\nimport { SecurityPermissions } from \"./modules/SecurityPermissions.js\";\nimport { FileUrlFormatterModule } from \"./modules/FileUrlFormatter.js\";\nimport { FmPermissionsFeature } from \"~/features/permissions/feature.js\";\nimport { GetFileFeature } from \"~/features/getFile/feature.js\";\nimport { ResolveImageToolFeature } from \"~/features/resolveImageTool/feature.js\";\nimport { ListFilesFeature } from \"~/features/listFiles/index.js\";\nimport { UpdateFileFeature } from \"~/features/updateFile/index.js\";\nimport { DeleteFileFeature } from \"~/features/deleteFile/index.js\";\nimport { FileUploaderFeature } from \"~/features/fileUploader/index.js\";\nimport { ListTagsFeature } from \"~/features/tags/index.js\";\nimport { GetSettingsFeature } from \"~/features/settings/index.js\";\nimport { SharedCacheFeature } from \"~/features/shared/index.js\";\nimport { FileManagerPresenterFeature } from \"~/presentation/FileList/index.js\";\nimport { FileManagerRoutes } from \"~/modules/FileManagerRoutes.js\";\nimport { FileManagerRendererDecorator } from \"~/presentation/FileManager/FileManagerRenderer.js\";\nimport { FileModelProviderFeature } from \"~/features/fileModel/index.js\";\nimport { FileFieldTypeFeature } from \"~/modules/HeadlessCms/fieldType/feature.js\";\nimport { CmsFilePickerRenderer } from \"~/presentation/fieldRenderers/CmsFilePickerRenderer.js\";\nimport { CmsMultiFilePickerRenderer } from \"~/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js\";\n\nexport const FileManager = () => {\n return (\n <>\n {/* Headless features. */}\n <RegisterFeature feature={FileModelProviderFeature} />\n <RegisterFeature feature={SharedCacheFeature} />\n <RegisterFeature feature={ListFilesFeature} />\n <RegisterFeature feature={GetFileFeature} />\n <RegisterFeature feature={UpdateFileFeature} />\n <RegisterFeature feature={DeleteFileFeature} />\n <RegisterFeature feature={FileUploaderFeature} />\n <RegisterFeature feature={ListTagsFeature} />\n <RegisterFeature feature={GetSettingsFeature} />\n <RegisterFeature feature={FmPermissionsFeature} />\n <RegisterFeature feature={GetFileFeature} />\n <RegisterFeature feature={ResolveImageToolFeature} />\n <FileModelModule />\n {/* Presentation features. */}\n <RegisterFeature feature={FileManagerPresenterFeature} />\n {/* Field renderers. */}\n <AdminConfig>\n <AdminConfig.Form.FieldRenderer\n name={\"folderTree\"}\n component={FolderTreeFieldRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsFilePicker\"}\n component={CmsFilePickerRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsMultiFilePicker\"}\n component={CmsMultiFilePickerRenderer}\n />\n </AdminConfig>\n {/* Legacy modules. */}\n <FileManagerRoutes />\n <SettingsModule />\n <FileManagerRendererDecorator />\n <DefaultFileManagerConfig />\n <RegisterFeature feature={FileFieldTypeFeature} />\n <EnterpriseModule />\n <AiEnrichmentModule />\n <SecurityPermissions />\n <FileUrlFormatterModule />\n </>\n );\n};\n"],"names":["FileManager","RegisterFeature","FileModelProviderFeature","SharedCacheFeature","ListFilesFeature","GetFileFeature","UpdateFileFeature","DeleteFileFeature","FileUploaderFeature","ListTagsFeature","GetSettingsFeature","FmPermissionsFeature","ResolveImageToolFeature","FileModelModule","FileManagerPresenterFeature","AdminConfig","FolderTreeFieldRenderer","CmsFilePickerRenderer","CmsMultiFilePickerRenderer","FileManagerRoutes","SettingsModule","FileManagerRendererDecorator","DefaultFileManagerConfig","FileFieldTypeFeature","EnterpriseModule","AiEnrichmentModule","SecurityPermissions","FileUrlFormatterModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAMA,cAAc,IAChB,WAAP,GACI,wDAEI,oBAACC,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACF,iBAAeA;QAAC,SAASG;sBAC1B,oBAACH,iBAAeA;QAAC,SAASI;sBAC1B,oBAACJ,iBAAeA;QAAC,SAASK;sBAC1B,oBAACL,iBAAeA;QAAC,SAASM;sBAC1B,oBAACN,iBAAeA;QAAC,SAASO;sBAC1B,oBAACP,iBAAeA;QAAC,SAASQ;sBAC1B,oBAACR,iBAAeA;QAAC,SAASS;sBAC1B,oBAACT,iBAAeA;QAAC,SAASU;sBAC1B,oBAACV,iBAAeA;QAAC,SAASI;sBAC1B,oBAACJ,iBAAeA;QAAC,SAASW;sBAC1B,oBAACC,iBAAeA,OAAAA,WAAAA,GAEhB,oBAACZ,iBAAeA;QAAC,SAASa;sBAE1B,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACA,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWC;sBAEf,oBAACD,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWE;sBAEf,oBAACF,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWG;uBAInB,oBAACC,mBAAiBA,OAAAA,WAAAA,GAClB,oBAACC,gBAAcA,OAAAA,WAAAA,GACf,oBAACC,8BAA4BA,OAAAA,WAAAA,GAC7B,oBAACC,0BAAwBA,OAAAA,WAAAA,GACzB,oBAACrB,iBAAeA;QAAC,SAASsB;sBAC1B,oBAACC,kBAAgBA,OAAAA,WAAAA,GACjB,oBAACC,oBAAkBA,OAAAA,WAAAA,GACnB,oBAACC,qBAAmBA,OAAAA,WAAAA,GACpB,oBAACC,wBAAsBA"}
|
package/domain/tagsHelpers.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ interface GetTagsInitialParams {
|
|
|
4
4
|
own?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const getTagsInitialParams: ({ scope, own }: GetTagsInitialParams) => {
|
|
7
|
-
tags_startsWith: string;
|
|
8
7
|
createdBy?: string | undefined;
|
|
8
|
+
tags_startsWith: string;
|
|
9
9
|
} | {
|
|
10
|
-
tags_not_startsWith: string;
|
|
11
10
|
createdBy?: string | undefined;
|
|
11
|
+
tags_not_startsWith: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const tagsModifier: (scope?: string) => (tags: TagItem[]) => {
|
|
14
14
|
tag: string;
|
package/domain/types.d.ts
CHANGED
|
@@ -18,14 +18,6 @@ export interface Settings {
|
|
|
18
18
|
uploadMaxFileSize: string;
|
|
19
19
|
srcPrefix: string;
|
|
20
20
|
}
|
|
21
|
-
export interface QueryGetSettingsResult {
|
|
22
|
-
fileManager: {
|
|
23
|
-
getSettings: {
|
|
24
|
-
data: Settings;
|
|
25
|
-
error: Error | null;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
21
|
export interface FileTag {
|
|
30
22
|
tag: string;
|
|
31
23
|
count: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Permissions } from "@webiny/app-admin/exports/admin/security.js";
|
|
2
2
|
import { FM_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
3
|
export declare const FileManagerPermissions: import("@webiny/di").Abstraction<{
|
|
4
|
-
canAccess: (entityId: "
|
|
5
|
-
canAction: (action: string, entityId: "
|
|
4
|
+
canAccess: (entityId: "file" | "settings") => boolean;
|
|
5
|
+
canAction: (action: string, entityId: "file" | "settings") => boolean;
|
|
6
6
|
} & {
|
|
7
7
|
canRead: (entityId: "file") => boolean;
|
|
8
8
|
canCreate: (entityId: "file") => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const FmPermissionsFeature: import("@webiny/feature/admin").FeatureDefinition<{
|
|
1
|
+
export declare const FmPermissionsFeature: import("@webiny/feature/admin/createFeature.js").FeatureDefinition<{
|
|
2
2
|
permissions: {
|
|
3
|
-
canAccess: (entityId: "
|
|
4
|
-
canAction: (action: string, entityId: "
|
|
3
|
+
canAccess: (entityId: "file" | "settings") => boolean;
|
|
4
|
+
canAction: (action: string, entityId: "file" | "settings") => boolean;
|
|
5
5
|
} & {
|
|
6
6
|
canRead: (entityId: "file") => boolean;
|
|
7
7
|
canCreate: (entityId: "file") => boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WebsocketEventHandler } from "@webiny/app-websockets";
|
|
2
|
+
import { Notifications } from "@webiny/app-admin/features/notifications/abstractions.js";
|
|
3
|
+
import { FilesListCache } from "../../features/shared/abstractions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Reacts to the `fm.file.enrichment` websocket message (published as a `WebsocketEvent`):
|
|
6
|
+
* patches the affected file in the shared list cache with the AI-generated tags and description
|
|
7
|
+
* (cache-only — the data is already persisted server-side), then surfaces a success notification.
|
|
8
|
+
*/
|
|
9
|
+
declare class AiImageEnrichmentEventHandlerImpl implements WebsocketEventHandler.Interface {
|
|
10
|
+
private filesListCache;
|
|
11
|
+
private notifications;
|
|
12
|
+
constructor(filesListCache: FilesListCache.Interface, notifications: Notifications.Interface);
|
|
13
|
+
handle(event: WebsocketEventHandler.Event): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const AiImageEnrichmentEventHandler: typeof AiImageEnrichmentEventHandlerImpl & {
|
|
16
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app/features/eventPublisher").IEventHandler<import("@webiny/app-websockets").WebsocketEvent>>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { WebsocketEventHandler } from "@webiny/app-websockets";
|
|
2
|
+
import { Notifications } from "@webiny/app-admin/features/notifications/abstractions.js";
|
|
3
|
+
import { FilesListCache } from "../../features/shared/abstractions.js";
|
|
4
|
+
const FILE_ENRICHMENT_ACTION = "fm.file.enrichment";
|
|
5
|
+
class AiImageEnrichmentEventHandlerImpl {
|
|
6
|
+
constructor(filesListCache, notifications){
|
|
7
|
+
this.filesListCache = filesListCache;
|
|
8
|
+
this.notifications = notifications;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
if (event.payload.action !== FILE_ENRICHMENT_ACTION) return;
|
|
12
|
+
const { id, tags, description } = event.payload.data;
|
|
13
|
+
this.filesListCache.updateItems((item)=>item.id === id ? {
|
|
14
|
+
...item,
|
|
15
|
+
tags,
|
|
16
|
+
description
|
|
17
|
+
} : item);
|
|
18
|
+
this.notifications.success({
|
|
19
|
+
title: "Image enriched",
|
|
20
|
+
description: "AI-generated tags and description have been added."
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const AiImageEnrichmentEventHandler = WebsocketEventHandler.createImplementation({
|
|
25
|
+
implementation: AiImageEnrichmentEventHandlerImpl,
|
|
26
|
+
dependencies: [
|
|
27
|
+
FilesListCache,
|
|
28
|
+
Notifications
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
export { AiImageEnrichmentEventHandler };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=AiImageEnrichmentEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/AiEnrichment/AiImageEnrichmentEventHandler.js","sources":["../../../src/modules/AiEnrichment/AiImageEnrichmentEventHandler.ts"],"sourcesContent":["import { WebsocketEventHandler } from \"@webiny/app-websockets\";\nimport { Notifications } from \"@webiny/app-admin/features/notifications/abstractions.js\";\nimport { FilesListCache } from \"~/features/shared/abstractions.js\";\n\nconst FILE_ENRICHMENT_ACTION = \"fm.file.enrichment\";\n\ninterface FileEnrichmentData {\n id: string;\n tags: string[];\n description: string;\n}\n\n/**\n * Reacts to the `fm.file.enrichment` websocket message (published as a `WebsocketEvent`):\n * patches the affected file in the shared list cache with the AI-generated tags and description\n * (cache-only — the data is already persisted server-side), then surfaces a success notification.\n */\nclass AiImageEnrichmentEventHandlerImpl implements WebsocketEventHandler.Interface {\n constructor(\n private filesListCache: FilesListCache.Interface,\n private notifications: Notifications.Interface\n ) {}\n\n async handle(event: WebsocketEventHandler.Event): Promise<void> {\n if (event.payload.action !== FILE_ENRICHMENT_ACTION) {\n return;\n }\n\n // Payload envelope is `{ action, data: { ... } }` (see the api-side sender + the threat-scan\n // handler which reads message.data). The enrichment fields live under `.data`, not top-level.\n const { id, tags, description } = (event.payload as unknown as { data: FileEnrichmentData })\n .data;\n\n this.filesListCache.updateItems(item =>\n item.id === id ? { ...item, tags, description } : item\n );\n\n this.notifications.success({\n title: \"Image enriched\",\n description: \"AI-generated tags and description have been added.\"\n });\n }\n}\n\nexport const AiImageEnrichmentEventHandler = WebsocketEventHandler.createImplementation({\n implementation: AiImageEnrichmentEventHandlerImpl,\n dependencies: [FilesListCache, Notifications]\n});\n"],"names":["FILE_ENRICHMENT_ACTION","AiImageEnrichmentEventHandlerImpl","filesListCache","notifications","event","id","tags","description","item","AiImageEnrichmentEventHandler","WebsocketEventHandler","FilesListCache","Notifications"],"mappings":";;;AAIA,MAAMA,yBAAyB;AAa/B,MAAMC;IACF,YACYC,cAAwC,EACxCC,aAAsC,CAChD;aAFUD,cAAc,GAAdA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,OAAOC,KAAkC,EAAiB;QAC5D,IAAIA,MAAM,OAAO,CAAC,MAAM,KAAKJ,wBACzB;QAKJ,MAAM,EAAEK,EAAE,EAAEC,IAAI,EAAEC,WAAW,EAAE,GAAIH,MAAM,OAAO,CAC3C,IAAI;QAET,IAAI,CAAC,cAAc,CAAC,WAAW,CAACI,CAAAA,OAC5BA,KAAK,EAAE,KAAKH,KAAK;gBAAE,GAAGG,IAAI;gBAAEF;gBAAMC;YAAY,IAAIC;QAGtD,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;YACvB,OAAO;YACP,aAAa;QACjB;IACJ;AACJ;AAEO,MAAMC,gCAAgCC,sBAAsB,oBAAoB,CAAC;IACpF,gBAAgBT;IAChB,cAAc;QAACU;QAAgBC;KAAc;AACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AiEnrichmentFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { AiImageEnrichmentEventHandler } from "./AiImageEnrichmentEventHandler.js";
|
|
3
|
+
const AiEnrichmentFeature = createFeature({
|
|
4
|
+
name: "FileManager/AiEnrichment",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(AiImageEnrichmentEventHandler);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { AiEnrichmentFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/AiEnrichment/feature.js","sources":["../../../src/modules/AiEnrichment/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { AiImageEnrichmentEventHandler } from \"./AiImageEnrichmentEventHandler.js\";\n\nexport const AiEnrichmentFeature = createFeature({\n name: \"FileManager/AiEnrichment\",\n register(container) {\n container.register(AiImageEnrichmentEventHandler);\n }\n});\n"],"names":["AiEnrichmentFeature","createFeature","container","AiImageEnrichmentEventHandler"],"mappings":";;AAGO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { RegisterFeature } from "@webiny/app-admin";
|
|
3
|
+
import { AiEnrichmentFeature } from "./feature.js";
|
|
4
|
+
const AiEnrichmentModule = ()=>/*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
5
|
+
feature: AiEnrichmentFeature
|
|
6
|
+
});
|
|
7
|
+
export { AiEnrichmentModule };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/AiEnrichment/index.js","sources":["../../../src/modules/AiEnrichment/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { RegisterFeature } from \"@webiny/app-admin\";\nimport { AiEnrichmentFeature } from \"./feature.js\";\n\nexport const AiEnrichmentModule = () => {\n return <RegisterFeature feature={AiEnrichmentFeature} />;\n};\n"],"names":["AiEnrichmentModule","RegisterFeature","AiEnrichmentFeature"],"mappings":";;;AAIO,MAAMA,qBAAqB,IACvB,WAAP,GAAO,oBAACC,iBAAeA;QAAC,SAASC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CmsFieldEditorGroupModifier } from "@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js";
|
|
2
|
+
import type { ICmsFieldEditorFormBuilder, ICmsFieldEditorContext } from "@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js";
|
|
3
|
+
import type { CmsModelField } from "@webiny/app-headless-cms-common/types/index.js";
|
|
4
|
+
declare class FileFieldSettingsModifierImpl implements CmsFieldEditorGroupModifier.Interface {
|
|
5
|
+
group: string;
|
|
6
|
+
shouldApply(context: ICmsFieldEditorContext): boolean;
|
|
7
|
+
modifyForm(form: ICmsFieldEditorFormBuilder): void;
|
|
8
|
+
mapToForm(field: CmsModelField): {
|
|
9
|
+
imagesOnly: boolean;
|
|
10
|
+
};
|
|
11
|
+
mapFromForm(formData: Record<string, any>, field: CmsModelField): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const FileFieldSettingsModifier: typeof FileFieldSettingsModifierImpl & {
|
|
14
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js").ICmsFieldEditorGroupModifier>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CmsFieldEditorGroupModifier } from "@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js";
|
|
2
|
+
class FileFieldSettingsModifierImpl {
|
|
3
|
+
shouldApply(context) {
|
|
4
|
+
return "file" === context.fieldType.type;
|
|
5
|
+
}
|
|
6
|
+
modifyForm(form) {
|
|
7
|
+
form.fields((fields)=>({
|
|
8
|
+
imagesOnly: fields.boolean().label("Images only").description("Allow only images to be selected").renderer("switch").defaultValue(false)
|
|
9
|
+
}));
|
|
10
|
+
form.layout((layout)=>[
|
|
11
|
+
layout.row("imagesOnly")
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
mapToForm(field) {
|
|
15
|
+
return {
|
|
16
|
+
imagesOnly: field.settings?.imagesOnly ?? false
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
mapFromForm(formData, field) {
|
|
20
|
+
if (!field.settings) field.settings = {};
|
|
21
|
+
field.settings.imagesOnly = formData.imagesOnly;
|
|
22
|
+
}
|
|
23
|
+
constructor(){
|
|
24
|
+
this.group = "general";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const FileFieldSettingsModifier = CmsFieldEditorGroupModifier.createImplementation({
|
|
28
|
+
implementation: FileFieldSettingsModifierImpl,
|
|
29
|
+
dependencies: []
|
|
30
|
+
});
|
|
31
|
+
export { FileFieldSettingsModifier };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=FileFieldSettingsModifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/FileFieldSettingsModifier.js","sources":["../../../../src/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.ts"],"sourcesContent":["import { CmsFieldEditorGroupModifier } from \"@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js\";\nimport type {\n ICmsFieldEditorFormBuilder,\n ICmsFieldEditorContext\n} from \"@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js\";\nimport type { CmsModelField } from \"@webiny/app-headless-cms-common/types/index.js\";\n\nclass FileFieldSettingsModifierImpl implements CmsFieldEditorGroupModifier.Interface {\n group = \"general\";\n\n shouldApply(context: ICmsFieldEditorContext) {\n return context.fieldType.type === \"file\";\n }\n\n modifyForm(form: ICmsFieldEditorFormBuilder) {\n form.fields(fields => ({\n imagesOnly: fields\n .boolean()\n .label(\"Images only\")\n .description(\"Allow only images to be selected\")\n .renderer(\"switch\")\n .defaultValue(false)\n }));\n form.layout(layout => [layout.row(\"imagesOnly\")]);\n }\n\n mapToForm(field: CmsModelField) {\n return { imagesOnly: field.settings?.imagesOnly ?? false };\n }\n\n mapFromForm(formData: Record<string, any>, field: CmsModelField) {\n if (!field.settings) {\n field.settings = {};\n }\n field.settings.imagesOnly = formData.imagesOnly;\n }\n}\n\nexport const FileFieldSettingsModifier = CmsFieldEditorGroupModifier.createImplementation({\n implementation: FileFieldSettingsModifierImpl,\n dependencies: []\n});\n"],"names":["FileFieldSettingsModifierImpl","context","form","fields","layout","field","formData","FileFieldSettingsModifier","CmsFieldEditorGroupModifier"],"mappings":";AAOA,MAAMA;IAGF,YAAYC,OAA+B,EAAE;QACzC,OAAOA,AAA2B,WAA3BA,QAAQ,SAAS,CAAC,IAAI;IACjC;IAEA,WAAWC,IAAgC,EAAE;QACzCA,KAAK,MAAM,CAACC,CAAAA,SAAW;gBACnB,YAAYA,OACP,OAAO,GACP,KAAK,CAAC,eACN,WAAW,CAAC,oCACZ,QAAQ,CAAC,UACT,YAAY,CAAC;YACtB;QACAD,KAAK,MAAM,CAACE,CAAAA,SAAU;gBAACA,OAAO,GAAG,CAAC;aAAc;IACpD;IAEA,UAAUC,KAAoB,EAAE;QAC5B,OAAO;YAAE,YAAYA,MAAM,QAAQ,EAAE,cAAc;QAAM;IAC7D;IAEA,YAAYC,QAA6B,EAAED,KAAoB,EAAE;QAC7D,IAAI,CAACA,MAAM,QAAQ,EACfA,MAAM,QAAQ,GAAG,CAAC;QAEtBA,MAAM,QAAQ,CAAC,UAAU,GAAGC,SAAS,UAAU;IACnD;;aA3BA,KAAK,GAAG;;AA4BZ;AAEO,MAAMC,4BAA4BC,4BAA4B,oBAAoB,CAAC;IACtF,gBAAgBR;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CmsFieldType } from "@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js";
|
|
3
|
+
declare class FileFieldTypeImpl implements CmsFieldType.Interface {
|
|
4
|
+
type: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
icon: React.JSX.Element;
|
|
8
|
+
allowList: boolean;
|
|
9
|
+
listLabel: string;
|
|
10
|
+
allowPredefinedValues: boolean;
|
|
11
|
+
validators: string[];
|
|
12
|
+
listValidators: string[];
|
|
13
|
+
createField(): {
|
|
14
|
+
type: string;
|
|
15
|
+
validation: never[];
|
|
16
|
+
renderer: {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const FileFieldType: typeof FileFieldTypeImpl & {
|
|
22
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js").ICmsFieldType>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { ReactComponent } from "@webiny/icons/file_present.svg";
|
|
3
|
+
import { CmsFieldType } from "@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js";
|
|
4
|
+
class FileFieldTypeImpl {
|
|
5
|
+
createField() {
|
|
6
|
+
return {
|
|
7
|
+
type: this.type,
|
|
8
|
+
validation: [],
|
|
9
|
+
renderer: {
|
|
10
|
+
name: ""
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
constructor(){
|
|
15
|
+
this.type = "file";
|
|
16
|
+
this.label = "Files";
|
|
17
|
+
this.description = "Images, videos and other files.";
|
|
18
|
+
this.icon = /*#__PURE__*/ react.createElement(ReactComponent, null);
|
|
19
|
+
this.allowList = true;
|
|
20
|
+
this.listLabel = "Use as a list of files or an image gallery";
|
|
21
|
+
this.allowPredefinedValues = false;
|
|
22
|
+
this.validators = [
|
|
23
|
+
"required"
|
|
24
|
+
];
|
|
25
|
+
this.listValidators = [
|
|
26
|
+
"minLength",
|
|
27
|
+
"maxLength"
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const FileFieldType = CmsFieldType.createImplementation({
|
|
32
|
+
implementation: FileFieldTypeImpl,
|
|
33
|
+
dependencies: []
|
|
34
|
+
});
|
|
35
|
+
export { FileFieldType };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=FileFieldType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/FileFieldType.js","sources":["../../../../src/modules/HeadlessCms/fieldType/FileFieldType.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as FileIcon } from \"@webiny/icons/file_present.svg\";\nimport { CmsFieldType } from \"@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js\";\n\nclass FileFieldTypeImpl implements CmsFieldType.Interface {\n type = \"file\";\n label = \"Files\";\n description = \"Images, videos and other files.\";\n icon = <FileIcon />;\n allowList = true;\n listLabel = \"Use as a list of files or an image gallery\";\n allowPredefinedValues = false;\n validators = [\"required\"];\n listValidators = [\"minLength\", \"maxLength\"];\n\n createField() {\n return {\n type: this.type,\n validation: [],\n renderer: { name: \"\" }\n };\n }\n}\n\nexport const FileFieldType = CmsFieldType.createImplementation({\n implementation: FileFieldTypeImpl,\n dependencies: []\n});\n"],"names":["FileFieldTypeImpl","FileIcon","FileFieldType","CmsFieldType"],"mappings":";;;AAIA,MAAMA;IAWF,cAAc;QACV,OAAO;YACH,MAAM,IAAI,CAAC,IAAI;YACf,YAAY,EAAE;YACd,UAAU;gBAAE,MAAM;YAAG;QACzB;IACJ;;aAhBA,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAAG;aACd,IAAI,GAAG,WAAP,GAAO,oBAACC,gBAAQA;aAChB,SAAS,GAAG;aACZ,SAAS,GAAG;aACZ,qBAAqB,GAAG;aACxB,UAAU,GAAG;YAAC;SAAW;aACzB,cAAc,GAAG;YAAC;YAAa;SAAY;;AAS/C;AAEO,MAAMC,gBAAgBC,aAAa,oBAAoB,CAAC;IAC3D,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CmsFieldRenderer } from "@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js";
|
|
2
|
+
import type { CmsModelField } from "@webiny/app-headless-cms-common/types/index.js";
|
|
3
|
+
declare class FileInputRendererImpl implements CmsFieldRenderer.Interface {
|
|
4
|
+
rendererName: string;
|
|
5
|
+
formRenderer: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
canUse({ field }: {
|
|
9
|
+
field: CmsModelField;
|
|
10
|
+
}): boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const FileInputRenderer: typeof FileInputRendererImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js").ICmsFieldRenderer>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CmsFieldRenderer } from "@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js";
|
|
2
|
+
class FileInputRendererImpl {
|
|
3
|
+
canUse({ field }) {
|
|
4
|
+
return "file" === field.type && !field.list;
|
|
5
|
+
}
|
|
6
|
+
constructor(){
|
|
7
|
+
this.rendererName = "file-input";
|
|
8
|
+
this.formRenderer = "cmsFilePicker";
|
|
9
|
+
this.name = "File Input";
|
|
10
|
+
this.description = "Enables selecting a single file via File Manager.";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const FileInputRenderer = CmsFieldRenderer.createImplementation({
|
|
14
|
+
implementation: FileInputRendererImpl,
|
|
15
|
+
dependencies: []
|
|
16
|
+
});
|
|
17
|
+
export { FileInputRenderer };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=FileInputRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/FileInputRenderer.js","sources":["../../../../src/modules/HeadlessCms/fieldType/FileInputRenderer.ts"],"sourcesContent":["import { CmsFieldRenderer } from \"@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js\";\nimport type { CmsModelField } from \"@webiny/app-headless-cms-common/types/index.js\";\n\nclass FileInputRendererImpl implements CmsFieldRenderer.Interface {\n rendererName = \"file-input\";\n formRenderer = \"cmsFilePicker\";\n name = \"File Input\";\n description = \"Enables selecting a single file via File Manager.\";\n\n canUse({ field }: { field: CmsModelField }) {\n return field.type === \"file\" && !field.list;\n }\n}\n\nexport const FileInputRenderer = CmsFieldRenderer.createImplementation({\n implementation: FileInputRendererImpl,\n dependencies: []\n});\n"],"names":["FileInputRendererImpl","field","FileInputRenderer","CmsFieldRenderer"],"mappings":";AAGA,MAAMA;IAMF,OAAO,EAAEC,KAAK,EAA4B,EAAE;QACxC,OAAOA,AAAe,WAAfA,MAAM,IAAI,IAAe,CAACA,MAAM,IAAI;IAC/C;;aAPA,YAAY,GAAG;aACf,YAAY,GAAG;aACf,IAAI,GAAG;aACP,WAAW,GAAG;;AAKlB;AAEO,MAAMC,oBAAoBC,iBAAiB,oBAAoB,CAAC;IACnE,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CmsFieldRenderer } from "@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js";
|
|
2
|
+
import type { CmsModelField } from "@webiny/app-headless-cms-common/types/index.js";
|
|
3
|
+
declare class FileInputsRendererImpl implements CmsFieldRenderer.Interface {
|
|
4
|
+
rendererName: string;
|
|
5
|
+
formRenderer: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
canUse({ field }: {
|
|
9
|
+
field: CmsModelField;
|
|
10
|
+
}): boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const FileInputsRenderer: typeof FileInputsRendererImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js").ICmsFieldRenderer>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CmsFieldRenderer } from "@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js";
|
|
2
|
+
class FileInputsRendererImpl {
|
|
3
|
+
canUse({ field }) {
|
|
4
|
+
return "file" === field.type && !!field.list;
|
|
5
|
+
}
|
|
6
|
+
constructor(){
|
|
7
|
+
this.rendererName = "file-inputs";
|
|
8
|
+
this.formRenderer = "cmsMultiFilePicker";
|
|
9
|
+
this.name = "File Inputs";
|
|
10
|
+
this.description = "Enables selecting multiple files via File Manager.";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const FileInputsRenderer = CmsFieldRenderer.createImplementation({
|
|
14
|
+
implementation: FileInputsRendererImpl,
|
|
15
|
+
dependencies: []
|
|
16
|
+
});
|
|
17
|
+
export { FileInputsRenderer };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=FileInputsRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/FileInputsRenderer.js","sources":["../../../../src/modules/HeadlessCms/fieldType/FileInputsRenderer.ts"],"sourcesContent":["import { CmsFieldRenderer } from \"@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js\";\nimport type { CmsModelField } from \"@webiny/app-headless-cms-common/types/index.js\";\n\nclass FileInputsRendererImpl implements CmsFieldRenderer.Interface {\n rendererName = \"file-inputs\";\n formRenderer = \"cmsMultiFilePicker\";\n name = \"File Inputs\";\n description = \"Enables selecting multiple files via File Manager.\";\n\n canUse({ field }: { field: CmsModelField }) {\n return field.type === \"file\" && !!field.list;\n }\n}\n\nexport const FileInputsRenderer = CmsFieldRenderer.createImplementation({\n implementation: FileInputsRendererImpl,\n dependencies: []\n});\n"],"names":["FileInputsRendererImpl","field","FileInputsRenderer","CmsFieldRenderer"],"mappings":";AAGA,MAAMA;IAMF,OAAO,EAAEC,KAAK,EAA4B,EAAE;QACxC,OAAOA,AAAe,WAAfA,MAAM,IAAI,IAAe,CAAC,CAACA,MAAM,IAAI;IAChD;;aAPA,YAAY,GAAG;aACf,YAAY,GAAG;aACf,IAAI,GAAG;aACP,WAAW,GAAG;;AAKlB;AAEO,MAAMC,qBAAqBC,iBAAiB,oBAAoB,CAAC;IACpE,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FileFieldTypeFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { FileFieldType } from "./FileFieldType.js";
|
|
3
|
+
import { FileFieldSettingsModifier } from "./FileFieldSettingsModifier.js";
|
|
4
|
+
import { FileInputRenderer } from "./FileInputRenderer.js";
|
|
5
|
+
import { FileInputsRenderer } from "./FileInputsRenderer.js";
|
|
6
|
+
const FileFieldTypeFeature = createFeature({
|
|
7
|
+
name: "FileFieldType",
|
|
8
|
+
register (container) {
|
|
9
|
+
container.register(FileFieldType);
|
|
10
|
+
container.register(FileFieldSettingsModifier);
|
|
11
|
+
container.register(FileInputRenderer);
|
|
12
|
+
container.register(FileInputsRenderer);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { FileFieldTypeFeature };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/feature.js","sources":["../../../../src/modules/HeadlessCms/fieldType/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { FileFieldType } from \"./FileFieldType.js\";\nimport { FileFieldSettingsModifier } from \"./FileFieldSettingsModifier.js\";\nimport { FileInputRenderer } from \"./FileInputRenderer.js\";\nimport { FileInputsRenderer } from \"./FileInputsRenderer.js\";\n\nexport const FileFieldTypeFeature = createFeature({\n name: \"FileFieldType\",\n register(container) {\n container.register(FileFieldType);\n container.register(FileFieldSettingsModifier);\n container.register(FileInputRenderer);\n container.register(FileInputsRenderer);\n }\n});\n"],"names":["FileFieldTypeFeature","createFeature","container","FileFieldType","FileFieldSettingsModifier","FileInputRenderer","FileInputsRenderer"],"mappings":";;;;;AAMO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;IACvB;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-file-manager",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -13,37 +13,28 @@
|
|
|
13
13
|
"author": "Jon Rapp ",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@apollo/react-common": "3.1.4",
|
|
17
|
-
"@apollo/react-components": "3.1.5",
|
|
18
16
|
"@types/react": "18.3.31",
|
|
19
|
-
"@webiny/admin-ui": "6.
|
|
20
|
-
"@webiny/app": "6.
|
|
21
|
-
"@webiny/app-aco": "6.
|
|
22
|
-
"@webiny/app-admin": "6.
|
|
23
|
-
"@webiny/app-headless-cms": "6.
|
|
24
|
-
"@webiny/app-headless-cms-common": "6.
|
|
25
|
-
"@webiny/app-websockets": "6.
|
|
17
|
+
"@webiny/admin-ui": "6.6.0-alpha.0",
|
|
18
|
+
"@webiny/app": "6.6.0-alpha.0",
|
|
19
|
+
"@webiny/app-aco": "6.6.0-alpha.0",
|
|
20
|
+
"@webiny/app-admin": "6.6.0-alpha.0",
|
|
21
|
+
"@webiny/app-headless-cms": "6.6.0-alpha.0",
|
|
22
|
+
"@webiny/app-headless-cms-common": "6.6.0-alpha.0",
|
|
23
|
+
"@webiny/app-websockets": "6.6.0-alpha.0",
|
|
26
24
|
"@webiny/di": "1.0.2",
|
|
27
|
-
"@webiny/feature": "6.
|
|
28
|
-
"@webiny/form": "6.
|
|
29
|
-
"@webiny/icons": "6.
|
|
30
|
-
"@webiny/plugins": "6.
|
|
31
|
-
"@webiny/react-composition": "6.
|
|
32
|
-
"@webiny/react-properties": "6.
|
|
33
|
-
"@webiny/sdk": "6.
|
|
34
|
-
"@webiny/validation": "6.
|
|
35
|
-
"apollo-cache": "1.3.5",
|
|
36
|
-
"apollo-client": "2.6.10",
|
|
37
|
-
"apollo-link": "1.2.14",
|
|
38
|
-
"apollo-utilities": "1.3.4",
|
|
25
|
+
"@webiny/feature": "6.6.0-alpha.0",
|
|
26
|
+
"@webiny/form": "6.6.0-alpha.0",
|
|
27
|
+
"@webiny/icons": "6.6.0-alpha.0",
|
|
28
|
+
"@webiny/plugins": "6.6.0-alpha.0",
|
|
29
|
+
"@webiny/react-composition": "6.6.0-alpha.0",
|
|
30
|
+
"@webiny/react-properties": "6.6.0-alpha.0",
|
|
31
|
+
"@webiny/sdk": "6.6.0-alpha.0",
|
|
32
|
+
"@webiny/validation": "6.6.0-alpha.0",
|
|
39
33
|
"bytes": "3.1.2",
|
|
40
34
|
"dayjs": "1.11.21",
|
|
41
|
-
"dot-prop-immutable": "2.1.1",
|
|
42
|
-
"graphql": "16.14.2",
|
|
43
|
-
"graphql-tag": "2.12.7",
|
|
44
35
|
"lodash": "4.18.1",
|
|
45
36
|
"mime": "4.1.0",
|
|
46
|
-
"minimatch": "10.2.
|
|
37
|
+
"minimatch": "10.2.6",
|
|
47
38
|
"mobx": "6.16.1",
|
|
48
39
|
"mobx-react-lite": "4.1.1",
|
|
49
40
|
"react": "18.3.1",
|
|
@@ -52,10 +43,9 @@
|
|
|
52
43
|
"zod": "4.4.3"
|
|
53
44
|
},
|
|
54
45
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@webiny/build-tools": "6.4.5",
|
|
46
|
+
"@webiny/build-tools": "6.6.0-alpha.0",
|
|
57
47
|
"rimraf": "6.1.3",
|
|
58
|
-
"typescript": "
|
|
48
|
+
"typescript": "7.0.2",
|
|
59
49
|
"vitest": "4.1.10"
|
|
60
50
|
},
|
|
61
51
|
"publishConfig": {
|