First atomic checkpoint of F2.3 (table migration to extension). Moves
the type declarations only — interfaces and unions for the table node
tree (WordsTableBlock, WordsTableRow, WordsTableCell, WordsTableOptions,
WordsTableCellOptions, WordsTableCellVerticalAlign, WordsTableCellTone)
go from engine/document.ts to extensions/table/types.ts.
engine/document.ts re-exports the moved types via `export type { ... }
from '../extensions/table/types'` so every existing consumer keeps
compiling without changes. Internal usages within document.ts use a
separate `import type` to keep the types in local scope for factory
function signatures.
The rest of F2.3 (factories + serializers + render + normalize + path
+ operations + registry wire-up) requires deeper dependency analysis
across the engine's ~990 LoC of table code spread over 10 files. That
work is deferred to a dedicated session to avoid mid-refactor breakage.
Verification:
- 143/143 tests pass in src/uix/soma/components/words
- 0 new TypeScript errors
- No engine behaviour change (types-only move)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
active-uix
parent
1805b0817d
commit
088d31ec5d
@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
* Table extension types — canonical types for the table node tree
|
||||||
|
* (`table` → `table-row` → `table-cell` → inline content).
|
||||||
|
*
|
||||||
|
* Owned by the table extension. The engine's `document.ts` re-exports
|
||||||
|
* these for backward compatibility with consumers that import table
|
||||||
|
* types from there directly. New code should import from the table
|
||||||
|
* extension barrel (`extensions/table`) instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { WordsInline, WordsTextAlign } from '../../engine/document';
|
||||||
|
|
||||||
|
export type WordsTableCellVerticalAlign = 'top' | 'middle' | 'bottom';
|
||||||
|
export type WordsTableCellTone = 'default' | 'muted' | 'accent';
|
||||||
|
|
||||||
|
export interface WordsTableBlock {
|
||||||
|
readonly type: 'table';
|
||||||
|
readonly striped?: boolean;
|
||||||
|
readonly compact?: boolean;
|
||||||
|
readonly children: readonly WordsTableRow[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WordsTableRow {
|
||||||
|
readonly type: 'table-row';
|
||||||
|
readonly children: readonly WordsTableCell[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WordsTableCell {
|
||||||
|
readonly type: 'table-cell';
|
||||||
|
readonly header?: boolean;
|
||||||
|
readonly textAlign?: WordsTextAlign;
|
||||||
|
readonly verticalAlign?: WordsTableCellVerticalAlign;
|
||||||
|
readonly tone?: WordsTableCellTone;
|
||||||
|
readonly children: readonly WordsInline[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WordsTableOptions {
|
||||||
|
readonly striped?: boolean;
|
||||||
|
readonly compact?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WordsTableCellOptions {
|
||||||
|
readonly header?: boolean;
|
||||||
|
readonly textAlign?: WordsTextAlign;
|
||||||
|
readonly verticalAlign?: WordsTableCellVerticalAlign;
|
||||||
|
readonly tone?: WordsTableCellTone;
|
||||||
|
}
|
||||||
Loading…
Reference in new issue