@jmruthers/pace-core 0.5.104 → 0.5.105
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/{AuthService-DX15wM6y.d.ts → AuthService-1D2ifNfa.d.ts} +1 -0
- package/dist/{DataTable-EEDFYMJP.js → DataTable-LWHFLTEW.js} +6 -6
- package/dist/{UnifiedAuthProvider-H7RI4KYD.js → UnifiedAuthProvider-XU4BHFXZ.js} +3 -3
- package/dist/{chunk-62AVH7CM.js → chunk-75G3NZWN.js} +4 -4
- package/dist/{chunk-SF6VFEWO.js → chunk-AZFPGDCJ.js} +15 -7
- package/dist/chunk-AZFPGDCJ.js.map +1 -0
- package/dist/{chunk-S7TZKHG3.js → chunk-DWYMGSGU.js} +14 -7
- package/dist/chunk-DWYMGSGU.js.map +1 -0
- package/dist/{chunk-G7UUVEAP.js → chunk-GVRSXXAA.js} +3 -3
- package/dist/{chunk-B6LDHZGA.js → chunk-HBGPLSA5.js} +28 -7
- package/dist/chunk-HBGPLSA5.js.map +1 -0
- package/dist/{chunk-ORACUZ7H.js → chunk-KBG34SVL.js} +2 -2
- package/dist/{chunk-ZGCVJ7WW.js → chunk-LT6RKRA7.js} +2 -2
- package/dist/{chunk-7TQDRDSM.js → chunk-MOMYOQMC.js} +5 -5
- package/dist/{chunk-2KLAOD4M.js → chunk-QDDUU625.js} +3 -3
- package/dist/{chunk-5RYPBJYL.js → chunk-X4FRXJV6.js} +7 -3
- package/dist/{chunk-5RYPBJYL.js.map → chunk-X4FRXJV6.js.map} +1 -1
- package/dist/{chunk-MVNOAHOP.js → chunk-ZXY5NTJB.js} +2 -2
- package/dist/components.js +8 -8
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -11
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +2 -2
- package/dist/rbac/index.js +7 -7
- package/dist/{usePublicRouteParams-BiXgKiYa.d.ts → usePublicRouteParams-CnM-IK2I.d.ts} +1 -0
- package/dist/utils.js +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 +1 -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 +1 -1
- 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 +4 -4
- 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 +1 -1
- 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/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.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 +7 -6
- package/package.json +1 -1
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +7 -0
- package/src/hooks/public/usePublicFileDisplay.ts +8 -0
- package/src/hooks/useEventTheme.ts +14 -1
- package/src/hooks/useFileDisplay.ts +10 -2
- package/src/services/EventService.ts +10 -3
- package/src/utils/file-reference.ts +15 -6
- package/dist/chunk-B6LDHZGA.js.map +0 -1
- package/dist/chunk-S7TZKHG3.js.map +0 -1
- package/dist/chunk-SF6VFEWO.js.map +0 -1
- /package/dist/{DataTable-EEDFYMJP.js.map → DataTable-LWHFLTEW.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-H7RI4KYD.js.map → UnifiedAuthProvider-XU4BHFXZ.js.map} +0 -0
- /package/dist/{chunk-62AVH7CM.js.map → chunk-75G3NZWN.js.map} +0 -0
- /package/dist/{chunk-G7UUVEAP.js.map → chunk-GVRSXXAA.js.map} +0 -0
- /package/dist/{chunk-ORACUZ7H.js.map → chunk-KBG34SVL.js.map} +0 -0
- /package/dist/{chunk-ZGCVJ7WW.js.map → chunk-LT6RKRA7.js.map} +0 -0
- /package/dist/{chunk-7TQDRDSM.js.map → chunk-MOMYOQMC.js.map} +0 -0
- /package/dist/{chunk-2KLAOD4M.js.map → chunk-QDDUU625.js.map} +0 -0
- /package/dist/{chunk-MVNOAHOP.js.map → chunk-ZXY5NTJB.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.105](../README.md) / [Exports](../modules.md) / PaceLoginPageProps
|
|
2
2
|
|
|
3
3
|
# Interface: PaceLoginPageProps
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ The name of the application to be displayed on the login form.
|
|
|
20
20
|
|
|
21
21
|
#### Defined in
|
|
22
22
|
|
|
23
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
23
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:134](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L134)
|
|
24
24
|
|
|
25
25
|
___
|
|
26
26
|
|
|
@@ -32,7 +32,7 @@ The path to redirect to upon successful login. Defaults to `/`.
|
|
|
32
32
|
|
|
33
33
|
#### Defined in
|
|
34
34
|
|
|
35
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
35
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:136](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L136)
|
|
36
36
|
|
|
37
37
|
___
|
|
38
38
|
|
|
@@ -44,4 +44,4 @@ Whether to check app access using RBAC. Defaults to false.
|
|
|
44
44
|
|
|
45
45
|
#### Defined in
|
|
46
46
|
|
|
47
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
47
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:138](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L138)
|
package/docs/api/modules.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.105](README.md) / Exports
|
|
2
2
|
|
|
3
|
-
# @jmruthers/pace-core - v0.5.
|
|
3
|
+
# @jmruthers/pace-core - v0.5.105
|
|
4
4
|
|
|
5
5
|
**`File`**
|
|
6
6
|
|
|
@@ -2477,7 +2477,7 @@ JSX.Element - The rendered login page with enhanced functionality
|
|
|
2477
2477
|
|
|
2478
2478
|
#### Defined in
|
|
2479
2479
|
|
|
2480
|
-
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:
|
|
2480
|
+
[packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx:165](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceLoginPage/PaceLoginPage.tsx#L165)
|
|
2481
2481
|
|
|
2482
2482
|
___
|
|
2483
2483
|
|
|
@@ -3837,7 +3837,7 @@ Useful for testing or when you need to force refresh all data
|
|
|
3837
3837
|
|
|
3838
3838
|
#### Defined in
|
|
3839
3839
|
|
|
3840
|
-
[packages/core/src/hooks/public/usePublicFileDisplay.ts:
|
|
3840
|
+
[packages/core/src/hooks/public/usePublicFileDisplay.ts:363](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/public/usePublicFileDisplay.ts#L363)
|
|
3841
3841
|
|
|
3842
3842
|
___
|
|
3843
3843
|
|
|
@@ -3858,7 +3858,7 @@ Get cache statistics for debugging
|
|
|
3858
3858
|
|
|
3859
3859
|
#### Defined in
|
|
3860
3860
|
|
|
3861
|
-
[packages/core/src/hooks/public/usePublicFileDisplay.ts:
|
|
3861
|
+
[packages/core/src/hooks/public/usePublicFileDisplay.ts:374](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/public/usePublicFileDisplay.ts#L374)
|
|
3862
3862
|
|
|
3863
3863
|
___
|
|
3864
3864
|
|
|
@@ -4048,6 +4048,7 @@ This hook watches the selected event and applies its colors using the theming sy
|
|
|
4048
4048
|
It will:
|
|
4049
4049
|
- Apply event colors when an event with `event_colours` is selected
|
|
4050
4050
|
- Clear theming when no event is selected
|
|
4051
|
+
- Skip theme application when on the login route to prevent login screen styling
|
|
4051
4052
|
- Handle cleanup when the component unmounts
|
|
4052
4053
|
|
|
4053
4054
|
#### Returns
|
|
@@ -4058,7 +4059,7 @@ void - This is an effect hook with no return value
|
|
|
4058
4059
|
|
|
4059
4060
|
#### Defined in
|
|
4060
4061
|
|
|
4061
|
-
[packages/core/src/hooks/useEventTheme.ts:
|
|
4062
|
+
[packages/core/src/hooks/useEventTheme.ts:41](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useEventTheme.ts#L41)
|
|
4062
4063
|
|
|
4063
4064
|
___
|
|
4064
4065
|
|
package/package.json
CHANGED
|
@@ -127,6 +127,7 @@ import { useUnifiedAuth } from '../../providers';
|
|
|
127
127
|
import { isSuperAdmin } from '../../rbac/api';
|
|
128
128
|
import { LoginForm } from '../LoginForm';
|
|
129
129
|
import { Button, Input, Label } from '..';
|
|
130
|
+
import { clearPalette } from '../../theming/runtime';
|
|
130
131
|
|
|
131
132
|
export interface PaceLoginPageProps {
|
|
132
133
|
/** The name of the application to be displayed on the login form. */
|
|
@@ -173,6 +174,12 @@ export const PaceLoginPage: React.FC<PaceLoginPageProps> = ({
|
|
|
173
174
|
const [accessError, setAccessError] = useState<string | null>(null);
|
|
174
175
|
const [isCheckingAccess, setIsCheckingAccess] = useState(false);
|
|
175
176
|
|
|
177
|
+
// Clear any active event theme when login page mounts
|
|
178
|
+
// This ensures the login screen always uses default colors
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
clearPalette();
|
|
181
|
+
}, []);
|
|
182
|
+
|
|
176
183
|
// Check app access after authentication using RBAC
|
|
177
184
|
useEffect(() => {
|
|
178
185
|
if (!requireAppAccess || !isAuthenticated || isLoading || !user || !supabase) {
|
|
@@ -147,8 +147,16 @@ export function usePublicFileDisplay(
|
|
|
147
147
|
|
|
148
148
|
let files: any[] = [];
|
|
149
149
|
|
|
150
|
+
// CRITICAL: When category is provided, MUST use RPC function, not direct queries
|
|
151
|
+
// Category is stored in file_metadata JSONB field, not a direct column
|
|
150
152
|
if (category) {
|
|
151
153
|
// Single file mode - use RPC to get files by category
|
|
154
|
+
console.log('[usePublicFileDisplay] Using RPC function for category filtering:', {
|
|
155
|
+
table_name,
|
|
156
|
+
record_id,
|
|
157
|
+
category,
|
|
158
|
+
organisation_id
|
|
159
|
+
});
|
|
152
160
|
const { data, error: rpcError } = await (supabase as any)
|
|
153
161
|
.rpc('data_file_reference_by_category_list', {
|
|
154
162
|
p_table_name: table_name,
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { useEffect } from 'react';
|
|
24
|
+
import { useLocation } from 'react-router-dom';
|
|
24
25
|
import { useEvents } from './useEvents';
|
|
25
26
|
import { applyPalette, clearPalette } from '../theming/runtime';
|
|
26
27
|
import type { PaletteData, ColorPalette } from '../theming/runtime';
|
|
@@ -32,14 +33,26 @@ import type { PaletteData, ColorPalette } from '../theming/runtime';
|
|
|
32
33
|
* It will:
|
|
33
34
|
* - Apply event colors when an event with `event_colours` is selected
|
|
34
35
|
* - Clear theming when no event is selected
|
|
36
|
+
* - Skip theme application when on the login route to prevent login screen styling
|
|
35
37
|
* - Handle cleanup when the component unmounts
|
|
36
38
|
*
|
|
37
39
|
* @returns void - This is an effect hook with no return value
|
|
38
40
|
*/
|
|
39
41
|
export function useEventTheme(): void {
|
|
40
42
|
const { selectedEvent } = useEvents();
|
|
43
|
+
const location = useLocation();
|
|
41
44
|
|
|
42
45
|
useEffect(() => {
|
|
46
|
+
// Skip theme application when on login route
|
|
47
|
+
// This prevents event colors from styling the login screen
|
|
48
|
+
const isOnLoginRoute = location.pathname === '/login' || location.pathname.startsWith('/login');
|
|
49
|
+
|
|
50
|
+
if (isOnLoginRoute) {
|
|
51
|
+
// Clear any active theme when on login route
|
|
52
|
+
clearPalette();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
43
56
|
// If there's no selected event, clear any dynamic theming
|
|
44
57
|
if (!selectedEvent) {
|
|
45
58
|
clearPalette();
|
|
@@ -82,5 +95,5 @@ export function useEventTheme(): void {
|
|
|
82
95
|
// Don't clear on unmount since we want the theme to persist
|
|
83
96
|
// The next event selection will update it
|
|
84
97
|
};
|
|
85
|
-
}, [selectedEvent]);
|
|
98
|
+
}, [selectedEvent, location.pathname]);
|
|
86
99
|
}
|
|
@@ -174,8 +174,16 @@ export function useFileDisplay(
|
|
|
174
174
|
const service = createFileReferenceService(supabase);
|
|
175
175
|
let files: FileReference[] = [];
|
|
176
176
|
|
|
177
|
+
// CRITICAL: When category is provided, MUST use RPC function, not direct queries
|
|
178
|
+
// Category is stored in file_metadata JSONB field, not a direct column
|
|
177
179
|
if (category) {
|
|
178
|
-
// Single file mode - get files by category
|
|
180
|
+
// Single file mode - get files by category using RPC
|
|
181
|
+
console.log('[useFileDisplay] Using RPC function for category filtering:', {
|
|
182
|
+
table_name,
|
|
183
|
+
record_id,
|
|
184
|
+
category,
|
|
185
|
+
organisation_id
|
|
186
|
+
});
|
|
179
187
|
files = await service.getFilesByCategory(
|
|
180
188
|
table_name,
|
|
181
189
|
record_id,
|
|
@@ -183,7 +191,7 @@ export function useFileDisplay(
|
|
|
183
191
|
organisation_id
|
|
184
192
|
);
|
|
185
193
|
} else {
|
|
186
|
-
// Multiple files mode - get all files
|
|
194
|
+
// Multiple files mode - get all files using RPC
|
|
187
195
|
files = await service.listFileReferences(
|
|
188
196
|
table_name,
|
|
189
197
|
record_id,
|
|
@@ -180,8 +180,9 @@ export class EventService extends BaseService implements IEventService {
|
|
|
180
180
|
if (persistedEvent) {
|
|
181
181
|
this.selectedEvent = persistedEvent;
|
|
182
182
|
this.setSelectedEventId?.(persistedEventId);
|
|
183
|
-
//
|
|
184
|
-
|
|
183
|
+
// Skip theme application during session restoration/login
|
|
184
|
+
// Theme will be applied by useEventTheme hook once user navigates away from login
|
|
185
|
+
this.updateThemeForSelectedEvent(true);
|
|
185
186
|
return true;
|
|
186
187
|
} else {
|
|
187
188
|
// Clear invalid persisted event
|
|
@@ -389,8 +390,14 @@ export class EventService extends BaseService implements IEventService {
|
|
|
389
390
|
|
|
390
391
|
/**
|
|
391
392
|
* Apply or clear runtime theme variables based on the current selected event's colours
|
|
393
|
+
* @param skipTheming - If true, skip theme application (useful during session restoration/login)
|
|
392
394
|
*/
|
|
393
|
-
private updateThemeForSelectedEvent(): void {
|
|
395
|
+
private updateThemeForSelectedEvent(skipTheming: boolean = false): void {
|
|
396
|
+
// Skip theme application if flag is set (e.g., during login/session restoration)
|
|
397
|
+
if (skipTheming) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
394
401
|
try {
|
|
395
402
|
const normalized = this.parseAndNormalizeEventColours(this.selectedEvent?.event_colours);
|
|
396
403
|
if (normalized) {
|