three-stdlib 2.35.4 → 2.35.6
Sign up to get free protection for your applications and to get access to all the features.
- package/exporters/DRACOExporter.cjs +3 -3
- package/exporters/DRACOExporter.cjs.map +1 -1
- package/exporters/DRACOExporter.d.ts +36 -25
- package/exporters/DRACOExporter.js +3 -3
- package/exporters/DRACOExporter.js.map +1 -1
- package/objects/Sky.cjs.map +1 -1
- package/objects/Sky.d.ts +18 -137
- package/objects/Sky.js.map +1 -1
- package/package.json +1 -1
- package/webxr/ARButton.cjs +106 -109
- package/webxr/ARButton.cjs.map +1 -1
- package/webxr/ARButton.d.ts +0 -1
- package/webxr/ARButton.js +106 -109
- package/webxr/ARButton.js.map +1 -1
- package/webxr/VRButton.cjs +4 -4
- package/webxr/VRButton.cjs.map +1 -1
- package/webxr/VRButton.d.ts +11 -9
- package/webxr/VRButton.js +4 -4
- package/webxr/VRButton.js.map +1 -1
package/webxr/VRButton.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VRButton.cjs","sources":["../../src/webxr/VRButton.
|
1
|
+
{"version":3,"file":"VRButton.cjs","sources":["../../src/webxr/VRButton.js"],"sourcesContent":["const VRButton = /* @__PURE__ */ (() => {\n class VRButton {\n static createButton(renderer, sessionInit = {}) {\n const button = document.createElement('button')\n\n function showEnterVR(/*device*/) {\n let currentSession = null\n\n async function onSessionStarted(session) {\n session.addEventListener('end', onSessionEnded)\n\n await renderer.xr.setSession(session)\n button.textContent = 'EXIT VR'\n\n currentSession = session\n }\n\n function onSessionEnded(/*event*/) {\n currentSession.removeEventListener('end', onSessionEnded)\n\n button.textContent = 'ENTER VR'\n\n currentSession = null\n }\n\n //\n\n button.style.display = ''\n\n button.style.cursor = 'pointer'\n button.style.left = 'calc(50% - 50px)'\n button.style.width = '100px'\n\n button.textContent = 'ENTER VR'\n\n button.onmouseenter = () => {\n button.style.opacity = '1.0'\n }\n\n button.onmouseleave = () => {\n button.style.opacity = '0.5'\n }\n\n button.onclick = () => {\n if (currentSession === null) {\n // WebXR's requestReferenceSpace only works if the corresponding feature\n // was requested at session creation time. For simplicity, just ask for\n // the interesting ones as optional features, but be aware that the\n // requestReferenceSpace call will fail if it turns out to be unavailable.\n // ('local' is always available for immersive sessions and doesn't need to\n // be requested separately.)\n\n const optionalFeatures = [sessionInit.optionalFeatures, 'local-floor', 'bounded-floor', 'hand-tracking']\n .flat()\n .filter(Boolean)\n\n navigator.xr?.requestSession('immersive-vr', { ...sessionInit, optionalFeatures }).then(onSessionStarted)\n } else {\n currentSession.end()\n }\n }\n }\n\n function disableButton() {\n button.style.display = ''\n\n button.style.cursor = 'auto'\n button.style.left = 'calc(50% - 75px)'\n button.style.width = '150px'\n\n button.onmouseenter = null\n button.onmouseleave = null\n\n button.onclick = null\n }\n\n function showWebXRNotFound() {\n disableButton()\n\n button.textContent = 'VR NOT SUPPORTED'\n }\n\n function stylizeElement(element) {\n element.style.position = 'absolute'\n element.style.bottom = '20px'\n element.style.padding = '12px 6px'\n element.style.border = '1px solid #fff'\n element.style.borderRadius = '4px'\n element.style.background = 'rgba(0,0,0,0.1)'\n element.style.color = '#fff'\n element.style.font = 'normal 13px sans-serif'\n element.style.textAlign = 'center'\n element.style.opacity = '0.5'\n element.style.outline = 'none'\n element.style.zIndex = '999'\n }\n\n if ('xr' in navigator) {\n stylizeElement(button)\n button.id = 'VRButton'\n button.style.display = 'none'\n\n // Query for session mode\n navigator.xr.isSessionSupported('immersive-vr').then((supported) => {\n supported ? showEnterVR() : showWebXRNotFound()\n\n if (supported && VRButton.xrSessionIsGranted) {\n button.click()\n }\n })\n\n return button\n } else {\n const message = document.createElement('a')\n\n if (window.isSecureContext === false) {\n message.href = document.location.href.replace(/^http:/, 'https:')\n message.innerHTML = 'WEBXR NEEDS HTTPS' // TODO Improve message\n } else {\n message.href = 'https://immersiveweb.dev/'\n message.innerHTML = 'WEBXR NOT AVAILABLE'\n }\n\n message.style.left = 'calc(50% - 90px)'\n message.style.width = '180px'\n message.style.textDecoration = 'none'\n\n stylizeElement(message)\n\n return message\n }\n }\n\n static xrSessionIsGranted = false\n\n static registerSessionGrantedListener() {\n if (typeof navigator !== 'undefined' && 'xr' in navigator) {\n navigator.xr.addEventListener('sessiongranted', () => {\n VRButton.xrSessionIsGranted = true\n })\n }\n }\n }\n\n VRButton.registerSessionGrantedListener()\n\n return VRButton\n})()\n\nexport { VRButton }\n"],"names":["VRButton"],"mappings":";;;;;;;;AAAK,MAAC,WAA4B,uBAAM;AACtC,QAAM,YAAN,MAAe;AAAA,IACb,OAAO,aAAa,UAAU,cAAc,IAAI;AAC9C,YAAM,SAAS,SAAS,cAAc,QAAQ;AAE9C,eAAS,cAAwB;AAC/B,YAAI,iBAAiB;AAErB,uBAAe,iBAAiB,SAAS;AACvC,kBAAQ,iBAAiB,OAAO,cAAc;AAE9C,gBAAM,SAAS,GAAG,WAAW,OAAO;AACpC,iBAAO,cAAc;AAErB,2BAAiB;AAAA,QAClB;AAED,iBAAS,iBAA0B;AACjC,yBAAe,oBAAoB,OAAO,cAAc;AAExD,iBAAO,cAAc;AAErB,2BAAiB;AAAA,QAClB;AAID,eAAO,MAAM,UAAU;AAEvB,eAAO,MAAM,SAAS;AACtB,eAAO,MAAM,OAAO;AACpB,eAAO,MAAM,QAAQ;AAErB,eAAO,cAAc;AAErB,eAAO,eAAe,MAAM;AAC1B,iBAAO,MAAM,UAAU;AAAA,QACxB;AAED,eAAO,eAAe,MAAM;AAC1B,iBAAO,MAAM,UAAU;AAAA,QACxB;AAED,eAAO,UAAU,MAAM;;AACrB,cAAI,mBAAmB,MAAM;AAQ3B,kBAAM,mBAAmB,CAAC,YAAY,kBAAkB,eAAe,iBAAiB,eAAe,EACpG,KAAM,EACN,OAAO,OAAO;AAEjB,4BAAU,OAAV,mBAAc,eAAe,gBAAgB,EAAE,GAAG,aAAa,iBAAkB,GAAE,KAAK;AAAA,UACpG,OAAiB;AACL,2BAAe,IAAK;AAAA,UACrB;AAAA,QACF;AAAA,MACF;AAED,eAAS,gBAAgB;AACvB,eAA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OAAO,iCAAiC;AACtC,UAAI,OAAO,cAAc,eAAe,QAAQ,WAAW;AACzD,kBAAU,GAAG,iBAAiB,kBAAkB,MAAM;AACpD,oBAAS,qBAAqB;AAAA,QACxC,CAAS;AAAA,MACF;AAAA,IACF;AAAA,EACF;AA7ID,MAAMA,YAAN;AAoIE,gBApIIA,WAoIG,sBAAqB;AAW9B,EAAAA,UAAS,+BAAgC;AAEzC,SAAOA;AACT,GAAC;;"}
|
package/webxr/VRButton.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
declare
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
import { WebGLRenderer } from 'three'
|
2
|
+
|
3
|
+
declare class VRButton {
|
4
|
+
static createButton(renderer: WebGLRenderer, sessionInit?: XRSessionInit): HTMLButtonElement | HTMLAnchorElement
|
5
|
+
|
6
|
+
static xrSessionIsGranted: boolean
|
7
|
+
|
8
|
+
static registerSessionGrantedListener(): void
|
9
|
+
}
|
10
|
+
|
11
|
+
export { VRButton }
|
package/webxr/VRButton.js
CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
5
5
|
return value;
|
6
6
|
};
|
7
7
|
const VRButton = /* @__PURE__ */ (() => {
|
8
|
-
const
|
8
|
+
const _VRButton = class {
|
9
9
|
static createButton(renderer, sessionInit = {}) {
|
10
10
|
const button = document.createElement("button");
|
11
11
|
function showEnterVR() {
|
@@ -75,7 +75,7 @@ const VRButton = /* @__PURE__ */ (() => {
|
|
75
75
|
button.style.display = "none";
|
76
76
|
navigator.xr.isSessionSupported("immersive-vr").then((supported) => {
|
77
77
|
supported ? showEnterVR() : showWebXRNotFound();
|
78
|
-
if (supported &&
|
78
|
+
if (supported && _VRButton.xrSessionIsGranted) {
|
79
79
|
button.click();
|
80
80
|
}
|
81
81
|
});
|
@@ -99,12 +99,12 @@ const VRButton = /* @__PURE__ */ (() => {
|
|
99
99
|
static registerSessionGrantedListener() {
|
100
100
|
if (typeof navigator !== "undefined" && "xr" in navigator) {
|
101
101
|
navigator.xr.addEventListener("sessiongranted", () => {
|
102
|
-
|
102
|
+
_VRButton.xrSessionIsGranted = true;
|
103
103
|
});
|
104
104
|
}
|
105
105
|
}
|
106
106
|
};
|
107
|
-
let VRButton2 =
|
107
|
+
let VRButton2 = _VRButton;
|
108
108
|
__publicField(VRButton2, "xrSessionIsGranted", false);
|
109
109
|
VRButton2.registerSessionGrantedListener();
|
110
110
|
return VRButton2;
|
package/webxr/VRButton.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VRButton.js","sources":["../../src/webxr/VRButton.
|
1
|
+
{"version":3,"file":"VRButton.js","sources":["../../src/webxr/VRButton.js"],"sourcesContent":["const VRButton = /* @__PURE__ */ (() => {\n class VRButton {\n static createButton(renderer, sessionInit = {}) {\n const button = document.createElement('button')\n\n function showEnterVR(/*device*/) {\n let currentSession = null\n\n async function onSessionStarted(session) {\n session.addEventListener('end', onSessionEnded)\n\n await renderer.xr.setSession(session)\n button.textContent = 'EXIT VR'\n\n currentSession = session\n }\n\n function onSessionEnded(/*event*/) {\n currentSession.removeEventListener('end', onSessionEnded)\n\n button.textContent = 'ENTER VR'\n\n currentSession = null\n }\n\n //\n\n button.style.display = ''\n\n button.style.cursor = 'pointer'\n button.style.left = 'calc(50% - 50px)'\n button.style.width = '100px'\n\n button.textContent = 'ENTER VR'\n\n button.onmouseenter = () => {\n button.style.opacity = '1.0'\n }\n\n button.onmouseleave = () => {\n button.style.opacity = '0.5'\n }\n\n button.onclick = () => {\n if (currentSession === null) {\n // WebXR's requestReferenceSpace only works if the corresponding feature\n // was requested at session creation time. For simplicity, just ask for\n // the interesting ones as optional features, but be aware that the\n // requestReferenceSpace call will fail if it turns out to be unavailable.\n // ('local' is always available for immersive sessions and doesn't need to\n // be requested separately.)\n\n const optionalFeatures = [sessionInit.optionalFeatures, 'local-floor', 'bounded-floor', 'hand-tracking']\n .flat()\n .filter(Boolean)\n\n navigator.xr?.requestSession('immersive-vr', { ...sessionInit, optionalFeatures }).then(onSessionStarted)\n } else {\n currentSession.end()\n }\n }\n }\n\n function disableButton() {\n button.style.display = ''\n\n button.style.cursor = 'auto'\n button.style.left = 'calc(50% - 75px)'\n button.style.width = '150px'\n\n button.onmouseenter = null\n button.onmouseleave = null\n\n button.onclick = null\n }\n\n function showWebXRNotFound() {\n disableButton()\n\n button.textContent = 'VR NOT SUPPORTED'\n }\n\n function stylizeElement(element) {\n element.style.position = 'absolute'\n element.style.bottom = '20px'\n element.style.padding = '12px 6px'\n element.style.border = '1px solid #fff'\n element.style.borderRadius = '4px'\n element.style.background = 'rgba(0,0,0,0.1)'\n element.style.color = '#fff'\n element.style.font = 'normal 13px sans-serif'\n element.style.textAlign = 'center'\n element.style.opacity = '0.5'\n element.style.outline = 'none'\n element.style.zIndex = '999'\n }\n\n if ('xr' in navigator) {\n stylizeElement(button)\n button.id = 'VRButton'\n button.style.display = 'none'\n\n // Query for session mode\n navigator.xr.isSessionSupported('immersive-vr').then((supported) => {\n supported ? showEnterVR() : showWebXRNotFound()\n\n if (supported && VRButton.xrSessionIsGranted) {\n button.click()\n }\n })\n\n return button\n } else {\n const message = document.createElement('a')\n\n if (window.isSecureContext === false) {\n message.href = document.location.href.replace(/^http:/, 'https:')\n message.innerHTML = 'WEBXR NEEDS HTTPS' // TODO Improve message\n } else {\n message.href = 'https://immersiveweb.dev/'\n message.innerHTML = 'WEBXR NOT AVAILABLE'\n }\n\n message.style.left = 'calc(50% - 90px)'\n message.style.width = '180px'\n message.style.textDecoration = 'none'\n\n stylizeElement(message)\n\n return message\n }\n }\n\n static xrSessionIsGranted = false\n\n static registerSessionGrantedListener() {\n if (typeof navigator !== 'undefined' && 'xr' in navigator) {\n navigator.xr.addEventListener('sessiongranted', () => {\n VRButton.xrSessionIsGranted = true\n })\n }\n }\n }\n\n VRButton.registerSessionGrantedListener()\n\n return VRButton\n})()\n\nexport { VRButton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