@playcanvas/web-components 0.10.0 → 0.10.1

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/entity.d.ts CHANGED
@@ -63,11 +63,12 @@ declare class EntityElement extends AsyncElement {
63
63
  private _built;
64
64
  private _entity;
65
65
  /**
66
- * The PlayCanvas entity instance. Available once the element is ready await
67
- * {@link whenReady} or the element's `ready()` promise before accessing it.
68
- * @returns The entity instance.
66
+ * The PlayCanvas entity instance. `null` until the element is ready, and again once it has
67
+ * been removed from the document — await {@link whenReady} or the element's `ready()`
68
+ * promise before accessing it.
69
+ * @returns The entity instance, or `null`.
69
70
  */
70
- get entity(): Entity;
71
+ get entity(): Entity | null;
71
72
  createEntity(app: AppBase): void;
72
73
  buildHierarchy(app: AppBase): void;
73
74
  connectedCallback(): void;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The slim progress bar `<pc-app>` shows while it boots and preloads. An implementation detail of
3
+ * AppElement rather than a custom element, so its shape can change without a breaking change.
4
+ *
5
+ * All styling is inline, so the library injects no stylesheet. The colors and height resolve CSS
6
+ * custom properties — `--pc-loading-bar-color`, `--pc-loading-bar-background` and
7
+ * `--pc-loading-bar-height` — so a page can theme the bar from `pc-app` or `:root`.
8
+ */
9
+ declare class LoadingBar {
10
+ private _track;
11
+ private _fill;
12
+ private _sweep;
13
+ private _removal;
14
+ /**
15
+ * Creates the bar and appends it to `parent`, starting in the indeterminate state.
16
+ * @param parent - The element to append the bar to.
17
+ */
18
+ constructor(parent: HTMLElement);
19
+ /**
20
+ * Reflects preload progress, switching the bar from indeterminate to determinate on the first
21
+ * call.
22
+ * @param loaded - The number of assets that have finished loading.
23
+ * @param total - The number of assets being preloaded.
24
+ */
25
+ progress(loaded: number, total: number): void;
26
+ /**
27
+ * Fills the bar, fades it out and removes it. Idempotent.
28
+ */
29
+ complete(): void;
30
+ /**
31
+ * Removes the bar immediately, cancelling any pending fade. Idempotent.
32
+ */
33
+ destroy(): void;
34
+ }
35
+ export { LoadingBar };
@@ -22,8 +22,14 @@ type TextureSlot = 'aoMap' | 'diffuseMap' | 'emissiveMap' | 'glossMap' | 'height
22
22
  * created on insertion.
23
23
  *
24
24
  * The element is metal/rough by default: unlike a bare `StandardMaterial` it enables the metalness
25
- * workflow, which is what the `metalness-*` attributes assume and what glTF means by PBR. The
26
- * `roughness` and `roughness-map` attributes are aliases for `gloss` and `gloss-map` that
25
+ * workflow, which is what the `metalness-*` attributes assume and what glTF means by PBR. It also
26
+ * defaults `metalness` to 0 rather than the engine's 1, because those two defaults have to be
27
+ * chosen together - the engine's 1 is unreachable under its own `useMetalness` of false, and with
28
+ * the workflow on it would make every material fully metallic, so `<pc-material diffuse="crimson">`
29
+ * would render as dark tinted reflections of an environment that may not exist rather than as a
30
+ * crimson surface. `metalness="1"` remains one attribute away.
31
+ *
32
+ * The `roughness` and `roughness-map` attributes are aliases for `gloss` and `gloss-map` that
27
33
  * additionally invert the gloss channel; do not mix the two families on one element.
28
34
  *
29
35
  * The two aliases are documented here rather than on an accessor, because they resolve to the