leafer-ui 2.2.10 → 2.3.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 +9 -234
- package/dist/web.js +80 -36
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +87 -37
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
官网: [leaferjs.com](https://www.leaferjs.com)
|
|
10
10
|
|
|
11
|
+
森林: [leafer.pro](https://www.leafer.pro)
|
|
12
|
+
|
|
11
13
|
**👉 在浏览器里 “跑得动 100 万个图形” 的 Canvas 引擎**
|
|
12
14
|
**👉 可以做 “Figma 级编辑器” 的 Canvas 内核**
|
|
13
15
|
|
|
@@ -159,242 +161,15 @@ LeaferJS 是一个持续打磨了五年的原创开源引擎。我们致力于
|
|
|
159
161
|
|
|
160
162
|
## 致谢贡献者
|
|
161
163
|
|
|
164
|
+
[每一位参与开源森林的创作者](https://www.leafer.pro/#creator)
|
|
165
|
+
|
|
162
166
|
[每一位贡献代码的社区成员](https://github.com/leaferjs/leafer-ui/graphs/contributors)
|
|
163
167
|
|
|
164
|
-
[
|
|
165
|
-
|
|
166
|
-
##
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<p style="display: flex;flex-wrap: wrap;justify-content: center;gap: 15px;">
|
|
170
|
-
<a target="_blank" href="https://yzllq.com/">
|
|
171
|
-
<img width="180" title="一个浏览器打开多组账户 - 电商、自媒体、矩阵营销的便捷账户管理方式" src="https://www.leaferjs.com/image/sponsor/gold/yzllq.png" loading="lazy" />
|
|
172
|
-
</a>
|
|
173
|
-
<a target="_blank" href="https://easysearch.cn">
|
|
174
|
-
<img width="180" title="Easysearch - 企业级的分布式搜索型数据库" src="https://www.leaferjs.com/image/sponsor/gold/easysearch.png" loading="lazy" />
|
|
175
|
-
</a>
|
|
176
|
-
<a target="_blank" href="https://boardos.online">
|
|
177
|
-
<img width="180" title="在线实时白板协作系统" src="https://www.leaferjs.com/image/sponsor/gold/boardos.svg" loading="lazy" />
|
|
178
|
-
</a>
|
|
179
|
-
<a target="_blank" href="https://www.photiu.ai">
|
|
180
|
-
<img width="180" title="Photiu" src="https://www.leaferjs.com/image/sponsor/gold/photiu.png" loading="lazy" />
|
|
181
|
-
</a>
|
|
182
|
-
<a target="_blank" href="https://xpai.design">
|
|
183
|
-
<img width="180" title="迅排设计" src="https://www.leaferjs.com/image/sponsor/gold/xp.jpg" loading="lazy" />
|
|
184
|
-
</a>
|
|
185
|
-
<a target="_blank" href="https://github.com/dromara/yft-design">
|
|
186
|
-
<img width="180" title="yft-design" src="https://www.leaferjs.com/image/sponsor/gold/yft.jpg" loading="lazy" />
|
|
187
|
-
</a>
|
|
188
|
-
<a target="_blank" href="https://www.finclip.com/landing/miniappgame?from=leafer">
|
|
189
|
-
<img width="180" title="FinClip" src="https://www.leaferjs.com/image/sponsor/gold/finclip.jpg" loading="lazy" />
|
|
190
|
-
</a>
|
|
191
|
-
<a target="_blank" href="https://f.style">
|
|
192
|
-
<img width="180" title="hiif" src="https://www.leaferjs.com/image/sponsor/gold/hiif.jpg" loading="lazy" />
|
|
193
|
-
</a>
|
|
194
|
-
<a target="_blank" href="https://www.seafox.cc">
|
|
195
|
-
<img width="180" title="seafox" src="https://www.leaferjs.com/image/sponsor/gold/seafox.jpg" loading="lazy" />
|
|
196
|
-
</a>
|
|
197
|
-
<a target="_blank" href="https://dooring.vip">
|
|
198
|
-
<img width="180" title="dooring" src="https://www.leaferjs.com/image/sponsor/gold/dooring.jpg" loading="lazy" />
|
|
199
|
-
</a>
|
|
200
|
-
<a target="_blank" href="https://pro.kuaitu.cc">
|
|
201
|
-
<img width="180" title="快图设计" src="https://www.leaferjs.com/image/sponsor/gold/kuaitu.jpg" loading="lazy" />
|
|
202
|
-
</a>
|
|
203
|
-
<a target="_blank" href="https://chensuiyi.me">
|
|
204
|
-
<img width="180" title="前端之虎陈随易" src="https://www.leaferjs.com/image/sponsor/gold/chensuiyi.jpg" loading="lazy" />
|
|
205
|
-
</a>
|
|
206
|
-
<a target="_blank" href="http://www.yunform.cn">
|
|
207
|
-
<img width="180" title="数据查询录入表单页面制作效率工具" src="https://www.leaferjs.com/image/sponsor/gold/yunform.svg" loading="lazy" />
|
|
208
|
-
</a>
|
|
209
|
-
<a target="_blank" href="https://www.pxgrow.com/vip/logo/">
|
|
210
|
-
<img width="180" title="赞助我们" src="https://www.leaferjs.com/image/sponsor/gold/add.jpg" loading="lazy" />
|
|
211
|
-
</a>
|
|
212
|
-
</p>
|
|
213
|
-
|
|
214
|
-
<p><h3 align="center">银牌赞助</h3></p>
|
|
215
|
-
<p style="display: flex;flex-wrap: wrap;justify-content: center;gap: 5px;">
|
|
216
|
-
<a target="_blank" href="">
|
|
217
|
-
<img width="40" title="怜生" src="https://www.pxgrow.com/image/user/default/3.jpg" loading="lazy" />
|
|
218
|
-
</a>
|
|
219
|
-
<a target="_blank" href="https://pro.kuaitu.cc">
|
|
220
|
-
<img width="40" title="快图设计" src="https://www.pxgrow.com/image/user/default/7.jpg" loading="lazy" />
|
|
221
|
-
</a>
|
|
222
|
-
<a target="_blank" href="">
|
|
223
|
-
<img width="40" title="black" src="https://api.pxgrow.com/uploads/avatar/249/AzA/4v/u.jpg" loading="lazy" />
|
|
224
|
-
</a>
|
|
225
|
-
<a target="_blank" href="">
|
|
226
|
-
<img width="40" title="ARAM" src="https://api.pxgrow.com/uploads/avatar/3Pv/P26/zw/u.jpg" loading="lazy" />
|
|
227
|
-
</a>
|
|
228
|
-
<a target="_blank" href="">
|
|
229
|
-
<img width="40" title="Winning" src="https://www.pxgrow.com/image/user/default/4.jpg" loading="lazy" />
|
|
230
|
-
</a>
|
|
231
|
-
<a target="_blank" href="">
|
|
232
|
-
<img width="40" title="刘洋" src="https://www.pxgrow.com/image/user/default/2.jpg" loading="lazy" />
|
|
233
|
-
</a>
|
|
234
|
-
<a target="_blank" href="">
|
|
235
|
-
<img width="40" title="张老爷" src="https://api.pxgrow.com/uploads/avatar/76z/6wz/Px/u.jpg" loading="lazy" />
|
|
236
|
-
</a>
|
|
237
|
-
<a target="_blank" href="">
|
|
238
|
-
<img width="40" title="KevinJiaCN" src="https://www.pxgrow.com/image/user/default/3.jpg" loading="lazy" />
|
|
239
|
-
</a>
|
|
240
|
-
<a target="_blank" href="">
|
|
241
|
-
<img width="40" title="goosen" src="https://www.pxgrow.com/image/sponsor/user/122.jpeg" loading="lazy" />
|
|
242
|
-
</a>
|
|
243
|
-
<a target="_blank" href="">
|
|
244
|
-
<img width="40" title="dev_chen" src="https://www.pxgrow.com/image/sponsor/user/137.jpg" loading="lazy" />
|
|
245
|
-
</a>
|
|
246
|
-
<a target="_blank" href="frameelf">
|
|
247
|
-
<img width="40" title="o" src="https://api.pxgrow.com/uploads/avatar/3Pv/P2S/ww/u.jpg" loading="lazy" />
|
|
248
|
-
</a>
|
|
249
|
-
<a target="_blank" href="">
|
|
250
|
-
<img width="40" title="Y" src="https://www.pxgrow.com/image/sponsor/user/131.jpg" loading="lazy" />
|
|
251
|
-
</a>
|
|
252
|
-
<a target="_blank" href="https://github.com/daodaolee">
|
|
253
|
-
<img width="40" title="道里" src="https://www.pxgrow.com/image/sponsor/user/108.jpg" loading="lazy" />
|
|
254
|
-
</a>
|
|
255
|
-
<a target="_blank" href="">
|
|
256
|
-
<img width="40" title="dong" src="https://www.pxgrow.com/image/sponsor/user/yellow.png" loading="lazy" />
|
|
257
|
-
</a>
|
|
258
|
-
<a target="_blank" href="">
|
|
259
|
-
<img width="40" title="三一" src="https://www.pxgrow.com/image/sponsor/user/151.jpeg" loading="lazy" />
|
|
260
|
-
</a>
|
|
261
|
-
<a target="_blank" href="https://www.fastadmin.net">
|
|
262
|
-
<img width="40" title="F4nniu" src="https://api.pxgrow.com/uploads/avatar/3Pv/P26/P3/u.jpg" loading="lazy" />
|
|
263
|
-
</a>
|
|
264
|
-
<a target="_blank" href="">
|
|
265
|
-
<img width="40" title="风之影" src="https://www.pxgrow.com/image/sponsor/user/81.jpg" loading="lazy" />
|
|
266
|
-
</a>
|
|
267
|
-
<a target="_blank" href="">
|
|
268
|
-
<img width="40" title="😊" src="https://www.pxgrow.com/image/sponsor/user/79.jpg" loading="lazy" />
|
|
269
|
-
</a>
|
|
270
|
-
<a target="_blank" href="https://pro.kuaitu.cc/">
|
|
271
|
-
<img width="40" title="快图设计" src="https://www.pxgrow.com/image/sponsor/user/72.jpg" loading="lazy" />
|
|
272
|
-
</a>
|
|
273
|
-
<a target="_blank" href="">
|
|
274
|
-
<img width="40" title="ycteng" src="https://www.pxgrow.com/image/sponsor/user/purple.png" loading="lazy" />
|
|
275
|
-
</a>
|
|
276
|
-
<a target="_blank" href="https://afdian.com/a/herobeast">
|
|
277
|
-
<img width="40" title="herobeast" src="https://www.pxgrow.com/image/sponsor/user/63.jpeg" loading="lazy" />
|
|
278
|
-
</a>
|
|
279
|
-
<a target="_blank" href="">
|
|
280
|
-
<img width="40" title="Evel" src="https://www.pxgrow.com/image/sponsor/user/62.jpeg" loading="lazy" />
|
|
281
|
-
</a>
|
|
282
|
-
<a target="_blank" href="">
|
|
283
|
-
<img width="40" title="icezeros" src="https://www.pxgrow.com/image/sponsor/user/purple.png" loading="lazy" />
|
|
284
|
-
</a>
|
|
285
|
-
<a target="_blank" href="">
|
|
286
|
-
<img width="40" title="林伟强@青柠设计" src="https://www.pxgrow.com/image/sponsor/user/purple.png" loading="lazy" />
|
|
287
|
-
</a>
|
|
288
|
-
<a target="_blank" href="https://github.com/Misakey-Mikoto">
|
|
289
|
-
<img width="40" title="misakey" src="https://www.pxgrow.com/image/sponsor/user/orange.png" loading="lazy" />
|
|
290
|
-
</a>
|
|
291
|
-
<a target="_blank" href="">
|
|
292
|
-
<img width="40" title="junna" src="https://www.pxgrow.com/image/sponsor/user/57.jpeg" loading="lazy" />
|
|
293
|
-
</a>
|
|
294
|
-
<a target="_blank" href="http://www.nickspace.cn">
|
|
295
|
-
<img width="40" title="NickSpace" src="https://www.pxgrow.com/image/sponsor/user/purple.png" loading="lazy" />
|
|
296
|
-
</a>
|
|
297
|
-
<a target="_blank" href="https://afdian.com/a/ziiziz">
|
|
298
|
-
<img width="40" title="YGG" src="https://www.pxgrow.com/image/sponsor/user/55.jpeg" loading="lazy" />
|
|
299
|
-
</a>
|
|
300
|
-
<a target="_blank" href="">
|
|
301
|
-
<img width="40" title="tony" src="https://www.pxgrow.com/image/sponsor/user/51.jpeg" loading="lazy" />
|
|
302
|
-
</a>
|
|
303
|
-
<a target="_blank" href="">
|
|
304
|
-
<img width="40" title="lk" src="https://api.pxgrow.com/uploads/avatar/39A/334/wC/u.jpg" loading="lazy" />
|
|
305
|
-
</a>
|
|
306
|
-
<a target="_blank" href="">
|
|
307
|
-
<img width="40" title="用户z89CSwv9" src="https://www.pxgrow.com/image/user/default/2.jpg" loading="lazy" />
|
|
308
|
-
</a>
|
|
309
|
-
<a target="_blank" href="">
|
|
310
|
-
<img width="40" title="南" src="https://www.pxgrow.com/image/sponsor/user/purple.png" loading="lazy" />
|
|
311
|
-
</a>
|
|
312
|
-
<a target="_blank" href="">
|
|
313
|
-
<img width="40" title=".." src="https://www.pxgrow.com/image/sponsor/user/44.jpg" loading="lazy" />
|
|
314
|
-
</a>
|
|
315
|
-
<a target="_blank" href="">
|
|
316
|
-
<img width="40" title="__tynam" src="https://www.pxgrow.com/image/sponsor/user/43.jpg" loading="lazy" />
|
|
317
|
-
</a>
|
|
318
|
-
<a target="_blank" href="https://github.com/zhixiaotong">
|
|
319
|
-
<img width="40" title="知晓同丶" src="https://www.pxgrow.com/image/sponsor/user/42.png" loading="lazy" />
|
|
320
|
-
</a>
|
|
321
|
-
<a target="_blank" href="">
|
|
322
|
-
<img width="40" title="馒头" src="https://www.pxgrow.com/image/sponsor/user/41.jpeg" loading="lazy" />
|
|
323
|
-
</a>
|
|
324
|
-
<a target="_blank" href="">
|
|
325
|
-
<img width="40" title="刘杨" src="https://www.pxgrow.com/image/sponsor/user/26.jpeg" loading="lazy" />
|
|
326
|
-
</a>
|
|
327
|
-
<a target="_blank" href="">
|
|
328
|
-
<img width="40" title="Biu" src="https://www.pxgrow.com/image/sponsor/user/32.jpeg" loading="lazy" />
|
|
329
|
-
</a>
|
|
330
|
-
<a target="_blank" href="https://www.leaferjs.com">
|
|
331
|
-
<img width="40" title="Leafer" src="https://www.pxgrow.com/image/sponsor/user/4.jpeg" loading="lazy" />
|
|
332
|
-
</a>
|
|
333
|
-
<a target="_blank" href="">
|
|
334
|
-
<img width="40" title="sunboy" src="https://www.pxgrow.com/image/sponsor/user/36.jpeg" loading="lazy" />
|
|
335
|
-
</a>
|
|
336
|
-
<a target="_blank" href="">
|
|
337
|
-
<img width="40" title="张恒来啦" src="https://www.pxgrow.com/image/sponsor/user/35.jpeg" loading="lazy" />
|
|
338
|
-
</a>
|
|
339
|
-
<a target="_blank" href="">
|
|
340
|
-
<img width="40" title="呆若牦牛" src="https://www.pxgrow.com/image/sponsor/user/34.jpeg" loading="lazy" />
|
|
341
|
-
</a>
|
|
342
|
-
<a target="_blank" href="">
|
|
343
|
-
<img width="40" title="艳霞" src="https://www.pxgrow.com/image/sponsor/user/33.jpeg" loading="lazy" />
|
|
344
|
-
</a>
|
|
345
|
-
<a target="_blank" href="">
|
|
346
|
-
<img width="40" title="skywalker512" src="https://www.pxgrow.com/image/sponsor/user/21.jpeg" loading="lazy" />
|
|
347
|
-
</a>
|
|
348
|
-
<a target="_blank" href="https://www.u-tools.cn/plugins/detail/%E6%88%AA%E5%9B%BE%E5%B7%A5%E5%85%B7%20Plus/index.html">
|
|
349
|
-
<img width="40" title="xiaou@截图工具" src="https://www.pxgrow.com/image/sponsor/user/135.png" loading="lazy" />
|
|
350
|
-
</a>
|
|
351
|
-
<a target="_blank" href="">
|
|
352
|
-
<img width="40" title="黄鸭梨" src="https://www.pxgrow.com/image/sponsor/user/yellow.png" loading="lazy" />
|
|
353
|
-
</a>
|
|
354
|
-
<a target="_blank" href="">
|
|
355
|
-
<img width="40" title="子洋" src="https://www.pxgrow.com/image/sponsor/user/17.jpeg" loading="lazy" />
|
|
356
|
-
</a>
|
|
357
|
-
<a target="_blank" href="">
|
|
358
|
-
<img width="40" title="一只胖憨憨" src="https://api.pxgrow.com/uploads/avatar/249/AzA/32/u.jpg" loading="lazy" />
|
|
359
|
-
</a>
|
|
360
|
-
<a target="_blank" href="danshen.me">
|
|
361
|
-
<img width="40" title="channely" src="https://www.pxgrow.com/image/sponsor/user/15.jpeg" loading="lazy" />
|
|
362
|
-
</a>
|
|
363
|
-
<a target="_blank" href="">
|
|
364
|
-
<img width="40" title="ibryang" src="https://www.pxgrow.com/image/user/default/2.jpg" loading="lazy" />
|
|
365
|
-
</a>
|
|
366
|
-
<a target="_blank" href="">
|
|
367
|
-
<img width="40" title="用户3PvP2Sxw" src="https://www.pxgrow.com/image/user/default/2.jpg" loading="lazy" />
|
|
368
|
-
</a>
|
|
369
|
-
<a target="_blank" href="">
|
|
370
|
-
<img width="40" title="kooriookami" src="https://www.pxgrow.com/image/user/default/3.jpg" loading="lazy" />
|
|
371
|
-
</a>
|
|
372
|
-
<a target="_blank" href="">
|
|
373
|
-
<img width="40" title="毛豆花生" src="https://www.pxgrow.com/image/sponsor/user/8.jpeg" loading="lazy" />
|
|
374
|
-
</a>
|
|
375
|
-
<a target="_blank" href="https://afdian.com/a/programschool">
|
|
376
|
-
<img width="40" title="编程学院" src="https://www.pxgrow.com/image/sponsor/user/7.jpg" loading="lazy" />
|
|
377
|
-
</a>
|
|
378
|
-
<a target="_blank" href="https://afdian.com/u/8230187ef5a811eeba2d5254001e7c00">
|
|
379
|
-
<img width="40" title="Jikun" src="https://www.pxgrow.com/image/sponsor/user/5.jpeg" loading="lazy" />
|
|
380
|
-
</a>
|
|
381
|
-
<a target="_blank" href="">
|
|
382
|
-
<img width="40" title="robot" src="https://www.pxgrow.com/image/sponsor/user/29.jpeg" loading="lazy" />
|
|
383
|
-
</a>
|
|
384
|
-
<a target="_blank" href="">
|
|
385
|
-
<img width="40" title="黄某人" src="https://www.pxgrow.com/image/user/default/3.jpg" loading="lazy" />
|
|
386
|
-
</a>
|
|
387
|
-
<a target="_blank" href="">
|
|
388
|
-
<img width="40" title="爱发电用户_xugk" src="https://www.pxgrow.com/image/sponsor/user/yellow.png" loading="lazy" />
|
|
389
|
-
</a>
|
|
390
|
-
<a target="_blank" href="https://www.pxgrow.com/vip/logo/">
|
|
391
|
-
<img width="40" title="赞助我们" src="https://www.leaferjs.com/image/sponsor/silver/add.jpg" loading="lazy" />
|
|
392
|
-
</a>
|
|
393
|
-
</p>
|
|
394
|
-
|
|
395
|
-
<p><h3 align="center">铜牌赞助</h3></p>
|
|
396
|
-
<p style="display: flex;flex-wrap: wrap;justify-content: center;gap: 15px;">
|
|
397
|
-
parox2014 QGG 小白不白 用户zw8T394C 用户zw8T398C 龙眼吃多了上火 用户zw8T392T 用户z89CSw69 用户CzP9SCAz Kim 用户249AzA8v l0f5c7bf 夏先生 yinuo 用户3wTwAz78 用户zw8T39zT 用户249AzA82 用户CzP9SCvz 用户39A334xT 用户3wTwAz3x 用户zw8T39zC 稀饭、微凉 用户CzP9SCT4 便宜VPS服务器 菲鸽 szhua Cheng Suezp beyond 用户3PvP2S63 o Arvin finallycc 用户39A3346C 大雷 用户CzP9SC4z 随风 用户z89CSwT9 用户3wTwAzCx UPMuling 军杨 桔子雨工作室 用户zw8T37xC 前端炒饭仔 用户z89CSw46 崮生 互动矩阵 ZhanYoHo 何佳Q coderhyh 早上好啊 快图设计 do 毛哥哥 迅排设计 用户z89CSw86 糖果 南城以北 黑色摩天仑 Charm Lauginwing 在路上 Jerry 张余🌈 李狗嗨。💢 用户zw8T376T 用户249AzA2v ʚ LMT ɞ 格子 等等 goosen F4nniu 梁福斌 江万江 杨超 ToB Dev 前端之虎陈随易 A☀️云☀️A zhk 爱发电用户_c9c82 轻简历 爱发电用户_0fac0 wangyesheji.cn 风间 爱发电用户_Tqsm 爱发电用户_6KpE 星小志 zwm 爱发电用户_3725c Noth1ng 纳西妲の√ 爱发电用户_Ahb9 爱发电用户_7617d 冷漠 爱发电用户_9RXB 今日值得读 爱发电用户_49sT 爱发电用户_NFCS 爱发电用户_43ad8 爱发电用户_30455 砖吐筷筷 xiaozhang 爱发电用户_b47b3 longbow1998 爱发电用户_5d755 爱发电用户_b76b8 爱发电用户_e70c2 xiaou@截图工具 ousiri 爱发电用户_039dc 花祁 爱发电用户_99f39 坤坤 爱发电用户_X6hp ycteng 曹吉美爸爸 啸沧海 Ronny 爱发电用户_UXEV Biu 王志强 SaltedFish 爱发电用户_76f9d PD.新城คิดถึง 糖颂缘冥倾 ALBERT. 爱发电用户_Pbm7 Leafer 赞助我们 </p>
|
|
168
|
+
[早期参与生态的社区成员](https://www.leaferjs.com/ui/contribute/)
|
|
169
|
+
|
|
170
|
+
## 致谢赞助商
|
|
171
|
+
|
|
172
|
+
[每一位参与赞助过我们的用户](https://www.leaferjs.com/#footer-sponsor)
|
|
398
173
|
|
|
399
174
|
## License
|
|
400
175
|
|
package/dist/web.js
CHANGED
|
@@ -433,7 +433,7 @@ var LeaferUI = function(exports) {
|
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
435
|
const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
436
|
-
const {float: float$
|
|
436
|
+
const {float: float$4} = MathHelper;
|
|
437
437
|
const tempPoint$5 = {};
|
|
438
438
|
function getWorld() {
|
|
439
439
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
@@ -681,12 +681,12 @@ var LeaferUI = function(exports) {
|
|
|
681
681
|
const cosR = c / scaleY;
|
|
682
682
|
rotation = PI_2 - (d > 0 ? acos(-cosR) : -acos(cosR));
|
|
683
683
|
}
|
|
684
|
-
const cosR = float$
|
|
684
|
+
const cosR = float$4(cos$5(rotation));
|
|
685
685
|
const sinR = sin$5(rotation);
|
|
686
|
-
scaleX = float$
|
|
687
|
-
skewX = cosR ? float$
|
|
688
|
-
skewY = cosR ? float$
|
|
689
|
-
rotation = float$
|
|
686
|
+
scaleX = float$4(scaleX), scaleY = float$4(scaleY);
|
|
687
|
+
skewX = cosR ? float$4((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
|
|
688
|
+
skewY = cosR ? float$4((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
|
|
689
|
+
rotation = float$4(rotation / OneRadian);
|
|
690
690
|
} else {
|
|
691
691
|
scaleX = a;
|
|
692
692
|
scaleY = d;
|
|
@@ -728,7 +728,7 @@ var LeaferUI = function(exports) {
|
|
|
728
728
|
}
|
|
729
729
|
};
|
|
730
730
|
const M$6 = MatrixHelper;
|
|
731
|
-
const {float: float$
|
|
731
|
+
const {float: float$3} = MathHelper;
|
|
732
732
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
733
733
|
const {sin: sin$4, cos: cos$4, abs: abs$6, sqrt: sqrt$2, atan2: atan2$2, min: min$2, round: round$2} = Math;
|
|
734
734
|
const PointHelper = {
|
|
@@ -871,7 +871,7 @@ var LeaferUI = function(exports) {
|
|
|
871
871
|
return points;
|
|
872
872
|
},
|
|
873
873
|
isSame(t, point, quick) {
|
|
874
|
-
return quick ? t.x === point.x && t.y === point.y : float$
|
|
874
|
+
return quick ? t.x === point.x && t.y === point.y : float$3(t.x) === float$3(point.x) && float$3(t.y) === float$3(point.y);
|
|
875
875
|
},
|
|
876
876
|
reset(t) {
|
|
877
877
|
t.x = t.y = 0;
|
|
@@ -1206,7 +1206,7 @@ var LeaferUI = function(exports) {
|
|
|
1206
1206
|
};
|
|
1207
1207
|
const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$2, addPoint: addPoint$2, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
1208
1208
|
const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
|
|
1209
|
-
const {float: float$
|
|
1209
|
+
const {float: float$2, fourNumber: fourNumber} = MathHelper;
|
|
1210
1210
|
const {floor: floor$1, ceil: ceil$1} = Math;
|
|
1211
1211
|
let right$1, bottom$1, boundsRight, boundsBottom;
|
|
1212
1212
|
const point = {};
|
|
@@ -1375,10 +1375,10 @@ var LeaferUI = function(exports) {
|
|
|
1375
1375
|
}
|
|
1376
1376
|
},
|
|
1377
1377
|
float(t, maxLength) {
|
|
1378
|
-
t.x = float$
|
|
1379
|
-
t.y = float$
|
|
1380
|
-
t.width = float$
|
|
1381
|
-
t.height = float$
|
|
1378
|
+
t.x = float$2(t.x, maxLength);
|
|
1379
|
+
t.y = float$2(t.y, maxLength);
|
|
1380
|
+
t.width = float$2(t.width, maxLength);
|
|
1381
|
+
t.height = float$2(t.height, maxLength);
|
|
1382
1382
|
},
|
|
1383
1383
|
add(t, bounds, isPoint) {
|
|
1384
1384
|
right$1 = t.x + t.width;
|
|
@@ -3516,6 +3516,7 @@ var LeaferUI = function(exports) {
|
|
|
3516
3516
|
const {M: M, L: L$1, Z: Z} = PathCommandMap;
|
|
3517
3517
|
const {getCenterX: getCenterX, getCenterY: getCenterY} = PointHelper;
|
|
3518
3518
|
const {arcTo: arcTo} = PathCommandDataHelper;
|
|
3519
|
+
const {float: float$1} = MathHelper;
|
|
3519
3520
|
const PathCorner = {
|
|
3520
3521
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3521
3522
|
let command, lastCommand, commandLen, startXIndex, startYIndex, smoothLen;
|
|
@@ -3556,7 +3557,8 @@ var LeaferUI = function(exports) {
|
|
|
3556
3557
|
break;
|
|
3557
3558
|
|
|
3558
3559
|
case Z:
|
|
3559
|
-
|
|
3560
|
+
if (float$1(x) === float$1(startX) && float$1(y) === float$1(startY)) x = lastX,
|
|
3561
|
+
y = lastY; else arcTo(smooth, x, y, startX, startY, cornerRadius, lastX, lastY, three);
|
|
3560
3562
|
break;
|
|
3561
3563
|
|
|
3562
3564
|
default:
|
|
@@ -4327,37 +4329,39 @@ var LeaferUI = function(exports) {
|
|
|
4327
4329
|
if (oldValue === 0 || value === 0) doBoundsType(leaf);
|
|
4328
4330
|
}
|
|
4329
4331
|
}
|
|
4332
|
+
function sortParentChange(parent) {
|
|
4333
|
+
parent.__layout.childrenSortChange();
|
|
4334
|
+
if (parent.__.flow) parent.__layout.boxChange();
|
|
4335
|
+
}
|
|
4330
4336
|
function sortType(defaultValue) {
|
|
4331
4337
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4332
4338
|
set(value) {
|
|
4333
4339
|
if (this.__setAttr(key, value)) {
|
|
4334
|
-
this.
|
|
4335
|
-
const {parent: parent} = this;
|
|
4336
|
-
parent.__layout.childrenSortChange();
|
|
4337
|
-
if (parent.__.flow) parent.__layout.boxChange();
|
|
4338
|
-
});
|
|
4340
|
+
this.waitParentChange(sortParentChange);
|
|
4339
4341
|
}
|
|
4340
4342
|
}
|
|
4341
4343
|
}));
|
|
4342
4344
|
}
|
|
4345
|
+
function maskParentChange(parent) {
|
|
4346
|
+
parent.__updateMask();
|
|
4347
|
+
}
|
|
4343
4348
|
function maskType(defaultValue, updateSelf) {
|
|
4344
4349
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4345
4350
|
set(value) {
|
|
4346
4351
|
if (this.__setAttr(key, value)) {
|
|
4347
4352
|
this.__layout.boxChanged || this.__layout.boxChange();
|
|
4348
|
-
updateSelf ? this.__updateMask() : this.
|
|
4349
|
-
this.parent.__updateMask(value);
|
|
4350
|
-
});
|
|
4353
|
+
updateSelf ? this.__updateMask() : this.waitParentChange(maskParentChange);
|
|
4351
4354
|
}
|
|
4352
4355
|
}
|
|
4353
4356
|
}));
|
|
4354
4357
|
}
|
|
4358
|
+
function eraserParentChange(parent) {
|
|
4359
|
+
parent.__updateEraser();
|
|
4360
|
+
}
|
|
4355
4361
|
function eraserType(defaultValue) {
|
|
4356
4362
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4357
4363
|
set(value) {
|
|
4358
|
-
this.__setAttr(key, value) && this.
|
|
4359
|
-
this.parent.__updateEraser(value);
|
|
4360
|
-
});
|
|
4364
|
+
this.__setAttr(key, value) && this.waitParentChange(eraserParentChange);
|
|
4361
4365
|
}
|
|
4362
4366
|
}));
|
|
4363
4367
|
}
|
|
@@ -4716,10 +4720,11 @@ var LeaferUI = function(exports) {
|
|
|
4716
4720
|
hasOffset(t) {
|
|
4717
4721
|
return t.offsetX || t.offsetY;
|
|
4718
4722
|
},
|
|
4719
|
-
hasParent(p, parent) {
|
|
4723
|
+
hasParent(p, parent, minLevel) {
|
|
4720
4724
|
if (!parent) return false;
|
|
4721
4725
|
while (p) {
|
|
4722
4726
|
if (parent === p) return true;
|
|
4727
|
+
if (minLevel && p.__level === minLevel) return;
|
|
4723
4728
|
p = p.parent;
|
|
4724
4729
|
}
|
|
4725
4730
|
},
|
|
@@ -4736,6 +4741,9 @@ var LeaferUI = function(exports) {
|
|
|
4736
4741
|
onAnimate && onAnimate();
|
|
4737
4742
|
}
|
|
4738
4743
|
};
|
|
4744
|
+
function isTrackChanges(leafer) {
|
|
4745
|
+
return leafer && leafer.config.trackChanges;
|
|
4746
|
+
}
|
|
4739
4747
|
const L = LeafHelper;
|
|
4740
4748
|
const {updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$1, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange} = L;
|
|
4741
4749
|
function getTempLocal(t, worldPoint) {
|
|
@@ -4783,6 +4791,16 @@ var LeaferUI = function(exports) {
|
|
|
4783
4791
|
sort(a, b) {
|
|
4784
4792
|
return a.__.zIndex === b.__.zIndex ? a.__tempNumber - b.__tempNumber : a.__.zIndex - b.__.zIndex;
|
|
4785
4793
|
},
|
|
4794
|
+
zIndex(branch, child, index) {
|
|
4795
|
+
const {children: children} = branch, before = children[index - 1], after = children[index];
|
|
4796
|
+
if (before && after) {
|
|
4797
|
+
if (child.zIndex < before.zIndex || child.zIndex > after.zIndex) child.zIndex = (before.zIndex + after.zIndex) / 2;
|
|
4798
|
+
} else if (before) {
|
|
4799
|
+
if (child.zIndex < before.zIndex) child.zIndex = before.zIndex + 1;
|
|
4800
|
+
} else if (after) {
|
|
4801
|
+
if (child.zIndex > after.zIndex) child.zIndex = after.zIndex - 1;
|
|
4802
|
+
}
|
|
4803
|
+
},
|
|
4786
4804
|
pushAllChildBranch(branch, leafList) {
|
|
4787
4805
|
branch.__tempNumber = 1;
|
|
4788
4806
|
if (branch.__.__childBranchNumber) {
|
|
@@ -5667,7 +5685,7 @@ var LeaferUI = function(exports) {
|
|
|
5667
5685
|
},
|
|
5668
5686
|
emitPropertyEvent(type, name, oldValue, newValue) {
|
|
5669
5687
|
const {leafer: leafer} = this;
|
|
5670
|
-
if (leafer
|
|
5688
|
+
if (isTrackChanges(leafer) || leafer.zoomLayer === this) {
|
|
5671
5689
|
const event = new PropertyEvent(type, this, name, oldValue, newValue);
|
|
5672
5690
|
this.isLeafer || this.hasEvent(type) && this.emitEvent(event);
|
|
5673
5691
|
leafer.emitEvent(event);
|
|
@@ -6063,6 +6081,11 @@ var LeaferUI = function(exports) {
|
|
|
6063
6081
|
this.__hasMask = this.__hasEraser = null;
|
|
6064
6082
|
this.forceUpdate();
|
|
6065
6083
|
}
|
|
6084
|
+
waitParentChange(item) {
|
|
6085
|
+
this.__parentChange || (this.__parentChange = []);
|
|
6086
|
+
if (!this.__parentChange.includes(item)) this.__parentChange.push(item);
|
|
6087
|
+
if (this.parent) item(this.parent, this);
|
|
6088
|
+
}
|
|
6066
6089
|
waitParent(item, bind) {
|
|
6067
6090
|
if (bind) item = item.bind(bind);
|
|
6068
6091
|
this.parent ? item() : this.on(ChildEvent.ADD, item, "once");
|
|
@@ -6098,7 +6121,6 @@ var LeaferUI = function(exports) {
|
|
|
6098
6121
|
}
|
|
6099
6122
|
}
|
|
6100
6123
|
__bindFrame(frame) {
|
|
6101
|
-
if (this.isFrame && frame !== null) frame = this;
|
|
6102
6124
|
this.frame = frame;
|
|
6103
6125
|
if (this.isBranch) {
|
|
6104
6126
|
const {children: children} = this;
|
|
@@ -6150,8 +6172,8 @@ var LeaferUI = function(exports) {
|
|
|
6150
6172
|
__extraUpdate() {
|
|
6151
6173
|
if (this.leaferIsReady) this.leafer.layouter.addExtra(this);
|
|
6152
6174
|
}
|
|
6153
|
-
__updateEraser(
|
|
6154
|
-
this.__hasEraser =
|
|
6175
|
+
__updateEraser() {
|
|
6176
|
+
this.__hasEraser = this.children.some(item => item.__.eraser);
|
|
6155
6177
|
}
|
|
6156
6178
|
__renderEraser(canvas, options) {
|
|
6157
6179
|
canvas.save();
|
|
@@ -6160,7 +6182,7 @@ var LeaferUI = function(exports) {
|
|
|
6160
6182
|
canvas.clearRect(r.x, r.y, r.width, r.height);
|
|
6161
6183
|
canvas.restore();
|
|
6162
6184
|
}
|
|
6163
|
-
__updateMask(
|
|
6185
|
+
__updateMask() {
|
|
6164
6186
|
const hasMask = this.children.some(item => item.__.mask && item.__.visible && item.__.opacity);
|
|
6165
6187
|
this.__hasMask = this.__.maskskip ? hasMask && 0 : hasMask;
|
|
6166
6188
|
}
|
|
@@ -6403,13 +6425,17 @@ var LeaferUI = function(exports) {
|
|
|
6403
6425
|
}
|
|
6404
6426
|
if (child.parent) child.parent.remove(child);
|
|
6405
6427
|
child.parent = this;
|
|
6406
|
-
noIndex
|
|
6428
|
+
if (noIndex) this.children.push(child); else {
|
|
6429
|
+
BranchHelper.zIndex(this, child, index);
|
|
6430
|
+
this.children.splice(index, 0, child);
|
|
6431
|
+
}
|
|
6407
6432
|
if (child.isBranch) this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
|
|
6408
6433
|
const childLayout = child.__layout;
|
|
6409
6434
|
childLayout.boxChanged || childLayout.boxChange();
|
|
6410
6435
|
childLayout.matrixChanged || childLayout.matrixChange();
|
|
6436
|
+
if (child.__parentChange) child.__parentChange.forEach(item => item(this, child));
|
|
6411
6437
|
if (child.__bubbleMap) child.__emitLifeEvent(ChildEvent.ADD);
|
|
6412
|
-
if (this.
|
|
6438
|
+
if (this.frame) child.__bindFrame(this.frame);
|
|
6413
6439
|
if (this.leafer) {
|
|
6414
6440
|
child.__bindLeafer(this.leafer);
|
|
6415
6441
|
if (this.leafer.created) this.__emitChildEvent(ChildEvent.ADD, child);
|
|
@@ -6469,11 +6495,11 @@ var LeaferUI = function(exports) {
|
|
|
6469
6495
|
if (this.leafer.hitCanvasManager) this.leafer.hitCanvasManager.clear();
|
|
6470
6496
|
}
|
|
6471
6497
|
}
|
|
6472
|
-
if (
|
|
6498
|
+
if (child.frame && !child.isFrame) child.__bindFrame(null);
|
|
6473
6499
|
}
|
|
6474
6500
|
__emitChildEvent(type, child) {
|
|
6475
6501
|
const {leafer: leafer} = this;
|
|
6476
|
-
if (leafer
|
|
6502
|
+
if (isTrackChanges(leafer) || leafer.zoomLayer === this) {
|
|
6477
6503
|
const event = new ChildEvent(type, child, this);
|
|
6478
6504
|
if (this.hasEvent(type) && !this.isLeafer) this.emitEvent(event);
|
|
6479
6505
|
leafer.emitEvent(event);
|
|
@@ -6626,7 +6652,12 @@ var LeaferUI = function(exports) {
|
|
|
6626
6652
|
this.levelMap = null;
|
|
6627
6653
|
}
|
|
6628
6654
|
}
|
|
6629
|
-
const version = "2.
|
|
6655
|
+
const version = "2.3.0";
|
|
6656
|
+
if (typeof globalThis !== "undefined") {
|
|
6657
|
+
const globalLeafer = globalThis.Leafer || (globalThis.Leafer = {});
|
|
6658
|
+
globalLeafer.version = version;
|
|
6659
|
+
globalLeafer.Plugin = Plugin;
|
|
6660
|
+
}
|
|
6630
6661
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6631
6662
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6632
6663
|
set zIndex(zIndex) {
|
|
@@ -7734,6 +7765,16 @@ var LeaferUI = function(exports) {
|
|
|
7734
7765
|
});
|
|
7735
7766
|
};
|
|
7736
7767
|
}
|
|
7768
|
+
function frameType() {
|
|
7769
|
+
return (target, key) => {
|
|
7770
|
+
defineKey(target, key, {
|
|
7771
|
+
set(_value) {},
|
|
7772
|
+
get() {
|
|
7773
|
+
return this;
|
|
7774
|
+
}
|
|
7775
|
+
});
|
|
7776
|
+
};
|
|
7777
|
+
}
|
|
7737
7778
|
function createAttr(defaultValue) {
|
|
7738
7779
|
return (target, key) => {
|
|
7739
7780
|
defineKey(target, key, createDescriptor(key, defaultValue));
|
|
@@ -8986,6 +9027,7 @@ var LeaferUI = function(exports) {
|
|
|
8986
9027
|
return true;
|
|
8987
9028
|
}
|
|
8988
9029
|
};
|
|
9030
|
+
__decorate([ frameType() ], exports.Frame.prototype, "frame", void 0);
|
|
8989
9031
|
__decorate([ dataProcessor(FrameData) ], exports.Frame.prototype, "__", void 0);
|
|
8990
9032
|
__decorate([ surfaceType("#FFFFFF") ], exports.Frame.prototype, "fill", void 0);
|
|
8991
9033
|
__decorate([ affectRenderBoundsType("hide") ], exports.Frame.prototype, "overflow", void 0);
|
|
@@ -12860,6 +12902,7 @@ var LeaferUI = function(exports) {
|
|
|
12860
12902
|
exports.emptyData = emptyData;
|
|
12861
12903
|
exports.eraserType = eraserType;
|
|
12862
12904
|
exports.extraPropertyEventMap = extraPropertyEventMap;
|
|
12905
|
+
exports.frameType = frameType;
|
|
12863
12906
|
exports.getBoundsData = getBoundsData;
|
|
12864
12907
|
exports.getDescriptor = getDescriptor;
|
|
12865
12908
|
exports.getMatrixData = getMatrixData;
|
|
@@ -12873,6 +12916,7 @@ var LeaferUI = function(exports) {
|
|
|
12873
12916
|
exports.isNumber = isNumber;
|
|
12874
12917
|
exports.isObject = isObject;
|
|
12875
12918
|
exports.isString = isString;
|
|
12919
|
+
exports.isTrackChanges = isTrackChanges;
|
|
12876
12920
|
exports.isUndefined = isUndefined;
|
|
12877
12921
|
exports.layoutProcessor = layoutProcessor;
|
|
12878
12922
|
exports.leaferTransformAttrMap = leaferTransformAttrMap;
|