@xrubik/fabric-to-leafer-elements 0.0.0-stage → 0.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/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # @rubik/fabric-to-leafer-elements
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 供 `@rubik/fabric-to-leafer` 产物使用的 Leafer 自定义元素:
4
+
5
+ | 元素 | 基类 | tag |
6
+ | --- | --- | --- |
7
+ | `Button` | `Box` | `Button` |
8
+ | `Bar` | `Box` | `Bar` |
9
+ | `Circle` | `Path` | `Circle` |
10
+ | `Lib` | `Group` | `Lib` |
11
+
12
+ `Button` 的交互(悬停遮罩 / 按下下陷 / 禁用)全部在元素内部实现:
13
+ 按下 = 文字右下移 1px + 上左边框 `#5F5F5F`、下右边框 `#EFEFEF`(松开还原) + 隐藏悬停遮罩,
14
+ 与 Fabric `Button._render` 的倒角翻转一致;`updatePressState()` 是唯一的状态同步入口。
15
+
16
+ 导入本包即完成 `registerUI()` 注册,宿主直接使用 `leafer-ui`(peerDependency),不会打进产物。
17
+
18
+ ```js
19
+ import { Button, Bar, Circle, Lib } from '@rubik/fabric-to-leafer-elements'
20
+
21
+ const lib = new Lib({ libName: '图元/手动门', children: [] })
22
+
23
+ const button = new Button({
24
+ text: '确定',
25
+ width: 120,
26
+ height: 40,
27
+ backgroundColor: '#1677ff'
28
+ })
29
+ ```