taffy-layout 1.0.2 → 1.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ByteLand Technology Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja-JP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Taffy Layout
1
+ # ![Taffy Layout Logo](./taffy.svg) Taffy Layout
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja-JP.md)
4
4
 
@@ -45,13 +45,28 @@ const containerStyle = new Style();
45
45
  containerStyle.display = Display.Flex;
46
46
  containerStyle.flexDirection = FlexDirection.Column;
47
47
  containerStyle.alignItems = AlignItems.Center;
48
+
49
+ // size オブジェクトで設定
48
50
  containerStyle.size = { width: 300, height: 200 };
51
+
52
+ // または個別の width/height プロパティを使用
53
+ containerStyle.width = 300;
54
+ containerStyle.height = 200;
55
+
56
+ // padding オブジェクトで設定
49
57
  containerStyle.padding = { left: 10, right: 10, top: 10, bottom: 10 };
50
58
 
59
+ // または個別の padding プロパティを使用
60
+ containerStyle.paddingLeft = 10;
61
+ containerStyle.paddingRight = 10;
62
+ containerStyle.paddingTop = 10;
63
+ containerStyle.paddingBottom = 10;
64
+
51
65
  // 子要素のスタイル
52
66
  const childStyle = new Style();
53
67
  childStyle.flexGrow = 1;
54
- childStyle.size = { width: "100%", height: "auto" };
68
+ childStyle.width = "100%";
69
+ childStyle.height = "auto";
55
70
 
56
71
  // ノードを生成
57
72
  const child1 = tree.newLeaf(childStyle);
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Taffy Layout
1
+ # ![Taffy Layout Logo](./taffy.svg) Taffy Layout
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja-JP.md)
4
4
 
@@ -45,13 +45,28 @@ const containerStyle = new Style();
45
45
  containerStyle.display = Display.Flex;
46
46
  containerStyle.flexDirection = FlexDirection.Column;
47
47
  containerStyle.alignItems = AlignItems.Center;
48
+
49
+ // You can set size as an object
48
50
  containerStyle.size = { width: 300, height: 200 };
51
+
52
+ // Or use individual width/height properties
53
+ containerStyle.width = 300;
54
+ containerStyle.height = 200;
55
+
56
+ // Set padding as an object
49
57
  containerStyle.padding = { left: 10, right: 10, top: 10, bottom: 10 };
50
58
 
59
+ // Or use individual padding properties
60
+ containerStyle.paddingLeft = 10;
61
+ containerStyle.paddingRight = 10;
62
+ containerStyle.paddingTop = 10;
63
+ containerStyle.paddingBottom = 10;
64
+
51
65
  // Create child styles
52
66
  const childStyle = new Style();
53
67
  childStyle.flexGrow = 1;
54
- childStyle.size = { width: "100%", height: "auto" };
68
+ childStyle.width = "100%";
69
+ childStyle.height = "auto";
55
70
 
56
71
  // Create nodes
57
72
  const child1 = tree.newLeaf(childStyle);
package/README.zh-CN.md CHANGED
@@ -1,4 +1,4 @@
1
- # Taffy Layout
1
+ # ![Taffy Layout Logo](./taffy.svg) Taffy Layout
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja-JP.md)
4
4
 
@@ -45,13 +45,28 @@ const containerStyle = new Style();
45
45
  containerStyle.display = Display.Flex;
46
46
  containerStyle.flexDirection = FlexDirection.Column;
47
47
  containerStyle.alignItems = AlignItems.Center;
48
+
49
+ // 可以设置 size 对象
48
50
  containerStyle.size = { width: 300, height: 200 };
51
+
52
+ // 或使用独立的 width/height 属性
53
+ containerStyle.width = 300;
54
+ containerStyle.height = 200;
55
+
56
+ // 设置 padding 对象
49
57
  containerStyle.padding = { left: 10, right: 10, top: 10, bottom: 10 };
50
58
 
59
+ // 或使用独立的 padding 属性
60
+ containerStyle.paddingLeft = 10;
61
+ containerStyle.paddingRight = 10;
62
+ containerStyle.paddingTop = 10;
63
+ containerStyle.paddingBottom = 10;
64
+
51
65
  // 子元素样式
52
66
  const childStyle = new Style();
53
67
  childStyle.flexGrow = 1;
54
- childStyle.size = { width: "100%", height: "auto" };
68
+ childStyle.width = "100%";
69
+ childStyle.height = "auto";
55
70
 
56
71
  // 创建节点
57
72
  const child1 = tree.newLeaf(childStyle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taffy-layout",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "WebAssembly bindings for Taffy layout library",
5
5
  "keywords": [
6
6
  "layout",
@@ -69,7 +69,7 @@
69
69
  "typedoc-plugin-markdown": "^4.9.0",
70
70
  "typescript": "^5.7.0",
71
71
  "vitest": "^4.0.16",
72
- "wasm-pack": "^0.13.1"
72
+ "wasm-pack": "^0.14.0"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=12"
package/pkg/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ByteLand Technology Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/pkg/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Taffy Layout
1
+ # ![Taffy Layout Logo](./taffy.svg) Taffy Layout
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja-JP.md)
4
4
 
@@ -45,13 +45,28 @@ const containerStyle = new Style();
45
45
  containerStyle.display = Display.Flex;
46
46
  containerStyle.flexDirection = FlexDirection.Column;
47
47
  containerStyle.alignItems = AlignItems.Center;
48
+
49
+ // You can set size as an object
48
50
  containerStyle.size = { width: 300, height: 200 };
51
+
52
+ // Or use individual width/height properties
53
+ containerStyle.width = 300;
54
+ containerStyle.height = 200;
55
+
56
+ // Set padding as an object
49
57
  containerStyle.padding = { left: 10, right: 10, top: 10, bottom: 10 };
50
58
 
59
+ // Or use individual padding properties
60
+ containerStyle.paddingLeft = 10;
61
+ containerStyle.paddingRight = 10;
62
+ containerStyle.paddingTop = 10;
63
+ containerStyle.paddingBottom = 10;
64
+
51
65
  // Create child styles
52
66
  const childStyle = new Style();
53
67
  childStyle.flexGrow = 1;
54
- childStyle.size = { width: "100%", height: "auto" };
68
+ childStyle.width = "100%";
69
+ childStyle.height = "auto";
55
70
 
56
71
  // Create nodes
57
72
  const child1 = tree.newLeaf(childStyle);