@playcanvas/web-components 0.13.1 → 0.15.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/colors.d.cts +1 -1
- package/dist/colors.d.ts +1 -1
- package/dist/components/joint-component.d.cts +521 -0
- package/dist/components/joint-component.d.ts +521 -0
- package/dist/custom-elements.json +1029 -0
- package/dist/entity-base.d.cts +1 -7
- package/dist/entity-base.d.ts +1 -7
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/loading-bar.d.cts +1 -35
- package/dist/loading-bar.d.ts +1 -35
- package/dist/material.d.cts +13 -0
- package/dist/material.d.ts +13 -0
- package/dist/model.d.cts +71 -0
- package/dist/model.d.ts +71 -0
- package/dist/node.d.cts +55 -0
- package/dist/node.d.ts +55 -0
- package/dist/parse.d.cts +1 -130
- package/dist/parse.d.ts +1 -130
- package/dist/pwc.cjs +1410 -148
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +1410 -148
- 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 +1410 -149
- package/dist/pwc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +203 -1
- package/dist/web-types.json +368 -2
- package/package.json +5 -4
- package/src/app.ts +18 -0
- package/src/colors.ts +5 -0
- package/src/components/joint-component.ts +984 -0
- package/src/entity-base.ts +3 -3
- package/src/entity.ts +28 -7
- package/src/index.ts +6 -0
- package/src/loading-bar.ts +2 -3
- package/src/material.ts +29 -0
- package/src/model.ts +156 -0
- package/src/node.ts +279 -9
- package/src/parse.ts +11 -1
|
@@ -544,6 +544,11 @@
|
|
|
544
544
|
"description": "The UV channel the metalness map samples.",
|
|
545
545
|
"values": []
|
|
546
546
|
},
|
|
547
|
+
{
|
|
548
|
+
"name": "name",
|
|
549
|
+
"description": "The name of the material - the label shown wherever materials surface by name, such as profilers, GPU captures and the assignments `pc-model.hierarchy()` reports.",
|
|
550
|
+
"values": []
|
|
551
|
+
},
|
|
547
552
|
{
|
|
548
553
|
"name": "normal-map",
|
|
549
554
|
"description": "The id of the `pc-asset` used as the normal map.",
|
|
@@ -698,7 +703,7 @@
|
|
|
698
703
|
},
|
|
699
704
|
{
|
|
700
705
|
"name": "pc-model",
|
|
701
|
-
"description": "The ModelElement interface provides properties and methods for manipulating\n[`<pc-model>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-model/) elements.\nThe ModelElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element becomes ready once its container asset has loaded and the instantiated hierarchy has\nbeen added to the scene — `entity` is non-null by then. A failed load also settles readiness,\nwith `entity` remaining `null`: readiness means the load settled, not that it succeeded — listen\nfor `error`, or check `entity`, to tell the outcomes apart. Changing `asset` re-arms readiness\nand instantiates anew, so a `ready()` obtained after the change resolves against the new\nhierarchy. A `pc-model` outside a `pc-app`, or referencing an unknown asset id, warns and never\nbecomes ready.\n\n---\n\n\n### **Events:**\n - **error** - Fired when the container asset fails to load, with the engine's error in `message`. Does not bubble. The element still becomes ready — readiness means the load settled, not that it succeeded.\n- **load** - Fired each time a container asset finishes instantiating, including re-instantiation after `asset` changes. Does not bubble — listen on this element, or use a capture-phase listener on an ancestor.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
706
|
+
"description": "The ModelElement interface provides properties and methods for manipulating\n[`<pc-model>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-model/) elements.\nThe ModelElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element becomes ready once its container asset has loaded and the instantiated hierarchy has\nbeen added to the scene — `entity` is non-null by then. A failed load also settles readiness,\nwith `entity` remaining `null`: readiness means the load settled, not that it succeeded — listen\nfor `error`, or check `entity`, to tell the outcomes apart. Changing `asset` re-arms readiness\nand instantiates anew, so a `ready()` obtained after the change resolves against the new\nhierarchy. A `pc-model` outside a `pc-app`, or referencing an unknown asset id, warns and never\nbecomes ready.\n\n---\n\n\n### **Events:**\n - **error** - Fired when the container asset fails to load, with the engine's error in `message`. Does not bubble. The element still becomes ready — readiness means the load settled, not that it succeeded.\n- **load** - Fired each time a container asset finishes instantiating, including re-instantiation after `asset` changes. Does not bubble — listen on this element, or use a capture-phase listener on an ancestor.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **hierarchy(): __** - Returns a snapshot of the instantiated node tree, or `null` while there is none (the\ncontainer asset has not loaded, or the element has left the document). One call grounds a\nsession — a browser console, a test, an agent — in the vocabulary `pc-node` binding\nresolves against: the instantiated names (HierarchyNode.name), paths, match\nindices, attached component types and the material assignments of render components\n(HierarchyNode.materials). `String(...)` of the result, or of any node in it,\nis the printable form.\n\nThe snapshot is plain data, computed afresh each call: it does not follow later changes\nto the hierarchy, and mutating it changes nothing.\n- **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
702
707
|
"attributes": [
|
|
703
708
|
{
|
|
704
709
|
"name": "asset",
|
|
@@ -749,6 +754,11 @@
|
|
|
749
754
|
"description": "Which match to bind when `name` matches more than one node, 0-based in depth-first order. Optional for a unique match; required for an ambiguous one.",
|
|
750
755
|
"values": []
|
|
751
756
|
},
|
|
757
|
+
{
|
|
758
|
+
"name": "material-overrides",
|
|
759
|
+
"description": "Overrides material assignments on the bound node's render component, as a JSON object from selector to `pc-material` id — for example `{\"name:CarPaint\": \"candy-red\", \"index:7\": \"smoked-glass\"}`. A `name:X` key selects every mesh instance whose baseline material is named `X`; an `index:N` key selects mesh instance `N` and wins over a name rule for the same instance. Assignments no rule matches keep their baseline materials, and removing the attribute restores all of them. Use `pc-model.hierarchy()` to discover the names and indices a node offers.",
|
|
760
|
+
"values": []
|
|
761
|
+
},
|
|
752
762
|
{
|
|
753
763
|
"name": "name",
|
|
754
764
|
"description": "The name of the node to bind, resolved within the nearest ancestor `pc-model` (or `pc-node`) once it has instantiated.",
|
|
@@ -1319,6 +1329,198 @@
|
|
|
1319
1329
|
],
|
|
1320
1330
|
"references": []
|
|
1321
1331
|
},
|
|
1332
|
+
{
|
|
1333
|
+
"name": "pc-joint",
|
|
1334
|
+
"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. The underlying engine component is in alpha, so its API may change.\n\n---\n\n\n### **Events:**\n - **break** - Fired when the impulse on the joint exceeds `break-impulse` and the constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on the underlying component re-attaches it. Bubbles and is composed.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
1335
|
+
"attributes": [
|
|
1336
|
+
{
|
|
1337
|
+
"name": "angular-damping",
|
|
1338
|
+
"description": "The spring damping of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
1339
|
+
"values": []
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
"name": "angular-equilibrium",
|
|
1343
|
+
"description": "The rest angle of the joint's angular springs. Accepts 3 space-separated numbers.",
|
|
1344
|
+
"values": []
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "angular-limits-x",
|
|
1348
|
+
"description": "The rotation limits of the joint about its X axis. Accepts 2 space-separated numbers.",
|
|
1349
|
+
"values": []
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"name": "angular-limits-y",
|
|
1353
|
+
"description": "The rotation limits of the joint about its Y axis. Accepts 2 space-separated numbers.",
|
|
1354
|
+
"values": []
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
"name": "angular-limits-z",
|
|
1358
|
+
"description": "The rotation limits of the joint about its Z axis. Accepts 2 space-separated numbers.",
|
|
1359
|
+
"values": []
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
"name": "angular-motion-x",
|
|
1363
|
+
"description": "How the joint constrains rotation about its X axis.",
|
|
1364
|
+
"values": [
|
|
1365
|
+
{ "name": "locked" },
|
|
1366
|
+
{ "name": "limited" },
|
|
1367
|
+
{ "name": "free" }
|
|
1368
|
+
]
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"name": "angular-motion-y",
|
|
1372
|
+
"description": "How the joint constrains rotation about its Y axis.",
|
|
1373
|
+
"values": [
|
|
1374
|
+
{ "name": "locked" },
|
|
1375
|
+
{ "name": "limited" },
|
|
1376
|
+
{ "name": "free" }
|
|
1377
|
+
]
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"name": "angular-motion-z",
|
|
1381
|
+
"description": "How the joint constrains rotation about its Z axis.",
|
|
1382
|
+
"values": [
|
|
1383
|
+
{ "name": "locked" },
|
|
1384
|
+
{ "name": "limited" },
|
|
1385
|
+
{ "name": "free" }
|
|
1386
|
+
]
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
"name": "angular-stiffness",
|
|
1390
|
+
"description": "The spring stiffness of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
1391
|
+
"values": []
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"name": "break-impulse",
|
|
1395
|
+
"description": "The impulse above which the joint breaks.",
|
|
1396
|
+
"values": []
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
"name": "enable-collision",
|
|
1400
|
+
"description": "Whether collision is enabled between the two constrained bodies.",
|
|
1401
|
+
"values": []
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"name": "enable-limits",
|
|
1405
|
+
"description": "Whether the limits of the joint are enforced.",
|
|
1406
|
+
"values": []
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "enabled",
|
|
1410
|
+
"description": "The enabled state of the component.",
|
|
1411
|
+
"values": []
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
"name": "entity-a",
|
|
1415
|
+
"description": "The reference to the `<pc-entity>` providing the first constrained body.",
|
|
1416
|
+
"values": []
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
"name": "entity-b",
|
|
1420
|
+
"description": "The reference to the `<pc-entity>` providing the second constrained body.",
|
|
1421
|
+
"values": []
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
"name": "limits",
|
|
1425
|
+
"description": "The rotation or travel limits of the joint. Accepts 2 space-separated numbers.",
|
|
1426
|
+
"values": []
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
"name": "linear-damping",
|
|
1430
|
+
"description": "The spring damping of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
1431
|
+
"values": []
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
"name": "linear-equilibrium",
|
|
1435
|
+
"description": "The rest point of the joint's linear springs. Accepts 3 space-separated numbers.",
|
|
1436
|
+
"values": []
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"name": "linear-limits-x",
|
|
1440
|
+
"description": "The translation limits of the joint along its X axis. Accepts 2 space-separated numbers.",
|
|
1441
|
+
"values": []
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
"name": "linear-limits-y",
|
|
1445
|
+
"description": "The translation limits of the joint along its Y axis. Accepts 2 space-separated numbers.",
|
|
1446
|
+
"values": []
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
"name": "linear-limits-z",
|
|
1450
|
+
"description": "The translation limits of the joint along its Z axis. Accepts 2 space-separated numbers.",
|
|
1451
|
+
"values": []
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
"name": "linear-motion-x",
|
|
1455
|
+
"description": "How the joint constrains translation along its X axis.",
|
|
1456
|
+
"values": [
|
|
1457
|
+
{ "name": "locked" },
|
|
1458
|
+
{ "name": "limited" },
|
|
1459
|
+
{ "name": "free" }
|
|
1460
|
+
]
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "linear-motion-y",
|
|
1464
|
+
"description": "How the joint constrains translation along its Y axis.",
|
|
1465
|
+
"values": [
|
|
1466
|
+
{ "name": "locked" },
|
|
1467
|
+
{ "name": "limited" },
|
|
1468
|
+
{ "name": "free" }
|
|
1469
|
+
]
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
"name": "linear-motion-z",
|
|
1473
|
+
"description": "How the joint constrains translation along its Z axis.",
|
|
1474
|
+
"values": [
|
|
1475
|
+
{ "name": "locked" },
|
|
1476
|
+
{ "name": "limited" },
|
|
1477
|
+
{ "name": "free" }
|
|
1478
|
+
]
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"name": "linear-stiffness",
|
|
1482
|
+
"description": "The spring stiffness of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
1483
|
+
"values": []
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
"name": "max-motor-force",
|
|
1487
|
+
"description": "The maximum torque or force of the joint's motor.",
|
|
1488
|
+
"values": []
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"name": "motor-speed",
|
|
1492
|
+
"description": "The target speed of the joint's motor.",
|
|
1493
|
+
"values": []
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
"name": "swing-limit-y",
|
|
1497
|
+
"description": "The maximum swing of the joint around the joint frame's Y axis.",
|
|
1498
|
+
"values": []
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
"name": "swing-limit-z",
|
|
1502
|
+
"description": "The maximum swing of the joint around the joint frame's Z axis.",
|
|
1503
|
+
"values": []
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"name": "twist-limit",
|
|
1507
|
+
"description": "The maximum twist of the joint about its primary axis.",
|
|
1508
|
+
"values": []
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
"name": "type",
|
|
1512
|
+
"description": "The type of the joint.",
|
|
1513
|
+
"values": [
|
|
1514
|
+
{ "name": "fixed" },
|
|
1515
|
+
{ "name": "ball" },
|
|
1516
|
+
{ "name": "hinge" },
|
|
1517
|
+
{ "name": "slider" },
|
|
1518
|
+
{ "name": "6dof" }
|
|
1519
|
+
]
|
|
1520
|
+
}
|
|
1521
|
+
],
|
|
1522
|
+
"references": []
|
|
1523
|
+
},
|
|
1322
1524
|
{
|
|
1323
1525
|
"name": "pc-layoutchild",
|
|
1324
1526
|
"description": "The LayoutChildComponentElement interface provides properties and methods for manipulating\n[`<pc-layoutchild>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-layoutchild/) elements.\nThe LayoutChildComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|