@webiny/app-file-manager 6.6.0-alpha.11 → 6.6.0-alpha.13
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/modules/AiEnrichment/ReenrichWithAi.js +1 -1
- package/modules/AiEnrichment/ReenrichWithAi.js.map +1 -1
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js +1 -1
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js.map +1 -1
- package/modules/Enterprise/index.js +1 -1
- package/modules/Enterprise/index.js.map +1 -1
- package/modules/FileManagerRoutes.js +1 -1
- package/modules/FileManagerRoutes.js.map +1 -1
- package/modules/SecurityPermissions.js +1 -1
- package/modules/SecurityPermissions.js.map +1 -1
- package/modules/Settings/index.js +1 -1
- package/modules/Settings/index.js.map +1 -1
- package/package.json +23 -22
- package/presentation/FileActions/FileDetails/CopyUrl.js +1 -1
- package/presentation/FileActions/FileDetails/CopyUrl.js.map +1 -1
- package/presentation/FileActions/FileDetails/DeleteImage.js +1 -1
- package/presentation/FileActions/FileDetails/DeleteImage.js.map +1 -1
- package/presentation/FileActions/FileDetails/Download.js +1 -1
- package/presentation/FileActions/FileDetails/Download.js.map +1 -1
- package/presentation/FileActions/FileDetails/EditImage.js +1 -1
- package/presentation/FileActions/FileDetails/EditImage.js.map +1 -1
- package/presentation/FileActions/FileDetails/MoveToFolder.js +1 -1
- package/presentation/FileActions/FileDetails/MoveToFolder.js.map +1 -1
- package/presentation/FileActions/Grid/Delete.js +1 -1
- package/presentation/FileActions/Grid/Delete.js.map +1 -1
- package/presentation/FileActions/Grid/Download.js +1 -1
- package/presentation/FileActions/Grid/Download.js.map +1 -1
- package/presentation/FileActions/Grid/MoveToFolder.js +1 -1
- package/presentation/FileActions/Grid/MoveToFolder.js.map +1 -1
- package/presentation/FileActions/Grid/Settings.js +1 -1
- package/presentation/FileActions/Grid/Settings.js.map +1 -1
- package/presentation/FileActions/index.js +1 -1
- package/presentation/FileActions/index.js.map +1 -1
- package/presentation/FileDetails/components/Content.js.map +1 -1
- package/presentation/FileList/FileListPresenter.test.js +30 -1
- package/presentation/FileList/FileListPresenter.test.js.map +1 -1
- package/presentation/FileList/FileManagerPresenter.d.ts +5 -1
- package/presentation/FileList/FileManagerPresenter.js +30 -3
- package/presentation/FileList/FileManagerPresenter.js.map +1 -1
- package/presentation/FileList/FileManagerPresenterProvider.js.map +1 -1
- package/presentation/FileList/components/BulkActions/domain/Field.js.map +1 -1
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.js +1 -1
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.js.map +1 -1
- package/presentation/FileList/components/FileDropArea/FileDropArea.js.map +1 -1
- package/presentation/FileList/components/Grid/File.js.map +1 -1
- package/presentation/FileList/components/Grid/FileGrid.js.map +1 -1
- package/presentation/FileList/components/Table/Cells/CellName.js.map +1 -1
- package/presentation/FileManager/FileManagerRenderer.js +2 -1
- package/presentation/FileManager/FileManagerRenderer.js.map +1 -1
- package/presentation/FileManager/FileManagerView.d.ts +5 -0
- package/presentation/FileManager/FileManagerView.js +2 -2
- package/presentation/FileManager/FileManagerView.js.map +1 -1
- package/presentation/FileManager/OverlayContext.js.map +1 -1
- package/presentation/config/DefaultFileManagerConfig.js +1 -1
- package/presentation/config/DefaultFileManagerConfig.js.map +1 -1
- package/presentation/config/FileManagerViewConfig.test.d.ts +1 -0
- package/presentation/config/FileManagerViewConfig.test.js +134 -0
- package/presentation/config/FileManagerViewConfig.test.js.map +1 -0
- package/presentation/config/configComponents/Browser/BulkAction.js +1 -1
- package/presentation/config/configComponents/Browser/BulkAction.js.map +1 -1
- package/presentation/config/configComponents/Browser/FileAction.js +1 -1
- package/presentation/config/configComponents/Browser/FileAction.js.map +1 -1
- package/presentation/config/configComponents/Browser/Filter.js +1 -1
- package/presentation/config/configComponents/Browser/Filter.js.map +1 -1
- package/presentation/config/configComponents/Browser/FolderAction.js +1 -1
- package/presentation/config/configComponents/Browser/FolderAction.js.map +1 -1
- package/presentation/config/configComponents/Browser/FolderDropConfirmation.js +1 -1
- package/presentation/config/configComponents/Browser/FolderDropConfirmation.js.map +1 -1
- package/presentation/config/configComponents/Browser/Table/Column.d.ts +5 -0
- package/presentation/config/configComponents/Browser/Table/Column.js +6 -2
- package/presentation/config/configComponents/Browser/Table/Column.js.map +1 -1
- package/presentation/contexts/FileProvider.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/FileList/components/Table/Cells/CellName.js","sources":["../../../../../../src/presentation/FileList/components/Table/Cells/CellName.tsx"],"sourcesContent":["import React from \"react\";\nimport { FolderIcon, FolderSharedIcon } from \"@webiny/app-aco\";\nimport { FileManagerViewConfig } from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { useFileManagerPresenter } from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport type { FolderDto } from \"@webiny/app-aco\";\nimport { cn, Text } from \"@webiny/admin-ui\";\nimport { CellThumbnail } from \"./CellThumbnail.js\";\nimport { FileProvider } from \"~/presentation/contexts/FileProvider.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\ninterface DefaultProps {\n onClick: (id: string) => void;\n}\n\ninterface FolderCellNameProps extends DefaultProps {\n folder: FolderDto;\n}\n\nexport const FolderCellName = ({ folder, onClick }: FolderCellNameProps) => {\n let icon = <FolderIcon width={32} height={32} />;\n if (folder.hasNonInheritedPermissions && folder.canManagePermissions) {\n icon = <FolderSharedIcon width={32} height={32} />;\n }\n\n return (\n <div\n className={cn([\n \"flex items-center gap-md\",\n \"truncate cursor-pointer font-semibold\",\n \"hover:underline\"\n ])}\n onClick={() => onClick(folder.id)}\n >\n <div className={\"size-xl rounded-md overflow-hidden flex-shrink-0\"}>{icon}</div>\n <Text className={\"truncate min-w-0 flex-shrink\"}>{folder.title}</Text>\n </div>\n );\n};\n\ninterface FileCellNameProps extends DefaultProps {\n file: FileItem;\n}\n\nexport const FileCellName = ({ file, onClick }: FileCellNameProps) => {\n return (\n <div\n className={cn([\n \"flex items-center gap-md\",\n \"truncate cursor-pointer\",\n \"hover:underline\"\n ])}\n onClick={() => onClick(file.id)}\n >\n <FileProvider file={file}>\n <div\n className={\n \"size-xl aspect-square rounded-md bg-neutral-muted overflow-hidden flex-shrink-0\"\n }\n >\n <CellThumbnail />\n </div>\n </FileProvider>\n <Text className={\"truncate min-w-0 flex-shrink\"}>{file.name}</Text>\n </div>\n );\n};\n\nexport const CellName = () => {\n const { useTableRow, isFolderRow } = FileManagerViewConfig.Browser.Table.Column;\n const { row } = useTableRow();\n const { actions } = useFileManagerPresenter();\n\n if (isFolderRow(row)) {\n return (\n <FolderCellName folder={row.data} onClick={id => actions.folders.selectFolder(id)} />\n );\n }\n\n return <FileCellName file={row.data} onClick={id => actions.showFileDetails(id)} />;\n};\n"],"names":["FolderCellName","folder","onClick","icon","FolderIcon","FolderSharedIcon","cn","Text","FileCellName","file","FileProvider","CellThumbnail","CellName","useTableRow","isFolderRow","FileManagerViewConfig","row","actions","useFileManagerPresenter","id"],"mappings":";;;;;;;AAkBO,MAAMA,iBAAiB,CAAC,EAAEC,MAAM,EAAEC,OAAO,EAAuB;IACnE,IAAIC,OAAO,WAAPA,GAAO,oBAACC,YAAUA;QAAC,OAAO;QAAI,QAAQ;;IAC1C,IAAIH,OAAO,0BAA0B,IAAIA,OAAO,oBAAoB,EAChEE,OAAO,WAAPA,GAAO,oBAACE,kBAAgBA;QAAC,OAAO;QAAI,QAAQ;;IAGhD,OAAO,WAAP,GACI,oBAAC;QACG,WAAWC,GAAG;YACV;YACA;YACA;SACH;QACD,SAAS,IAAMJ,QAAQD,OAAO,EAAE;qBAEhC,oBAAC;QAAI,WAAW;OAAqDE,OAAAA,WAAAA,GACrE,oBAACI,MAAIA;QAAC,WAAW;OAAiCN,OAAO,KAAK;AAG1E;AAMO,MAAMO,eAAe,CAAC,EAAEC,IAAI,EAAEP,OAAO,EAAqB,GACtD,WAAP,GACI,oBAAC;QACG,WAAWI,GAAG;YACV;YACA;YACA;SACH;QACD,SAAS,IAAMJ,QAAQO,KAAK,EAAE;qBAE9B,oBAACC,cAAYA;QAAC,MAAMD;qBAChB,oBAAC;QACG,WACI;qBAGJ,oBAACE,eAAaA,SAAAA,WAAAA,GAGtB,oBAACJ,MAAIA;QAAC,WAAW;OAAiCE,KAAK,IAAI;AAKhE,MAAMG,WAAW;IACpB,MAAM,EAAEC,WAAW,EAAEC,WAAW,EAAE,GAAGC,sBAAsB,OAAO,CAAC,KAAK,CAAC,MAAM;IAC/E,MAAM,EAAEC,GAAG,EAAE,GAAGH;IAChB,MAAM,EAAEI,OAAO,EAAE,GAAGC;IAEpB,IAAIJ,YAAYE,MACZ,OAAO,WAAP,GACI,oBAAChB,
|
|
1
|
+
{"version":3,"file":"presentation/FileList/components/Table/Cells/CellName.js","sources":["../../../../../../src/presentation/FileList/components/Table/Cells/CellName.tsx"],"sourcesContent":["import React from \"react\";\nimport { FolderIcon, FolderSharedIcon } from \"@webiny/app-aco\";\nimport { FileManagerViewConfig } from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { useFileManagerPresenter } from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport type { FolderDto } from \"@webiny/app-aco\";\nimport { cn, Text } from \"@webiny/admin-ui\";\nimport { CellThumbnail } from \"./CellThumbnail.js\";\nimport { FileProvider } from \"~/presentation/contexts/FileProvider.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\ninterface DefaultProps {\n onClick: (id: string) => void;\n}\n\ninterface FolderCellNameProps extends DefaultProps {\n folder: FolderDto;\n}\n\nexport const FolderCellName = ({ folder, onClick }: FolderCellNameProps) => {\n let icon = <FolderIcon width={32} height={32} />;\n if (folder.hasNonInheritedPermissions && folder.canManagePermissions) {\n icon = <FolderSharedIcon width={32} height={32} />;\n }\n\n return (\n <div\n className={cn([\n \"flex items-center gap-md\",\n \"truncate cursor-pointer font-semibold\",\n \"hover:underline\"\n ])}\n onClick={() => onClick(folder.id)}\n >\n <div className={\"size-xl rounded-md overflow-hidden flex-shrink-0\"}>{icon}</div>\n <Text className={\"truncate min-w-0 flex-shrink\"}>{folder.title}</Text>\n </div>\n );\n};\n\ninterface FileCellNameProps extends DefaultProps {\n file: FileItem;\n}\n\nexport const FileCellName = ({ file, onClick }: FileCellNameProps) => {\n return (\n <div\n className={cn([\n \"flex items-center gap-md\",\n \"truncate cursor-pointer\",\n \"hover:underline\"\n ])}\n onClick={() => onClick(file.id)}\n >\n <FileProvider file={file}>\n <div\n className={\n \"size-xl aspect-square rounded-md bg-neutral-muted overflow-hidden flex-shrink-0\"\n }\n >\n <CellThumbnail />\n </div>\n </FileProvider>\n <Text className={\"truncate min-w-0 flex-shrink\"}>{file.name}</Text>\n </div>\n );\n};\n\nexport const CellName = () => {\n const { useTableRow, isFolderRow } = FileManagerViewConfig.Browser.Table.Column;\n const { row } = useTableRow();\n const { actions } = useFileManagerPresenter();\n\n if (isFolderRow(row)) {\n return (\n <FolderCellName folder={row.data} onClick={id => actions.folders.selectFolder(id)} />\n );\n }\n\n return <FileCellName file={row.data} onClick={id => actions.showFileDetails(id)} />;\n};\n"],"names":["FolderCellName","folder","onClick","icon","FolderIcon","FolderSharedIcon","cn","Text","FileCellName","file","FileProvider","CellThumbnail","CellName","useTableRow","isFolderRow","FileManagerViewConfig","row","actions","useFileManagerPresenter","id"],"mappings":";;;;;;;AAkBO,MAAMA,iBAAiB,CAAC,EAAEC,MAAM,EAAEC,OAAO,EAAuB;IACnE,IAAIC,OAAO,WAAPA,GAAO,oBAACC,YAAUA;QAAC,OAAO;QAAI,QAAQ;;IAC1C,IAAIH,OAAO,0BAA0B,IAAIA,OAAO,oBAAoB,EAChEE,OAAO,WAAPA,GAAO,oBAACE,kBAAgBA;QAAC,OAAO;QAAI,QAAQ;;IAGhD,OAAO,WAAP,GACI,oBAAC;QACG,WAAWC,GAAG;YACV;YACA;YACA;SACH;QACD,SAAS,IAAMJ,QAAQD,OAAO,EAAE;qBAEhC,oBAAC;QAAI,WAAW;OAAqDE,OAAAA,WAAAA,GACrE,oBAACI,MAAIA;QAAC,WAAW;OAAiCN,OAAO,KAAK;AAG1E;AAMO,MAAMO,eAAe,CAAC,EAAEC,IAAI,EAAEP,OAAO,EAAqB,GACtD,WAAP,GACI,oBAAC;QACG,WAAWI,GAAG;YACV;YACA;YACA;SACH;QACD,SAAS,IAAMJ,QAAQO,KAAK,EAAE;qBAE9B,oBAACC,cAAYA;QAAC,MAAMD;qBAChB,oBAAC;QACG,WACI;qBAGJ,oBAACE,eAAaA,SAAAA,WAAAA,GAGtB,oBAACJ,MAAIA;QAAC,WAAW;OAAiCE,KAAK,IAAI;AAKhE,MAAMG,WAAW;IACpB,MAAM,EAAEC,WAAW,EAAEC,WAAW,EAAE,GAAGC,sBAAsB,OAAO,CAAC,KAAK,CAAC,MAAM;IAC/E,MAAM,EAAEC,GAAG,EAAE,GAAGH;IAChB,MAAM,EAAEI,OAAO,EAAE,GAAGC;IAEpB,IAAIJ,YAAYE,MACZ,OAAO,WAAP,GACI,oBAAChB,gBAAAA;QAAe,QAAQgB,IAAI,IAAI;QAAE,SAASG,CAAAA,KAAMF,QAAQ,OAAO,CAAC,YAAY,CAACE;;IAItF,OAAO,WAAP,GAAO,oBAACX,cAAAA;QAAa,MAAMQ,IAAI,IAAI;QAAE,SAASG,CAAAA,KAAMF,QAAQ,eAAe,CAACE;;AAChF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/FileManager/FileManagerRenderer.js","sources":["../../../src/presentation/FileManager/FileManagerRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FileManagerFileItem, FileManagerOnChange } from \"@webiny/app-admin\";\nimport { FileManager } from \"@webiny/app-admin\";\nimport type { FmFile } from \"~/features/shared/types.js\";\nimport { FileManagerView } from \"./FileManagerView.js\";\n\nconst formatFileItem = (file: FmFile): FileManagerFileItem => {\n return {\n id: file.id,\n src: file.src,\n name: file.name,\n type: file.type,\n size: file.size,\n width: file.metadata?.image?.width,\n height: file.metadata?.image?.height,\n extensions: file.extensions,\n metadata: file.metadata\n };\n};\n\nexport const FileManagerRendererDecorator = FileManager.Renderer.createDecorator(() => {\n return function FileManagerRendererImpl(props) {\n const { onChange, onClose, multiple, accept, scope, overlay = true } = props;\n\n const handleChange = (files: FmFile[]) => {\n if (!onChange || !files.length) {\n return;\n }\n\n if (multiple) {\n (onChange as FileManagerOnChange<FileManagerFileItem[]>)(files.map(formatFileItem));\n } else {\n (onChange as FileManagerOnChange<FileManagerFileItem>)(formatFileItem(files[0]));\n }\n\n if (onClose) {\n onClose();\n }\n };\n\n return (\n <FileManagerView\n overlay={overlay}\n onChange={handleChange}\n onClose={onClose}\n multiple={multiple}\n accept={accept}\n scope={scope}\n />\n );\n };\n});\n"],"names":["formatFileItem","file","FileManagerRendererDecorator","FileManager","props","onChange","onClose","multiple","accept","scope","overlay","handleChange","files","FileManagerView"],"mappings":";;;AAMA,MAAMA,iBAAiB,CAACC,OACb;QACH,IAAIA,KAAK,EAAE;QACX,KAAKA,KAAK,GAAG;QACb,MAAMA,KAAK,IAAI;QACf,MAAMA,KAAK,IAAI;QACf,MAAMA,KAAK,IAAI;QACf,OAAOA,KAAK,QAAQ,EAAE,OAAO;QAC7B,QAAQA,KAAK,QAAQ,EAAE,OAAO;QAC9B,YAAYA,KAAK,UAAU;QAC3B,UAAUA,KAAK,QAAQ;IAC3B;AAGG,MAAMC,+BAA+BC,YAAY,QAAQ,CAAC,eAAe,CAAC,IACtE,SAAiCC,KAAK;QACzC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,IAAI,EAAE,GAAGN;QAEvE,MAAMO,eAAe,CAACC;YAClB,IAAI,CAACP,YAAY,CAACO,MAAM,MAAM,EAC1B;YAGAL,WACCF,SAAwDO,MAAM,GAAG,CAACZ,mBAElEK,SAAsDL,eAAeY,KAAK,CAAC,EAAE;YAGlF,IAAIN,SACAA;QAER;QAEA,OAAO,WAAP,GACI,oBAACO,iBAAeA;YACZ,SAASH;YACT,UAAUC;YACV,SAASL;YACT,UAAUC;YACV,QAAQC;YACR,OAAOC;;
|
|
1
|
+
{"version":3,"file":"presentation/FileManager/FileManagerRenderer.js","sources":["../../../src/presentation/FileManager/FileManagerRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FileManagerFileItem, FileManagerOnChange } from \"@webiny/app-admin\";\nimport { FileManager } from \"@webiny/app-admin\";\nimport type { FmFile } from \"~/features/shared/types.js\";\nimport { FileManagerView } from \"./FileManagerView.js\";\n\nconst formatFileItem = (file: FmFile): FileManagerFileItem => {\n return {\n id: file.id,\n src: file.src,\n name: file.name,\n type: file.type,\n size: file.size,\n width: file.metadata?.image?.width,\n height: file.metadata?.image?.height,\n extensions: file.extensions,\n metadata: file.metadata\n };\n};\n\nexport const FileManagerRendererDecorator = FileManager.Renderer.createDecorator(() => {\n return function FileManagerRendererImpl(props) {\n const { onChange, onClose, multiple, accept, scope, overlay = true } = props;\n\n const handleChange = (files: FmFile[]) => {\n if (!onChange || !files.length) {\n return;\n }\n\n if (multiple) {\n (onChange as FileManagerOnChange<FileManagerFileItem[]>)(files.map(formatFileItem));\n } else {\n (onChange as FileManagerOnChange<FileManagerFileItem>)(formatFileItem(files[0]));\n }\n\n if (onClose) {\n onClose();\n }\n };\n\n return (\n <FileManagerView\n overlay={overlay}\n onChange={handleChange}\n onClose={onClose}\n multiple={multiple}\n accept={accept}\n scope={scope}\n // Rendered by the FileManager component (a picker, or embedded in a screen), never\n // on the File Manager's own route.\n syncRoute={false}\n />\n );\n };\n});\n"],"names":["formatFileItem","file","FileManagerRendererDecorator","FileManager","props","onChange","onClose","multiple","accept","scope","overlay","handleChange","files","FileManagerView"],"mappings":";;;AAMA,MAAMA,iBAAiB,CAACC,OACb;QACH,IAAIA,KAAK,EAAE;QACX,KAAKA,KAAK,GAAG;QACb,MAAMA,KAAK,IAAI;QACf,MAAMA,KAAK,IAAI;QACf,MAAMA,KAAK,IAAI;QACf,OAAOA,KAAK,QAAQ,EAAE,OAAO;QAC7B,QAAQA,KAAK,QAAQ,EAAE,OAAO;QAC9B,YAAYA,KAAK,UAAU;QAC3B,UAAUA,KAAK,QAAQ;IAC3B;AAGG,MAAMC,+BAA+BC,YAAY,QAAQ,CAAC,eAAe,CAAC,IACtE,SAAiCC,KAAK;QACzC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,IAAI,EAAE,GAAGN;QAEvE,MAAMO,eAAe,CAACC;YAClB,IAAI,CAACP,YAAY,CAACO,MAAM,MAAM,EAC1B;YAGAL,WACCF,SAAwDO,MAAM,GAAG,CAACZ,mBAElEK,SAAsDL,eAAeY,KAAK,CAAC,EAAE;YAGlF,IAAIN,SACAA;QAER;QAEA,OAAO,WAAP,GACI,oBAACO,iBAAeA;YACZ,SAASH;YACT,UAAUC;YACV,SAASL;YACT,UAAUC;YACV,QAAQC;YACR,OAAOC;YAGP,WAAW;;IAGvB"}
|
|
@@ -7,6 +7,11 @@ export interface FileManagerViewProps {
|
|
|
7
7
|
multiple?: boolean;
|
|
8
8
|
accept?: string[];
|
|
9
9
|
scope?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Keep the folder and search in the File Manager route's address (its own screen). Off for a
|
|
12
|
+
* File Manager embedded in another screen, which must not write to (or navigate to) that route.
|
|
13
|
+
*/
|
|
14
|
+
syncRoute?: boolean;
|
|
10
15
|
children?: React.ReactNode;
|
|
11
16
|
}
|
|
12
17
|
export declare const FileManagerView: (props: FileManagerViewProps) => React.JSX.Element;
|
|
@@ -200,7 +200,7 @@ const FileManagerView_FileManagerViewLayout = observer(function() {
|
|
|
200
200
|
}, content);
|
|
201
201
|
return content;
|
|
202
202
|
});
|
|
203
|
-
const FileManagerViewInner = observer(({ overlay = false, onChange, onClose, multiple, accept, scope, children })=>{
|
|
203
|
+
const FileManagerViewInner = observer(({ overlay = false, onChange, onClose, multiple, accept, scope, syncRoute = true, children })=>{
|
|
204
204
|
const { presenter } = useFeature(FileManagerPresenterFeature);
|
|
205
205
|
const overlayConfig = useMemo(()=>{
|
|
206
206
|
if (!overlay || !onChange || !onClose) return null;
|
|
@@ -242,7 +242,7 @@ const FileManagerViewInner = observer(({ overlay = false, onChange, onClose, mul
|
|
|
242
242
|
]);
|
|
243
243
|
const inner = /*#__PURE__*/ react.createElement(DialogsProvider, null, /*#__PURE__*/ react.createElement(FileManagerViewWithConfig, null, /*#__PURE__*/ react.createElement(FileManagerPresenterProvider, {
|
|
244
244
|
presenter: presenter
|
|
245
|
-
}, /*#__PURE__*/ react.createElement(FileManagerView_FileManagerViewLayout, null), children, !overlayConfig && /*#__PURE__*/ react.createElement(RouteParamsSync, null), !overlayConfig && /*#__PURE__*/ react.createElement(FileManagerBreadcrumbs, null))));
|
|
245
|
+
}, /*#__PURE__*/ react.createElement(FileManagerView_FileManagerViewLayout, null), children, !overlayConfig && syncRoute && /*#__PURE__*/ react.createElement(RouteParamsSync, null), !overlayConfig && syncRoute && /*#__PURE__*/ react.createElement(FileManagerBreadcrumbs, null))));
|
|
246
246
|
if (overlayConfig) return /*#__PURE__*/ react.createElement(OverlayProvider, {
|
|
247
247
|
config: overlayConfig
|
|
248
248
|
}, inner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/FileManager/FileManagerView.js","sources":["../../../src/presentation/FileManager/FileManagerView.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useCallback } from \"react\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { observer } from \"mobx-react-lite\";\nimport {\n BrowserFilePicker,\n type BrowserFilePickerRenderProps\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport debounce from \"lodash/debounce.js\";\nimport { Heading, OverlayLoader, ScrollArea, Separator, useToast } from \"@webiny/admin-ui\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport {\n LeftPanel,\n OverlayLayout,\n RightPanel,\n SplitView,\n DialogsProvider,\n useHotkeys\n} from \"@webiny/app-admin\";\nimport { FoldersFeature } from \"@webiny/app-aco/features/folders/feature.js\";\nimport { FolderTreePresenterFeature } from \"@webiny/app-aco/presentation/folderTree/feature.js\";\nimport { FileManagerPresenterFeature } from \"~/presentation/FileList/feature.js\";\nimport {\n FileManagerPresenterProvider,\n useFileManagerPresenter\n} from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport { FileDetailsPresenterFeature } from \"~/presentation/FileDetails/feature.js\";\nimport { SharedCacheFeature } from \"~/features/shared/feature.js\";\nimport { ListFilesFeature } from \"~/features/listFiles/feature.js\";\nimport { GetFileFeature } from \"~/features/getFile/feature.js\";\nimport { DeleteFileFeature } from \"~/features/deleteFile/feature.js\";\nimport { UpdateFileFeature } from \"~/features/updateFile/feature.js\";\nimport { FileUploaderFeature } from \"~/features/fileUploader/feature.js\";\nimport { ListTagsFeature } from \"~/features/tags/feature.js\";\nimport { GetSettingsFeature } from \"~/features/settings/feature.js\";\nimport {\n FileManagerViewWithConfig,\n useFileManagerConfig\n} from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FolderTree } from \"@webiny/app-aco/presentation/folderTree/FolderTree.js\";\nimport { BottomInfoBar } from \"~/presentation/FileList/components/BottomInfoBar/index.js\";\nimport { BulkActionBar } from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { FileDropPlaceholder } from \"~/presentation/FileList/components/FileDropPlaceholder/index.js\";\nimport { Empty } from \"~/presentation/FileList/components/Empty/index.js\";\nimport { FileDetailsDrawer } from \"~/presentation/FileDetails/components/FileDetailsDrawer.js\";\nimport { FileGrid } from \"~/presentation/FileList/components/Grid/index.js\";\nimport { FileManagerHeader } from \"~/presentation/FileList/components/Header/FileManagerHeader.js\";\nimport { FileTable } from \"~/presentation/FileList/components/Table/index.js\";\nimport { TagsList } from \"~/presentation/FileList/components/TagsList/index.js\";\nimport { UploadProgress } from \"~/presentation/FileList/components/Upload/index.js\";\nimport { GetSettingsRepository } from \"~/features/settings/abstractions.js\";\nimport { OverlayProvider, useOverlay } from \"./OverlayContext.js\";\nimport { RouteParamsSync } from \"./RouteParamsSync.js\";\nimport { FileManagerBreadcrumbs } from \"./FileManagerBreadcrumbs.js\";\n\nimport type { FmFile } from \"~/features/shared/types.js\";\nimport type {\n FileError,\n SelectedFile\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport { outputFileSelectionError } from \"~/presentation/FileManager/outputFileSelectionError.js\";\nimport type { ScrollPosition } from \"@webiny/admin-ui\";\n\nexport interface FileManagerViewProps {\n overlay?: boolean;\n onChange?: (files: FmFile[]) => void;\n onClose?: () => void;\n multiple?: boolean;\n accept?: string[];\n scope?: string;\n children?: React.ReactNode;\n}\n\nconst t = i18n.ns(\"app-admin/file-manager/file-manager-view\");\n\n// ---------------------------------------------------------------------------\n// Layout — uses original UI components, wired to the presenter.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewLayout = observer(function FileManagerViewLayout() {\n const { vm, actions } = useFileManagerPresenter();\n const { browser } = useFileManagerConfig();\n const overlay = useOverlay();\n const toast = useToast();\n\n useHotkeys({\n zIndex: 20,\n keys: {\n esc: () => overlay && overlay.onClose()\n }\n });\n\n const container = useContainer();\n const settingsRepository = useMemo(() => container.resolve(GetSettingsRepository), [container]);\n const settings = settingsRepository.settings;\n\n const uploadFiles = async (files: SelectedFile[]) => {\n await actions.upload(files);\n toast.showSuccessToast({ title: \"File upload complete.\" });\n };\n\n useEffect(() => {\n const handlePaste = (e: ClipboardEvent) => {\n const items = e.clipboardData?.items;\n if (!items) {\n return;\n }\n\n const files: SelectedFile[] = [];\n for (let i = 0; i < items.length; i++) {\n if (items[i].kind === \"file\") {\n const file = items[i].getAsFile();\n if (file) {\n const name =\n file.name && file.name !== \"image.png\"\n ? file.name\n : `pasted-${Date.now()}.${file.type.split(\"/\")[1] || \"png\"}`;\n\n files.push({\n id: String(Date.now()) + \"-\" + i,\n name,\n type: file.type,\n size: file.size,\n src: { file, base64: null }\n });\n }\n }\n }\n\n if (files.length > 0) {\n e.preventDefault();\n void uploadFiles(files);\n }\n };\n\n document.addEventListener(\"paste\", handlePaste);\n return () => document.removeEventListener(\"paste\", handlePaste);\n }, [actions]);\n\n const onError = useCallback((errors: FileError[]) => {\n const message = outputFileSelectionError(errors);\n if (message) {\n toast.showWarningToast({ title: message });\n } else {\n toast.showWarningToast({ title: \"Couldn't process selected files.\" });\n console.error(errors);\n }\n }, []);\n\n const loadMoreOnScroll = useCallback(\n debounce(async (scrollFrame: ScrollPosition) => {\n if (scrollFrame.top > 0.8) {\n void actions.loadMore();\n }\n }, 200),\n [vm.list.pagination, actions]\n );\n\n if (!vm.fileModel) {\n return <OverlayLoader text={t`Preparing File Manager...`} />;\n }\n\n const renderList = (browseFiles: BrowserFilePickerRenderProps[\"browseFiles\"]) => {\n if (vm.loading) {\n return <OverlayLoader text={t`Loading files...`} size={\"lg\"} />;\n }\n\n if (vm.empty) {\n return <Empty isSearchResult={!vm.showFolders} browseFiles={browseFiles} />;\n }\n\n if (vm.viewMode === \"table\") {\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileTable />\n </ScrollArea>\n );\n }\n\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileGrid />\n </ScrollArea>\n );\n };\n\n const content = (\n <BrowserFilePicker\n multiple\n maxSize={settings ? settings.uploadMaxFileSize + \"b\" : \"1TB\"}\n multipleMaxSize={\"1TB\"}\n accept={overlay?.accept ?? []}\n onSuccess={uploadFiles}\n onError={onError}\n >\n {({ getDropZoneProps, browseFiles }) => (\n <>\n <FileDetailsDrawer />\n <SplitView namespace={\"fm/file/list\"}>\n <LeftPanel span={2}>\n <div className={\"flex flex-col h-full\"}>\n <div className={\"py-sm px-md\"}>\n <Heading level={5}>{t`File Manager`}</Heading>\n </div>\n <Separator />\n <div className={\"shrink-0 overflow-y-auto max-h-[66vh]\"}>\n <FolderTree\n vm={vm.folders}\n actions={actions.folders}\n folderActions={browser.folder.actions}\n dropConfirmation={browser.folder.dropConfirmation}\n enableActions={true}\n enableCreate={true}\n />\n </div>\n {browser.filterByTags ? (\n <>\n <Separator />\n <div className={\"flex-1 overflow-y-auto min-h-0\"}>\n <TagsList\n loading={false}\n activeTags={\n (vm.list.filters[\"tags\"] as string[]) ?? []\n }\n tags={vm.tags.map(tag => ({\n tag: tag.tag,\n count: tag.count\n }))}\n onActivatedTagsChange={tags => {\n if (tags.length > 0) {\n actions.filter.set(\"tags\", tags);\n } else {\n actions.filter.clear(\"tags\");\n actions.filter.clear(\"tags_rule\");\n }\n }}\n />\n </div>\n </>\n ) : null}\n </div>\n </LeftPanel>\n <RightPanel span={10}>\n <div className={\"flex flex-col relative h-full overflow-hidden\"}>\n <FileManagerHeader browseFiles={browseFiles} />\n <div\n className={\"flex-1 min-h-0 overflow-hidden\"}\n {...getDropZoneProps({\n onDragEnter: () => actions.setDragging(true),\n onDrop: () => actions.setDragging(false),\n onDragLeave: (e: React.DragEvent) => {\n if (\n !e.relatedTarget ||\n !e.currentTarget.contains(e.relatedTarget as Node)\n ) {\n actions.setDragging(false);\n }\n }\n })}\n data-testid={\"fm-list-wrapper\"}\n >\n {!overlay && <BulkActionBar />}\n {renderList(browseFiles)}\n {vm.dragging && <FileDropPlaceholder />}\n <UploadProgress />\n </div>\n <BottomInfoBar\n accept={overlay?.accept ?? []}\n listing={vm.list.pagination.loadingMore}\n loading={vm.list.pagination.loading}\n totalCount={vm.list.pagination.totalCount}\n currentCount={vm.list.pagination.currentCount}\n />\n </div>\n </RightPanel>\n </SplitView>\n </>\n )}\n </BrowserFilePicker>\n );\n\n if (overlay) {\n return (\n <OverlayLayout variant={\"strong\"} onExited={() => overlay.onClose()}>\n {content}\n </OverlayLayout>\n );\n }\n\n return content;\n});\n\n// ---------------------------------------------------------------------------\n// Inner component that resolves the presenter from the scoped container.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewInner = observer(\n ({\n overlay = false,\n onChange,\n onClose,\n multiple,\n accept,\n scope,\n children\n }: FileManagerViewProps) => {\n const { presenter } = useFeature(FileManagerPresenterFeature);\n\n const overlayConfig = useMemo(() => {\n if (!overlay || !onChange || !onClose) {\n return null;\n }\n\n const handleFileClick = (file: FmFile) => {\n if (multiple) {\n presenter.actions.selection.toggle(file.id);\n } else {\n onChange([file]);\n }\n };\n\n const confirmSelection = () => {\n const selectedIds = presenter.vm.list.selection.selectedIds;\n const selectedFiles = presenter.vm.list.rows.filter(f => selectedIds.has(f.id));\n if (selectedFiles.length > 0) {\n onChange(selectedFiles);\n }\n };\n\n return {\n onFileClick: handleFileClick,\n confirmSelection,\n onClose,\n accept: accept ?? [],\n multiple: multiple ?? false\n };\n }, [overlay, onChange, onClose, multiple, accept]);\n\n useEffect(() => {\n presenter.init({ scope, accept: accept ?? undefined });\n return () => presenter.dispose();\n }, [presenter, overlay, scope]);\n\n const inner = (\n <DialogsProvider>\n <FileManagerViewWithConfig>\n <FileManagerPresenterProvider presenter={presenter}>\n <FileManagerViewLayout />\n {children}\n {!overlayConfig && <RouteParamsSync />}\n {!overlayConfig && <FileManagerBreadcrumbs />}\n </FileManagerPresenterProvider>\n </FileManagerViewWithConfig>\n </DialogsProvider>\n );\n\n if (overlayConfig) {\n return <OverlayProvider config={overlayConfig}>{inner}</OverlayProvider>;\n }\n\n return inner;\n }\n);\n\n// ---------------------------------------------------------------------------\n// FileManagerView — sets up DI container and renders the inner component.\n// ---------------------------------------------------------------------------\n\nexport const FileManagerView = (props: FileManagerViewProps) => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n\n SharedCacheFeature.register(child);\n FoldersFeature.register(child, { type: \"FmFile\" });\n FolderTreePresenterFeature.register(child);\n ListFilesFeature.register(child);\n GetFileFeature.register(child);\n DeleteFileFeature.register(child);\n UpdateFileFeature.register(child);\n FileUploaderFeature.register(child);\n ListTagsFeature.register(child);\n GetSettingsFeature.register(child);\n FileDetailsPresenterFeature.register(child);\n FileManagerPresenterFeature.register(child);\n\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <FileManagerViewInner {...props} />\n </DiContainerProvider>\n );\n};\n"],"names":["t","i18n","FileManagerViewLayout","observer","vm","actions","useFileManagerPresenter","browser","useFileManagerConfig","overlay","useOverlay","toast","useToast","useHotkeys","container","useContainer","settingsRepository","useMemo","GetSettingsRepository","settings","uploadFiles","files","useEffect","handlePaste","e","items","i","file","name","Date","String","document","onError","useCallback","errors","message","outputFileSelectionError","console","loadMoreOnScroll","debounce","scrollFrame","OverlayLoader","renderList","browseFiles","Empty","ScrollArea","FileTable","FileGrid","content","BrowserFilePicker","getDropZoneProps","FileDetailsDrawer","SplitView","LeftPanel","Heading","Separator","FolderTree","TagsList","tag","tags","RightPanel","FileManagerHeader","BulkActionBar","FileDropPlaceholder","UploadProgress","BottomInfoBar","OverlayLayout","FileManagerViewInner","onChange","onClose","multiple","accept","scope","children","presenter","useFeature","FileManagerPresenterFeature","overlayConfig","handleFileClick","confirmSelection","selectedIds","selectedFiles","f","undefined","inner","DialogsProvider","FileManagerViewWithConfig","FileManagerPresenterProvider","RouteParamsSync","FileManagerBreadcrumbs","OverlayProvider","FileManagerView","props","scopedContainer","child","SharedCacheFeature","FoldersFeature","FolderTreePresenterFeature","ListFilesFeature","GetFileFeature","DeleteFileFeature","UpdateFileFeature","FileUploaderFeature","ListTagsFeature","GetSettingsFeature","FileDetailsPresenterFeature","DiContainerProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAMlB,MAAMC,wCAAwBC,SAAS;IACnC,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAMC,UAAUC;IAChB,MAAMC,QAAQC;IAEdC,WAAW;QACP,QAAQ;QACR,MAAM;YACF,KAAK,IAAMJ,WAAWA,QAA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;QAErC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACY,qBAAmBA;QAAC,WAAWb;qBAC5B,oBAAC1B,sBAAyByB;AAGtC"}
|
|
1
|
+
{"version":3,"file":"presentation/FileManager/FileManagerView.js","sources":["../../../src/presentation/FileManager/FileManagerView.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useCallback } from \"react\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { observer } from \"mobx-react-lite\";\nimport {\n BrowserFilePicker,\n type BrowserFilePickerRenderProps\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport debounce from \"lodash/debounce.js\";\nimport { Heading, OverlayLoader, ScrollArea, Separator, useToast } from \"@webiny/admin-ui\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport {\n LeftPanel,\n OverlayLayout,\n RightPanel,\n SplitView,\n DialogsProvider,\n useHotkeys\n} from \"@webiny/app-admin\";\nimport { FoldersFeature } from \"@webiny/app-aco/features/folders/feature.js\";\nimport { FolderTreePresenterFeature } from \"@webiny/app-aco/presentation/folderTree/feature.js\";\nimport { FileManagerPresenterFeature } from \"~/presentation/FileList/feature.js\";\nimport {\n FileManagerPresenterProvider,\n useFileManagerPresenter\n} from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport { FileDetailsPresenterFeature } from \"~/presentation/FileDetails/feature.js\";\nimport { SharedCacheFeature } from \"~/features/shared/feature.js\";\nimport { ListFilesFeature } from \"~/features/listFiles/feature.js\";\nimport { GetFileFeature } from \"~/features/getFile/feature.js\";\nimport { DeleteFileFeature } from \"~/features/deleteFile/feature.js\";\nimport { UpdateFileFeature } from \"~/features/updateFile/feature.js\";\nimport { FileUploaderFeature } from \"~/features/fileUploader/feature.js\";\nimport { ListTagsFeature } from \"~/features/tags/feature.js\";\nimport { GetSettingsFeature } from \"~/features/settings/feature.js\";\nimport {\n FileManagerViewWithConfig,\n useFileManagerConfig\n} from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FolderTree } from \"@webiny/app-aco/presentation/folderTree/FolderTree.js\";\nimport { BottomInfoBar } from \"~/presentation/FileList/components/BottomInfoBar/index.js\";\nimport { BulkActionBar } from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { FileDropPlaceholder } from \"~/presentation/FileList/components/FileDropPlaceholder/index.js\";\nimport { Empty } from \"~/presentation/FileList/components/Empty/index.js\";\nimport { FileDetailsDrawer } from \"~/presentation/FileDetails/components/FileDetailsDrawer.js\";\nimport { FileGrid } from \"~/presentation/FileList/components/Grid/index.js\";\nimport { FileManagerHeader } from \"~/presentation/FileList/components/Header/FileManagerHeader.js\";\nimport { FileTable } from \"~/presentation/FileList/components/Table/index.js\";\nimport { TagsList } from \"~/presentation/FileList/components/TagsList/index.js\";\nimport { UploadProgress } from \"~/presentation/FileList/components/Upload/index.js\";\nimport { GetSettingsRepository } from \"~/features/settings/abstractions.js\";\nimport { OverlayProvider, useOverlay } from \"./OverlayContext.js\";\nimport { RouteParamsSync } from \"./RouteParamsSync.js\";\nimport { FileManagerBreadcrumbs } from \"./FileManagerBreadcrumbs.js\";\n\nimport type { FmFile } from \"~/features/shared/types.js\";\nimport type {\n FileError,\n SelectedFile\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport { outputFileSelectionError } from \"~/presentation/FileManager/outputFileSelectionError.js\";\nimport type { ScrollPosition } from \"@webiny/admin-ui\";\n\nexport interface FileManagerViewProps {\n overlay?: boolean;\n onChange?: (files: FmFile[]) => void;\n onClose?: () => void;\n multiple?: boolean;\n accept?: string[];\n scope?: string;\n /**\n * Keep the folder and search in the File Manager route's address (its own screen). Off for a\n * File Manager embedded in another screen, which must not write to (or navigate to) that route.\n */\n syncRoute?: boolean;\n children?: React.ReactNode;\n}\n\nconst t = i18n.ns(\"app-admin/file-manager/file-manager-view\");\n\n// ---------------------------------------------------------------------------\n// Layout — uses original UI components, wired to the presenter.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewLayout = observer(function FileManagerViewLayout() {\n const { vm, actions } = useFileManagerPresenter();\n const { browser } = useFileManagerConfig();\n const overlay = useOverlay();\n const toast = useToast();\n\n useHotkeys({\n zIndex: 20,\n keys: {\n esc: () => overlay && overlay.onClose()\n }\n });\n\n const container = useContainer();\n const settingsRepository = useMemo(() => container.resolve(GetSettingsRepository), [container]);\n const settings = settingsRepository.settings;\n\n const uploadFiles = async (files: SelectedFile[]) => {\n await actions.upload(files);\n toast.showSuccessToast({ title: \"File upload complete.\" });\n };\n\n useEffect(() => {\n const handlePaste = (e: ClipboardEvent) => {\n const items = e.clipboardData?.items;\n if (!items) {\n return;\n }\n\n const files: SelectedFile[] = [];\n for (let i = 0; i < items.length; i++) {\n if (items[i].kind === \"file\") {\n const file = items[i].getAsFile();\n if (file) {\n const name =\n file.name && file.name !== \"image.png\"\n ? file.name\n : `pasted-${Date.now()}.${file.type.split(\"/\")[1] || \"png\"}`;\n\n files.push({\n id: String(Date.now()) + \"-\" + i,\n name,\n type: file.type,\n size: file.size,\n src: { file, base64: null }\n });\n }\n }\n }\n\n if (files.length > 0) {\n e.preventDefault();\n void uploadFiles(files);\n }\n };\n\n document.addEventListener(\"paste\", handlePaste);\n return () => document.removeEventListener(\"paste\", handlePaste);\n }, [actions]);\n\n const onError = useCallback((errors: FileError[]) => {\n const message = outputFileSelectionError(errors);\n if (message) {\n toast.showWarningToast({ title: message });\n } else {\n toast.showWarningToast({ title: \"Couldn't process selected files.\" });\n console.error(errors);\n }\n }, []);\n\n const loadMoreOnScroll = useCallback(\n debounce(async (scrollFrame: ScrollPosition) => {\n if (scrollFrame.top > 0.8) {\n void actions.loadMore();\n }\n }, 200),\n [vm.list.pagination, actions]\n );\n\n if (!vm.fileModel) {\n return <OverlayLoader text={t`Preparing File Manager...`} />;\n }\n\n const renderList = (browseFiles: BrowserFilePickerRenderProps[\"browseFiles\"]) => {\n if (vm.loading) {\n return <OverlayLoader text={t`Loading files...`} size={\"lg\"} />;\n }\n\n if (vm.empty) {\n return <Empty isSearchResult={!vm.showFolders} browseFiles={browseFiles} />;\n }\n\n if (vm.viewMode === \"table\") {\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileTable />\n </ScrollArea>\n );\n }\n\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileGrid />\n </ScrollArea>\n );\n };\n\n const content = (\n <BrowserFilePicker\n multiple\n maxSize={settings ? settings.uploadMaxFileSize + \"b\" : \"1TB\"}\n multipleMaxSize={\"1TB\"}\n accept={overlay?.accept ?? []}\n onSuccess={uploadFiles}\n onError={onError}\n >\n {({ getDropZoneProps, browseFiles }) => (\n <>\n <FileDetailsDrawer />\n <SplitView namespace={\"fm/file/list\"}>\n <LeftPanel span={2}>\n <div className={\"flex flex-col h-full\"}>\n <div className={\"py-sm px-md\"}>\n <Heading level={5}>{t`File Manager`}</Heading>\n </div>\n <Separator />\n <div className={\"shrink-0 overflow-y-auto max-h-[66vh]\"}>\n <FolderTree\n vm={vm.folders}\n actions={actions.folders}\n folderActions={browser.folder.actions}\n dropConfirmation={browser.folder.dropConfirmation}\n enableActions={true}\n enableCreate={true}\n />\n </div>\n {browser.filterByTags ? (\n <>\n <Separator />\n <div className={\"flex-1 overflow-y-auto min-h-0\"}>\n <TagsList\n loading={false}\n activeTags={\n (vm.list.filters[\"tags\"] as string[]) ?? []\n }\n tags={vm.tags.map(tag => ({\n tag: tag.tag,\n count: tag.count\n }))}\n onActivatedTagsChange={tags => {\n if (tags.length > 0) {\n actions.filter.set(\"tags\", tags);\n } else {\n actions.filter.clear(\"tags\");\n actions.filter.clear(\"tags_rule\");\n }\n }}\n />\n </div>\n </>\n ) : null}\n </div>\n </LeftPanel>\n <RightPanel span={10}>\n <div className={\"flex flex-col relative h-full overflow-hidden\"}>\n <FileManagerHeader browseFiles={browseFiles} />\n <div\n className={\"flex-1 min-h-0 overflow-hidden\"}\n {...getDropZoneProps({\n onDragEnter: () => actions.setDragging(true),\n onDrop: () => actions.setDragging(false),\n onDragLeave: (e: React.DragEvent) => {\n if (\n !e.relatedTarget ||\n !e.currentTarget.contains(e.relatedTarget as Node)\n ) {\n actions.setDragging(false);\n }\n }\n })}\n data-testid={\"fm-list-wrapper\"}\n >\n {!overlay && <BulkActionBar />}\n {renderList(browseFiles)}\n {vm.dragging && <FileDropPlaceholder />}\n <UploadProgress />\n </div>\n <BottomInfoBar\n accept={overlay?.accept ?? []}\n listing={vm.list.pagination.loadingMore}\n loading={vm.list.pagination.loading}\n totalCount={vm.list.pagination.totalCount}\n currentCount={vm.list.pagination.currentCount}\n />\n </div>\n </RightPanel>\n </SplitView>\n </>\n )}\n </BrowserFilePicker>\n );\n\n if (overlay) {\n return (\n <OverlayLayout variant={\"strong\"} onExited={() => overlay.onClose()}>\n {content}\n </OverlayLayout>\n );\n }\n\n return content;\n});\n\n// ---------------------------------------------------------------------------\n// Inner component that resolves the presenter from the scoped container.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewInner = observer(\n ({\n overlay = false,\n onChange,\n onClose,\n multiple,\n accept,\n scope,\n syncRoute = true,\n children\n }: FileManagerViewProps) => {\n const { presenter } = useFeature(FileManagerPresenterFeature);\n\n const overlayConfig = useMemo(() => {\n if (!overlay || !onChange || !onClose) {\n return null;\n }\n\n const handleFileClick = (file: FmFile) => {\n if (multiple) {\n presenter.actions.selection.toggle(file.id);\n } else {\n onChange([file]);\n }\n };\n\n const confirmSelection = () => {\n const selectedIds = presenter.vm.list.selection.selectedIds;\n const selectedFiles = presenter.vm.list.rows.filter(f => selectedIds.has(f.id));\n if (selectedFiles.length > 0) {\n onChange(selectedFiles);\n }\n };\n\n return {\n onFileClick: handleFileClick,\n confirmSelection,\n onClose,\n accept: accept ?? [],\n multiple: multiple ?? false\n };\n }, [overlay, onChange, onClose, multiple, accept]);\n\n useEffect(() => {\n presenter.init({ scope, accept: accept ?? undefined });\n return () => presenter.dispose();\n }, [presenter, overlay, scope]);\n\n const inner = (\n <DialogsProvider>\n <FileManagerViewWithConfig>\n <FileManagerPresenterProvider presenter={presenter}>\n <FileManagerViewLayout />\n {children}\n {!overlayConfig && syncRoute && <RouteParamsSync />}\n {!overlayConfig && syncRoute && <FileManagerBreadcrumbs />}\n </FileManagerPresenterProvider>\n </FileManagerViewWithConfig>\n </DialogsProvider>\n );\n\n if (overlayConfig) {\n return <OverlayProvider config={overlayConfig}>{inner}</OverlayProvider>;\n }\n\n return inner;\n }\n);\n\n// ---------------------------------------------------------------------------\n// FileManagerView — sets up DI container and renders the inner component.\n// ---------------------------------------------------------------------------\n\nexport const FileManagerView = (props: FileManagerViewProps) => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n\n SharedCacheFeature.register(child);\n FoldersFeature.register(child, { type: \"FmFile\" });\n FolderTreePresenterFeature.register(child);\n ListFilesFeature.register(child);\n GetFileFeature.register(child);\n DeleteFileFeature.register(child);\n UpdateFileFeature.register(child);\n FileUploaderFeature.register(child);\n ListTagsFeature.register(child);\n GetSettingsFeature.register(child);\n FileDetailsPresenterFeature.register(child);\n FileManagerPresenterFeature.register(child);\n\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <FileManagerViewInner {...props} />\n </DiContainerProvider>\n );\n};\n"],"names":["t","i18n","FileManagerViewLayout","observer","vm","actions","useFileManagerPresenter","browser","useFileManagerConfig","overlay","useOverlay","toast","useToast","useHotkeys","container","useContainer","settingsRepository","useMemo","GetSettingsRepository","settings","uploadFiles","files","useEffect","handlePaste","e","items","i","file","name","Date","String","document","onError","useCallback","errors","message","outputFileSelectionError","console","loadMoreOnScroll","debounce","scrollFrame","OverlayLoader","renderList","browseFiles","Empty","ScrollArea","FileTable","FileGrid","content","BrowserFilePicker","getDropZoneProps","FileDetailsDrawer","SplitView","LeftPanel","Heading","Separator","FolderTree","TagsList","tag","tags","RightPanel","FileManagerHeader","BulkActionBar","FileDropPlaceholder","UploadProgress","BottomInfoBar","OverlayLayout","FileManagerViewInner","onChange","onClose","multiple","accept","scope","syncRoute","children","presenter","useFeature","FileManagerPresenterFeature","overlayConfig","handleFileClick","confirmSelection","selectedIds","selectedFiles","f","undefined","inner","DialogsProvider","FileManagerViewWithConfig","FileManagerPresenterProvider","RouteParamsSync","FileManagerBreadcrumbs","OverlayProvider","FileManagerView","props","scopedContainer","child","SharedCacheFeature","FoldersFeature","FolderTreePresenterFeature","ListFilesFeature","GetFileFeature","DeleteFileFeature","UpdateFileFeature","FileUploaderFeature","ListTagsFeature","GetSettingsFeature","FileDetailsPresenterFeature","DiContainerProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAMlB,MAAMC,wCAAwBC,SAAS;IACnC,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAMC,UAAUC;IAChB,MAAMC,QAAQC;IAEdC,WAAW;QACP,QAAQ;QACR,MAAM;YACF,KAAK,IAAMJ,WAAWA,QAAQ,OAAO;QACzC;IACJ;IAEA,MAAMK,YAAYC;IAClB,MAAMC,qBAAqBC,QAAQ,IAAMH,UAAU,OAAO,CAACI,wBAAwB;QAACJ;KAAU;IAC9F,MAAMK,WAAWH,mBAAmB,QAAQ;IAE5C,MAAMI,cAAc,OAAOC;QACvB,MAAMhB,QAAQ,MAAM,CAACgB;QACrBV,MAAM,gBAAgB,CAAC;YAAE,OAAO;QAAwB;IAC5D;IAEAW,UAAU;QACN,MAAMC,cAAc,CAACC;YACjB,MAAMC,QAAQD,EAAE,aAAa,EAAE;YAC/B,IAAI,CAACC,OACD;YAGJ,MAAMJ,QAAwB,EAAE;YAChC,IAAK,IAAIK,IAAI,GAAGA,IAAID,MAAM,MAAM,EAAEC,IAC9B,IAAID,AAAkB,WAAlBA,KAAK,CAACC,EAAE,CAAC,IAAI,EAAa;gBAC1B,MAAMC,OAAOF,KAAK,CAACC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AACI,iBAAiBL,aAAa,WAAbA,GAAa,oBAACgB,iBAAeA,OAC/C,CAACX,iBAAiBL,aAAa,WAAbA,GAAa,oBAACiB,wBAAsBA;IAMvE,IAAIZ,eACA,OAAO,WAAP,GAAO,oBAACa,iBAAeA;QAAC,QAAQb;OAAgBO;IAGpD,OAAOA;AACX;AAOG,MAAMO,kBAAkB,CAACC;IAC5B,MAAM/E,YAAYC;IAElB,MAAM+E,kBAAkB7E,QAAQ;QAC5B,MAAM8E,QAAQjF,UAAU,oBAAoB;QAE5CkF,mBAAmB,QAAQ,CAACD;QAC5BE,eAAe,QAAQ,CAACF,OAAO;YAAE,MAAM;QAAS;QAChDG,2BAA2B,QAAQ,CAACH;QACpCI,iBAAiB,QAAQ,CAACJ;QAC1BK,eAAe,QAAQ,CAACL;QACxBM,kBAAkB,QAAQ,CAACN;QAC3BO,kBAAkB,QAAQ,CAACP;QAC3BQ,oBAAoB,QAAQ,CAACR;QAC7BS,gBAAgB,QAAQ,CAACT;QACzBU,mBAAmB,QAAQ,CAACV;QAC5BW,4BAA4B,QAAQ,CAACX;QACrClB,4BAA4B,QAAQ,CAACkB;QAErC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACY,qBAAmBA;QAAC,WAAWb;qBAC5B,oBAAC3B,sBAAyB0B;AAGtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/FileManager/OverlayContext.js","sources":["../../../src/presentation/FileManager/OverlayContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport type { FmFile } from \"~/features/shared/types.js\";\n\nexport interface OverlayConfig {\n onFileClick: (file: FmFile) => void;\n confirmSelection: () => void;\n onClose: () => void;\n accept: string[];\n multiple: boolean;\n}\n\nconst OverlayCtx = createContext<OverlayConfig | null>(null);\n\nexport const OverlayProvider = ({\n config,\n children\n}: {\n config: OverlayConfig;\n children: React.ReactNode;\n}) => {\n return <OverlayCtx.Provider value={config}>{children}</OverlayCtx.Provider>;\n};\n\nexport function useOverlay(): OverlayConfig | null {\n return useContext(OverlayCtx);\n}\n"],"names":["OverlayCtx","createContext","OverlayProvider","config","children","useOverlay","useContext"],"mappings":";AAWA,MAAMA,aAAa,
|
|
1
|
+
{"version":3,"file":"presentation/FileManager/OverlayContext.js","sources":["../../../src/presentation/FileManager/OverlayContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport type { FmFile } from \"~/features/shared/types.js\";\n\nexport interface OverlayConfig {\n onFileClick: (file: FmFile) => void;\n confirmSelection: () => void;\n onClose: () => void;\n accept: string[];\n multiple: boolean;\n}\n\nconst OverlayCtx = createContext<OverlayConfig | null>(null);\n\nexport const OverlayProvider = ({\n config,\n children\n}: {\n config: OverlayConfig;\n children: React.ReactNode;\n}) => {\n return <OverlayCtx.Provider value={config}>{children}</OverlayCtx.Provider>;\n};\n\nexport function useOverlay(): OverlayConfig | null {\n return useContext(OverlayCtx);\n}\n"],"names":["OverlayCtx","createContext","OverlayProvider","config","children","useOverlay","useContext"],"mappings":";AAWA,MAAMA,aAAa,WAAbA,GAAaC,cAAoC;AAEhD,MAAMC,kBAAkB,CAAC,EAC5BC,MAAM,EACNC,QAAQ,EAIX,GACU,WAAP,GAAO,oBAACJ,WAAW,QAAQ;QAAC,OAAOG;OAASC;AAGzC,SAASC;IACZ,OAAOC,WAAWN;AACtB"}
|
|
@@ -13,7 +13,7 @@ import { FilePreviewImageRenderer } from "./thumbnailRenderers/FilePreviewImageR
|
|
|
13
13
|
import { TableItemDefaultRenderer } from "./thumbnailRenderers/TableItemDefaultRenderer.js";
|
|
14
14
|
import { TableItemImageRenderer } from "./thumbnailRenderers/TableItemImageRenderer.js";
|
|
15
15
|
import { FilePreviewDefaultRenderer } from "./thumbnailRenderers/FilePreviewDefaultRenderer.js";
|
|
16
|
-
const { Browser
|
|
16
|
+
const { Browser, FileDetails } = FileManagerViewConfig;
|
|
17
17
|
const PrivateFilesBulkEditField = ()=>{
|
|
18
18
|
const featureFlags = useFeatureFlags();
|
|
19
19
|
if (!featureFlags.isEnabled("advancedAccessControlLayer.privateFiles")) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/DefaultFileManagerConfig.js","sources":["../../../src/presentation/config/DefaultFileManagerConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { useFeatureFlags } from \"@webiny/app-admin\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport { FileManagerViewConfig as FileManagerConfig } from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FilterByType } from \"~/presentation/FileList/components/Filters/FilterByType.js\";\nimport {\n BulkActionDelete,\n BulkActionMove\n} from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { Tags, AccessControl } from \"~/presentation/config/fields/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellModified,\n CellName,\n CellSize,\n CellType,\n CopyFile,\n DeleteFile,\n EditFile,\n MoveFile\n} from \"~/presentation/FileList/components/Table/index.js\";\nimport { GridItemDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/GridItemDefaultRenderer.js\";\nimport { GridItemImageRenderer } from \"~/presentation/config/thumbnailRenderers/GridItemImageRenderer.js\";\nimport { FileActions } from \"~/presentation/FileActions/index.js\";\nimport { FilePreviewImageRenderer } from \"~/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js\";\nimport { TableItemDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/TableItemDefaultRenderer.js\";\nimport { TableItemImageRenderer } from \"~/presentation/config/thumbnailRenderers/TableItemImageRenderer.js\";\nimport { FilePreviewDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/FilePreviewDefaultRenderer.js\";\n\nconst { Browser, FileDetails } = FileManagerConfig;\n\nconst PrivateFilesBulkEditField = () => {\n const featureFlags = useFeatureFlags();\n if (!featureFlags.isEnabled(\"advancedAccessControlLayer.privateFiles\")) {\n return null;\n }\n return (\n <Browser.BulkEditField\n name={\"accessControl\"}\n element={<AccessControl placeholder={\"Select privacy settings\"} />}\n />\n );\n};\n\nexport const DefaultFileManagerConfig = () => {\n return (\n <FileManagerConfig>\n {/* Filters */}\n <Browser.FilterByTags />\n <Browser.Filter name={\"type\"} element={<FilterByType />} />\n {/* Bulk Actions */}\n <Browser.BulkAction name={\"move\"} element={<BulkActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<BulkActionDelete />} />\n {/* Folder Actions */}\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n {/* File Actions */}\n <Browser.File.Action name={\"copy\"} element={<CopyFile />} />\n <Browser.File.Action name={\"edit\"} element={<EditFile />} />\n <Browser.File.Action name={\"move\"} element={<MoveFile />} />\n <Browser.File.Action name={\"delete\"} element={<DeleteFile />} />\n {/* Table Columns */}\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"type\"} header={\"Type\"} cell={<CellType />} />\n <Browser.Table.Column\n name={\"size\"}\n header={\"Size\"}\n cell={<CellSize />}\n sortable={true}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"actions\"}\n header={\" \"}\n cell={<CellActions />}\n size={56}\n truncate={false}\n className={\"flex justify-center\"}\n hideable={false}\n resizable={false}\n />\n <Browser.BulkEditField name={\"tags\"} element={<Tags />} />\n {/* File Details Actions */}\n <FileActions />\n {/* Access Control */}\n <PrivateFilesBulkEditField />\n {/* Grid Thumbnail */}\n <Browser.Grid.Item.Thumbnail type={\"*/*\"} element={<GridItemDefaultRenderer />} />\n <Browser.Grid.Item.Thumbnail type={\"image/*\"} element={<GridItemImageRenderer />} />\n {/* Table Thumbnail */}\n <Browser.Table.Cell.Thumbnail type={\"image/*\"} element={<TableItemImageRenderer />} />\n <Browser.Table.Cell.Thumbnail type={\"*/*\"} element={<TableItemDefaultRenderer />} />\n {/* File Details Thumbnail */}\n <FileDetails.Preview.Thumbnail type={\"*/*\"} element={<FilePreviewDefaultRenderer />} />\n <FileDetails.Preview.Thumbnail\n type={\"image/*\"}\n element={<FilePreviewImageRenderer />}\n />\n </FileManagerConfig>\n );\n};\n"],"names":["Browser","FileDetails","FileManagerConfig","PrivateFilesBulkEditField","featureFlags","useFeatureFlags","AccessControl","DefaultFileManagerConfig","FilterByType","BulkActionMove","BulkActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","CopyFile","EditFile","MoveFile","DeleteFile","CellName","CellType","CellSize","CellAuthor","CellCreated","CellModified","CellActions","Tags","FileActions","GridItemDefaultRenderer","GridItemImageRenderer","TableItemImageRenderer","TableItemDefaultRenderer","FilePreviewDefaultRenderer","FilePreviewImageRenderer"],"mappings":";;;;;;;;;;;;;;;AA+BA,MAAM,EAAEA,
|
|
1
|
+
{"version":3,"file":"presentation/config/DefaultFileManagerConfig.js","sources":["../../../src/presentation/config/DefaultFileManagerConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { useFeatureFlags } from \"@webiny/app-admin\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport { FileManagerViewConfig as FileManagerConfig } from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FilterByType } from \"~/presentation/FileList/components/Filters/FilterByType.js\";\nimport {\n BulkActionDelete,\n BulkActionMove\n} from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { Tags, AccessControl } from \"~/presentation/config/fields/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellModified,\n CellName,\n CellSize,\n CellType,\n CopyFile,\n DeleteFile,\n EditFile,\n MoveFile\n} from \"~/presentation/FileList/components/Table/index.js\";\nimport { GridItemDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/GridItemDefaultRenderer.js\";\nimport { GridItemImageRenderer } from \"~/presentation/config/thumbnailRenderers/GridItemImageRenderer.js\";\nimport { FileActions } from \"~/presentation/FileActions/index.js\";\nimport { FilePreviewImageRenderer } from \"~/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js\";\nimport { TableItemDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/TableItemDefaultRenderer.js\";\nimport { TableItemImageRenderer } from \"~/presentation/config/thumbnailRenderers/TableItemImageRenderer.js\";\nimport { FilePreviewDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/FilePreviewDefaultRenderer.js\";\n\nconst { Browser, FileDetails } = FileManagerConfig;\n\nconst PrivateFilesBulkEditField = () => {\n const featureFlags = useFeatureFlags();\n if (!featureFlags.isEnabled(\"advancedAccessControlLayer.privateFiles\")) {\n return null;\n }\n return (\n <Browser.BulkEditField\n name={\"accessControl\"}\n element={<AccessControl placeholder={\"Select privacy settings\"} />}\n />\n );\n};\n\nexport const DefaultFileManagerConfig = () => {\n return (\n <FileManagerConfig>\n {/* Filters */}\n <Browser.FilterByTags />\n <Browser.Filter name={\"type\"} element={<FilterByType />} />\n {/* Bulk Actions */}\n <Browser.BulkAction name={\"move\"} element={<BulkActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<BulkActionDelete />} />\n {/* Folder Actions */}\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n {/* File Actions */}\n <Browser.File.Action name={\"copy\"} element={<CopyFile />} />\n <Browser.File.Action name={\"edit\"} element={<EditFile />} />\n <Browser.File.Action name={\"move\"} element={<MoveFile />} />\n <Browser.File.Action name={\"delete\"} element={<DeleteFile />} />\n {/* Table Columns */}\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"type\"} header={\"Type\"} cell={<CellType />} />\n <Browser.Table.Column\n name={\"size\"}\n header={\"Size\"}\n cell={<CellSize />}\n sortable={true}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"actions\"}\n header={\" \"}\n cell={<CellActions />}\n size={56}\n truncate={false}\n className={\"flex justify-center\"}\n hideable={false}\n resizable={false}\n />\n <Browser.BulkEditField name={\"tags\"} element={<Tags />} />\n {/* File Details Actions */}\n <FileActions />\n {/* Access Control */}\n <PrivateFilesBulkEditField />\n {/* Grid Thumbnail */}\n <Browser.Grid.Item.Thumbnail type={\"*/*\"} element={<GridItemDefaultRenderer />} />\n <Browser.Grid.Item.Thumbnail type={\"image/*\"} element={<GridItemImageRenderer />} />\n {/* Table Thumbnail */}\n <Browser.Table.Cell.Thumbnail type={\"image/*\"} element={<TableItemImageRenderer />} />\n <Browser.Table.Cell.Thumbnail type={\"*/*\"} element={<TableItemDefaultRenderer />} />\n {/* File Details Thumbnail */}\n <FileDetails.Preview.Thumbnail type={\"*/*\"} element={<FilePreviewDefaultRenderer />} />\n <FileDetails.Preview.Thumbnail\n type={\"image/*\"}\n element={<FilePreviewImageRenderer />}\n />\n </FileManagerConfig>\n );\n};\n"],"names":["Browser","FileDetails","FileManagerConfig","PrivateFilesBulkEditField","featureFlags","useFeatureFlags","AccessControl","DefaultFileManagerConfig","FilterByType","BulkActionMove","BulkActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","CopyFile","EditFile","MoveFile","DeleteFile","CellName","CellType","CellSize","CellAuthor","CellCreated","CellModified","CellActions","Tags","FileActions","GridItemDefaultRenderer","GridItemImageRenderer","TableItemImageRenderer","TableItemDefaultRenderer","FilePreviewDefaultRenderer","FilePreviewImageRenderer"],"mappings":";;;;;;;;;;;;;;;AA+BA,MAAM,EAAEA,OAAO,EAAEC,WAAW,EAAE,GAAGC;AAEjC,MAAMC,4BAA4B;IAC9B,MAAMC,eAAeC;IACrB,IAAI,CAACD,aAAa,SAAS,CAAC,4CACxB,OAAO;IAEX,OAAO,WAAP,GACI,oBAACJ,QAAQ,aAAa;QAClB,MAAM;QACN,uBAAS,oBAACM,eAAaA;YAAC,aAAa;;;AAGjD;AAEO,MAAMC,2BAA2B,IAC7B,WAAP,GACI,oBAACL,uBAAiBA,MAAAA,WAAAA,GAEd,oBAACF,QAAQ,YAAY,uBACrB,oBAACA,QAAQ,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACQ,cAAYA;sBAEpD,oBAACR,QAAQ,UAAU;QAAC,MAAM;QAAQ,uBAAS,oBAACS,gBAAcA;sBAC1D,oBAACT,QAAQ,UAAU;QAAC,MAAM;QAAU,uBAAS,oBAACU,kBAAgBA;sBAE9D,oBAACV,QAAQ,MAAM,CAAC,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACW,YAAUA;sBACzD,oBAACX,QAAQ,MAAM,CAAC,MAAM;QAAC,MAAM;QAAe,uBAAS,oBAACY,sBAAoBA;sBAC1E,oBAACZ,QAAQ,MAAM,CAAC,MAAM;QAAC,MAAM;QAAU,uBAAS,oBAACa,cAAYA;sBAE7D,oBAACb,QAAQ,IAAI,CAAC,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACc,UAAQA;sBACrD,oBAACd,QAAQ,IAAI,CAAC,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACe,UAAQA;sBACrD,oBAACf,QAAQ,IAAI,CAAC,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACgB,UAAQA;sBACrD,oBAAChB,QAAQ,IAAI,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AC,MAAM;QAAW,uBAAS,oBAAC6B,wBAAsBA;sBAC/E,oBAAC7B,QAAQ,KAAK,CAAC,IAAI,CAAC,SAAS;QAAC,MAAM;QAAO,uBAAS,oBAAC8B,0BAAwBA;sBAE7E,oBAAC7B,YAAY,OAAO,CAAC,SAAS;QAAC,MAAM;QAAO,uBAAS,oBAAC8B,4BAA0BA;sBAChF,oBAAC9B,YAAY,OAAO,CAAC,SAAS;QAC1B,MAAM;QACN,uBAAS,oBAAC+B,0BAAwBA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
3
|
+
import { act, cleanup, render } from "@testing-library/react";
|
|
4
|
+
import { CompositionProvider } from "@webiny/react-composition";
|
|
5
|
+
import { FileManagerViewConfig, FileManagerViewWithConfig, useFileManagerConfig } from "./FileManagerViewConfig.js";
|
|
6
|
+
const { Browser } = FileManagerViewConfig;
|
|
7
|
+
const DEFAULT_COLUMNS = [
|
|
8
|
+
"name",
|
|
9
|
+
"type",
|
|
10
|
+
"size",
|
|
11
|
+
"createdBy",
|
|
12
|
+
"createdOn",
|
|
13
|
+
"savedOn",
|
|
14
|
+
"actions"
|
|
15
|
+
];
|
|
16
|
+
const DefaultTableConfig = ()=>/*#__PURE__*/ react.createElement(FileManagerViewConfig, null, /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
17
|
+
name: "name",
|
|
18
|
+
header: "Name",
|
|
19
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "name"),
|
|
20
|
+
sortable: true,
|
|
21
|
+
hideable: false,
|
|
22
|
+
size: 200
|
|
23
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
24
|
+
name: "type",
|
|
25
|
+
header: "Type",
|
|
26
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "type")
|
|
27
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
28
|
+
name: "size",
|
|
29
|
+
header: "Size",
|
|
30
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "size"),
|
|
31
|
+
sortable: true
|
|
32
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
33
|
+
name: "createdBy",
|
|
34
|
+
header: "Author",
|
|
35
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "author")
|
|
36
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
37
|
+
name: "createdOn",
|
|
38
|
+
header: "Created",
|
|
39
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "created"),
|
|
40
|
+
sortable: true
|
|
41
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
42
|
+
name: "savedOn",
|
|
43
|
+
header: "Modified",
|
|
44
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "modified"),
|
|
45
|
+
sortable: true
|
|
46
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
47
|
+
name: "actions",
|
|
48
|
+
header: " ",
|
|
49
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "actions"),
|
|
50
|
+
size: 56,
|
|
51
|
+
truncate: false,
|
|
52
|
+
className: "flex justify-center",
|
|
53
|
+
hideable: false,
|
|
54
|
+
resizable: false
|
|
55
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Cell.Thumbnail, {
|
|
56
|
+
type: "image/*",
|
|
57
|
+
element: /*#__PURE__*/ react.createElement("span", null, "image")
|
|
58
|
+
}), /*#__PURE__*/ react.createElement(Browser.Table.Cell.Thumbnail, {
|
|
59
|
+
type: "*/*",
|
|
60
|
+
element: /*#__PURE__*/ react.createElement("span", null, "file")
|
|
61
|
+
}));
|
|
62
|
+
async function flush() {
|
|
63
|
+
await act(async ()=>{
|
|
64
|
+
await new Promise((resolve)=>setTimeout(resolve, 10));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async function renderConfig(extension) {
|
|
68
|
+
let config;
|
|
69
|
+
const Probe = ()=>{
|
|
70
|
+
config = useFileManagerConfig();
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
render(/*#__PURE__*/ react.createElement(CompositionProvider, null, /*#__PURE__*/ react.createElement(DefaultTableConfig, null), extension ? /*#__PURE__*/ react.createElement(FileManagerViewConfig, null, extension) : null, /*#__PURE__*/ react.createElement(FileManagerViewWithConfig, null, /*#__PURE__*/ react.createElement(Probe, null))));
|
|
74
|
+
await flush();
|
|
75
|
+
if (!config) throw new Error("The File Manager config was never delivered to its consumers.");
|
|
76
|
+
return config;
|
|
77
|
+
}
|
|
78
|
+
function columnNames(config) {
|
|
79
|
+
return config.browser.table.columns.map((column)=>column.name);
|
|
80
|
+
}
|
|
81
|
+
function expectThumbnails(config) {
|
|
82
|
+
expect(config.browser.table.cellThumbnails.map((thumbnail)=>thumbnail.type)).toEqual([
|
|
83
|
+
"image/*",
|
|
84
|
+
"*/*"
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
describe("File Manager config: table columns from an extension", ()=>{
|
|
88
|
+
afterEach(()=>{
|
|
89
|
+
cleanup();
|
|
90
|
+
});
|
|
91
|
+
it("holds the default columns when no extension changes them", async ()=>{
|
|
92
|
+
const config = await renderConfig();
|
|
93
|
+
expect(config.browser.table.columns).toBeDefined();
|
|
94
|
+
expect(columnNames(config)).toEqual(DEFAULT_COLUMNS);
|
|
95
|
+
expectThumbnails(config);
|
|
96
|
+
});
|
|
97
|
+
it("removes a default column", async ()=>{
|
|
98
|
+
const config = await renderConfig(/*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
99
|
+
name: "actions",
|
|
100
|
+
remove: true
|
|
101
|
+
}));
|
|
102
|
+
expect(config.browser.table.columns).toBeDefined();
|
|
103
|
+
expect(columnNames(config)).toEqual(DEFAULT_COLUMNS.filter((name)=>"actions" !== name));
|
|
104
|
+
expectThumbnails(config);
|
|
105
|
+
});
|
|
106
|
+
it("overrides a default column", async ()=>{
|
|
107
|
+
const config = await renderConfig(/*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
108
|
+
name: "name",
|
|
109
|
+
header: "Custom"
|
|
110
|
+
}));
|
|
111
|
+
expect(config.browser.table.columns).toBeDefined();
|
|
112
|
+
expect(columnNames(config)).toEqual(DEFAULT_COLUMNS);
|
|
113
|
+
const name = config.browser.table.columns.find((column)=>"name" === column.name);
|
|
114
|
+
expect(name?.header).toBe("Custom");
|
|
115
|
+
expectThumbnails(config);
|
|
116
|
+
});
|
|
117
|
+
it("adds a column alongside the defaults", async ()=>{
|
|
118
|
+
const config = await renderConfig(/*#__PURE__*/ react.createElement(Browser.Table.Column, {
|
|
119
|
+
name: "custom",
|
|
120
|
+
header: "Custom",
|
|
121
|
+
cell: /*#__PURE__*/ react.createElement("span", null, "custom")
|
|
122
|
+
}));
|
|
123
|
+
expect(config.browser.table.columns).toBeDefined();
|
|
124
|
+
expect(columnNames(config)).toEqual([
|
|
125
|
+
...DEFAULT_COLUMNS,
|
|
126
|
+
"custom"
|
|
127
|
+
]);
|
|
128
|
+
const custom = config.browser.table.columns.find((column)=>"custom" === column.name);
|
|
129
|
+
expect(custom?.header).toBe("Custom");
|
|
130
|
+
expectThumbnails(config);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=FileManagerViewConfig.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/config/FileManagerViewConfig.test.js","sources":["../../../src/presentation/config/FileManagerViewConfig.test.tsx"],"sourcesContent":["// @vitest-environment jsdom\n/**\n * An extension's `<FileManagerConfig><Browser.Table.Column … /></FileManagerConfig>`,\n * registered after the default config, must change the table's columns and nothing\n * else: `browser.table.columns` keeps the defaults (minus a removed one, with an\n * overridden one changed, plus an added one), and `browser.table.cellThumbnails`\n * stays populated. The table view maps over `browser.table.columns`, so if it goes\n * missing the File Manager crashes (webiny-js#6308).\n */\nimport React from \"react\";\nimport { afterEach, describe, expect, it } from \"vitest\";\nimport { act, cleanup, render } from \"@testing-library/react\";\nimport { CompositionProvider } from \"@webiny/react-composition\";\nimport {\n FileManagerViewConfig,\n FileManagerViewWithConfig,\n useFileManagerConfig\n} from \"./FileManagerViewConfig.js\";\n\nconst { Browser } = FileManagerViewConfig;\n\ntype FileManagerConfig = ReturnType<typeof useFileManagerConfig>;\n\nconst DEFAULT_COLUMNS = [\"name\", \"type\", \"size\", \"createdBy\", \"createdOn\", \"savedOn\", \"actions\"];\n\n/**\n * The table part of `DefaultFileManagerConfig`, in the same order: the columns,\n * then the table cell thumbnails. The real component also registers filters,\n * actions and a feature-flagged field, which need the admin's DI container;\n * they don't touch `browser.table`.\n */\nconst DefaultTableConfig = () => {\n return (\n <FileManagerViewConfig>\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<span>name</span>}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"type\"} header={\"Type\"} cell={<span>type</span>} />\n <Browser.Table.Column\n name={\"size\"}\n header={\"Size\"}\n cell={<span>size</span>}\n sortable={true}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<span>author</span>} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<span>created</span>}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<span>modified</span>}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"actions\"}\n header={\" \"}\n cell={<span>actions</span>}\n size={56}\n truncate={false}\n className={\"flex justify-center\"}\n hideable={false}\n resizable={false}\n />\n <Browser.Table.Cell.Thumbnail type={\"image/*\"} element={<span>image</span>} />\n <Browser.Table.Cell.Thumbnail type={\"*/*\"} element={<span>file</span>} />\n </FileManagerViewConfig>\n );\n};\n\n/**\n * Wait for the PropertyStore's debounced flush, as `react-properties` tests do.\n */\nasync function flush() {\n await act(async () => {\n await new Promise(resolve => setTimeout(resolve, 10));\n });\n}\n\nasync function renderConfig(extension?: React.ReactNode): Promise<FileManagerConfig> {\n let config: FileManagerConfig | undefined;\n\n const Probe = () => {\n config = useFileManagerConfig();\n return null;\n };\n\n render(\n <CompositionProvider>\n <DefaultTableConfig />\n {extension ? <FileManagerViewConfig>{extension}</FileManagerViewConfig> : null}\n <FileManagerViewWithConfig>\n <Probe />\n </FileManagerViewWithConfig>\n </CompositionProvider>\n );\n\n await flush();\n\n if (!config) {\n throw new Error(\"The File Manager config was never delivered to its consumers.\");\n }\n\n return config;\n}\n\nfunction columnNames(config: FileManagerConfig) {\n return config.browser.table.columns.map(column => column.name);\n}\n\nfunction expectThumbnails(config: FileManagerConfig) {\n expect(config.browser.table.cellThumbnails.map(thumbnail => thumbnail.type)).toEqual([\n \"image/*\",\n \"*/*\"\n ]);\n}\n\ndescribe(\"File Manager config: table columns from an extension\", () => {\n afterEach(() => {\n cleanup();\n });\n\n it(\"holds the default columns when no extension changes them\", async () => {\n const config = await renderConfig();\n\n expect(config.browser.table.columns).toBeDefined();\n expect(columnNames(config)).toEqual(DEFAULT_COLUMNS);\n expectThumbnails(config);\n });\n\n it(\"removes a default column\", async () => {\n const config = await renderConfig(<Browser.Table.Column name={\"actions\"} remove />);\n\n expect(config.browser.table.columns).toBeDefined();\n expect(columnNames(config)).toEqual(DEFAULT_COLUMNS.filter(name => name !== \"actions\"));\n expectThumbnails(config);\n });\n\n it(\"overrides a default column\", async () => {\n const config = await renderConfig(<Browser.Table.Column name={\"name\"} header={\"Custom\"} />);\n\n expect(config.browser.table.columns).toBeDefined();\n expect(columnNames(config)).toEqual(DEFAULT_COLUMNS);\n const name = config.browser.table.columns.find(column => column.name === \"name\");\n expect(name?.header).toBe(\"Custom\");\n expectThumbnails(config);\n });\n\n it(\"adds a column alongside the defaults\", async () => {\n const config = await renderConfig(\n <Browser.Table.Column name={\"custom\"} header={\"Custom\"} cell={<span>custom</span>} />\n );\n\n expect(config.browser.table.columns).toBeDefined();\n expect(columnNames(config)).toEqual([...DEFAULT_COLUMNS, \"custom\"]);\n const custom = config.browser.table.columns.find(column => column.name === \"custom\");\n expect(custom?.header).toBe(\"Custom\");\n expectThumbnails(config);\n });\n});\n"],"names":["Browser","FileManagerViewConfig","DEFAULT_COLUMNS","DefaultTableConfig","flush","act","Promise","resolve","setTimeout","renderConfig","extension","config","Probe","useFileManagerConfig","render","CompositionProvider","FileManagerViewWithConfig","Error","columnNames","column","expectThumbnails","expect","thumbnail","describe","afterEach","cleanup","it","name","custom"],"mappings":";;;;;AAmBA,MAAM,EAAEA,OAAO,EAAE,GAAGC;AAIpB,MAAMC,kBAAkB;IAAC;IAAQ;IAAQ;IAAQ;IAAa;IAAa;IAAW;CAAU;AAQhG,MAAMC,qBAAqB,IAChB,WAAP,GACI,oBAACF,uBAAqBA,MAAAA,WAAAA,GAClB,oBAACD,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAAC,cAAK;QACZ,UAAU;QACV,UAAU;QACV,MAAM;sBAEV,oBAACA,QAAQ,KAAK,CAAC,MAAM;QAAC,MAAM;QAAQ,QAAQ;QAAQ,oBAAM,oBAAC,cAAK;sBAChE,oBAACA,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAAC,cAAK;QACZ,UAAU;sBAEd,oBAACA,QAAQ,KAAK,CAAC,MAAM;QAAC,MAAM;QAAa,QAAQ;QAAU,oBAAM,oBAAC,cAAK;sBACvE,oBAACA,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAAC,cAAK;QACZ,UAAU;sBAEd,oBAACA,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAAC,cAAK;QACZ,UAAU;sBAEd,oBAACA,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAAC,cAAK;QACZ,MAAM;QACN,UAAU;QACV,WAAW;QAC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AbA,GAAa,oBAACT,QAAQ,KAAK,CAAC,MAAM;YAAC,MAAM;YAAW;;QAEzEqB,OAAOV,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW;QAChDU,OAAOH,YAAYP,SAAS,OAAO,CAACT,gBAAgB,MAAM,CAACyB,CAAAA,OAAQA,AAAS,cAATA;QACnEP,iBAAiBT;IACrB;IAEAe,GAAG,8BAA8B;QAC7B,MAAMf,SAAS,MAAMF,aAAa,WAAbA,GAAa,oBAACT,QAAQ,KAAK,CAAC,MAAM;YAAC,MAAM;YAAQ,QAAQ;;QAE9EqB,OAAOV,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW;QAChDU,OAAOH,YAAYP,SAAS,OAAO,CAACT;QACpC,MAAMyB,OAAOhB,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAACQ,CAAAA,SAAUA,AAAgB,WAAhBA,OAAO,IAAI;QACpEE,OAAOM,MAAM,QAAQ,IAAI,CAAC;QAC1BP,iBAAiBT;IACrB;IAEAe,GAAG,wCAAwC;QACvC,MAAMf,SAAS,MAAMF,aAAa,WAAbA,GACjB,oBAACT,QAAQ,KAAK,CAAC,MAAM;YAAC,MAAM;YAAU,QAAQ;YAAU,oBAAM,oBAAC,cAAK;;QAGxEqB,OAAOV,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW;QAChDU,OAAOH,YAAYP,SAAS,OAAO,CAAC;eAAIT;YAAiB;SAAS;QAClE,MAAM0B,SAASjB,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAACQ,CAAAA,SAAUA,AAAgB,aAAhBA,OAAO,IAAI;QACtEE,OAAOO,QAAQ,QAAQ,IAAI,CAAC;QAC5BR,iBAAiBT;IACrB;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/BulkAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/BulkAction.tsx"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\nimport type { CallbackParams } from \"@webiny/app-admin\";\nimport { useButtons, useDialogWithReport, Worker } from \"@webiny/app-admin\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { useFileManagerPresenter } from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nexport interface BulkActionConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface BulkActionProps {\n name: string;\n remove?: boolean;\n before?: string;\n after?: string;\n element?: React.ReactElement;\n}\n\nexport const BaseBulkAction = ({\n name,\n after = undefined,\n before = undefined,\n remove = false,\n element\n}: BulkActionProps) => {\n const getId = useIdGenerator(\"bulkAction\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property id=\"browser\" name={\"browser\"}>\n <Property\n id={getId(name)}\n name={\"bulkActions\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"name\")} name={\"name\"} value={name} />\n {element ? (\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n ) : null}\n </Property>\n </Property>\n );\n};\n\nconst useWorker = () => {\n const { vm, actions } = useFileManagerPresenter();\n const { current: worker } = useRef(new Worker<FileItem>());\n\n const selected = vm.list.rows.filter(f => vm.list.selection.selectedIds.has(f.id));\n\n const resetItems = useCallback(() => {\n actions.selection.deselectAll();\n }, []);\n\n return {\n items: selected,\n process: (callback: (items: FileItem[]) => void) => worker.process(selected, callback),\n processInSeries: async (\n callback: ({ item, allItems, report }: CallbackParams<FileItem>) => Promise<void>,\n chunkSize?: number\n ) => worker.processInSeries(selected, callback, chunkSize),\n resetItems: resetItems,\n results: worker.results\n };\n};\n\nexport const BulkAction = Object.assign(BaseBulkAction, {\n useButtons,\n useWorker,\n useDialog: useDialogWithReport\n});\n"],"names":["BaseBulkAction","name","after","before","remove","element","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property","useWorker","vm","actions","useFileManagerPresenter","worker","useRef","Worker","selected","f","resetItems","useCallback","callback","chunkSize","BulkAction","Object","useButtons","useDialogWithReport"],"mappings":";;;;AAoBO,MAAMA,iBAAiB,CAAC,EAC3BC,IAAI,EACJC,KAAiB,EACjBC,MAAkB,EAClBC,SAAS,KAAK,EACdC,OAAO,EACO;IACd,MAAMC,QAAQC,eAAe;IAE7B,MAAMC,aAAaN,AAAUO,WAAVP,QAAsBI,MAAMJ,SAASO;IACxD,MAAMC,cAAcP,AAAWM,WAAXN,SAAuBG,MAAMH,UAAUM;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QAAC,IAAG;QAAU,MAAM;qBACzB,oBAACA,UAAQA;QACL,IAAIL,MAAML;QACV,MAAM;QACN,QAAQG;QACR,OAAO;QACP,QAAQM;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAS,MAAM;QAAQ,OAAOA;QACvDI,UAAU,WAAVA,GACG,oBAACM,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAY,MAAM;QAAW,OAAOI;SAC9D;AAIpB;AAEA,MAAMO,YAAY;IACd,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAE,SAASC,MAAM,EAAE,GAAGC,OAAO,IAAIC;IAEvC,MAAMC,WAAWN,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAACO,CAAAA,IAAKP,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAACO,EAAE,EAAE;IAEhF,MAAMC,aAAaC,YAAY;QAC3BR,QAAQ,SAAS,CAAC,WAAW;IACjC,GAAG,EAAE;IAEL,OAAO;QACH,OAAOK;QACP,SAAS,CAACI,WAA0CP,OAAO,OAAO,CAACG,UAAUI;QAC7E,iBAAiB,OACbA,UACAC,YACCR,OAAO,eAAe,CAACG,UAAUI,UAAUC;QAChD,YAAYH;QACZ,SAASL,OAAO,OAAO;IAC3B;AACJ;AAEO,MAAMS,aAAaC,OAAO,MAAM,CAAC1B,gBAAgB;IACpD2B,YAAUA;IACVf
|
|
1
|
+
{"version":3,"file":"presentation/config/configComponents/Browser/BulkAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/BulkAction.tsx"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\nimport type { CallbackParams } from \"@webiny/app-admin\";\nimport { useButtons, useDialogWithReport, Worker } from \"@webiny/app-admin\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { useFileManagerPresenter } from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nexport interface BulkActionConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface BulkActionProps {\n name: string;\n remove?: boolean;\n before?: string;\n after?: string;\n element?: React.ReactElement;\n}\n\nexport const BaseBulkAction = ({\n name,\n after = undefined,\n before = undefined,\n remove = false,\n element\n}: BulkActionProps) => {\n const getId = useIdGenerator(\"bulkAction\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property id=\"browser\" name={\"browser\"}>\n <Property\n id={getId(name)}\n name={\"bulkActions\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"name\")} name={\"name\"} value={name} />\n {element ? (\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n ) : null}\n </Property>\n </Property>\n );\n};\n\nconst useWorker = () => {\n const { vm, actions } = useFileManagerPresenter();\n const { current: worker } = useRef(new Worker<FileItem>());\n\n const selected = vm.list.rows.filter(f => vm.list.selection.selectedIds.has(f.id));\n\n const resetItems = useCallback(() => {\n actions.selection.deselectAll();\n }, []);\n\n return {\n items: selected,\n process: (callback: (items: FileItem[]) => void) => worker.process(selected, callback),\n processInSeries: async (\n callback: ({ item, allItems, report }: CallbackParams<FileItem>) => Promise<void>,\n chunkSize?: number\n ) => worker.processInSeries(selected, callback, chunkSize),\n resetItems: resetItems,\n results: worker.results\n };\n};\n\nexport const BulkAction = Object.assign(BaseBulkAction, {\n useButtons,\n useWorker,\n useDialog: useDialogWithReport\n});\n"],"names":["BaseBulkAction","name","after","before","remove","element","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property","useWorker","vm","actions","useFileManagerPresenter","worker","useRef","Worker","selected","f","resetItems","useCallback","callback","chunkSize","BulkAction","Object","useButtons","useDialogWithReport"],"mappings":";;;;AAoBO,MAAMA,iBAAiB,CAAC,EAC3BC,IAAI,EACJC,KAAiB,EACjBC,MAAkB,EAClBC,SAAS,KAAK,EACdC,OAAO,EACO;IACd,MAAMC,QAAQC,eAAe;IAE7B,MAAMC,aAAaN,AAAUO,WAAVP,QAAsBI,MAAMJ,SAASO;IACxD,MAAMC,cAAcP,AAAWM,WAAXN,SAAuBG,MAAMH,UAAUM;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QAAC,IAAG;QAAU,MAAM;qBACzB,oBAACA,UAAQA;QACL,IAAIL,MAAML;QACV,MAAM;QACN,QAAQG;QACR,OAAO;QACP,QAAQM;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAS,MAAM;QAAQ,OAAOA;QACvDI,UAAU,WAAVA,GACG,oBAACM,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAY,MAAM;QAAW,OAAOI;SAC9D;AAIpB;AAEA,MAAMO,YAAY;IACd,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAE,SAASC,MAAM,EAAE,GAAGC,OAAO,IAAIC;IAEvC,MAAMC,WAAWN,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAACO,CAAAA,IAAKP,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAACO,EAAE,EAAE;IAEhF,MAAMC,aAAaC,YAAY;QAC3BR,QAAQ,SAAS,CAAC,WAAW;IACjC,GAAG,EAAE;IAEL,OAAO;QACH,OAAOK;QACP,SAAS,CAACI,WAA0CP,OAAO,OAAO,CAACG,UAAUI;QAC7E,iBAAiB,OACbA,UACAC,YACCR,OAAO,eAAe,CAACG,UAAUI,UAAUC;QAChD,YAAYH;QACZ,SAASL,OAAO,OAAO;IAC3B;AACJ;AAEO,MAAMS,aAAaC,OAAO,MAAM,CAAC1B,gBAAgB;IACpD2B,YAAUA;IACVf;IACA,WAAWgB;AACf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { AcoConfig } from "@webiny/app-aco";
|
|
3
|
-
const { Record
|
|
3
|
+
const { Record } = AcoConfig;
|
|
4
4
|
const BaseFileAction = (props)=>/*#__PURE__*/ react.createElement(Record.Action, props);
|
|
5
5
|
const FileAction = Object.assign(BaseFileAction, {
|
|
6
6
|
OptionsMenuItem: Record.Action.OptionsMenuItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/FileAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FileAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type RecordActionConfig } from \"@webiny/app-aco\";\n\nconst { Record } = AcoConfig;\n\nexport type { RecordActionConfig as FileActionConfig };\n\ntype FileActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;\n\nconst BaseFileAction = (props: FileActionProps) => {\n return <Record.Action {...props} />;\n};\n\nexport const FileAction = Object.assign(BaseFileAction, {\n OptionsMenuItem: Record.Action.OptionsMenuItem,\n OptionsMenuLink: Record.Action.OptionsMenuLink\n});\n"],"names":["Record","AcoConfig","BaseFileAction","props","FileAction","Object"],"mappings":";;AAGA,MAAM,EAAEA,
|
|
1
|
+
{"version":3,"file":"presentation/config/configComponents/Browser/FileAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FileAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type RecordActionConfig } from \"@webiny/app-aco\";\n\nconst { Record } = AcoConfig;\n\nexport type { RecordActionConfig as FileActionConfig };\n\ntype FileActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;\n\nconst BaseFileAction = (props: FileActionProps) => {\n return <Record.Action {...props} />;\n};\n\nexport const FileAction = Object.assign(BaseFileAction, {\n OptionsMenuItem: Record.Action.OptionsMenuItem,\n OptionsMenuLink: Record.Action.OptionsMenuLink\n});\n"],"names":["Record","AcoConfig","BaseFileAction","props","FileAction","Object"],"mappings":";;AAGA,MAAM,EAAEA,MAAM,EAAE,GAAGC;AAMnB,MAAMC,iBAAiB,CAACC,QACb,WAAP,GAAO,oBAACH,OAAO,MAAM,EAAKG;AAGvB,MAAMC,aAAaC,OAAO,MAAM,CAACH,gBAAgB;IACpD,iBAAiBF,OAAO,MAAM,CAAC,eAAe;IAC9C,iBAAiBA,OAAO,MAAM,CAAC,eAAe;AAClD"}
|
|
@@ -30,7 +30,7 @@ const createDecorator = createDecoratorFactory()(BaseFilter, (decoratorProps, co
|
|
|
30
30
|
return decoratorProps.name === componentProps.name;
|
|
31
31
|
});
|
|
32
32
|
const Filter = Object.assign(BaseFilter, {
|
|
33
|
-
createDecorator
|
|
33
|
+
createDecorator
|
|
34
34
|
});
|
|
35
35
|
export { Filter };
|
|
36
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/Filter.js","sources":["../../../../../src/presentation/config/configComponents/Browser/Filter.tsx"],"sourcesContent":["import React from \"react\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { createDecoratorFactory, makeDecoratable } from \"@webiny/app-admin\";\n\nexport interface FilterConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface FilterProps {\n name: string;\n element?: React.ReactElement<unknown>;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nconst BaseFilter = makeDecoratable(\n \"Filter\",\n ({ name, element, after = undefined, before = undefined, remove = false }: FilterProps) => {\n const getId = useIdGenerator(\"filter\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property id=\"browser\" name={\"browser\"}>\n <Property\n id={getId(name)}\n name={\"filters\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"name\")} name={\"name\"} value={name} />\n {element ? (\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n ) : null}\n </Property>\n </Property>\n );\n }\n);\n\nconst createDecorator = createDecoratorFactory<{ name: string }>()(\n BaseFilter,\n (decoratorProps, componentProps) => {\n if (decoratorProps.name === \"*\") {\n return true;\n }\n\n return decoratorProps.name === componentProps.name;\n }\n);\n\nexport const Filter = Object.assign(BaseFilter, { createDecorator });\n"],"names":["BaseFilter","makeDecoratable","name","element","after","before","remove","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property","createDecorator","createDecoratorFactory","decoratorProps","componentProps","Filter","Object"],"mappings":";;;AAiBA,MAAMA,aAAaC,gBACf,UACA,CAAC,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAiB,EAAEC,MAAkB,EAAEC,SAAS,KAAK,EAAe;IAClF,MAAMC,QAAQC,eAAe;IAE7B,MAAMC,aAAaL,AAAUM,WAAVN,QAAsBG,MAAMH,SAASM;IACxD,MAAMC,cAAcN,AAAWK,WAAXL,SAAuBE,MAAMF,UAAUK;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QAAC,IAAG;QAAU,MAAM;qBACzB,oBAACA,UAAQA;QACL,IAAIL,MAAML;QACV,MAAM;QACN,QAAQI;QACR,OAAO;QACP,QAAQK;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAS,MAAM;QAAQ,OAAOA;QACvDC,UAAU,WAAVA,GACG,oBAACS,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAY,MAAM;QAAW,OAAOC;SAC9D;AAIpB;AAGJ,MAAMU,kBAAkBC,yBACpBd,YACA,CAACe,gBAAgBC;IACb,IAAID,AAAwB,QAAxBA,eAAe,IAAI,EACnB,OAAO;IAGX,OAAOA,eAAe,IAAI,KAAKC,eAAe,IAAI;AACtD;AAGG,MAAMC,SAASC,OAAO,MAAM,CAAClB,YAAY;IAAEa
|
|
1
|
+
{"version":3,"file":"presentation/config/configComponents/Browser/Filter.js","sources":["../../../../../src/presentation/config/configComponents/Browser/Filter.tsx"],"sourcesContent":["import React from \"react\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { createDecoratorFactory, makeDecoratable } from \"@webiny/app-admin\";\n\nexport interface FilterConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface FilterProps {\n name: string;\n element?: React.ReactElement<unknown>;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nconst BaseFilter = makeDecoratable(\n \"Filter\",\n ({ name, element, after = undefined, before = undefined, remove = false }: FilterProps) => {\n const getId = useIdGenerator(\"filter\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property id=\"browser\" name={\"browser\"}>\n <Property\n id={getId(name)}\n name={\"filters\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"name\")} name={\"name\"} value={name} />\n {element ? (\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n ) : null}\n </Property>\n </Property>\n );\n }\n);\n\nconst createDecorator = createDecoratorFactory<{ name: string }>()(\n BaseFilter,\n (decoratorProps, componentProps) => {\n if (decoratorProps.name === \"*\") {\n return true;\n }\n\n return decoratorProps.name === componentProps.name;\n }\n);\n\nexport const Filter = Object.assign(BaseFilter, { createDecorator });\n"],"names":["BaseFilter","makeDecoratable","name","element","after","before","remove","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property","createDecorator","createDecoratorFactory","decoratorProps","componentProps","Filter","Object"],"mappings":";;;AAiBA,MAAMA,aAAaC,gBACf,UACA,CAAC,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAiB,EAAEC,MAAkB,EAAEC,SAAS,KAAK,EAAe;IAClF,MAAMC,QAAQC,eAAe;IAE7B,MAAMC,aAAaL,AAAUM,WAAVN,QAAsBG,MAAMH,SAASM;IACxD,MAAMC,cAAcN,AAAWK,WAAXL,SAAuBE,MAAMF,UAAUK;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QAAC,IAAG;QAAU,MAAM;qBACzB,oBAACA,UAAQA;QACL,IAAIL,MAAML;QACV,MAAM;QACN,QAAQI;QACR,OAAO;QACP,QAAQK;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAS,MAAM;QAAQ,OAAOA;QACvDC,UAAU,WAAVA,GACG,oBAACS,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAY,MAAM;QAAW,OAAOC;SAC9D;AAIpB;AAGJ,MAAMU,kBAAkBC,yBACpBd,YACA,CAACe,gBAAgBC;IACb,IAAID,AAAwB,QAAxBA,eAAe,IAAI,EACnB,OAAO;IAGX,OAAOA,eAAe,IAAI,KAAKC,eAAe,IAAI;AACtD;AAGG,MAAMC,SAASC,OAAO,MAAM,CAAClB,YAAY;IAAEa;AAAgB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { AcoConfig } from "@webiny/app-aco";
|
|
3
|
-
const { Folder
|
|
3
|
+
const { Folder } = AcoConfig;
|
|
4
4
|
const BaseFolderAction = (props)=>/*#__PURE__*/ react.createElement(Folder.Action, props);
|
|
5
5
|
const FolderAction = Object.assign(BaseFolderAction, {
|
|
6
6
|
OptionsMenuItem: Folder.Action.OptionsMenuItem
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/FolderAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FolderAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type FolderActionConfig } from \"@webiny/app-aco\";\n\nconst { Folder } = AcoConfig;\n\nexport type { FolderActionConfig };\n\ntype FolderActionProps = React.ComponentProps<typeof AcoConfig.Folder.Action>;\n\nconst BaseFolderAction = (props: FolderActionProps) => {\n return <Folder.Action {...props} />;\n};\n\nexport const FolderAction = Object.assign(BaseFolderAction, {\n OptionsMenuItem: Folder.Action.OptionsMenuItem\n});\n"],"names":["Folder","AcoConfig","BaseFolderAction","props","FolderAction","Object"],"mappings":";;AAGA,MAAM,EAAEA,
|
|
1
|
+
{"version":3,"file":"presentation/config/configComponents/Browser/FolderAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FolderAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type FolderActionConfig } from \"@webiny/app-aco\";\n\nconst { Folder } = AcoConfig;\n\nexport type { FolderActionConfig };\n\ntype FolderActionProps = React.ComponentProps<typeof AcoConfig.Folder.Action>;\n\nconst BaseFolderAction = (props: FolderActionProps) => {\n return <Folder.Action {...props} />;\n};\n\nexport const FolderAction = Object.assign(BaseFolderAction, {\n OptionsMenuItem: Folder.Action.OptionsMenuItem\n});\n"],"names":["Folder","AcoConfig","BaseFolderAction","props","FolderAction","Object"],"mappings":";;AAGA,MAAM,EAAEA,MAAM,EAAE,GAAGC;AAMnB,MAAMC,mBAAmB,CAACC,QACf,WAAP,GAAO,oBAACH,OAAO,MAAM,EAAKG;AAGvB,MAAMC,eAAeC,OAAO,MAAM,CAACH,kBAAkB;IACxD,iBAAiBF,OAAO,MAAM,CAAC,eAAe;AAClD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { AcoConfig } from "@webiny/app-aco";
|
|
3
|
-
const { Folder
|
|
3
|
+
const { Folder } = AcoConfig;
|
|
4
4
|
const FolderDropConfirmation = (props)=>/*#__PURE__*/ react.createElement(Folder.DropConfirmation, props);
|
|
5
5
|
export { FolderDropConfirmation };
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/FolderDropConfirmation.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FolderDropConfirmation.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig } from \"@webiny/app-aco\";\n\nconst { Folder } = AcoConfig;\n\ntype FolderDropConfirmationProps = React.ComponentProps<typeof AcoConfig.Folder.DropConfirmation>;\n\nexport const FolderDropConfirmation = (props: FolderDropConfirmationProps) => {\n return <Folder.DropConfirmation {...props} />;\n};\n"],"names":["Folder","AcoConfig","FolderDropConfirmation","props"],"mappings":";;AAGA,MAAM,EAAEA,
|
|
1
|
+
{"version":3,"file":"presentation/config/configComponents/Browser/FolderDropConfirmation.js","sources":["../../../../../src/presentation/config/configComponents/Browser/FolderDropConfirmation.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig } from \"@webiny/app-aco\";\n\nconst { Folder } = AcoConfig;\n\ntype FolderDropConfirmationProps = React.ComponentProps<typeof AcoConfig.Folder.DropConfirmation>;\n\nexport const FolderDropConfirmation = (props: FolderDropConfirmationProps) => {\n return <Folder.DropConfirmation {...props} />;\n};\n"],"names":["Folder","AcoConfig","FolderDropConfirmation","props"],"mappings":";;AAGA,MAAM,EAAEA,MAAM,EAAE,GAAGC;AAIZ,MAAMC,yBAAyB,CAACC,QAC5B,WAAP,GAAO,oBAACH,OAAO,gBAAgB,EAAKG"}
|
|
@@ -3,6 +3,11 @@ import { AcoConfig, type TableColumnConfig as ColumnConfig } from "@webiny/app-a
|
|
|
3
3
|
import type { TableItem } from "../../../../../domain/types.js";
|
|
4
4
|
export type { ColumnConfig };
|
|
5
5
|
type ColumnProps = React.ComponentProps<typeof AcoConfig.Table.Column>;
|
|
6
|
+
/**
|
|
7
|
+
* The File Manager reads its columns from `browser.table.columns`, so every column
|
|
8
|
+
* must be registered under `browser`, as the table thumbnails are. ACO's
|
|
9
|
+
* `Table.Column` registers `table` at whatever level it's mounted at.
|
|
10
|
+
*/
|
|
6
11
|
declare const BaseColumnComponent: (props: ColumnProps) => React.JSX.Element;
|
|
7
12
|
export declare const Column: typeof BaseColumnComponent & {
|
|
8
13
|
original: typeof BaseColumnComponent;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { AcoConfig } from "@webiny/app-aco";
|
|
3
3
|
import { makeDecoratable } from "@webiny/react-composition";
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
import { Property } from "@webiny/react-properties";
|
|
5
|
+
const { Table } = AcoConfig;
|
|
6
|
+
const BaseColumnComponent = (props)=>/*#__PURE__*/ react.createElement(Property, {
|
|
7
|
+
id: "browser",
|
|
8
|
+
name: "browser"
|
|
9
|
+
}, /*#__PURE__*/ react.createElement(Table.Column, props));
|
|
6
10
|
const BaseColumn = makeDecoratable("Column", BaseColumnComponent);
|
|
7
11
|
const Column = Object.assign(BaseColumn, {
|
|
8
12
|
useTableRow: Table.Column.createUseTableRow(),
|