uhuu-components 0.2.80 → 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";
@@ -191,6 +222,9 @@ export interface PrintConfig {
191
222
 
192
223
  export type PrintConfigMap = Record<string, PrintConfig>;
193
224
 
225
+ /** Initial PageEditor zoom preference; fit modes follow layout until manually adjusted. */
226
+ export type PageEditorDefaultZoomMode = "manual" | "fit-width" | "fit-height" | "fit-page";
227
+
194
228
  export interface PageEditorProps {
195
229
  templateConfig: Record<string, unknown>;
196
230
  payload?: Record<string, unknown>;
@@ -199,6 +233,7 @@ export interface PageEditorProps {
199
233
  pageOptions?: unknown[];
200
234
  pageFilter?: PageFilterConfig;
201
235
  printConfigs?: PrintConfigMap;
236
+ defaultZoomMode?: PageEditorDefaultZoomMode;
202
237
  onItemsChange?: (items: PageEditorItem[], state: PageEditorState) => void;
203
238
  onStateChange?: (state: PageEditorState) => void;
204
239
  renderOverlay?: (context: {
@@ -317,6 +352,41 @@ export interface StaticFlowProps<TItem = unknown> {
317
352
  ) => ReactNode;
318
353
  }
319
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
+
320
390
  export type HtmlFlowItem = {
321
391
  id: string;
322
392
  type: string;
@@ -350,7 +420,9 @@ export const Static: {
350
420
  FlowArea: ComponentType<StaticFlowAreaProps>;
351
421
  FlowPage: ComponentType<StaticFlowPageProps>;
352
422
  Flow: <TItem = unknown>(props: StaticFlowProps<TItem>) => ReactElement | null;
423
+ FlowColumns: <TItem = unknown>(props: StaticFlowColumnsProps<TItem>) => ReactElement | null;
353
424
  planFlowChunks: (input?: StaticFlowPlanInput) => StaticFlowChunk[];
425
+ planFlowColumnChunks: (input?: StaticFlowColumnPlanInput) => StaticFlowChunk[];
354
426
  FlowDocument: ComponentType<StaticFlowDocumentProps>;
355
427
  markdownToFlowItems: (
356
428
  markdown?: string,
package/package.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
- "version": "0.2.80",
2
+ "version": "0.2.82",
3
3
  "name": "uhuu-components",
4
- "main": "uhuu-components.umd.js",
4
+ "main": "uhuu-components.umd.cjs",
5
5
  "module": "uhuu-components.es.js",
6
6
  "browser": "uhuu-components.es.js",
7
7
  "types": "index.d.ts",
8
8
  "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./index.d.ts",
12
+ "import": "./uhuu-components.es.js",
13
+ "require": "./uhuu-components.umd.cjs",
14
+ "default": "./uhuu-components.es.js"
15
+ }
16
+ },
9
17
  "license": "https://uhuu.io/license",
10
18
  "peerDependencies": {
11
19
  "react": "^18.0.0 || ^19.0.0",