@eva/plugin-renderer-text 1.2.7-editor.8 → 1.2.7-fix.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/EVA.plugin.renderer.text.js +29 -378
- package/dist/EVA.plugin.renderer.text.min.js +1 -1
- package/dist/miniprogram.js +103 -0
- package/dist/plugin-renderer-text.cjs.js +1 -165
- package/dist/plugin-renderer-text.cjs.prod.js +1 -1
- package/dist/plugin-renderer-text.d.ts +32 -34
- package/dist/plugin-renderer-text.esm.js +2 -166
- package/package.json +5 -5
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
window.EVA = window.EVA || {};
|
|
4
3
|
window.EVA.plugin = window.EVA.plugin || {};
|
|
5
4
|
window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
|
|
6
|
-
|
|
7
5
|
var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendererAdapter) {
|
|
8
6
|
'use strict';
|
|
9
7
|
|
|
@@ -14,62 +12,33 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
14
12
|
d.__proto__ = b;
|
|
15
13
|
} || function (d, b) {
|
|
16
14
|
for (var p in b) {
|
|
17
|
-
if (
|
|
15
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
18
16
|
}
|
|
19
17
|
};
|
|
20
|
-
|
|
21
18
|
return _extendStatics(d, b);
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
function __extends(d, b) {
|
|
25
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
|
-
|
|
27
21
|
_extendStatics(d, b);
|
|
28
|
-
|
|
29
22
|
function __() {
|
|
30
23
|
this.constructor = d;
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
var _assign = function __assign() {
|
|
37
|
-
_assign = Object.assign || function __assign(t) {
|
|
38
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39
|
-
s = arguments[i];
|
|
40
|
-
|
|
41
|
-
for (var p in s) {
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return t;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return _assign.apply(this, arguments);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
27
|
function __decorate(decorators, target, key, desc) {
|
|
53
28
|
var c = arguments.length,
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
30
|
+
d;
|
|
56
31
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
57
32
|
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
58
33
|
}
|
|
59
34
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
60
35
|
}
|
|
61
|
-
|
|
62
|
-
function __metadata(metadataKey, metadataValue) {
|
|
63
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
36
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
67
37
|
function adopt(value) {
|
|
68
38
|
return value instanceof P ? value : new P(function (resolve) {
|
|
69
39
|
resolve(value);
|
|
70
40
|
});
|
|
71
41
|
}
|
|
72
|
-
|
|
73
42
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
74
43
|
function fulfilled(value) {
|
|
75
44
|
try {
|
|
@@ -78,7 +47,6 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
78
47
|
reject(e);
|
|
79
48
|
}
|
|
80
49
|
}
|
|
81
|
-
|
|
82
50
|
function rejected(value) {
|
|
83
51
|
try {
|
|
84
52
|
step(generator["throw"](value));
|
|
@@ -86,29 +54,26 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
86
54
|
reject(e);
|
|
87
55
|
}
|
|
88
56
|
}
|
|
89
|
-
|
|
90
57
|
function step(result) {
|
|
91
58
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
92
59
|
}
|
|
93
|
-
|
|
94
60
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
61
|
});
|
|
96
62
|
}
|
|
97
|
-
|
|
98
63
|
function __generator(thisArg, body) {
|
|
99
64
|
var _ = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
65
|
+
label: 0,
|
|
66
|
+
sent: function sent() {
|
|
67
|
+
if (t[0] & 1) throw t[1];
|
|
68
|
+
return t[1];
|
|
69
|
+
},
|
|
70
|
+
trys: [],
|
|
71
|
+
ops: []
|
|
104
72
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
y,
|
|
110
|
-
t,
|
|
111
|
-
g;
|
|
73
|
+
f,
|
|
74
|
+
y,
|
|
75
|
+
t,
|
|
76
|
+
g;
|
|
112
77
|
return g = {
|
|
113
78
|
next: verb(0),
|
|
114
79
|
"throw": verb(1),
|
|
@@ -116,79 +81,60 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
116
81
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
117
82
|
return this;
|
|
118
83
|
}), g;
|
|
119
|
-
|
|
120
84
|
function verb(n) {
|
|
121
85
|
return function (v) {
|
|
122
86
|
return step([n, v]);
|
|
123
87
|
};
|
|
124
88
|
}
|
|
125
|
-
|
|
126
89
|
function step(op) {
|
|
127
90
|
if (f) throw new TypeError("Generator is already executing.");
|
|
128
|
-
|
|
129
91
|
while (_) {
|
|
130
92
|
try {
|
|
131
93
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
132
94
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
133
|
-
|
|
134
95
|
switch (op[0]) {
|
|
135
96
|
case 0:
|
|
136
97
|
case 1:
|
|
137
98
|
t = op;
|
|
138
99
|
break;
|
|
139
|
-
|
|
140
100
|
case 4:
|
|
141
101
|
_.label++;
|
|
142
102
|
return {
|
|
143
103
|
value: op[1],
|
|
144
104
|
done: false
|
|
145
105
|
};
|
|
146
|
-
|
|
147
106
|
case 5:
|
|
148
107
|
_.label++;
|
|
149
108
|
y = op[1];
|
|
150
109
|
op = [0];
|
|
151
110
|
continue;
|
|
152
|
-
|
|
153
111
|
case 7:
|
|
154
112
|
op = _.ops.pop();
|
|
155
|
-
|
|
156
113
|
_.trys.pop();
|
|
157
|
-
|
|
158
114
|
continue;
|
|
159
|
-
|
|
160
115
|
default:
|
|
161
116
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
162
117
|
_ = 0;
|
|
163
118
|
continue;
|
|
164
119
|
}
|
|
165
|
-
|
|
166
120
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
167
121
|
_.label = op[1];
|
|
168
122
|
break;
|
|
169
123
|
}
|
|
170
|
-
|
|
171
124
|
if (op[0] === 6 && _.label < t[1]) {
|
|
172
125
|
_.label = t[1];
|
|
173
126
|
t = op;
|
|
174
127
|
break;
|
|
175
128
|
}
|
|
176
|
-
|
|
177
129
|
if (t && _.label < t[2]) {
|
|
178
130
|
_.label = t[2];
|
|
179
|
-
|
|
180
131
|
_.ops.push(op);
|
|
181
|
-
|
|
182
132
|
break;
|
|
183
133
|
}
|
|
184
|
-
|
|
185
134
|
if (t[2]) _.ops.pop();
|
|
186
|
-
|
|
187
135
|
_.trys.pop();
|
|
188
|
-
|
|
189
136
|
continue;
|
|
190
137
|
}
|
|
191
|
-
|
|
192
138
|
op = body.call(thisArg, _);
|
|
193
139
|
} catch (e) {
|
|
194
140
|
op = [6, e];
|
|
@@ -197,7 +143,6 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
197
143
|
f = t = 0;
|
|
198
144
|
}
|
|
199
145
|
}
|
|
200
|
-
|
|
201
146
|
if (op[0] & 5) throw op[1];
|
|
202
147
|
return {
|
|
203
148
|
value: op[0] ? op[1] : void 0,
|
|
@@ -205,356 +150,69 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
205
150
|
};
|
|
206
151
|
}
|
|
207
152
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
function SymbolKeysNotSupportedError() {
|
|
213
|
-
var _newTarget = this.constructor;
|
|
214
|
-
|
|
215
|
-
var _this = _super.call(this, 'Symbol keys are not supported yet!') || this;
|
|
216
|
-
|
|
217
|
-
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
218
|
-
return _this;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return SymbolKeysNotSupportedError;
|
|
222
|
-
}(Error);
|
|
223
|
-
|
|
224
|
-
(function (_super) {
|
|
225
|
-
__extends(StaticGetPropertiesIsNotAFunctionError, _super);
|
|
226
|
-
|
|
227
|
-
function StaticGetPropertiesIsNotAFunctionError() {
|
|
228
|
-
var _newTarget = this.constructor;
|
|
229
|
-
|
|
230
|
-
var _this = _super.call(this, 'getProperties is not a function!') || this;
|
|
231
|
-
|
|
232
|
-
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
233
|
-
return _this;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return StaticGetPropertiesIsNotAFunctionError;
|
|
237
|
-
})(Error);
|
|
238
|
-
|
|
239
|
-
var IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
|
|
240
|
-
|
|
241
|
-
function transformBasicType(type) {
|
|
242
|
-
if (type === String) {
|
|
243
|
-
return 'string';
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (type === Number) {
|
|
247
|
-
return 'number';
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (type === Boolean) {
|
|
251
|
-
return 'boolean';
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return 'unknown';
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function defineTypes(target, key, options, returnTypeFunction) {
|
|
258
|
-
var type = Reflect.getMetadata('design:type', target, key);
|
|
259
|
-
var isArray = type === Array;
|
|
260
|
-
var str = transformBasicType(type);
|
|
261
|
-
|
|
262
|
-
if (str !== 'unknown') {
|
|
263
|
-
type = str;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (returnTypeFunction) {
|
|
267
|
-
var returnType = returnTypeFunction();
|
|
268
|
-
|
|
269
|
-
if (Array.isArray(returnType)) {
|
|
270
|
-
isArray = true;
|
|
271
|
-
type = returnType[0];
|
|
272
|
-
} else {
|
|
273
|
-
type = returnType;
|
|
274
|
-
}
|
|
153
|
+
function getIDEPropsPropertyObj(target, propertyKey) {
|
|
154
|
+
if (!target.constructor.IDEProps) {
|
|
155
|
+
target.constructor.IDEProps = {};
|
|
275
156
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
properties[key] = _assign({
|
|
279
|
-
type: type,
|
|
280
|
-
isArray: isArray
|
|
281
|
-
}, options);
|
|
282
|
-
Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
286
|
-
if (typeof returnTypeFuncOrOptions === 'function') {
|
|
287
|
-
return {
|
|
288
|
-
returnTypeFunc: returnTypeFuncOrOptions,
|
|
289
|
-
options: maybeOptions || {}
|
|
290
|
-
};
|
|
157
|
+
if (!target.constructor.IDEProps[propertyKey]) {
|
|
158
|
+
target.constructor.IDEProps[propertyKey] = {};
|
|
291
159
|
}
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
options: returnTypeFuncOrOptions || {}
|
|
295
|
-
};
|
|
160
|
+
var propertyObj = target.constructor.IDEProps[propertyKey];
|
|
161
|
+
return propertyObj;
|
|
296
162
|
}
|
|
297
|
-
|
|
298
|
-
function Field(returnTypeFunction, maybeOptions) {
|
|
163
|
+
function type(type) {
|
|
299
164
|
return function (target, propertyKey) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
var _a = getTypeDecoratorParams(returnTypeFunction, maybeOptions),
|
|
305
|
-
options = _a.options,
|
|
306
|
-
returnTypeFunc = _a.returnTypeFunc;
|
|
307
|
-
|
|
308
|
-
defineTypes(target, propertyKey, options, returnTypeFunc);
|
|
165
|
+
var prop = getIDEPropsPropertyObj(target, propertyKey);
|
|
166
|
+
prop.key = propertyKey;
|
|
167
|
+
prop.type = type;
|
|
309
168
|
};
|
|
310
169
|
}
|
|
311
|
-
|
|
312
|
-
var ExecuteMode;
|
|
313
|
-
|
|
314
|
-
(function (ExecuteMode) {
|
|
315
|
-
ExecuteMode[ExecuteMode["Edit"] = 2] = "Edit";
|
|
316
|
-
ExecuteMode[ExecuteMode["Game"] = 4] = "Game";
|
|
317
|
-
ExecuteMode[ExecuteMode["All"] = 6] = "All";
|
|
318
|
-
})(ExecuteMode || (ExecuteMode = {}));
|
|
319
|
-
|
|
320
|
-
var Color = function () {
|
|
321
|
-
function Color() {}
|
|
322
|
-
|
|
323
|
-
Color.getProperties = function () {
|
|
324
|
-
return 'color';
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
return Color;
|
|
328
|
-
}();
|
|
329
|
-
|
|
330
|
-
var Style = function () {
|
|
331
|
-
function Style() {}
|
|
332
|
-
|
|
333
|
-
__decorate([Field({
|
|
334
|
-
type: 'selector',
|
|
335
|
-
isArray: false,
|
|
336
|
-
options: ['center', 'left', 'right'],
|
|
337
|
-
default: 'left'
|
|
338
|
-
}), __metadata("design:type", String)], Style.prototype, "align", void 0);
|
|
339
|
-
|
|
340
|
-
__decorate([Field(), __metadata("design:type", Boolean)], Style.prototype, "breakWords", void 0);
|
|
341
|
-
|
|
342
|
-
__decorate([Field(), __metadata("design:type", Boolean)], Style.prototype, "dropShadow", void 0);
|
|
343
|
-
|
|
344
|
-
__decorate([Field({
|
|
345
|
-
default: 1
|
|
346
|
-
}), __metadata("design:type", Number)], Style.prototype, "dropShadowAlpha", void 0);
|
|
347
|
-
|
|
348
|
-
__decorate([Field({
|
|
349
|
-
default: Math.PI / 6
|
|
350
|
-
}), __metadata("design:type", Number)], Style.prototype, "dropShadowAngle", void 0);
|
|
351
|
-
|
|
352
|
-
__decorate([Field({
|
|
353
|
-
default: 0
|
|
354
|
-
}), __metadata("design:type", Number)], Style.prototype, "dropShadowBlur", void 0);
|
|
355
|
-
|
|
356
|
-
__decorate([Field(function () {
|
|
357
|
-
return Color;
|
|
358
|
-
}, {
|
|
359
|
-
default: '#000000'
|
|
360
|
-
}), __metadata("design:type", Object)], Style.prototype, "dropShadowColor", void 0);
|
|
361
|
-
|
|
362
|
-
__decorate([Field({
|
|
363
|
-
default: 5
|
|
364
|
-
}), __metadata("design:type", Number)], Style.prototype, "dropShadowDistance", void 0);
|
|
365
|
-
|
|
366
|
-
__decorate([Field(function () {
|
|
367
|
-
return [Color];
|
|
368
|
-
}, {
|
|
369
|
-
default: ['#000000']
|
|
370
|
-
}), __metadata("design:type", Object)], Style.prototype, "fill", void 0);
|
|
371
|
-
|
|
372
|
-
__decorate([Field({
|
|
373
|
-
type: 'selector',
|
|
374
|
-
options: {
|
|
375
|
-
vertical: 1,
|
|
376
|
-
horizontal: 0
|
|
377
|
-
},
|
|
378
|
-
default: 1,
|
|
379
|
-
filter: function filter(val) {
|
|
380
|
-
return Number(val);
|
|
381
|
-
},
|
|
382
|
-
isArray: false
|
|
383
|
-
}), __metadata("design:type", Number)], Style.prototype, "fillGradientType", void 0);
|
|
384
|
-
|
|
385
|
-
__decorate([Field(function () {
|
|
386
|
-
return Number;
|
|
387
|
-
}, {
|
|
388
|
-
step: 0.1,
|
|
389
|
-
min: 0,
|
|
390
|
-
max: 1
|
|
391
|
-
}), __metadata("design:type", Array)], Style.prototype, "fillGradientStops", void 0);
|
|
392
|
-
|
|
393
|
-
__decorate([Field(function () {
|
|
394
|
-
return String;
|
|
395
|
-
}, {
|
|
396
|
-
default: 'Arial'
|
|
397
|
-
}), __metadata("design:type", Object)], Style.prototype, "fontFamily", void 0);
|
|
398
|
-
|
|
399
|
-
__decorate([Field(function () {
|
|
400
|
-
return Number;
|
|
401
|
-
}, {
|
|
402
|
-
min: 5,
|
|
403
|
-
default: 26
|
|
404
|
-
}), __metadata("design:type", Object)], Style.prototype, "fontSize", void 0);
|
|
405
|
-
|
|
406
|
-
__decorate([Field({
|
|
407
|
-
type: 'selector',
|
|
408
|
-
options: ['normal', 'italic', 'oblique'],
|
|
409
|
-
default: 'normal'
|
|
410
|
-
}), __metadata("design:type", String)], Style.prototype, "fontStyle", void 0);
|
|
411
|
-
|
|
412
|
-
__decorate([Field({
|
|
413
|
-
type: 'selector',
|
|
414
|
-
options: ['normal', 'small-caps'],
|
|
415
|
-
default: 'normal'
|
|
416
|
-
}), __metadata("design:type", String)], Style.prototype, "fontVariant", void 0);
|
|
417
|
-
|
|
418
|
-
__decorate([Field({
|
|
419
|
-
type: 'selector',
|
|
420
|
-
options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
421
|
-
default: 'normal'
|
|
422
|
-
}), __metadata("design:type", String)], Style.prototype, "fontWeight", void 0);
|
|
423
|
-
|
|
424
|
-
__decorate([Field({
|
|
425
|
-
default: 0
|
|
426
|
-
}), __metadata("design:type", Number)], Style.prototype, "letterSpacing", void 0);
|
|
427
|
-
|
|
428
|
-
__decorate([Field({
|
|
429
|
-
default: 0
|
|
430
|
-
}), __metadata("design:type", Number)], Style.prototype, "lineHeight", void 0);
|
|
431
|
-
|
|
432
|
-
__decorate([Field({
|
|
433
|
-
type: 'selector',
|
|
434
|
-
options: ['miter', 'round', 'bevel'],
|
|
435
|
-
default: 'miter'
|
|
436
|
-
}), __metadata("design:type", String)], Style.prototype, "lineJoin", void 0);
|
|
437
|
-
|
|
438
|
-
__decorate([Field({
|
|
439
|
-
default: 10
|
|
440
|
-
}), __metadata("design:type", Number)], Style.prototype, "miterLimit", void 0);
|
|
441
|
-
|
|
442
|
-
__decorate([Field({
|
|
443
|
-
default: 0
|
|
444
|
-
}), __metadata("design:type", Number)], Style.prototype, "padding", void 0);
|
|
445
|
-
|
|
446
|
-
__decorate([Field(function () {
|
|
447
|
-
return Color;
|
|
448
|
-
}, {
|
|
449
|
-
default: '#000000'
|
|
450
|
-
}), __metadata("design:type", Object)], Style.prototype, "stroke", void 0);
|
|
451
|
-
|
|
452
|
-
__decorate([Field({
|
|
453
|
-
default: 0,
|
|
454
|
-
min: 0
|
|
455
|
-
}), __metadata("design:type", Number)], Style.prototype, "strokeThickness", void 0);
|
|
456
|
-
|
|
457
|
-
__decorate([Field({
|
|
458
|
-
default: 'alphabetic'
|
|
459
|
-
}), __metadata("design:type", String)], Style.prototype, "textBaseline", void 0);
|
|
460
|
-
|
|
461
|
-
__decorate([Field(), __metadata("design:type", Boolean)], Style.prototype, "trim", void 0);
|
|
462
|
-
|
|
463
|
-
__decorate([Field({
|
|
464
|
-
default: 'pre',
|
|
465
|
-
type: 'selector',
|
|
466
|
-
options: ['normal', 'pre', 'pre-line']
|
|
467
|
-
}), __metadata("design:type", String)], Style.prototype, "whiteSpace", void 0);
|
|
468
|
-
|
|
469
|
-
__decorate([Field(), __metadata("design:type", Boolean)], Style.prototype, "wordWrap", void 0);
|
|
470
|
-
|
|
471
|
-
__decorate([Field({
|
|
472
|
-
default: 100
|
|
473
|
-
}), __metadata("design:type", Number)], Style.prototype, "wordWrapWidth", void 0);
|
|
474
|
-
|
|
475
|
-
__decorate([Field(), __metadata("design:type", Number)], Style.prototype, "leading", void 0);
|
|
476
|
-
|
|
477
|
-
return Style;
|
|
478
|
-
}();
|
|
479
|
-
|
|
480
170
|
var Text$2 = function (_super) {
|
|
481
171
|
__extends(Text, _super);
|
|
482
|
-
|
|
483
172
|
function Text() {
|
|
484
173
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
485
|
-
|
|
486
174
|
_this.text = '';
|
|
487
175
|
_this.style = {};
|
|
488
176
|
return _this;
|
|
489
177
|
}
|
|
490
|
-
|
|
491
178
|
Text.prototype.init = function (obj) {
|
|
492
179
|
var style = new pixi_js.TextStyle({
|
|
493
180
|
fontSize: 20
|
|
494
181
|
});
|
|
495
182
|
var newStyle = {};
|
|
496
|
-
|
|
497
183
|
for (var key in style) {
|
|
498
184
|
if (key.indexOf('_') === 0) {
|
|
499
185
|
newStyle[key.substring(1)] = style[key];
|
|
500
186
|
}
|
|
501
187
|
}
|
|
502
|
-
|
|
503
188
|
this.style = newStyle;
|
|
504
|
-
|
|
505
189
|
if (obj) {
|
|
506
190
|
this.text = obj.text;
|
|
507
|
-
|
|
508
191
|
_extends(this.style, obj.style);
|
|
509
192
|
}
|
|
510
193
|
};
|
|
511
|
-
|
|
512
194
|
Text.componentName = 'Text';
|
|
513
|
-
|
|
514
|
-
__decorate([Field({
|
|
515
|
-
type: 'textarea',
|
|
516
|
-
filter: function filter(text) {
|
|
517
|
-
if (typeof text !== 'string') {
|
|
518
|
-
return '';
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
if (text.length > 100) {
|
|
522
|
-
return text.slice(0, 100);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
return text;
|
|
526
|
-
}
|
|
527
|
-
}), __metadata("design:type", String)], Text.prototype, "text", void 0);
|
|
528
|
-
|
|
529
|
-
__decorate([Field(), __metadata("design:type", Style)], Text.prototype, "style", void 0);
|
|
530
|
-
|
|
195
|
+
__decorate([type('string')], Text.prototype, "text", void 0);
|
|
531
196
|
return Text;
|
|
532
197
|
}(eva_js.Component);
|
|
533
|
-
|
|
534
198
|
var Text$3 = Text$2;
|
|
535
|
-
|
|
536
199
|
var Text = function (_super) {
|
|
537
200
|
__extends(Text, _super);
|
|
538
|
-
|
|
539
201
|
function Text() {
|
|
540
202
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
541
|
-
|
|
542
203
|
_this.name = 'Text';
|
|
543
204
|
_this.texts = {};
|
|
544
205
|
return _this;
|
|
545
206
|
}
|
|
546
|
-
|
|
547
207
|
Text.prototype.init = function () {
|
|
548
208
|
this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
|
|
549
209
|
this.renderSystem.rendererManager.register(this);
|
|
550
210
|
};
|
|
551
|
-
|
|
552
211
|
Text.prototype.componentChanged = function (changed) {
|
|
553
212
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
213
|
var component, text;
|
|
555
214
|
return __generator(this, function (_a) {
|
|
556
215
|
if (changed.componentName !== 'Text') return [2];
|
|
557
|
-
|
|
558
216
|
if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
|
|
559
217
|
component = changed.component;
|
|
560
218
|
text = new rendererAdapter.Text(component.text, component.style);
|
|
@@ -574,31 +232,26 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
574
232
|
this.change(changed);
|
|
575
233
|
this.setSize(changed);
|
|
576
234
|
}
|
|
577
|
-
|
|
578
235
|
return [2];
|
|
579
236
|
});
|
|
580
237
|
});
|
|
581
238
|
};
|
|
582
|
-
|
|
583
239
|
Text.prototype.change = function (changed) {
|
|
584
240
|
var _a = this.texts[changed.gameObject.id],
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
241
|
+
text = _a.text,
|
|
242
|
+
component = _a.component;
|
|
588
243
|
if (changed.prop.prop[0] === 'text') {
|
|
589
244
|
text.text = component.text;
|
|
590
245
|
} else if (changed.prop.prop[0] === 'style') {
|
|
591
246
|
_extends(text.style, changed.component.style);
|
|
592
247
|
}
|
|
593
248
|
};
|
|
594
|
-
|
|
595
249
|
Text.prototype.setSize = function (changed) {
|
|
596
250
|
var transform = changed.gameObject.transform;
|
|
597
251
|
if (!transform) return;
|
|
598
252
|
transform.size.width = this.texts[changed.gameObject.id].text.width;
|
|
599
253
|
transform.size.height = this.texts[changed.gameObject.id].text.height;
|
|
600
254
|
};
|
|
601
|
-
|
|
602
255
|
Text.systemName = 'Text';
|
|
603
256
|
Text = __decorate([eva_js.decorators.componentObserver({
|
|
604
257
|
Text: ['text', {
|
|
@@ -608,7 +261,6 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
608
261
|
})], Text);
|
|
609
262
|
return Text;
|
|
610
263
|
}(pluginRenderer.Renderer);
|
|
611
|
-
|
|
612
264
|
var Text$1 = Text;
|
|
613
265
|
exports.Text = Text$3;
|
|
614
266
|
exports.TextSystem = Text$1;
|
|
@@ -617,5 +269,4 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
617
269
|
});
|
|
618
270
|
return exports;
|
|
619
271
|
}({}, PIXI, EVA, EVA.plugin.renderer, EVA.rendererAdapter);
|
|
620
|
-
|
|
621
272
|
window.EVA.plugin.renderer.text = window.EVA.plugin.renderer.text || _EVA_IIFE_text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _extends(){return _extends=Object.assign
|
|
1
|
+
function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_extends.apply(this,arguments)}window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_text=function(t,e,n,r,o){"use strict";var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)};function c(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t,e,n,r){var o,i=arguments.length,c=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(c=(i<3?o(c):i>3?o(e,n,c):o(e,n))||c);return i>3&&c&&Object.defineProperty(e,n,c),c}function a(t,e,n,r){return new(n||(n=Promise))((function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,s)}a((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function p(t){return function(e,n){var r=function(t,e){return t.constructor.IDEProps||(t.constructor.IDEProps={}),t.constructor.IDEProps[e]||(t.constructor.IDEProps[e]={}),t.constructor.IDEProps[e]}(e,n);r.key=n,r.type=t}}var l=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.text="",e.style={},e}return c(n,t),n.prototype.init=function(t){var n=new e.TextStyle({fontSize:20}),r={};for(var o in n)0===o.indexOf("_")&&(r[o.substring(1)]=n[o]);this.style=r,t&&(this.text=t.text,_extends(this.style,t.style))},n.componentName="Text",s([p("string")],n.prototype,"text",void 0),n}(n.Component),f=l,d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Text",e.texts={},e}return c(e,t),e.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},e.prototype.componentChanged=function(t){return a(this,void 0,void 0,(function(){var e,r;return u(this,(function(i){return"Text"!==t.componentName||(t.type===n.OBSERVER_TYPE.ADD?(e=t.component,r=new o.Text(e.text,e.style),this.containerManager.getContainer(t.gameObject.id).addChildAt(r,0),this.texts[t.gameObject.id]={text:r,component:t.component},this.setSize(t)):t.type===n.OBSERVER_TYPE.REMOVE?(this.containerManager.getContainer(t.gameObject.id).removeChild(this.texts[t.gameObject.id].text),this.texts[t.gameObject.id].text.destroy({children:!0}),delete this.texts[t.gameObject.id]):(this.change(t),this.setSize(t))),[2]}))}))},e.prototype.change=function(t){var e=this.texts[t.gameObject.id],n=e.text,r=e.component;"text"===t.prop.prop[0]?n.text=r.text:"style"===t.prop.prop[0]&&_extends(n.style,t.component.style)},e.prototype.setSize=function(t){var e=t.gameObject.transform;e&&(e.size.width=this.texts[t.gameObject.id].text.width,e.size.height=this.texts[t.gameObject.id].text.height)},e.systemName="Text",e=s([n.decorators.componentObserver({Text:["text",{prop:["style"],deep:!0}]})],e)}(r.Renderer),h=d;return t.Text=f,t.TextSystem=h,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,EVA,EVA.plugin.renderer,EVA.rendererAdapter);window.EVA.plugin.renderer.text=window.EVA.plugin.renderer.text||_EVA_IIFE_text;
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
import { __extends, __decorate, __awaiter, __generator } from 'tslib';
|
|
3
|
+
import { TextStyle } from '@eva/miniprogram-pixi';
|
|
4
|
+
import { Component, OBSERVER_TYPE, decorators } from '@eva/eva.js/dist/miniprogram';
|
|
5
|
+
import { type } from '@eva/inspector-decorator';
|
|
6
|
+
import { RendererSystem, Renderer } from '@eva/plugin-renderer/dist/miniprogram';
|
|
7
|
+
import { Text as Text$4 } from '@eva/renderer-adapter/dist/miniprogram';
|
|
8
|
+
var Text$2 = function (_super) {
|
|
9
|
+
__extends(Text, _super);
|
|
10
|
+
function Text() {
|
|
11
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
12
|
+
_this.text = '';
|
|
13
|
+
_this.style = {};
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
Text.prototype.init = function (obj) {
|
|
17
|
+
var style = new TextStyle({
|
|
18
|
+
fontSize: 20
|
|
19
|
+
});
|
|
20
|
+
var newStyle = {};
|
|
21
|
+
for (var key in style) {
|
|
22
|
+
if (key.indexOf('_') === 0) {
|
|
23
|
+
newStyle[key.substring(1)] = style[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
this.style = newStyle;
|
|
27
|
+
if (obj) {
|
|
28
|
+
this.text = obj.text;
|
|
29
|
+
_extends(this.style, obj.style);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
Text.componentName = 'Text';
|
|
33
|
+
__decorate([type('string')], Text.prototype, "text", void 0);
|
|
34
|
+
return Text;
|
|
35
|
+
}(Component);
|
|
36
|
+
var Text$3 = Text$2;
|
|
37
|
+
var Text = function (_super) {
|
|
38
|
+
__extends(Text, _super);
|
|
39
|
+
function Text() {
|
|
40
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
41
|
+
_this.name = 'Text';
|
|
42
|
+
_this.texts = {};
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
Text.prototype.init = function () {
|
|
46
|
+
this.renderSystem = this.game.getSystem(RendererSystem);
|
|
47
|
+
this.renderSystem.rendererManager.register(this);
|
|
48
|
+
};
|
|
49
|
+
Text.prototype.componentChanged = function (changed) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var component, text;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
if (changed.componentName !== 'Text') return [2];
|
|
54
|
+
if (changed.type === OBSERVER_TYPE.ADD) {
|
|
55
|
+
component = changed.component;
|
|
56
|
+
text = new Text$4(component.text, component.style);
|
|
57
|
+
this.containerManager.getContainer(changed.gameObject.id).addChildAt(text, 0);
|
|
58
|
+
this.texts[changed.gameObject.id] = {
|
|
59
|
+
text: text,
|
|
60
|
+
component: changed.component
|
|
61
|
+
};
|
|
62
|
+
this.setSize(changed);
|
|
63
|
+
} else if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
64
|
+
this.containerManager.getContainer(changed.gameObject.id).removeChild(this.texts[changed.gameObject.id].text);
|
|
65
|
+
this.texts[changed.gameObject.id].text.destroy({
|
|
66
|
+
children: true
|
|
67
|
+
});
|
|
68
|
+
delete this.texts[changed.gameObject.id];
|
|
69
|
+
} else {
|
|
70
|
+
this.change(changed);
|
|
71
|
+
this.setSize(changed);
|
|
72
|
+
}
|
|
73
|
+
return [2];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
Text.prototype.change = function (changed) {
|
|
78
|
+
var _a = this.texts[changed.gameObject.id],
|
|
79
|
+
text = _a.text,
|
|
80
|
+
component = _a.component;
|
|
81
|
+
if (changed.prop.prop[0] === 'text') {
|
|
82
|
+
text.text = component.text;
|
|
83
|
+
} else if (changed.prop.prop[0] === 'style') {
|
|
84
|
+
_extends(text.style, changed.component.style);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
Text.prototype.setSize = function (changed) {
|
|
88
|
+
var transform = changed.gameObject.transform;
|
|
89
|
+
if (!transform) return;
|
|
90
|
+
transform.size.width = this.texts[changed.gameObject.id].text.width;
|
|
91
|
+
transform.size.height = this.texts[changed.gameObject.id].text.height;
|
|
92
|
+
};
|
|
93
|
+
Text.systemName = 'Text';
|
|
94
|
+
Text = __decorate([decorators.componentObserver({
|
|
95
|
+
Text: ['text', {
|
|
96
|
+
prop: ['style'],
|
|
97
|
+
deep: true
|
|
98
|
+
}]
|
|
99
|
+
})], Text);
|
|
100
|
+
return Text;
|
|
101
|
+
}(Renderer);
|
|
102
|
+
var Text$1 = Text;
|
|
103
|
+
export { Text$3 as Text, Text$1 as TextSystem };
|
|
@@ -44,10 +44,6 @@ function __decorate(decorators, target, key, desc) {
|
|
|
44
44
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
function __metadata(metadataKey, metadataValue) {
|
|
48
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
47
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
52
48
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
53
49
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -85,150 +81,6 @@ function __generator(thisArg, body) {
|
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
|
|
88
|
-
var Color = (function () {
|
|
89
|
-
function Color() {
|
|
90
|
-
}
|
|
91
|
-
Color.getProperties = function () {
|
|
92
|
-
return 'color';
|
|
93
|
-
};
|
|
94
|
-
return Color;
|
|
95
|
-
}());
|
|
96
|
-
var Style = (function () {
|
|
97
|
-
function Style() {
|
|
98
|
-
}
|
|
99
|
-
__decorate([
|
|
100
|
-
inspectorDecorator.Field({
|
|
101
|
-
type: 'selector',
|
|
102
|
-
isArray: false,
|
|
103
|
-
options: ['center', 'left', 'right'],
|
|
104
|
-
default: 'left',
|
|
105
|
-
}),
|
|
106
|
-
__metadata("design:type", String)
|
|
107
|
-
], Style.prototype, "align", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
inspectorDecorator.Field(),
|
|
110
|
-
__metadata("design:type", Boolean)
|
|
111
|
-
], Style.prototype, "breakWords", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
inspectorDecorator.Field(),
|
|
114
|
-
__metadata("design:type", Boolean)
|
|
115
|
-
], Style.prototype, "dropShadow", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
inspectorDecorator.Field({ default: 1 }),
|
|
118
|
-
__metadata("design:type", Number)
|
|
119
|
-
], Style.prototype, "dropShadowAlpha", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
inspectorDecorator.Field({ default: Math.PI / 6 }),
|
|
122
|
-
__metadata("design:type", Number)
|
|
123
|
-
], Style.prototype, "dropShadowAngle", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
inspectorDecorator.Field({ default: 0 }),
|
|
126
|
-
__metadata("design:type", Number)
|
|
127
|
-
], Style.prototype, "dropShadowBlur", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
inspectorDecorator.Field(function () { return Color; }, { default: '#000000' }),
|
|
130
|
-
__metadata("design:type", Object)
|
|
131
|
-
], Style.prototype, "dropShadowColor", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
inspectorDecorator.Field({ default: 5 }),
|
|
134
|
-
__metadata("design:type", Number)
|
|
135
|
-
], Style.prototype, "dropShadowDistance", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
inspectorDecorator.Field(function () { return [Color]; }, { default: ['#000000'] }),
|
|
138
|
-
__metadata("design:type", Object)
|
|
139
|
-
], Style.prototype, "fill", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
inspectorDecorator.Field({
|
|
142
|
-
type: 'selector',
|
|
143
|
-
options: { vertical: 1, horizontal: 0 },
|
|
144
|
-
default: 1,
|
|
145
|
-
filter: function (val) { return Number(val); },
|
|
146
|
-
isArray: false,
|
|
147
|
-
}),
|
|
148
|
-
__metadata("design:type", Number)
|
|
149
|
-
], Style.prototype, "fillGradientType", void 0);
|
|
150
|
-
__decorate([
|
|
151
|
-
inspectorDecorator.Field(function () { return Number; }, { step: 0.1, min: 0, max: 1 }),
|
|
152
|
-
__metadata("design:type", Array)
|
|
153
|
-
], Style.prototype, "fillGradientStops", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
inspectorDecorator.Field(function () { return String; }, { default: 'Arial' }),
|
|
156
|
-
__metadata("design:type", Object)
|
|
157
|
-
], Style.prototype, "fontFamily", void 0);
|
|
158
|
-
__decorate([
|
|
159
|
-
inspectorDecorator.Field(function () { return Number; }, { min: 5, default: 26 }),
|
|
160
|
-
__metadata("design:type", Object)
|
|
161
|
-
], Style.prototype, "fontSize", void 0);
|
|
162
|
-
__decorate([
|
|
163
|
-
inspectorDecorator.Field({ type: 'selector', options: ['normal', 'italic', 'oblique'], default: 'normal' }),
|
|
164
|
-
__metadata("design:type", String)
|
|
165
|
-
], Style.prototype, "fontStyle", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
inspectorDecorator.Field({ type: 'selector', options: ['normal', 'small-caps'], default: 'normal' }),
|
|
168
|
-
__metadata("design:type", String)
|
|
169
|
-
], Style.prototype, "fontVariant", void 0);
|
|
170
|
-
__decorate([
|
|
171
|
-
inspectorDecorator.Field({
|
|
172
|
-
type: 'selector',
|
|
173
|
-
options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
174
|
-
default: 'normal',
|
|
175
|
-
}),
|
|
176
|
-
__metadata("design:type", String)
|
|
177
|
-
], Style.prototype, "fontWeight", void 0);
|
|
178
|
-
__decorate([
|
|
179
|
-
inspectorDecorator.Field({ default: 0 }),
|
|
180
|
-
__metadata("design:type", Number)
|
|
181
|
-
], Style.prototype, "letterSpacing", void 0);
|
|
182
|
-
__decorate([
|
|
183
|
-
inspectorDecorator.Field({ default: 0 }),
|
|
184
|
-
__metadata("design:type", Number)
|
|
185
|
-
], Style.prototype, "lineHeight", void 0);
|
|
186
|
-
__decorate([
|
|
187
|
-
inspectorDecorator.Field({ type: 'selector', options: ['miter', 'round', 'bevel'], default: 'miter' }),
|
|
188
|
-
__metadata("design:type", String)
|
|
189
|
-
], Style.prototype, "lineJoin", void 0);
|
|
190
|
-
__decorate([
|
|
191
|
-
inspectorDecorator.Field({ default: 10 }),
|
|
192
|
-
__metadata("design:type", Number)
|
|
193
|
-
], Style.prototype, "miterLimit", void 0);
|
|
194
|
-
__decorate([
|
|
195
|
-
inspectorDecorator.Field({ default: 0 }),
|
|
196
|
-
__metadata("design:type", Number)
|
|
197
|
-
], Style.prototype, "padding", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
inspectorDecorator.Field(function () { return Color; }, { default: '#000000' }),
|
|
200
|
-
__metadata("design:type", Object)
|
|
201
|
-
], Style.prototype, "stroke", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
inspectorDecorator.Field({ default: 0, min: 0 }),
|
|
204
|
-
__metadata("design:type", Number)
|
|
205
|
-
], Style.prototype, "strokeThickness", void 0);
|
|
206
|
-
__decorate([
|
|
207
|
-
inspectorDecorator.Field({ default: 'alphabetic' }),
|
|
208
|
-
__metadata("design:type", String)
|
|
209
|
-
], Style.prototype, "textBaseline", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
inspectorDecorator.Field(),
|
|
212
|
-
__metadata("design:type", Boolean)
|
|
213
|
-
], Style.prototype, "trim", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
inspectorDecorator.Field({ default: 'pre', type: 'selector', options: ['normal', 'pre', 'pre-line'] }),
|
|
216
|
-
__metadata("design:type", String)
|
|
217
|
-
], Style.prototype, "whiteSpace", void 0);
|
|
218
|
-
__decorate([
|
|
219
|
-
inspectorDecorator.Field(),
|
|
220
|
-
__metadata("design:type", Boolean)
|
|
221
|
-
], Style.prototype, "wordWrap", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
inspectorDecorator.Field({ default: 100 }),
|
|
224
|
-
__metadata("design:type", Number)
|
|
225
|
-
], Style.prototype, "wordWrapWidth", void 0);
|
|
226
|
-
__decorate([
|
|
227
|
-
inspectorDecorator.Field(),
|
|
228
|
-
__metadata("design:type", Number)
|
|
229
|
-
], Style.prototype, "leading", void 0);
|
|
230
|
-
return Style;
|
|
231
|
-
}());
|
|
232
84
|
var Text$2 = (function (_super) {
|
|
233
85
|
__extends(Text, _super);
|
|
234
86
|
function Text() {
|
|
@@ -255,24 +107,8 @@ var Text$2 = (function (_super) {
|
|
|
255
107
|
};
|
|
256
108
|
Text.componentName = 'Text';
|
|
257
109
|
__decorate([
|
|
258
|
-
inspectorDecorator.
|
|
259
|
-
type: 'textarea',
|
|
260
|
-
filter: function (text) {
|
|
261
|
-
if (typeof text !== 'string') {
|
|
262
|
-
return '';
|
|
263
|
-
}
|
|
264
|
-
if (text.length > 100) {
|
|
265
|
-
return text.slice(0, 100);
|
|
266
|
-
}
|
|
267
|
-
return text;
|
|
268
|
-
},
|
|
269
|
-
}),
|
|
270
|
-
__metadata("design:type", String)
|
|
110
|
+
inspectorDecorator.type('string')
|
|
271
111
|
], Text.prototype, "text", void 0);
|
|
272
|
-
__decorate([
|
|
273
|
-
inspectorDecorator.Field(),
|
|
274
|
-
__metadata("design:type", Style)
|
|
275
|
-
], Text.prototype, "style", void 0);
|
|
276
112
|
return Text;
|
|
277
113
|
}(eva_js.Component));
|
|
278
114
|
var Text$3 = Text$2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("pixi.js"),t=require("@eva/eva.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("pixi.js"),t=require("@eva/eva.js"),n=require("@eva/inspector-decorator"),r=require("@eva/plugin-renderer"),o=require("@eva/renderer-adapter"),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)};function s(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function c(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var p=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.text="",e.style={},e}return s(r,t),r.prototype.init=function(t){var n=new e.TextStyle({fontSize:20}),r={};for(var o in n)0===o.indexOf("_")&&(r[o.substring(1)]=n[o]);this.style=r,t&&(this.text=t.text,Object.assign(this.style,t.style))},r.componentName="Text",a([n.type("string")],r.prototype,"text",void 0),r}(t.Component),u=p,l=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Text",t.texts={},t}return s(n,e),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.componentChanged=function(e){return n=this,r=void 0,s=function(){var n,r;return c(this,(function(i){return"Text"!==e.componentName||(e.type===t.OBSERVER_TYPE.ADD?(n=e.component,r=new o.Text(n.text,n.style),this.containerManager.getContainer(e.gameObject.id).addChildAt(r,0),this.texts[e.gameObject.id]={text:r,component:e.component},this.setSize(e)):e.type===t.OBSERVER_TYPE.REMOVE?(this.containerManager.getContainer(e.gameObject.id).removeChild(this.texts[e.gameObject.id].text),this.texts[e.gameObject.id].text.destroy({children:!0}),delete this.texts[e.gameObject.id]):(this.change(e),this.setSize(e))),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(o,a)}c((s=s.apply(n,r||[])).next())}));var n,r,i,s},n.prototype.change=function(e){var t=this.texts[e.gameObject.id],n=t.text,r=t.component;"text"===e.prop.prop[0]?n.text=r.text:"style"===e.prop.prop[0]&&Object.assign(n.style,e.component.style)},n.prototype.setSize=function(e){var t=e.gameObject.transform;t&&(t.size.width=this.texts[e.gameObject.id].text.width,t.size.height=this.texts[e.gameObject.id].text.height)},n.systemName="Text",n=a([t.decorators.componentObserver({Text:["text",{prop:["style"],deep:!0}]})],n)}(r.Renderer);exports.Text=u,exports.TextSystem=l;
|
|
@@ -6,49 +6,47 @@ import { RendererManager } from '@eva/plugin-renderer';
|
|
|
6
6
|
import { RendererSystem } from '@eva/plugin-renderer';
|
|
7
7
|
import { Text as Text_3 } from '@eva/renderer-adapter';
|
|
8
8
|
|
|
9
|
-
declare class Style {
|
|
10
|
-
align?: string;
|
|
11
|
-
breakWords?: boolean;
|
|
12
|
-
dropShadow?: boolean;
|
|
13
|
-
dropShadowAlpha?: number;
|
|
14
|
-
dropShadowAngle?: number;
|
|
15
|
-
dropShadowBlur?: number;
|
|
16
|
-
dropShadowColor?: string | number;
|
|
17
|
-
dropShadowDistance?: number;
|
|
18
|
-
fill?: string | string[] | number | number[] | CanvasGradient | CanvasPattern;
|
|
19
|
-
fillGradientType?: number;
|
|
20
|
-
fillGradientStops?: number[];
|
|
21
|
-
fontFamily?: string | string[];
|
|
22
|
-
fontSize?: number | string;
|
|
23
|
-
fontStyle?: string;
|
|
24
|
-
fontVariant?: string;
|
|
25
|
-
fontWeight?: string;
|
|
26
|
-
letterSpacing?: number;
|
|
27
|
-
lineHeight?: number;
|
|
28
|
-
lineJoin?: string;
|
|
29
|
-
miterLimit?: number;
|
|
30
|
-
padding?: number;
|
|
31
|
-
stroke?: string | number;
|
|
32
|
-
strokeThickness?: number;
|
|
33
|
-
textBaseline?: string;
|
|
34
|
-
trim?: boolean;
|
|
35
|
-
whiteSpace?: string;
|
|
36
|
-
wordWrap?: boolean;
|
|
37
|
-
wordWrapWidth?: number;
|
|
38
|
-
leading?: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
9
|
declare class Text_2 extends Component<TextParams> {
|
|
42
10
|
static componentName: string;
|
|
43
11
|
text: string;
|
|
44
|
-
style:
|
|
12
|
+
style: TextParams['style'];
|
|
45
13
|
init(obj?: TextParams): void;
|
|
46
14
|
}
|
|
47
15
|
export { Text_2 as Text }
|
|
48
16
|
|
|
49
17
|
export declare interface TextParams {
|
|
50
18
|
text: string;
|
|
51
|
-
style?:
|
|
19
|
+
style?: {
|
|
20
|
+
align?: string;
|
|
21
|
+
breakWords?: boolean;
|
|
22
|
+
dropShadow?: boolean;
|
|
23
|
+
dropShadowAlpha?: number;
|
|
24
|
+
dropShadowAngle?: number;
|
|
25
|
+
dropShadowBlur?: number;
|
|
26
|
+
dropShadowColor?: string | number;
|
|
27
|
+
dropShadowDistance?: number;
|
|
28
|
+
fill?: string | string[] | number | number[] | CanvasGradient | CanvasPattern;
|
|
29
|
+
fillGradientType?: number;
|
|
30
|
+
fillGradientStops?: number[];
|
|
31
|
+
fontFamily?: string | string[];
|
|
32
|
+
fontSize?: number | string;
|
|
33
|
+
fontStyle?: string;
|
|
34
|
+
fontVariant?: string;
|
|
35
|
+
fontWeight?: string;
|
|
36
|
+
letterSpacing?: number;
|
|
37
|
+
lineHeight?: number;
|
|
38
|
+
lineJoin?: string;
|
|
39
|
+
miterLimit?: number;
|
|
40
|
+
padding?: number;
|
|
41
|
+
stroke?: string | number;
|
|
42
|
+
strokeThickness?: number;
|
|
43
|
+
textBaseline?: string;
|
|
44
|
+
trim?: boolean;
|
|
45
|
+
whiteSpace?: string;
|
|
46
|
+
wordWrap?: boolean;
|
|
47
|
+
wordWrapWidth?: number;
|
|
48
|
+
leading?: number;
|
|
49
|
+
};
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
export declare class TextSystem extends Renderer {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextStyle } from 'pixi.js';
|
|
2
2
|
import { Component, decorators, OBSERVER_TYPE } from '@eva/eva.js';
|
|
3
|
-
import {
|
|
3
|
+
import { type } from '@eva/inspector-decorator';
|
|
4
4
|
import { RendererSystem, Renderer } from '@eva/plugin-renderer';
|
|
5
5
|
import { Text as Text$4 } from '@eva/renderer-adapter';
|
|
6
6
|
|
|
@@ -40,10 +40,6 @@ function __decorate(decorators, target, key, desc) {
|
|
|
40
40
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function __metadata(metadataKey, metadataValue) {
|
|
44
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
43
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
48
44
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
49
45
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -81,150 +77,6 @@ function __generator(thisArg, body) {
|
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
|
|
84
|
-
var Color = (function () {
|
|
85
|
-
function Color() {
|
|
86
|
-
}
|
|
87
|
-
Color.getProperties = function () {
|
|
88
|
-
return 'color';
|
|
89
|
-
};
|
|
90
|
-
return Color;
|
|
91
|
-
}());
|
|
92
|
-
var Style = (function () {
|
|
93
|
-
function Style() {
|
|
94
|
-
}
|
|
95
|
-
__decorate([
|
|
96
|
-
Field({
|
|
97
|
-
type: 'selector',
|
|
98
|
-
isArray: false,
|
|
99
|
-
options: ['center', 'left', 'right'],
|
|
100
|
-
default: 'left',
|
|
101
|
-
}),
|
|
102
|
-
__metadata("design:type", String)
|
|
103
|
-
], Style.prototype, "align", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
Field(),
|
|
106
|
-
__metadata("design:type", Boolean)
|
|
107
|
-
], Style.prototype, "breakWords", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
Field(),
|
|
110
|
-
__metadata("design:type", Boolean)
|
|
111
|
-
], Style.prototype, "dropShadow", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
Field({ default: 1 }),
|
|
114
|
-
__metadata("design:type", Number)
|
|
115
|
-
], Style.prototype, "dropShadowAlpha", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
Field({ default: Math.PI / 6 }),
|
|
118
|
-
__metadata("design:type", Number)
|
|
119
|
-
], Style.prototype, "dropShadowAngle", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
Field({ default: 0 }),
|
|
122
|
-
__metadata("design:type", Number)
|
|
123
|
-
], Style.prototype, "dropShadowBlur", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
Field(function () { return Color; }, { default: '#000000' }),
|
|
126
|
-
__metadata("design:type", Object)
|
|
127
|
-
], Style.prototype, "dropShadowColor", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
Field({ default: 5 }),
|
|
130
|
-
__metadata("design:type", Number)
|
|
131
|
-
], Style.prototype, "dropShadowDistance", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
Field(function () { return [Color]; }, { default: ['#000000'] }),
|
|
134
|
-
__metadata("design:type", Object)
|
|
135
|
-
], Style.prototype, "fill", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
Field({
|
|
138
|
-
type: 'selector',
|
|
139
|
-
options: { vertical: 1, horizontal: 0 },
|
|
140
|
-
default: 1,
|
|
141
|
-
filter: function (val) { return Number(val); },
|
|
142
|
-
isArray: false,
|
|
143
|
-
}),
|
|
144
|
-
__metadata("design:type", Number)
|
|
145
|
-
], Style.prototype, "fillGradientType", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
Field(function () { return Number; }, { step: 0.1, min: 0, max: 1 }),
|
|
148
|
-
__metadata("design:type", Array)
|
|
149
|
-
], Style.prototype, "fillGradientStops", void 0);
|
|
150
|
-
__decorate([
|
|
151
|
-
Field(function () { return String; }, { default: 'Arial' }),
|
|
152
|
-
__metadata("design:type", Object)
|
|
153
|
-
], Style.prototype, "fontFamily", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
Field(function () { return Number; }, { min: 5, default: 26 }),
|
|
156
|
-
__metadata("design:type", Object)
|
|
157
|
-
], Style.prototype, "fontSize", void 0);
|
|
158
|
-
__decorate([
|
|
159
|
-
Field({ type: 'selector', options: ['normal', 'italic', 'oblique'], default: 'normal' }),
|
|
160
|
-
__metadata("design:type", String)
|
|
161
|
-
], Style.prototype, "fontStyle", void 0);
|
|
162
|
-
__decorate([
|
|
163
|
-
Field({ type: 'selector', options: ['normal', 'small-caps'], default: 'normal' }),
|
|
164
|
-
__metadata("design:type", String)
|
|
165
|
-
], Style.prototype, "fontVariant", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
Field({
|
|
168
|
-
type: 'selector',
|
|
169
|
-
options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
170
|
-
default: 'normal',
|
|
171
|
-
}),
|
|
172
|
-
__metadata("design:type", String)
|
|
173
|
-
], Style.prototype, "fontWeight", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
Field({ default: 0 }),
|
|
176
|
-
__metadata("design:type", Number)
|
|
177
|
-
], Style.prototype, "letterSpacing", void 0);
|
|
178
|
-
__decorate([
|
|
179
|
-
Field({ default: 0 }),
|
|
180
|
-
__metadata("design:type", Number)
|
|
181
|
-
], Style.prototype, "lineHeight", void 0);
|
|
182
|
-
__decorate([
|
|
183
|
-
Field({ type: 'selector', options: ['miter', 'round', 'bevel'], default: 'miter' }),
|
|
184
|
-
__metadata("design:type", String)
|
|
185
|
-
], Style.prototype, "lineJoin", void 0);
|
|
186
|
-
__decorate([
|
|
187
|
-
Field({ default: 10 }),
|
|
188
|
-
__metadata("design:type", Number)
|
|
189
|
-
], Style.prototype, "miterLimit", void 0);
|
|
190
|
-
__decorate([
|
|
191
|
-
Field({ default: 0 }),
|
|
192
|
-
__metadata("design:type", Number)
|
|
193
|
-
], Style.prototype, "padding", void 0);
|
|
194
|
-
__decorate([
|
|
195
|
-
Field(function () { return Color; }, { default: '#000000' }),
|
|
196
|
-
__metadata("design:type", Object)
|
|
197
|
-
], Style.prototype, "stroke", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
Field({ default: 0, min: 0 }),
|
|
200
|
-
__metadata("design:type", Number)
|
|
201
|
-
], Style.prototype, "strokeThickness", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
Field({ default: 'alphabetic' }),
|
|
204
|
-
__metadata("design:type", String)
|
|
205
|
-
], Style.prototype, "textBaseline", void 0);
|
|
206
|
-
__decorate([
|
|
207
|
-
Field(),
|
|
208
|
-
__metadata("design:type", Boolean)
|
|
209
|
-
], Style.prototype, "trim", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
Field({ default: 'pre', type: 'selector', options: ['normal', 'pre', 'pre-line'] }),
|
|
212
|
-
__metadata("design:type", String)
|
|
213
|
-
], Style.prototype, "whiteSpace", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
Field(),
|
|
216
|
-
__metadata("design:type", Boolean)
|
|
217
|
-
], Style.prototype, "wordWrap", void 0);
|
|
218
|
-
__decorate([
|
|
219
|
-
Field({ default: 100 }),
|
|
220
|
-
__metadata("design:type", Number)
|
|
221
|
-
], Style.prototype, "wordWrapWidth", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
Field(),
|
|
224
|
-
__metadata("design:type", Number)
|
|
225
|
-
], Style.prototype, "leading", void 0);
|
|
226
|
-
return Style;
|
|
227
|
-
}());
|
|
228
80
|
var Text$2 = (function (_super) {
|
|
229
81
|
__extends(Text, _super);
|
|
230
82
|
function Text() {
|
|
@@ -251,24 +103,8 @@ var Text$2 = (function (_super) {
|
|
|
251
103
|
};
|
|
252
104
|
Text.componentName = 'Text';
|
|
253
105
|
__decorate([
|
|
254
|
-
|
|
255
|
-
type: 'textarea',
|
|
256
|
-
filter: function (text) {
|
|
257
|
-
if (typeof text !== 'string') {
|
|
258
|
-
return '';
|
|
259
|
-
}
|
|
260
|
-
if (text.length > 100) {
|
|
261
|
-
return text.slice(0, 100);
|
|
262
|
-
}
|
|
263
|
-
return text;
|
|
264
|
-
},
|
|
265
|
-
}),
|
|
266
|
-
__metadata("design:type", String)
|
|
106
|
+
type('string')
|
|
267
107
|
], Text.prototype, "text", void 0);
|
|
268
|
-
__decorate([
|
|
269
|
-
Field(),
|
|
270
|
-
__metadata("design:type", Style)
|
|
271
|
-
], Text.prototype, "style", void 0);
|
|
272
108
|
return Text;
|
|
273
109
|
}(Component));
|
|
274
110
|
var Text$3 = Text$2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-text",
|
|
3
|
-
"version": "1.2.7-
|
|
3
|
+
"version": "1.2.7-fix.4",
|
|
4
4
|
"description": "@eva/plugin-renderer-text",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-text.esm.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@eva/inspector-decorator": "0.
|
|
22
|
-
"@eva/plugin-renderer": "1.2.7-
|
|
23
|
-
"@eva/renderer-adapter": "1.2.7-
|
|
24
|
-
"@eva/eva.js": "1.2.7-
|
|
21
|
+
"@eva/inspector-decorator": "^0.0.5",
|
|
22
|
+
"@eva/plugin-renderer": "1.2.7-fix.4",
|
|
23
|
+
"@eva/renderer-adapter": "1.2.7-fix.4",
|
|
24
|
+
"@eva/eva.js": "1.2.7-fix.4",
|
|
25
25
|
"pixi.js": "^4.8.7"
|
|
26
26
|
}
|
|
27
27
|
}
|