@webiny/app-file-manager 6.5.4-beta.1 → 6.5.4-beta.2
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/features/fileUploader/FileUploader.js.map +1 -1
- package/features/tags/ListTags.test.js.map +1 -1
- package/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.js.map +1 -1
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.js.map +1 -1
- package/package.json +20 -20
- package/presentation/FileDetails/FileDetailsPresenter.test.js.map +1 -1
- package/presentation/FileList/FileListDataSource.js.map +1 -1
- package/presentation/FileList/FileListPresenter.test.js.map +1 -1
- package/presentation/FileList/FileManagerPresenter.js.map +1 -1
- package/presentation/FileList/components/BulkActions/ActionEditPresenter.js.map +1 -1
- package/presentation/FileList/components/BulkActions/GraphQLInputMapper.js +3 -3
- package/presentation/FileList/components/BulkActions/GraphQLInputMapper.js.map +1 -1
- package/presentation/FileList/components/BulkActions/domain/BatchMapper.js.map +1 -1
- package/presentation/FileList/components/BulkActions/domain/FieldMapper.js.map +1 -1
- package/presentation/FileList/components/Table/FileTable.js.map +1 -1
- package/presentation/FileList/components/Table/FileTable.test.js.map +1 -1
- package/presentation/FileManager/FileManagerRenderer.js.map +1 -1
- package/presentation/FileManager/FileManagerView.js.map +1 -1
- package/presentation/Settings/SettingsPresenter.js.map +1 -1
- package/presentation/Settings/components/SettingsView.js.map +1 -1
- package/presentation/config/FileManagerViewConfig.js.map +1 -1
- package/presentation/config/fields/Tags.js.map +1 -1
- package/presentation/config/fields/useAccessControlField.js.map +1 -1
- package/presentation/config/getThumbnailRenderer.js.map +1 -1
- package/presentation/config/thumbnailRenderers/CroppedFileImage.js.map +1 -1
- package/presentation/hooks/useCopyFile.js.map +1 -1
- package/routes.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/getThumbnailRenderer.js","sources":["../../../src/presentation/config/getThumbnailRenderer.ts"],"sourcesContent":["import { minimatch } from \"minimatch\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nexport const getThumbnailRenderer = <T extends { type: string }>(\n renderers: T[],\n file: FileItem\n): T => {\n // Sort by type and by priority. More occurrences of `*` means lower priority.\n const regExMatch = /\\*/g;\n\n const types = renderers.sort((a, b) => {\n const countA = (a.type.match(regExMatch) || []).length;\n const countB = (b.type.match(regExMatch) || []).length;\n if (countB > countA) {\n return -1;\n } else if (countB < countA) {\n return 1;\n }\n return 0;\n });\n\n // Find first matching type\n const renderer = types.find(type => minimatch(file.type, type.type));\n\n return renderer!;\n};\n"],"names":["getThumbnailRenderer","renderers","file","regExMatch","types","a","b","countA","countB","renderer","type","minimatch"],"mappings":";AAGO,MAAMA,uBAAuB,CAChCC,WACAC;IAGA,MAAMC,aAAa;IAEnB,MAAMC,QAAQH,UAAU,IAAI,CAAC,CAACI,GAAGC;QAC7B,MAAMC,SAAUF,AAAAA,CAAAA,EAAE,IAAI,CAAC,KAAK,CAACF,eAAe,
|
|
1
|
+
{"version":3,"file":"presentation/config/getThumbnailRenderer.js","sources":["../../../src/presentation/config/getThumbnailRenderer.ts"],"sourcesContent":["import { minimatch } from \"minimatch\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nexport const getThumbnailRenderer = <T extends { type: string }>(\n renderers: T[],\n file: FileItem\n): T => {\n // Sort by type and by priority. More occurrences of `*` means lower priority.\n const regExMatch = /\\*/g;\n\n const types = renderers.sort((a, b) => {\n const countA = (a.type.match(regExMatch) || []).length;\n const countB = (b.type.match(regExMatch) || []).length;\n if (countB > countA) {\n return -1;\n } else if (countB < countA) {\n return 1;\n }\n return 0;\n });\n\n // Find first matching type\n const renderer = types.find(type => minimatch(file.type, type.type));\n\n return renderer!;\n};\n"],"names":["getThumbnailRenderer","renderers","file","regExMatch","types","a","b","countA","countB","renderer","type","minimatch"],"mappings":";AAGO,MAAMA,uBAAuB,CAChCC,WACAC;IAGA,MAAMC,aAAa;IAEnB,MAAMC,QAAQH,UAAU,IAAI,CAAC,CAACI,GAAGC;QAC7B,MAAMC,SAAUF,AAAAA,CAAAA,EAAE,IAAI,CAAC,KAAK,CAACF,eAAe,EAAE,EAAE,MAAM;QACtD,MAAMK,SAAUF,AAAAA,CAAAA,EAAE,IAAI,CAAC,KAAK,CAACH,eAAe,EAAE,EAAE,MAAM;QACtD,IAAIK,SAASD,QACT,OAAO;aACJ,IAAIC,SAASD,QAChB,OAAO;QAEX,OAAO;IACX;IAGA,MAAME,WAAWL,MAAM,IAAI,CAACM,CAAAA,OAAQC,UAAUT,KAAK,IAAI,EAAEQ,KAAK,IAAI;IAElE,OAAOD;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/thumbnailRenderers/CroppedFileImage.js","sources":["../../../../src/presentation/config/thumbnailRenderers/CroppedFileImage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport { Image } from \"@webiny/app/components/index.js\";\nimport { cn, getCroppedImageRenderStyles } from \"@webiny/admin-ui\";\nimport type { FileItem } from \"~/domain/types.js\";\n\ninterface CroppedFileImageProps {\n file: FileItem;\n /** Width passed to the delivery transform (`?width=`). */\n width: number;\n /** How the (cropped) image fits its slot. */\n fit: \"cover\" | \"contain\";\n /** Class applied to the `<Image>` when there is no crop (original behavior). */\n fallbackClassName?: string;\n}\n\nconst isFullCrop = (crop: any): boolean => {\n return !crop || (crop.top === 0 && crop.left === 0 && crop.bottom === 0 && crop.right === 0);\n};\n\n/**\n * Renders a File Manager image thumbnail/preview honoring the saved crop (and, for\n * `cover`, the hotspot). Falls back to the plain image when the file has no crop,\n * so un-edited files render exactly as before.\n */\nexport const CroppedFileImage = ({\n file,\n width,\n fit,\n fallbackClassName\n}: CroppedFileImageProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [box, setBox] = useState({ w: 0, h: 0 });\n\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) {\n return;\n }\n const measure = () => {\n const rect = el.getBoundingClientRect();\n setBox({ w: rect.width, h: rect.height });\n };\n measure();\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const ro = new ResizeObserver(measure);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const img = file.metadata?.image;\n const imageWidth = img?.width ?? 0;\n const imageHeight = img?.height ?? 0;\n\n if (isFullCrop(img?.crop) || imageWidth <= 0 || imageHeight <= 0) {\n return (\n <Image\n src={file.src}\n alt={file.name}\n transform={{ width }}\n className={fallbackClassName}\n />\n );\n }\n\n const focalPoint = img?.focalPoint;\n const hotspot = focalPoint\n ? { x: focalPoint.x, y: focalPoint.y, width: 1, height: 1 }\n : undefined;\n\n const { wrapper, image } = getCroppedImageRenderStyles(\n imageWidth,\n imageHeight,\n img?.crop,\n hotspot,\n {\n boxWidth: box.w,\n boxHeight: box.h,\n fit\n }\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"flex h-full w-full items-center justify-center overflow-hidden\")}\n >\n <div style={wrapper}>\n <Image src={file.src} alt={file.name} transform={{ width }} style={image} />\n </div>\n </div>\n );\n};\n"],"names":["isFullCrop","crop","CroppedFileImage","file","width","fit","fallbackClassName","ref","useRef","box","setBox","useState","useLayoutEffect","el","measure","rect","ResizeObserver","ro","img","imageWidth","imageHeight","Image","focalPoint","hotspot","undefined","wrapper","image","getCroppedImageRenderStyles","cn"],"mappings":";;;AAgBA,MAAMA,aAAa,CAACC,OACT,CAACA,QAASA,AAAa,MAAbA,KAAK,GAAG,IAAUA,AAAc,MAAdA,KAAK,IAAI,IAAUA,AAAgB,MAAhBA,KAAK,MAAM,IAAUA,AAAe,MAAfA,KAAK,KAAK;AAQlF,MAAMC,mBAAmB,CAAC,EAC7BC,IAAI,EACJC,KAAK,EACLC,GAAG,EACHC,iBAAiB,EACG;IACpB,MAAMC,MAAMC,AAAAA,IAAAA,wBAAAA,MAAAA,
|
|
1
|
+
{"version":3,"file":"presentation/config/thumbnailRenderers/CroppedFileImage.js","sources":["../../../../src/presentation/config/thumbnailRenderers/CroppedFileImage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport { Image } from \"@webiny/app/components/index.js\";\nimport { cn, getCroppedImageRenderStyles } from \"@webiny/admin-ui\";\nimport type { FileItem } from \"~/domain/types.js\";\n\ninterface CroppedFileImageProps {\n file: FileItem;\n /** Width passed to the delivery transform (`?width=`). */\n width: number;\n /** How the (cropped) image fits its slot. */\n fit: \"cover\" | \"contain\";\n /** Class applied to the `<Image>` when there is no crop (original behavior). */\n fallbackClassName?: string;\n}\n\nconst isFullCrop = (crop: any): boolean => {\n return !crop || (crop.top === 0 && crop.left === 0 && crop.bottom === 0 && crop.right === 0);\n};\n\n/**\n * Renders a File Manager image thumbnail/preview honoring the saved crop (and, for\n * `cover`, the hotspot). Falls back to the plain image when the file has no crop,\n * so un-edited files render exactly as before.\n */\nexport const CroppedFileImage = ({\n file,\n width,\n fit,\n fallbackClassName\n}: CroppedFileImageProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [box, setBox] = useState({ w: 0, h: 0 });\n\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) {\n return;\n }\n const measure = () => {\n const rect = el.getBoundingClientRect();\n setBox({ w: rect.width, h: rect.height });\n };\n measure();\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const ro = new ResizeObserver(measure);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const img = file.metadata?.image;\n const imageWidth = img?.width ?? 0;\n const imageHeight = img?.height ?? 0;\n\n if (isFullCrop(img?.crop) || imageWidth <= 0 || imageHeight <= 0) {\n return (\n <Image\n src={file.src}\n alt={file.name}\n transform={{ width }}\n className={fallbackClassName}\n />\n );\n }\n\n const focalPoint = img?.focalPoint;\n const hotspot = focalPoint\n ? { x: focalPoint.x, y: focalPoint.y, width: 1, height: 1 }\n : undefined;\n\n const { wrapper, image } = getCroppedImageRenderStyles(\n imageWidth,\n imageHeight,\n img?.crop,\n hotspot,\n {\n boxWidth: box.w,\n boxHeight: box.h,\n fit\n }\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"flex h-full w-full items-center justify-center overflow-hidden\")}\n >\n <div style={wrapper}>\n <Image src={file.src} alt={file.name} transform={{ width }} style={image} />\n </div>\n </div>\n );\n};\n"],"names":["isFullCrop","crop","CroppedFileImage","file","width","fit","fallbackClassName","ref","useRef","box","setBox","useState","useLayoutEffect","el","measure","rect","ResizeObserver","ro","img","imageWidth","imageHeight","Image","focalPoint","hotspot","undefined","wrapper","image","getCroppedImageRenderStyles","cn"],"mappings":";;;AAgBA,MAAMA,aAAa,CAACC,OACT,CAACA,QAASA,AAAa,MAAbA,KAAK,GAAG,IAAUA,AAAc,MAAdA,KAAK,IAAI,IAAUA,AAAgB,MAAhBA,KAAK,MAAM,IAAUA,AAAe,MAAfA,KAAK,KAAK;AAQlF,MAAMC,mBAAmB,CAAC,EAC7BC,IAAI,EACJC,KAAK,EACLC,GAAG,EACHC,iBAAiB,EACG;IACpB,MAAMC,MAAMC,AAAAA,IAAAA,wBAAAA,MAAAA,EAAuB;IACnC,MAAM,CAACC,KAAKC,OAAO,GAAGC,AAAAA,IAAAA,wBAAAA,QAAAA,EAAS;QAAE,GAAG;QAAG,GAAG;IAAE;IAE5CC,IAAAA,wBAAAA,eAAAA,EAAgB;QACZ,MAAMC,KAAKN,IAAI,OAAO;QACtB,IAAI,CAACM,IACD;QAEJ,MAAMC,UAAU;YACZ,MAAMC,OAAOF,GAAG,qBAAqB;YACrCH,OAAO;gBAAE,GAAGK,KAAK,KAAK;gBAAE,GAAGA,KAAK,MAAM;YAAC;QAC3C;QACAD;QACA,IAAI,AAA0B,MAA1B,OAAOE,gBACP;QAEJ,MAAMC,KAAK,IAAID,eAAeF;QAC9BG,GAAG,OAAO,CAACJ;QACX,OAAO,IAAMI,GAAG,UAAU;IAC9B,GAAG,EAAE;IAEL,MAAMC,MAAMf,KAAK,QAAQ,EAAE;IAC3B,MAAMgB,aAAaD,KAAK,SAAS;IACjC,MAAME,cAAcF,KAAK,UAAU;IAEnC,IAAIlB,WAAWkB,KAAK,SAASC,cAAc,KAAKC,eAAe,GAC3D,OAAO,WAAP,GACI,sCAACC,OAAKA;QACF,KAAKlB,KAAK,GAAG;QACb,KAAKA,KAAK,IAAI;QACd,WAAW;YAAEC;QAAM;QACnB,WAAWE;;IAKvB,MAAMgB,aAAaJ,KAAK;IACxB,MAAMK,UAAUD,aACV;QAAE,GAAGA,WAAW,CAAC;QAAE,GAAGA,WAAW,CAAC;QAAE,OAAO;QAAG,QAAQ;IAAE,IACxDE;IAEN,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAGC,4BACvBR,YACAC,aACAF,KAAK,MACLK,SACA;QACI,UAAUd,IAAI,CAAC;QACf,WAAWA,IAAI,CAAC;QAChBJ;IACJ;IAGJ,OAAO,WAAP,GACI,sCAAC;QACG,KAAKE;QACL,WAAWqB,GAAG;qBAEd,sCAAC;QAAI,OAAOH;qBACR,sCAACJ,OAAKA;QAAC,KAAKlB,KAAK,GAAG;QAAE,KAAKA,KAAK,IAAI;QAAE,WAAW;YAAEC;QAAM;QAAG,OAAOsB;;AAInF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/hooks/useCopyFile.js","sources":["../../../src/presentation/hooks/useCopyFile.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { useContainer } from \"@webiny/app\";\nimport { GetSettingsRepository } from \"~/features/settings/abstractions.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nconst t = i18n.ns(\"app-admin/file-manager/hooks/use-copy-file\");\n\ninterface UseCopyFileParams {\n file: {\n key: FileItem[\"key\"];\n src?: FileItem[\"src\"];\n };\n}\n\nexport const useCopyFile = ({ file }: UseCopyFileParams) => {\n const container = useContainer();\n const settingsRepository = container.resolve(GetSettingsRepository);\n const { showSnackbar } = useSnackbar();\n\n const copyFileUrl = useCallback(() => {\n const fileSrc = file.src || (settingsRepository.settings?.srcPrefix ?? \"\") + file.key;\n\n navigator.clipboard.writeText(fileSrc);\n showSnackbar(t`URL copied successfully.`);\n }, [file]);\n\n return {\n copyFileUrl\n };\n};\n"],"names":["t","i18n","useCopyFile","file","container","useContainer","settingsRepository","GetSettingsRepository","showSnackbar","useSnackbar","copyFileUrl","useCallback","fileSrc","navigator"],"mappings":";;;;;AAOA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AASX,MAAMC,cAAc,CAAC,EAAEC,IAAI,EAAqB;IACnD,MAAMC,YAAYC;IAClB,MAAMC,qBAAqBF,UAAU,OAAO,CAACG;IAC7C,MAAM,EAAEC,YAAY,EAAE,GAAGC;IAEzB,MAAMC,cAAcC,YAAY;QAC5B,MAAMC,UAAUT,KAAK,GAAG,IAAKG,AAAAA,CAAAA,mBAAmB,QAAQ,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"presentation/hooks/useCopyFile.js","sources":["../../../src/presentation/hooks/useCopyFile.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { useContainer } from \"@webiny/app\";\nimport { GetSettingsRepository } from \"~/features/settings/abstractions.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nconst t = i18n.ns(\"app-admin/file-manager/hooks/use-copy-file\");\n\ninterface UseCopyFileParams {\n file: {\n key: FileItem[\"key\"];\n src?: FileItem[\"src\"];\n };\n}\n\nexport const useCopyFile = ({ file }: UseCopyFileParams) => {\n const container = useContainer();\n const settingsRepository = container.resolve(GetSettingsRepository);\n const { showSnackbar } = useSnackbar();\n\n const copyFileUrl = useCallback(() => {\n const fileSrc = file.src || (settingsRepository.settings?.srcPrefix ?? \"\") + file.key;\n\n navigator.clipboard.writeText(fileSrc);\n showSnackbar(t`URL copied successfully.`);\n }, [file]);\n\n return {\n copyFileUrl\n };\n};\n"],"names":["t","i18n","useCopyFile","file","container","useContainer","settingsRepository","GetSettingsRepository","showSnackbar","useSnackbar","copyFileUrl","useCallback","fileSrc","navigator"],"mappings":";;;;;AAOA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AASX,MAAMC,cAAc,CAAC,EAAEC,IAAI,EAAqB;IACnD,MAAMC,YAAYC;IAClB,MAAMC,qBAAqBF,UAAU,OAAO,CAACG;IAC7C,MAAM,EAAEC,YAAY,EAAE,GAAGC;IAEzB,MAAMC,cAAcC,YAAY;QAC5B,MAAMC,UAAUT,KAAK,GAAG,IAAKG,AAAAA,CAAAA,mBAAmB,QAAQ,EAAE,aAAa,EAAE,IAAIH,KAAK,GAAG;QAErFU,UAAU,SAAS,CAAC,SAAS,CAACD;QAC9BJ,aAAaR,CAAC,CAAC,wBAAwB,CAAC;IAC5C,GAAG;QAACG;KAAK;IAET,OAAO;QACHO;IACJ;AACJ"}
|
package/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sources":["../src/routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n List: new Route({\n name: \"FileManager/List\",\n path: \"/file-manager\",\n params: zod => {\n return {\n folderId: zod.string().optional(),\n search: zod.string().optional()\n };\n }\n }),\n Settings: new Route({\n name: \"FileManager/Settings\",\n path: \"/settings/file-manager/general\"\n })\n};\n"],"names":["Routes","Route","zod"],"mappings":";AAEO,MAAMA,SAAS;IAClB,MAAM,IAAIC,MAAM;QACZ,MAAM;QACN,MAAM;QACN,QAAQC,CAAAA,MACG;gBACH,UAAUA,IAAI,MAAM,GAAG,QAAQ;gBAC/B,QAAQA,IAAI,MAAM,GAAG,QAAQ;YACjC;
|
|
1
|
+
{"version":3,"file":"routes.js","sources":["../src/routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n List: new Route({\n name: \"FileManager/List\",\n path: \"/file-manager\",\n params: zod => {\n return {\n folderId: zod.string().optional(),\n search: zod.string().optional()\n };\n }\n }),\n Settings: new Route({\n name: \"FileManager/Settings\",\n path: \"/settings/file-manager/general\"\n })\n};\n"],"names":["Routes","Route","zod"],"mappings":";AAEO,MAAMA,SAAS;IAClB,MAAM,IAAIC,MAAM;QACZ,MAAM;QACN,MAAM;QACN,QAAQC,CAAAA,MACG;gBACH,UAAUA,IAAI,MAAM,GAAG,QAAQ;gBAC/B,QAAQA,IAAI,MAAM,GAAG,QAAQ;YACjC,CAAC;IAET;IACA,UAAU,IAAID,MAAM;QAChB,MAAM;QACN,MAAM;IACV;AACJ"}
|