@pelicanplatform/components 1.0.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.
Files changed (159) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +0 -0
  3. package/dist/AuthenticatedClient/AuthenticatedClient.d.ts +6 -0
  4. package/dist/AuthenticatedClient/AuthenticatedClient.d.ts.map +1 -0
  5. package/dist/AuthenticatedClient/AuthenticatedClient.js +98 -0
  6. package/dist/AuthenticatedClient/AuthenticatedClient.js.map +1 -0
  7. package/dist/AuthenticatedClient/index.d.ts +3 -0
  8. package/dist/AuthenticatedClient/index.d.ts.map +1 -0
  9. package/dist/AuthenticatedClient/index.js +3 -0
  10. package/dist/AuthenticatedClient/index.js.map +1 -0
  11. package/dist/Client/Client.d.ts +12 -0
  12. package/dist/Client/Client.d.ts.map +1 -0
  13. package/dist/Client/Client.js +13 -0
  14. package/dist/Client/Client.js.map +1 -0
  15. package/dist/Client/index.d.ts +3 -0
  16. package/dist/Client/index.d.ts.map +1 -0
  17. package/dist/Client/index.js +3 -0
  18. package/dist/Client/index.js.map +1 -0
  19. package/dist/ClientMenu/ClientMenu.d.ts +7 -0
  20. package/dist/ClientMenu/ClientMenu.d.ts.map +1 -0
  21. package/dist/ClientMenu/ClientMenu.js +9 -0
  22. package/dist/ClientMenu/ClientMenu.js.map +1 -0
  23. package/dist/ClientMenu/index.d.ts +1 -0
  24. package/dist/ClientMenu/index.d.ts.map +1 -0
  25. package/dist/ClientMenu/index.js +2 -0
  26. package/dist/ClientMenu/index.js.map +1 -0
  27. package/dist/ClientMetadata/ClientMetadata.d.ts +14 -0
  28. package/dist/ClientMetadata/ClientMetadata.d.ts.map +1 -0
  29. package/dist/ClientMetadata/ClientMetadata.js +12 -0
  30. package/dist/ClientMetadata/ClientMetadata.js.map +1 -0
  31. package/dist/ClientMetadata/index.d.ts +3 -0
  32. package/dist/ClientMetadata/index.d.ts.map +1 -0
  33. package/dist/ClientMetadata/index.js +3 -0
  34. package/dist/ClientMetadata/index.js.map +1 -0
  35. package/dist/CollectionShortcuts/CollectionShortcuts.d.ts +13 -0
  36. package/dist/CollectionShortcuts/CollectionShortcuts.d.ts.map +1 -0
  37. package/dist/CollectionShortcuts/CollectionShortcuts.js +22 -0
  38. package/dist/CollectionShortcuts/CollectionShortcuts.js.map +1 -0
  39. package/dist/CollectionShortcuts/index.d.ts +3 -0
  40. package/dist/CollectionShortcuts/index.d.ts.map +1 -0
  41. package/dist/CollectionShortcuts/index.js +3 -0
  42. package/dist/CollectionShortcuts/index.js.map +1 -0
  43. package/dist/CollectionView/CollectionView.d.ts +13 -0
  44. package/dist/CollectionView/CollectionView.d.ts.map +1 -0
  45. package/dist/CollectionView/CollectionView.js +12 -0
  46. package/dist/CollectionView/CollectionView.js.map +1 -0
  47. package/dist/CollectionView/index.d.ts +2 -0
  48. package/dist/CollectionView/index.d.ts.map +1 -0
  49. package/dist/CollectionView/index.js +2 -0
  50. package/dist/CollectionView/index.js.map +1 -0
  51. package/dist/LabeledIconButton/LabeledIconButton.d.ts +10 -0
  52. package/dist/LabeledIconButton/LabeledIconButton.d.ts.map +1 -0
  53. package/dist/LabeledIconButton/LabeledIconButton.js +11 -0
  54. package/dist/LabeledIconButton/LabeledIconButton.js.map +1 -0
  55. package/dist/LabeledIconButton/index.d.ts +2 -0
  56. package/dist/LabeledIconButton/index.d.ts.map +1 -0
  57. package/dist/LabeledIconButton/index.js +2 -0
  58. package/dist/LabeledIconButton/index.js.map +1 -0
  59. package/dist/ObjectInput/ObjectInput.d.ts +18 -0
  60. package/dist/ObjectInput/ObjectInput.d.ts.map +1 -0
  61. package/dist/ObjectInput/ObjectInput.js +46 -0
  62. package/dist/ObjectInput/ObjectInput.js.map +1 -0
  63. package/dist/ObjectInput/StartAdornment.d.ts +9 -0
  64. package/dist/ObjectInput/StartAdornment.d.ts.map +1 -0
  65. package/dist/ObjectInput/StartAdornment.js +13 -0
  66. package/dist/ObjectInput/StartAdornment.js.map +1 -0
  67. package/dist/ObjectInput/index.d.ts +3 -0
  68. package/dist/ObjectInput/index.d.ts.map +1 -0
  69. package/dist/ObjectInput/index.js +3 -0
  70. package/dist/ObjectInput/index.js.map +1 -0
  71. package/dist/ObjectUpload/ObjectUpload.d.ts +27 -0
  72. package/dist/ObjectUpload/ObjectUpload.d.ts.map +1 -0
  73. package/dist/ObjectUpload/ObjectUpload.js +177 -0
  74. package/dist/ObjectUpload/ObjectUpload.js.map +1 -0
  75. package/dist/ObjectUpload/index.d.ts +3 -0
  76. package/dist/ObjectUpload/index.d.ts.map +1 -0
  77. package/dist/ObjectUpload/index.js +3 -0
  78. package/dist/ObjectUpload/index.js.map +1 -0
  79. package/dist/ObjectView/ObjectView.d.ts +18 -0
  80. package/dist/ObjectView/ObjectView.d.ts.map +1 -0
  81. package/dist/ObjectView/ObjectView.js +115 -0
  82. package/dist/ObjectView/ObjectView.js.map +1 -0
  83. package/dist/ObjectView/index.d.ts +3 -0
  84. package/dist/ObjectView/index.d.ts.map +1 -0
  85. package/dist/ObjectView/index.js +3 -0
  86. package/dist/ObjectView/index.js.map +1 -0
  87. package/dist/PelicanClientProvider/PelicanClientContext.d.ts +26 -0
  88. package/dist/PelicanClientProvider/PelicanClientContext.d.ts.map +1 -0
  89. package/dist/PelicanClientProvider/PelicanClientContext.js +4 -0
  90. package/dist/PelicanClientProvider/PelicanClientContext.js.map +1 -0
  91. package/dist/PelicanClientProvider/PelicanClientProvider.d.ts +15 -0
  92. package/dist/PelicanClientProvider/PelicanClientProvider.d.ts.map +1 -0
  93. package/dist/PelicanClientProvider/PelicanClientProvider.js +377 -0
  94. package/dist/PelicanClientProvider/PelicanClientProvider.js.map +1 -0
  95. package/dist/PelicanClientProvider/index.d.ts +6 -0
  96. package/dist/PelicanClientProvider/index.d.ts.map +1 -0
  97. package/dist/PelicanClientProvider/index.js +4 -0
  98. package/dist/PelicanClientProvider/index.js.map +1 -0
  99. package/dist/PelicanClientProvider/usePelicanClient.d.ts +21 -0
  100. package/dist/PelicanClientProvider/usePelicanClient.d.ts.map +1 -0
  101. package/dist/PelicanClientProvider/usePelicanClient.js +29 -0
  102. package/dist/PelicanClientProvider/usePelicanClient.js.map +1 -0
  103. package/dist/PermissionIcon/PermissionIcon.d.ts +7 -0
  104. package/dist/PermissionIcon/PermissionIcon.d.ts.map +1 -0
  105. package/dist/PermissionIcon/PermissionIcon.js +16 -0
  106. package/dist/PermissionIcon/PermissionIcon.js.map +1 -0
  107. package/dist/PermissionIcon/index.d.ts +2 -0
  108. package/dist/PermissionIcon/index.d.ts.map +1 -0
  109. package/dist/PermissionIcon/index.js +2 -0
  110. package/dist/PermissionIcon/index.js.map +1 -0
  111. package/dist/PublicClient/PublicClient.d.ts +6 -0
  112. package/dist/PublicClient/PublicClient.d.ts.map +1 -0
  113. package/dist/PublicClient/PublicClient.js +33 -0
  114. package/dist/PublicClient/PublicClient.js.map +1 -0
  115. package/dist/PublicClient/index.d.ts +3 -0
  116. package/dist/PublicClient/index.d.ts.map +1 -0
  117. package/dist/PublicClient/index.js +3 -0
  118. package/dist/PublicClient/index.js.map +1 -0
  119. package/dist/index.d.ts +3 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +3 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/usePelicanClient/index.d.ts +3 -0
  124. package/dist/usePelicanClient/index.d.ts.map +1 -0
  125. package/dist/usePelicanClient/index.js +3 -0
  126. package/dist/usePelicanClient/index.js.map +1 -0
  127. package/dist/usePelicanClient/useAuthExchange.d.ts +41 -0
  128. package/dist/usePelicanClient/useAuthExchange.d.ts.map +1 -0
  129. package/dist/usePelicanClient/useAuthExchange.js +89 -0
  130. package/dist/usePelicanClient/useAuthExchange.js.map +1 -0
  131. package/dist/usePelicanClient/useCodeVerifier.d.ts +12 -0
  132. package/dist/usePelicanClient/useCodeVerifier.d.ts.map +1 -0
  133. package/dist/usePelicanClient/useCodeVerifier.js +37 -0
  134. package/dist/usePelicanClient/useCodeVerifier.js.map +1 -0
  135. package/dist/usePelicanClient/useEventCallback.d.ts +18 -0
  136. package/dist/usePelicanClient/useEventCallback.d.ts.map +1 -0
  137. package/dist/usePelicanClient/useEventCallback.js +12 -0
  138. package/dist/usePelicanClient/useEventCallback.js.map +1 -0
  139. package/dist/usePelicanClient/useEventListener.d.ts +7 -0
  140. package/dist/usePelicanClient/useEventListener.d.ts.map +1 -0
  141. package/dist/usePelicanClient/useEventListener.js +57 -0
  142. package/dist/usePelicanClient/useEventListener.js.map +1 -0
  143. package/dist/usePelicanClient/useIsomorphicLayoutEffect.d.ts +16 -0
  144. package/dist/usePelicanClient/useIsomorphicLayoutEffect.d.ts.map +1 -0
  145. package/dist/usePelicanClient/useIsomorphicLayoutEffect.js +16 -0
  146. package/dist/usePelicanClient/useIsomorphicLayoutEffect.js.map +1 -0
  147. package/dist/usePelicanClient/usePelicanClient.d.ts +27 -0
  148. package/dist/usePelicanClient/usePelicanClient.d.ts.map +1 -0
  149. package/dist/usePelicanClient/usePelicanClient.js +245 -0
  150. package/dist/usePelicanClient/usePelicanClient.js.map +1 -0
  151. package/dist/usePelicanClient/useSessionStorage.d.ts +39 -0
  152. package/dist/usePelicanClient/useSessionStorage.d.ts.map +1 -0
  153. package/dist/usePelicanClient/useSessionStorage.js +121 -0
  154. package/dist/usePelicanClient/useSessionStorage.js.map +1 -0
  155. package/dist/usePelicanClient/util.d.ts +1 -0
  156. package/dist/usePelicanClient/util.d.ts.map +1 -0
  157. package/dist/usePelicanClient/util.js +2 -0
  158. package/dist/usePelicanClient/util.js.map +1 -0
  159. package/package.json +53 -0
@@ -0,0 +1,3 @@
1
+ export { default } from "./PublicClient";
2
+ export * from "./PublicClient";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PublicClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from "./PublicClient";
2
+ export * from "./PublicClient";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PublicClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from "./Client";
2
+ export * from "./Client";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { default } from "./Client";
2
+ export * from "./Client";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./useAuthExchange";
2
+ export * from "./useCodeVerifier";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./useAuthExchange";
2
+ export * from "./useCodeVerifier";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/usePelicanClient/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Namespace, Token } from "@pelicanplatform/web-client";
2
+ export interface AuthExchangeResult {
3
+ federationHostname: string;
4
+ namespacePrefix: string;
5
+ token: Token;
6
+ }
7
+ export interface UseAuthExchangeOptions {
8
+ /** Whether authentication is enabled */
9
+ enabled: boolean;
10
+ /** The PKCE code verifier for the OAuth flow */
11
+ codeVerifier: string | null;
12
+ /** Callback invoked when a token is successfully obtained */
13
+ onTokenReceived?: (result: AuthExchangeResult) => void;
14
+ /** Function to get namespace metadata by federation hostname and prefix */
15
+ getNamespace: (federationHostname: string, namespacePrefix: string) => Namespace | undefined;
16
+ }
17
+ export interface UseAuthExchangeReturn {
18
+ /** Whether the auth code exchange is ongoing */
19
+ loading: boolean;
20
+ /** Error message if exchange failed */
21
+ error: string | null;
22
+ }
23
+ /**
24
+ * Hook to manage OAuth authorization code exchange flow.
25
+ *
26
+ * On mount, checks URL params for an authorization code and exchanges it
27
+ * for an access token using the PKCE code verifier. The token is returned
28
+ * via the onTokenReceived callback for storage in the parent component.
29
+ *
30
+ * This hook is designed to run once per page load and handles:
31
+ * - Parsing authorization code from URL params
32
+ * - Validating required OAuth credentials exist
33
+ * - Exchanging code for token
34
+ * - Cleaning up URL params
35
+ *
36
+ * @param options Configuration options for the auth exchange
37
+ * @returns Status of the exchange process
38
+ */
39
+ export declare function useAuthExchange({ enabled, codeVerifier, onTokenReceived, getNamespace }: UseAuthExchangeOptions): UseAuthExchangeReturn;
40
+ export default useAuthExchange;
41
+ //# sourceMappingURL=useAuthExchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAuthExchange.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/useAuthExchange.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,SAAS,EACT,KAAK,EACR,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,kBAAkB;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACnC,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6DAA6D;IAC7D,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,2EAA2E;IAC3E,YAAY,EAAE,CAAC,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC;CAChG;AAED,MAAM,WAAW,qBAAqB;IAClC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,EAC5B,OAAO,EACP,YAAY,EACZ,eAAe,EACf,YAAY,EACf,EAAE,sBAAsB,GAAG,qBAAqB,CAsFhD;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { useEffect, useState } from "react";
2
+ import { getAuthorizationCode, getToken } from "@pelicanplatform/web-client";
3
+ /**
4
+ * Hook to manage OAuth authorization code exchange flow.
5
+ *
6
+ * On mount, checks URL params for an authorization code and exchanges it
7
+ * for an access token using the PKCE code verifier. The token is returned
8
+ * via the onTokenReceived callback for storage in the parent component.
9
+ *
10
+ * This hook is designed to run once per page load and handles:
11
+ * - Parsing authorization code from URL params
12
+ * - Validating required OAuth credentials exist
13
+ * - Exchanging code for token
14
+ * - Cleaning up URL params
15
+ *
16
+ * @param options Configuration options for the auth exchange
17
+ * @returns Status of the exchange process
18
+ */
19
+ export function useAuthExchange({ enabled, codeVerifier, onTokenReceived, getNamespace }) {
20
+ const [error, setError] = useState(null);
21
+ const [loading, setLoading] = useState(false);
22
+ useEffect(() => {
23
+ if (!enabled) {
24
+ return;
25
+ }
26
+ async function exchange() {
27
+ const { federationHostname, namespacePrefix, code } = getAuthorizationCode();
28
+ try {
29
+ // Check if we have an authorization code to exchange
30
+ if (!code || !federationHostname || !namespacePrefix || !codeVerifier) {
31
+ // No code to exchange - this is normal for non-redirect page loads
32
+ setLoading(false);
33
+ return;
34
+ }
35
+ setLoading(true);
36
+ // Get namespace metadata (includes OAuth client credentials)
37
+ const namespace = getNamespace(federationHostname, namespacePrefix);
38
+ if (!namespace) {
39
+ const errorMsg = `Cannot exchange code: namespace metadata not found for ${namespacePrefix}`;
40
+ console.error(errorMsg);
41
+ setError(errorMsg);
42
+ setLoading(false);
43
+ return;
44
+ }
45
+ if (!namespace.clientId || !namespace.clientSecret) {
46
+ const errorMsg = `Cannot exchange code: missing client credentials for namespace ${namespacePrefix}`;
47
+ console.error(errorMsg);
48
+ setError(errorMsg);
49
+ setLoading(false);
50
+ return;
51
+ }
52
+ if (!namespace.oidcConfiguration) {
53
+ const errorMsg = `Cannot exchange code: missing OIDC configuration for namespace ${namespacePrefix}`;
54
+ console.error(errorMsg);
55
+ setError(errorMsg);
56
+ setLoading(false);
57
+ return;
58
+ }
59
+ // Exchange authorization code for access token
60
+ const tokenData = await getToken(namespace.oidcConfiguration, codeVerifier, namespace.clientId, namespace.clientSecret, code);
61
+ console.log("Obtained token via authorization code exchange:", tokenData);
62
+ // Notify parent component of successful token acquisition
63
+ if (onTokenReceived) {
64
+ onTokenReceived({
65
+ federationHostname,
66
+ namespacePrefix,
67
+ token: tokenData.accessToken,
68
+ });
69
+ }
70
+ }
71
+ catch (e) {
72
+ const errorMsg = `Error during authorization code exchange: ${e}`;
73
+ console.error(errorMsg);
74
+ setError(errorMsg);
75
+ }
76
+ finally {
77
+ // Mark exchange as complete (whether successful or not)
78
+ setLoading(false);
79
+ }
80
+ }
81
+ exchange();
82
+ }, [enabled, codeVerifier, getNamespace, onTokenReceived]);
83
+ return {
84
+ loading,
85
+ error,
86
+ };
87
+ }
88
+ export default useAuthExchange;
89
+ //# sourceMappingURL=useAuthExchange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAuthExchange.js","sourceRoot":"","sources":["../../src/usePelicanClient/useAuthExchange.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Hook to manage OAuth PKCE code verifier generation and persistence.
3
+ *
4
+ * The code verifier is automatically generated on first use and persisted
5
+ * in session storage for the duration of the OAuth flow.
6
+ *
7
+ * @returns {[string | null, () => string]} A tuple containing the current code verifier
8
+ * and a function to ensure a code verifier exists (generating one if needed)
9
+ */
10
+ export declare function useCodeVerifier(): [string | null, () => string];
11
+ export default useCodeVerifier;
12
+ //# sourceMappingURL=useCodeVerifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCodeVerifier.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/useCodeVerifier.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,CAAC,CA6B/D;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { useEffect } from "react";
2
+ import { generateCodeVerifier } from "@pelicanplatform/web-client";
3
+ import { useSessionStorage } from "./useSessionStorage";
4
+ /**
5
+ * Hook to manage OAuth PKCE code verifier generation and persistence.
6
+ *
7
+ * The code verifier is automatically generated on first use and persisted
8
+ * in session storage for the duration of the OAuth flow.
9
+ *
10
+ * @returns {[string | null, () => string]} A tuple containing the current code verifier
11
+ * and a function to ensure a code verifier exists (generating one if needed)
12
+ */
13
+ export function useCodeVerifier() {
14
+ const [codeVerifier, setCodeVerifier] = useSessionStorage("pelican-wc-cv", null);
15
+ // Auto-generate on mount if missing
16
+ useEffect(() => {
17
+ if (!codeVerifier) {
18
+ const cv = generateCodeVerifier();
19
+ setCodeVerifier(cv);
20
+ }
21
+ }, [codeVerifier, setCodeVerifier]);
22
+ /**
23
+ * Ensures a code verifier exists, generating one if needed.
24
+ * Returns the current or newly generated code verifier.
25
+ */
26
+ const ensureCodeVerifier = () => {
27
+ if (codeVerifier) {
28
+ return codeVerifier;
29
+ }
30
+ const cv = generateCodeVerifier();
31
+ setCodeVerifier(cv);
32
+ return cv;
33
+ };
34
+ return [codeVerifier, ensureCodeVerifier];
35
+ }
36
+ export default useCodeVerifier;
37
+ //# sourceMappingURL=useCodeVerifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCodeVerifier.js","sourceRoot":"","sources":["../../src/usePelicanClient/useCodeVerifier.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe;IAC3B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,iBAAiB,CACvD,eAAe,EACf,IAAI,CACL,CAAC;IAEF,oCAAoC;IACpC,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,MAAM,EAAE,GAAG,oBAAoB,EAAE,CAAC;YAClC,eAAe,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAEpC;;;OAGG;IACH,MAAM,kBAAkB,GAAG,GAAW,EAAE;QACpC,IAAI,YAAY,EAAE,CAAC;YACf,OAAO,YAAY,CAAC;QACxB,CAAC;QAED,MAAM,EAAE,GAAG,oBAAoB,EAAE,CAAC;QAClC,eAAe,CAAC,EAAE,CAAC,CAAC;QACpB,OAAO,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAC9C,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Custom hook that creates a memoized event callback.
3
+ * @template Args - An array of argument types for the event callback.
4
+ * @template R - The return type of the event callback.
5
+ * @param {(...args: Args) => R} fn - The callback function.
6
+ * @returns {(...args: Args) => R} A memoized event callback function.
7
+ * @public
8
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-event-callback)
9
+ * @example
10
+ * ```tsx
11
+ * const handleClick = useEventCallback((event) => {
12
+ * // Handle the event here
13
+ * });
14
+ * ```
15
+ */
16
+ export declare function useEventCallback<Args extends unknown[], R>(fn: (...args: Args) => R): (...args: Args) => R;
17
+ export declare function useEventCallback<Args extends unknown[], R>(fn: ((...args: Args) => R) | undefined): ((...args: Args) => R) | undefined;
18
+ //# sourceMappingURL=useEventCallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEventCallback.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/useEventCallback.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC;AAC5G,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,CAAC,EACtD,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,GAAG,SAAS,GACvC,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { useCallback, useRef } from "react";
2
+ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
3
+ export function useEventCallback(fn) {
4
+ const ref = useRef(() => {
5
+ throw new Error("Cannot call an event handler while rendering.");
6
+ });
7
+ useIsomorphicLayoutEffect(() => {
8
+ ref.current = fn;
9
+ }, [fn]);
10
+ return useCallback((...args) => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.call(ref, ...args); }, [ref]);
11
+ }
12
+ //# sourceMappingURL=useEventCallback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEventCallback.js","sourceRoot":"","sources":["../../src/usePelicanClient/useEventCallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAqBxE,MAAM,UAAU,gBAAgB,CAC5B,EAAsC;IAEtC,MAAM,GAAG,GAAG,MAAM,CAAY,GAAG,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,yBAAyB,CAAC,GAAG,EAAE;QAC3B,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAET,OAAO,WAAW,CAAC,CAAC,GAAG,IAAU,EAAE,EAAE,WAAC,OAAA,MAAA,GAAG,CAAC,OAAO,oDAAG,GAAG,IAAI,CAAC,CAAA,EAAA,EAAE,CAAC,GAAG,CAAC,CAAyB,CAAC;AACjG,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { RefObject } from "react";
2
+ declare function useEventListener<K extends keyof MediaQueryListEventMap>(eventName: K, handler: (event: MediaQueryListEventMap[K]) => void, element: RefObject<MediaQueryList>, options?: boolean | AddEventListenerOptions): void;
3
+ declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
4
+ declare function useEventListener<K extends keyof HTMLElementEventMap & keyof SVGElementEventMap, T extends Element = K extends keyof HTMLElementEventMap ? HTMLDivElement : SVGElement>(eventName: K, handler: ((event: HTMLElementEventMap[K]) => void) | ((event: SVGElementEventMap[K]) => void), element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
5
+ declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
6
+ export { useEventListener };
7
+ //# sourceMappingURL=useEventListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEventListener.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/useEventListener.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,iBAAS,gBAAgB,CAAC,CAAC,SAAS,MAAM,sBAAsB,EAC5D,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,IAAI,EACnD,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,EAClC,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC5C,IAAI,CAAC;AAGR,iBAAS,gBAAgB,CAAC,CAAC,SAAS,MAAM,cAAc,EACpD,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,EAC3C,OAAO,CAAC,EAAE,SAAS,EACnB,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC5C,IAAI,CAAC;AAGR,iBAAS,gBAAgB,CACrB,CAAC,SAAS,MAAM,mBAAmB,GAAG,MAAM,kBAAkB,EAC9D,CAAC,SAAS,OAAO,GAAG,CAAC,SAAS,MAAM,mBAAmB,GAAG,cAAc,GAAG,UAAU,EAErF,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EAC7F,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC5C,IAAI,CAAC;AAGR,iBAAS,gBAAgB,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACtD,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC7C,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC5B,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC5C,IAAI,CAAC;AA6ER,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { useEffect, useRef } from "react";
2
+ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
3
+ /**
4
+ * Custom hook that attaches event listeners to DOM elements, the window, or media query lists.
5
+ * @template KW - The type of event for window events.
6
+ * @template KH - The type of event for HTML or SVG element events.
7
+ * @template KM - The type of event for media query list events.
8
+ * @template T - The type of the DOM element (default is `HTMLElement`).
9
+ * @param {KW | KH | KM} eventName - The name of the event to listen for.
10
+ * @param {(event: WindowEventMap[KW] | HTMLElementEventMap[KH] | SVGElementEventMap[KH] | MediaQueryListEventMap[KM] | Event) => void} handler - The event handler function.
11
+ * @param {RefObject<T>} [element] - The DOM element or media query list to attach the event listener to (optional).
12
+ * @param {boolean | AddEventListenerOptions} [options] - An options object that specifies characteristics about the event listener (optional).
13
+ * @public
14
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-event-listener)
15
+ * @example
16
+ * ```tsx
17
+ * // Example 1: Attach a window event listener
18
+ * useEventListener('resize', handleResize);
19
+ * ```
20
+ * @example
21
+ * ```tsx
22
+ * // Example 2: Attach a document event listener with options
23
+ * const elementRef = useRef(document);
24
+ * useEventListener('click', handleClick, elementRef, { capture: true });
25
+ * ```
26
+ * @example
27
+ * ```tsx
28
+ * // Example 3: Attach an element event listener
29
+ * const buttonRef = useRef<HTMLButtonElement>(null);
30
+ * useEventListener('click', handleButtonClick, buttonRef);
31
+ * ```
32
+ */
33
+ function useEventListener(eventName, handler, element, options) {
34
+ // Create a ref that stores handler
35
+ const savedHandler = useRef(handler);
36
+ useIsomorphicLayoutEffect(() => {
37
+ savedHandler.current = handler;
38
+ }, [handler]);
39
+ useEffect(() => {
40
+ var _a;
41
+ // Define the listening target
42
+ const targetElement = (_a = element === null || element === void 0 ? void 0 : element.current) !== null && _a !== void 0 ? _a : window;
43
+ if (!(targetElement && targetElement.addEventListener))
44
+ return;
45
+ // Create event listener that calls handler function stored in ref
46
+ const listener = (event) => {
47
+ savedHandler.current(event);
48
+ };
49
+ targetElement.addEventListener(eventName, listener, options);
50
+ // Remove event listener on cleanup
51
+ return () => {
52
+ targetElement.removeEventListener(eventName, listener, options);
53
+ };
54
+ }, [eventName, element, options]);
55
+ }
56
+ export { useEventListener };
57
+ //# sourceMappingURL=useEventListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEventListener.js","sourceRoot":"","sources":["../../src/usePelicanClient/useEventListener.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAqCxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,gBAAgB,CAMrB,SAAuB,EACvB,OAOS,EACT,OAAsB,EACtB,OAA2C;IAE3C,mCAAmC;IACnC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAErC,yBAAyB,CAAC,GAAG,EAAE;QAC3B,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IACnC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,SAAS,CAAC,GAAG,EAAE;;QACX,8BAA8B;QAC9B,MAAM,aAAa,GAAe,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,MAAM,CAAC;QAE7D,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,gBAAgB,CAAC;YAAE,OAAO;QAE/D,kEAAkE;QAClE,MAAM,QAAQ,GAAmB,CAAC,KAAK,EAAE,EAAE;YACvC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEF,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE7D,mCAAmC;QACnC,OAAO,GAAG,EAAE;YACR,aAAa,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpE,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { useLayoutEffect } from "react";
2
+ /**
3
+ * Custom hook that uses either `useLayoutEffect` or `useEffect` based on the environment (client-side or server-side).
4
+ * @param {Function} effect - The effect function to be executed.
5
+ * @param {Array<any>} [dependencies] - An array of dependencies for the effect (optional).
6
+ * @public
7
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-isomorphic-layout-effect)
8
+ * @example
9
+ * ```tsx
10
+ * useIsomorphicLayoutEffect(() => {
11
+ * // Code to be executed during the layout phase on the client side
12
+ * }, [dependency1, dependency2]);
13
+ * ```
14
+ */
15
+ export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
16
+ //# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/useIsomorphicLayoutEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,wBAA8D,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { useEffect, useLayoutEffect } from "react";
2
+ /**
3
+ * Custom hook that uses either `useLayoutEffect` or `useEffect` based on the environment (client-side or server-side).
4
+ * @param {Function} effect - The effect function to be executed.
5
+ * @param {Array<any>} [dependencies] - An array of dependencies for the effect (optional).
6
+ * @public
7
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-isomorphic-layout-effect)
8
+ * @example
9
+ * ```tsx
10
+ * useIsomorphicLayoutEffect(() => {
11
+ * // Code to be executed during the layout phase on the client side
12
+ * }, [dependency1, dependency2]);
13
+ * ```
14
+ */
15
+ export const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
16
+ //# sourceMappingURL=useIsomorphicLayoutEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.js","sourceRoot":"","sources":["../../src/usePelicanClient/useIsomorphicLayoutEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { ObjectList, Collection } from "@pelicanplatform/web-client";
2
+ export interface UsePelicanClientOptions {
3
+ /** The initial object URL to load */
4
+ objectUrl: string;
5
+ /** Whether to enable authentication features */
6
+ enableAuth?: boolean;
7
+ }
8
+ /**
9
+ * A React hook to manage Pelican client state and actions.
10
+ *
11
+ * The main pieces of state are `objectUrl`, `federationHostname`, and `objectPrefix`.
12
+ * These each represent:
13
+ * - `objectUrl`: The full Pelican URL, as inputed by the user
14
+ * - `federationHostname`: The hostname of the federation being accessed
15
+ * - `objectPrefix`: The prefix (namespace) of the object being accessed
16
+ */
17
+ declare function usePelicanClient({ objectUrl, enableAuth }: UsePelicanClientOptions): {
18
+ loading: boolean;
19
+ collections: Collection[];
20
+ loginRequired: boolean;
21
+ getObjectList: () => Promise<ObjectList[] | undefined>;
22
+ handleLogin: () => Promise<void>;
23
+ handleDownload: (downloadObjectUrl: string) => Promise<void>;
24
+ handleUpload: (file: File, uploadObjectUrl?: string) => Promise<void>;
25
+ };
26
+ export default usePelicanClient;
27
+ //# sourceMappingURL=usePelicanClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePelicanClient.d.ts","sourceRoot":"","sources":["../../src/usePelicanClient/usePelicanClient.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAaV,UAAU,EAEX,MAAM,6BAA6B,CAAC;AAMrC,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,UAAiB,EAAE,EAAE,uBAAuB;;;;;;wCA2MhC,MAAM;yBA0BrB,IAAI,oBAAoB,MAAM;EA2BjE;AAED,eAAe,gBAAgB,CAAC"}