@antv/g 5.5.2 → 5.6.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/AbstractRenderer.d.ts +9 -2
- package/dist/AbstractRenderer.d.ts.map +1 -1
- package/dist/Canvas.d.ts +2 -1
- package/dist/Canvas.d.ts.map +1 -1
- package/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/css/parser/path.d.ts.map +1 -1
- package/dist/css/parser/transform.d.ts +1 -0
- package/dist/css/parser/transform.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyFilter.d.ts +1 -0
- package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -1
- package/dist/display-objects/DisplayObject.d.ts.map +1 -1
- package/dist/dom/Document.d.ts +3 -3
- package/dist/dom/Document.d.ts.map +1 -1
- package/dist/index.esm.js +1981 -1906
- package/dist/index.js +1982 -1905
- package/dist/index.umd.js +3342 -2090
- package/dist/index.umd.min.js +2 -2
- package/dist/services/RenderingService.d.ts +4 -0
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/SceneGraphService.d.ts.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -8215,6 +8215,10 @@ var memoizedParsePath = memoize(function (path) {
|
|
|
8215
8215
|
var absolutePath;
|
|
8216
8216
|
|
|
8217
8217
|
try {
|
|
8218
|
+
if (Array.isArray(path) && path.length === 0) {
|
|
8219
|
+
throw new Error();
|
|
8220
|
+
}
|
|
8221
|
+
|
|
8218
8222
|
absolutePath = normalizePath(path);
|
|
8219
8223
|
} catch (e) {
|
|
8220
8224
|
absolutePath = normalizePath('');
|
|
@@ -8252,7 +8256,7 @@ var memoizedParsePath = memoize(function (path) {
|
|
|
8252
8256
|
curve: curve,
|
|
8253
8257
|
totalLength: length,
|
|
8254
8258
|
zCommandIndexes: zCommandIndexes,
|
|
8255
|
-
rect: new Rectangle(x, y, width, height)
|
|
8259
|
+
rect: new Rectangle(Number.isFinite(x) ? x : 0, Number.isFinite(y) ? y : 0, Number.isFinite(width) ? width : 0, Number.isFinite(height) ? height : 0)
|
|
8256
8260
|
};
|
|
8257
8261
|
}, function (path) {
|
|
8258
8262
|
return isString(path) ? path : path2String(path);
|
|
@@ -8756,12 +8760,12 @@ function convertToMatrix(transformList) {
|
|
|
8756
8760
|
|
|
8757
8761
|
function makeMatrixDecomposition(transformList) {
|
|
8758
8762
|
var translate = [0, 0, 0];
|
|
8759
|
-
var scale = [
|
|
8763
|
+
var scale = [1, 1, 1];
|
|
8760
8764
|
var skew = [0, 0, 0];
|
|
8761
8765
|
var perspective = [0, 0, 0, 1];
|
|
8762
8766
|
var quaternion = [0, 0, 0, 1];
|
|
8763
8767
|
decomposeMatrix(convertToMatrix(transformList), translate, scale, skew, perspective, quaternion);
|
|
8764
|
-
return [translate, scale, skew, quaternion, perspective];
|
|
8768
|
+
return [[translate, scale, skew, quaternion, perspective]];
|
|
8765
8769
|
}
|
|
8766
8770
|
|
|
8767
8771
|
var composeMatrix = function () {
|
|
@@ -8856,14 +8860,16 @@ function mergeMatrices(left, right) {
|
|
|
8856
8860
|
|
|
8857
8861
|
if (left.decompositionPair !== right) {
|
|
8858
8862
|
// @ts-ignore
|
|
8859
|
-
left.decompositionPair = right;
|
|
8863
|
+
left.decompositionPair = right; // @ts-ignore
|
|
8864
|
+
|
|
8860
8865
|
leftArgs = makeMatrixDecomposition(left);
|
|
8861
8866
|
} // @ts-ignore
|
|
8862
8867
|
|
|
8863
8868
|
|
|
8864
8869
|
if (right.decompositionPair !== left) {
|
|
8865
8870
|
// @ts-ignore
|
|
8866
|
-
right.decompositionPair = left;
|
|
8871
|
+
right.decompositionPair = left; // @ts-ignore
|
|
8872
|
+
|
|
8867
8873
|
rightArgs = makeMatrixDecomposition(right);
|
|
8868
8874
|
}
|
|
8869
8875
|
|
|
@@ -9050,7 +9056,15 @@ function mergeTransforms(left, right, target) {
|
|
|
9050
9056
|
var stringifiedArgs = args.map(function (arg, j) {
|
|
9051
9057
|
return types[i][1][j](arg);
|
|
9052
9058
|
}).join(',');
|
|
9053
|
-
|
|
9059
|
+
|
|
9060
|
+
if (types[i][0] === 'matrix' && stringifiedArgs.split(',').length === 16) {
|
|
9061
|
+
types[i][0] = 'matrix3d';
|
|
9062
|
+
}
|
|
9063
|
+
|
|
9064
|
+
if (types[i][0] === 'matrix3d' && stringifiedArgs.split(',').length === 6) {
|
|
9065
|
+
types[i][0] = 'matrix';
|
|
9066
|
+
}
|
|
9067
|
+
|
|
9054
9068
|
return types[i][0] + '(' + stringifiedArgs + ')';
|
|
9055
9069
|
}).join(' ');
|
|
9056
9070
|
}];
|
|
@@ -10555,2336 +10569,2337 @@ var Element = /*#__PURE__*/function (_Node) {
|
|
|
10555
10569
|
return Element;
|
|
10556
10570
|
}(Node);
|
|
10557
10571
|
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10572
|
+
var DisplayObjectPool = /*#__PURE__*/function () {
|
|
10573
|
+
function DisplayObjectPool() {
|
|
10574
|
+
this.pool = {};
|
|
10575
|
+
this.htmlPool = [];
|
|
10576
|
+
}
|
|
10561
10577
|
|
|
10562
|
-
var
|
|
10563
|
-
_inheritsLoose(AnimationEvent, _FederatedEvent);
|
|
10578
|
+
var _proto = DisplayObjectPool.prototype;
|
|
10564
10579
|
|
|
10565
|
-
function
|
|
10566
|
-
|
|
10580
|
+
_proto.getByEntity = function getByEntity(entity) {
|
|
10581
|
+
return this.pool[entity];
|
|
10582
|
+
};
|
|
10567
10583
|
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
_this.timelineTime = void 0;
|
|
10571
|
-
_this.currentTime = currentTime;
|
|
10572
|
-
_this.timelineTime = timelineTime; // @ts-ignore
|
|
10584
|
+
_proto.add = function add(entity, groupOrShape) {
|
|
10585
|
+
this.pool[entity] = groupOrShape;
|
|
10573
10586
|
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10587
|
+
if (groupOrShape.nodeName === Shape.HTML) {
|
|
10588
|
+
this.htmlPool.push(groupOrShape);
|
|
10589
|
+
}
|
|
10590
|
+
};
|
|
10577
10591
|
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
_this.timeStamp = Date.now();
|
|
10582
|
-
_this.currentTime = currentTime;
|
|
10583
|
-
_this.timelineTime = timelineTime;
|
|
10584
|
-
return _this;
|
|
10585
|
-
}
|
|
10592
|
+
_proto.remove = function remove(entity) {
|
|
10593
|
+
var existed = this.pool[entity];
|
|
10594
|
+
delete this.pool[entity];
|
|
10586
10595
|
|
|
10587
|
-
|
|
10588
|
-
|
|
10596
|
+
if (existed.nodeName === Shape.HTML) {
|
|
10597
|
+
var index = this.htmlPool.indexOf(existed);
|
|
10598
|
+
this.htmlPool.splice(index, 1);
|
|
10599
|
+
}
|
|
10600
|
+
};
|
|
10589
10601
|
|
|
10590
|
-
|
|
10602
|
+
_proto.getHTMLs = function getHTMLs() {
|
|
10603
|
+
return this.htmlPool;
|
|
10604
|
+
};
|
|
10605
|
+
|
|
10606
|
+
return DisplayObjectPool;
|
|
10607
|
+
}();
|
|
10608
|
+
|
|
10609
|
+
DisplayObjectPool = __decorate([singleton()], DisplayObjectPool);
|
|
10610
|
+
|
|
10611
|
+
var DEFAULT_STYLE_PROPS = {
|
|
10612
|
+
anchor: '',
|
|
10613
|
+
opacity: '',
|
|
10614
|
+
fillOpacity: '',
|
|
10615
|
+
strokeOpacity: '',
|
|
10616
|
+
fill: '',
|
|
10617
|
+
stroke: '',
|
|
10618
|
+
transform: '',
|
|
10619
|
+
transformOrigin: '',
|
|
10620
|
+
visibility: '',
|
|
10621
|
+
pointerEvents: '',
|
|
10622
|
+
lineWidth: '',
|
|
10623
|
+
lineCap: '',
|
|
10624
|
+
lineJoin: '',
|
|
10625
|
+
increasedLineWidthForHitTesting: '',
|
|
10626
|
+
fontSize: '',
|
|
10627
|
+
fontFamily: '',
|
|
10628
|
+
fontStyle: '',
|
|
10629
|
+
fontWeight: '',
|
|
10630
|
+
fontVariant: '',
|
|
10631
|
+
textAlign: '',
|
|
10632
|
+
textBaseline: '',
|
|
10633
|
+
textTransform: '',
|
|
10634
|
+
zIndex: '',
|
|
10635
|
+
filter: ''
|
|
10636
|
+
};
|
|
10591
10637
|
/**
|
|
10592
|
-
*
|
|
10638
|
+
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
10639
|
+
*
|
|
10640
|
+
* mixins: Animatable, Transformable, Visible
|
|
10641
|
+
* @see https://github.com/tannerntannern/ts-mixer/blob/master/README.md#mixing-generic-classes
|
|
10642
|
+
*
|
|
10643
|
+
* Provide abilities in scene graph, such as:
|
|
10644
|
+
* * transform `translate/rotate/scale`
|
|
10645
|
+
* * add/remove child
|
|
10646
|
+
* * visibility and z-index
|
|
10647
|
+
*
|
|
10648
|
+
* Those abilities are implemented with those components: `Transform/Sortable/Visible`.
|
|
10649
|
+
*
|
|
10650
|
+
* Emit following events:
|
|
10651
|
+
* * init
|
|
10652
|
+
* * destroy
|
|
10653
|
+
* * attributeChanged
|
|
10593
10654
|
*/
|
|
10594
10655
|
|
|
10595
|
-
var
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
this.timeline = void 0;
|
|
10599
|
-
this.id = void 0;
|
|
10600
|
-
this.currentTimePending = false;
|
|
10601
|
-
this._idle = true;
|
|
10602
|
-
this._paused = false;
|
|
10603
|
-
this._finishedFlag = true;
|
|
10604
|
-
this.oldPlayState = void 0;
|
|
10605
|
-
this._holdTime = void 0;
|
|
10606
|
-
this.readyPromise = void 0;
|
|
10607
|
-
this.finishedPromise = void 0;
|
|
10608
|
-
this.resolveReadyPromise = void 0;
|
|
10609
|
-
this.rejectReadyPromise = void 0;
|
|
10610
|
-
this.resolveFinishedPromise = void 0;
|
|
10611
|
-
this.rejectFinishedPromise = void 0;
|
|
10612
|
-
this.onfinish = void 0;
|
|
10613
|
-
this.oncancel = void 0;
|
|
10614
|
-
this.onframe = void 0;
|
|
10615
|
-
this._currentTime = 0;
|
|
10616
|
-
this._startTime = void 0;
|
|
10617
|
-
this._playbackRate = 1;
|
|
10618
|
-
this._inEffect = void 0;
|
|
10619
|
-
this._inTimeline = true;
|
|
10620
|
-
this.onremove = void 0;
|
|
10621
|
-
this.effect = effect;
|
|
10622
|
-
effect.animation = this;
|
|
10623
|
-
this.timeline = timeline;
|
|
10624
|
-
this.id = "" + sequenceNumber++;
|
|
10625
|
-
this._inEffect = !!this.effect.update(0);
|
|
10626
|
-
this._holdTime = 0;
|
|
10627
|
-
this._paused = false;
|
|
10628
|
-
this.oldPlayState = 'idle';
|
|
10629
|
-
this.updatePromises();
|
|
10630
|
-
}
|
|
10656
|
+
var DisplayObject = /*#__PURE__*/function (_Element) {
|
|
10657
|
+
_inheritsLoose(DisplayObject, _Element);
|
|
10658
|
+
|
|
10631
10659
|
/**
|
|
10632
|
-
*
|
|
10633
|
-
* resolve/reject ready/finished Promise according to current state
|
|
10660
|
+
* contains style props in constructor's params, eg. fill, stroke...
|
|
10634
10661
|
*/
|
|
10635
10662
|
|
|
10663
|
+
/**
|
|
10664
|
+
* push to active animations after calling `animate()`
|
|
10665
|
+
*/
|
|
10666
|
+
function DisplayObject(config) {
|
|
10667
|
+
var _this$config$capture;
|
|
10636
10668
|
|
|
10637
|
-
|
|
10669
|
+
var _this;
|
|
10638
10670
|
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
var newPlayState = this.pending ? 'pending' : this.playState;
|
|
10671
|
+
_this = _Element.call(this) || this; // assign name, id to config
|
|
10672
|
+
// eg. group.get('name')
|
|
10642
10673
|
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
} else if (newPlayState === 'pending') {
|
|
10650
|
-
this.readyPromise = undefined;
|
|
10651
|
-
}
|
|
10652
|
-
}
|
|
10674
|
+
_this.config = void 0;
|
|
10675
|
+
_this.styleValueRegistry = GlobalContainer.get(StyleValueRegistry);
|
|
10676
|
+
_this.isCustomElement = false;
|
|
10677
|
+
_this.activeAnimations = [];
|
|
10678
|
+
_this.mutationEvent = new MutationEvent(ElementEvent.ATTR_MODIFIED, _assertThisInitialized(_this), null, null, null, MutationEvent.MODIFICATION, null, null);
|
|
10679
|
+
_this.config = config; // compatible with G 3.0
|
|
10653
10680
|
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
this.finishedPromise = undefined;
|
|
10662
|
-
}
|
|
10681
|
+
_this.config.interactive = (_this$config$capture = _this.config.capture) !== null && _this$config$capture !== void 0 ? _this$config$capture : _this.config.interactive; // init scene graph node
|
|
10682
|
+
|
|
10683
|
+
_this.id = _this.config.id || '';
|
|
10684
|
+
_this.name = _this.config.name || '';
|
|
10685
|
+
|
|
10686
|
+
if (_this.config.className || _this.config.class) {
|
|
10687
|
+
_this.className = _this.config.className || _this.config.class;
|
|
10663
10688
|
}
|
|
10664
10689
|
|
|
10665
|
-
|
|
10666
|
-
return this.readyPromise || this.finishedPromise;
|
|
10667
|
-
};
|
|
10690
|
+
_this.nodeName = _this.config.type || Shape.GROUP; // compatible with G 3.0
|
|
10668
10691
|
|
|
10669
|
-
|
|
10670
|
-
this.updatePromises();
|
|
10671
|
-
this._paused = false;
|
|
10692
|
+
_this.config.style = _extends({}, DEFAULT_STYLE_PROPS, _this.config.style, _this.config.attrs);
|
|
10672
10693
|
|
|
10673
|
-
if (
|
|
10674
|
-
|
|
10675
|
-
this._startTime = null;
|
|
10694
|
+
if (_this.config.visible != null) {
|
|
10695
|
+
_this.config.style.visibility = _this.config.visible === false ? 'hidden' : 'visible';
|
|
10676
10696
|
}
|
|
10677
10697
|
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
this.ensureAlive();
|
|
10681
|
-
this.timeline.applyDirtiedAnimation(this);
|
|
10682
|
-
|
|
10683
|
-
if (this.timeline.animations.indexOf(this) === -1) {
|
|
10684
|
-
this.timeline.animations.push(this);
|
|
10698
|
+
if (_this.config.interactive != null) {
|
|
10699
|
+
_this.config.style.pointerEvents = _this.config.interactive === false ? 'none' : 'auto';
|
|
10685
10700
|
}
|
|
10686
10701
|
|
|
10687
|
-
|
|
10688
|
-
|
|
10702
|
+
_this.style = new Proxy(_extends({}, _this.attributes, {
|
|
10703
|
+
setProperty: function setProperty(propertyName, value) {
|
|
10704
|
+
_this.setAttribute(propertyName, value);
|
|
10705
|
+
},
|
|
10706
|
+
getPropertyValue: function getPropertyValue(propertyName) {
|
|
10707
|
+
return _this.getAttribute(propertyName);
|
|
10708
|
+
},
|
|
10709
|
+
removeProperty: function removeProperty(propertyName) {
|
|
10710
|
+
_this.removeAttribute(propertyName);
|
|
10711
|
+
},
|
|
10712
|
+
item: function item() {
|
|
10713
|
+
return '';
|
|
10714
|
+
}
|
|
10715
|
+
}), {
|
|
10716
|
+
get: function get(target, name) {
|
|
10717
|
+
if (target[name] !== undefined) {
|
|
10718
|
+
// if (name in target) {
|
|
10719
|
+
return target[name];
|
|
10720
|
+
}
|
|
10689
10721
|
|
|
10690
|
-
|
|
10691
|
-
|
|
10722
|
+
return _this.getAttribute(name);
|
|
10723
|
+
},
|
|
10724
|
+
set: function set(_, prop, value) {
|
|
10725
|
+
_this.setAttribute(prop, value);
|
|
10692
10726
|
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
}
|
|
10727
|
+
return true;
|
|
10728
|
+
}
|
|
10729
|
+
});
|
|
10696
10730
|
|
|
10697
|
-
|
|
10698
|
-
this.currentTimePending = true;
|
|
10699
|
-
} else if (this._idle) {
|
|
10700
|
-
this.rewind();
|
|
10701
|
-
this._idle = false;
|
|
10702
|
-
}
|
|
10731
|
+
_this.initAttributes(_this.config.style); // insert this group into pool
|
|
10703
10732
|
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10733
|
+
|
|
10734
|
+
GlobalContainer.get(DisplayObjectPool).add(_this.entity, _assertThisInitialized(_this));
|
|
10735
|
+
return _this;
|
|
10736
|
+
}
|
|
10737
|
+
|
|
10738
|
+
var _proto = DisplayObject.prototype;
|
|
10739
|
+
|
|
10740
|
+
_proto.destroy = function destroy() {
|
|
10741
|
+
_Element.prototype.destroy.call(this); // remove from into pool
|
|
10742
|
+
|
|
10743
|
+
|
|
10744
|
+
GlobalContainer.get(DisplayObjectPool).remove(this.entity); // stop all active animations
|
|
10745
|
+
|
|
10746
|
+
this.getAnimations().forEach(function (animation) {
|
|
10747
|
+
animation.cancel();
|
|
10748
|
+
});
|
|
10707
10749
|
};
|
|
10708
10750
|
|
|
10709
|
-
_proto.
|
|
10710
|
-
this.
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10751
|
+
_proto.cloneNode = function cloneNode(deep) {
|
|
10752
|
+
var cloned = new this.constructor({
|
|
10753
|
+
// copy id & name
|
|
10754
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode#notes
|
|
10755
|
+
id: this.id,
|
|
10756
|
+
name: this.name,
|
|
10757
|
+
className: this.name,
|
|
10758
|
+
interactive: this.interactive,
|
|
10759
|
+
style: _extends({}, this.attributes)
|
|
10760
|
+
}); // apply transform
|
|
10761
|
+
|
|
10762
|
+
cloned.setLocalTransform(this.getLocalTransform());
|
|
10763
|
+
|
|
10764
|
+
if (deep) {
|
|
10765
|
+
this.children.forEach(function (child) {
|
|
10766
|
+
var clonedChild = child.cloneNode(deep);
|
|
10767
|
+
cloned.appendChild(clonedChild);
|
|
10768
|
+
});
|
|
10769
|
+
}
|
|
10770
|
+
|
|
10771
|
+
return cloned;
|
|
10717
10772
|
};
|
|
10718
10773
|
|
|
10719
|
-
_proto.
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
this._idle = true;
|
|
10724
|
-
this._paused = false;
|
|
10725
|
-
this._finishedFlag = true;
|
|
10726
|
-
this._currentTime = 0;
|
|
10727
|
-
this._startTime = null;
|
|
10728
|
-
this.effect.update(null); // effects are invalid after cancellation as the animation state
|
|
10729
|
-
// needs to un-apply.
|
|
10774
|
+
_proto.initAttributes = function initAttributes(attributes) {
|
|
10775
|
+
if (attributes === void 0) {
|
|
10776
|
+
attributes = {};
|
|
10777
|
+
}
|
|
10730
10778
|
|
|
10731
|
-
this.
|
|
10732
|
-
this.
|
|
10779
|
+
var renderable = this.renderable;
|
|
10780
|
+
this.styleValueRegistry.processProperties(this, attributes); // redraw at next frame
|
|
10781
|
+
|
|
10782
|
+
renderable.dirty = true;
|
|
10733
10783
|
};
|
|
10734
10784
|
|
|
10735
|
-
_proto.
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
this.play();
|
|
10785
|
+
_proto.setAttribute = function setAttribute(name, value, force) {
|
|
10786
|
+
if (force === void 0) {
|
|
10787
|
+
force = false;
|
|
10788
|
+
}
|
|
10740
10789
|
|
|
10741
|
-
|
|
10742
|
-
|
|
10790
|
+
var _formatAttribute = formatAttribute(name, value),
|
|
10791
|
+
attributeName = _formatAttribute[0],
|
|
10792
|
+
attributeValue = _formatAttribute[1]; // ignore undefined value
|
|
10793
|
+
|
|
10794
|
+
|
|
10795
|
+
if (isUndefined(value)) {
|
|
10796
|
+
return;
|
|
10743
10797
|
}
|
|
10744
10798
|
|
|
10745
|
-
this.
|
|
10799
|
+
if (force || attributeValue !== this.attributes[attributeName]) {
|
|
10800
|
+
this.internalSetAttribute(attributeName, attributeValue);
|
|
10801
|
+
|
|
10802
|
+
_Element.prototype.setAttribute.call(this, attributeName, attributeValue);
|
|
10803
|
+
}
|
|
10746
10804
|
}
|
|
10747
10805
|
/**
|
|
10748
|
-
*
|
|
10806
|
+
* called when attributes get changed or initialized
|
|
10749
10807
|
*/
|
|
10750
10808
|
;
|
|
10751
10809
|
|
|
10752
|
-
_proto.
|
|
10753
|
-
|
|
10754
|
-
|
|
10810
|
+
_proto.internalSetAttribute = function internalSetAttribute(name, value, parseOptions) {
|
|
10811
|
+
var _this$styleValueRegis,
|
|
10812
|
+
_this2 = this;
|
|
10755
10813
|
|
|
10756
|
-
|
|
10757
|
-
|
|
10814
|
+
if (parseOptions === void 0) {
|
|
10815
|
+
parseOptions = {};
|
|
10816
|
+
}
|
|
10758
10817
|
|
|
10759
|
-
var
|
|
10760
|
-
|
|
10761
|
-
|
|
10818
|
+
var renderable = this.renderable;
|
|
10819
|
+
var oldValue = this.attributes[name];
|
|
10820
|
+
var oldParsedValue = this.parsedStyle[name];
|
|
10821
|
+
this.styleValueRegistry.processProperties(this, (_this$styleValueRegis = {}, _this$styleValueRegis[name] = value, _this$styleValueRegis), parseOptions); // inform clip path targets
|
|
10762
10822
|
|
|
10763
|
-
|
|
10764
|
-
|
|
10823
|
+
if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
|
|
10824
|
+
this.parsedStyle.clipPathTargets.forEach(function (target) {
|
|
10825
|
+
_this2.sceneGraphService.dirtifyToRoot(target);
|
|
10765
10826
|
|
|
10766
|
-
|
|
10767
|
-
animations.push(this);
|
|
10768
|
-
}
|
|
10769
|
-
};
|
|
10827
|
+
target.dispatchEvent(new MutationEvent(ElementEvent.ATTR_MODIFIED, target, _this2, _this2, 'clipPath', MutationEvent.MODIFICATION, _this2, _this2));
|
|
10770
10828
|
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10829
|
+
if (target.isCustomElement && target.isConnected) {
|
|
10830
|
+
if (target.attributeChangedCallback) {
|
|
10831
|
+
target.attributeChangedCallback('clipPath', _this2, _this2);
|
|
10832
|
+
}
|
|
10833
|
+
}
|
|
10834
|
+
});
|
|
10835
|
+
} // redraw at next frame
|
|
10774
10836
|
|
|
10775
|
-
if (index !== -1) {
|
|
10776
|
-
animations.splice(index, 1);
|
|
10777
|
-
}
|
|
10778
|
-
};
|
|
10779
10837
|
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
if (this._startTime === null) {
|
|
10783
|
-
if (isAnimationFrame) {
|
|
10784
|
-
this.startTime = timelineTime - this._currentTime / this.playbackRate;
|
|
10785
|
-
}
|
|
10786
|
-
} else if (!this._isFinished) {
|
|
10787
|
-
this.tickCurrentTime((timelineTime - this._startTime) * this.playbackRate);
|
|
10788
|
-
}
|
|
10789
|
-
}
|
|
10838
|
+
renderable.dirty = true; // trigger later
|
|
10839
|
+
// this.sceneGraphService.pendingEvents.push([ElementEvent.ATTR_MODIFIED, { affectChildren }]);
|
|
10790
10840
|
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10841
|
+
this.mutationEvent.prevValue = oldValue;
|
|
10842
|
+
this.mutationEvent.newValue = value;
|
|
10843
|
+
this.mutationEvent.attrName = name;
|
|
10844
|
+
this.mutationEvent.prevParsedValue = oldParsedValue;
|
|
10845
|
+
this.mutationEvent.newParsedValue = this.parsedStyle[name];
|
|
10846
|
+
this.dispatchEvent(this.mutationEvent);
|
|
10796
10847
|
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
this.currentTime = this.totalDuration;
|
|
10802
|
-
} else {
|
|
10803
|
-
throw new Error('Unable to rewind negative playback rate animation with infinite duration');
|
|
10848
|
+
if (this.isCustomElement && this.isConnected) {
|
|
10849
|
+
if (this.attributeChangedCallback) {
|
|
10850
|
+
this.attributeChangedCallback(name, oldValue, value);
|
|
10851
|
+
}
|
|
10804
10852
|
}
|
|
10805
|
-
}
|
|
10853
|
+
} // #region transformable
|
|
10806
10854
|
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10855
|
+
/**
|
|
10856
|
+
* returns different values than getBoundingClientRect(), as the latter returns value relative to the viewport
|
|
10857
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox
|
|
10858
|
+
*
|
|
10859
|
+
* FIXME: It is worth noting that getBBox responds to original untransformed values of a drawn object.
|
|
10860
|
+
* @see https://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#getBBox
|
|
10861
|
+
*/
|
|
10810
10862
|
;
|
|
10811
10863
|
|
|
10812
|
-
_proto.
|
|
10813
|
-
|
|
10814
|
-
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10815
|
-
;
|
|
10864
|
+
_proto.getBBox = function getBBox() {
|
|
10865
|
+
var aabb = this.getBounds();
|
|
10816
10866
|
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
;
|
|
10867
|
+
var _aabb$getMin = aabb.getMin(),
|
|
10868
|
+
left = _aabb$getMin[0],
|
|
10869
|
+
top = _aabb$getMin[1];
|
|
10821
10870
|
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10871
|
+
var _aabb$getMax = aabb.getMax(),
|
|
10872
|
+
right = _aabb$getMax[0],
|
|
10873
|
+
bottom = _aabb$getMax[1];
|
|
10825
10874
|
|
|
10826
|
-
|
|
10827
|
-
_proto.commitStyles = function commitStyles() {
|
|
10828
|
-
throw new Error('Method not implemented.');
|
|
10875
|
+
return new Rectangle(left, top, right - left, bottom - top);
|
|
10829
10876
|
};
|
|
10830
10877
|
|
|
10831
|
-
_proto.
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
// active interval (currentTime === 0).
|
|
10835
|
-
if (this.playbackRate < 0 && this.currentTime === 0) {
|
|
10836
|
-
var _this$effect2;
|
|
10837
|
-
|
|
10838
|
-
this._inEffect = !!((_this$effect2 = this.effect) === null || _this$effect2 === void 0 ? void 0 : _this$effect2.update(-1));
|
|
10839
|
-
} else {
|
|
10840
|
-
var _this$effect3;
|
|
10841
|
-
|
|
10842
|
-
this._inEffect = !!((_this$effect3 = this.effect) === null || _this$effect3 === void 0 ? void 0 : _this$effect3.update(this.currentTime));
|
|
10878
|
+
_proto.setOrigin = function setOrigin(position, y, z) {
|
|
10879
|
+
if (y === void 0) {
|
|
10880
|
+
y = 0;
|
|
10843
10881
|
}
|
|
10844
10882
|
|
|
10845
|
-
if (
|
|
10846
|
-
|
|
10847
|
-
this.timeline.animations.push(this);
|
|
10883
|
+
if (z === void 0) {
|
|
10884
|
+
z = 0;
|
|
10848
10885
|
}
|
|
10849
|
-
};
|
|
10850
10886
|
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10887
|
+
this.sceneGraphService.setOrigin(this, createVec3(position, y, z));
|
|
10888
|
+
return this;
|
|
10889
|
+
};
|
|
10854
10890
|
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10891
|
+
_proto.getOrigin = function getOrigin() {
|
|
10892
|
+
return this.sceneGraphService.getOrigin(this);
|
|
10893
|
+
}
|
|
10894
|
+
/**
|
|
10895
|
+
* set position in world space
|
|
10896
|
+
*/
|
|
10897
|
+
;
|
|
10858
10898
|
|
|
10859
|
-
|
|
10899
|
+
_proto.setPosition = function setPosition(position, y, z) {
|
|
10900
|
+
if (y === void 0) {
|
|
10901
|
+
y = 0;
|
|
10860
10902
|
}
|
|
10861
|
-
};
|
|
10862
10903
|
|
|
10863
|
-
|
|
10864
|
-
|
|
10904
|
+
if (z === void 0) {
|
|
10905
|
+
z = 0;
|
|
10906
|
+
}
|
|
10865
10907
|
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
}
|
|
10874
|
-
});
|
|
10875
|
-
}
|
|
10876
|
-
|
|
10877
|
-
this._finishedFlag = true;
|
|
10878
|
-
}
|
|
10879
|
-
} else {
|
|
10880
|
-
if (this.onframe && this.playState === 'running') {
|
|
10881
|
-
var _event = new AnimationEvent(null, this, this.currentTime, baseTime);
|
|
10882
|
-
|
|
10883
|
-
this.onframe(_event);
|
|
10884
|
-
}
|
|
10908
|
+
this.sceneGraphService.setPosition(this, createVec3(position, y, z));
|
|
10909
|
+
return this;
|
|
10910
|
+
}
|
|
10911
|
+
/**
|
|
10912
|
+
* set position in local space
|
|
10913
|
+
*/
|
|
10914
|
+
;
|
|
10885
10915
|
|
|
10886
|
-
|
|
10916
|
+
_proto.setLocalPosition = function setLocalPosition(position, y, z) {
|
|
10917
|
+
if (y === void 0) {
|
|
10918
|
+
y = 0;
|
|
10887
10919
|
}
|
|
10888
|
-
};
|
|
10889
|
-
|
|
10890
|
-
_createClass(Animation, [{
|
|
10891
|
-
key: "pending",
|
|
10892
|
-
get:
|
|
10893
|
-
/**
|
|
10894
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
|
|
10895
|
-
*/
|
|
10896
10920
|
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
*/
|
|
10900
|
-
|
|
10901
|
-
/**
|
|
10902
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
|
|
10903
|
-
*/
|
|
10904
|
-
// animation: InternalAnimation | null;
|
|
10905
|
-
|
|
10906
|
-
/**
|
|
10907
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
|
|
10908
|
-
*/
|
|
10909
|
-
function get() {
|
|
10910
|
-
return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
|
|
10911
|
-
}
|
|
10912
|
-
}, {
|
|
10913
|
-
key: "playState",
|
|
10914
|
-
get: function get() {
|
|
10915
|
-
if (this._idle) return 'idle';
|
|
10916
|
-
if (this._isFinished) return 'finished';
|
|
10917
|
-
if (this._paused) return 'paused';
|
|
10918
|
-
return 'running';
|
|
10921
|
+
if (z === void 0) {
|
|
10922
|
+
z = 0;
|
|
10919
10923
|
}
|
|
10920
|
-
/**
|
|
10921
|
-
* record previos state
|
|
10922
|
-
*/
|
|
10923
|
-
|
|
10924
|
-
}, {
|
|
10925
|
-
key: "ready",
|
|
10926
|
-
get:
|
|
10927
|
-
/**
|
|
10928
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
|
|
10929
|
-
* @example
|
|
10930
|
-
animation.pause();
|
|
10931
|
-
animation.ready.then(function() {
|
|
10932
|
-
// Displays 'running'
|
|
10933
|
-
alert(animation.playState);
|
|
10934
|
-
});
|
|
10935
|
-
animation.play();
|
|
10936
|
-
*/
|
|
10937
|
-
function get() {
|
|
10938
|
-
var _this2 = this;
|
|
10939
|
-
|
|
10940
|
-
if (!this.readyPromise) {
|
|
10941
|
-
if (this.timeline.animationsWithPromises.indexOf(this) === -1) {
|
|
10942
|
-
this.timeline.animationsWithPromises.push(this);
|
|
10943
|
-
}
|
|
10944
|
-
|
|
10945
|
-
this.readyPromise = new Promise(function (resolve, reject) {
|
|
10946
|
-
_this2.resolveReadyPromise = function () {
|
|
10947
|
-
resolve(_this2);
|
|
10948
|
-
};
|
|
10949
10924
|
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
}
|
|
10958
|
-
}
|
|
10925
|
+
this.sceneGraphService.setLocalPosition(this, createVec3(position, y, z));
|
|
10926
|
+
return this;
|
|
10927
|
+
}
|
|
10928
|
+
/**
|
|
10929
|
+
* translate in world space
|
|
10930
|
+
*/
|
|
10931
|
+
;
|
|
10959
10932
|
|
|
10960
|
-
|
|
10933
|
+
_proto.translate = function translate(position, y, z) {
|
|
10934
|
+
if (y === void 0) {
|
|
10935
|
+
y = 0;
|
|
10961
10936
|
}
|
|
10962
|
-
/**
|
|
10963
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/finished
|
|
10964
|
-
* @example
|
|
10965
|
-
Promise.all(
|
|
10966
|
-
elem.getAnimations().map(
|
|
10967
|
-
function(animation) {
|
|
10968
|
-
return animation.finished
|
|
10969
|
-
}
|
|
10970
|
-
)
|
|
10971
|
-
).then(
|
|
10972
|
-
function() {
|
|
10973
|
-
return elem.remove();
|
|
10974
|
-
}
|
|
10975
|
-
);
|
|
10976
|
-
*/
|
|
10977
|
-
|
|
10978
|
-
}, {
|
|
10979
|
-
key: "finished",
|
|
10980
|
-
get: function get() {
|
|
10981
|
-
var _this3 = this;
|
|
10982
|
-
|
|
10983
|
-
if (!this.finishedPromise) {
|
|
10984
|
-
if (this.timeline.animationsWithPromises.indexOf(this) === -1) {
|
|
10985
|
-
this.timeline.animationsWithPromises.push(this);
|
|
10986
|
-
}
|
|
10987
|
-
|
|
10988
|
-
this.finishedPromise = new Promise(function (resolve, reject) {
|
|
10989
|
-
_this3.resolveFinishedPromise = function () {
|
|
10990
|
-
resolve(_this3);
|
|
10991
|
-
};
|
|
10992
|
-
|
|
10993
|
-
_this3.rejectFinishedPromise = function () {
|
|
10994
|
-
reject(new Error());
|
|
10995
|
-
};
|
|
10996
|
-
});
|
|
10997
10937
|
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
}
|
|
11001
|
-
}
|
|
11002
|
-
|
|
11003
|
-
return this.finishedPromise;
|
|
10938
|
+
if (z === void 0) {
|
|
10939
|
+
z = 0;
|
|
11004
10940
|
}
|
|
11005
|
-
/**
|
|
11006
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/onfinish
|
|
11007
|
-
*/
|
|
11008
|
-
|
|
11009
|
-
}, {
|
|
11010
|
-
key: "currentTime",
|
|
11011
|
-
get:
|
|
11012
|
-
/**
|
|
11013
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/currentTime
|
|
11014
|
-
*/
|
|
11015
|
-
function get() {
|
|
11016
|
-
this.updatePromises();
|
|
11017
|
-
return this._idle || this.currentTimePending ? null : this._currentTime;
|
|
11018
|
-
},
|
|
11019
|
-
set: function set(newTime) {
|
|
11020
|
-
newTime = Number(newTime);
|
|
11021
|
-
if (isNaN(newTime)) return;
|
|
11022
|
-
this.timeline.restart();
|
|
11023
10941
|
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
if (this._currentTime === newTime) {
|
|
11033
|
-
return;
|
|
11034
|
-
}
|
|
11035
|
-
|
|
11036
|
-
if (this._idle) {
|
|
11037
|
-
this._idle = false;
|
|
11038
|
-
this._paused = true;
|
|
11039
|
-
}
|
|
10942
|
+
this.sceneGraphService.translate(this, createVec3(position, y, z));
|
|
10943
|
+
return this;
|
|
10944
|
+
}
|
|
10945
|
+
/**
|
|
10946
|
+
* translate in local space
|
|
10947
|
+
*/
|
|
10948
|
+
;
|
|
11040
10949
|
|
|
11041
|
-
|
|
11042
|
-
|
|
10950
|
+
_proto.translateLocal = function translateLocal(position, y, z) {
|
|
10951
|
+
if (y === void 0) {
|
|
10952
|
+
y = 0;
|
|
11043
10953
|
}
|
|
11044
|
-
/**
|
|
11045
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/startTime
|
|
11046
|
-
*/
|
|
11047
10954
|
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
get: function get() {
|
|
11051
|
-
return this._startTime;
|
|
11052
|
-
},
|
|
11053
|
-
set: function set(newTime) {
|
|
11054
|
-
if (newTime !== null) {
|
|
11055
|
-
this.updatePromises();
|
|
11056
|
-
newTime = Number(newTime);
|
|
11057
|
-
if (isNaN(newTime)) return;
|
|
11058
|
-
if (this._paused || this._idle) return;
|
|
11059
|
-
this._startTime = newTime;
|
|
11060
|
-
this.tickCurrentTime((Number(this.timeline.currentTime) - this._startTime) * this.playbackRate);
|
|
11061
|
-
this.timeline.applyDirtiedAnimation(this);
|
|
11062
|
-
this.updatePromises();
|
|
11063
|
-
}
|
|
10955
|
+
if (z === void 0) {
|
|
10956
|
+
z = 0;
|
|
11064
10957
|
}
|
|
11065
|
-
}, {
|
|
11066
|
-
key: "playbackRate",
|
|
11067
|
-
get: function get() {
|
|
11068
|
-
return this._playbackRate;
|
|
11069
|
-
},
|
|
11070
|
-
set: function set(value) {
|
|
11071
|
-
if (value === this._playbackRate) {
|
|
11072
|
-
return;
|
|
11073
|
-
}
|
|
11074
10958
|
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
this.startTime = null;
|
|
10959
|
+
this.sceneGraphService.translateLocal(this, createVec3(position, y, z));
|
|
10960
|
+
return this;
|
|
10961
|
+
};
|
|
11079
10962
|
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
this.ensureAlive();
|
|
11084
|
-
this.timeline.applyDirtiedAnimation(this);
|
|
11085
|
-
}
|
|
10963
|
+
_proto.getPosition = function getPosition() {
|
|
10964
|
+
return this.sceneGraphService.getPosition(this);
|
|
10965
|
+
};
|
|
11086
10966
|
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
10967
|
+
_proto.getLocalPosition = function getLocalPosition() {
|
|
10968
|
+
return this.sceneGraphService.getLocalPosition(this);
|
|
10969
|
+
}
|
|
10970
|
+
/**
|
|
10971
|
+
* compatible with G 3.0
|
|
10972
|
+
*
|
|
10973
|
+
* scaling in local space
|
|
10974
|
+
* scale(10) = scale(10, 10, 10)
|
|
10975
|
+
*
|
|
10976
|
+
* we can't set scale in world space
|
|
10977
|
+
*/
|
|
10978
|
+
;
|
|
11090
10979
|
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
}
|
|
11094
|
-
key: "_isFinished",
|
|
11095
|
-
get: function get() {
|
|
11096
|
-
return !this._idle && (this._playbackRate > 0 && Number(this._currentTime) >= this.totalDuration || this._playbackRate < 0 && Number(this._currentTime) <= 0);
|
|
11097
|
-
}
|
|
11098
|
-
}, {
|
|
11099
|
-
key: "totalDuration",
|
|
11100
|
-
get: function get() {
|
|
11101
|
-
var _this$effect4;
|
|
10980
|
+
_proto.scale = function scale(scaling, y, z) {
|
|
10981
|
+
return this.scaleLocal(scaling, y, z);
|
|
10982
|
+
};
|
|
11102
10983
|
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
return this.pending || this.playState === 'running' || !this._finishedFlag;
|
|
10984
|
+
_proto.scaleLocal = function scaleLocal(scaling, y, z) {
|
|
10985
|
+
if (typeof scaling === 'number') {
|
|
10986
|
+
y = y || scaling;
|
|
10987
|
+
z = z || scaling;
|
|
10988
|
+
scaling = createVec3(scaling, y, z);
|
|
11109
10989
|
}
|
|
11110
|
-
}]);
|
|
11111
10990
|
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
function compareAnimations(leftAnimation, rightAnimation) {
|
|
11116
|
-
return Number(leftAnimation.id) - Number(rightAnimation.id);
|
|
11117
|
-
}
|
|
11118
|
-
/**
|
|
11119
|
-
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
|
|
11120
|
-
*/
|
|
11121
|
-
|
|
11122
|
-
var AnimationTimeline = /*#__PURE__*/function () {
|
|
10991
|
+
this.sceneGraphService.scaleLocal(this, scaling);
|
|
10992
|
+
return this;
|
|
10993
|
+
}
|
|
11123
10994
|
/**
|
|
11124
|
-
*
|
|
10995
|
+
* set scaling in local space
|
|
11125
10996
|
*/
|
|
11126
|
-
|
|
11127
|
-
var _this = this;
|
|
11128
|
-
|
|
11129
|
-
this.document = void 0;
|
|
11130
|
-
this.animations = [];
|
|
11131
|
-
this.ticking = false;
|
|
11132
|
-
this.timelineTicking = false;
|
|
11133
|
-
this.hasRestartedThisFrame = false;
|
|
11134
|
-
this.animationsWithPromises = [];
|
|
11135
|
-
this.inTick = false;
|
|
11136
|
-
this.pendingEffects = [];
|
|
11137
|
-
this.currentTime = null;
|
|
11138
|
-
this.rafId = 0;
|
|
11139
|
-
this.rafCallbacks = [];
|
|
11140
|
-
this.frameId = void 0;
|
|
11141
|
-
|
|
11142
|
-
this.webAnimationsNextTick = function (t) {
|
|
11143
|
-
_this.currentTime = t;
|
|
11144
|
-
|
|
11145
|
-
_this.discardAnimations();
|
|
11146
|
-
|
|
11147
|
-
if (_this.animations.length === 0) {
|
|
11148
|
-
_this.timelineTicking = false;
|
|
11149
|
-
} else {
|
|
11150
|
-
_this.requestAnimationFrame(_this.webAnimationsNextTick);
|
|
11151
|
-
}
|
|
11152
|
-
};
|
|
11153
|
-
|
|
11154
|
-
this.processRafCallbacks = function (t) {
|
|
11155
|
-
var processing = _this.rafCallbacks;
|
|
11156
|
-
_this.rafCallbacks = [];
|
|
11157
|
-
if (t < Number(_this.currentTime)) t = Number(_this.currentTime);
|
|
11158
|
-
|
|
11159
|
-
_this.animations.sort(compareAnimations);
|
|
11160
|
-
|
|
11161
|
-
_this.animations = _this.tick(t, true, _this.animations)[0];
|
|
11162
|
-
processing.forEach(function (entry) {
|
|
11163
|
-
entry[1](t);
|
|
11164
|
-
});
|
|
10997
|
+
;
|
|
11165
10998
|
|
|
11166
|
-
|
|
11167
|
-
|
|
10999
|
+
_proto.setLocalScale = function setLocalScale(scaling, y, z) {
|
|
11000
|
+
if (typeof scaling === 'number') {
|
|
11001
|
+
y = y || scaling;
|
|
11002
|
+
z = z || scaling;
|
|
11003
|
+
scaling = createVec3(scaling, y, z);
|
|
11004
|
+
}
|
|
11168
11005
|
|
|
11169
|
-
this.
|
|
11006
|
+
this.sceneGraphService.setLocalScale(this, scaling);
|
|
11007
|
+
return this;
|
|
11170
11008
|
}
|
|
11009
|
+
/**
|
|
11010
|
+
* get scaling in local space
|
|
11011
|
+
*/
|
|
11012
|
+
;
|
|
11171
11013
|
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
_proto.isTicking = function isTicking() {
|
|
11180
|
-
return this.inTick;
|
|
11181
|
-
};
|
|
11014
|
+
_proto.getLocalScale = function getLocalScale() {
|
|
11015
|
+
return this.sceneGraphService.getLocalScale(this);
|
|
11016
|
+
}
|
|
11017
|
+
/**
|
|
11018
|
+
* get scaling in world space
|
|
11019
|
+
*/
|
|
11020
|
+
;
|
|
11182
11021
|
|
|
11183
|
-
_proto.
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
animation.updatePromises();
|
|
11190
|
-
return animation;
|
|
11191
|
-
} // RAF is supposed to be the last script to occur before frame rendering but not
|
|
11192
|
-
// all browsers behave like this. This function is for synchonously updating an
|
|
11193
|
-
// animation's effects whenever its state is mutated by script to work around
|
|
11194
|
-
// incorrect script execution ordering by the browser.
|
|
11022
|
+
_proto.getScale = function getScale() {
|
|
11023
|
+
return this.sceneGraphService.getScale(this);
|
|
11024
|
+
}
|
|
11025
|
+
/**
|
|
11026
|
+
* only return degrees of Z axis in world space
|
|
11027
|
+
*/
|
|
11195
11028
|
;
|
|
11196
11029
|
|
|
11197
|
-
_proto.
|
|
11198
|
-
|
|
11030
|
+
_proto.getEulerAngles = function getEulerAngles() {
|
|
11031
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11032
|
+
var _getEuler = getEuler(vec3.create(), this.sceneGraphService.getWorldTransform(this)),
|
|
11033
|
+
ex = _getEuler[0],
|
|
11034
|
+
ey = _getEuler[1],
|
|
11035
|
+
ez = _getEuler[2];
|
|
11199
11036
|
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11037
|
+
return rad2deg(ez);
|
|
11038
|
+
}
|
|
11039
|
+
/**
|
|
11040
|
+
* only return degrees of Z axis in local space
|
|
11041
|
+
*/
|
|
11042
|
+
;
|
|
11203
11043
|
|
|
11044
|
+
_proto.getLocalEulerAngles = function getLocalEulerAngles() {
|
|
11045
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11046
|
+
var _getEuler2 = getEuler(vec3.create(), this.sceneGraphService.getLocalRotation(this)),
|
|
11047
|
+
ex = _getEuler2[0],
|
|
11048
|
+
ey = _getEuler2[1],
|
|
11049
|
+
ez = _getEuler2[2];
|
|
11204
11050
|
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11051
|
+
return rad2deg(ez);
|
|
11052
|
+
}
|
|
11053
|
+
/**
|
|
11054
|
+
* set euler angles(degrees) in world space
|
|
11055
|
+
*/
|
|
11056
|
+
;
|
|
11208
11057
|
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11058
|
+
_proto.setEulerAngles = function setEulerAngles(z) {
|
|
11059
|
+
this.sceneGraphService.setEulerAngles(this, 0, 0, z);
|
|
11060
|
+
return this;
|
|
11061
|
+
}
|
|
11062
|
+
/**
|
|
11063
|
+
* set euler angles(degrees) in local space
|
|
11064
|
+
*/
|
|
11065
|
+
;
|
|
11212
11066
|
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
});
|
|
11217
|
-
this.applyPendingEffects();
|
|
11067
|
+
_proto.setLocalEulerAngles = function setLocalEulerAngles(z) {
|
|
11068
|
+
this.sceneGraphService.setLocalEulerAngles(this, 0, 0, z);
|
|
11069
|
+
return this;
|
|
11218
11070
|
};
|
|
11219
11071
|
|
|
11220
|
-
_proto.
|
|
11221
|
-
if (
|
|
11222
|
-
this.
|
|
11223
|
-
|
|
11224
|
-
this.
|
|
11072
|
+
_proto.rotateLocal = function rotateLocal(x, y, z) {
|
|
11073
|
+
if (isNil(y) && isNil(z)) {
|
|
11074
|
+
this.sceneGraphService.rotateLocal(this, 0, 0, x);
|
|
11075
|
+
} else {
|
|
11076
|
+
this.sceneGraphService.rotateLocal(this, x, y, z);
|
|
11225
11077
|
}
|
|
11226
11078
|
|
|
11227
|
-
return this
|
|
11079
|
+
return this;
|
|
11228
11080
|
};
|
|
11229
11081
|
|
|
11230
|
-
_proto.
|
|
11231
|
-
|
|
11232
|
-
|
|
11082
|
+
_proto.rotate = function rotate(x, y, z) {
|
|
11083
|
+
if (isNil(y) && isNil(z)) {
|
|
11084
|
+
this.sceneGraphService.rotate(this, 0, 0, x);
|
|
11085
|
+
} else {
|
|
11086
|
+
this.sceneGraphService.rotate(this, x, y, z);
|
|
11087
|
+
}
|
|
11233
11088
|
|
|
11234
|
-
|
|
11235
|
-
this.pendingEffects.forEach(function (effect) {
|
|
11236
|
-
effect === null || effect === void 0 ? void 0 : effect.applyInterpolations();
|
|
11237
|
-
});
|
|
11238
|
-
this.pendingEffects = [];
|
|
11089
|
+
return this;
|
|
11239
11090
|
};
|
|
11240
11091
|
|
|
11241
|
-
_proto.
|
|
11242
|
-
this.
|
|
11243
|
-
|
|
11244
|
-
});
|
|
11092
|
+
_proto.setRotation = function setRotation(rotation, y, z, w) {
|
|
11093
|
+
this.sceneGraphService.setRotation(this, rotation, y, z, w);
|
|
11094
|
+
return this;
|
|
11245
11095
|
};
|
|
11246
11096
|
|
|
11247
|
-
_proto.
|
|
11248
|
-
this.
|
|
11249
|
-
|
|
11250
|
-
return animation.playState !== 'finished' && animation.playState !== 'idle';
|
|
11251
|
-
});
|
|
11097
|
+
_proto.setLocalRotation = function setLocalRotation(rotation, y, z, w) {
|
|
11098
|
+
this.sceneGraphService.setLocalRotation(this, rotation, y, z, w);
|
|
11099
|
+
return this;
|
|
11252
11100
|
};
|
|
11253
11101
|
|
|
11254
|
-
_proto.
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
this.requestAnimationFrame(this.webAnimationsNextTick);
|
|
11258
|
-
}
|
|
11102
|
+
_proto.setLocalSkew = function setLocalSkew(skew, y) {
|
|
11103
|
+
this.sceneGraphService.setLocalSkew(this, skew, y);
|
|
11104
|
+
return this;
|
|
11259
11105
|
};
|
|
11260
11106
|
|
|
11261
|
-
_proto.
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
if (this.rafCallbacks.length === 0) {
|
|
11265
|
-
this.frameId = this.document.defaultView.requestAnimationFrame(this.processRafCallbacks);
|
|
11266
|
-
}
|
|
11267
|
-
|
|
11268
|
-
this.rafCallbacks.push([id, f]);
|
|
11269
|
-
return id;
|
|
11107
|
+
_proto.getRotation = function getRotation() {
|
|
11108
|
+
return this.sceneGraphService.getRotation(this);
|
|
11270
11109
|
};
|
|
11271
11110
|
|
|
11272
|
-
_proto.
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
return this.rAF(function (x) {
|
|
11276
|
-
_this3.updateAnimationsPromises();
|
|
11277
|
-
|
|
11278
|
-
f(x);
|
|
11279
|
-
|
|
11280
|
-
_this3.updateAnimationsPromises();
|
|
11281
|
-
});
|
|
11111
|
+
_proto.getLocalRotation = function getLocalRotation() {
|
|
11112
|
+
return this.sceneGraphService.getLocalRotation(this);
|
|
11282
11113
|
};
|
|
11283
11114
|
|
|
11284
|
-
_proto.
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
_this$pendingEffects2;
|
|
11288
|
-
|
|
11289
|
-
this.inTick = true;
|
|
11290
|
-
this.hasRestartedThisFrame = false;
|
|
11291
|
-
this.currentTime = t;
|
|
11292
|
-
this.ticking = false;
|
|
11293
|
-
var newPendingClears = [];
|
|
11294
|
-
var newPendingEffects = [];
|
|
11295
|
-
var activeAnimations = [];
|
|
11296
|
-
var inactiveAnimations = [];
|
|
11297
|
-
updatingAnimations.forEach(function (animation) {
|
|
11298
|
-
animation.tick(t, isAnimationFrame);
|
|
11299
|
-
|
|
11300
|
-
if (!animation._inEffect) {
|
|
11301
|
-
newPendingClears.push(animation.effect);
|
|
11302
|
-
animation.unmarkTarget();
|
|
11303
|
-
} else {
|
|
11304
|
-
newPendingEffects.push(animation.effect);
|
|
11305
|
-
animation.markTarget();
|
|
11306
|
-
}
|
|
11307
|
-
|
|
11308
|
-
if (animation._needsTick) _this4.ticking = true;
|
|
11309
|
-
var alive = animation._inEffect || animation._needsTick;
|
|
11310
|
-
animation._inTimeline = alive;
|
|
11311
|
-
|
|
11312
|
-
if (alive) {
|
|
11313
|
-
activeAnimations.push(animation);
|
|
11314
|
-
} else {
|
|
11315
|
-
inactiveAnimations.push(animation);
|
|
11316
|
-
}
|
|
11317
|
-
});
|
|
11115
|
+
_proto.getLocalSkew = function getLocalSkew() {
|
|
11116
|
+
return this.sceneGraphService.getLocalSkew(this);
|
|
11117
|
+
};
|
|
11318
11118
|
|
|
11319
|
-
|
|
11119
|
+
_proto.getLocalTransform = function getLocalTransform() {
|
|
11120
|
+
return this.sceneGraphService.getLocalTransform(this);
|
|
11121
|
+
};
|
|
11320
11122
|
|
|
11321
|
-
|
|
11123
|
+
_proto.getWorldTransform = function getWorldTransform() {
|
|
11124
|
+
return this.sceneGraphService.getWorldTransform(this);
|
|
11125
|
+
};
|
|
11322
11126
|
|
|
11323
|
-
|
|
11324
|
-
this.
|
|
11325
|
-
return
|
|
11127
|
+
_proto.setLocalTransform = function setLocalTransform(transform) {
|
|
11128
|
+
this.sceneGraphService.setLocalTransform(this, transform);
|
|
11129
|
+
return this;
|
|
11326
11130
|
};
|
|
11327
11131
|
|
|
11328
|
-
|
|
11329
|
-
|
|
11132
|
+
_proto.resetLocalTransform = function resetLocalTransform() {
|
|
11133
|
+
this.sceneGraphService.resetLocalTransform(this);
|
|
11134
|
+
} // #endregion transformable
|
|
11135
|
+
// #region animatable
|
|
11330
11136
|
|
|
11331
|
-
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11137
|
+
/**
|
|
11138
|
+
* returns an array of all Animation objects affecting this element
|
|
11139
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations
|
|
11140
|
+
*/
|
|
11141
|
+
;
|
|
11142
|
+
|
|
11143
|
+
_proto.getAnimations = function getAnimations() {
|
|
11144
|
+
return this.activeAnimations;
|
|
11335
11145
|
}
|
|
11146
|
+
/**
|
|
11147
|
+
* create an animation with WAAPI
|
|
11148
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/animate
|
|
11149
|
+
*/
|
|
11150
|
+
;
|
|
11336
11151
|
|
|
11337
|
-
|
|
11152
|
+
_proto.animate = function animate(keyframes, options) {
|
|
11153
|
+
var _this$ownerDocument;
|
|
11338
11154
|
|
|
11339
|
-
|
|
11340
|
-
return this.pool[entity];
|
|
11341
|
-
};
|
|
11155
|
+
var timeline = (_this$ownerDocument = this.ownerDocument) === null || _this$ownerDocument === void 0 ? void 0 : _this$ownerDocument.timeline; // account for clip path, use target's timeline
|
|
11342
11156
|
|
|
11343
|
-
|
|
11344
|
-
|
|
11157
|
+
if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
|
|
11158
|
+
var _target$ownerDocument;
|
|
11345
11159
|
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
}
|
|
11349
|
-
};
|
|
11160
|
+
var target = this.parsedStyle.clipPathTargets[0];
|
|
11161
|
+
timeline = (_target$ownerDocument = target.ownerDocument) === null || _target$ownerDocument === void 0 ? void 0 : _target$ownerDocument.timeline;
|
|
11162
|
+
} // clear old parsed transform
|
|
11350
11163
|
|
|
11351
|
-
_proto.remove = function remove(entity) {
|
|
11352
|
-
var existed = this.pool[entity];
|
|
11353
|
-
delete this.pool[entity];
|
|
11354
11164
|
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11165
|
+
delete this.parsedStyle.transform;
|
|
11166
|
+
|
|
11167
|
+
if (timeline) {
|
|
11168
|
+
return timeline.play(new KeyframeEffect(this, keyframes, options));
|
|
11358
11169
|
}
|
|
11359
|
-
};
|
|
11360
11170
|
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11171
|
+
return null;
|
|
11172
|
+
} // #endregion animatable
|
|
11173
|
+
// #region visible
|
|
11364
11174
|
|
|
11365
|
-
|
|
11366
|
-
|
|
11175
|
+
/**
|
|
11176
|
+
* show group, which will also change visibility of its children in sceneGraphNode
|
|
11177
|
+
*
|
|
11178
|
+
* @deprecated
|
|
11179
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility
|
|
11180
|
+
*/
|
|
11181
|
+
;
|
|
11367
11182
|
|
|
11368
|
-
|
|
11183
|
+
_proto.show = function show() {
|
|
11184
|
+
this.style.visibility = 'visible';
|
|
11185
|
+
}
|
|
11186
|
+
/**
|
|
11187
|
+
* @deprecated
|
|
11188
|
+
* hide group, which will also change visibility of its children in sceneGraphNode
|
|
11189
|
+
*/
|
|
11190
|
+
;
|
|
11369
11191
|
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
transform: '',
|
|
11378
|
-
transformOrigin: '',
|
|
11379
|
-
visibility: '',
|
|
11380
|
-
pointerEvents: '',
|
|
11381
|
-
lineWidth: '',
|
|
11382
|
-
lineCap: '',
|
|
11383
|
-
lineJoin: '',
|
|
11384
|
-
increasedLineWidthForHitTesting: '',
|
|
11385
|
-
fontSize: '',
|
|
11386
|
-
fontFamily: '',
|
|
11387
|
-
fontStyle: '',
|
|
11388
|
-
fontWeight: '',
|
|
11389
|
-
fontVariant: '',
|
|
11390
|
-
textAlign: '',
|
|
11391
|
-
textBaseline: '',
|
|
11392
|
-
textTransform: '',
|
|
11393
|
-
zIndex: ''
|
|
11394
|
-
};
|
|
11395
|
-
/**
|
|
11396
|
-
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
11397
|
-
*
|
|
11398
|
-
* mixins: Animatable, Transformable, Visible
|
|
11399
|
-
* @see https://github.com/tannerntannern/ts-mixer/blob/master/README.md#mixing-generic-classes
|
|
11400
|
-
*
|
|
11401
|
-
* Provide abilities in scene graph, such as:
|
|
11402
|
-
* * transform `translate/rotate/scale`
|
|
11403
|
-
* * add/remove child
|
|
11404
|
-
* * visibility and z-index
|
|
11405
|
-
*
|
|
11406
|
-
* Those abilities are implemented with those components: `Transform/Sortable/Visible`.
|
|
11407
|
-
*
|
|
11408
|
-
* Emit following events:
|
|
11409
|
-
* * init
|
|
11410
|
-
* * destroy
|
|
11411
|
-
* * attributeChanged
|
|
11412
|
-
*/
|
|
11192
|
+
_proto.hide = function hide() {
|
|
11193
|
+
this.style.visibility = 'hidden';
|
|
11194
|
+
}
|
|
11195
|
+
/**
|
|
11196
|
+
* shortcut for Used value of `visibility`
|
|
11197
|
+
*/
|
|
11198
|
+
;
|
|
11413
11199
|
|
|
11414
|
-
|
|
11415
|
-
|
|
11200
|
+
_proto.isVisible = function isVisible() {
|
|
11201
|
+
var _this$parsedStyle, _this$parsedStyle$vis;
|
|
11202
|
+
|
|
11203
|
+
return ((_this$parsedStyle = this.parsedStyle) === null || _this$parsedStyle === void 0 ? void 0 : (_this$parsedStyle$vis = _this$parsedStyle.visibility) === null || _this$parsedStyle$vis === void 0 ? void 0 : _this$parsedStyle$vis.value) === 'visible';
|
|
11204
|
+
};
|
|
11205
|
+
|
|
11206
|
+
_proto.isInteractive = function isInteractive() {
|
|
11207
|
+
var _this$parsedStyle2, _this$parsedStyle2$po;
|
|
11416
11208
|
|
|
11209
|
+
return ((_this$parsedStyle2 = this.parsedStyle) === null || _this$parsedStyle2 === void 0 ? void 0 : (_this$parsedStyle2$po = _this$parsedStyle2.pointerEvents) === null || _this$parsedStyle2$po === void 0 ? void 0 : _this$parsedStyle2$po.value) !== 'none';
|
|
11210
|
+
};
|
|
11211
|
+
|
|
11212
|
+
_proto.isCulled = function isCulled() {
|
|
11213
|
+
return !!(this.cullable && this.cullable.isCulled());
|
|
11214
|
+
}
|
|
11417
11215
|
/**
|
|
11418
|
-
*
|
|
11216
|
+
* bring to front in current group
|
|
11419
11217
|
*/
|
|
11218
|
+
;
|
|
11219
|
+
|
|
11220
|
+
_proto.toFront = function toFront() {
|
|
11221
|
+
if (this.parentNode) {
|
|
11222
|
+
this.style.zIndex = Math.max.apply(Math, this.parentNode.children.map(function (child) {
|
|
11223
|
+
return Number(child.style.zIndex);
|
|
11224
|
+
})) + 1;
|
|
11225
|
+
}
|
|
11420
11226
|
|
|
11227
|
+
return this;
|
|
11228
|
+
}
|
|
11421
11229
|
/**
|
|
11422
|
-
*
|
|
11230
|
+
* send to back in current group
|
|
11423
11231
|
*/
|
|
11424
|
-
|
|
11425
|
-
var _this$config$capture;
|
|
11232
|
+
;
|
|
11426
11233
|
|
|
11427
|
-
|
|
11234
|
+
_proto.toBack = function toBack() {
|
|
11235
|
+
if (this.parentNode) {
|
|
11236
|
+
this.style.zIndex = Math.min.apply(Math, this.parentNode.children.map(function (child) {
|
|
11237
|
+
return Number(child.style.zIndex);
|
|
11238
|
+
})) - 1;
|
|
11239
|
+
}
|
|
11428
11240
|
|
|
11429
|
-
|
|
11430
|
-
|
|
11241
|
+
return this;
|
|
11242
|
+
} // #endregion visible
|
|
11243
|
+
// #region deprecated
|
|
11431
11244
|
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11245
|
+
/**
|
|
11246
|
+
* @deprecated
|
|
11247
|
+
* compatible with G 3.0
|
|
11248
|
+
* @deprecated
|
|
11249
|
+
*/
|
|
11250
|
+
;
|
|
11438
11251
|
|
|
11439
|
-
|
|
11252
|
+
_proto.getCount = function getCount() {
|
|
11253
|
+
return this.childElementCount;
|
|
11254
|
+
}
|
|
11255
|
+
/**
|
|
11256
|
+
* @deprecated
|
|
11257
|
+
* compatible with G 3.0
|
|
11258
|
+
* @deprecated
|
|
11259
|
+
*/
|
|
11260
|
+
;
|
|
11440
11261
|
|
|
11441
|
-
|
|
11442
|
-
|
|
11262
|
+
_proto.getParent = function getParent() {
|
|
11263
|
+
return this.parentElement;
|
|
11264
|
+
}
|
|
11265
|
+
/**
|
|
11266
|
+
* @deprecated
|
|
11267
|
+
* compatible with G 3.0
|
|
11268
|
+
* @deprecated
|
|
11269
|
+
*/
|
|
11270
|
+
;
|
|
11443
11271
|
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11272
|
+
_proto.getChildren = function getChildren() {
|
|
11273
|
+
return this.children;
|
|
11274
|
+
}
|
|
11275
|
+
/**
|
|
11276
|
+
* @deprecated
|
|
11277
|
+
* compatible with G 3.0
|
|
11278
|
+
* @deprecated
|
|
11279
|
+
*/
|
|
11280
|
+
;
|
|
11447
11281
|
|
|
11448
|
-
|
|
11282
|
+
_proto.getFirst = function getFirst() {
|
|
11283
|
+
return this.firstElementChild;
|
|
11284
|
+
}
|
|
11285
|
+
/**
|
|
11286
|
+
* @deprecated
|
|
11287
|
+
* compatible with G 3.0
|
|
11288
|
+
* @deprecated
|
|
11289
|
+
* get last child group/shape
|
|
11290
|
+
*/
|
|
11291
|
+
;
|
|
11449
11292
|
|
|
11450
|
-
|
|
11293
|
+
_proto.getLast = function getLast() {
|
|
11294
|
+
return this.lastElementChild;
|
|
11295
|
+
}
|
|
11296
|
+
/**
|
|
11297
|
+
* @deprecated
|
|
11298
|
+
* compatible with G 3.0
|
|
11299
|
+
* @deprecated
|
|
11300
|
+
* get child group/shape by index
|
|
11301
|
+
*/
|
|
11302
|
+
;
|
|
11451
11303
|
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11304
|
+
_proto.getChildByIndex = function getChildByIndex(index) {
|
|
11305
|
+
return this.children[index] || null;
|
|
11306
|
+
}
|
|
11307
|
+
/**
|
|
11308
|
+
* compatible with G 3.0
|
|
11309
|
+
* @deprecated
|
|
11310
|
+
*/
|
|
11311
|
+
;
|
|
11455
11312
|
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11313
|
+
_proto.add = function add(child, index) {
|
|
11314
|
+
return this.appendChild(child, index);
|
|
11315
|
+
}
|
|
11316
|
+
/**
|
|
11317
|
+
* @alias style.clipPath
|
|
11318
|
+
* @deprecated
|
|
11319
|
+
*/
|
|
11320
|
+
;
|
|
11459
11321
|
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
_this.removeAttribute(propertyName);
|
|
11469
|
-
},
|
|
11470
|
-
item: function item() {
|
|
11471
|
-
return '';
|
|
11472
|
-
}
|
|
11473
|
-
}), {
|
|
11474
|
-
get: function get(target, name) {
|
|
11475
|
-
if (target[name] !== undefined) {
|
|
11476
|
-
// if (name in target) {
|
|
11477
|
-
return target[name];
|
|
11478
|
-
}
|
|
11322
|
+
_proto.setClip = function setClip(clipPath) {
|
|
11323
|
+
this.style.clipPath = clipPath;
|
|
11324
|
+
}
|
|
11325
|
+
/**
|
|
11326
|
+
* @alias style.clipPath
|
|
11327
|
+
* @deprecated
|
|
11328
|
+
*/
|
|
11329
|
+
;
|
|
11479
11330
|
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11331
|
+
_proto.getClip = function getClip() {
|
|
11332
|
+
return this.style.clipPath || null;
|
|
11333
|
+
}
|
|
11334
|
+
/**
|
|
11335
|
+
* compatible with G 3.0
|
|
11336
|
+
* @deprecated
|
|
11337
|
+
*/
|
|
11338
|
+
;
|
|
11484
11339
|
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11340
|
+
_proto.set = function set(name, value) {
|
|
11341
|
+
this.config[name] = value;
|
|
11342
|
+
}
|
|
11343
|
+
/**
|
|
11344
|
+
* compatible with G 3.0
|
|
11345
|
+
* @deprecated
|
|
11346
|
+
*/
|
|
11347
|
+
;
|
|
11488
11348
|
|
|
11489
|
-
|
|
11349
|
+
_proto.get = function get(name) {
|
|
11350
|
+
return this.config[name];
|
|
11351
|
+
}
|
|
11352
|
+
/**
|
|
11353
|
+
* compatible with G 3.0
|
|
11354
|
+
* @alias object.config
|
|
11355
|
+
* @deprecated
|
|
11356
|
+
*/
|
|
11357
|
+
;
|
|
11490
11358
|
|
|
11359
|
+
_proto.getConfig = function getConfig() {
|
|
11360
|
+
return this.config;
|
|
11361
|
+
};
|
|
11491
11362
|
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
}
|
|
11363
|
+
_proto.attr = function attr() {
|
|
11364
|
+
var _this3 = this;
|
|
11495
11365
|
|
|
11496
|
-
|
|
11366
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11367
|
+
args[_key] = arguments[_key];
|
|
11368
|
+
}
|
|
11497
11369
|
|
|
11498
|
-
|
|
11499
|
-
|
|
11370
|
+
var name = args[0],
|
|
11371
|
+
value = args[1];
|
|
11500
11372
|
|
|
11373
|
+
if (!name) {
|
|
11374
|
+
return this.attributes;
|
|
11375
|
+
}
|
|
11501
11376
|
|
|
11502
|
-
|
|
11377
|
+
if (isObject(name)) {
|
|
11378
|
+
Object.keys(name).forEach(function (key) {
|
|
11379
|
+
_this3.setAttribute(key, name[key]);
|
|
11380
|
+
});
|
|
11381
|
+
return this;
|
|
11382
|
+
}
|
|
11503
11383
|
|
|
11504
|
-
|
|
11505
|
-
|
|
11506
|
-
|
|
11507
|
-
|
|
11384
|
+
if (args.length === 2) {
|
|
11385
|
+
this.setAttribute(name, value);
|
|
11386
|
+
return this;
|
|
11387
|
+
}
|
|
11508
11388
|
|
|
11509
|
-
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
|
|
11517
|
-
|
|
11518
|
-
|
|
11389
|
+
return this.attributes[name];
|
|
11390
|
+
}
|
|
11391
|
+
/**
|
|
11392
|
+
* @alias setPosition
|
|
11393
|
+
* @deprecated
|
|
11394
|
+
*/
|
|
11395
|
+
;
|
|
11396
|
+
|
|
11397
|
+
_proto.moveTo = function moveTo(position, y, z) {
|
|
11398
|
+
if (y === void 0) {
|
|
11399
|
+
y = 0;
|
|
11400
|
+
}
|
|
11401
|
+
|
|
11402
|
+
if (z === void 0) {
|
|
11403
|
+
z = 0;
|
|
11404
|
+
}
|
|
11519
11405
|
|
|
11520
|
-
|
|
11406
|
+
this.setPosition(position, y, z);
|
|
11407
|
+
return this;
|
|
11408
|
+
}
|
|
11409
|
+
/**
|
|
11410
|
+
* @alias setPosition
|
|
11411
|
+
* @deprecated
|
|
11412
|
+
*/
|
|
11413
|
+
;
|
|
11521
11414
|
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
cloned.appendChild(clonedChild);
|
|
11526
|
-
});
|
|
11415
|
+
_proto.move = function move(position, y, z) {
|
|
11416
|
+
if (y === void 0) {
|
|
11417
|
+
y = 0;
|
|
11527
11418
|
}
|
|
11528
11419
|
|
|
11529
|
-
|
|
11530
|
-
|
|
11531
|
-
|
|
11532
|
-
_proto.initAttributes = function initAttributes(attributes) {
|
|
11533
|
-
if (attributes === void 0) {
|
|
11534
|
-
attributes = {};
|
|
11420
|
+
if (z === void 0) {
|
|
11421
|
+
z = 0;
|
|
11535
11422
|
}
|
|
11536
11423
|
|
|
11537
|
-
|
|
11538
|
-
this
|
|
11424
|
+
this.setPosition(position, y, z);
|
|
11425
|
+
return this;
|
|
11426
|
+
}
|
|
11427
|
+
/**
|
|
11428
|
+
* @alias style.zIndex
|
|
11429
|
+
* @deprecated
|
|
11430
|
+
*/
|
|
11431
|
+
;
|
|
11539
11432
|
|
|
11540
|
-
|
|
11541
|
-
|
|
11433
|
+
_proto.setZIndex = function setZIndex(zIndex) {
|
|
11434
|
+
this.style.zIndex = zIndex;
|
|
11435
|
+
return this;
|
|
11436
|
+
}
|
|
11437
|
+
/**
|
|
11438
|
+
* return 3x3 matrix in world space
|
|
11439
|
+
* @deprecated
|
|
11440
|
+
*/
|
|
11441
|
+
;
|
|
11542
11442
|
|
|
11543
|
-
_proto.
|
|
11544
|
-
|
|
11545
|
-
force = false;
|
|
11546
|
-
}
|
|
11443
|
+
_proto.getMatrix = function getMatrix(transformMat4) {
|
|
11444
|
+
var transform = transformMat4 || this.getWorldTransform();
|
|
11547
11445
|
|
|
11548
|
-
var
|
|
11549
|
-
|
|
11550
|
-
|
|
11446
|
+
var _mat4$getTranslation = mat4.getTranslation(vec3.create(), transform),
|
|
11447
|
+
tx = _mat4$getTranslation[0],
|
|
11448
|
+
ty = _mat4$getTranslation[1];
|
|
11551
11449
|
|
|
11450
|
+
var _mat4$getScaling = mat4.getScaling(vec3.create(), transform),
|
|
11451
|
+
sx = _mat4$getScaling[0],
|
|
11452
|
+
sy = _mat4$getScaling[1];
|
|
11552
11453
|
|
|
11553
|
-
|
|
11554
|
-
return;
|
|
11555
|
-
}
|
|
11454
|
+
var rotation = mat4.getRotation(quat$1.create(), transform); // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11556
11455
|
|
|
11557
|
-
|
|
11558
|
-
|
|
11456
|
+
var _getEuler3 = getEuler(vec3.create(), rotation),
|
|
11457
|
+
eux = _getEuler3[0],
|
|
11458
|
+
euy = _getEuler3[1],
|
|
11459
|
+
euz = _getEuler3[2]; // gimbal lock at 90 degrees
|
|
11559
11460
|
|
|
11560
|
-
|
|
11561
|
-
|
|
11461
|
+
|
|
11462
|
+
return fromRotationTranslationScale(eux || euz, tx, ty, sx, sy);
|
|
11562
11463
|
}
|
|
11563
11464
|
/**
|
|
11564
|
-
*
|
|
11465
|
+
* return 3x3 matrix in local space
|
|
11466
|
+
* @deprecated
|
|
11565
11467
|
*/
|
|
11566
11468
|
;
|
|
11567
11469
|
|
|
11568
|
-
_proto.
|
|
11569
|
-
|
|
11570
|
-
|
|
11470
|
+
_proto.getLocalMatrix = function getLocalMatrix() {
|
|
11471
|
+
return this.getMatrix(this.getLocalTransform());
|
|
11472
|
+
}
|
|
11473
|
+
/**
|
|
11474
|
+
* set 3x3 matrix in world space
|
|
11475
|
+
* @deprecated
|
|
11476
|
+
*/
|
|
11477
|
+
;
|
|
11571
11478
|
|
|
11572
|
-
|
|
11573
|
-
|
|
11479
|
+
_proto.setMatrix = function setMatrix(mat) {
|
|
11480
|
+
var _decompose = decompose(mat),
|
|
11481
|
+
tx = _decompose[0],
|
|
11482
|
+
ty = _decompose[1],
|
|
11483
|
+
scalingX = _decompose[2],
|
|
11484
|
+
scalingY = _decompose[3],
|
|
11485
|
+
angle = _decompose[4];
|
|
11486
|
+
|
|
11487
|
+
this.setEulerAngles(angle).setPosition(tx, ty).setLocalScale(scalingX, scalingY);
|
|
11488
|
+
}
|
|
11489
|
+
/**
|
|
11490
|
+
* set 3x3 matrix in local space
|
|
11491
|
+
* @deprecated
|
|
11492
|
+
*/
|
|
11493
|
+
;
|
|
11494
|
+
|
|
11495
|
+
_proto.setLocalMatrix = function setLocalMatrix(mat) {
|
|
11496
|
+
var _decompose2 = decompose(mat),
|
|
11497
|
+
tx = _decompose2[0],
|
|
11498
|
+
ty = _decompose2[1],
|
|
11499
|
+
scalingX = _decompose2[2],
|
|
11500
|
+
scalingY = _decompose2[3],
|
|
11501
|
+
angle = _decompose2[4];
|
|
11502
|
+
|
|
11503
|
+
this.setLocalEulerAngles(angle).setLocalPosition(tx, ty).setLocalScale(scalingX, scalingY);
|
|
11504
|
+
};
|
|
11505
|
+
|
|
11506
|
+
_createClass(DisplayObject, [{
|
|
11507
|
+
key: "interactive",
|
|
11508
|
+
get: function get() {
|
|
11509
|
+
return this.isInteractive();
|
|
11510
|
+
},
|
|
11511
|
+
set: function set(b) {
|
|
11512
|
+
this.style.pointerEvents = b ? 'auto' : 'none';
|
|
11574
11513
|
}
|
|
11514
|
+
}]);
|
|
11575
11515
|
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
var oldParsedValue = this.parsedStyle[name];
|
|
11579
|
-
this.styleValueRegistry.processProperties(this, (_this$styleValueRegis = {}, _this$styleValueRegis[name] = value, _this$styleValueRegis), parseOptions); // inform clip path targets
|
|
11516
|
+
return DisplayObject;
|
|
11517
|
+
}(Element);
|
|
11580
11518
|
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11519
|
+
var _excluded = ["style"];
|
|
11520
|
+
/**
|
|
11521
|
+
* shadow root
|
|
11522
|
+
* @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
|
|
11523
|
+
*/
|
|
11584
11524
|
|
|
11585
|
-
|
|
11525
|
+
var CustomElement = /*#__PURE__*/function (_DisplayObject) {
|
|
11526
|
+
_inheritsLoose(CustomElement, _DisplayObject);
|
|
11586
11527
|
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11593
|
-
} // redraw at next frame
|
|
11528
|
+
// static get observedAttributes(): string[] {
|
|
11529
|
+
// return [];
|
|
11530
|
+
// }
|
|
11531
|
+
// private shadowNodes: DisplayObject[] = [];
|
|
11532
|
+
function CustomElement(_temp) {
|
|
11533
|
+
var _this;
|
|
11594
11534
|
|
|
11535
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11536
|
+
style = _ref.style,
|
|
11537
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11595
11538
|
|
|
11596
|
-
|
|
11597
|
-
|
|
11539
|
+
_this = _DisplayObject.call(this, _extends({
|
|
11540
|
+
style: _extends({
|
|
11541
|
+
x: '',
|
|
11542
|
+
y: ''
|
|
11543
|
+
}, style)
|
|
11544
|
+
}, rest)) || this;
|
|
11545
|
+
_this.isCustomElement = true;
|
|
11546
|
+
return _this;
|
|
11547
|
+
}
|
|
11598
11548
|
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
this.mutationEvent.attrName = name;
|
|
11602
|
-
this.mutationEvent.prevParsedValue = oldParsedValue;
|
|
11603
|
-
this.mutationEvent.newParsedValue = this.parsedStyle[name];
|
|
11604
|
-
this.dispatchEvent(this.mutationEvent);
|
|
11549
|
+
return CustomElement;
|
|
11550
|
+
}(DisplayObject);
|
|
11605
11551
|
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
}
|
|
11610
|
-
}
|
|
11611
|
-
} // #region transformable
|
|
11552
|
+
var _excluded$1 = ["style"];
|
|
11553
|
+
var Circle = /*#__PURE__*/function (_DisplayObject) {
|
|
11554
|
+
_inheritsLoose(Circle, _DisplayObject);
|
|
11612
11555
|
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
* FIXME: It is worth noting that getBBox responds to original untransformed values of a drawn object.
|
|
11618
|
-
* @see https://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#getBBox
|
|
11619
|
-
*/
|
|
11620
|
-
;
|
|
11556
|
+
function Circle(_temp) {
|
|
11557
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11558
|
+
style = _ref.style,
|
|
11559
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
11621
11560
|
|
|
11622
|
-
|
|
11623
|
-
|
|
11561
|
+
return _DisplayObject.call(this, _extends({
|
|
11562
|
+
type: Shape.CIRCLE,
|
|
11563
|
+
style: _extends({
|
|
11564
|
+
cx: '',
|
|
11565
|
+
cy: '',
|
|
11566
|
+
r: ''
|
|
11567
|
+
}, style)
|
|
11568
|
+
}, rest)) || this;
|
|
11569
|
+
}
|
|
11624
11570
|
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
top = _aabb$getMin[1];
|
|
11571
|
+
return Circle;
|
|
11572
|
+
}(DisplayObject);
|
|
11628
11573
|
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
11574
|
+
var _excluded$2 = ["style"];
|
|
11575
|
+
var Ellipse = /*#__PURE__*/function (_DisplayObject) {
|
|
11576
|
+
_inheritsLoose(Ellipse, _DisplayObject);
|
|
11632
11577
|
|
|
11633
|
-
|
|
11634
|
-
|
|
11578
|
+
function Ellipse(_temp) {
|
|
11579
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11580
|
+
style = _ref.style,
|
|
11581
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
11635
11582
|
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11583
|
+
return _DisplayObject.call(this, _extends({
|
|
11584
|
+
type: Shape.ELLIPSE,
|
|
11585
|
+
style: _extends({
|
|
11586
|
+
cx: '',
|
|
11587
|
+
cy: '',
|
|
11588
|
+
rx: '',
|
|
11589
|
+
ry: ''
|
|
11590
|
+
}, style)
|
|
11591
|
+
}, rest)) || this;
|
|
11592
|
+
}
|
|
11593
|
+
|
|
11594
|
+
return Ellipse;
|
|
11595
|
+
}(DisplayObject);
|
|
11596
|
+
|
|
11597
|
+
var _excluded$3 = ["style"];
|
|
11598
|
+
/**
|
|
11599
|
+
* its attributes are inherited by its children.
|
|
11600
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/g
|
|
11601
|
+
*
|
|
11602
|
+
* @example
|
|
11603
|
+
* <g fill="white" stroke="green" stroke-width="5">
|
|
11604
|
+
<circle cx="40" cy="40" r="25" />
|
|
11605
|
+
<circle cx="60" cy="60" r="25" />
|
|
11606
|
+
</g>
|
|
11607
|
+
*/
|
|
11640
11608
|
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
}
|
|
11609
|
+
var Group = /*#__PURE__*/function (_DisplayObject) {
|
|
11610
|
+
_inheritsLoose(Group, _DisplayObject);
|
|
11644
11611
|
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11612
|
+
function Group(_temp) {
|
|
11613
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11614
|
+
style = _ref.style,
|
|
11615
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
11648
11616
|
|
|
11649
|
-
|
|
11650
|
-
|
|
11617
|
+
return _DisplayObject.call(this, _extends({
|
|
11618
|
+
type: Shape.GROUP,
|
|
11619
|
+
style: _extends({
|
|
11620
|
+
x: '',
|
|
11621
|
+
y: '',
|
|
11622
|
+
width: '',
|
|
11623
|
+
height: ''
|
|
11624
|
+
}, style)
|
|
11625
|
+
}, rest)) || this;
|
|
11651
11626
|
}
|
|
11652
|
-
/**
|
|
11653
|
-
* set position in world space
|
|
11654
|
-
*/
|
|
11655
|
-
;
|
|
11656
11627
|
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
y = 0;
|
|
11660
|
-
}
|
|
11628
|
+
return Group;
|
|
11629
|
+
}(DisplayObject);
|
|
11661
11630
|
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11631
|
+
var _excluded$4 = ["style"];
|
|
11632
|
+
var Image = /*#__PURE__*/function (_DisplayObject) {
|
|
11633
|
+
_inheritsLoose(Image, _DisplayObject);
|
|
11665
11634
|
|
|
11666
|
-
|
|
11667
|
-
|
|
11635
|
+
function Image(_temp) {
|
|
11636
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11637
|
+
style = _ref.style,
|
|
11638
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
11639
|
+
|
|
11640
|
+
return _DisplayObject.call(this, _extends({
|
|
11641
|
+
type: Shape.IMAGE,
|
|
11642
|
+
style: _extends({
|
|
11643
|
+
x: '',
|
|
11644
|
+
y: '',
|
|
11645
|
+
img: '',
|
|
11646
|
+
width: '',
|
|
11647
|
+
height: ''
|
|
11648
|
+
}, style)
|
|
11649
|
+
}, rest)) || this;
|
|
11668
11650
|
}
|
|
11669
|
-
/**
|
|
11670
|
-
* set position in local space
|
|
11671
|
-
*/
|
|
11672
|
-
;
|
|
11673
11651
|
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
y = 0;
|
|
11677
|
-
}
|
|
11652
|
+
return Image;
|
|
11653
|
+
}(DisplayObject);
|
|
11678
11654
|
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11655
|
+
var _excluded$5 = ["style"];
|
|
11656
|
+
var Line = /*#__PURE__*/function (_DisplayObject) {
|
|
11657
|
+
_inheritsLoose(Line, _DisplayObject);
|
|
11682
11658
|
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
* translate in world space
|
|
11688
|
-
*/
|
|
11689
|
-
;
|
|
11659
|
+
function Line(_temp) {
|
|
11660
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11661
|
+
style = _ref.style,
|
|
11662
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
11690
11663
|
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11664
|
+
return _DisplayObject.call(this, _extends({
|
|
11665
|
+
type: Shape.LINE,
|
|
11666
|
+
style: _extends({
|
|
11667
|
+
x1: 0,
|
|
11668
|
+
y1: 0,
|
|
11669
|
+
x2: 0,
|
|
11670
|
+
y2: 0,
|
|
11671
|
+
z1: 0,
|
|
11672
|
+
z2: 0,
|
|
11673
|
+
isBillboard: false
|
|
11674
|
+
}, style)
|
|
11675
|
+
}, rest)) || this;
|
|
11676
|
+
}
|
|
11695
11677
|
|
|
11696
|
-
|
|
11697
|
-
z = 0;
|
|
11698
|
-
}
|
|
11678
|
+
var _proto = Line.prototype;
|
|
11699
11679
|
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11680
|
+
_proto.getPoint = function getPoint(ratio) {
|
|
11681
|
+
// TODO: account for z1/z2 in 3D line
|
|
11682
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
11683
|
+
x1 = _this$parsedStyle.x1,
|
|
11684
|
+
y1 = _this$parsedStyle.y1,
|
|
11685
|
+
x2 = _this$parsedStyle.x2,
|
|
11686
|
+
y2 = _this$parsedStyle.y2,
|
|
11687
|
+
defX = _this$parsedStyle.defX,
|
|
11688
|
+
defY = _this$parsedStyle.defY;
|
|
11707
11689
|
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
}
|
|
11690
|
+
var _LineUtil$pointAt = Line$1.pointAt(x1.value, y1.value, x2.value, y2.value, ratio),
|
|
11691
|
+
x = _LineUtil$pointAt.x,
|
|
11692
|
+
y = _LineUtil$pointAt.y;
|
|
11712
11693
|
|
|
11713
|
-
|
|
11714
|
-
z = 0;
|
|
11715
|
-
}
|
|
11694
|
+
var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
11716
11695
|
|
|
11717
|
-
|
|
11718
|
-
return this;
|
|
11696
|
+
return new Point(transformed[0], transformed[1]);
|
|
11719
11697
|
};
|
|
11720
11698
|
|
|
11721
|
-
_proto.
|
|
11722
|
-
|
|
11699
|
+
_proto.getTotalLength = function getTotalLength() {
|
|
11700
|
+
// TODO: account for z1/z2 in 3D line
|
|
11701
|
+
var _this$parsedStyle2 = this.parsedStyle,
|
|
11702
|
+
x1 = _this$parsedStyle2.x1,
|
|
11703
|
+
y1 = _this$parsedStyle2.y1,
|
|
11704
|
+
x2 = _this$parsedStyle2.x2,
|
|
11705
|
+
y2 = _this$parsedStyle2.y2;
|
|
11706
|
+
return Line$1.length(x1.value, y1.value, x2.value, y2.value);
|
|
11723
11707
|
};
|
|
11724
11708
|
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
}
|
|
11728
|
-
/**
|
|
11729
|
-
* compatible with G 3.0
|
|
11730
|
-
*
|
|
11731
|
-
* scaling in local space
|
|
11732
|
-
* scale(10) = scale(10, 10, 10)
|
|
11733
|
-
*
|
|
11734
|
-
* we can't set scale in world space
|
|
11735
|
-
*/
|
|
11736
|
-
;
|
|
11709
|
+
return Line;
|
|
11710
|
+
}(DisplayObject);
|
|
11737
11711
|
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11712
|
+
var _excluded$6 = ["style"];
|
|
11713
|
+
var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
11714
|
+
_inheritsLoose(Path, _DisplayObject);
|
|
11741
11715
|
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
scaling = createVec3(scaling, y, z);
|
|
11747
|
-
}
|
|
11716
|
+
function Path(_temp) {
|
|
11717
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11718
|
+
style = _ref.style,
|
|
11719
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
11748
11720
|
|
|
11749
|
-
|
|
11750
|
-
|
|
11721
|
+
return _DisplayObject.call(this, _extends({
|
|
11722
|
+
type: Shape.PATH,
|
|
11723
|
+
style: _extends({
|
|
11724
|
+
path: '',
|
|
11725
|
+
miterLimit: 4
|
|
11726
|
+
}, style)
|
|
11727
|
+
}, rest)) || this;
|
|
11751
11728
|
}
|
|
11752
|
-
/**
|
|
11753
|
-
* set scaling in local space
|
|
11754
|
-
*/
|
|
11755
|
-
;
|
|
11756
11729
|
|
|
11757
|
-
_proto
|
|
11758
|
-
if (typeof scaling === 'number') {
|
|
11759
|
-
y = y || scaling;
|
|
11760
|
-
z = z || scaling;
|
|
11761
|
-
scaling = createVec3(scaling, y, z);
|
|
11762
|
-
}
|
|
11730
|
+
var _proto = Path.prototype;
|
|
11763
11731
|
|
|
11764
|
-
|
|
11765
|
-
return this;
|
|
11732
|
+
_proto.getTotalLength = function getTotalLength() {
|
|
11733
|
+
return this.parsedStyle.path.totalLength;
|
|
11766
11734
|
}
|
|
11767
11735
|
/**
|
|
11768
|
-
*
|
|
11736
|
+
* Get point according to ratio
|
|
11769
11737
|
*/
|
|
11770
11738
|
;
|
|
11771
11739
|
|
|
11772
|
-
_proto.
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11740
|
+
_proto.getPoint = function getPoint(ratio) {
|
|
11741
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
11742
|
+
defX = _this$parsedStyle.defX,
|
|
11743
|
+
defY = _this$parsedStyle.defY,
|
|
11744
|
+
_this$parsedStyle$pat = _this$parsedStyle.path,
|
|
11745
|
+
totalLength = _this$parsedStyle$pat.totalLength,
|
|
11746
|
+
absolutePath = _this$parsedStyle$pat.absolutePath;
|
|
11779
11747
|
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
/**
|
|
11784
|
-
* only return degrees of Z axis in world space
|
|
11785
|
-
*/
|
|
11786
|
-
;
|
|
11748
|
+
var _getPointAtLength = getPointAtLength(absolutePath, ratio * totalLength),
|
|
11749
|
+
x = _getPointAtLength.x,
|
|
11750
|
+
y = _getPointAtLength.y;
|
|
11787
11751
|
|
|
11788
|
-
|
|
11789
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11790
|
-
var _getEuler = getEuler(vec3.create(), this.sceneGraphService.getWorldTransform(this)),
|
|
11791
|
-
ex = _getEuler[0],
|
|
11792
|
-
ey = _getEuler[1],
|
|
11793
|
-
ez = _getEuler[2];
|
|
11752
|
+
var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
11794
11753
|
|
|
11795
|
-
return
|
|
11754
|
+
return new Point(transformed[0], transformed[1]);
|
|
11796
11755
|
}
|
|
11797
11756
|
/**
|
|
11798
|
-
*
|
|
11757
|
+
* Get start tangent vector
|
|
11799
11758
|
*/
|
|
11800
11759
|
;
|
|
11801
11760
|
|
|
11802
|
-
_proto.
|
|
11803
|
-
|
|
11804
|
-
var
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11761
|
+
_proto.getStartTangent = function getStartTangent() {
|
|
11762
|
+
var segments = this.parsedStyle.path.segments;
|
|
11763
|
+
var result = [];
|
|
11764
|
+
|
|
11765
|
+
if (segments.length > 1) {
|
|
11766
|
+
var startPoint = segments[0].currentPoint;
|
|
11767
|
+
var endPoint = segments[1].currentPoint;
|
|
11768
|
+
var tangent = segments[1].startTangent;
|
|
11769
|
+
result = [];
|
|
11770
|
+
|
|
11771
|
+
if (tangent) {
|
|
11772
|
+
result.push([startPoint[0] - tangent[0], startPoint[1] - tangent[1]]);
|
|
11773
|
+
result.push([startPoint[0], startPoint[1]]);
|
|
11774
|
+
} else {
|
|
11775
|
+
result.push([endPoint[0], endPoint[1]]);
|
|
11776
|
+
result.push([startPoint[0], startPoint[1]]);
|
|
11777
|
+
}
|
|
11778
|
+
}
|
|
11808
11779
|
|
|
11809
|
-
return
|
|
11780
|
+
return result;
|
|
11810
11781
|
}
|
|
11811
11782
|
/**
|
|
11812
|
-
*
|
|
11783
|
+
* Get end tangent vector
|
|
11813
11784
|
*/
|
|
11814
11785
|
;
|
|
11815
11786
|
|
|
11816
|
-
_proto.
|
|
11817
|
-
this.
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
/**
|
|
11821
|
-
* set euler angles(degrees) in local space
|
|
11822
|
-
*/
|
|
11823
|
-
;
|
|
11787
|
+
_proto.getEndTangent = function getEndTangent() {
|
|
11788
|
+
var segments = this.parsedStyle.path.segments;
|
|
11789
|
+
var length = segments.length;
|
|
11790
|
+
var result = [];
|
|
11824
11791
|
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11792
|
+
if (length > 1) {
|
|
11793
|
+
var startPoint = segments[length - 2].currentPoint;
|
|
11794
|
+
var endPoint = segments[length - 1].currentPoint;
|
|
11795
|
+
var tangent = segments[length - 1].endTangent;
|
|
11796
|
+
result = [];
|
|
11829
11797
|
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11798
|
+
if (tangent) {
|
|
11799
|
+
result.push([endPoint[0] - tangent[0], endPoint[1] - tangent[1]]);
|
|
11800
|
+
result.push([endPoint[0], endPoint[1]]);
|
|
11801
|
+
} else {
|
|
11802
|
+
result.push([startPoint[0], startPoint[1]]);
|
|
11803
|
+
result.push([endPoint[0], endPoint[1]]);
|
|
11804
|
+
}
|
|
11835
11805
|
}
|
|
11836
11806
|
|
|
11837
|
-
return
|
|
11807
|
+
return result;
|
|
11838
11808
|
};
|
|
11839
11809
|
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
this.sceneGraphService.rotate(this, 0, 0, x);
|
|
11843
|
-
} else {
|
|
11844
|
-
this.sceneGraphService.rotate(this, x, y, z);
|
|
11845
|
-
}
|
|
11810
|
+
return Path;
|
|
11811
|
+
}(DisplayObject);
|
|
11846
11812
|
|
|
11847
|
-
|
|
11848
|
-
|
|
11813
|
+
var _excluded$7 = ["style"];
|
|
11814
|
+
var Polygon = /*#__PURE__*/function (_DisplayObject) {
|
|
11815
|
+
_inheritsLoose(Polygon, _DisplayObject);
|
|
11849
11816
|
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11817
|
+
function Polygon(_temp) {
|
|
11818
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11819
|
+
style = _ref.style,
|
|
11820
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
11854
11821
|
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11822
|
+
return _DisplayObject.call(this, _extends({
|
|
11823
|
+
type: Shape.POLYGON,
|
|
11824
|
+
style: _extends({
|
|
11825
|
+
points: '',
|
|
11826
|
+
miterLimit: 4
|
|
11827
|
+
}, style)
|
|
11828
|
+
}, rest)) || this;
|
|
11829
|
+
}
|
|
11859
11830
|
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
return this;
|
|
11863
|
-
};
|
|
11831
|
+
return Polygon;
|
|
11832
|
+
}(DisplayObject);
|
|
11864
11833
|
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11834
|
+
var _excluded$8 = ["style"];
|
|
11835
|
+
var Polyline = /*#__PURE__*/function (_DisplayObject) {
|
|
11836
|
+
_inheritsLoose(Polyline, _DisplayObject);
|
|
11868
11837
|
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11838
|
+
function Polyline(_temp) {
|
|
11839
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11840
|
+
style = _ref.style,
|
|
11841
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
11872
11842
|
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11843
|
+
return _DisplayObject.call(this, _extends({
|
|
11844
|
+
type: Shape.POLYLINE,
|
|
11845
|
+
style: _extends({
|
|
11846
|
+
points: '',
|
|
11847
|
+
miterLimit: 4
|
|
11848
|
+
}, style)
|
|
11849
|
+
}, rest)) || this;
|
|
11850
|
+
}
|
|
11876
11851
|
|
|
11877
|
-
_proto
|
|
11878
|
-
return this.sceneGraphService.getLocalTransform(this);
|
|
11879
|
-
};
|
|
11852
|
+
var _proto = Polyline.prototype;
|
|
11880
11853
|
|
|
11881
|
-
_proto.
|
|
11882
|
-
return this.
|
|
11854
|
+
_proto.getTotalLength = function getTotalLength() {
|
|
11855
|
+
return this.parsedStyle.points.totalLength;
|
|
11883
11856
|
};
|
|
11884
11857
|
|
|
11885
|
-
_proto.
|
|
11886
|
-
this.
|
|
11887
|
-
|
|
11888
|
-
|
|
11858
|
+
_proto.getPoint = function getPoint(ratio) {
|
|
11859
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
11860
|
+
defX = _this$parsedStyle.defX,
|
|
11861
|
+
defY = _this$parsedStyle.defY,
|
|
11862
|
+
_this$parsedStyle$poi = _this$parsedStyle.points,
|
|
11863
|
+
points = _this$parsedStyle$poi.points,
|
|
11864
|
+
segments = _this$parsedStyle$poi.segments;
|
|
11865
|
+
var subt = 0;
|
|
11866
|
+
var index = 0;
|
|
11867
|
+
segments.forEach(function (v, i) {
|
|
11868
|
+
if (ratio >= v[0] && ratio <= v[1]) {
|
|
11869
|
+
subt = (ratio - v[0]) / (v[1] - v[0]);
|
|
11870
|
+
index = i;
|
|
11871
|
+
}
|
|
11872
|
+
});
|
|
11889
11873
|
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
// #region animatable
|
|
11874
|
+
var _LineUtil$pointAt = Line$1.pointAt(points[index][0], points[index][1], points[index + 1][0], points[index + 1][1], subt),
|
|
11875
|
+
x = _LineUtil$pointAt.x,
|
|
11876
|
+
y = _LineUtil$pointAt.y;
|
|
11894
11877
|
|
|
11895
|
-
|
|
11896
|
-
* returns an array of all Animation objects affecting this element
|
|
11897
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations
|
|
11898
|
-
*/
|
|
11899
|
-
;
|
|
11878
|
+
var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
11900
11879
|
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
}
|
|
11904
|
-
/**
|
|
11905
|
-
* create an animation with WAAPI
|
|
11906
|
-
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/animate
|
|
11907
|
-
*/
|
|
11908
|
-
;
|
|
11880
|
+
return new Point(transformed[0], transformed[1]);
|
|
11881
|
+
};
|
|
11909
11882
|
|
|
11910
|
-
_proto.
|
|
11911
|
-
var
|
|
11883
|
+
_proto.getStartTangent = function getStartTangent() {
|
|
11884
|
+
var points = this.parsedStyle.points.points;
|
|
11885
|
+
var result = [];
|
|
11886
|
+
result.push([points[1][0], points[1][1]]);
|
|
11887
|
+
result.push([points[0][0], points[0][1]]);
|
|
11888
|
+
return result;
|
|
11889
|
+
};
|
|
11912
11890
|
|
|
11913
|
-
|
|
11891
|
+
_proto.getEndTangent = function getEndTangent() {
|
|
11892
|
+
var points = this.parsedStyle.points.points;
|
|
11893
|
+
var l = points.length - 1;
|
|
11894
|
+
var result = [];
|
|
11895
|
+
result.push([points[l - 1][0], points[l - 1][1]]);
|
|
11896
|
+
result.push([points[l][0], points[l][1]]);
|
|
11897
|
+
return result;
|
|
11898
|
+
};
|
|
11914
11899
|
|
|
11915
|
-
|
|
11916
|
-
|
|
11900
|
+
return Polyline;
|
|
11901
|
+
}(DisplayObject);
|
|
11917
11902
|
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11903
|
+
var _excluded$9 = ["style"];
|
|
11904
|
+
var Rect = /*#__PURE__*/function (_DisplayObject) {
|
|
11905
|
+
_inheritsLoose(Rect, _DisplayObject);
|
|
11921
11906
|
|
|
11907
|
+
function Rect(_temp) {
|
|
11908
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11909
|
+
style = _ref.style,
|
|
11910
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
11922
11911
|
|
|
11923
|
-
|
|
11912
|
+
return _DisplayObject.call(this, _extends({
|
|
11913
|
+
type: Shape.RECT,
|
|
11914
|
+
style: _extends({
|
|
11915
|
+
x: '',
|
|
11916
|
+
y: '',
|
|
11917
|
+
width: '',
|
|
11918
|
+
height: '',
|
|
11919
|
+
radius: ''
|
|
11920
|
+
}, style)
|
|
11921
|
+
}, rest)) || this;
|
|
11922
|
+
}
|
|
11924
11923
|
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
}
|
|
11924
|
+
return Rect;
|
|
11925
|
+
}(DisplayObject);
|
|
11928
11926
|
|
|
11929
|
-
|
|
11930
|
-
|
|
11931
|
-
|
|
11927
|
+
var _excluded$a = ["style"];
|
|
11928
|
+
/**
|
|
11929
|
+
* <text> @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextElement
|
|
11930
|
+
*/
|
|
11931
|
+
|
|
11932
|
+
var Text = /*#__PURE__*/function (_DisplayObject) {
|
|
11933
|
+
_inheritsLoose(Text, _DisplayObject);
|
|
11932
11934
|
|
|
11933
11935
|
/**
|
|
11934
|
-
*
|
|
11935
|
-
*
|
|
11936
|
-
* @deprecated
|
|
11937
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility
|
|
11936
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
|
|
11938
11937
|
*/
|
|
11939
|
-
|
|
11938
|
+
function Text(_temp) {
|
|
11939
|
+
var _this;
|
|
11940
11940
|
|
|
11941
|
-
|
|
11942
|
-
|
|
11941
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
11942
|
+
style = _ref.style,
|
|
11943
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
11944
|
+
|
|
11945
|
+
_this = _DisplayObject.call(this, _extends({
|
|
11946
|
+
type: Shape.TEXT,
|
|
11947
|
+
style: _extends({
|
|
11948
|
+
x: '',
|
|
11949
|
+
y: '',
|
|
11950
|
+
text: '',
|
|
11951
|
+
fontSize: '',
|
|
11952
|
+
fontFamily: '',
|
|
11953
|
+
fontStyle: '',
|
|
11954
|
+
fontWeight: '',
|
|
11955
|
+
fontVariant: '',
|
|
11956
|
+
textAlign: '',
|
|
11957
|
+
textBaseline: '',
|
|
11958
|
+
textTransform: '',
|
|
11959
|
+
// dropShadow: false,
|
|
11960
|
+
// dropShadowAlpha: 1,
|
|
11961
|
+
// dropShadowAngle: Math.PI / 6,
|
|
11962
|
+
// dropShadowBlur: 0,
|
|
11963
|
+
// dropShadowColor: '#000',
|
|
11964
|
+
// dropShadowDistance: 5,
|
|
11965
|
+
fill: 'black',
|
|
11966
|
+
// stroke: 'black',
|
|
11967
|
+
letterSpacing: 0,
|
|
11968
|
+
lineHeight: 0,
|
|
11969
|
+
miterLimit: 10,
|
|
11970
|
+
whiteSpace: 'pre',
|
|
11971
|
+
wordWrap: false,
|
|
11972
|
+
wordWrapWidth: 0,
|
|
11973
|
+
leading: 0,
|
|
11974
|
+
dx: '',
|
|
11975
|
+
dy: ''
|
|
11976
|
+
}, style)
|
|
11977
|
+
}, rest)) || this;
|
|
11978
|
+
_this.LENGTHADJUST_SPACING = 1;
|
|
11979
|
+
_this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
|
11980
|
+
_this.LENGTHADJUST_UNKNOWN = 0;
|
|
11981
|
+
_this.lengthAdjust = void 0;
|
|
11982
|
+
_this.textLength = void 0;
|
|
11983
|
+
return _this;
|
|
11943
11984
|
}
|
|
11944
|
-
/**
|
|
11945
|
-
* @deprecated
|
|
11946
|
-
* hide group, which will also change visibility of its children in sceneGraphNode
|
|
11947
|
-
*/
|
|
11948
|
-
;
|
|
11949
11985
|
|
|
11950
|
-
_proto
|
|
11951
|
-
|
|
11986
|
+
var _proto = Text.prototype;
|
|
11987
|
+
|
|
11988
|
+
_proto.getCharNumAtPosition = function getCharNumAtPosition(point) {
|
|
11989
|
+
throw new Error('Method not implemented.');
|
|
11952
11990
|
}
|
|
11953
11991
|
/**
|
|
11954
|
-
*
|
|
11992
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
|
|
11955
11993
|
*/
|
|
11956
11994
|
;
|
|
11957
11995
|
|
|
11958
|
-
_proto.
|
|
11959
|
-
var _this$parsedStyle
|
|
11996
|
+
_proto.getComputedTextLength = function getComputedTextLength() {
|
|
11997
|
+
var _this$parsedStyle$met;
|
|
11960
11998
|
|
|
11961
|
-
return ((_this$parsedStyle = this.parsedStyle) === null || _this$parsedStyle === void 0 ? void 0 :
|
|
11999
|
+
return ((_this$parsedStyle$met = this.parsedStyle.metrics) === null || _this$parsedStyle$met === void 0 ? void 0 : _this$parsedStyle$met.maxLineWidth) || 0;
|
|
11962
12000
|
};
|
|
11963
12001
|
|
|
11964
|
-
_proto.
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
return ((_this$parsedStyle2 = this.parsedStyle) === null || _this$parsedStyle2 === void 0 ? void 0 : (_this$parsedStyle2$po = _this$parsedStyle2.pointerEvents) === null || _this$parsedStyle2$po === void 0 ? void 0 : _this$parsedStyle2$po.value) !== 'none';
|
|
12002
|
+
_proto.getEndPositionOfChar = function getEndPositionOfChar(charnum) {
|
|
12003
|
+
throw new Error('Method not implemented.');
|
|
11968
12004
|
};
|
|
11969
12005
|
|
|
11970
|
-
_proto.
|
|
11971
|
-
|
|
11972
|
-
}
|
|
11973
|
-
/**
|
|
11974
|
-
* bring to front in current group
|
|
11975
|
-
*/
|
|
11976
|
-
;
|
|
12006
|
+
_proto.getExtentOfChar = function getExtentOfChar(charnum) {
|
|
12007
|
+
throw new Error('Method not implemented.');
|
|
12008
|
+
};
|
|
11977
12009
|
|
|
11978
|
-
_proto.
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
return Number(child.style.zIndex);
|
|
11982
|
-
})) + 1;
|
|
11983
|
-
}
|
|
12010
|
+
_proto.getNumberOfChars = function getNumberOfChars() {
|
|
12011
|
+
throw new Error('Method not implemented.');
|
|
12012
|
+
};
|
|
11984
12013
|
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
* send to back in current group
|
|
11989
|
-
*/
|
|
11990
|
-
;
|
|
12014
|
+
_proto.getRotationOfChar = function getRotationOfChar(charnum) {
|
|
12015
|
+
throw new Error('Method not implemented.');
|
|
12016
|
+
};
|
|
11991
12017
|
|
|
11992
|
-
_proto.
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
return Number(child.style.zIndex);
|
|
11996
|
-
})) - 1;
|
|
11997
|
-
}
|
|
12018
|
+
_proto.getStartPositionOfChar = function getStartPositionOfChar(charnum) {
|
|
12019
|
+
throw new Error('Method not implemented.');
|
|
12020
|
+
};
|
|
11998
12021
|
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12022
|
+
_proto.getSubStringLength = function getSubStringLength(charnum, nchars) {
|
|
12023
|
+
throw new Error('Method not implemented.');
|
|
12024
|
+
};
|
|
12002
12025
|
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
* @deprecated
|
|
12007
|
-
*/
|
|
12008
|
-
;
|
|
12026
|
+
_proto.selectSubString = function selectSubString(charnum, nchars) {
|
|
12027
|
+
throw new Error('Method not implemented.');
|
|
12028
|
+
};
|
|
12009
12029
|
|
|
12010
|
-
_proto.
|
|
12011
|
-
|
|
12012
|
-
}
|
|
12013
|
-
/**
|
|
12014
|
-
* @deprecated
|
|
12015
|
-
* compatible with G 3.0
|
|
12016
|
-
* @deprecated
|
|
12017
|
-
*/
|
|
12018
|
-
;
|
|
12030
|
+
_proto.getLineBoundingRects = function getLineBoundingRects() {
|
|
12031
|
+
var _this$parsedStyle$met2;
|
|
12019
12032
|
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
}
|
|
12023
|
-
/**
|
|
12024
|
-
* @deprecated
|
|
12025
|
-
* compatible with G 3.0
|
|
12026
|
-
* @deprecated
|
|
12027
|
-
*/
|
|
12028
|
-
;
|
|
12033
|
+
return ((_this$parsedStyle$met2 = this.parsedStyle.metrics) === null || _this$parsedStyle$met2 === void 0 ? void 0 : _this$parsedStyle$met2.lineMetrics) || [];
|
|
12034
|
+
};
|
|
12029
12035
|
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
}
|
|
12033
|
-
/**
|
|
12034
|
-
* @deprecated
|
|
12035
|
-
* compatible with G 3.0
|
|
12036
|
-
* @deprecated
|
|
12037
|
-
*/
|
|
12038
|
-
;
|
|
12036
|
+
return Text;
|
|
12037
|
+
}(DisplayObject);
|
|
12039
12038
|
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
* compatible with G 3.0
|
|
12046
|
-
* @deprecated
|
|
12047
|
-
* get last child group/shape
|
|
12048
|
-
*/
|
|
12049
|
-
;
|
|
12039
|
+
var _excluded$b = ["style"];
|
|
12040
|
+
/**
|
|
12041
|
+
* HTML container
|
|
12042
|
+
* @see https://github.com/pmndrs/drei#html
|
|
12043
|
+
*/
|
|
12050
12044
|
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
}
|
|
12054
|
-
/**
|
|
12055
|
-
* @deprecated
|
|
12056
|
-
* compatible with G 3.0
|
|
12057
|
-
* @deprecated
|
|
12058
|
-
* get child group/shape by index
|
|
12059
|
-
*/
|
|
12060
|
-
;
|
|
12045
|
+
var HTML = /*#__PURE__*/function (_DisplayObject) {
|
|
12046
|
+
_inheritsLoose(HTML, _DisplayObject);
|
|
12061
12047
|
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
}
|
|
12065
|
-
/**
|
|
12066
|
-
* compatible with G 3.0
|
|
12067
|
-
* @deprecated
|
|
12068
|
-
*/
|
|
12069
|
-
;
|
|
12048
|
+
function HTML(_temp) {
|
|
12049
|
+
var _this;
|
|
12070
12050
|
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
/**
|
|
12075
|
-
* @alias style.clipPath
|
|
12076
|
-
* @deprecated
|
|
12077
|
-
*/
|
|
12078
|
-
;
|
|
12051
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
12052
|
+
style = _ref.style,
|
|
12053
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
12079
12054
|
|
|
12080
|
-
|
|
12081
|
-
|
|
12055
|
+
_this = _DisplayObject.call(this, _extends({
|
|
12056
|
+
type: Shape.HTML,
|
|
12057
|
+
style: _extends({
|
|
12058
|
+
x: '',
|
|
12059
|
+
y: '',
|
|
12060
|
+
width: 'auto',
|
|
12061
|
+
height: 'auto',
|
|
12062
|
+
innerHTML: ''
|
|
12063
|
+
}, style)
|
|
12064
|
+
}, rest)) || this;
|
|
12065
|
+
_this.cullable.enable = false;
|
|
12066
|
+
return _this;
|
|
12082
12067
|
}
|
|
12083
12068
|
/**
|
|
12084
|
-
*
|
|
12085
|
-
*
|
|
12069
|
+
* return wrapper HTMLElement
|
|
12070
|
+
* * <div> in g-webgl/canvas
|
|
12071
|
+
* * <foreignObject> in g-svg
|
|
12086
12072
|
*/
|
|
12087
|
-
;
|
|
12088
12073
|
|
|
12089
|
-
_proto.getClip = function getClip() {
|
|
12090
|
-
return this.style.clipPath || null;
|
|
12091
|
-
}
|
|
12092
|
-
/**
|
|
12093
|
-
* compatible with G 3.0
|
|
12094
|
-
* @deprecated
|
|
12095
|
-
*/
|
|
12096
|
-
;
|
|
12097
12074
|
|
|
12098
|
-
_proto
|
|
12099
|
-
this.config[name] = value;
|
|
12100
|
-
}
|
|
12101
|
-
/**
|
|
12102
|
-
* compatible with G 3.0
|
|
12103
|
-
* @deprecated
|
|
12104
|
-
*/
|
|
12105
|
-
;
|
|
12075
|
+
var _proto = HTML.prototype;
|
|
12106
12076
|
|
|
12107
|
-
_proto.
|
|
12108
|
-
return this.
|
|
12077
|
+
_proto.getDomElement = function getDomElement() {
|
|
12078
|
+
return this.parsedStyle.$el;
|
|
12109
12079
|
}
|
|
12110
12080
|
/**
|
|
12111
|
-
*
|
|
12112
|
-
* @
|
|
12113
|
-
* @deprecated
|
|
12081
|
+
* override with $el.getBoundingClientRect
|
|
12082
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
|
|
12114
12083
|
*/
|
|
12115
12084
|
;
|
|
12116
12085
|
|
|
12117
|
-
_proto.
|
|
12118
|
-
return this.
|
|
12086
|
+
_proto.getBoundingClientRect = function getBoundingClientRect() {
|
|
12087
|
+
return this.parsedStyle.$el.getBoundingClientRect();
|
|
12119
12088
|
};
|
|
12120
12089
|
|
|
12121
|
-
_proto.
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12125
|
-
args[_key] = arguments[_key];
|
|
12126
|
-
}
|
|
12127
|
-
|
|
12128
|
-
var name = args[0],
|
|
12129
|
-
value = args[1];
|
|
12130
|
-
|
|
12131
|
-
if (!name) {
|
|
12132
|
-
return this.attributes;
|
|
12133
|
-
}
|
|
12134
|
-
|
|
12135
|
-
if (isObject(name)) {
|
|
12136
|
-
Object.keys(name).forEach(function (key) {
|
|
12137
|
-
_this3.setAttribute(key, name[key]);
|
|
12138
|
-
});
|
|
12139
|
-
return this;
|
|
12140
|
-
}
|
|
12090
|
+
_proto.getClientRects = function getClientRects() {
|
|
12091
|
+
return [this.getBoundingClientRect()];
|
|
12092
|
+
};
|
|
12141
12093
|
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
return this;
|
|
12145
|
-
}
|
|
12094
|
+
_proto.getBounds = function getBounds() {
|
|
12095
|
+
var _this$ownerDocument, _this$ownerDocument$d;
|
|
12146
12096
|
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
/**
|
|
12150
|
-
* @alias setPosition
|
|
12151
|
-
* @deprecated
|
|
12152
|
-
*/
|
|
12153
|
-
;
|
|
12097
|
+
var clientRect = this.getBoundingClientRect(); // calc context's offset
|
|
12098
|
+
// @ts-ignore
|
|
12154
12099
|
|
|
12155
|
-
|
|
12156
|
-
if (y === void 0) {
|
|
12157
|
-
y = 0;
|
|
12158
|
-
}
|
|
12100
|
+
var canvasRect = (_this$ownerDocument = this.ownerDocument) === null || _this$ownerDocument === void 0 ? void 0 : (_this$ownerDocument$d = _this$ownerDocument.defaultView) === null || _this$ownerDocument$d === void 0 ? void 0 : _this$ownerDocument$d.getContextService().getBoundingClientRect();
|
|
12159
12101
|
|
|
12160
|
-
if (
|
|
12161
|
-
|
|
12102
|
+
if (canvasRect) {
|
|
12103
|
+
var minX = clientRect.left - canvasRect.left;
|
|
12104
|
+
var minY = clientRect.top - canvasRect.top;
|
|
12105
|
+
var aabb = new AABB();
|
|
12106
|
+
aabb.setMinMax(vec3.fromValues(minX, minY, 0), vec3.fromValues(minX + clientRect.width, minY + clientRect.height, 0));
|
|
12107
|
+
return aabb;
|
|
12162
12108
|
}
|
|
12163
12109
|
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
}
|
|
12167
|
-
/**
|
|
12168
|
-
* @alias setPosition
|
|
12169
|
-
* @deprecated
|
|
12170
|
-
*/
|
|
12171
|
-
;
|
|
12110
|
+
return null;
|
|
12111
|
+
};
|
|
12172
12112
|
|
|
12173
|
-
_proto.
|
|
12174
|
-
if (
|
|
12175
|
-
|
|
12176
|
-
|
|
12113
|
+
_proto.getLocalBounds = function getLocalBounds() {
|
|
12114
|
+
if (this.parentNode) {
|
|
12115
|
+
var parentInvert = mat4.invert(mat4.create(), this.parentNode.getWorldTransform());
|
|
12116
|
+
var bounds = this.getBounds();
|
|
12177
12117
|
|
|
12178
|
-
|
|
12179
|
-
|
|
12118
|
+
if (!AABB.isEmpty(bounds)) {
|
|
12119
|
+
var localBounds = new AABB();
|
|
12120
|
+
localBounds.setFromTransformedAABB(bounds, parentInvert);
|
|
12121
|
+
return localBounds;
|
|
12122
|
+
}
|
|
12180
12123
|
}
|
|
12181
12124
|
|
|
12182
|
-
this.
|
|
12183
|
-
|
|
12184
|
-
}
|
|
12185
|
-
/**
|
|
12186
|
-
* @alias style.zIndex
|
|
12187
|
-
* @deprecated
|
|
12188
|
-
*/
|
|
12189
|
-
;
|
|
12190
|
-
|
|
12191
|
-
_proto.setZIndex = function setZIndex(zIndex) {
|
|
12192
|
-
this.style.zIndex = zIndex;
|
|
12193
|
-
return this;
|
|
12194
|
-
}
|
|
12195
|
-
/**
|
|
12196
|
-
* return 3x3 matrix in world space
|
|
12197
|
-
* @deprecated
|
|
12198
|
-
*/
|
|
12199
|
-
;
|
|
12125
|
+
return this.getBounds();
|
|
12126
|
+
};
|
|
12200
12127
|
|
|
12201
|
-
|
|
12202
|
-
|
|
12128
|
+
return HTML;
|
|
12129
|
+
}(DisplayObject);
|
|
12203
12130
|
|
|
12204
|
-
|
|
12205
|
-
|
|
12206
|
-
|
|
12131
|
+
/**
|
|
12132
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
|
|
12133
|
+
*/
|
|
12207
12134
|
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
sy = _mat4$getScaling[1];
|
|
12135
|
+
var AnimationEvent = /*#__PURE__*/function (_FederatedEvent) {
|
|
12136
|
+
_inheritsLoose(AnimationEvent, _FederatedEvent);
|
|
12211
12137
|
|
|
12212
|
-
|
|
12138
|
+
function AnimationEvent(manager, target, currentTime, timelineTime) {
|
|
12139
|
+
var _this;
|
|
12213
12140
|
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12141
|
+
_this = _FederatedEvent.call(this, manager) || this;
|
|
12142
|
+
_this.currentTime = void 0;
|
|
12143
|
+
_this.timelineTime = void 0;
|
|
12144
|
+
_this.currentTime = currentTime;
|
|
12145
|
+
_this.timelineTime = timelineTime; // @ts-ignore
|
|
12218
12146
|
|
|
12147
|
+
_this.target = target;
|
|
12148
|
+
_this.type = 'finish';
|
|
12149
|
+
_this.bubbles = false; // @ts-ignore
|
|
12219
12150
|
|
|
12220
|
-
|
|
12151
|
+
_this.currentTarget = target;
|
|
12152
|
+
_this.defaultPrevented = false;
|
|
12153
|
+
_this.eventPhase = _this.AT_TARGET;
|
|
12154
|
+
_this.timeStamp = Date.now();
|
|
12155
|
+
_this.currentTime = currentTime;
|
|
12156
|
+
_this.timelineTime = timelineTime;
|
|
12157
|
+
return _this;
|
|
12221
12158
|
}
|
|
12222
|
-
/**
|
|
12223
|
-
* return 3x3 matrix in local space
|
|
12224
|
-
* @deprecated
|
|
12225
|
-
*/
|
|
12226
|
-
;
|
|
12227
12159
|
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
}
|
|
12231
|
-
/**
|
|
12232
|
-
* set 3x3 matrix in world space
|
|
12233
|
-
* @deprecated
|
|
12234
|
-
*/
|
|
12235
|
-
;
|
|
12160
|
+
return AnimationEvent;
|
|
12161
|
+
}(FederatedEvent);
|
|
12236
12162
|
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
scalingX = _decompose[2],
|
|
12242
|
-
scalingY = _decompose[3],
|
|
12243
|
-
angle = _decompose[4];
|
|
12163
|
+
var sequenceNumber = 0;
|
|
12164
|
+
/**
|
|
12165
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation
|
|
12166
|
+
*/
|
|
12244
12167
|
|
|
12245
|
-
|
|
12168
|
+
var Animation = /*#__PURE__*/function () {
|
|
12169
|
+
function Animation(effect, timeline) {
|
|
12170
|
+
this.effect = void 0;
|
|
12171
|
+
this.timeline = void 0;
|
|
12172
|
+
this.id = void 0;
|
|
12173
|
+
this.currentTimePending = false;
|
|
12174
|
+
this._idle = true;
|
|
12175
|
+
this._paused = false;
|
|
12176
|
+
this._finishedFlag = true;
|
|
12177
|
+
this.oldPlayState = void 0;
|
|
12178
|
+
this._holdTime = void 0;
|
|
12179
|
+
this.readyPromise = void 0;
|
|
12180
|
+
this.finishedPromise = void 0;
|
|
12181
|
+
this.resolveReadyPromise = void 0;
|
|
12182
|
+
this.rejectReadyPromise = void 0;
|
|
12183
|
+
this.resolveFinishedPromise = void 0;
|
|
12184
|
+
this.rejectFinishedPromise = void 0;
|
|
12185
|
+
this.onfinish = void 0;
|
|
12186
|
+
this.oncancel = void 0;
|
|
12187
|
+
this.onframe = void 0;
|
|
12188
|
+
this._currentTime = 0;
|
|
12189
|
+
this._startTime = void 0;
|
|
12190
|
+
this._playbackRate = 1;
|
|
12191
|
+
this._inEffect = void 0;
|
|
12192
|
+
this._inTimeline = true;
|
|
12193
|
+
this.onremove = void 0;
|
|
12194
|
+
this.effect = effect;
|
|
12195
|
+
effect.animation = this;
|
|
12196
|
+
this.timeline = timeline;
|
|
12197
|
+
this.id = "" + sequenceNumber++;
|
|
12198
|
+
this._inEffect = !!this.effect.update(0);
|
|
12199
|
+
this._holdTime = 0;
|
|
12200
|
+
this._paused = false;
|
|
12201
|
+
this.oldPlayState = 'idle';
|
|
12202
|
+
this.updatePromises();
|
|
12246
12203
|
}
|
|
12247
12204
|
/**
|
|
12248
|
-
*
|
|
12249
|
-
*
|
|
12205
|
+
* state machine,
|
|
12206
|
+
* resolve/reject ready/finished Promise according to current state
|
|
12250
12207
|
*/
|
|
12251
|
-
;
|
|
12252
12208
|
|
|
12253
|
-
_proto.setLocalMatrix = function setLocalMatrix(mat) {
|
|
12254
|
-
var _decompose2 = decompose(mat),
|
|
12255
|
-
tx = _decompose2[0],
|
|
12256
|
-
ty = _decompose2[1],
|
|
12257
|
-
scalingX = _decompose2[2],
|
|
12258
|
-
scalingY = _decompose2[3],
|
|
12259
|
-
angle = _decompose2[4];
|
|
12260
12209
|
|
|
12261
|
-
|
|
12262
|
-
};
|
|
12210
|
+
var _proto = Animation.prototype;
|
|
12263
12211
|
|
|
12264
|
-
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12212
|
+
_proto.updatePromises = function updatePromises() {
|
|
12213
|
+
var oldPlayState = this.oldPlayState;
|
|
12214
|
+
var newPlayState = this.pending ? 'pending' : this.playState;
|
|
12215
|
+
|
|
12216
|
+
if (this.readyPromise && newPlayState !== oldPlayState) {
|
|
12217
|
+
if (newPlayState === 'idle') {
|
|
12218
|
+
this.rejectReadyPromise();
|
|
12219
|
+
this.readyPromise = undefined;
|
|
12220
|
+
} else if (oldPlayState === 'pending') {
|
|
12221
|
+
this.resolveReadyPromise();
|
|
12222
|
+
} else if (newPlayState === 'pending') {
|
|
12223
|
+
this.readyPromise = undefined;
|
|
12224
|
+
}
|
|
12271
12225
|
}
|
|
12272
|
-
}]);
|
|
12273
12226
|
|
|
12274
|
-
|
|
12275
|
-
|
|
12227
|
+
if (this.finishedPromise && newPlayState !== oldPlayState) {
|
|
12228
|
+
if (newPlayState === 'idle') {
|
|
12229
|
+
this.rejectFinishedPromise();
|
|
12230
|
+
this.finishedPromise = undefined;
|
|
12231
|
+
} else if (newPlayState === 'finished') {
|
|
12232
|
+
this.resolveFinishedPromise();
|
|
12233
|
+
} else if (oldPlayState === 'finished') {
|
|
12234
|
+
this.finishedPromise = undefined;
|
|
12235
|
+
}
|
|
12236
|
+
}
|
|
12276
12237
|
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
* @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
|
|
12281
|
-
*/
|
|
12238
|
+
this.oldPlayState = newPlayState;
|
|
12239
|
+
return this.readyPromise || this.finishedPromise;
|
|
12240
|
+
};
|
|
12282
12241
|
|
|
12283
|
-
|
|
12284
|
-
|
|
12242
|
+
_proto.play = function play() {
|
|
12243
|
+
this.updatePromises();
|
|
12244
|
+
this._paused = false;
|
|
12285
12245
|
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
function CustomElement(_temp) {
|
|
12291
|
-
var _this;
|
|
12246
|
+
if (this._isFinished || this._idle) {
|
|
12247
|
+
this.rewind();
|
|
12248
|
+
this._startTime = null;
|
|
12249
|
+
}
|
|
12292
12250
|
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12251
|
+
this._finishedFlag = false;
|
|
12252
|
+
this._idle = false;
|
|
12253
|
+
this.ensureAlive();
|
|
12254
|
+
this.timeline.applyDirtiedAnimation(this);
|
|
12296
12255
|
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12300
|
-
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12256
|
+
if (this.timeline.animations.indexOf(this) === -1) {
|
|
12257
|
+
this.timeline.animations.push(this);
|
|
12258
|
+
}
|
|
12259
|
+
|
|
12260
|
+
this.updatePromises();
|
|
12261
|
+
};
|
|
12262
|
+
|
|
12263
|
+
_proto.pause = function pause() {
|
|
12264
|
+
this.updatePromises();
|
|
12265
|
+
|
|
12266
|
+
if (this.currentTime) {
|
|
12267
|
+
this._holdTime = this.currentTime;
|
|
12268
|
+
}
|
|
12306
12269
|
|
|
12307
|
-
|
|
12308
|
-
|
|
12270
|
+
if (!this._isFinished && !this._paused && !this._idle) {
|
|
12271
|
+
this.currentTimePending = true;
|
|
12272
|
+
} else if (this._idle) {
|
|
12273
|
+
this.rewind();
|
|
12274
|
+
this._idle = false;
|
|
12275
|
+
}
|
|
12309
12276
|
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12277
|
+
this._startTime = null;
|
|
12278
|
+
this._paused = true;
|
|
12279
|
+
this.updatePromises();
|
|
12280
|
+
};
|
|
12313
12281
|
|
|
12314
|
-
function
|
|
12315
|
-
|
|
12316
|
-
|
|
12317
|
-
|
|
12282
|
+
_proto.finish = function finish() {
|
|
12283
|
+
this.updatePromises();
|
|
12284
|
+
if (this._idle) return;
|
|
12285
|
+
this.currentTime = this._playbackRate > 0 ? this.totalDuration : 0;
|
|
12286
|
+
this._startTime = this.totalDuration - this.currentTime;
|
|
12287
|
+
this.currentTimePending = false;
|
|
12288
|
+
this.timeline.applyDirtiedAnimation(this);
|
|
12289
|
+
this.updatePromises();
|
|
12290
|
+
};
|
|
12318
12291
|
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12292
|
+
_proto.cancel = function cancel() {
|
|
12293
|
+
this.updatePromises();
|
|
12294
|
+
if (!this._inEffect) return;
|
|
12295
|
+
this._inEffect = false;
|
|
12296
|
+
this._idle = true;
|
|
12297
|
+
this._paused = false;
|
|
12298
|
+
this._finishedFlag = true;
|
|
12299
|
+
this._currentTime = 0;
|
|
12300
|
+
this._startTime = null;
|
|
12301
|
+
this.effect.update(null); // effects are invalid after cancellation as the animation state
|
|
12302
|
+
// needs to un-apply.
|
|
12328
12303
|
|
|
12329
|
-
|
|
12330
|
-
|
|
12304
|
+
this.timeline.applyDirtiedAnimation(this);
|
|
12305
|
+
this.updatePromises();
|
|
12306
|
+
};
|
|
12331
12307
|
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12308
|
+
_proto.reverse = function reverse() {
|
|
12309
|
+
this.updatePromises();
|
|
12310
|
+
var oldCurrentTime = this.currentTime;
|
|
12311
|
+
this.playbackRate *= -1;
|
|
12312
|
+
this.play();
|
|
12335
12313
|
|
|
12336
|
-
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
12314
|
+
if (oldCurrentTime !== null) {
|
|
12315
|
+
this.currentTime = oldCurrentTime;
|
|
12316
|
+
}
|
|
12340
12317
|
|
|
12341
|
-
|
|
12342
|
-
type: Shape.ELLIPSE,
|
|
12343
|
-
style: _extends({
|
|
12344
|
-
cx: '',
|
|
12345
|
-
cy: '',
|
|
12346
|
-
rx: '',
|
|
12347
|
-
ry: ''
|
|
12348
|
-
}, style)
|
|
12349
|
-
}, rest)) || this;
|
|
12318
|
+
this.updatePromises();
|
|
12350
12319
|
}
|
|
12320
|
+
/**
|
|
12321
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/updatePlaybackRate
|
|
12322
|
+
*/
|
|
12323
|
+
;
|
|
12351
12324
|
|
|
12352
|
-
|
|
12353
|
-
|
|
12325
|
+
_proto.updatePlaybackRate = function updatePlaybackRate(playbackRate) {
|
|
12326
|
+
this.playbackRate = playbackRate;
|
|
12327
|
+
};
|
|
12354
12328
|
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
* its attributes are inherited by its children.
|
|
12358
|
-
* @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/g
|
|
12359
|
-
*
|
|
12360
|
-
* @example
|
|
12361
|
-
* <g fill="white" stroke="green" stroke-width="5">
|
|
12362
|
-
<circle cx="40" cy="40" r="25" />
|
|
12363
|
-
<circle cx="60" cy="60" r="25" />
|
|
12364
|
-
</g>
|
|
12365
|
-
*/
|
|
12329
|
+
_proto.targetAnimations = function targetAnimations() {
|
|
12330
|
+
var _this$effect;
|
|
12366
12331
|
|
|
12367
|
-
var
|
|
12368
|
-
|
|
12332
|
+
var target = (_this$effect = this.effect) === null || _this$effect === void 0 ? void 0 : _this$effect.target;
|
|
12333
|
+
return target.getAnimations();
|
|
12334
|
+
};
|
|
12369
12335
|
|
|
12370
|
-
function
|
|
12371
|
-
var
|
|
12372
|
-
style = _ref.style,
|
|
12373
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
12336
|
+
_proto.markTarget = function markTarget() {
|
|
12337
|
+
var animations = this.targetAnimations();
|
|
12374
12338
|
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
y: '',
|
|
12380
|
-
width: '',
|
|
12381
|
-
height: ''
|
|
12382
|
-
}, style)
|
|
12383
|
-
}, rest)) || this;
|
|
12384
|
-
}
|
|
12339
|
+
if (animations.indexOf(this) === -1) {
|
|
12340
|
+
animations.push(this);
|
|
12341
|
+
}
|
|
12342
|
+
};
|
|
12385
12343
|
|
|
12386
|
-
|
|
12387
|
-
|
|
12344
|
+
_proto.unmarkTarget = function unmarkTarget() {
|
|
12345
|
+
var animations = this.targetAnimations();
|
|
12346
|
+
var index = animations.indexOf(this);
|
|
12388
12347
|
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12348
|
+
if (index !== -1) {
|
|
12349
|
+
animations.splice(index, 1);
|
|
12350
|
+
}
|
|
12351
|
+
};
|
|
12392
12352
|
|
|
12393
|
-
function
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12353
|
+
_proto.tick = function tick(timelineTime, isAnimationFrame) {
|
|
12354
|
+
if (!this._idle && !this._paused) {
|
|
12355
|
+
if (this._startTime === null) {
|
|
12356
|
+
if (isAnimationFrame) {
|
|
12357
|
+
this.startTime = timelineTime - this._currentTime / this.playbackRate;
|
|
12358
|
+
}
|
|
12359
|
+
} else if (!this._isFinished) {
|
|
12360
|
+
this.tickCurrentTime((timelineTime - this._startTime) * this.playbackRate);
|
|
12361
|
+
}
|
|
12362
|
+
}
|
|
12397
12363
|
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
img: '',
|
|
12404
|
-
width: '',
|
|
12405
|
-
height: ''
|
|
12406
|
-
}, style)
|
|
12407
|
-
}, rest)) || this;
|
|
12408
|
-
}
|
|
12364
|
+
if (isAnimationFrame) {
|
|
12365
|
+
this.currentTimePending = false;
|
|
12366
|
+
this.fireEvents(timelineTime);
|
|
12367
|
+
}
|
|
12368
|
+
};
|
|
12409
12369
|
|
|
12410
|
-
|
|
12411
|
-
|
|
12370
|
+
_proto.rewind = function rewind() {
|
|
12371
|
+
if (this.playbackRate >= 0) {
|
|
12372
|
+
this.currentTime = 0;
|
|
12373
|
+
} else if (this.totalDuration < Infinity) {
|
|
12374
|
+
this.currentTime = this.totalDuration;
|
|
12375
|
+
} else {
|
|
12376
|
+
throw new Error('Unable to rewind negative playback rate animation with infinite duration');
|
|
12377
|
+
}
|
|
12378
|
+
};
|
|
12412
12379
|
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12380
|
+
_proto.persist = function persist() {
|
|
12381
|
+
throw new Error('Method not implemented.');
|
|
12382
|
+
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12383
|
+
;
|
|
12416
12384
|
|
|
12417
|
-
function
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12385
|
+
_proto.addEventListener = function addEventListener(type, listener, options) {
|
|
12386
|
+
throw new Error('Method not implemented.');
|
|
12387
|
+
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12388
|
+
;
|
|
12421
12389
|
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
y1: 0,
|
|
12427
|
-
x2: 0,
|
|
12428
|
-
y2: 0,
|
|
12429
|
-
z1: 0,
|
|
12430
|
-
z2: 0,
|
|
12431
|
-
isBillboard: false
|
|
12432
|
-
}, style)
|
|
12433
|
-
}, rest)) || this;
|
|
12434
|
-
}
|
|
12390
|
+
_proto.removeEventListener = function removeEventListener(type, listener, options) {
|
|
12391
|
+
throw new Error('Method not implemented.');
|
|
12392
|
+
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12393
|
+
;
|
|
12435
12394
|
|
|
12436
|
-
|
|
12395
|
+
_proto.dispatchEvent = function dispatchEvent(event) {
|
|
12396
|
+
throw new Error('Method not implemented.');
|
|
12397
|
+
};
|
|
12437
12398
|
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
y1 = _this$parsedStyle.y1,
|
|
12443
|
-
x2 = _this$parsedStyle.x2,
|
|
12444
|
-
y2 = _this$parsedStyle.y2,
|
|
12445
|
-
defX = _this$parsedStyle.defX,
|
|
12446
|
-
defY = _this$parsedStyle.defY;
|
|
12399
|
+
// replaceState: AnimationReplaceState;
|
|
12400
|
+
_proto.commitStyles = function commitStyles() {
|
|
12401
|
+
throw new Error('Method not implemented.');
|
|
12402
|
+
};
|
|
12447
12403
|
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12404
|
+
_proto.ensureAlive = function ensureAlive() {
|
|
12405
|
+
// If an animation is playing backwards and is not fill backwards/both
|
|
12406
|
+
// then it should go out of effect when it reaches the start of its
|
|
12407
|
+
// active interval (currentTime === 0).
|
|
12408
|
+
if (this.playbackRate < 0 && this.currentTime === 0) {
|
|
12409
|
+
var _this$effect2;
|
|
12451
12410
|
|
|
12452
|
-
|
|
12411
|
+
this._inEffect = !!((_this$effect2 = this.effect) === null || _this$effect2 === void 0 ? void 0 : _this$effect2.update(-1));
|
|
12412
|
+
} else {
|
|
12413
|
+
var _this$effect3;
|
|
12453
12414
|
|
|
12454
|
-
|
|
12455
|
-
|
|
12415
|
+
this._inEffect = !!((_this$effect3 = this.effect) === null || _this$effect3 === void 0 ? void 0 : _this$effect3.update(this.currentTime));
|
|
12416
|
+
}
|
|
12456
12417
|
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
y1 = _this$parsedStyle2.y1,
|
|
12462
|
-
x2 = _this$parsedStyle2.x2,
|
|
12463
|
-
y2 = _this$parsedStyle2.y2;
|
|
12464
|
-
return Line$1.length(x1.value, y1.value, x2.value, y2.value);
|
|
12418
|
+
if (!this._inTimeline && (this._inEffect || !this._finishedFlag)) {
|
|
12419
|
+
this._inTimeline = true;
|
|
12420
|
+
this.timeline.animations.push(this);
|
|
12421
|
+
}
|
|
12465
12422
|
};
|
|
12466
12423
|
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
var _excluded$6 = ["style"];
|
|
12471
|
-
var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
12472
|
-
_inheritsLoose(Path, _DisplayObject);
|
|
12424
|
+
_proto.tickCurrentTime = function tickCurrentTime(newTime, ignoreLimit) {
|
|
12425
|
+
if (newTime !== this._currentTime) {
|
|
12426
|
+
this._currentTime = newTime;
|
|
12473
12427
|
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
12428
|
+
if (this._isFinished && !ignoreLimit) {
|
|
12429
|
+
this._currentTime = this._playbackRate > 0 ? this.totalDuration : 0;
|
|
12430
|
+
}
|
|
12478
12431
|
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
path: '',
|
|
12483
|
-
miterLimit: 4
|
|
12484
|
-
}, style)
|
|
12485
|
-
}, rest)) || this;
|
|
12486
|
-
}
|
|
12432
|
+
this.ensureAlive();
|
|
12433
|
+
}
|
|
12434
|
+
};
|
|
12487
12435
|
|
|
12488
|
-
|
|
12436
|
+
_proto.fireEvents = function fireEvents(baseTime) {
|
|
12437
|
+
var _this = this;
|
|
12489
12438
|
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12496
|
-
|
|
12439
|
+
if (this._isFinished) {
|
|
12440
|
+
if (!this._finishedFlag) {
|
|
12441
|
+
if (this.onfinish) {
|
|
12442
|
+
var event = new AnimationEvent(null, this, this.currentTime, baseTime);
|
|
12443
|
+
setTimeout(function () {
|
|
12444
|
+
if (_this.onfinish) {
|
|
12445
|
+
_this.onfinish(event);
|
|
12446
|
+
}
|
|
12447
|
+
});
|
|
12448
|
+
}
|
|
12497
12449
|
|
|
12498
|
-
|
|
12499
|
-
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
totalLength = _this$parsedStyle$pat.totalLength,
|
|
12504
|
-
absolutePath = _this$parsedStyle$pat.absolutePath;
|
|
12450
|
+
this._finishedFlag = true;
|
|
12451
|
+
}
|
|
12452
|
+
} else {
|
|
12453
|
+
if (this.onframe && this.playState === 'running') {
|
|
12454
|
+
var _event = new AnimationEvent(null, this, this.currentTime, baseTime);
|
|
12505
12455
|
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
y = _getPointAtLength.y;
|
|
12456
|
+
this.onframe(_event);
|
|
12457
|
+
}
|
|
12509
12458
|
|
|
12510
|
-
|
|
12459
|
+
this._finishedFlag = false;
|
|
12460
|
+
}
|
|
12461
|
+
};
|
|
12511
12462
|
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12463
|
+
_createClass(Animation, [{
|
|
12464
|
+
key: "pending",
|
|
12465
|
+
get:
|
|
12466
|
+
/**
|
|
12467
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
|
|
12468
|
+
*/
|
|
12518
12469
|
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12470
|
+
/**
|
|
12471
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline
|
|
12472
|
+
*/
|
|
12522
12473
|
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
result = [];
|
|
12474
|
+
/**
|
|
12475
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
|
|
12476
|
+
*/
|
|
12477
|
+
// animation: InternalAnimation | null;
|
|
12528
12478
|
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12479
|
+
/**
|
|
12480
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
|
|
12481
|
+
*/
|
|
12482
|
+
function get() {
|
|
12483
|
+
return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
|
|
12484
|
+
}
|
|
12485
|
+
}, {
|
|
12486
|
+
key: "playState",
|
|
12487
|
+
get: function get() {
|
|
12488
|
+
if (this._idle) return 'idle';
|
|
12489
|
+
if (this._isFinished) return 'finished';
|
|
12490
|
+
if (this._paused) return 'paused';
|
|
12491
|
+
return 'running';
|
|
12536
12492
|
}
|
|
12493
|
+
/**
|
|
12494
|
+
* record previos state
|
|
12495
|
+
*/
|
|
12537
12496
|
|
|
12538
|
-
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12543
|
-
|
|
12497
|
+
}, {
|
|
12498
|
+
key: "ready",
|
|
12499
|
+
get:
|
|
12500
|
+
/**
|
|
12501
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
|
|
12502
|
+
* @example
|
|
12503
|
+
animation.pause();
|
|
12504
|
+
animation.ready.then(function() {
|
|
12505
|
+
// Displays 'running'
|
|
12506
|
+
alert(animation.playState);
|
|
12507
|
+
});
|
|
12508
|
+
animation.play();
|
|
12509
|
+
*/
|
|
12510
|
+
function get() {
|
|
12511
|
+
var _this2 = this;
|
|
12544
12512
|
|
|
12545
|
-
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12513
|
+
if (!this.readyPromise) {
|
|
12514
|
+
if (this.timeline.animationsWithPromises.indexOf(this) === -1) {
|
|
12515
|
+
this.timeline.animationsWithPromises.push(this);
|
|
12516
|
+
}
|
|
12549
12517
|
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
result = [];
|
|
12518
|
+
this.readyPromise = new Promise(function (resolve, reject) {
|
|
12519
|
+
_this2.resolveReadyPromise = function () {
|
|
12520
|
+
resolve(_this2);
|
|
12521
|
+
};
|
|
12555
12522
|
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12523
|
+
_this2.rejectReadyPromise = function () {
|
|
12524
|
+
reject(new Error());
|
|
12525
|
+
};
|
|
12526
|
+
});
|
|
12527
|
+
|
|
12528
|
+
if (!this.pending) {
|
|
12529
|
+
this.resolveReadyPromise();
|
|
12530
|
+
}
|
|
12562
12531
|
}
|
|
12563
|
-
}
|
|
12564
12532
|
|
|
12565
|
-
|
|
12566
|
-
|
|
12533
|
+
return this.readyPromise;
|
|
12534
|
+
}
|
|
12535
|
+
/**
|
|
12536
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/finished
|
|
12537
|
+
* @example
|
|
12538
|
+
Promise.all(
|
|
12539
|
+
elem.getAnimations().map(
|
|
12540
|
+
function(animation) {
|
|
12541
|
+
return animation.finished
|
|
12542
|
+
}
|
|
12543
|
+
)
|
|
12544
|
+
).then(
|
|
12545
|
+
function() {
|
|
12546
|
+
return elem.remove();
|
|
12547
|
+
}
|
|
12548
|
+
);
|
|
12549
|
+
*/
|
|
12567
12550
|
|
|
12568
|
-
|
|
12569
|
-
|
|
12551
|
+
}, {
|
|
12552
|
+
key: "finished",
|
|
12553
|
+
get: function get() {
|
|
12554
|
+
var _this3 = this;
|
|
12570
12555
|
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12556
|
+
if (!this.finishedPromise) {
|
|
12557
|
+
if (this.timeline.animationsWithPromises.indexOf(this) === -1) {
|
|
12558
|
+
this.timeline.animationsWithPromises.push(this);
|
|
12559
|
+
}
|
|
12574
12560
|
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12561
|
+
this.finishedPromise = new Promise(function (resolve, reject) {
|
|
12562
|
+
_this3.resolveFinishedPromise = function () {
|
|
12563
|
+
resolve(_this3);
|
|
12564
|
+
};
|
|
12579
12565
|
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
miterLimit: 4
|
|
12585
|
-
}, style)
|
|
12586
|
-
}, rest)) || this;
|
|
12587
|
-
}
|
|
12566
|
+
_this3.rejectFinishedPromise = function () {
|
|
12567
|
+
reject(new Error());
|
|
12568
|
+
};
|
|
12569
|
+
});
|
|
12588
12570
|
|
|
12589
|
-
|
|
12590
|
-
|
|
12571
|
+
if (this.playState === 'finished') {
|
|
12572
|
+
this.resolveFinishedPromise();
|
|
12573
|
+
}
|
|
12574
|
+
}
|
|
12591
12575
|
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12576
|
+
return this.finishedPromise;
|
|
12577
|
+
}
|
|
12578
|
+
/**
|
|
12579
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/onfinish
|
|
12580
|
+
*/
|
|
12595
12581
|
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12582
|
+
}, {
|
|
12583
|
+
key: "currentTime",
|
|
12584
|
+
get:
|
|
12585
|
+
/**
|
|
12586
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/currentTime
|
|
12587
|
+
*/
|
|
12588
|
+
function get() {
|
|
12589
|
+
this.updatePromises();
|
|
12590
|
+
return this._idle || this.currentTimePending ? null : this._currentTime;
|
|
12591
|
+
},
|
|
12592
|
+
set: function set(newTime) {
|
|
12593
|
+
newTime = Number(newTime);
|
|
12594
|
+
if (isNaN(newTime)) return;
|
|
12595
|
+
this.timeline.restart();
|
|
12600
12596
|
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
style: _extends({
|
|
12604
|
-
points: '',
|
|
12605
|
-
miterLimit: 4
|
|
12606
|
-
}, style)
|
|
12607
|
-
}, rest)) || this;
|
|
12608
|
-
}
|
|
12597
|
+
if (!this._paused && this._startTime !== null) {
|
|
12598
|
+
var _this$timeline;
|
|
12609
12599
|
|
|
12610
|
-
|
|
12600
|
+
this._startTime = Number((_this$timeline = this.timeline) === null || _this$timeline === void 0 ? void 0 : _this$timeline.currentTime) - newTime / this.playbackRate;
|
|
12601
|
+
}
|
|
12611
12602
|
|
|
12612
|
-
|
|
12613
|
-
return this.parsedStyle.points.totalLength;
|
|
12614
|
-
};
|
|
12603
|
+
this.currentTimePending = false;
|
|
12615
12604
|
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
defX = _this$parsedStyle.defX,
|
|
12619
|
-
defY = _this$parsedStyle.defY,
|
|
12620
|
-
_this$parsedStyle$poi = _this$parsedStyle.points,
|
|
12621
|
-
points = _this$parsedStyle$poi.points,
|
|
12622
|
-
segments = _this$parsedStyle$poi.segments;
|
|
12623
|
-
var subt = 0;
|
|
12624
|
-
var index = 0;
|
|
12625
|
-
segments.forEach(function (v, i) {
|
|
12626
|
-
if (ratio >= v[0] && ratio <= v[1]) {
|
|
12627
|
-
subt = (ratio - v[0]) / (v[1] - v[0]);
|
|
12628
|
-
index = i;
|
|
12605
|
+
if (this._currentTime === newTime) {
|
|
12606
|
+
return;
|
|
12629
12607
|
}
|
|
12630
|
-
});
|
|
12631
|
-
|
|
12632
|
-
var _LineUtil$pointAt = Line$1.pointAt(points[index][0], points[index][1], points[index + 1][0], points[index + 1][1], subt),
|
|
12633
|
-
x = _LineUtil$pointAt.x,
|
|
12634
|
-
y = _LineUtil$pointAt.y;
|
|
12635
12608
|
|
|
12636
|
-
|
|
12609
|
+
if (this._idle) {
|
|
12610
|
+
this._idle = false;
|
|
12611
|
+
this._paused = true;
|
|
12612
|
+
}
|
|
12637
12613
|
|
|
12638
|
-
|
|
12639
|
-
|
|
12614
|
+
this.tickCurrentTime(newTime, true);
|
|
12615
|
+
this.timeline.applyDirtiedAnimation(this);
|
|
12616
|
+
}
|
|
12617
|
+
/**
|
|
12618
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/startTime
|
|
12619
|
+
*/
|
|
12640
12620
|
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12621
|
+
}, {
|
|
12622
|
+
key: "startTime",
|
|
12623
|
+
get: function get() {
|
|
12624
|
+
return this._startTime;
|
|
12625
|
+
},
|
|
12626
|
+
set: function set(newTime) {
|
|
12627
|
+
if (newTime !== null) {
|
|
12628
|
+
this.updatePromises();
|
|
12629
|
+
newTime = Number(newTime);
|
|
12630
|
+
if (isNaN(newTime)) return;
|
|
12631
|
+
if (this._paused || this._idle) return;
|
|
12632
|
+
this._startTime = newTime;
|
|
12633
|
+
this.tickCurrentTime((Number(this.timeline.currentTime) - this._startTime) * this.playbackRate);
|
|
12634
|
+
this.timeline.applyDirtiedAnimation(this);
|
|
12635
|
+
this.updatePromises();
|
|
12636
|
+
}
|
|
12637
|
+
}
|
|
12638
|
+
}, {
|
|
12639
|
+
key: "playbackRate",
|
|
12640
|
+
get: function get() {
|
|
12641
|
+
return this._playbackRate;
|
|
12642
|
+
},
|
|
12643
|
+
set: function set(value) {
|
|
12644
|
+
if (value === this._playbackRate) {
|
|
12645
|
+
return;
|
|
12646
|
+
}
|
|
12648
12647
|
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
result.push([points[l - 1][0], points[l - 1][1]]);
|
|
12654
|
-
result.push([points[l][0], points[l][1]]);
|
|
12655
|
-
return result;
|
|
12656
|
-
};
|
|
12648
|
+
this.updatePromises();
|
|
12649
|
+
var oldCurrentTime = this.currentTime;
|
|
12650
|
+
this._playbackRate = value;
|
|
12651
|
+
this.startTime = null;
|
|
12657
12652
|
|
|
12658
|
-
|
|
12659
|
-
|
|
12653
|
+
if (this.playState !== 'paused' && this.playState !== 'idle') {
|
|
12654
|
+
this._finishedFlag = false;
|
|
12655
|
+
this._idle = false;
|
|
12656
|
+
this.ensureAlive();
|
|
12657
|
+
this.timeline.applyDirtiedAnimation(this);
|
|
12658
|
+
}
|
|
12660
12659
|
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
|
|
12660
|
+
if (oldCurrentTime !== null) {
|
|
12661
|
+
this.currentTime = oldCurrentTime;
|
|
12662
|
+
}
|
|
12664
12663
|
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12668
|
-
|
|
12664
|
+
this.updatePromises();
|
|
12665
|
+
}
|
|
12666
|
+
}, {
|
|
12667
|
+
key: "_isFinished",
|
|
12668
|
+
get: function get() {
|
|
12669
|
+
return !this._idle && (this._playbackRate > 0 && Number(this._currentTime) >= this.totalDuration || this._playbackRate < 0 && Number(this._currentTime) <= 0);
|
|
12670
|
+
}
|
|
12671
|
+
}, {
|
|
12672
|
+
key: "totalDuration",
|
|
12673
|
+
get: function get() {
|
|
12674
|
+
var _this$effect4;
|
|
12669
12675
|
|
|
12670
|
-
|
|
12671
|
-
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
|
|
12675
|
-
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
}, style)
|
|
12679
|
-
}, rest)) || this;
|
|
12680
|
-
}
|
|
12676
|
+
return Number((_this$effect4 = this.effect) === null || _this$effect4 === void 0 ? void 0 : _this$effect4.getComputedTiming().endTime);
|
|
12677
|
+
}
|
|
12678
|
+
}, {
|
|
12679
|
+
key: "_needsTick",
|
|
12680
|
+
get: function get() {
|
|
12681
|
+
return this.pending || this.playState === 'running' || !this._finishedFlag;
|
|
12682
|
+
}
|
|
12683
|
+
}]);
|
|
12681
12684
|
|
|
12682
|
-
return
|
|
12683
|
-
}(
|
|
12685
|
+
return Animation;
|
|
12686
|
+
}();
|
|
12684
12687
|
|
|
12685
|
-
|
|
12688
|
+
function compareAnimations(leftAnimation, rightAnimation) {
|
|
12689
|
+
return Number(leftAnimation.id) - Number(rightAnimation.id);
|
|
12690
|
+
}
|
|
12686
12691
|
/**
|
|
12687
|
-
*
|
|
12692
|
+
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
|
|
12688
12693
|
*/
|
|
12689
12694
|
|
|
12690
|
-
var
|
|
12691
|
-
_inheritsLoose(Text, _DisplayObject);
|
|
12692
|
-
|
|
12695
|
+
var AnimationTimeline = /*#__PURE__*/function () {
|
|
12693
12696
|
/**
|
|
12694
|
-
*
|
|
12697
|
+
* all active animations
|
|
12695
12698
|
*/
|
|
12696
|
-
function
|
|
12697
|
-
var _this;
|
|
12699
|
+
function AnimationTimeline(document) {
|
|
12700
|
+
var _this = this;
|
|
12698
12701
|
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
+
this.document = void 0;
|
|
12703
|
+
this.animations = [];
|
|
12704
|
+
this.ticking = false;
|
|
12705
|
+
this.timelineTicking = false;
|
|
12706
|
+
this.hasRestartedThisFrame = false;
|
|
12707
|
+
this.animationsWithPromises = [];
|
|
12708
|
+
this.inTick = false;
|
|
12709
|
+
this.pendingEffects = [];
|
|
12710
|
+
this.currentTime = null;
|
|
12711
|
+
this.rafId = 0;
|
|
12712
|
+
this.rafCallbacks = [];
|
|
12713
|
+
this.frameId = void 0;
|
|
12702
12714
|
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
leading: 0,
|
|
12732
|
-
dx: '',
|
|
12733
|
-
dy: ''
|
|
12734
|
-
}, style)
|
|
12735
|
-
}, rest)) || this;
|
|
12736
|
-
_this.LENGTHADJUST_SPACING = 1;
|
|
12737
|
-
_this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
|
12738
|
-
_this.LENGTHADJUST_UNKNOWN = 0;
|
|
12739
|
-
_this.lengthAdjust = void 0;
|
|
12740
|
-
_this.textLength = void 0;
|
|
12741
|
-
return _this;
|
|
12715
|
+
this.webAnimationsNextTick = function (t) {
|
|
12716
|
+
_this.currentTime = t;
|
|
12717
|
+
|
|
12718
|
+
_this.discardAnimations();
|
|
12719
|
+
|
|
12720
|
+
if (_this.animations.length === 0) {
|
|
12721
|
+
_this.timelineTicking = false;
|
|
12722
|
+
} else {
|
|
12723
|
+
_this.requestAnimationFrame(_this.webAnimationsNextTick);
|
|
12724
|
+
}
|
|
12725
|
+
};
|
|
12726
|
+
|
|
12727
|
+
this.processRafCallbacks = function (t) {
|
|
12728
|
+
var processing = _this.rafCallbacks;
|
|
12729
|
+
_this.rafCallbacks = [];
|
|
12730
|
+
if (t < Number(_this.currentTime)) t = Number(_this.currentTime);
|
|
12731
|
+
|
|
12732
|
+
_this.animations.sort(compareAnimations);
|
|
12733
|
+
|
|
12734
|
+
_this.animations = _this.tick(t, true, _this.animations)[0];
|
|
12735
|
+
processing.forEach(function (entry) {
|
|
12736
|
+
entry[1](t);
|
|
12737
|
+
});
|
|
12738
|
+
|
|
12739
|
+
_this.applyPendingEffects();
|
|
12740
|
+
};
|
|
12741
|
+
|
|
12742
|
+
this.document = document;
|
|
12742
12743
|
}
|
|
12743
12744
|
|
|
12744
|
-
var _proto =
|
|
12745
|
+
var _proto = AnimationTimeline.prototype;
|
|
12746
|
+
|
|
12747
|
+
_proto.getAnimations = function getAnimations() {
|
|
12748
|
+
this.discardAnimations();
|
|
12749
|
+
return this.animations.slice();
|
|
12750
|
+
};
|
|
12751
|
+
|
|
12752
|
+
_proto.isTicking = function isTicking() {
|
|
12753
|
+
return this.inTick;
|
|
12754
|
+
};
|
|
12745
12755
|
|
|
12746
|
-
_proto.
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12756
|
+
_proto.play = function play(effect) {
|
|
12757
|
+
var animation = new Animation(effect, this);
|
|
12758
|
+
this.animations.push(animation);
|
|
12759
|
+
this.restartWebAnimationsNextTick();
|
|
12760
|
+
animation.updatePromises();
|
|
12761
|
+
animation.play();
|
|
12762
|
+
animation.updatePromises();
|
|
12763
|
+
return animation;
|
|
12764
|
+
} // RAF is supposed to be the last script to occur before frame rendering but not
|
|
12765
|
+
// all browsers behave like this. This function is for synchonously updating an
|
|
12766
|
+
// animation's effects whenever its state is mutated by script to work around
|
|
12767
|
+
// incorrect script execution ordering by the browser.
|
|
12752
12768
|
;
|
|
12753
12769
|
|
|
12754
|
-
_proto.
|
|
12755
|
-
var
|
|
12770
|
+
_proto.applyDirtiedAnimation = function applyDirtiedAnimation(animation) {
|
|
12771
|
+
var _this2 = this;
|
|
12756
12772
|
|
|
12757
|
-
|
|
12758
|
-
|
|
12773
|
+
if (this.inTick) {
|
|
12774
|
+
return;
|
|
12775
|
+
} // update active animations in displayobject
|
|
12759
12776
|
|
|
12760
|
-
_proto.getEndPositionOfChar = function getEndPositionOfChar(charnum) {
|
|
12761
|
-
throw new Error('Method not implemented.');
|
|
12762
|
-
};
|
|
12763
12777
|
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12778
|
+
animation.markTarget();
|
|
12779
|
+
var animations = animation.targetAnimations();
|
|
12780
|
+
animations.sort(compareAnimations); // clear inactive animations
|
|
12767
12781
|
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12782
|
+
var inactiveAnimations = this.tick(Number(this.currentTime), false, animations.slice())[1];
|
|
12783
|
+
inactiveAnimations.forEach(function (animation) {
|
|
12784
|
+
var index = _this2.animations.indexOf(animation);
|
|
12771
12785
|
|
|
12772
|
-
|
|
12773
|
-
|
|
12786
|
+
if (index !== -1) {
|
|
12787
|
+
_this2.animations.splice(index, 1);
|
|
12788
|
+
}
|
|
12789
|
+
});
|
|
12790
|
+
this.applyPendingEffects();
|
|
12774
12791
|
};
|
|
12775
12792
|
|
|
12776
|
-
_proto.
|
|
12777
|
-
|
|
12778
|
-
|
|
12793
|
+
_proto.restart = function restart() {
|
|
12794
|
+
if (!this.ticking) {
|
|
12795
|
+
this.ticking = true;
|
|
12796
|
+
this.requestAnimationFrame(function () {});
|
|
12797
|
+
this.hasRestartedThisFrame = true;
|
|
12798
|
+
}
|
|
12779
12799
|
|
|
12780
|
-
|
|
12781
|
-
throw new Error('Method not implemented.');
|
|
12800
|
+
return this.hasRestartedThisFrame;
|
|
12782
12801
|
};
|
|
12783
12802
|
|
|
12784
|
-
_proto.
|
|
12785
|
-
|
|
12803
|
+
_proto.destroy = function destroy() {
|
|
12804
|
+
this.document.defaultView.cancelAnimationFrame(this.frameId);
|
|
12786
12805
|
};
|
|
12787
12806
|
|
|
12788
|
-
_proto.
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12807
|
+
_proto.applyPendingEffects = function applyPendingEffects() {
|
|
12808
|
+
this.pendingEffects.forEach(function (effect) {
|
|
12809
|
+
effect === null || effect === void 0 ? void 0 : effect.applyInterpolations();
|
|
12810
|
+
});
|
|
12811
|
+
this.pendingEffects = [];
|
|
12792
12812
|
};
|
|
12793
12813
|
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
* HTML container
|
|
12800
|
-
* @see https://github.com/pmndrs/drei#html
|
|
12801
|
-
*/
|
|
12814
|
+
_proto.updateAnimationsPromises = function updateAnimationsPromises() {
|
|
12815
|
+
this.animationsWithPromises = this.animationsWithPromises.filter(function (animation) {
|
|
12816
|
+
return animation.updatePromises();
|
|
12817
|
+
});
|
|
12818
|
+
};
|
|
12802
12819
|
|
|
12803
|
-
|
|
12804
|
-
|
|
12820
|
+
_proto.discardAnimations = function discardAnimations() {
|
|
12821
|
+
this.updateAnimationsPromises();
|
|
12822
|
+
this.animations = this.animations.filter(function (animation) {
|
|
12823
|
+
return animation.playState !== 'finished' && animation.playState !== 'idle';
|
|
12824
|
+
});
|
|
12825
|
+
};
|
|
12805
12826
|
|
|
12806
|
-
function
|
|
12807
|
-
|
|
12827
|
+
_proto.restartWebAnimationsNextTick = function restartWebAnimationsNextTick() {
|
|
12828
|
+
if (!this.timelineTicking) {
|
|
12829
|
+
this.timelineTicking = true;
|
|
12830
|
+
this.requestAnimationFrame(this.webAnimationsNextTick);
|
|
12831
|
+
}
|
|
12832
|
+
};
|
|
12808
12833
|
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
12834
|
+
_proto.rAF = function rAF(f) {
|
|
12835
|
+
var id = this.rafId++;
|
|
12812
12836
|
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
x: '',
|
|
12817
|
-
y: '',
|
|
12818
|
-
width: 'auto',
|
|
12819
|
-
height: 'auto',
|
|
12820
|
-
innerHTML: ''
|
|
12821
|
-
}, style)
|
|
12822
|
-
}, rest)) || this;
|
|
12823
|
-
_this.cullable.enable = false;
|
|
12824
|
-
return _this;
|
|
12825
|
-
}
|
|
12826
|
-
/**
|
|
12827
|
-
* return wrapper HTMLElement
|
|
12828
|
-
* * <div> in g-webgl/canvas
|
|
12829
|
-
* * <foreignObject> in g-svg
|
|
12830
|
-
*/
|
|
12837
|
+
if (this.rafCallbacks.length === 0) {
|
|
12838
|
+
this.frameId = this.document.defaultView.requestAnimationFrame(this.processRafCallbacks);
|
|
12839
|
+
}
|
|
12831
12840
|
|
|
12841
|
+
this.rafCallbacks.push([id, f]);
|
|
12842
|
+
return id;
|
|
12843
|
+
};
|
|
12832
12844
|
|
|
12833
|
-
|
|
12845
|
+
_proto.requestAnimationFrame = function requestAnimationFrame(f) {
|
|
12846
|
+
var _this3 = this;
|
|
12834
12847
|
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
}
|
|
12838
|
-
/**
|
|
12839
|
-
* override with $el.getBoundingClientRect
|
|
12840
|
-
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
|
|
12841
|
-
*/
|
|
12842
|
-
;
|
|
12848
|
+
return this.rAF(function (x) {
|
|
12849
|
+
_this3.updateAnimationsPromises();
|
|
12843
12850
|
|
|
12844
|
-
|
|
12845
|
-
return this.parsedStyle.$el.getBoundingClientRect();
|
|
12846
|
-
};
|
|
12851
|
+
f(x);
|
|
12847
12852
|
|
|
12848
|
-
|
|
12849
|
-
|
|
12853
|
+
_this3.updateAnimationsPromises();
|
|
12854
|
+
});
|
|
12850
12855
|
};
|
|
12851
12856
|
|
|
12852
|
-
_proto.
|
|
12853
|
-
var
|
|
12857
|
+
_proto.tick = function tick(t, isAnimationFrame, updatingAnimations) {
|
|
12858
|
+
var _this4 = this,
|
|
12859
|
+
_this$pendingEffects,
|
|
12860
|
+
_this$pendingEffects2;
|
|
12854
12861
|
|
|
12855
|
-
|
|
12856
|
-
|
|
12862
|
+
this.inTick = true;
|
|
12863
|
+
this.hasRestartedThisFrame = false;
|
|
12864
|
+
this.currentTime = t;
|
|
12865
|
+
this.ticking = false;
|
|
12866
|
+
var newPendingClears = [];
|
|
12867
|
+
var newPendingEffects = [];
|
|
12868
|
+
var activeAnimations = [];
|
|
12869
|
+
var inactiveAnimations = [];
|
|
12870
|
+
updatingAnimations.forEach(function (animation) {
|
|
12871
|
+
animation.tick(t, isAnimationFrame);
|
|
12857
12872
|
|
|
12858
|
-
|
|
12873
|
+
if (!animation._inEffect) {
|
|
12874
|
+
newPendingClears.push(animation.effect);
|
|
12875
|
+
animation.unmarkTarget();
|
|
12876
|
+
} else {
|
|
12877
|
+
newPendingEffects.push(animation.effect);
|
|
12878
|
+
animation.markTarget();
|
|
12879
|
+
}
|
|
12859
12880
|
|
|
12860
|
-
|
|
12861
|
-
var
|
|
12862
|
-
|
|
12863
|
-
var aabb = new AABB();
|
|
12864
|
-
aabb.setMinMax(vec3.fromValues(minX, minY, 0), vec3.fromValues(minX + clientRect.width, minY + clientRect.height, 0));
|
|
12865
|
-
return aabb;
|
|
12866
|
-
}
|
|
12881
|
+
if (animation._needsTick) _this4.ticking = true;
|
|
12882
|
+
var alive = animation._inEffect || animation._needsTick;
|
|
12883
|
+
animation._inTimeline = alive;
|
|
12867
12884
|
|
|
12868
|
-
|
|
12869
|
-
|
|
12885
|
+
if (alive) {
|
|
12886
|
+
activeAnimations.push(animation);
|
|
12887
|
+
} else {
|
|
12888
|
+
inactiveAnimations.push(animation);
|
|
12889
|
+
}
|
|
12890
|
+
});
|
|
12870
12891
|
|
|
12871
|
-
|
|
12872
|
-
if (this.parentNode) {
|
|
12873
|
-
var parentInvert = mat4.invert(mat4.create(), this.parentNode.getWorldTransform());
|
|
12874
|
-
var bounds = this.getBounds();
|
|
12892
|
+
(_this$pendingEffects = this.pendingEffects).push.apply(_this$pendingEffects, newPendingClears);
|
|
12875
12893
|
|
|
12876
|
-
|
|
12877
|
-
var localBounds = new AABB();
|
|
12878
|
-
localBounds.setFromTransformedAABB(bounds, parentInvert);
|
|
12879
|
-
return localBounds;
|
|
12880
|
-
}
|
|
12881
|
-
}
|
|
12894
|
+
(_this$pendingEffects2 = this.pendingEffects).push.apply(_this$pendingEffects2, newPendingEffects);
|
|
12882
12895
|
|
|
12883
|
-
|
|
12896
|
+
if (this.ticking) this.requestAnimationFrame(function () {});
|
|
12897
|
+
this.inTick = false;
|
|
12898
|
+
return [activeAnimations, inactiveAnimations];
|
|
12884
12899
|
};
|
|
12885
12900
|
|
|
12886
|
-
return
|
|
12887
|
-
}(
|
|
12901
|
+
return AnimationTimeline;
|
|
12902
|
+
}();
|
|
12888
12903
|
|
|
12889
12904
|
/**
|
|
12890
12905
|
* the entry of DOM tree
|
|
@@ -12919,7 +12934,7 @@ var Document = /*#__PURE__*/function (_Node) {
|
|
|
12919
12934
|
defaultValue = _ref.defaultValue;
|
|
12920
12935
|
|
|
12921
12936
|
if (inherited && defaultValue) {
|
|
12922
|
-
initialStyle[name] = defaultValue;
|
|
12937
|
+
initialStyle[name] = isFunction(defaultValue) ? defaultValue(Shape.GROUP) : defaultValue;
|
|
12923
12938
|
}
|
|
12924
12939
|
}); // like <html> in DOM tree
|
|
12925
12940
|
|
|
@@ -12939,7 +12954,12 @@ var Document = /*#__PURE__*/function (_Node) {
|
|
|
12939
12954
|
* @example const circle = document.createElement('circle', { style: { r: 10 } });
|
|
12940
12955
|
*/
|
|
12941
12956
|
_proto.createElement = function createElement(tagName, options) {
|
|
12942
|
-
//
|
|
12957
|
+
// @observablehq/plot will create <svg>
|
|
12958
|
+
if (tagName === 'svg') {
|
|
12959
|
+
return this.documentElement;
|
|
12960
|
+
} // d3 will use <tspan>
|
|
12961
|
+
|
|
12962
|
+
|
|
12943
12963
|
var clazz = this.defaultView.customElements.get(tagName);
|
|
12944
12964
|
|
|
12945
12965
|
if (!clazz) {
|
|
@@ -14918,7 +14938,11 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
14918
14938
|
affectChildren = false;
|
|
14919
14939
|
}
|
|
14920
14940
|
|
|
14921
|
-
var p = element;
|
|
14941
|
+
var p = element; // only need to re-render itself
|
|
14942
|
+
|
|
14943
|
+
if (p.renderable) {
|
|
14944
|
+
p.renderable.dirty = true;
|
|
14945
|
+
}
|
|
14922
14946
|
|
|
14923
14947
|
while (p) {
|
|
14924
14948
|
var renderable = p.renderable;
|
|
@@ -14926,7 +14950,6 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
14926
14950
|
if (renderable) {
|
|
14927
14951
|
renderable.renderBoundsDirty = true;
|
|
14928
14952
|
renderable.boundsDirty = true;
|
|
14929
|
-
renderable.dirty = true;
|
|
14930
14953
|
}
|
|
14931
14954
|
|
|
14932
14955
|
p = p.parentNode;
|
|
@@ -16484,6 +16507,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
16484
16507
|
rendered: 0
|
|
16485
16508
|
};
|
|
16486
16509
|
this.zIndexCounter = 0;
|
|
16510
|
+
this.renderOrderChangedEvent = new CustomEvent(ElementEvent.RENDER_ORDER_CHANGED);
|
|
16487
16511
|
this.hooks = {
|
|
16488
16512
|
/**
|
|
16489
16513
|
* called before any frame rendered
|
|
@@ -16670,9 +16694,10 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
16670
16694
|
|
|
16671
16695
|
if (renderOrderChanged) {
|
|
16672
16696
|
displayObject.forEach(function (child) {
|
|
16673
|
-
|
|
16697
|
+
_this3.renderOrderChangedEvent.detail = {
|
|
16674
16698
|
renderOrder: child.sortable.renderOrder
|
|
16675
|
-
}
|
|
16699
|
+
};
|
|
16700
|
+
child.dispatchEvent(_this3.renderOrderChangedEvent);
|
|
16676
16701
|
});
|
|
16677
16702
|
}
|
|
16678
16703
|
};
|
|
@@ -18759,9 +18784,24 @@ CSSPropertyColor = __decorate([singleton({
|
|
|
18759
18784
|
}]
|
|
18760
18785
|
})], CSSPropertyColor);
|
|
18761
18786
|
|
|
18762
|
-
var CSSPropertyFilter = function
|
|
18763
|
-
|
|
18764
|
-
|
|
18787
|
+
var CSSPropertyFilter = /*#__PURE__*/function () {
|
|
18788
|
+
function CSSPropertyFilter() {
|
|
18789
|
+
this.parser = parseFilter;
|
|
18790
|
+
}
|
|
18791
|
+
|
|
18792
|
+
var _proto = CSSPropertyFilter.prototype;
|
|
18793
|
+
|
|
18794
|
+
_proto.calculator = function calculator(name, oldParsed, parsed) {
|
|
18795
|
+
// unset or none
|
|
18796
|
+
if (parsed instanceof CSSKeywordValue) {
|
|
18797
|
+
return [];
|
|
18798
|
+
}
|
|
18799
|
+
|
|
18800
|
+
return parsed;
|
|
18801
|
+
};
|
|
18802
|
+
|
|
18803
|
+
return CSSPropertyFilter;
|
|
18804
|
+
}();
|
|
18765
18805
|
|
|
18766
18806
|
CSSPropertyFilter = __decorate([singleton({
|
|
18767
18807
|
token: {
|
|
@@ -19335,32 +19375,32 @@ var CSSPropertyTransform = /*#__PURE__*/function () {
|
|
|
19335
19375
|
|
|
19336
19376
|
if (t === 'scale') {
|
|
19337
19377
|
// scale(1) scale(1, 1)
|
|
19338
|
-
var newScale = d.map(function (s) {
|
|
19378
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19339
19379
|
return s.value;
|
|
19340
|
-
}) || [1, 1];
|
|
19380
|
+
})) || [1, 1];
|
|
19341
19381
|
object.scaleLocal(newScale[0], newScale[1], 1);
|
|
19342
19382
|
} else if (t === 'scalex') {
|
|
19343
|
-
var _newScale = d.map(function (s) {
|
|
19383
|
+
var _newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19344
19384
|
return s.value;
|
|
19345
|
-
}) || [1];
|
|
19385
|
+
})) || [1];
|
|
19346
19386
|
|
|
19347
19387
|
object.scaleLocal(_newScale[0], 1, 1);
|
|
19348
19388
|
} else if (t === 'scaley') {
|
|
19349
|
-
var _newScale2 = d.map(function (s) {
|
|
19389
|
+
var _newScale2 = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19350
19390
|
return s.value;
|
|
19351
|
-
}) || [1];
|
|
19391
|
+
})) || [1];
|
|
19352
19392
|
|
|
19353
19393
|
object.scaleLocal(1, _newScale2[0], 1);
|
|
19354
19394
|
} else if (t === 'scalez') {
|
|
19355
|
-
var _newScale3 = d.map(function (s) {
|
|
19395
|
+
var _newScale3 = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19356
19396
|
return s.value;
|
|
19357
|
-
}) || [1];
|
|
19397
|
+
})) || [1];
|
|
19358
19398
|
|
|
19359
19399
|
object.scaleLocal(1, 1, _newScale3[0]);
|
|
19360
19400
|
} else if (t === 'scale3d') {
|
|
19361
|
-
var _newScale4 = d.map(function (s) {
|
|
19401
|
+
var _newScale4 = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19362
19402
|
return s.value;
|
|
19363
|
-
}) || [1, 1, 1];
|
|
19403
|
+
})) || [1, 1, 1];
|
|
19364
19404
|
|
|
19365
19405
|
object.scaleLocal(_newScale4[0], _newScale4[1], _newScale4[2]);
|
|
19366
19406
|
} else if (t === 'translate') {
|
|
@@ -19398,22 +19438,42 @@ var CSSPropertyTransform = /*#__PURE__*/function () {
|
|
|
19398
19438
|
|
|
19399
19439
|
object.rotateLocal(0, 0, _newAngles3[0].value);
|
|
19400
19440
|
} else if (t === 'rotate3d') ; else if (t === 'skew') {
|
|
19401
|
-
var newSkew = d.map(function (s) {
|
|
19441
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19402
19442
|
return s.value;
|
|
19403
|
-
}) || [0, 0];
|
|
19443
|
+
})) || [0, 0];
|
|
19404
19444
|
object.setLocalSkew(deg2rad(newSkew[0]), deg2rad(newSkew[1]));
|
|
19405
19445
|
} else if (t === 'skewx') {
|
|
19406
|
-
var _newSkew = d.map(function (s) {
|
|
19446
|
+
var _newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19407
19447
|
return s.value;
|
|
19408
|
-
}) || [0];
|
|
19448
|
+
})) || [0];
|
|
19409
19449
|
|
|
19410
19450
|
object.setLocalSkew(deg2rad(_newSkew[0]), object.getLocalSkew()[1]);
|
|
19411
19451
|
} else if (t === 'skewy') {
|
|
19412
|
-
var _newSkew2 = d.map(function (s) {
|
|
19452
|
+
var _newSkew2 = (d === null || d === void 0 ? void 0 : d.map(function (s) {
|
|
19413
19453
|
return s.value;
|
|
19414
|
-
}) || [0];
|
|
19454
|
+
})) || [0];
|
|
19415
19455
|
|
|
19416
19456
|
object.setLocalSkew(object.getLocalSkew()[0], deg2rad(_newSkew2[0]));
|
|
19457
|
+
} else if (t === 'matrix') {
|
|
19458
|
+
var _d$map = d.map(function (s) {
|
|
19459
|
+
return s.value;
|
|
19460
|
+
}),
|
|
19461
|
+
a = _d$map[0],
|
|
19462
|
+
b = _d$map[1],
|
|
19463
|
+
c = _d$map[2],
|
|
19464
|
+
dd = _d$map[3],
|
|
19465
|
+
tx = _d$map[4],
|
|
19466
|
+
ty = _d$map[5];
|
|
19467
|
+
|
|
19468
|
+
object.setLocalTransform(mat4.fromValues(a, b, 0, 0, c, dd, 0, 0, 0, 0, 1, 0, tx + defX, ty + defY, 0, 1));
|
|
19469
|
+
} else if (t === 'matrix3d') {
|
|
19470
|
+
// @ts-ignore
|
|
19471
|
+
var mat = mat4.fromValues.apply(mat4, d.map(function (s) {
|
|
19472
|
+
return s.value;
|
|
19473
|
+
}));
|
|
19474
|
+
mat[12] += defX;
|
|
19475
|
+
mat[13] += defY;
|
|
19476
|
+
object.setLocalTransform(mat);
|
|
19417
19477
|
}
|
|
19418
19478
|
});
|
|
19419
19479
|
}
|
|
@@ -19551,16 +19611,19 @@ var BUILT_IN_PROPERTIES = [{
|
|
|
19551
19611
|
name: 'shadowOffsetX',
|
|
19552
19612
|
interpolable: true,
|
|
19553
19613
|
layoutDependent: true,
|
|
19614
|
+
defaultValue: '0',
|
|
19554
19615
|
syntax: PropertySyntax.LENGTH_PERCENTAGE
|
|
19555
19616
|
}, {
|
|
19556
19617
|
name: 'shadowOffsetY',
|
|
19557
19618
|
interpolable: true,
|
|
19558
19619
|
layoutDependent: true,
|
|
19620
|
+
defaultValue: '0',
|
|
19559
19621
|
syntax: PropertySyntax.LENGTH_PERCENTAGE
|
|
19560
19622
|
}, {
|
|
19561
19623
|
name: 'shadowBlur',
|
|
19562
19624
|
interpolable: true,
|
|
19563
19625
|
layoutDependent: true,
|
|
19626
|
+
defaultValue: '0',
|
|
19564
19627
|
syntax: PropertySyntax.SHADOW_BLUR
|
|
19565
19628
|
}, {
|
|
19566
19629
|
/**
|
|
@@ -19654,6 +19717,8 @@ var BUILT_IN_PROPERTIES = [{
|
|
|
19654
19717
|
name: 'filter',
|
|
19655
19718
|
independent: true,
|
|
19656
19719
|
layoutDependent: true,
|
|
19720
|
+
keywords: ['none'],
|
|
19721
|
+
defaultValue: 'none',
|
|
19657
19722
|
syntax: PropertySyntax.FILTER
|
|
19658
19723
|
}, {
|
|
19659
19724
|
name: 'clipPath',
|
|
@@ -20267,7 +20332,8 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
20267
20332
|
|
|
20268
20333
|
var halfExtents = vec3.fromValues(Math.abs(width) / 2, Math.abs(height) / 2, depth / 2); // anchor is center by default, don't account for lineWidth here
|
|
20269
20334
|
|
|
20270
|
-
var
|
|
20335
|
+
var stroke = parsedStyle.stroke,
|
|
20336
|
+
lineWidth = parsedStyle.lineWidth,
|
|
20271
20337
|
increasedLineWidthForHitTesting = parsedStyle.increasedLineWidthForHitTesting,
|
|
20272
20338
|
shadowColor = parsedStyle.shadowColor,
|
|
20273
20339
|
_parsedStyle$filter = parsedStyle.filter,
|
|
@@ -20289,10 +20355,15 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
20289
20355
|
// if (lineJoin?.value === 'miter' && expansion < Math.SQRT2 * miterLimit) {
|
|
20290
20356
|
// expansion = Math.SQRT1_2 * miterLimit;
|
|
20291
20357
|
// }
|
|
20358
|
+
// append border only if stroke existed
|
|
20292
20359
|
|
|
20293
|
-
var
|
|
20360
|
+
var hasStroke = stroke && !stroke.isNone;
|
|
20361
|
+
|
|
20362
|
+
if (hasStroke) {
|
|
20363
|
+
var halfLineWidth = (((lineWidth === null || lineWidth === void 0 ? void 0 : lineWidth.value) || 0) + ((increasedLineWidthForHitTesting === null || increasedLineWidthForHitTesting === void 0 ? void 0 : increasedLineWidthForHitTesting.value) || 0)) * expansion;
|
|
20364
|
+
vec3.add(halfExtents, halfExtents, vec3.fromValues(halfLineWidth, halfLineWidth, 0));
|
|
20365
|
+
}
|
|
20294
20366
|
|
|
20295
|
-
vec3.add(halfExtents, halfExtents, vec3.fromValues(halfLineWidth, halfLineWidth, 0));
|
|
20296
20367
|
geometry.renderBounds.update(center, halfExtents); // account for shadow, only support constant value now
|
|
20297
20368
|
|
|
20298
20369
|
if (shadowColor) {
|
|
@@ -20547,6 +20618,9 @@ var containerModule = Module(function (register) {
|
|
|
20547
20618
|
});
|
|
20548
20619
|
});
|
|
20549
20620
|
|
|
20621
|
+
var AbstractRendererPlugin = function AbstractRendererPlugin() {
|
|
20622
|
+
this.container = void 0;
|
|
20623
|
+
};
|
|
20550
20624
|
var AbstractRenderer = /*#__PURE__*/function () {
|
|
20551
20625
|
function AbstractRenderer(config) {
|
|
20552
20626
|
this.plugins = [];
|
|
@@ -20566,7 +20640,8 @@ var AbstractRenderer = /*#__PURE__*/function () {
|
|
|
20566
20640
|
/**
|
|
20567
20641
|
* enable dirty rectangle rendering by default
|
|
20568
20642
|
*/
|
|
20569
|
-
enableDirtyRectangleRendering: true
|
|
20643
|
+
enableDirtyRectangleRendering: true,
|
|
20644
|
+
enableDirtyRectangleRenderingDebug: false
|
|
20570
20645
|
}, config);
|
|
20571
20646
|
}
|
|
20572
20647
|
|
|
@@ -21327,6 +21402,7 @@ var CanvasEvent;
|
|
|
21327
21402
|
CanvasEvent["BEFORE_DESTROY"] = "beforedestroy";
|
|
21328
21403
|
CanvasEvent["AFTER_DESTROY"] = "afterdestroy";
|
|
21329
21404
|
CanvasEvent["RESIZE"] = "resize";
|
|
21405
|
+
CanvasEvent["DIRTY_RECTANGLE"] = "dirtyrectangle";
|
|
21330
21406
|
})(CanvasEvent || (CanvasEvent = {}));
|
|
21331
21407
|
/**
|
|
21332
21408
|
* can be treated like Window in DOM
|
|
@@ -21811,14 +21887,13 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21811
21887
|
// load other container modules provided by g-canvas/g-svg/g-webgl
|
|
21812
21888
|
var plugins = renderer.getPlugins();
|
|
21813
21889
|
plugins.forEach(function (plugin) {
|
|
21814
|
-
plugin.
|
|
21890
|
+
plugin.container = _this4.container;
|
|
21891
|
+
plugin.init();
|
|
21815
21892
|
});
|
|
21816
21893
|
};
|
|
21817
21894
|
|
|
21818
21895
|
_proto.setRenderer = /*#__PURE__*/function () {
|
|
21819
21896
|
var _setRenderer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(renderer) {
|
|
21820
|
-
var _this5 = this;
|
|
21821
|
-
|
|
21822
21897
|
var canvasConfig, oldRenderer;
|
|
21823
21898
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
21824
21899
|
while (1) {
|
|
@@ -21841,7 +21916,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21841
21916
|
this.destroy(false, true); // destroy all plugins, reverse will mutate origin array
|
|
21842
21917
|
|
|
21843
21918
|
[].concat(oldRenderer === null || oldRenderer === void 0 ? void 0 : oldRenderer.getPlugins()).reverse().forEach(function (plugin) {
|
|
21844
|
-
plugin.destroy(
|
|
21919
|
+
plugin.destroy();
|
|
21845
21920
|
});
|
|
21846
21921
|
_context3.next = 9;
|
|
21847
21922
|
return this.initRenderer(renderer);
|
|
@@ -21866,7 +21941,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21866
21941
|
};
|
|
21867
21942
|
|
|
21868
21943
|
_proto.unmountChildren = function unmountChildren(parent) {
|
|
21869
|
-
var
|
|
21944
|
+
var _this5 = this;
|
|
21870
21945
|
|
|
21871
21946
|
if (this.inited) {
|
|
21872
21947
|
var path = [];
|
|
@@ -21886,7 +21961,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21886
21961
|
|
|
21887
21962
|
child.dispatchEvent(new CustomEvent(ElementEvent.UNMOUNTED)); // skip document.documentElement
|
|
21888
21963
|
|
|
21889
|
-
if (child !==
|
|
21964
|
+
if (child !== _this5.document.documentElement) {
|
|
21890
21965
|
child.ownerDocument = null;
|
|
21891
21966
|
}
|
|
21892
21967
|
|
|
@@ -21896,12 +21971,12 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21896
21971
|
};
|
|
21897
21972
|
|
|
21898
21973
|
_proto.mountChildren = function mountChildren(parent) {
|
|
21899
|
-
var
|
|
21974
|
+
var _this6 = this;
|
|
21900
21975
|
|
|
21901
21976
|
if (this.inited) {
|
|
21902
21977
|
parent.forEach(function (child) {
|
|
21903
21978
|
if (!child.isConnected) {
|
|
21904
|
-
child.ownerDocument =
|
|
21979
|
+
child.ownerDocument = _this6.document;
|
|
21905
21980
|
child.isConnected = true;
|
|
21906
21981
|
child.dispatchEvent(new CustomEvent(ElementEvent.MOUNTED)); // trigger after mounted
|
|
21907
21982
|
|
|
@@ -21913,7 +21988,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21913
21988
|
}
|
|
21914
21989
|
});
|
|
21915
21990
|
} else {
|
|
21916
|
-
console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.", 'appended child: ', parent);
|
|
21991
|
+
console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.", 'appended child: ', parent.nodeName);
|
|
21917
21992
|
}
|
|
21918
21993
|
};
|
|
21919
21994
|
|
|
@@ -21960,12 +22035,12 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21960
22035
|
_createClass(Canvas, [{
|
|
21961
22036
|
key: "ready",
|
|
21962
22037
|
get: function get() {
|
|
21963
|
-
var
|
|
22038
|
+
var _this7 = this;
|
|
21964
22039
|
|
|
21965
22040
|
if (!this.readyPromise) {
|
|
21966
22041
|
this.readyPromise = new Promise(function (resolve) {
|
|
21967
|
-
|
|
21968
|
-
resolve(
|
|
22042
|
+
_this7.resolveReadyPromise = function () {
|
|
22043
|
+
resolve(_this7);
|
|
21969
22044
|
};
|
|
21970
22045
|
});
|
|
21971
22046
|
|
|
@@ -21985,4 +22060,4 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21985
22060
|
GlobalContainer.load(containerModule);
|
|
21986
22061
|
var layoutEngine = GlobalContainer.get(LayoutEngine);
|
|
21987
22062
|
|
|
21988
|
-
export { AABB, AbstractLayoutDefinition, AbstractRenderer, Animation, AnimationEffectTiming, AnimationEvent, AnimationTimeline, AsyncParallelHook, AsyncSeriesWaterfallHook, BUILT_IN_PROPERTIES, BaseType, BoundingSphere, CSS, CSSColorValue, CSSGradientValue, CSSKeywordValue, CSSMathInvert, CSSMathMax, CSSMathMin, CSSMathNegate, CSSMathOperator, CSSMathProduct, CSSMathSum, CSSMathValue, CSSMathVariadic, CSSNumericValue, CSSNumericValueType, CSSProperty, CSSPropertyAngle, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLengthOrPercentage, CSSPropertyLengthOrPercentage12, CSSPropertyLengthOrPercentage14, CSSPropertyLocalPosition, CSSPropertyNumber, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyShadowBlur, CSSPropertySyntaxFactory, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSRGB, CSSStyleValue, CSSStyleValueType, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasConfig, CanvasEvent, Circle, CircleUpdater, ContextNode, ContextService, Cullable, CustomElement, CustomElementRegistry, CustomEvent, DCHECK, DCHECK_EQ, DCHECK_NE, DELEGATION_SPLITTER, DefaultCamera, DefaultSceneGraphSelector, DefaultSceneGraphService, DefaultStyleValueRegistry, Deferred, DisplayObject, DisplayObjectPool, Document, EasingFunctions, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FragmentResult, FragmentResultFactory, FragmentResultOptions, Frustum, Geometry, GeometryAABBUpdater, GeometryUpdaterFactory, GradientType, Group, HTML, Image, KeyframeEffect, LayoutChildren, LayoutChildrenFactory, LayoutChildrenOptions, LayoutContext, LayoutContextFactory, LayoutContextOptions, LayoutEdges, LayoutEdgesFactory, LayoutEdgesOptions, LayoutEngine, LayoutFragment, LayoutFragmentFactory, LayoutFragmentOptions, LayoutObject, LayoutRegistry, LayoutTaskType, Line, LineUpdater, MOUSE_POINTER_ID, Mask, MutationEvent, MutationObserver, MutationRecord, Nested, Node, ObjectTyped, Odeg, OffscreenCanvasCreator, Opx, ParenLess, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertyName, PropertySyntax, RBushNode, RBushRoot, Ray, Rect, RectUpdater, Rectangle, Registration, RenderReason, Renderable, RenderingContext, RenderingPluginContribution, RenderingService, SceneGraphSelector, SceneGraphSelectorFactory, SceneGraphService, Shape, Sortable, Strategy, StyleValueRegistry, SyncHook, SyncWaterfallHook, TOUCH_TO_POINTER, Text, TextService, TextUpdater, Transform, UnitCategory, UnitType, ValueRange, baseTypeToString, camelCase, clamp, clampedMergeNumbers, cleanExistedCanvas, colorStopToString, compareAnimations, computeLinearGradient, computeRadialGradient, convertAngleUnit, convertEffectInput, convertItemToMatrix, convertPercentUnit, convertToDash, convertToPath, createVec3, decompose, deg2rad, deg2turn, equalSet, extractPolygons, formatAttribute, fromRotationTranslationScale, getAngle, getEasingFunction, getEuler, getHeight, getRotationInRadians, getScaling, getStyle, getTranslation, getWidth, grad2deg, hasArcOrBezier, isBoolean, isBrowser, isComparison, isFunction, isNil, isNumber, isObject, isPattern, isString, isUndefined, layoutEngine, makePerspective, makeQuerablePromise, makeTiming, memoize, mergeColors, mergeDimensionList, mergeDimensions, mergeNumberLists, mergeNumbers, mergePaths, mergeTransforms, normalizeKeyframes, normalizeTimingInput, numberToString, numericTimingToObject, parseAngle, parseColor, parseDimension, parseDimensionArray, parseFilter, parseGradient, parseLength, parseLengthOrPercentage, parseNumber, parseNumberList, parseParam, parsePath, parsePoints, parseTransform, parseTransformOrigin, parserPercentage, path2Segments, rad2deg, setDOMSize, sortByZIndex, toFontString, translatePathToString, turn2deg, typeCheck, unitTypeToBaseType };
|
|
22063
|
+
export { AABB, AbstractLayoutDefinition, AbstractRenderer, AbstractRendererPlugin, Animation, AnimationEffectTiming, AnimationEvent, AnimationTimeline, AsyncParallelHook, AsyncSeriesWaterfallHook, BUILT_IN_PROPERTIES, BaseType, BoundingSphere, CSS, CSSColorValue, CSSGradientValue, CSSKeywordValue, CSSMathInvert, CSSMathMax, CSSMathMin, CSSMathNegate, CSSMathOperator, CSSMathProduct, CSSMathSum, CSSMathValue, CSSMathVariadic, CSSNumericValue, CSSNumericValueType, CSSProperty, CSSPropertyAngle, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLengthOrPercentage, CSSPropertyLengthOrPercentage12, CSSPropertyLengthOrPercentage14, CSSPropertyLocalPosition, CSSPropertyNumber, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyShadowBlur, CSSPropertySyntaxFactory, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSRGB, CSSStyleValue, CSSStyleValueType, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasConfig, CanvasEvent, Circle, CircleUpdater, ContextNode, ContextService, Cullable, CustomElement, CustomElementRegistry, CustomEvent, DCHECK, DCHECK_EQ, DCHECK_NE, DELEGATION_SPLITTER, DefaultCamera, DefaultSceneGraphSelector, DefaultSceneGraphService, DefaultStyleValueRegistry, Deferred, DisplayObject, DisplayObjectPool, Document, EasingFunctions, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FragmentResult, FragmentResultFactory, FragmentResultOptions, Frustum, Geometry, GeometryAABBUpdater, GeometryUpdaterFactory, GradientType, Group, HTML, Image, KeyframeEffect, LayoutChildren, LayoutChildrenFactory, LayoutChildrenOptions, LayoutContext, LayoutContextFactory, LayoutContextOptions, LayoutEdges, LayoutEdgesFactory, LayoutEdgesOptions, LayoutEngine, LayoutFragment, LayoutFragmentFactory, LayoutFragmentOptions, LayoutObject, LayoutRegistry, LayoutTaskType, Line, LineUpdater, MOUSE_POINTER_ID, Mask, MutationEvent, MutationObserver, MutationRecord, Nested, Node, ObjectTyped, Odeg, OffscreenCanvasCreator, Opx, ParenLess, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertyName, PropertySyntax, RBushNode, RBushRoot, Ray, Rect, RectUpdater, Rectangle, Registration, RenderReason, Renderable, RenderingContext, RenderingPluginContribution, RenderingService, SceneGraphSelector, SceneGraphSelectorFactory, SceneGraphService, Shape, Sortable, Strategy, StyleValueRegistry, SyncHook, SyncWaterfallHook, TOUCH_TO_POINTER, Text, TextService, TextUpdater, Transform, UnitCategory, UnitType, ValueRange, baseTypeToString, camelCase, clamp, clampedMergeNumbers, cleanExistedCanvas, colorStopToString, compareAnimations, composeMatrix, computeLinearGradient, computeRadialGradient, convertAngleUnit, convertEffectInput, convertItemToMatrix, convertPercentUnit, convertToDash, convertToPath, createVec3, decompose, deg2rad, deg2turn, equalSet, extractPolygons, formatAttribute, fromRotationTranslationScale, getAngle, getEasingFunction, getEuler, getHeight, getRotationInRadians, getScaling, getStyle, getTranslation, getWidth, grad2deg, hasArcOrBezier, isBoolean, isBrowser, isComparison, isFunction, isNil, isNumber, isObject, isPattern, isString, isUndefined, layoutEngine, makePerspective, makeQuerablePromise, makeTiming, memoize, mergeColors, mergeDimensionList, mergeDimensions, mergeNumberLists, mergeNumbers, mergePaths, mergeTransforms, normalizeKeyframes, normalizeTimingInput, numberToString, numericTimingToObject, parseAngle, parseColor, parseDimension, parseDimensionArray, parseFilter, parseGradient, parseLength, parseLengthOrPercentage, parseNumber, parseNumberList, parseParam, parsePath, parsePoints, parseTransform, parseTransformOrigin, parserPercentage, path2Segments, rad2deg, setDOMSize, sortByZIndex, toFontString, translatePathToString, turn2deg, typeCheck, unitTypeToBaseType };
|