@jmruthers/pace-core 0.6.8 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/audit-tool/audits/02-project-structure.cjs +38 -35
  3. package/dist/{DataTable-6RMSCQJ6.js → DataTable-SOAFXIWY.js} +1 -1
  4. package/dist/{chunk-EURB7QFZ.js → chunk-5HNSDQWH.js} +3 -3
  5. package/dist/{chunk-IUBRCBSY.js → chunk-C7ZQ5O4C.js} +11 -5
  6. package/dist/{chunk-NKHKXPI4.js → chunk-J2U36LHD.js} +65 -2
  7. package/dist/components.js +4 -4
  8. package/dist/{database.generated-CcnC_DRc.d.ts → database.generated-DT8JTZiP.d.ts} +12 -12
  9. package/dist/hooks.d.ts +3 -3
  10. package/dist/index.d.ts +4 -4
  11. package/dist/index.js +4 -4
  12. package/dist/rbac/index.d.ts +1 -1
  13. package/dist/{timezone-BZe_eUxx.d.ts → timezone-0AyangqX.d.ts} +1 -1
  14. package/dist/types.d.ts +1 -1
  15. package/dist/{usePublicRouteParams-MamNgwqe.d.ts → usePublicRouteParams-DQLrDqDb.d.ts} +1 -1
  16. package/dist/utils.d.ts +3 -3
  17. package/dist/utils.js +3 -3
  18. package/docs/api/modules.md +1 -1
  19. package/docs/api-reference/rpc-functions.md +3 -3
  20. package/docs/implementation-guides/data-tables.md +66 -0
  21. package/package.json +1 -1
  22. package/src/components/DataTable/__tests__/DataTable.select-label-display.test.tsx +483 -0
  23. package/src/components/DataTable/hooks/__tests__/useTableColumns.test.ts +224 -0
  24. package/src/components/DataTable/hooks/useTableColumns.ts +23 -1
  25. package/src/components/DataTable/utils/__tests__/selectFieldUtils.test.ts +207 -0
  26. package/src/components/DataTable/utils/index.ts +1 -0
  27. package/src/components/DataTable/utils/selectFieldUtils.ts +134 -0
  28. package/src/components/UserMenu/UserMenu.tsx +3 -5
  29. package/src/types/database.generated.ts +9 -9
  30. package/src/utils/supabase/createBaseClient.ts +25 -7
package/CHANGELOG.md CHANGED
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+ - **DataTable: Automatic label display for select fields** - Select fields with `fieldType: 'select'` and `fieldOptions` now automatically display labels (e.g., "Mobile") instead of raw values (e.g., `1`) in read mode. This eliminates the need for custom cell renderers for common select field patterns. The feature supports simple options, grouped options, type coercion, and gracefully falls back to raw values when labels aren't found. Custom cell renderers are preserved if already defined.
12
+
10
13
  ### Breaking Changes
11
14
  - **@supabase/supabase-js is now an included dependency (security enforcement)**: Moved from peer dependency to included dependency to enforce security rules. Consuming apps can no longer import `createClient` directly.
12
15
  - **Action Required**:
@@ -127,6 +127,8 @@ function checkImportPaths(consumingAppPath) {
127
127
 
128
128
  /**
129
129
  * Check test file colocation
130
+ * Only flags tests that are in the wrong location (e.g., in __tests__/ when they should be colocated).
131
+ * Does not flag missing test files - use test coverage tools for that.
130
132
  */
131
133
  function checkTestColocation(consumingAppPath) {
132
134
  const issues = [];
@@ -136,9 +138,9 @@ function checkTestColocation(consumingAppPath) {
136
138
  return issues;
137
139
  }
138
140
 
139
- // Find all source files
140
- const sourceFiles = [];
141
- function findFiles(dir) {
141
+ // Find all test files
142
+ const testFiles = [];
143
+ function findTestFiles(dir) {
142
144
  if (!fs.existsSync(dir)) return;
143
145
 
144
146
  const files = fs.readdirSync(dir);
@@ -148,47 +150,48 @@ function checkTestColocation(consumingAppPath) {
148
150
 
149
151
  if (stat.isDirectory()) {
150
152
  if (!['node_modules', 'dist', 'build', '.git'].includes(file)) {
151
- findFiles(filePath);
153
+ findTestFiles(filePath);
152
154
  }
153
- } else if (/\.(ts|tsx|js|jsx)$/.test(file) && !file.includes('.test.') && !file.includes('.spec.')) {
154
- sourceFiles.push(filePath);
155
+ } else if (/\.(ts|tsx|js|jsx)$/.test(file) && (file.includes('.test.') || file.includes('.spec.'))) {
156
+ testFiles.push(filePath);
155
157
  }
156
158
  });
157
159
  }
158
160
 
159
- findFiles(srcDir);
161
+ findTestFiles(srcDir);
160
162
 
161
- // Check if test files are colocated
162
- sourceFiles.forEach(sourceFile => {
163
- const dir = path.dirname(sourceFile);
164
- const basename = path.basename(sourceFile, path.extname(sourceFile));
165
- const ext = path.extname(sourceFile);
163
+ // Check if test files are in the wrong location
164
+ testFiles.forEach(testFile => {
165
+ const testDir = path.dirname(testFile);
166
+ const testBasename = path.basename(testFile);
166
167
 
167
- // Look for test file
168
- const testFile = path.join(dir, `${basename}.test${ext}`);
169
- const testFileTsx = path.join(dir, `${basename}.test.tsx`);
168
+ // Extract the source file name from the test file name
169
+ // e.g., "Component.test.tsx" -> "Component.tsx"
170
+ const sourceBasename = testBasename.replace(/\.(test|spec)\./, '.');
171
+ const sourceFile = path.join(testDir, sourceBasename);
170
172
 
171
- // Skip if it's a test file itself or if test file exists
172
- if (fileExists(testFile) || fileExists(testFileTsx)) {
173
- return;
174
- }
175
-
176
- // Check if file is in a test directory (acceptable alternative)
177
- if (dir.includes('/__tests__/') || dir.includes('/tests/')) {
178
- return;
179
- }
173
+ // Check if test is in a __tests__ or tests directory
174
+ const isInTestDirectory = testDir.includes('/__tests__/') || testDir.includes('/tests/') ||
175
+ testDir.endsWith('/__tests__') || testDir.endsWith('/tests');
180
176
 
181
- // For components, hooks, and utils, suggest colocation
182
- if (dir.includes('/components/') || dir.includes('/hooks/') || dir.includes('/utils/')) {
183
- const relativePath = getRelativePath(sourceFile, consumingAppPath);
184
- issues.push({
185
- type: 'testColocation',
186
- file: relativePath,
187
- line: 1,
188
- message: `Test file not colocated with source file. Consider creating ${path.basename(testFile)}`,
189
- severity: 'info',
190
- fix: `Create test file: ${path.basename(testFile)} in the same directory`,
191
- });
177
+ // If test is in a test directory, check if the source file exists in the parent directory
178
+ if (isInTestDirectory) {
179
+ // Get the parent directory (should be where the source file is)
180
+ const parentDir = path.dirname(testDir);
181
+ const expectedSourceFile = path.join(parentDir, sourceBasename);
182
+
183
+ // If source file exists in parent, flag that test should be colocated
184
+ if (fileExists(expectedSourceFile)) {
185
+ const relativePath = getRelativePath(testFile, consumingAppPath);
186
+ issues.push({
187
+ type: 'testColocation',
188
+ file: relativePath,
189
+ line: 1,
190
+ message: `Test file is in a test directory but should be colocated with source file. Move to ${parentDir}`,
191
+ severity: 'warning',
192
+ fix: `Move test file to ${parentDir} to colocate with source file`,
193
+ });
194
+ }
192
195
  }
193
196
  });
194
197
 
@@ -1,4 +1,4 @@
1
- export { ActionButtons, BulkOperationsDropdown, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, LoadingState, PaginationControls, SortIndicator, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, exportToCSV, exportToCSVWithTableRows, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, validateHierarchicalData, validatePaginationConfig } from './chunk-NKHKXPI4.js';
1
+ export { ActionButtons, BulkOperationsDropdown, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, LoadingState, PaginationControls, SortIndicator, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, exportToCSV, exportToCSVWithTableRows, findSelectLabel, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, validateHierarchicalData, validatePaginationConfig } from './chunk-J2U36LHD.js';
2
2
  import './chunk-GS5672WG.js';
3
3
  export { CircuitBreaker, DEFAULT_FALLBACK_CONFIG, DataChunkManager, DataTableError, DataTableErrorType, ErrorRecoveryManager, MemoryMonitor, SearchIndex, VisibilityTracker, chunkData, debounce, determinePaginationMode, getOptimalPageSizeOptions, safeExecute, throttle, useDataTablePerformance } from './chunk-S7DKJPLT.js';
4
4
  import './chunk-EF2UGZWY.js';
@@ -1,5 +1,5 @@
1
1
  import { AccessDenied } from './chunk-S6ZQKDY6.js';
2
- import { Input, Dialog, DialogContent, DialogHeader, DialogBody, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Alert, AlertDescription, Label, SelectLabel, SelectSeparator, DialogTitle, deriveFormKey, useSessionDraft, filterSensitiveFields, isSensitiveField, SelectGroup, AlertTitle, Progress } from './chunk-NKHKXPI4.js';
2
+ import { Input, Dialog, DialogContent, DialogHeader, DialogBody, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Alert, AlertDescription, Label, SelectLabel, SelectSeparator, DialogTitle, deriveFormKey, useSessionDraft, filterSensitiveFields, isSensitiveField, SelectGroup, AlertTitle, Progress } from './chunk-J2U36LHD.js';
3
3
  import { Button, useRBAC, useResolvedScope, usePermissions, useEvents, useCan } from './chunk-GS5672WG.js';
4
4
  import { useAddressAutocomplete, createFileReferenceService, uploadFileWithReference, usePublicFileDisplay, useFileDisplay, getPublicUrl, getSignedUrl, generateFileUrlsBatch, useEventTheme, usePreventTabReload } from './chunk-MPBLMWVR.js';
5
5
  import { clearPalette } from './chunk-5W2A3DRC.js';
@@ -2961,11 +2961,11 @@ var UserMenu = React6__default.memo(function UserMenu2({
2961
2961
  /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
2962
2962
  ] }) }),
2963
2963
  /* @__PURE__ */ jsxs(SelectContent, { children: [
2964
- /* @__PURE__ */ jsx(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs("li", { className: "pt-2", children: [
2964
+ /* @__PURE__ */ jsxs(SelectLabel, { className: "font-normal pt-2", children: [
2965
2965
  userInfo.displayName,
2966
2966
  /* @__PURE__ */ jsx("br", {}),
2967
2967
  /* @__PURE__ */ jsx("small", { children: userInfo.email })
2968
- ] }) }),
2968
+ ] }),
2969
2969
  /* @__PURE__ */ jsx(SelectSeparator, {}),
2970
2970
  /* @__PURE__ */ jsxs(
2971
2971
  SelectItem,
@@ -283,12 +283,12 @@ var ALLOWED_FILE_PATTERNS = [
283
283
  /[\/\\]src[\/\\]supabase\.(tsx?|jsx?)(\?|:|\s|$)/i
284
284
  ];
285
285
  function isAllowedContext() {
286
- if (typeof process !== "undefined" && true) {
287
- return true;
288
- }
286
+ const isProduction = typeof process !== "undefined" && true || typeof import.meta !== "undefined" && import.meta.env?.MODE === "production" || typeof import.meta !== "undefined" && import.meta.env?.PROD === true;
289
287
  try {
290
288
  const stack = new Error().stack;
291
- if (!stack) return false;
289
+ if (!stack) {
290
+ return isProduction;
291
+ }
292
292
  const stackLines = stack.split("\n");
293
293
  for (const line of stackLines) {
294
294
  for (const pattern of ALLOWED_FILE_PATTERNS) {
@@ -297,9 +297,15 @@ function isAllowedContext() {
297
297
  }
298
298
  }
299
299
  }
300
+ const hasMinifiedFiles = stackLines.some(
301
+ (line) => /index-[a-zA-Z0-9]+\.js/i.test(line) || /assets\/index-[a-zA-Z0-9]+\.js/i.test(line)
302
+ );
303
+ if (hasMinifiedFiles || isProduction) {
304
+ return true;
305
+ }
300
306
  return false;
301
307
  } catch {
302
- return true;
308
+ return isProduction;
303
309
  }
304
310
  }
305
311
  function createBaseClient(supabaseUrl, supabaseKey) {
@@ -7142,6 +7142,62 @@ var ColumnFactory = class {
7142
7142
  }
7143
7143
  };
7144
7144
 
7145
+ // src/components/DataTable/utils/selectFieldUtils.ts
7146
+ function findSelectLabel(value, fieldOptions) {
7147
+ if (!fieldOptions || fieldOptions.length === 0) {
7148
+ return null;
7149
+ }
7150
+ if (value === null || value === void 0) {
7151
+ return null;
7152
+ }
7153
+ const normalizedValue = typeof value === "string" && !isNaN(Number(value)) && value.trim() !== "" ? Number(value) : value;
7154
+ for (const option of fieldOptions) {
7155
+ if ("type" in option && option.type === "separator") {
7156
+ continue;
7157
+ }
7158
+ if ("value" in option && !("type" in option)) {
7159
+ const optionValue = option.value;
7160
+ if (optionValue === normalizedValue) {
7161
+ return option.label;
7162
+ }
7163
+ if (typeof optionValue === "number" && typeof normalizedValue === "string") {
7164
+ const numValue = Number(normalizedValue);
7165
+ if (!isNaN(numValue) && optionValue === numValue) {
7166
+ return option.label;
7167
+ }
7168
+ }
7169
+ if (typeof optionValue === "string" && typeof normalizedValue === "number") {
7170
+ const numValue = Number(optionValue);
7171
+ if (!isNaN(numValue) && numValue === normalizedValue) {
7172
+ return option.label;
7173
+ }
7174
+ }
7175
+ }
7176
+ if ("type" in option && option.type === "group") {
7177
+ const groupOption = option;
7178
+ for (const item of groupOption.items) {
7179
+ const itemValue = item.value;
7180
+ if (itemValue === normalizedValue) {
7181
+ return item.label;
7182
+ }
7183
+ if (typeof itemValue === "number" && typeof normalizedValue === "string") {
7184
+ const numValue = Number(normalizedValue);
7185
+ if (!isNaN(numValue) && itemValue === numValue) {
7186
+ return item.label;
7187
+ }
7188
+ }
7189
+ if (typeof itemValue === "string" && typeof normalizedValue === "number") {
7190
+ const numValue = Number(itemValue);
7191
+ if (!isNaN(numValue) && numValue === normalizedValue) {
7192
+ return item.label;
7193
+ }
7194
+ }
7195
+ }
7196
+ }
7197
+ }
7198
+ return null;
7199
+ }
7200
+
7145
7201
  // src/components/DataTable/hooks/useTableColumns.ts
7146
7202
  function useTableColumns({
7147
7203
  columns,
@@ -7151,13 +7207,20 @@ function useTableColumns({
7151
7207
  }) {
7152
7208
  const enhancedColumns = useMemo(() => {
7153
7209
  const baseColumns = [...columns].map((column) => {
7210
+ const dataTableColumn = column;
7154
7211
  const baseColumn = {
7155
7212
  ...column,
7156
7213
  enableSorting: features.sorting && column.enableSorting !== false,
7157
7214
  enableColumnFilter: features.filtering && column.enableColumnFilter !== false,
7158
7215
  enableGrouping: features.grouping && column.enableGrouping !== false
7159
7216
  };
7160
- const dataTableColumn = column;
7217
+ if (dataTableColumn.fieldType === "select" && dataTableColumn.fieldOptions && dataTableColumn.fieldOptions.length > 0 && !baseColumn.cell) {
7218
+ baseColumn.cell = ({ getValue, row, column: col }) => {
7219
+ const value = getValue();
7220
+ const label = findSelectLabel(value, dataTableColumn.fieldOptions);
7221
+ return label !== null ? label : String(value ?? "");
7222
+ };
7223
+ }
7161
7224
  const isNumericColumn = column.meta?.type === "number" || dataTableColumn.fieldType === "number" || dataTableColumn.filterType === "number";
7162
7225
  const isDateColumn = column.meta?.type === "date" || dataTableColumn.fieldType === "date" || dataTableColumn.filterType === "date";
7163
7226
  if (isNumericColumn && !isDateColumn) {
@@ -8451,4 +8514,4 @@ function max(accessorKey) {
8451
8514
  };
8452
8515
  }
8453
8516
 
8454
- export { ActionButtons, Alert, AlertDescription, AlertTitle, BulkOperationsDropdown, Checkbox, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, Input, Label, LoadingState, PaginationControls, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SortIndicator, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, deriveFormKey, exportToCSV, exportToCSVWithTableRows, filterSensitiveFields, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, isSensitiveField, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, useSessionDraft, validateHierarchicalData, validatePaginationConfig };
8517
+ export { ActionButtons, Alert, AlertDescription, AlertTitle, BulkOperationsDropdown, Checkbox, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, Input, Label, LoadingState, PaginationControls, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SortIndicator, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, deriveFormKey, exportToCSV, exportToCSVWithTableRows, filterSensitiveFields, findSelectLabel, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, isSensitiveField, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, useSessionDraft, validateHierarchicalData, validatePaginationConfig };
@@ -1,8 +1,8 @@
1
- import { Calendar } from './chunk-EURB7QFZ.js';
2
- export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-EURB7QFZ.js';
1
+ import { Calendar } from './chunk-5HNSDQWH.js';
2
+ export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-5HNSDQWH.js';
3
3
  import './chunk-S6ZQKDY6.js';
4
- import { Label, Input } from './chunk-NKHKXPI4.js';
5
- export { Alert, AlertDescription, AlertTitle, Checkbox, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './chunk-NKHKXPI4.js';
4
+ import { Label, Input } from './chunk-J2U36LHD.js';
5
+ export { Alert, AlertDescription, AlertTitle, Checkbox, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './chunk-J2U36LHD.js';
6
6
  import { Button } from './chunk-GS5672WG.js';
7
7
  export { Button, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './chunk-GS5672WG.js';
8
8
  import './chunk-MPBLMWVR.js';
@@ -7726,6 +7726,18 @@ type Database = {
7726
7726
  Args: never;
7727
7727
  Returns: number;
7728
7728
  };
7729
+ data_app_resolve: {
7730
+ Args: {
7731
+ p_app_name: string;
7732
+ p_user_id?: string;
7733
+ };
7734
+ Returns: {
7735
+ app_id: string;
7736
+ app_name: string;
7737
+ has_access: boolean;
7738
+ is_active: boolean;
7739
+ }[];
7740
+ };
7729
7741
  data_cake_deliveries_list: {
7730
7742
  Args: {
7731
7743
  p_event_id: string;
@@ -9337,18 +9349,6 @@ type Database = {
9337
9349
  success: boolean;
9338
9350
  }[];
9339
9351
  };
9340
- util_app_resolve: {
9341
- Args: {
9342
- p_app_name: string;
9343
- p_user_id?: string;
9344
- };
9345
- Returns: {
9346
- app_id: string;
9347
- app_name: string;
9348
- has_access: boolean;
9349
- is_active: boolean;
9350
- }[];
9351
- };
9352
9352
  validate_base_question_options: {
9353
9353
  Args: {
9354
9354
  options: Json;
package/dist/hooks.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  export { u as useToast } from './useToast-AyaT-x7p.js';
2
- import { S as StorageUploadOptions, a as StorageUploadResult, b as StorageListOptions, c as StorageListResult, d as StorageFileInfo } from './usePublicRouteParams-MamNgwqe.js';
3
- export { O as OrganisationSecurityHook, l as UseAppConfigReturn, i as UseFormDialogOptions, j as UseFormDialogReturn, U as UseOrganisationPermissionsReturn, F as UsePublicEventLogoOptions, E as UsePublicEventLogoReturn, B as UsePublicEventOptions, A as UsePublicEventReturn, D as UsePublicFileDisplayOptions, C as UsePublicFileDisplayReturn, G as UsePublicRouteParamsReturn, n as clearPublicEventCache, q as clearPublicFileDisplayCache, t as clearPublicLogoCache, z as extractEventCodeFromPath, y as generatePublicRoutePath, o as getPublicEventCacheStats, r as getPublicFileDisplayCacheStats, v as getPublicLogoCacheStats, k as useAppConfig, u as useEventTheme, h as useFormDialog, e as useOrganisationPermissions, f as useOrganisationSecurity, m as usePublicEvent, x as usePublicEventCode, s as usePublicEventLogo, p as usePublicFileDisplay, w as usePublicRouteParams, g as useZodForm } from './usePublicRouteParams-MamNgwqe.js';
2
+ import { S as StorageUploadOptions, a as StorageUploadResult, b as StorageListOptions, c as StorageListResult, d as StorageFileInfo } from './usePublicRouteParams-DQLrDqDb.js';
3
+ export { O as OrganisationSecurityHook, l as UseAppConfigReturn, i as UseFormDialogOptions, j as UseFormDialogReturn, U as UseOrganisationPermissionsReturn, F as UsePublicEventLogoOptions, E as UsePublicEventLogoReturn, B as UsePublicEventOptions, A as UsePublicEventReturn, D as UsePublicFileDisplayOptions, C as UsePublicFileDisplayReturn, G as UsePublicRouteParamsReturn, n as clearPublicEventCache, q as clearPublicFileDisplayCache, t as clearPublicLogoCache, z as extractEventCodeFromPath, y as generatePublicRoutePath, o as getPublicEventCacheStats, r as getPublicFileDisplayCacheStats, v as getPublicLogoCacheStats, k as useAppConfig, u as useEventTheme, h as useFormDialog, e as useOrganisationPermissions, f as useOrganisationSecurity, m as usePublicEvent, x as usePublicEventCode, s as usePublicEventLogo, p as usePublicFileDisplay, w as usePublicRouteParams, g as useZodForm } from './usePublicRouteParams-DQLrDqDb.js';
4
4
  import * as React$1 from 'react';
5
5
  import { SortingState, ColumnFiltersState, ExpandedState } from '@tanstack/react-table';
6
6
  import { d as DataRecord, g as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, i as SearchIndexConfig, h as PaginationMode, k as ServerSideParams, l as ServerSideResponse, A as AutocompleteOptions, m as GooglePlaceAutocompletePrediction, P as ParsedAddress } from './types-DXstZpNI.js';
7
7
  export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
8
8
  import { SupabaseClient } from '@supabase/supabase-js';
9
- import { D as Database } from './database.generated-CcnC_DRc.js';
9
+ import { D as Database } from './database.generated-DT8JTZiP.js';
10
10
  import { F as FileCategory, a as FileReference } from './file-reference-BavO2eQj.js';
11
11
  import 'react-hook-form';
12
12
  import 'zod';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { a as UnifiedAuthContextType, d as UnifiedAuthProvider, c as UnifiedAuthProviderProps, U as UserEventAccess, u as useUnifiedAuth } from './UnifiedAuthProvider-CKvHP1MK.js';
2
- export { q as LogLevel, L as Logger, r as LoggerConfig, g as cn, l as createBaseClient, o as createLogger, f as createSecureDataAccess, e as emailSchema, A as formatCompactNumber, x as formatCurrency, t as formatDate, w as formatDateTime, B as formatFileSize, C as formatInTimeZone, y as formatNumber, z as formatPercent, v as formatTime, E as formatTimeInTimeZone, H as fromZonedTime, i as getAppConfig, k as getCurrentAppId, j as getCurrentAppName, J as getTimeZoneDifference, D as getTimezoneAbbreviation, F as getUserTimeZone, m as logger, n as nameSchema, b as passwordSchema, p as phoneSchema, I as roundToNearestMinutes, c as sanitizeFormData, d as sanitizeHtml, s as sanitizeUserInput, h as setAppConfig, G as toZonedTime, a as urlSchema, u as useSessionTracking } from './timezone-BZe_eUxx.js';
2
+ export { q as LogLevel, L as Logger, r as LoggerConfig, g as cn, l as createBaseClient, o as createLogger, f as createSecureDataAccess, e as emailSchema, A as formatCompactNumber, x as formatCurrency, t as formatDate, w as formatDateTime, B as formatFileSize, C as formatInTimeZone, y as formatNumber, z as formatPercent, v as formatTime, E as formatTimeInTimeZone, H as fromZonedTime, i as getAppConfig, k as getCurrentAppId, j as getCurrentAppName, J as getTimeZoneDifference, D as getTimezoneAbbreviation, F as getUserTimeZone, m as logger, n as nameSchema, b as passwordSchema, p as phoneSchema, I as roundToNearestMinutes, c as sanitizeFormData, d as sanitizeHtml, s as sanitizeUserInput, h as setAppConfig, G as toZonedTime, a as urlSchema, u as useSessionTracking } from './timezone-0AyangqX.js';
3
3
  import { j as EventService, k as OrganisationService, A as AuthService, l as InactivityService } from './AuthService-DmfO5rGS.js';
4
4
  export { c as EventServiceProvider, i as InactivityServiceProvider, f as OrganisationServiceProvider } from './AuthService-DmfO5rGS.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -16,8 +16,8 @@ export { D as DataTable, a as DataTableProps } from './DataTable-DRUIgtUH.js';
16
16
  import { d as DataRecord, a as DataTableAction, D as DataTableColumn } from './types-DXstZpNI.js';
17
17
  export { c as AggregateConfig, A as AutocompleteOptions, f as DataTableFeatureConfig, b as DataTableToolbarButton, E as EmptyStateConfig, j as ExportOptions, G as GetRowId, P as ParsedAddress } from './types-DXstZpNI.js';
18
18
  import { ColumnDef } from '@tanstack/react-table';
19
- import { H as FileSizeLimits, I as StorageConfig, S as StorageUploadOptions, J as StorageFileMetadata, a as StorageUploadResult, K as StorageUrlOptions, b as StorageListOptions, c as StorageListResult } from './usePublicRouteParams-MamNgwqe.js';
20
- export { d as StorageFileInfo, i as UseFormDialogOptions, j as UseFormDialogReturn, F as UsePublicEventLogoOptions, E as UsePublicEventLogoReturn, B as UsePublicEventOptions, A as UsePublicEventReturn, D as UsePublicFileDisplayOptions, C as UsePublicFileDisplayReturn, G as UsePublicRouteParamsReturn, n as clearPublicEventCache, q as clearPublicFileDisplayCache, t as clearPublicLogoCache, z as extractEventCodeFromPath, y as generatePublicRoutePath, o as getPublicEventCacheStats, r as getPublicFileDisplayCacheStats, v as getPublicLogoCacheStats, k as useAppConfig, u as useEventTheme, h as useFormDialog, e as useOrganisationPermissions, f as useOrganisationSecurity, m as usePublicEvent, x as usePublicEventCode, s as usePublicEventLogo, p as usePublicFileDisplay, w as usePublicRouteParams, g as useZodForm } from './usePublicRouteParams-MamNgwqe.js';
19
+ import { H as FileSizeLimits, I as StorageConfig, S as StorageUploadOptions, J as StorageFileMetadata, a as StorageUploadResult, K as StorageUrlOptions, b as StorageListOptions, c as StorageListResult } from './usePublicRouteParams-DQLrDqDb.js';
20
+ export { d as StorageFileInfo, i as UseFormDialogOptions, j as UseFormDialogReturn, F as UsePublicEventLogoOptions, E as UsePublicEventLogoReturn, B as UsePublicEventOptions, A as UsePublicEventReturn, D as UsePublicFileDisplayOptions, C as UsePublicFileDisplayReturn, G as UsePublicRouteParamsReturn, n as clearPublicEventCache, q as clearPublicFileDisplayCache, t as clearPublicLogoCache, z as extractEventCodeFromPath, y as generatePublicRoutePath, o as getPublicEventCacheStats, r as getPublicFileDisplayCacheStats, v as getPublicLogoCacheStats, k as useAppConfig, u as useEventTheme, h as useFormDialog, e as useOrganisationPermissions, f as useOrganisationSecurity, m as usePublicEvent, x as usePublicEventCode, s as usePublicEventLogo, p as usePublicFileDisplay, w as usePublicRouteParams, g as useZodForm } from './usePublicRouteParams-DQLrDqDb.js';
21
21
  export { z } from 'zod';
22
22
  export { F as FileCategory, b as FileMetadata, a as FileReference, c as FileUploadOptions } from './file-reference-BavO2eQj.js';
23
23
  import { SupabaseClient } from '@supabase/supabase-js';
@@ -25,7 +25,7 @@ export { StyleImport, getAllStylePaths, getStylePath, styleConfig } from './styl
25
25
  export { ColorPalette, ColorShade, PaletteData, applyPalette, clearPalette, parseAndNormalizeEventColours } from './theming/runtime.js';
26
26
  export { a as NavigationItem, N as NavigationMenuProps, b as NavigationMode } from './types-t9H8qKRw.js';
27
27
  import 'clsx';
28
- import './database.generated-CcnC_DRc.js';
28
+ import './database.generated-DT8JTZiP.js';
29
29
  import './core-CUElvH_C.js';
30
30
  import '@radix-ui/react-label';
31
31
  import '@radix-ui/react-checkbox';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { ALL_PERMISSIONS, EVENT_APP_PERMISSIONS, GLOBAL_PERMISSIONS, NavigationGuard, ORGANISATION_PERMISSIONS, PAGE_PERMISSIONS, PagePermissionGuard, RBACErrorCode, RPCFunction, checkRuntimeCompliance, createRBACExpressMiddleware, createRBACMiddleware, getCustomAuthCodeFixes, getDirectSupabaseAuthFixes, getDuplicateConfigFixes, getQuickFixes, getSetupIssues, getUnprotectedPageFixes, isRBACInitialized, isValidPermission, validateAndWarn, validateDatabaseConfiguration, validateRBACSetup, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from './chunk-Z2FNRKF3.js';
2
- export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, PasswordChangeForm, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-EURB7QFZ.js';
2
+ export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, PasswordChangeForm, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-5HNSDQWH.js';
3
3
  export { AccessDenied } from './chunk-S6ZQKDY6.js';
4
- import { Dialog, DialogContent, DialogHeader } from './chunk-NKHKXPI4.js';
5
- export { Alert, AlertDescription, AlertTitle, Checkbox, ColumnFactory, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, average, count, exportToCSV, exportToCSVWithTableRows, generateCSVContent, max, min, sum } from './chunk-NKHKXPI4.js';
4
+ import { Dialog, DialogContent, DialogHeader } from './chunk-J2U36LHD.js';
5
+ export { Alert, AlertDescription, AlertTitle, Checkbox, ColumnFactory, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, average, count, exportToCSV, exportToCSVWithTableRows, generateCSVContent, max, min, sum } from './chunk-J2U36LHD.js';
6
6
  import { Button } from './chunk-GS5672WG.js';
7
7
  export { Button, SECURE_CLIENT_SYMBOL, SecureSupabaseClient, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, createSecureClient, fromSupabaseClient, isSecureClient, useAccessLevel, useCan, useEvents, useMultiplePermissions, usePermissions, useRBAC, useResolvedScope, useResourcePermissions, useRoleManagement, useSecureSupabase, warnIfInsecureClient } from './chunk-GS5672WG.js';
8
8
  export { StorageUtils, clearPublicEventCache, clearPublicLogoCache, extractEventCodeFromPath, generatePublicRoutePath, getPublicEventCacheStats, getPublicLogoCacheStats, useFormDialog, useOrganisationPermissions, usePublicEvent, usePublicEventCode, usePublicEventLogo, usePublicRouteParams, useZodForm } from './chunk-4DDCYDQ3.js';
@@ -18,7 +18,7 @@ export { CACHE_PATTERNS, RBACCache, RBACEngine, clearInFlightRequests, createRBA
18
18
  export { RBACAuditManager, createAuditManager, emitAuditEvent, getGlobalAuditManager, setGlobalAuditManager } from './chunk-AHU7G2R5.js';
19
19
  export { FileCategory } from './chunk-6QYDGKQY.js';
20
20
  import './chunk-4SXLQIZO.js';
21
- export { createBaseClient, emailSchema, formatCompactNumber, formatCurrency, formatDate, formatDateTime, formatFileSize, formatNumber, formatPercent, formatTime, getAppConfig, getCurrentAppId, getCurrentAppName, nameSchema, passwordSchema, phoneSchema, sanitizeFormData, sanitizeUserInput, setAppConfig, urlSchema, useSessionTracking } from './chunk-IUBRCBSY.js';
21
+ export { createBaseClient, emailSchema, formatCompactNumber, formatCurrency, formatDate, formatDateTime, formatFileSize, formatNumber, formatPercent, formatTime, getAppConfig, getCurrentAppId, getCurrentAppName, nameSchema, passwordSchema, phoneSchema, sanitizeFormData, sanitizeUserInput, setAppConfig, urlSchema, useSessionTracking } from './chunk-C7ZQ5O4C.js';
22
22
  export { formatInTimeZone, formatTimeInTimeZone, fromZonedTime, getTimeZoneDifference, getTimezoneAbbreviation, getUserTimeZone, roundToNearestMinutes, toZonedTime } from './chunk-FEJLJNWA.js';
23
23
  export { LoadingSpinner, sanitizeHtml } from './chunk-A3W6LW53.js';
24
24
  import './chunk-OJ4SKRSV.js';
@@ -2,7 +2,7 @@ import { U as UUID, g as PermissionCacheKey, h as AuditEventSource, i as RBACAud
2
2
  export { E as EventAppRole, G as GlobalRole, I as InvalidScopeError, M as MissingUserContextError, O as Operation, e as OrganisationContextRequiredError, c as OrganisationRole, d as PermissionDeniedError, R as RBACError, f as RBACNotInitializedError } from '../types-BeoeWV5I.js';
3
3
  export { A as AccessLevelContext, s as AuditEventType, P as PermissionSource, d as RBACAccessValidateParams, e as RBACAccessValidateResult, q as RBACAuditLogParams, r as RBACAuditLogResult, t as RBACContext, w as RBACErrorCode, v as RBACFunctionResponse, f as RBACPageAccessCheckParams, R as RBACPermissionCheckParams, a as RBACPermissionCheckResult, b as RBACPermissionsGetParams, c as RBACPermissionsGetResult, u as RBACResult, g as RBACRoleGrantParams, h as RBACRoleGrantResult, i as RBACRoleRevokeParams, j as RBACRoleRevokeResult, m as RBACRoleValidateParams, n as RBACRoleValidateResult, k as RBACRolesListParams, l as RBACRolesListResult, o as RBACSessionTrackParams, p as RBACSessionTrackResult, x as RPCFunction, S as SessionType } from '../functions-lBy5L2ry.js';
4
4
  import { SupabaseClient } from '@supabase/supabase-js';
5
- import { D as Database } from '../database.generated-CcnC_DRc.js';
5
+ import { D as Database } from '../database.generated-DT8JTZiP.js';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import React__default from 'react';
8
8
  import { a as NavigationItem } from '../types-t9H8qKRw.js';
@@ -1,7 +1,7 @@
1
1
  import { SupabaseClient } from '@supabase/supabase-js';
2
2
  import { z } from 'zod';
3
3
  import { ClassValue } from 'clsx';
4
- import { D as Database } from './database.generated-CcnC_DRc.js';
4
+ import { D as Database } from './database.generated-DT8JTZiP.js';
5
5
 
6
6
  /**
7
7
  * Hook for manual session tracking (event switches and session expiration).
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export { E as Event, c as EventContextType, b as EventTheme, k as ORGANISATION_R
6
6
  export { g as BucketInfo, B as BulkUploadResult, F as FileCategory, b as FileMetadata, a as FileReference, d as FileReferenceService, f as FileReferenceWithUrl, c as FileUploadOptions, e as FileUploadResult, h as FileUrlInfo, S as StorageUploadOptions, U as UploadProgress } from './file-reference-BavO2eQj.js';
7
7
  export { C as ChangePasswordFormValues, o as ContactFormData, F as FormData, k as LoginFormData, L as LoginFormValues, P as ProfileFormData, m as RegistrationFormData, R as RegistrationFormValues, S as SecureLoginFormValues, j as SecureRegistrationFormValues, U as UserProfileFormValues, V as ValidationError, a as ValidationResult, g as changePasswordSchema, t as combineSchemas, i as contactFormSchema, d as dateSchema, e as emailSchema, l as loginSchema, n as nameSchema, f as passwordResetSchema, b as passwordSchema, p as phoneSchema, q as pickSchema, r as registrationSchema, c as secureLoginSchema, s as securePasswordSchema, u as urlSchema, h as userProfileSchema } from './validation-643vUDZW.js';
8
8
  import { SupabaseClient } from '@supabase/supabase-js';
9
- export { D as Database, J as Json } from './database.generated-CcnC_DRc.js';
9
+ export { D as Database, J as Json } from './database.generated-DT8JTZiP.js';
10
10
  export { A as AccessLevelContext, s as AuditEventType, P as PermissionSource, d as RBACAccessValidateParams, e as RBACAccessValidateResult, q as RBACAuditLogParams, r as RBACAuditLogResult, t as RBACContext, w as RBACErrorCode, v as RBACFunctionResponse, f as RBACPageAccessCheckParams, R as RBACPermissionCheckParams, a as RBACPermissionCheckResult, b as RBACPermissionsGetParams, c as RBACPermissionsGetResult, u as RBACResult, g as RBACRoleGrantParams, h as RBACRoleGrantResult, i as RBACRoleRevokeParams, j as RBACRoleRevokeResult, m as RBACRoleValidateParams, n as RBACRoleValidateResult, k as RBACRolesListParams, l as RBACRolesListResult, o as RBACSessionTrackParams, p as RBACSessionTrackResult, S as SessionType } from './functions-lBy5L2ry.js';
11
11
  import 'zod';
12
12
  import './types-BeoeWV5I.js';
@@ -2,7 +2,7 @@ import * as react_hook_form from 'react-hook-form';
2
2
  import { z } from 'zod';
3
3
  import { l as OrganisationRole, m as OrganisationPermission, S as SuperAdminContext, E as Event } from './event-CW5YB_2p.js';
4
4
  import { SupabaseClient } from '@supabase/supabase-js';
5
- import { D as Database } from './database.generated-CcnC_DRc.js';
5
+ import { D as Database } from './database.generated-DT8JTZiP.js';
6
6
  import { F as FileCategory, a as FileReference } from './file-reference-BavO2eQj.js';
7
7
 
8
8
  interface UseZodFormProps<T extends z.ZodTypeAny> {
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as SanitizationOptions } from './timezone-BZe_eUxx.js';
2
- export { Q as DateTimeFormatOptions, q as LogLevel, L as Logger, r as LoggerConfig, K as SecureDataAccess, V as calculatePasswordStrength, g as cn, l as createBaseClient, o as createLogger, U as dateSchema, e as emailSchema, A as formatCompactNumber, x as formatCurrency, t as formatDate, N as formatDateOnlyForDisplay, w as formatDateTime, M as formatDateTimeForDisplay, P as formatDateTimeForMap, O as formatDateTimeForTable, B as formatFileSize, C as formatInTimeZone, y as formatNumber, z as formatPercent, v as formatTime, E as formatTimeInTimeZone, H as fromZonedTime, i as getAppConfig, k as getCurrentAppId, J as getTimeZoneDifference, D as getTimezoneAbbreviation, F as getUserTimeZone, m as logger, n as nameSchema, b as passwordSchema, p as phoneSchema, T as renderSafeHtml, I as roundToNearestMinutes, c as sanitizeFormData, d as sanitizeHtml, s as sanitizeUserInput, h as setAppConfig, G as toZonedTime, a as urlSchema, u as useSessionTracking, R as validateHtml } from './timezone-BZe_eUxx.js';
1
+ import { S as SanitizationOptions } from './timezone-0AyangqX.js';
2
+ export { Q as DateTimeFormatOptions, q as LogLevel, L as Logger, r as LoggerConfig, K as SecureDataAccess, V as calculatePasswordStrength, g as cn, l as createBaseClient, o as createLogger, U as dateSchema, e as emailSchema, A as formatCompactNumber, x as formatCurrency, t as formatDate, N as formatDateOnlyForDisplay, w as formatDateTime, M as formatDateTimeForDisplay, P as formatDateTimeForMap, O as formatDateTimeForTable, B as formatFileSize, C as formatInTimeZone, y as formatNumber, z as formatPercent, v as formatTime, E as formatTimeInTimeZone, H as fromZonedTime, i as getAppConfig, k as getCurrentAppId, J as getTimeZoneDifference, D as getTimezoneAbbreviation, F as getUserTimeZone, m as logger, n as nameSchema, b as passwordSchema, p as phoneSchema, T as renderSafeHtml, I as roundToNearestMinutes, c as sanitizeFormData, d as sanitizeHtml, s as sanitizeUserInput, h as setAppConfig, G as toZonedTime, a as urlSchema, u as useSessionTracking, R as validateHtml } from './timezone-0AyangqX.js';
3
3
  import { SupabaseClient } from '@supabase/supabase-js';
4
- import { D as Database } from './database.generated-CcnC_DRc.js';
4
+ import { D as Database } from './database.generated-DT8JTZiP.js';
5
5
  export { g as changePasswordSchema, t as combineSchemas, i as contactFormSchema, l as loginSchema, f as passwordResetSchema, q as pickSchema, r as registrationSchema, c as secureLoginSchema, s as securePasswordSchema, h as userProfileSchema } from './validation-643vUDZW.js';
6
6
  import { z } from 'zod';
7
7
  export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
package/dist/utils.js CHANGED
@@ -1,5 +1,5 @@
1
- import { sanitizeUserInput, emailSchema, nameSchema, sanitizeFormData } from './chunk-IUBRCBSY.js';
2
- export { calculatePasswordStrength, createBaseClient, dateSchema, emailSchema, formatCompactNumber, formatCurrency, formatDate, formatDateOnlyForDisplay, formatDateTime, formatDateTimeForDisplay, formatDateTimeForMap, formatDateTimeForTable, formatFileSize, formatNumber, formatPercent, formatTime, getAppConfig, getCurrentAppId, nameSchema, passwordSchema, phoneSchema, sanitizeFormData, sanitizeUserInput, setAppConfig, urlSchema, useSessionTracking } from './chunk-IUBRCBSY.js';
1
+ import { sanitizeUserInput, emailSchema, nameSchema, sanitizeFormData } from './chunk-C7ZQ5O4C.js';
2
+ export { calculatePasswordStrength, createBaseClient, dateSchema, emailSchema, formatCompactNumber, formatCurrency, formatDate, formatDateOnlyForDisplay, formatDateTime, formatDateTimeForDisplay, formatDateTimeForMap, formatDateTimeForTable, formatFileSize, formatNumber, formatPercent, formatTime, getAppConfig, getCurrentAppId, nameSchema, passwordSchema, phoneSchema, sanitizeFormData, sanitizeUserInput, setAppConfig, urlSchema, useSessionTracking } from './chunk-C7ZQ5O4C.js';
3
3
  export { CachedAppIdResolver, cachedAppIdResolver, formatInTimeZone, formatTimeInTimeZone, fromZonedTime, getAppId, getAppIds, getTimeZoneDifference, getTimezoneAbbreviation, getUserTimeZone, roundToNearestMinutes, toZonedTime } from './chunk-FEJLJNWA.js';
4
4
  import { LoadingSpinner } from './chunk-A3W6LW53.js';
5
5
  export { renderSafeHtml, sanitizeHtml, validateHtml } from './chunk-A3W6LW53.js';
@@ -759,7 +759,7 @@ function createLazyComponent(importFn, componentName, options = {}) {
759
759
  return WrappedComponent;
760
760
  }
761
761
  var LazyDataTable = createLazyComponent(
762
- () => import('./DataTable-6RMSCQJ6.js').then((module) => ({ default: module.DataTable })),
762
+ () => import('./DataTable-SOAFXIWY.js').then((module) => ({ default: module.DataTable })),
763
763
  "DataTable"
764
764
  );
765
765
 
@@ -9545,7 +9545,7 @@ function App() {
9545
9545
 
9546
9546
  #### Defined in
9547
9547
 
9548
- [packages/core/src/utils/supabase/createBaseClient.ts:120](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/supabase/createBaseClient.ts#L120)
9548
+ [packages/core/src/utils/supabase/createBaseClient.ts:138](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/supabase/createBaseClient.ts#L138)
9549
9549
 
9550
9550
  ___
9551
9551
 
@@ -16,10 +16,10 @@ RPC functions are PostgreSQL functions that provide a secure, standardized way t
16
16
 
17
17
  All RPC functions follow the `<family>_<domain>_<verb>` pattern:
18
18
 
19
- - **`data_*`** prefix for read operations (e.g., `data_file_reference_list`, `data_user_organisations_get`)
19
+ - **`data_*`** prefix for read operations (e.g., `data_file_reference_list`, `data_user_organisations_get`, `data_app_resolve`)
20
20
  - **`app_*`** prefix for write operations (e.g., `app_cake_dish_create`, `app_file_reference_create`)
21
21
  - **`rbac_*`** prefix for RBAC operations (exception to standard pattern, e.g., `rbac_permission_check`, `rbac_role_grant`)
22
- - **`util_*`** prefix for utility functions (e.g., `util_app_resolve`)
22
+ - **`util_*`** prefix for utility functions (legacy - use `data_*` for read operations instead, e.g., `util_get_cake_app_id`)
23
23
  - **CRUD verbs**: `create`, `read`, `get`, `list`, `update`, `delete`
24
24
  - **Bulk operations**: Use `_bulk` suffix (e.g., `app_cake_dish_create_bulk`)
25
25
 
@@ -155,7 +155,7 @@ Documented in [RBAC API Reference](../rbac/api-reference.md):
155
155
  - `rbac_check_distribution_or_page_permission` - Check distribution or page permissions
156
156
 
157
157
  **Utility:**
158
- - `util_app_resolve` - Resolve app ID from app name
158
+ - `data_app_resolve` - Resolve app ID from app name (renamed from `util_app_resolve`)
159
159
  - `util_get_cake_app_id` - Get CAKE app ID (application-specific utility)
160
160
  - `debug_auth_context` - Debug authentication context (development only)
161
161
  - `handle_new_user` - Handle new user registration (triggered automatically)
@@ -1514,6 +1514,72 @@ function UserManagement() {
1514
1514
 
1515
1515
  DataTable provides advanced editing capabilities for columns, including searchable and creatable select fields, grouped options, and customizable number inputs.
1516
1516
 
1517
+ ### Automatic Label Display for Select Fields
1518
+
1519
+ DataTable automatically displays labels for select fields in read mode, eliminating the need for custom cell renderers. When a column has `fieldType: 'select'` and `fieldOptions`, the table will automatically show the label (e.g., "Mobile") instead of the raw value (e.g., `1`).
1520
+
1521
+ **Automatic Behavior:**
1522
+ - ✅ **No custom cell renderer needed** - Labels are displayed automatically
1523
+ - ✅ **Works with simple options** - `{ value: 1, label: 'Mobile' }`
1524
+ - ✅ **Works with grouped options** - Supports groups and separators
1525
+ - ✅ **Type coercion** - Handles both string and number values (e.g., `"1"` matches `1`)
1526
+ - ✅ **Fallback to raw value** - If label not found, displays the original value
1527
+ - ✅ **Preserves custom renderers** - If you provide a custom `cell` renderer, it won't be overridden
1528
+
1529
+ **Example:**
1530
+
1531
+ ```tsx
1532
+ const columns = [
1533
+ {
1534
+ accessorKey: 'phone_type_id',
1535
+ header: 'Phone Type',
1536
+ fieldType: 'select',
1537
+ fieldOptions: [
1538
+ { value: 1, label: 'Mobile' },
1539
+ { value: 2, label: 'Home' },
1540
+ { value: 3, label: 'Work' },
1541
+ ],
1542
+ // No cell renderer needed - automatically displays "Mobile", "Home", or "Work"
1543
+ }
1544
+ ];
1545
+ ```
1546
+
1547
+ **Before (required custom cell renderer):**
1548
+ ```tsx
1549
+ {
1550
+ accessorKey: 'phone_type_id',
1551
+ header: 'Phone Type',
1552
+ fieldType: 'select',
1553
+ fieldOptions: [
1554
+ { value: 1, label: 'Mobile' },
1555
+ { value: 2, label: 'Home' },
1556
+ ],
1557
+ cell: ({ row }) => {
1558
+ const option = fieldOptions.find(opt => opt.value === row.original.phone_type_id);
1559
+ return option?.label || row.original.phone_type_id;
1560
+ }
1561
+ }
1562
+ ```
1563
+
1564
+ **After (automatic):**
1565
+ ```tsx
1566
+ {
1567
+ accessorKey: 'phone_type_id',
1568
+ header: 'Phone Type',
1569
+ fieldType: 'select',
1570
+ fieldOptions: [
1571
+ { value: 1, label: 'Mobile' },
1572
+ { value: 2, label: 'Home' },
1573
+ ]
1574
+ // No cell renderer needed - automatically displays labels
1575
+ }
1576
+ ```
1577
+
1578
+ **Note:** This automatic behavior only applies when:
1579
+ - `fieldType: 'select'` is specified
1580
+ - `fieldOptions` is provided and not empty
1581
+ - No custom `cell` renderer is already defined
1582
+
1517
1583
  ### Select Fields with Search and Create
1518
1584
 
1519
1585
  Editable select columns support type-to-search functionality and the ability to create new options on-the-fly when needed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmruthers/pace-core",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "description": "React component library with Tailwind v4",
5
5
  "private": false,
6
6
  "publishConfig": {