@ai-matrx/media 0.3.0 → 0.4.1
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/CHANGELOG.md +156 -0
- package/README.md +60 -3
- package/dist/next.cjs +92 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +74 -0
- package/dist/next.d.ts +74 -0
- package/dist/next.js +60 -0
- package/dist/next.js.map +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +10 -1
- package/dist/react.d.ts +10 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/viewers.cjs +1756 -0
- package/dist/viewers.cjs.map +1 -0
- package/dist/viewers.d.cts +289 -0
- package/dist/viewers.d.ts +289 -0
- package/dist/viewers.js +1738 -0
- package/dist/viewers.js.map +1 -0
- package/package.json +31 -4
package/dist/react.d.cts
CHANGED
|
@@ -280,7 +280,16 @@ interface FileUploadDropzoneProps {
|
|
|
280
280
|
}
|
|
281
281
|
declare function FileUploadDropzone({ uploadOptions, accept, maxSize, enablePaste, mode, children, className, actions, onUploadStart, onUploaded, onError, onOpenFile, pickerEventName, }: FileUploadDropzoneProps): react.JSX.Element;
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Human file size.
|
|
285
|
+
*
|
|
286
|
+
* `null` / `undefined` / NaN / negative collapse to an em-dash, NOT to
|
|
287
|
+
* "0 B" (fixed at 0.4.0 while absorbing the viewer bodies — matrx-frontend's
|
|
288
|
+
* `formatFileSize` already had this guard and the package's did not, so a
|
|
289
|
+
* corrupt or mid-upload `size` row rendered as a confident, wrong "0 B"
|
|
290
|
+
* instead of an honest "size unknown").
|
|
291
|
+
*/
|
|
292
|
+
declare function formatFileSize(bytes: number | null | undefined): string;
|
|
284
293
|
interface UploadProgressListProps {
|
|
285
294
|
uploads: MediaUploadEntry[];
|
|
286
295
|
/** Remove an entry from the tray (wire to `useMediaUpload().clearEntry`). */
|
package/dist/react.d.ts
CHANGED
|
@@ -280,7 +280,16 @@ interface FileUploadDropzoneProps {
|
|
|
280
280
|
}
|
|
281
281
|
declare function FileUploadDropzone({ uploadOptions, accept, maxSize, enablePaste, mode, children, className, actions, onUploadStart, onUploaded, onError, onOpenFile, pickerEventName, }: FileUploadDropzoneProps): react.JSX.Element;
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Human file size.
|
|
285
|
+
*
|
|
286
|
+
* `null` / `undefined` / NaN / negative collapse to an em-dash, NOT to
|
|
287
|
+
* "0 B" (fixed at 0.4.0 while absorbing the viewer bodies — matrx-frontend's
|
|
288
|
+
* `formatFileSize` already had this guard and the package's did not, so a
|
|
289
|
+
* corrupt or mid-upload `size` row rendered as a confident, wrong "0 B"
|
|
290
|
+
* instead of an honest "size unknown").
|
|
291
|
+
*/
|
|
292
|
+
declare function formatFileSize(bytes: number | null | undefined): string;
|
|
284
293
|
interface UploadProgressListProps {
|
|
285
294
|
uploads: MediaUploadEntry[];
|
|
286
295
|
/** Remove an entry from the tray (wire to `useMediaUpload().clearEntry`). */
|
package/dist/react.js
CHANGED
|
@@ -1748,7 +1748,7 @@ import { memo, useEffect as useEffect7, useRef as useRef7, useState as useState6
|
|
|
1748
1748
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1749
1749
|
var AUTO_DISMISS_MS = 1e4;
|
|
1750
1750
|
function formatFileSize(bytes) {
|
|
1751
|
-
if (!Number.isFinite(bytes) || bytes < 0) return "
|
|
1751
|
+
if (bytes == null || !Number.isFinite(bytes) || bytes < 0) return "\u2014";
|
|
1752
1752
|
if (bytes < 1024) return `${bytes} B`;
|
|
1753
1753
|
const units = ["KB", "MB", "GB", "TB"];
|
|
1754
1754
|
let value = bytes;
|