@eva/plugin-renderer-spine 1.2.7-editor.9 → 1.2.8-alpha.0
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,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
window.EVA = window.EVA || {};
|
|
4
4
|
window.EVA.plugin = window.EVA.plugin || {};
|
|
@@ -7,23 +7,21 @@ window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
|
|
|
7
7
|
var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
var _extendStatics$ = function extendStatics$
|
|
10
|
+
var _extendStatics$ = function extendStatics$1(d, b) {
|
|
11
11
|
_extendStatics$ = Object.setPrototypeOf || {
|
|
12
12
|
__proto__: []
|
|
13
13
|
} instanceof Array && function (d, b) {
|
|
14
14
|
d.__proto__ = b;
|
|
15
15
|
} || function (d, b) {
|
|
16
16
|
for (var p in b) {
|
|
17
|
-
if (
|
|
17
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
return _extendStatics$(d, b);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
function __extends$
|
|
25
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
|
-
|
|
24
|
+
function __extends$2(d, b) {
|
|
27
25
|
_extendStatics$(d, b);
|
|
28
26
|
|
|
29
27
|
function __() {
|
|
@@ -33,159 +31,27 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
33
31
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} instanceof Array && function (d, b) {
|
|
40
|
-
d.__proto__ = b;
|
|
41
|
-
} || function (d, b) {
|
|
42
|
-
for (var p in b) {
|
|
43
|
-
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return _extendStatics$2(d, b);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
function __extends$2(d, b) {
|
|
51
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
52
|
-
|
|
53
|
-
_extendStatics$2(d, b);
|
|
54
|
-
|
|
55
|
-
function __() {
|
|
56
|
-
this.constructor = d;
|
|
34
|
+
function getIDEPropsPropertyObj(target, propertyKey) {
|
|
35
|
+
if (!target.constructor.IDEProps) {
|
|
36
|
+
target.constructor.IDEProps = {};
|
|
57
37
|
}
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var _assign$ = function __assign$1() {
|
|
63
|
-
_assign$ = Object.assign || function __assign(t) {
|
|
64
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
65
|
-
s = arguments[i];
|
|
66
|
-
|
|
67
|
-
for (var p in s) {
|
|
68
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return t;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return _assign$.apply(this, arguments);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
var SymbolKeysNotSupportedError = function (_super) {
|
|
79
|
-
__extends$2(SymbolKeysNotSupportedError, _super);
|
|
80
|
-
|
|
81
|
-
function SymbolKeysNotSupportedError() {
|
|
82
|
-
var _newTarget = this.constructor;
|
|
83
|
-
|
|
84
|
-
var _this = _super.call(this, 'Symbol keys are not supported yet!') || this;
|
|
85
|
-
|
|
86
|
-
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
87
|
-
return _this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return SymbolKeysNotSupportedError;
|
|
91
|
-
}(Error);
|
|
92
|
-
|
|
93
|
-
(function (_super) {
|
|
94
|
-
__extends$2(StaticGetPropertiesIsNotAFunctionError, _super);
|
|
95
|
-
|
|
96
|
-
function StaticGetPropertiesIsNotAFunctionError() {
|
|
97
|
-
var _newTarget = this.constructor;
|
|
98
|
-
|
|
99
|
-
var _this = _super.call(this, 'getProperties is not a function!') || this;
|
|
100
|
-
|
|
101
|
-
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
102
|
-
return _this;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return StaticGetPropertiesIsNotAFunctionError;
|
|
106
|
-
})(Error);
|
|
107
|
-
|
|
108
|
-
var IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
|
|
109
|
-
|
|
110
|
-
function transformBasicType(type) {
|
|
111
|
-
if (type === String) {
|
|
112
|
-
return 'string';
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (type === Number) {
|
|
116
|
-
return 'number';
|
|
39
|
+
if (!target.constructor.IDEProps[propertyKey]) {
|
|
40
|
+
target.constructor.IDEProps[propertyKey] = {};
|
|
117
41
|
}
|
|
118
42
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return 'unknown';
|
|
43
|
+
var propertyObj = target.constructor.IDEProps[propertyKey];
|
|
44
|
+
return propertyObj;
|
|
124
45
|
}
|
|
125
46
|
|
|
126
|
-
function
|
|
127
|
-
var type = Reflect.getMetadata('design:type', target, key);
|
|
128
|
-
var isArray = type === Array;
|
|
129
|
-
var str = transformBasicType(type);
|
|
130
|
-
|
|
131
|
-
if (str !== 'unknown') {
|
|
132
|
-
type = str;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (returnTypeFunction) {
|
|
136
|
-
var returnType = returnTypeFunction();
|
|
137
|
-
|
|
138
|
-
if (Array.isArray(returnType)) {
|
|
139
|
-
isArray = true;
|
|
140
|
-
type = returnType[0];
|
|
141
|
-
} else {
|
|
142
|
-
type = returnType;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
var properties = Reflect.getMetadata(IDE_PROPERTY_METADATA, target.constructor) || {};
|
|
147
|
-
properties[key] = _assign$({
|
|
148
|
-
type: type,
|
|
149
|
-
isArray: isArray
|
|
150
|
-
}, options);
|
|
151
|
-
Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
155
|
-
if (typeof returnTypeFuncOrOptions === 'function') {
|
|
156
|
-
return {
|
|
157
|
-
returnTypeFunc: returnTypeFuncOrOptions,
|
|
158
|
-
options: maybeOptions || {}
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return {
|
|
163
|
-
options: returnTypeFuncOrOptions || {}
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function Field(returnTypeFunction, maybeOptions) {
|
|
47
|
+
function type(type) {
|
|
168
48
|
return function (target, propertyKey) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
var _a = getTypeDecoratorParams(returnTypeFunction, maybeOptions),
|
|
174
|
-
options = _a.options,
|
|
175
|
-
returnTypeFunc = _a.returnTypeFunc;
|
|
176
|
-
|
|
177
|
-
defineTypes(target, propertyKey, options, returnTypeFunc);
|
|
49
|
+
var prop = getIDEPropsPropertyObj(target, propertyKey);
|
|
50
|
+
prop.key = propertyKey;
|
|
51
|
+
prop.type = type;
|
|
178
52
|
};
|
|
179
53
|
}
|
|
180
54
|
|
|
181
|
-
var ExecuteMode;
|
|
182
|
-
|
|
183
|
-
(function (ExecuteMode) {
|
|
184
|
-
ExecuteMode[ExecuteMode["Edit"] = 2] = "Edit";
|
|
185
|
-
ExecuteMode[ExecuteMode["Game"] = 4] = "Game";
|
|
186
|
-
ExecuteMode[ExecuteMode["All"] = 6] = "All";
|
|
187
|
-
})(ExecuteMode || (ExecuteMode = {}));
|
|
188
|
-
|
|
189
55
|
var _extendStatics = function extendStatics(d, b) {
|
|
190
56
|
_extendStatics = Object.setPrototypeOf || {
|
|
191
57
|
__proto__: []
|
|
@@ -210,22 +76,6 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
210
76
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
211
77
|
}
|
|
212
78
|
|
|
213
|
-
var _assign = function __assign() {
|
|
214
|
-
_assign = Object.assign || function __assign(t) {
|
|
215
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
216
|
-
s = arguments[i];
|
|
217
|
-
|
|
218
|
-
for (var p in s) {
|
|
219
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return t;
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
return _assign.apply(this, arguments);
|
|
227
|
-
};
|
|
228
|
-
|
|
229
79
|
function __decorate(decorators, target, key, desc) {
|
|
230
80
|
var c = arguments.length,
|
|
231
81
|
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
@@ -236,10 +86,6 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
236
86
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
237
87
|
}
|
|
238
88
|
|
|
239
|
-
function __metadata(metadataKey, metadataValue) {
|
|
240
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
89
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
244
90
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
245
91
|
function fulfilled(value) {
|
|
@@ -394,12 +240,6 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
394
240
|
};
|
|
395
241
|
}
|
|
396
242
|
|
|
397
|
-
var sleep = function sleep(time) {
|
|
398
|
-
return new Promise(function (resolve) {
|
|
399
|
-
return setTimeout(resolve, time);
|
|
400
|
-
});
|
|
401
|
-
};
|
|
402
|
-
|
|
403
243
|
var Spine$2 = function (_super) {
|
|
404
244
|
__extends$1(Spine, _super);
|
|
405
245
|
|
|
@@ -565,47 +405,11 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
565
405
|
|
|
566
406
|
Spine.componentName = 'Spine';
|
|
567
407
|
|
|
568
|
-
__decorate([
|
|
569
|
-
type: 'resource'
|
|
570
|
-
}), __metadata("design:type", String)], Spine.prototype, "resource", void 0);
|
|
571
|
-
|
|
572
|
-
__decorate([Field({
|
|
573
|
-
type: 'selector',
|
|
574
|
-
options: function options(that) {
|
|
575
|
-
var _a, _b, _c;
|
|
576
|
-
|
|
577
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
578
|
-
var animations;
|
|
579
|
-
return __generator(this, function (_d) {
|
|
580
|
-
switch (_d.label) {
|
|
581
|
-
case 0:
|
|
582
|
-
return [4, sleep(0)];
|
|
408
|
+
__decorate([type('string')], Spine.prototype, "resource", void 0);
|
|
583
409
|
|
|
584
|
-
|
|
585
|
-
_d.sent();
|
|
410
|
+
__decorate([type('string')], Spine.prototype, "animationName", void 0);
|
|
586
411
|
|
|
587
|
-
|
|
588
|
-
return [2, {}];
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
return [4, eva_js.resource.promiseMap[that.resource]];
|
|
592
|
-
|
|
593
|
-
case 2:
|
|
594
|
-
_d.sent();
|
|
595
|
-
|
|
596
|
-
animations = (_c = (_b = (_a = eva_js.resource.resourcesMap[that.resource]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.ske) === null || _c === void 0 ? void 0 : _c.animations;
|
|
597
|
-
return [2, animations ? Object.keys(animations).reduce(function (prev, key) {
|
|
598
|
-
var _a;
|
|
599
|
-
|
|
600
|
-
return _assign(_assign({}, prev), (_a = {}, _a[key] = key, _a));
|
|
601
|
-
}, {}) : {}];
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
}), __metadata("design:type", String)], Spine.prototype, "animationName", void 0);
|
|
607
|
-
|
|
608
|
-
__decorate([Field(), __metadata("design:type", Boolean)], Spine.prototype, "autoPlay", void 0);
|
|
412
|
+
__decorate([type('boolean')], Spine.prototype, "autoPlay", void 0);
|
|
609
413
|
|
|
610
414
|
return Spine;
|
|
611
415
|
}(eva_js.Component);
|
|
@@ -9772,9 +9576,9 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
9772
9576
|
var cachedResource = loader.resources[name];
|
|
9773
9577
|
|
|
9774
9578
|
if (cachedResource) {
|
|
9775
|
-
function done() {
|
|
9579
|
+
var done = function done() {
|
|
9776
9580
|
callback(cachedResource.texture.baseTexture);
|
|
9777
|
-
}
|
|
9581
|
+
};
|
|
9778
9582
|
|
|
9779
9583
|
if (cachedResource.texture) {
|
|
9780
9584
|
done();
|
|
@@ -9825,7 +9629,7 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
9825
9629
|
var pixiSpine = pixi_spine;
|
|
9826
9630
|
|
|
9827
9631
|
var SpineSystem = function (_super) {
|
|
9828
|
-
__extends$
|
|
9632
|
+
__extends$2(SpineSystem, _super);
|
|
9829
9633
|
|
|
9830
9634
|
function SpineSystem() {
|
|
9831
9635
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -9843,7 +9647,7 @@ var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
9843
9647
|
var SpineSystem$1 = SpineSystem;
|
|
9844
9648
|
|
|
9845
9649
|
var Spine = function (_super) {
|
|
9846
|
-
__extends$
|
|
9650
|
+
__extends$2(Spine, _super);
|
|
9847
9651
|
|
|
9848
9652
|
function Spine() {
|
|
9849
9653
|
return _super !== null && _super.apply(this, arguments) || this;
|