@playcanvas/web-components 0.19.0 → 0.20.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/app.d.cts +14 -0
- package/dist/app.d.ts +14 -0
- package/dist/components/button-component.d.cts +9 -5
- package/dist/components/button-component.d.ts +9 -5
- package/dist/components/joint-component.d.cts +24 -10
- package/dist/components/joint-component.d.ts +24 -10
- package/dist/components/script-component.d.cts +4 -2
- package/dist/components/script-component.d.ts +4 -2
- package/dist/components/script-instance.d.cts +14 -6
- package/dist/components/script-instance.d.ts +14 -6
- package/dist/components/scroll-view-component.d.cts +24 -12
- package/dist/components/scroll-view-component.d.ts +24 -12
- package/dist/components/scrollbar-component.d.cts +6 -3
- package/dist/components/scrollbar-component.d.ts +6 -3
- package/dist/custom-elements.json +21 -21
- package/dist/parse.d.cts +7 -2
- package/dist/parse.d.ts +7 -2
- package/dist/pwc.cjs +406 -128
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +406 -128
- 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 +406 -128
- package/dist/pwc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +10 -10
- package/dist/web-types.json +20 -20
- package/package.json +3 -3
- package/src/app.ts +76 -41
- package/src/components/button-component.ts +18 -10
- package/src/components/joint-component.ts +29 -15
- package/src/components/script-component.ts +25 -12
- package/src/components/script-instance.ts +14 -6
- package/src/components/scroll-view-component.ts +49 -29
- package/src/components/scrollbar-component.ts +13 -8
- package/src/parse.ts +213 -16
|
@@ -7048,7 +7048,7 @@
|
|
|
7048
7048
|
{
|
|
7049
7049
|
"kind": "field",
|
|
7050
7050
|
"name": "image",
|
|
7051
|
-
"description": "Gets the reference to the
|
|
7051
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity whose image element is used for visual transitions, or empty for\nthe button's own entity.",
|
|
7052
7052
|
"parameters": [
|
|
7053
7053
|
{
|
|
7054
7054
|
"description": "The image entity reference.",
|
|
@@ -7261,7 +7261,7 @@
|
|
|
7261
7261
|
"text": "string"
|
|
7262
7262
|
},
|
|
7263
7263
|
"fieldName": "image",
|
|
7264
|
-
"description": "The reference to the
|
|
7264
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity whose image element is used for visual transitions, or empty for the button's own entity."
|
|
7265
7265
|
},
|
|
7266
7266
|
{
|
|
7267
7267
|
"name": "inactive-sprite-asset",
|
|
@@ -9594,7 +9594,7 @@
|
|
|
9594
9594
|
"declarations": [
|
|
9595
9595
|
{
|
|
9596
9596
|
"kind": "class",
|
|
9597
|
-
"description": "The JointComponentElement interface provides properties and methods for manipulating\n[`<pc-joint>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/) elements.\nThe JointComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe entity holding the joint is not itself constrained. Its world transform defines the joint\nframe — the anchor point and axes the constraint operates about — with the local X axis as the\nprimary axis: a hinge rotates about it, a slider translates along it and a ball joint twists\nabout it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need\na rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world\nspace.
|
|
9597
|
+
"description": "The JointComponentElement interface provides properties and methods for manipulating\n[`<pc-joint>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/) elements.\nThe JointComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe entity holding the joint is not itself constrained. Its world transform defines the joint\nframe — the anchor point and axes the constraint operates about — with the local X axis as the\nprimary axis: a hinge rotates about it, a slider translates along it and a ball joint twists\nabout it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need\na rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world\nspace. A reference can name any entity-fronting element — `<pc-entity>`, `<pc-model>` or\n`<pc-node>`, so a ragdoll can join a model's own skeleton nodes by name — and a name resolves\nagainst the nearest enclosing entity first, then outward through the entity hierarchy, then the\ndocument, while a `#` selector resolves document-wide. A `<template>` prefab with one\nentity-fronting root can therefore wire its joints by name and stay self-contained when cloned.\nThe underlying engine component is in alpha, so its API may change.\n",
|
|
9598
9598
|
"name": "JointComponentElement",
|
|
9599
9599
|
"members": [
|
|
9600
9600
|
{
|
|
@@ -9866,7 +9866,7 @@
|
|
|
9866
9866
|
{
|
|
9867
9867
|
"kind": "field",
|
|
9868
9868
|
"name": "entityA",
|
|
9869
|
-
"description": "Gets the reference
|
|
9869
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the element providing the first constrained body.",
|
|
9870
9870
|
"parameters": [
|
|
9871
9871
|
{
|
|
9872
9872
|
"description": "The first body's entity reference.",
|
|
@@ -9882,7 +9882,7 @@
|
|
|
9882
9882
|
{
|
|
9883
9883
|
"kind": "field",
|
|
9884
9884
|
"name": "entityB",
|
|
9885
|
-
"description": "Gets the reference
|
|
9885
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the element providing the second constrained body, or empty for the\nworld-space case.",
|
|
9886
9886
|
"parameters": [
|
|
9887
9887
|
{
|
|
9888
9888
|
"description": "The second body's entity reference.",
|
|
@@ -10314,7 +10314,7 @@
|
|
|
10314
10314
|
"text": "string"
|
|
10315
10315
|
},
|
|
10316
10316
|
"fieldName": "entityA",
|
|
10317
|
-
"description": "The reference
|
|
10317
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the element providing the first constrained body."
|
|
10318
10318
|
},
|
|
10319
10319
|
{
|
|
10320
10320
|
"name": "entity-b",
|
|
@@ -10322,7 +10322,7 @@
|
|
|
10322
10322
|
"text": "string"
|
|
10323
10323
|
},
|
|
10324
10324
|
"fieldName": "entityB",
|
|
10325
|
-
"description": "The reference
|
|
10325
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the element providing the second constrained body, or empty for the world-space case."
|
|
10326
10326
|
},
|
|
10327
10327
|
{
|
|
10328
10328
|
"name": "limits",
|
|
@@ -13048,7 +13048,7 @@
|
|
|
13048
13048
|
"declarations": [
|
|
13049
13049
|
{
|
|
13050
13050
|
"kind": "class",
|
|
13051
|
-
"description": "The ScriptInstanceElement interface provides properties and methods for manipulating\n`<pc-script-instance>` elements. The ScriptInstanceElement interface also inherits the properties and\nmethods of the AsyncElement interface.\n\nScript attributes can be supplied through two channels:\n\n- **Per-property attributes**: any non-reserved attribute on the element maps to the script\n attribute of the same name (kebab-case to camelCase, e.g. `focus-point` → `focusPoint`).\n Values are parsed according to the type of the attribute's current value — initially the\n script's declared default (numbers, booleans, strings, Vec2/3/4, Color, Quat as Euler\n angles) — and the `asset:`/`entity:`/`vec2:`/`vec3:`/`vec4:`/`color:` prefixes may be used\n to be explicit.\n- **The `attributes` JSON attribute**: an object supporting nested structures and attribute\n names that collide with reserved HTML attribute names (e.g. `title`).\n\nWhen both specify the same attribute, the per-property attribute wins — at creation and\nwhenever either channel changes at runtime. The element's own `name` and `enabled`\nattributes configure the element itself and are not script attributes.\n\nChanging `name` on a live element destroys the old-name script instance and creates the\nnew-name one, re-applying both attribute channels to it.\n\nThe element becomes ready once its script instance has been created by the parent\n`<pc-script>` element.\n",
|
|
13051
|
+
"description": "The ScriptInstanceElement interface provides properties and methods for manipulating\n`<pc-script-instance>` elements. The ScriptInstanceElement interface also inherits the properties and\nmethods of the AsyncElement interface.\n\nScript attributes can be supplied through two channels:\n\n- **Per-property attributes**: any non-reserved attribute on the element maps to the script\n attribute of the same name (kebab-case to camelCase, e.g. `focus-point` → `focusPoint`).\n Values are parsed according to the type of the attribute's current value — initially the\n script's declared default (numbers, booleans, strings, Vec2/3/4, Color, Quat as Euler\n angles) — and the `asset:`/`entity:`/`vec2:`/`vec3:`/`vec4:`/`color:` prefixes may be used\n to be explicit. An `entity:` reference is an entity name — resolved against the nearest\n enclosing entity first, then outward, then the document — or a document-wide `#` selector\n (`entity:#id`); a bare value is always a name, never an element id.\n- **The `attributes` JSON attribute**: an object supporting nested structures and attribute\n names that collide with reserved HTML attribute names (e.g. `title`).\n\nWhen both specify the same attribute, the per-property attribute wins — at creation and\nwhenever either channel changes at runtime. The element's own `name` and `enabled`\nattributes configure the element itself and are not script attributes.\n\nChanging `name` on a live element destroys the old-name script instance and creates the\nnew-name one, re-applying both attribute channels to it.\n\nThe element becomes ready once its script instance has been created by the parent\n`<pc-script>` element.\n",
|
|
13052
13052
|
"name": "ScriptInstanceElement",
|
|
13053
13053
|
"members": [
|
|
13054
13054
|
{
|
|
@@ -13150,7 +13150,7 @@
|
|
|
13150
13150
|
{
|
|
13151
13151
|
"kind": "field",
|
|
13152
13152
|
"name": "scriptAttributes",
|
|
13153
|
-
"description": "Gets the attributes of the script.",
|
|
13153
|
+
"description": "Gets the attributes of the script as an object whose `asset:`, `entity:`, `vec2:`, `vec3:`,\n`vec4:` and `color:` prefixed values are resolved when applied — an `entity:` value being\nan entity name (nearest enclosing entity first, then outward, then the document) or a\ndocument-wide `#` selector (`entity:#id`), never a bare element id.",
|
|
13154
13154
|
"parameters": [
|
|
13155
13155
|
{
|
|
13156
13156
|
"description": "The attributes of the script.",
|
|
@@ -13208,7 +13208,7 @@
|
|
|
13208
13208
|
"text": "string"
|
|
13209
13209
|
},
|
|
13210
13210
|
"fieldName": "scriptAttributes",
|
|
13211
|
-
"description": "The attributes of the script."
|
|
13211
|
+
"description": "The attributes of the script as an object whose `asset:`, `entity:`, `vec2:`, `vec3:`, `vec4:` and `color:` prefixed values are resolved when applied — an `entity:` value being an entity name (nearest enclosing entity first, then outward, then the document) or a document-wide `#` selector (`entity:#id`), never a bare element id."
|
|
13212
13212
|
},
|
|
13213
13213
|
{
|
|
13214
13214
|
"name": "enabled",
|
|
@@ -13232,7 +13232,7 @@
|
|
|
13232
13232
|
"name": "AsyncElement",
|
|
13233
13233
|
"module": "/src/async-element"
|
|
13234
13234
|
},
|
|
13235
|
-
"summary": "The `<pc-script-instance>` element attaches one script class, named by `name`, to\nthe entity of its parent `<pc-script>`. Its other attributes set script attributes of the same\nname, and `attributes` takes a JSON object instead. Must be a direct child of `<pc-script>`.\n",
|
|
13235
|
+
"summary": "The `<pc-script-instance>` element attaches one script class, named by `name`, to\nthe entity of its parent `<pc-script>`. Its other attributes set script attributes of the same\nname, and `attributes` takes a JSON object instead. An `entity:` value is an entity name —\nwrite `entity:#id` for an element id. Must be a direct child of `<pc-script>`.\n",
|
|
13236
13236
|
"tagName": "pc-script-instance",
|
|
13237
13237
|
"customElement": true
|
|
13238
13238
|
}
|
|
@@ -13338,7 +13338,7 @@
|
|
|
13338
13338
|
{
|
|
13339
13339
|
"kind": "field",
|
|
13340
13340
|
"name": "content",
|
|
13341
|
-
"description": "Gets the reference to the
|
|
13341
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity used as the content.",
|
|
13342
13342
|
"parameters": [
|
|
13343
13343
|
{
|
|
13344
13344
|
"description": "The content entity reference.",
|
|
@@ -13406,7 +13406,7 @@
|
|
|
13406
13406
|
{
|
|
13407
13407
|
"kind": "field",
|
|
13408
13408
|
"name": "horizontalScrollbar",
|
|
13409
|
-
"description": "Gets the reference to the
|
|
13409
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity containing the horizontal scrollbar.",
|
|
13410
13410
|
"parameters": [
|
|
13411
13411
|
{
|
|
13412
13412
|
"description": "The horizontal scrollbar entity reference.",
|
|
@@ -13516,7 +13516,7 @@
|
|
|
13516
13516
|
{
|
|
13517
13517
|
"kind": "field",
|
|
13518
13518
|
"name": "verticalScrollbar",
|
|
13519
|
-
"description": "Gets the reference to the
|
|
13519
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity containing the vertical scrollbar.",
|
|
13520
13520
|
"parameters": [
|
|
13521
13521
|
{
|
|
13522
13522
|
"description": "The vertical scrollbar entity reference.",
|
|
@@ -13548,7 +13548,7 @@
|
|
|
13548
13548
|
{
|
|
13549
13549
|
"kind": "field",
|
|
13550
13550
|
"name": "viewport",
|
|
13551
|
-
"description": "Gets the reference to the
|
|
13551
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity used as the viewport.",
|
|
13552
13552
|
"parameters": [
|
|
13553
13553
|
{
|
|
13554
13554
|
"description": "The viewport entity reference.",
|
|
@@ -13578,7 +13578,7 @@
|
|
|
13578
13578
|
"text": "string"
|
|
13579
13579
|
},
|
|
13580
13580
|
"fieldName": "content",
|
|
13581
|
-
"description": "The reference to the
|
|
13581
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity used as the content."
|
|
13582
13582
|
},
|
|
13583
13583
|
{
|
|
13584
13584
|
"name": "enabled",
|
|
@@ -13617,7 +13617,7 @@
|
|
|
13617
13617
|
"text": "string"
|
|
13618
13618
|
},
|
|
13619
13619
|
"fieldName": "horizontalScrollbar",
|
|
13620
|
-
"description": "The reference to the
|
|
13620
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity containing the horizontal scrollbar."
|
|
13621
13621
|
},
|
|
13622
13622
|
{
|
|
13623
13623
|
"name": "horizontal-scrollbar-visibility",
|
|
@@ -13670,7 +13670,7 @@
|
|
|
13670
13670
|
"text": "string"
|
|
13671
13671
|
},
|
|
13672
13672
|
"fieldName": "verticalScrollbar",
|
|
13673
|
-
"description": "The reference to the
|
|
13673
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity containing the vertical scrollbar."
|
|
13674
13674
|
},
|
|
13675
13675
|
{
|
|
13676
13676
|
"name": "vertical-scrollbar-visibility",
|
|
@@ -13687,7 +13687,7 @@
|
|
|
13687
13687
|
"text": "string"
|
|
13688
13688
|
},
|
|
13689
13689
|
"fieldName": "viewport",
|
|
13690
|
-
"description": "The reference to the
|
|
13690
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity used as the viewport."
|
|
13691
13691
|
}
|
|
13692
13692
|
],
|
|
13693
13693
|
"superclass": {
|
|
@@ -13817,7 +13817,7 @@
|
|
|
13817
13817
|
{
|
|
13818
13818
|
"kind": "field",
|
|
13819
13819
|
"name": "handle",
|
|
13820
|
-
"description": "Gets the reference to the
|
|
13820
|
+
"description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity used as the scrollbar handle.",
|
|
13821
13821
|
"parameters": [
|
|
13822
13822
|
{
|
|
13823
13823
|
"description": "The handle entity reference.",
|
|
@@ -13913,7 +13913,7 @@
|
|
|
13913
13913
|
"text": "string"
|
|
13914
13914
|
},
|
|
13915
13915
|
"fieldName": "handle",
|
|
13916
|
-
"description": "The reference to the
|
|
13916
|
+
"description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity used as the scrollbar handle."
|
|
13917
13917
|
},
|
|
13918
13918
|
{
|
|
13919
13919
|
"name": "handle-size",
|
package/dist/parse.d.cts
CHANGED
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
* - `parseBool` and `parseTags` take no attribute name, because every value is valid for them and
|
|
13
13
|
* so they never warn.
|
|
14
14
|
*
|
|
15
|
-
* `getEntity`
|
|
16
|
-
* literal, and
|
|
15
|
+
* `findEntityElement` and `getEntity` are the exceptions: they resolve a reference rather than
|
|
16
|
+
* parsing a literal, and return `null` instead of falling back to a default. A reference
|
|
17
|
+
* beginning with `#` is a document-wide selector (an element id, or any selector rooted in one);
|
|
18
|
+
* anything else is an entity name, resolved lexically through the entity hierarchy first and
|
|
19
|
+
* against the document after — never as a selector or an id. They also do not warn - what an
|
|
20
|
+
* unresolved reference means depends on the element holding it - so elements report through
|
|
21
|
+
* `resolveEntity`, which takes that meaning as parameters.
|
|
17
22
|
*/
|
|
18
23
|
export {};
|
package/dist/parse.d.ts
CHANGED
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
* - `parseBool` and `parseTags` take no attribute name, because every value is valid for them and
|
|
13
13
|
* so they never warn.
|
|
14
14
|
*
|
|
15
|
-
* `getEntity`
|
|
16
|
-
* literal, and
|
|
15
|
+
* `findEntityElement` and `getEntity` are the exceptions: they resolve a reference rather than
|
|
16
|
+
* parsing a literal, and return `null` instead of falling back to a default. A reference
|
|
17
|
+
* beginning with `#` is a document-wide selector (an element id, or any selector rooted in one);
|
|
18
|
+
* anything else is an entity name, resolved lexically through the entity hierarchy first and
|
|
19
|
+
* against the document after — never as a selector or an id. They also do not warn - what an
|
|
20
|
+
* unresolved reference means depends on the element holding it - so elements report through
|
|
21
|
+
* `resolveEntity`, which takes that meaning as parameters.
|
|
17
22
|
*/
|
|
18
23
|
export {};
|