@webiny/app-file-manager 6.4.12-beta.4 → 6.5.0-beta.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 +21 -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 +2 -2
- package/features/shared/FILE_FIELDS.js +4 -0
- package/features/shared/FILE_FIELDS.js.map +1 -1
- 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/AssetFieldSettingsModifier.d.ts +26 -0
- package/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.js +39 -0
- package/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetFieldType.d.ts +34 -0
- package/modules/HeadlessCms/fieldType/AssetFieldType.js +42 -0
- package/modules/HeadlessCms/fieldType/AssetFieldType.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetFormFieldType.d.ts +21 -0
- package/modules/HeadlessCms/fieldType/AssetFormFieldType.js +42 -0
- package/modules/HeadlessCms/fieldType/AssetFormFieldType.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetInputRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/AssetInputRenderer.js +20 -0
- package/modules/HeadlessCms/fieldType/AssetInputRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetInputsRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/AssetInputsRenderer.js +20 -0
- package/modules/HeadlessCms/fieldType/AssetInputsRenderer.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 +25 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.js +38 -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 +27 -0
- package/modules/HeadlessCms/fieldType/feature.js.map +1 -0
- package/modules/HeadlessCms/fieldType/isAssetField.d.ts +2 -0
- package/modules/HeadlessCms/fieldType/isAssetField.js +4 -0
- package/modules/HeadlessCms/fieldType/isAssetField.js.map +1 -0
- package/package.json +25 -35
- package/presentation/FileActions/FileDetails/EditImage.d.ts +2 -0
- package/presentation/FileActions/FileDetails/EditImage.js +39 -0
- package/presentation/FileActions/FileDetails/EditImage.js.map +1 -0
- package/presentation/FileActions/index.js +4 -0
- package/presentation/FileActions/index.js.map +1 -1
- package/presentation/FileDetails/FileDetailsPresenter.d.ts +2 -0
- package/presentation/FileDetails/FileDetailsPresenter.js +5 -0
- package/presentation/FileDetails/FileDetailsPresenter.js.map +1 -1
- package/presentation/FileDetails/FileDetailsPresenter.test.js +1 -0
- package/presentation/FileDetails/FileDetailsPresenter.test.js.map +1 -1
- package/presentation/FileDetails/abstractions.d.ts +2 -0
- package/presentation/FileDetails/abstractions.js.map +1 -1
- package/presentation/FileDetails/components/Content.d.ts +5 -4
- package/presentation/FileDetails/components/FileDetailsDrawer.d.ts +2 -2
- package/presentation/FileList/FileListDataSource.d.ts +8 -12
- package/presentation/FileList/FileListDataSource.js +47 -87
- package/presentation/FileList/FileListDataSource.js.map +1 -1
- package/presentation/FileList/FileListPresenter.test.js +9 -3
- package/presentation/FileList/FileListPresenter.test.js.map +1 -1
- package/presentation/FileList/FileManagerPresenter.d.ts +1 -0
- package/presentation/FileList/FileManagerPresenter.js +15 -5
- package/presentation/FileList/FileManagerPresenter.js.map +1 -1
- package/presentation/FileList/abstractions.d.ts +3 -0
- package/presentation/FileList/abstractions.js.map +1 -1
- package/presentation/FileList/components/BulkActions/BulkActionBar.d.ts +2 -2
- package/presentation/FileList/components/BulkActions/BulkActionDelete.d.ts +2 -2
- package/presentation/FileList/components/BulkActions/BulkActionMove.d.ts +2 -2
- 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/Filters/SubFoldersToggle.d.ts +2 -2
- package/presentation/FileList/components/Filters/TagsFilter.d.ts +2 -2
- package/presentation/FileList/components/Filters/TypeFilter.d.ts +2 -2
- package/presentation/FileList/components/Grid/FileGrid.d.ts +2 -2
- 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/Header/FileManagerHeader.d.ts +2 -2
- package/presentation/FileList/components/Search/SearchBar.d.ts +2 -2
- package/presentation/FileList/components/Table/FileTable.d.ts +2 -2
- 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/FileList/components/Upload/UploadProgress.d.ts +2 -2
- package/presentation/FileManager/FileManagerView.js +4 -2
- 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/Settings/components/SettingsView.d.ts +2 -2
- 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/config/getThumbnailRenderer.js +1 -1
- package/presentation/config/getThumbnailRenderer.js.map +1 -1
- package/presentation/config/thumbnailRenderers/CroppedFileImage.d.ts +18 -0
- package/presentation/config/thumbnailRenderers/CroppedFileImage.js +66 -0
- package/presentation/config/thumbnailRenderers/CroppedFileImage.js.map +1 -0
- package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js +6 -9
- package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js.map +1 -1
- package/presentation/config/thumbnailRenderers/GridItemImageRenderer.js +6 -9
- package/presentation/config/thumbnailRenderers/GridItemImageRenderer.js.map +1 -1
- package/presentation/config/thumbnailRenderers/TableItemImageRenderer.js +6 -9
- package/presentation/config/thumbnailRenderers/TableItemImageRenderer.js.map +1 -1
- package/presentation/fieldRenderers/CmsAssetPickerRenderer.d.ts +22 -0
- package/presentation/fieldRenderers/CmsAssetPickerRenderer.js +56 -0
- package/presentation/fieldRenderers/CmsAssetPickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.d.ts +13 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.js +36 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsImageEditorDialog.d.ts +7 -0
- package/presentation/fieldRenderers/CmsImageEditorDialog.js +32 -0
- package/presentation/fieldRenderers/CmsImageEditorDialog.js.map +1 -0
- package/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.d.ts +18 -0
- package/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.js +88 -0
- package/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.d.ts +13 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js +60 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CroppedAssetThumb.d.ts +15 -0
- package/presentation/fieldRenderers/CroppedAssetThumb.js +25 -0
- package/presentation/fieldRenderers/CroppedAssetThumb.js.map +1 -0
- package/presentation/fieldRenderers/assetValue.d.ts +10 -0
- package/presentation/fieldRenderers/assetValue.js +88 -0
- package/presentation/fieldRenderers/assetValue.js.map +1 -0
- package/presentation/hooks/useCmsImageEditor.d.ts +10 -0
- package/presentation/hooks/useCmsImageEditor.js +76 -0
- package/presentation/hooks/useCmsImageEditor.js.map +1 -0
- package/presentation/hooks/useEditImage.d.ts +14 -0
- package/presentation/hooks/useEditImage.js +67 -0
- package/presentation/hooks/useEditImage.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,11 @@ 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";
|
|
28
|
+
import { CmsAssetPickerRenderer } from "./presentation/fieldRenderers/CmsAssetPickerRenderer.js";
|
|
29
|
+
import { CmsMultiAssetPickerRenderer } from "./presentation/fieldRenderers/CmsMultiAssetPickerRenderer.js";
|
|
25
30
|
const FileManager = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
26
31
|
feature: FileModelProviderFeature
|
|
27
32
|
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
@@ -51,7 +56,21 @@ const FileManager = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null,
|
|
|
51
56
|
}), /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
52
57
|
name: "folderTree",
|
|
53
58
|
component: FolderTreeFieldRenderer
|
|
54
|
-
})
|
|
59
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
60
|
+
name: "cmsFilePicker",
|
|
61
|
+
component: CmsFilePickerRenderer
|
|
62
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
63
|
+
name: "cmsMultiFilePicker",
|
|
64
|
+
component: CmsMultiFilePickerRenderer
|
|
65
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
66
|
+
name: "cmsAssetPicker",
|
|
67
|
+
component: CmsAssetPickerRenderer
|
|
68
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
|
69
|
+
name: "cmsMultiAssetPicker",
|
|
70
|
+
component: CmsMultiAssetPickerRenderer
|
|
71
|
+
})), /*#__PURE__*/ react.createElement(FileManagerRoutes, null), /*#__PURE__*/ react.createElement(SettingsModule, null), /*#__PURE__*/ react.createElement(FileManagerRendererDecorator, null), /*#__PURE__*/ react.createElement(DefaultFileManagerConfig, null), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
72
|
+
feature: FileFieldTypeFeature
|
|
73
|
+
}), /*#__PURE__*/ react.createElement(EnterpriseModule, null), /*#__PURE__*/ react.createElement(AiEnrichmentModule, null), /*#__PURE__*/ react.createElement(SecurityPermissions, null), /*#__PURE__*/ react.createElement(FileUrlFormatterModule, null));
|
|
55
74
|
export { FileManager };
|
|
56
75
|
|
|
57
76
|
//# 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\";\nimport { CmsAssetPickerRenderer } from \"~/presentation/fieldRenderers/CmsAssetPickerRenderer.js\";\nimport { CmsMultiAssetPickerRenderer } from \"~/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.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.Form.FieldRenderer\n name={\"cmsAssetPicker\"}\n component={CmsAssetPickerRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsMultiAssetPicker\"}\n component={CmsMultiAssetPickerRenderer}\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","CmsAssetPickerRenderer","CmsMultiAssetPickerRenderer","FileManagerRoutes","SettingsModule","FileManagerRendererDecorator","DefaultFileManagerConfig","FileFieldTypeFeature","EnterpriseModule","AiEnrichmentModule","SecurityPermissions","FileUrlFormatterModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,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;sBAEf,oBAACH,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWI;sBAEf,oBAACJ,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWK;uBAInB,oBAACC,mBAAiBA,OAAAA,WAAAA,GAClB,oBAACC,gBAAcA,OAAAA,WAAAA,GACf,oBAACC,8BAA4BA,OAAAA,WAAAA,GAC7B,oBAACC,0BAAwBA,OAAAA,WAAAA,GACzB,oBAACvB,iBAAeA;QAAC,SAASwB;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
1
|
export declare const FmPermissionsFeature: import("@webiny/feature/admin").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;
|
|
@@ -24,6 +24,10 @@ const FILE_FIELDS = [
|
|
|
24
24
|
"metadata.image.height",
|
|
25
25
|
"metadata.image.format",
|
|
26
26
|
"metadata.image.orientation",
|
|
27
|
+
"metadata.image.crop",
|
|
28
|
+
"metadata.image.focalPoint",
|
|
29
|
+
"metadata.image.alt",
|
|
30
|
+
"metadata.image.caption",
|
|
27
31
|
"metadata.exif",
|
|
28
32
|
"metadata.iptc"
|
|
29
33
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/shared/FILE_FIELDS.js","sources":["../../../src/features/shared/FILE_FIELDS.ts"],"sourcesContent":["export const FILE_FIELDS = [\n \"id\",\n \"name\",\n \"description\",\n \"key\",\n \"src\",\n \"type\",\n \"size\",\n \"tags\",\n \"createdOn\",\n \"savedOn\",\n \"modifiedOn\",\n \"createdBy.id\",\n \"createdBy.displayName\",\n \"createdBy.type\",\n \"savedBy.id\",\n \"savedBy.displayName\",\n \"savedBy.type\",\n \"modifiedBy.id\",\n \"modifiedBy.displayName\",\n \"modifiedBy.type\",\n \"location.folderId\",\n \"metadata.image.width\",\n \"metadata.image.height\",\n \"metadata.image.format\",\n \"metadata.image.orientation\",\n \"metadata.exif\",\n \"metadata.iptc\"\n];\n"],"names":["FILE_FIELDS"],"mappings":"AAAO,MAAMA,cAAc;IACvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH"}
|
|
1
|
+
{"version":3,"file":"features/shared/FILE_FIELDS.js","sources":["../../../src/features/shared/FILE_FIELDS.ts"],"sourcesContent":["export const FILE_FIELDS = [\n \"id\",\n \"name\",\n \"description\",\n \"key\",\n \"src\",\n \"type\",\n \"size\",\n \"tags\",\n \"createdOn\",\n \"savedOn\",\n \"modifiedOn\",\n \"createdBy.id\",\n \"createdBy.displayName\",\n \"createdBy.type\",\n \"savedBy.id\",\n \"savedBy.displayName\",\n \"savedBy.type\",\n \"modifiedBy.id\",\n \"modifiedBy.displayName\",\n \"modifiedBy.type\",\n \"location.folderId\",\n \"metadata.image.width\",\n \"metadata.image.height\",\n \"metadata.image.format\",\n \"metadata.image.orientation\",\n \"metadata.image.crop\",\n \"metadata.image.focalPoint\",\n \"metadata.image.alt\",\n \"metadata.image.caption\",\n \"metadata.exif\",\n \"metadata.iptc\"\n];\n"],"names":["FILE_FIELDS"],"mappings":"AAAO,MAAMA,cAAc;IACvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH"}
|
|
@@ -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;
|
|
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 const { id, tags, description } = event.payload as unknown as FileEnrichmentData;\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;QAGJ,MAAM,EAAEK,EAAE,EAAEC,IAAI,EAAEC,WAAW,EAAE,GAAGH,MAAM,OAAO;QAE/C,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,26 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Adds Asset-specific options to the field settings form in the content-model
|
|
6
|
+
* editor: an "Images only" toggle (parity with the File field) and an optional
|
|
7
|
+
* "Accepted file types" list. Both are honored by the asset picker renderers
|
|
8
|
+
* (`settings.imagesOnly` / `settings.accept`).
|
|
9
|
+
*
|
|
10
|
+
* Applies to the Asset field, which the editor resolves to the `"asset"` field
|
|
11
|
+
* type via `matches()` even though it is stored as an `object`.
|
|
12
|
+
*/
|
|
13
|
+
declare class AssetFieldSettingsModifierImpl implements CmsFieldEditorGroupModifier.Interface {
|
|
14
|
+
group: string;
|
|
15
|
+
shouldApply(context: ICmsFieldEditorContext): boolean;
|
|
16
|
+
modifyForm(form: ICmsFieldEditorFormBuilder): void;
|
|
17
|
+
mapToForm(field: CmsModelField): {
|
|
18
|
+
imagesOnly: boolean;
|
|
19
|
+
accept: any;
|
|
20
|
+
};
|
|
21
|
+
mapFromForm(formData: Record<string, any>, field: CmsModelField): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const AssetFieldSettingsModifier: typeof AssetFieldSettingsModifierImpl & {
|
|
24
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js").ICmsFieldEditorGroupModifier>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CmsFieldEditorGroupModifier } from "@webiny/app-headless-cms/presentation/fieldEditor/abstractions.js";
|
|
2
|
+
class AssetFieldSettingsModifierImpl {
|
|
3
|
+
shouldApply(context) {
|
|
4
|
+
return "asset" === 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
|
+
accept: fields.text().list().label("Accepted file types").description("MIME types or extensions to allow (e.g. image/png, application/pdf). Leave empty to allow all.").renderer("tags").defaultValue([])
|
|
10
|
+
}));
|
|
11
|
+
form.layout((layout)=>[
|
|
12
|
+
layout.row("imagesOnly"),
|
|
13
|
+
layout.row("accept")
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
mapToForm(field) {
|
|
17
|
+
return {
|
|
18
|
+
imagesOnly: field.settings?.imagesOnly ?? false,
|
|
19
|
+
accept: field.settings?.accept ?? []
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
mapFromForm(formData, field) {
|
|
23
|
+
if (!field.settings) field.settings = {};
|
|
24
|
+
field.settings.imagesOnly = formData.imagesOnly;
|
|
25
|
+
const accept = Array.isArray(formData.accept) ? formData.accept.filter((t)=>"string" == typeof t && t.trim().length > 0) : [];
|
|
26
|
+
if (accept.length > 0) field.settings.accept = accept;
|
|
27
|
+
else delete field.settings.accept;
|
|
28
|
+
}
|
|
29
|
+
constructor(){
|
|
30
|
+
this.group = "general";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const AssetFieldSettingsModifier = CmsFieldEditorGroupModifier.createImplementation({
|
|
34
|
+
implementation: AssetFieldSettingsModifierImpl,
|
|
35
|
+
dependencies: []
|
|
36
|
+
});
|
|
37
|
+
export { AssetFieldSettingsModifier };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=AssetFieldSettingsModifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.js","sources":["../../../../src/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.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\n/**\n * Adds Asset-specific options to the field settings form in the content-model\n * editor: an \"Images only\" toggle (parity with the File field) and an optional\n * \"Accepted file types\" list. Both are honored by the asset picker renderers\n * (`settings.imagesOnly` / `settings.accept`).\n *\n * Applies to the Asset field, which the editor resolves to the `\"asset\"` field\n * type via `matches()` even though it is stored as an `object`.\n */\nclass AssetFieldSettingsModifierImpl implements CmsFieldEditorGroupModifier.Interface {\n group = \"general\";\n\n shouldApply(context: ICmsFieldEditorContext) {\n return context.fieldType.type === \"asset\";\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 accept: fields\n .text()\n .list()\n .label(\"Accepted file types\")\n .description(\n \"MIME types or extensions to allow (e.g. image/png, application/pdf). Leave empty to allow all.\"\n )\n .renderer(\"tags\")\n .defaultValue([])\n }));\n form.layout(layout => [layout.row(\"imagesOnly\"), layout.row(\"accept\")]);\n }\n\n mapToForm(field: CmsModelField) {\n return {\n imagesOnly: field.settings?.imagesOnly ?? false,\n accept: field.settings?.accept ?? []\n };\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 const accept = Array.isArray(formData.accept)\n ? formData.accept.filter((t: unknown) => typeof t === \"string\" && t.trim().length > 0)\n : [];\n if (accept.length > 0) {\n field.settings.accept = accept;\n } else {\n delete field.settings.accept;\n }\n }\n}\n\nexport const AssetFieldSettingsModifier = CmsFieldEditorGroupModifier.createImplementation({\n implementation: AssetFieldSettingsModifierImpl,\n dependencies: []\n});\n"],"names":["AssetFieldSettingsModifierImpl","context","form","fields","layout","field","formData","accept","Array","t","AssetFieldSettingsModifier","CmsFieldEditorGroupModifier"],"mappings":";AAgBA,MAAMA;IAGF,YAAYC,OAA+B,EAAE;QACzC,OAAOA,AAA2B,YAA3BA,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;gBAClB,QAAQA,OACH,IAAI,GACJ,IAAI,GACJ,KAAK,CAAC,uBACN,WAAW,CACR,kGAEH,QAAQ,CAAC,QACT,YAAY,CAAC,EAAE;YACxB;QACAD,KAAK,MAAM,CAACE,CAAAA,SAAU;gBAACA,OAAO,GAAG,CAAC;gBAAeA,OAAO,GAAG,CAAC;aAAU;IAC1E;IAEA,UAAUC,KAAoB,EAAE;QAC5B,OAAO;YACH,YAAYA,MAAM,QAAQ,EAAE,cAAc;YAC1C,QAAQA,MAAM,QAAQ,EAAE,UAAU,EAAE;QACxC;IACJ;IAEA,YAAYC,QAA6B,EAAED,KAAoB,EAAE;QAC7D,IAAI,CAACA,MAAM,QAAQ,EACfA,MAAM,QAAQ,GAAG,CAAC;QAEtBA,MAAM,QAAQ,CAAC,UAAU,GAAGC,SAAS,UAAU;QAC/C,MAAMC,SAASC,MAAM,OAAO,CAACF,SAAS,MAAM,IACtCA,SAAS,MAAM,CAAC,MAAM,CAAC,CAACG,IAAe,AAAa,YAAb,OAAOA,KAAkBA,EAAE,IAAI,GAAG,MAAM,GAAG,KAClF,EAAE;QACR,IAAIF,OAAO,MAAM,GAAG,GAChBF,MAAM,QAAQ,CAAC,MAAM,GAAGE;aAExB,OAAOF,MAAM,QAAQ,CAAC,MAAM;IAEpC;;aA/CA,KAAK,GAAG;;AAgDZ;AAEO,MAAMK,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBX;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CmsFieldType } from "@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js";
|
|
3
|
+
import type { CmsModelField } from "@webiny/app-headless-cms-common/types/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Palette entry for the Asset field. It is stored as an `object` field (so it reuses
|
|
6
|
+
* the object GraphQL/storage machinery); `createField()` therefore emits `type:
|
|
7
|
+
* "object"` with the asset renderer, and the API normalizer stamps the canonical
|
|
8
|
+
* nested schema on save. `matches()` lets the field editor resolve this descriptor
|
|
9
|
+
* for an asset field even though its stored type is `object`.
|
|
10
|
+
*/
|
|
11
|
+
declare class AssetFieldTypeImpl implements CmsFieldType.Interface {
|
|
12
|
+
type: string;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
icon: React.JSX.Element;
|
|
16
|
+
allowList: boolean;
|
|
17
|
+
listLabel: string;
|
|
18
|
+
allowPredefinedValues: boolean;
|
|
19
|
+
validators: string[];
|
|
20
|
+
listValidators: string[];
|
|
21
|
+
matches(field: CmsModelField): boolean;
|
|
22
|
+
createField(): {
|
|
23
|
+
type: string;
|
|
24
|
+
validation: never[];
|
|
25
|
+
renderer: {
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
settings: {};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export declare const AssetFieldType: typeof AssetFieldTypeImpl & {
|
|
32
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js").ICmsFieldType>;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { ReactComponent } from "@webiny/icons/collections.svg";
|
|
3
|
+
import { CmsFieldType } from "@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js";
|
|
4
|
+
import { isAssetField } from "./isAssetField.js";
|
|
5
|
+
class AssetFieldTypeImpl {
|
|
6
|
+
matches(field) {
|
|
7
|
+
return isAssetField(field);
|
|
8
|
+
}
|
|
9
|
+
createField() {
|
|
10
|
+
return {
|
|
11
|
+
type: "asset",
|
|
12
|
+
validation: [],
|
|
13
|
+
renderer: {
|
|
14
|
+
name: "asset-input"
|
|
15
|
+
},
|
|
16
|
+
settings: {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
constructor(){
|
|
20
|
+
this.type = "asset";
|
|
21
|
+
this.label = "Asset";
|
|
22
|
+
this.description = "Images, videos, and documents — with per-usage cropping and focal point.";
|
|
23
|
+
this.icon = /*#__PURE__*/ react.createElement(ReactComponent, null);
|
|
24
|
+
this.allowList = true;
|
|
25
|
+
this.listLabel = "Use as a list of assets or a gallery";
|
|
26
|
+
this.allowPredefinedValues = false;
|
|
27
|
+
this.validators = [
|
|
28
|
+
"required"
|
|
29
|
+
];
|
|
30
|
+
this.listValidators = [
|
|
31
|
+
"minLength",
|
|
32
|
+
"maxLength"
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const AssetFieldType = CmsFieldType.createImplementation({
|
|
37
|
+
implementation: AssetFieldTypeImpl,
|
|
38
|
+
dependencies: []
|
|
39
|
+
});
|
|
40
|
+
export { AssetFieldType };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=AssetFieldType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/AssetFieldType.js","sources":["../../../../src/modules/HeadlessCms/fieldType/AssetFieldType.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as AssetIcon } from \"@webiny/icons/collections.svg\";\nimport { CmsFieldType } from \"@webiny/app-headless-cms/presentation/fieldTypes/abstractions.js\";\nimport type { CmsModelField } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport { isAssetField } from \"./isAssetField.js\";\n\n/**\n * Palette entry for the Asset field. It is stored as an `object` field (so it reuses\n * the object GraphQL/storage machinery); `createField()` therefore emits `type:\n * \"object\"` with the asset renderer, and the API normalizer stamps the canonical\n * nested schema on save. `matches()` lets the field editor resolve this descriptor\n * for an asset field even though its stored type is `object`.\n */\nclass AssetFieldTypeImpl implements CmsFieldType.Interface {\n type = \"asset\";\n label = \"Asset\";\n description = \"Images, videos, and documents — with per-usage cropping and focal point.\";\n icon = <AssetIcon />;\n allowList = true;\n listLabel = \"Use as a list of assets or a gallery\";\n allowPredefinedValues = false;\n validators = [\"required\"];\n listValidators = [\"minLength\", \"maxLength\"];\n\n matches(field: CmsModelField) {\n return isAssetField(field);\n }\n\n createField() {\n return {\n type: \"asset\",\n validation: [],\n renderer: { name: \"asset-input\" },\n settings: {}\n };\n }\n}\n\nexport const AssetFieldType = CmsFieldType.createImplementation({\n implementation: AssetFieldTypeImpl,\n dependencies: []\n});\n"],"names":["AssetFieldTypeImpl","field","isAssetField","AssetIcon","AssetFieldType","CmsFieldType"],"mappings":";;;;AAaA,MAAMA;IAWF,QAAQC,KAAoB,EAAE;QAC1B,OAAOC,aAAaD;IACxB;IAEA,cAAc;QACV,OAAO;YACH,MAAM;YACN,YAAY,EAAE;YACd,UAAU;gBAAE,MAAM;YAAc;YAChC,UAAU,CAAC;QACf;IACJ;;aArBA,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAAG;aACd,IAAI,GAAG,WAAP,GAAO,oBAACE,gBAASA;aACjB,SAAS,GAAG;aACZ,SAAS,GAAG;aACZ,qBAAqB,GAAG;aACxB,UAAU,GAAG;YAAC;SAAW;aACzB,cAAc,GAAG;YAAC;YAAa;SAAY;;AAc/C;AAEO,MAAMC,iBAAiBC,aAAa,oBAAoB,CAAC;IAC5D,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type IFieldTypeFactory } from "@webiny/app-admin/features/formModel/abstractions.js";
|
|
2
|
+
import { FieldBuilder } from "@webiny/app-admin/features/formModel/FieldBuilder.js";
|
|
3
|
+
export declare class AssetFieldBuilder extends FieldBuilder<"asset"> {
|
|
4
|
+
constructor();
|
|
5
|
+
list(): this;
|
|
6
|
+
imagesOnly(): this;
|
|
7
|
+
accept(mimeTypes: string[]): this;
|
|
8
|
+
}
|
|
9
|
+
declare class AssetFieldTypeFactory implements IFieldTypeFactory {
|
|
10
|
+
readonly type = "asset";
|
|
11
|
+
create(): AssetFieldBuilder;
|
|
12
|
+
}
|
|
13
|
+
export declare const AssetFormFieldType: typeof AssetFieldTypeFactory & {
|
|
14
|
+
__abstraction: import("@webiny/di").Abstraction<IFieldTypeFactory>;
|
|
15
|
+
};
|
|
16
|
+
declare module "@webiny/app-admin/features/formModel/abstractions.js" {
|
|
17
|
+
interface IFieldBuilderRegistry {
|
|
18
|
+
asset(): AssetFieldBuilder;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FieldType } from "@webiny/app-admin/features/formModel/abstractions.js";
|
|
2
|
+
import { FieldBuilder } from "@webiny/app-admin/features/formModel/FieldBuilder.js";
|
|
3
|
+
class AssetFieldBuilder extends FieldBuilder {
|
|
4
|
+
constructor(){
|
|
5
|
+
super("asset");
|
|
6
|
+
this._config.renderer = "cmsAssetPicker";
|
|
7
|
+
}
|
|
8
|
+
list() {
|
|
9
|
+
super.list();
|
|
10
|
+
if ("cmsAssetPicker" === this._config.renderer) this._config.renderer = "cmsMultiAssetPicker";
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
imagesOnly() {
|
|
14
|
+
this._config.rendererSettings = {
|
|
15
|
+
...this._config.rendererSettings,
|
|
16
|
+
imagesOnly: true
|
|
17
|
+
};
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
accept(mimeTypes) {
|
|
21
|
+
this._config.rendererSettings = {
|
|
22
|
+
...this._config.rendererSettings,
|
|
23
|
+
accept: mimeTypes
|
|
24
|
+
};
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class AssetFieldTypeFactory {
|
|
29
|
+
create() {
|
|
30
|
+
return new AssetFieldBuilder();
|
|
31
|
+
}
|
|
32
|
+
constructor(){
|
|
33
|
+
this.type = "asset";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const AssetFormFieldType = FieldType.createImplementation({
|
|
37
|
+
implementation: AssetFieldTypeFactory,
|
|
38
|
+
dependencies: []
|
|
39
|
+
});
|
|
40
|
+
export { AssetFieldBuilder, AssetFormFieldType };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=AssetFormFieldType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/AssetFormFieldType.js","sources":["../../../../src/modules/HeadlessCms/fieldType/AssetFormFieldType.ts"],"sourcesContent":["import {\n FieldType,\n type IFieldTypeFactory\n} from \"@webiny/app-admin/features/formModel/abstractions.js\";\nimport { FieldBuilder } from \"@webiny/app-admin/features/formModel/FieldBuilder.js\";\n\nexport class AssetFieldBuilder extends FieldBuilder<\"asset\"> {\n constructor() {\n super(\"asset\");\n this._config.renderer = \"cmsAssetPicker\";\n }\n\n override list(): this {\n super.list();\n if (this._config.renderer === \"cmsAssetPicker\") {\n this._config.renderer = \"cmsMultiAssetPicker\";\n }\n return this;\n }\n\n imagesOnly(): this {\n this._config.rendererSettings = { ...this._config.rendererSettings, imagesOnly: true };\n return this;\n }\n\n accept(mimeTypes: string[]): this {\n this._config.rendererSettings = { ...this._config.rendererSettings, accept: mimeTypes };\n return this;\n }\n}\n\nclass AssetFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"asset\";\n create() {\n return new AssetFieldBuilder();\n }\n}\n\nexport const AssetFormFieldType = FieldType.createImplementation({\n implementation: AssetFieldTypeFactory,\n dependencies: []\n});\n\ndeclare module \"@webiny/app-admin/features/formModel/abstractions.js\" {\n interface IFieldBuilderRegistry {\n asset(): AssetFieldBuilder;\n }\n}\n"],"names":["AssetFieldBuilder","FieldBuilder","mimeTypes","AssetFieldTypeFactory","AssetFormFieldType","FieldType"],"mappings":";;AAMO,MAAMA,0BAA0BC;IACnC,aAAc;QACV,KAAK,CAAC;QACN,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG;IAC5B;IAES,OAAa;QAClB,KAAK,CAAC;QACN,IAAI,AAA0B,qBAA1B,IAAI,CAAC,OAAO,CAAC,QAAQ,EACrB,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG;QAE5B,OAAO,IAAI;IACf;IAEA,aAAmB;QACf,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG;YAAE,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB;YAAE,YAAY;QAAK;QACrF,OAAO,IAAI;IACf;IAEA,OAAOC,SAAmB,EAAQ;QAC9B,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG;YAAE,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB;YAAE,QAAQA;QAAU;QACtF,OAAO,IAAI;IACf;AACJ;AAEA,MAAMC;IAEF,SAAS;QACL,OAAO,IAAIH;IACf;;aAHS,IAAI,GAAG;;AAIpB;AAEO,MAAMI,qBAAqBC,UAAU,oBAAoB,CAAC;IAC7D,gBAAgBF;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 AssetInputRendererImpl 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 AssetInputRenderer: typeof AssetInputRendererImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js").ICmsFieldRenderer>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CmsFieldRenderer } from "@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js";
|
|
2
|
+
import { isAssetField } from "./isAssetField.js";
|
|
3
|
+
class AssetInputRendererImpl {
|
|
4
|
+
canUse({ field }) {
|
|
5
|
+
return isAssetField(field) && !field.list;
|
|
6
|
+
}
|
|
7
|
+
constructor(){
|
|
8
|
+
this.rendererName = "asset-input";
|
|
9
|
+
this.formRenderer = "cmsAssetPicker";
|
|
10
|
+
this.name = "Asset Input";
|
|
11
|
+
this.description = "Enables selecting a single asset (image, document, or video) via File Manager.";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const AssetInputRenderer = CmsFieldRenderer.createImplementation({
|
|
15
|
+
implementation: AssetInputRendererImpl,
|
|
16
|
+
dependencies: []
|
|
17
|
+
});
|
|
18
|
+
export { AssetInputRenderer };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=AssetInputRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/AssetInputRenderer.js","sources":["../../../../src/modules/HeadlessCms/fieldType/AssetInputRenderer.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\";\nimport { isAssetField } from \"./isAssetField.js\";\n\nclass AssetInputRendererImpl implements CmsFieldRenderer.Interface {\n rendererName = \"asset-input\";\n formRenderer = \"cmsAssetPicker\";\n name = \"Asset Input\";\n description = \"Enables selecting a single asset (image, document, or video) via File Manager.\";\n\n canUse({ field }: { field: CmsModelField }) {\n return isAssetField(field) && !field.list;\n }\n}\n\nexport const AssetInputRenderer = CmsFieldRenderer.createImplementation({\n implementation: AssetInputRendererImpl,\n dependencies: []\n});\n"],"names":["AssetInputRendererImpl","field","isAssetField","AssetInputRenderer","CmsFieldRenderer"],"mappings":";;AAIA,MAAMA;IAMF,OAAO,EAAEC,KAAK,EAA4B,EAAE;QACxC,OAAOC,aAAaD,UAAU,CAACA,MAAM,IAAI;IAC7C;;aAPA,YAAY,GAAG;aACf,YAAY,GAAG;aACf,IAAI,GAAG;aACP,WAAW,GAAG;;AAKlB;AAEO,MAAME,qBAAqBC,iBAAiB,oBAAoB,CAAC;IACpE,gBAAgBJ;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 AssetInputsRendererImpl 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 AssetInputsRenderer: typeof AssetInputsRendererImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js").ICmsFieldRenderer>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CmsFieldRenderer } from "@webiny/app-headless-cms/presentation/fieldRenderers/abstractions.js";
|
|
2
|
+
import { isAssetField } from "./isAssetField.js";
|
|
3
|
+
class AssetInputsRendererImpl {
|
|
4
|
+
canUse({ field }) {
|
|
5
|
+
return isAssetField(field) && !!field.list;
|
|
6
|
+
}
|
|
7
|
+
constructor(){
|
|
8
|
+
this.rendererName = "asset-inputs";
|
|
9
|
+
this.formRenderer = "cmsMultiAssetPicker";
|
|
10
|
+
this.name = "Asset Inputs";
|
|
11
|
+
this.description = "Enables selecting multiple assets via File Manager.";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const AssetInputsRenderer = CmsFieldRenderer.createImplementation({
|
|
15
|
+
implementation: AssetInputsRendererImpl,
|
|
16
|
+
dependencies: []
|
|
17
|
+
});
|
|
18
|
+
export { AssetInputsRenderer };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=AssetInputsRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules/HeadlessCms/fieldType/AssetInputsRenderer.js","sources":["../../../../src/modules/HeadlessCms/fieldType/AssetInputsRenderer.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\";\nimport { isAssetField } from \"./isAssetField.js\";\n\nclass AssetInputsRendererImpl implements CmsFieldRenderer.Interface {\n rendererName = \"asset-inputs\";\n formRenderer = \"cmsMultiAssetPicker\";\n name = \"Asset Inputs\";\n description = \"Enables selecting multiple assets via File Manager.\";\n\n canUse({ field }: { field: CmsModelField }) {\n return isAssetField(field) && !!field.list;\n }\n}\n\nexport const AssetInputsRenderer = CmsFieldRenderer.createImplementation({\n implementation: AssetInputsRendererImpl,\n dependencies: []\n});\n"],"names":["AssetInputsRendererImpl","field","isAssetField","AssetInputsRenderer","CmsFieldRenderer"],"mappings":";;AAIA,MAAMA;IAMF,OAAO,EAAEC,KAAK,EAA4B,EAAE;QACxC,OAAOC,aAAaD,UAAU,CAAC,CAACA,MAAM,IAAI;IAC9C;;aAPA,YAAY,GAAG;aACf,YAAY,GAAG;aACf,IAAI,GAAG;aACP,WAAW,GAAG;;AAKlB;AAEO,MAAME,sBAAsBC,iBAAiB,oBAAoB,CAAC;IACrE,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -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 {};
|