@leafer-ui/worker 1.1.1 → 1.2.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/dist/worker.js CHANGED
@@ -1405,9 +1405,21 @@ var LeaferUI = (function (exports) {
1405
1405
  };
1406
1406
  const R = Run;
1407
1407
 
1408
- function needPlugin(name) {
1409
- console.error('need plugin: @leafer-in/' + name);
1410
- }
1408
+ const Plugin = {
1409
+ list: {},
1410
+ add(name) {
1411
+ this.list[name] = true;
1412
+ },
1413
+ check(name, tip) {
1414
+ const rs = this.list[name];
1415
+ if (!rs && tip)
1416
+ this.need(name);
1417
+ return rs;
1418
+ },
1419
+ need(name) {
1420
+ console.error('need plugin: @leafer-in/' + name);
1421
+ }
1422
+ };
1411
1423
 
1412
1424
  const debug$e = Debug.get('UICreator');
1413
1425
  const UICreator = {
@@ -5632,10 +5644,10 @@ var LeaferUI = (function (exports) {
5632
5644
  __updatePath() { }
5633
5645
  __updateRenderPath() { }
5634
5646
  getMotionPathData() {
5635
- return needPlugin('path');
5647
+ return Plugin.need('path');
5636
5648
  }
5637
5649
  getMotionPoint(_motionDistance) {
5638
- return needPlugin('path');
5650
+ return Plugin.need('path');
5639
5651
  }
5640
5652
  getMotionTotal() {
5641
5653
  return 0;
@@ -5992,7 +6004,7 @@ var LeaferUI = (function (exports) {
5992
6004
  }
5993
6005
  }
5994
6006
 
5995
- const version = "1.1.1";
6007
+ const version = "1.2.0";
5996
6008
 
5997
6009
  class LeaferCanvas extends LeaferCanvasBase {
5998
6010
  get allowBackgroundColor() { return true; }
@@ -6990,8 +7002,8 @@ var LeaferUI = (function (exports) {
6990
7002
  const Effect = {};
6991
7003
  const Export = {};
6992
7004
  const State = {
6993
- setStyleName(_leaf, _styleName, _value) { return needPlugin('state'); },
6994
- set(_leaf, _stateName) { return needPlugin('state'); }
7005
+ setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
7006
+ set(_leaf, _stateName) { return Plugin.need('state'); }
6995
7007
  };
6996
7008
  const Transition = {
6997
7009
  list: {},
@@ -7492,7 +7504,7 @@ var LeaferUI = (function (exports) {
7492
7504
  drawer.rect(x, y, width, height);
7493
7505
  }
7494
7506
  animate(_keyframe, _options, _type, _isTemp) {
7495
- return needPlugin('animate');
7507
+ return Plugin.need('animate');
7496
7508
  }
7497
7509
  killAnimate(_type) { }
7498
7510
  export(filename, options) {
@@ -8070,7 +8082,7 @@ var LeaferUI = (function (exports) {
8070
8082
  this.requestRender();
8071
8083
  }
8072
8084
  zoom(_zoomType, _padding, _fixedScale) {
8073
- return needPlugin('view');
8085
+ return Plugin.need('view');
8074
8086
  }
8075
8087
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
8076
8088
  getValidScale(changeScale) { return changeScale; }
@@ -11891,6 +11903,7 @@ var LeaferUI = (function (exports) {
11891
11903
  exports.PathNumberCommandMap = PathNumberCommandMap;
11892
11904
  exports.PenData = PenData;
11893
11905
  exports.Platform = Platform;
11906
+ exports.Plugin = Plugin;
11894
11907
  exports.Point = Point;
11895
11908
  exports.PointHelper = PointHelper;
11896
11909
  exports.PointerButton = PointerButton;
@@ -11950,7 +11963,6 @@ var LeaferUI = (function (exports) {
11950
11963
  exports.layoutProcessor = layoutProcessor;
11951
11964
  exports.maskType = maskType;
11952
11965
  exports.naturalBoundsType = naturalBoundsType;
11953
- exports.needPlugin = needPlugin;
11954
11966
  exports.opacityType = opacityType;
11955
11967
  exports.pathInputType = pathInputType;
11956
11968
  exports.pathType = pathType;