@galacean/effects-plugin-editor-gizmo 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 editor gizmo 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 { glContext, Texture, noop, math, Geometry, Transform, Mesh, Material, DestroyOptions, GLSLVersion, GLGeometry, serialize, effectsClass, PluginSystem, RendererComponent, ParticleSystemRenderer, assertExist, TextureLoadAction, HitTestType, spec, RenderPassPriorityPostprocess, RenderPass, RenderPassPriorityPrepare, AbstractPlugin, registerPlugin, logger } from '@galacean/effects';
10
+ import { glContext, Texture, noop, math, Geometry, Transform, Mesh, Material, DestroyOptions, GLSLVersion, GLGeometry, serialize, effectsClass, HitTestType, spec, PluginSystem, RendererComponent, ParticleSystemRenderer, assertExist, RenderPassPriorityPostprocess, TextureLoadAction, RenderPass, RenderPassPriorityPrepare, Plugin, registerPlugin, logger } from '@galacean/effects';
11
11
 
12
12
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
13
  try {
@@ -58,6 +58,74 @@ function _inherits(subClass, superClass) {
58
58
  if (superClass) _set_prototype_of(subClass, superClass);
59
59
  }
60
60
 
61
+ function _is_native_reflect_construct() {
62
+ // Since Reflect.construct can't be properly polyfilled, some
63
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
64
+ // Those polyfills don't allow us to subclass built-ins, so we need to
65
+ // use our fallback implementation.
66
+ try {
67
+ // If the internal slots aren't set, this throws an error similar to
68
+ // TypeError: this is not a Boolean object.
69
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
70
+ } catch (_) {}
71
+ return (_is_native_reflect_construct = function _is_native_reflect_construct() {
72
+ return !!result;
73
+ })();
74
+ }
75
+
76
+ function _construct(Parent, args, Class) {
77
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
78
+ else {
79
+ _construct = function construct(Parent, args, Class) {
80
+ var a = [
81
+ null
82
+ ];
83
+ a.push.apply(a, args);
84
+ var Constructor = Function.bind.apply(Parent, a);
85
+ var instance = new Constructor();
86
+ if (Class) _set_prototype_of(instance, Class.prototype);
87
+ return instance;
88
+ };
89
+ }
90
+ return _construct.apply(null, arguments);
91
+ }
92
+
93
+ function _get_prototype_of(o) {
94
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
95
+ return o.__proto__ || Object.getPrototypeOf(o);
96
+ };
97
+ return _get_prototype_of(o);
98
+ }
99
+
100
+ function _is_native_function(fn) {
101
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
102
+ }
103
+
104
+ function _wrap_native_super(Class) {
105
+ var _cache = typeof Map === "function" ? new Map() : undefined;
106
+ _wrap_native_super = function _wrap_native_super(Class) {
107
+ if (Class === null || !_is_native_function(Class)) return Class;
108
+ if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
109
+ if (typeof _cache !== "undefined") {
110
+ if (_cache.has(Class)) return _cache.get(Class);
111
+ _cache.set(Class, Wrapper);
112
+ }
113
+ function Wrapper() {
114
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
115
+ }
116
+ Wrapper.prototype = Object.create(Class.prototype, {
117
+ constructor: {
118
+ value: Wrapper,
119
+ enumerable: false,
120
+ writable: true,
121
+ configurable: true
122
+ }
123
+ });
124
+ return _set_prototype_of(Wrapper, Class);
125
+ };
126
+ return _wrap_native_super(Class);
127
+ }
128
+
61
129
  function _array_like_to_array(arr, len) {
62
130
  if (len == null || len > arr.length) len = arr.length;
63
131
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -3560,16 +3628,16 @@ var DrawGizmoEditorPass = /*#__PURE__*/ function(RenderPass) {
3560
3628
 
3561
3629
  var iconImages = new Map();
3562
3630
  var iconTextures = new Map();
3563
- var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3564
- _inherits(EditorGizmoPlugin, AbstractPlugin);
3631
+ var EditorGizmoPlugin = /*#__PURE__*/ function(Plugin) {
3632
+ _inherits(EditorGizmoPlugin, Plugin);
3565
3633
  function EditorGizmoPlugin() {
3566
3634
  var _this;
3567
- _this = AbstractPlugin.apply(this, arguments) || this;
3635
+ _this = Plugin.apply(this, arguments) || this;
3568
3636
  _this.order = 1001;
3569
3637
  return _this;
3570
3638
  }
3571
3639
  var _proto = EditorGizmoPlugin.prototype;
3572
- _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {
3640
+ _proto.onCompositionCreated = function onCompositionCreated(composition, scene) {
3573
3641
  return _async_to_generator(function() {
3574
3642
  var engine, _iterator, _step, _step_value, name, data, _, _tmp, items, targetMap, i, item, gizmoComponent;
3575
3643
  return __generator(this, function(_state) {
@@ -3634,12 +3702,12 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3634
3702
  })();
3635
3703
  };
3636
3704
  return EditorGizmoPlugin;
3637
- }(AbstractPlugin);
3705
+ }(_wrap_native_super(Plugin));
3638
3706
 
3639
3707
  registerPlugin("editor-gizmo", EditorGizmoPlugin);
3640
3708
  /**
3641
3709
  * 插件版本号
3642
- */ var version = "2.8.0-alpha.2";
3710
+ */ var version = "2.8.0-alpha.4";
3643
3711
  logger.info("Plugin editor gizmo version: " + version + ".");
3644
3712
  if (version !== EFFECTS.version) {
3645
3713
  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!");