@shopware-ag/dive 1.19.1-beta.8 → 2.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/FileTypes-BjZ0rrIV.cjs +1 -0
- package/build/chunks/FileTypes-qgYnI0Jg.mjs +30 -0
- package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +1 -0
- package/build/chunks/ModuleRegistry-RSub8W0G.mjs +13 -0
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +1 -0
- package/build/chunks/PerspectiveCamera-sm4_81KJ.mjs +34 -0
- package/build/chunks/SelectTool-BRKko7uz.cjs +1 -0
- package/build/chunks/SelectTool-mTRiZYaC.mjs +712 -0
- package/build/chunks/SystemInfo-DPAQG-S5.mjs +139 -0
- package/build/chunks/SystemInfo-oX-NNneO.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +8 -0
- package/build/chunks/findInterface-BEdL2iUQ.cjs +1 -0
- package/build/chunks/findInterface-OrXgmwxj.mjs +18 -0
- package/build/chunks/index-C_uFFwT2.mjs +5 -0
- package/build/chunks/index-DAwIH9xh.cjs +1 -0
- package/build/chunks/package-BFpY3sIj.cjs +1 -0
- package/build/chunks/package-BvoZkrge.mjs +39 -0
- package/build/chunks/parse-error-2f5qpXP5.cjs +6 -0
- package/build/chunks/parse-error-DRBVHL9E.mjs +614 -0
- package/build/dive.cjs +30 -0
- package/build/dive.d.ts +2 -0
- package/build/dive.mjs +1757 -0
- package/build/src/{primitive → components}/floor/Floor.d.ts +1 -1
- package/build/src/{gizmo → components/gizmo}/Gizmo.d.ts +4 -4
- package/build/src/{gizmo → components/gizmo}/handles/AxisHandle.d.ts +4 -4
- package/build/src/{gizmo → components/gizmo}/handles/RadialHandle.d.ts +4 -4
- package/build/src/{gizmo → components/gizmo}/handles/ScaleHandle.d.ts +4 -4
- package/build/src/{gizmo → components/gizmo}/plane/GizmoPlane.d.ts +1 -1
- package/build/src/{gizmo → components/gizmo}/rotate/RotateGizmo.d.ts +4 -4
- package/build/src/{gizmo → components/gizmo}/scale/ScaleGizmo.d.ts +5 -5
- package/build/src/{gizmo → components/gizmo}/translate/TranslateGizmo.d.ts +4 -4
- package/build/src/{group → components/group}/Group.d.ts +8 -3
- package/build/src/components/index.d.ts +9 -0
- package/build/src/{light → components/light}/AmbientLight.d.ts +1 -1
- package/build/src/{light → components/light}/PointLight.d.ts +4 -4
- package/build/src/{light → components/light}/SceneLight.d.ts +1 -1
- package/build/src/components/light/index.d.ts +3 -0
- package/build/src/{model → components/model}/Model.d.ts +2 -2
- package/build/src/{node → components/node}/Node.d.ts +4 -4
- package/build/src/{primitive → components/primitive}/Primitive.d.ts +2 -2
- package/build/src/{engine/scene → components}/root/Root.d.ts +6 -2
- package/build/src/constants/index.d.ts +3 -0
- package/build/src/core/Dive.d.ts +57 -0
- package/build/src/core/index.d.ts +1 -0
- package/build/src/engine/Engine.d.ts +19 -19
- package/build/src/engine/camera/PerspectiveCamera.d.ts +6 -3
- package/build/src/engine/clock/Clock.d.ts +19 -0
- package/build/src/engine/renderer/Renderer.d.ts +29 -57
- package/build/src/engine/resize/ResizeManager.d.ts +11 -0
- package/build/src/engine/scene/Scene.d.ts +6 -15
- package/build/src/engine/scene/xrroot/XRRoot.d.ts +5 -5
- package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +3 -3
- package/build/src/{helper → helpers}/findSceneRecursive/findSceneRecursive.d.ts +1 -1
- package/build/src/helpers/index.d.ts +8 -0
- package/build/src/{helper → helpers}/isFileTypeSupported/isFileTypeSupported.d.ts +1 -1
- package/build/src/index.d.ts +8 -2
- package/build/src/{interface → interfaces}/Draggable.d.ts +1 -1
- package/build/src/interfaces/index.d.ts +6 -0
- package/build/src/modules/ModuleRegistry.d.ts +19 -0
- package/build/src/modules/animation/AnimationSystem.cjs +1 -0
- package/build/src/modules/animation/AnimationSystem.d.ts +36 -0
- package/build/src/modules/animation/AnimationSystem.mjs +95 -0
- package/build/src/modules/animation/animator/Animator.d.ts +26 -0
- package/build/src/modules/animation/types/AnimatorParameters.d.ts +7 -0
- package/build/src/modules/ar/ARSystem.cjs +1 -2
- package/build/src/modules/ar/ARSystem.d.ts +1 -2
- package/build/src/modules/ar/ARSystem.mjs +2 -3
- package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +1 -1
- package/build/src/modules/ar/sceneviewer/SceneViewer.d.ts +1 -1
- package/build/src/modules/ar/webxr/WebXR.d.ts +3 -4
- package/build/src/modules/ar/webxr/controller/WebXRController.d.ts +3 -3
- package/build/src/modules/ar/webxr/origin/WebXROrigin.d.ts +2 -2
- package/build/src/modules/ar/webxr/raycaster/WebXRRaycaster.d.ts +4 -4
- package/build/src/modules/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +3 -3
- package/build/src/modules/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
- package/build/src/modules/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs +0 -1
- package/build/src/modules/asset/converter/AssetConverter.d.ts +4 -5
- package/build/src/modules/asset/converter/AssetConverter.mjs +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.cjs +24 -25
- package/build/src/modules/asset/exporter/AssetExporter.d.ts +15 -3
- package/build/src/modules/asset/exporter/AssetExporter.mjs +3 -5
- package/build/src/modules/asset/loader/AssetLoader.cjs +2 -3
- package/build/src/modules/asset/loader/AssetLoader.d.ts +1 -3
- package/build/src/modules/asset/loader/AssetLoader.mjs +96 -101
- package/build/src/modules/axiscamera/AxisCamera.d.ts +21 -0
- package/build/src/modules/controller/orbit/OrbitController.d.ts +30 -0
- package/build/src/modules/mediacreator/MediaCreator.cjs +1 -2
- package/build/src/modules/mediacreator/MediaCreator.d.ts +5 -6
- package/build/src/modules/mediacreator/MediaCreator.mjs +13 -11
- package/build/src/modules/state/ActionRegistry.d.ts +26 -0
- package/build/src/modules/state/State.cjs +27 -0
- package/build/src/modules/state/State.d.ts +58 -0
- package/build/src/modules/state/State.mjs +4271 -0
- package/build/src/modules/state/actions/action.d.ts +36 -0
- package/build/src/modules/state/actions/ar/index.d.ts +1 -0
- package/build/src/modules/state/actions/ar/launchar.d.ts +15 -0
- package/build/src/modules/state/actions/camera/computeencompassingview.d.ts +12 -0
- package/build/src/modules/state/actions/camera/getcameratransform.d.ts +12 -0
- package/build/src/modules/state/actions/camera/index.d.ts +6 -0
- package/build/src/modules/state/actions/camera/lockcamera.d.ts +8 -0
- package/build/src/modules/state/actions/camera/movecamera.d.ts +29 -0
- package/build/src/modules/state/actions/camera/setcameralayer.d.ts +12 -0
- package/build/src/modules/state/actions/camera/setcameratransform.d.ts +15 -0
- package/build/src/modules/state/actions/camera/zoomcamera.d.ts +14 -0
- package/build/src/modules/state/actions/index.d.ts +7 -0
- package/build/src/modules/state/actions/media/generatemedia.d.ts +25 -0
- package/build/src/modules/state/actions/media/index.d.ts +1 -0
- package/build/src/modules/state/actions/object/addobject.d.ts +8 -0
- package/build/src/modules/state/actions/object/deleteobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/deselectobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/dropit.d.ts +12 -0
- package/build/src/modules/state/actions/object/getallobjects.d.ts +8 -0
- package/build/src/modules/state/actions/object/getobjects.d.ts +12 -0
- package/build/src/modules/state/actions/object/index.d.ts +11 -0
- package/build/src/modules/state/actions/object/modelloaded.d.ts +12 -0
- package/build/src/modules/state/actions/object/placeonfloor.d.ts +12 -0
- package/build/src/modules/state/actions/object/selectobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/setparent.d.ts +22 -0
- package/build/src/modules/state/actions/object/updateobject.d.ts +12 -0
- package/build/src/modules/state/actions/renderer/index.d.ts +1 -0
- package/build/src/modules/state/actions/renderer/startrender.d.ts +8 -0
- package/build/src/modules/state/actions/scene/exportscene.d.ts +13 -0
- package/build/src/modules/state/actions/scene/getallscenedata.d.ts +9 -0
- package/build/src/modules/state/actions/scene/index.d.ts +4 -0
- package/build/src/modules/state/actions/scene/setbackground.d.ts +12 -0
- package/build/src/modules/state/actions/scene/updatescene.d.ts +20 -0
- package/build/src/modules/state/actions/toolbox/index.d.ts +4 -0
- package/build/src/modules/state/actions/toolbox/setgizmomode.d.ts +12 -0
- package/build/src/modules/state/actions/toolbox/setgizmoscalelinked.d.ts +8 -0
- package/build/src/modules/state/actions/toolbox/setgizmovisible.d.ts +8 -0
- package/build/src/modules/state/actions/toolbox/usetool.d.ts +13 -0
- package/build/src/modules/state/types/ActionTypes.d.ts +18 -0
- package/build/src/{com → modules/state}/types/COMBaseEntity.d.ts +1 -1
- package/build/src/modules/state/types/COMEntity.d.ts +6 -0
- package/build/src/{com → modules/state}/types/COMGeometry.d.ts +1 -1
- package/build/src/{com → modules/state}/types/COMGroup.d.ts +3 -1
- package/build/src/{com → modules/state}/types/COMLight.d.ts +3 -1
- package/build/src/{com → modules/state}/types/COMModel.d.ts +4 -2
- package/build/src/modules/state/types/COMPov.d.ts +9 -0
- package/build/src/modules/state/types/COMPrimitive.d.ts +13 -0
- package/build/src/modules/state/types/index.d.ts +11 -0
- package/build/src/modules/systeminfo/SystemInfo.cjs +1 -2
- package/build/src/modules/systeminfo/SystemInfo.d.ts +6 -9
- package/build/src/modules/systeminfo/SystemInfo.mjs +3 -113
- package/build/src/{toolbox → modules/toolbox}/BaseTool.d.ts +6 -6
- package/build/src/modules/toolbox/Toolbox.cjs +1 -0
- package/build/src/{toolbox → modules/toolbox}/Toolbox.d.ts +10 -6
- package/build/src/modules/toolbox/Toolbox.mjs +99 -0
- package/build/src/{toolbox → modules/toolbox}/select/SelectTool.d.ts +5 -5
- package/build/src/{toolbox → modules/toolbox}/transform/TransformTool.d.ts +6 -6
- package/build/src/types/SceneData.d.ts +1 -1
- package/build/src/types/SceneObjects.d.ts +6 -6
- package/build/src/types/SceneType.d.ts +1 -1
- package/build/src/types/UUID.d.ts +1 -0
- package/build/src/types/file/index.d.ts +1 -1
- package/build/src/types/index.d.ts +6 -6
- package/package.json +67 -26
- package/build/chunks/PerspectiveCamera-ACx6umAu.mjs +0 -38
- package/build/chunks/PerspectiveCamera-ACx6umAu.mjs.map +0 -1
- package/build/chunks/PerspectiveCamera-BXPNOM71.cjs +0 -2
- package/build/chunks/PerspectiveCamera-BXPNOM71.cjs.map +0 -1
- package/build/chunks/fflate.module-DHdJvhNh.cjs +0 -7
- package/build/chunks/fflate.module-DHdJvhNh.cjs.map +0 -1
- package/build/chunks/fflate.module-DkZg07PZ.mjs +0 -603
- package/build/chunks/fflate.module-DkZg07PZ.mjs.map +0 -1
- package/build/chunks/file-type-error-D6aWGgyc.mjs +0 -15
- package/build/chunks/file-type-error-D6aWGgyc.mjs.map +0 -1
- package/build/chunks/file-type-error-DtvBgs64.cjs +0 -2
- package/build/chunks/file-type-error-DtvBgs64.cjs.map +0 -1
- package/build/chunks/index-C7Wx_9uY.mjs +0 -34
- package/build/chunks/index-C7Wx_9uY.mjs.map +0 -1
- package/build/chunks/index-MNP0K5dt.cjs +0 -2
- package/build/chunks/index-MNP0K5dt.cjs.map +0 -1
- package/build/chunks/network-error-C2ZDC8qS.cjs +0 -2
- package/build/chunks/network-error-C2ZDC8qS.cjs.map +0 -1
- package/build/chunks/network-error-DgecatEk.mjs +0 -27
- package/build/chunks/network-error-DgecatEk.mjs.map +0 -1
- package/build/index.cjs +0 -57
- package/build/index.cjs.map +0 -1
- package/build/index.d.ts +0 -6
- package/build/index.mjs +0 -6809
- package/build/index.mjs.map +0 -1
- package/build/src/animation/AnimationSystem.d.ts +0 -16
- package/build/src/axiscamera/AxisCamera.d.ts +0 -18
- package/build/src/com/Communication.d.ts +0 -74
- package/build/src/com/actions/camera/computeencompassingview.d.ts +0 -9
- package/build/src/com/actions/camera/getcameratransform.d.ts +0 -9
- package/build/src/com/actions/camera/movecamera.d.ts +0 -15
- package/build/src/com/actions/camera/resetcamera.d.ts +0 -7
- package/build/src/com/actions/camera/setcameralayer.d.ts +0 -7
- package/build/src/com/actions/camera/setcameratransform.d.ts +0 -9
- package/build/src/com/actions/camera/zoomcamera.d.ts +0 -8
- package/build/src/com/actions/index.d.ts +0 -60
- package/build/src/com/actions/media/generatemedia.d.ts +0 -14
- package/build/src/com/actions/object/addobject.d.ts +0 -6
- package/build/src/com/actions/object/deleteobject.d.ts +0 -8
- package/build/src/com/actions/object/deselectobject.d.ts +0 -8
- package/build/src/com/actions/object/getallobjects.d.ts +0 -6
- package/build/src/com/actions/object/getobjects.d.ts +0 -8
- package/build/src/com/actions/object/model/dropit.d.ts +0 -7
- package/build/src/com/actions/object/model/modelloaded.d.ts +0 -7
- package/build/src/com/actions/object/model/placeonfloor.d.ts +0 -7
- package/build/src/com/actions/object/selectobject.d.ts +0 -8
- package/build/src/com/actions/object/setparent.d.ts +0 -13
- package/build/src/com/actions/object/updateobject.d.ts +0 -8
- package/build/src/com/actions/renderer/startrender.d.ts +0 -5
- package/build/src/com/actions/scene/exportscene.d.ts +0 -8
- package/build/src/com/actions/scene/getallscenedata.d.ts +0 -6
- package/build/src/com/actions/scene/launchar.d.ts +0 -9
- package/build/src/com/actions/scene/setbackground.d.ts +0 -7
- package/build/src/com/actions/scene/updatescene.d.ts +0 -11
- package/build/src/com/actions/toolbox/select/setgizmomode.d.ts +0 -7
- package/build/src/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +0 -5
- package/build/src/com/actions/toolbox/transform/setgizmovisible.d.ts +0 -5
- package/build/src/com/actions/toolbox/usetool.d.ts +0 -8
- package/build/src/com/types/COMEntity.d.ts +0 -6
- package/build/src/com/types/COMPov.d.ts +0 -7
- package/build/src/com/types/COMPrimitive.d.ts +0 -11
- package/build/src/com/types/index.d.ts +0 -11
- package/build/src/controls/OrbitControls.d.ts +0 -38
- package/build/src/dive.d.ts +0 -49
- package/build/src/error/index.d.ts +0 -4
- package/build/src/helper/index.d.ts +0 -7
- package/build/src/modules/_system/ModuleImporter.d.ts +0 -21
- package/build/src/modules/_system/ModuleRegistry.d.ts +0 -72
- package/build/src/modules/ar/ARSystem.cjs.map +0 -1
- package/build/src/modules/ar/ARSystem.mjs.map +0 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs.map +0 -1
- package/build/src/modules/asset/converter/AssetConverter.mjs.map +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.cjs.map +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.mjs.map +0 -1
- package/build/src/modules/asset/loader/AssetLoader.cjs.map +0 -1
- package/build/src/modules/asset/loader/AssetLoader.mjs.map +0 -1
- package/build/src/modules/index.cjs +0 -2
- package/build/src/modules/index.cjs.map +0 -1
- package/build/src/modules/index.d.ts +0 -10
- package/build/src/modules/index.mjs +0 -109
- package/build/src/modules/index.mjs.map +0 -1
- package/build/src/modules/mediacreator/MediaCreator.cjs.map +0 -1
- package/build/src/modules/mediacreator/MediaCreator.mjs.map +0 -1
- package/build/src/modules/systeminfo/SystemInfo.cjs.map +0 -1
- package/build/src/modules/systeminfo/SystemInfo.mjs.map +0 -1
- /package/build/src/{grid → components/grid}/Grid.d.ts +0 -0
- /package/build/src/{constant → constants}/AxisHelperColors.d.ts +0 -0
- /package/build/src/{constant → constants}/GridColors.d.ts +0 -0
- /package/build/src/{constant → constants}/VisibilityLayerMask.d.ts +0 -0
- /package/build/src/{helper → helpers}/applyMixins/applyMixins.d.ts +0 -0
- /package/build/src/{helper → helpers}/findInterface/findInterface.d.ts +0 -0
- /package/build/src/{helper → helpers}/getFileTypeFromUri/getFileTypeFromUri.d.ts +0 -0
- /package/build/src/{helper → helpers}/getObjectDelta/getObjectDelta.d.ts +0 -0
- /package/build/src/{helper/isInterface → helpers/implementsInterface}/implementsInterface.d.ts +0 -0
- /package/build/src/{math → helpers/math}/ceil/ceilExp.d.ts +0 -0
- /package/build/src/{math → helpers/math}/degToRad/degToRad.d.ts +0 -0
- /package/build/src/{math → helpers/math}/floor/floorExp.d.ts +0 -0
- /package/build/src/{math → helpers/math}/helper/shift.d.ts +0 -0
- /package/build/src/{math → helpers/math}/index.d.ts +0 -0
- /package/build/src/{math → helpers/math}/radToDeg/radToDeg.d.ts +0 -0
- /package/build/src/{math → helpers/math}/round/roundExp.d.ts +0 -0
- /package/build/src/{math → helpers/math}/signedAngleTo/signedAngleTo.d.ts +0 -0
- /package/build/src/{math → helpers/math}/toFixed/toFixedExp.d.ts +0 -0
- /package/build/src/{math → helpers/math}/truncate/truncateExp.d.ts +0 -0
- /package/build/src/{interface → interfaces}/Hoverable.d.ts +0 -0
- /package/build/src/{interface → interfaces}/Movable.d.ts +0 -0
- /package/build/src/{interface → interfaces}/Rotatable.d.ts +0 -0
- /package/build/src/{interface → interfaces}/Scalable.d.ts +0 -0
- /package/build/src/{interface → interfaces}/Selectable.d.ts +0 -0
- /package/build/src/{events → modules/events}/EventExecutor.d.ts +0 -0
- /package/build/src/{com → modules/state}/types/COMEntityType.d.ts +0 -0
- /package/build/src/{com → modules/state}/types/COMGeometryType.d.ts +0 -0
- /package/build/src/{com → modules/state}/types/COMMaterial.d.ts +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var c=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var o=(s,e,t)=>c(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l={AssetLoader:"./asset/loader/AssetLoader.mjs",AssetConverter:"./asset/converter/AssetConverter.mjs",AssetExporter:"./asset/exporter/AssetExporter.mjs",ARSystem:"./ar/ARSystem.mjs",MediaCreator:"./mediacreator/MediaCreator.mjs",SystemInfo:"./systeminfo/SystemInfo.mjs"};class u{constructor(e){o(this,"_promise",null);o(this,"_importFn");this._name=e,this._importFn=async()=>{const t=l[this._name];if(!t)throw new Error(`Build path for module ${this._name} not found in __MODULE_BUILD_PATHS__. Build configuration issue?`);try{const r=await import(t);if(!r[this._name])throw new Error(`Module class ${this._name} not found in dynamically imported module: ${t}`);return r[this._name]}catch(r){throw new Error(`Failed to dynamically import module ${this._name} from path ${t}: ${r instanceof Error?r.message:String(r)}`)}}}async getClass(){return this._promise||(this._promise=this._importFn()),this._promise}}const i=class i{constructor(){o(this,"_modules",new Map)}static get instance(){return this._instance}register(e){this._modules.has(e)&&console.warn(`Module '${e}' is already registered. Overwriting.`),this._modules.set(e,new u(e))}async get(e){const t=this._modules.get(e);if(!t)throw new Error(`Module '${e}' not registered`);return t.getClass()}};o(i,"_instance",new i);let n=i;const a=n.instance,m={AssetLoader:"./asset/loader/AssetLoader.ts",AssetConverter:"./asset/converter/AssetConverter.ts",AssetExporter:"./asset/exporter/AssetExporter.ts",ARSystem:"./ar/ARSystem.ts",MediaCreator:"./mediacreator/MediaCreator.ts",SystemInfo:"./systeminfo/SystemInfo.ts"};Object.keys(m).forEach(s=>{a.register(s)});exports.MODULE_PATHS=m;exports.ModuleRegistry=a;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/modules/_system/ModuleImporter.ts","../../../src/modules/_system/ModuleRegistry.ts","../../../src/modules/index.ts"],"sourcesContent":["/** @internal */\n\n// Declare the global variable injected by the build process\ndeclare const __MODULE_BUILD_PATHS__: Record<keyof ModuleClasses, string>;\n\n/**\n * @internal\n * Handles the dynamic importing and caching of module classes.\n * This class is responsible for:\n * 1. Resolving the build path for a module\n * 2. Dynamically importing the module class\n * 3. Caching the imported class to avoid multiple imports\n */\nexport class ModuleImporter<T extends new (...args: unknown[]) => unknown> {\n private _promise: Promise<T> | null = null;\n private _importFn: () => Promise<T>;\n\n constructor(private _name: keyof ModuleClasses) {\n this._importFn = async (): Promise<T> => {\n // Get the correct build path from the injected map\n const importPath = __MODULE_BUILD_PATHS__[this._name];\n\n if (!importPath) {\n // This should theoretically not happen if build process is correct\n throw new Error(\n `Build path for module ${this._name} not found in __MODULE_BUILD_PATHS__. Build configuration issue?`,\n );\n }\n\n try {\n // Perform the dynamic import using the path from the map\n const module = await import(/* @vite-ignore */ importPath);\n if (!module[this._name]) {\n throw new Error(\n `Module class ${this._name} not found in dynamically imported module: ${importPath}`,\n );\n }\n return module[this._name] as T;\n } catch (err) {\n throw new Error(\n `Failed to dynamically import module ${this._name} from path ${importPath}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n };\n }\n\n /**\n * @internal\n * Get the module class, importing it if not already cached.\n * @returns A Promise that resolves to the module's class constructor.\n */\n public async getClass(): Promise<T> {\n if (!this._promise) {\n this._promise = this._importFn();\n }\n\n return this._promise;\n }\n}\n","/**\n * @internal\n * This module contains the internal module registry implementation.\n * Do not import directly - use the central export from 'src/modules/index.ts' instead.\n */\n\nimport { ModuleImporter } from './ModuleImporter';\n// Define the base interface that modules will augment\ndeclare global {\n interface ModuleClasses {}\n}\n\n/**\n * @internal\n * Helper type to get the instance type of a module\n */\nexport type ModuleInstance<Id extends keyof ModuleClasses> = InstanceType<\n ModuleClasses[Id]\n>;\n\n/** @internal */\ntype ModuleConstructors = {\n [K in keyof ModuleClasses]: K extends keyof ModuleClasses\n ? ModuleClasses[K] extends { new (...args: infer P): infer R }\n ? new (...args: P) => R\n : new (...args: unknown[]) => ModuleClasses[K]\n : never;\n};\n\n/**\n * @internal\n * The ModuleRegistryClass is a singleton that manages the registration and retrieval of modules.\n * It provides a type-safe way to:\n * 1. Register modules by their name\n * 2. Retrieve module classes for instantiation\n *\n * The registry maintains a map of module names to ModuleImporter instances, which handle the actual\n * dynamic importing of module classes.\n */\nclass ModuleRegistryClass {\n private static _instance = new ModuleRegistryClass();\n // Map stores ModuleImporter instances, keyed by name\n private _modules = new Map<\n keyof ModuleClasses,\n ModuleImporter<new (...args: unknown[]) => unknown>\n >();\n\n private constructor() {}\n\n /**\n * @internal\n * Get the singleton instance of the ModuleRegistryClass.\n * This ensures that there is only one registry throughout the application.\n */\n public static get instance(): ModuleRegistryClass {\n return this._instance;\n }\n\n /**\n * @internal\n * Register a module by its name.\n * This creates a new ModuleImporter instance that will handle the dynamic importing of the module class.\n *\n * @param name - The name of the module to register. Must be a key of ModuleClasses.\n * @throws Error if the module name is not a valid key of ModuleClasses.\n * @example\n * ```typescript\n * ModuleRegistry.register('MyModule');\n * ```\n */\n public register<Id extends keyof ModuleClasses>(name: Id): void {\n if (this._modules.has(name)) {\n console.warn(\n `Module '${name}' is already registered. Overwriting.`,\n );\n }\n this._modules.set(name, new ModuleImporter(name));\n }\n\n /**\n * @internal\n * Get the class constructor for a registered module.\n * This will dynamically import the module if it hasn't been imported yet.\n *\n * @param name - The name of the module to get. Must be a key of ModuleClasses.\n * @returns A Promise that resolves to the module's class constructor.\n * @throws Error if the module is not registered.\n * @example\n * ```typescript\n * const ModuleClass = await ModuleRegistry.get('MyModule');\n * const instance = new ModuleClass();\n * ```\n */\n public async get<Id extends keyof ModuleClasses>(\n name: Id,\n ): Promise<ModuleConstructors[Id]> {\n const module = this._modules.get(name);\n if (!module) {\n throw new Error(`Module '${name}' not registered`);\n }\n return module.getClass() as Promise<ModuleConstructors[Id]>;\n }\n}\n\n// Internal singleton instance\n/** @internal */\nexport const internalModuleRegistry = ModuleRegistryClass.instance;\n","/**\n * Central export point for the module system.\n * This is the only place where ModuleRegistry should be imported from.\n */\nimport {\n internalModuleRegistry as ModuleRegistry,\n type ModuleInstance,\n} from './_system/ModuleRegistry';\n\n// Define module source paths for build process and module registry.\nexport const MODULE_PATHS = {\n AssetLoader: './asset/loader/AssetLoader.ts',\n AssetConverter: './asset/converter/AssetConverter.ts',\n AssetExporter: './asset/exporter/AssetExporter.ts',\n ARSystem: './ar/ARSystem.ts',\n MediaCreator: './mediacreator/MediaCreator.ts',\n SystemInfo: './systeminfo/SystemInfo.ts',\n};\n\n// Register all modules with just their names\nObject.keys(MODULE_PATHS).forEach((name) => {\n ModuleRegistry.register(name as keyof ModuleClasses);\n});\n\n// Re-export the ModuleRegistry as the only public access point\nexport { ModuleRegistry, type ModuleInstance };\n"],"names":["ModuleImporter","_name","__publicField","importPath","define_MODULE_BUILD_PATHS_default","module","err","_ModuleRegistryClass","name","ModuleRegistryClass","internalModuleRegistry","MODULE_PATHS","ModuleRegistry"],"mappings":"ugBAaO,MAAMA,CAA8D,CAIvE,YAAoBC,EAA4B,CAHxCC,EAAA,gBAA8B,MAC9BA,EAAA,kBAEY,KAAA,MAAAD,EAChB,KAAK,UAAY,SAAwB,CAE/B,MAAAE,EAAaC,EAAuB,KAAK,KAAK,EAEpD,GAAI,CAACD,EAED,MAAM,IAAI,MACN,yBAAyB,KAAK,KAAK,kEACvC,EAGA,GAAA,CAEA,MAAME,EAAS,MAAM,OAA0BF,GAC/C,GAAI,CAACE,EAAO,KAAK,KAAK,EAClB,MAAM,IAAI,MACN,gBAAgB,KAAK,KAAK,8CAA8CF,CAAU,EACtF,EAEG,OAAAE,EAAO,KAAK,KAAK,QACnBC,EAAK,CACV,MAAM,IAAI,MACN,uCAAuC,KAAK,KAAK,cAAcH,CAAU,KAAKG,aAAe,MAAQA,EAAI,QAAU,OAAOA,CAAG,CAAC,EAClI,CAAA,CAER,CAAA,CAQJ,MAAa,UAAuB,CAC5B,OAAC,KAAK,WACD,KAAA,SAAW,KAAK,UAAU,GAG5B,KAAK,QAAA,CAEpB,CCnBA,MAAMC,EAAN,MAAMA,CAAoB,CAQd,aAAc,CALdL,EAAA,oBAAe,IAKD,CAOtB,WAAkB,UAAgC,CAC9C,OAAO,KAAK,SAAA,CAeT,SAAyCM,EAAgB,CACxD,KAAK,SAAS,IAAIA,CAAI,GACd,QAAA,KACJ,WAAWA,CAAI,uCACnB,EAEJ,KAAK,SAAS,IAAIA,EAAM,IAAIR,EAAeQ,CAAI,CAAC,CAAA,CAiBpD,MAAa,IACTA,EAC+B,CAC/B,MAAMH,EAAS,KAAK,SAAS,IAAIG,CAAI,EACrC,GAAI,CAACH,EACD,MAAM,IAAI,MAAM,WAAWG,CAAI,kBAAkB,EAErD,OAAOH,EAAO,SAAS,CAAA,CAE/B,EA9DIH,EADEK,EACa,YAAY,IAAIA,GADnC,IAAME,EAANF,EAmEO,MAAMG,EAAyBD,EAAoB,SChG7CE,EAAe,CACxB,YAAa,gCACb,eAAgB,sCAChB,cAAe,oCACf,SAAU,mBACV,aAAc,iCACd,WAAY,4BAChB,EAGA,OAAO,KAAKA,CAAY,EAAE,QAASH,GAAS,CACxCI,EAAe,SAASJ,CAA2B,CACvD,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { internalModuleRegistry as ModuleRegistry, ModuleInstance } from './_system/ModuleRegistry';
|
|
2
|
-
export declare const MODULE_PATHS: {
|
|
3
|
-
AssetLoader: string;
|
|
4
|
-
AssetConverter: string;
|
|
5
|
-
AssetExporter: string;
|
|
6
|
-
ARSystem: string;
|
|
7
|
-
MediaCreator: string;
|
|
8
|
-
SystemInfo: string;
|
|
9
|
-
};
|
|
10
|
-
export { ModuleRegistry, type ModuleInstance };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
var a = Object.defineProperty;
|
|
2
|
-
var m = (s, e, t) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var o = (s, e, t) => m(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
var d = { AssetLoader: "./asset/loader/AssetLoader.mjs", AssetConverter: "./asset/converter/AssetConverter.mjs", AssetExporter: "./asset/exporter/AssetExporter.mjs", ARSystem: "./ar/ARSystem.mjs", MediaCreator: "./mediacreator/MediaCreator.mjs", SystemInfo: "./systeminfo/SystemInfo.mjs" };
|
|
5
|
-
class c {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
o(this, "_promise", null);
|
|
8
|
-
o(this, "_importFn");
|
|
9
|
-
this._name = e, this._importFn = async () => {
|
|
10
|
-
const t = d[this._name];
|
|
11
|
-
if (!t)
|
|
12
|
-
throw new Error(
|
|
13
|
-
`Build path for module ${this._name} not found in __MODULE_BUILD_PATHS__. Build configuration issue?`
|
|
14
|
-
);
|
|
15
|
-
try {
|
|
16
|
-
const r = await import(
|
|
17
|
-
/* @vite-ignore */
|
|
18
|
-
t
|
|
19
|
-
);
|
|
20
|
-
if (!r[this._name])
|
|
21
|
-
throw new Error(
|
|
22
|
-
`Module class ${this._name} not found in dynamically imported module: ${t}`
|
|
23
|
-
);
|
|
24
|
-
return r[this._name];
|
|
25
|
-
} catch (r) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`Failed to dynamically import module ${this._name} from path ${t}: ${r instanceof Error ? r.message : String(r)}`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @internal
|
|
34
|
-
* Get the module class, importing it if not already cached.
|
|
35
|
-
* @returns A Promise that resolves to the module's class constructor.
|
|
36
|
-
*/
|
|
37
|
-
async getClass() {
|
|
38
|
-
return this._promise || (this._promise = this._importFn()), this._promise;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const i = class i {
|
|
42
|
-
constructor() {
|
|
43
|
-
// Map stores ModuleImporter instances, keyed by name
|
|
44
|
-
o(this, "_modules", /* @__PURE__ */ new Map());
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
* Get the singleton instance of the ModuleRegistryClass.
|
|
49
|
-
* This ensures that there is only one registry throughout the application.
|
|
50
|
-
*/
|
|
51
|
-
static get instance() {
|
|
52
|
-
return this._instance;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
* Register a module by its name.
|
|
57
|
-
* This creates a new ModuleImporter instance that will handle the dynamic importing of the module class.
|
|
58
|
-
*
|
|
59
|
-
* @param name - The name of the module to register. Must be a key of ModuleClasses.
|
|
60
|
-
* @throws Error if the module name is not a valid key of ModuleClasses.
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* ModuleRegistry.register('MyModule');
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
register(e) {
|
|
67
|
-
this._modules.has(e) && console.warn(
|
|
68
|
-
`Module '${e}' is already registered. Overwriting.`
|
|
69
|
-
), this._modules.set(e, new c(e));
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
* Get the class constructor for a registered module.
|
|
74
|
-
* This will dynamically import the module if it hasn't been imported yet.
|
|
75
|
-
*
|
|
76
|
-
* @param name - The name of the module to get. Must be a key of ModuleClasses.
|
|
77
|
-
* @returns A Promise that resolves to the module's class constructor.
|
|
78
|
-
* @throws Error if the module is not registered.
|
|
79
|
-
* @example
|
|
80
|
-
* ```typescript
|
|
81
|
-
* const ModuleClass = await ModuleRegistry.get('MyModule');
|
|
82
|
-
* const instance = new ModuleClass();
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
async get(e) {
|
|
86
|
-
const t = this._modules.get(e);
|
|
87
|
-
if (!t)
|
|
88
|
-
throw new Error(`Module '${e}' not registered`);
|
|
89
|
-
return t.getClass();
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
o(i, "_instance", new i());
|
|
93
|
-
let n = i;
|
|
94
|
-
const l = n.instance, _ = {
|
|
95
|
-
AssetLoader: "./asset/loader/AssetLoader.ts",
|
|
96
|
-
AssetConverter: "./asset/converter/AssetConverter.ts",
|
|
97
|
-
AssetExporter: "./asset/exporter/AssetExporter.ts",
|
|
98
|
-
ARSystem: "./ar/ARSystem.ts",
|
|
99
|
-
MediaCreator: "./mediacreator/MediaCreator.ts",
|
|
100
|
-
SystemInfo: "./systeminfo/SystemInfo.ts"
|
|
101
|
-
};
|
|
102
|
-
Object.keys(_).forEach((s) => {
|
|
103
|
-
l.register(s);
|
|
104
|
-
});
|
|
105
|
-
export {
|
|
106
|
-
_ as MODULE_PATHS,
|
|
107
|
-
l as ModuleRegistry
|
|
108
|
-
};
|
|
109
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/modules/_system/ModuleImporter.ts","../../../src/modules/_system/ModuleRegistry.ts","../../../src/modules/index.ts"],"sourcesContent":["/** @internal */\n\n// Declare the global variable injected by the build process\ndeclare const __MODULE_BUILD_PATHS__: Record<keyof ModuleClasses, string>;\n\n/**\n * @internal\n * Handles the dynamic importing and caching of module classes.\n * This class is responsible for:\n * 1. Resolving the build path for a module\n * 2. Dynamically importing the module class\n * 3. Caching the imported class to avoid multiple imports\n */\nexport class ModuleImporter<T extends new (...args: unknown[]) => unknown> {\n private _promise: Promise<T> | null = null;\n private _importFn: () => Promise<T>;\n\n constructor(private _name: keyof ModuleClasses) {\n this._importFn = async (): Promise<T> => {\n // Get the correct build path from the injected map\n const importPath = __MODULE_BUILD_PATHS__[this._name];\n\n if (!importPath) {\n // This should theoretically not happen if build process is correct\n throw new Error(\n `Build path for module ${this._name} not found in __MODULE_BUILD_PATHS__. Build configuration issue?`,\n );\n }\n\n try {\n // Perform the dynamic import using the path from the map\n const module = await import(/* @vite-ignore */ importPath);\n if (!module[this._name]) {\n throw new Error(\n `Module class ${this._name} not found in dynamically imported module: ${importPath}`,\n );\n }\n return module[this._name] as T;\n } catch (err) {\n throw new Error(\n `Failed to dynamically import module ${this._name} from path ${importPath}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n };\n }\n\n /**\n * @internal\n * Get the module class, importing it if not already cached.\n * @returns A Promise that resolves to the module's class constructor.\n */\n public async getClass(): Promise<T> {\n if (!this._promise) {\n this._promise = this._importFn();\n }\n\n return this._promise;\n }\n}\n","/**\n * @internal\n * This module contains the internal module registry implementation.\n * Do not import directly - use the central export from 'src/modules/index.ts' instead.\n */\n\nimport { ModuleImporter } from './ModuleImporter';\n// Define the base interface that modules will augment\ndeclare global {\n interface ModuleClasses {}\n}\n\n/**\n * @internal\n * Helper type to get the instance type of a module\n */\nexport type ModuleInstance<Id extends keyof ModuleClasses> = InstanceType<\n ModuleClasses[Id]\n>;\n\n/** @internal */\ntype ModuleConstructors = {\n [K in keyof ModuleClasses]: K extends keyof ModuleClasses\n ? ModuleClasses[K] extends { new (...args: infer P): infer R }\n ? new (...args: P) => R\n : new (...args: unknown[]) => ModuleClasses[K]\n : never;\n};\n\n/**\n * @internal\n * The ModuleRegistryClass is a singleton that manages the registration and retrieval of modules.\n * It provides a type-safe way to:\n * 1. Register modules by their name\n * 2. Retrieve module classes for instantiation\n *\n * The registry maintains a map of module names to ModuleImporter instances, which handle the actual\n * dynamic importing of module classes.\n */\nclass ModuleRegistryClass {\n private static _instance = new ModuleRegistryClass();\n // Map stores ModuleImporter instances, keyed by name\n private _modules = new Map<\n keyof ModuleClasses,\n ModuleImporter<new (...args: unknown[]) => unknown>\n >();\n\n private constructor() {}\n\n /**\n * @internal\n * Get the singleton instance of the ModuleRegistryClass.\n * This ensures that there is only one registry throughout the application.\n */\n public static get instance(): ModuleRegistryClass {\n return this._instance;\n }\n\n /**\n * @internal\n * Register a module by its name.\n * This creates a new ModuleImporter instance that will handle the dynamic importing of the module class.\n *\n * @param name - The name of the module to register. Must be a key of ModuleClasses.\n * @throws Error if the module name is not a valid key of ModuleClasses.\n * @example\n * ```typescript\n * ModuleRegistry.register('MyModule');\n * ```\n */\n public register<Id extends keyof ModuleClasses>(name: Id): void {\n if (this._modules.has(name)) {\n console.warn(\n `Module '${name}' is already registered. Overwriting.`,\n );\n }\n this._modules.set(name, new ModuleImporter(name));\n }\n\n /**\n * @internal\n * Get the class constructor for a registered module.\n * This will dynamically import the module if it hasn't been imported yet.\n *\n * @param name - The name of the module to get. Must be a key of ModuleClasses.\n * @returns A Promise that resolves to the module's class constructor.\n * @throws Error if the module is not registered.\n * @example\n * ```typescript\n * const ModuleClass = await ModuleRegistry.get('MyModule');\n * const instance = new ModuleClass();\n * ```\n */\n public async get<Id extends keyof ModuleClasses>(\n name: Id,\n ): Promise<ModuleConstructors[Id]> {\n const module = this._modules.get(name);\n if (!module) {\n throw new Error(`Module '${name}' not registered`);\n }\n return module.getClass() as Promise<ModuleConstructors[Id]>;\n }\n}\n\n// Internal singleton instance\n/** @internal */\nexport const internalModuleRegistry = ModuleRegistryClass.instance;\n","/**\n * Central export point for the module system.\n * This is the only place where ModuleRegistry should be imported from.\n */\nimport {\n internalModuleRegistry as ModuleRegistry,\n type ModuleInstance,\n} from './_system/ModuleRegistry';\n\n// Define module source paths for build process and module registry.\nexport const MODULE_PATHS = {\n AssetLoader: './asset/loader/AssetLoader.ts',\n AssetConverter: './asset/converter/AssetConverter.ts',\n AssetExporter: './asset/exporter/AssetExporter.ts',\n ARSystem: './ar/ARSystem.ts',\n MediaCreator: './mediacreator/MediaCreator.ts',\n SystemInfo: './systeminfo/SystemInfo.ts',\n};\n\n// Register all modules with just their names\nObject.keys(MODULE_PATHS).forEach((name) => {\n ModuleRegistry.register(name as keyof ModuleClasses);\n});\n\n// Re-export the ModuleRegistry as the only public access point\nexport { ModuleRegistry, type ModuleInstance };\n"],"names":["ModuleImporter","_name","__publicField","importPath","define_MODULE_BUILD_PATHS_default","module","err","_ModuleRegistryClass","name","ModuleRegistryClass","internalModuleRegistry","MODULE_PATHS","ModuleRegistry"],"mappings":";;;;AAaO,MAAMA,EAA8D;AAAA,EAIvE,YAAoBC,GAA4B;AAHxC,IAAAC,EAAA,kBAA8B;AAC9B,IAAAA,EAAA;AAEY,SAAA,QAAAD,GAChB,KAAK,YAAY,YAAwB;AAE/B,YAAAE,IAAaC,EAAuB,KAAK,KAAK;AAEpD,UAAI,CAACD;AAED,cAAM,IAAI;AAAA,UACN,yBAAyB,KAAK,KAAK;AAAA,QACvC;AAGA,UAAA;AAEA,cAAME,IAAS,MAAM;AAAA;AAAA,UAA0BF;AAAA;AAC/C,YAAI,CAACE,EAAO,KAAK,KAAK;AAClB,gBAAM,IAAI;AAAA,YACN,gBAAgB,KAAK,KAAK,8CAA8CF,CAAU;AAAA,UACtF;AAEG,eAAAE,EAAO,KAAK,KAAK;AAAA,eACnBC,GAAK;AACV,cAAM,IAAI;AAAA,UACN,uCAAuC,KAAK,KAAK,cAAcH,CAAU,KAAKG,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG,CAAC;AAAA,QAClI;AAAA,MAAA;AAAA,IAER;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQJ,MAAa,WAAuB;AAC5B,WAAC,KAAK,aACD,KAAA,WAAW,KAAK,UAAU,IAG5B,KAAK;AAAA,EAAA;AAEpB;ACnBA,MAAMC,IAAN,MAAMA,EAAoB;AAAA,EAQd,cAAc;AALd;AAAA,IAAAL,EAAA,sCAAe,IAGrB;AAAA,EAEoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOtB,WAAkB,WAAgC;AAC9C,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeT,SAAyCM,GAAgB;AAC5D,IAAI,KAAK,SAAS,IAAIA,CAAI,KACd,QAAA;AAAA,MACJ,WAAWA,CAAI;AAAA,IACnB,GAEJ,KAAK,SAAS,IAAIA,GAAM,IAAIR,EAAeQ,CAAI,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBpD,MAAa,IACTA,GAC+B;AAC/B,UAAMH,IAAS,KAAK,SAAS,IAAIG,CAAI;AACrC,QAAI,CAACH;AACD,YAAM,IAAI,MAAM,WAAWG,CAAI,kBAAkB;AAErD,WAAOH,EAAO,SAAS;AAAA,EAAA;AAE/B;AA9DIH,EADEK,GACa,aAAY,IAAIA,EAAoB;AADvD,IAAME,IAANF;AAmEO,MAAMG,IAAyBD,EAAoB,UChG7CE,IAAe;AAAA,EACxB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAChB;AAGA,OAAO,KAAKA,CAAY,EAAE,QAAQ,CAACH,MAAS;AACxCI,EAAAA,EAAe,SAASJ,CAA2B;AACvD,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MediaCreator.cjs","sources":["../../../../src/modules/mediacreator/MediaCreator.ts"],"sourcesContent":["import { DIVEPerspectiveCamera } from '../../engine/camera/PerspectiveCamera';\nimport { type DIVEScene } from '../../engine/scene/Scene';\nimport { type DIVERenderer } from '../../engine/renderer/Renderer';\nimport type DIVEOrbitControls from '../../controls/OrbitControls';\nimport { type Vector3Like } from 'three';\n\ndeclare global {\n interface ModuleClasses {\n MediaCreator: typeof MediaCreator;\n }\n}\n\n/**\n * @module MediaCreator\n *\n * Provides tools for creating media content from the 3D scene:\n *\n * ```ts\n * import { ModuleRegistry } from '@shopware-ag/dive/modules';\n *\n * const MediaCreator = await ModuleRegistry.get('MediaCreator');\n * const mediaCreator = new MediaCreator(renderer, scene, controller);\n *\n * // Generate a screenshot\n * const screenshot = await mediaCreator.GenerateMedia(\n * { x: 0, y: 0, z: 0 }, // camera position\n * { x: 0, y: 0, z: 0 }, // camera target\n * 1920, // width\n * 1080 // height\n * );\n * ```\n *\n * Features:\n * - High-quality screenshot generation\n * - Customizable camera position and target\n * - Configurable output resolution\n */\n\n/**\n * @internal\n */\nexport class MediaCreator {\n private _renderer: DIVERenderer;\n private _scene: DIVEScene;\n private _controller: DIVEOrbitControls;\n\n constructor(\n renderer: DIVERenderer,\n scene: DIVEScene,\n controller: DIVEOrbitControls,\n ) {\n this._renderer = renderer;\n this._scene = scene;\n this._controller = controller;\n }\n\n public GenerateMedia(\n position: Vector3Like,\n target: Vector3Like,\n width: number,\n height: number,\n ): string {\n const resetPosition = this._controller.object.position.clone();\n const resetRotation = this._controller.object.quaternion.clone();\n\n this._renderer.OnResize(width, height);\n this._controller.object.OnResize(width, height);\n\n this._controller.object.position.copy(position);\n this._controller.target.copy(target);\n this._controller.update();\n\n const dataUri = this.DrawCanvas().toDataURL();\n\n this._controller.object.position.copy(resetPosition);\n this._controller.object.quaternion.copy(resetRotation);\n\n return dataUri;\n }\n\n public DrawCanvas(canvasElement?: HTMLCanvasElement): HTMLCanvasElement {\n // save current canvas\n const restore = this._renderer.domElement;\n if (canvasElement) {\n this._renderer.domElement = canvasElement;\n }\n\n // draw canvas\n this._controller.object.layers.mask =\n DIVEPerspectiveCamera.LIVE_VIEW_LAYER_MASK;\n this._renderer.render(this._scene, this._controller.object);\n this._controller.object.layers.mask =\n DIVEPerspectiveCamera.EDITOR_VIEW_LAYER_MASK;\n\n const returnCanvas = this._renderer.domElement;\n\n // restore canvas\n if (canvasElement) {\n this._renderer.domElement = restore;\n }\n\n return returnCanvas;\n }\n}\n"],"names":["MediaCreator","renderer","scene","controller","__publicField","position","target","width","height","resetPosition","resetRotation","dataUri","canvasElement","restore","DIVEPerspectiveCamera","returnCanvas"],"mappings":"sTAyCO,MAAMA,CAAa,CAKtB,YACIC,EACAC,EACAC,EACF,CARMC,EAAA,kBACAA,EAAA,eACAA,EAAA,oBAOJ,KAAK,UAAYH,EACjB,KAAK,OAASC,EACd,KAAK,YAAcC,CAAA,CAGhB,cACHE,EACAC,EACAC,EACAC,EACM,CACN,MAAMC,EAAgB,KAAK,YAAY,OAAO,SAAS,MAAM,EACvDC,EAAgB,KAAK,YAAY,OAAO,WAAW,MAAM,EAE1D,KAAA,UAAU,SAASH,EAAOC,CAAM,EACrC,KAAK,YAAY,OAAO,SAASD,EAAOC,CAAM,EAE9C,KAAK,YAAY,OAAO,SAAS,KAAKH,CAAQ,EACzC,KAAA,YAAY,OAAO,KAAKC,CAAM,EACnC,KAAK,YAAY,OAAO,EAExB,MAAMK,EAAU,KAAK,WAAW,EAAE,UAAU,EAE5C,YAAK,YAAY,OAAO,SAAS,KAAKF,CAAa,EACnD,KAAK,YAAY,OAAO,WAAW,KAAKC,CAAa,EAE9CC,CAAA,CAGJ,WAAWC,EAAsD,CAE9D,MAAAC,EAAU,KAAK,UAAU,WAC3BD,IACA,KAAK,UAAU,WAAaA,GAIhC,KAAK,YAAY,OAAO,OAAO,KAC3BE,EAAsB,sBAAA,qBAC1B,KAAK,UAAU,OAAO,KAAK,OAAQ,KAAK,YAAY,MAAM,EAC1D,KAAK,YAAY,OAAO,OAAO,KAC3BA,EAAsB,sBAAA,uBAEpB,MAAAC,EAAe,KAAK,UAAU,WAGpC,OAAIH,IACA,KAAK,UAAU,WAAaC,GAGzBE,CAAA,CAEf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MediaCreator.mjs","sources":["../../../../src/modules/mediacreator/MediaCreator.ts"],"sourcesContent":["import { DIVEPerspectiveCamera } from '../../engine/camera/PerspectiveCamera';\nimport { type DIVEScene } from '../../engine/scene/Scene';\nimport { type DIVERenderer } from '../../engine/renderer/Renderer';\nimport type DIVEOrbitControls from '../../controls/OrbitControls';\nimport { type Vector3Like } from 'three';\n\ndeclare global {\n interface ModuleClasses {\n MediaCreator: typeof MediaCreator;\n }\n}\n\n/**\n * @module MediaCreator\n *\n * Provides tools for creating media content from the 3D scene:\n *\n * ```ts\n * import { ModuleRegistry } from '@shopware-ag/dive/modules';\n *\n * const MediaCreator = await ModuleRegistry.get('MediaCreator');\n * const mediaCreator = new MediaCreator(renderer, scene, controller);\n *\n * // Generate a screenshot\n * const screenshot = await mediaCreator.GenerateMedia(\n * { x: 0, y: 0, z: 0 }, // camera position\n * { x: 0, y: 0, z: 0 }, // camera target\n * 1920, // width\n * 1080 // height\n * );\n * ```\n *\n * Features:\n * - High-quality screenshot generation\n * - Customizable camera position and target\n * - Configurable output resolution\n */\n\n/**\n * @internal\n */\nexport class MediaCreator {\n private _renderer: DIVERenderer;\n private _scene: DIVEScene;\n private _controller: DIVEOrbitControls;\n\n constructor(\n renderer: DIVERenderer,\n scene: DIVEScene,\n controller: DIVEOrbitControls,\n ) {\n this._renderer = renderer;\n this._scene = scene;\n this._controller = controller;\n }\n\n public GenerateMedia(\n position: Vector3Like,\n target: Vector3Like,\n width: number,\n height: number,\n ): string {\n const resetPosition = this._controller.object.position.clone();\n const resetRotation = this._controller.object.quaternion.clone();\n\n this._renderer.OnResize(width, height);\n this._controller.object.OnResize(width, height);\n\n this._controller.object.position.copy(position);\n this._controller.target.copy(target);\n this._controller.update();\n\n const dataUri = this.DrawCanvas().toDataURL();\n\n this._controller.object.position.copy(resetPosition);\n this._controller.object.quaternion.copy(resetRotation);\n\n return dataUri;\n }\n\n public DrawCanvas(canvasElement?: HTMLCanvasElement): HTMLCanvasElement {\n // save current canvas\n const restore = this._renderer.domElement;\n if (canvasElement) {\n this._renderer.domElement = canvasElement;\n }\n\n // draw canvas\n this._controller.object.layers.mask =\n DIVEPerspectiveCamera.LIVE_VIEW_LAYER_MASK;\n this._renderer.render(this._scene, this._controller.object);\n this._controller.object.layers.mask =\n DIVEPerspectiveCamera.EDITOR_VIEW_LAYER_MASK;\n\n const returnCanvas = this._renderer.domElement;\n\n // restore canvas\n if (canvasElement) {\n this._renderer.domElement = restore;\n }\n\n return returnCanvas;\n }\n}\n"],"names":["MediaCreator","renderer","scene","controller","__publicField","position","target","width","height","resetPosition","resetRotation","dataUri","canvasElement","restore","DIVEPerspectiveCamera","returnCanvas"],"mappings":";;;;AAyCO,MAAMA,EAAa;AAAA,EAKtB,YACIC,GACAC,GACAC,GACF;AARM,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAOJ,SAAK,YAAYH,GACjB,KAAK,SAASC,GACd,KAAK,cAAcC;AAAA,EAAA;AAAA,EAGhB,cACHE,GACAC,GACAC,GACAC,GACM;AACN,UAAMC,IAAgB,KAAK,YAAY,OAAO,SAAS,MAAM,GACvDC,IAAgB,KAAK,YAAY,OAAO,WAAW,MAAM;AAE1D,SAAA,UAAU,SAASH,GAAOC,CAAM,GACrC,KAAK,YAAY,OAAO,SAASD,GAAOC,CAAM,GAE9C,KAAK,YAAY,OAAO,SAAS,KAAKH,CAAQ,GACzC,KAAA,YAAY,OAAO,KAAKC,CAAM,GACnC,KAAK,YAAY,OAAO;AAExB,UAAMK,IAAU,KAAK,WAAW,EAAE,UAAU;AAE5C,gBAAK,YAAY,OAAO,SAAS,KAAKF,CAAa,GACnD,KAAK,YAAY,OAAO,WAAW,KAAKC,CAAa,GAE9CC;AAAA,EAAA;AAAA,EAGJ,WAAWC,GAAsD;AAE9D,UAAAC,IAAU,KAAK,UAAU;AAC/B,IAAID,MACA,KAAK,UAAU,aAAaA,IAIhC,KAAK,YAAY,OAAO,OAAO,OAC3BE,EAAsB,sBAC1B,KAAK,UAAU,OAAO,KAAK,QAAQ,KAAK,YAAY,MAAM,GAC1D,KAAK,YAAY,OAAO,OAAO,OAC3BA,EAAsB;AAEpB,UAAAC,IAAe,KAAK,UAAU;AAGpC,WAAIH,MACA,KAAK,UAAU,aAAaC,IAGzBE;AAAA,EAAA;AAEf;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SystemInfo.cjs","sources":["../../../../src/modules/systeminfo/SystemInfo.ts"],"sourcesContent":["import { ESystem, EWebXRUnsupportedReason } from '../../types/info';\nimport { ARCompatibilityError } from '../../error';\n\ndeclare global {\n interface ModuleClasses {\n SystemInfo: typeof SystemInfo;\n }\n}\n\n/**\n * @module SystemInfo\n *\n * Provides information about the system's capabilities and performance:\n *\n * ```ts\n * import { ModuleRegistry } from '@shopware-ag/dive/modules';\n *\n * const SystemInfo = await ModuleRegistry.get('SystemInfo');\n * const systemInfo = new SystemInfo();\n *\n * // Get system information\n * const system = systemInfo.getSystem(); // Returns ESystem enum (IOS, ANDROID, etc.)\n *\n * // Check AR capabilities\n * const supportsAR = systemInfo.getSupportsAR();\n *\n * // Check device type\n * const isMobile = systemInfo.isMobile;\n * const isDesktop = systemInfo.isDesktop;\n * ```\n *\n * Features:\n * - System detection (iOS, Android, Windows, etc.)\n * - WebXR support detection\n * - AR capability checking\n * - Device type detection\n * - SceneViewer support detection\n */\n\nexport class SystemInfo {\n private static _supportsWebXR: boolean = false;\n private static _webXRUnsupportedReason: EWebXRUnsupportedReason | null =\n null;\n\n /**\n * Gets the current system (iOS, Android, Windows, etc.)\n * @returns DIVESystem The current system\n */\n public static getSystem(): ESystem {\n if (typeof window === 'undefined' || !window.navigator) {\n return ESystem.UNKNOWN;\n }\n\n const userAgent = window.navigator.userAgent.toLowerCase();\n if (userAgent.includes('iphone') || userAgent.includes('ipad')) {\n return ESystem.IOS;\n }\n if (userAgent.includes('android')) {\n return ESystem.ANDROID;\n }\n if (userAgent.includes('windows')) {\n return ESystem.WINDOWS;\n }\n if (userAgent.includes('macintosh')) {\n return ESystem.MACOS;\n }\n if (userAgent.includes('linux')) {\n return ESystem.LINUX;\n }\n return ESystem.UNKNOWN;\n }\n\n /**\n * @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.\n */\n public static async getSupportsWebXR(): Promise<boolean> {\n if (this._supportsWebXR !== false) {\n return this._supportsWebXR;\n }\n\n // Check if we're in a secure context (HTTPS)\n if (!window.isSecureContext) {\n this._supportsWebXR = false;\n this._webXRUnsupportedReason = EWebXRUnsupportedReason.NO_HTTPS;\n return this._supportsWebXR;\n }\n\n // Check if XRSystem is available\n if (!navigator.xr) {\n this._supportsWebXR = false;\n this._webXRUnsupportedReason = EWebXRUnsupportedReason.NO_WEBXR_API;\n return this._supportsWebXR;\n }\n\n try {\n // Check specifically for immersive-ar support\n const arSupported =\n await navigator.xr.isSessionSupported('immersive-ar');\n this._supportsWebXR = arSupported;\n\n if (!this._supportsWebXR) {\n this._webXRUnsupportedReason =\n EWebXRUnsupportedReason.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE;\n }\n } catch (error) {\n this._supportsWebXR = false;\n this._webXRUnsupportedReason =\n EWebXRUnsupportedReason.AR_PERMISSION_DENIED;\n }\n\n return this._supportsWebXR;\n }\n\n /**\n * @returns The reason why WebXR is not supported on the user's device. Returns null if WebXR is supported.\n */\n public static getWebXRUnsupportedReason(): EWebXRUnsupportedReason | null {\n if (this._supportsWebXR) {\n console.log('WebXR is supported.');\n return null;\n }\n return this._webXRUnsupportedReason;\n }\n\n /**\n * Checks if ARQuickLook is supported on the current device\n * This checks for:\n * 1. AR support via relList\n *\n * Requirements:\n * - iOS 13.0 or later\n * - Safari browser (ARQuickLook is only supported in Safari)\n * - Device with AR capabilities (iPhone/iPad with LiDAR scanner or ARKit support)\n *\n * Note: ARQuickLook is only available in Safari on iOS. Other browsers\n * (Chrome, Firefox, etc.) do not support ARQuickLook, even on iOS.\n *\n * @returns boolean indicating if ARQuickLook is supported\n * @throws ARCompatibilityError if ARQuickLook is not supported, with detailed browser information\n */\n public static getSupportsARQuickLook(): boolean {\n const a = document.createElement('a');\n if (a.relList.supports('ar')) {\n return true;\n }\n\n const userAgent = window.navigator.userAgent;\n const platform = window.navigator.platform;\n const vendor = window.navigator.vendor;\n\n // The base error message - the ARCompatibilityError constructor will add more details\n const errorMessage = 'ARQuickLook is not supported';\n\n throw new ARCompatibilityError(\n errorMessage,\n userAgent,\n platform,\n vendor,\n );\n }\n\n /**\n * Checks if SceneViewer is supported on the current device\n * This checks for:\n * 1. Android device\n * 2. Chrome browser (version 89 or later)\n *\n * Requirements:\n * - Android 7.0 (API level 24) or later\n * - Chrome for Android 89 or later\n *\n * Note: According to Google's documentation, if these requirements are met,\n * SceneViewer will be available. If ARCore is not installed, SceneViewer will\n * fall back to showing the model in 3D.\n *\n * @returns boolean indicating if SceneViewer is supported\n */\n public static getSupportsSceneViewer(): boolean {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || !window.navigator) {\n return false;\n }\n\n const userAgent = window.navigator.userAgent.toLowerCase();\n\n // Check if we're on Android\n if (!userAgent.includes('android')) {\n return false;\n }\n\n // Check if we're using Chrome\n if (!userAgent.includes('chrome')) {\n return false;\n }\n\n // Check Chrome version (89 or later)\n const chromeVersion = userAgent.match(/chrome\\/(\\d+)/);\n if (!chromeVersion || parseInt(chromeVersion[1]) < 89) {\n return false;\n }\n\n return true;\n }\n\n /**\n * @returns A boolean indicating whether the user's device is a mobile device.\n */\n public static get isMobile(): boolean {\n return (\n this.getSystem() === ESystem.ANDROID ||\n this.getSystem() === ESystem.IOS\n );\n }\n\n /**\n * @returns A boolean indicating whether the user's device is a desktop device.\n */\n public static get isDesktop(): boolean {\n return !this.isMobile;\n }\n\n /**\n * @returns A promise that resolves to a boolean indicating whether the user's device is capable of AR.\n */\n public static getSupportsAR(): boolean {\n return this.getSupportsARQuickLook() || this.getSupportsSceneViewer();\n }\n}\n"],"names":["SystemInfo","ESystem","userAgent","EWebXRUnsupportedReason","arSupported","platform","vendor","errorMessage","ARCompatibilityError","chromeVersion","__publicField"],"mappings":"0SAuCO,MAAMA,CAAW,CASpB,OAAc,WAAqB,CAC/B,GAAI,OAAO,OAAW,KAAe,CAAC,OAAO,UACzC,OAAOC,EAAQ,QAAA,QAGnB,MAAMC,EAAY,OAAO,UAAU,UAAU,YAAY,EACzD,OAAIA,EAAU,SAAS,QAAQ,GAAKA,EAAU,SAAS,MAAM,EAClDD,EAAQ,QAAA,IAEfC,EAAU,SAAS,SAAS,EACrBD,EAAQ,QAAA,QAEfC,EAAU,SAAS,SAAS,EACrBD,EAAQ,QAAA,QAEfC,EAAU,SAAS,WAAW,EACvBD,EAAQ,QAAA,MAEfC,EAAU,SAAS,OAAO,EACnBD,EAAQ,QAAA,MAEZA,EAAQ,QAAA,OAAA,CAMnB,aAAoB,kBAAqC,CACjD,GAAA,KAAK,iBAAmB,GACxB,OAAO,KAAK,eAIZ,GAAA,CAAC,OAAO,gBACR,YAAK,eAAiB,GACtB,KAAK,wBAA0BE,EAAAA,wBAAwB,SAChD,KAAK,eAIZ,GAAA,CAAC,UAAU,GACX,YAAK,eAAiB,GACtB,KAAK,wBAA0BA,EAAAA,wBAAwB,aAChD,KAAK,eAGZ,GAAA,CAEA,MAAMC,EACF,MAAM,UAAU,GAAG,mBAAmB,cAAc,EACxD,KAAK,eAAiBA,EAEjB,KAAK,iBACN,KAAK,wBACDD,EAAAA,wBAAwB,2CAEpB,CACZ,KAAK,eAAiB,GACtB,KAAK,wBACDA,EAAAA,wBAAwB,oBAAA,CAGhC,OAAO,KAAK,cAAA,CAMhB,OAAc,2BAA4D,CACtE,OAAI,KAAK,gBACL,QAAQ,IAAI,qBAAqB,EAC1B,MAEJ,KAAK,uBAAA,CAmBhB,OAAc,wBAAkC,CAE5C,GADU,SAAS,cAAc,GAAG,EAC9B,QAAQ,SAAS,IAAI,EAChB,MAAA,GAGL,MAAAD,EAAY,OAAO,UAAU,UAC7BG,EAAW,OAAO,UAAU,SAC5BC,EAAS,OAAO,UAAU,OAG1BC,EAAe,+BAErB,MAAM,IAAIC,EAAA,qBACND,EACAL,EACAG,EACAC,CACJ,CAAA,CAmBJ,OAAc,wBAAkC,CAE5C,GAAI,OAAO,OAAW,KAAe,CAAC,OAAO,UAClC,MAAA,GAGX,MAAMJ,EAAY,OAAO,UAAU,UAAU,YAAY,EAQzD,GALI,CAACA,EAAU,SAAS,SAAS,GAK7B,CAACA,EAAU,SAAS,QAAQ,EACrB,MAAA,GAIL,MAAAO,EAAgBP,EAAU,MAAM,eAAe,EACrD,MAAI,GAACO,GAAiB,SAASA,EAAc,CAAC,CAAC,EAAI,GAI5C,CAMX,WAAkB,UAAoB,CAE9B,OAAA,KAAK,cAAgBR,EAAA,QAAQ,SAC7B,KAAK,cAAgBA,EAAAA,QAAQ,GAAA,CAOrC,WAAkB,WAAqB,CACnC,MAAO,CAAC,KAAK,QAAA,CAMjB,OAAc,eAAyB,CACnC,OAAO,KAAK,0BAA4B,KAAK,uBAAuB,CAAA,CAE5E,CA3LIS,EADSV,EACM,iBAA0B,IACzCU,EAFSV,EAEM,0BACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SystemInfo.mjs","sources":["../../../../src/modules/systeminfo/SystemInfo.ts"],"sourcesContent":["import { ESystem, EWebXRUnsupportedReason } from '../../types/info';\nimport { ARCompatibilityError } from '../../error';\n\ndeclare global {\n interface ModuleClasses {\n SystemInfo: typeof SystemInfo;\n }\n}\n\n/**\n * @module SystemInfo\n *\n * Provides information about the system's capabilities and performance:\n *\n * ```ts\n * import { ModuleRegistry } from '@shopware-ag/dive/modules';\n *\n * const SystemInfo = await ModuleRegistry.get('SystemInfo');\n * const systemInfo = new SystemInfo();\n *\n * // Get system information\n * const system = systemInfo.getSystem(); // Returns ESystem enum (IOS, ANDROID, etc.)\n *\n * // Check AR capabilities\n * const supportsAR = systemInfo.getSupportsAR();\n *\n * // Check device type\n * const isMobile = systemInfo.isMobile;\n * const isDesktop = systemInfo.isDesktop;\n * ```\n *\n * Features:\n * - System detection (iOS, Android, Windows, etc.)\n * - WebXR support detection\n * - AR capability checking\n * - Device type detection\n * - SceneViewer support detection\n */\n\nexport class SystemInfo {\n private static _supportsWebXR: boolean = false;\n private static _webXRUnsupportedReason: EWebXRUnsupportedReason | null =\n null;\n\n /**\n * Gets the current system (iOS, Android, Windows, etc.)\n * @returns DIVESystem The current system\n */\n public static getSystem(): ESystem {\n if (typeof window === 'undefined' || !window.navigator) {\n return ESystem.UNKNOWN;\n }\n\n const userAgent = window.navigator.userAgent.toLowerCase();\n if (userAgent.includes('iphone') || userAgent.includes('ipad')) {\n return ESystem.IOS;\n }\n if (userAgent.includes('android')) {\n return ESystem.ANDROID;\n }\n if (userAgent.includes('windows')) {\n return ESystem.WINDOWS;\n }\n if (userAgent.includes('macintosh')) {\n return ESystem.MACOS;\n }\n if (userAgent.includes('linux')) {\n return ESystem.LINUX;\n }\n return ESystem.UNKNOWN;\n }\n\n /**\n * @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.\n */\n public static async getSupportsWebXR(): Promise<boolean> {\n if (this._supportsWebXR !== false) {\n return this._supportsWebXR;\n }\n\n // Check if we're in a secure context (HTTPS)\n if (!window.isSecureContext) {\n this._supportsWebXR = false;\n this._webXRUnsupportedReason = EWebXRUnsupportedReason.NO_HTTPS;\n return this._supportsWebXR;\n }\n\n // Check if XRSystem is available\n if (!navigator.xr) {\n this._supportsWebXR = false;\n this._webXRUnsupportedReason = EWebXRUnsupportedReason.NO_WEBXR_API;\n return this._supportsWebXR;\n }\n\n try {\n // Check specifically for immersive-ar support\n const arSupported =\n await navigator.xr.isSessionSupported('immersive-ar');\n this._supportsWebXR = arSupported;\n\n if (!this._supportsWebXR) {\n this._webXRUnsupportedReason =\n EWebXRUnsupportedReason.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE;\n }\n } catch (error) {\n this._supportsWebXR = false;\n this._webXRUnsupportedReason =\n EWebXRUnsupportedReason.AR_PERMISSION_DENIED;\n }\n\n return this._supportsWebXR;\n }\n\n /**\n * @returns The reason why WebXR is not supported on the user's device. Returns null if WebXR is supported.\n */\n public static getWebXRUnsupportedReason(): EWebXRUnsupportedReason | null {\n if (this._supportsWebXR) {\n console.log('WebXR is supported.');\n return null;\n }\n return this._webXRUnsupportedReason;\n }\n\n /**\n * Checks if ARQuickLook is supported on the current device\n * This checks for:\n * 1. AR support via relList\n *\n * Requirements:\n * - iOS 13.0 or later\n * - Safari browser (ARQuickLook is only supported in Safari)\n * - Device with AR capabilities (iPhone/iPad with LiDAR scanner or ARKit support)\n *\n * Note: ARQuickLook is only available in Safari on iOS. Other browsers\n * (Chrome, Firefox, etc.) do not support ARQuickLook, even on iOS.\n *\n * @returns boolean indicating if ARQuickLook is supported\n * @throws ARCompatibilityError if ARQuickLook is not supported, with detailed browser information\n */\n public static getSupportsARQuickLook(): boolean {\n const a = document.createElement('a');\n if (a.relList.supports('ar')) {\n return true;\n }\n\n const userAgent = window.navigator.userAgent;\n const platform = window.navigator.platform;\n const vendor = window.navigator.vendor;\n\n // The base error message - the ARCompatibilityError constructor will add more details\n const errorMessage = 'ARQuickLook is not supported';\n\n throw new ARCompatibilityError(\n errorMessage,\n userAgent,\n platform,\n vendor,\n );\n }\n\n /**\n * Checks if SceneViewer is supported on the current device\n * This checks for:\n * 1. Android device\n * 2. Chrome browser (version 89 or later)\n *\n * Requirements:\n * - Android 7.0 (API level 24) or later\n * - Chrome for Android 89 or later\n *\n * Note: According to Google's documentation, if these requirements are met,\n * SceneViewer will be available. If ARCore is not installed, SceneViewer will\n * fall back to showing the model in 3D.\n *\n * @returns boolean indicating if SceneViewer is supported\n */\n public static getSupportsSceneViewer(): boolean {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || !window.navigator) {\n return false;\n }\n\n const userAgent = window.navigator.userAgent.toLowerCase();\n\n // Check if we're on Android\n if (!userAgent.includes('android')) {\n return false;\n }\n\n // Check if we're using Chrome\n if (!userAgent.includes('chrome')) {\n return false;\n }\n\n // Check Chrome version (89 or later)\n const chromeVersion = userAgent.match(/chrome\\/(\\d+)/);\n if (!chromeVersion || parseInt(chromeVersion[1]) < 89) {\n return false;\n }\n\n return true;\n }\n\n /**\n * @returns A boolean indicating whether the user's device is a mobile device.\n */\n public static get isMobile(): boolean {\n return (\n this.getSystem() === ESystem.ANDROID ||\n this.getSystem() === ESystem.IOS\n );\n }\n\n /**\n * @returns A boolean indicating whether the user's device is a desktop device.\n */\n public static get isDesktop(): boolean {\n return !this.isMobile;\n }\n\n /**\n * @returns A promise that resolves to a boolean indicating whether the user's device is capable of AR.\n */\n public static getSupportsAR(): boolean {\n return this.getSupportsARQuickLook() || this.getSupportsSceneViewer();\n }\n}\n"],"names":["SystemInfo","ESystem","userAgent","EWebXRUnsupportedReason","arSupported","platform","vendor","errorMessage","ARCompatibilityError","chromeVersion","__publicField"],"mappings":";;;;AAuCO,MAAMA,EAAW;AAAA;AAAA;AAAA;AAAA;AAAA,EASpB,OAAc,YAAqB;AAC/B,QAAI,OAAO,SAAW,OAAe,CAAC,OAAO;AACzC,aAAOC,EAAQ;AAGnB,UAAMC,IAAY,OAAO,UAAU,UAAU,YAAY;AACzD,WAAIA,EAAU,SAAS,QAAQ,KAAKA,EAAU,SAAS,MAAM,IAClDD,EAAQ,MAEfC,EAAU,SAAS,SAAS,IACrBD,EAAQ,UAEfC,EAAU,SAAS,SAAS,IACrBD,EAAQ,UAEfC,EAAU,SAAS,WAAW,IACvBD,EAAQ,QAEfC,EAAU,SAAS,OAAO,IACnBD,EAAQ,QAEZA,EAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,aAAoB,mBAAqC;AACjD,QAAA,KAAK,mBAAmB;AACxB,aAAO,KAAK;AAIZ,QAAA,CAAC,OAAO;AACR,kBAAK,iBAAiB,IACtB,KAAK,0BAA0BE,EAAwB,UAChD,KAAK;AAIZ,QAAA,CAAC,UAAU;AACX,kBAAK,iBAAiB,IACtB,KAAK,0BAA0BA,EAAwB,cAChD,KAAK;AAGZ,QAAA;AAEA,YAAMC,IACF,MAAM,UAAU,GAAG,mBAAmB,cAAc;AACxD,WAAK,iBAAiBA,GAEjB,KAAK,mBACN,KAAK,0BACDD,EAAwB;AAAA,YAEpB;AACZ,WAAK,iBAAiB,IACtB,KAAK,0BACDA,EAAwB;AAAA,IAAA;AAGhC,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMhB,OAAc,4BAA4D;AACtE,WAAI,KAAK,kBACL,QAAQ,IAAI,qBAAqB,GAC1B,QAEJ,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBhB,OAAc,yBAAkC;AAE5C,QADU,SAAS,cAAc,GAAG,EAC9B,QAAQ,SAAS,IAAI;AAChB,aAAA;AAGL,UAAAD,IAAY,OAAO,UAAU,WAC7BG,IAAW,OAAO,UAAU,UAC5BC,IAAS,OAAO,UAAU,QAG1BC,IAAe;AAErB,UAAM,IAAIC;AAAA,MACND;AAAA,MACAL;AAAA,MACAG;AAAA,MACAC;AAAA,IACJ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBJ,OAAc,yBAAkC;AAE5C,QAAI,OAAO,SAAW,OAAe,CAAC,OAAO;AAClC,aAAA;AAGX,UAAMJ,IAAY,OAAO,UAAU,UAAU,YAAY;AAQzD,QALI,CAACA,EAAU,SAAS,SAAS,KAK7B,CAACA,EAAU,SAAS,QAAQ;AACrB,aAAA;AAIL,UAAAO,IAAgBP,EAAU,MAAM,eAAe;AACrD,WAAI,GAACO,KAAiB,SAASA,EAAc,CAAC,CAAC,IAAI;AAAA,EAI5C;AAAA;AAAA;AAAA;AAAA,EAMX,WAAkB,WAAoB;AAE9B,WAAA,KAAK,gBAAgBR,EAAQ,WAC7B,KAAK,gBAAgBA,EAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAOrC,WAAkB,YAAqB;AACnC,WAAO,CAAC,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,OAAc,gBAAyB;AACnC,WAAO,KAAK,4BAA4B,KAAK,uBAAuB;AAAA,EAAA;AAE5E;AA3LIS,EADSV,GACM,kBAA0B,KACzCU,EAFSV,GAEM,2BACX;"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/build/src/{helper/isInterface → helpers/implementsInterface}/implementsInterface.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|