@leafer-draw/worker 1.1.2 → 1.2.1
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 +31 -16
- package/dist/worker.min.js +1 -1
- package/dist/worker.module.js +31 -16
- package/dist/worker.module.min.js +1 -1
- package/package.json +6 -6
package/dist/worker.module.js
CHANGED
|
@@ -1402,9 +1402,21 @@ const Run = {
|
|
|
1402
1402
|
};
|
|
1403
1403
|
const R = Run;
|
|
1404
1404
|
|
|
1405
|
-
|
|
1406
|
-
|
|
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$d = Debug.get('UICreator');
|
|
1410
1422
|
const UICreator = {
|
|
@@ -5419,7 +5431,7 @@ let Leaf = class Leaf {
|
|
|
5419
5431
|
this.__[attrName] = value === undefined ? null : undefined;
|
|
5420
5432
|
this[attrName] = value;
|
|
5421
5433
|
}
|
|
5422
|
-
forceRender(_bounds) {
|
|
5434
|
+
forceRender(_bounds, _sync) {
|
|
5423
5435
|
this.forceUpdate('surface');
|
|
5424
5436
|
}
|
|
5425
5437
|
__updateWorldMatrix() { }
|
|
@@ -5629,10 +5641,10 @@ let Leaf = class Leaf {
|
|
|
5629
5641
|
__updatePath() { }
|
|
5630
5642
|
__updateRenderPath() { }
|
|
5631
5643
|
getMotionPathData() {
|
|
5632
|
-
return
|
|
5644
|
+
return Plugin.need('path');
|
|
5633
5645
|
}
|
|
5634
5646
|
getMotionPoint(_motionDistance) {
|
|
5635
|
-
return
|
|
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.
|
|
6004
|
+
const version = "1.2.1";
|
|
5993
6005
|
|
|
5994
6006
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
5995
6007
|
get allowBackgroundColor() { return true; }
|
|
@@ -6714,8 +6726,8 @@ const PaintGradient = {};
|
|
|
6714
6726
|
const Effect = {};
|
|
6715
6727
|
const Export = {};
|
|
6716
6728
|
const State = {
|
|
6717
|
-
setStyleName(_leaf, _styleName, _value) { return
|
|
6718
|
-
set(_leaf, _stateName) { return
|
|
6729
|
+
setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
|
|
6730
|
+
set(_leaf, _stateName) { return Plugin.need('state'); }
|
|
6719
6731
|
};
|
|
6720
6732
|
const Transition = {
|
|
6721
6733
|
list: {},
|
|
@@ -7216,7 +7228,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7216
7228
|
drawer.rect(x, y, width, height);
|
|
7217
7229
|
}
|
|
7218
7230
|
animate(_keyframe, _options, _type, _isTemp) {
|
|
7219
|
-
return
|
|
7231
|
+
return Plugin.need('animate');
|
|
7220
7232
|
}
|
|
7221
7233
|
killAnimate(_type) { }
|
|
7222
7234
|
export(filename, options) {
|
|
@@ -7615,10 +7627,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7615
7627
|
const data = DataHelper.copyAttrs({}, size, canvasSizeAttrs);
|
|
7616
7628
|
Object.keys(data).forEach(key => this[key] = data[key]);
|
|
7617
7629
|
}
|
|
7618
|
-
forceRender(bounds) {
|
|
7619
|
-
|
|
7620
|
-
if (
|
|
7621
|
-
|
|
7630
|
+
forceRender(bounds, sync) {
|
|
7631
|
+
const { renderer } = this;
|
|
7632
|
+
if (renderer) {
|
|
7633
|
+
renderer.addBlock(bounds ? new Bounds(bounds) : this.canvas.bounds);
|
|
7634
|
+
if (this.viewReady)
|
|
7635
|
+
sync ? renderer.render() : renderer.update();
|
|
7636
|
+
}
|
|
7622
7637
|
}
|
|
7623
7638
|
requestRender(change = false) {
|
|
7624
7639
|
if (this.renderer)
|
|
@@ -7794,7 +7809,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7794
7809
|
this.requestRender();
|
|
7795
7810
|
}
|
|
7796
7811
|
zoom(_zoomType, _padding, _fixedScale) {
|
|
7797
|
-
return
|
|
7812
|
+
return Plugin.need('view');
|
|
7798
7813
|
}
|
|
7799
7814
|
getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
|
|
7800
7815
|
getValidScale(changeScale) { return changeScale; }
|
|
@@ -10232,4 +10247,4 @@ Object.assign(Export, ExportModule);
|
|
|
10232
10247
|
|
|
10233
10248
|
useCanvas();
|
|
10234
10249
|
|
|
10235
|
-
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, 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, MyImage, 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, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, 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, naturalBoundsType,
|
|
10250
|
+
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, 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, MyImage, 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, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, 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, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|