@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/dist/pwc.js CHANGED
@@ -2120,6 +2120,7 @@
2120
2120
  this._asset = '';
2121
2121
  this._autoWidth = true;
2122
2122
  this._color = new playcanvas.Color(1, 1, 1, 1);
2123
+ this._enableMarkup = false;
2123
2124
  this._fontSize = 32;
2124
2125
  this._lineHeight = 32;
2125
2126
  this._pivot = new playcanvas.Vec2(0.5, 0.5);
@@ -2136,6 +2137,7 @@
2136
2137
  anchor: this._anchor,
2137
2138
  autoWidth: this._autoWidth,
2138
2139
  color: this._color,
2140
+ enableMarkup: this._enableMarkup,
2139
2141
  fontAsset: AssetElement.get(this._asset).id,
2140
2142
  fontSize: this._fontSize,
2141
2143
  lineHeight: this._lineHeight,
@@ -2222,6 +2224,23 @@
2222
2224
  get color() {
2223
2225
  return this._color;
2224
2226
  }
2227
+ /**
2228
+ * Sets whether the element component should use markup.
2229
+ * @param value - Whether to enable markup.
2230
+ */
2231
+ set enableMarkup(value) {
2232
+ this._enableMarkup = value;
2233
+ if (this.component) {
2234
+ this.component.enableMarkup = value;
2235
+ }
2236
+ }
2237
+ /**
2238
+ * Gets whether the element component should use markup.
2239
+ * @returns Whether markup is enabled.
2240
+ */
2241
+ get enableMarkup() {
2242
+ return this._enableMarkup;
2243
+ }
2225
2244
  /**
2226
2245
  * Sets the font size of the element component.
2227
2246
  * @param value - The font size.
@@ -2348,6 +2367,7 @@
2348
2367
  'asset',
2349
2368
  'auto-width',
2350
2369
  'color',
2370
+ 'enable-markup',
2351
2371
  'font-size',
2352
2372
  'line-height',
2353
2373
  'pivot',
@@ -2372,6 +2392,9 @@
2372
2392
  case 'color':
2373
2393
  this.color = parseColor(newValue);
2374
2394
  break;
2395
+ case 'enable-markup':
2396
+ this.enableMarkup = this.hasAttribute(name);
2397
+ break;
2375
2398
  case 'font-size':
2376
2399
  this.fontSize = Number(newValue);
2377
2400
  break;