@mathscan/geometry-engine 0.1.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/README.md +1101 -0
- package/dist/coordinates/grid.d.cts +8 -0
- package/dist/coordinates/grid.d.ts +9 -0
- package/dist/coordinates/grid.d.ts.map +1 -0
- package/dist/coordinates/lineClipping.d.cts +3 -0
- package/dist/coordinates/lineClipping.d.ts +4 -0
- package/dist/coordinates/lineClipping.d.ts.map +1 -0
- package/dist/coordinates/transform.d.cts +18 -0
- package/dist/coordinates/transform.d.ts +19 -0
- package/dist/coordinates/transform.d.ts.map +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.mjs +4 -0
- package/dist/entries/core.d.cts +16 -0
- package/dist/entries/core.d.ts +17 -0
- package/dist/entries/core.d.ts.map +1 -0
- package/dist/entries/react.d.cts +18 -0
- package/dist/entries/react.d.ts +19 -0
- package/dist/entries/react.d.ts.map +1 -0
- package/dist/entries/schemas.d.cts +14 -0
- package/dist/entries/schemas.d.ts +15 -0
- package/dist/entries/schemas.d.ts.map +1 -0
- package/dist/entries/validation.d.cts +12 -0
- package/dist/entries/validation.d.ts +13 -0
- package/dist/entries/validation.d.ts.map +1 -0
- package/dist/exercise.schema-BV2b7rtN.cjs +2 -0
- package/dist/exercise.schema-BV2b7rtN.cjs.map +1 -0
- package/dist/exercise.schema-ckVBW9XA.js +212 -0
- package/dist/exercise.schema-ckVBW9XA.js.map +1 -0
- package/dist/geometry/distance.d.cts +9 -0
- package/dist/geometry/distance.d.ts +10 -0
- package/dist/geometry/distance.d.ts.map +1 -0
- package/dist/geometry/entities/circle.d.cts +36 -0
- package/dist/geometry/entities/circle.d.ts +37 -0
- package/dist/geometry/entities/circle.d.ts.map +1 -0
- package/dist/geometry/entities/index.d.cts +60 -0
- package/dist/geometry/entities/index.d.ts +61 -0
- package/dist/geometry/entities/index.d.ts.map +1 -0
- package/dist/geometry/entities/line.d.cts +43 -0
- package/dist/geometry/entities/line.d.ts +44 -0
- package/dist/geometry/entities/line.d.ts.map +1 -0
- package/dist/geometry/entities/point.d.cts +27 -0
- package/dist/geometry/entities/point.d.ts +28 -0
- package/dist/geometry/entities/point.d.ts.map +1 -0
- package/dist/geometry/entities/relations.d.cts +27 -0
- package/dist/geometry/entities/relations.d.ts +28 -0
- package/dist/geometry/entities/relations.d.ts.map +1 -0
- package/dist/geometry/entities/segment.d.cts +45 -0
- package/dist/geometry/entities/segment.d.ts +46 -0
- package/dist/geometry/entities/segment.d.ts.map +1 -0
- package/dist/geometry/entityCapabilities.d.cts +2 -0
- package/dist/geometry/entityCapabilities.d.ts +3 -0
- package/dist/geometry/entityCapabilities.d.ts.map +1 -0
- package/dist/geometry/entityModel.d.cts +139 -0
- package/dist/geometry/entityModel.d.ts +140 -0
- package/dist/geometry/entityModel.d.ts.map +1 -0
- package/dist/geometry/entityRecord.d.cts +27 -0
- package/dist/geometry/entityRecord.d.ts +28 -0
- package/dist/geometry/entityRecord.d.ts.map +1 -0
- package/dist/geometry/evaluateGraph.d.cts +37 -0
- package/dist/geometry/evaluateGraph.d.ts +38 -0
- package/dist/geometry/evaluateGraph.d.ts.map +1 -0
- package/dist/geometry/geometryObject.d.cts +4 -0
- package/dist/geometry/geometryObject.d.ts +5 -0
- package/dist/geometry/geometryObject.d.ts.map +1 -0
- package/dist/geometry/goalCandidate.d.cts +8 -0
- package/dist/geometry/goalCandidate.d.ts +9 -0
- package/dist/geometry/goalCandidate.d.ts.map +1 -0
- package/dist/geometry/hitTest.d.cts +23 -0
- package/dist/geometry/hitTest.d.ts +24 -0
- package/dist/geometry/hitTest.d.ts.map +1 -0
- package/dist/geometry/point.d.cts +5 -0
- package/dist/geometry/point.d.ts +6 -0
- package/dist/geometry/point.d.ts.map +1 -0
- package/dist/geometry/pointOrigin.d.cts +5 -0
- package/dist/geometry/pointOrigin.d.ts +6 -0
- package/dist/geometry/pointOrigin.d.ts.map +1 -0
- package/dist/geometry/v1Bridge.d.cts +41 -0
- package/dist/geometry/v1Bridge.d.ts +42 -0
- package/dist/geometry/v1Bridge.d.ts.map +1 -0
- package/dist/geometryAttemptStatus-5L_q6-9l.js +184 -0
- package/dist/geometryAttemptStatus-5L_q6-9l.js.map +1 -0
- package/dist/geometryAttemptStatus-N_XHIkiS.cjs +2 -0
- package/dist/geometryAttemptStatus-N_XHIkiS.cjs.map +1 -0
- package/dist/geometryState.schema-D0ixyGYE.js +955 -0
- package/dist/geometryState.schema-D0ixyGYE.js.map +1 -0
- package/dist/geometryState.schema-DKQ-durx.cjs +2 -0
- package/dist/geometryState.schema-DKQ-durx.cjs.map +1 -0
- package/dist/goals-C3ZwbEh_.js +451 -0
- package/dist/goals-C3ZwbEh_.js.map +1 -0
- package/dist/goals-CxR5qPDC.cjs +2 -0
- package/dist/goals-CxR5qPDC.cjs.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +10 -0
- package/dist/measure/geometryAdapter.d.cts +26 -0
- package/dist/measure/geometryAdapter.d.ts +27 -0
- package/dist/measure/geometryAdapter.d.ts.map +1 -0
- package/dist/measure/kernel.d.cts +25 -0
- package/dist/measure/kernel.d.ts +26 -0
- package/dist/measure/kernel.d.ts.map +1 -0
- package/dist/numerics/policy.d.cts +17 -0
- package/dist/numerics/policy.d.ts +18 -0
- package/dist/numerics/policy.d.ts.map +1 -0
- package/dist/react-BEcdx1f6.js +1851 -0
- package/dist/react-BEcdx1f6.js.map +1 -0
- package/dist/react-Pp_VSk--.cjs +2 -0
- package/dist/react-Pp_VSk--.cjs.map +1 -0
- package/dist/react.cjs +1 -0
- package/dist/react.mjs +2 -0
- package/dist/renderer/GeometryCanvas.d.cts +14 -0
- package/dist/renderer/GeometryCanvas.d.ts +15 -0
- package/dist/renderer/GeometryCanvas.d.ts.map +1 -0
- package/dist/renderer/GeometryCompanion.d.cts +29 -0
- package/dist/renderer/GeometryCompanion.d.ts +30 -0
- package/dist/renderer/GeometryCompanion.d.ts.map +1 -0
- package/dist/renderer/GeometryGrid.d.cts +7 -0
- package/dist/renderer/GeometryGrid.d.ts +8 -0
- package/dist/renderer/GeometryGrid.d.ts.map +1 -0
- package/dist/renderer/GeometryInstruments.d.cts +7 -0
- package/dist/renderer/GeometryInstruments.d.ts +8 -0
- package/dist/renderer/GeometryInstruments.d.ts.map +1 -0
- package/dist/renderer/StudentGeometryCanvas.d.cts +11 -0
- package/dist/renderer/StudentGeometryCanvas.d.ts +12 -0
- package/dist/renderer/StudentGeometryCanvas.d.ts.map +1 -0
- package/dist/renderer/StudentGeometryExercise.d.cts +36 -0
- package/dist/renderer/StudentGeometryExercise.d.ts +37 -0
- package/dist/renderer/StudentGeometryExercise.d.ts.map +1 -0
- package/dist/renderer/Toolbar.d.cts +7 -0
- package/dist/renderer/Toolbar.d.ts +8 -0
- package/dist/renderer/Toolbar.d.ts.map +1 -0
- package/dist/renderer/deriveRenderableGeometry.d.cts +15 -0
- package/dist/renderer/deriveRenderableGeometry.d.ts +16 -0
- package/dist/renderer/deriveRenderableGeometry.d.ts.map +1 -0
- package/dist/renderer/deriveSemanticScene.d.cts +58 -0
- package/dist/renderer/deriveSemanticScene.d.ts +59 -0
- package/dist/renderer/deriveSemanticScene.d.ts.map +1 -0
- package/dist/renderer/entityDisplayName.d.cts +12 -0
- package/dist/renderer/entityDisplayName.d.ts +13 -0
- package/dist/renderer/entityDisplayName.d.ts.map +1 -0
- package/dist/renderer/gesturePolicy.d.cts +97 -0
- package/dist/renderer/gesturePolicy.d.ts +98 -0
- package/dist/renderer/gesturePolicy.d.ts.map +1 -0
- package/dist/renderer/shapes/CircleShape.d.cts +17 -0
- package/dist/renderer/shapes/CircleShape.d.ts +18 -0
- package/dist/renderer/shapes/CircleShape.d.ts.map +1 -0
- package/dist/renderer/shapes/EntityLabel.d.cts +14 -0
- package/dist/renderer/shapes/EntityLabel.d.ts +15 -0
- package/dist/renderer/shapes/EntityLabel.d.ts.map +1 -0
- package/dist/renderer/shapes/EntityShape.d.cts +18 -0
- package/dist/renderer/shapes/EntityShape.d.ts +19 -0
- package/dist/renderer/shapes/EntityShape.d.ts.map +1 -0
- package/dist/renderer/shapes/LineShape.d.cts +16 -0
- package/dist/renderer/shapes/LineShape.d.ts +17 -0
- package/dist/renderer/shapes/LineShape.d.ts.map +1 -0
- package/dist/renderer/shapes/PointShape.d.cts +17 -0
- package/dist/renderer/shapes/PointShape.d.ts +18 -0
- package/dist/renderer/shapes/PointShape.d.ts.map +1 -0
- package/dist/renderer/shapes/SegmentShape.d.cts +17 -0
- package/dist/renderer/shapes/SegmentShape.d.ts +18 -0
- package/dist/renderer/shapes/SegmentShape.d.ts.map +1 -0
- package/dist/renderer/shapes/SnapMarker.d.cts +8 -0
- package/dist/renderer/shapes/SnapMarker.d.ts +9 -0
- package/dist/renderer/shapes/SnapMarker.d.ts.map +1 -0
- package/dist/renderer/shapes/StrokedLine.d.cts +18 -0
- package/dist/renderer/shapes/StrokedLine.d.ts +19 -0
- package/dist/renderer/shapes/StrokedLine.d.ts.map +1 -0
- package/dist/renderer/studentExerciseSession.d.cts +71 -0
- package/dist/renderer/studentExerciseSession.d.ts +72 -0
- package/dist/renderer/studentExerciseSession.d.ts.map +1 -0
- package/dist/renderer/useConnectionPreview.d.cts +44 -0
- package/dist/renderer/useConnectionPreview.d.ts +45 -0
- package/dist/renderer/useConnectionPreview.d.ts.map +1 -0
- package/dist/renderer/usePlacementSnap.d.cts +28 -0
- package/dist/renderer/usePlacementSnap.d.ts +29 -0
- package/dist/renderer/usePlacementSnap.d.ts.map +1 -0
- package/dist/renderer/usePointerGestures.d.cts +46 -0
- package/dist/renderer/usePointerGestures.d.ts +47 -0
- package/dist/renderer/usePointerGestures.d.ts.map +1 -0
- package/dist/schemas/circle.schema.d.cts +8 -0
- package/dist/schemas/circle.schema.d.ts +9 -0
- package/dist/schemas/circle.schema.d.ts.map +1 -0
- package/dist/schemas/entityDefinition.schema.d.cts +69 -0
- package/dist/schemas/entityDefinition.schema.d.ts +70 -0
- package/dist/schemas/entityDefinition.schema.d.ts.map +1 -0
- package/dist/schemas/entityDocument.d.cts +95 -0
- package/dist/schemas/entityDocument.d.ts +96 -0
- package/dist/schemas/entityDocument.d.ts.map +1 -0
- package/dist/schemas/entityPresentation.schema.d.cts +12 -0
- package/dist/schemas/entityPresentation.schema.d.ts +13 -0
- package/dist/schemas/entityPresentation.schema.d.ts.map +1 -0
- package/dist/schemas/exercise.schema.d.cts +217 -0
- package/dist/schemas/exercise.schema.d.ts +218 -0
- package/dist/schemas/exercise.schema.d.ts.map +1 -0
- package/dist/schemas/exerciseProjection.d.cts +10 -0
- package/dist/schemas/exerciseProjection.d.ts +11 -0
- package/dist/schemas/exerciseProjection.d.ts.map +1 -0
- package/dist/schemas/exerciseV2.schema.d.cts +137 -0
- package/dist/schemas/exerciseV2.schema.d.ts +138 -0
- package/dist/schemas/exerciseV2.schema.d.ts.map +1 -0
- package/dist/schemas/exerciseV3.schema.d.cts +149 -0
- package/dist/schemas/exerciseV3.schema.d.ts +150 -0
- package/dist/schemas/exerciseV3.schema.d.ts.map +1 -0
- package/dist/schemas/geometryObject.schema.d.cts +17 -0
- package/dist/schemas/geometryObject.schema.d.ts +18 -0
- package/dist/schemas/geometryObject.schema.d.ts.map +1 -0
- package/dist/schemas/geometryState.schema.d.cts +64 -0
- package/dist/schemas/geometryState.schema.d.ts +65 -0
- package/dist/schemas/geometryState.schema.d.ts.map +1 -0
- package/dist/schemas/givenElement.schema.d.cts +24 -0
- package/dist/schemas/givenElement.schema.d.ts +25 -0
- package/dist/schemas/givenElement.schema.d.ts.map +1 -0
- package/dist/schemas/goals/createGoal.schema.d.cts +12 -0
- package/dist/schemas/goals/createGoal.schema.d.ts +13 -0
- package/dist/schemas/goals/createGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/geometryGoal.schema.d.cts +58 -0
- package/dist/schemas/goals/geometryGoal.schema.d.ts +59 -0
- package/dist/schemas/goals/geometryGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/goalKindDeclaration.d.cts +53 -0
- package/dist/schemas/goals/goalKindDeclaration.d.ts +54 -0
- package/dist/schemas/goals/goalKindDeclaration.d.ts.map +1 -0
- package/dist/schemas/goals/midpointGoal.schema.d.cts +9 -0
- package/dist/schemas/goals/midpointGoal.schema.d.ts +10 -0
- package/dist/schemas/goals/midpointGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/parallelGoal.schema.d.cts +15 -0
- package/dist/schemas/goals/parallelGoal.schema.d.ts +16 -0
- package/dist/schemas/goals/parallelGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/perpendicularGoal.schema.d.cts +15 -0
- package/dist/schemas/goals/perpendicularGoal.schema.d.ts +16 -0
- package/dist/schemas/goals/perpendicularGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/segmentLengthGoal.schema.d.cts +9 -0
- package/dist/schemas/goals/segmentLengthGoal.schema.d.ts +10 -0
- package/dist/schemas/goals/segmentLengthGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/throughPointsGoal.schema.d.cts +13 -0
- package/dist/schemas/goals/throughPointsGoal.schema.d.ts +14 -0
- package/dist/schemas/goals/throughPointsGoal.schema.d.ts.map +1 -0
- package/dist/schemas/identifier.schema.d.cts +2 -0
- package/dist/schemas/identifier.schema.d.ts +3 -0
- package/dist/schemas/identifier.schema.d.ts.map +1 -0
- package/dist/schemas/line.schema.d.cts +7 -0
- package/dist/schemas/line.schema.d.ts +8 -0
- package/dist/schemas/line.schema.d.ts.map +1 -0
- package/dist/schemas/migrate.d.cts +21 -0
- package/dist/schemas/migrate.d.ts +22 -0
- package/dist/schemas/migrate.d.ts.map +1 -0
- package/dist/schemas/objectTypeName.schema.d.cts +8 -0
- package/dist/schemas/objectTypeName.schema.d.ts +9 -0
- package/dist/schemas/objectTypeName.schema.d.ts.map +1 -0
- package/dist/schemas/point.schema.d.cts +15 -0
- package/dist/schemas/point.schema.d.ts +16 -0
- package/dist/schemas/point.schema.d.ts.map +1 -0
- package/dist/schemas/pointOrigin.schema.d.cts +25 -0
- package/dist/schemas/pointOrigin.schema.d.ts +26 -0
- package/dist/schemas/pointOrigin.schema.d.ts.map +1 -0
- package/dist/schemas/segment.schema.d.cts +8 -0
- package/dist/schemas/segment.schema.d.ts +9 -0
- package/dist/schemas/segment.schema.d.ts.map +1 -0
- package/dist/schemas/v1ToV2.d.cts +37 -0
- package/dist/schemas/v1ToV2.d.ts +38 -0
- package/dist/schemas/v1ToV2.d.ts.map +1 -0
- package/dist/schemas/v2ToV3.d.cts +37 -0
- package/dist/schemas/v2ToV3.d.ts +38 -0
- package/dist/schemas/v2ToV3.d.ts.map +1 -0
- package/dist/schemas/v3ToV4.d.cts +3 -0
- package/dist/schemas/v3ToV4.d.ts +4 -0
- package/dist/schemas/v3ToV4.d.ts.map +1 -0
- package/dist/schemas/viewport.schema.d.cts +3 -0
- package/dist/schemas/viewport.schema.d.ts +4 -0
- package/dist/schemas/viewport.schema.d.ts.map +1 -0
- package/dist/schemas.cjs +1 -0
- package/dist/schemas.mjs +3 -0
- package/dist/snapping/computeSnap.d.cts +30 -0
- package/dist/snapping/computeSnap.d.ts +31 -0
- package/dist/snapping/computeSnap.d.ts.map +1 -0
- package/dist/state/geometryContext.d.cts +40 -0
- package/dist/state/geometryContext.d.ts +41 -0
- package/dist/state/geometryContext.d.ts.map +1 -0
- package/dist/state/resolvePoints.d.cts +51 -0
- package/dist/state/resolvePoints.d.ts +52 -0
- package/dist/state/resolvePoints.d.ts.map +1 -0
- package/dist/store/attemptChange.d.cts +30 -0
- package/dist/store/attemptChange.d.ts +31 -0
- package/dist/store/attemptChange.d.ts.map +1 -0
- package/dist/store/constructionCommand.d.cts +35 -0
- package/dist/store/constructionCommand.d.ts +36 -0
- package/dist/store/constructionCommand.d.ts.map +1 -0
- package/dist/store/constructionIdentity.d.cts +21 -0
- package/dist/store/constructionIdentity.d.ts +22 -0
- package/dist/store/constructionIdentity.d.ts.map +1 -0
- package/dist/store/createStore.d.cts +6 -0
- package/dist/store/createStore.d.ts +7 -0
- package/dist/store/createStore.d.ts.map +1 -0
- package/dist/store/history.d.cts +2 -0
- package/dist/store/history.d.ts +3 -0
- package/dist/store/history.d.ts.map +1 -0
- package/dist/store/studentStore.d.cts +151 -0
- package/dist/store/studentStore.d.ts +152 -0
- package/dist/store/studentStore.d.ts.map +1 -0
- package/dist/store/teacherStore.d.cts +111 -0
- package/dist/store/teacherStore.d.ts +112 -0
- package/dist/store/teacherStore.d.ts.map +1 -0
- package/dist/store/useStoreState.d.cts +2 -0
- package/dist/store/useStoreState.d.ts +3 -0
- package/dist/store/useStoreState.d.ts.map +1 -0
- package/dist/studentStore-CEKTtMCh.js +1162 -0
- package/dist/studentStore-CEKTtMCh.js.map +1 -0
- package/dist/studentStore-DLftfFAl.cjs +2 -0
- package/dist/studentStore-DLftfFAl.cjs.map +1 -0
- package/dist/validation/checkGeometryAnswer.d.cts +63 -0
- package/dist/validation/checkGeometryAnswer.d.ts +64 -0
- package/dist/validation/checkGeometryAnswer.d.ts.map +1 -0
- package/dist/validation/deriveGeometryCanvasFeedback.d.cts +7 -0
- package/dist/validation/deriveGeometryCanvasFeedback.d.ts +8 -0
- package/dist/validation/deriveGeometryCanvasFeedback.d.ts.map +1 -0
- package/dist/validation/exerciseLoad.d.cts +29 -0
- package/dist/validation/exerciseLoad.d.ts +30 -0
- package/dist/validation/exerciseLoad.d.ts.map +1 -0
- package/dist/validation/geometryAttemptStatus.d.cts +23 -0
- package/dist/validation/geometryAttemptStatus.d.ts +24 -0
- package/dist/validation/geometryAttemptStatus.d.ts.map +1 -0
- package/dist/validation/getGeometryExerciseWarnings.d.cts +16 -0
- package/dist/validation/getGeometryExerciseWarnings.d.ts +17 -0
- package/dist/validation/getGeometryExerciseWarnings.d.ts.map +1 -0
- package/dist/validation/goals/create.d.cts +3 -0
- package/dist/validation/goals/create.d.ts +4 -0
- package/dist/validation/goals/create.d.ts.map +1 -0
- package/dist/validation/goals/goalContext.d.cts +44 -0
- package/dist/validation/goals/goalContext.d.ts +45 -0
- package/dist/validation/goals/goalContext.d.ts.map +1 -0
- package/dist/validation/goals/goalKindHandler.d.cts +26 -0
- package/dist/validation/goals/goalKindHandler.d.ts +27 -0
- package/dist/validation/goals/goalKindHandler.d.ts.map +1 -0
- package/dist/validation/goals/index.d.cts +14 -0
- package/dist/validation/goals/index.d.ts +15 -0
- package/dist/validation/goals/index.d.ts.map +1 -0
- package/dist/validation/goals/midpoint.d.cts +4 -0
- package/dist/validation/goals/midpoint.d.ts +5 -0
- package/dist/validation/goals/midpoint.d.ts.map +1 -0
- package/dist/validation/goals/parallel.d.cts +3 -0
- package/dist/validation/goals/parallel.d.ts +4 -0
- package/dist/validation/goals/parallel.d.ts.map +1 -0
- package/dist/validation/goals/perpendicular.d.cts +3 -0
- package/dist/validation/goals/perpendicular.d.ts +4 -0
- package/dist/validation/goals/perpendicular.d.ts.map +1 -0
- package/dist/validation/goals/previewGeometry.d.cts +9 -0
- package/dist/validation/goals/previewGeometry.d.ts +10 -0
- package/dist/validation/goals/previewGeometry.d.ts.map +1 -0
- package/dist/validation/goals/segmentLength.d.cts +3 -0
- package/dist/validation/goals/segmentLength.d.ts +4 -0
- package/dist/validation/goals/segmentLength.d.ts.map +1 -0
- package/dist/validation/goals/throughPoints.d.cts +5 -0
- package/dist/validation/goals/throughPoints.d.ts +6 -0
- package/dist/validation/goals/throughPoints.d.ts.map +1 -0
- package/dist/validation/gradingFingerprints.d.cts +4 -0
- package/dist/validation/gradingFingerprints.d.ts +5 -0
- package/dist/validation/gradingFingerprints.d.ts.map +1 -0
- package/dist/validation/revealGeometryAnswers.d.cts +3 -0
- package/dist/validation/revealGeometryAnswers.d.ts +4 -0
- package/dist/validation/revealGeometryAnswers.d.ts.map +1 -0
- package/dist/validation/revealGeometryAttempt.d.cts +36 -0
- package/dist/validation/revealGeometryAttempt.d.ts +37 -0
- package/dist/validation/revealGeometryAttempt.d.ts.map +1 -0
- package/dist/validation/types.d.cts +58 -0
- package/dist/validation/types.d.ts +59 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/validateGeometryExercise.d.cts +30 -0
- package/dist/validation/validateGeometryExercise.d.ts +31 -0
- package/dist/validation/validateGeometryExercise.d.ts.map +1 -0
- package/dist/validation/validateGeometryState.d.cts +16 -0
- package/dist/validation/validateGeometryState.d.ts +17 -0
- package/dist/validation/validateGeometryState.d.ts.map +1 -0
- package/dist/validation/validateGeometryStateInput.d.cts +22 -0
- package/dist/validation/validateGeometryStateInput.d.ts +23 -0
- package/dist/validation/validateGeometryStateInput.d.ts.map +1 -0
- package/dist/validation.cjs +2 -0
- package/dist/validation.cjs.map +1 -0
- package/dist/validation.mjs +269 -0
- package/dist/validation.mjs.map +1 -0
- package/package.json +150 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const midpointGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"midpoint">;
|
|
5
|
+
objectType: z.ZodLiteral<"point">;
|
|
6
|
+
referenceObjectId: z.ZodString;
|
|
7
|
+
toleranceUnits: z.ZodNumber;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type MidpointGoal = z.infer<typeof midpointGoalSchema>;
|
|
10
|
+
//# sourceMappingURL=midpointGoal.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midpointGoal.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/goals/midpointGoal.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,kBAAkB;;;;;;kBAWpB,CAAA;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const parallelGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"parallel">;
|
|
5
|
+
objectType: z.ZodEnum<{
|
|
6
|
+
point: "point";
|
|
7
|
+
segment: "segment";
|
|
8
|
+
line: "line";
|
|
9
|
+
circle: "circle";
|
|
10
|
+
}>;
|
|
11
|
+
referenceObjectId: z.ZodString;
|
|
12
|
+
throughPointId: z.ZodString;
|
|
13
|
+
toleranceDegrees: z.ZodNumber;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type ParallelGoal = z.infer<typeof parallelGoalSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const parallelGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"parallel">;
|
|
5
|
+
objectType: z.ZodEnum<{
|
|
6
|
+
point: "point";
|
|
7
|
+
segment: "segment";
|
|
8
|
+
line: "line";
|
|
9
|
+
circle: "circle";
|
|
10
|
+
}>;
|
|
11
|
+
referenceObjectId: z.ZodString;
|
|
12
|
+
throughPointId: z.ZodString;
|
|
13
|
+
toleranceDegrees: z.ZodNumber;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type ParallelGoal = z.infer<typeof parallelGoalSchema>;
|
|
16
|
+
//# sourceMappingURL=parallelGoal.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelGoal.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/goals/parallelGoal.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;kBASpB,CAAA;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const perpendicularGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"perpendicular">;
|
|
5
|
+
objectType: z.ZodEnum<{
|
|
6
|
+
point: "point";
|
|
7
|
+
segment: "segment";
|
|
8
|
+
line: "line";
|
|
9
|
+
circle: "circle";
|
|
10
|
+
}>;
|
|
11
|
+
referenceObjectId: z.ZodString;
|
|
12
|
+
throughPointId: z.ZodString;
|
|
13
|
+
toleranceDegrees: z.ZodNumber;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type PerpendicularGoal = z.infer<typeof perpendicularGoalSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const perpendicularGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"perpendicular">;
|
|
5
|
+
objectType: z.ZodEnum<{
|
|
6
|
+
point: "point";
|
|
7
|
+
segment: "segment";
|
|
8
|
+
line: "line";
|
|
9
|
+
circle: "circle";
|
|
10
|
+
}>;
|
|
11
|
+
referenceObjectId: z.ZodString;
|
|
12
|
+
throughPointId: z.ZodString;
|
|
13
|
+
toleranceDegrees: z.ZodNumber;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type PerpendicularGoal = z.infer<typeof perpendicularGoalSchema>;
|
|
16
|
+
//# sourceMappingURL=perpendicularGoal.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perpendicularGoal.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/goals/perpendicularGoal.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;kBASzB,CAAA;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const segmentLengthGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"segmentLength">;
|
|
5
|
+
objectType: z.ZodLiteral<"segment">;
|
|
6
|
+
targetLength: z.ZodNumber;
|
|
7
|
+
toleranceUnits: z.ZodNumber;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type SegmentLengthGoal = z.infer<typeof segmentLengthGoalSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const segmentLengthGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"segmentLength">;
|
|
5
|
+
objectType: z.ZodLiteral<"segment">;
|
|
6
|
+
targetLength: z.ZodNumber;
|
|
7
|
+
toleranceUnits: z.ZodNumber;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type SegmentLengthGoal = z.infer<typeof segmentLengthGoalSchema>;
|
|
10
|
+
//# sourceMappingURL=segmentLengthGoal.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentLengthGoal.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/goals/segmentLengthGoal.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,uBAAuB;;;;;;kBAWzB,CAAA;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const throughPointsGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"throughPoints">;
|
|
5
|
+
objectType: z.ZodEnum<{
|
|
6
|
+
point: "point";
|
|
7
|
+
segment: "segment";
|
|
8
|
+
line: "line";
|
|
9
|
+
circle: "circle";
|
|
10
|
+
}>;
|
|
11
|
+
pointIds: z.ZodArray<z.ZodString>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type ThroughPointsGoal = z.infer<typeof throughPointsGoalSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const throughPointsGoalSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"throughPoints">;
|
|
5
|
+
objectType: z.ZodEnum<{
|
|
6
|
+
point: "point";
|
|
7
|
+
segment: "segment";
|
|
8
|
+
line: "line";
|
|
9
|
+
circle: "circle";
|
|
10
|
+
}>;
|
|
11
|
+
pointIds: z.ZodArray<z.ZodString>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type ThroughPointsGoal = z.infer<typeof throughPointsGoalSchema>;
|
|
14
|
+
//# sourceMappingURL=throughPointsGoal.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throughPointsGoal.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/goals/throughPointsGoal.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,uBAAuB;;;;;;;;;;kBAOzB,CAAA;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/identifier.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,gBAAgB,aAKzB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const lineSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"line">;
|
|
5
|
+
through: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export type Line = z.infer<typeof lineSchema>;
|
|
8
|
+
//# sourceMappingURL=line.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/line.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,UAAU;;;;kBAMZ,CAAA;AAEX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface MigrationStep {
|
|
2
|
+
from: number;
|
|
3
|
+
to: number;
|
|
4
|
+
migrate: (document: Record<string, unknown>) => Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export type MigrationOutcome = {
|
|
7
|
+
success: true;
|
|
8
|
+
data: unknown;
|
|
9
|
+
} | {
|
|
10
|
+
success: false;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Brings a stored document up to `latestVersion` by applying steps in order.
|
|
15
|
+
*
|
|
16
|
+
* Failure is a message, never a throw: the input is untrusted JSON from a
|
|
17
|
+
* database or a request body, and the caller wants to report it rather than
|
|
18
|
+
* crash. A document from a *newer* version fails too — downgrading by guessing
|
|
19
|
+
* which fields to drop would silently destroy student work.
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyMigrations(input: unknown, steps: readonly MigrationStep[], latestVersion: number): MigrationOutcome;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface MigrationStep {
|
|
2
|
+
from: number;
|
|
3
|
+
to: number;
|
|
4
|
+
migrate: (document: Record<string, unknown>) => Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export type MigrationOutcome = {
|
|
7
|
+
success: true;
|
|
8
|
+
data: unknown;
|
|
9
|
+
} | {
|
|
10
|
+
success: false;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Brings a stored document up to `latestVersion` by applying steps in order.
|
|
15
|
+
*
|
|
16
|
+
* Failure is a message, never a throw: the input is untrusted JSON from a
|
|
17
|
+
* database or a request body, and the caller wants to report it rather than
|
|
18
|
+
* crash. A document from a *newer* version fails too — downgrading by guessing
|
|
19
|
+
* which fields to drop would silently destroy student work.
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyMigrations(input: unknown, steps: readonly MigrationStep[], latestVersion: number): MigrationOutcome;
|
|
22
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/schemas/migrate.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxE;AAED,MAAM,MAAM,gBAAgB,GAC1B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAOxE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,aAAa,EAAE,MAAM,GACpB,gBAAgB,CAgDlB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const objectTypeNameSchema: z.ZodEnum<{
|
|
3
|
+
point: "point";
|
|
4
|
+
segment: "segment";
|
|
5
|
+
line: "line";
|
|
6
|
+
circle: "circle";
|
|
7
|
+
}>;
|
|
8
|
+
export type ObjectTypeName = z.infer<typeof objectTypeNameSchema>;
|
|
9
|
+
//# sourceMappingURL=objectTypeName.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectTypeName.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/objectTypeName.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,oBAAoB;;;;;EAAiD,CAAA;AAElF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const pointSchema: z.ZodObject<{
|
|
3
|
+
x: z.ZodNumber;
|
|
4
|
+
y: z.ZodNumber;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type Point = z.infer<typeof pointSchema>;
|
|
7
|
+
export declare const givenPointSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
type: z.ZodLiteral<"point">;
|
|
10
|
+
x: z.ZodNumber;
|
|
11
|
+
y: z.ZodNumber;
|
|
12
|
+
label: z.ZodOptional<z.ZodString>;
|
|
13
|
+
draggable: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type GivenPoint = z.infer<typeof givenPointSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const pointSchema: z.ZodObject<{
|
|
3
|
+
x: z.ZodNumber;
|
|
4
|
+
y: z.ZodNumber;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type Point = z.infer<typeof pointSchema>;
|
|
7
|
+
export declare const givenPointSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
type: z.ZodLiteral<"point">;
|
|
10
|
+
x: z.ZodNumber;
|
|
11
|
+
y: z.ZodNumber;
|
|
12
|
+
label: z.ZodOptional<z.ZodString>;
|
|
13
|
+
draggable: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type GivenPoint = z.infer<typeof givenPointSchema>;
|
|
16
|
+
//# sourceMappingURL=point.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/point.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,WAAW;;;kBAKb,CAAA;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C,eAAO,MAAM,gBAAgB;;;;;;;kBASlB,CAAA;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const freePointOriginSchema: z.ZodObject<{
|
|
3
|
+
x: z.ZodNumber;
|
|
4
|
+
y: z.ZodNumber;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const onObjectPointOriginSchema: z.ZodObject<{
|
|
7
|
+
onObject: z.ZodString;
|
|
8
|
+
t: z.ZodNumber;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const intersectionPointOriginSchema: z.ZodObject<{
|
|
11
|
+
intersectionOf: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const pointOriginSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
14
|
+
x: z.ZodNumber;
|
|
15
|
+
y: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
onObject: z.ZodString;
|
|
18
|
+
t: z.ZodNumber;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
intersectionOf: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
21
|
+
}, z.core.$strict>]>;
|
|
22
|
+
export type FreePointOrigin = z.infer<typeof freePointOriginSchema>;
|
|
23
|
+
export type OnObjectPointOrigin = z.infer<typeof onObjectPointOriginSchema>;
|
|
24
|
+
export type IntersectionPointOrigin = z.infer<typeof intersectionPointOriginSchema>;
|
|
25
|
+
export type PointOrigin = z.infer<typeof pointOriginSchema>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const freePointOriginSchema: z.ZodObject<{
|
|
3
|
+
x: z.ZodNumber;
|
|
4
|
+
y: z.ZodNumber;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const onObjectPointOriginSchema: z.ZodObject<{
|
|
7
|
+
onObject: z.ZodString;
|
|
8
|
+
t: z.ZodNumber;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const intersectionPointOriginSchema: z.ZodObject<{
|
|
11
|
+
intersectionOf: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const pointOriginSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
14
|
+
x: z.ZodNumber;
|
|
15
|
+
y: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
onObject: z.ZodString;
|
|
18
|
+
t: z.ZodNumber;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
intersectionOf: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
21
|
+
}, z.core.$strict>]>;
|
|
22
|
+
export type FreePointOrigin = z.infer<typeof freePointOriginSchema>;
|
|
23
|
+
export type OnObjectPointOrigin = z.infer<typeof onObjectPointOriginSchema>;
|
|
24
|
+
export type IntersectionPointOrigin = z.infer<typeof intersectionPointOriginSchema>;
|
|
25
|
+
export type PointOrigin = z.infer<typeof pointOriginSchema>;
|
|
26
|
+
//# sourceMappingURL=pointOrigin.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointOrigin.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/pointOrigin.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,qBAAqB;;;kBAKvB,CAAA;AAIX,eAAO,MAAM,yBAAyB;;;kBAK3B,CAAA;AAEX,eAAO,MAAM,6BAA6B;;kBAI/B,CAAA;AAIX,eAAO,MAAM,iBAAiB;;;;;;;;oBAI5B,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC3E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const segmentSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"segment">;
|
|
5
|
+
from: z.ZodString;
|
|
6
|
+
to: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type Segment = z.infer<typeof segmentSchema>;
|
|
9
|
+
//# sourceMappingURL=segment.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/segment.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,aAAa;;;;;kBAOf,CAAA;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MigrationStep } from './migrate.cjs';
|
|
2
|
+
/** The version both steps below produce. */
|
|
3
|
+
export declare const v2SchemaVersion = 2;
|
|
4
|
+
/**
|
|
5
|
+
* A stored v1 attempt as a v2 one: `points` and `constructions` become the
|
|
6
|
+
* single `entities` record, `constructedPointIds` becomes `answerEntityIds`
|
|
7
|
+
* **plus every construction id**, and every entity gets an explicit
|
|
8
|
+
* presentation entry.
|
|
9
|
+
*
|
|
10
|
+
* The presentation row is the only line here that is not a rename. A v1 attempt
|
|
11
|
+
* has no concept of an implicit entity — everything in it came from a student
|
|
12
|
+
* gesture and is drawn — so `presentation: {}` plus the attempt's `implicit`
|
|
13
|
+
* default would hide every construction a student ever made (ADR 0008).
|
|
14
|
+
*
|
|
15
|
+
* `answerEntityIds` gaining the construction ids reproduces v1 grading exactly:
|
|
16
|
+
* v1 keeps a candidacy list for points only and treats every construction as a
|
|
17
|
+
* candidate.
|
|
18
|
+
*/
|
|
19
|
+
export declare const geometryStateV1ToV2: MigrationStep;
|
|
20
|
+
/**
|
|
21
|
+
* A stored v1 exercise as a v2 one: `givens[]` becomes the same `entities`
|
|
22
|
+
* record the attempt uses, `label` moves into `presentation` and `draggable`
|
|
23
|
+
* becomes the `draggableEntityIds` list.
|
|
24
|
+
*
|
|
25
|
+
* `id`, `viewport`, `showGrid`, `allowedObjects`, `tools` and `goals` are
|
|
26
|
+
* carried over untouched — the goals array migrates by identity — and anything
|
|
27
|
+
* else a stored document carries is carried over too, so that the strict v2
|
|
28
|
+
* schema rejects an unknown field rather than this step silently eating it.
|
|
29
|
+
*
|
|
30
|
+
* An unlabelled given gets **no** presentation entry: the exercise's default
|
|
31
|
+
* role is `explicit`, so `{ role: 'explicit' }` and no entry mean the same
|
|
32
|
+
* thing, and the smaller document is the one that stays true if a given is
|
|
33
|
+
* later relabelled.
|
|
34
|
+
*
|
|
35
|
+
* A duplicate id is refused rather than collapsed — see `claimId()`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const geometryExerciseV1ToV2: MigrationStep;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MigrationStep } from './migrate.js';
|
|
2
|
+
/** The version both steps below produce. */
|
|
3
|
+
export declare const v2SchemaVersion = 2;
|
|
4
|
+
/**
|
|
5
|
+
* A stored v1 attempt as a v2 one: `points` and `constructions` become the
|
|
6
|
+
* single `entities` record, `constructedPointIds` becomes `answerEntityIds`
|
|
7
|
+
* **plus every construction id**, and every entity gets an explicit
|
|
8
|
+
* presentation entry.
|
|
9
|
+
*
|
|
10
|
+
* The presentation row is the only line here that is not a rename. A v1 attempt
|
|
11
|
+
* has no concept of an implicit entity — everything in it came from a student
|
|
12
|
+
* gesture and is drawn — so `presentation: {}` plus the attempt's `implicit`
|
|
13
|
+
* default would hide every construction a student ever made (ADR 0008).
|
|
14
|
+
*
|
|
15
|
+
* `answerEntityIds` gaining the construction ids reproduces v1 grading exactly:
|
|
16
|
+
* v1 keeps a candidacy list for points only and treats every construction as a
|
|
17
|
+
* candidate.
|
|
18
|
+
*/
|
|
19
|
+
export declare const geometryStateV1ToV2: MigrationStep;
|
|
20
|
+
/**
|
|
21
|
+
* A stored v1 exercise as a v2 one: `givens[]` becomes the same `entities`
|
|
22
|
+
* record the attempt uses, `label` moves into `presentation` and `draggable`
|
|
23
|
+
* becomes the `draggableEntityIds` list.
|
|
24
|
+
*
|
|
25
|
+
* `id`, `viewport`, `showGrid`, `allowedObjects`, `tools` and `goals` are
|
|
26
|
+
* carried over untouched — the goals array migrates by identity — and anything
|
|
27
|
+
* else a stored document carries is carried over too, so that the strict v2
|
|
28
|
+
* schema rejects an unknown field rather than this step silently eating it.
|
|
29
|
+
*
|
|
30
|
+
* An unlabelled given gets **no** presentation entry: the exercise's default
|
|
31
|
+
* role is `explicit`, so `{ role: 'explicit' }` and no entry mean the same
|
|
32
|
+
* thing, and the smaller document is the one that stays true if a given is
|
|
33
|
+
* later relabelled.
|
|
34
|
+
*
|
|
35
|
+
* A duplicate id is refused rather than collapsed — see `claimId()`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const geometryExerciseV1ToV2: MigrationStep;
|
|
38
|
+
//# sourceMappingURL=v1ToV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1ToV2.d.ts","sourceRoot":"","sources":["../../src/schemas/v1ToV2.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAY9C,4CAA4C;AAC5C,eAAO,MAAM,eAAe,IAAI,CAAA;AA8EhC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAsCjC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,EAAE,aA8CpC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { MigrationStep } from './migrate.cjs';
|
|
3
|
+
/** The version the step below produces. */
|
|
4
|
+
export declare const v3SchemaVersion = 3;
|
|
5
|
+
/**
|
|
6
|
+
* Just enough of a schema for the gate: the next version's parser, passed in
|
|
7
|
+
* rather than imported to keep this module free of a cycle with
|
|
8
|
+
* `exercise.schema.ts` — and small enough that a test can substitute a laxer
|
|
9
|
+
* one and watch the gate react.
|
|
10
|
+
*/
|
|
11
|
+
export interface DocumentGate {
|
|
12
|
+
safeParse(input: unknown): {
|
|
13
|
+
success: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* An exercise hop that adds vocabulary and changes nothing it already had. The
|
|
18
|
+
* refusal rule, stated exactly: **a document that is invalid at `from` and
|
|
19
|
+
* valid at `from + 1` is refused.** That is what silent promotion means, and it
|
|
20
|
+
* covers every way the next version can be wider — a new field, a new entity
|
|
21
|
+
* kind, a new goal type, a new `allowedObjects` member, a new presentation
|
|
22
|
+
* entry, a loosened value — without the step having to enumerate them or read
|
|
23
|
+
* issue codes to guess which is which.
|
|
24
|
+
*
|
|
25
|
+
* A document that is invalid at **both** versions passes through untouched, so
|
|
26
|
+
* an ordinary fault (a bad viewport, a dangling parent) is still reported by
|
|
27
|
+
* `geometryExerciseSchema` at its own document path rather than refiled here as
|
|
28
|
+
* one message under `schemaVersion`. It is rejected either way; only the quality
|
|
29
|
+
* of the error differs, and the path is the better answer.
|
|
30
|
+
*
|
|
31
|
+
* `frozenSchema` must be a transcription of version `from` and `nextSchema` the
|
|
32
|
+
* parser of version `from + 1` — frozen as well unless that is the current one,
|
|
33
|
+
* because a current schema's version literal would never accept the promotion.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createIdentityExerciseStep(from: number, frozenSchema: ZodType, nextSchema: DocumentGate): MigrationStep;
|
|
36
|
+
/** The v2 → v3 hop, gated against the version 3 schema it is given. */
|
|
37
|
+
export declare function createGeometryExerciseV2ToV3(v3ExerciseSchema: DocumentGate): MigrationStep;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { MigrationStep } from './migrate.js';
|
|
3
|
+
/** The version the step below produces. */
|
|
4
|
+
export declare const v3SchemaVersion = 3;
|
|
5
|
+
/**
|
|
6
|
+
* Just enough of a schema for the gate: the next version's parser, passed in
|
|
7
|
+
* rather than imported to keep this module free of a cycle with
|
|
8
|
+
* `exercise.schema.ts` — and small enough that a test can substitute a laxer
|
|
9
|
+
* one and watch the gate react.
|
|
10
|
+
*/
|
|
11
|
+
export interface DocumentGate {
|
|
12
|
+
safeParse(input: unknown): {
|
|
13
|
+
success: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* An exercise hop that adds vocabulary and changes nothing it already had. The
|
|
18
|
+
* refusal rule, stated exactly: **a document that is invalid at `from` and
|
|
19
|
+
* valid at `from + 1` is refused.** That is what silent promotion means, and it
|
|
20
|
+
* covers every way the next version can be wider — a new field, a new entity
|
|
21
|
+
* kind, a new goal type, a new `allowedObjects` member, a new presentation
|
|
22
|
+
* entry, a loosened value — without the step having to enumerate them or read
|
|
23
|
+
* issue codes to guess which is which.
|
|
24
|
+
*
|
|
25
|
+
* A document that is invalid at **both** versions passes through untouched, so
|
|
26
|
+
* an ordinary fault (a bad viewport, a dangling parent) is still reported by
|
|
27
|
+
* `geometryExerciseSchema` at its own document path rather than refiled here as
|
|
28
|
+
* one message under `schemaVersion`. It is rejected either way; only the quality
|
|
29
|
+
* of the error differs, and the path is the better answer.
|
|
30
|
+
*
|
|
31
|
+
* `frozenSchema` must be a transcription of version `from` and `nextSchema` the
|
|
32
|
+
* parser of version `from + 1` — frozen as well unless that is the current one,
|
|
33
|
+
* because a current schema's version literal would never accept the promotion.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createIdentityExerciseStep(from: number, frozenSchema: ZodType, nextSchema: DocumentGate): MigrationStep;
|
|
36
|
+
/** The v2 → v3 hop, gated against the version 3 schema it is given. */
|
|
37
|
+
export declare function createGeometryExerciseV2ToV3(v3ExerciseSchema: DocumentGate): MigrationStep;
|
|
38
|
+
//# sourceMappingURL=v2ToV3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2ToV3.d.ts","sourceRoot":"","sources":["../../src/schemas/v2ToV3.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAG9C,2CAA2C;AAC3C,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAA;CAChD;AAkBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,YAAY,GACvB,aAAa,CAkBf;AAED,uEAAuE;AACvE,wBAAgB,4BAA4B,CAAC,gBAAgB,EAAE,YAAY,GAAG,aAAa,CAE1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3ToV4.d.ts","sourceRoot":"","sources":["../../src/schemas/v3ToV4.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE9C,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,UAAU,CAAA;AAExE,wBAAgB,4BAA4B,CAAC,qBAAqB,EAAE,YAAY,GAAG,aAAa,CAE/F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/viewport.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,kBAAkB,wEAe3B,CAAA;AAEJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/schemas.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./geometryState.schema-DKQ-durx.cjs"),t=require("./exercise.schema-BV2b7rtN.cjs");exports.applyMigrations=e.o,exports.createGoalSchema=e.y,exports.exerciseGradingSchema=t.t,exports.extraObjectPolicySchema=t.n,exports.geometryExerciseMigrations=t.r,exports.geometryExerciseSchema=t.i,exports.geometryGoalSchema=t.l,exports.geometryIdSchema=e.D,exports.geometryStateMigrations=e.t,exports.geometryStateSchema=e.n,exports.latestGeometryExerciseVersion=t.a,exports.latestGeometryStateVersion=e.r,exports.mathViewportSchema=t.u,exports.midpointGoalSchema=e.v,exports.migrateGeometryExercise=t.o,exports.migrateGeometryState=e.i,exports.objectTypeNameSchema=e.b,exports.parallelGoalSchema=e._,exports.parseGeometryExercise=t.s,exports.perpendicularGoalSchema=e.g,exports.pointSchema=e.l,exports.segmentLengthGoalSchema=e.h,exports.throughPointsGoalSchema=e.m,exports.toolNameSchema=t.c;
|
package/dist/schemas.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { D as e, _ as t, b as n, g as r, h as i, i as a, l as o, m as s, n as c, o as l, r as u, t as d, v as f, y as p } from "./geometryState.schema-D0ixyGYE.js";
|
|
2
|
+
import { a as m, c as h, i as g, l as _, n as v, o as y, r as b, s as x, t as S, u as C } from "./exercise.schema-ckVBW9XA.js";
|
|
3
|
+
export { l as applyMigrations, p as createGoalSchema, S as exerciseGradingSchema, v as extraObjectPolicySchema, b as geometryExerciseMigrations, g as geometryExerciseSchema, _ as geometryGoalSchema, e as geometryIdSchema, d as geometryStateMigrations, c as geometryStateSchema, m as latestGeometryExerciseVersion, u as latestGeometryStateVersion, C as mathViewportSchema, f as midpointGoalSchema, y as migrateGeometryExercise, a as migrateGeometryState, n as objectTypeNameSchema, t as parallelGoalSchema, x as parseGeometryExercise, r as perpendicularGoalSchema, o as pointSchema, i as segmentLengthGoalSchema, s as throughPointsGoalSchema, h as toolNameSchema };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SceneEntity } from '../geometry/hitTest.cjs';
|
|
2
|
+
import { Point, PointId } from '../geometry/point.cjs';
|
|
3
|
+
import { EntityId, PointDefinition } from '../geometry/entityModel.cjs';
|
|
4
|
+
import { MathViewport } from '../schemas/viewport.schema.cjs';
|
|
5
|
+
export type SnapKind = 'point' | 'intersection' | 'grid' | 'onObject';
|
|
6
|
+
export interface SnapResult {
|
|
7
|
+
position: Point;
|
|
8
|
+
kind: SnapKind;
|
|
9
|
+
targetIds: string[];
|
|
10
|
+
parameter?: number;
|
|
11
|
+
distance: number;
|
|
12
|
+
}
|
|
13
|
+
export interface SnapScene {
|
|
14
|
+
points: ReadonlyMap<PointId, Point>;
|
|
15
|
+
objects: readonly SceneEntity[];
|
|
16
|
+
viewport: MathViewport;
|
|
17
|
+
showGrid?: boolean;
|
|
18
|
+
isSnapTarget?: (id: EntityId) => boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface SnapOptions {
|
|
21
|
+
tolerance: number;
|
|
22
|
+
exclude?: readonly string[];
|
|
23
|
+
kinds?: readonly SnapKind[];
|
|
24
|
+
}
|
|
25
|
+
export declare function computeSnap(at: Point, scene: SnapScene, options: SnapOptions): SnapResult | null;
|
|
26
|
+
export declare function snapPosition(at: Point, scene: SnapScene, options: SnapOptions): Point;
|
|
27
|
+
export declare function originForSnap(placement: {
|
|
28
|
+
position: Point;
|
|
29
|
+
snap: SnapResult | null;
|
|
30
|
+
}): PointDefinition | null;
|