@galacean/effects 0.0.1-alpha.3 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime player for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v0.0.1-alpha.3
6
+ * Version: v1.0.1
7
7
  */
8
8
 
9
9
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -9453,6 +9453,7 @@ var Transform = /** @class */ (function () {
9453
9453
  */
9454
9454
  Transform.prototype.rotateByQuat = function (quat) {
9455
9455
  quatMultiply(this.quat, this.quat, quat);
9456
+ rotationFromMat3(this.rotation, mat3FromQuat(tempMat3$3, quat));
9456
9457
  this.dirtyFlags.localData = true;
9457
9458
  this.dispatchValueChange();
9458
9459
  };
@@ -10279,7 +10280,7 @@ var PluginSystem = /** @class */ (function () {
10279
10280
  .map(function (name) {
10280
10281
  var CTRL = pluginLoaderMap[name];
10281
10282
  if (!CTRL) {
10282
- throw new Error("plugin '".concat(name, "' not found"));
10283
+ throw new Error("plugin '".concat(name, "' not found.") + getPluginUsageInfo(name));
10283
10284
  }
10284
10285
  var loader = new CTRL();
10285
10286
  loader.name = name;
@@ -10351,6 +10352,23 @@ var PluginSystem = /** @class */ (function () {
10351
10352
  };
10352
10353
  return PluginSystem;
10353
10354
  }());
10355
+ var pluginInfoMap = {
10356
+ 'alipay-downgrade': '@galacean/effects-plugin-alipay-downgrade',
10357
+ 'editor-gizmo': '@galacean/effects-plugin-editor-gizmo',
10358
+ 'tree': '@galacean/effects-plugin-model',
10359
+ 'model': '@galacean/effects-plugin-model',
10360
+ 'orientation-transformer': '@galacean/effects-plugin-orientation-transformer',
10361
+ 'spine': '@galacean/effects-plugin-spine',
10362
+ };
10363
+ function getPluginUsageInfo(name) {
10364
+ var info = pluginInfoMap[name];
10365
+ if (info) {
10366
+ return "\nInstall Plugin: npm i ".concat(info, "@latest --save\nImport Plugin: import '").concat(info, "'");
10367
+ }
10368
+ else {
10369
+ return '';
10370
+ }
10371
+ }
10354
10372
 
10355
10373
  /**
10356
10374
  * 抽象插件类
@@ -25205,12 +25223,6 @@ var Composition = /** @class */ (function () {
25205
25223
  enumerable: false,
25206
25224
  configurable: true
25207
25225
  });
25208
- /**
25209
- * 获取合成的时长
25210
- */
25211
- Composition.prototype.getDuration = function () {
25212
- return this.content.duration;
25213
- };
25214
25226
  Object.defineProperty(Composition.prototype, "isDestroyed", {
25215
25227
  /**
25216
25228
  * 获取销毁状态
@@ -25221,6 +25233,12 @@ var Composition = /** @class */ (function () {
25221
25233
  enumerable: false,
25222
25234
  configurable: true
25223
25235
  });
25236
+ /**
25237
+ * 获取合成的时长
25238
+ */
25239
+ Composition.prototype.getDuration = function () {
25240
+ return this.content.duration;
25241
+ };
25224
25242
  /**
25225
25243
  * 重新开始合成
25226
25244
  */
@@ -30874,25 +30892,6 @@ var Player = /** @class */ (function () {
30874
30892
  });
30875
30893
  }
30876
30894
  };
30877
- /**
30878
- * 修改播放器的配置
30879
- * @param config - 播放配置,当前仅支持修改合成播放速度
30880
- */
30881
- Player.prototype.config = function (config) {
30882
- var singleComp = typeof config.compositionName === 'string';
30883
- if ('speed' in config) {
30884
- var speed_1 = +(config.speed || 1);
30885
- if (singleComp) {
30886
- var comp = this.compositions.find(function (comp) { return comp.name === config.compositionName; });
30887
- if (comp) {
30888
- comp.speed = speed_1;
30889
- }
30890
- }
30891
- else {
30892
- this.compositions.forEach(function (comp) { return (comp.speed = speed_1); });
30893
- }
30894
- }
30895
- };
30896
30895
  /**
30897
30896
  * 清空 canvas 的画面
30898
30897
  * @param immediate - 如果立即清理,当前画面将会消失,如果 player 还有合成在渲染,可能出现闪烁
@@ -30960,11 +30959,15 @@ var Player = /** @class */ (function () {
30960
30959
  }
30961
30960
  this.canvas.remove();
30962
30961
  }
30963
- this.tick = throwDestroyedError;
30964
- this.resize = throwDestroyedError;
30965
- this.loadScene = throwDestroyedErrorPromise;
30966
- this.play = throwDestroyedErrorPromise;
30967
- this.resume = throwDestroyedErrorPromise;
30962
+ // 在报错函数中传入 player.name
30963
+ var errorMsg = getDestroyedErrorMessage(this.name);
30964
+ var throwErrorFunc = function () { return throwDestroyedError(errorMsg); };
30965
+ var throwErrorPromiseFunc = function () { return throwDestroyedErrorPromise(errorMsg); };
30966
+ this.tick = throwErrorFunc;
30967
+ this.resize = throwErrorFunc;
30968
+ this.loadScene = throwErrorPromiseFunc;
30969
+ this.play = throwErrorPromiseFunc;
30970
+ this.resume = throwErrorPromiseFunc;
30968
30971
  this.disposed = true;
30969
30972
  };
30970
30973
  Player.prototype.offloadTexture = function () {
@@ -31089,11 +31092,13 @@ function assertContainer(container) {
31089
31092
  throw new Error("Container is not an HTMLElement, see ".concat(HELP_LINK['Container is not an HTMLElement']));
31090
31093
  }
31091
31094
  }
31092
- var destroyedErrorMessage = "Never use destroyed player again, see ".concat(HELP_LINK['Never use destroyed player again']);
31093
- function throwDestroyedError() {
31095
+ function getDestroyedErrorMessage(name) {
31096
+ return "Never use destroyed player: ".concat(name, " again, see ").concat(HELP_LINK['Never use destroyed player again']);
31097
+ }
31098
+ function throwDestroyedError(destroyedErrorMessage) {
31094
31099
  throw new Error(destroyedErrorMessage);
31095
31100
  }
31096
- function throwDestroyedErrorPromise() {
31101
+ function throwDestroyedErrorPromise(destroyedErrorMessage) {
31097
31102
  return Promise.reject(destroyedErrorMessage);
31098
31103
  }
31099
31104
 
@@ -31139,9 +31144,9 @@ Renderer.create = function (canvas, framework, renderOptions) {
31139
31144
  Engine.create = function (gl) {
31140
31145
  return new GLEngine(gl);
31141
31146
  };
31142
- var version = "0.0.1-alpha.3";
31147
+ var version = "1.0.1";
31143
31148
  console.info({
31144
- content: '[Galacean Effects Player] version: ' + "0.0.1-alpha.3",
31149
+ content: '[Galacean Effects Player] version: ' + "1.0.1",
31145
31150
  type: LOG_TYPE,
31146
31151
  });
31147
31152