@playcanvas/web-components 0.1.8 → 0.1.9
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 +10 -1
- package/dist/asset.d.ts +3 -1
- package/dist/async-element.d.ts +2 -1
- package/dist/components/camera-component.d.ts +4 -4
- package/dist/components/collision-component.d.ts +4 -4
- package/dist/components/component.d.ts +3 -1
- package/dist/components/element-component.d.ts +4 -1
- package/dist/components/gsplat-component.d.ts +4 -1
- package/dist/components/light-component.d.ts +4 -4
- package/dist/components/listener-component.d.ts +4 -1
- package/dist/components/render-component.d.ts +4 -1
- package/dist/components/rigidbody-component.d.ts +4 -4
- package/dist/components/screen-component.d.ts +4 -1
- package/dist/components/script-component.d.ts +4 -1
- package/dist/components/script.d.ts +3 -1
- package/dist/components/sound-component.d.ts +4 -1
- package/dist/components/sound-slot.d.ts +3 -1
- package/dist/entity.d.ts +7 -3
- package/dist/material.d.ts +3 -1
- package/dist/model.d.ts +3 -1
- package/dist/module.d.ts +6 -0
- package/dist/pwc.cjs +161 -77
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +161 -77
- 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 +161 -77
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.ts +3 -1
- package/dist/sky.d.ts +3 -1
- package/package.json +8 -8
- package/src/app.ts +28 -1
- package/src/asset.ts +3 -1
- package/src/async-element.ts +2 -1
- package/src/components/camera-component.ts +4 -4
- package/src/components/collision-component.ts +4 -4
- package/src/components/component.ts +3 -1
- package/src/components/element-component.ts +4 -2
- package/src/components/gsplat-component.ts +4 -1
- package/src/components/light-component.ts +4 -4
- package/src/components/listener-component.ts +4 -1
- package/src/components/render-component.ts +4 -1
- package/src/components/rigidbody-component.ts +4 -4
- package/src/components/screen-component.ts +4 -1
- package/src/components/script-component.ts +4 -1
- package/src/components/script.ts +3 -1
- package/src/components/sound-component.ts +4 -1
- package/src/components/sound-slot.ts +3 -1
- package/src/entity.ts +61 -31
- package/src/material.ts +3 -1
- package/src/model.ts +3 -1
- package/src/module.ts +6 -0
- package/src/scene.ts +13 -11
- package/src/sky.ts +3 -1
package/dist/app.d.ts
CHANGED
|
@@ -13,12 +13,15 @@ declare class AppElement extends AsyncElement {
|
|
|
13
13
|
private _depth;
|
|
14
14
|
private _stencil;
|
|
15
15
|
private _highResolution;
|
|
16
|
+
private _hierarchyReady;
|
|
16
17
|
/**
|
|
17
18
|
* The PlayCanvas application instance.
|
|
18
19
|
*/
|
|
19
20
|
app: Application | null;
|
|
20
21
|
/**
|
|
21
|
-
* Creates a new AppElement.
|
|
22
|
+
* Creates a new AppElement instance.
|
|
23
|
+
*
|
|
24
|
+
* @ignore
|
|
22
25
|
*/
|
|
23
26
|
constructor();
|
|
24
27
|
connectedCallback(): Promise<void>;
|
|
@@ -54,6 +57,12 @@ declare class AppElement extends AsyncElement {
|
|
|
54
57
|
* @returns The depth flag.
|
|
55
58
|
*/
|
|
56
59
|
get depth(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the hierarchy ready flag.
|
|
62
|
+
* @returns The hierarchy ready flag.
|
|
63
|
+
* @ignore
|
|
64
|
+
*/
|
|
65
|
+
get hierarchyReady(): boolean;
|
|
57
66
|
/**
|
|
58
67
|
* Sets the high resolution flag. When true, the application will render at the device's
|
|
59
68
|
* physical resolution. When false, the application will render at CSS resolution.
|
package/dist/asset.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Asset } from 'playcanvas';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The AssetElement interface provides properties and methods for manipulating
|
|
4
|
+
* `<pc-asset>` elements. The AssetElement interface also inherits the properties and
|
|
5
|
+
* methods of the {@link HTMLElement} interface.
|
|
4
6
|
*/
|
|
5
7
|
declare class AssetElement extends HTMLElement {
|
|
6
8
|
private _preload;
|
package/dist/async-element.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AppElement } from './app';
|
|
2
2
|
import { EntityElement } from './entity';
|
|
3
3
|
/**
|
|
4
|
-
* Base class for all PlayCanvas
|
|
4
|
+
* Base class for all PlayCanvas Web Components that initialize asynchronously.
|
|
5
5
|
*/
|
|
6
6
|
declare class AsyncElement extends HTMLElement {
|
|
7
7
|
private _readyPromise;
|
|
8
8
|
private _readyResolve;
|
|
9
|
+
/** @ignore */
|
|
9
10
|
constructor();
|
|
10
11
|
get closestApp(): AppElement;
|
|
11
12
|
get closestEntity(): EntityElement;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CameraComponent, Color, Vec4 } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The CameraComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-camera>` elements. The CameraComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -21,9 +23,7 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
21
23
|
private _priority;
|
|
22
24
|
private _rect;
|
|
23
25
|
private _scissorRect;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new CameraComponentElement.
|
|
26
|
-
*/
|
|
26
|
+
/** @ignore */
|
|
27
27
|
constructor();
|
|
28
28
|
getInitialComponentData(): {
|
|
29
29
|
clearColor: Color;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CollisionComponent, Quat, Vec3 } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The CollisionComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-collision>` elements. The CollisionComponentElement interface also inherits the properties
|
|
6
|
+
* and methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -14,9 +16,7 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
14
16
|
private _linearOffset;
|
|
15
17
|
private _radius;
|
|
16
18
|
private _type;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new CollisionComponentElement.
|
|
19
|
-
*/
|
|
19
|
+
/** @ignore */
|
|
20
20
|
constructor();
|
|
21
21
|
getInitialComponentData(): {
|
|
22
22
|
axis: number;
|
|
@@ -10,8 +10,10 @@ declare class ComponentElement extends AsyncElement {
|
|
|
10
10
|
private _enabled;
|
|
11
11
|
private _component;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Creates a new ComponentElement instance.
|
|
14
|
+
*
|
|
14
15
|
* @param componentName - The name of the component.
|
|
16
|
+
* @ignore
|
|
15
17
|
*/
|
|
16
18
|
constructor(componentName: string);
|
|
17
19
|
getInitialComponentData(): {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Color, ElementComponent, Vec2, Vec4 } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The ElementComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-element>` elements. The ElementComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -17,6 +19,7 @@ declare class ElementComponentElement extends ComponentElement {
|
|
|
17
19
|
private _type;
|
|
18
20
|
private _width;
|
|
19
21
|
private _wrapLines;
|
|
22
|
+
/** @ignore */
|
|
20
23
|
constructor();
|
|
21
24
|
initComponent(): void;
|
|
22
25
|
getInitialComponentData(): {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { GSplatComponent } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The GSplatComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-splat>` elements. The GSplatComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
8
10
|
declare class GSplatComponentElement extends ComponentElement {
|
|
9
11
|
private _asset;
|
|
12
|
+
/** @ignore */
|
|
10
13
|
constructor();
|
|
11
14
|
getInitialComponentData(): {
|
|
12
15
|
asset: import("playcanvas").Asset | null | undefined;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Color, LightComponent } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The LightComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-light>` elements. The LightComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -17,9 +19,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
17
19
|
private _shadowDistance;
|
|
18
20
|
private _shadowResolution;
|
|
19
21
|
private _type;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a new LightComponentElement.
|
|
22
|
-
*/
|
|
22
|
+
/** @ignore */
|
|
23
23
|
constructor();
|
|
24
24
|
getInitialComponentData(): {
|
|
25
25
|
castShadows: boolean;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { AudioListenerComponent } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The ListenerComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-listener>` elements. The ListenerComponentElement interface also inherits the properties
|
|
6
|
+
* and methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
8
10
|
declare class ListenerComponentElement extends ComponentElement {
|
|
11
|
+
/** @ignore */
|
|
9
12
|
constructor();
|
|
10
13
|
/**
|
|
11
14
|
* Gets the audio listener component.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { RenderComponent, StandardMaterial } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The RenderComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-render>` elements. The RenderComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -10,6 +12,7 @@ declare class RenderComponentElement extends ComponentElement {
|
|
|
10
12
|
private _material;
|
|
11
13
|
private _receiveShadows;
|
|
12
14
|
private _type;
|
|
15
|
+
/** @ignore */
|
|
13
16
|
constructor();
|
|
14
17
|
getInitialComponentData(): {
|
|
15
18
|
type: "box" | "asset" | "capsule" | "cone" | "cylinder" | "plane" | "sphere";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { RigidBodyComponent, Vec3 } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The RigidBodyComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-rigidbody>` elements. The RigidBodyComponentElement interface also inherits the properties
|
|
6
|
+
* and methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -42,9 +44,7 @@ declare class RigidBodyComponentElement extends ComponentElement {
|
|
|
42
44
|
* The type of the rigidbody.
|
|
43
45
|
*/
|
|
44
46
|
private _type;
|
|
45
|
-
/**
|
|
46
|
-
* Creates a new RigidBodyComponentElement.
|
|
47
|
-
*/
|
|
47
|
+
/** @ignore */
|
|
48
48
|
constructor();
|
|
49
49
|
getInitialComponentData(): {
|
|
50
50
|
angularDamping: number;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ScreenComponent, Vec2 } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The ScreenComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-screen>` elements. The ScreenComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -12,6 +14,7 @@ declare class ScreenComponentElement extends ComponentElement {
|
|
|
12
14
|
private _priority;
|
|
13
15
|
private _blend;
|
|
14
16
|
private _scaleBlend;
|
|
17
|
+
/** @ignore */
|
|
15
18
|
constructor();
|
|
16
19
|
getInitialComponentData(): {
|
|
17
20
|
priority: number;
|
|
@@ -17,12 +17,15 @@ declare global {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* The ScriptComponentElement interface provides properties and methods for manipulating
|
|
21
|
+
* `<pc-scripts>` elements. The ScriptComponentElement interface also inherits the properties and
|
|
22
|
+
* methods of the {@link HTMLElement} interface.
|
|
21
23
|
*
|
|
22
24
|
* @category Components
|
|
23
25
|
*/
|
|
24
26
|
declare class ScriptComponentElement extends ComponentElement {
|
|
25
27
|
private observer;
|
|
28
|
+
/** @ignore */
|
|
26
29
|
constructor();
|
|
27
30
|
initComponent(): void;
|
|
28
31
|
private applyAttributes;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The ScriptElement interface provides properties and methods for manipulating
|
|
3
|
+
* `<pc-script>` elements. The ScriptElement interface also inherits the properties and
|
|
4
|
+
* methods of the {@link HTMLElement} interface.
|
|
3
5
|
*/
|
|
4
6
|
declare class ScriptElement extends HTMLElement {
|
|
5
7
|
private _attributes;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SoundComponent } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The SoundComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-sounds>` elements. The SoundComponentElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*
|
|
6
8
|
* @category Components
|
|
7
9
|
*/
|
|
@@ -13,6 +15,7 @@ declare class SoundComponentElement extends ComponentElement {
|
|
|
13
15
|
private _refDistance;
|
|
14
16
|
private _rollOffFactor;
|
|
15
17
|
private _volume;
|
|
18
|
+
/** @ignore */
|
|
16
19
|
constructor();
|
|
17
20
|
getInitialComponentData(): {
|
|
18
21
|
distanceModel: "exponential" | "inverse" | "linear";
|
|
@@ -2,7 +2,9 @@ import { SoundSlot } from 'playcanvas';
|
|
|
2
2
|
import { AsyncElement } from '../async-element';
|
|
3
3
|
import { SoundComponentElement } from './sound-component';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The SoundSlotElement interface provides properties and methods for manipulating
|
|
6
|
+
* `<pc-sound>` elements. The SoundSlotElement interface also inherits the properties and
|
|
7
|
+
* methods of the {@link AsyncElement} interface.
|
|
6
8
|
*/
|
|
7
9
|
declare class SoundSlotElement extends AsyncElement {
|
|
8
10
|
private _asset;
|
package/dist/entity.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Entity, Vec3 } from 'playcanvas';
|
|
1
|
+
import { Application, Entity, Vec3 } from 'playcanvas';
|
|
2
2
|
import { AsyncElement } from './async-element';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The EntityElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-entity>` elements. The EntityElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
7
|
*/
|
|
6
8
|
declare class EntityElement extends AsyncElement {
|
|
7
9
|
/**
|
|
@@ -32,7 +34,9 @@ declare class EntityElement extends AsyncElement {
|
|
|
32
34
|
* The PlayCanvas entity instance.
|
|
33
35
|
*/
|
|
34
36
|
entity: Entity | null;
|
|
35
|
-
|
|
37
|
+
createEntity(app: Application): void;
|
|
38
|
+
buildHierarchy(app: Application): void;
|
|
39
|
+
connectedCallback(): void;
|
|
36
40
|
disconnectedCallback(): void;
|
|
37
41
|
/**
|
|
38
42
|
* Sets the enabled state of the entity.
|
package/dist/material.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Color, StandardMaterial } from 'playcanvas';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The MaterialElement interface provides properties and methods for manipulating
|
|
4
|
+
* `<pc-material>` elements. The MaterialElement interface also inherits the properties and
|
|
5
|
+
* methods of the {@link HTMLElement} interface.
|
|
4
6
|
*/
|
|
5
7
|
declare class MaterialElement extends HTMLElement {
|
|
6
8
|
private _diffuse;
|
package/dist/model.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AsyncElement } from './async-element';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The ModelElement interface provides properties and methods for manipulating
|
|
4
|
+
* `<pc-model>` elements. The ModelElement interface also inherits the properties and
|
|
5
|
+
* methods of the {@link HTMLElement} interface.
|
|
4
6
|
*/
|
|
5
7
|
declare class ModelElement extends AsyncElement {
|
|
6
8
|
private _asset;
|
package/dist/module.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ModuleElement interface provides properties and methods for manipulating
|
|
3
|
+
* `<pc-module>` elements. The ModuleElement interface also inherits the properties and
|
|
4
|
+
* methods of the {@link HTMLElement} interface.
|
|
5
|
+
*/
|
|
1
6
|
declare class ModuleElement extends HTMLElement {
|
|
2
7
|
private loadPromise;
|
|
8
|
+
/** @ignore */
|
|
3
9
|
constructor();
|
|
4
10
|
private loadModule;
|
|
5
11
|
getLoadPromise(): Promise<void>;
|