@playcanvas/web-components 0.14.0 → 0.16.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/components/anim-clip.d.cts +127 -0
- package/dist/components/anim-clip.d.ts +127 -0
- package/dist/components/anim-component.d.cts +207 -0
- package/dist/components/anim-component.d.ts +207 -0
- package/dist/components/joint-component.d.cts +521 -0
- package/dist/components/joint-component.d.ts +521 -0
- package/dist/custom-elements.json +2841 -1393
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/pwc.cjs +3536 -1744
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +3536 -1744
- 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 +3535 -1746
- package/dist/pwc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +251 -0
- package/dist/web-types.json +503 -1
- package/package.json +3 -2
- package/src/app.ts +18 -0
- package/src/components/anim-clip.ts +395 -0
- package/src/components/anim-component.ts +649 -0
- package/src/components/joint-component.ts +984 -0
- package/src/entity.ts +28 -7
- package/src/index.ts +10 -0
- package/src/model.ts +0 -7
- package/src/node.ts +2 -7
|
@@ -906,6 +906,65 @@
|
|
|
906
906
|
],
|
|
907
907
|
"references": []
|
|
908
908
|
},
|
|
909
|
+
{
|
|
910
|
+
"name": "pc-anim-clip",
|
|
911
|
+
"description": "The AnimClipElement interface provides properties and methods for manipulating\n[`<pc-anim-clip>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-anim-clip/)\nelements. The AnimClipElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nA clip declares one named animation on its parent `<pc-anim>`. `name` is both the clip's name\nand the track looked up in the clip's source: an explicit `asset` (a `container`, an\n`animation` `.glb`, or an `animclip` JSON), or, without one, the container of the `<pc-model>`\nenclosing the parent `<pc-anim>`. A source holding a single track supplies it whatever it is\nnamed; in a multi-track source the track named `name` is chosen, falling back to the first\nwith a warning. The element becomes ready once its resolved track is assigned.\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.",
|
|
912
|
+
"attributes": [
|
|
913
|
+
{
|
|
914
|
+
"name": "asset",
|
|
915
|
+
"description": "The id of the `pc-asset` supplying the clip's track.",
|
|
916
|
+
"values": []
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"name": "loop",
|
|
920
|
+
"description": "Whether the clip loops.",
|
|
921
|
+
"values": []
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
"name": "name",
|
|
925
|
+
"description": "The name of the clip.",
|
|
926
|
+
"values": []
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
"name": "speed",
|
|
930
|
+
"description": "The playback speed of the clip.",
|
|
931
|
+
"values": []
|
|
932
|
+
}
|
|
933
|
+
],
|
|
934
|
+
"references": []
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"name": "pc-anim",
|
|
938
|
+
"description": "The AnimComponentElement interface provides properties and methods for manipulating\n[`<pc-anim>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-anim/) elements.\nThe AnimComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element drives animation clips over the host entity's hierarchy. Clips come from\n`<pc-anim-clip>` children — or, when the element is a direct child of a `<pc-model>` and\ndeclares no clips, every animation of that model's container asset is assigned, named by track\nname, in container order. The first clip plays automatically (opt out with `activate=\"false\"`);\nswitch clips declaratively through the `clip` attribute, or imperatively through play\nand transition. Tracks bind to scene nodes by name, so any hierarchy whose node names\nmatch a clip's curves can be animated — a model's skeleton is simply the common case.\n\nThe engine reports no clip completion: a non-looping clip holds its last pose silently. Poll\nthe underlying AnimComponent (via component) for playback state beyond what\nthis element exposes.\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 - **pause()** - Pauses playback, preserving the playhead — play resumes from where it stopped.\n- **play(name: _string_)** - Resumes playback, optionally switching to a named clip first (a hard cut). A name that\nmatches no clip leaves the selection unchanged.\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.\n- **transition(name: _string_, time: _number_)** - Cross-fades to a named clip and ensures playback is running. A name that matches no clip\nleaves the selection unchanged.",
|
|
939
|
+
"attributes": [
|
|
940
|
+
{
|
|
941
|
+
"name": "activate",
|
|
942
|
+
"description": "Whether playback starts automatically once a clip is assigned.",
|
|
943
|
+
"values": []
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"name": "clip",
|
|
947
|
+
"description": "The name of the active clip.",
|
|
948
|
+
"values": []
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"name": "enabled",
|
|
952
|
+
"description": "The enabled state of the component.",
|
|
953
|
+
"values": []
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"name": "speed",
|
|
957
|
+
"description": "The playback speed multiplier applied across all clips.",
|
|
958
|
+
"values": []
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"name": "transition-time",
|
|
962
|
+
"description": "The cross-fade duration of clip switches made through the `clip` attribute.",
|
|
963
|
+
"values": []
|
|
964
|
+
}
|
|
965
|
+
],
|
|
966
|
+
"references": []
|
|
967
|
+
},
|
|
909
968
|
{
|
|
910
969
|
"name": "pc-button",
|
|
911
970
|
"description": "The ButtonComponentElement interface provides properties and methods for manipulating\n[`<pc-button>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-button/) elements.\nThe ButtonComponentElement 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.",
|
|
@@ -1329,6 +1388,198 @@
|
|
|
1329
1388
|
],
|
|
1330
1389
|
"references": []
|
|
1331
1390
|
},
|
|
1391
|
+
{
|
|
1392
|
+
"name": "pc-joint",
|
|
1393
|
+
"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.",
|
|
1394
|
+
"attributes": [
|
|
1395
|
+
{
|
|
1396
|
+
"name": "angular-damping",
|
|
1397
|
+
"description": "The spring damping of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
1398
|
+
"values": []
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"name": "angular-equilibrium",
|
|
1402
|
+
"description": "The rest angle of the joint's angular springs. Accepts 3 space-separated numbers.",
|
|
1403
|
+
"values": []
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
"name": "angular-limits-x",
|
|
1407
|
+
"description": "The rotation limits of the joint about its X axis. Accepts 2 space-separated numbers.",
|
|
1408
|
+
"values": []
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"name": "angular-limits-y",
|
|
1412
|
+
"description": "The rotation limits of the joint about its Y axis. Accepts 2 space-separated numbers.",
|
|
1413
|
+
"values": []
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
"name": "angular-limits-z",
|
|
1417
|
+
"description": "The rotation limits of the joint about its Z axis. Accepts 2 space-separated numbers.",
|
|
1418
|
+
"values": []
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
"name": "angular-motion-x",
|
|
1422
|
+
"description": "How the joint constrains rotation about its X axis.",
|
|
1423
|
+
"values": [
|
|
1424
|
+
{ "name": "locked" },
|
|
1425
|
+
{ "name": "limited" },
|
|
1426
|
+
{ "name": "free" }
|
|
1427
|
+
]
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
"name": "angular-motion-y",
|
|
1431
|
+
"description": "How the joint constrains rotation about its Y axis.",
|
|
1432
|
+
"values": [
|
|
1433
|
+
{ "name": "locked" },
|
|
1434
|
+
{ "name": "limited" },
|
|
1435
|
+
{ "name": "free" }
|
|
1436
|
+
]
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"name": "angular-motion-z",
|
|
1440
|
+
"description": "How the joint constrains rotation about its Z axis.",
|
|
1441
|
+
"values": [
|
|
1442
|
+
{ "name": "locked" },
|
|
1443
|
+
{ "name": "limited" },
|
|
1444
|
+
{ "name": "free" }
|
|
1445
|
+
]
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
"name": "angular-stiffness",
|
|
1449
|
+
"description": "The spring stiffness of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
1450
|
+
"values": []
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
"name": "break-impulse",
|
|
1454
|
+
"description": "The impulse above which the joint breaks.",
|
|
1455
|
+
"values": []
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
"name": "enable-collision",
|
|
1459
|
+
"description": "Whether collision is enabled between the two constrained bodies.",
|
|
1460
|
+
"values": []
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "enable-limits",
|
|
1464
|
+
"description": "Whether the limits of the joint are enforced.",
|
|
1465
|
+
"values": []
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
"name": "enabled",
|
|
1469
|
+
"description": "The enabled state of the component.",
|
|
1470
|
+
"values": []
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
"name": "entity-a",
|
|
1474
|
+
"description": "The reference to the `<pc-entity>` providing the first constrained body.",
|
|
1475
|
+
"values": []
|
|
1476
|
+
},
|
|
1477
|
+
{
|
|
1478
|
+
"name": "entity-b",
|
|
1479
|
+
"description": "The reference to the `<pc-entity>` providing the second constrained body.",
|
|
1480
|
+
"values": []
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
"name": "limits",
|
|
1484
|
+
"description": "The rotation or travel limits of the joint. Accepts 2 space-separated numbers.",
|
|
1485
|
+
"values": []
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
"name": "linear-damping",
|
|
1489
|
+
"description": "The spring damping of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
1490
|
+
"values": []
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
"name": "linear-equilibrium",
|
|
1494
|
+
"description": "The rest point of the joint's linear springs. Accepts 3 space-separated numbers.",
|
|
1495
|
+
"values": []
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
"name": "linear-limits-x",
|
|
1499
|
+
"description": "The translation limits of the joint along its X axis. Accepts 2 space-separated numbers.",
|
|
1500
|
+
"values": []
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
"name": "linear-limits-y",
|
|
1504
|
+
"description": "The translation limits of the joint along its Y axis. Accepts 2 space-separated numbers.",
|
|
1505
|
+
"values": []
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"name": "linear-limits-z",
|
|
1509
|
+
"description": "The translation limits of the joint along its Z axis. Accepts 2 space-separated numbers.",
|
|
1510
|
+
"values": []
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
"name": "linear-motion-x",
|
|
1514
|
+
"description": "How the joint constrains translation along its X axis.",
|
|
1515
|
+
"values": [
|
|
1516
|
+
{ "name": "locked" },
|
|
1517
|
+
{ "name": "limited" },
|
|
1518
|
+
{ "name": "free" }
|
|
1519
|
+
]
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
"name": "linear-motion-y",
|
|
1523
|
+
"description": "How the joint constrains translation along its Y axis.",
|
|
1524
|
+
"values": [
|
|
1525
|
+
{ "name": "locked" },
|
|
1526
|
+
{ "name": "limited" },
|
|
1527
|
+
{ "name": "free" }
|
|
1528
|
+
]
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
"name": "linear-motion-z",
|
|
1532
|
+
"description": "How the joint constrains translation along its Z axis.",
|
|
1533
|
+
"values": [
|
|
1534
|
+
{ "name": "locked" },
|
|
1535
|
+
{ "name": "limited" },
|
|
1536
|
+
{ "name": "free" }
|
|
1537
|
+
]
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
"name": "linear-stiffness",
|
|
1541
|
+
"description": "The spring stiffness of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
1542
|
+
"values": []
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
"name": "max-motor-force",
|
|
1546
|
+
"description": "The maximum torque or force of the joint's motor.",
|
|
1547
|
+
"values": []
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
"name": "motor-speed",
|
|
1551
|
+
"description": "The target speed of the joint's motor.",
|
|
1552
|
+
"values": []
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
"name": "swing-limit-y",
|
|
1556
|
+
"description": "The maximum swing of the joint around the joint frame's Y axis.",
|
|
1557
|
+
"values": []
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
"name": "swing-limit-z",
|
|
1561
|
+
"description": "The maximum swing of the joint around the joint frame's Z axis.",
|
|
1562
|
+
"values": []
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
"name": "twist-limit",
|
|
1566
|
+
"description": "The maximum twist of the joint about its primary axis.",
|
|
1567
|
+
"values": []
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"name": "type",
|
|
1571
|
+
"description": "The type of the joint.",
|
|
1572
|
+
"values": [
|
|
1573
|
+
{ "name": "fixed" },
|
|
1574
|
+
{ "name": "ball" },
|
|
1575
|
+
{ "name": "hinge" },
|
|
1576
|
+
{ "name": "slider" },
|
|
1577
|
+
{ "name": "6dof" }
|
|
1578
|
+
]
|
|
1579
|
+
}
|
|
1580
|
+
],
|
|
1581
|
+
"references": []
|
|
1582
|
+
},
|
|
1332
1583
|
{
|
|
1333
1584
|
"name": "pc-layoutchild",
|
|
1334
1585
|
"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.",
|