@jmruthers/pace-core 0.5.101 → 0.5.102
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/{PublicLoadingSpinner-C2h8zg67.d.ts → PublicLoadingSpinner-Cvgk-V0F.d.ts} +22 -55
- package/dist/{chunk-2ZYHCFUO.js → chunk-7ME4Z5OY.js} +148 -12
- package/dist/chunk-7ME4Z5OY.js.map +1 -0
- package/dist/{chunk-MKMKUCPF.js → chunk-SZWRW5FD.js} +20 -139
- package/dist/chunk-SZWRW5FD.js.map +1 -0
- package/dist/{chunk-A5DFMP3O.js → chunk-UDWTCBSH.js} +127 -498
- package/dist/chunk-UDWTCBSH.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +2 -8
- package/dist/components.js.map +1 -1
- package/dist/hooks.js +5 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -12
- package/dist/index.js.map +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +2 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +77 -35
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +11 -24
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UseEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +29 -96
- package/docs/implementation-guides/file-reference-system.md +53 -2
- package/package.json +1 -1
- package/src/components/FileDisplay/FileDisplay.test.tsx +1 -1
- package/src/components/FileDisplay/FileDisplay.tsx +189 -300
- package/src/components/PublicLayout/PublicPageHeader.tsx +14 -9
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +25 -35
- package/src/components/PublicLayout/index.ts +2 -5
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/examples/PublicEventPage.tsx +17 -7
- package/src/examples/PublicPageApp.tsx +18 -8
- package/src/hooks/useFileReference.ts +10 -1
- package/src/utils/file-reference.ts +24 -7
- package/src/utils/storage/helpers.ts +12 -1
- package/dist/chunk-2ZYHCFUO.js.map +0 -1
- package/dist/chunk-A5DFMP3O.js.map +0 -1
- package/dist/chunk-MKMKUCPF.js.map +0 -1
- package/docs/api/interfaces/EventLogoProps.md +0 -152
- package/src/components/PublicLayout/EventLogo.tsx +0 -474
package/docs/api/modules.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.102](README.md) / Exports
|
|
2
2
|
|
|
3
|
-
# @jmruthers/pace-core - v0.5.
|
|
3
|
+
# @jmruthers/pace-core - v0.5.102
|
|
4
4
|
|
|
5
5
|
**`File`**
|
|
6
6
|
|
|
@@ -73,7 +73,6 @@ import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';
|
|
|
73
73
|
- [PaceAppLayoutProps](interfaces/PaceAppLayoutProps.md)
|
|
74
74
|
- [PaceLoginPageProps](interfaces/PaceLoginPageProps.md)
|
|
75
75
|
- [ProtectedRouteProps](interfaces/ProtectedRouteProps.md)
|
|
76
|
-
- [EventLogoProps](interfaces/EventLogoProps.md)
|
|
77
76
|
- [PublicErrorBoundaryProps](interfaces/PublicErrorBoundaryProps.md)
|
|
78
77
|
- [PublicErrorBoundaryState](interfaces/PublicErrorBoundaryState.md)
|
|
79
78
|
- [PublicLoadingSpinnerProps](interfaces/PublicLoadingSpinnerProps.md)
|
|
@@ -224,9 +223,6 @@ import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';
|
|
|
224
223
|
- [PasswordResetForm](modules.md#passwordresetform)
|
|
225
224
|
- [Progress](modules.md#progress)
|
|
226
225
|
- [ProtectedRoute](modules.md#protectedroute)
|
|
227
|
-
- [EventLogo](modules.md#eventlogo)
|
|
228
|
-
- [EventLogoCompact](modules.md#eventlogocompact)
|
|
229
|
-
- [EventLogoLarge](modules.md#eventlogolarge)
|
|
230
226
|
- [useErrorBoundary](modules.md#useerrorboundary)
|
|
231
227
|
- [DefaultPublicErrorFallback](modules.md#defaultpublicerrorfallback)
|
|
232
228
|
- [PublicLoadingSpinner](modules.md#publicloadingspinner)
|
|
@@ -448,7 +444,7 @@ ___
|
|
|
448
444
|
|
|
449
445
|
#### Defined in
|
|
450
446
|
|
|
451
|
-
[packages/core/src/hooks/useFileReference.ts:
|
|
447
|
+
[packages/core/src/hooks/useFileReference.ts:448](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useFileReference.ts#L448)
|
|
452
448
|
|
|
453
449
|
___
|
|
454
450
|
|
|
@@ -474,7 +470,7 @@ ___
|
|
|
474
470
|
|
|
475
471
|
#### Defined in
|
|
476
472
|
|
|
477
|
-
[packages/core/src/hooks/useFileReference.ts:
|
|
473
|
+
[packages/core/src/hooks/useFileReference.ts:454](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useFileReference.ts#L454)
|
|
478
474
|
|
|
479
475
|
___
|
|
480
476
|
|
|
@@ -502,7 +498,7 @@ ___
|
|
|
502
498
|
|
|
503
499
|
#### Defined in
|
|
504
500
|
|
|
505
|
-
[packages/core/src/hooks/useFileReference.ts:
|
|
501
|
+
[packages/core/src/hooks/useFileReference.ts:468](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useFileReference.ts#L468)
|
|
506
502
|
|
|
507
503
|
___
|
|
508
504
|
|
|
@@ -1657,8 +1653,7 @@ Component for displaying file references with context-awareness
|
|
|
1657
1653
|
This component is context-aware and automatically detects whether it's being used
|
|
1658
1654
|
in a public or authenticated context. It fetches and displays files from storage.
|
|
1659
1655
|
|
|
1660
|
-
|
|
1661
|
-
When `supabase` prop is not provided, it automatically detects context and uses:
|
|
1656
|
+
The component automatically detects context and uses:
|
|
1662
1657
|
- PublicPageProvider context for public pages
|
|
1663
1658
|
- UnifiedAuthProvider context for authenticated pages
|
|
1664
1659
|
|
|
@@ -1676,7 +1671,7 @@ React element with file display
|
|
|
1676
1671
|
|
|
1677
1672
|
#### Defined in
|
|
1678
1673
|
|
|
1679
|
-
[packages/core/src/components/FileDisplay/FileDisplay.tsx:
|
|
1674
|
+
[packages/core/src/components/FileDisplay/FileDisplay.tsx:726](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/FileDisplay/FileDisplay.tsx#L726)
|
|
1680
1675
|
|
|
1681
1676
|
___
|
|
1682
1677
|
|
|
@@ -2601,78 +2596,6 @@ React element with route protection logic
|
|
|
2601
2596
|
|
|
2602
2597
|
___
|
|
2603
2598
|
|
|
2604
|
-
### EventLogo
|
|
2605
|
-
|
|
2606
|
-
▸ **EventLogo**(`props`): `Element`
|
|
2607
|
-
|
|
2608
|
-
Component for displaying event logos with fallback to initials
|
|
2609
|
-
|
|
2610
|
-
This component is context-aware and automatically detects whether it's being used
|
|
2611
|
-
in a public or authenticated context. It fetches and displays event logos from storage,
|
|
2612
|
-
with automatic fallback to event initials if no logo is available.
|
|
2613
|
-
|
|
2614
|
-
#### Parameters
|
|
2615
|
-
|
|
2616
|
-
| Name | Type | Description |
|
|
2617
|
-
| :------ | :------ | :------ |
|
|
2618
|
-
| `props` | [`EventLogoProps`](interfaces/EventLogoProps.md) | Logo configuration and styling |
|
|
2619
|
-
|
|
2620
|
-
#### Returns
|
|
2621
|
-
|
|
2622
|
-
`Element`
|
|
2623
|
-
|
|
2624
|
-
React element with event logo or fallback
|
|
2625
|
-
|
|
2626
|
-
#### Defined in
|
|
2627
|
-
|
|
2628
|
-
[packages/core/src/components/PublicLayout/EventLogo.tsx:399](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PublicLayout/EventLogo.tsx#L399)
|
|
2629
|
-
|
|
2630
|
-
___
|
|
2631
|
-
|
|
2632
|
-
### EventLogoCompact
|
|
2633
|
-
|
|
2634
|
-
▸ **EventLogoCompact**(`props`): `Element`
|
|
2635
|
-
|
|
2636
|
-
Compact event logo for small spaces
|
|
2637
|
-
|
|
2638
|
-
#### Parameters
|
|
2639
|
-
|
|
2640
|
-
| Name | Type |
|
|
2641
|
-
| :------ | :------ |
|
|
2642
|
-
| `props` | [`EventLogoProps`](interfaces/EventLogoProps.md) |
|
|
2643
|
-
|
|
2644
|
-
#### Returns
|
|
2645
|
-
|
|
2646
|
-
`Element`
|
|
2647
|
-
|
|
2648
|
-
#### Defined in
|
|
2649
|
-
|
|
2650
|
-
[packages/core/src/components/PublicLayout/EventLogo.tsx:453](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PublicLayout/EventLogo.tsx#L453)
|
|
2651
|
-
|
|
2652
|
-
___
|
|
2653
|
-
|
|
2654
|
-
### EventLogoLarge
|
|
2655
|
-
|
|
2656
|
-
▸ **EventLogoLarge**(`props`): `Element`
|
|
2657
|
-
|
|
2658
|
-
Large event logo for prominent display
|
|
2659
|
-
|
|
2660
|
-
#### Parameters
|
|
2661
|
-
|
|
2662
|
-
| Name | Type |
|
|
2663
|
-
| :------ | :------ |
|
|
2664
|
-
| `props` | [`EventLogoProps`](interfaces/EventLogoProps.md) |
|
|
2665
|
-
|
|
2666
|
-
#### Returns
|
|
2667
|
-
|
|
2668
|
-
`Element`
|
|
2669
|
-
|
|
2670
|
-
#### Defined in
|
|
2671
|
-
|
|
2672
|
-
[packages/core/src/components/PublicLayout/EventLogo.tsx:466](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PublicLayout/EventLogo.tsx#L466)
|
|
2673
|
-
|
|
2674
|
-
___
|
|
2675
|
-
|
|
2676
2599
|
### useErrorBoundary
|
|
2677
2600
|
|
|
2678
2601
|
▸ **useErrorBoundary**(): `Object`
|
|
@@ -2915,7 +2838,7 @@ React element with public page header
|
|
|
2915
2838
|
|
|
2916
2839
|
#### Defined in
|
|
2917
2840
|
|
|
2918
|
-
[packages/core/src/components/PublicLayout/PublicPageHeader.tsx:
|
|
2841
|
+
[packages/core/src/components/PublicLayout/PublicPageHeader.tsx:86](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PublicLayout/PublicPageHeader.tsx#L86)
|
|
2919
2842
|
|
|
2920
2843
|
___
|
|
2921
2844
|
|
|
@@ -4439,7 +4362,16 @@ ___
|
|
|
4439
4362
|
|
|
4440
4363
|
▸ **useFilesByCategory**(`supabase`, `table_name`, `record_id`, `category`, `organisation_id`): `Object`
|
|
4441
4364
|
|
|
4442
|
-
|
|
4365
|
+
Convenience hook for getting files by category with automatic URL loading.
|
|
4366
|
+
|
|
4367
|
+
This hook wraps useFileReference().getFilesByCategory and automatically:
|
|
4368
|
+
- Loads file references filtered by category
|
|
4369
|
+
- Generates URLs for all files (public URLs for public files, signed URLs for private files)
|
|
4370
|
+
- Manages state for fileReferences and fileUrls
|
|
4371
|
+
- Auto-refetches when table_name, record_id, category, or organisation_id changes
|
|
4372
|
+
|
|
4373
|
+
Use this hook when you need files by category with their URLs ready to display.
|
|
4374
|
+
For more control, use useFileReference() directly and manage URLs yourself.
|
|
4443
4375
|
|
|
4444
4376
|
#### Parameters
|
|
4445
4377
|
|
|
@@ -4466,7 +4398,7 @@ Hook for getting files by category
|
|
|
4466
4398
|
|
|
4467
4399
|
#### Defined in
|
|
4468
4400
|
|
|
4469
|
-
[packages/core/src/hooks/useFileReference.ts:
|
|
4401
|
+
[packages/core/src/hooks/useFileReference.ts:374](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useFileReference.ts#L374)
|
|
4470
4402
|
|
|
4471
4403
|
___
|
|
4472
4404
|
|
|
@@ -6998,6 +6930,7 @@ ___
|
|
|
6998
6930
|
▸ **generateUniqueFileName**(`originalName`): `string`
|
|
6999
6931
|
|
|
7000
6932
|
Generate a unique filename with timestamp and UUID
|
|
6933
|
+
Sanitizes the original filename to remove spaces and invalid characters for storage compatibility
|
|
7001
6934
|
|
|
7002
6935
|
#### Parameters
|
|
7003
6936
|
|
|
@@ -7011,7 +6944,7 @@ Generate a unique filename with timestamp and UUID
|
|
|
7011
6944
|
|
|
7012
6945
|
#### Defined in
|
|
7013
6946
|
|
|
7014
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
6947
|
+
[packages/core/src/utils/storage/helpers.ts:51](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L51)
|
|
7015
6948
|
|
|
7016
6949
|
___
|
|
7017
6950
|
|
|
@@ -7035,7 +6968,7 @@ Extract file metadata from a File object
|
|
|
7035
6968
|
|
|
7036
6969
|
#### Defined in
|
|
7037
6970
|
|
|
7038
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
6971
|
+
[packages/core/src/utils/storage/helpers.ts:78](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L78)
|
|
7039
6972
|
|
|
7040
6973
|
___
|
|
7041
6974
|
|
|
@@ -7059,7 +6992,7 @@ Upload a file to Supabase storage with app segregation
|
|
|
7059
6992
|
|
|
7060
6993
|
#### Defined in
|
|
7061
6994
|
|
|
7062
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
6995
|
+
[packages/core/src/utils/storage/helpers.ts:152](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L152)
|
|
7063
6996
|
|
|
7064
6997
|
___
|
|
7065
6998
|
|
|
@@ -7085,7 +7018,7 @@ Public URL for the file
|
|
|
7085
7018
|
|
|
7086
7019
|
#### Defined in
|
|
7087
7020
|
|
|
7088
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
7021
|
+
[packages/core/src/utils/storage/helpers.ts:224](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L224)
|
|
7089
7022
|
|
|
7090
7023
|
___
|
|
7091
7024
|
|
|
@@ -7112,7 +7045,7 @@ Signed URL with expiration timestamp, or null if failed
|
|
|
7112
7045
|
|
|
7113
7046
|
#### Defined in
|
|
7114
7047
|
|
|
7115
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
7048
|
+
[packages/core/src/utils/storage/helpers.ts:320](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L320)
|
|
7116
7049
|
|
|
7117
7050
|
___
|
|
7118
7051
|
|
|
@@ -7138,7 +7071,7 @@ Success status and optional error message
|
|
|
7138
7071
|
|
|
7139
7072
|
#### Defined in
|
|
7140
7073
|
|
|
7141
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
7074
|
+
[packages/core/src/utils/storage/helpers.ts:355](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L355)
|
|
7142
7075
|
|
|
7143
7076
|
___
|
|
7144
7077
|
|
|
@@ -7163,7 +7096,7 @@ List of files with metadata
|
|
|
7163
7096
|
|
|
7164
7097
|
#### Defined in
|
|
7165
7098
|
|
|
7166
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
7099
|
+
[packages/core/src/utils/storage/helpers.ts:389](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L389)
|
|
7167
7100
|
|
|
7168
7101
|
___
|
|
7169
7102
|
|
|
@@ -7189,7 +7122,7 @@ File blob with metadata, or null if failed
|
|
|
7189
7122
|
|
|
7190
7123
|
#### Defined in
|
|
7191
7124
|
|
|
7192
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
7125
|
+
[packages/core/src/utils/storage/helpers.ts:449](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L449)
|
|
7193
7126
|
|
|
7194
7127
|
___
|
|
7195
7128
|
|
|
@@ -7216,4 +7149,4 @@ Move a file to archived location (soft delete)
|
|
|
7216
7149
|
|
|
7217
7150
|
#### Defined in
|
|
7218
7151
|
|
|
7219
|
-
[packages/core/src/utils/storage/helpers.ts:
|
|
7152
|
+
[packages/core/src/utils/storage/helpers.ts:502](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/helpers.ts#L502)
|
|
@@ -222,7 +222,6 @@ import { FileUpload, FileCategory } from '@jmruthers/pace-core';
|
|
|
222
222
|
import { FileDisplay, FileCategory } from '@jmruthers/pace-core';
|
|
223
223
|
|
|
224
224
|
<FileDisplay
|
|
225
|
-
supabase={supabase}
|
|
226
225
|
table_name="pace_person"
|
|
227
226
|
record_id={personId}
|
|
228
227
|
organisation_id={orgId}
|
|
@@ -244,7 +243,6 @@ import { FileDisplay, FileCategory } from '@jmruthers/pace-core';
|
|
|
244
243
|
```tsx
|
|
245
244
|
// Display just the first image without category filtering or metadata
|
|
246
245
|
<FileDisplay
|
|
247
|
-
supabase={supabase}
|
|
248
246
|
table_name="event"
|
|
249
247
|
record_id={eventId}
|
|
250
248
|
organisation_id={orgId}
|
|
@@ -252,6 +250,59 @@ import { FileDisplay, FileCategory } from '@jmruthers/pace-core';
|
|
|
252
250
|
/>
|
|
253
251
|
// When displayOnly is true, shows first file (prefers images) in simplified format
|
|
254
252
|
// without wrappers, borders, or metadata. Perfect for clean logo/image displays.
|
|
253
|
+
// FileDisplay automatically detects context (public or authenticated) and uses the appropriate Supabase client.
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**With Fallback Display:**
|
|
257
|
+
```tsx
|
|
258
|
+
// Show fallback UI when no file is available or image fails to load
|
|
259
|
+
<FileDisplay
|
|
260
|
+
table_name="pace_person"
|
|
261
|
+
record_id={personId}
|
|
262
|
+
organisation_id={orgId}
|
|
263
|
+
category={FileCategory.PROFILE_PHOTOS}
|
|
264
|
+
displayOnly={true}
|
|
265
|
+
showFallback={true}
|
|
266
|
+
fallbackSize="lg"
|
|
267
|
+
generateFallbackText={(fileName) => {
|
|
268
|
+
// Custom fallback text generator - extracts initials from file name
|
|
269
|
+
if (!fileName) return 'FL';
|
|
270
|
+
return fileName.split(/[\s\-_]+/)
|
|
271
|
+
.map(word => word.charAt(0).toUpperCase())
|
|
272
|
+
.join('')
|
|
273
|
+
.substring(0, 3);
|
|
274
|
+
}}
|
|
275
|
+
/>
|
|
276
|
+
// When showFallback is true, displays a styled fallback box with initials or custom text
|
|
277
|
+
// when no file is found, an error occurs, or an image fails to load.
|
|
278
|
+
// FileDisplay automatically detects context (public or authenticated) and uses the appropriate Supabase client.
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Event Logo Example:**
|
|
282
|
+
|
|
283
|
+
For displaying event logos, use `FileDisplay` directly with appropriate props:
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
import { FileDisplay, FileCategory } from '@jmruthers/pace-core';
|
|
287
|
+
|
|
288
|
+
<FileDisplay
|
|
289
|
+
table_name="event"
|
|
290
|
+
record_id={event.id}
|
|
291
|
+
organisation_id={event.organisation_id}
|
|
292
|
+
category={FileCategory.EVENT_LOGOS}
|
|
293
|
+
displayOnly={true}
|
|
294
|
+
showFallback={true}
|
|
295
|
+
fallbackSize="lg"
|
|
296
|
+
generateFallbackText={(fileName) => {
|
|
297
|
+
// Custom fallback generator from event name
|
|
298
|
+
if (!event.event_name) return 'EV';
|
|
299
|
+
return event.event_name
|
|
300
|
+
.split(/[\s\-_]+/)
|
|
301
|
+
.map(word => word.charAt(0).toUpperCase())
|
|
302
|
+
.join('')
|
|
303
|
+
.substring(0, 3);
|
|
304
|
+
}}
|
|
305
|
+
/>
|
|
255
306
|
```
|
|
256
307
|
|
|
257
308
|
### React Hooks
|
package/package.json
CHANGED
|
@@ -398,7 +398,7 @@ describe('[component] FileDisplay', () => {
|
|
|
398
398
|
clearError: vi.fn(),
|
|
399
399
|
});
|
|
400
400
|
|
|
401
|
-
// This test verifies that displayOnly logic
|
|
401
|
+
// This test verifies that displayOnly logic prefers images
|
|
402
402
|
// The component should select the image file over the PDF
|
|
403
403
|
renderWithProviders(<FileDisplay {...baseProps} displayOnly />);
|
|
404
404
|
|