uhuu-components 0.3.11 → 0.3.12

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
@@ -33,6 +33,9 @@ export interface StaticFlowItemLines {
33
33
  lines: Array<{ top: number; bottom: number; start: number; hyphen?: boolean }>;
34
34
  end: number;
35
35
  justify: boolean;
36
+ /** The text's computed CSS `orphans` / `widows`, where the browser reports them; the item's meta wins. */
37
+ orphans?: number;
38
+ widows?: number;
36
39
  }
37
40
 
38
41
  /** One piece of an item split between the lines of its `Static.FlowText`. */
@@ -201,6 +204,16 @@ export interface StaticFlowMeasureApi {
201
204
  readUnwrappedHeights: (area: HTMLElement, flow: HTMLElement, scale?: number) => Map<HTMLElement, number>;
202
205
  /** Every measured leaf under `root`, in document order. */
203
206
  readFlowItemElements: (root: HTMLElement) => HTMLElement[];
207
+ /**
208
+ * The first of `items` that does not lie below the item before it in `area` (beside it, in
209
+ * another column), or `null`: such a flow cannot be planned (`unstacked-flow-items`).
210
+ */
211
+ readUnstackedItem: (area: HTMLElement, flow: HTMLElement, items: HTMLElement[]) => HTMLElement | null;
212
+ /**
213
+ * A CSS length with an absolute unit (`"20mm"`, `"12px"`) or a number of px, in CSS px;
214
+ * `undefined` for anything else. What `breakReserve` is read with.
215
+ */
216
+ parseAbsoluteLength: (value: number | string | undefined) => number | undefined;
204
217
  parseKeepWithNext: (value: string | undefined) => boolean | number;
205
218
  serializeKeepWithNext: (value: StaticFlowItemMeta['keepWithNext']) => string | undefined;
206
219
  /** `orphans` / `widows` attribute values: a positive whole number, else `undefined`. */
@@ -243,6 +256,12 @@ export interface StaticFlowPlanInput {
243
256
  * Without `lines` the plan is item-level. `planFlowColumnChunks` does not split.
244
257
  */
245
258
  lines?: Array<StaticFlowItemLines | undefined>;
259
+ /**
260
+ * Room kept free at the bottom of every page the flow breaks from, in px; the page it ends on
261
+ * keeps its full region, so a flow that fits one page plans as without it. 0 by default; a
262
+ * reserve of a page or more is ignored. `planFlowColumnChunks` does not take it.
263
+ */
264
+ breakReserve?: number;
246
265
  }
247
266
 
248
267
  /** Input for `Static.planFlowColumnChunks`, using globally indexed leaf measurements. */
@@ -869,6 +888,13 @@ export interface StaticFlowAreaProps {
869
888
  * and plans every later sheet with that height. Default: every sheet has the first one's height.
870
889
  */
871
890
  measureContinuation?: boolean;
891
+ /**
892
+ * Room kept free at the bottom of every sheet the flow continues from, so a break never sits on
893
+ * the sheet's edge; the sheet the flow ends on keeps its full area, and a flow that fits one
894
+ * sheet lays out as without it. A CSS length with an absolute unit (`"20mm"`, `"12px"`) or a
895
+ * number of px. `Static.FlowColumns` does not keep it.
896
+ */
897
+ breakReserve?: number | string;
872
898
  }
873
899
 
874
900
  export interface StaticFlowPageProps {
@@ -882,6 +908,8 @@ export interface StaticFlowPageProps {
882
908
  onFlowMeasurement?: (measurement: StaticFlowMeasurement) => void;
883
909
  /** See `StaticFlowAreaProps.measureContinuation`. */
884
910
  measureContinuation?: boolean;
911
+ /** See `StaticFlowAreaProps.breakReserve`. */
912
+ breakReserve?: number | string;
885
913
  }
886
914
 
887
915
  export interface StaticFlowProps<TItem = unknown> {
@@ -999,6 +1027,8 @@ export interface StaticFlowDocumentProps {
999
1027
  flowAreaStyle?: CSSProperties;
1000
1028
  /** See `StaticFlowAreaProps.measureContinuation`. */
1001
1029
  measureContinuation?: boolean;
1030
+ /** See `StaticFlowAreaProps.breakReserve`. */
1031
+ breakReserve?: number | string;
1002
1032
  id?: string;
1003
1033
  idPrefix?: string;
1004
1034
  flowClassName?: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.11",
2
+ "version": "0.3.12",
3
3
  "name": "uhuu-components",
4
4
  "main": "uhuu-components.umd.cjs",
5
5
  "module": "uhuu-components.es.js",