@leafer/core 1.4.2 → 1.5.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/lib/core.esm.js CHANGED
@@ -4070,12 +4070,11 @@ function defineDataProcessor(target, key, defaultValue) {
4070
4070
  if (defaultValue === undefined) {
4071
4071
  property.get = function () { return this[computedKey]; };
4072
4072
  }
4073
- else if (typeof defaultValue === 'object') {
4074
- const { clone } = DataHelper;
4073
+ else if (typeof defaultValue === 'function') {
4075
4074
  property.get = function () {
4076
4075
  let v = this[computedKey];
4077
4076
  if (v === undefined)
4078
- this[computedKey] = v = clone(defaultValue);
4077
+ this[computedKey] = v = defaultValue(this.__leaf);
4079
4078
  return v;
4080
4079
  };
4081
4080
  }
@@ -5722,10 +5721,10 @@ let Leaf = class Leaf {
5722
5721
  static changeAttr(attrName, defaultValue, fn) {
5723
5722
  fn ? this.addAttr(attrName, defaultValue, fn) : defineDataProcessor(this.prototype, attrName, defaultValue);
5724
5723
  }
5725
- static addAttr(attrName, defaultValue, fn) {
5724
+ static addAttr(attrName, defaultValue, fn, helpValue) {
5726
5725
  if (!fn)
5727
5726
  fn = boundsType;
5728
- fn(defaultValue)(this.prototype, attrName);
5727
+ fn(defaultValue, helpValue)(this.prototype, attrName);
5729
5728
  }
5730
5729
  __emitLifeEvent(type) {
5731
5730
  if (this.hasEvent(type))
@@ -6052,7 +6051,7 @@ class LeafLevelList {
6052
6051
  }
6053
6052
  }
6054
6053
 
6055
- const version = "1.4.2";
6054
+ const version = "1.5.0";
6056
6055
 
6057
6056
  export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, useModule, version, visibleType };
6058
6057
  //# sourceMappingURL=core.esm.js.map