@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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@playcanvas/web-components",
4
- "version": "0.14.0",
4
+ "version": "0.16.0",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1825,6 +1825,161 @@
1825
1825
  ]
1826
1826
  }
1827
1827
  },
1828
+ {
1829
+ "name": "pc-anim-clip",
1830
+ "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.",
1831
+ "doc-url": "",
1832
+ "attributes": [
1833
+ {
1834
+ "name": "asset",
1835
+ "description": "The id of the `pc-asset` supplying the clip's track.",
1836
+ "value": { "type": "string" }
1837
+ },
1838
+ {
1839
+ "name": "loop",
1840
+ "description": "Whether the clip loops.",
1841
+ "value": { "type": "boolean", "default": "true" }
1842
+ },
1843
+ {
1844
+ "name": "name",
1845
+ "description": "The name of the clip.",
1846
+ "value": { "type": "string" }
1847
+ },
1848
+ {
1849
+ "name": "speed",
1850
+ "description": "The playback speed of the clip.",
1851
+ "value": { "type": "number", "default": "1" }
1852
+ }
1853
+ ],
1854
+ "events": [
1855
+ {
1856
+ "name": "ready",
1857
+ "type": "CustomEvent",
1858
+ "description": "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."
1859
+ }
1860
+ ],
1861
+ "js": {
1862
+ "properties": [
1863
+ {
1864
+ "name": "asset",
1865
+ "description": "Gets the id of the `pc-asset` supplying the clip's track."
1866
+ },
1867
+ {
1868
+ "name": "closestApp",
1869
+ "description": "The nearest ancestor `<pc-app>` element, or `null` if this element has no `<pc-app>`\nancestor. The search starts at the parent, so an element never resolves to itself.",
1870
+ "type": "AppElement | null"
1871
+ },
1872
+ {
1873
+ "name": "closestEntity",
1874
+ "description": "The nearest ancestor element that fronts an entity — `<pc-entity>` or `<pc-node>` — or\n`null` if this element has no such ancestor. The search starts at the parent, so an element\nnever resolves to itself.",
1875
+ "type": "EntityBaseElement | null"
1876
+ },
1877
+ { "name": "loop", "description": "Gets whether the clip loops." },
1878
+ { "name": "name", "description": "Gets the name of the clip." },
1879
+ {
1880
+ "name": "speed",
1881
+ "description": "Gets the playback speed of the clip."
1882
+ }
1883
+ ],
1884
+ "events": [
1885
+ {
1886
+ "name": "ready",
1887
+ "type": "CustomEvent",
1888
+ "description": "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."
1889
+ }
1890
+ ]
1891
+ }
1892
+ },
1893
+ {
1894
+ "name": "pc-anim",
1895
+ "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.",
1896
+ "doc-url": "",
1897
+ "attributes": [
1898
+ {
1899
+ "name": "activate",
1900
+ "description": "Whether playback starts automatically once a clip is assigned.",
1901
+ "value": { "type": "boolean", "default": "true" }
1902
+ },
1903
+ {
1904
+ "name": "clip",
1905
+ "description": "The name of the active clip.",
1906
+ "value": { "type": "string" }
1907
+ },
1908
+ {
1909
+ "name": "enabled",
1910
+ "description": "The enabled state of the component.",
1911
+ "value": { "type": "boolean", "default": "true" }
1912
+ },
1913
+ {
1914
+ "name": "speed",
1915
+ "description": "The playback speed multiplier applied across all clips.",
1916
+ "value": { "type": "number", "default": "1" }
1917
+ },
1918
+ {
1919
+ "name": "transition-time",
1920
+ "description": "The cross-fade duration of clip switches made through the `clip` attribute.",
1921
+ "value": { "type": "number", "default": "0" }
1922
+ }
1923
+ ],
1924
+ "events": [
1925
+ {
1926
+ "name": "ready",
1927
+ "type": "CustomEvent",
1928
+ "description": "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."
1929
+ }
1930
+ ],
1931
+ "js": {
1932
+ "properties": [
1933
+ {
1934
+ "name": "activate",
1935
+ "description": "Gets whether playback starts automatically once a clip is assigned."
1936
+ },
1937
+ {
1938
+ "name": "clip",
1939
+ "description": "Gets the name of the active clip."
1940
+ },
1941
+ {
1942
+ "name": "clips",
1943
+ "description": "Gets the names of the assigned clips.",
1944
+ "type": "string[]"
1945
+ },
1946
+ {
1947
+ "name": "closestApp",
1948
+ "description": "The nearest ancestor `<pc-app>` element, or `null` if this element has no `<pc-app>`\nancestor. The search starts at the parent, so an element never resolves to itself.",
1949
+ "type": "AppElement | null"
1950
+ },
1951
+ {
1952
+ "name": "closestEntity",
1953
+ "description": "The nearest ancestor element that fronts an entity — `<pc-entity>` or `<pc-node>` — or\n`null` if this element has no such ancestor. The search starts at the parent, so an element\nnever resolves to itself.",
1954
+ "type": "EntityBaseElement | null"
1955
+ },
1956
+ {
1957
+ "name": "component",
1958
+ "description": "Gets the underlying PlayCanvas anim component.",
1959
+ "type": "Component | null"
1960
+ },
1961
+ {
1962
+ "name": "enabled",
1963
+ "description": "Gets the enabled state of the component."
1964
+ },
1965
+ {
1966
+ "name": "speed",
1967
+ "description": "Gets the playback speed multiplier applied across all clips."
1968
+ },
1969
+ {
1970
+ "name": "transitionTime",
1971
+ "description": "Gets the cross-fade duration of clip switches made through the `clip` attribute."
1972
+ }
1973
+ ],
1974
+ "events": [
1975
+ {
1976
+ "name": "ready",
1977
+ "type": "CustomEvent",
1978
+ "description": "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."
1979
+ }
1980
+ ]
1981
+ }
1982
+ },
1828
1983
  {
1829
1984
  "name": "pc-button",
1830
1985
  "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.",
@@ -2713,6 +2868,353 @@
2713
2868
  ]
2714
2869
  }
2715
2870
  },
2871
+ {
2872
+ "name": "pc-joint",
2873
+ "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.",
2874
+ "doc-url": "",
2875
+ "attributes": [
2876
+ {
2877
+ "name": "angular-damping",
2878
+ "description": "The spring damping of the joint per angular axis. Accepts 3 space-separated numbers.",
2879
+ "value": { "type": "string", "default": "1 1 1" }
2880
+ },
2881
+ {
2882
+ "name": "angular-equilibrium",
2883
+ "description": "The rest angle of the joint's angular springs. Accepts 3 space-separated numbers.",
2884
+ "value": { "type": "string", "default": "0 0 0" }
2885
+ },
2886
+ {
2887
+ "name": "angular-limits-x",
2888
+ "description": "The rotation limits of the joint about its X axis. Accepts 2 space-separated numbers.",
2889
+ "value": { "type": "string", "default": "0 0" }
2890
+ },
2891
+ {
2892
+ "name": "angular-limits-y",
2893
+ "description": "The rotation limits of the joint about its Y axis. Accepts 2 space-separated numbers.",
2894
+ "value": { "type": "string", "default": "0 0" }
2895
+ },
2896
+ {
2897
+ "name": "angular-limits-z",
2898
+ "description": "The rotation limits of the joint about its Z axis. Accepts 2 space-separated numbers.",
2899
+ "value": { "type": "string", "default": "0 0" }
2900
+ },
2901
+ {
2902
+ "name": "angular-motion-x",
2903
+ "description": "How the joint constrains rotation about its X axis.",
2904
+ "value": {
2905
+ "type": "'locked' | 'limited' | 'free'",
2906
+ "default": "locked"
2907
+ }
2908
+ },
2909
+ {
2910
+ "name": "angular-motion-y",
2911
+ "description": "How the joint constrains rotation about its Y axis.",
2912
+ "value": {
2913
+ "type": "'locked' | 'limited' | 'free'",
2914
+ "default": "locked"
2915
+ }
2916
+ },
2917
+ {
2918
+ "name": "angular-motion-z",
2919
+ "description": "How the joint constrains rotation about its Z axis.",
2920
+ "value": {
2921
+ "type": "'locked' | 'limited' | 'free'",
2922
+ "default": "locked"
2923
+ }
2924
+ },
2925
+ {
2926
+ "name": "angular-stiffness",
2927
+ "description": "The spring stiffness of the joint per angular axis. Accepts 3 space-separated numbers.",
2928
+ "value": { "type": "string", "default": "0 0 0" }
2929
+ },
2930
+ {
2931
+ "name": "break-impulse",
2932
+ "description": "The impulse above which the joint breaks.",
2933
+ "value": { "type": "number", "default": "Infinity" }
2934
+ },
2935
+ {
2936
+ "name": "enable-collision",
2937
+ "description": "Whether collision is enabled between the two constrained bodies.",
2938
+ "value": { "type": "boolean", "default": "false" }
2939
+ },
2940
+ {
2941
+ "name": "enable-limits",
2942
+ "description": "Whether the limits of the joint are enforced.",
2943
+ "value": { "type": "boolean", "default": "false" }
2944
+ },
2945
+ {
2946
+ "name": "enabled",
2947
+ "description": "The enabled state of the component.",
2948
+ "value": { "type": "boolean", "default": "true" }
2949
+ },
2950
+ {
2951
+ "name": "entity-a",
2952
+ "description": "The reference to the `<pc-entity>` providing the first constrained body.",
2953
+ "value": { "type": "string" }
2954
+ },
2955
+ {
2956
+ "name": "entity-b",
2957
+ "description": "The reference to the `<pc-entity>` providing the second constrained body.",
2958
+ "value": { "type": "string" }
2959
+ },
2960
+ {
2961
+ "name": "limits",
2962
+ "description": "The rotation or travel limits of the joint. Accepts 2 space-separated numbers.",
2963
+ "value": { "type": "string", "default": "-45 45" }
2964
+ },
2965
+ {
2966
+ "name": "linear-damping",
2967
+ "description": "The spring damping of the joint per linear axis. Accepts 3 space-separated numbers.",
2968
+ "value": { "type": "string", "default": "1 1 1" }
2969
+ },
2970
+ {
2971
+ "name": "linear-equilibrium",
2972
+ "description": "The rest point of the joint's linear springs. Accepts 3 space-separated numbers.",
2973
+ "value": { "type": "string", "default": "0 0 0" }
2974
+ },
2975
+ {
2976
+ "name": "linear-limits-x",
2977
+ "description": "The translation limits of the joint along its X axis. Accepts 2 space-separated numbers.",
2978
+ "value": { "type": "string", "default": "0 0" }
2979
+ },
2980
+ {
2981
+ "name": "linear-limits-y",
2982
+ "description": "The translation limits of the joint along its Y axis. Accepts 2 space-separated numbers.",
2983
+ "value": { "type": "string", "default": "0 0" }
2984
+ },
2985
+ {
2986
+ "name": "linear-limits-z",
2987
+ "description": "The translation limits of the joint along its Z axis. Accepts 2 space-separated numbers.",
2988
+ "value": { "type": "string", "default": "0 0" }
2989
+ },
2990
+ {
2991
+ "name": "linear-motion-x",
2992
+ "description": "How the joint constrains translation along its X axis.",
2993
+ "value": {
2994
+ "type": "'locked' | 'limited' | 'free'",
2995
+ "default": "locked"
2996
+ }
2997
+ },
2998
+ {
2999
+ "name": "linear-motion-y",
3000
+ "description": "How the joint constrains translation along its Y axis.",
3001
+ "value": {
3002
+ "type": "'locked' | 'limited' | 'free'",
3003
+ "default": "locked"
3004
+ }
3005
+ },
3006
+ {
3007
+ "name": "linear-motion-z",
3008
+ "description": "How the joint constrains translation along its Z axis.",
3009
+ "value": {
3010
+ "type": "'locked' | 'limited' | 'free'",
3011
+ "default": "locked"
3012
+ }
3013
+ },
3014
+ {
3015
+ "name": "linear-stiffness",
3016
+ "description": "The spring stiffness of the joint per linear axis. Accepts 3 space-separated numbers.",
3017
+ "value": { "type": "string", "default": "0 0 0" }
3018
+ },
3019
+ {
3020
+ "name": "max-motor-force",
3021
+ "description": "The maximum torque or force of the joint's motor.",
3022
+ "value": { "type": "number", "default": "0" }
3023
+ },
3024
+ {
3025
+ "name": "motor-speed",
3026
+ "description": "The target speed of the joint's motor.",
3027
+ "value": { "type": "number", "default": "0" }
3028
+ },
3029
+ {
3030
+ "name": "swing-limit-y",
3031
+ "description": "The maximum swing of the joint around the joint frame's Y axis.",
3032
+ "value": { "type": "number", "default": "45" }
3033
+ },
3034
+ {
3035
+ "name": "swing-limit-z",
3036
+ "description": "The maximum swing of the joint around the joint frame's Z axis.",
3037
+ "value": { "type": "number", "default": "45" }
3038
+ },
3039
+ {
3040
+ "name": "twist-limit",
3041
+ "description": "The maximum twist of the joint about its primary axis.",
3042
+ "value": { "type": "number", "default": "20" }
3043
+ },
3044
+ {
3045
+ "name": "type",
3046
+ "description": "The type of the joint.",
3047
+ "value": {
3048
+ "type": "'fixed' | 'ball' | 'hinge' | 'slider' | '6dof'",
3049
+ "default": "fixed"
3050
+ }
3051
+ }
3052
+ ],
3053
+ "events": [
3054
+ {
3055
+ "name": "break",
3056
+ "type": "CustomEvent",
3057
+ "description": "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."
3058
+ },
3059
+ {
3060
+ "name": "ready",
3061
+ "type": "CustomEvent",
3062
+ "description": "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."
3063
+ }
3064
+ ],
3065
+ "js": {
3066
+ "properties": [
3067
+ {
3068
+ "name": "angularDamping",
3069
+ "description": "Gets the spring damping of the joint per angular axis."
3070
+ },
3071
+ {
3072
+ "name": "angularEquilibrium",
3073
+ "description": "Gets the rest angle of the joint's angular springs."
3074
+ },
3075
+ {
3076
+ "name": "angularLimitsX",
3077
+ "description": "Gets the rotation limits of the joint about its X axis."
3078
+ },
3079
+ {
3080
+ "name": "angularLimitsY",
3081
+ "description": "Gets the rotation limits of the joint about its Y axis."
3082
+ },
3083
+ {
3084
+ "name": "angularLimitsZ",
3085
+ "description": "Gets the rotation limits of the joint about its Z axis."
3086
+ },
3087
+ {
3088
+ "name": "angularMotionX",
3089
+ "description": "Gets how the joint constrains rotation about its X axis."
3090
+ },
3091
+ {
3092
+ "name": "angularMotionY",
3093
+ "description": "Gets how the joint constrains rotation about its Y axis."
3094
+ },
3095
+ {
3096
+ "name": "angularMotionZ",
3097
+ "description": "Gets how the joint constrains rotation about its Z axis."
3098
+ },
3099
+ {
3100
+ "name": "angularStiffness",
3101
+ "description": "Gets the spring stiffness of the joint per angular axis."
3102
+ },
3103
+ {
3104
+ "name": "breakImpulse",
3105
+ "description": "Gets the impulse above which the joint breaks."
3106
+ },
3107
+ {
3108
+ "name": "closestApp",
3109
+ "description": "The nearest ancestor `<pc-app>` element, or `null` if this element has no `<pc-app>`\nancestor. The search starts at the parent, so an element never resolves to itself.",
3110
+ "type": "AppElement | null"
3111
+ },
3112
+ {
3113
+ "name": "closestEntity",
3114
+ "description": "The nearest ancestor element that fronts an entity — `<pc-entity>` or `<pc-node>` — or\n`null` if this element has no such ancestor. The search starts at the parent, so an element\nnever resolves to itself.",
3115
+ "type": "EntityBaseElement | null"
3116
+ },
3117
+ {
3118
+ "name": "component",
3119
+ "description": "Gets the underlying PlayCanvas joint component.",
3120
+ "type": "Component | null"
3121
+ },
3122
+ {
3123
+ "name": "enableCollision",
3124
+ "description": "Gets whether collision is enabled between the two constrained bodies."
3125
+ },
3126
+ {
3127
+ "name": "enabled",
3128
+ "description": "Gets the enabled state of the component."
3129
+ },
3130
+ {
3131
+ "name": "enableLimits",
3132
+ "description": "Gets whether the limits of the joint are enforced."
3133
+ },
3134
+ {
3135
+ "name": "entityA",
3136
+ "description": "Gets the reference to the `<pc-entity>` providing the first constrained body."
3137
+ },
3138
+ {
3139
+ "name": "entityB",
3140
+ "description": "Gets the reference to the `<pc-entity>` providing the second constrained body."
3141
+ },
3142
+ {
3143
+ "name": "limits",
3144
+ "description": "Gets the rotation or travel limits of the joint."
3145
+ },
3146
+ {
3147
+ "name": "linearDamping",
3148
+ "description": "Gets the spring damping of the joint per linear axis."
3149
+ },
3150
+ {
3151
+ "name": "linearEquilibrium",
3152
+ "description": "Gets the rest point of the joint's linear springs."
3153
+ },
3154
+ {
3155
+ "name": "linearLimitsX",
3156
+ "description": "Gets the translation limits of the joint along its X axis."
3157
+ },
3158
+ {
3159
+ "name": "linearLimitsY",
3160
+ "description": "Gets the translation limits of the joint along its Y axis."
3161
+ },
3162
+ {
3163
+ "name": "linearLimitsZ",
3164
+ "description": "Gets the translation limits of the joint along its Z axis."
3165
+ },
3166
+ {
3167
+ "name": "linearMotionX",
3168
+ "description": "Gets how the joint constrains translation along its X axis."
3169
+ },
3170
+ {
3171
+ "name": "linearMotionY",
3172
+ "description": "Gets how the joint constrains translation along its Y axis."
3173
+ },
3174
+ {
3175
+ "name": "linearMotionZ",
3176
+ "description": "Gets how the joint constrains translation along its Z axis."
3177
+ },
3178
+ {
3179
+ "name": "linearStiffness",
3180
+ "description": "Gets the spring stiffness of the joint per linear axis."
3181
+ },
3182
+ {
3183
+ "name": "maxMotorForce",
3184
+ "description": "Gets the maximum torque or force of the joint's motor."
3185
+ },
3186
+ {
3187
+ "name": "motorSpeed",
3188
+ "description": "Gets the target speed of the joint's motor."
3189
+ },
3190
+ {
3191
+ "name": "swingLimitY",
3192
+ "description": "Gets the maximum swing of the joint around the joint frame's Y axis."
3193
+ },
3194
+ {
3195
+ "name": "swingLimitZ",
3196
+ "description": "Gets the maximum swing of the joint around the joint frame's Z axis."
3197
+ },
3198
+ {
3199
+ "name": "twistLimit",
3200
+ "description": "Gets the maximum twist of the joint about its primary axis."
3201
+ },
3202
+ { "name": "type", "description": "Gets the type of the joint." }
3203
+ ],
3204
+ "events": [
3205
+ {
3206
+ "name": "break",
3207
+ "type": "CustomEvent",
3208
+ "description": "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."
3209
+ },
3210
+ {
3211
+ "name": "ready",
3212
+ "type": "CustomEvent",
3213
+ "description": "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."
3214
+ }
3215
+ ]
3216
+ }
3217
+ },
2716
3218
  {
2717
3219
  "name": "pc-layoutchild",
2718
3220
  "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.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/web-components",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://playcanvas.com",
6
6
  "description": "Web Components for the PlayCanvas Engine",
@@ -71,6 +71,7 @@
71
71
  "test:unit": "vitest run --project unit",
72
72
  "test:elements": "vitest run --project elements",
73
73
  "test:integration": "vitest run --project integration",
74
+ "test:examples": "vitest run --project examples",
74
75
  "publint": "publint",
75
76
  "type-check": "npm run type-check:src && npm run type-check:test",
76
77
  "type-check:src": "tsc --noEmit -p tsconfig.json",
@@ -100,7 +101,7 @@
100
101
  "jsdom": "30.0.1",
101
102
  "mediabunny": "1.53.1",
102
103
  "opentype.js": "2.0.0",
103
- "playcanvas": "2.22.0-beta.12",
104
+ "playcanvas": "2.21.4",
104
105
  "prettier": "3.9.6",
105
106
  "publint": "0.3.23",
106
107
  "rollup": "4.62.4",
package/src/app.ts CHANGED
@@ -252,6 +252,24 @@ class AppElement extends AsyncElement {
252
252
  this._bar = new LoadingBar(this);
253
253
  }
254
254
 
255
+ // Upgrade the subtree before reading anything out of it. A subtree cloned from a
256
+ // <template> arrives entirely unupgraded - template content lives in an inert document,
257
+ // where custom element definitions are never looked up - and appending the clone upgrades
258
+ // its elements in tree order, this one before its descendants. The module query below would
259
+ // otherwise find plain HTMLElements with no _getLoadPromise to call, and the boot would die
260
+ // there, leaving the element permanently unready: no canvas, no entities, no application.
261
+ //
262
+ // Upgrading is the fix here rather than skipping whatever has not upgraded, because a
263
+ // <pc-module> is the one child that nothing else ever builds on its own behalf - skipping
264
+ // it would drop the wasm module the app asked for, silently and only for cloned apps.
265
+ // Upgrading runs each descendant's connectedCallback synchronously, a few lines earlier
266
+ // than the parser's path runs them but into the same state they see there: no application
267
+ // yet and _hierarchyReady false, so they defer to the sweeps below. A descendant that
268
+ // disconnects this element from there is caught by the generation check after the await,
269
+ // as any other disconnect is. An already-upgraded subtree - every other insertion path -
270
+ // is left completely untouched.
271
+ customElements.upgrade(this);
272
+
255
273
  // Get all pc-module elements that are direct children of the pc-app element
256
274
  const moduleElements = this.querySelectorAll<ModuleElement>(':scope > pc-module');
257
275