@playcanvas/web-components 0.2.11 → 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/components/splat-component.d.ts +13 -0
- package/dist/pwc.cjs +53 -2
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +53 -2
- 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 +53 -2
- package/dist/pwc.mjs.map +1 -1
- package/package.json +13 -11
- package/src/components/element-component.ts +26 -0
- package/src/components/rigidbody-component.ts +1 -1
- package/src/components/splat-component.ts +33 -2
package/dist/pwc.mjs
CHANGED
|
@@ -2116,6 +2116,7 @@ class ElementComponentElement extends ComponentElement {
|
|
|
2116
2116
|
this._asset = '';
|
|
2117
2117
|
this._autoWidth = true;
|
|
2118
2118
|
this._color = new Color(1, 1, 1, 1);
|
|
2119
|
+
this._enableMarkup = false;
|
|
2119
2120
|
this._fontSize = 32;
|
|
2120
2121
|
this._lineHeight = 32;
|
|
2121
2122
|
this._pivot = new Vec2(0.5, 0.5);
|
|
@@ -2132,6 +2133,7 @@ class ElementComponentElement extends ComponentElement {
|
|
|
2132
2133
|
anchor: this._anchor,
|
|
2133
2134
|
autoWidth: this._autoWidth,
|
|
2134
2135
|
color: this._color,
|
|
2136
|
+
enableMarkup: this._enableMarkup,
|
|
2135
2137
|
fontAsset: AssetElement.get(this._asset).id,
|
|
2136
2138
|
fontSize: this._fontSize,
|
|
2137
2139
|
lineHeight: this._lineHeight,
|
|
@@ -2218,6 +2220,23 @@ class ElementComponentElement extends ComponentElement {
|
|
|
2218
2220
|
get color() {
|
|
2219
2221
|
return this._color;
|
|
2220
2222
|
}
|
|
2223
|
+
/**
|
|
2224
|
+
* Sets whether the element component should use markup.
|
|
2225
|
+
* @param value - Whether to enable markup.
|
|
2226
|
+
*/
|
|
2227
|
+
set enableMarkup(value) {
|
|
2228
|
+
this._enableMarkup = value;
|
|
2229
|
+
if (this.component) {
|
|
2230
|
+
this.component.enableMarkup = value;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
/**
|
|
2234
|
+
* Gets whether the element component should use markup.
|
|
2235
|
+
* @returns Whether markup is enabled.
|
|
2236
|
+
*/
|
|
2237
|
+
get enableMarkup() {
|
|
2238
|
+
return this._enableMarkup;
|
|
2239
|
+
}
|
|
2221
2240
|
/**
|
|
2222
2241
|
* Sets the font size of the element component.
|
|
2223
2242
|
* @param value - The font size.
|
|
@@ -2344,6 +2363,7 @@ class ElementComponentElement extends ComponentElement {
|
|
|
2344
2363
|
'asset',
|
|
2345
2364
|
'auto-width',
|
|
2346
2365
|
'color',
|
|
2366
|
+
'enable-markup',
|
|
2347
2367
|
'font-size',
|
|
2348
2368
|
'line-height',
|
|
2349
2369
|
'pivot',
|
|
@@ -2368,6 +2388,9 @@ class ElementComponentElement extends ComponentElement {
|
|
|
2368
2388
|
case 'color':
|
|
2369
2389
|
this.color = parseColor(newValue);
|
|
2370
2390
|
break;
|
|
2391
|
+
case 'enable-markup':
|
|
2392
|
+
this.enableMarkup = this.hasAttribute(name);
|
|
2393
|
+
break;
|
|
2371
2394
|
case 'font-size':
|
|
2372
2395
|
this.fontSize = Number(newValue);
|
|
2373
2396
|
break;
|
|
@@ -4257,11 +4280,13 @@ class SplatComponentElement extends ComponentElement {
|
|
|
4257
4280
|
super('gsplat');
|
|
4258
4281
|
this._asset = '';
|
|
4259
4282
|
this._castShadows = false;
|
|
4283
|
+
this._unified = false;
|
|
4260
4284
|
}
|
|
4261
4285
|
getInitialComponentData() {
|
|
4262
4286
|
return {
|
|
4263
4287
|
asset: AssetElement.get(this._asset),
|
|
4264
|
-
castShadows: this._castShadows
|
|
4288
|
+
castShadows: this._castShadows,
|
|
4289
|
+
unified: this._unified
|
|
4265
4290
|
};
|
|
4266
4291
|
}
|
|
4267
4292
|
/**
|
|
@@ -4306,11 +4331,34 @@ class SplatComponentElement extends ComponentElement {
|
|
|
4306
4331
|
get castShadows() {
|
|
4307
4332
|
return this._castShadows;
|
|
4308
4333
|
}
|
|
4334
|
+
/**
|
|
4335
|
+
* Sets whether the splat supports global sorting and LOD streaming. This property can only be
|
|
4336
|
+
* changed when the component is disabled.
|
|
4337
|
+
* @param value - Whether the splat supports global sorting and LOD streaming.
|
|
4338
|
+
*/
|
|
4339
|
+
set unified(value) {
|
|
4340
|
+
if (this.component && this.component.enabled) {
|
|
4341
|
+
console.warn('The "unified" property can only be changed when the component is disabled.');
|
|
4342
|
+
return;
|
|
4343
|
+
}
|
|
4344
|
+
this._unified = value;
|
|
4345
|
+
if (this.component) {
|
|
4346
|
+
this.component.unified = value;
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
/**
|
|
4350
|
+
* Gets whether the splat supports global sorting and LOD streaming.
|
|
4351
|
+
* @returns Whether the splat supports global sorting and LOD streaming.
|
|
4352
|
+
*/
|
|
4353
|
+
get unified() {
|
|
4354
|
+
return this._unified;
|
|
4355
|
+
}
|
|
4309
4356
|
static get observedAttributes() {
|
|
4310
4357
|
return [
|
|
4311
4358
|
...super.observedAttributes,
|
|
4312
4359
|
'asset',
|
|
4313
|
-
'cast-shadows'
|
|
4360
|
+
'cast-shadows',
|
|
4361
|
+
'unified'
|
|
4314
4362
|
];
|
|
4315
4363
|
}
|
|
4316
4364
|
attributeChangedCallback(name, _oldValue, newValue) {
|
|
@@ -4322,6 +4370,9 @@ class SplatComponentElement extends ComponentElement {
|
|
|
4322
4370
|
case 'cast-shadows':
|
|
4323
4371
|
this.castShadows = this.hasAttribute('cast-shadows');
|
|
4324
4372
|
break;
|
|
4373
|
+
case 'unified':
|
|
4374
|
+
this.unified = this.hasAttribute('unified');
|
|
4375
|
+
break;
|
|
4325
4376
|
}
|
|
4326
4377
|
}
|
|
4327
4378
|
}
|