taffy-js 0.2.8 → 0.2.10

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 CHANGED
@@ -329,7 +329,7 @@ type AvailableSpace = number | "minContent" | "maxContent";
329
329
 
330
330
  // Measure function for custom content measurement
331
331
  type MeasureFunction = (
332
- knownDimensions: Size<number | null>,
332
+ knownDimensions: Size<number | undefined>,
333
333
  availableSpace: Size<AvailableSpace>,
334
334
  node: bigint,
335
335
  context: any,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taffy-js",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "WebAssembly bindings for Taffy layout library",
5
5
  "keywords": [
6
6
  "layout",
@@ -45,7 +45,7 @@
45
45
  "build:dev": "wasm-pack build --dev --target web && npm run patch-dts && npm run build:ts",
46
46
  "docs": "typedoc && prettier --write docs",
47
47
  "patch-dts": "npx tsx scripts/patch-dts.ts",
48
- "test": "wasm-pack test --node",
48
+ "test": "vitest run",
49
49
  "prepare": "husky"
50
50
  },
51
51
  "devDependencies": {
@@ -59,6 +59,7 @@
59
59
  "typedoc": "^0.28.15",
60
60
  "typedoc-plugin-markdown": "^4.9.0",
61
61
  "typescript": "^5.7.0",
62
+ "vitest": "^4.0.16",
62
63
  "wasm-pack": "^0.13.1"
63
64
  },
64
65
  "engines": {
@@ -76,4 +77,4 @@
76
77
  "*.{js,ts,jsx,tsx,json,md,yaml,yml}": "prettier --write",
77
78
  "*.rs": "cargo fmt --"
78
79
  }
79
- }
80
+ }
package/pkg/README.md CHANGED
@@ -329,7 +329,7 @@ type AvailableSpace = number | "minContent" | "maxContent";
329
329
 
330
330
  // Measure function for custom content measurement
331
331
  type MeasureFunction = (
332
- knownDimensions: Size<number | null>,
332
+ knownDimensions: Size<number | undefined>,
333
333
  availableSpace: Size<AvailableSpace>,
334
334
  node: bigint,
335
335
  context: any,
package/pkg/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "ByteLandTechnology <github@byteland.app>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Taffy layout library",
8
- "version": "0.9.6",
8
+ "version": "0.9.7-0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -80,7 +80,7 @@ export interface Size<T> {
80
80
  * custom sizing based on their content (e.g., text nodes that need text measurement).
81
81
  *
82
82
  * @param knownDimensions - Dimensions already determined by constraints. Each dimension
83
- * is `number` if known, or `null` if needs to be measured.
83
+ * is `number` if known, or `undefined` if needs to be measured.
84
84
  * @param availableSpace - The available space constraints for the node. Can be definite
85
85
  * pixels, "minContent", or "maxContent".
86
86
  * @param node - The node ID (`bigint`) of the node being measured
@@ -130,7 +130,7 @@ export interface Size<T> {
130
130
  * ```
131
131
  */
132
132
  export type MeasureFunction = (
133
- knownDimensions: Size<number | null>,
133
+ knownDimensions: Size<number | undefined>,
134
134
  availableSpace: Size<AvailableSpace>,
135
135
  node: bigint,
136
136
  context: any,
@@ -928,17 +928,17 @@ export enum Overflow {
928
928
  */
929
929
  Visible = 0,
930
930
  /**
931
- * Content is clipped at the container boundary
931
+ * Content is clipped at the container boundary, but unlike Hidden, this forbids all scrolling
932
932
  */
933
- Hidden = 1,
933
+ Clip = 1,
934
934
  /**
935
- * Always display scrollbars for scrollable content
935
+ * Content is clipped at the container boundary
936
936
  */
937
- Scroll = 2,
937
+ Hidden = 2,
938
938
  /**
939
- * Display scrollbars only when content overflows (internally maps to Scroll)
939
+ * Always display scrollbars for scrollable content
940
940
  */
941
- Auto = 3,
941
+ Scroll = 3,
942
942
  }
943
943
 
944
944
  /**
package/pkg/taffy_wasm.js CHANGED
@@ -864,17 +864,17 @@ export const Overflow = Object.freeze({
864
864
  */
865
865
  Visible: 0, "0": "Visible",
866
866
  /**
867
- * Content is clipped at the container boundary
867
+ * Content is clipped at the container boundary, but unlike Hidden, this forbids all scrolling
868
868
  */
869
- Hidden: 1, "1": "Hidden",
869
+ Clip: 1, "1": "Clip",
870
870
  /**
871
- * Always display scrollbars for scrollable content
871
+ * Content is clipped at the container boundary
872
872
  */
873
- Scroll: 2, "2": "Scroll",
873
+ Hidden: 2, "2": "Hidden",
874
874
  /**
875
- * Display scrollbars only when content overflows (internally maps to Scroll)
875
+ * Always display scrollbars for scrollable content
876
876
  */
877
- Auto: 3, "3": "Auto",
877
+ Scroll: 3, "3": "Scroll",
878
878
  });
879
879
 
880
880
  /**
@@ -1037,7 +1037,6 @@ export class Style {
1037
1037
  *
1038
1038
  *
1039
1039
  * @example
1040
- *
1041
1040
  * ```typescript
1042
1041
  * style.display = Display.Flex;
1043
1042
  * ```
@@ -1121,7 +1120,6 @@ export class Style {
1121
1120
  *
1122
1121
  *
1123
1122
  * @example
1124
- *
1125
1123
  * ```typescript
1126
1124
  * style.position = Position.Absolute;
1127
1125
  * style.inset = { left: 10, top: 10, right: "auto", bottom: "auto" };
@@ -1164,7 +1162,6 @@ export class Style {
1164
1162
  *
1165
1163
  *
1166
1164
  * @example
1167
- *
1168
1165
  * ```typescript
1169
1166
  * style.flexWrap = FlexWrap.Wrap;
1170
1167
  * ```
@@ -1247,7 +1244,6 @@ export class Style {
1247
1244
  * @param val - The new align-items value, or `undefined` to use default
1248
1245
  *
1249
1246
  * @example
1250
- *
1251
1247
  * ```typescript
1252
1248
  * style.alignItems = AlignItems.Center;
1253
1249
  * ```
@@ -1305,7 +1301,6 @@ export class Style {
1305
1301
  *
1306
1302
  *
1307
1303
  * @example
1308
- *
1309
1304
  * ```typescript
1310
1305
  * style.flexDirection = FlexDirection.Column;
1311
1306
  * ```
@@ -2513,6 +2508,10 @@ function __wbg_get_imports() {
2513
2508
  const ret = Error(getStringFromWasm0(arg0, arg1));
2514
2509
  return ret;
2515
2510
  };
2511
+ imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
2512
+ const ret = Number(arg0);
2513
+ return ret;
2514
+ };
2516
2515
  imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
2517
2516
  const ret = String(arg1);
2518
2517
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -2559,10 +2558,6 @@ function __wbg_get_imports() {
2559
2558
  const ret = typeof(val) === 'object' && val !== null;
2560
2559
  return ret;
2561
2560
  };
2562
- imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
2563
- const ret = typeof(arg0) === 'string';
2564
- return ret;
2565
- };
2566
2561
  imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
2567
2562
  const ret = arg0 === undefined;
2568
2563
  return ret;
@@ -2615,10 +2610,6 @@ function __wbg_get_imports() {
2615
2610
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2616
2611
  }
2617
2612
  };
2618
- imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
2619
- const ret = arg0[arg1 >>> 0];
2620
- return ret;
2621
- };
2622
2613
  imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
2623
2614
  const ret = Reflect.get(arg0, arg1);
2624
2615
  return ret;
@@ -2677,7 +2668,7 @@ function __wbg_get_imports() {
2677
2668
  const ret = arg0.length;
2678
2669
  return ret;
2679
2670
  };
2680
- imports.wbg.__wbg_log_9826028ea7e9105c = function(arg0, arg1) {
2671
+ imports.wbg.__wbg_log_24bf1f6bcbf6c87b = function(arg0, arg1) {
2681
2672
  console.log(getStringFromWasm0(arg0, arg1));
2682
2673
  };
2683
2674
  imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
Binary file