@burdenoff/microfe-files 2026.1113.2 → 2026.1115.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/dist/files/components/CopyDialog.d.ts +6 -0
- package/dist/files/components/CopyDialog.js +112 -101
- package/dist/files/components/CopyDialog.js.map +1 -1
- package/dist/files/components/FileBrowser.js +175 -165
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/FileInfoPanel.d.ts +7 -1
- package/dist/files/components/FileInfoPanel.js +225 -184
- package/dist/files/components/FileInfoPanel.js.map +1 -1
- package/dist/files/components/SearchBar.d.ts +7 -1
- package/dist/files/components/SearchBar.js +166 -159
- package/dist/files/components/SearchBar.js.map +1 -1
- package/dist/files/components/ShareAccessParts.d.ts +65 -0
- package/dist/files/components/ShareAccessParts.js +149 -0
- package/dist/files/components/ShareAccessParts.js.map +1 -0
- package/dist/files/components/ShareDialog.d.ts +5 -4
- package/dist/files/components/ShareDialog.js +31 -27
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/components/SharedFolderView.d.ts +18 -0
- package/dist/files/components/SharedFolderView.js +80 -0
- package/dist/files/components/SharedFolderView.js.map +1 -0
- package/dist/files/hooks/usePublicShare.d.ts +21 -0
- package/dist/files/hooks/usePublicShare.js +45 -0
- package/dist/files/hooks/usePublicShare.js.map +1 -0
- package/dist/files/hooks/useSharedFolderFileUrl.d.ts +20 -0
- package/dist/files/hooks/useSharedFolderFileUrl.js +32 -0
- package/dist/files/hooks/useSharedFolderFileUrl.js.map +1 -0
- package/dist/files/pages/BrowserPage.js +274 -271
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/ShareAccessPage.js +129 -160
- package/dist/files/pages/ShareAccessPage.js.map +1 -1
- package/dist/files/utils/fileKind.d.ts +16 -0
- package/dist/files/utils/fileKind.js +120 -0
- package/dist/files/utils/fileKind.js.map +1 -0
- package/dist/files/utils/infoTechnicalDetails.d.ts +12 -0
- package/dist/files/utils/infoTechnicalDetails.js +16 -0
- package/dist/files/utils/infoTechnicalDetails.js.map +1 -0
- package/dist/files/utils/publicShare.d.ts +62 -0
- package/dist/files/utils/publicShare.js +44 -0
- package/dist/files/utils/publicShare.js.map +1 -0
- package/dist/files/utils/shareAccess.d.ts +6 -0
- package/dist/files/utils/shareAccess.js +6 -1
- package/dist/files/utils/shareAccess.js.map +1 -1
- package/dist/generated/global-types.d.ts +294 -123
- package/dist/generated/wspace-operations.d.ts +48 -0
- package/dist/generated/wspace-operations.js +372 -36
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +6493 -695
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/translations/en.d.ts +40 -0
- package/dist/translations/en.js +43 -1
- package/dist/translations/en.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PublicShareDocuments, PublicShareRequest, PublicShareResult, ShareResourceKind } from '../utils/publicShare';
|
|
2
|
+
import { ShareAccessFailure } from '../utils/shareAccess';
|
|
3
|
+
/**
|
|
4
|
+
* Opens a public share link (file or folder, BOFF-11865) when the page mounts
|
|
5
|
+
* and on retry or password entry. Failures are reduced to what the visitor
|
|
6
|
+
* can act on; the raw error only goes to `onError` for support logs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePublicShare(options: {
|
|
9
|
+
request: PublicShareRequest;
|
|
10
|
+
documents: PublicShareDocuments;
|
|
11
|
+
token: string;
|
|
12
|
+
onLoaded: (result: PublicShareResult) => void;
|
|
13
|
+
onError: (error: unknown, kind: ShareResourceKind | undefined) => void;
|
|
14
|
+
}): {
|
|
15
|
+
loading: boolean;
|
|
16
|
+
failure: ShareAccessFailure | null;
|
|
17
|
+
share: PublicShareResult | null;
|
|
18
|
+
kind: ShareResourceKind | null;
|
|
19
|
+
acceptedPasswordRef: import('react').RefObject<string | undefined>;
|
|
20
|
+
loadShare: (sharePassword?: string) => Promise<void>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { loadPublicShare as e } from "../utils/publicShare.js";
|
|
2
|
+
import { classifyShareAccessError as t } from "../utils/shareAccess.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
4
|
+
// src/files/hooks/usePublicShare.ts
|
|
5
|
+
function o(o) {
|
|
6
|
+
let { request: s, documents: c, token: l } = o, u = i(o);
|
|
7
|
+
r(() => {
|
|
8
|
+
u.current = o;
|
|
9
|
+
});
|
|
10
|
+
let [d, f] = a(!1), [p, m] = a(null), [h, g] = a(null), [_, v] = a(null), y = i(void 0), b = i(void 0), x = n(async (n) => {
|
|
11
|
+
f(!0);
|
|
12
|
+
try {
|
|
13
|
+
let t = await e(s, c, {
|
|
14
|
+
token: l,
|
|
15
|
+
password: n,
|
|
16
|
+
kind: y.current,
|
|
17
|
+
onKind: (e) => {
|
|
18
|
+
y.current = e, v(e);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
b.current = n || void 0, g(t), m(null), u.current.onLoaded(t);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
u.current.onError(e, y.current), m(t(e));
|
|
24
|
+
} finally {
|
|
25
|
+
f(!1);
|
|
26
|
+
}
|
|
27
|
+
}, [
|
|
28
|
+
c,
|
|
29
|
+
s,
|
|
30
|
+
l
|
|
31
|
+
]);
|
|
32
|
+
return r(() => {
|
|
33
|
+
x();
|
|
34
|
+
}, [x]), {
|
|
35
|
+
loading: d,
|
|
36
|
+
failure: p,
|
|
37
|
+
share: h,
|
|
38
|
+
kind: _,
|
|
39
|
+
acceptedPasswordRef: b,
|
|
40
|
+
loadShare: x
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export { o as usePublicShare };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=usePublicShare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePublicShare.js","names":["usePublicShare","options","callbacksRef","useRef","loading","setLoading","useState","failure","setFailure","share","setShare","kind","setKind","kindRef","acceptedPasswordRef","loadShare","useCallback","result","loadPublicShare","request","documents","sharePassword","resolved","error","classifyShareAccessError","token","useEffect"],"sources":["../../../src/files/hooks/usePublicShare.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport {\n type PublicShareDocuments,\n type PublicShareRequest,\n type PublicShareResult,\n type ShareResourceKind,\n loadPublicShare,\n} from \"../utils/publicShare\";\nimport {\n type ShareAccessFailure,\n classifyShareAccessError,\n} from \"../utils/shareAccess\";\n\n/**\n * Opens a public share link (file or folder, BOFF-11865) when the page mounts\n * and on retry or password entry. Failures are reduced to what the visitor\n * can act on; the raw error only goes to `onError` for support logs.\n */\nexport function usePublicShare(options: {\n request: PublicShareRequest;\n documents: PublicShareDocuments;\n token: string;\n onLoaded: (result: PublicShareResult) => void;\n onError: (error: unknown, kind: ShareResourceKind | undefined) => void;\n}) {\n const { request, documents, token } = options;\n // Read through refs so new callbacks never re-run the lookup (each lookup\n // counts a view on the link).\n const callbacksRef = useRef(options);\n useEffect(() => {\n callbacksRef.current = options;\n });\n\n const [loading, setLoading] = useState(false);\n const [failure, setFailure] = useState<ShareAccessFailure | null>(null);\n const [share, setShare] = useState<PublicShareResult | null>(null);\n const [kind, setKind] = useState<ShareResourceKind | null>(null);\n // Once the token's kind is known, retries skip the lookup.\n const kindRef = useRef<ShareResourceKind | undefined>(undefined);\n // The password that unlocked the link; folder file downloads need it again.\n const acceptedPasswordRef = useRef<string | undefined>(undefined);\n\n const loadShare = useCallback(\n async (sharePassword?: string) => {\n setLoading(true);\n try {\n const result = await loadPublicShare(request, documents, {\n token,\n password: sharePassword,\n kind: kindRef.current,\n onKind: (resolved) => {\n kindRef.current = resolved;\n setKind(resolved);\n },\n });\n acceptedPasswordRef.current = sharePassword || undefined;\n setShare(result);\n setFailure(null);\n callbacksRef.current.onLoaded(result);\n } catch (error) {\n callbacksRef.current.onError(error, kindRef.current);\n setFailure(classifyShareAccessError(error));\n } finally {\n setLoading(false);\n }\n },\n [documents, request, token],\n );\n\n useEffect(() => {\n void loadShare();\n }, [loadShare]);\n\n return { loading, failure, share, kind, acceptedPasswordRef, loadShare };\n}\n"],"mappings":";;;;AAkBA,SAAgBA,EAAe,GAM5B;CACD,IAAM,EAAE,YAAS,cAAW,aAAUC,GAGhCC,IAAeC,EAAOF,CAAO;CACnC,QAAgB;EACd,EAAa,UAAUA;CACzB,CAAC;CAED,IAAM,CAACG,GAASC,KAAcC,EAAS,EAAK,GACtC,CAACC,GAASC,KAAcF,EAAoC,IAAI,GAChE,CAACG,GAAOC,KAAYJ,EAAmC,IAAI,GAC3D,CAACK,GAAMC,KAAWN,EAAmC,IAAI,GAEzDO,IAAUV,EAAsC,KAAA,CAAS,GAEzDW,IAAsBX,EAA2B,KAAA,CAAS,GAE1DY,IAAYC,EAChB,OAAO,MAA2B;EAChC,EAAW,EAAI;EACf,IAAI;GACF,IAAMC,IAAS,MAAMC,EAAgBC,GAASC,GAAW;IACvD;IACA,UAAUC;IACV,MAAMR,EAAQ;IACd,SAAS,MAAa;KAEpB,AADA,EAAQ,UAAUS,GAClBV,EAAQU,CAAQ;IAClB;GACF,CAAC;GAID,AAHA,EAAoB,UAAUD,KAAiB,KAAA,GAC/CX,EAASO,CAAM,GACfT,EAAW,IAAI,GACfN,EAAa,QAAQ,SAASe,CAAM;EACtC,SAASM,GAAO;GAEd,AADArB,EAAa,QAAQ,QAAQqB,GAAOV,EAAQ,OAAO,GACnDL,EAAWgB,EAAyBD,CAAK,CAAC;EAC5C,UAAU;GACR,EAAW,EAAK;EAClB;CACF,GACA;EAACH;EAAWD;EAASM;CAAK,CAC5B;CAMA,OAJAC,QAAgB;EACd,EAAe;CACjB,GAAG,CAACX,CAAS,CAAC,GAEP;EAAE;EAAS;EAAS;EAAO;EAAM;EAAqB;CAAU;AACzE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { PublicShareRequest, SharedFolderFile } from '../utils/publicShare';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches a short-lived URL for one file of a folder opened through its
|
|
5
|
+
* public share link (BOFF-11865), and tracks which file is loading or failed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSharedFolderFileUrl(options: {
|
|
8
|
+
request: PublicShareRequest;
|
|
9
|
+
/** The printed DownloadFolderShareFile mutation. */
|
|
10
|
+
document: string;
|
|
11
|
+
token: string;
|
|
12
|
+
/** The password that unlocked the link, when it has one. */
|
|
13
|
+
passwordRef: RefObject<string | undefined>;
|
|
14
|
+
/** Called with the raw error for support logs; never shown to the visitor. */
|
|
15
|
+
onError: (error: unknown) => void;
|
|
16
|
+
}): {
|
|
17
|
+
busyFileId: string | null;
|
|
18
|
+
failedFileId: string | null;
|
|
19
|
+
fetchUrl: (file: SharedFolderFile) => Promise<string | null>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useCallback as e, useState as t } from "react";
|
|
2
|
+
// src/files/hooks/useSharedFolderFileUrl.ts
|
|
3
|
+
function n(n) {
|
|
4
|
+
let { request: r, document: i, token: a, passwordRef: o, onError: s } = n, [c, l] = t(null), [u, d] = t(null);
|
|
5
|
+
return {
|
|
6
|
+
busyFileId: c,
|
|
7
|
+
failedFileId: u,
|
|
8
|
+
fetchUrl: e(async (e) => {
|
|
9
|
+
l(e.id), d(null);
|
|
10
|
+
try {
|
|
11
|
+
return (await r(i, { input: {
|
|
12
|
+
token: a,
|
|
13
|
+
fileId: e.id,
|
|
14
|
+
password: o.current
|
|
15
|
+
} })).downloadFolderShareFile.downloadUrl;
|
|
16
|
+
} catch (t) {
|
|
17
|
+
return s(t), d(e.id), null;
|
|
18
|
+
} finally {
|
|
19
|
+
l(null);
|
|
20
|
+
}
|
|
21
|
+
}, [
|
|
22
|
+
i,
|
|
23
|
+
s,
|
|
24
|
+
o,
|
|
25
|
+
r,
|
|
26
|
+
a
|
|
27
|
+
])
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { n as useSharedFolderFileUrl };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=useSharedFolderFileUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSharedFolderFileUrl.js","names":["useSharedFolderFileUrl","options","busyFileId","setBusyFileId","useState","failedFileId","setFailedFileId","useCallback","file","request","document","passwordRef","error","onError","token"],"sources":["../../../src/files/hooks/useSharedFolderFileUrl.ts"],"sourcesContent":["import { type RefObject, useCallback, useState } from \"react\";\nimport type {\n DownloadFolderShareFileMutation,\n DownloadFolderShareFileMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport type {\n PublicShareRequest,\n SharedFolderFile,\n} from \"../utils/publicShare\";\n\n/**\n * Fetches a short-lived URL for one file of a folder opened through its\n * public share link (BOFF-11865), and tracks which file is loading or failed.\n */\nexport function useSharedFolderFileUrl(options: {\n request: PublicShareRequest;\n /** The printed DownloadFolderShareFile mutation. */\n document: string;\n token: string;\n /** The password that unlocked the link, when it has one. */\n passwordRef: RefObject<string | undefined>;\n /** Called with the raw error for support logs; never shown to the visitor. */\n onError: (error: unknown) => void;\n}) {\n const { request, document, token, passwordRef, onError } = options;\n const [busyFileId, setBusyFileId] = useState<string | null>(null);\n const [failedFileId, setFailedFileId] = useState<string | null>(null);\n\n /** The file's URL, or null when it could not be fetched. */\n const fetchUrl = useCallback(\n async (file: SharedFolderFile): Promise<string | null> => {\n setBusyFileId(file.id);\n setFailedFileId(null);\n try {\n const data = await request<\n DownloadFolderShareFileMutation,\n DownloadFolderShareFileMutationVariables\n >(document, {\n input: { token, fileId: file.id, password: passwordRef.current },\n });\n return data.downloadFolderShareFile.downloadUrl;\n } catch (error) {\n onError(error);\n setFailedFileId(file.id);\n return null;\n } finally {\n setBusyFileId(null);\n }\n },\n [document, onError, passwordRef, request, token],\n );\n\n return { busyFileId, failedFileId, fetchUrl };\n}\n"],"mappings":";;AAcA,SAAgBA,EAAuB,GASpC;CACD,IAAM,EAAE,YAAS,aAAU,UAAO,gBAAa,eAAYC,GACrD,CAACC,GAAYC,KAAiBC,EAAwB,IAAI,GAC1D,CAACC,GAAcC,KAAmBF,EAAwB,IAAI;CA0BpE,OAAO;EAAE;EAAY;EAAc,UAvBlBG,EACf,OAAO,MAAmD;GAExD,AADAJ,EAAcK,EAAK,EAAE,GACrBF,EAAgB,IAAI;GACpB,IAAI;IAOF,QAAO,MANYG,EAGjBC,GAAU,EACV,OAAO;KAAE;KAAO,QAAQF,EAAK;KAAI,UAAUG,EAAY;IAAQ,EACjE,CAAC,EAAA,CACW,wBAAwB;GACtC,SAASC,GAAO;IAGd,OAFAC,EAAQD,CAAK,GACbN,EAAgBE,EAAK,EAAE,GAChB;GACT,UAAU;IACR,EAAc,IAAI;GACpB;EACF,GACA;GAACE;GAAUG;GAASF;GAAaF;GAASK;EAAK,CAGd;CAAS;AAC9C"}
|