@galacean/effects-plugin-spine 2.8.0-alpha.2 → 2.8.0-alpha.4

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,11 +3,11 @@
3
3
  * Description: Galacean Effects player spine plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 十弦
6
- * Version: v2.8.0-alpha.2
6
+ * Version: v2.8.0-alpha.4
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
10
- import { assertExist, glContext, Mesh, Geometry, Material, setMaskMode, GLSLVersion, PLAYER_OPTIONS_ENV_EDITOR, math, serialize, effectsClass, spec, MaskMode, HitTestType, RendererComponent, MaskProcessor, registerPlugin, logger, AbstractPlugin } from '@galacean/effects';
10
+ import { assertExist, glContext, Mesh, Geometry, Material, setMaskMode, GLSLVersion, PLAYER_OPTIONS_ENV_EDITOR, math, serialize, effectsClass, spec, MaskProcessor, MaskMode, HitTestType, RendererComponent, Plugin, registerPlugin, logger } from '@galacean/effects';
11
11
 
12
12
  function _set_prototype_of(o, p) {
13
13
  _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
@@ -31,6 +31,74 @@ function _inherits(subClass, superClass) {
31
31
  if (superClass) _set_prototype_of(subClass, superClass);
32
32
  }
33
33
 
34
+ function _is_native_reflect_construct() {
35
+ // Since Reflect.construct can't be properly polyfilled, some
36
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
37
+ // Those polyfills don't allow us to subclass built-ins, so we need to
38
+ // use our fallback implementation.
39
+ try {
40
+ // If the internal slots aren't set, this throws an error similar to
41
+ // TypeError: this is not a Boolean object.
42
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
43
+ } catch (_) {}
44
+ return (_is_native_reflect_construct = function _is_native_reflect_construct() {
45
+ return !!result;
46
+ })();
47
+ }
48
+
49
+ function _construct(Parent, args, Class) {
50
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
51
+ else {
52
+ _construct = function construct(Parent, args, Class) {
53
+ var a = [
54
+ null
55
+ ];
56
+ a.push.apply(a, args);
57
+ var Constructor = Function.bind.apply(Parent, a);
58
+ var instance = new Constructor();
59
+ if (Class) _set_prototype_of(instance, Class.prototype);
60
+ return instance;
61
+ };
62
+ }
63
+ return _construct.apply(null, arguments);
64
+ }
65
+
66
+ function _get_prototype_of(o) {
67
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
68
+ return o.__proto__ || Object.getPrototypeOf(o);
69
+ };
70
+ return _get_prototype_of(o);
71
+ }
72
+
73
+ function _is_native_function(fn) {
74
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
75
+ }
76
+
77
+ function _wrap_native_super(Class) {
78
+ var _cache = typeof Map === "function" ? new Map() : undefined;
79
+ _wrap_native_super = function _wrap_native_super(Class) {
80
+ if (Class === null || !_is_native_function(Class)) return Class;
81
+ if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
82
+ if (typeof _cache !== "undefined") {
83
+ if (_cache.has(Class)) return _cache.get(Class);
84
+ _cache.set(Class, Wrapper);
85
+ }
86
+ function Wrapper() {
87
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
88
+ }
89
+ Wrapper.prototype = Object.create(Class.prototype, {
90
+ constructor: {
91
+ value: Wrapper,
92
+ enumerable: false,
93
+ writable: true,
94
+ configurable: true
95
+ }
96
+ });
97
+ return _set_prototype_of(Wrapper, Class);
98
+ };
99
+ return _wrap_native_super(Class);
100
+ }
101
+
34
102
  function _array_like_to_array(arr, len) {
35
103
  if (len == null || len > arr.length) len = arr.length;
36
104
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -11525,17 +11593,17 @@ SpineComponent = __decorate([
11525
11593
  effectsClass(spec.DataType.SpineComponent)
11526
11594
  ], SpineComponent);
11527
11595
 
11528
- var SpineLoader = /*#__PURE__*/ function(AbstractPlugin) {
11529
- _inherits(SpineLoader, AbstractPlugin);
11596
+ var SpineLoader = /*#__PURE__*/ function(Plugin) {
11597
+ _inherits(SpineLoader, Plugin);
11530
11598
  function SpineLoader() {
11531
- return AbstractPlugin.apply(this, arguments);
11599
+ return Plugin.apply(this, arguments);
11532
11600
  }
11533
11601
  return SpineLoader;
11534
- }(AbstractPlugin);
11602
+ }(_wrap_native_super(Plugin));
11535
11603
  registerPlugin("spine", SpineLoader);
11536
11604
  /**
11537
11605
  * 插件版本号
11538
- */ var version = "2.8.0-alpha.2";
11606
+ */ var version = "2.8.0-alpha.4";
11539
11607
  logger.info("Plugin spine version: " + version + ".");
11540
11608
  if (version !== EFFECTS.version) {
11541
11609
  console.error("注意:请统一 Spine 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Spine plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");