@playcanvas/web-components 0.11.1 → 0.13.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/README.md +1 -1
- package/dist/app.d.cts +246 -0
- package/dist/app.d.ts +38 -13
- package/dist/asset.d.cts +218 -0
- package/dist/asset.d.ts +145 -6
- package/dist/async-element.d.cts +103 -0
- package/dist/async-element.d.ts +11 -8
- package/dist/colors.d.cts +1 -0
- package/dist/components/button-component.d.cts +186 -0
- package/dist/components/button-component.d.ts +1 -1
- package/dist/components/camera-component.d.cts +253 -0
- package/dist/components/camera-component.d.ts +1 -1
- package/dist/components/collision-component.d.cts +73 -0
- package/dist/components/collision-component.d.ts +17 -1
- package/dist/components/component.d.cts +82 -0
- package/dist/components/component.d.ts +20 -1
- package/dist/components/element-component.d.cts +316 -0
- package/dist/components/element-component.d.ts +1 -1
- package/dist/components/gsplat-component.d.cts +108 -0
- package/dist/components/gsplat-component.d.ts +1 -1
- package/dist/components/layoutchild-component.d.cts +110 -0
- package/dist/components/layoutchild-component.d.ts +1 -1
- package/dist/components/layoutgroup-component.d.cts +136 -0
- package/dist/components/layoutgroup-component.d.ts +1 -1
- package/dist/components/light-component.d.cts +264 -0
- package/dist/components/light-component.d.ts +1 -1
- package/dist/components/listener-component.d.cts +20 -0
- package/dist/components/listener-component.d.ts +1 -1
- package/dist/components/particlesystem-component.d.cts +52 -0
- package/dist/components/particlesystem-component.d.ts +1 -1
- package/dist/components/render-component.d.cts +76 -0
- package/dist/components/render-component.d.ts +1 -1
- package/dist/components/rigidbody-component.d.cts +88 -0
- package/dist/components/rigidbody-component.d.ts +1 -1
- package/dist/components/screen-component.d.cts +70 -0
- package/dist/components/screen-component.d.ts +1 -1
- package/dist/components/script-component.d.cts +163 -0
- package/dist/components/script-component.d.ts +1 -1
- package/dist/components/script.d.cts +94 -0
- package/dist/components/script.d.ts +1 -1
- package/dist/components/scrollbar-component.d.cts +69 -0
- package/dist/components/scrollbar-component.d.ts +1 -1
- package/dist/components/scrollview-component.d.cts +178 -0
- package/dist/components/scrollview-component.d.ts +1 -1
- package/dist/components/sound-component.d.cts +108 -0
- package/dist/components/sound-component.d.ts +1 -1
- package/dist/components/sound-slot.d.cts +134 -0
- package/dist/components/sound-slot.d.ts +2 -2
- package/dist/custom-elements.json +1127 -179
- package/dist/entity-base.d.cts +67 -0
- package/dist/entity-base.d.ts +67 -0
- package/dist/entity.d.cts +131 -0
- package/dist/entity.d.ts +3 -38
- package/dist/index.d.cts +79 -0
- package/dist/index.d.ts +35 -32
- package/dist/loading-bar.d.cts +35 -0
- package/dist/material.d.cts +1011 -0
- package/dist/material.d.ts +2 -1
- package/dist/model.d.cts +72 -0
- package/dist/model.d.ts +27 -5
- package/dist/module.d.cts +29 -0
- package/dist/module.d.ts +16 -10
- package/dist/node.d.cts +253 -0
- package/dist/node.d.ts +253 -0
- package/dist/parse.d.cts +147 -0
- package/dist/pwc.cjs +1496 -200
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +1497 -201
- 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 +1496 -202
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.cts +117 -0
- package/dist/scene.d.ts +1 -1
- package/dist/sky.d.cts +121 -0
- package/dist/sky.d.ts +1 -1
- package/dist/vscode.html-custom-data.json +127 -5
- package/dist/web-types.json +399 -59
- package/package.json +16 -7
- package/src/app.ts +137 -45
- package/src/asset.ts +439 -9
- package/src/async-element.ts +11 -8
- package/src/components/collision-component.ts +35 -0
- package/src/components/component.ts +93 -3
- package/src/entity-base.ts +136 -0
- package/src/entity.ts +23 -117
- package/src/index.ts +5 -0
- package/src/loading-bar.ts +2 -2
- package/src/material.ts +2 -2
- package/src/model.ts +79 -11
- package/src/module.ts +39 -20
- package/src/node.ts +715 -0
- package/src/sky.ts +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Entity } from 'playcanvas';
|
|
2
|
+
import type { AppElement } from './app.cjs';
|
|
3
|
+
import { AsyncElement } from './async-element.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* The attribute names of the inline `onpointer*` event handlers, shared by every element that
|
|
6
|
+
* fronts an engine entity. Spread into `observedAttributes` by subclasses.
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
declare const POINTER_ATTRIBUTES: readonly ["onpointerenter", "onpointerleave", "onpointerdown", "onpointerup", "onpointermove"];
|
|
10
|
+
/**
|
|
11
|
+
* The base class for elements that front an engine {@link Entity}: `<pc-entity>`, which creates
|
|
12
|
+
* one, and `<pc-node>`, which binds to one inside a model's instantiated hierarchy. It carries
|
|
13
|
+
* what both need — the `entity` contract, registration with the owning application (which joins
|
|
14
|
+
* picked scene nodes back to elements by identity, never by name), and the pointer listener
|
|
15
|
+
* bookkeeping that lets the application lazily attach its canvas handlers.
|
|
16
|
+
*/
|
|
17
|
+
declare class EntityBaseElement extends AsyncElement {
|
|
18
|
+
protected _entity: Entity | null;
|
|
19
|
+
/**
|
|
20
|
+
* The application element this entity is registered with, cached at registration time so the
|
|
21
|
+
* entity can be unregistered even once this element has left the DOM.
|
|
22
|
+
*/
|
|
23
|
+
protected _appElement: AppElement | null;
|
|
24
|
+
/**
|
|
25
|
+
* The pointer event listeners for the entity.
|
|
26
|
+
*/
|
|
27
|
+
private _listeners;
|
|
28
|
+
/**
|
|
29
|
+
* The event types for which an inline `onpointer*` attribute is currently present.
|
|
30
|
+
*/
|
|
31
|
+
private _inlineHandlerTypes;
|
|
32
|
+
/**
|
|
33
|
+
* The PlayCanvas entity instance. `null` until the element is ready, and again once the
|
|
34
|
+
* entity is gone — await {@link whenReady} or the element's `ready()` promise before
|
|
35
|
+
* accessing it.
|
|
36
|
+
* @returns The entity instance, or `null`.
|
|
37
|
+
*/
|
|
38
|
+
get entity(): Entity | null;
|
|
39
|
+
/**
|
|
40
|
+
* Registers `entity` as this element's backing entity with the owning application, which
|
|
41
|
+
* joins engine nodes back to elements by identity (never by name).
|
|
42
|
+
*
|
|
43
|
+
* @param entity - The entity to register.
|
|
44
|
+
*/
|
|
45
|
+
protected _registerEntity(entity: Entity): void;
|
|
46
|
+
/**
|
|
47
|
+
* Removes the registration for `entity`.
|
|
48
|
+
*
|
|
49
|
+
* @param entity - The entity to unregister.
|
|
50
|
+
*/
|
|
51
|
+
protected _unregisterEntity(entity: Entity): void;
|
|
52
|
+
/**
|
|
53
|
+
* Tracks whether an inline `onpointer*` attribute is present. The browser itself compiles and
|
|
54
|
+
* runs these attributes — they are standard `GlobalEventHandlers`, so setting one replaces
|
|
55
|
+
* the previous handler and removing it removes the handler, exactly like `onclick` on any
|
|
56
|
+
* HTML element. But because they bypass {@link addEventListener}, the connect/disconnect
|
|
57
|
+
* bookkeeping that lets the application lazily attach its canvas pointer handlers must be
|
|
58
|
+
* kept in sync here.
|
|
59
|
+
*
|
|
60
|
+
* @param name - The attribute name (e.g. 'onpointerdown').
|
|
61
|
+
* @param value - The attribute value, or `null` when the attribute has been removed.
|
|
62
|
+
*/
|
|
63
|
+
protected _updateInlineHandler(name: string, value: string | null): void;
|
|
64
|
+
addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
|
|
65
|
+
removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
|
|
66
|
+
}
|
|
67
|
+
export { EntityBaseElement, POINTER_ATTRIBUTES };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Entity } from 'playcanvas';
|
|
2
|
+
import type { AppElement } from './app.js';
|
|
3
|
+
import { AsyncElement } from './async-element.js';
|
|
4
|
+
/**
|
|
5
|
+
* The attribute names of the inline `onpointer*` event handlers, shared by every element that
|
|
6
|
+
* fronts an engine entity. Spread into `observedAttributes` by subclasses.
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
declare const POINTER_ATTRIBUTES: readonly ["onpointerenter", "onpointerleave", "onpointerdown", "onpointerup", "onpointermove"];
|
|
10
|
+
/**
|
|
11
|
+
* The base class for elements that front an engine {@link Entity}: `<pc-entity>`, which creates
|
|
12
|
+
* one, and `<pc-node>`, which binds to one inside a model's instantiated hierarchy. It carries
|
|
13
|
+
* what both need — the `entity` contract, registration with the owning application (which joins
|
|
14
|
+
* picked scene nodes back to elements by identity, never by name), and the pointer listener
|
|
15
|
+
* bookkeeping that lets the application lazily attach its canvas handlers.
|
|
16
|
+
*/
|
|
17
|
+
declare class EntityBaseElement extends AsyncElement {
|
|
18
|
+
protected _entity: Entity | null;
|
|
19
|
+
/**
|
|
20
|
+
* The application element this entity is registered with, cached at registration time so the
|
|
21
|
+
* entity can be unregistered even once this element has left the DOM.
|
|
22
|
+
*/
|
|
23
|
+
protected _appElement: AppElement | null;
|
|
24
|
+
/**
|
|
25
|
+
* The pointer event listeners for the entity.
|
|
26
|
+
*/
|
|
27
|
+
private _listeners;
|
|
28
|
+
/**
|
|
29
|
+
* The event types for which an inline `onpointer*` attribute is currently present.
|
|
30
|
+
*/
|
|
31
|
+
private _inlineHandlerTypes;
|
|
32
|
+
/**
|
|
33
|
+
* The PlayCanvas entity instance. `null` until the element is ready, and again once the
|
|
34
|
+
* entity is gone — await {@link whenReady} or the element's `ready()` promise before
|
|
35
|
+
* accessing it.
|
|
36
|
+
* @returns The entity instance, or `null`.
|
|
37
|
+
*/
|
|
38
|
+
get entity(): Entity | null;
|
|
39
|
+
/**
|
|
40
|
+
* Registers `entity` as this element's backing entity with the owning application, which
|
|
41
|
+
* joins engine nodes back to elements by identity (never by name).
|
|
42
|
+
*
|
|
43
|
+
* @param entity - The entity to register.
|
|
44
|
+
*/
|
|
45
|
+
protected _registerEntity(entity: Entity): void;
|
|
46
|
+
/**
|
|
47
|
+
* Removes the registration for `entity`.
|
|
48
|
+
*
|
|
49
|
+
* @param entity - The entity to unregister.
|
|
50
|
+
*/
|
|
51
|
+
protected _unregisterEntity(entity: Entity): void;
|
|
52
|
+
/**
|
|
53
|
+
* Tracks whether an inline `onpointer*` attribute is present. The browser itself compiles and
|
|
54
|
+
* runs these attributes — they are standard `GlobalEventHandlers`, so setting one replaces
|
|
55
|
+
* the previous handler and removing it removes the handler, exactly like `onclick` on any
|
|
56
|
+
* HTML element. But because they bypass {@link addEventListener}, the connect/disconnect
|
|
57
|
+
* bookkeeping that lets the application lazily attach its canvas pointer handlers must be
|
|
58
|
+
* kept in sync here.
|
|
59
|
+
*
|
|
60
|
+
* @param name - The attribute name (e.g. 'onpointerdown').
|
|
61
|
+
* @param value - The attribute value, or `null` when the attribute has been removed.
|
|
62
|
+
*/
|
|
63
|
+
protected _updateInlineHandler(name: string, value: string | null): void;
|
|
64
|
+
addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
|
|
65
|
+
removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
|
|
66
|
+
}
|
|
67
|
+
export { EntityBaseElement, POINTER_ATTRIBUTES };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Vec3 } from 'playcanvas';
|
|
2
|
+
import { EntityBaseElement } from './entity-base.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* The EntityElement interface provides properties and methods for manipulating
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
|
|
6
|
+
* The EntityElement interface also inherits the properties and methods of the
|
|
7
|
+
* {@link HTMLElement} interface.
|
|
8
|
+
*
|
|
9
|
+
* The pointer events below are dispatched by the containing `<pc-app>` element when the pointer
|
|
10
|
+
* intersects this entity's geometry. They are only generated while the entity has a listener for
|
|
11
|
+
* them, registered either with {@link addEventListener} or with the matching inline `onpointer*`
|
|
12
|
+
* attribute.
|
|
13
|
+
*
|
|
14
|
+
* @attribute {string} onpointerenter - Script to run when the pointer moves onto the entity.
|
|
15
|
+
* @attribute {string} onpointerleave - Script to run when the pointer moves off the entity.
|
|
16
|
+
* @attribute {string} onpointermove - Script to run when the pointer moves over the entity.
|
|
17
|
+
* @attribute {string} onpointerdown - Script to run when a pointer button is pressed over the
|
|
18
|
+
* entity.
|
|
19
|
+
* @attribute {string} onpointerup - Script to run when a pointer button is released over the
|
|
20
|
+
* entity.
|
|
21
|
+
* @fires {PointerEvent} pointerenter - Fired when the pointer moves onto the entity.
|
|
22
|
+
* @fires {PointerEvent} pointerleave - Fired when the pointer moves off the entity.
|
|
23
|
+
* @fires {PointerEvent} pointermove - Fired when the pointer moves over the entity.
|
|
24
|
+
* @fires {PointerEvent} pointerdown - Fired when a pointer button is pressed over the entity.
|
|
25
|
+
* @fires {PointerEvent} pointerup - Fired when a pointer button is released over the entity.
|
|
26
|
+
*/
|
|
27
|
+
declare class EntityElement extends EntityBaseElement {
|
|
28
|
+
/**
|
|
29
|
+
* Whether the entity is enabled.
|
|
30
|
+
*/
|
|
31
|
+
private _enabled;
|
|
32
|
+
/**
|
|
33
|
+
* The name of the entity.
|
|
34
|
+
*/
|
|
35
|
+
private _name;
|
|
36
|
+
/**
|
|
37
|
+
* The position of the entity.
|
|
38
|
+
*/
|
|
39
|
+
private _position;
|
|
40
|
+
/**
|
|
41
|
+
* The rotation of the entity.
|
|
42
|
+
*/
|
|
43
|
+
private _rotation;
|
|
44
|
+
/**
|
|
45
|
+
* The scale of the entity.
|
|
46
|
+
*/
|
|
47
|
+
private _scale;
|
|
48
|
+
/**
|
|
49
|
+
* The tags of the entity.
|
|
50
|
+
*/
|
|
51
|
+
private _tags;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the hierarchy has been built for this entity.
|
|
54
|
+
*/
|
|
55
|
+
private _built;
|
|
56
|
+
/**
|
|
57
|
+
* Handles the destruction of the backing entity. Resets the element so a later re-insertion
|
|
58
|
+
* starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
|
|
59
|
+
* and a re-created entity would never be parented. Readiness is re-armed for the same
|
|
60
|
+
* reason — with the entity gone, a resolved ready promise would resume its awaiters against
|
|
61
|
+
* a null `entity`.
|
|
62
|
+
*
|
|
63
|
+
* @param entity - The entity that was destroyed.
|
|
64
|
+
*/
|
|
65
|
+
private _onEntityDestroy;
|
|
66
|
+
connectedCallback(): void;
|
|
67
|
+
disconnectedCallback(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the enabled state of the entity.
|
|
70
|
+
* @param value - Whether the entity is enabled.
|
|
71
|
+
*/
|
|
72
|
+
set enabled(value: boolean);
|
|
73
|
+
/**
|
|
74
|
+
* Gets the enabled state of the entity.
|
|
75
|
+
* @returns Whether the entity is enabled.
|
|
76
|
+
*/
|
|
77
|
+
get enabled(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the name of the entity.
|
|
80
|
+
* @param value - The name of the entity.
|
|
81
|
+
*/
|
|
82
|
+
set name(value: string);
|
|
83
|
+
/**
|
|
84
|
+
* Gets the name of the entity.
|
|
85
|
+
* @returns The name of the entity.
|
|
86
|
+
*/
|
|
87
|
+
get name(): string;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the position of the entity.
|
|
90
|
+
* @param value - The position of the entity.
|
|
91
|
+
*/
|
|
92
|
+
set position(value: Vec3);
|
|
93
|
+
/**
|
|
94
|
+
* Gets the position of the entity.
|
|
95
|
+
* @returns The position of the entity.
|
|
96
|
+
*/
|
|
97
|
+
get position(): Vec3;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the rotation of the entity.
|
|
100
|
+
* @param value - The rotation of the entity.
|
|
101
|
+
*/
|
|
102
|
+
set rotation(value: Vec3);
|
|
103
|
+
/**
|
|
104
|
+
* Gets the rotation of the entity.
|
|
105
|
+
* @returns The rotation of the entity.
|
|
106
|
+
*/
|
|
107
|
+
get rotation(): Vec3;
|
|
108
|
+
/**
|
|
109
|
+
* Sets the scale of the entity.
|
|
110
|
+
* @param value - The scale of the entity.
|
|
111
|
+
*/
|
|
112
|
+
set scale(value: Vec3);
|
|
113
|
+
/**
|
|
114
|
+
* Gets the scale of the entity.
|
|
115
|
+
* @returns The scale of the entity.
|
|
116
|
+
*/
|
|
117
|
+
get scale(): Vec3;
|
|
118
|
+
/**
|
|
119
|
+
* Sets the tags of the entity.
|
|
120
|
+
* @param value - The tags of the entity.
|
|
121
|
+
*/
|
|
122
|
+
set tags(value: string[]);
|
|
123
|
+
/**
|
|
124
|
+
* Gets the tags of the entity.
|
|
125
|
+
* @returns The tags of the entity.
|
|
126
|
+
*/
|
|
127
|
+
get tags(): string[];
|
|
128
|
+
static get observedAttributes(): string[];
|
|
129
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
130
|
+
}
|
|
131
|
+
export { EntityElement };
|
package/dist/entity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Vec3 } from 'playcanvas';
|
|
2
|
+
import { EntityBaseElement } from './entity-base.js';
|
|
3
3
|
/**
|
|
4
4
|
* The EntityElement interface provides properties and methods for manipulating
|
|
5
5
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
|
|
@@ -24,7 +24,7 @@ import { AsyncElement } from './async-element';
|
|
|
24
24
|
* @fires {PointerEvent} pointerdown - Fired when a pointer button is pressed over the entity.
|
|
25
25
|
* @fires {PointerEvent} pointerup - Fired when a pointer button is released over the entity.
|
|
26
26
|
*/
|
|
27
|
-
declare class EntityElement extends
|
|
27
|
+
declare class EntityElement extends EntityBaseElement {
|
|
28
28
|
/**
|
|
29
29
|
* Whether the entity is enabled.
|
|
30
30
|
*/
|
|
@@ -49,31 +49,10 @@ declare class EntityElement extends AsyncElement {
|
|
|
49
49
|
* The tags of the entity.
|
|
50
50
|
*/
|
|
51
51
|
private _tags;
|
|
52
|
-
/**
|
|
53
|
-
* The pointer event listeners for the entity.
|
|
54
|
-
*/
|
|
55
|
-
private _listeners;
|
|
56
|
-
/**
|
|
57
|
-
* The event types for which an inline `onpointer*` attribute is currently present.
|
|
58
|
-
*/
|
|
59
|
-
private _inlineHandlerTypes;
|
|
60
52
|
/**
|
|
61
53
|
* Whether the hierarchy has been built for this entity.
|
|
62
54
|
*/
|
|
63
55
|
private _built;
|
|
64
|
-
private _entity;
|
|
65
|
-
/**
|
|
66
|
-
* The application element this entity is registered with, cached at creation time so the
|
|
67
|
-
* entity can be unregistered even once this element has left the DOM.
|
|
68
|
-
*/
|
|
69
|
-
private _appElement;
|
|
70
|
-
/**
|
|
71
|
-
* The PlayCanvas entity instance. `null` until the element is ready, and again once it has
|
|
72
|
-
* been removed from the document — await {@link whenReady} or the element's `ready()`
|
|
73
|
-
* promise before accessing it.
|
|
74
|
-
* @returns The entity instance, or `null`.
|
|
75
|
-
*/
|
|
76
|
-
get entity(): Entity | null;
|
|
77
56
|
/**
|
|
78
57
|
* Handles the destruction of the backing entity. Resets the element so a later re-insertion
|
|
79
58
|
* starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
|
|
@@ -146,21 +125,7 @@ declare class EntityElement extends AsyncElement {
|
|
|
146
125
|
* @returns The tags of the entity.
|
|
147
126
|
*/
|
|
148
127
|
get tags(): string[];
|
|
149
|
-
/**
|
|
150
|
-
* Tracks whether an inline `onpointer*` attribute is present. The browser itself compiles and
|
|
151
|
-
* runs these attributes — they are standard `GlobalEventHandlers`, so setting one replaces
|
|
152
|
-
* the previous handler and removing it removes the handler, exactly like `onclick` on any
|
|
153
|
-
* HTML element. But because they bypass {@link addEventListener}, the connect/disconnect
|
|
154
|
-
* bookkeeping that lets the application lazily attach its canvas pointer handlers must be
|
|
155
|
-
* kept in sync here.
|
|
156
|
-
*
|
|
157
|
-
* @param name - The attribute name (e.g. 'onpointerdown').
|
|
158
|
-
* @param value - The attribute value, or `null` when the attribute has been removed.
|
|
159
|
-
*/
|
|
160
|
-
private _updateInlineHandler;
|
|
161
128
|
static get observedAttributes(): string[];
|
|
162
129
|
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
163
|
-
addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
|
|
164
|
-
removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
|
|
165
130
|
}
|
|
166
131
|
export { EntityElement };
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Engine Web Components module provides a set of Web Components for the PlayCanvas Engine.
|
|
3
|
+
* While these components are normally instantiated in a declarative fashion using HTML, this
|
|
4
|
+
* reference covers the TypeScript/JavaScript API that allows these components to be created
|
|
5
|
+
* programmatically.
|
|
6
|
+
*
|
|
7
|
+
* @module EngineWebComponents
|
|
8
|
+
*/
|
|
9
|
+
import { AsyncElement, whenReady } from './async-element.cjs';
|
|
10
|
+
import { ModuleElement } from './module.cjs';
|
|
11
|
+
import { AppElement } from './app.cjs';
|
|
12
|
+
import { EntityElement } from './entity.cjs';
|
|
13
|
+
import { AssetElement } from './asset.cjs';
|
|
14
|
+
import { ListenerComponentElement } from './components/listener-component.cjs';
|
|
15
|
+
import { ButtonComponentElement } from './components/button-component.cjs';
|
|
16
|
+
import { CameraComponentElement } from './components/camera-component.cjs';
|
|
17
|
+
import { CollisionComponentElement } from './components/collision-component.cjs';
|
|
18
|
+
import { ComponentElement } from './components/component.cjs';
|
|
19
|
+
import { ElementComponentElement } from './components/element-component.cjs';
|
|
20
|
+
import { LayoutChildComponentElement } from './components/layoutchild-component.cjs';
|
|
21
|
+
import { LayoutGroupComponentElement } from './components/layoutgroup-component.cjs';
|
|
22
|
+
import { LightComponentElement } from './components/light-component.cjs';
|
|
23
|
+
import { ParticleSystemComponentElement } from './components/particlesystem-component.cjs';
|
|
24
|
+
import { RenderComponentElement } from './components/render-component.cjs';
|
|
25
|
+
import { RigidBodyComponentElement } from './components/rigidbody-component.cjs';
|
|
26
|
+
import { ScreenComponentElement } from './components/screen-component.cjs';
|
|
27
|
+
import { ScrollbarComponentElement } from './components/scrollbar-component.cjs';
|
|
28
|
+
import { ScrollViewComponentElement } from './components/scrollview-component.cjs';
|
|
29
|
+
import { ScriptComponentElement } from './components/script-component.cjs';
|
|
30
|
+
import { ScriptElement } from './components/script.cjs';
|
|
31
|
+
import { SoundComponentElement } from './components/sound-component.cjs';
|
|
32
|
+
import { SoundSlotElement } from './components/sound-slot.cjs';
|
|
33
|
+
import { GSplatComponentElement } from './components/gsplat-component.cjs';
|
|
34
|
+
import { EntityBaseElement } from './entity-base.cjs';
|
|
35
|
+
import { MaterialElement } from './material.cjs';
|
|
36
|
+
import { ModelElement } from './model.cjs';
|
|
37
|
+
import { NodeElement } from './node.cjs';
|
|
38
|
+
import { SceneElement } from './scene.cjs';
|
|
39
|
+
import { SkyElement } from './sky.cjs';
|
|
40
|
+
import type { ScriptAttributesChangeEvent, ScriptEnableChangeEvent, ScriptNameChangeEvent } from './components/script-component.cjs';
|
|
41
|
+
declare global {
|
|
42
|
+
interface HTMLElementEventMap {
|
|
43
|
+
scriptattributeschange: ScriptAttributesChangeEvent;
|
|
44
|
+
scriptenablechange: ScriptEnableChangeEvent;
|
|
45
|
+
scriptnamechange: ScriptNameChangeEvent;
|
|
46
|
+
}
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
'pc-app': AppElement;
|
|
49
|
+
'pc-asset': AssetElement;
|
|
50
|
+
'pc-button': ButtonComponentElement;
|
|
51
|
+
'pc-camera': CameraComponentElement;
|
|
52
|
+
'pc-collision': CollisionComponentElement;
|
|
53
|
+
'pc-element': ElementComponentElement;
|
|
54
|
+
'pc-entity': EntityElement;
|
|
55
|
+
'pc-gsplat': GSplatComponentElement;
|
|
56
|
+
'pc-layoutchild': LayoutChildComponentElement;
|
|
57
|
+
'pc-layoutgroup': LayoutGroupComponentElement;
|
|
58
|
+
'pc-light': LightComponentElement;
|
|
59
|
+
'pc-listener': ListenerComponentElement;
|
|
60
|
+
'pc-material': MaterialElement;
|
|
61
|
+
'pc-model': ModelElement;
|
|
62
|
+
'pc-module': ModuleElement;
|
|
63
|
+
'pc-node': NodeElement;
|
|
64
|
+
'pc-particles': ParticleSystemComponentElement;
|
|
65
|
+
'pc-render': RenderComponentElement;
|
|
66
|
+
'pc-rigidbody': RigidBodyComponentElement;
|
|
67
|
+
'pc-scene': SceneElement;
|
|
68
|
+
'pc-screen': ScreenComponentElement;
|
|
69
|
+
'pc-script': ScriptElement;
|
|
70
|
+
'pc-scripts': ScriptComponentElement;
|
|
71
|
+
'pc-scrollbar': ScrollbarComponentElement;
|
|
72
|
+
'pc-scrollview': ScrollViewComponentElement;
|
|
73
|
+
'pc-sky': SkyElement;
|
|
74
|
+
'pc-sound': SoundSlotElement;
|
|
75
|
+
'pc-sounds': SoundComponentElement;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export { AsyncElement, ModuleElement, AppElement, EntityElement, AssetElement, ButtonComponentElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, LayoutChildComponentElement, LayoutGroupComponentElement, ParticleSystemComponentElement, LightComponentElement, ListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScrollbarComponentElement, ScrollViewComponentElement, ScriptComponentElement, ScriptElement, SoundComponentElement, SoundSlotElement, GSplatComponentElement, EntityBaseElement, MaterialElement, ModelElement, NodeElement, SceneElement, SkyElement, whenReady };
|
|
79
|
+
export type { AsyncElementTagName } from './async-element.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,36 +6,38 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module EngineWebComponents
|
|
8
8
|
*/
|
|
9
|
-
import { AsyncElement, whenReady } from './async-element';
|
|
10
|
-
import { ModuleElement } from './module';
|
|
11
|
-
import { AppElement } from './app';
|
|
12
|
-
import { EntityElement } from './entity';
|
|
13
|
-
import { AssetElement } from './asset';
|
|
14
|
-
import { ListenerComponentElement } from './components/listener-component';
|
|
15
|
-
import { ButtonComponentElement } from './components/button-component';
|
|
16
|
-
import { CameraComponentElement } from './components/camera-component';
|
|
17
|
-
import { CollisionComponentElement } from './components/collision-component';
|
|
18
|
-
import { ComponentElement } from './components/component';
|
|
19
|
-
import { ElementComponentElement } from './components/element-component';
|
|
20
|
-
import { LayoutChildComponentElement } from './components/layoutchild-component';
|
|
21
|
-
import { LayoutGroupComponentElement } from './components/layoutgroup-component';
|
|
22
|
-
import { LightComponentElement } from './components/light-component';
|
|
23
|
-
import { ParticleSystemComponentElement } from './components/particlesystem-component';
|
|
24
|
-
import { RenderComponentElement } from './components/render-component';
|
|
25
|
-
import { RigidBodyComponentElement } from './components/rigidbody-component';
|
|
26
|
-
import { ScreenComponentElement } from './components/screen-component';
|
|
27
|
-
import { ScrollbarComponentElement } from './components/scrollbar-component';
|
|
28
|
-
import { ScrollViewComponentElement } from './components/scrollview-component';
|
|
29
|
-
import { ScriptComponentElement } from './components/script-component';
|
|
30
|
-
import { ScriptElement } from './components/script';
|
|
31
|
-
import { SoundComponentElement } from './components/sound-component';
|
|
32
|
-
import { SoundSlotElement } from './components/sound-slot';
|
|
33
|
-
import { GSplatComponentElement } from './components/gsplat-component';
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import
|
|
9
|
+
import { AsyncElement, whenReady } from './async-element.js';
|
|
10
|
+
import { ModuleElement } from './module.js';
|
|
11
|
+
import { AppElement } from './app.js';
|
|
12
|
+
import { EntityElement } from './entity.js';
|
|
13
|
+
import { AssetElement } from './asset.js';
|
|
14
|
+
import { ListenerComponentElement } from './components/listener-component.js';
|
|
15
|
+
import { ButtonComponentElement } from './components/button-component.js';
|
|
16
|
+
import { CameraComponentElement } from './components/camera-component.js';
|
|
17
|
+
import { CollisionComponentElement } from './components/collision-component.js';
|
|
18
|
+
import { ComponentElement } from './components/component.js';
|
|
19
|
+
import { ElementComponentElement } from './components/element-component.js';
|
|
20
|
+
import { LayoutChildComponentElement } from './components/layoutchild-component.js';
|
|
21
|
+
import { LayoutGroupComponentElement } from './components/layoutgroup-component.js';
|
|
22
|
+
import { LightComponentElement } from './components/light-component.js';
|
|
23
|
+
import { ParticleSystemComponentElement } from './components/particlesystem-component.js';
|
|
24
|
+
import { RenderComponentElement } from './components/render-component.js';
|
|
25
|
+
import { RigidBodyComponentElement } from './components/rigidbody-component.js';
|
|
26
|
+
import { ScreenComponentElement } from './components/screen-component.js';
|
|
27
|
+
import { ScrollbarComponentElement } from './components/scrollbar-component.js';
|
|
28
|
+
import { ScrollViewComponentElement } from './components/scrollview-component.js';
|
|
29
|
+
import { ScriptComponentElement } from './components/script-component.js';
|
|
30
|
+
import { ScriptElement } from './components/script.js';
|
|
31
|
+
import { SoundComponentElement } from './components/sound-component.js';
|
|
32
|
+
import { SoundSlotElement } from './components/sound-slot.js';
|
|
33
|
+
import { GSplatComponentElement } from './components/gsplat-component.js';
|
|
34
|
+
import { EntityBaseElement } from './entity-base.js';
|
|
35
|
+
import { MaterialElement } from './material.js';
|
|
36
|
+
import { ModelElement } from './model.js';
|
|
37
|
+
import { NodeElement } from './node.js';
|
|
38
|
+
import { SceneElement } from './scene.js';
|
|
39
|
+
import { SkyElement } from './sky.js';
|
|
40
|
+
import type { ScriptAttributesChangeEvent, ScriptEnableChangeEvent, ScriptNameChangeEvent } from './components/script-component.js';
|
|
39
41
|
declare global {
|
|
40
42
|
interface HTMLElementEventMap {
|
|
41
43
|
scriptattributeschange: ScriptAttributesChangeEvent;
|
|
@@ -58,6 +60,7 @@ declare global {
|
|
|
58
60
|
'pc-material': MaterialElement;
|
|
59
61
|
'pc-model': ModelElement;
|
|
60
62
|
'pc-module': ModuleElement;
|
|
63
|
+
'pc-node': NodeElement;
|
|
61
64
|
'pc-particles': ParticleSystemComponentElement;
|
|
62
65
|
'pc-render': RenderComponentElement;
|
|
63
66
|
'pc-rigidbody': RigidBodyComponentElement;
|
|
@@ -72,5 +75,5 @@ declare global {
|
|
|
72
75
|
'pc-sounds': SoundComponentElement;
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
|
-
export { AsyncElement, ModuleElement, AppElement, EntityElement, AssetElement, ButtonComponentElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, LayoutChildComponentElement, LayoutGroupComponentElement, ParticleSystemComponentElement, LightComponentElement, ListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScrollbarComponentElement, ScrollViewComponentElement, ScriptComponentElement, ScriptElement, SoundComponentElement, SoundSlotElement, GSplatComponentElement, MaterialElement, ModelElement, SceneElement, SkyElement, whenReady };
|
|
76
|
-
export type { AsyncElementTagName } from './async-element';
|
|
78
|
+
export { AsyncElement, ModuleElement, AppElement, EntityElement, AssetElement, ButtonComponentElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, LayoutChildComponentElement, LayoutGroupComponentElement, ParticleSystemComponentElement, LightComponentElement, ListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScrollbarComponentElement, ScrollViewComponentElement, ScriptComponentElement, ScriptElement, SoundComponentElement, SoundSlotElement, GSplatComponentElement, EntityBaseElement, MaterialElement, ModelElement, NodeElement, SceneElement, SkyElement, whenReady };
|
|
79
|
+
export type { AsyncElementTagName } from './async-element.js';
|
|
@@ -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 };
|