@powerhousedao/document-engineering 1.30.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-input-container.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-input-container.js +30 -31
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-input-container.js.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/use-id-autocomplete.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/use-id-autocomplete.js +2 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/use-id-autocomplete.js.map +1 -1
- package/dist/src/scalars/components/index.d.ts +1 -0
- package/dist/src/scalars/components/index.d.ts.map +1 -1
- package/dist/src/scalars/components/index.js +1 -0
- package/dist/src/scalars/components/index.js.map +1 -1
- package/dist/src/scalars/components/phone-number-field/phone-number-field.d.ts.map +1 -1
- package/dist/src/scalars/components/phone-number-field/phone-number-field.js +18 -2
- package/dist/src/scalars/components/phone-number-field/phone-number-field.js.map +1 -1
- package/dist/src/ui/components/data-entry/amount-input/amount-input.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/amount-input/amount-input.js +2 -2
- package/dist/src/ui/components/data-entry/amount-input/amount-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.d.ts +7 -0
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.js +64 -0
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/examples/index.d.ts +2 -0
- package/dist/src/ui/components/data-entry/file-input/examples/index.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/examples/index.js +2 -0
- package/dist/src/ui/components/data-entry/file-input/examples/index.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.js +1 -1
- package/dist/src/ui/components/data-entry/file-input/file-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.d.ts +3 -3
- package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.js +16 -9
- package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.d.ts +9 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.js +10 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.d.ts +8 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.js +11 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.d.ts +6 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.js +8 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.d.ts +8 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.js +8 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.d.ts +2 -4
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.js +3 -8
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.d.ts +2 -2
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.js +1 -2
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.d.ts +2 -4
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.js +3 -8
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.d.ts +8 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.js +8 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/types.d.ts +3 -5
- package/dist/src/ui/components/data-entry/file-input/types.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/types.js +1 -1
- package/dist/src/ui/components/data-entry/file-input/types.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/useFetchQuery.d.ts +11 -0
- package/dist/src/ui/components/data-entry/file-input/useFetchQuery.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/useFetchQuery.js +30 -0
- package/dist/src/ui/components/data-entry/file-input/useFetchQuery.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/useUploadFile.d.ts +3 -4
- package/dist/src/ui/components/data-entry/file-input/useUploadFile.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/useUploadFile.js +30 -36
- package/dist/src/ui/components/data-entry/file-input/useUploadFile.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/utils.d.ts +32 -4
- package/dist/src/ui/components/data-entry/file-input/utils.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/utils.js +142 -57
- package/dist/src/ui/components/data-entry/file-input/utils.js.map +1 -1
- package/dist/src/ui/components/data-entry/number-input/number-input.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/number-input/number-input.js +5 -5
- package/dist/src/ui/components/data-entry/number-input/number-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/number-input/types.d.ts +1 -0
- package/dist/src/ui/components/data-entry/number-input/types.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/password-input/password-input.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/password-input/password-input.js +1 -1
- package/dist/src/ui/components/data-entry/password-input/password-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.js +3 -6
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.d.ts +15 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.js +117 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.js.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.d.ts +14 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.js +8 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.js.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.d.ts +12 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.js +9 -0
- package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.js.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.js +37 -13
- package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.js.map +1 -1
- package/dist/src/ui/components/icon-components/BrokenAudio.d.ts +7 -0
- package/dist/src/ui/components/icon-components/BrokenAudio.d.ts.map +1 -0
- package/dist/src/ui/components/icon-components/BrokenAudio.js +7 -0
- package/dist/src/ui/components/icon-components/BrokenAudio.js.map +1 -0
- package/dist/src/ui/components/icon-components/BrokenVideo.d.ts +7 -0
- package/dist/src/ui/components/icon-components/BrokenVideo.d.ts.map +1 -0
- package/dist/src/ui/components/icon-components/BrokenVideo.js +7 -0
- package/dist/src/ui/components/icon-components/BrokenVideo.js.map +1 -0
- package/dist/src/ui/components/icon-components/PlaceholderAudio.d.ts +7 -0
- package/dist/src/ui/components/icon-components/PlaceholderAudio.d.ts.map +1 -0
- package/dist/src/ui/components/icon-components/PlaceholderAudio.js +7 -0
- package/dist/src/ui/components/icon-components/PlaceholderAudio.js.map +1 -0
- package/dist/src/ui/components/icon-components/PlaceholderVideo.d.ts +7 -0
- package/dist/src/ui/components/icon-components/PlaceholderVideo.d.ts.map +1 -0
- package/dist/src/ui/components/icon-components/PlaceholderVideo.js +7 -0
- package/dist/src/ui/components/icon-components/PlaceholderVideo.js.map +1 -0
- package/dist/src/ui/components/icon-components/index.d.ts +1 -1
- package/dist/src/ui/components/icon-components/index.d.ts.map +1 -1
- package/dist/src/ui/components/icon-components/index.js +12 -0
- package/dist/src/ui/components/icon-components/index.js.map +1 -1
- package/dist/src/ui/components/index.d.ts +1 -0
- package/dist/src/ui/components/index.d.ts.map +1 -1
- package/dist/src/ui/components/index.js +1 -0
- package/dist/src/ui/components/index.js.map +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.d.ts.map +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.js +2 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.js.map +1 -1
- package/dist/style.css +145 -12
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-image.d.ts +0 -9
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-image.d.ts.map +0 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-image.js +0 -13
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-image.js.map +0 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-pdf.d.ts +0 -9
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-pdf.d.ts.map +0 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-pdf.js +0 -13
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-pdf.js.map +0 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-unsupported.d.ts +0 -8
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-unsupported.d.ts.map +0 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-unsupported.js +0 -11
- package/dist/src/ui/components/data-entry/file-input/sub-components/place-holder-unsupported.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-item.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/file-upload-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAA;AAC/F,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,0EAA0E,CAAA;AAE1G,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"file-upload-item.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/file-upload-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAA;AAC/F,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,0EAA0E,CAAA;AAE1G,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAuBjE,MAAM,cAAc,GAAG,CAAC,EACtB,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,SAAS,EACpB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,GAAG,EAAE,EACb,YAAY,EACZ,MAAM,GAAG,MAAM;AAEf,gBAAgB;AAChB,WAAW,EACX,OAAO,EACP,aAAa,EACb,eAAe,EACf,qBAAqB,GAAG,GAAG,EAAE,CAA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ewType } from '../types.js';
|
|
2
|
+
interface PlaceHolderCorruptedProps {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
typePreview: PreviewType;
|
|
6
|
+
}
|
|
7
|
+
export declare const PlaceHolderCorrupted: ({ onClose, className, typePreview }: PlaceHolderCorruptedProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=placeholder-corrupted.d.ts.map
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-corrupted.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAI9C,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,oBAAoB,GAAI,qCAAqC,yBAAyB,4CAwBlG,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
3
|
+
import { Icon } from '../../../icon/index.js';
|
|
4
|
+
import { getBrokenFileIcon } from '../utils.js';
|
|
5
|
+
import PreviewHeader from './preview-header.js';
|
|
6
|
+
export const PlaceHolderCorrupted = ({ onClose, className, typePreview }) => {
|
|
7
|
+
const iconBroken = getBrokenFileIcon(typePreview);
|
|
8
|
+
return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,115,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "error", onClose: onClose, title: "Corrupted File" }), _jsx("div", { className: "flex flex-col items-center justify-center bg-gray-100 w-full rounded-md overflow-hidden flex-1", children: _jsx("div", { className: "relative", children: _jsx(Icon, { name: iconBroken, size: 128, className: "text-gray-300" }) }) }), _jsx("div", { className: "border-gray-200", children: _jsx("p", { className: "text-xs text-red-900 font-normal leading-4.5", children: "Your file is corrupted and cannot be shown in the preview" }) })] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=placeholder-corrupted.js.map
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-corrupted.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAA6B,EAAE,EAAE;IACrG,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAEjD,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,gHAAgH,EAChH,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,gBAAgB,GAAG,EACzE,cAAK,SAAS,EAAC,gGAAgG,YAC7G,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAC,eAAe,GAAG,GAC3D,GACF,EAEN,cAAK,SAAS,EAAC,iBAAiB,YAC9B,YAAG,SAAS,EAAC,8CAA8C,0EAEvD,GACA,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PreviewType } from '../types.js';
|
|
2
|
+
interface PlaceHolderPdfProps {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
typePreview: PreviewType;
|
|
5
|
+
}
|
|
6
|
+
export declare const PlaceHolderLoading: ({ onClose, typePreview }: PlaceHolderPdfProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=placeholder-loading.d.ts.map
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-loading.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-loading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAG9C,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,kBAAkB,GAAI,0BAA0B,mBAAmB,4CAuB/E,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import PreviewHeader from './preview-header.js';
|
|
3
|
+
import LoadingBar from './loading-bar.js';
|
|
4
|
+
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
5
|
+
import { Icon } from '../../../icon/index.js';
|
|
6
|
+
import { getIconLoading } from '../utils.js';
|
|
7
|
+
export const PlaceHolderLoading = ({ onClose, typePreview }) => {
|
|
8
|
+
const iconLoading = getIconLoading(typePreview);
|
|
9
|
+
return (_jsxs("div", { className: "flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(37, 44, 56, 0.25)] px-6 py-4 gap-4 border border-gray-200 w-full h-full", children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose }), _jsx("div", { className: cn('flex-1 min-h-0 flex flex-col items-center justify-center bg-gray-100 w-full overflow-auto rounded-md'), children: _jsxs("div", { className: "flex flex-col items-center justify-center gap-6", children: [_jsx("div", { className: "relative", children: _jsx(Icon, { name: iconLoading, size: 256, className: "text-gray-300" }) }), _jsxs("div", { className: "flex flex-col items-center justify-center gap-4", children: [_jsx("h3", { className: "text-xl font-bold leading-6 text-gray-500", children: "Loading" }), _jsx(LoadingBar, { progress: 50, className: "w-[375px]" })] })] }) })] }));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=placeholder-loading.js.map
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-loading.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-loading.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAO5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,OAAO,EAAE,WAAW,EAAuB,EAAE,EAAE;IAClF,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;IAC/C,OAAO,CACL,eAAK,SAAS,EAAC,yIAAyI,aACtJ,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,EACjD,cACE,SAAS,EAAE,EAAE,CACX,sGAAsG,CACvG,YAED,eAAK,SAAS,EAAC,iDAAiD,aAC9D,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAC,eAAe,GAAG,GAC5D,EAEN,eAAK,SAAS,EAAC,iDAAiD,aAC9D,aAAI,SAAS,EAAC,2CAA2C,wBAAa,EACtE,KAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAC,WAAW,GAAG,IAC9C,IACF,GACF,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-unsupported.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,eAAO,MAAM,sBAAsB,GAAI,aAAa,mBAAmB,4CAwBtE,CAAA"}
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import PreviewHeader from './preview-header.js';
|
|
3
|
+
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
4
|
+
import { Icon } from '../../../icon/index.js';
|
|
5
|
+
export const PlaceHolderUnsupported = ({ onClose }) => {
|
|
6
|
+
return (_jsxs("div", { className: "flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(37, 44, 56, 0.25)] px-6 py-4 gap-4 border border-gray-200 w-full h-full", children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose }), _jsxs("div", { className: cn('flex-1 min-h-0 flex flex-col items-center justify-center bg-gray-100 w-full overflow-auto rounded-md'), children: [_jsx("div", { className: "relative", children: _jsx(Icon, { name: "ContentUnavailableIcon", size: 256, className: "text-gray-300" }) }), _jsxs("div", { className: "flex flex-col items-center justify-center gap-4", children: [_jsx("h3", { className: "text-xl font-bold leading-6 text-gray-500", children: "Opss!" }), _jsx("p", { className: "text-center text-sm text-gray-500 mx-auto max-w-[375px] whitespace-pre-line", children: "It looks like we still don't support this format. (We are working on it) Please try to upload it with a different Format." })] })] })] }));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=placeholder-unsupported.js.map
|
package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-unsupported.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAM7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;IACzE,OAAO,CACL,eAAK,SAAS,EAAC,yIAAyI,aACtJ,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,EACjD,eACE,SAAS,EAAE,EAAE,CACX,sGAAsG,CACvG,aAED,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,IAAI,EAAC,wBAAwB,EAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAC,eAAe,GAAG,GACvE,EAEN,eAAK,SAAS,EAAC,iDAAiD,aAC9D,aAAI,SAAS,EAAC,2CAA2C,sBAAW,EAEpE,YAAG,SAAS,EAAC,6EAA6E,0IAGtF,IACA,IACF,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface AudioPreviewProps {
|
|
2
|
+
onClose?: () => void;
|
|
3
|
+
preview?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const PreviewAudio: ({ onClose, preview, className }: AudioPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default PreviewAudio;
|
|
8
|
+
//# sourceMappingURL=preview-audio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-audio.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-audio.tsx"],"names":[],"mappings":"AAGA,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,YAAY,GAAI,iCAA8C,iBAAiB,4CAiBpF,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
3
|
+
import PreviewHeader from './preview-header.js';
|
|
4
|
+
const PreviewAudio = ({ onClose = () => null, preview, className }) => {
|
|
5
|
+
return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,15,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose, title: "Audio Preview" }), _jsx("div", { className: "flex-1 flex items-center justify-center", children: _jsx("audio", { src: preview, controls: true, className: "w-full", "aria-label": "Audio player", children: _jsx("p", { children: "Your browser does not support the audio preview." }) }) })] }));
|
|
6
|
+
};
|
|
7
|
+
export default PreviewAudio;
|
|
8
|
+
//# sourceMappingURL=preview-audio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-audio.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-audio.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAqB,EAAE,EAAE;IACvF,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,+GAA+G,EAC/G,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,GAAG,EAEvE,cAAK,SAAS,EAAC,yCAAyC,YACtD,gBAAO,GAAG,EAAE,OAAO,EAAE,QAAQ,QAAC,SAAS,EAAC,QAAQ,gBAAY,cAAc,YACxE,2EAAuD,GACjD,GACJ,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { type PreviewStatus } from '../types.js';
|
|
2
1
|
interface FilePreviewStateProps {
|
|
3
2
|
onClose?: () => void;
|
|
4
3
|
preview?: string;
|
|
5
4
|
className?: string;
|
|
6
|
-
status: PreviewStatus;
|
|
7
5
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
6
|
+
declare const PreviewFile: ({ onClose, preview, className }: FilePreviewStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default PreviewFile;
|
|
10
8
|
//# sourceMappingURL=preview-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-file.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-file.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview-file.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-file.tsx"],"names":[],"mappings":"AAGA,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,WAAW,GAAI,iCAA8C,qBAAqB,4CAqBvF,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
3
|
-
import { PREVIEW_STATUS } from '../types.js';
|
|
4
|
-
import { PlaceHolderPdf } from './place-holder-pdf.js';
|
|
5
3
|
import PreviewHeader from './preview-header.js';
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
return (_jsxs("div", { className: cn('relative flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,15,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: status, onClose: onClose, title: "PDF Preview" }), _jsx("div", { className: "flex-1 relative rounded-md overflow-hidden", children: _jsx("iframe", { src: `${preview}#toolbar=0&navpanes=0&scrollbar=0`, title: "Previsualizaci\u00F3n de PDF", className: "w-full h-full border-none", height: 652, width: 500, children: _jsx("p", { children: "Your browser does not support the preview." }) }) })] }));
|
|
9
|
-
}
|
|
10
|
-
return _jsx(PlaceHolderPdf, { status: status, onClose: onClose, className: cn('w-full h-full', className) });
|
|
4
|
+
const PreviewFile = ({ onClose = () => null, preview, className }) => {
|
|
5
|
+
return (_jsxs("div", { className: cn('relative flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,15,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose, title: "PDF Preview" }), _jsx("div", { className: "flex-1 relative rounded-md overflow-hidden", children: _jsx("iframe", { src: `${preview}#toolbar=0&navpanes=0&scrollbar=0`, title: "Previsualizaci\u00F3n de PDF", className: "w-full h-full border-none", children: _jsx("p", { children: "Your browser does not support the preview." }) }) })] }));
|
|
11
6
|
};
|
|
12
|
-
export default
|
|
7
|
+
export default PreviewFile;
|
|
13
8
|
//# sourceMappingURL=preview-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-file.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-file.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"preview-file.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-file.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,WAAW,GAAG,CAAC,EAAE,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAyB,EAAE,EAAE;IAC1F,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,wHAAwH,EACxH,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,aAAa,GAAG,EAErE,cAAK,SAAS,EAAC,4CAA4C,YACzD,iBACE,GAAG,EAAE,GAAG,OAAO,mCAAmC,EAClD,KAAK,EAAC,8BAAyB,EAC/B,SAAS,EAAC,2BAA2B,YAErC,qEAAiD,GAC1C,GACL,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-header.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview-header.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-header.tsx"],"names":[],"mappings":"AAGA,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpC,UAAU,kBAAkB;IAC1B,MAAM,EAAE,YAAY,CAAA;IACpB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,aAAa,GAAI,4BAA6C,kBAAkB,4CAWrF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
3
3
|
import { Icon } from '../../../icon/index.js';
|
|
4
|
-
import { PREVIEW_STATUS } from '../types.js';
|
|
5
4
|
const PreviewHeader = ({ status, onClose, title = 'File Preview' }) => {
|
|
6
|
-
return (_jsxs("header", { className: "flex justify-between items-center", children: [_jsx("span", { className: cn('text-gray-900 text-sm font-normal leading-4.5', status ===
|
|
5
|
+
return (_jsxs("header", { className: "flex justify-between items-center", children: [_jsx("span", { className: cn('text-gray-900 text-sm font-normal leading-4.5', status === 'error' && 'text-red-900'), children: title }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close preview", className: "text-gray-400 hover:text-gray-600", children: _jsx(Icon, { name: "XmarkLight", size: 16, className: "text-gray-900" }) })] }));
|
|
7
6
|
};
|
|
8
7
|
export default PreviewHeader;
|
|
9
8
|
//# sourceMappingURL=preview-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-header.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"preview-header.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAU7C,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,cAAc,EAAsB,EAAE,EAAE;IACxF,OAAO,CACL,kBAAQ,SAAS,EAAC,mCAAmC,aACnD,eAAM,SAAS,EAAE,EAAE,CAAC,+CAA+C,EAAE,MAAM,KAAK,OAAO,IAAI,cAAc,CAAC,YACvG,KAAK,GACD,EACP,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,gBAAa,eAAe,EAAC,SAAS,EAAC,mCAAmC,YAC9G,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,eAAe,GAAG,GACvD,IACF,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { type PreviewStatus } from '../types.js';
|
|
2
1
|
interface FilePreviewStateProps {
|
|
3
|
-
status: PreviewStatus;
|
|
4
2
|
onClose: () => void;
|
|
5
3
|
className?: string;
|
|
6
4
|
preview?: string;
|
|
7
5
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
6
|
+
declare const PreviewImage: ({ onClose, className, preview }: FilePreviewStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default PreviewImage;
|
|
10
8
|
//# sourceMappingURL=preview-image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-image.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview-image.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-image.tsx"],"names":[],"mappings":"AAGA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,QAAA,MAAM,YAAY,GAAI,iCAAiC,qBAAqB,4CAc3E,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
3
|
-
import { PREVIEW_STATUS } from '../types.js';
|
|
4
|
-
import { PlaceHolderImage } from './place-holder-image.js';
|
|
5
3
|
import PreviewHeader from './preview-header.js';
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,115,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: status, onClose: onClose, title: "Image Preview" }), _jsx("div", { className: "flex justify-center items-center relative rounded-md overflow-hidden", children: preview && _jsx("img", { src: preview, alt: "Preview", className: "w-full h-full object-contain" }) })] }));
|
|
9
|
-
}
|
|
10
|
-
return _jsx(PlaceHolderImage, { status: status, onClose: onClose, className: className });
|
|
4
|
+
const PreviewImage = ({ onClose, className, preview }) => {
|
|
5
|
+
return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,115,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose, title: "Image Preview" }), _jsx("div", { className: "flex-1 flex justify-center items-center relative rounded-md overflow-hidden", children: preview && _jsx("img", { src: preview, alt: "Preview", className: "w-full h-full object-contain" }) })] }));
|
|
11
6
|
};
|
|
12
|
-
export default
|
|
7
|
+
export default PreviewImage;
|
|
13
8
|
//# sourceMappingURL=preview-image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-image.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"preview-image.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAyB,EAAE,EAAE;IAC9E,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,gHAAgH,EAChH,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,GAAG,EACvE,cAAK,SAAS,EAAC,6EAA6E,YACzF,OAAO,IAAI,cAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,EAAC,SAAS,EAAC,8BAA8B,GAAG,GACpF,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface VideoPreviewProps {
|
|
2
|
+
onClose?: () => void;
|
|
3
|
+
preview?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const PreviewVideo: ({ onClose, preview, className }: VideoPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default PreviewVideo;
|
|
8
|
+
//# sourceMappingURL=preview-video.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-video.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-video.tsx"],"names":[],"mappings":"AAGA,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,YAAY,GAAI,iCAA8C,iBAAiB,4CAsBpF,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../../../../scalars/lib/utils.js';
|
|
3
|
+
import PreviewHeader from './preview-header.js';
|
|
4
|
+
const PreviewVideo = ({ onClose = () => null, preview, className }) => {
|
|
5
|
+
return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,15,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose, title: "Video Preview" }), _jsx("div", { className: "flex-1 flex justify-center items-center rounded-md overflow-hidden", children: _jsx("video", { src: preview, controls: true, "aria-label": "Video player", className: "w-full h-full rounded-md overflow-hidden object-contain", children: _jsx("p", { children: "Your browser does not support the video preview." }) }) })] }));
|
|
6
|
+
};
|
|
7
|
+
export default PreviewVideo;
|
|
8
|
+
//# sourceMappingURL=preview-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-video.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-video.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAqB,EAAE,EAAE;IACvF,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,+GAA+G,EAC/G,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,GAAG,EAEvE,cAAK,SAAS,EAAC,oEAAoE,YACjF,gBACE,GAAG,EAAE,OAAO,EACZ,QAAQ,sBACG,cAAc,EACzB,SAAS,EAAC,yDAAyD,YAEnE,2EAAuD,GACjD,GACJ,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -20,17 +20,15 @@ export interface FileInputProps extends Omit<InputHTMLAttributes<HTMLInputElemen
|
|
|
20
20
|
export type UploadFile = 'idle' | 'uploading' | 'success' | 'error';
|
|
21
21
|
export declare const PREVIEW_STATUS: {
|
|
22
22
|
readonly LOADING: "loading";
|
|
23
|
-
readonly
|
|
23
|
+
readonly UNSUPPORTED_FILE: "unsupported_file";
|
|
24
24
|
readonly CORRUPTED_FILE: "corrupted_file";
|
|
25
25
|
readonly SUCCESS: "success";
|
|
26
26
|
};
|
|
27
|
-
type
|
|
28
|
-
export type PreviewStatus = ValueOf<typeof PREVIEW_STATUS>;
|
|
27
|
+
export type PreviewStatus = 'idle' | 'loading' | 'success' | 'corrupted_file' | 'unsupported_file';
|
|
29
28
|
export interface StatusConfig {
|
|
30
29
|
icon: IconName | undefined;
|
|
31
30
|
title?: string;
|
|
32
31
|
message?: string;
|
|
33
32
|
}
|
|
34
|
-
export type PreviewType = 'pdf' | 'image' | 'audio' | '
|
|
35
|
-
export {};
|
|
33
|
+
export type PreviewType = 'pdf' | 'image' | 'audio' | 'video';
|
|
36
34
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA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C,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/types.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/types.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,OAAO,EAAE,SAAS;CACV,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface UseQueryOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
interface UseQueryResult<T> {
|
|
5
|
+
data: T | null;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: unknown;
|
|
8
|
+
}
|
|
9
|
+
declare const useFetchQuery: <T>(queryFn: () => Promise<T>, { enabled }?: UseQueryOptions) => UseQueryResult<T>;
|
|
10
|
+
export default useFetchQuery;
|
|
11
|
+
//# sourceMappingURL=useFetchQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/useFetchQuery.ts"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,UAAU,cAAc,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,QAAA,MAAM,aAAa,GAAI,CAAC,EAAE,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,cAAoB,eAAoB,KAAG,cAAc,CAAC,CAAC,CA6B/G,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
const useFetchQuery = (queryFn, { enabled = true } = {}) => {
|
|
3
|
+
const [data, setData] = useState(null);
|
|
4
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
5
|
+
const [error, setError] = useState(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!enabled) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const fetchData = async () => {
|
|
11
|
+
setIsLoading(true);
|
|
12
|
+
setError(null);
|
|
13
|
+
setData(null);
|
|
14
|
+
try {
|
|
15
|
+
const result = await queryFn();
|
|
16
|
+
setData(result);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
setError(err);
|
|
20
|
+
}
|
|
21
|
+
finally {
|
|
22
|
+
setIsLoading(false);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
void fetchData();
|
|
26
|
+
}, [queryFn, enabled]);
|
|
27
|
+
return { data, isLoading, error };
|
|
28
|
+
};
|
|
29
|
+
export default useFetchQuery;
|
|
30
|
+
//# sourceMappingURL=useFetchQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchQuery.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/useFetchQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAY3C,MAAM,aAAa,GAAG,CAAI,OAAyB,EAAE,EAAE,OAAO,GAAG,IAAI,KAAsB,EAAE,EAAqB,EAAE;IAClH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAW,IAAI,CAAC,CAAA;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAA;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAM;QACR,CAAC;QAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;YAC3B,YAAY,CAAC,IAAI,CAAC,CAAA;YAClB,QAAQ,CAAC,IAAI,CAAC,CAAA;YACd,OAAO,CAAC,IAAI,CAAC,CAAA;YAEb,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAA;gBAC9B,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,QAAQ,CAAC,GAAG,CAAC,CAAA;YACf,CAAC;oBAAS,CAAC;gBACT,YAAY,CAAC,KAAK,CAAC,CAAA;YACrB,CAAC;QACH,CAAC,CAAA;QAED,KAAK,SAAS,EAAE,CAAA;IAClB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IAEtB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;AACnC,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PreviewStatus } from './types.js';
|
|
2
2
|
interface UseFileUploadProps {
|
|
3
3
|
value?: File | null;
|
|
4
4
|
defaultValue?: File | null;
|
|
@@ -10,11 +10,10 @@ export declare const useFileUpload: ({ value, defaultValue, onChange }: UseFileU
|
|
|
10
10
|
borderIndicator: string;
|
|
11
11
|
preview: string | undefined;
|
|
12
12
|
handleCancelPreview: () => void;
|
|
13
|
-
handleOnPreview: () =>
|
|
13
|
+
handleOnPreview: () => void;
|
|
14
14
|
isPreviewOpen: boolean;
|
|
15
15
|
previewStatus: PreviewStatus;
|
|
16
|
-
|
|
17
|
-
typePreview: "audio" | "image" | "unknown" | "pdf";
|
|
16
|
+
typePreview: "audio" | "video" | "image" | "pdf" | undefined;
|
|
18
17
|
};
|
|
19
18
|
export {};
|
|
20
19
|
//# sourceMappingURL=useUploadFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUploadFile.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/useUploadFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUploadFile.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/useUploadFile.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAC1B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;CACvC;AAED,eAAO,MAAM,aAAa,GAAI,mCAAmC,kBAAkB;iCA0B9D,IAAI,EAAE;;;;;;;;;CA4C1B,CAAA"}
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
const mapValidator = {
|
|
5
|
-
['pdf']: validatePdfHeader,
|
|
6
|
-
['image']: validateImageHeader,
|
|
7
|
-
['audio']: async () => Promise.resolve(true),
|
|
8
|
-
['unknown']: async () => Promise.resolve(false),
|
|
9
|
-
};
|
|
2
|
+
import { detectPreviewType, getPreviewComponentFromError, validateFileForPreview } from './utils.js';
|
|
3
|
+
import useFetchQuery from './useFetchQuery.js';
|
|
10
4
|
export const useFileUpload = ({ value, defaultValue, onChange }) => {
|
|
11
5
|
const [file, setFile] = useState(value ?? defaultValue ?? null);
|
|
12
6
|
const [preview, setPreview] = useState(undefined);
|
|
13
7
|
const [isPreviewOpen, setIsPreviewOpen] = useState(false);
|
|
14
|
-
const
|
|
8
|
+
const queryFn = useCallback(async () => {
|
|
9
|
+
if (!file)
|
|
10
|
+
return Promise.reject(new Error('No hay archivo seleccionado'));
|
|
11
|
+
return validateFileForPreview(file);
|
|
12
|
+
}, [file]);
|
|
13
|
+
const { data, isLoading, error } = useFetchQuery(queryFn, {
|
|
14
|
+
enabled: isPreviewOpen && !!file,
|
|
15
|
+
});
|
|
16
|
+
const getPreviewStatus = () => {
|
|
17
|
+
if (!isPreviewOpen)
|
|
18
|
+
return 'idle';
|
|
19
|
+
if (isLoading)
|
|
20
|
+
return 'loading';
|
|
21
|
+
if (error) {
|
|
22
|
+
const errorType = getPreviewComponentFromError(error);
|
|
23
|
+
return errorType || 'unsupported_file';
|
|
24
|
+
}
|
|
25
|
+
if (data === 'success')
|
|
26
|
+
return 'success';
|
|
27
|
+
return 'idle';
|
|
28
|
+
};
|
|
29
|
+
const previewStatus = getPreviewStatus();
|
|
15
30
|
const handleDrop = useCallback((acceptedFiles) => {
|
|
16
31
|
if (!acceptedFiles || acceptedFiles.length === 0)
|
|
17
32
|
return;
|
|
@@ -24,32 +39,7 @@ export const useFileUpload = ({ value, defaultValue, onChange }) => {
|
|
|
24
39
|
const handleCancelPreview = () => {
|
|
25
40
|
setIsPreviewOpen(false);
|
|
26
41
|
};
|
|
27
|
-
const typePreview = detectPreviewType(file
|
|
28
|
-
const handleOnPreview = async () => {
|
|
29
|
-
setIsPreviewOpen(true);
|
|
30
|
-
setPreviewStatus(PREVIEW_STATUS.LOADING);
|
|
31
|
-
if (!file || typePreview === 'unknown') {
|
|
32
|
-
setPreviewStatus(PREVIEW_STATUS.UNSUPPORTED_FORMAT);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const validator = mapValidator[typePreview];
|
|
36
|
-
try {
|
|
37
|
-
const isValid = await validator(file);
|
|
38
|
-
if (!isValid) {
|
|
39
|
-
setPreviewStatus(PREVIEW_STATUS.CORRUPTED_FILE);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (!preview) {
|
|
43
|
-
setPreviewStatus(PREVIEW_STATUS.CORRUPTED_FILE);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
await new Promise((res) => setTimeout(res, 2000));
|
|
47
|
-
setPreviewStatus(PREVIEW_STATUS.SUCCESS);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
setPreviewStatus(PREVIEW_STATUS.CORRUPTED_FILE);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
42
|
+
const typePreview = detectPreviewType(file ?? undefined);
|
|
53
43
|
useEffect(() => {
|
|
54
44
|
return () => {
|
|
55
45
|
if (preview) {
|
|
@@ -58,6 +48,11 @@ export const useFileUpload = ({ value, defaultValue, onChange }) => {
|
|
|
58
48
|
};
|
|
59
49
|
}, [preview]);
|
|
60
50
|
const borderIndicator = file ? 'text-blue-900' : 'text-gray-300';
|
|
51
|
+
const handleOnPreview = () => {
|
|
52
|
+
if (!file)
|
|
53
|
+
return;
|
|
54
|
+
setIsPreviewOpen(true);
|
|
55
|
+
};
|
|
61
56
|
return {
|
|
62
57
|
handleDrop,
|
|
63
58
|
file,
|
|
@@ -68,7 +63,6 @@ export const useFileUpload = ({ value, defaultValue, onChange }) => {
|
|
|
68
63
|
handleOnPreview,
|
|
69
64
|
isPreviewOpen,
|
|
70
65
|
previewStatus,
|
|
71
|
-
setPreviewStatus,
|
|
72
66
|
typePreview,
|
|
73
67
|
};
|
|
74
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUploadFile.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/useUploadFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MA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