@webiny/app-file-manager 6.4.5-beta.0 → 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./BatchEditorDialog.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./BatchEditorDialog.js";
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import react, { useCallback, useEffect, useMemo } from "react";
|
|
2
|
-
import { observer } from "mobx-react-lite";
|
|
3
|
-
import { ReactComponent } from "@webiny/icons/edit.svg";
|
|
4
|
-
import { Tooltip } from "@webiny/admin-ui";
|
|
5
|
-
import { useFeature } from "@webiny/app";
|
|
6
|
-
import omit from "lodash/omit.js";
|
|
7
|
-
import { prepareFormData } from "@webiny/app-headless-cms-common";
|
|
8
|
-
import { BulkAction, getFilesLabel } from "./useBulkActionWorker.js";
|
|
9
|
-
import { useFileManagerPresenter } from "../../FileManagerPresenterProvider.js";
|
|
10
|
-
import { UpdateFileFeature } from "../../../../features/updateFile/feature.js";
|
|
11
|
-
import { ActionEditPresenter } from "./ActionEditPresenter.js";
|
|
12
|
-
import { BatchEditorDialog } from "./BatchEditorDialog/BatchEditorDialog.js";
|
|
13
|
-
import { GraphQLInputMapper } from "./GraphQLInputMapper.js";
|
|
14
|
-
const { useButtons: useButtons } = BulkAction;
|
|
15
|
-
const BulkActionEdit_BulkActionEdit = observer(function() {
|
|
16
|
-
const { ButtonDefault } = useButtons();
|
|
17
|
-
const { vm } = useFileManagerPresenter();
|
|
18
|
-
const { useCase: updateFileUseCase } = useFeature(UpdateFileFeature);
|
|
19
|
-
const { useWorker, useDialog } = BulkAction;
|
|
20
|
-
const worker = useWorker();
|
|
21
|
-
const { showConfirmationDialog, showResultsDialog } = useDialog();
|
|
22
|
-
const fields = vm.fileModel?.fields ?? [];
|
|
23
|
-
const presenter = useMemo(()=>new ActionEditPresenter(), []);
|
|
24
|
-
useEffect(()=>{
|
|
25
|
-
presenter.load(fields);
|
|
26
|
-
}, [
|
|
27
|
-
fields
|
|
28
|
-
]);
|
|
29
|
-
const filesLabel = useMemo(()=>getFilesLabel(worker.items.length), [
|
|
30
|
-
worker.items.length
|
|
31
|
-
]);
|
|
32
|
-
const openWorkerDialog = useCallback((batch, modelFields)=>{
|
|
33
|
-
showConfirmationDialog({
|
|
34
|
-
title: "Edit files",
|
|
35
|
-
message: `You are about to edit ${filesLabel}. Are you sure you want to continue?`,
|
|
36
|
-
loadingLabel: `Processing ${filesLabel}`,
|
|
37
|
-
execute: async ()=>{
|
|
38
|
-
await worker.processInSeries(async ({ item, report })=>{
|
|
39
|
-
try {
|
|
40
|
-
const modifiedFileData = GraphQLInputMapper.applyOperations(item, batch);
|
|
41
|
-
const output = omit(modifiedFileData, [
|
|
42
|
-
"id",
|
|
43
|
-
"createdBy",
|
|
44
|
-
"createdOn",
|
|
45
|
-
"src"
|
|
46
|
-
]);
|
|
47
|
-
const fileData = prepareFormData(output, modelFields);
|
|
48
|
-
const result = await updateFileUseCase.execute({
|
|
49
|
-
id: item.id,
|
|
50
|
-
data: fileData
|
|
51
|
-
});
|
|
52
|
-
if (!result.success) return void report.error({
|
|
53
|
-
title: `${item.name}`,
|
|
54
|
-
message: result.error.message
|
|
55
|
-
});
|
|
56
|
-
report.success({
|
|
57
|
-
title: `${item.name}`,
|
|
58
|
-
message: "File successfully edited."
|
|
59
|
-
});
|
|
60
|
-
} catch (e) {
|
|
61
|
-
report.error({
|
|
62
|
-
title: `${item.name}`,
|
|
63
|
-
message: e.message
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
worker.resetItems();
|
|
68
|
-
showResultsDialog({
|
|
69
|
-
results: worker.results,
|
|
70
|
-
title: "Edit files",
|
|
71
|
-
message: "Finished editing files! See full report below:"
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}, [
|
|
76
|
-
filesLabel
|
|
77
|
-
]);
|
|
78
|
-
const onBatchEditorSubmit = useCallback((batch)=>{
|
|
79
|
-
presenter.closeEditor();
|
|
80
|
-
openWorkerDialog(batch, fields);
|
|
81
|
-
}, [
|
|
82
|
-
openWorkerDialog,
|
|
83
|
-
fields
|
|
84
|
-
]);
|
|
85
|
-
if (!presenter.vm.show) return null;
|
|
86
|
-
if (!vm.permissions.canEdit) return null;
|
|
87
|
-
return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Tooltip, {
|
|
88
|
-
side: "bottom",
|
|
89
|
-
content: `Edit ${filesLabel}`,
|
|
90
|
-
trigger: /*#__PURE__*/ react.createElement(ButtonDefault, {
|
|
91
|
-
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
92
|
-
onAction: ()=>presenter.openEditor(),
|
|
93
|
-
size: "sm"
|
|
94
|
-
}, "Edit")
|
|
95
|
-
}), /*#__PURE__*/ react.createElement(BatchEditorDialog, {
|
|
96
|
-
onClose: ()=>presenter.closeEditor(),
|
|
97
|
-
fields: presenter.vm.fields,
|
|
98
|
-
batch: presenter.vm.currentBatch,
|
|
99
|
-
vm: presenter.vm.editorVm,
|
|
100
|
-
onApply: onBatchEditorSubmit
|
|
101
|
-
}));
|
|
102
|
-
});
|
|
103
|
-
export { BulkActionEdit_BulkActionEdit as BulkActionEdit };
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=BulkActionEdit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/FileList/components/BulkActions/BulkActionEdit.js","sources":["../../../../../src/presentation/FileList/components/BulkActions/BulkActionEdit.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as EditIcon } from \"@webiny/icons/edit.svg\";\nimport { Tooltip } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport omit from \"lodash/omit.js\";\nimport { prepareFormData } from \"@webiny/app-headless-cms-common\";\nimport type { CmsModelField } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport { BulkAction, getFilesLabel } from \"./useBulkActionWorker.js\";\nimport { useFileManagerPresenter } from \"../../FileManagerPresenterProvider.js\";\nimport { UpdateFileFeature } from \"~/features/updateFile/feature.js\";\nimport { ActionEditPresenter } from \"~/presentation/FileList/components/BulkActions/ActionEditPresenter.js\";\nimport { BatchEditorDialog } from \"~/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js\";\nimport { GraphQLInputMapper } from \"~/presentation/FileList/components/BulkActions/GraphQLInputMapper.js\";\nimport type { BatchDTO } from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\nimport type { FmFile } from \"~/features/shared/types.js\";\n\nconst { useButtons } = BulkAction;\n\nexport const BulkActionEdit = observer(function BulkActionEdit() {\n const { ButtonDefault } = useButtons();\n\n const { vm } = useFileManagerPresenter();\n const { useCase: updateFileUseCase } = useFeature(UpdateFileFeature);\n\n const { useWorker, useDialog } = BulkAction;\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const fields = vm.fileModel?.fields ?? [];\n\n const presenter = useMemo<ActionEditPresenter>(() => {\n return new ActionEditPresenter();\n }, []);\n\n useEffect(() => {\n presenter.load(fields);\n }, [fields]);\n\n const filesLabel = useMemo(() => {\n return getFilesLabel(worker.items.length);\n }, [worker.items.length]);\n\n const openWorkerDialog = useCallback(\n (batch: BatchDTO, modelFields: CmsModelField[]) => {\n showConfirmationDialog({\n title: \"Edit files\",\n message: `You are about to edit ${filesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${filesLabel}`,\n execute: async () => {\n await worker.processInSeries(async ({ item, report }) => {\n try {\n // Apply batch operations to the file data.\n const modifiedFileData = GraphQLInputMapper.applyOperations(\n item as any,\n batch\n ) as FmFile;\n\n const output = omit(modifiedFileData, [\n \"id\",\n \"createdBy\",\n \"createdOn\",\n \"src\"\n ]);\n\n const fileData = prepareFormData(output, modelFields);\n\n const result = await updateFileUseCase.execute({\n id: item.id,\n data: fileData\n });\n\n if (!result.success) {\n report.error({\n title: `${item.name}`,\n message: result.error.message\n });\n return;\n }\n\n report.success({\n title: `${item.name}`,\n message: \"File successfully edited.\"\n });\n } catch (e) {\n report.error({\n title: `${item.name}`,\n message: (e as Error).message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Edit files\",\n message: \"Finished editing files! See full report below:\"\n });\n }\n });\n },\n [filesLabel]\n );\n\n const onBatchEditorSubmit = useCallback(\n (batch: BatchDTO) => {\n presenter.closeEditor();\n openWorkerDialog(batch, fields);\n },\n [openWorkerDialog, fields]\n );\n\n if (!presenter.vm.show) {\n return null;\n }\n\n if (!vm.permissions.canEdit) {\n return null;\n }\n\n return (\n <>\n <Tooltip\n side={\"bottom\"}\n content={`Edit ${filesLabel}`}\n trigger={\n <ButtonDefault\n icon={<EditIcon />}\n onAction={() => presenter.openEditor()}\n size={\"sm\"}\n >\n {\"Edit\"}\n </ButtonDefault>\n }\n />\n <BatchEditorDialog\n onClose={() => presenter.closeEditor()}\n fields={presenter.vm.fields}\n batch={presenter.vm.currentBatch}\n vm={presenter.vm.editorVm}\n onApply={onBatchEditorSubmit}\n />\n </>\n );\n});\n"],"names":["useButtons","BulkAction","BulkActionEdit","observer","ButtonDefault","vm","useFileManagerPresenter","updateFileUseCase","useFeature","UpdateFileFeature","useWorker","useDialog","worker","showConfirmationDialog","showResultsDialog","fields","presenter","useMemo","ActionEditPresenter","useEffect","filesLabel","getFilesLabel","openWorkerDialog","useCallback","batch","modelFields","item","report","modifiedFileData","GraphQLInputMapper","output","omit","fileData","prepareFormData","result","e","onBatchEditorSubmit","Tooltip","EditIcon","BatchEditorDialog"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,EAAEA,YAAAA,UAAU,EAAE,GAAGC;AAEhB,MAAMC,gCAAiBC,SAAS;IACnC,MAAM,EAAEC,aAAa,EAAE,GAAGJ;IAE1B,MAAM,EAAEK,EAAE,EAAE,GAAGC;IACf,MAAM,EAAE,SAASC,iBAAiB,EAAE,GAAGC,WAAWC;IAElD,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGV;IACjC,MAAMW,SAASF;IACf,MAAM,EAAEG,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGH;IAEtD,MAAMI,SAASV,GAAG,SAAS,EAAE,UAAU,EAAE;IAEzC,MAAMW,YAAYC,QAA6B,IACpC,IAAIC,uBACZ,EAAE;IAELC,UAAU;QACNH,UAAU,IAAI,CAACD;IACnB,GAAG;QAACA;KAAO;IAEX,MAAMK,aAAaH,QAAQ,IAChBI,cAAcT,OAAO,KAAK,CAAC,MAAM,GACzC;QAACA,OAAO,KAAK,CAAC,MAAM;KAAC;IAExB,MAAMU,mBAAmBC,YACrB,CAACC,OAAiBC;QACdZ,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEO,WAAW,oCAAoC,CAAC;YAClF,cAAc,CAAC,WAAW,EAAEA,YAAY;YACxC,SAAS;gBACL,MAAMR,OAAO,eAAe,CAAC,OAAO,EAAEc,IAAI,EAAEC,MAAM,EAAE;oBAChD,IAAI;wBAEA,MAAMC,mBAAmBC,mBAAmB,eAAe,CACvDH,MACAF;wBAGJ,MAAMM,SAASC,KAAKH,kBAAkB;4BAClC;4BACA;4BACA;4BACA;yBACH;wBAED,MAAMI,WAAWC,gBAAgBH,QAAQL;wBAEzC,MAAMS,SAAS,MAAM3B,kBAAkB,OAAO,CAAC;4BAC3C,IAAImB,KAAK,EAAE;4BACX,MAAMM;wBACV;wBAEA,IAAI,CAACE,OAAO,OAAO,EAAE,YACjBP,OAAO,KAAK,CAAC;4BACT,OAAO,GAAGD,KAAK,IAAI,EAAE;4BACrB,SAASQ,OAAO,KAAK,CAAC,OAAO;wBACjC;wBAIJP,OAAO,OAAO,CAAC;4BACX,OAAO,GAAGD,KAAK,IAAI,EAAE;4BACrB,SAAS;wBACb;oBACJ,EAAE,OAAOS,GAAG;wBACRR,OAAO,KAAK,CAAC;4BACT,OAAO,GAAGD,KAAK,IAAI,EAAE;4BACrB,SAAUS,EAAY,OAAO;wBACjC;oBACJ;gBACJ;gBAEAvB,OAAO,UAAU;gBAEjBE,kBAAkB;oBACd,SAASF,OAAO,OAAO;oBACvB,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IACJ,GACA;QAACQ;KAAW;IAGhB,MAAMgB,sBAAsBb,YACxB,CAACC;QACGR,UAAU,WAAW;QACrBM,iBAAiBE,OAAOT;IAC5B,GACA;QAACO;QAAkBP;KAAO;IAG9B,IAAI,CAACC,UAAU,EAAE,CAAC,IAAI,EAClB,OAAO;IAGX,IAAI,CAACX,GAAG,WAAW,CAAC,OAAO,EACvB,OAAO;IAGX,OAAO,WAAP,GACI,wDACI,oBAACgC,SAAOA;QACJ,MAAM;QACN,SAAS,CAAC,KAAK,EAAEjB,YAAY;QAC7B,uBACI,oBAAChB,eAAAA;YACG,oBAAM,oBAACkC,gBAAQA;YACf,UAAU,IAAMtB,UAAU,UAAU;YACpC,MAAM;WAEL;sBAIb,oBAACuB,mBAAiBA;QACd,SAAS,IAAMvB,UAAU,WAAW;QACpC,QAAQA,UAAU,EAAE,CAAC,MAAM;QAC3B,OAAOA,UAAU,EAAE,CAAC,YAAY;QAChC,IAAIA,UAAU,EAAE,CAAC,QAAQ;QACzB,SAASoB;;AAIzB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import type { FieldElement } from "@webiny/app-headless-cms-common";
|
|
3
|
-
export type FieldProps = React.ComponentProps<typeof FieldElement>;
|
|
4
|
-
export type FolderFieldDecoratorProps = {
|
|
5
|
-
id?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const shouldDecorateFolderField: (decoratorProps: FolderFieldDecoratorProps, componentProps: FieldProps) => boolean;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useFoldersType } from "@webiny/app-aco";
|
|
2
|
-
const shouldDecorateFolderField = (decoratorProps, componentProps)=>{
|
|
3
|
-
const { id } = decoratorProps;
|
|
4
|
-
const type = useFoldersType();
|
|
5
|
-
if ("FmFile" !== type) return false;
|
|
6
|
-
if (id) return "*" === id ? true : id === componentProps.field.id;
|
|
7
|
-
return true;
|
|
8
|
-
};
|
|
9
|
-
export { shouldDecorateFolderField };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=FolderFieldDecorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/FolderFieldDecorator.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FolderFieldDecorator.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { FieldElement } from \"@webiny/app-headless-cms-common\";\nimport { useFoldersType } from \"@webiny/app-aco\";\n\nexport type FieldProps = React.ComponentProps<typeof FieldElement>;\n\nexport type FolderFieldDecoratorProps = {\n id?: string;\n};\n\nexport const shouldDecorateFolderField = (\n decoratorProps: FolderFieldDecoratorProps,\n componentProps: FieldProps\n) => {\n const { id } = decoratorProps;\n const type = useFoldersType();\n\n if (type !== \"FmFile\") {\n return false;\n }\n\n if (id) {\n return id === \"*\" ? true : id === componentProps.field.id;\n }\n\n return true;\n};\n"],"names":["shouldDecorateFolderField","decoratorProps","componentProps","id","type","useFoldersType"],"mappings":";AAUO,MAAMA,4BAA4B,CACrCC,gBACAC;IAEA,MAAM,EAAEC,EAAE,EAAE,GAAGF;IACf,MAAMG,OAAOC;IAEb,IAAID,AAAS,aAATA,MACA,OAAO;IAGX,IAAID,IACA,OAAOA,AAAO,QAAPA,KAAa,OAAOA,OAAOD,eAAe,KAAK,CAAC,EAAE;IAG7D,OAAO;AACX"}
|