@jmruthers/pace-core 0.6.3 → 0.6.5
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/{DataTable-THFPBKTP.js → DataTable-AOVNCPTX.js} +8 -8
- package/dist/{PublicPageProvider-DEMpysFR.d.ts → PublicPageProvider-QTFVrL-Z.d.ts} +65 -83
- package/dist/{UnifiedAuthProvider-KAGUYQ4J.js → UnifiedAuthProvider-4SBX4LU5.js} +4 -4
- package/dist/{api-IAGWF3ZG.js → api-O6HTBX5Y.js} +3 -3
- package/dist/{chunk-ZNIWI3UC.js → chunk-6COVEUS7.js} +141 -107
- package/dist/chunk-6COVEUS7.js.map +1 -0
- package/dist/{chunk-QRPVRXYT.js → chunk-AFVQODI2.js} +38 -1
- package/dist/{chunk-QRPVRXYT.js.map → chunk-AFVQODI2.js.map} +1 -1
- package/dist/{chunk-RWEBCB47.js → chunk-EFN2EIMK.js} +2 -2
- package/dist/{chunk-CNCQDFLN.js → chunk-G7QEZTYQ.js} +31 -31
- package/dist/{chunk-CNCQDFLN.js.map → chunk-G7QEZTYQ.js.map} +1 -1
- package/dist/{chunk-YDQHOZNA.js → chunk-HU2C6SSC.js} +29 -18
- package/dist/chunk-HU2C6SSC.js.map +1 -0
- package/dist/{chunk-DWUBLJJM.js → chunk-IHB5DR3H.js} +184 -53
- package/dist/chunk-IHB5DR3H.js.map +1 -0
- package/dist/{chunk-PQBSKX33.js → chunk-IVOFDYWT.js} +364 -208
- package/dist/chunk-IVOFDYWT.js.map +1 -0
- package/dist/{chunk-6SOIHG6Z.js → chunk-JGRYX5UX.js} +120 -20
- package/dist/chunk-JGRYX5UX.js.map +1 -0
- package/dist/{chunk-6Z7LTB3D.js → chunk-NTM7ZSB6.js} +4 -4
- package/dist/chunk-NTM7ZSB6.js.map +1 -0
- package/dist/{chunk-HFZBI76P.js → chunk-RGAWHO7N.js} +4 -4
- package/dist/chunk-RGAWHO7N.js.map +1 -0
- package/dist/{chunk-2T2IG7T7.js → chunk-UPPMRMYG.js} +3 -3
- package/dist/{chunk-2T2IG7T7.js.map → chunk-UPPMRMYG.js.map} +1 -1
- package/dist/components.d.ts +2 -3
- package/dist/components.js +24 -28
- package/dist/components.js.map +1 -1
- package/dist/{contextValidator-3JNZKUTX.js → contextValidator-5OGXSPKS.js} +2 -2
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +41 -139
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +27 -18
- package/dist/index.js +41 -50
- package/dist/index.js.map +1 -1
- package/dist/providers.js +3 -3
- package/dist/rbac/index.d.ts +16 -9
- package/dist/rbac/index.js +6 -6
- package/dist/{usePublicRouteParams-i3qtoBgg.d.ts → usePublicRouteParams-ClnV4tnv.d.ts} +8 -8
- package/dist/utils.js +1 -1
- package/docs/api/modules.md +210 -100
- package/package.json +8 -4
- package/scripts/audit/core/checks/dependencies.cjs +9 -0
- package/scripts/validate-master.js +1 -1
- package/src/components/DataTable/__tests__/keyboard.test.tsx +15 -2
- package/src/components/DataTable/components/ImportModal.tsx +4 -6
- package/src/components/DataTable/components/ViewRowModal.tsx +4 -4
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +455 -96
- package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +122 -58
- package/src/components/DataTable/core/DataTableContext.tsx +1 -1
- package/src/components/DateTimeField/DateTimeField.tsx +17 -19
- package/src/components/DateTimeField/README.md +5 -2
- package/src/components/Dialog/Dialog.test.tsx +248 -228
- package/src/components/Dialog/Dialog.tsx +455 -325
- package/src/components/Dialog/index.ts +3 -3
- package/src/components/FileDisplay/FileDisplay.test.tsx +41 -0
- package/src/components/FileDisplay/FileDisplay.tsx +5 -5
- package/src/components/Form/Form.test.tsx +3 -2
- package/src/components/Form/Form.tsx +4 -5
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +28 -28
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +40 -54
- package/src/components/LoginForm/LoginForm.tsx +2 -2
- package/src/components/NavigationMenu/NavigationMenu.tsx +2 -2
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +54 -42
- package/src/components/PaceAppLayout/README.md +10 -9
- package/src/components/PaceAppLayout/test-setup.tsx +40 -31
- package/src/components/PasswordChange/PasswordChangeForm.test.tsx +61 -0
- package/src/components/PasswordChange/PasswordChangeForm.tsx +20 -13
- package/src/components/PublicLayout/PublicLayout.test.tsx +7 -3
- package/src/components/PublicLayout/PublicPageLayout.tsx +5 -8
- package/src/components/UserMenu/UserMenu.test.tsx +38 -6
- package/src/components/UserMenu/UserMenu.tsx +36 -34
- package/src/components/index.ts +3 -4
- package/src/hooks/useEventTheme.ts +4 -4
- package/src/hooks/useEvents.ts +11 -7
- package/src/hooks/useKeyboardShortcuts.ts +1 -1
- package/src/hooks/useOrganisationPermissions.ts +4 -4
- package/src/hooks/useOrganisations.ts +13 -7
- package/src/index.ts +11 -1
- package/src/rbac/README.md +20 -20
- package/src/rbac/hooks/useRBAC.test.ts +21 -3
- package/src/rbac/hooks/useRBAC.ts +4 -3
- package/src/rbac/hooks/useResourcePermissions.test.ts +125 -30
- package/src/rbac/hooks/useResourcePermissions.ts +57 -29
- package/src/rbac/permissions.ts +17 -17
- package/src/rbac/utils/contextValidator.ts +36 -0
- package/src/services/AuthService.ts +2 -5
- package/src/services/EventService.ts +99 -2
- package/src/services/InactivityService.ts +139 -58
- package/src/styles/core.css +4 -0
- package/src/utils/formatting/formatTime.test.ts +3 -2
- package/dist/chunk-6SOIHG6Z.js.map +0 -1
- package/dist/chunk-6Z7LTB3D.js.map +0 -1
- package/dist/chunk-DWUBLJJM.js.map +0 -1
- package/dist/chunk-HFZBI76P.js.map +0 -1
- package/dist/chunk-PQBSKX33.js.map +0 -1
- package/dist/chunk-YDQHOZNA.js.map +0 -1
- package/dist/chunk-ZNIWI3UC.js.map +0 -1
- /package/dist/{DataTable-THFPBKTP.js.map → DataTable-AOVNCPTX.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-KAGUYQ4J.js.map → UnifiedAuthProvider-4SBX4LU5.js.map} +0 -0
- /package/dist/{api-IAGWF3ZG.js.map → api-O6HTBX5Y.js.map} +0 -0
- /package/dist/{chunk-RWEBCB47.js.map → chunk-EFN2EIMK.js.map} +0 -0
- /package/dist/{contextValidator-3JNZKUTX.js.map → contextValidator-5OGXSPKS.js.map} +0 -0
|
@@ -291,10 +291,10 @@ export class InactivityService extends BaseService implements IInactivityService
|
|
|
291
291
|
private setupEventHandlers(): void {
|
|
292
292
|
if (typeof window === 'undefined') return;
|
|
293
293
|
|
|
294
|
-
let idleTimer: NodeJS.Timeout | null = null;
|
|
295
294
|
let warningTimer: NodeJS.Timeout | null = null;
|
|
295
|
+
let logoutTimer: NodeJS.Timeout | null = null;
|
|
296
|
+
let countdownInterval: NodeJS.Timeout | null = null;
|
|
296
297
|
let lastActivity = Date.now();
|
|
297
|
-
let pollInterval: NodeJS.Timeout | null = null;
|
|
298
298
|
|
|
299
299
|
// Store previous state for comparison
|
|
300
300
|
let prevIsIdle = false;
|
|
@@ -303,19 +303,29 @@ export class InactivityService extends BaseService implements IInactivityService
|
|
|
303
303
|
let prevInactivityTimeRemaining = 0;
|
|
304
304
|
let prevTimeRemaining = this.idleTimeoutMs;
|
|
305
305
|
|
|
306
|
-
//
|
|
307
|
-
const
|
|
306
|
+
// Calculate time until warning and logout
|
|
307
|
+
const getTimeUntilWarning = () => {
|
|
308
|
+
const timeSinceActivity = Date.now() - lastActivity;
|
|
309
|
+
return Math.max(0, (this.idleTimeoutMs - this.warnBeforeMs) - timeSinceActivity);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
const getTimeUntilLogout = () => {
|
|
313
|
+
const timeSinceActivity = Date.now() - lastActivity;
|
|
314
|
+
return Math.max(0, this.idleTimeoutMs - timeSinceActivity);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// Update state and notify if changed
|
|
318
|
+
const updateState = (forceNotify = false) => {
|
|
308
319
|
const now = Date.now();
|
|
309
320
|
const timeSinceActivity = now - lastActivity;
|
|
310
321
|
const timeUntilIdle = this.idleTimeoutMs - timeSinceActivity;
|
|
311
|
-
const timeUntilWarning = (this.idleTimeoutMs - this.warnBeforeMs) - timeSinceActivity;
|
|
312
322
|
|
|
313
|
-
// Calculate new state values
|
|
314
|
-
const newIsIdle = timeSinceActivity >=
|
|
315
|
-
const newShowWarning =
|
|
323
|
+
// Calculate new state values
|
|
324
|
+
const newIsIdle = timeSinceActivity >= this.idleTimeoutMs;
|
|
325
|
+
const newShowWarning = timeSinceActivity >= (this.idleTimeoutMs - this.warnBeforeMs) && !newIsIdle;
|
|
316
326
|
const newShowInactivityWarning = newShowWarning;
|
|
317
327
|
const newInactivityTimeRemaining = newShowWarning
|
|
318
|
-
? Math.ceil(
|
|
328
|
+
? Math.ceil(timeUntilIdle / 1000)
|
|
319
329
|
: 0;
|
|
320
330
|
const newTimeRemaining = Math.max(0, timeUntilIdle);
|
|
321
331
|
|
|
@@ -324,11 +334,11 @@ export class InactivityService extends BaseService implements IInactivityService
|
|
|
324
334
|
prevIsIdle !== newIsIdle ||
|
|
325
335
|
prevShowWarning !== newShowWarning ||
|
|
326
336
|
prevShowInactivityWarning !== newShowInactivityWarning ||
|
|
327
|
-
prevInactivityTimeRemaining !== newInactivityTimeRemaining ||
|
|
337
|
+
(newShowWarning && prevInactivityTimeRemaining !== newInactivityTimeRemaining) ||
|
|
328
338
|
prevTimeRemaining !== newTimeRemaining;
|
|
329
339
|
|
|
330
|
-
// Only update and notify if state changed
|
|
331
|
-
if (stateChanged) {
|
|
340
|
+
// Only update and notify if state changed or forced
|
|
341
|
+
if (stateChanged || forceNotify) {
|
|
332
342
|
this._isIdle = newIsIdle;
|
|
333
343
|
this._showWarning = newShowWarning;
|
|
334
344
|
this._showInactivityWarning = newShowInactivityWarning;
|
|
@@ -342,76 +352,147 @@ export class InactivityService extends BaseService implements IInactivityService
|
|
|
342
352
|
prevInactivityTimeRemaining = newInactivityTimeRemaining;
|
|
343
353
|
prevTimeRemaining = newTimeRemaining;
|
|
344
354
|
|
|
345
|
-
|
|
355
|
+
if (stateChanged) {
|
|
356
|
+
this.notify();
|
|
357
|
+
}
|
|
346
358
|
|
|
347
359
|
// Handle idle logout if needed
|
|
348
|
-
if (newIsIdle
|
|
360
|
+
if (newIsIdle) {
|
|
349
361
|
this.handleIdleLogout();
|
|
350
362
|
}
|
|
351
363
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
// Schedule next state check based on current state
|
|
367
|
+
const scheduleNextCheck = () => {
|
|
368
|
+
// Clear existing timers
|
|
359
369
|
if (warningTimer) {
|
|
360
370
|
clearTimeout(warningTimer);
|
|
361
371
|
warningTimer = null;
|
|
362
372
|
}
|
|
363
373
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
pollInactivityState();
|
|
368
|
-
}, Math.min(10000, timeUntilIdle));
|
|
374
|
+
if (logoutTimer) {
|
|
375
|
+
clearTimeout(logoutTimer);
|
|
376
|
+
logoutTimer = null;
|
|
369
377
|
}
|
|
370
378
|
|
|
371
|
-
if (
|
|
372
|
-
|
|
379
|
+
if (countdownInterval) {
|
|
380
|
+
clearInterval(countdownInterval);
|
|
381
|
+
countdownInterval = null;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const timeUntilWarning = getTimeUntilWarning();
|
|
385
|
+
const timeUntilLogout = getTimeUntilLogout();
|
|
386
|
+
const timeSinceActivity = Date.now() - lastActivity;
|
|
387
|
+
|
|
388
|
+
// If already idle, nothing to schedule
|
|
389
|
+
if (timeSinceActivity >= this.idleTimeoutMs) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// If warning should be shown, start countdown interval
|
|
394
|
+
if (timeSinceActivity >= (this.idleTimeoutMs - this.warnBeforeMs)) {
|
|
395
|
+
// Update state to show warning
|
|
396
|
+
updateState();
|
|
397
|
+
|
|
398
|
+
// Start countdown interval to update remaining time every second
|
|
399
|
+
countdownInterval = setInterval(() => {
|
|
400
|
+
updateState();
|
|
401
|
+
|
|
402
|
+
// Check if we've reached logout time
|
|
403
|
+
if (Date.now() - lastActivity >= this.idleTimeoutMs) {
|
|
404
|
+
if (countdownInterval) {
|
|
405
|
+
clearInterval(countdownInterval);
|
|
406
|
+
countdownInterval = null;
|
|
407
|
+
}
|
|
408
|
+
this.handleIdleLogout();
|
|
409
|
+
}
|
|
410
|
+
}, 1000); // Update every second during warning period
|
|
411
|
+
|
|
412
|
+
// Schedule logout
|
|
413
|
+
logoutTimer = setTimeout(() => {
|
|
414
|
+
if (countdownInterval) {
|
|
415
|
+
clearInterval(countdownInterval);
|
|
416
|
+
countdownInterval = null;
|
|
417
|
+
}
|
|
373
418
|
this.handleIdleLogout();
|
|
374
|
-
},
|
|
419
|
+
}, timeUntilLogout);
|
|
420
|
+
} else {
|
|
421
|
+
// User is still active - schedule warning timer
|
|
422
|
+
// Use adaptive interval: check more frequently as we approach warning time
|
|
423
|
+
// Check every 60 seconds when far from warning, every 10 seconds when close
|
|
424
|
+
const timeUntilWarningMs = timeUntilWarning;
|
|
425
|
+
const adaptiveInterval = timeUntilWarningMs > 5 * 60 * 1000
|
|
426
|
+
? 60 * 1000 // Check every 60 seconds when > 5 minutes away
|
|
427
|
+
: timeUntilWarningMs > 60 * 1000
|
|
428
|
+
? 10 * 1000 // Check every 10 seconds when < 5 minutes but > 1 minute away
|
|
429
|
+
: 1000; // Check every second when < 1 minute away
|
|
430
|
+
|
|
431
|
+
warningTimer = setTimeout(() => {
|
|
432
|
+
updateState();
|
|
433
|
+
scheduleNextCheck(); // Reschedule for next check
|
|
434
|
+
}, Math.min(adaptiveInterval, timeUntilWarningMs));
|
|
375
435
|
}
|
|
376
436
|
};
|
|
377
437
|
|
|
378
438
|
const resetTimers = () => {
|
|
379
|
-
//
|
|
439
|
+
// Update last activity time
|
|
380
440
|
lastActivity = Date.now();
|
|
381
441
|
|
|
382
|
-
// Clear timers
|
|
383
|
-
if (idleTimer) {
|
|
384
|
-
clearTimeout(idleTimer);
|
|
385
|
-
idleTimer = null;
|
|
386
|
-
}
|
|
387
|
-
|
|
442
|
+
// Clear all timers
|
|
388
443
|
if (warningTimer) {
|
|
389
444
|
clearTimeout(warningTimer);
|
|
390
445
|
warningTimer = null;
|
|
391
446
|
}
|
|
392
447
|
|
|
393
|
-
|
|
448
|
+
if (logoutTimer) {
|
|
449
|
+
clearTimeout(logoutTimer);
|
|
450
|
+
logoutTimer = null;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (countdownInterval) {
|
|
454
|
+
clearInterval(countdownInterval);
|
|
455
|
+
countdownInterval = null;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// Reset state values
|
|
459
|
+
const hadWarning = this._showWarning || this._showInactivityWarning;
|
|
394
460
|
this._showInactivityWarning = false;
|
|
395
461
|
this._inactivityTimeRemaining = 0;
|
|
396
462
|
this._isIdle = false;
|
|
397
463
|
this._showWarning = false;
|
|
464
|
+
this._timeRemaining = this.idleTimeoutMs;
|
|
398
465
|
|
|
399
|
-
// Update previous state
|
|
466
|
+
// Update previous state
|
|
400
467
|
prevIsIdle = false;
|
|
401
468
|
prevShowWarning = false;
|
|
402
469
|
prevShowInactivityWarning = false;
|
|
403
470
|
prevInactivityTimeRemaining = 0;
|
|
404
471
|
prevTimeRemaining = this.idleTimeoutMs;
|
|
405
472
|
|
|
406
|
-
//
|
|
473
|
+
// Notify if we were showing a warning (state changed)
|
|
474
|
+
if (hadWarning) {
|
|
475
|
+
this.notify();
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Reschedule next check
|
|
479
|
+
scheduleNextCheck();
|
|
407
480
|
};
|
|
408
481
|
|
|
409
|
-
// Activity detection -
|
|
482
|
+
// Activity detection - throttled to avoid excessive calls
|
|
410
483
|
const activityEvents = ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart', 'click'];
|
|
484
|
+
let activityThrottleTimer: NodeJS.Timeout | null = null;
|
|
411
485
|
|
|
412
486
|
const handleActivity = () => {
|
|
413
|
-
|
|
414
|
-
|
|
487
|
+
// Throttle activity detection to once per second max
|
|
488
|
+
if (activityThrottleTimer) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
activityThrottleTimer = setTimeout(() => {
|
|
493
|
+
activityThrottleTimer = null;
|
|
494
|
+
resetTimers();
|
|
495
|
+
}, 1000);
|
|
415
496
|
};
|
|
416
497
|
|
|
417
498
|
// Add event listeners
|
|
@@ -419,29 +500,30 @@ export class InactivityService extends BaseService implements IInactivityService
|
|
|
419
500
|
document.addEventListener(event, handleActivity, true);
|
|
420
501
|
});
|
|
421
502
|
|
|
422
|
-
//
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}, 10000); // 10 seconds
|
|
426
|
-
|
|
427
|
-
// Initial poll
|
|
428
|
-
pollInactivityState();
|
|
503
|
+
// Initial state update and schedule first check
|
|
504
|
+
updateState(true); // Force initial notification
|
|
505
|
+
scheduleNextCheck();
|
|
429
506
|
|
|
430
507
|
// Store cleanup function
|
|
431
508
|
this.cleanupHandlers = () => {
|
|
432
|
-
if (idleTimer) {
|
|
433
|
-
clearTimeout(idleTimer);
|
|
434
|
-
idleTimer = null;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
509
|
if (warningTimer) {
|
|
438
510
|
clearTimeout(warningTimer);
|
|
439
511
|
warningTimer = null;
|
|
440
512
|
}
|
|
441
513
|
|
|
442
|
-
if (
|
|
443
|
-
|
|
444
|
-
|
|
514
|
+
if (logoutTimer) {
|
|
515
|
+
clearTimeout(logoutTimer);
|
|
516
|
+
logoutTimer = null;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (countdownInterval) {
|
|
520
|
+
clearInterval(countdownInterval);
|
|
521
|
+
countdownInterval = null;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (activityThrottleTimer) {
|
|
525
|
+
clearTimeout(activityThrottleTimer);
|
|
526
|
+
activityThrottleTimer = null;
|
|
445
527
|
}
|
|
446
528
|
|
|
447
529
|
activityEvents.forEach(event => {
|
|
@@ -457,6 +539,5 @@ export class InactivityService extends BaseService implements IInactivityService
|
|
|
457
539
|
};
|
|
458
540
|
|
|
459
541
|
this._isTracking = true;
|
|
460
|
-
this.notify(); // Initial notification only
|
|
461
542
|
}
|
|
462
543
|
}
|
package/src/styles/core.css
CHANGED
|
@@ -202,6 +202,10 @@
|
|
|
202
202
|
font-size: 0.875em;
|
|
203
203
|
color: var(--color-main-600);
|
|
204
204
|
}
|
|
205
|
+
|
|
206
|
+
dialog::backdrop {
|
|
207
|
+
background-color: oklch(from var(--color-main-700) l c h / 0.5);
|
|
208
|
+
}
|
|
205
209
|
|
|
206
210
|
.appGradient {
|
|
207
211
|
background: linear-gradient(145deg, var(--color-main-100) 10%, var(--color-main-200) 30%, var(--color-main-200) 70%, var(--color-main-300) 90%);
|
|
@@ -161,8 +161,9 @@ describe('formatTime Utility', () => {
|
|
|
161
161
|
}
|
|
162
162
|
const end = performance.now();
|
|
163
163
|
|
|
164
|
-
// Should complete in reasonable time (less than
|
|
165
|
-
|
|
164
|
+
// Should complete in reasonable time (less than 200ms for 1000 calls)
|
|
165
|
+
// Increased threshold to account for test environment variability
|
|
166
|
+
expect(end - start).toBeLessThan(200);
|
|
166
167
|
});
|
|
167
168
|
});
|
|
168
169
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useToast.ts","../src/components/DataTable/utils/performanceUtils.ts","../src/components/DataTable/utils/errorHandling.ts","../src/hooks/useDataTablePerformance.ts"],"sourcesContent":["\n/**\n * @file Toast hook for managing toast notifications\n * @package @jmruthers/pace-core\n * @module Hooks\n * @since 0.1.0\n *\n * Toast notifications automatically dismiss after 5 seconds by default.\n * The duration is fixed to the pace-core default to ensure consistent behaviour.\n */\n\nimport * as React from \"react\"\n\n/** Maximum number of toasts to show at once */\nconst TOAST_LIMIT = 5\n/** Delay before removing a dismissed toast */\nconst TOAST_REMOVE_DELAY = 1000\n/** Default duration for auto-dismissing toasts (5 seconds) */\nconst DEFAULT_TOAST_DURATION = 5000\n\nexport interface ToastProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n variant?: 'default' | 'destructive' | 'success';\n onClose?: () => void;\n action?: React.ReactElement<any>;\n}\n\n/**\n * Extended toast props with additional properties\n * @interface ToasterToast\n */\ntype ToasterToast = ToastProps & {\n /** Unique identifier for the toast */\n id: string\n /** Duration before automatic dismissal in milliseconds */\n duration?: number\n /** Optional title content */\n title?: React.ReactNode\n /** Optional description content */\n description?: React.ReactNode\n /** Optional action button */\n action?: React.ReactElement<any>\n /** Open state */\n open?: boolean\n /** Open change handler */\n onOpenChange?: (open: boolean) => void\n /** Dismiss function */\n dismiss?: () => void\n}\n\n/**\n * State interface for toast management\n */\ninterface State {\n /** Array of active toasts */\n toasts: ToasterToast[]\n}\n\n/** Map of toast IDs to their removal timeouts */\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()\n\n/** Current toast state */\nlet memoryState: State = {\n toasts: [],\n}\n\n/** List of state change listeners */\nconst listeners: Array<(state: State) => void> = []\n\n/**\n * Reset the toast state and clear all timeouts\n */\nexport function reset(): void {\n memoryState = { toasts: [] }\n toastTimeouts.forEach((timeout) => clearTimeout(timeout))\n toastTimeouts.clear()\n}\n\n/**\n * Dispatch a state change\n * @param action - Action to dispatch\n */\nfunction dispatch(action: {\n type: \"ADD_TOAST\" | \"UPDATE_TOAST\" | \"DISMISS_TOAST\" | \"REMOVE_TOAST\"\n toast?: ToasterToast\n toastId?: string\n}) {\n memoryState = reducer(memoryState, action)\n listeners.forEach((listener) => {\n listener(memoryState)\n })\n}\n\n/**\n * Generate a unique ID for a toast\n * @returns Unique ID string\n */\nfunction genId() {\n return Math.random().toString(36).substring(2, 9)\n}\n\n/**\n * Add a toast to the removal queue\n * @param toastId - ID of the toast to remove\n */\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId)\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n })\n }, TOAST_REMOVE_DELAY)\n\n toastTimeouts.set(toastId, timeout)\n}\n\n/**\n * State reducer for toast management\n * @param state - Current state\n * @param action - Action to process\n * @returns New state\n */\nfunction reducer(state: State, action: {\n type: \"ADD_TOAST\" | \"UPDATE_TOAST\" | \"DISMISS_TOAST\" | \"REMOVE_TOAST\"\n toast?: ToasterToast\n toastId?: string\n}): State {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast!, ...state.toasts].slice(0, TOAST_LIMIT),\n }\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast?.id ? { ...t, ...action.toast } : t\n ),\n }\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action\n\n if (toastId) {\n addToRemoveQueue(toastId)\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n }\n }\n\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n }\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n }\n }\n}\n\n/**\n * Toast configuration without ID\n * Duration is fixed to DEFAULT_TOAST_DURATION and cannot be overridden\n */\ntype Toast = Omit<ToasterToast, \"id\" | \"duration\">\n\n/**\n * Creates a new toast notification\n * @param props - Toast configuration. Duration is automatically set to 5 seconds (5000ms) and cannot be customized.\n * @returns Object with toast ID and control methods\n */\nfunction toast(props: Toast) {\n const id = genId()\n\n const update = (props: Partial<Omit<ToasterToast, \"id\" | \"duration\">>) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, duration: DEFAULT_TOAST_DURATION, id },\n })\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id })\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n duration: DEFAULT_TOAST_DURATION,\n id,\n open: true,\n dismiss,\n onOpenChange: (open) => {\n if (!open) dismiss()\n },\n },\n })\n\n return {\n id: id,\n dismiss,\n update,\n }\n}\n\n/**\n * Hook for managing toast notifications\n * @returns Object with toast state and control methods\n */\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState)\n\n React.useEffect(() => {\n listeners.push(setState)\n return () => {\n const index = listeners.indexOf(setState)\n if (index > -1) {\n listeners.splice(index, 1)\n }\n }\n }, [state])\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n }\n}\n\nexport { useToast, toast }\nexport type { ToasterToast }\n","/**\n * @file Performance Utilities for DataTable\n * @package @jmruthers/pace-core\n * @module Components/DataTable/Utils/Performance\n * @since 0.3.0\n */\n\nimport type { \n DataRecord, \n PaginationMode, \n ChunkingConfig, \n SearchIndexConfig\n} from '../types';\n\n// ============================================================================\n// PAGINATION MODE DETECTION\n// ============================================================================\n\n/**\n * Determines the optimal pagination mode based on dataset size.\n * \n * IMPORTANT: This function NEVER returns 'server' mode - it only returns 'client' or 'hybrid'.\n * Server mode should ONLY be used when serverSide config is explicitly provided.\n * Returning 'server' without serverSide config breaks pagination because TanStack Table\n * expects pre-paginated data but receives all client-side data.\n * \n * For large datasets (>10k rows), returns 'hybrid' which still uses client-side pagination\n * but with optimizations. If true server-side pagination is needed, serverSide config must be provided.\n * \n * @param dataLength - Number of rows in the dataset\n * @param serverSideThreshold - Threshold for switching to hybrid mode (default: 10000)\n * @returns Optimal pagination mode ('client' or 'hybrid')\n */\nexport function determinePaginationMode(\n dataLength: number,\n serverSideThreshold: number = 10000\n): 'client' | 'hybrid' {\n if (dataLength <= 1000) return 'client';\n // Even for very large datasets, use 'hybrid' mode (client-side pagination with optimizations)\n // unless serverSide config is explicitly provided (handled in useDataTablePerformance)\n return 'hybrid';\n}\n\n/**\n * Gets optimal page size options based on pagination mode and dataset size\n */\nexport function getOptimalPageSizeOptions(\n mode: PaginationMode,\n dataLength: number\n): number[] {\n switch (mode) {\n case 'client':\n return dataLength <= 100 ? [10, 25, 50] : [10, 25, 50, 100];\n case 'hybrid':\n return [50, 100, 250, 500];\n case 'server':\n return [25, 50, 100, 250];\n default:\n return [10, 25, 50, 100];\n }\n}\n\n// ============================================================================\n// DATA CHUNKING\n// ============================================================================\n\n/**\n * Splits data into chunks for memory management\n */\nexport function chunkData<TData extends DataRecord>(\n data: TData[],\n chunkSize: number\n): TData[][] {\n const chunks: TData[][] = [];\n for (let i = 0; i < data.length; i += chunkSize) {\n chunks.push(data.slice(i, i + chunkSize));\n }\n return chunks;\n}\n\n/**\n * Manages data chunks with LRU cache\n */\nexport class DataChunkManager<TData extends DataRecord> {\n private chunks: Map<number, TData[]> = new Map();\n private accessOrder: number[] = [];\n private maxChunks: number;\n private chunkSize: number;\n\n constructor(config: ChunkingConfig) {\n this.maxChunks = config.maxChunksInMemory;\n this.chunkSize = config.chunkSize;\n }\n\n getChunk(chunkIndex: number, allData: TData[]): TData[] {\n // Check if chunk is already in memory\n if (this.chunks.has(chunkIndex)) {\n this.updateAccessOrder(chunkIndex);\n return this.chunks.get(chunkIndex)!;\n }\n\n // Calculate chunk bounds\n const startIndex = chunkIndex * this.chunkSize;\n const endIndex = Math.min(startIndex + this.chunkSize, allData.length);\n const chunk = allData.slice(startIndex, endIndex);\n\n // Add chunk to memory\n this.addChunk(chunkIndex, chunk);\n return chunk;\n }\n\n private addChunk(chunkIndex: number, chunk: TData[]): void {\n // Remove oldest chunk if at capacity\n if (this.chunks.size >= this.maxChunks && !this.chunks.has(chunkIndex)) {\n const oldestChunk = this.accessOrder.shift();\n if (oldestChunk !== undefined) {\n this.chunks.delete(oldestChunk);\n }\n }\n\n this.chunks.set(chunkIndex, chunk);\n this.updateAccessOrder(chunkIndex);\n }\n\n private updateAccessOrder(chunkIndex: number): void {\n const existingIndex = this.accessOrder.indexOf(chunkIndex);\n if (existingIndex > -1) {\n this.accessOrder.splice(existingIndex, 1);\n }\n this.accessOrder.push(chunkIndex);\n }\n\n clear(): void {\n this.chunks.clear();\n this.accessOrder = [];\n }\n\n getMemoryUsage(): number {\n let totalSize = 0;\n for (const chunk of this.chunks.values()) {\n totalSize += JSON.stringify(chunk).length;\n }\n return totalSize / (1024 * 1024); // Convert to MB\n }\n}\n\n// ============================================================================\n// SEARCH INDEXING\n// ============================================================================\n\n/**\n * Creates a search index for fast text searching\n */\nexport class SearchIndex<TData extends DataRecord> {\n private index: Map<string, Set<number>> = new Map();\n private data: TData[] = [];\n private indexedFields: string[];\n private fuzzySearch: boolean;\n private fuzzyThreshold: number;\n\n constructor(config: SearchIndexConfig) {\n this.indexedFields = config.indexedFields;\n this.fuzzySearch = config.fuzzySearch ?? false;\n this.fuzzyThreshold = config.fuzzyThreshold ?? 0.6;\n }\n\n buildIndex(data: TData[]): void {\n this.data = data;\n this.index.clear();\n\n data.forEach((row, rowIndex) => {\n this.indexedFields.forEach(field => {\n const value = this.getNestedValue(row, field);\n if (value != null) {\n const searchableText = String(value).toLowerCase();\n const words = this.tokenize(searchableText);\n \n words.forEach(word => {\n if (!this.index.has(word)) {\n this.index.set(word, new Set());\n }\n this.index.get(word)!.add(rowIndex);\n });\n }\n });\n });\n }\n\n search(query: string): number[] {\n if (!query.trim()) return [];\n\n const searchTerms = this.tokenize(query.toLowerCase());\n const matchingSets: Set<number>[] = [];\n\n searchTerms.forEach(term => {\n const matches = new Set<number>();\n \n // Exact matches\n if (this.index.has(term)) {\n this.index.get(term)!.forEach(index => matches.add(index));\n }\n\n // Fuzzy matches\n if (this.fuzzySearch) {\n for (const [indexedTerm, indices] of this.index.entries()) {\n if (this.calculateSimilarity(term, indexedTerm) >= this.fuzzyThreshold) {\n indices.forEach(index => matches.add(index));\n }\n }\n }\n\n matchingSets.push(matches);\n });\n\n // Find intersection of all matching sets\n if (matchingSets.length === 0) return [];\n \n let result = matchingSets[0];\n for (let i = 1; i < matchingSets.length; i++) {\n result = new Set([...result].filter(x => matchingSets[i].has(x)));\n }\n\n return Array.from(result);\n }\n\n private getNestedValue(obj: unknown, path: string): unknown {\n return path.split('.').reduce((current: unknown, key: string) => {\n if (current && typeof current === 'object' && key in current) {\n return (current as Record<string, unknown>)[key];\n }\n return undefined;\n }, obj);\n }\n\n private tokenize(text: string): string[] {\n return text\n .replace(/[^\\w\\s]/g, ' ')\n .split(/\\s+/)\n .filter(word => word.length > 0);\n }\n\n private calculateSimilarity(str1: string, str2: string): number {\n const longer = str1.length > str2.length ? str1 : str2;\n const shorter = str1.length > str2.length ? str2 : str1;\n \n if (longer.length === 0) return 1.0;\n \n const editDistance = this.levenshteinDistance(longer, shorter);\n return (longer.length - editDistance) / longer.length;\n }\n\n private levenshteinDistance(str1: string, str2: string): number {\n const matrix = Array(str2.length + 1).fill(null).map(() => \n Array(str1.length + 1).fill(null)\n );\n\n for (let i = 0; i <= str1.length; i++) matrix[0][i] = i;\n for (let j = 0; j <= str2.length; j++) matrix[j][0] = j;\n\n for (let j = 1; j <= str2.length; j++) {\n for (let i = 1; i <= str1.length; i++) {\n const substitutionCost = str1[i - 1] === str2[j - 1] ? 0 : 1;\n matrix[j][i] = Math.min(\n matrix[j][i - 1] + 1, // insertion\n matrix[j - 1][i] + 1, // deletion\n matrix[j - 1][i - 1] + substitutionCost // substitution\n );\n }\n }\n\n return matrix[str2.length][str1.length];\n }\n}\n\n\n// ============================================================================\n// DEBOUNCE UTILITIES\n// ============================================================================\n\n/**\n * Creates a debounced function\n */\nexport function debounce<T extends (...args: unknown[]) => unknown>(\n func: T,\n delay: number\n): (...args: Parameters<T>) => void {\n let timeoutId: NodeJS.Timeout;\n \n return (...args: Parameters<T>) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => func(...args), delay);\n };\n}\n\n/**\n * Creates a throttled function\n */\nexport function throttle<T extends (...args: unknown[]) => unknown>(\n func: T,\n delay: number\n): (...args: Parameters<T>) => void {\n let lastCall = 0;\n \n return (...args: Parameters<T>) => {\n const now = Date.now();\n if (now - lastCall >= delay) {\n lastCall = now;\n func(...args);\n }\n };\n}\n\n// ============================================================================\n// MEMORY MANAGEMENT\n// ============================================================================\n\n/**\n * Intersection Observer for tracking visible rows\n */\nexport class VisibilityTracker {\n private observer: IntersectionObserver | null = null;\n private visibleElements = new Set<Element>();\n private callbacks = new Set<(visibleCount: number) => void>();\n\n constructor() {\n if (typeof IntersectionObserver !== 'undefined') {\n this.observer = new IntersectionObserver(\n (entries) => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n this.visibleElements.add(entry.target);\n } else {\n this.visibleElements.delete(entry.target);\n }\n });\n \n this.callbacks.forEach(callback => {\n callback(this.visibleElements.size);\n });\n },\n { threshold: 0.1 }\n );\n }\n }\n\n observe(element: Element): void {\n this.observer?.observe(element);\n }\n\n unobserve(element: Element): void {\n this.observer?.unobserve(element);\n this.visibleElements.delete(element);\n }\n\n onVisibilityChange(callback: (visibleCount: number) => void): () => void {\n this.callbacks.add(callback);\n return () => this.callbacks.delete(callback);\n }\n\n getVisibleCount(): number {\n return this.visibleElements.size;\n }\n\n destroy(): void {\n this.observer?.disconnect();\n this.visibleElements.clear();\n this.callbacks.clear();\n }\n} ","/**\n * @file Error Handling Stubs\n * @package @jmruthers/pace-core\n * @module Components/DataTable/Utils/Stubs\n * \n * Minimal stubs for removed error handling utilities.\n * This file exists only to prevent import errors in useDataTablePerformance.\n */\n\nexport interface FallbackConfig {\n enabled: boolean;\n}\n\nexport const DEFAULT_FALLBACK_CONFIG: FallbackConfig = {\n enabled: false\n};\n\nexport enum DataTableErrorType {\n VIRTUALIZATION = 'virtualization',\n SEARCH_INDEX = 'search_index',\n DATA_CHUNK = 'data_chunk',\n SERVER_FETCH = 'server_fetch',\n MEMORY = 'memory'\n}\n\n/**\n * Custom error class for DataTable operations.\n * Provides error type and recoverability information.\n */\nexport class DataTableError extends Error {\n constructor(\n message: string,\n public type: DataTableErrorType,\n public recoverable: boolean = true\n ) {\n super(message);\n this.name = 'DataTableError';\n }\n}\n\n/**\n * Error recovery manager for DataTable.\n * Handles error recovery strategies and error logging.\n */\nexport class ErrorRecoveryManager {\n constructor(private config: FallbackConfig) {}\n \n async handleError(error: DataTableError) {\n return { recovered: false, strategy: null };\n }\n \n clearErrorLog(): void {\n // Stub method\n }\n}\n\n/**\n * Memory monitor for DataTable.\n * Tracks memory usage and provides warnings when thresholds are exceeded.\n */\nexport class MemoryMonitor {\n constructor(private threshold: number = 100) {}\n \n getCurrentUsage(): number {\n return 0;\n }\n \n checkThreshold(): boolean {\n return true;\n }\n \n stopMonitoring(): void {\n // Stub method\n }\n}\n\nexport class CircuitBreaker {\n constructor() {}\n \n isOpen(): boolean {\n return false;\n }\n \n recordSuccess(): void {}\n \n recordFailure(): void {}\n \n reset(): void {}\n}\n\nexport function safeExecute<T>(fn: () => T, fallback: T): T {\n try {\n return fn();\n } catch {\n return fallback;\n }\n}\n\n","/**\n * @file DataTable Performance Hook\n * @package @jmruthers/pace-core\n * @module Hooks/DataTablePerformance\n * @since 0.3.0\n */\n\nimport { useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport type { \n DataRecord,\n PaginationMode,\n PerformanceConfig,\n ServerSideConfig,\n ServerSideParams,\n ServerSideResponse,\n ChunkingConfig,\n SearchIndexConfig,\n} from '../components/DataTable/types';\nimport {\n determinePaginationMode,\n getOptimalPageSizeOptions,\n DataChunkManager,\n SearchIndex,\n debounce,\n VisibilityTracker\n} from '../components/DataTable/utils/performanceUtils';\nimport {\n ErrorRecoveryManager,\n DataTableError,\n DataTableErrorType,\n safeExecute,\n MemoryMonitor,\n CircuitBreaker,\n DEFAULT_FALLBACK_CONFIG,\n type FallbackConfig\n} from '../components/DataTable/utils/errorHandling';\nimport { logger } from '../utils/core/logger';\n\nexport interface UseDataTablePerformanceOptions<TData extends DataRecord> {\n data: TData[];\n performance?: PerformanceConfig;\n serverSide?: ServerSideConfig<TData>;\n chunking?: ChunkingConfig;\n searchIndex?: SearchIndexConfig;\n // Enhanced error handling options\n fallbackConfig?: FallbackConfig;\n onError?: (error: DataTableError) => void;\n enableErrorRecovery?: boolean;\n}\n\nexport interface UseDataTablePerformanceReturn<TData extends DataRecord> {\n // Performance state\n paginationMode: PaginationMode;\n isVirtualized: boolean;\n pageSizeOptions: number[];\n \n // Data management\n processedData: TData[];\n totalCount: number;\n isLoading: boolean;\n \n // Search functionality\n searchQuery: string;\n setSearchQuery: (query: string) => void;\n searchResults: number[];\n \n // Server-side functionality\n fetchServerData: (params: ServerSideParams) => Promise<void>;\n serverData: ServerSideResponse<TData> | null;\n \n // Performance monitoring\n memoryUsage: number;\n \n // Error handling and recovery\n errorState: {\n hasErrors: boolean;\n errorCount: number;\n lastError: DataTableError | null;\n fallbacksActive: string[];\n };\n retryLastOperation: () => Promise<void>;\n clearErrors: () => void;\n \n // Cleanup\n cleanup: () => void;\n}\n\n/**\n * Hook for managing DataTable performance optimizations\n */\nexport function useDataTablePerformance<TData extends DataRecord>({\n data,\n performance = {},\n serverSide,\n chunking,\n searchIndex,\n fallbackConfig = DEFAULT_FALLBACK_CONFIG,\n onError,\n enableErrorRecovery = true\n}: UseDataTablePerformanceOptions<TData>): UseDataTablePerformanceReturn<TData> {\n // ============================================================================\n // STATE MANAGEMENT\n // ============================================================================\n \n const [isLoading, setIsLoading] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [searchResults, setSearchResults] = useState<number[]>([]);\n const [serverData, setServerData] = useState<ServerSideResponse<TData> | null>(null);\n const [memoryUsage, setMemoryUsage] = useState(0);\n \n // Error handling state\n const [errorState, setErrorState] = useState({\n hasErrors: false,\n errorCount: 0,\n lastError: null as DataTableError | null,\n fallbacksActive: [] as string[],\n });\n const [lastFailedOperation, setLastFailedOperation] = useState<(() => Promise<any>) | null>(null);\n\n // ============================================================================\n // REFS AND MANAGERS\n // ============================================================================\n \n const chunkManagerRef = useRef<DataChunkManager<TData> | null>(null);\n const searchIndexRef = useRef<SearchIndex<TData> | null>(null);\n const visibilityTrackerRef = useRef<VisibilityTracker | null>(null);\n \n // Error handling managers\n const errorRecoveryManagerRef = useRef<ErrorRecoveryManager>(new ErrorRecoveryManager(fallbackConfig));\n const memoryMonitorRef = useRef<MemoryMonitor | null>(null);\n const circuitBreakerRef = useRef<CircuitBreaker>(new CircuitBreaker());\n\n // ============================================================================\n // COMPUTED VALUES\n // ============================================================================\n \n const paginationMode = useMemo(() => {\n // CRITICAL FIX: Only use 'server' mode if serverSide config is explicitly provided.\n // determinePaginationMode now never returns 'server' - it only returns 'client' or 'hybrid'.\n // This fixes pagination issues where large datasets would auto-detect 'server' mode\n // but have no serverSide config, causing pagination controls to break.\n if (serverSide) return 'server';\n return determinePaginationMode(data?.length || 0, performance.serverSideThreshold);\n }, [data?.length, performance.serverSideThreshold, serverSide]);\n\n // Virtualization is now handled internally by UnifiedTableBody\n const isVirtualized = false;\n\n const pageSizeOptions = useMemo(() => {\n return getOptimalPageSizeOptions(paginationMode, data?.length || 0);\n }, [paginationMode, data?.length]);\n\n // ============================================================================\n // DATA PROCESSING\n // ============================================================================\n \n const processedData = useMemo(() => {\n if (serverSide && serverData) {\n return serverData.data;\n }\n\n let filteredData = data;\n \n // Apply search filtering - ensure we don't exclude zero values\n if (searchQuery && searchResults.length > 0) {\n filteredData = searchResults.map(index => data[index]);\n }\n\n // Important: Ensure we don't accidentally filter out rows with zero values\n // This was causing \"no data\" issues when rows contained zero values in numeric columns\n // The filtering should be explicit, not implicit based on falsy values\n\n return filteredData;\n }, [data, serverData, searchQuery, searchResults, serverSide]);\n\n const totalCount = useMemo(() => {\n if (serverSide && serverData) {\n return serverData.totalCount;\n }\n return processedData?.length || 0;\n }, [serverData, processedData?.length, serverSide]);\n\n // ============================================================================\n // CHUNK MANAGEMENT\n // ============================================================================\n \n useEffect(() => {\n if (chunking && !chunkManagerRef.current) {\n chunkManagerRef.current = new DataChunkManager<TData>(chunking);\n }\n }, [chunking]);\n\n // ============================================================================\n // SEARCH INDEX MANAGEMENT\n // ============================================================================\n \n useEffect(() => {\n if (searchIndex && !searchIndexRef.current) {\n searchIndexRef.current = new SearchIndex<TData>(searchIndex);\n }\n\n if (searchIndexRef.current && data.length > 0) {\n searchIndexRef.current.buildIndex(data);\n }\n }, [searchIndex, data]);\n\n // Debounced search function\n const debouncedSearch = useCallback(\n debounce(((query: string) => {\n if (!searchIndexRef.current) return;\n \n if (!query.trim()) {\n setSearchResults([]);\n return;\n }\n\n const results = searchIndexRef.current.search(query);\n setSearchResults(results);\n }) as unknown as (...args: unknown[]) => unknown, performance.debounceSearch ?? 300) as (query: string) => void,\n [performance.debounceSearch]\n );\n\n // Handle search query changes\n useEffect(() => {\n debouncedSearch(searchQuery);\n }, [searchQuery, debouncedSearch]);\n\n // ============================================================================\n // SERVER-SIDE DATA FETCHING\n // ============================================================================\n \n const fetchServerData = useCallback(async (params: ServerSideParams) => {\n if (!serverSide) return;\n\n setIsLoading(true);\n try {\n const response = await serverSide.fetchData(params);\n setServerData(response);\n } catch (error) {\n logger.error('useDataTablePerformance', 'Failed to fetch server data:', error);\n } finally {\n setIsLoading(false);\n }\n }, [serverSide]);\n\n // ============================================================================\n // PERFORMANCE MONITORING\n // ============================================================================\n \n useEffect(() => {\n if (!visibilityTrackerRef.current) {\n visibilityTrackerRef.current = new VisibilityTracker();\n }\n\n const tracker = visibilityTrackerRef.current;\n const unsubscribe = tracker.onVisibilityChange((visibleCount) => {\n // Performance monitoring removed\n });\n\n return unsubscribe;\n }, [totalCount, isVirtualized, paginationMode]);\n\n // Update memory usage\n useEffect(() => {\n const updateMemoryUsage = () => {\n let usage = 0;\n \n if (chunkManagerRef.current) {\n usage += chunkManagerRef.current.getMemoryUsage();\n }\n \n // Add general memory estimation\n usage += (JSON.stringify(processedData || []).length) / (1024 * 1024);\n \n setMemoryUsage(usage);\n };\n\n updateMemoryUsage();\n \n // Only set up interval in non-test environments to prevent memory leaks during testing\n const interval = import.meta.env.MODE !== 'test' \n ? setInterval(updateMemoryUsage, 5000) \n : null;\n \n return () => {\n if (interval) {\n clearInterval(interval);\n }\n };\n }, [processedData]);\n\n // ============================================================================\n // ERROR HANDLING FUNCTIONS\n // ============================================================================\n \n const handleError = useCallback(async (error: DataTableError, operation?: () => Promise<any>) => {\n if (enableErrorRecovery) {\n try {\n const recovery = await errorRecoveryManagerRef.current.handleError(error);\n setErrorState(prev => ({\n hasErrors: true,\n errorCount: prev.errorCount + 1,\n lastError: error,\n fallbacksActive: [...prev.fallbacksActive, error.type],\n }));\n \n if (operation) {\n setLastFailedOperation(() => operation);\n }\n \n onError?.(error);\n return recovery;\n } catch (recoveryError) {\n logger.error('useDataTablePerformance', 'Error recovery failed:', recoveryError);\n }\n }\n throw error;\n }, [enableErrorRecovery, onError]);\n\n const retryLastOperation = useCallback(async () => {\n if (lastFailedOperation) {\n try {\n await lastFailedOperation();\n setLastFailedOperation(null);\n setErrorState(prev => ({ ...prev, hasErrors: false }));\n } catch (error) {\n logger.error('useDataTablePerformance', 'Retry failed:', error);\n }\n }\n }, [lastFailedOperation]);\n\n const clearErrors = useCallback(() => {\n setErrorState({\n hasErrors: false,\n errorCount: 0,\n lastError: null,\n fallbacksActive: [],\n });\n setLastFailedOperation(null);\n errorRecoveryManagerRef.current.clearErrorLog();\n }, []);\n\n // ============================================================================\n // CLEANUP\n // ============================================================================\n \n const cleanup = useCallback(() => {\n chunkManagerRef.current?.clear();\n visibilityTrackerRef.current?.destroy();\n memoryMonitorRef.current?.stopMonitoring();\n }, []);\n\n useEffect(() => {\n return cleanup;\n }, [cleanup]);\n\n // ============================================================================\n // RETURN VALUES\n // ============================================================================\n \n return {\n // Performance state\n paginationMode,\n isVirtualized,\n pageSizeOptions,\n \n // Data management\n processedData,\n totalCount,\n isLoading,\n \n // Search functionality\n searchQuery,\n setSearchQuery,\n searchResults,\n \n // Server-side functionality\n fetchServerData,\n serverData,\n \n // Performance monitoring\n memoryUsage,\n \n // Error handling and recovery\n errorState,\n retryLastOperation,\n clearErrors,\n \n // Cleanup\n cleanup\n };\n} "],"mappings":";;;;;AAWA,YAAY,WAAW;AAGvB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAE3B,IAAM,yBAAyB;AA0C/B,IAAM,gBAAgB,oBAAI,IAA2C;AAGrE,IAAI,cAAqB;AAAA,EACvB,QAAQ,CAAC;AACX;AAGA,IAAM,YAA2C,CAAC;AAelD,SAAS,SAAS,QAIf;AACD,gBAAc,QAAQ,aAAa,MAAM;AACzC,YAAU,QAAQ,CAAC,aAAa;AAC9B,aAAS,WAAW;AAAA,EACtB,CAAC;AACH;AAMA,SAAS,QAAQ;AACf,SAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,GAAG,CAAC;AAClD;AAMA,IAAM,mBAAmB,CAAC,YAAoB;AAC5C,MAAI,cAAc,IAAI,OAAO,GAAG;AAC9B;AAAA,EACF;AAEA,QAAM,UAAU,WAAW,MAAM;AAC/B,kBAAc,OAAO,OAAO;AAC5B,aAAS;AAAA,MACP,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,GAAG,kBAAkB;AAErB,gBAAc,IAAI,SAAS,OAAO;AACpC;AAQA,SAAS,QAAQ,OAAc,QAIrB;AACR,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,CAAC,OAAO,OAAQ,GAAG,MAAM,MAAM,EAAE,MAAM,GAAG,WAAW;AAAA,MAC/D;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ,MAAM,OAAO;AAAA,UAAI,CAAC,MACxB,EAAE,OAAO,OAAO,OAAO,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,MAAM,IAAI;AAAA,QAC1D;AAAA,MACF;AAAA,IAEF,KAAK,iBAAiB;AACpB,YAAM,EAAE,QAAQ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AC,CAAC;AAEL,EAAAA,WAAU,MAAM;AACd,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,CAAC;AAMZ,SAAO;AAAA;AAAA,IAEL;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,EACF;AACF;","names":["props","DataTableErrorType","useState","useEffect","useState","useEffect"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useEvents.ts","../src/components/ErrorBoundary/ErrorBoundaryContext.tsx","../src/components/ErrorBoundary/ErrorBoundary.tsx","../src/components/ErrorBoundary/index.ts","../src/components/PublicLayout/PublicPageProvider.tsx","../src/hooks/useAppConfig.ts","../src/hooks/useOrganisationSecurity.ts"],"sourcesContent":["/**\n * @file Event Hook\n * @package @jmruthers/pace-core\n * @module Hooks\n * @since 0.1.0\n *\n * Convenience hook for accessing event context.\n * This hook provides a simple interface for working with events.\n * \n * Note: This is a convenience wrapper around the EventService.\n * For better performance, consider using useEventService directly.\n */\n\nimport { useMemo, useRef } from 'react';\nimport { useEventService } from './services/useEventService';\nimport { Event } from '../types/event';\n\nexport interface EventContextType {\n events: Event[];\n selectedEvent: Event | null;\n isLoading: boolean;\n error: Error | null;\n setSelectedEvent: (event: Event | null) => void;\n refreshEvents: () => Promise<void>;\n clearEventSelection: () => Promise<void>;\n}\n\n/**\n * Hook to access event context\n * \n * @returns Event context with events, selected event, and helper methods\n * @throws {Error} If used outside EventServiceProvider\n * \n * @example\n * ```tsx\n * function MyComponent() {\n * const { events, selectedEvent, setSelectedEvent } = useEvents();\n * \n * return (\n * <div>\n * {events.map(event => (\n * <button key={event.id} onClick={() => setSelectedEvent(event)}>\n * {event.event_name}\n * </button>\n * ))}\n * </div>\n * );\n * }\n * ```\n */\nexport function useEvents(): EventContextType {\n const eventService = useEventService();\n\n // Get current state - service subscription will trigger re-renders when state changes\n const rawEvents = eventService.getEvents();\n const selectedEvent = eventService.getSelectedEvent();\n const isLoading = eventService.isLoading();\n const error = eventService.getError();\n\n // Use refs to track previous values and only create new array reference when events actually change\n const prevEventsRef = useRef<Event[]>([]);\n const prevEventsIdsRef = useRef<string>('');\n \n // Compare event IDs to detect actual changes (more efficient than deep comparison)\n // Do this outside useMemo to avoid dependency on rawEvents array\n const currentEventsIds = rawEvents.map(e => e.event_id || e.id).join(',');\n const eventsChanged = currentEventsIds !== prevEventsIdsRef.current;\n \n // Only create new array reference when events actually changed\n // Update refs synchronously, then memoize based on the ID string\n if (eventsChanged) {\n prevEventsRef.current = rawEvents;\n prevEventsIdsRef.current = currentEventsIds;\n }\n \n // Return stable array reference - only changes when event IDs change\n const events = useMemo(() => {\n return prevEventsRef.current;\n }, [currentEventsIds]);\n\n // Memoize callbacks to prevent unnecessary re-renders in child components\n const setSelectedEventCallback = useMemo(\n () => (event: Event | null) => eventService.setSelectedEvent(event),\n [eventService]\n );\n const refreshEventsCallback = useMemo(\n () => () => eventService.refreshEvents(),\n [eventService]\n );\n const clearEventSelectionCallback = useMemo(\n () => () => eventService.clearEventSelection(),\n [eventService]\n );\n\n // Memoize the return object - only recreate when actual values change\n return useMemo(() => ({\n events,\n selectedEvent,\n isLoading,\n error,\n setSelectedEvent: setSelectedEventCallback,\n refreshEvents: refreshEventsCallback,\n clearEventSelection: clearEventSelectionCallback,\n }), [events, selectedEvent?.event_id, isLoading, error?.message, setSelectedEventCallback, refreshEventsCallback, clearEventSelectionCallback]);\n}\n\n","/**\n * @file Error Boundary Context\n * @package @jmruthers/pace-core\n * @module Components/ErrorBoundary\n * @since 0.6.2\n *\n * Context provider for global error handler configuration in ErrorBoundary components.\n * Allows applications to register a default error handler once, which is then used by\n * all ErrorBoundary instances unless overridden.\n *\n * @example\n * ```tsx\n * // Setup once in main.tsx\n * <ErrorBoundaryProvider\n * defaultErrorHandler={(error, errorInfo, errorId, componentName) => {\n * if (import.meta.env.DEV) {\n * console.error(`[${componentName}] ErrorBoundary caught error:`, error, errorInfo);\n * }\n * errorTracking.captureException(error, {\n * componentStack: errorInfo.componentStack,\n * errorBoundary: true,\n * errorId,\n * componentName,\n * });\n * }}\n * >\n * <App />\n * </ErrorBoundaryProvider>\n *\n * // Usage - no onError needed, uses global handler\n * <ErrorBoundary componentName=\"AppRoot\">\n * <AppContent />\n * </ErrorBoundary>\n * ```\n */\n\nimport React, { createContext, useContext, ReactNode } from 'react';\n\n/**\n * Type definition for the global error handler function\n * @public\n */\nexport type GlobalErrorHandler = (\n error: Error,\n errorInfo: React.ErrorInfo,\n errorId: string,\n componentName: string\n) => void;\n\n/**\n * Context value type for ErrorBoundary configuration\n * @internal\n */\ninterface ErrorBoundaryContextType {\n /** Global error handler that will be used by all ErrorBoundary instances */\n defaultErrorHandler?: GlobalErrorHandler;\n}\n\n/**\n * Context for ErrorBoundary global configuration\n * @internal\n */\nconst ErrorBoundaryContext = createContext<ErrorBoundaryContextType | undefined>(undefined);\n\n/**\n * Props for ErrorBoundaryProvider component\n * @public\n */\nexport interface ErrorBoundaryProviderProps {\n /** Children to wrap with the provider */\n children: ReactNode;\n /** Global error handler that will be used by all ErrorBoundary instances unless overridden */\n defaultErrorHandler?: GlobalErrorHandler;\n}\n\n/**\n * Provider component for ErrorBoundary global error handler configuration\n * \n * Wrap your application with this provider to set a default error handler that will\n * be used by all ErrorBoundary instances unless they provide their own onError prop.\n * \n * @example\n * ```tsx\n * <ErrorBoundaryProvider\n * defaultErrorHandler={(error, errorInfo, errorId, componentName) => {\n * errorTracking.captureException(error, {\n * componentStack: errorInfo.componentStack,\n * errorBoundary: true,\n * errorId,\n * componentName,\n * });\n * }}\n * >\n * <App />\n * </ErrorBoundaryProvider>\n * ```\n * \n * @public\n */\n/**\n * Error boundary provider component.\n * Provides global error handling configuration to child ErrorBoundary components.\n * \n * @param props - Error boundary provider configuration\n * @returns The error boundary provider\n */\nexport function ErrorBoundaryProvider({\n children,\n defaultErrorHandler,\n}: ErrorBoundaryProviderProps) {\n const contextValue: ErrorBoundaryContextType = {\n defaultErrorHandler,\n };\n\n return (\n <ErrorBoundaryContext.Provider value={contextValue}>\n {children}\n </ErrorBoundaryContext.Provider>\n );\n}\n\n/**\n * Hook to access ErrorBoundary context\n * @internal\n */\nexport function useErrorBoundaryContext(): ErrorBoundaryContextType | undefined {\n return useContext(ErrorBoundaryContext);\n}\n\n","/**\n * @file Error Boundary Component\n * @package @jmruthers/pace-core\n * @module Components/ErrorBoundary\n * @since 0.1.0\n *\n * A comprehensive error boundary component that catches JavaScript errors in child components\n * and provides fallback UI with retry functionality and error reporting.\n *\n * Features:\n * - Catches JavaScript errors in component tree\n * - Custom fallback UI with retry functionality\n * - Error reporting and logging\n * - Performance monitoring integration\n * - Retry mechanism with configurable attempts\n * - Development mode error details\n * - Accessibility compliant error display\n * - Component-specific error tracking\n * - Error ID generation for tracking\n *\n * @example\n * ```tsx\n * // Basic error boundary\n * <ErrorBoundary>\n * <MyComponent />\n * </ErrorBoundary>\n * \n * // Using global error handler (recommended for applications)\n * import { ErrorBoundaryProvider, ErrorBoundary } from '@jmruthers/pace-core';\n * \n * // Setup once in main.tsx\n * <ErrorBoundaryProvider\n * defaultErrorHandler={(error, errorInfo, errorId, componentName) => {\n * if (import.meta.env.DEV) {\n * console.error(`[${componentName}] ErrorBoundary caught error:`, error, errorInfo);\n * }\n * errorTracking.captureException(error, {\n * componentStack: errorInfo.componentStack,\n * errorBoundary: true,\n * errorId,\n * componentName,\n * });\n * }}\n * >\n * <App />\n * </ErrorBoundaryProvider>\n * \n * // Then use ErrorBoundary without onError prop - uses global handler\n * <ErrorBoundary componentName=\"AppRoot\">\n * <AppContent />\n * </ErrorBoundary>\n * \n * // Error boundary with custom fallback\n * <ErrorBoundary\n * componentName=\"UserProfile\"\n * fallback={<section>Something went wrong loading the profile.</section>}\n * onError={(error, errorInfo, errorId) => {\n * console.log('Error caught:', errorId, error);\n * }}\n * >\n * <UserProfile />\n * </ErrorBoundary>\n * \n * // Error boundary with retry functionality\n * <ErrorBoundary\n * componentName=\"DataTable\"\n * maxRetries={3}\n * enableRetry={true}\n * enableReporting={true}\n * onError={(error, errorInfo, errorId) => {\n * // Send to error reporting service\n * errorReportingService.report({ error, errorInfo, errorId });\n * }}\n * >\n * <DataTable data={data} />\n * </ErrorBoundary>\n * \n * // Wrapping multiple components\n * <ErrorBoundary componentName=\"App\">\n * <Header />\n * <ErrorBoundary componentName=\"MainContent\">\n * <MainContent />\n * </ErrorBoundary>\n * <Footer />\n * </ErrorBoundary>\n * \n * // Per-instance onError overrides global handler\n * <ErrorBoundary \n * componentName=\"SpecialCase\"\n * onError={(error, errorInfo, errorId) => {\n * // Custom handling for this specific case - global handler won't be called\n * }}\n * >\n * <SpecialComponent />\n * </ErrorBoundary>\n * ```\n *\n * @accessibility\n * - WCAG 2.1 AA compliant\n * - Proper ARIA role=\"alert\" for error announcements\n * - Screen reader friendly error messages\n * - Keyboard accessible retry buttons\n * - High contrast error styling\n * - Clear error identification\n *\n * @performance\n * - Efficient error state management\n * - Performance monitoring integration\n * - Minimal impact on normal rendering\n * - Configurable error reporting\n *\n * @dependencies\n * - React 19+ - Component lifecycle\n * - Performance monitoring utilities\n * - Tailwind CSS - Styling\n */\n\nimport React, { Component, ReactNode } from 'react';\nimport { performanceBudgetMonitor } from '../../utils/performance/performanceBudgets';\nimport { logger } from '../../utils/core/logger';\n\n/**\n * State interface for the ErrorBoundary component\n * @public\n */\nexport interface ErrorBoundaryState {\n /** Whether an error has been caught */\n hasError: boolean;\n /** The error that was caught */\n error?: Error;\n /** Additional error information from React */\n errorInfo?: React.ErrorInfo;\n /** Unique identifier for the error */\n errorId?: string;\n /** Number of retry attempts made */\n retryCount: number;\n}\n\n/**\n * Props interface for the ErrorBoundary component\n * @public\n */\nexport interface ErrorBoundaryProps {\n /** Child components to wrap with error boundary */\n children: ReactNode;\n /** Name of the component for error reporting */\n componentName?: string;\n /** Custom fallback UI to display when error occurs */\n fallback?: ReactNode;\n /** Callback function called when an error is caught */\n onError?: (error: Error, errorInfo: React.ErrorInfo, errorId: string) => void;\n /** Maximum number of retry attempts */\n maxRetries?: number;\n /** Whether to enable retry functionality */\n enableRetry?: boolean;\n /** Whether to enable error reporting */\n enableReporting?: boolean;\n /** Internal: Global error handler from context (not part of public API) */\n _globalErrorHandler?: (error: Error, errorInfo: React.ErrorInfo, errorId: string, componentName: string) => void;\n}\n\n/**\n * ErrorBoundary component\n * Catches JavaScript errors in child components and provides fallback UI\n * \n * @example\n * ```tsx\n * <ErrorBoundary\n * componentName=\"MyComponent\"\n * maxRetries={3}\n * onError={(error, errorInfo, errorId) => {\n * console.log('Error caught:', errorId);\n * }}\n * >\n * <MyComponent />\n * </ErrorBoundary>\n * ```\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n private retryTimeoutId: NodeJS.Timeout | null = null;\n\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { \n hasError: false, \n retryCount: 0 \n };\n }\n\n static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState> {\n const errorId = `error_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n return { \n hasError: true, \n error,\n errorId \n };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n const { componentName = 'Unknown Component', onError, enableReporting = true } = this.props;\n const errorId = this.state.errorId!;\n const componentNameForHandler = componentName || 'Unknown Component';\n \n this.setState({ errorInfo });\n \n // Enhanced logging with component name and error ID\n logger.error('ErrorBoundary', `[${componentNameForHandler}] Caught error ${errorId}:`, error, errorInfo);\n \n // Performance monitoring - track error occurrence\n performanceBudgetMonitor.measure('ERROR_BOUNDARY_TRIGGER', 1, {\n componentName: componentNameForHandler,\n errorId,\n errorMessage: error.message,\n stack: error.stack?.substring(0, 200), // Truncated stack trace\n });\n\n // Report error if enabled\n if (enableReporting) {\n this.reportError(errorId, componentNameForHandler);\n }\n \n // Call error handler: prefer prop onError, fall back to global handler from props\n if (onError) {\n onError(error, errorInfo, errorId);\n } else if (this.props._globalErrorHandler) {\n this.props._globalErrorHandler(error, errorInfo, errorId, componentNameForHandler);\n }\n }\n\n private reportError = (errorId: string, componentName: string) => {\n // In production, this would send to error reporting service\n if (import.meta.env.MODE === 'production') {\n // Example: Send to error reporting service\n // errorReportingService.report({ error, errorInfo, errorId, componentName });\n logger.warn('ErrorBoundary', 'Error reporting would be triggered in production:', { errorId, componentName });\n }\n };\n\n private handleRetry = () => {\n const { maxRetries = 3 } = this.props;\n const { retryCount } = this.state;\n\n if (retryCount < maxRetries) {\n logger.debug('ErrorBoundary', `Retrying component render (attempt ${retryCount + 1}/${maxRetries})`);\n \n this.setState(prevState => ({\n hasError: false,\n error: undefined,\n errorInfo: undefined,\n errorId: undefined,\n retryCount: prevState.retryCount + 1\n }));\n }\n };\n\n componentWillUnmount() {\n if (this.retryTimeoutId) {\n clearTimeout(this.retryTimeoutId);\n }\n }\n\n render() {\n if (this.state.hasError) {\n const { \n componentName = 'Component', \n fallback, \n enableRetry = true, \n maxRetries = 3 \n } = this.props;\n const { retryCount, errorId } = this.state;\n\n // Use custom fallback if provided\n if (fallback) {\n return fallback;\n }\n\n // Enhanced error UI with retry functionality\n return (\n <div \n role=\"alert\" \n className=\"p-6 bg-destructive/10 border border-destructive/20 rounded-lg\"\n data-error-boundary={errorId}\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"flex-shrink-0\">\n <svg className=\"w-5 h-5 text-destructive\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"text-destructive\">\n Error in {componentName}\n </h3>\n <p className=\"text-destructive/80\">\n {this.state.error?.message || 'An unexpected error occurred.'}\n </p>\n \n {enableRetry && retryCount < maxRetries && (\n <div className=\"flex gap-3 mb-4\">\n <button\n onClick={this.handleRetry}\n className=\"px-4 py-2 bg-destructive text-destructive-foreground rounded-md hover:bg-destructive/90 transition-colors text-sm font-medium\"\n >\n Retry ({retryCount + 1}/{maxRetries})\n </button>\n <button\n onClick={() => window.location.reload()}\n className=\"px-4 py-2 bg-sec-600 text-main-50 rounded-md hover:bg-sec-700 transition-colors text-sm font-medium\"\n >\n Reload Page\n </button>\n </div>\n )}\n\n {retryCount >= maxRetries && (\n <div className=\"mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md\">\n <p className=\"text-acc-800\">\n Maximum retry attempts reached. Please reload the page or contact support.\n </p>\n <button\n onClick={() => window.location.reload()}\n className=\"mt-2 px-3 py-1 bg-acc-600 text-main-50 rounded text-sm hover:bg-acc-700\"\n >\n Reload Page\n </button>\n </div>\n )}\n\n {import.meta.env.MODE === 'development' && this.state.error && (\n <details className=\"text-sm text-destructive/70\">\n <summary className=\"cursor-pointer font-medium mb-2\">\n Error Details (Development)\n </summary>\n <div className=\"bg-destructive/5 p-3 rounded border\">\n <p className=\"font-mono\">Error ID: {errorId}</p>\n <pre className=\"whitespace-pre-wrap text-xs overflow-auto max-h-32\">\n {this.state.error.toString()}\n {this.state.errorInfo?.componentStack}\n </pre>\n </div>\n </details>\n )}\n </div>\n </div>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n","/**\n * @file Error Boundary exports\n */\n\n// Re-export ErrorBoundary with automatic context support\nimport { ErrorBoundary as ErrorBoundaryClass } from './ErrorBoundary';\nimport { useErrorBoundaryContext } from './ErrorBoundaryContext';\nimport React from 'react';\nimport type { ErrorBoundaryProps } from './ErrorBoundary';\n\n// Export types and provider\nexport type { ErrorBoundaryProps, ErrorBoundaryState } from './ErrorBoundary';\nexport { ErrorBoundaryProvider } from './ErrorBoundaryContext';\nexport type { ErrorBoundaryProviderProps, GlobalErrorHandler } from './ErrorBoundaryContext';\n\n/**\n * ErrorBoundary component with automatic context support\n * This wrapper automatically uses the global error handler from ErrorBoundaryProvider\n * if no onError prop is provided.\n */\nexport const ErrorBoundary = React.forwardRef<\n ErrorBoundaryClass,\n Omit<ErrorBoundaryProps, '_globalErrorHandler'>\n>((props, ref) => {\n const context = useErrorBoundaryContext();\n const globalErrorHandler = context?.defaultErrorHandler;\n \n return React.createElement(ErrorBoundaryClass, { ...props, ref, _globalErrorHandler: globalErrorHandler });\n});\n\nErrorBoundary.displayName = 'ErrorBoundary';\n\nexport default ErrorBoundary;\n","/**\n * @file Public Page Provider\n * @package @jmruthers/pace-core\n * @module Components/PublicLayout\n * @since 1.0.0\n *\n * A completely isolated provider for public pages that doesn't trigger\n * any authentication context. This ensures public pages work independently\n * of the main application's authentication system.\n *\n * Features:\n * - No authentication required\n * - No organisation context\n * - No event context\n * - Completely isolated from main app context\n * - Environment variable access for public data\n * - Error boundary integration\n *\n * @example\n * ```tsx\n * import { PublicPageProvider } from '@jmruthers/pace-core';\n * \n * const APP_NAME = 'CORE';\n * \n * function PublicApp() {\n * return (\n * <PublicPageProvider appName={APP_NAME}>\n * <Routes>\n * <Route path=\"/events/:eventCode/recipe-grid-report\" element={<PublicRecipePage />} />\n * </Routes>\n * </PublicPageProvider>\n * );\n * }\n * ```\n */\n\nimport React, { createContext, useContext, ReactNode, useMemo } from 'react';\nimport { createClient } from '@supabase/supabase-js';\nimport type { Database } from '../../types/database';\nimport { ErrorBoundary } from '../ErrorBoundary';\nimport { logger } from '../../utils/core/logger';\n\ninterface PublicPageContextType {\n isPublicPage: true;\n supabase: ReturnType<typeof createClient<Database>> | null;\n appName: string | null;\n environment: {\n supabaseUrl: string | null;\n supabaseKey: string | null;\n };\n}\n\n/**\n * Context for public pages.\n * Provides isolated context for public pages without authentication requirements.\n */\nexport const PublicPageContext = createContext<PublicPageContextType | undefined>(undefined);\n\nexport interface PublicPageProviderProps {\n children: ReactNode;\n /** Application name for logo display and branding. Should match the APP_NAME constant used in App.tsx */\n appName?: string;\n}\n\n/**\n * Provider for public pages that completely isolates them from authentication context\n * \n * This provider:\n * - Does not initialize any authentication providers\n * - Provides environment variables for public data access\n * - Includes error boundary for graceful error handling\n * - Is completely separate from the main app context\n * - Provides appName for consistent logo display\n */\nexport function PublicPageProvider({ children, appName }: PublicPageProviderProps) {\n // Get environment variables for public data access\n // Handle both Vite (import.meta.env) and Node.js (process.env) environments\n const getEnvVar = (key: string): string | undefined => {\n // Check Vite environment first (browser)\n if (typeof import.meta !== 'undefined' && import.meta.env) {\n const env = import.meta.env as Record<string, string | undefined>;\n return env[key];\n }\n // Check Node.js environment (server-side)\n if (typeof process !== 'undefined' && process.env) {\n return process.env[key];\n }\n return undefined;\n };\n\n const supabaseUrl = getEnvVar('VITE_SUPABASE_URL') || \n getEnvVar('NEXT_PUBLIC_SUPABASE_URL') || \n null;\n \n const supabaseKey = getEnvVar('VITE_SUPABASE_PUBLISHABLE_KEY') || \n getEnvVar('NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY') ||\n getEnvVar('VITE_SUPABASE_ANON_KEY') ||\n getEnvVar('NEXT_PUBLIC_SUPABASE_ANON_KEY') || \n null;\n\n // Create Supabase client if environment variables are available\n // Note: VITE_SUPABASE_PUBLISHABLE_KEY should be your publishable key (sb_publishable_...)\n const supabase = useMemo(() => {\n if (!supabaseUrl || !supabaseKey) {\n logger.warn('PublicPageProvider', 'Missing Supabase environment variables. Please ensure VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY are set in your environment.');\n return null;\n }\n const client = createClient<Database>(supabaseUrl, supabaseKey);\n return client;\n }, [supabaseUrl, supabaseKey]);\n\n const contextValue: PublicPageContextType = {\n isPublicPage: true,\n supabase,\n appName: appName || null,\n environment: {\n supabaseUrl,\n supabaseKey\n }\n };\n\n return (\n <PublicPageContext.Provider value={contextValue}>\n <ErrorBoundary componentName=\"PublicPageProvider\">\n {children}\n </ErrorBoundary>\n </PublicPageContext.Provider>\n );\n}\n\n/**\n * Hook to access public page context\n * \n * @returns Public page context with environment variables\n */\nexport function usePublicPageContext(): PublicPageContextType {\n const context = useContext(PublicPageContext);\n \n if (!context) {\n throw new Error('usePublicPageContext must be used within a PublicPageProvider');\n }\n \n return context;\n}\n\n/**\n * Hook to check if we're in a public page context\n * \n * @returns True if we're in a public page context\n */\nexport function useIsPublicPage(): boolean {\n const context = useContext(PublicPageContext);\n return context !== undefined;\n}\n","/**\n * @file useAppConfig Hook\n * @package @jmruthers/pace-core\n * @module Hooks/useAppConfig\n * @since 0.4.0\n *\n * Hook for accessing app name and loading state.\n * \n * NOTE: Scope configuration (requires_event) is now page-level only (rbac_app_pages.scope_type).\n * Use getPageScopeType() to determine if a specific page requires event or organisation context.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { appName, isLoading } = useAppConfig();\n * \n * if (isLoading) return <div>Loading...</div>;\n * \n * return <div>App: {appName}</div>;\n * }\n * ```\n */\n\nimport { useMemo, useContext } from 'react';\nimport { useUnifiedAuth } from '../providers/services/UnifiedAuthProvider';\nimport { useIsPublicPage, PublicPageContext } from '../components/PublicLayout/PublicPageProvider';\n\nexport interface UseAppConfigReturn {\n appName: string;\n isLoading: boolean;\n}\n\n/**\n * Hook to access app configuration\n * Works in both authenticated and public contexts\n * @returns App configuration and loading state\n */\nexport function useAppConfig(): UseAppConfigReturn {\n // Check if we're in a public page context first\n const isPublicPage = useIsPublicPage();\n \n // Try to get appName from PublicPageContext (access context directly to avoid hook rule violations)\n const publicPageContext = useContext(PublicPageContext);\n const hasPublicContext = publicPageContext !== undefined;\n const contextAppName = publicPageContext?.appName || null;\n const getNodeEnvVar = (key: string): string | undefined =>\n typeof process !== 'undefined' && process.env ? process.env[key] : undefined;\n \n if (isPublicPage) {\n const getAppName = (): string => {\n // When tests mock public mode without the provider, default to PACE\n if (!hasPublicContext) {\n return 'PACE';\n }\n \n // Priority 1: Use appName from PublicPageContext (passed from App.tsx)\n if (contextAppName) {\n return contextAppName;\n }\n \n // Priority 2: Check environment variables\n if (typeof import.meta !== 'undefined' && (import.meta as any).env) {\n const env = (import.meta as any).env;\n return env.VITE_APP_NAME || \n env.NEXT_PUBLIC_APP_NAME || \n 'PACE';\n }\n if (typeof import.meta !== 'undefined' && import.meta.env) {\n return import.meta.env.VITE_APP_NAME || \n import.meta.env.NEXT_PUBLIC_APP_NAME || \n 'PACE';\n }\n \n const nodeEnvAppName =\n getNodeEnvVar('VITE_APP_NAME') ||\n getNodeEnvVar('NEXT_PUBLIC_APP_NAME');\n if (nodeEnvAppName) {\n return nodeEnvAppName;\n }\n \n // Priority 3: Default fallback\n return 'PACE';\n };\n \n return useMemo(() => ({\n appName: getAppName(),\n isLoading: false\n }), [contextAppName, hasPublicContext]);\n }\n \n // For authenticated pages, use UnifiedAuthProvider\n try {\n const { appName } = useUnifiedAuth();\n return useMemo(() => ({\n appName,\n isLoading: false\n }), [appName]);\n } catch (error) {\n // Fallback if UnifiedAuthProvider is not available\n return useMemo(() => ({\n appName: contextAppName ||\n getNodeEnvVar('VITE_APP_NAME') ||\n getNodeEnvVar('NEXT_PUBLIC_APP_NAME') ||\n 'PACE',\n isLoading: false\n }), [contextAppName]);\n }\n} ","/**\n * @file Organisation Security Hook\n * @package @jmruthers/pace-core\n * @module Hooks/OrganisationSecurity\n * @since 0.4.0\n *\n * Security-focused hook for organisation access validation and super admin functionality.\n * Provides utilities for validating user access to organisations and checking permissions.\n */\n\nimport { useCallback, useMemo, useEffect, useState } from 'react';\nimport { useUnifiedAuth } from '../providers';\nimport { useOrganisations } from './useOrganisations';\n// Legacy useRBAC hook removed - use new RBAC system instead\nimport type { OrganisationSecurityError, SuperAdminContext } from '../types/organisation';\nimport type { Permission } from '../rbac/types';\nimport { logger } from '../utils/core/logger';\n\n/**\n * Organisation security hook interface.\n * Provides security utilities for organisation access validation and super admin functionality.\n */\nexport interface OrganisationSecurityHook {\n // Super admin context\n superAdminContext: SuperAdminContext;\n \n // Access validation\n validateOrganisationAccess: (orgId: string) => Promise<boolean>;\n hasMinimumRole: (minRole: string, orgId?: string) => boolean;\n canAccessChildOrganisations: (orgId?: string) => boolean;\n \n // Permission checks\n hasPermission: (permission: string, orgId?: string) => Promise<boolean>;\n getUserPermissions: (orgId?: string) => Promise<string[]>;\n \n // Audit logging\n logOrganisationAccess: (action: string, details?: Record<string, unknown>) => Promise<void>;\n \n // Security utilities\n ensureOrganisationAccess: (orgId: string) => Promise<void>;\n validateUserAccess: (userId: string, orgId: string) => Promise<boolean>;\n}\n\nexport const useOrganisationSecurity = (): OrganisationSecurityHook => {\n const { user, session, supabase } = useUnifiedAuth();\n const { selectedOrganisation, getUserRole, validateOrganisationAccess: validateAccess } = useOrganisations();\n \n // Super admin status - query database for security (user_metadata can be spoofed)\n const [isSuperAdmin, setIsSuperAdmin] = useState<boolean>(false);\n const [isCheckingSuperAdmin, setIsCheckingSuperAdmin] = useState(false);\n\n // Check super admin status from database\n useEffect(() => {\n if (!user || !session || !supabase) {\n setIsSuperAdmin(false);\n return;\n }\n\n const checkSuperAdmin = async () => {\n setIsCheckingSuperAdmin(true);\n try {\n const now = new Date().toISOString();\n const { data, error } = await supabase\n .from('rbac_global_roles')\n .select('role')\n .eq('user_id', user.id)\n .eq('role', 'super_admin')\n .lte('valid_from', now)\n .or(`valid_to.is.null,valid_to.gte.${now}`)\n .limit(1);\n\n setIsSuperAdmin(!error && data && data.length > 0);\n } catch (error) {\n logger.error('useOrganisationSecurity', 'Error checking super admin status:', error);\n setIsSuperAdmin(false);\n } finally {\n setIsCheckingSuperAdmin(false);\n }\n };\n\n checkSuperAdmin();\n }, [user, session, supabase]);\n\n // Super admin context\n const superAdminContext = useMemo((): SuperAdminContext => {\n return {\n isSuperAdmin,\n hasGlobalAccess: isSuperAdmin,\n canManageAllOrganisations: isSuperAdmin\n };\n }, [isSuperAdmin]);\n\n // Validate organisation access with database check\n const validateOrganisationAccess = useCallback(async (orgId: string): Promise<boolean> => {\n if (!user || !session || !supabase) return false;\n \n try {\n // Super admin has access to all organisations\n if (superAdminContext.isSuperAdmin) {\n return true;\n }\n\n // Check organisation membership using consolidated rbac_organisation_roles table\n const { data, error } = await supabase\n .from('rbac_organisation_roles')\n .select('id')\n .eq('user_id', user.id)\n .eq('organisation_id', orgId)\n .eq('status', 'active')\n .is('revoked_at', null)\n .in('role', ['org_admin', 'leader', 'member']) // Only actual members, not supporters\n .single();\n\n if (error) {\n logger.error('useOrganisationSecurity', 'Error validating organisation access:', error);\n return false;\n }\n\n return !!data;\n } catch (error) {\n logger.error('useOrganisationSecurity', 'Exception validating organisation access:', error);\n return false;\n }\n }, [user, session, supabase, superAdminContext.isSuperAdmin]);\n\n // Check if user has minimum role\n const hasMinimumRole = useCallback((minRole: string, orgId?: string): boolean => {\n // Super admin has all roles\n if (superAdminContext.isSuperAdmin) {\n return true;\n }\n\n const targetOrgId = orgId || selectedOrganisation?.id;\n if (!targetOrgId) return false;\n\n const userRole = getUserRole(targetOrgId);\n const roleHierarchy = ['supporter', 'member', 'leader', 'org_admin'];\n \n const userRoleIndex = roleHierarchy.indexOf(userRole);\n const minRoleIndex = roleHierarchy.indexOf(minRole);\n \n return userRoleIndex >= minRoleIndex;\n }, [selectedOrganisation, getUserRole, superAdminContext.isSuperAdmin]);\n\n // Check if user can access child organisations\n const canAccessChildOrganisations = useCallback((orgId?: string): boolean => {\n // Super admin can access all organisations\n if (superAdminContext.isSuperAdmin) {\n return true;\n }\n\n const targetOrgId = orgId || selectedOrganisation?.id;\n if (!targetOrgId) return false;\n\n const userRole = getUserRole(targetOrgId);\n return userRole === 'org_admin';\n }, [selectedOrganisation, getUserRole, superAdminContext.isSuperAdmin]);\n\n // Check specific permission using the new RBAC system\n const hasPermission = useCallback(async (permission: string, orgId?: string): Promise<boolean> => {\n // Super admin has all permissions\n if (superAdminContext.isSuperAdmin) {\n return true;\n }\n\n const targetOrgId = orgId || selectedOrganisation?.id;\n if (!targetOrgId || !user) return false;\n\n try {\n // Use the new RBAC system with caching\n const { isPermittedCached } = await import('../rbac/api');\n \n const scope = {\n organisationId: targetOrgId,\n eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,\n appId: user.user_metadata?.appId || user.app_metadata?.appId,\n };\n\n return await isPermittedCached({\n userId: user.id,\n scope,\n permission: permission as Permission\n });\n } catch (error) {\n logger.error('useOrganisationSecurity', 'Exception checking permission:', error);\n return false;\n }\n }, [selectedOrganisation, user, superAdminContext.isSuperAdmin]);\n\n // Get user's permissions for organisation using the new RBAC system\n const getUserPermissions = useCallback(async (orgId?: string): Promise<string[]> => {\n // Super admin has all permissions\n if (superAdminContext.isSuperAdmin) {\n return ['*']; // All permissions\n }\n\n const targetOrgId = orgId || selectedOrganisation?.id;\n if (!targetOrgId || !user) return [];\n\n try {\n // Use the new RBAC system\n const { getPermissionMap } = await import('../rbac/api');\n \n const scope = {\n organisationId: targetOrgId,\n eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,\n appId: user.user_metadata?.appId || user.app_metadata?.appId,\n };\n\n const permissionMap = await getPermissionMap({\n userId: user.id,\n scope\n });\n \n // Flatten all permissions from all pages\n const allPermissions = Object.entries(permissionMap)\n .filter(([, allowed]) => allowed)\n .map(([permission]) => permission);\n return [...new Set(allPermissions)]; // Remove duplicates\n } catch (error) {\n logger.error('useOrganisationSecurity', 'Exception getting user permissions:', error);\n return [];\n }\n }, [selectedOrganisation, user, getUserRole, superAdminContext.isSuperAdmin]);\n\n // Log organisation access for audit using the new RBAC audit system\n const logOrganisationAccess = useCallback(async (action: string, details?: Record<string, unknown>): Promise<void> => {\n if (!user || !selectedOrganisation) return;\n\n try {\n // Use the new RBAC audit system - only if we have a valid organisation ID\n if (selectedOrganisation.id) {\n const { emitAuditEvent } = await import('../rbac/audit');\n \n await emitAuditEvent({\n type: 'permission_check',\n userId: user.id,\n organisationId: selectedOrganisation.id,\n permission: action,\n decision: true, // Assume access was granted if we're logging it\n source: 'api',\n duration_ms: 0, // No actual permission check performed here\n metadata: details || {}\n });\n }\n } catch (error) {\n logger.error('useOrganisationSecurity', 'Error logging organisation access:', error);\n }\n }, [user, selectedOrganisation]);\n\n // Ensure organisation access (throws if no access)\n const ensureOrganisationAccess = useCallback(async (orgId: string): Promise<void> => {\n const hasAccess = await validateOrganisationAccess(orgId);\n \n if (!hasAccess) {\n const error = new Error(`User does not have access to organisation ${orgId}`) as OrganisationSecurityError;\n error.name = 'OrganisationSecurityError';\n error.code = 'ACCESS_DENIED';\n error.organisationId = orgId;\n error.userId = user?.id;\n throw error;\n }\n }, [validateOrganisationAccess, user]);\n\n // Validate user access (for admin functions)\n const validateUserAccess = useCallback(async (userId: string, orgId: string): Promise<boolean> => {\n if (!supabase) return false;\n\n try {\n // Super admin can validate any user\n if (superAdminContext.isSuperAdmin) {\n return true;\n }\n\n // Regular users can only validate their own access\n if (userId !== user?.id) {\n return false;\n }\n\n return await validateOrganisationAccess(orgId);\n } catch (error) {\n logger.error('useOrganisationSecurity', 'Exception validating user access:', error);\n return false;\n }\n }, [supabase, superAdminContext.isSuperAdmin, user, validateOrganisationAccess]);\n\n return {\n superAdminContext,\n validateOrganisationAccess,\n hasMinimumRole,\n canAccessChildOrganisations,\n hasPermission,\n getUserPermissions,\n logOrganisationAccess,\n ensureOrganisationAccess,\n validateUserAccess\n };\n}; "],"mappings":";;;;;;;;;;;;;AAaA,SAAS,SAAS,cAAc;AAqCzB,SAAS,YAA8B;AAC5C,QAAM,eAAe,gBAAgB;AAGrC,QAAM,YAAY,aAAa,UAAU;AACzC,QAAM,gBAAgB,aAAa,iBAAiB;AACpD,QAAM,YAAY,aAAa,UAAU;AACzC,QAAM,QAAQ,aAAa,SAAS;AAGpC,QAAM,gBAAgB,OAAgB,CAAC,CAAC;AACxC,QAAM,mBAAmB,OAAe,EAAE;AAI1C,QAAM,mBAAmB,UAAU,IAAI,OAAK,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,GAAG;AACxE,Q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AG,CAAC,UAAU,kBAAkB,cAAc,MAAM,0BAA0B,CAAC;AAE/E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["jsx","React","ErrorBoundary","createContext","useContext","useMemo","jsx","createContext","useMemo","ErrorBoundary","useContext","useMemo","useContext","useContext","useMemo","useMemo","useMemo"]}
|