@vvfx/sdk 0.2.2-beta.12 → 0.2.2-beta.16

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.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: TODO
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 赤芍,何即,不择,意绮
6
- * Version: v0.2.2-beta.12
6
+ * Version: v0.2.2-beta.16
7
7
  */
8
8
 
9
9
  'use strict';
@@ -60433,6 +60433,8 @@ var PageDataUtils = /*#__PURE__*/ function() {
60433
60433
  }
60434
60434
  }
60435
60435
  var isLocked = (_this_getSDKItem = this.getSDKItem(playerItem.getInstanceId())) == null ? void 0 : _this_getSDKItem.isLocked;
60436
+ // 优先通过 ID 查找现有 SDKItem,获取其 SDKItemType
60437
+ var existingSDKItem = this.getSDKItem(playerItem.getInstanceId());
60436
60438
  // 创建基础选项
60437
60439
  var baseOptions = {
60438
60440
  id: playerItem.getInstanceId(),
@@ -60444,12 +60446,11 @@ var PageDataUtils = /*#__PURE__*/ function() {
60444
60446
  endBehavior: playerItem.endBehavior,
60445
60447
  visible: isVisible,
60446
60448
  isLocked: isLocked,
60447
- isCoreEditable: isCoreEditable
60449
+ isCoreEditable: isCoreEditable,
60450
+ extension: existingSDKItem == null ? void 0 : existingSDKItem.extension
60448
60451
  };
60449
60452
  // 根据类型创建对应的 SDKItem 类实例
60450
60453
  var sdkItem;
60451
- // 优先通过 ID 查找现有 SDKItem,获取其 SDKItemType
60452
- var existingSDKItem = this.getSDKItem(playerItem.getInstanceId());
60453
60454
  // 如果找到了现有 SDKItem,根据 SDKItemType 创建
60454
60455
  // 将类型转换为 string 进行比较
60455
60456
  if ((existingSDKItem == null ? void 0 : existingSDKItem.type) === SDKItemType.GENERATOR) {
@@ -94023,18 +94024,22 @@ var SDK = /*#__PURE__*/ function() {
94023
94024
  _proto.initPlayer = function initPlayer(mode) {
94024
94025
  var _this = this;
94025
94026
  var playerContainer = document.createElement('div');
94026
- var _ref = mode === 'editor' ? [
94027
- this._container.clientWidth,
94028
- this._container.clientHeight
94029
- ] : [
94027
+ var _ref = mode === 'template' ? [
94030
94028
  this._container.offsetWidth,
94031
94029
  this._container.offsetHeight
94030
+ ] : [
94031
+ document.documentElement.clientWidth,
94032
+ document.documentElement.clientHeight
94032
94033
  ], width = _ref[0], height = _ref[1];
94033
94034
  this._playerContainer = playerContainer;
94034
94035
  this._playerContainer.id = 'player-container';
94035
94036
  this._playerContainer.style.position = 'absolute';
94036
94037
  this._playerContainer.style.width = "" + width + "px";
94037
94038
  this._playerContainer.style.height = "" + height + "px";
94039
+ if (mode === 'editor') {
94040
+ this._playerContainer.style.left = '0px';
94041
+ this._playerContainer.style.top = '0px';
94042
+ }
94038
94043
  this._container.appendChild(playerContainer);
94039
94044
  this.player = new EFFECTS.Player({
94040
94045
  container: this._playerContainer,
@@ -94093,6 +94098,7 @@ var SDK = /*#__PURE__*/ function() {
94093
94098
  _this._gestureHandler.dispose();
94094
94099
  setTimeout(function() {
94095
94100
  return _async_to_generator(function() {
94101
+ var _this_pageData, _this_pageData1, itemExtension;
94096
94102
  return _ts_generator(this, function(_state) {
94097
94103
  switch(_state.label){
94098
94104
  case 0:
@@ -94100,12 +94106,22 @@ var SDK = /*#__PURE__*/ function() {
94100
94106
  this._pageDataUtils = new PageDataUtils(this.player, this._playerContainer, this._eventEmitter, this);
94101
94107
  this._gestureHandler = new GestureHandler(this._container);
94102
94108
  this.syncCanvasLayerOrder();
94109
+ itemExtension = {};
94110
+ (_this_pageData = this.pageData) == null ? void 0 : _this_pageData.items.forEach(function(item) {
94111
+ itemExtension[item.id] = item.getAllExtension();
94112
+ });
94103
94113
  return [
94104
94114
  4,
94105
94115
  this.runByPageData(this.pageData)
94106
94116
  ];
94107
94117
  case 1:
94108
94118
  _state.sent();
94119
+ (_this_pageData1 = this.pageData) == null ? void 0 : _this_pageData1.items.forEach(function(item) {
94120
+ var extension = itemExtension[item.id];
94121
+ if (extension) {
94122
+ item.setExtensions(extension);
94123
+ }
94124
+ });
94109
94125
  this._eventEmitter.emit('viewRebuildFinish');
94110
94126
  return [
94111
94127
  2