@flipdish/portal-library 8.6.6 → 8.6.7
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/dist/components/organisms/AssetManager/UploadTabContent/index.cjs.js +1 -1
- package/dist/components/organisms/AssetManager/UploadTabContent/index.cjs.js.map +1 -1
- package/dist/components/organisms/AssetManager/UploadTabContent/index.js +1 -1
- package/dist/components/organisms/AssetManager/UploadTabContent/index.js.map +1 -1
- package/dist/utilities/fileUtils.cjs.js +1 -1
- package/dist/utilities/fileUtils.cjs.js.map +1 -1
- package/dist/utilities/fileUtils.d.ts +2 -2
- package/dist/utilities/fileUtils.js +1 -1
- package/dist/utilities/fileUtils.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime");require("react");var i=require("../../../../utilities/fileUtils.cjs.js"),r=require("../../../../providers/TranslationProvider.cjs.js"),l=require("../../FileUpload/index.cjs.js");const s=["jpg","jpeg","png","bmp","tiff","ico","webp"];module.exports=({files:o,onUpload:a,onRemove:t,error:n})=>{const{translate:p}=r.useTranslation(),_=p("File_is_too_large_upload_a_file_under",{maxFileSize:"
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");require("react");var i=require("../../../../utilities/fileUtils.cjs.js"),r=require("../../../../providers/TranslationProvider.cjs.js"),l=require("../../FileUpload/index.cjs.js");const s=["jpg","jpeg","png","bmp","tiff","ico","webp"];module.exports=({files:o,onUpload:a,onRemove:t,error:n})=>{const{translate:p}=r.useTranslation(),_=p("File_is_too_large_upload_a_file_under",{maxFileSize:"20 MB"}),u=p("File_type_isnt_supported_upload_an_image",{fileTypes:s.join(", ")});return e.jsx(l,{allowedFileTypes:s,error:n,files:o,invalidFileSizeText:_,invalidFileTypesText:u,label:"",maxFiles:10,maxFileSize:i.TWENTY_MB_IN_BYTES,onRemove:t,onUpload:a})};
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../../src/components/organisms/AssetManager/UploadTabContent/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../src/components/organisms/AssetManager/UploadTabContent/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { TWENTY_MB_IN_BYTES } from '@fd/utilities/fileUtils';\n\nimport { useTranslation } from '../../../../providers/TranslationProvider';\nimport FileUpload, { type FileUploadState } from '../../FileUpload';\n\nconst ALLOWED_FILE_TYPES = ['jpg', 'jpeg', 'png', 'bmp', 'tiff', 'ico', 'webp'];\nconst MAX_FILES = 10;\n\n/**\n * Props for the UploadTabContent component.\n * @param files - Array of file upload states\n * @param onUpload - Callback fired when files are uploaded\n * @param onRemove - Callback fired when a file is removed\n * @param error - Optional error message to display on the file upload\n */\nexport interface UploadTabContentProps {\n /** Array of file upload states */\n files: FileUploadState[];\n /** Callback fired when files are uploaded */\n onUpload: (files: File[]) => void;\n /** Callback fired when a file is removed */\n onRemove: (file: File) => void;\n /** Optional error message to display on the file upload */\n error?: string | null;\n}\n\n/**\n * UploadAsset component provides a file upload interface for uploading new assets.\n *\n * @param props - The component props\n * @returns The upload tab content\n */\nconst UploadTabContent: React.FC<UploadTabContentProps> = ({ files, onUpload, onRemove, error }) => {\n const { translate } = useTranslation();\n const maxFileSizeText = translate('File_is_too_large_upload_a_file_under', {\n maxFileSize: '20 MB',\n });\n const invalidFileTypesText = translate('File_type_isnt_supported_upload_an_image', {\n fileTypes: ALLOWED_FILE_TYPES.join(', '),\n });\n\n return (\n <FileUpload\n allowedFileTypes={ALLOWED_FILE_TYPES}\n error={error}\n files={files}\n invalidFileSizeText={maxFileSizeText}\n invalidFileTypesText={invalidFileTypesText}\n label=\"\"\n maxFiles={MAX_FILES}\n maxFileSize={TWENTY_MB_IN_BYTES}\n onRemove={onRemove}\n onUpload={onUpload}\n />\n );\n};\n\nexport default UploadTabContent;\n"],"names":["ALLOWED_FILE_TYPES","files","onUpload","onRemove","error","translate","useTranslation","maxFileSizeText","maxFileSize","invalidFileTypesText","fileTypes","join","_jsx","FileUpload","allowedFileTypes","invalidFileSizeText","label","maxFiles","TWENTY_MB_IN_BYTES"],"mappings":"kOAOA,MAAMA,EAAqB,CAAC,MAAO,OAAQ,MAAO,MAAO,OAAQ,MAAO,uBA2Bd,EAAGC,QAAOC,WAAUC,WAAUC,YACtF,MAAMC,UAAEA,GAAcC,mBAChBC,EAAkBF,EAAU,wCAAyC,CACzEG,YAAa,UAETC,EAAuBJ,EAAU,2CAA4C,CACjFK,UAAWV,EAAmBW,KAAK,QAGrC,OACEC,MAACC,EAAU,CACTC,iBAAkBd,EAClBI,MAAOA,EACPH,MAAOA,EACPc,oBAAqBR,EACrBE,qBAAsBA,EACtBO,MAAM,GACNC,SA3CY,GA4CZT,YAAaU,EAAAA,mBACbf,SAAUA,EACVD,SAAUA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import"react";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import"react";import{TWENTY_MB_IN_BYTES as i}from"../../../../utilities/fileUtils.js";import{useTranslation as o}from"../../../../providers/TranslationProvider.js";import l from"../../FileUpload/index.js";const r=["jpg","jpeg","png","bmp","tiff","ico","webp"],t=({files:t,onUpload:a,onRemove:p,error:s})=>{const{translate:n}=o(),m=n("File_is_too_large_upload_a_file_under",{maxFileSize:"20 MB"}),d=n("File_type_isnt_supported_upload_an_image",{fileTypes:r.join(", ")});return e(l,{allowedFileTypes:r,error:s,files:t,invalidFileSizeText:m,invalidFileTypesText:d,label:"",maxFiles:10,maxFileSize:i,onRemove:p,onUpload:a})};export{t as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/organisms/AssetManager/UploadTabContent/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/organisms/AssetManager/UploadTabContent/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { TWENTY_MB_IN_BYTES } from '@fd/utilities/fileUtils';\n\nimport { useTranslation } from '../../../../providers/TranslationProvider';\nimport FileUpload, { type FileUploadState } from '../../FileUpload';\n\nconst ALLOWED_FILE_TYPES = ['jpg', 'jpeg', 'png', 'bmp', 'tiff', 'ico', 'webp'];\nconst MAX_FILES = 10;\n\n/**\n * Props for the UploadTabContent component.\n * @param files - Array of file upload states\n * @param onUpload - Callback fired when files are uploaded\n * @param onRemove - Callback fired when a file is removed\n * @param error - Optional error message to display on the file upload\n */\nexport interface UploadTabContentProps {\n /** Array of file upload states */\n files: FileUploadState[];\n /** Callback fired when files are uploaded */\n onUpload: (files: File[]) => void;\n /** Callback fired when a file is removed */\n onRemove: (file: File) => void;\n /** Optional error message to display on the file upload */\n error?: string | null;\n}\n\n/**\n * UploadAsset component provides a file upload interface for uploading new assets.\n *\n * @param props - The component props\n * @returns The upload tab content\n */\nconst UploadTabContent: React.FC<UploadTabContentProps> = ({ files, onUpload, onRemove, error }) => {\n const { translate } = useTranslation();\n const maxFileSizeText = translate('File_is_too_large_upload_a_file_under', {\n maxFileSize: '20 MB',\n });\n const invalidFileTypesText = translate('File_type_isnt_supported_upload_an_image', {\n fileTypes: ALLOWED_FILE_TYPES.join(', '),\n });\n\n return (\n <FileUpload\n allowedFileTypes={ALLOWED_FILE_TYPES}\n error={error}\n files={files}\n invalidFileSizeText={maxFileSizeText}\n invalidFileTypesText={invalidFileTypesText}\n label=\"\"\n maxFiles={MAX_FILES}\n maxFileSize={TWENTY_MB_IN_BYTES}\n onRemove={onRemove}\n onUpload={onUpload}\n />\n );\n};\n\nexport default UploadTabContent;\n"],"names":["ALLOWED_FILE_TYPES","UploadTabContent","files","onUpload","onRemove","error","translate","useTranslation","maxFileSizeText","maxFileSize","invalidFileTypesText","fileTypes","join","_jsx","FileUpload","allowedFileTypes","invalidFileSizeText","label","maxFiles","TWENTY_MB_IN_BYTES"],"mappings":"qPAOA,MAAMA,EAAqB,CAAC,MAAO,OAAQ,MAAO,MAAO,OAAQ,MAAO,QA2BlEC,EAAoD,EAAGC,QAAOC,WAAUC,WAAUC,YACtF,MAAMC,UAAEA,GAAcC,IAChBC,EAAkBF,EAAU,wCAAyC,CACzEG,YAAa,UAETC,EAAuBJ,EAAU,2CAA4C,CACjFK,UAAWX,EAAmBY,KAAK,QAGrC,OACEC,EAACC,EAAU,CACTC,iBAAkBf,EAClBK,MAAOA,EACPH,MAAOA,EACPc,oBAAqBR,EACrBE,qBAAsBA,EACtBO,MAAM,GACNC,SA3CY,GA4CZT,YAAaU,EACbf,SAAUA,EACVD,SAAUA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=e=>e.replace(/\s+/g,"-");exports.
|
|
1
|
+
"use strict";const e=e=>e.replace(/\s+/g,"-");exports.TWENTY_MB_IN_BYTES=20971520,exports.sanitizeFile=t=>{const s=e(t.name);return new File([t],s,{type:t.type})},exports.sanitizeFileName=e;
|
|
2
2
|
//# sourceMappingURL=fileUtils.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileUtils.cjs.js","sources":["../../src/utilities/fileUtils.ts"],"sourcesContent":["export const
|
|
1
|
+
{"version":3,"file":"fileUtils.cjs.js","sources":["../../src/utilities/fileUtils.ts"],"sourcesContent":["export const TWENTY_MB_IN_BYTES = 20 * 1024 * 1024;\n\n/**\n * Sanitizes a filename by replacing spaces with dashes\n * @param filename - The original filename\n * @returns The sanitized filename with spaces replaced by dashes\n * @example\n * sanitizeFileName('my file.jpg') // returns 'my-file.jpg'\n * sanitizeFileName('already-good.png') // returns 'already-good.png'\n */\nexport const sanitizeFileName = (filename: string): string => {\n return filename.replace(/\\s+/g, '-');\n};\n\n/**\n * Creates a new File object with a sanitized filename\n * @param file - The original File object\n * @returns A new File object with spaces replaced by dashes in the filename\n */\nexport const sanitizeFile = (file: File): File => {\n const sanitizedName = sanitizeFileName(file.name);\n return new File([file], sanitizedName, { type: file.type });\n};\n"],"names":["sanitizeFileName","filename","replace","file","sanitizedName","name","File","type"],"mappings":"mBAUaA,EAAoBC,GACxBA,EAASC,QAAQ,OAAQ,gCAXA,8BAmBLC,IAC3B,MAAMC,EAAgBJ,EAAiBG,EAAKE,MAC5C,OAAO,IAAIC,KAAK,CAACH,GAAOC,EAAe,CAAEG,KAAMJ,EAAKI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const TWENTY_MB_IN_BYTES: number;
|
|
2
2
|
/**
|
|
3
3
|
* Sanitizes a filename by replacing spaces with dashes
|
|
4
4
|
* @param filename - The original filename
|
|
@@ -15,4 +15,4 @@ declare const sanitizeFileName: (filename: string) => string;
|
|
|
15
15
|
*/
|
|
16
16
|
declare const sanitizeFile: (file: File) => File;
|
|
17
17
|
|
|
18
|
-
export {
|
|
18
|
+
export { TWENTY_MB_IN_BYTES, sanitizeFile, sanitizeFileName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=
|
|
1
|
+
const e=20971520,t=e=>e.replace(/\s+/g,"-"),n=e=>{const n=t(e.name);return new File([e],n,{type:e.type})};export{e as TWENTY_MB_IN_BYTES,n as sanitizeFile,t as sanitizeFileName};
|
|
2
2
|
//# sourceMappingURL=fileUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileUtils.js","sources":["../../src/utilities/fileUtils.ts"],"sourcesContent":["export const
|
|
1
|
+
{"version":3,"file":"fileUtils.js","sources":["../../src/utilities/fileUtils.ts"],"sourcesContent":["export const TWENTY_MB_IN_BYTES = 20 * 1024 * 1024;\n\n/**\n * Sanitizes a filename by replacing spaces with dashes\n * @param filename - The original filename\n * @returns The sanitized filename with spaces replaced by dashes\n * @example\n * sanitizeFileName('my file.jpg') // returns 'my-file.jpg'\n * sanitizeFileName('already-good.png') // returns 'already-good.png'\n */\nexport const sanitizeFileName = (filename: string): string => {\n return filename.replace(/\\s+/g, '-');\n};\n\n/**\n * Creates a new File object with a sanitized filename\n * @param file - The original File object\n * @returns A new File object with spaces replaced by dashes in the filename\n */\nexport const sanitizeFile = (file: File): File => {\n const sanitizedName = sanitizeFileName(file.name);\n return new File([file], sanitizedName, { type: file.type });\n};\n"],"names":["TWENTY_MB_IN_BYTES","sanitizeFileName","filename","replace","sanitizeFile","file","sanitizedName","name","File","type"],"mappings":"MAAaA,EAAqB,SAUrBC,EAAoBC,GACxBA,EAASC,QAAQ,OAAQ,KAQrBC,EAAgBC,IAC3B,MAAMC,EAAgBL,EAAiBI,EAAKE,MAC5C,OAAO,IAAIC,KAAK,CAACH,GAAOC,EAAe,CAAEG,KAAMJ,EAAKI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipdish/portal-library",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.7",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@cloudinary/url-gen": "^1.21.0",
|
|
43
43
|
"@emotion/react": "11.14.0",
|
|
44
44
|
"@emotion/styled": "11.14.1",
|
|
45
|
-
"@flipdish/asset-management": "^0.0.5 || ^0.0.6 || ^0.0.7 || ^0.0.10 || ^0.0.11",
|
|
45
|
+
"@flipdish/asset-management": "^0.0.5 || ^0.0.6 || ^0.0.7 || ^0.0.10 || ^0.0.11 || ^0.0.12",
|
|
46
46
|
"@mui/material": "6.5.0",
|
|
47
47
|
"@mui/x-date-pickers": "^7.23.3",
|
|
48
48
|
"@tanstack/react-query": "^5.62.0",
|