@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/app.d.ts +52 -7
- package/dist/asset.d.ts +9 -0
- package/dist/async-element.d.ts +12 -2
- package/dist/components/component.d.ts +5 -4
- package/dist/custom-elements.json +583 -110
- package/dist/entity.d.ts +5 -4
- package/dist/loading-bar.d.ts +35 -0
- package/dist/material.d.ts +8 -2
- package/dist/pwc.cjs +385 -105
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +385 -105
- 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.min.mjs +1 -1
- package/dist/pwc.min.mjs.map +1 -1
- package/dist/pwc.mjs +385 -105
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.ts +11 -3
- package/dist/vscode.html-custom-data.json +8 -3
- package/dist/web-types.json +322 -78
- package/package.json +1 -1
- package/src/app.ts +172 -73
- package/src/asset.ts +25 -0
- package/src/async-element.ts +14 -4
- package/src/components/component.ts +6 -5
- package/src/entity.ts +34 -18
- package/src/loading-bar.ts +122 -0
- package/src/material.ts +10 -4
- package/src/scene.ts +49 -19
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.
|
|
67
|
-
* {@link whenReady} or the element's `ready()`
|
|
68
|
-
*
|
|
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 };
|
package/dist/material.d.ts
CHANGED
|
@@ -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.
|
|
26
|
-
* `
|
|
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
|