@happyvertical/smrt-ui 0.42.6 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -2
- package/dist/components/data/CollectionToolbar.svelte +204 -4
- package/dist/components/data/CollectionToolbar.svelte.d.ts +7 -1
- package/dist/components/data/CollectionToolbar.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTable.svelte +338 -2
- package/dist/components/data/DataTable.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTableController.d.ts +2 -0
- package/dist/components/data/DataTableController.d.ts.map +1 -1
- package/dist/components/data/DataTableController.js +4 -0
- package/dist/components/data/__tests__/data-surface.test.js +75 -4
- package/dist/components/data/__tests__/mounted-data-surface.test.js +794 -0
- package/dist/components/data/data-surface.d.ts +36 -0
- package/dist/components/data/data-surface.d.ts.map +1 -1
- package/dist/components/data/data-surface.js +189 -30
- package/dist/components/data/data-table-surface.d.ts +9 -0
- package/dist/components/data/data-table-surface.d.ts.map +1 -0
- package/dist/components/data/data-table-surface.js +195 -0
- package/dist/components/data/index.d.ts +1 -0
- package/dist/components/data/index.d.ts.map +1 -1
- package/dist/components/data/index.js +1 -0
- package/dist/components/data/types.d.ts +22 -0
- package/dist/components/data/types.d.ts.map +1 -1
- package/package.json +7 -2
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - Material 3 styling with theme token support
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { type Snippet, tick } from 'svelte';
|
|
14
|
+
import { onDestroy, type Snippet, tick, untrack } from 'svelte';
|
|
15
15
|
import { M } from '../../i18n/strings.js';
|
|
16
16
|
import Trans from '../../i18n/Trans.svelte';
|
|
17
17
|
import { useI18n } from '../../i18n/use-i18n.js';
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
type DataTableFilter,
|
|
25
25
|
type DataTableModes,
|
|
26
26
|
type DataTableRowId,
|
|
27
|
+
type DataTableSelection,
|
|
27
28
|
type DataTableSnapshot,
|
|
28
29
|
type DataTableViewState,
|
|
29
30
|
type DataTableViewStateInput,
|
|
@@ -39,8 +40,15 @@ import {
|
|
|
39
40
|
resolveDataTableVirtualWindow,
|
|
40
41
|
scrollTopForDataTableRow,
|
|
41
42
|
} from './DataTableVirtualization.js';
|
|
43
|
+
import type {
|
|
44
|
+
DataSurfaceJsonValue,
|
|
45
|
+
DataSurfaceSelectionReference,
|
|
46
|
+
} from './data-surface.js';
|
|
47
|
+
import { normalizeDataSurfaceDescriptor } from './data-surface.js';
|
|
48
|
+
import { dataTableCommandFromDataSurfaceCommand } from './data-table-surface.js';
|
|
42
49
|
import type {
|
|
43
50
|
DataTableColumn,
|
|
51
|
+
DataTableDataSurfaceOptions,
|
|
44
52
|
DataTableProps,
|
|
45
53
|
DataTableStructuralRow,
|
|
46
54
|
SortState,
|
|
@@ -105,6 +113,7 @@ let {
|
|
|
105
113
|
initialState,
|
|
106
114
|
onStateChange,
|
|
107
115
|
modes,
|
|
116
|
+
dataSurface,
|
|
108
117
|
}: ExtendedProps<T> = $props();
|
|
109
118
|
|
|
110
119
|
const dataTableId = $props.id();
|
|
@@ -154,6 +163,21 @@ let localControllerInitialized = false;
|
|
|
154
163
|
let hasHorizontalOverflow = $state(false);
|
|
155
164
|
let canScrollLeft = $state(false);
|
|
156
165
|
let canScrollRight = $state(false);
|
|
166
|
+
let surfaceHighlighted = $state(false);
|
|
167
|
+
|
|
168
|
+
interface DataTableSurfaceRegistration<T> {
|
|
169
|
+
surface: DataTableDataSurfaceOptions;
|
|
170
|
+
registry: DataTableDataSurfaceOptions['registry'];
|
|
171
|
+
descriptorSignature: string;
|
|
172
|
+
tableBindingSignature: string;
|
|
173
|
+
controller: DataTableController;
|
|
174
|
+
columns: DataTableColumn<T>[];
|
|
175
|
+
rowKey: DataTableProps<T>['rowKey'];
|
|
176
|
+
visibleColumnIds: Set<string> | undefined;
|
|
177
|
+
cleanup: () => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let surfaceRegistration: DataTableSurfaceRegistration<T> | undefined;
|
|
157
181
|
|
|
158
182
|
function activeController(): DataTableController {
|
|
159
183
|
return controller ?? localController;
|
|
@@ -312,6 +336,312 @@ function dispatch(command: DataTableCommand) {
|
|
|
312
336
|
activeController().dispatch(command);
|
|
313
337
|
}
|
|
314
338
|
|
|
339
|
+
function assertSurfaceDescriptorMatchesTable(
|
|
340
|
+
surface: DataTableDataSurfaceOptions,
|
|
341
|
+
tableColumns: DataTableColumn<T>[],
|
|
342
|
+
tableRowKey: DataTableProps<T>['rowKey'],
|
|
343
|
+
tableVisibleColumnIds: Set<string> | undefined,
|
|
344
|
+
) {
|
|
345
|
+
if (typeof tableRowKey !== 'string') {
|
|
346
|
+
throw new Error(
|
|
347
|
+
'DataTable requires a string rowKey for mounted data surfaces',
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
const tableController = activeController();
|
|
351
|
+
const columnState = new Map(
|
|
352
|
+
tableController
|
|
353
|
+
.getState()
|
|
354
|
+
.columnVisibility.map((entry) => [entry.columnId, entry.visible]),
|
|
355
|
+
);
|
|
356
|
+
for (const descriptorColumn of surface.descriptor.columns) {
|
|
357
|
+
if (descriptorColumn.id === surface.descriptor.rowKey) continue;
|
|
358
|
+
const column = tableColumns.find(
|
|
359
|
+
(candidate) => candidate.id === descriptorColumn.id,
|
|
360
|
+
);
|
|
361
|
+
if (
|
|
362
|
+
!column ||
|
|
363
|
+
column.hidden ||
|
|
364
|
+
tableVisibleColumnIds?.has(column.id) === false ||
|
|
365
|
+
columnState.get(column.id) === false
|
|
366
|
+
) {
|
|
367
|
+
throw new Error(
|
|
368
|
+
`DataSurface descriptor exposes a non-visible DataTable column: ${descriptorColumn.id}`,
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (surface.descriptor.rowKey !== tableRowKey) {
|
|
373
|
+
throw new Error(
|
|
374
|
+
'DataSurface descriptor rowKey must match the DataTable rowKey',
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function descriptorColumnAllows(
|
|
380
|
+
surface: DataTableDataSurfaceOptions,
|
|
381
|
+
tableColumns: DataTableColumn<T>[],
|
|
382
|
+
columnId: string,
|
|
383
|
+
capability?: 'filter' | 'sort',
|
|
384
|
+
): boolean {
|
|
385
|
+
const descriptorColumn = surface.descriptor.columns.find(
|
|
386
|
+
(column) => column.id === columnId,
|
|
387
|
+
);
|
|
388
|
+
const tableColumn = tableColumns.find((column) => column.id === columnId);
|
|
389
|
+
if (!descriptorColumn || !tableColumn) return false;
|
|
390
|
+
if (!descriptorColumn.capabilities.includes('read')) return false;
|
|
391
|
+
return capability === undefined
|
|
392
|
+
? true
|
|
393
|
+
: descriptorColumn.capabilities.includes(capability);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function descriptorAllowsTableCommand(
|
|
397
|
+
surface: DataTableDataSurfaceOptions,
|
|
398
|
+
tableColumns: DataTableColumn<T>[],
|
|
399
|
+
command: DataTableCommand,
|
|
400
|
+
): boolean {
|
|
401
|
+
switch (command.type) {
|
|
402
|
+
case 'setFilters':
|
|
403
|
+
return command.filters.every((filter) => {
|
|
404
|
+
const column = tableColumns.find(
|
|
405
|
+
(candidate) => candidate.id === filter.columnId,
|
|
406
|
+
);
|
|
407
|
+
return (
|
|
408
|
+
column?.filterable !== false &&
|
|
409
|
+
descriptorColumnAllows(
|
|
410
|
+
surface,
|
|
411
|
+
tableColumns,
|
|
412
|
+
filter.columnId,
|
|
413
|
+
'filter',
|
|
414
|
+
)
|
|
415
|
+
);
|
|
416
|
+
});
|
|
417
|
+
case 'setSorting':
|
|
418
|
+
return command.sorting.every((sortRule) => {
|
|
419
|
+
const column = tableColumns.find(
|
|
420
|
+
(candidate) => candidate.id === sortRule.columnId,
|
|
421
|
+
);
|
|
422
|
+
return (
|
|
423
|
+
column?.sortable === true &&
|
|
424
|
+
descriptorColumnAllows(
|
|
425
|
+
surface,
|
|
426
|
+
tableColumns,
|
|
427
|
+
sortRule.columnId,
|
|
428
|
+
'sort',
|
|
429
|
+
)
|
|
430
|
+
);
|
|
431
|
+
});
|
|
432
|
+
case 'toggleSorting': {
|
|
433
|
+
const column = tableColumns.find(
|
|
434
|
+
(candidate) => candidate.id === command.columnId,
|
|
435
|
+
);
|
|
436
|
+
return (
|
|
437
|
+
column?.sortable === true &&
|
|
438
|
+
descriptorColumnAllows(surface, tableColumns, command.columnId, 'sort')
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
case 'setColumnOrder':
|
|
442
|
+
return command.columnIds.every((columnId) =>
|
|
443
|
+
descriptorColumnAllows(surface, tableColumns, columnId),
|
|
444
|
+
);
|
|
445
|
+
case 'setColumnVisibility':
|
|
446
|
+
return command.columns.every((column) =>
|
|
447
|
+
descriptorColumnAllows(surface, tableColumns, column.columnId),
|
|
448
|
+
);
|
|
449
|
+
default:
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function dataSurfaceSelection(
|
|
455
|
+
selection: DataTableSelection,
|
|
456
|
+
): DataSurfaceSelectionReference | null {
|
|
457
|
+
if (selection.scope === 'page') return { scope: 'current-page' };
|
|
458
|
+
if (selection.scope === 'allMatching') {
|
|
459
|
+
return {
|
|
460
|
+
scope: 'all-matching',
|
|
461
|
+
queryFingerprint: selection.queryFingerprint,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
return selection.rowIds.length > 0
|
|
465
|
+
? { scope: 'explicit-ids', rowIds: selection.rowIds }
|
|
466
|
+
: null;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function preservesDeclaredVisibleColumns(
|
|
470
|
+
surface: DataTableDataSurfaceOptions,
|
|
471
|
+
visibility: DataTableViewState['columnVisibility'],
|
|
472
|
+
): boolean {
|
|
473
|
+
const requested = new Map(
|
|
474
|
+
visibility.map((column) => [column.columnId, column.visible]),
|
|
475
|
+
);
|
|
476
|
+
return surface.descriptor.columns
|
|
477
|
+
.filter((column) => column.id !== surface.descriptor.rowKey)
|
|
478
|
+
.every((column) => requested.get(column.id) === true);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function preservesDeclaredVisibleColumnsForCommand(
|
|
482
|
+
surface: DataTableDataSurfaceOptions,
|
|
483
|
+
command: DataTableCommand,
|
|
484
|
+
): boolean {
|
|
485
|
+
return command.type !== 'setColumnVisibility'
|
|
486
|
+
? true
|
|
487
|
+
: preservesDeclaredVisibleColumns(surface, command.columns);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
$effect(() => {
|
|
491
|
+
const surface = dataSurface;
|
|
492
|
+
const surfaceController = activeController();
|
|
493
|
+
if (!surface) {
|
|
494
|
+
surfaceRegistration?.cleanup();
|
|
495
|
+
surfaceRegistration = undefined;
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
assertSurfaceDescriptorMatchesTable(
|
|
499
|
+
surface,
|
|
500
|
+
columns,
|
|
501
|
+
rowKey,
|
|
502
|
+
visibleColumnIds,
|
|
503
|
+
);
|
|
504
|
+
const descriptorSignature = JSON.stringify(
|
|
505
|
+
normalizeDataSurfaceDescriptor(surface.descriptor),
|
|
506
|
+
);
|
|
507
|
+
const tableBindingSignature = JSON.stringify({
|
|
508
|
+
rowKey,
|
|
509
|
+
visibleColumnIds: visibleColumnIds ? [...visibleColumnIds].sort() : null,
|
|
510
|
+
columns: columns.map((column) => ({
|
|
511
|
+
id: column.id,
|
|
512
|
+
hidden: column.hidden === true,
|
|
513
|
+
sortable: column.sortable === true,
|
|
514
|
+
filterable: column.filterable !== false,
|
|
515
|
+
})),
|
|
516
|
+
});
|
|
517
|
+
if (
|
|
518
|
+
surfaceRegistration?.registry === surface.registry &&
|
|
519
|
+
surfaceRegistration.descriptorSignature === descriptorSignature &&
|
|
520
|
+
surfaceRegistration.tableBindingSignature === tableBindingSignature &&
|
|
521
|
+
surfaceRegistration.controller === surfaceController
|
|
522
|
+
) {
|
|
523
|
+
surfaceRegistration.surface = surface;
|
|
524
|
+
surfaceRegistration.columns = columns;
|
|
525
|
+
surfaceRegistration.rowKey = rowKey;
|
|
526
|
+
surfaceRegistration.visibleColumnIds = visibleColumnIds;
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
surfaceRegistration?.cleanup();
|
|
530
|
+
surfaceRegistration = undefined;
|
|
531
|
+
const registration: DataTableSurfaceRegistration<T> = {
|
|
532
|
+
surface,
|
|
533
|
+
registry: surface.registry,
|
|
534
|
+
descriptorSignature,
|
|
535
|
+
tableBindingSignature,
|
|
536
|
+
controller: surfaceController,
|
|
537
|
+
columns,
|
|
538
|
+
rowKey,
|
|
539
|
+
visibleColumnIds,
|
|
540
|
+
cleanup: () => {},
|
|
541
|
+
};
|
|
542
|
+
const cleanup = untrack(() => {
|
|
543
|
+
let revision = 0;
|
|
544
|
+
let highlightTimer: ReturnType<typeof setTimeout> | undefined;
|
|
545
|
+
let restoringInvalidVisibility = false;
|
|
546
|
+
const unsubscribe = surfaceController.subscribe((transition) => {
|
|
547
|
+
if (
|
|
548
|
+
!restoringInvalidVisibility &&
|
|
549
|
+
!preservesDeclaredVisibleColumns(
|
|
550
|
+
registration.surface,
|
|
551
|
+
transition.next.state.columnVisibility,
|
|
552
|
+
)
|
|
553
|
+
) {
|
|
554
|
+
restoringInvalidVisibility = true;
|
|
555
|
+
try {
|
|
556
|
+
surfaceController.replaceState(transition.previous.state);
|
|
557
|
+
} finally {
|
|
558
|
+
restoringInvalidVisibility = false;
|
|
559
|
+
}
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (transition.changed) revision += 1;
|
|
563
|
+
});
|
|
564
|
+
const unregister = surface.registry.register({
|
|
565
|
+
descriptor: registration.surface.descriptor,
|
|
566
|
+
getSnapshot: () => {
|
|
567
|
+
const snapshot = surfaceController.snapshot();
|
|
568
|
+
return {
|
|
569
|
+
revision,
|
|
570
|
+
state: { table: snapshot as unknown as DataSurfaceJsonValue },
|
|
571
|
+
selection: dataSurfaceSelection(snapshot.state.selection),
|
|
572
|
+
};
|
|
573
|
+
},
|
|
574
|
+
execute: async (command) => {
|
|
575
|
+
const tableCommand = dataTableCommandFromDataSurfaceCommand(command);
|
|
576
|
+
if (tableCommand) {
|
|
577
|
+
if (
|
|
578
|
+
!descriptorAllowsTableCommand(
|
|
579
|
+
registration.surface,
|
|
580
|
+
registration.columns,
|
|
581
|
+
tableCommand,
|
|
582
|
+
) ||
|
|
583
|
+
!preservesDeclaredVisibleColumnsForCommand(
|
|
584
|
+
registration.surface,
|
|
585
|
+
tableCommand,
|
|
586
|
+
)
|
|
587
|
+
) {
|
|
588
|
+
return { ok: false };
|
|
589
|
+
}
|
|
590
|
+
const transition = surfaceController.dispatch(tableCommand);
|
|
591
|
+
if (surfaceController.isControlled() && transition.changed) {
|
|
592
|
+
const settled = await registration.surface.applyControlledState?.(
|
|
593
|
+
transition.next.state,
|
|
594
|
+
tableCommand,
|
|
595
|
+
);
|
|
596
|
+
if (settled) surfaceController.replaceState(settled);
|
|
597
|
+
if (
|
|
598
|
+
JSON.stringify(surfaceController.getState()) !==
|
|
599
|
+
JSON.stringify(transition.next.state)
|
|
600
|
+
) {
|
|
601
|
+
return { ok: false };
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
switch (command.controlId) {
|
|
607
|
+
case 'focus':
|
|
608
|
+
tableContainer?.focus();
|
|
609
|
+
return;
|
|
610
|
+
case 'reveal':
|
|
611
|
+
tableContainer?.scrollIntoView({ block: 'nearest' });
|
|
612
|
+
return;
|
|
613
|
+
case 'highlight':
|
|
614
|
+
surfaceHighlighted = true;
|
|
615
|
+
if (highlightTimer) clearTimeout(highlightTimer);
|
|
616
|
+
highlightTimer = setTimeout(() => {
|
|
617
|
+
surfaceHighlighted = false;
|
|
618
|
+
}, 1_000);
|
|
619
|
+
return;
|
|
620
|
+
case 'refresh':
|
|
621
|
+
if (!registration.surface.onRefresh) return { ok: false };
|
|
622
|
+
await registration.surface.onRefresh();
|
|
623
|
+
return;
|
|
624
|
+
case 'retry':
|
|
625
|
+
if (!registration.surface.onRetry) return { ok: false };
|
|
626
|
+
await registration.surface.onRetry();
|
|
627
|
+
return;
|
|
628
|
+
default:
|
|
629
|
+
return { ok: false };
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
});
|
|
633
|
+
return () => {
|
|
634
|
+
if (highlightTimer) clearTimeout(highlightTimer);
|
|
635
|
+
unsubscribe();
|
|
636
|
+
unregister();
|
|
637
|
+
};
|
|
638
|
+
});
|
|
639
|
+
registration.cleanup = cleanup;
|
|
640
|
+
surfaceRegistration = registration;
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
onDestroy(() => surfaceRegistration?.cleanup());
|
|
644
|
+
|
|
315
645
|
function handleSort(column: DataTableColumn<T>, event: MouseEvent) {
|
|
316
646
|
if (!sortable || !column.sortable) return;
|
|
317
647
|
dispatch({
|
|
@@ -1061,8 +1391,9 @@ $effect(() => {
|
|
|
1061
1391
|
class:data-table-container--sticky={stickyHeader || virtualizedBody}
|
|
1062
1392
|
class:data-table-container--overflowing={hasHorizontalOverflow}
|
|
1063
1393
|
class:data-table-container--virtualized={virtualizationWindow.enabled}
|
|
1394
|
+
class:data-table-container--highlighted={surfaceHighlighted}
|
|
1064
1395
|
style:height={virtualContainerHeight === undefined ? undefined : `${virtualContainerHeight}px`}
|
|
1065
|
-
tabindex={virtualizationWindow.enabled || hasHorizontalOverflow ? 0 : undefined}
|
|
1396
|
+
tabindex={virtualizationWindow.enabled || hasHorizontalOverflow ? 0 : dataSurface ? -1 : undefined}
|
|
1066
1397
|
role={virtualizationWindow.enabled || hasHorizontalOverflow ? 'region' : undefined}
|
|
1067
1398
|
aria-label={virtualizationWindow.enabled
|
|
1068
1399
|
? caption
|
|
@@ -1534,6 +1865,11 @@ $effect(() => {
|
|
|
1534
1865
|
outline-offset: 2px;
|
|
1535
1866
|
}
|
|
1536
1867
|
|
|
1868
|
+
.data-table-container--highlighted {
|
|
1869
|
+
outline: 2px solid var(--smrt-color-primary, #2563eb);
|
|
1870
|
+
outline-offset: 3px;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1537
1873
|
.data-table__overflow-cue {
|
|
1538
1874
|
display: flex;
|
|
1539
1875
|
justify-content: space-between;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/data/DataTable.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"DataTable.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/data/DataTable.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,OAAO,EAAa,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AAmChE,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EAGf,MAAM,YAAY,CAAC;AAIpB,UAAU,aAAa,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAClD,+DAA+D;IAC/D,IAAI,CAAC,EAAE,OAAO,CACZ;QAAC;YAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;YAAC,GAAG,EAAE,CAAC,CAAC;YAAC,KAAK,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;KAAC,CACxE,CAAC;CACH;AAYC,iBAAS,QAAQ,CAAC,CAAC;WAglDQ,aAAa,CAAC,CAAC,CAAC;;;;;EAAgH;AAC7J,cAAM,iBAAiB,CAAC,CAAC;IACrB,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,QAAQ;IACR,OAAO;CACV;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5X,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3H,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,SAAS,EAAE,qBAAmC,CAAC;AACnC,KAAK,SAAS,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,eAAe,SAAS,CAAC"}
|
|
@@ -214,6 +214,8 @@ export declare class DataTableController {
|
|
|
214
214
|
constructor(options?: DataTableControllerOptions);
|
|
215
215
|
getState(): DataTableViewState;
|
|
216
216
|
getModes(): DataTableModes;
|
|
217
|
+
/** Whether commands are proposals until an owning host supplies state. */
|
|
218
|
+
isControlled(): boolean;
|
|
217
219
|
snapshot(): DataTableSnapshot;
|
|
218
220
|
subscribe(listener: DataTableStateListener): () => void;
|
|
219
221
|
/** Dispatches a serializable command. Controlled controllers emit a proposal only. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableController.d.ts","sourceRoot":"","sources":["../../../src/components/data/DataTableController.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAA;CAAE,GAC3C;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAA;CAAE,GAC/C,CAAC;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,sBAAsB,CAAC,CAAC;AAE/E,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,kBAAkB,EAAE,GACpB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAAE,CAAC;AAE1C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,sBAAsB,CAAC;IAClC,OAAO,EAAE,sBAAsB,CAAC;IAChC,UAAU,EAAE,sBAAsB,CAAC;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAA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iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,mBAAmB;IAU7D,kFAAkF;IAClF,YAAY,CACV,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,eAAe,GAAE,SAAS,MAAM,EAAO,GACtC,mBAAmB;IA6CtB,OAAO,CAAC,wBAAwB;IAwBhC,oFAAoF;IACpF,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,mBAAmB;IAgCpE,OAAO,CAAC,IAAI;CAIb;AAaD,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,0BAA+B,GACvC,mBAAmB,CAErB"}
|
|
@@ -609,6 +609,10 @@ export class DataTableController {
|
|
|
609
609
|
getModes() {
|
|
610
610
|
return { ...this.modes };
|
|
611
611
|
}
|
|
612
|
+
/** Whether commands are proposals until an owning host supplies state. */
|
|
613
|
+
isControlled() {
|
|
614
|
+
return this.controlled;
|
|
615
|
+
}
|
|
612
616
|
snapshot() {
|
|
613
617
|
return { version: 3, modes: this.getModes(), state: this.getState() };
|
|
614
618
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { createDataSurfaceRegistry, DATA_SURFACE_MAX_REPLAY_ENTRIES, DATA_SURFACE_MAX_REQUEST_BYTES, normalizeDataSurfaceActionRequest, normalizeDataSurfaceQueryRequest, normalizeDataSurfaceVisibleCommand, } from '../data-surface.js';
|
|
2
|
+
import { createDataSurfaceRegistry, DATA_SURFACE_IDENTIFIER_MAX_LENGTH, DATA_SURFACE_MAX_REPLAY_ENTRIES, DATA_SURFACE_MAX_REQUEST_BYTES, normalizeDataSurfaceActionRequest, normalizeDataSurfaceDescriptor, normalizeDataSurfaceQueryRequest, normalizeDataSurfaceVisibleCommand, } from '../data-surface.js';
|
|
3
3
|
const identity = {
|
|
4
4
|
surfaceId: 'content-library',
|
|
5
5
|
kind: 'table',
|
|
@@ -86,6 +86,18 @@ function registerFixture(options = {}) {
|
|
|
86
86
|
return { registry, unregister, execute };
|
|
87
87
|
}
|
|
88
88
|
describe('data surface registry', () => {
|
|
89
|
+
it('identifies unknown action columns in descriptor validation errors', () => {
|
|
90
|
+
expect(() => normalizeDataSurfaceDescriptor(descriptor({
|
|
91
|
+
actions: [
|
|
92
|
+
{
|
|
93
|
+
id: 'archive',
|
|
94
|
+
label: 'Archive',
|
|
95
|
+
selectionScopes: ['explicit-ids'],
|
|
96
|
+
columnIds: ['missing'],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
}))).toThrow('Unknown DataSurface action column id: missing');
|
|
100
|
+
});
|
|
89
101
|
it('aligns bounded query result shapes with each query kind', () => {
|
|
90
102
|
const results = [
|
|
91
103
|
{
|
|
@@ -593,6 +605,60 @@ describe('data surface registry', () => {
|
|
|
593
605
|
expect(() => normalizeDataSurfaceVisibleCommand(command({ payload: { sql: 'select * from content' } }))).toThrow('authority or SQL');
|
|
594
606
|
expect(() => normalizeDataSurfaceVisibleCommand(command({ payload: { tenantId: 'other-tenant' } }))).toThrow('authority or SQL');
|
|
595
607
|
});
|
|
608
|
+
it('enforces the shared identifier bound at registry boundaries', () => {
|
|
609
|
+
const tooLong = 'x'.repeat(DATA_SURFACE_IDENTIFIER_MAX_LENGTH + 1);
|
|
610
|
+
const identifiers = [
|
|
611
|
+
['command id', command({ commandId: tooLong })],
|
|
612
|
+
['control id', command({ controlId: tooLong })],
|
|
613
|
+
[
|
|
614
|
+
'surface id',
|
|
615
|
+
command({ identity: { ...identity, surfaceId: tooLong } }),
|
|
616
|
+
],
|
|
617
|
+
[
|
|
618
|
+
'subject type',
|
|
619
|
+
command({
|
|
620
|
+
identity: {
|
|
621
|
+
...identity,
|
|
622
|
+
subject: { type: tooLong, id: 'docs' },
|
|
623
|
+
},
|
|
624
|
+
}),
|
|
625
|
+
],
|
|
626
|
+
[
|
|
627
|
+
'subject id',
|
|
628
|
+
command({
|
|
629
|
+
identity: {
|
|
630
|
+
...identity,
|
|
631
|
+
subject: { type: 'site', id: tooLong },
|
|
632
|
+
},
|
|
633
|
+
}),
|
|
634
|
+
],
|
|
635
|
+
];
|
|
636
|
+
for (const [label, value] of identifiers) {
|
|
637
|
+
expect(() => normalizeDataSurfaceVisibleCommand(value), label).toThrow();
|
|
638
|
+
}
|
|
639
|
+
expect(() => normalizeDataSurfaceActionRequest({
|
|
640
|
+
version: 1,
|
|
641
|
+
requestId: tooLong,
|
|
642
|
+
identity,
|
|
643
|
+
actionId: 'archive',
|
|
644
|
+
phase: 'preview',
|
|
645
|
+
selection: { scope: 'current-page' },
|
|
646
|
+
})).toThrow();
|
|
647
|
+
expect(() => normalizeDataSurfaceActionRequest({
|
|
648
|
+
version: 1,
|
|
649
|
+
requestId: 'row-id',
|
|
650
|
+
identity,
|
|
651
|
+
actionId: 'archive',
|
|
652
|
+
phase: 'preview',
|
|
653
|
+
selection: { scope: 'explicit-ids', rowIds: [tooLong] },
|
|
654
|
+
})).toThrow();
|
|
655
|
+
expect(() => createDataSurfaceRegistry().register({
|
|
656
|
+
descriptor: descriptor({
|
|
657
|
+
identity: { ...identity, surfaceId: tooLong },
|
|
658
|
+
}),
|
|
659
|
+
getSnapshot: () => ({ revision: 0, state: {} }),
|
|
660
|
+
})).toThrow();
|
|
661
|
+
});
|
|
596
662
|
it('rejects parsed prototype keys at every browser-contract boundary', () => {
|
|
597
663
|
const prototypePayload = JSON.parse('{"__proto__":{"tenantId":"other"}}');
|
|
598
664
|
expect(() => normalizeDataSurfaceVisibleCommand(command({ payload: prototypePayload }))).toThrow('prototype key');
|
|
@@ -662,12 +728,17 @@ describe('data surface registry', () => {
|
|
|
662
728
|
identity,
|
|
663
729
|
kind: 'rows',
|
|
664
730
|
limit: 1,
|
|
665
|
-
projection:
|
|
731
|
+
projection: Array.from({ length: 394 }, (_, index) => `${String(index).padStart(3, '0')}${'x'.repeat(247)}`),
|
|
666
732
|
};
|
|
667
|
-
const
|
|
733
|
+
const withEmpty = { ...request, projection: [...request.projection, ''] };
|
|
734
|
+
const overhead = new TextEncoder().encode(JSON.stringify(withEmpty)).byteLength -
|
|
735
|
+
new TextEncoder().encode(JSON.stringify(request)).byteLength;
|
|
736
|
+
const finalLength = DATA_SURFACE_MAX_REQUEST_BYTES -
|
|
737
|
+
new TextEncoder().encode(JSON.stringify(request)).byteLength -
|
|
738
|
+
overhead;
|
|
668
739
|
const exactLimit = {
|
|
669
740
|
...request,
|
|
670
|
-
projection: ['x'.repeat(
|
|
741
|
+
projection: [...request.projection, 'x'.repeat(finalLength)],
|
|
671
742
|
};
|
|
672
743
|
expect(new TextEncoder().encode(JSON.stringify(exactLimit)).byteLength).toBe(DATA_SURFACE_MAX_REQUEST_BYTES);
|
|
673
744
|
expect(normalizeDataSurfaceQueryRequest(exactLimit)).toEqual(exactLimit);
|