@visactor/vstory 0.0.25-none → 0.0.26-alpha.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/index.js CHANGED
@@ -59728,24 +59728,62 @@
59728
59728
  }]);
59729
59729
  }(ACustomAnimate);
59730
59730
 
59731
+ function isVerticalBarRect(from, to) {
59732
+ return null != (null == to ? void 0 : to.y1) || null != (null == from ? void 0 : from.y1);
59733
+ }
59734
+ function normalizeBarRect(rect, fallback) {
59735
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
59736
+ var source = null != rect ? rect : {},
59737
+ ref = null != fallback ? fallback : {},
59738
+ x = null !== (_c = null !== (_b = null !== (_a = source.x) && void 0 !== _a ? _a : ref.x) && void 0 !== _b ? _b : ref.x1) && void 0 !== _c ? _c : 0,
59739
+ y = null !== (_f = null !== (_e = null !== (_d = source.y) && void 0 !== _d ? _d : ref.y) && void 0 !== _e ? _e : ref.y1) && void 0 !== _f ? _f : 0,
59740
+ x1 = null !== (_h = null !== (_g = source.x1) && void 0 !== _g ? _g : ref.x1) && void 0 !== _h ? _h : null != source.width ? x + source.width : null != ref.width ? x + ref.width : x,
59741
+ y1 = null !== (_k = null !== (_j = source.y1) && void 0 !== _j ? _j : ref.y1) && void 0 !== _k ? _k : null != source.height ? y + source.height : null != ref.height ? y + ref.height : y,
59742
+ width = null !== (_m = null !== (_l = source.width) && void 0 !== _l ? _l : ref.width) && void 0 !== _m ? _m : Math.abs(x1 - x),
59743
+ height = null !== (_p = null !== (_o = source.height) && void 0 !== _o ? _o : ref.height) && void 0 !== _p ? _p : Math.abs(y1 - y);
59744
+ return Object.assign(Object.assign(Object.assign({}, ref), source), {
59745
+ x: x,
59746
+ y: y,
59747
+ x1: x1,
59748
+ y1: y1,
59749
+ width: width,
59750
+ height: height,
59751
+ cornerRadius: null !== (_q = source.cornerRadius) && void 0 !== _q ? _q : ref.cornerRadius
59752
+ });
59753
+ }
59754
+ function createCollapsedBarRect(rect, vertical) {
59755
+ var _a, _b, _c, _d, _e, _f, _g, _h;
59756
+ return vertical ? {
59757
+ x: rect.x,
59758
+ x1: rect.x1,
59759
+ width: rect.width,
59760
+ height: 0,
59761
+ cornerRadius: rect.cornerRadius,
59762
+ y: null !== (_b = null !== (_a = rect.y1) && void 0 !== _a ? _a : rect.y) && void 0 !== _b ? _b : 0,
59763
+ y1: null !== (_d = null !== (_c = rect.y1) && void 0 !== _c ? _c : rect.y) && void 0 !== _d ? _d : 0
59764
+ } : {
59765
+ y: rect.y,
59766
+ y1: rect.y1,
59767
+ height: rect.height,
59768
+ width: 0,
59769
+ cornerRadius: rect.cornerRadius,
59770
+ x: null !== (_f = null !== (_e = rect.x1) && void 0 !== _e ? _e : rect.x) && void 0 !== _f ? _f : 0,
59771
+ x1: null !== (_h = null !== (_g = rect.x1) && void 0 !== _g ? _g : rect.x) && void 0 !== _h ? _h : 0
59772
+ };
59773
+ }
59774
+
59731
59775
  var barBounce1Str = "M0,0 C0.126,0.382 0.06,0.254 0.105,0.467 0.159,0.729 0.3,1.173 0.38,1.173 0.476,1.173 0.512,0.909 0.578,0.9 0.632,0.892 0.685,1.084 0.735,1.085 0.784,1.085 0.843,0.966 0.887,0.966 0.94,0.966 0.984,1 1,1";
59732
59776
  var barBounce2Str = "M0,0 C0.126,0.382 0.185,0.598 0.262,0.801 0.307,0.919 0.396,1.089 0.476,1.089 0.572,1.089 0.622,0.936 0.688,0.927 0.742,0.919 0.778,1.036 0.828,1.038 0.877,1.038 0.882,0.972 0.926,0.972 0.979,0.972 0.984,1 1,1";
59733
59777
  var barBounce1 = generatorPathEasingFunc(barBounce1Str),
59734
59778
  barBounce2 = generatorPathEasingFunc(barBounce2Str);
59735
59779
  var BarBounce = /*#__PURE__*/function (_ACustomAnimate) {
59736
59780
  function BarBounce(from, to, duration, easing, params) {
59781
+ var _this;
59737
59782
  _classCallCheck(this, BarBounce);
59738
- return _callSuper(this, BarBounce, [{
59739
- y: from.y1,
59740
- y1: from.y1,
59741
- x: from.x1,
59742
- x1: from.x1
59743
- }, {
59744
- y: from.y,
59745
- y1: from.y1,
59746
- x: from.x,
59747
- x1: from.x1
59748
- }, duration, easing, params]);
59783
+ var vertical = isVerticalBarRect(from, to),
59784
+ target = normalizeBarRect(to, from);
59785
+ _this = _callSuper(this, BarBounce, [createCollapsedBarRect(target, vertical), target, duration, easing, params]), _this.vertical = vertical;
59786
+ return _this;
59749
59787
  }
59750
59788
  _inherits(BarBounce, _ACustomAnimate);
59751
59789
  return _createClass(BarBounce, [{
@@ -59771,15 +59809,16 @@
59771
59809
  to = this.to,
59772
59810
  r1 = barBounce1(ratio),
59773
59811
  r2 = barBounce2(ratio);
59774
- if (from.y1) {
59812
+ if (this.vertical) {
59775
59813
  out.y = from.y + (to.y - from.y) * r1;
59776
59814
  var dh = (to.y1 - to.y) * r2;
59777
- out.y1 = Math.min(out.y + dh, this.to.y1);
59815
+ out.y1 = Math.min(out.y + dh, this.to.y1), out.height = Math.max(out.y1 - out.y, 0);
59778
59816
  } else {
59779
59817
  out.x = from.x + (to.x - from.x) * r1;
59780
59818
  var dw = (to.x - to.x1) * r2;
59781
- out.x1 = Math.max(out.x - dw, this.to.x1);
59819
+ out.x1 = Math.max(out.x - dw, this.to.x1), out.width = Math.max(out.x - out.x1, 0);
59782
59820
  }
59821
+ this.target && (Object.assign(this.target.attribute, out), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
59783
59822
  }
59784
59823
  }]);
59785
59824
  }(ACustomAnimate);
@@ -59793,20 +59832,22 @@
59793
59832
  function BarLeap(from, to, duration, easing, params) {
59794
59833
  var _this;
59795
59834
  _classCallCheck(this, BarLeap);
59796
- _this = _callSuper(this, BarLeap, [Object.assign(Object.assign({}, from), {
59835
+ var target = normalizeBarRect(to, from),
59836
+ start = normalizeBarRect(from, target);
59837
+ _this = _callSuper(this, BarLeap, [Object.assign(Object.assign({}, start), {
59797
59838
  cornerRadius: 0
59798
- }), to, duration, easing, params]), _this.vertical = null != to.y1;
59799
- var centerX = null != to.x1 ? (to.x + to.x1) / 2 : to.x + to.width / 2,
59800
- centerY = null != to.y1 ? (to.y + to.y1) / 2 : to.y + to.height / 2;
59839
+ }), target, duration, easing, params]), _this.vertical = isVerticalBarRect(from, to);
59840
+ var centerX = (target.x + target.x1) / 2,
59841
+ centerY = (target.y + target.y1) / 2;
59801
59842
  _this.toCenter = {
59802
- x: centerX - to.x,
59803
- y: centerY - to.y
59843
+ x: centerX - target.x,
59844
+ y: centerY - target.y
59804
59845
  }, _this.vertical ? _this.fromCenter = {
59805
- x: centerX + 200 - to.x,
59806
- y: centerY - 600 - to.y
59846
+ x: centerX + 200 - target.x,
59847
+ y: centerY - 600 - target.y
59807
59848
  } : _this.fromCenter = {
59808
- x: centerX + 600 - to.x,
59809
- y: centerY - 200 - to.y
59849
+ x: centerX + 600 - target.x,
59850
+ y: centerY - 200 - target.y
59810
59851
  };
59811
59852
  return _this;
59812
59853
  }
@@ -59949,15 +59990,30 @@
59949
59990
  var pieLeap2Str = "M0,0 C0.331,0 0.047,-0.001 0.4,0 0.554,0 0.623,0.988 0.704,1.05 0.777,1.106 0.826,0.966 0.885,0.966 0.968,0.966 0.986,1 1,1";
59950
59991
  var pieLeap1 = generatorPathEasingFunc(pieLeap1Str),
59951
59992
  pieLeap2 = generatorPathEasingFunc(pieLeap2Str);
59993
+ function normalizePieLeapProps(arc, fallback) {
59994
+ var _a, _b, _c, _d, _e, _f, _g, _h;
59995
+ var source = null != arc ? arc : {},
59996
+ ref = null != fallback ? fallback : {},
59997
+ innerRadius = null !== (_b = null !== (_a = source.innerRadius) && void 0 !== _a ? _a : ref.innerRadius) && void 0 !== _b ? _b : 0,
59998
+ outerRadius = null !== (_d = null !== (_c = source.outerRadius) && void 0 !== _c ? _c : ref.outerRadius) && void 0 !== _d ? _d : innerRadius;
59999
+ return Object.assign(Object.assign(Object.assign({}, ref), source), {
60000
+ x: null !== (_f = null !== (_e = source.x) && void 0 !== _e ? _e : ref.x) && void 0 !== _f ? _f : 0,
60001
+ y: null !== (_h = null !== (_g = source.y) && void 0 !== _g ? _g : ref.y) && void 0 !== _h ? _h : 0,
60002
+ innerRadius: innerRadius,
60003
+ outerRadius: outerRadius
60004
+ });
60005
+ }
59952
60006
  var PieLeap = /*#__PURE__*/function (_ACustomAnimate) {
59953
60007
  function PieLeap(from, to, duration, easing, params) {
59954
60008
  _classCallCheck(this, PieLeap);
60009
+ var target = normalizePieLeapProps(to, from),
60010
+ start = normalizePieLeapProps(from, target);
59955
60011
  return _callSuper(this, PieLeap, [{
59956
- y: from.y - 500,
59957
- x: from.x + 500,
59958
- innerRadius: from.innerRadius,
59959
- outerRadius: (from.innerRadius + from.outerRadius) / 2
59960
- }, to, duration, easing, params]);
60012
+ y: start.y - 500,
60013
+ x: start.x + 500,
60014
+ innerRadius: start.innerRadius,
60015
+ outerRadius: (start.innerRadius + start.outerRadius) / 2
60016
+ }, target, duration, easing, params]);
59961
60017
  }
59962
60018
  _inherits(PieLeap, _ACustomAnimate);
59963
60019
  return _createClass(PieLeap, [{
@@ -60628,7 +60684,7 @@
60628
60684
  _option$pluginList = option.pluginList,
60629
60685
  pluginList = _option$pluginList === void 0 ? null !== (_b = option.pluginList) && void 0 !== _b ? _b : [] : _option$pluginList;
60630
60686
  if (!dom && !canvas) throw new Error("dom or canvas is required");
60631
- if (_this._option = option, _this._option.mode = null !== (_c = option.mode) && void 0 !== _c ? _c : "desktop-browser", _this._canvas = new StoryCanvas(_this, {
60687
+ _this._option = option, _this._option.mode = null !== (_c = option.mode) && void 0 !== _c ? _c : "desktop-browser", _this._canvas = new StoryCanvas(_this, {
60632
60688
  container: isString$2(dom) ? vglobal.getElementById(dom) : dom,
60633
60689
  canvas: isString$2(canvas) ? vglobal.getElementById(canvas) : canvas,
60634
60690
  width: width,
@@ -60641,16 +60697,15 @@
60641
60697
  scaleY: scaleY,
60642
60698
  pluginList: pluginList,
60643
60699
  layerClip: layerClip
60644
- }), _this._characterTree = new CharacterTree(_this), _this._dsl = dsl, _this._theme = theme, _this.pluginService = new DefaultPluginService(), pluginList.length > 0) {
60645
- var activatedPlugins = pluginList.reduce(function (list, name) {
60646
- return _this.pluginService.findPluginsByName(name).forEach(function (plugin) {
60647
- return list.push(plugin);
60648
- }), list;
60649
- }, []);
60650
- _this.pluginService.active(_this, {
60651
- pluginList: activatedPlugins
60652
- });
60653
- }
60700
+ }), _this._characterTree = new CharacterTree(_this), _this._dsl = dsl, _this._theme = theme, _this.pluginService = new DefaultPluginService();
60701
+ var activatedPlugins = pluginList.reduce(function (list, name) {
60702
+ return _this.pluginService.findPluginsByName(name).forEach(function (plugin) {
60703
+ return list.push(plugin);
60704
+ }), list;
60705
+ }, []);
60706
+ _this.pluginService.active(_this, {
60707
+ pluginList: activatedPlugins
60708
+ });
60654
60709
  return _this;
60655
60710
  }
60656
60711
  _inherits(Story, _EventEmitter);
@@ -60747,7 +60802,7 @@
60747
60802
  }, {
60748
60803
  key: "release",
60749
60804
  value: function release() {
60750
- this._player.release(), this._canvas.release();
60805
+ this.pluginService.release(), this._player.release(), this._canvas.release();
60751
60806
  }
60752
60807
  }]);
60753
60808
  }(EventEmitter);
@@ -61073,34 +61128,59 @@
61073
61128
  }();
61074
61129
  var globalTickerStore = new GlobalTickerStore();
61075
61130
 
61076
- var Player$1 = /*#__PURE__*/function () {
61131
+ var Player$1 = /*#__PURE__*/function (_EventEmitter) {
61077
61132
  function Player(story) {
61078
- var _this = this;
61133
+ var _this;
61079
61134
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
61080
61135
  _classCallCheck(this, Player);
61081
- this._lastFrameTime = -1, this.handlerTick = function (delta) {
61136
+ _this = _callSuper(this, Player), _this._lastFrameTime = -1, _this.handlerTick = function (delta) {
61137
+ if ("playing" !== _this._state) return;
61082
61138
  var time = Date.now();
61083
61139
  void 0 === delta && (delta = _this._lastFrameTime >= 0 ? time - _this._lastFrameTime : 0), _this._lastFrameTime = time;
61084
- var totalTime = _this._scheduler.getTotalTime();
61085
- var currTime = _this._currTime;
61086
- if (_this._loop > 0) if (totalTime <= 0) currTime = 0;else if (currTime + delta > totalTime) for (currTime += delta; currTime > totalTime;) currTime -= totalTime;
61087
- (_this._loop || currTime !== totalTime) && _this.tickTo(_this._loop >= 0 ? Math.min(currTime + delta, totalTime) : currTime + delta);
61140
+ var totalTime = _this.totalTime,
61141
+ currTime = _this._currTime;
61142
+ var nextTime = currTime + delta;
61143
+ _this._loop > 0 && (totalTime <= 0 ? nextTime = 0 : nextTime > totalTime && (nextTime %= totalTime)), _this._loop || currTime !== totalTime ? (_this.tickTo(_this._loop >= 0 ? Math.min(nextTime, totalTime) : nextTime), !_this._loop && _this._currTime >= totalTime && _this._finishPlayback()) : _this._finishPlayback();
61088
61144
  };
61089
61145
  var _params$actionProcess = params.actionProcessor,
61090
61146
  actionProcessor = _params$actionProcess === void 0 ? new ActionProcessor(story) : _params$actionProcess;
61091
- this._story = story, this._ticker = globalTickerStore.getGlobalTicker(), this._actionProcessor = actionProcessor, this._scheduler = new Scheduler(actionProcessor), this._currTime = 0, this.initTicker();
61147
+ _this._story = story, _this._ticker = globalTickerStore.getGlobalTicker(), _this._actionProcessor = actionProcessor, _this._scheduler = new Scheduler(actionProcessor), _this._currTime = 0, _this._loop = 0, _this._state = "idle", _this._tickerListening = !1, _this._preserveStateOnReset = !1, _this.initTicker();
61148
+ return _this;
61092
61149
  }
61150
+ _inherits(Player, _EventEmitter);
61093
61151
  return _createClass(Player, [{
61152
+ key: "state",
61153
+ get: function get() {
61154
+ return this._state;
61155
+ }
61156
+ }, {
61157
+ key: "currentTime",
61158
+ get: function get() {
61159
+ return this._currTime;
61160
+ }
61161
+ }, {
61162
+ key: "totalTime",
61163
+ get: function get() {
61164
+ return this._scheduler.getTotalTime();
61165
+ }
61166
+ }, {
61094
61167
  key: "initTicker",
61095
61168
  value: function initTicker() {
61096
- this._ticker.addListener("tick", this.handlerTick);
61169
+ this._attachTickerListener();
61097
61170
  }
61098
61171
  }, {
61099
61172
  key: "tickTo",
61100
61173
  value: function tickTo(t) {
61101
61174
  var _this2 = this;
61102
61175
  var lastTime = this._currTime;
61103
- lastTime > t && this._story.reset();
61176
+ if (lastTime > t) {
61177
+ this._preserveStateOnReset = !0;
61178
+ try {
61179
+ this._story.reset();
61180
+ } finally {
61181
+ this._preserveStateOnReset = !1;
61182
+ }
61183
+ }
61104
61184
  this._scheduler.getUnAppliedAppearAction().forEach(function (action) {
61105
61185
  var character = _this2._story.getCharacterById(action.characterId);
61106
61186
  _this2._actionProcessor.applyAppearAttrs(character.config.type, action.actionSpec.action, character, action.actionSpec);
@@ -61127,16 +61207,30 @@
61127
61207
  }, {
61128
61208
  key: "reset",
61129
61209
  value: function reset() {
61130
- this._scheduler.clearState(), this._ticker.getTimelines().forEach(function (tl) {
61210
+ var _a;
61211
+ this._scheduler.clearState(), null === (_a = this._ticker) || void 0 === _a || _a.getTimelines().forEach(function (tl) {
61131
61212
  return tl.clear();
61132
- }), this._currTime = 0;
61213
+ }), this._currTime = 0, this._preserveStateOnReset || (this._loop = 0, this._lastFrameTime = -1, this._detachTickerListener(), this._setState("idle"));
61133
61214
  }
61134
61215
  }, {
61135
61216
  key: "play",
61136
61217
  value: function play() {
61137
61218
  var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
61138
- var totalTime = this._scheduler.getTotalTime();
61139
- this._loop = loop, totalTime <= 0 && !this._loop ? (this._currTime = 0, this.tickTo(0)) : (this._currTime = 0, this._ticker.start(!0));
61219
+ var _a;
61220
+ "idle" === this._state && 0 === this._currTime || this._resetStoryForRestart();
61221
+ var totalTime = this.totalTime;
61222
+ this._loop = loop, this._currTime = 0, this._lastFrameTime = -1, this._attachTickerListener(), this._setState("playing"), totalTime <= 0 && !this._loop ? (this.tickTo(0), this._finishPlayback()) : null === (_a = this._ticker) || void 0 === _a || _a.start(!0);
61223
+ }
61224
+ }, {
61225
+ key: "pause",
61226
+ value: function pause() {
61227
+ "playing" === this._state && (this._lastFrameTime = -1, this._detachTickerListener(), this._setState("paused"));
61228
+ }
61229
+ }, {
61230
+ key: "resume",
61231
+ value: function resume() {
61232
+ var _a;
61233
+ "paused" === this._state && (this._lastFrameTime = -1, this._attachTickerListener(), null === (_a = this._ticker) || void 0 === _a || _a.start(!0), this._setState("playing"));
61140
61234
  }
61141
61235
  }, {
61142
61236
  key: "setViewScale",
@@ -61159,10 +61253,57 @@
61159
61253
  }, {
61160
61254
  key: "release",
61161
61255
  value: function release() {
61162
- this._actionProcessor.release(), this._scheduler.release(), this._ticker.removeListener("tick", this.handlerTick), this._ticker = null;
61256
+ this._detachTickerListener(), this.removeAllListeners(), this._actionProcessor.release(), this._scheduler.release(), this._ticker = null;
61257
+ }
61258
+ }, {
61259
+ key: "_attachTickerListener",
61260
+ value: function _attachTickerListener() {
61261
+ this._ticker && !this._tickerListening && (this._ticker.addListener("tick", this.handlerTick), this._tickerListening = !0);
61262
+ }
61263
+ }, {
61264
+ key: "_detachTickerListener",
61265
+ value: function _detachTickerListener() {
61266
+ this._ticker && this._tickerListening && (this._ticker.removeListener("tick", this.handlerTick), this._tickerListening = !1);
61267
+ }
61268
+ }, {
61269
+ key: "_setState",
61270
+ value: function _setState(state) {
61271
+ if (this._state === state) return;
61272
+ var previousState = this._state;
61273
+ this._state = state;
61274
+ var event = {
61275
+ state: state,
61276
+ previousState: previousState,
61277
+ currentTime: this.currentTime,
61278
+ totalTime: this.totalTime
61279
+ };
61280
+ this.emit("stateChange", event);
61281
+ }
61282
+ }, {
61283
+ key: "_resetStoryForRestart",
61284
+ value: function _resetStoryForRestart() {
61285
+ if (this._story) {
61286
+ this._preserveStateOnReset = !0;
61287
+ try {
61288
+ this._story.reset();
61289
+ } finally {
61290
+ this._preserveStateOnReset = !1;
61291
+ }
61292
+ }
61293
+ }
61294
+ }, {
61295
+ key: "_finishPlayback",
61296
+ value: function _finishPlayback() {
61297
+ if ("ended" === this._state) return;
61298
+ this._lastFrameTime = -1, this._detachTickerListener(), this._setState("ended");
61299
+ var event = {
61300
+ currentTime: this.currentTime,
61301
+ totalTime: this.totalTime
61302
+ };
61303
+ this.emit("end", event);
61163
61304
  }
61164
61305
  }]);
61165
- }();
61306
+ }(EventEmitter);
61166
61307
 
61167
61308
  function createStory(dsl, option) {
61168
61309
  return new Story(dsl, option);
@@ -161010,6 +161151,11 @@
161010
161151
  list: ["BaseGraphic"]
161011
161152
  }
161012
161153
  },
161154
+ Path: {
161155
+ runtime: {
161156
+ list: ["BaseGraphic"]
161157
+ }
161158
+ },
161013
161159
  Timeline: {
161014
161160
  runtime: {
161015
161161
  list: ["BaseGraphic"]
@@ -162272,6 +162418,74 @@
162272
162418
  }(CharacterComponent);
162273
162419
  LineCharacter.type = "Line";
162274
162420
 
162421
+ var PathComponent = /*#__PURE__*/function (_BaseComponentWithTex) {
162422
+ function PathComponent(attributes, options) {
162423
+ var _this;
162424
+ _classCallCheck(this, PathComponent);
162425
+ _this = _callSuper(this, PathComponent, [(null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, PathComponent.defaultAttributes, attributes)]), _this.type = "PathComponent";
162426
+ return _this;
162427
+ }
162428
+ _inherits(PathComponent, _BaseComponentWithTex);
162429
+ return _createClass(PathComponent, [{
162430
+ key: "render",
162431
+ value: function render() {
162432
+ _superPropGet(PathComponent, "render", this, 3)([]), this.renderPath();
162433
+ }
162434
+ }, {
162435
+ key: "renderPath",
162436
+ value: function renderPath() {
162437
+ var _a, _b;
162438
+ var _this$attribute = this.attribute,
162439
+ graphic = _this$attribute.graphic,
162440
+ padding = _this$attribute.padding,
162441
+ attrs = Object.assign({}, graphic);
162442
+ null == attrs.x && (attrs.x = null !== (_a = null == padding ? void 0 : padding.left) && void 0 !== _a ? _a : 0), null == attrs.y && (attrs.y = null !== (_b = null == padding ? void 0 : padding.top) && void 0 !== _b ? _b : 0), this.mainGraphic = this.createOrUpdateChild("path", Object.assign(Object.assign({}, attrs), {
162443
+ scaleX: 1,
162444
+ scaleY: 1,
162445
+ angle: 0,
162446
+ postMatrix: null
162447
+ }), "path");
162448
+ }
162449
+ }]);
162450
+ }(BaseComponentWithText);
162451
+ PathComponent.defaultAttributes = {
162452
+ visible: !0,
162453
+ textStyle: {},
162454
+ width: 100,
162455
+ height: 100,
162456
+ padding: {
162457
+ top: 0,
162458
+ bottom: 0,
162459
+ left: 0,
162460
+ right: 0
162461
+ }
162462
+ };
162463
+
162464
+ var PathCharacter = /*#__PURE__*/function (_CharacterComponent) {
162465
+ function PathCharacter() {
162466
+ _classCallCheck(this, PathCharacter);
162467
+ return _callSuper(this, PathCharacter, arguments);
162468
+ }
162469
+ _inherits(PathCharacter, _CharacterComponent);
162470
+ return _createClass(PathCharacter, [{
162471
+ key: "createAndAddGraphic",
162472
+ value: function createAndAddGraphic(attribute) {
162473
+ this._graphic = new PathComponent(attribute), this.canvas.addGraphic(this._graphic);
162474
+ }
162475
+ }, {
162476
+ key: "show",
162477
+ value: function show() {
162478
+ this._graphic.setAttribute("visibleAll", !0);
162479
+ }
162480
+ }, {
162481
+ key: "hide",
162482
+ value: function hide() {
162483
+ this._graphic.setAttribute("visibleAll", !1);
162484
+ }
162485
+ }]);
162486
+ }(CharacterComponent);
162487
+ PathCharacter.type = "Path";
162488
+
162275
162489
  var PolygonComponent = /*#__PURE__*/function (_BaseComponentWithTex) {
162276
162490
  function PolygonComponent(attributes, options) {
162277
162491
  _classCallCheck(this, PolygonComponent);
@@ -164132,7 +164346,7 @@
164132
164346
 
164133
164347
  exports.CharacterType = void 0;
164134
164348
  !function (CharacterType) {
164135
- CharacterType.VCHART = "VChart", CharacterType.VTABLE = "VTable", CharacterType.WEATHERTABLE = "WeatherTable", CharacterType.RANKINGBAR = "RankingBar", CharacterType.WAVE_SCATTER = "WaveScatter", CharacterType.SCATTER_BAR = "ScatterBar", CharacterType.PROGRESS_PIE = "ProgressPie", CharacterType.PIVOT_CHART = "PivotChart", CharacterType.TEXT = "Text", CharacterType.RECT = "Rect", CharacterType.SHAPE = "Shape", CharacterType.IMAGE = "Image", CharacterType.LINE = "Line", CharacterType.POLYGON = "Polygon", CharacterType.ARC = "Arc", CharacterType.TIMELINE = "Timeline", CharacterType.UNIT = "Unit", CharacterType.COMMON = "Common";
164349
+ CharacterType.VCHART = "VChart", CharacterType.VTABLE = "VTable", CharacterType.WEATHERTABLE = "WeatherTable", CharacterType.RANKINGBAR = "RankingBar", CharacterType.WAVE_SCATTER = "WaveScatter", CharacterType.SCATTER_BAR = "ScatterBar", CharacterType.PROGRESS_PIE = "ProgressPie", CharacterType.PIVOT_CHART = "PivotChart", CharacterType.TEXT = "Text", CharacterType.RECT = "Rect", CharacterType.SHAPE = "Shape", CharacterType.IMAGE = "Image", CharacterType.LINE = "Line", CharacterType.POLYGON = "Polygon", CharacterType.PATH = "Path", CharacterType.ARC = "Arc", CharacterType.TIMELINE = "Timeline", CharacterType.UNIT = "Unit", CharacterType.COMMON = "Common";
164136
164350
  }(exports.CharacterType || (exports.CharacterType = {}));
164137
164351
  var SeriesAxisOrientKey = "".concat(VSTORY_PREFIX, "_seriesAxisOrient");
164138
164352
 
@@ -164758,7 +164972,7 @@
164758
164972
 
164759
164973
  var _register = !1;
164760
164974
  function registerCharacters() {
164761
- _register || (_register = !0, StoryFactory.registerCharacter(VChartCharacter.type, VChartCharacter), registerRankingBarTemp(), registerAllVChart(), StoryFactory.registerCharacter(RankingBarCharacter.type, RankingBarCharacter), StoryFactory.registerCharacter(WaveScatterCharacter.type, WaveScatterCharacter), StoryFactory.registerCharacter(ScatterBarCharacter.type, ScatterBarCharacter), StoryFactory.registerCharacter(TextCharacter.type, TextCharacter), StoryFactory.registerCharacter(RectCharacter.type, RectCharacter), StoryFactory.registerCharacter(ImageCharacter.type, ImageCharacter), StoryFactory.registerCharacter(LineCharacter.type, LineCharacter), StoryFactory.registerCharacter(ShapeCharacter.type, ShapeCharacter), StoryFactory.registerCharacter(PolygonCharacter.type, PolygonCharacter), StoryFactory.registerCharacter(ArcCharacter.type, ArcCharacter), StoryFactory.registerCharacter(TimelineCharacter.type, TimelineCharacter), StoryFactory.registerCharacter(UnitCharacter.type, UnitCharacter), StoryFactory.registerCharacter(VTableCharacter.type, VTableCharacter), StoryFactory.registerCharacter(PivotChartCharacter.type, PivotChartCharacter), registerRuntime());
164975
+ _register || (_register = !0, StoryFactory.registerCharacter(VChartCharacter.type, VChartCharacter), registerRankingBarTemp(), registerAllVChart(), StoryFactory.registerCharacter(RankingBarCharacter.type, RankingBarCharacter), StoryFactory.registerCharacter(WaveScatterCharacter.type, WaveScatterCharacter), StoryFactory.registerCharacter(ScatterBarCharacter.type, ScatterBarCharacter), StoryFactory.registerCharacter(TextCharacter.type, TextCharacter), StoryFactory.registerCharacter(RectCharacter.type, RectCharacter), StoryFactory.registerCharacter(ImageCharacter.type, ImageCharacter), StoryFactory.registerCharacter(LineCharacter.type, LineCharacter), StoryFactory.registerCharacter(ShapeCharacter.type, ShapeCharacter), StoryFactory.registerCharacter(PolygonCharacter.type, PolygonCharacter), StoryFactory.registerCharacter(PathCharacter.type, PathCharacter), StoryFactory.registerCharacter(ArcCharacter.type, ArcCharacter), StoryFactory.registerCharacter(TimelineCharacter.type, TimelineCharacter), StoryFactory.registerCharacter(UnitCharacter.type, UnitCharacter), StoryFactory.registerCharacter(VTableCharacter.type, VTableCharacter), StoryFactory.registerCharacter(PivotChartCharacter.type, PivotChartCharacter), registerRuntime());
164762
164976
  }
164763
164977
  function registerRuntime() {
164764
164978
  RuntimeStore.register(CommonLayoutRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance$1), RuntimeStore.register(SeriesSpecRuntimeInstance), RuntimeStore.register(MarkStyleRuntimeInstance), RuntimeStore.register(LabelStyleRuntimeInstance), RuntimeStore.register(TotalLabelRuntimeInstance), RuntimeStore.register(ChartMarkerRuntimeInstance), RuntimeStore.register(RankingBarRuntimeInstance), RuntimeStore.register(WaveScatterRuntimeInstance), RuntimeStore.register(BaseGraphicRuntimeInstance), RuntimeStore.register(TextRuntimeInstance), RuntimeStore.register(LineRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance), RuntimeStore.register(TableTypeRuntimeInstance), RuntimeStore.register(TableThemeRuntimeInstance), RuntimeStore.register(ShowHeaderRuntimeInstance), RuntimeStore.register(ColWidthRuntimeInstance), RuntimeStore.register(RowHeightRuntimeInstance), RuntimeStore.register(ColVisibleRuntimeInstance), RuntimeStore.register(RowVisibleRuntimeInstance), RuntimeStore.register(ColStyleRuntimeInstance), RuntimeStore.register(RowStyleRuntimeInstance), RuntimeStore.register(ContentColStyleRuntimeInstance), RuntimeStore.register(ContentRowStyleRuntimeInstance), RuntimeStore.register(CellStyleRuntimeInstance), RuntimeStore.register(ConditionFormatRuntimeInstance);
@@ -165856,7 +166070,7 @@
165856
166070
  var _a, _b, _c;
165857
166071
  var config = _this6.getMarkAnimateConfig(vchart, mark, markIndex, action, series, payload),
165858
166072
  product = mark.getProduct();
165859
- isRun ? (null === (_a = null == product ? void 0 : product.setAttribute) || void 0 === _a || _a.call(product, "visibleAll", !0), null === (_b = null == product ? void 0 : product.executeAnimation) || void 0 === _b || _b.call(product, config || {})) : null === (_c = null == product ? void 0 : product.setAttribute) || void 0 === _c || _c.call(product, "visibleAll", !1);
166073
+ isRun ? ("rect" !== mark.type && "rect3d" !== mark.type || _this6.ensureRectMarkFinalAttributes(product), null === (_a = null == product ? void 0 : product.setAttribute) || void 0 === _a || _a.call(product, "visibleAll", !0), null === (_b = null == product ? void 0 : product.executeAnimation) || void 0 === _b || _b.call(product, config || {})) : null === (_c = null == product ? void 0 : product.setAttribute) || void 0 === _c || _c.call(product, "visibleAll", !1);
165860
166074
  });
165861
166075
  }
165862
166076
  }, {
@@ -165877,6 +166091,26 @@
165877
166091
  character: this.character
165878
166092
  });
165879
166093
  }
166094
+ }, {
166095
+ key: "ensureRectMarkFinalAttributes",
166096
+ value: function ensureRectMarkFinalAttributes(graphic) {
166097
+ var _this7 = this;
166098
+ if (!graphic) return;
166099
+ var targetGraphic = graphic;
166100
+ "rect" !== targetGraphic.type && "rect3d" !== targetGraphic.type || this.patchGraphicFinalAttribute(targetGraphic), "function" == typeof targetGraphic.forEachChildren && targetGraphic.forEachChildren(function (child) {
166101
+ _this7.ensureRectMarkFinalAttributes(child);
166102
+ });
166103
+ }
166104
+ }, {
166105
+ key: "patchGraphicFinalAttribute",
166106
+ value: function patchGraphicFinalAttribute(graphic) {
166107
+ if (graphic.__vstoryGetFinalAttributeFallbackPatched || "function" != typeof graphic.getFinalAttribute) return;
166108
+ var originalGetFinalAttribute = graphic.getFinalAttribute.bind(graphic);
166109
+ graphic.getFinalAttribute = function () {
166110
+ var _a;
166111
+ return null !== (_a = originalGetFinalAttribute()) && void 0 !== _a ? _a : graphic.attribute;
166112
+ }, graphic.__vstoryGetFinalAttributeFallbackPatched = !0;
166113
+ }
165880
166114
  }]);
165881
166115
  }(VChartBaseActionProcessor);
165882
166116
  VChartVisibilityActionProcessor.rectPayload = function (seriesType) {
@@ -166074,10 +166308,11 @@
166074
166308
  easing = waveAnimate.easing,
166075
166309
  loop = waveAnimate.loop,
166076
166310
  custom = waveAnimate.custom,
166077
- graphics = mark.getProduct().getAllElements().map(function (item) {
166078
- return item.getGraphicItem();
166079
- });
166080
- graphics.length && graphics.forEach(function (g) {
166311
+ product = mark.getProduct(),
166312
+ graphics = [];
166313
+ product && "function" == typeof product.forEachChildren && product.forEachChildren(function (child) {
166314
+ graphics.push(child);
166315
+ }), graphics.length && graphics.forEach(function (g) {
166081
166316
  g.animate({
166082
166317
  timeline: globalTickerStore.getTimeline("background_animate")
166083
166318
  }).play(new custom({}, {}, duration, easing, {})).loop(loop ? 1 / 0 : 1);
@@ -166668,6 +166903,27 @@
166668
166903
  registerLineVisibilityAction();
166669
166904
  }
166670
166905
 
166906
+ var PathVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
166907
+ function PathVisibilityActionProcessor() {
166908
+ _classCallCheck(this, PathVisibilityActionProcessor);
166909
+ return _callSuper(this, PathVisibilityActionProcessor, arguments);
166910
+ }
166911
+ _inherits(PathVisibilityActionProcessor, _CommonVisibilityActi);
166912
+ return _createClass(PathVisibilityActionProcessor, [{
166913
+ key: "getEffectInstance",
166914
+ value: function getEffectInstance(effect, appear) {
166915
+ return "clipRange" === effect ? clipRangeInstance : _superPropGet(PathVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
166916
+ }
166917
+ }]);
166918
+ }(CommonVisibilityActionProcessor);
166919
+ function registerPathVisibilityAction() {
166920
+ globalProcessorRegistry.registerProcessor("Path", _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ACTION_TYPE.APPEAR, new PathVisibilityActionProcessor()), ACTION_TYPE.DISAPPEAR, new PathVisibilityActionProcessor()), ACTION_TYPE.STYLE, new CommonStyleActionProcessor()), ACTION_TYPE.MOVETO, new CommonMoveToActionProcessor()), ACTION_TYPE.SCALETO, new CommonScaleToActionProcessor()), ACTION_TYPE.BOUNCE, new CommonBounceActionProcessor()));
166921
+ }
166922
+
166923
+ function registerPathAction() {
166924
+ registerPathVisibilityAction();
166925
+ }
166926
+
166671
166927
  var RectVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
166672
166928
  function RectVisibilityActionProcessor() {
166673
166929
  var _this;
@@ -167055,7 +167311,7 @@
167055
167311
  }
167056
167312
 
167057
167313
  function registerVComponentAction() {
167058
- registerTextAction(), registerRectAction(), registerImageAction(), registerLineAction(), registerShapeAction(), registerTimelineAction(), registerUnitAction(), registerPolygonAction(), registerArcAction();
167314
+ registerTextAction(), registerRectAction(), registerImageAction(), registerLineAction(), registerPathAction(), registerShapeAction(), registerTimelineAction(), registerUnitAction(), registerPolygonAction(), registerArcAction();
167059
167315
  }
167060
167316
 
167061
167317
  var VTableBaseActionProcessor = /*#__PURE__*/function (_ActionProcessorItem) {
@@ -172088,7 +172344,7 @@
172088
172344
  function ShapeSelection() {
172089
172345
  var _this;
172090
172346
  _classCallCheck(this, ShapeSelection);
172091
- _this = _callSuper(this, ShapeSelection, arguments), _this.level = 3, _this.type = "shape", _this.editCharacterType = "Shape", _this.supportedCharacterType = ["Shape"], _this.handlerContentClick = function (e) {
172347
+ _this = _callSuper(this, ShapeSelection, arguments), _this.level = 3, _this.type = "shape", _this.editCharacterType = "Shape", _this.supportedCharacterType = ["Shape", "Path"], _this.handlerContentClick = function (e) {
172092
172348
  _this._layoutController.handleDragMouseDown(e);
172093
172349
  };
172094
172350
  return _this;
@@ -172146,7 +172402,7 @@
172146
172402
  bind(RichTextEditPlugin).toSelf(), bind(AutoEnablePlugins).toService(RichTextEditPlugin);
172147
172403
  });
172148
172404
  function registerAllSelection() {
172149
- container.load(editPlugin), Edit.registerEditSelection("Rect", RectSelection), Edit.registerEditSelection("Image", ImageSelection), Edit.registerEditSelection("Shape", ShapeSelection);
172405
+ container.load(editPlugin), Edit.registerEditSelection("Rect", RectSelection), Edit.registerEditSelection("Image", ImageSelection), Edit.registerEditSelection("Shape", ShapeSelection), Edit.registerEditSelection("Path", ShapeSelection);
172150
172406
  }
172151
172407
 
172152
172408
  var SnapshotManager = /*#__PURE__*/function () {
@@ -172334,6 +172590,7 @@
172334
172590
  exports.registerLottie = registerLottie;
172335
172591
  exports.registerLottieAction = registerLottieAction;
172336
172592
  exports.registerMosaicChart = registerMosaicChart;
172593
+ exports.registerPathAction = registerPathAction;
172337
172594
  exports.registerPolygonAction = registerPolygonAction;
172338
172595
  exports.registerPopTip = registerPopTip;
172339
172596
  exports.registerPopTipAction = registerPopTipAction;