@shopware-ag/dive 3.0.8 → 3.0.9
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/build/chunks/{AssetCache-5FgjqaKg.cjs → AssetCache-B8-Wr1-A.cjs} +1 -1
- package/build/chunks/{AssetCache-w3B0LIUw.mjs → AssetCache-CpOZDw2l.mjs} +1 -1
- package/build/chunks/{AssetLoader-Dp_S2z9P.cjs → AssetLoader-C_5aI7P_.cjs} +1 -1
- package/build/chunks/{AssetLoader-BeP0hkJD.mjs → AssetLoader-_PLMJWFq.mjs} +3 -3
- package/build/chunks/{FileTypes-Ck6z0LqE.mjs → FileTypes-BzbxtVmA.mjs} +196 -166
- package/build/chunks/{FileTypes-Ba65iQSJ.cjs → FileTypes-Cnt-P_Lo.cjs} +2 -2
- package/build/chunks/{PerspectiveCamera-35cBnxwG.mjs → PerspectiveCamera-B5TvUzTa.mjs} +2 -2
- package/build/chunks/isFileTypeSupported-CH4N-8-i.cjs +1 -0
- package/build/chunks/{isFileTypeSupported-DPjSWSnx.mjs → isFileTypeSupported-Cj4v-F9a.mjs} +3 -3
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +132 -117
- package/build/helpers/index.d.ts +3 -0
- package/build/helpers/isFileExtensionSupported/isFileExtensionSupported.d.ts +7 -0
- package/build/helpers/isFileSupported/isFileSupported.d.ts +6 -0
- package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +2 -0
- package/build/helpers/isMimeTypeSupported/isMimeTypeSupported.d.ts +7 -0
- package/build/helpers/isURIFileExtensionSupported/isURIFileExtensionSupported.d.ts +7 -0
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +1 -1
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/mediacreator/index.mjs +1 -1
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +2 -2
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +1 -1
- package/build/plugins/state/index.cjs +1 -1
- package/build/plugins/state/index.mjs +1 -1
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +2 -2
- package/build/types/file/FileTypes.d.ts +9 -0
- package/package.json +1 -1
- package/build/chunks/isFileTypeSupported-Dx01kdxM.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./FileTypes-Cnt-P_Lo.cjs");function o(e){var t;const i=(e.split("/").pop()||"").split(/[?#]/)[0];return!i.includes(".")||i.endsWith(".")?"":((t=i.split(".").pop())==null?void 0:t.toLowerCase())||""}function r(e){return e.toLowerCase()in n.FILE_TYPES}exports.getFileTypeFromUri=o;exports.isFileTypeSupported=r;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as n } from "./FileTypes-
|
|
1
|
+
import { F as n } from "./FileTypes-BzbxtVmA.mjs";
|
|
2
2
|
function r(e) {
|
|
3
3
|
var i;
|
|
4
|
-
const t = e.split("/").pop() || "";
|
|
5
|
-
return !t.includes(".") || t.endsWith(".") ? "" : ((i = t.split(".").pop()) == null ? void 0 : i.toLowerCase()
|
|
4
|
+
const t = (e.split("/").pop() || "").split(/[?#]/)[0];
|
|
5
|
+
return !t.includes(".") || t.endsWith(".") ? "" : ((i = t.split(".").pop()) == null ? void 0 : i.toLowerCase()) || "";
|
|
6
6
|
}
|
|
7
7
|
function p(e) {
|
|
8
8
|
return e.toLowerCase() in n;
|
package/build/dive.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty;var O=(r,i,e)=>i in r?b(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>O(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunks/FileTypes-Ba65iQSJ.cjs"),u=require("./chunks/PerspectiveCamera-DwQUmkDv.cjs"),_=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),s=require("three/webgpu"),V=require("./chunks/findInterface-C6mrvf_t.cjs"),y=require("./chunks/isFileTypeSupported-Dx01kdxM.cjs"),w=require("./chunks/network-error-CdDXil5g.cjs"),A=require("./chunks/parse-error-Dy_EE4rL.cjs"),P=require("./chunks/PovSchema-Co9FznEz.cjs");class m extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const l=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const g=new s.TorusGeometry(t,.1,3,48,o),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function p(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function R(r,i=0){const e=p(r,+i);return p(Math.ceil(e),-i)}function v(r,i=0){const e=p(r,+i);return p(Math.floor(e),-i)}function x(r,i=0){if(r<0)return-x(-r,i);const e=p(r,+i);return p(Math.round(e),-i)}function H(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function G(r,i=0){const e=p(r,+i);return p(Math.round(e),-i).toFixed(i)}function z(r,i=0){const e=p(r,+i);return p(Math.trunc(e),-i)}function L(r){return(s.MathUtils.radToDeg(r)+360)%360}function C(r){return s.MathUtils.degToRad(r)}const S={ceilExp:R,floorExp:v,roundExp:x,toFixedExp:G,truncateExp:z,signedAngleTo:H,radToDeg:L,degToRad:C};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new m("x",1,Math.PI/2,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new m("y",1,-Math.PI/2,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new m("z",1,Math.PI/2,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=S.signedAngleTo(h,o,e.forwardVector),l=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,l)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const l=new s.Mesh(a,this._lineMaterial);l.layers.mask=u.UI_LAYER_MASK,l.renderOrder=1/0,l.rotateX(Math.PI/2),l.translateY(t/2),this.add(l);const d=new s.CylinderGeometry(.1,.1,t,3),g=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,g),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class T extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class M extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const l=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const g=new s.CylinderGeometry(.1,.1,t+a/2,3),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new M("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new M("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new M("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class N extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const l=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(l,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class F extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new T(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new j(e),this._gizmoPlane=new N,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class U{constructor(){n(this,"isMovable",!0)}}class K{constructor(){n(this,"isSelectable",!0)}}function X(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function f(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let l=0;l<r.length;l++)a[l]=f(r[l],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[l,d]of r)a.set(f(l,i),f(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const l of r)a.add(f(l,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}return t}const I=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((l,d)=>{const g=I(o[d],h[d]);Object.keys(g).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=I(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function q(r){return r.entityType==="group"}function B(r){return r.entityType==="light"}function Z(r){return r.entityType==="primitive"}exports.BoundingBox=c.BoundingBox;exports.DIVE=c.DIVE;exports.DIVEAbortablePromise=c.DIVEAbortablePromise;exports.DIVEAmbientLight=c.DIVEAmbientLight;exports.DIVECanvasLifecycleManager=c.DIVECanvasLifecycleManager;exports.DIVEClock=c.DIVEClock;exports.DIVEDefaultSettings=c.DIVEDefaultSettings;exports.DIVEDeferredPromise=c.DIVEDeferredPromise;exports.DIVEEnvironment=c.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=c.DIVEEnvironmentDefaultSettings;exports.DIVEFloor=c.DIVEFloor;exports.DIVEGrid=c.DIVEGrid;exports.DIVEGroup=c.DIVEGroup;exports.DIVEModel=c.DIVEModel;exports.DIVENode=c.DIVENode;exports.DIVEPointLight=c.DIVEPointLight;exports.DIVEPrimitive=c.DIVEPrimitive;exports.DIVERenderer=c.DIVERenderer;exports.DIVERendererDefaultSettings=c.DIVERendererDefaultSettings;exports.DIVERoot=c.DIVERoot;exports.DIVEScene=c.DIVEScene;exports.DIVESceneDefaultSettings=c.DIVESceneDefaultSettings;exports.DIVESceneLight=c.DIVESceneLight;exports.DIVEView=c.DIVEView;exports.FILE_TYPES=c.FILE_TYPES;exports.GRID_MAJOR_LINE_COLOR=c.GRID_MAJOR_LINE_COLOR;exports.GRID_MINOR_LINE_COLOR=c.GRID_MINOR_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=c.SUPPORTED_FILE_TYPES;exports.findSceneRecursive=c.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.DIVEPerspectiveCamera=u.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=u.DIVEPerspectiveCameraDefaultSettings;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.AxesColorBlue=_.AxesColorBlue;exports.AxesColorBlueLetter=_.AxesColorBlueLetter;exports.AxesColorGreen=_.AxesColorGreen;exports.AxesColorGreenLetter=_.AxesColorGreenLetter;exports.AxesColorRed=_.AxesColorRed;exports.AxesColorRedLetter=_.AxesColorRedLetter;exports.findInterface=V.findInterface;exports.implementsInterface=V.implementsInterface;exports.getFileTypeFromUri=y.getFileTypeFromUri;exports.isFileTypeSupported=y.isFileTypeSupported;exports.FileContentError=w.FileContentError;exports.NetworkError=w.NetworkError;exports.FileTypeError=A.FileTypeError;exports.ParseError=A.ParseError;exports.isModelSchema=P.isModelSchema;exports.isPovSchema=P.isPovSchema;exports.DIVEGizmo=F;exports.DIVEMath=S;exports.DIVEMovable=U;exports.DIVESelectable=K;exports.applyMixins=X;exports.deepClone=f;exports.getObjectDelta=I;exports.isGroupSchema=q;exports.isLightSchema=B;exports.isPrimitiveSchema=Z;
|
|
1
|
+
"use strict";var R=Object.defineProperty;var O=(r,i,e)=>i in r?R(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>O(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunks/FileTypes-Cnt-P_Lo.cjs"),u=require("./chunks/PerspectiveCamera-DwQUmkDv.cjs"),_=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),s=require("three/webgpu"),y=require("./chunks/findInterface-C6mrvf_t.cjs"),V=require("./chunks/isFileTypeSupported-CH4N-8-i.cjs"),P=require("./chunks/network-error-CdDXil5g.cjs"),w=require("./chunks/parse-error-Dy_EE4rL.cjs"),S=require("./chunks/PovSchema-Co9FznEz.cjs");class m extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const l=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const g=new s.TorusGeometry(t,.1,3,48,o),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function p(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function v(r,i=0){const e=p(r,+i);return p(Math.ceil(e),-i)}function H(r,i=0){const e=p(r,+i);return p(Math.floor(e),-i)}function A(r,i=0){if(r<0)return-A(-r,i);const e=p(r,+i);return p(Math.round(e),-i)}function G(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function z(r,i=0){const e=p(r,+i);return p(Math.round(e),-i).toFixed(i)}function L(r,i=0){const e=p(r,+i);return p(Math.trunc(e),-i)}function C(r){return(s.MathUtils.radToDeg(r)+360)%360}function T(r){return s.MathUtils.degToRad(r)}const x={ceilExp:v,floorExp:H,roundExp:A,toFixedExp:z,truncateExp:L,signedAngleTo:G,radToDeg:C,degToRad:T};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new m("x",1,Math.PI/2,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new m("y",1,-Math.PI/2,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new m("z",1,Math.PI/2,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=x.signedAngleTo(h,o,e.forwardVector),l=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,l)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const l=new s.Mesh(a,this._lineMaterial);l.layers.mask=u.UI_LAYER_MASK,l.renderOrder=1/0,l.rotateX(Math.PI/2),l.translateY(t/2),this.add(l);const d=new s.CylinderGeometry(.1,.1,t,3),g=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,g),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class M extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const l=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const g=new s.CylinderGeometry(.1,.1,t+a/2,3),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class F extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new M("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new M("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new M("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class U extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const l=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(l,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class N extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new j(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new F(e),this._gizmoPlane=new U,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class K{constructor(){n(this,"isMovable",!0)}}class X{constructor(){n(this,"isSelectable",!0)}}function q(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function f(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let l=0;l<r.length;l++)a[l]=f(r[l],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[l,d]of r)a.set(f(l,i),f(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const l of r)a.add(f(l,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}return t}const I=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((l,d)=>{const g=I(o[d],h[d]);Object.keys(g).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=I(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function B(r){return c.SUPPORTED_MIME_TYPES.includes(r.toLowerCase())}function b(r){return r.toLowerCase()in c.FILE_TYPES}function Z(r){return b(V.getFileTypeFromUri(r))}function k(r){return r.entityType==="group"}function Q(r){return r.entityType==="light"}function W(r){return r.entityType==="primitive"}exports.BoundingBox=c.BoundingBox;exports.DIVE=c.DIVE;exports.DIVEAbortablePromise=c.DIVEAbortablePromise;exports.DIVEAmbientLight=c.DIVEAmbientLight;exports.DIVECanvasLifecycleManager=c.DIVECanvasLifecycleManager;exports.DIVEClock=c.DIVEClock;exports.DIVEDefaultSettings=c.DIVEDefaultSettings;exports.DIVEDeferredPromise=c.DIVEDeferredPromise;exports.DIVEEnvironment=c.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=c.DIVEEnvironmentDefaultSettings;exports.DIVEFloor=c.DIVEFloor;exports.DIVEGrid=c.DIVEGrid;exports.DIVEGroup=c.DIVEGroup;exports.DIVEModel=c.DIVEModel;exports.DIVENode=c.DIVENode;exports.DIVEPointLight=c.DIVEPointLight;exports.DIVEPrimitive=c.DIVEPrimitive;exports.DIVERenderer=c.DIVERenderer;exports.DIVERendererDefaultSettings=c.DIVERendererDefaultSettings;exports.DIVERoot=c.DIVERoot;exports.DIVEScene=c.DIVEScene;exports.DIVESceneDefaultSettings=c.DIVESceneDefaultSettings;exports.DIVESceneLight=c.DIVESceneLight;exports.DIVEView=c.DIVEView;exports.FILE_TYPES=c.FILE_TYPES;exports.GRID_MAJOR_LINE_COLOR=c.GRID_MAJOR_LINE_COLOR;exports.GRID_MINOR_LINE_COLOR=c.GRID_MINOR_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=c.SUPPORTED_FILE_TYPES;exports.SUPPORTED_MIME_TYPES=c.SUPPORTED_MIME_TYPES;exports.findSceneRecursive=c.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.DIVEPerspectiveCamera=u.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=u.DIVEPerspectiveCameraDefaultSettings;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.AxesColorBlue=_.AxesColorBlue;exports.AxesColorBlueLetter=_.AxesColorBlueLetter;exports.AxesColorGreen=_.AxesColorGreen;exports.AxesColorGreenLetter=_.AxesColorGreenLetter;exports.AxesColorRed=_.AxesColorRed;exports.AxesColorRedLetter=_.AxesColorRedLetter;exports.findInterface=y.findInterface;exports.implementsInterface=y.implementsInterface;exports.getFileTypeFromUri=V.getFileTypeFromUri;exports.isFileTypeSupported=V.isFileTypeSupported;exports.FileContentError=P.FileContentError;exports.NetworkError=P.NetworkError;exports.FileTypeError=w.FileTypeError;exports.ParseError=w.ParseError;exports.isModelSchema=S.isModelSchema;exports.isPovSchema=S.isPovSchema;exports.DIVEGizmo=N;exports.DIVEMath=x;exports.DIVEMovable=K;exports.DIVESelectable=X;exports.applyMixins=q;exports.deepClone=f;exports.getObjectDelta=I;exports.isFileExtensionSupported=b;exports.isGroupSchema=k;exports.isLightSchema=Q;exports.isMimeTypeSupported=B;exports.isPrimitiveSchema=W;exports.isURIFileExtensionSupported=Z;
|
package/build/dive.mjs
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
2
|
var A = (r, s, t) => s in r ? S(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
|
|
3
3
|
var i = (r, s, t) => A(r, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { d as G, F as R } from "./chunks/FileTypes-BzbxtVmA.mjs";
|
|
5
|
+
import { B as _t, b as gt, e as mt, f as Et, g as Dt, h as wt, D as yt, i as Mt, j as xt, k as It, l as Pt, m as Vt, n as bt, c as Ht, o as zt, p as vt, q as Ot, r as St, s as At, t as Gt, u as Rt, v as Tt, w as Lt, x as Yt, G as Ct, y as jt, S as Nt, z as Xt } from "./chunks/FileTypes-BzbxtVmA.mjs";
|
|
6
|
+
import { U as d } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
|
|
7
|
+
import { C as Zt, b as qt, D as Qt, a as Ut, H as Wt, P as kt } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
|
|
7
8
|
import { A as I, a as P, b as V } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
8
|
-
import { e as
|
|
9
|
-
import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as
|
|
10
|
-
import { f as
|
|
11
|
-
import { g as
|
|
12
|
-
import {
|
|
13
|
-
import { F as
|
|
14
|
-
import {
|
|
15
|
-
|
|
9
|
+
import { e as Kt, d as Jt, c as $t } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
10
|
+
import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as T, CylinderGeometry as E, BoxGeometry as L, PlaneGeometry as w } from "three/webgpu";
|
|
11
|
+
import { f as ee, i as re } from "./chunks/findInterface-DbJ5qzbc.mjs";
|
|
12
|
+
import { g as Y } from "./chunks/isFileTypeSupported-Cj4v-F9a.mjs";
|
|
13
|
+
import { i as ie } from "./chunks/isFileTypeSupported-Cj4v-F9a.mjs";
|
|
14
|
+
import { F as ae, N as oe } from "./chunks/network-error-BONfHWQq.mjs";
|
|
15
|
+
import { F as le, P as ce } from "./chunks/parse-error-DfOPyLWM.mjs";
|
|
16
|
+
import { i as pe, a as ue } from "./chunks/PovSchema-DWWvr_ED.mjs";
|
|
17
|
+
class y extends f {
|
|
16
18
|
constructor(t, e, n, o, a) {
|
|
17
19
|
super();
|
|
18
20
|
i(this, "isHoverable", !0);
|
|
@@ -34,14 +36,14 @@ class w extends f {
|
|
|
34
36
|
});
|
|
35
37
|
const l = new p(h, this._lineMaterial);
|
|
36
38
|
l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
|
|
37
|
-
const _ = new H(e, 0.1, 3, 48, n),
|
|
39
|
+
const _ = new H(e, 0.1, 3, 48, n), D = new g({
|
|
38
40
|
color: 16711935,
|
|
39
41
|
transparent: !0,
|
|
40
42
|
opacity: 0.15,
|
|
41
43
|
depthTest: !1,
|
|
42
44
|
depthWrite: !1
|
|
43
45
|
});
|
|
44
|
-
this._colliderMesh = new p(_,
|
|
46
|
+
this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
|
|
45
47
|
}
|
|
46
48
|
set debug(t) {
|
|
47
49
|
this._colliderMesh.visible = t;
|
|
@@ -84,11 +86,11 @@ function u(r, s) {
|
|
|
84
86
|
const t = (r + "e").split("e");
|
|
85
87
|
return +(t[0] + "e" + (+t[1] + (s || 0)));
|
|
86
88
|
}
|
|
87
|
-
function
|
|
89
|
+
function C(r, s = 0) {
|
|
88
90
|
const t = u(r, +s);
|
|
89
91
|
return u(Math.ceil(t), -s);
|
|
90
92
|
}
|
|
91
|
-
function
|
|
93
|
+
function j(r, s = 0) {
|
|
92
94
|
const t = u(r, +s);
|
|
93
95
|
return u(Math.floor(t), -s);
|
|
94
96
|
}
|
|
@@ -97,44 +99,44 @@ function O(r, s = 0) {
|
|
|
97
99
|
const t = u(r, +s);
|
|
98
100
|
return u(Math.round(t), -s);
|
|
99
101
|
}
|
|
100
|
-
function
|
|
102
|
+
function N(r, s, t) {
|
|
101
103
|
return Math.atan2(
|
|
102
104
|
r.clone().cross(s).dot(t),
|
|
103
105
|
s.clone().dot(r)
|
|
104
106
|
);
|
|
105
107
|
}
|
|
106
|
-
function
|
|
108
|
+
function X(r, s = 0) {
|
|
107
109
|
const t = u(r, +s);
|
|
108
110
|
return u(Math.round(t), -s).toFixed(s);
|
|
109
111
|
}
|
|
110
|
-
function
|
|
112
|
+
function F(r, s = 0) {
|
|
111
113
|
const t = u(r, +s);
|
|
112
114
|
return u(Math.trunc(t), -s);
|
|
113
115
|
}
|
|
114
|
-
function
|
|
115
|
-
return (
|
|
116
|
+
function Z(r) {
|
|
117
|
+
return (v.radToDeg(r) + 360) % 360;
|
|
116
118
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
119
|
+
function q(r) {
|
|
120
|
+
return v.degToRad(r);
|
|
119
121
|
}
|
|
120
|
-
const
|
|
121
|
-
ceilExp:
|
|
122
|
-
floorExp:
|
|
122
|
+
const Q = {
|
|
123
|
+
ceilExp: C,
|
|
124
|
+
floorExp: j,
|
|
123
125
|
roundExp: O,
|
|
124
|
-
toFixedExp:
|
|
125
|
-
truncateExp:
|
|
126
|
-
signedAngleTo:
|
|
127
|
-
radToDeg:
|
|
128
|
-
degToRad:
|
|
126
|
+
toFixedExp: X,
|
|
127
|
+
truncateExp: F,
|
|
128
|
+
signedAngleTo: N,
|
|
129
|
+
radToDeg: Z,
|
|
130
|
+
degToRad: q
|
|
129
131
|
};
|
|
130
|
-
class
|
|
132
|
+
class U extends f {
|
|
131
133
|
constructor(t) {
|
|
132
134
|
super();
|
|
133
135
|
i(this, "children");
|
|
134
136
|
i(this, "_controller");
|
|
135
137
|
i(this, "_startRot");
|
|
136
138
|
this.name = "DIVERotateGizmo", this.children = [], this._startRot = null, this._controller = t, this.add(
|
|
137
|
-
new
|
|
139
|
+
new y(
|
|
138
140
|
"x",
|
|
139
141
|
1,
|
|
140
142
|
Math.PI / 2,
|
|
@@ -142,7 +144,7 @@ class Z extends f {
|
|
|
142
144
|
I
|
|
143
145
|
)
|
|
144
146
|
), this.add(
|
|
145
|
-
new
|
|
147
|
+
new y(
|
|
146
148
|
"y",
|
|
147
149
|
1,
|
|
148
150
|
-Math.PI / 2,
|
|
@@ -150,7 +152,7 @@ class Z extends f {
|
|
|
150
152
|
P
|
|
151
153
|
)
|
|
152
154
|
), this.add(
|
|
153
|
-
new
|
|
155
|
+
new y(
|
|
154
156
|
"z",
|
|
155
157
|
1,
|
|
156
158
|
Math.PI / 2,
|
|
@@ -184,11 +186,11 @@ class Z extends f {
|
|
|
184
186
|
}
|
|
185
187
|
onHandleDrag(t, e) {
|
|
186
188
|
if (!this._startRot || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
187
|
-
const n = e.dragCurrent.clone().sub(this.parent.parent.position).normalize(), o = e.dragStart.clone().sub(this.parent.parent.position).normalize(), a =
|
|
189
|
+
const n = e.dragCurrent.clone().sub(this.parent.parent.position).normalize(), o = e.dragStart.clone().sub(this.parent.parent.position).normalize(), a = Q.signedAngleTo(
|
|
188
190
|
o,
|
|
189
191
|
n,
|
|
190
192
|
t.forwardVector
|
|
191
|
-
), h = new
|
|
193
|
+
), h = new T(
|
|
192
194
|
this._startRot.x + t.forwardVector.x * a,
|
|
193
195
|
this._startRot.y + t.forwardVector.y * a,
|
|
194
196
|
this._startRot.z + t.forwardVector.z * a
|
|
@@ -213,7 +215,7 @@ class M extends f {
|
|
|
213
215
|
i(this, "_lineMaterial");
|
|
214
216
|
i(this, "_colliderMesh");
|
|
215
217
|
this.name = "DIVEAxisHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
|
|
216
|
-
const a = new
|
|
218
|
+
const a = new E(0.01, 0.01, e, 13);
|
|
217
219
|
this._lineMaterial = new g({
|
|
218
220
|
color: o,
|
|
219
221
|
depthTest: !1,
|
|
@@ -221,7 +223,7 @@ class M extends f {
|
|
|
221
223
|
});
|
|
222
224
|
const h = new p(a, this._lineMaterial);
|
|
223
225
|
h.layers.mask = d, h.renderOrder = 1 / 0, h.rotateX(Math.PI / 2), h.translateY(e / 2), this.add(h);
|
|
224
|
-
const l = new
|
|
226
|
+
const l = new E(0.1, 0.1, e, 3), _ = new g({
|
|
225
227
|
color: 16711935,
|
|
226
228
|
transparent: !0,
|
|
227
229
|
opacity: 0.15,
|
|
@@ -267,7 +269,7 @@ class M extends f {
|
|
|
267
269
|
this.parent && this.parent.onHandleDragEnd(this);
|
|
268
270
|
}
|
|
269
271
|
}
|
|
270
|
-
class
|
|
272
|
+
class W extends f {
|
|
271
273
|
constructor(t) {
|
|
272
274
|
super();
|
|
273
275
|
i(this, "_controller");
|
|
@@ -335,7 +337,7 @@ class x extends f {
|
|
|
335
337
|
i(this, "_box");
|
|
336
338
|
i(this, "_boxSize");
|
|
337
339
|
this.name = "DIVEScaleHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = a;
|
|
338
|
-
const h = new
|
|
340
|
+
const h = new E(
|
|
339
341
|
0.01,
|
|
340
342
|
0.01,
|
|
341
343
|
e - a / 2,
|
|
@@ -348,22 +350,22 @@ class x extends f {
|
|
|
348
350
|
});
|
|
349
351
|
const l = new p(h, this._lineMaterial);
|
|
350
352
|
l.layers.mask = d, l.renderOrder = 1 / 0, l.rotateX(Math.PI / 2), l.translateY(e / 2 - a / 4), this.add(l), this._box = new p(
|
|
351
|
-
new
|
|
353
|
+
new L(a, a, a),
|
|
352
354
|
this._lineMaterial
|
|
353
355
|
), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - a / 2), this._box.rotateZ(n.x * Math.PI / 2), this._box.rotateX(n.z * Math.PI / 2), this.add(this._box);
|
|
354
|
-
const _ = new
|
|
356
|
+
const _ = new E(
|
|
355
357
|
0.1,
|
|
356
358
|
0.1,
|
|
357
359
|
e + a / 2,
|
|
358
360
|
3
|
|
359
|
-
),
|
|
361
|
+
), D = new g({
|
|
360
362
|
color: 16711935,
|
|
361
363
|
transparent: !0,
|
|
362
364
|
opacity: 0.15,
|
|
363
365
|
depthTest: !1,
|
|
364
366
|
depthWrite: !1
|
|
365
367
|
});
|
|
366
|
-
this._colliderMesh = new p(_,
|
|
368
|
+
this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
|
|
367
369
|
}
|
|
368
370
|
set debug(t) {
|
|
369
371
|
this._colliderMesh.visible = t;
|
|
@@ -411,7 +413,7 @@ class x extends f {
|
|
|
411
413
|
this.parent && this.parent.onAxisDragEnd(this);
|
|
412
414
|
}
|
|
413
415
|
}
|
|
414
|
-
class
|
|
416
|
+
class k extends f {
|
|
415
417
|
constructor(t) {
|
|
416
418
|
super();
|
|
417
419
|
i(this, "isHoverable", !0);
|
|
@@ -471,7 +473,7 @@ class Q extends f {
|
|
|
471
473
|
this._startScale = null, this.handleHighlight(t.axis, !1, !1);
|
|
472
474
|
}
|
|
473
475
|
}
|
|
474
|
-
class
|
|
476
|
+
class B extends f {
|
|
475
477
|
constructor() {
|
|
476
478
|
super();
|
|
477
479
|
i(this, "_meshX");
|
|
@@ -484,11 +486,11 @@ class W extends f {
|
|
|
484
486
|
depthTest: !1,
|
|
485
487
|
depthWrite: !1,
|
|
486
488
|
side: 2
|
|
487
|
-
}), e = new
|
|
489
|
+
}), e = new w(100, 100, 2, 2), n = t.clone();
|
|
488
490
|
n.color.set(16711680), this._meshX = new p(e, n), this._meshX.layers.mask = d, this._meshX.rotateY(Math.PI / 2);
|
|
489
|
-
const o = new
|
|
491
|
+
const o = new w(100, 100, 2, 2), a = t.clone();
|
|
490
492
|
a.color.set(65280), this._meshY = new p(o, a), this._meshY.layers.mask = d, this._meshY.rotateX(-Math.PI / 2);
|
|
491
|
-
const h = new
|
|
493
|
+
const h = new w(100, 100, 2, 2), l = t.clone();
|
|
492
494
|
l.color.set(255), this._meshZ = new p(h, l), this._meshZ.layers.mask = d;
|
|
493
495
|
}
|
|
494
496
|
get XPlane() {
|
|
@@ -527,7 +529,7 @@ class W extends f {
|
|
|
527
529
|
}
|
|
528
530
|
}
|
|
529
531
|
}
|
|
530
|
-
class
|
|
532
|
+
class it extends f {
|
|
531
533
|
constructor(t) {
|
|
532
534
|
super();
|
|
533
535
|
i(this, "_mode");
|
|
@@ -541,7 +543,7 @@ class J extends f {
|
|
|
541
543
|
this.name = "DIVEGizmo", t.addEventListener("change", () => {
|
|
542
544
|
const e = t.getDistance() / 2.5;
|
|
543
545
|
this.scale.set(e, e, e);
|
|
544
|
-
}), this._mode = "translate", this._gizmoNode = new f(), this.add(this._gizmoNode), this._translateGizmo = new
|
|
546
|
+
}), this._mode = "translate", this._gizmoNode = new f(), this.add(this._gizmoNode), this._translateGizmo = new W(t), this._rotateGizmo = new U(t), this._scaleGizmo = new k(t), this._gizmoPlane = new B(), this._gizmoPlane.visible = !1, this._object = null;
|
|
545
547
|
}
|
|
546
548
|
get mode() {
|
|
547
549
|
return this._mode;
|
|
@@ -577,17 +579,17 @@ class J extends f {
|
|
|
577
579
|
this._gizmoNode.clear(), this._gizmoPlane.clear(), this._translateGizmo.reset(), this._rotateGizmo.reset(), this._scaleGizmo.reset(), this.object !== null && (this._mode === "translate" && this._gizmoNode.add(this._translateGizmo), this._mode === "rotate" && this._gizmoNode.add(this._rotateGizmo), this._mode === "scale" && this._gizmoNode.add(this._scaleGizmo), this.add(this._gizmoPlane));
|
|
578
580
|
}
|
|
579
581
|
}
|
|
580
|
-
class
|
|
582
|
+
class nt {
|
|
581
583
|
constructor() {
|
|
582
584
|
i(this, "isMovable", !0);
|
|
583
585
|
}
|
|
584
586
|
}
|
|
585
|
-
class
|
|
587
|
+
class at {
|
|
586
588
|
constructor() {
|
|
587
589
|
i(this, "isSelectable", !0);
|
|
588
590
|
}
|
|
589
591
|
}
|
|
590
|
-
function
|
|
592
|
+
function ot(r, s) {
|
|
591
593
|
return s.forEach((t) => {
|
|
592
594
|
Object.getOwnPropertyNames(t.prototype).forEach((n) => {
|
|
593
595
|
if (n === "constructor")
|
|
@@ -676,7 +678,7 @@ function m(r, s = /* @__PURE__ */ new WeakMap()) {
|
|
|
676
678
|
}
|
|
677
679
|
return e;
|
|
678
680
|
}
|
|
679
|
-
const
|
|
681
|
+
const z = (r, s) => {
|
|
680
682
|
if (Object.keys(r).length === 0 && Object.keys(s).length === 0)
|
|
681
683
|
return {};
|
|
682
684
|
if (typeof r != "object" || typeof s != "object")
|
|
@@ -703,7 +705,7 @@ const v = (r, s) => {
|
|
|
703
705
|
}
|
|
704
706
|
const a = [];
|
|
705
707
|
if (o.forEach((h, l) => {
|
|
706
|
-
const _ =
|
|
708
|
+
const _ = z(
|
|
707
709
|
n[l],
|
|
708
710
|
o[l]
|
|
709
711
|
);
|
|
@@ -719,7 +721,7 @@ const v = (r, s) => {
|
|
|
719
721
|
t = { ...t, [e]: s[e] };
|
|
720
722
|
return;
|
|
721
723
|
}
|
|
722
|
-
const n =
|
|
724
|
+
const n = z(
|
|
723
725
|
r[e],
|
|
724
726
|
s[e]
|
|
725
727
|
);
|
|
@@ -731,76 +733,89 @@ const v = (r, s) => {
|
|
|
731
733
|
r[e] !== s[e] && (t = { ...t, [e]: s[e] });
|
|
732
734
|
}), t;
|
|
733
735
|
};
|
|
734
|
-
function
|
|
736
|
+
function ht(r) {
|
|
737
|
+
return G.includes(r.toLowerCase());
|
|
738
|
+
}
|
|
739
|
+
function K(r) {
|
|
740
|
+
return r.toLowerCase() in R;
|
|
741
|
+
}
|
|
742
|
+
function lt(r) {
|
|
743
|
+
return K(Y(r));
|
|
744
|
+
}
|
|
745
|
+
function ct(r) {
|
|
735
746
|
return r.entityType === "group";
|
|
736
747
|
}
|
|
737
|
-
function
|
|
748
|
+
function dt(r) {
|
|
738
749
|
return r.entityType === "light";
|
|
739
750
|
}
|
|
740
|
-
function
|
|
751
|
+
function pt(r) {
|
|
741
752
|
return r.entityType === "primitive";
|
|
742
753
|
}
|
|
743
754
|
export {
|
|
744
755
|
V as AxesColorBlue,
|
|
745
|
-
|
|
756
|
+
Kt as AxesColorBlueLetter,
|
|
746
757
|
P as AxesColorGreen,
|
|
747
|
-
|
|
758
|
+
Jt as AxesColorGreenLetter,
|
|
748
759
|
I as AxesColorRed,
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
760
|
+
$t as AxesColorRedLetter,
|
|
761
|
+
_t as BoundingBox,
|
|
762
|
+
Zt as COORDINATE_LAYER_MASK,
|
|
763
|
+
qt as DEFAULT_LAYER_MASK,
|
|
764
|
+
gt as DIVE,
|
|
765
|
+
mt as DIVEAbortablePromise,
|
|
766
|
+
Et as DIVEAmbientLight,
|
|
767
|
+
Dt as DIVECanvasLifecycleManager,
|
|
768
|
+
wt as DIVEClock,
|
|
769
|
+
yt as DIVEDefaultSettings,
|
|
770
|
+
Mt as DIVEDeferredPromise,
|
|
771
|
+
xt as DIVEEnvironment,
|
|
772
|
+
It as DIVEEnvironmentDefaultSettings,
|
|
773
|
+
Pt as DIVEFloor,
|
|
774
|
+
it as DIVEGizmo,
|
|
775
|
+
Vt as DIVEGrid,
|
|
776
|
+
bt as DIVEGroup,
|
|
777
|
+
Q as DIVEMath,
|
|
778
|
+
Ht as DIVEModel,
|
|
779
|
+
nt as DIVEMovable,
|
|
780
|
+
zt as DIVENode,
|
|
781
|
+
Qt as DIVEPerspectiveCamera,
|
|
782
|
+
Ut as DIVEPerspectiveCameraDefaultSettings,
|
|
783
|
+
vt as DIVEPointLight,
|
|
784
|
+
Ot as DIVEPrimitive,
|
|
785
|
+
St as DIVERenderer,
|
|
786
|
+
At as DIVERendererDefaultSettings,
|
|
787
|
+
Gt as DIVERoot,
|
|
788
|
+
Rt as DIVEScene,
|
|
789
|
+
Tt as DIVESceneDefaultSettings,
|
|
790
|
+
Lt as DIVESceneLight,
|
|
791
|
+
at as DIVESelectable,
|
|
792
|
+
Yt as DIVEView,
|
|
793
|
+
R as FILE_TYPES,
|
|
794
|
+
ae as FileContentError,
|
|
795
|
+
le as FileTypeError,
|
|
796
|
+
Ct as GRID_MAJOR_LINE_COLOR,
|
|
797
|
+
jt as GRID_MINOR_LINE_COLOR,
|
|
798
|
+
Wt as HELPER_LAYER_MASK,
|
|
799
|
+
oe as NetworkError,
|
|
800
|
+
kt as PRODUCT_LAYER_MASK,
|
|
801
|
+
ce as ParseError,
|
|
802
|
+
Nt as SUPPORTED_FILE_TYPES,
|
|
803
|
+
G as SUPPORTED_MIME_TYPES,
|
|
792
804
|
d as UI_LAYER_MASK,
|
|
793
|
-
|
|
805
|
+
ot as applyMixins,
|
|
794
806
|
m as deepClone,
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
807
|
+
ee as findInterface,
|
|
808
|
+
Xt as findSceneRecursive,
|
|
809
|
+
Y as getFileTypeFromUri,
|
|
810
|
+
z as getObjectDelta,
|
|
811
|
+
re as implementsInterface,
|
|
812
|
+
K as isFileExtensionSupported,
|
|
813
|
+
ie as isFileTypeSupported,
|
|
814
|
+
ct as isGroupSchema,
|
|
815
|
+
dt as isLightSchema,
|
|
816
|
+
ht as isMimeTypeSupported,
|
|
817
|
+
pe as isModelSchema,
|
|
818
|
+
ue as isPovSchema,
|
|
819
|
+
pt as isPrimitiveSchema,
|
|
820
|
+
lt as isURIFileExtensionSupported
|
|
806
821
|
};
|
package/build/helpers/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export * from './getFileTypeFromUri/getFileTypeFromUri.ts';
|
|
|
6
6
|
export * from './getObjectDelta/getObjectDelta.ts';
|
|
7
7
|
export * from './implementsInterface/implementsInterface.ts';
|
|
8
8
|
export * from './isFileTypeSupported/isFileTypeSupported.ts';
|
|
9
|
+
export * from './isMimeTypeSupported/isMimeTypeSupported.ts';
|
|
10
|
+
export * from './isFileExtensionSupported/isFileExtensionSupported.ts';
|
|
11
|
+
export * from './isURIFileExtensionSupported/isURIFileExtensionSupported.ts';
|
|
9
12
|
export * from './math/index.ts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FileType } from '../../types/file/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a file extension is supported
|
|
4
|
+
* @param extension The file extension to check
|
|
5
|
+
* @returns True if the extension is supported, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function isFileExtensionSupported(extension: string): extension is FileType;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a file, file extension, MIME type, or DataTransferItem is supported
|
|
3
|
+
* @param file The file-like input to check
|
|
4
|
+
* @returns True if the file-like input is supported, false otherwise
|
|
5
|
+
*/
|
|
6
|
+
export declare function isFileSupported(file: File | DataTransferItem | string): boolean;
|
|
@@ -3,5 +3,7 @@ import { FileType } from '../../types/file/index.ts';
|
|
|
3
3
|
* Checks if a file extension is supported
|
|
4
4
|
* @param extension The file extension to check
|
|
5
5
|
* @returns True if the extension is supported, false otherwise
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Use isFileExtensionSupported instead
|
|
6
8
|
*/
|
|
7
9
|
export declare function isFileTypeSupported(extension: string): extension is FileType;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MimeType } from '../../types/file/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a file MIME type is supported
|
|
4
|
+
* @param mimeType The file MIME type to check
|
|
5
|
+
* @returns True if the MIME type is supported, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function isMimeTypeSupported(mimeType: string): mimeType is MimeType;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FileType } from '../../index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a URI contains a supported file extension
|
|
4
|
+
* @param uri The URI to check
|
|
5
|
+
* @returns True if the URI contains a supported file extension, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function isURIFileExtensionSupported(uri: string): uri is FileType;
|