@playcanvas/web-components 0.2.12 → 0.3.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.
- package/LICENSE +1 -1
- package/dist/components/element-component.d.ts +12 -0
- package/dist/pwc.cjs +23 -0
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +23 -0
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.mjs +23 -0
- package/dist/pwc.mjs.map +1 -1
- package/package.json +10 -8
- package/src/components/element-component.ts +26 -0
- package/src/components/rigidbody-component.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcanvas/web-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "PlayCanvas <support@playcanvas.com>",
|
|
5
5
|
"homepage": "https://playcanvas.com",
|
|
6
6
|
"description": "Web Components for the PlayCanvas Engine",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"lint": "eslint examples/js examples/assets/scripts src",
|
|
33
33
|
"serve": "serve",
|
|
34
34
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
35
|
+
"publint": "publint",
|
|
35
36
|
"type-check": "tsc --noEmit",
|
|
36
37
|
"type-check:watch": "npm run type-check -- --watch",
|
|
37
38
|
"watch": "rollup -c -w"
|
|
@@ -44,20 +45,21 @@
|
|
|
44
45
|
"@rollup/plugin-terser": "0.4.4",
|
|
45
46
|
"@rollup/plugin-typescript": "12.3.0",
|
|
46
47
|
"@tweenjs/tween.js": "25.0.0",
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
48
|
-
"@typescript-eslint/parser": "8.
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "8.52.0",
|
|
49
|
+
"@typescript-eslint/parser": "8.52.0",
|
|
49
50
|
"concurrently": "9.2.1",
|
|
50
51
|
"earcut": "3.0.2",
|
|
51
52
|
"eslint": "9.39.2",
|
|
52
53
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
53
|
-
"globals": "
|
|
54
|
-
"mediabunny": "1.
|
|
54
|
+
"globals": "17.0.0",
|
|
55
|
+
"mediabunny": "1.27.4",
|
|
55
56
|
"opentype.js": "1.3.4",
|
|
56
|
-
"playcanvas": "2.
|
|
57
|
-
"
|
|
57
|
+
"playcanvas": "2.15.0",
|
|
58
|
+
"publint": "0.3.16",
|
|
59
|
+
"rollup": "4.55.1",
|
|
58
60
|
"serve": "14.2.5",
|
|
59
61
|
"tslib": "2.8.1",
|
|
60
|
-
"typedoc": "0.28.
|
|
62
|
+
"typedoc": "0.28.16",
|
|
61
63
|
"typedoc-plugin-mdn-links": "5.0.10",
|
|
62
64
|
"typescript": "5.9.3"
|
|
63
65
|
}
|
|
@@ -21,6 +21,8 @@ class ElementComponentElement extends ComponentElement {
|
|
|
21
21
|
|
|
22
22
|
private _color: Color = new Color(1, 1, 1, 1);
|
|
23
23
|
|
|
24
|
+
private _enableMarkup: boolean = false;
|
|
25
|
+
|
|
24
26
|
private _fontSize: number = 32;
|
|
25
27
|
|
|
26
28
|
private _lineHeight: number = 32;
|
|
@@ -49,6 +51,7 @@ class ElementComponentElement extends ComponentElement {
|
|
|
49
51
|
anchor: this._anchor,
|
|
50
52
|
autoWidth: this._autoWidth,
|
|
51
53
|
color: this._color,
|
|
54
|
+
enableMarkup: this._enableMarkup,
|
|
52
55
|
fontAsset: AssetElement.get(this._asset)!.id,
|
|
53
56
|
fontSize: this._fontSize,
|
|
54
57
|
lineHeight: this._lineHeight,
|
|
@@ -145,6 +148,25 @@ class ElementComponentElement extends ComponentElement {
|
|
|
145
148
|
return this._color;
|
|
146
149
|
}
|
|
147
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Sets whether the element component should use markup.
|
|
153
|
+
* @param value - Whether to enable markup.
|
|
154
|
+
*/
|
|
155
|
+
set enableMarkup(value: boolean) {
|
|
156
|
+
this._enableMarkup = value;
|
|
157
|
+
if (this.component) {
|
|
158
|
+
this.component.enableMarkup = value;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Gets whether the element component should use markup.
|
|
164
|
+
* @returns Whether markup is enabled.
|
|
165
|
+
*/
|
|
166
|
+
get enableMarkup() {
|
|
167
|
+
return this._enableMarkup;
|
|
168
|
+
}
|
|
169
|
+
|
|
148
170
|
/**
|
|
149
171
|
* Sets the font size of the element component.
|
|
150
172
|
* @param value - The font size.
|
|
@@ -285,6 +307,7 @@ class ElementComponentElement extends ComponentElement {
|
|
|
285
307
|
'asset',
|
|
286
308
|
'auto-width',
|
|
287
309
|
'color',
|
|
310
|
+
'enable-markup',
|
|
288
311
|
'font-size',
|
|
289
312
|
'line-height',
|
|
290
313
|
'pivot',
|
|
@@ -311,6 +334,9 @@ class ElementComponentElement extends ComponentElement {
|
|
|
311
334
|
case 'color':
|
|
312
335
|
this.color = parseColor(newValue);
|
|
313
336
|
break;
|
|
337
|
+
case 'enable-markup':
|
|
338
|
+
this.enableMarkup = this.hasAttribute(name);
|
|
339
|
+
break;
|
|
314
340
|
case 'font-size':
|
|
315
341
|
this.fontSize = Number(newValue);
|
|
316
342
|
break;
|
|
@@ -175,7 +175,7 @@ class RigidBodyComponentElement extends ComponentElement {
|
|
|
175
175
|
set type(value: string) {
|
|
176
176
|
this._type = value;
|
|
177
177
|
if (this.component) {
|
|
178
|
-
this.component.type = value;
|
|
178
|
+
this.component.type = value as 'static' | 'dynamic' | 'kinematic';
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|