@leafer-game/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.
@@ -1402,9 +1402,21 @@ const Run = {
1402
1402
  };
1403
1403
  const R = Run;
1404
1404
 
1405
- function needPlugin(name) {
1406
- console.error('need plugin: @leafer-in/' + name);
1407
- }
1405
+ const Plugin = {
1406
+ list: {},
1407
+ add(name) {
1408
+ this.list[name] = true;
1409
+ },
1410
+ check(name, tip) {
1411
+ const rs = this.list[name];
1412
+ if (!rs && tip)
1413
+ this.need(name);
1414
+ return rs;
1415
+ },
1416
+ need(name) {
1417
+ console.error('need plugin: @leafer-in/' + name);
1418
+ }
1419
+ };
1408
1420
 
1409
1421
  const debug$e = Debug.get('UICreator');
1410
1422
  const UICreator = {
@@ -5629,10 +5641,10 @@ let Leaf = class Leaf {
5629
5641
  __updatePath() { }
5630
5642
  __updateRenderPath() { }
5631
5643
  getMotionPathData() {
5632
- return needPlugin('path');
5644
+ return Plugin.need('path');
5633
5645
  }
5634
5646
  getMotionPoint(_motionDistance) {
5635
- return needPlugin('path');
5647
+ return Plugin.need('path');
5636
5648
  }
5637
5649
  getMotionTotal() {
5638
5650
  return 0;
@@ -5989,7 +6001,7 @@ class LeafLevelList {
5989
6001
  }
5990
6002
  }
5991
6003
 
5992
- const version = "1.1.1";
6004
+ const version = "1.2.0";
5993
6005
 
5994
6006
  class LeaferCanvas extends LeaferCanvasBase {
5995
6007
  get allowBackgroundColor() { return true; }
@@ -6987,8 +6999,8 @@ const PaintGradient = {};
6987
6999
  const Effect = {};
6988
7000
  const Export = {};
6989
7001
  const State = {
6990
- setStyleName(_leaf, _styleName, _value) { return needPlugin('state'); },
6991
- set(_leaf, _stateName) { return needPlugin('state'); }
7002
+ setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
7003
+ set(_leaf, _stateName) { return Plugin.need('state'); }
6992
7004
  };
6993
7005
  const Transition = {
6994
7006
  list: {},
@@ -7489,7 +7501,7 @@ let UI = UI_1 = class UI extends Leaf {
7489
7501
  drawer.rect(x, y, width, height);
7490
7502
  }
7491
7503
  animate(_keyframe, _options, _type, _isTemp) {
7492
- return needPlugin('animate');
7504
+ return Plugin.need('animate');
7493
7505
  }
7494
7506
  killAnimate(_type) { }
7495
7507
  export(filename, options) {
@@ -8067,7 +8079,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8067
8079
  this.requestRender();
8068
8080
  }
8069
8081
  zoom(_zoomType, _padding, _fixedScale) {
8070
- return needPlugin('view');
8082
+ return Plugin.need('view');
8071
8083
  }
8072
8084
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
8073
8085
  getValidScale(changeScale) { return changeScale; }
@@ -11962,6 +11974,8 @@ Robot = __decorate([
11962
11974
  registerUI()
11963
11975
  ], Robot);
11964
11976
 
11977
+ Plugin.add('robot');
11978
+
11965
11979
  function stateType(defaultValue, styleName) {
11966
11980
  return decorateLeafAttr(defaultValue, (key) => attr({
11967
11981
  set(value) {
@@ -12231,6 +12245,7 @@ function checkState(stateName, leaf, button) {
12231
12245
  return !!find;
12232
12246
  }
12233
12247
 
12248
+ Plugin.add('state');
12234
12249
  State.animateExcludes = {
12235
12250
  animation: 1,
12236
12251
  animationOut: 1,
@@ -13107,6 +13122,7 @@ function hsla(h, s, l, a = 1) {
13107
13122
  return { r: round$1(r * 255), g: round$1(g * 255), b: round$1(b * 255), a };
13108
13123
  }
13109
13124
 
13125
+ Plugin.add('color');
13110
13126
  ColorConvert.object = colorToRGBA;
13111
13127
 
13112
13128
  const { round } = Math;
@@ -13168,6 +13184,8 @@ function shadow(from, to, t) {
13168
13184
  };
13169
13185
  }
13170
13186
 
13187
+ Plugin.add('animate');
13188
+ setTimeout(() => Plugin.check('color', true));
13171
13189
  State.canAnimate = true;
13172
13190
  Object.assign(Transition, TransitionModule);
13173
13191
  Object.assign(Transition.list, TransitionList);
@@ -13440,6 +13458,7 @@ function motionPathType(defaultValue) {
13440
13458
  }));
13441
13459
  }
13442
13460
 
13461
+ Plugin.add('motion-path');
13443
13462
  Transition.register('motion', function (from, to, t, target) {
13444
13463
  if (!from)
13445
13464
  from = 0;
@@ -13541,4 +13560,4 @@ function getMotionPathData(leaf) {
13541
13560
  return data.__pathForMotion = HighCurveHelper.getMotionPathData(leaf.getPath(true, true));
13542
13561
  }
13543
13562
 
13544
- export { AlignHelper, Animate, AnimateEasing, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, needPlugin, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
13563
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };