@vived/core 1.4.1 → 1.4.3
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/README.md +118 -20
- package/dist/cjs/AppObject/AppObject.js +112 -0
- package/dist/cjs/AppObject/AppObject.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectComponent.js +160 -0
- package/dist/cjs/AppObject/AppObjectComponent.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectController.js +34 -0
- package/dist/cjs/AppObject/AppObjectController.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectEntity.js +90 -0
- package/dist/cjs/AppObject/AppObjectEntity.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectEntityRepo.js +130 -0
- package/dist/cjs/AppObject/AppObjectEntityRepo.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectPM.js +86 -0
- package/dist/cjs/AppObject/AppObjectPM.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectRepo.js +153 -0
- package/dist/cjs/AppObject/AppObjectRepo.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectUC.js +35 -0
- package/dist/cjs/AppObject/AppObjectUC.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectView.js +34 -0
- package/dist/cjs/AppObject/AppObjectView.js.map +1 -0
- package/dist/cjs/AppObject/getSingletonComponent.js +26 -0
- package/dist/cjs/AppObject/getSingletonComponent.js.map +1 -0
- package/dist/cjs/AppObject/index.js +27 -0
- package/dist/cjs/AppObject/index.js.map +1 -0
- package/dist/cjs/AppObject/printAppObjectDetails.js +18 -0
- package/dist/cjs/AppObject/printAppObjectDetails.js.map +1 -0
- package/dist/cjs/Entities/MemoizedAngle.js +44 -0
- package/dist/cjs/Entities/MemoizedAngle.js.map +1 -0
- package/dist/cjs/Entities/MemoizedBoolean.js +44 -0
- package/dist/cjs/Entities/MemoizedBoolean.js.map +1 -0
- package/dist/cjs/Entities/MemoizedColor.js +45 -0
- package/dist/cjs/Entities/MemoizedColor.js.map +1 -0
- package/dist/cjs/Entities/MemoizedNumber.js +44 -0
- package/dist/cjs/Entities/MemoizedNumber.js.map +1 -0
- package/dist/cjs/Entities/MemoizedQuaternion.js +45 -0
- package/dist/cjs/Entities/MemoizedQuaternion.js.map +1 -0
- package/dist/cjs/Entities/MemoizedString.js +44 -0
- package/dist/cjs/Entities/MemoizedString.js.map +1 -0
- package/dist/cjs/Entities/MemoizedVector2.js +45 -0
- package/dist/cjs/Entities/MemoizedVector2.js.map +1 -0
- package/dist/cjs/Entities/MemoizedVector3.js +45 -0
- package/dist/cjs/Entities/MemoizedVector3.js.map +1 -0
- package/dist/cjs/Entities/ObservableEntity.js +37 -0
- package/dist/cjs/Entities/ObservableEntity.js.map +1 -0
- package/dist/cjs/Entities/ObserverList.js +48 -0
- package/dist/cjs/Entities/ObserverList.js.map +1 -0
- package/dist/cjs/Entities/RangedNumber.js +65 -0
- package/dist/cjs/Entities/RangedNumber.js.map +1 -0
- package/dist/cjs/Entities/index.js +28 -0
- package/dist/cjs/Entities/index.js.map +1 -0
- package/dist/cjs/Types/AppBoundary.js +3 -0
- package/dist/cjs/Types/AppBoundary.js.map +1 -0
- package/dist/cjs/Types/EaseFn.js +3 -0
- package/dist/cjs/Types/EaseFn.js.map +1 -0
- package/dist/cjs/Types/PmAdapter.js +3 -0
- package/dist/cjs/Types/PmAdapter.js.map +1 -0
- package/dist/cjs/Types/SingletonPmAdapter.js +3 -0
- package/dist/cjs/Types/SingletonPmAdapter.js.map +1 -0
- package/dist/cjs/Types/index.js +21 -0
- package/dist/cjs/Types/index.js.map +1 -0
- package/dist/cjs/Utilities/LengthConverters.js +21 -0
- package/dist/cjs/Utilities/LengthConverters.js.map +1 -0
- package/dist/cjs/Utilities/LerpNumber.js +85 -0
- package/dist/cjs/Utilities/LerpNumber.js.map +1 -0
- package/dist/cjs/Utilities/addAlphaToHex.js +16 -0
- package/dist/cjs/Utilities/addAlphaToHex.js.map +1 -0
- package/dist/cjs/Utilities/alphaToHex.js +21 -0
- package/dist/cjs/Utilities/alphaToHex.js.map +1 -0
- package/dist/cjs/Utilities/degreesToRadians.js +7 -0
- package/dist/cjs/Utilities/degreesToRadians.js.map +1 -0
- package/dist/cjs/Utilities/downloadFile.js +14 -0
- package/dist/cjs/Utilities/downloadFile.js.map +1 -0
- package/dist/cjs/Utilities/easeFunctions.js +208 -0
- package/dist/cjs/Utilities/easeFunctions.js.map +1 -0
- package/dist/cjs/Utilities/generateUniqueID.js +8 -0
- package/dist/cjs/Utilities/generateUniqueID.js.map +1 -0
- package/dist/cjs/Utilities/index.js +25 -0
- package/dist/cjs/Utilities/index.js.map +1 -0
- package/dist/cjs/Utilities/interpolateNumber.js +18 -0
- package/dist/cjs/Utilities/interpolateNumber.js.map +1 -0
- package/dist/cjs/ValueObjects/Angle.js +47 -0
- package/dist/cjs/ValueObjects/Angle.js.map +1 -0
- package/dist/cjs/ValueObjects/Color.js +859 -0
- package/dist/cjs/ValueObjects/Color.js.map +1 -0
- package/dist/cjs/ValueObjects/LineSegment2D.js +72 -0
- package/dist/cjs/ValueObjects/LineSegment2D.js.map +1 -0
- package/dist/cjs/ValueObjects/Matrix.js +466 -0
- package/dist/cjs/ValueObjects/Matrix.js.map +1 -0
- package/dist/cjs/ValueObjects/ParametricLine.js +77 -0
- package/dist/cjs/ValueObjects/ParametricLine.js.map +1 -0
- package/dist/cjs/ValueObjects/ParametricPlane.js +65 -0
- package/dist/cjs/ValueObjects/ParametricPlane.js.map +1 -0
- package/dist/cjs/ValueObjects/Quaternion.js +290 -0
- package/dist/cjs/ValueObjects/Quaternion.js.map +1 -0
- package/dist/cjs/ValueObjects/Rectangle.js +24 -0
- package/dist/cjs/ValueObjects/Rectangle.js.map +1 -0
- package/dist/cjs/ValueObjects/Vector2.js +191 -0
- package/dist/cjs/ValueObjects/Vector2.js.map +1 -0
- package/dist/cjs/ValueObjects/Vector3.js +231 -0
- package/dist/cjs/ValueObjects/Vector3.js.map +1 -0
- package/dist/cjs/ValueObjects/Version.js +171 -0
- package/dist/cjs/ValueObjects/Version.js.map +1 -0
- package/dist/cjs/ValueObjects/index.js +28 -0
- package/dist/cjs/ValueObjects/index.js.map +1 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/AppObject/AppObject.js +53 -0
- package/dist/esm/AppObject/AppObject.js.map +1 -1
- package/dist/esm/AppObject/AppObjectComponent.js +78 -0
- package/dist/esm/AppObject/AppObjectComponent.js.map +1 -1
- package/dist/esm/AppObject/AppObjectController.js +22 -0
- package/dist/esm/AppObject/AppObjectController.js.map +1 -1
- package/dist/esm/AppObject/AppObjectEntity.js +52 -0
- package/dist/esm/AppObject/AppObjectEntity.js.map +1 -1
- package/dist/esm/AppObject/AppObjectEntityRepo.js +75 -1
- package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -1
- package/dist/esm/AppObject/AppObjectPM.js +46 -0
- package/dist/esm/AppObject/AppObjectPM.js.map +1 -1
- package/dist/esm/AppObject/AppObjectRepo.js +20 -0
- package/dist/esm/AppObject/AppObjectRepo.js.map +1 -1
- package/dist/esm/AppObject/AppObjectUC.js +24 -1
- package/dist/esm/AppObject/AppObjectUC.js.map +1 -1
- package/dist/esm/AppObject/AppObjectView.js +23 -1
- package/dist/esm/AppObject/AppObjectView.js.map +1 -1
- package/dist/esm/AppObject/getSingletonComponent.js +19 -0
- package/dist/esm/AppObject/getSingletonComponent.js.map +1 -1
- package/dist/esm/Entities/MemoizedAngle.js +21 -0
- package/dist/esm/Entities/MemoizedAngle.js.map +1 -1
- package/dist/esm/Entities/MemoizedBoolean.js +21 -0
- package/dist/esm/Entities/MemoizedBoolean.js.map +1 -1
- package/dist/esm/Entities/MemoizedColor.js +21 -0
- package/dist/esm/Entities/MemoizedColor.js.map +1 -1
- package/dist/esm/Entities/MemoizedNumber.js +21 -0
- package/dist/esm/Entities/MemoizedNumber.js.map +1 -1
- package/dist/esm/Entities/MemoizedQuaternion.js +21 -0
- package/dist/esm/Entities/MemoizedQuaternion.js.map +1 -1
- package/dist/esm/Entities/MemoizedString.js +21 -0
- package/dist/esm/Entities/MemoizedString.js.map +1 -1
- package/dist/esm/Entities/MemoizedVector2.js +21 -0
- package/dist/esm/Entities/MemoizedVector2.js.map +1 -1
- package/dist/esm/Entities/MemoizedVector3.js +21 -0
- package/dist/esm/Entities/MemoizedVector3.js.map +1 -1
- package/dist/esm/Entities/ObservableEntity.js +17 -0
- package/dist/esm/Entities/ObservableEntity.js.map +1 -1
- package/dist/esm/Entities/ObserverList.js +21 -0
- package/dist/esm/Entities/ObserverList.js.map +1 -1
- package/dist/esm/Entities/RangedNumber.js +29 -0
- package/dist/esm/Entities/RangedNumber.js.map +1 -1
- package/dist/esm/Types/PmAdapter.js.map +1 -1
- package/dist/esm/Types/SingletonPmAdapter.js.map +1 -1
- package/dist/esm/ValueObjects/Angle.js +1 -1
- package/dist/esm/ValueObjects/Angle.js.map +1 -1
- package/dist/esm/ValueObjects/LineSegment2D.js +6 -6
- package/dist/esm/ValueObjects/LineSegment2D.js.map +1 -1
- package/dist/esm/ValueObjects/Matrix.js +6 -6
- package/dist/esm/ValueObjects/Matrix.js.map +1 -1
- package/dist/esm/ValueObjects/Quaternion.js +17 -17
- package/dist/esm/ValueObjects/Quaternion.js.map +1 -1
- package/dist/esm/ValueObjects/Vector2.js +15 -8
- package/dist/esm/ValueObjects/Vector2.js.map +1 -1
- package/dist/types/AppObject/AppObject.d.ts +42 -0
- package/dist/types/AppObject/AppObject.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectComponent.d.ts +80 -0
- package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectController.d.ts +22 -0
- package/dist/types/AppObject/AppObjectController.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectEntity.d.ts +55 -0
- package/dist/types/AppObject/AppObjectEntity.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectEntityRepo.d.ts +75 -0
- package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectPM.d.ts +53 -0
- package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectRepo.d.ts +124 -0
- package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectUC.d.ts +23 -0
- package/dist/types/AppObject/AppObjectUC.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectView.d.ts +22 -0
- package/dist/types/AppObject/AppObjectView.d.ts.map +1 -1
- package/dist/types/AppObject/getSingletonComponent.d.ts +19 -0
- package/dist/types/AppObject/getSingletonComponent.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedAngle.d.ts +21 -0
- package/dist/types/Entities/MemoizedAngle.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedBoolean.d.ts +21 -0
- package/dist/types/Entities/MemoizedBoolean.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedColor.d.ts +21 -0
- package/dist/types/Entities/MemoizedColor.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedNumber.d.ts +21 -0
- package/dist/types/Entities/MemoizedNumber.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedQuaternion.d.ts +21 -0
- package/dist/types/Entities/MemoizedQuaternion.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedString.d.ts +21 -0
- package/dist/types/Entities/MemoizedString.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedVector2.d.ts +21 -0
- package/dist/types/Entities/MemoizedVector2.d.ts.map +1 -1
- package/dist/types/Entities/MemoizedVector3.d.ts +21 -0
- package/dist/types/Entities/MemoizedVector3.d.ts.map +1 -1
- package/dist/types/Entities/ObservableEntity.d.ts +20 -0
- package/dist/types/Entities/ObservableEntity.d.ts.map +1 -1
- package/dist/types/Entities/ObserverList.d.ts +21 -0
- package/dist/types/Entities/ObserverList.d.ts.map +1 -1
- package/dist/types/Entities/RangedNumber.d.ts +37 -0
- package/dist/types/Entities/RangedNumber.d.ts.map +1 -1
- package/dist/types/Types/PmAdapter.d.ts +60 -0
- package/dist/types/Types/PmAdapter.d.ts.map +1 -1
- package/dist/types/Types/SingletonPmAdapter.d.ts +55 -0
- package/dist/types/Types/SingletonPmAdapter.d.ts.map +1 -1
- package/dist/types/ValueObjects/Angle.d.ts +1 -1
- package/dist/types/ValueObjects/Matrix.d.ts +5 -5
- package/dist/types/ValueObjects/Matrix.d.ts.map +1 -1
- package/dist/types/ValueObjects/Quaternion.d.ts +17 -17
- package/dist/types/ValueObjects/Vector2.d.ts +8 -3
- package/dist/types/ValueObjects/Vector2.d.ts.map +1 -1
- package/package.json +58 -55
- package/dist/esm/AppObject/AppObject.test.js +0 -110
- package/dist/esm/AppObject/AppObject.test.js.map +0 -1
- package/dist/esm/AppObject/AppObjectComponent.test.js +0 -130
- package/dist/esm/AppObject/AppObjectComponent.test.js.map +0 -1
- package/dist/esm/AppObject/AppObjectEntity.test.js +0 -106
- package/dist/esm/AppObject/AppObjectEntity.test.js.map +0 -1
- package/dist/esm/AppObject/AppObjectEntityRepo.test.js +0 -147
- package/dist/esm/AppObject/AppObjectEntityRepo.test.js.map +0 -1
- package/dist/esm/AppObject/AppObjectPM.test.js +0 -101
- package/dist/esm/AppObject/AppObjectPM.test.js.map +0 -1
- package/dist/esm/AppObject/AppObjectRepo.test.js +0 -211
- package/dist/esm/AppObject/AppObjectRepo.test.js.map +0 -1
- package/dist/esm/AppObject/getSingletonComponent.test.js +0 -11
- package/dist/esm/AppObject/getSingletonComponent.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedAngle.test.js +0 -28
- package/dist/esm/Entities/MemoizedAngle.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedBoolean.test.js +0 -32
- package/dist/esm/Entities/MemoizedBoolean.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedColor.test.js +0 -30
- package/dist/esm/Entities/MemoizedColor.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedNumber.test.js +0 -27
- package/dist/esm/Entities/MemoizedNumber.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedQuaternion.test.js +0 -30
- package/dist/esm/Entities/MemoizedQuaternion.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedString.test.js +0 -27
- package/dist/esm/Entities/MemoizedString.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedVector2.test.js +0 -30
- package/dist/esm/Entities/MemoizedVector2.test.js.map +0 -1
- package/dist/esm/Entities/MemoizedVector3.test.js +0 -30
- package/dist/esm/Entities/MemoizedVector3.test.js.map +0 -1
- package/dist/esm/Entities/ObservableEntity.test.js +0 -23
- package/dist/esm/Entities/ObservableEntity.test.js.map +0 -1
- package/dist/esm/Entities/ObserverList.test.js +0 -42
- package/dist/esm/Entities/ObserverList.test.js.map +0 -1
- package/dist/esm/Entities/RangedNumber.test.js +0 -94
- package/dist/esm/Entities/RangedNumber.test.js.map +0 -1
- package/dist/esm/Utilities/LengthConverters.test.js +0 -22
- package/dist/esm/Utilities/LengthConverters.test.js.map +0 -1
- package/dist/esm/Utilities/LerpNumber.test.js +0 -88
- package/dist/esm/Utilities/LerpNumber.test.js.map +0 -1
- package/dist/esm/Utilities/addAlphaToHex.test.js +0 -32
- package/dist/esm/Utilities/addAlphaToHex.test.js.map +0 -1
- package/dist/esm/Utilities/alphaToHex.test.js +0 -73
- package/dist/esm/Utilities/alphaToHex.test.js.map +0 -1
- package/dist/esm/Utilities/degreesToRadians.test.js +0 -7
- package/dist/esm/Utilities/degreesToRadians.test.js.map +0 -1
- package/dist/esm/Utilities/easeFunctions.test.js +0 -207
- package/dist/esm/Utilities/easeFunctions.test.js.map +0 -1
- package/dist/esm/Utilities/interpolateNumber.test.js +0 -24
- package/dist/esm/Utilities/interpolateNumber.test.js.map +0 -1
- package/dist/esm/ValueObjects/Angle.test.js +0 -26
- package/dist/esm/ValueObjects/Angle.test.js.map +0 -1
- package/dist/esm/ValueObjects/Color.test.js +0 -145
- package/dist/esm/ValueObjects/Color.test.js.map +0 -1
- package/dist/esm/ValueObjects/LineSegment2D.test.js +0 -100
- package/dist/esm/ValueObjects/LineSegment2D.test.js.map +0 -1
- package/dist/esm/ValueObjects/Matrix.test.js +0 -383
- package/dist/esm/ValueObjects/Matrix.test.js.map +0 -1
- package/dist/esm/ValueObjects/ParametricLine.test.js +0 -124
- package/dist/esm/ValueObjects/ParametricLine.test.js.map +0 -1
- package/dist/esm/ValueObjects/ParametricPlane.test.js +0 -99
- package/dist/esm/ValueObjects/ParametricPlane.test.js.map +0 -1
- package/dist/esm/ValueObjects/Quaternion.test.js +0 -238
- package/dist/esm/ValueObjects/Quaternion.test.js.map +0 -1
- package/dist/esm/ValueObjects/Rectangle.test.js +0 -30
- package/dist/esm/ValueObjects/Rectangle.test.js.map +0 -1
- package/dist/esm/ValueObjects/Vector2.test.js +0 -134
- package/dist/esm/ValueObjects/Vector2.test.js.map +0 -1
- package/dist/esm/ValueObjects/Vector3.test.js +0 -186
- package/dist/esm/ValueObjects/Vector3.test.js.map +0 -1
- package/dist/esm/ValueObjects/Version.test.js +0 -308
- package/dist/esm/ValueObjects/Version.test.js.map +0 -1
- package/dist/types/AppObject/AppObject.test.d.ts +0 -7
- package/dist/types/AppObject/AppObject.test.d.ts.map +0 -1
- package/dist/types/AppObject/AppObjectComponent.test.d.ts +0 -2
- package/dist/types/AppObject/AppObjectComponent.test.d.ts.map +0 -1
- package/dist/types/AppObject/AppObjectEntity.test.d.ts +0 -2
- package/dist/types/AppObject/AppObjectEntity.test.d.ts.map +0 -1
- package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts +0 -2
- package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts.map +0 -1
- package/dist/types/AppObject/AppObjectPM.test.d.ts +0 -2
- package/dist/types/AppObject/AppObjectPM.test.d.ts.map +0 -1
- package/dist/types/AppObject/AppObjectRepo.test.d.ts +0 -2
- package/dist/types/AppObject/AppObjectRepo.test.d.ts.map +0 -1
- package/dist/types/AppObject/getSingletonComponent.test.d.ts +0 -2
- package/dist/types/AppObject/getSingletonComponent.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedAngle.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedAngle.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedBoolean.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedBoolean.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedColor.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedColor.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedNumber.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedNumber.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedQuaternion.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedQuaternion.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedString.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedString.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedVector2.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedVector2.test.d.ts.map +0 -1
- package/dist/types/Entities/MemoizedVector3.test.d.ts +0 -2
- package/dist/types/Entities/MemoizedVector3.test.d.ts.map +0 -1
- package/dist/types/Entities/ObservableEntity.test.d.ts +0 -2
- package/dist/types/Entities/ObservableEntity.test.d.ts.map +0 -1
- package/dist/types/Entities/ObserverList.test.d.ts +0 -2
- package/dist/types/Entities/ObserverList.test.d.ts.map +0 -1
- package/dist/types/Entities/RangedNumber.test.d.ts +0 -2
- package/dist/types/Entities/RangedNumber.test.d.ts.map +0 -1
- package/dist/types/Utilities/LengthConverters.test.d.ts +0 -2
- package/dist/types/Utilities/LengthConverters.test.d.ts.map +0 -1
- package/dist/types/Utilities/LerpNumber.test.d.ts +0 -2
- package/dist/types/Utilities/LerpNumber.test.d.ts.map +0 -1
- package/dist/types/Utilities/addAlphaToHex.test.d.ts +0 -2
- package/dist/types/Utilities/addAlphaToHex.test.d.ts.map +0 -1
- package/dist/types/Utilities/alphaToHex.test.d.ts +0 -2
- package/dist/types/Utilities/alphaToHex.test.d.ts.map +0 -1
- package/dist/types/Utilities/degreesToRadians.test.d.ts +0 -2
- package/dist/types/Utilities/degreesToRadians.test.d.ts.map +0 -1
- package/dist/types/Utilities/easeFunctions.test.d.ts +0 -2
- package/dist/types/Utilities/easeFunctions.test.d.ts.map +0 -1
- package/dist/types/Utilities/interpolateNumber.test.d.ts +0 -2
- package/dist/types/Utilities/interpolateNumber.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Angle.test.d.ts +0 -2
- package/dist/types/ValueObjects/Angle.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Color.test.d.ts +0 -2
- package/dist/types/ValueObjects/Color.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/LineSegment2D.test.d.ts +0 -2
- package/dist/types/ValueObjects/LineSegment2D.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Matrix.test.d.ts +0 -2
- package/dist/types/ValueObjects/Matrix.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/ParametricLine.test.d.ts +0 -2
- package/dist/types/ValueObjects/ParametricLine.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/ParametricPlane.test.d.ts +0 -2
- package/dist/types/ValueObjects/ParametricPlane.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Quaternion.test.d.ts +0 -2
- package/dist/types/ValueObjects/Quaternion.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Rectangle.test.d.ts +0 -2
- package/dist/types/ValueObjects/Rectangle.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Vector2.test.d.ts +0 -2
- package/dist/types/ValueObjects/Vector2.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Vector3.test.d.ts +0 -2
- package/dist/types/ValueObjects/Vector3.test.d.ts.map +0 -1
- package/dist/types/ValueObjects/Version.test.d.ts +0 -2
- package/dist/types/ValueObjects/Version.test.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedAngle.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedAngle.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,aAAa;IAGxB;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAQ;QACd,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;YAAE,OAAO;QAE5C,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAU;QAC7B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAmB,EAAE,gBAA4B;QAC3D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,sCAyCC","sourcesContent":["import { Angle } from \"../ValueObjects\";\r\n\r\n/**\r\n * A wrapper class for Angle objects that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the angle value actually changes.\r\n */\r\nexport class MemoizedAngle {\r\n private _val: Angle;\r\n\r\n /**\r\n * Gets the current angle value\r\n */\r\n get val(): Angle {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the angle value and triggers the onChange callback if the value changed\r\n * @param b - The new Angle value\r\n */\r\n set val(b: Angle) {\r\n if (this._val.degrees === b.degrees) return;\r\n\r\n this._val = b;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new Angle value\r\n */\r\n public setValQuietly(val: Angle) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedAngle instance\r\n *\r\n * @param initialValue - The initial Angle value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: Angle, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedBoolean = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper class for boolean values that tracks changes and triggers callbacks.
|
|
6
|
+
* Only triggers the callback when the value actually changes.
|
|
7
|
+
*/
|
|
8
|
+
class MemoizedBoolean {
|
|
9
|
+
/**
|
|
10
|
+
* Gets the current boolean value
|
|
11
|
+
*/
|
|
12
|
+
get val() {
|
|
13
|
+
return this._val;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Sets the boolean value and triggers the onChange callback if the value changed
|
|
17
|
+
* @param b - The new boolean value
|
|
18
|
+
*/
|
|
19
|
+
set val(b) {
|
|
20
|
+
if (this._val === b)
|
|
21
|
+
return;
|
|
22
|
+
this._val = b;
|
|
23
|
+
this.onChangeCallback();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sets the value without triggering the onChange callback
|
|
27
|
+
* @param val - The new boolean value
|
|
28
|
+
*/
|
|
29
|
+
setValQuietly(val) {
|
|
30
|
+
this._val = val;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new MemoizedBoolean instance
|
|
34
|
+
*
|
|
35
|
+
* @param initialValue - The initial boolean value
|
|
36
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
37
|
+
*/
|
|
38
|
+
constructor(initialValue, onChangeCallback) {
|
|
39
|
+
this._val = initialValue;
|
|
40
|
+
this.onChangeCallback = onChangeCallback;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.MemoizedBoolean = MemoizedBoolean;
|
|
44
|
+
//# sourceMappingURL=MemoizedBoolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedBoolean.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedBoolean.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,eAAe;IAG1B;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAU;QAChB,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAE5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAY;QAC/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAqB,EAAE,gBAA4B;QAC7D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,0CAyCC","sourcesContent":["/**\r\n * A wrapper class for boolean values that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the value actually changes.\r\n */\r\nexport class MemoizedBoolean {\r\n private _val: boolean;\r\n\r\n /**\r\n * Gets the current boolean value\r\n */\r\n get val(): boolean {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the boolean value and triggers the onChange callback if the value changed\r\n * @param b - The new boolean value\r\n */\r\n set val(b: boolean) {\r\n if (this._val === b) return;\r\n\r\n this._val = b;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new boolean value\r\n */\r\n public setValQuietly(val: boolean) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedBoolean instance\r\n *\r\n * @param initialValue - The initial boolean value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: boolean, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedColor = void 0;
|
|
4
|
+
const ValueObjects_1 = require("../ValueObjects");
|
|
5
|
+
/**
|
|
6
|
+
* A wrapper class for Color objects that tracks changes and triggers callbacks.
|
|
7
|
+
* Only triggers the callback when the color value actually changes.
|
|
8
|
+
*/
|
|
9
|
+
class MemoizedColor {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the current Color value
|
|
12
|
+
*/
|
|
13
|
+
get val() {
|
|
14
|
+
return this._val;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the Color value and triggers the onChange callback if the value changed
|
|
18
|
+
* @param v - The new Color value
|
|
19
|
+
*/
|
|
20
|
+
set val(v) {
|
|
21
|
+
if (ValueObjects_1.Color.Equal(v, this._val))
|
|
22
|
+
return;
|
|
23
|
+
this._val = v;
|
|
24
|
+
this.onChangeCallback();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets the value without triggering the onChange callback
|
|
28
|
+
* @param val - The new Color value
|
|
29
|
+
*/
|
|
30
|
+
setValQuietly(val) {
|
|
31
|
+
this._val = val;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new MemoizedColor instance
|
|
35
|
+
*
|
|
36
|
+
* @param initialValue - The initial Color value
|
|
37
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
38
|
+
*/
|
|
39
|
+
constructor(initialValue, onChangeCallback) {
|
|
40
|
+
this._val = initialValue;
|
|
41
|
+
this.onChangeCallback = onChangeCallback;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.MemoizedColor = MemoizedColor;
|
|
45
|
+
//# sourceMappingURL=MemoizedColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedColor.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedColor.ts"],"names":[],"mappings":";;;AAAA,kDAAwC;AAExC;;;GAGG;AACH,MAAa,aAAa;IAGxB;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAQ;QACd,IAAI,oBAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO;QAEtC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAU;QAC7B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAmB,EAAE,gBAA4B;QAC3D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,sCAyCC","sourcesContent":["import { Color } from \"../ValueObjects\";\r\n\r\n/**\r\n * A wrapper class for Color objects that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the color value actually changes.\r\n */\r\nexport class MemoizedColor {\r\n private _val: Color;\r\n\r\n /**\r\n * Gets the current Color value\r\n */\r\n get val(): Color {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the Color value and triggers the onChange callback if the value changed\r\n * @param v - The new Color value\r\n */\r\n set val(v: Color) {\r\n if (Color.Equal(v, this._val)) return;\r\n\r\n this._val = v;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new Color value\r\n */\r\n public setValQuietly(val: Color) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedColor instance\r\n *\r\n * @param initialValue - The initial Color value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: Color, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedNumber = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper class for numeric values that tracks changes and triggers callbacks.
|
|
6
|
+
* Only triggers the callback when the value actually changes.
|
|
7
|
+
*/
|
|
8
|
+
class MemoizedNumber {
|
|
9
|
+
/**
|
|
10
|
+
* Gets the current numeric value
|
|
11
|
+
*/
|
|
12
|
+
get val() {
|
|
13
|
+
return this._val;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Sets the numeric value and triggers the onChange callback if the value changed
|
|
17
|
+
* @param b - The new numeric value
|
|
18
|
+
*/
|
|
19
|
+
set val(b) {
|
|
20
|
+
if (this._val === b)
|
|
21
|
+
return;
|
|
22
|
+
this._val = b;
|
|
23
|
+
this.onChangeCallback();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sets the value without triggering the onChange callback
|
|
27
|
+
* @param val - The new numeric value
|
|
28
|
+
*/
|
|
29
|
+
setValQuietly(val) {
|
|
30
|
+
this._val = val;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new MemoizedNumber instance
|
|
34
|
+
*
|
|
35
|
+
* @param initialValue - The initial numeric value
|
|
36
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
37
|
+
*/
|
|
38
|
+
constructor(initialValue, onChangeCallback) {
|
|
39
|
+
this._val = initialValue;
|
|
40
|
+
this.onChangeCallback = onChangeCallback;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.MemoizedNumber = MemoizedNumber;
|
|
44
|
+
//# sourceMappingURL=MemoizedNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedNumber.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedNumber.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,cAAc;IAGzB;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAS;QACf,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAE5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAW;QAC9B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAoB,EAAE,gBAA4B;QAC5D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,wCAyCC","sourcesContent":["/**\r\n * A wrapper class for numeric values that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the value actually changes.\r\n */\r\nexport class MemoizedNumber {\r\n private _val: number;\r\n\r\n /**\r\n * Gets the current numeric value\r\n */\r\n get val(): number {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the numeric value and triggers the onChange callback if the value changed\r\n * @param b - The new numeric value\r\n */\r\n set val(b: number) {\r\n if (this._val === b) return;\r\n\r\n this._val = b;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new numeric value\r\n */\r\n public setValQuietly(val: number) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedNumber instance\r\n *\r\n * @param initialValue - The initial numeric value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: number, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedQuaternion = void 0;
|
|
4
|
+
const ValueObjects_1 = require("../ValueObjects");
|
|
5
|
+
/**
|
|
6
|
+
* A wrapper class for Quaternion objects that tracks changes and triggers callbacks.
|
|
7
|
+
* Only triggers the callback when the quaternion value actually changes.
|
|
8
|
+
*/
|
|
9
|
+
class MemoizedQuaternion {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the current Quaternion value
|
|
12
|
+
*/
|
|
13
|
+
get val() {
|
|
14
|
+
return this._val;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the Quaternion value and triggers the onChange callback if the value changed
|
|
18
|
+
* @param v - The new Quaternion value
|
|
19
|
+
*/
|
|
20
|
+
set val(v) {
|
|
21
|
+
if (ValueObjects_1.Quaternion.Equal(v, this._val))
|
|
22
|
+
return;
|
|
23
|
+
this._val = v;
|
|
24
|
+
this.onChangeCallback();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets the value without triggering the onChange callback
|
|
28
|
+
* @param val - The new Quaternion value
|
|
29
|
+
*/
|
|
30
|
+
setValQuietly(val) {
|
|
31
|
+
this._val = val;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new MemoizedQuaternion instance
|
|
35
|
+
*
|
|
36
|
+
* @param initialValue - The initial Quaternion value
|
|
37
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
38
|
+
*/
|
|
39
|
+
constructor(initialValue, onChangeCallback) {
|
|
40
|
+
this._val = initialValue;
|
|
41
|
+
this.onChangeCallback = onChangeCallback;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.MemoizedQuaternion = MemoizedQuaternion;
|
|
45
|
+
//# sourceMappingURL=MemoizedQuaternion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedQuaternion.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedQuaternion.ts"],"names":[],"mappings":";;;AAAA,kDAA6C;AAE7C;;;GAGG;AACH,MAAa,kBAAkB;IAG7B;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAa;QACnB,IAAI,yBAAU,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO;QAE3C,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAe;QAClC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAwB,EAAE,gBAA4B;QAChE,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,gDAyCC","sourcesContent":["import { Quaternion } from \"../ValueObjects\";\r\n\r\n/**\r\n * A wrapper class for Quaternion objects that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the quaternion value actually changes.\r\n */\r\nexport class MemoizedQuaternion {\r\n private _val: Quaternion;\r\n\r\n /**\r\n * Gets the current Quaternion value\r\n */\r\n get val(): Quaternion {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the Quaternion value and triggers the onChange callback if the value changed\r\n * @param v - The new Quaternion value\r\n */\r\n set val(v: Quaternion) {\r\n if (Quaternion.Equal(v, this._val)) return;\r\n\r\n this._val = v;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new Quaternion value\r\n */\r\n public setValQuietly(val: Quaternion) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedQuaternion instance\r\n *\r\n * @param initialValue - The initial Quaternion value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: Quaternion, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper class for string values that tracks changes and triggers callbacks.
|
|
6
|
+
* Only triggers the callback when the value actually changes.
|
|
7
|
+
*/
|
|
8
|
+
class MemoizedString {
|
|
9
|
+
/**
|
|
10
|
+
* Gets the current string value
|
|
11
|
+
*/
|
|
12
|
+
get val() {
|
|
13
|
+
return this._val;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Sets the string value and triggers the onChange callback if the value changed
|
|
17
|
+
* @param b - The new string value
|
|
18
|
+
*/
|
|
19
|
+
set val(b) {
|
|
20
|
+
if (this._val === b)
|
|
21
|
+
return;
|
|
22
|
+
this._val = b;
|
|
23
|
+
this.onChangeCallback();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sets the value without triggering the onChange callback
|
|
27
|
+
* @param val - The new string value
|
|
28
|
+
*/
|
|
29
|
+
setValQuietly(val) {
|
|
30
|
+
this._val = val;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new MemoizedString instance
|
|
34
|
+
*
|
|
35
|
+
* @param initialValue - The initial string value
|
|
36
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
37
|
+
*/
|
|
38
|
+
constructor(initialValue, onChangeCallback) {
|
|
39
|
+
this._val = initialValue;
|
|
40
|
+
this.onChangeCallback = onChangeCallback;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.MemoizedString = MemoizedString;
|
|
44
|
+
//# sourceMappingURL=MemoizedString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedString.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedString.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,cAAc;IAGzB;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAS;QACf,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAE5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAW;QAC9B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAoB,EAAE,gBAA4B;QAC5D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,wCAyCC","sourcesContent":["/**\r\n * A wrapper class for string values that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the value actually changes.\r\n */\r\nexport class MemoizedString {\r\n private _val: string;\r\n\r\n /**\r\n * Gets the current string value\r\n */\r\n get val(): string {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the string value and triggers the onChange callback if the value changed\r\n * @param b - The new string value\r\n */\r\n set val(b: string) {\r\n if (this._val === b) return;\r\n\r\n this._val = b;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new string value\r\n */\r\n public setValQuietly(val: string) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedString instance\r\n *\r\n * @param initialValue - The initial string value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: string, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedVector2 = void 0;
|
|
4
|
+
const ValueObjects_1 = require("../ValueObjects");
|
|
5
|
+
/**
|
|
6
|
+
* A wrapper class for Vector2 objects that tracks changes and triggers callbacks.
|
|
7
|
+
* Only triggers the callback when the vector value actually changes.
|
|
8
|
+
*/
|
|
9
|
+
class MemoizedVector2 {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the current Vector2 value
|
|
12
|
+
*/
|
|
13
|
+
get val() {
|
|
14
|
+
return this._val;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the Vector2 value and triggers the onChange callback if the value changed
|
|
18
|
+
* @param v - The new Vector2 value
|
|
19
|
+
*/
|
|
20
|
+
set val(v) {
|
|
21
|
+
if (ValueObjects_1.Vector2.Equal(v, this._val))
|
|
22
|
+
return;
|
|
23
|
+
this._val = v;
|
|
24
|
+
this.onChangeCallback();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets the value without triggering the onChange callback
|
|
28
|
+
* @param val - The new Vector2 value
|
|
29
|
+
*/
|
|
30
|
+
setValQuietly(val) {
|
|
31
|
+
this._val = val;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new MemoizedVector2 instance
|
|
35
|
+
*
|
|
36
|
+
* @param initialValue - The initial Vector2 value
|
|
37
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
38
|
+
*/
|
|
39
|
+
constructor(initialValue, onChangeCallback) {
|
|
40
|
+
this._val = initialValue;
|
|
41
|
+
this.onChangeCallback = onChangeCallback;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.MemoizedVector2 = MemoizedVector2;
|
|
45
|
+
//# sourceMappingURL=MemoizedVector2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedVector2.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedVector2.ts"],"names":[],"mappings":";;;AAAA,kDAA0C;AAE1C;;;GAGG;AACH,MAAa,eAAe;IAG1B;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAU;QAChB,IAAI,sBAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO;QAExC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAY;QAC/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAqB,EAAE,gBAA4B;QAC7D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,0CAyCC","sourcesContent":["import { Vector2 } from \"../ValueObjects\";\r\n\r\n/**\r\n * A wrapper class for Vector2 objects that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the vector value actually changes.\r\n */\r\nexport class MemoizedVector2 {\r\n private _val: Vector2;\r\n\r\n /**\r\n * Gets the current Vector2 value\r\n */\r\n get val(): Vector2 {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the Vector2 value and triggers the onChange callback if the value changed\r\n * @param v - The new Vector2 value\r\n */\r\n set val(v: Vector2) {\r\n if (Vector2.Equal(v, this._val)) return;\r\n\r\n this._val = v;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new Vector2 value\r\n */\r\n public setValQuietly(val: Vector2) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedVector2 instance\r\n *\r\n * @param initialValue - The initial Vector2 value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: Vector2, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoizedVector3 = void 0;
|
|
4
|
+
const ValueObjects_1 = require("../ValueObjects");
|
|
5
|
+
/**
|
|
6
|
+
* A wrapper class for Vector3 objects that tracks changes and triggers callbacks.
|
|
7
|
+
* Only triggers the callback when the vector value actually changes.
|
|
8
|
+
*/
|
|
9
|
+
class MemoizedVector3 {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the current Vector3 value
|
|
12
|
+
*/
|
|
13
|
+
get val() {
|
|
14
|
+
return this._val;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the Vector3 value and triggers the onChange callback if the value changed
|
|
18
|
+
* @param v - The new Vector3 value
|
|
19
|
+
*/
|
|
20
|
+
set val(v) {
|
|
21
|
+
if (ValueObjects_1.Vector3.Equal(v, this._val))
|
|
22
|
+
return;
|
|
23
|
+
this._val = v;
|
|
24
|
+
this.onChangeCallback();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets the value without triggering the onChange callback
|
|
28
|
+
* @param val - The new Vector3 value
|
|
29
|
+
*/
|
|
30
|
+
setValQuietly(val) {
|
|
31
|
+
this._val = val;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new MemoizedVector3 instance
|
|
35
|
+
*
|
|
36
|
+
* @param initialValue - The initial Vector3 value
|
|
37
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
38
|
+
*/
|
|
39
|
+
constructor(initialValue, onChangeCallback) {
|
|
40
|
+
this._val = initialValue;
|
|
41
|
+
this.onChangeCallback = onChangeCallback;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.MemoizedVector3 = MemoizedVector3;
|
|
45
|
+
//# sourceMappingURL=MemoizedVector3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedVector3.js","sourceRoot":"","sources":["../../../src/Entities/MemoizedVector3.ts"],"names":[],"mappings":";;;AAAA,kDAA0C;AAE1C;;;GAGG;AACH,MAAa,eAAe;IAG1B;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,GAAG,CAAC,CAAU;QAChB,IAAI,sBAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO;QAExC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,GAAY;QAC/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAID;;;;;OAKG;IACH,YAAY,YAAqB,EAAE,gBAA4B;QAC7D,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AAzCD,0CAyCC","sourcesContent":["import { Vector3 } from \"../ValueObjects\";\r\n\r\n/**\r\n * A wrapper class for Vector3 objects that tracks changes and triggers callbacks.\r\n * Only triggers the callback when the vector value actually changes.\r\n */\r\nexport class MemoizedVector3 {\r\n private _val: Vector3;\r\n\r\n /**\r\n * Gets the current Vector3 value\r\n */\r\n get val(): Vector3 {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the Vector3 value and triggers the onChange callback if the value changed\r\n * @param v - The new Vector3 value\r\n */\r\n set val(v: Vector3) {\r\n if (Vector3.Equal(v, this._val)) return;\r\n\r\n this._val = v;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback\r\n * @param val - The new Vector3 value\r\n */\r\n public setValQuietly(val: Vector3) {\r\n this._val = val;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new MemoizedVector3 instance\r\n *\r\n * @param initialValue - The initial Vector3 value\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(initialValue: Vector3, onChangeCallback: () => void) {\r\n this._val = initialValue;\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObservableEntity = void 0;
|
|
4
|
+
const ObserverList_1 = require("./ObserverList");
|
|
5
|
+
/**
|
|
6
|
+
* Base class that implements the Observable pattern.
|
|
7
|
+
* Allows other objects to register as observers and be notified of changes.
|
|
8
|
+
*
|
|
9
|
+
* Extend this class to make your entity observable.
|
|
10
|
+
*/
|
|
11
|
+
class ObservableEntity {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.observerList = new ObserverList_1.ObserverList();
|
|
14
|
+
/**
|
|
15
|
+
* Registers a new observer to be notified of changes
|
|
16
|
+
* @param observer Function to be called when the entity changes
|
|
17
|
+
*/
|
|
18
|
+
this.addObserver = (observer) => {
|
|
19
|
+
this.observerList.add(observer);
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Unregisters an existing observer
|
|
23
|
+
* @param observer The observer function to remove
|
|
24
|
+
*/
|
|
25
|
+
this.removeObserver = (observer) => {
|
|
26
|
+
this.observerList.remove(observer);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Notifies all registered observers about a change
|
|
30
|
+
*/
|
|
31
|
+
this.notify = () => {
|
|
32
|
+
this.observerList.notify();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ObservableEntity = ObservableEntity;
|
|
37
|
+
//# sourceMappingURL=ObservableEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservableEntity.js","sourceRoot":"","sources":["../../../src/Entities/ObservableEntity.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAO9C;;;;;GAKG;AACH,MAAsB,gBAAgB;IAAtC;QACU,iBAAY,GAAG,IAAI,2BAAY,EAAQ,CAAC;QAEhD;;;WAGG;QACH,gBAAW,GAAG,CAAC,QAAwB,EAAQ,EAAE;YAC/C,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC;QAEF;;;WAGG;QACH,mBAAc,GAAG,CAAC,QAAwB,EAAQ,EAAE;YAClD,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC,CAAC;QAEF;;WAEG;QACH,WAAM,GAAG,GAAG,EAAE;YACZ,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC;CAAA;AAzBD,4CAyBC","sourcesContent":["import { ObserverList } from \"./ObserverList\";\r\n\r\n/**\r\n * Function type for entity observers\r\n */\r\nexport type EntityObserver = () => void;\r\n\r\n/**\r\n * Base class that implements the Observable pattern.\r\n * Allows other objects to register as observers and be notified of changes.\r\n *\r\n * Extend this class to make your entity observable.\r\n */\r\nexport abstract class ObservableEntity {\r\n private observerList = new ObserverList<void>();\r\n\r\n /**\r\n * Registers a new observer to be notified of changes\r\n * @param observer Function to be called when the entity changes\r\n */\r\n addObserver = (observer: EntityObserver): void => {\r\n this.observerList.add(observer);\r\n };\r\n\r\n /**\r\n * Unregisters an existing observer\r\n * @param observer The observer function to remove\r\n */\r\n removeObserver = (observer: EntityObserver): void => {\r\n this.observerList.remove(observer);\r\n };\r\n\r\n /**\r\n * Notifies all registered observers about a change\r\n */\r\n notify = () => {\r\n this.observerList.notify();\r\n };\r\n}\r\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObserverList = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A generic implementation of the Observer pattern.
|
|
6
|
+
* Maintains a list of observer functions that can be notified with a message.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The type of message that will be passed to observers
|
|
9
|
+
*/
|
|
10
|
+
class ObserverList {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.observers = [];
|
|
13
|
+
/**
|
|
14
|
+
* Notifies all observers by calling them with the provided message
|
|
15
|
+
* @param msg - The message to send to all observers
|
|
16
|
+
*/
|
|
17
|
+
this.notify = (msg) => {
|
|
18
|
+
this.observers.forEach((obs) => {
|
|
19
|
+
obs(msg);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Adds a new observer function to the list
|
|
24
|
+
* @param obs - The observer function to add
|
|
25
|
+
*/
|
|
26
|
+
this.add = (obs) => {
|
|
27
|
+
this.observers.push(obs);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Removes an observer from the list
|
|
31
|
+
* @param obs - The observer function to remove
|
|
32
|
+
*/
|
|
33
|
+
this.remove = (obs) => {
|
|
34
|
+
const index = this.observers.indexOf(obs);
|
|
35
|
+
if (index >= 0) {
|
|
36
|
+
this.observers.splice(index, 1);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Removes all observers from the list
|
|
41
|
+
*/
|
|
42
|
+
this.clear = () => {
|
|
43
|
+
this.observers = [];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ObserverList = ObserverList;
|
|
48
|
+
//# sourceMappingURL=ObserverList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObserverList.js","sourceRoot":"","sources":["../../../src/Entities/ObserverList.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,YAAY;IAAzB;QACU,cAAS,GAAyB,EAAE,CAAC;QAE7C;;;WAGG;QACI,WAAM,GAAG,CAAC,GAAM,EAAE,EAAE;YACzB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC7B,GAAG,CAAC,GAAG,CAAC,CAAC;YACX,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF;;;WAGG;QACI,QAAG,GAAG,CAAC,GAAqB,EAAE,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEF;;;WAGG;QACI,WAAM,GAAG,CAAC,GAAqB,EAAE,EAAE;YACxC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC1C,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,CAAC;QAEF;;WAEG;QACI,UAAK,GAAG,GAAG,EAAE;YAClB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACtB,CAAC,CAAC;IACJ,CAAC;CAAA;AAtCD,oCAsCC","sourcesContent":["/**\r\n * A generic implementation of the Observer pattern.\r\n * Maintains a list of observer functions that can be notified with a message.\r\n *\r\n * @typeParam T - The type of message that will be passed to observers\r\n */\r\nexport class ObserverList<T> {\r\n private observers: ((msg: T) => void)[] = [];\r\n\r\n /**\r\n * Notifies all observers by calling them with the provided message\r\n * @param msg - The message to send to all observers\r\n */\r\n public notify = (msg: T) => {\r\n this.observers.forEach((obs) => {\r\n obs(msg);\r\n });\r\n };\r\n\r\n /**\r\n * Adds a new observer function to the list\r\n * @param obs - The observer function to add\r\n */\r\n public add = (obs: (msg: T) => void) => {\r\n this.observers.push(obs);\r\n };\r\n\r\n /**\r\n * Removes an observer from the list\r\n * @param obs - The observer function to remove\r\n */\r\n public remove = (obs: (msg: T) => void) => {\r\n const index = this.observers.indexOf(obs);\r\n if (index >= 0) {\r\n this.observers.splice(index, 1);\r\n }\r\n };\r\n\r\n /**\r\n * Removes all observers from the list\r\n */\r\n public clear = () => {\r\n this.observers = [];\r\n };\r\n}\r\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RangedNumber = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A numeric value that is constrained to a specified range.
|
|
6
|
+
* Values set outside the range will be automatically clamped.
|
|
7
|
+
* Triggers a callback when the value changes.
|
|
8
|
+
*/
|
|
9
|
+
class RangedNumber {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the current numeric value (guaranteed to be within min/max range)
|
|
12
|
+
*/
|
|
13
|
+
get val() {
|
|
14
|
+
return this._val;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the numeric value and triggers the onChange callback if the value changed.
|
|
18
|
+
* The input value will be automatically clamped to the defined min/max range.
|
|
19
|
+
* @param x - The new numeric value
|
|
20
|
+
*/
|
|
21
|
+
set val(x) {
|
|
22
|
+
const y = this.clamp(x);
|
|
23
|
+
if (this._val === y)
|
|
24
|
+
return;
|
|
25
|
+
this._val = y;
|
|
26
|
+
this.onChangeCallback();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Sets the value without triggering the onChange callback.
|
|
30
|
+
* The input value will still be clamped to the defined range.
|
|
31
|
+
* @param val - The new numeric value
|
|
32
|
+
*/
|
|
33
|
+
setValQuietly(val) {
|
|
34
|
+
this._val = this.clamp(val);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Ensures a value is within the min/max range
|
|
38
|
+
* @param x - The value to clamp
|
|
39
|
+
* @returns The clamped value
|
|
40
|
+
*/
|
|
41
|
+
clamp(x) {
|
|
42
|
+
let rVal = x;
|
|
43
|
+
if (x > this.maxValue) {
|
|
44
|
+
rVal = this.maxValue;
|
|
45
|
+
}
|
|
46
|
+
else if (x < this.minValue) {
|
|
47
|
+
rVal = this.minValue;
|
|
48
|
+
}
|
|
49
|
+
return rVal;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new RangedNumber instance
|
|
53
|
+
*
|
|
54
|
+
* @param props - Object containing min, max, and initialValue properties
|
|
55
|
+
* @param onChangeCallback - Function to call when the value changes
|
|
56
|
+
*/
|
|
57
|
+
constructor(props, onChangeCallback) {
|
|
58
|
+
this.maxValue = props.max;
|
|
59
|
+
this.minValue = props.min;
|
|
60
|
+
this._val = this.clamp(props.initialValue);
|
|
61
|
+
this.onChangeCallback = onChangeCallback;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.RangedNumber = RangedNumber;
|
|
65
|
+
//# sourceMappingURL=RangedNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangedNumber.js","sourceRoot":"","sources":["../../../src/Entities/RangedNumber.ts"],"names":[],"mappings":";;;AAYA;;;;GAIG;AACH,MAAa,YAAY;IAQvB;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,IAAI,GAAG,CAAC,CAAS;QACf,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAE5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,GAAW;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,CAAS;QACrB,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;aAAM,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7B,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAID;;;;;OAKG;IACH,YAAY,KAA6B,EAAE,gBAA4B;QACrE,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC;QAE1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CACF;AApED,oCAoEC","sourcesContent":["/**\r\n * Properties required to initialize a RangedNumber\r\n */\r\nexport interface RangedNumberProperties {\r\n /** The minimum allowed value */\r\n min: number;\r\n /** The maximum allowed value */\r\n max: number;\r\n /** The initial value (will be clamped between min and max) */\r\n initialValue: number;\r\n}\r\n\r\n/**\r\n * A numeric value that is constrained to a specified range.\r\n * Values set outside the range will be automatically clamped.\r\n * Triggers a callback when the value changes.\r\n */\r\nexport class RangedNumber {\r\n /** The maximum allowed value */\r\n public readonly maxValue: number;\r\n /** The minimum allowed value */\r\n public readonly minValue: number;\r\n\r\n private _val: number;\r\n\r\n /**\r\n * Gets the current numeric value (guaranteed to be within min/max range)\r\n */\r\n get val(): number {\r\n return this._val;\r\n }\r\n\r\n /**\r\n * Sets the numeric value and triggers the onChange callback if the value changed.\r\n * The input value will be automatically clamped to the defined min/max range.\r\n * @param x - The new numeric value\r\n */\r\n set val(x: number) {\r\n const y = this.clamp(x);\r\n if (this._val === y) return;\r\n\r\n this._val = y;\r\n this.onChangeCallback();\r\n }\r\n\r\n /**\r\n * Sets the value without triggering the onChange callback.\r\n * The input value will still be clamped to the defined range.\r\n * @param val - The new numeric value\r\n */\r\n public setValQuietly(val: number) {\r\n this._val = this.clamp(val);\r\n }\r\n\r\n /**\r\n * Ensures a value is within the min/max range\r\n * @param x - The value to clamp\r\n * @returns The clamped value\r\n */\r\n private clamp(x: number): number {\r\n let rVal = x;\r\n if (x > this.maxValue) {\r\n rVal = this.maxValue;\r\n } else if (x < this.minValue) {\r\n rVal = this.minValue;\r\n }\r\n\r\n return rVal;\r\n }\r\n\r\n private onChangeCallback: () => void;\r\n\r\n /**\r\n * Creates a new RangedNumber instance\r\n *\r\n * @param props - Object containing min, max, and initialValue properties\r\n * @param onChangeCallback - Function to call when the value changes\r\n */\r\n constructor(props: RangedNumberProperties, onChangeCallback: () => void) {\r\n this.maxValue = props.max;\r\n this.minValue = props.min;\r\n\r\n this._val = this.clamp(props.initialValue);\r\n this.onChangeCallback = onChangeCallback;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./MemoizedAngle"), exports);
|
|
18
|
+
__exportStar(require("./MemoizedBoolean"), exports);
|
|
19
|
+
__exportStar(require("./MemoizedColor"), exports);
|
|
20
|
+
__exportStar(require("./MemoizedNumber"), exports);
|
|
21
|
+
__exportStar(require("./MemoizedQuaternion"), exports);
|
|
22
|
+
__exportStar(require("./MemoizedString"), exports);
|
|
23
|
+
__exportStar(require("./MemoizedVector2"), exports);
|
|
24
|
+
__exportStar(require("./MemoizedVector3"), exports);
|
|
25
|
+
__exportStar(require("./ObservableEntity"), exports);
|
|
26
|
+
__exportStar(require("./ObserverList"), exports);
|
|
27
|
+
__exportStar(require("./RangedNumber"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,oDAAkC;AAClC,kDAAgC;AAChC,mDAAiC;AACjC,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B","sourcesContent":["export * from \"./MemoizedAngle\";\r\nexport * from \"./MemoizedBoolean\";\r\nexport * from \"./MemoizedColor\";\r\nexport * from \"./MemoizedNumber\";\r\nexport * from \"./MemoizedQuaternion\";\r\nexport * from \"./MemoizedString\";\r\nexport * from \"./MemoizedVector2\";\r\nexport * from \"./MemoizedVector3\";\r\nexport * from \"./ObservableEntity\";\r\nexport * from \"./ObserverList\";\r\nexport * from \"./RangedNumber\";\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppBoundary.js","sourceRoot":"","sources":["../../../src/Types/AppBoundary.ts"],"names":[],"mappings":"","sourcesContent":["export type Handler = (request: Request) => void;\r\n\r\nexport interface Request {\r\n type: string;\r\n version: number;\r\n payload?: unknown;\r\n}\r\n\r\n// tslint:disable-next-line: class-name\r\nexport interface VIVEDApp_3 {\r\n mount(hostRequestHandler: Handler): Handler;\r\n mountDev(container: HTMLElement): void;\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EaseFn.js","sourceRoot":"","sources":["../../../src/Types/EaseFn.ts"],"names":[],"mappings":"","sourcesContent":["export type EaseFn = (p: number) => number;"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PmAdapter.js","sourceRoot":"","sources":["../../../src/Types/PmAdapter.ts"],"names":[],"mappings":"","sourcesContent":["import { AppObjectRepo } from \"../AppObject\";\r\n\r\n/**\r\n * PmAdapter interface defines a bridge between UI components and AppObjectPM (Presentation Manager) components.\r\n * It allows UI frameworks (like React, Vue, Angular, etc.) to subscribe to view model updates from specific AppObjects.\r\n * \r\n * This adapter is used for AppObject-specific subscriptions, where each UI component subscribes to\r\n * a particular AppObject's presentation manager, identified by its ID.\r\n * \r\n * Usage example with React:\r\n * ```typescript\r\n * // Define an adapter for a specific view model type\r\n * class MyComponentAdapter implements PmAdapter<MyViewModel> {\r\n * // Default view model when no data is available\r\n * defaultVM: MyViewModel = { value: 0, label: \"\" };\r\n * \r\n * // Subscribe to updates from a specific AppObject's presentation manager\r\n * subscribe(id: string, appObjects: AppObjectRepo, setVM: (vm: MyViewModel) => void): void {\r\n * const appObject = appObjects.get(id);\r\n * if (!appObject) return;\r\n * \r\n * const pm = appObject.getComponent<MyPM>(\"MyPresentationManager\");\r\n * if (pm) {\r\n * pm.addView(setVM);\r\n * // Initial update with current view model if available\r\n * if (pm.lastVM) setVM(pm.lastVM);\r\n * }\r\n * }\r\n * \r\n * // Unsubscribe when component unmounts\r\n * unsubscribe(id: string, appObjects: AppObjectRepo, setVM: (vm: MyViewModel) => void): void {\r\n * const appObject = appObjects.get(id);\r\n * if (!appObject) return;\r\n * \r\n * const pm = appObject.getComponent<MyPM>(\"MyPresentationManager\");\r\n * if (pm) {\r\n * pm.removeView(setVM);\r\n * }\r\n * }\r\n * }\r\n * ```\r\n * \r\n * @typeparam VM The view model type provided by this adapter\r\n */\r\nexport interface PmAdapter<VM> {\r\n /**\r\n * Default view model to use when no data is available\r\n * This prevents null/undefined handling in UI components\r\n */\r\n defaultVM: VM;\r\n \r\n /**\r\n * Subscribe to view model updates from an AppObject's presentation manager\r\n * \r\n * @param id The ID of the AppObject to subscribe to\r\n * @param appObjects The repository containing the AppObjects\r\n * @param setVM Callback function that updates the UI with new view models\r\n */\r\n subscribe(\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: VM) => void\r\n ): void;\r\n \r\n /**\r\n * Unsubscribe from view model updates when a component is being unmounted or no longer needs updates\r\n * \r\n * @param id The ID of the AppObject to unsubscribe from\r\n * @param appObjects The repository containing the AppObjects\r\n * @param setVM The same callback function that was provided to subscribe\r\n */\r\n unsubscribe(\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: VM) => void\r\n ): void;\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingletonPmAdapter.js","sourceRoot":"","sources":["../../../src/Types/SingletonPmAdapter.ts"],"names":[],"mappings":"","sourcesContent":["import { AppObjectRepo } from \"../AppObject\";\r\n\r\n/**\r\n * SingletonPmAdapter interface defines a bridge between UI components and singleton presentation managers.\r\n * It's similar to PmAdapter but designed for components that subscribe to a singleton PM \r\n * (a PM that exists only once in the application).\r\n * \r\n * This adapter simplifies the subscription process when there's only one instance of a specific\r\n * presentation manager type in the entire application, eliminating the need to specify an AppObject ID.\r\n * \r\n * Usage example with React:\r\n * ```typescript\r\n * // Define an adapter for a singleton presentation manager\r\n * class GlobalSettingsPMAdapter implements SingletonPmAdapter<SettingsViewModel> {\r\n * // Default view model when no data is available\r\n * defaultVM: SettingsViewModel = { theme: \"light\", fontSize: \"medium\" };\r\n * \r\n * // Subscribe to updates from the singleton presentation manager\r\n * subscribe(appObjects: AppObjectRepo, setVM: (vm: SettingsViewModel) => void): void {\r\n * // Get the singleton PM\r\n * const settingsPM = appObjects.getSingleton<SettingsPM>(\"SettingsPM\");\r\n * if (settingsPM) {\r\n * // Register the update callback\r\n * settingsPM.addView(setVM);\r\n * // Initial update with current view model if available\r\n * if (settingsPM.lastVM) setVM(settingsPM.lastVM);\r\n * }\r\n * }\r\n * \r\n * // Unsubscribe when component unmounts\r\n * unsubscribe(appObjects: AppObjectRepo, setVM: (vm: SettingsViewModel) => void): void {\r\n * const settingsPM = appObjects.getSingleton<SettingsPM>(\"SettingsPM\");\r\n * if (settingsPM) {\r\n * settingsPM.removeView(setVM);\r\n * }\r\n * }\r\n * }\r\n * ```\r\n * \r\n * @typeparam VM The view model type provided by this adapter\r\n */\r\nexport interface SingletonPmAdapter<VM> {\r\n /**\r\n * Default view model to use when no data is available\r\n * This prevents null/undefined handling in UI components\r\n */\r\n defaultVM: VM;\r\n \r\n /**\r\n * Subscribe to view model updates from a singleton presentation manager\r\n * \r\n * @param appObjects The repository containing the AppObjects\r\n * @param setVM Callback function that updates the UI with new view models\r\n */\r\n subscribe(appObjects: AppObjectRepo, setVM: (vm: VM) => void): void;\r\n \r\n /**\r\n * Unsubscribe from view model updates when a component is being unmounted or no longer needs updates\r\n * \r\n * @param appObjects The repository containing the AppObjects\r\n * @param setVM The same callback function that was provided to subscribe\r\n */\r\n unsubscribe(appObjects: AppObjectRepo, setVM: (vm: VM) => void): void;\r\n}\r\n"]}
|