uhuu-components 0.2.81 → 0.2.82

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/index.d.ts CHANGED
@@ -50,6 +50,8 @@ export interface StaticFlowUnplaceableItem {
50
50
  headerHeight: number;
51
51
  requiredHeight: number;
52
52
  availableHeight: number;
53
+ /** Present when the item belongs to a FlowColumns track. */
54
+ columnId?: string;
53
55
  groupKey?: string;
54
56
  reason: "item-too-tall" | "item-with-header-too-tall";
55
57
  }
@@ -68,12 +70,34 @@ export interface StaticFlowGroupHeaderFragment {
68
70
  }
69
71
 
70
72
  export interface StaticFlowChunk {
73
+ /** Flattened visual reading order for this page; `layout` preserves parallel track identity. */
71
74
  indexes: number[];
72
75
  keys: string[];
76
+ /** Track-local source predecessor for the first item in this continuation fragment. */
77
+ previousSourceIndex?: number;
73
78
  groupHeaders?: StaticFlowGroupHeaderFragment[];
74
79
  unplaceable?: StaticFlowUnplaceableItem;
80
+ layout?: StaticFlowLayoutFragment[];
75
81
  }
76
82
 
83
+ export interface StaticFlowColumn {
84
+ id: string;
85
+ indexes: number[];
86
+ }
87
+
88
+ export type StaticFlowLayoutNode =
89
+ | { kind: "item"; index: number }
90
+ | { kind: "columns"; id: string; columns: StaticFlowColumn[] };
91
+
92
+ export interface StaticFlowColumnFragment {
93
+ id: string;
94
+ chunk: StaticFlowChunk;
95
+ }
96
+
97
+ export type StaticFlowLayoutFragment =
98
+ | { kind: "items"; chunk: StaticFlowChunk }
99
+ | { kind: "columns"; id: string; columns: StaticFlowColumnFragment[] };
100
+
77
101
  export interface StaticFlowMeasurement {
78
102
  flowId: string;
79
103
  chunks: StaticFlowChunk[];
@@ -93,6 +117,13 @@ export interface StaticFlowPlanInput {
93
117
  onUnplaceableItem?: (item: StaticFlowUnplaceableItem) => void;
94
118
  }
95
119
 
120
+ /** Input for `Static.planFlowColumnChunks`, using globally indexed leaf measurements. */
121
+ export interface StaticFlowColumnPlanInput extends StaticFlowPlanInput {
122
+ nodes: StaticFlowLayoutNode[];
123
+ columnHeaderGroupHeights?: Record<string, Record<string, Record<string, number>>>;
124
+ columnHeaderGroupRepeats?: Record<string, Record<string, Record<string, boolean>>>;
125
+ }
126
+
96
127
  export interface ImageBlockDialog {
97
128
  path: string;
98
129
  type: "image" | "satellite";
@@ -321,6 +352,41 @@ export interface StaticFlowProps<TItem = unknown> {
321
352
  ) => ReactNode;
322
353
  }
323
354
 
355
+ export interface StaticFlowColumnsRenderContext {
356
+ /** Stable identity only: column geometry callbacks must be page-invariant. */
357
+ flowId: string;
358
+ }
359
+
360
+ export interface StaticFlowColumnsContainerProps {
361
+ className?: string;
362
+ /**
363
+ * Geometry must be identical in measurement and visible output. Vertical group/column margins,
364
+ * padding, borders, fixed/min/max heights, wrapping, and row-gap are unsupported; put measured
365
+ * vertical spacing on items instead.
366
+ */
367
+ style?: CSSProperties;
368
+ }
369
+
370
+ export interface StaticFlowColumnsProps<TItem = unknown> extends StaticFlowProps<TItem> {
371
+ /** One-level story layout. Recursive columns are intentionally unsupported. */
372
+ layout: StaticFlowLayoutNode[];
373
+ getColumnGroupProps?: (
374
+ node: Extract<StaticFlowLayoutNode, { kind: "columns" }>,
375
+ context: StaticFlowColumnsRenderContext
376
+ ) => StaticFlowColumnsContainerProps | undefined;
377
+ getColumnProps?: (
378
+ node: Extract<StaticFlowLayoutNode, { kind: "columns" }>,
379
+ column: StaticFlowColumn,
380
+ context: StaticFlowColumnsRenderContext
381
+ ) => StaticFlowColumnsContainerProps | undefined;
382
+ getColumnItemProps?: (
383
+ node: Extract<StaticFlowLayoutNode, { kind: "columns" }>,
384
+ column: StaticFlowColumn,
385
+ itemIndex: number,
386
+ context: StaticFlowColumnsRenderContext
387
+ ) => StaticFlowColumnsContainerProps | undefined;
388
+ }
389
+
324
390
  export type HtmlFlowItem = {
325
391
  id: string;
326
392
  type: string;
@@ -354,7 +420,9 @@ export const Static: {
354
420
  FlowArea: ComponentType<StaticFlowAreaProps>;
355
421
  FlowPage: ComponentType<StaticFlowPageProps>;
356
422
  Flow: <TItem = unknown>(props: StaticFlowProps<TItem>) => ReactElement | null;
423
+ FlowColumns: <TItem = unknown>(props: StaticFlowColumnsProps<TItem>) => ReactElement | null;
357
424
  planFlowChunks: (input?: StaticFlowPlanInput) => StaticFlowChunk[];
425
+ planFlowColumnChunks: (input?: StaticFlowColumnPlanInput) => StaticFlowChunk[];
358
426
  FlowDocument: ComponentType<StaticFlowDocumentProps>;
359
427
  markdownToFlowItems: (
360
428
  markdown?: string,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.81",
2
+ "version": "0.2.82",
3
3
  "name": "uhuu-components",
4
4
  "main": "uhuu-components.umd.cjs",
5
5
  "module": "uhuu-components.es.js",