@galacean/effects-plugin-editor-gizmo 2.8.0-alpha.3 → 2.8.0-alpha.5

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.
@@ -1,7 +1,7 @@
1
1
  import type { Composition, Scene, Texture } from '@galacean/effects';
2
- import { AbstractPlugin } from '@galacean/effects';
2
+ import { Plugin } from '@galacean/effects';
3
3
  export declare const iconTextures: Map<string, Texture>;
4
- export declare class EditorGizmoPlugin extends AbstractPlugin {
4
+ export declare class EditorGizmoPlugin extends Plugin {
5
5
  order: number;
6
- onCompositionConstructed(composition: Composition, scene: Scene): Promise<void>;
6
+ onCompositionCreated(composition: Composition, scene: Scene): Promise<void>;
7
7
  }
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player editor gizmo plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 茂安,旻诺
6
- * Version: v2.8.0-alpha.3
6
+ * Version: v2.8.0-alpha.5
7
7
  */
8
8
 
9
9
  'use strict';
@@ -81,6 +81,74 @@ function _inherits(subClass, superClass) {
81
81
  if (superClass) _set_prototype_of(subClass, superClass);
82
82
  }
83
83
 
84
+ function _is_native_reflect_construct() {
85
+ // Since Reflect.construct can't be properly polyfilled, some
86
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
87
+ // Those polyfills don't allow us to subclass built-ins, so we need to
88
+ // use our fallback implementation.
89
+ try {
90
+ // If the internal slots aren't set, this throws an error similar to
91
+ // TypeError: this is not a Boolean object.
92
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
93
+ } catch (_) {}
94
+ return (_is_native_reflect_construct = function _is_native_reflect_construct() {
95
+ return !!result;
96
+ })();
97
+ }
98
+
99
+ function _construct(Parent, args, Class) {
100
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
101
+ else {
102
+ _construct = function construct(Parent, args, Class) {
103
+ var a = [
104
+ null
105
+ ];
106
+ a.push.apply(a, args);
107
+ var Constructor = Function.bind.apply(Parent, a);
108
+ var instance = new Constructor();
109
+ if (Class) _set_prototype_of(instance, Class.prototype);
110
+ return instance;
111
+ };
112
+ }
113
+ return _construct.apply(null, arguments);
114
+ }
115
+
116
+ function _get_prototype_of(o) {
117
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
118
+ return o.__proto__ || Object.getPrototypeOf(o);
119
+ };
120
+ return _get_prototype_of(o);
121
+ }
122
+
123
+ function _is_native_function(fn) {
124
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
125
+ }
126
+
127
+ function _wrap_native_super(Class) {
128
+ var _cache = typeof Map === "function" ? new Map() : undefined;
129
+ _wrap_native_super = function _wrap_native_super(Class) {
130
+ if (Class === null || !_is_native_function(Class)) return Class;
131
+ if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
132
+ if (typeof _cache !== "undefined") {
133
+ if (_cache.has(Class)) return _cache.get(Class);
134
+ _cache.set(Class, Wrapper);
135
+ }
136
+ function Wrapper() {
137
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
138
+ }
139
+ Wrapper.prototype = Object.create(Class.prototype, {
140
+ constructor: {
141
+ value: Wrapper,
142
+ enumerable: false,
143
+ writable: true,
144
+ configurable: true
145
+ }
146
+ });
147
+ return _set_prototype_of(Wrapper, Class);
148
+ };
149
+ return _wrap_native_super(Class);
150
+ }
151
+
84
152
  function _array_like_to_array(arr, len) {
85
153
  if (len == null || len > arr.length) len = arr.length;
86
154
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -3583,16 +3651,16 @@ var DrawGizmoEditorPass = /*#__PURE__*/ function(RenderPass) {
3583
3651
 
3584
3652
  var iconImages = new Map();
3585
3653
  var iconTextures = new Map();
3586
- var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3587
- _inherits(EditorGizmoPlugin, AbstractPlugin);
3654
+ var EditorGizmoPlugin = /*#__PURE__*/ function(Plugin) {
3655
+ _inherits(EditorGizmoPlugin, Plugin);
3588
3656
  function EditorGizmoPlugin() {
3589
3657
  var _this;
3590
- _this = AbstractPlugin.apply(this, arguments) || this;
3658
+ _this = Plugin.apply(this, arguments) || this;
3591
3659
  _this.order = 1001;
3592
3660
  return _this;
3593
3661
  }
3594
3662
  var _proto = EditorGizmoPlugin.prototype;
3595
- _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {
3663
+ _proto.onCompositionCreated = function onCompositionCreated(composition, scene) {
3596
3664
  return _async_to_generator(function() {
3597
3665
  var engine, _iterator, _step, _step_value, name, data, _, _tmp, items, targetMap, i, item, gizmoComponent;
3598
3666
  return __generator(this, function(_state) {
@@ -3657,12 +3725,12 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3657
3725
  })();
3658
3726
  };
3659
3727
  return EditorGizmoPlugin;
3660
- }(EFFECTS.AbstractPlugin);
3728
+ }(_wrap_native_super(EFFECTS.Plugin));
3661
3729
 
3662
3730
  EFFECTS.registerPlugin("editor-gizmo", EditorGizmoPlugin);
3663
3731
  /**
3664
3732
  * 插件版本号
3665
- */ var version = "2.8.0-alpha.3";
3733
+ */ var version = "2.8.0-alpha.5";
3666
3734
  EFFECTS.logger.info("Plugin editor gizmo version: " + version + ".");
3667
3735
  if (version !== EFFECTS__namespace.version) {
3668
3736
  console.error("注意:请统一 Editor Gizmo 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Editor Gizmo plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");