@mathscan/geometry-engine 0.1.0 → 0.1.1
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 +24 -7
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +4 -4
- package/dist/entries/core.d.cts +1 -1
- package/dist/entries/core.d.ts +1 -1
- package/dist/entries/core.d.ts.map +1 -1
- package/dist/exercise.schema-Bma3qN9P.js +251 -0
- package/dist/exercise.schema-Bma3qN9P.js.map +1 -0
- package/dist/exercise.schema-Oj5ZH-yO.cjs +2 -0
- package/dist/exercise.schema-Oj5ZH-yO.cjs.map +1 -0
- package/dist/exerciseLoad-Db9Cigxi.cjs +2 -0
- package/dist/exerciseLoad-Db9Cigxi.cjs.map +1 -0
- package/dist/{geometryAttemptStatus-5L_q6-9l.js → exerciseLoad-DgeDXYbf.js} +84 -71
- package/dist/exerciseLoad-DgeDXYbf.js.map +1 -0
- package/dist/geometry/entities/angle.d.cts +56 -0
- package/dist/geometry/entities/angle.d.ts +57 -0
- package/dist/geometry/entities/angle.d.ts.map +1 -0
- package/dist/geometry/entities/circle.d.ts.map +1 -1
- package/dist/geometry/entities/index.d.cts +8 -4
- package/dist/geometry/entities/index.d.ts +8 -4
- package/dist/geometry/entities/index.d.ts.map +1 -1
- package/dist/geometry/entities/line.d.ts.map +1 -1
- package/dist/geometry/entities/point.d.ts.map +1 -1
- package/dist/geometry/entities/relations.d.cts +8 -1
- package/dist/geometry/entities/relations.d.ts +8 -1
- package/dist/geometry/entities/relations.d.ts.map +1 -1
- package/dist/geometry/entities/segment.d.ts.map +1 -1
- package/dist/geometry/entityModel.d.cts +21 -3
- package/dist/geometry/entityModel.d.ts +21 -3
- package/dist/geometry/entityModel.d.ts.map +1 -1
- package/dist/geometryState.schema-B5ccMKDa.cjs +2 -0
- package/dist/geometryState.schema-B5ccMKDa.cjs.map +1 -0
- package/dist/geometryState.schema-CKFPlX8j.js +1177 -0
- package/dist/geometryState.schema-CKFPlX8j.js.map +1 -0
- package/dist/goals-BlSeniyt.js +563 -0
- package/dist/goals-BlSeniyt.js.map +1 -0
- package/dist/goals-DLbmBZD8.cjs +2 -0
- package/dist/goals-DLbmBZD8.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +8 -8
- package/dist/measure/angleType.d.cts +2 -0
- package/dist/measure/angleType.d.ts +3 -0
- package/dist/measure/angleType.d.ts.map +1 -0
- package/dist/measure/geometryAdapter.d.cts +3 -0
- package/dist/measure/geometryAdapter.d.ts +3 -0
- package/dist/measure/geometryAdapter.d.ts.map +1 -1
- package/dist/react-B26_e52I.cjs +2 -0
- package/dist/react-B26_e52I.cjs.map +1 -0
- package/dist/{react-BEcdx1f6.js → react-B5cGaxH8.js} +738 -513
- package/dist/react-B5cGaxH8.js.map +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/renderer/GeometryCanvas.d.ts.map +1 -1
- package/dist/renderer/StudentGeometryCanvas.d.ts.map +1 -1
- package/dist/renderer/Toolbar.d.ts.map +1 -1
- package/dist/renderer/angleMeasure.d.cts +14 -0
- package/dist/renderer/angleMeasure.d.ts +15 -0
- package/dist/renderer/angleMeasure.d.ts.map +1 -0
- package/dist/renderer/deriveRenderableGeometry.d.cts +1 -0
- package/dist/renderer/deriveRenderableGeometry.d.ts +1 -0
- package/dist/renderer/deriveRenderableGeometry.d.ts.map +1 -1
- package/dist/renderer/deriveSemanticScene.d.ts.map +1 -1
- package/dist/renderer/dragSnap.d.cts +14 -0
- package/dist/renderer/dragSnap.d.ts +15 -0
- package/dist/renderer/dragSnap.d.ts.map +1 -0
- package/dist/renderer/shapes/AngleShape.d.cts +19 -0
- package/dist/renderer/shapes/AngleShape.d.ts +20 -0
- package/dist/renderer/shapes/AngleShape.d.ts.map +1 -0
- package/dist/renderer/shapes/EntityLabel.d.cts +9 -1
- package/dist/renderer/shapes/EntityLabel.d.ts +9 -1
- package/dist/renderer/shapes/EntityLabel.d.ts.map +1 -1
- package/dist/renderer/shapes/EntityShape.d.cts +2 -1
- package/dist/renderer/shapes/EntityShape.d.ts +2 -1
- package/dist/renderer/shapes/EntityShape.d.ts.map +1 -1
- package/dist/renderer/useConnectionPreview.d.cts +12 -1
- package/dist/renderer/useConnectionPreview.d.ts +12 -1
- package/dist/renderer/useConnectionPreview.d.ts.map +1 -1
- package/dist/renderer/usePointerGestures.d.cts +1 -1
- package/dist/renderer/usePointerGestures.d.ts +1 -1
- package/dist/renderer/usePointerGestures.d.ts.map +1 -1
- package/dist/schemas/entityDefinition.schema.d.cts +7 -0
- package/dist/schemas/entityDefinition.schema.d.ts +7 -0
- package/dist/schemas/entityDefinition.schema.d.ts.map +1 -1
- package/dist/schemas/entityDocument.d.cts +34 -13
- package/dist/schemas/entityDocument.d.ts +34 -13
- package/dist/schemas/entityDocument.d.ts.map +1 -1
- package/dist/schemas/entityPresentation.schema.d.cts +3 -0
- package/dist/schemas/entityPresentation.schema.d.ts +3 -0
- package/dist/schemas/entityPresentation.schema.d.ts.map +1 -1
- package/dist/schemas/exercise.schema.d.cts +80 -2
- package/dist/schemas/exercise.schema.d.ts +80 -2
- package/dist/schemas/exercise.schema.d.ts.map +1 -1
- package/dist/schemas/exerciseV2.schema.d.cts +57 -0
- package/dist/schemas/exerciseV2.schema.d.ts +57 -0
- package/dist/schemas/exerciseV2.schema.d.ts.map +1 -1
- package/dist/schemas/exerciseV4.schema.d.cts +168 -0
- package/dist/schemas/exerciseV4.schema.d.ts +169 -0
- package/dist/schemas/exerciseV4.schema.d.ts.map +1 -0
- package/dist/schemas/geometryState.schema.d.cts +8 -0
- package/dist/schemas/geometryState.schema.d.ts +8 -0
- package/dist/schemas/geometryState.schema.d.ts.map +1 -1
- package/dist/schemas/goals/angleBisectorGoal.schema.d.cts +15 -0
- package/dist/schemas/goals/angleBisectorGoal.schema.d.ts +16 -0
- package/dist/schemas/goals/angleBisectorGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/angleCriterion.schema.d.cts +28 -0
- package/dist/schemas/goals/angleCriterion.schema.d.ts +29 -0
- package/dist/schemas/goals/angleCriterion.schema.d.ts.map +1 -0
- package/dist/schemas/goals/angleMeasureGoal.schema.d.cts +26 -0
- package/dist/schemas/goals/angleMeasureGoal.schema.d.ts +27 -0
- package/dist/schemas/goals/angleMeasureGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/createGoal.schema.d.cts +1 -0
- package/dist/schemas/goals/createGoal.schema.d.ts +1 -0
- package/dist/schemas/goals/createGoal.schema.d.ts.map +1 -1
- package/dist/schemas/goals/geometryGoal.schema.d.cts +61 -0
- package/dist/schemas/goals/geometryGoal.schema.d.ts +61 -0
- package/dist/schemas/goals/geometryGoal.schema.d.ts.map +1 -1
- package/dist/schemas/goals/givenAngleGoal.schema.d.cts +35 -0
- package/dist/schemas/goals/givenAngleGoal.schema.d.ts +36 -0
- package/dist/schemas/goals/givenAngleGoal.schema.d.ts.map +1 -0
- package/dist/schemas/goals/goalKindDeclaration.d.cts +7 -0
- package/dist/schemas/goals/goalKindDeclaration.d.ts +7 -0
- package/dist/schemas/goals/goalKindDeclaration.d.ts.map +1 -1
- package/dist/schemas/goals/parallelGoal.schema.d.cts +1 -0
- package/dist/schemas/goals/parallelGoal.schema.d.ts +1 -0
- package/dist/schemas/goals/parallelGoal.schema.d.ts.map +1 -1
- package/dist/schemas/goals/perpendicularGoal.schema.d.cts +1 -0
- package/dist/schemas/goals/perpendicularGoal.schema.d.ts +1 -0
- package/dist/schemas/goals/perpendicularGoal.schema.d.ts.map +1 -1
- package/dist/schemas/goals/throughPointsGoal.schema.d.cts +1 -0
- package/dist/schemas/goals/throughPointsGoal.schema.d.ts +1 -0
- package/dist/schemas/goals/throughPointsGoal.schema.d.ts.map +1 -1
- package/dist/schemas/objectTypeName.schema.d.cts +1 -0
- package/dist/schemas/objectTypeName.schema.d.ts +1 -0
- package/dist/schemas/objectTypeName.schema.d.ts.map +1 -1
- package/dist/schemas/v2ToV3.d.cts +15 -1
- package/dist/schemas/v2ToV3.d.ts +15 -1
- package/dist/schemas/v2ToV3.d.ts.map +1 -1
- package/dist/schemas/v3ToV4.d.cts +2 -1
- package/dist/schemas/v3ToV4.d.ts +2 -1
- package/dist/schemas/v3ToV4.d.ts.map +1 -1
- package/dist/schemas/v4ToV5.d.cts +7 -0
- package/dist/schemas/v4ToV5.d.ts +8 -0
- package/dist/schemas/v4ToV5.d.ts.map +1 -0
- package/dist/schemas.cjs +1 -1
- package/dist/schemas.mjs +3 -3
- package/dist/snapping/computeDragSnap.d.cts +30 -0
- package/dist/snapping/computeDragSnap.d.ts +31 -0
- package/dist/snapping/computeDragSnap.d.ts.map +1 -0
- package/dist/state/geometryContext.d.ts.map +1 -1
- package/dist/store/attemptChange.d.cts +1 -1
- package/dist/store/attemptChange.d.ts +1 -1
- package/dist/store/attemptChange.d.ts.map +1 -1
- package/dist/store/constructionCommand.d.cts +14 -2
- package/dist/store/constructionCommand.d.ts +14 -2
- package/dist/store/constructionCommand.d.ts.map +1 -1
- package/dist/store/constructionIdentity.d.cts +9 -0
- package/dist/store/constructionIdentity.d.ts +9 -0
- package/dist/store/constructionIdentity.d.ts.map +1 -1
- package/dist/store/studentStore.d.cts +7 -0
- package/dist/store/studentStore.d.ts +7 -0
- package/dist/store/studentStore.d.ts.map +1 -1
- package/dist/store/teacherStore.d.cts +16 -0
- package/dist/store/teacherStore.d.ts +16 -0
- package/dist/store/teacherStore.d.ts.map +1 -1
- package/dist/{studentStore-CEKTtMCh.js → studentStore-CyYa0N93.js} +502 -370
- package/dist/studentStore-CyYa0N93.js.map +1 -0
- package/dist/studentStore-ubldy4PJ.cjs +2 -0
- package/dist/studentStore-ubldy4PJ.cjs.map +1 -0
- package/dist/validation/getGeometryExerciseWarnings.d.cts +3 -2
- package/dist/validation/getGeometryExerciseWarnings.d.ts +3 -2
- package/dist/validation/getGeometryExerciseWarnings.d.ts.map +1 -1
- package/dist/validation/goals/angleBisector.d.cts +3 -0
- package/dist/validation/goals/angleBisector.d.ts +4 -0
- package/dist/validation/goals/angleBisector.d.ts.map +1 -0
- package/dist/validation/goals/angleCriterion.d.cts +12 -0
- package/dist/validation/goals/angleCriterion.d.ts +13 -0
- package/dist/validation/goals/angleCriterion.d.ts.map +1 -0
- package/dist/validation/goals/angleMeasure.d.cts +9 -0
- package/dist/validation/goals/angleMeasure.d.ts +10 -0
- package/dist/validation/goals/angleMeasure.d.ts.map +1 -0
- package/dist/validation/goals/create.d.cts +2 -2
- package/dist/validation/goals/create.d.ts +2 -2
- package/dist/validation/goals/create.d.ts.map +1 -1
- package/dist/validation/goals/givenAngle.d.cts +11 -0
- package/dist/validation/goals/givenAngle.d.ts +12 -0
- package/dist/validation/goals/givenAngle.d.ts.map +1 -0
- package/dist/validation/goals/goalKindHandler.d.cts +38 -1
- package/dist/validation/goals/goalKindHandler.d.ts +38 -1
- package/dist/validation/goals/goalKindHandler.d.ts.map +1 -1
- package/dist/validation/goals/index.d.cts +9 -2
- package/dist/validation/goals/index.d.ts +9 -2
- package/dist/validation/goals/index.d.ts.map +1 -1
- package/dist/validation/goals/midpoint.d.cts +2 -2
- package/dist/validation/goals/midpoint.d.ts +2 -2
- package/dist/validation/goals/midpoint.d.ts.map +1 -1
- package/dist/validation/goals/parallel.d.cts +2 -2
- package/dist/validation/goals/parallel.d.ts +2 -2
- package/dist/validation/goals/parallel.d.ts.map +1 -1
- package/dist/validation/goals/perpendicular.d.cts +2 -2
- package/dist/validation/goals/perpendicular.d.ts +2 -2
- package/dist/validation/goals/perpendicular.d.ts.map +1 -1
- package/dist/validation/goals/segmentLength.d.cts +2 -2
- package/dist/validation/goals/segmentLength.d.ts +2 -2
- package/dist/validation/goals/segmentLength.d.ts.map +1 -1
- package/dist/validation/goals/throughPoints.d.cts +2 -2
- package/dist/validation/goals/throughPoints.d.ts +2 -2
- package/dist/validation/goals/throughPoints.d.ts.map +1 -1
- package/dist/validation/types.d.cts +5 -1
- package/dist/validation/types.d.ts +5 -1
- package/dist/validation/types.d.ts.map +1 -1
- package/dist/validation/validateGeometryState.d.ts.map +1 -1
- package/dist/validation/validateGeometryStateInput.d.ts.map +1 -1
- package/dist/validation.cjs +1 -1
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.mjs +106 -85
- package/dist/validation.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/exercise.schema-BV2b7rtN.cjs +0 -2
- package/dist/exercise.schema-BV2b7rtN.cjs.map +0 -1
- package/dist/exercise.schema-ckVBW9XA.js +0 -212
- package/dist/exercise.schema-ckVBW9XA.js.map +0 -1
- package/dist/geometryAttemptStatus-5L_q6-9l.js.map +0 -1
- package/dist/geometryAttemptStatus-N_XHIkiS.cjs +0 -2
- package/dist/geometryAttemptStatus-N_XHIkiS.cjs.map +0 -1
- package/dist/geometryState.schema-D0ixyGYE.js +0 -955
- package/dist/geometryState.schema-D0ixyGYE.js.map +0 -1
- package/dist/geometryState.schema-DKQ-durx.cjs +0 -2
- package/dist/geometryState.schema-DKQ-durx.cjs.map +0 -1
- package/dist/goals-C3ZwbEh_.js +0 -451
- package/dist/goals-C3ZwbEh_.js.map +0 -1
- package/dist/goals-CxR5qPDC.cjs +0 -2
- package/dist/goals-CxR5qPDC.cjs.map +0 -1
- package/dist/react-BEcdx1f6.js.map +0 -1
- package/dist/react-Pp_VSk--.cjs +0 -2
- package/dist/react-Pp_VSk--.cjs.map +0 -1
- package/dist/studentStore-CEKTtMCh.js.map +0 -1
- package/dist/studentStore-DLftfFAl.cjs +0 -2
- package/dist/studentStore-DLftfFAl.cjs.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EntityId, GeometryContext } from '../geometry/entityModel.js';
|
|
2
|
+
/**
|
|
3
|
+
* Decimals an angle's drawn measure is rounded to (M3.5.a). Zero, so an arm
|
|
4
|
+
* snapped to a whole degree (ADR 0018) reads exactly its measure. Display only:
|
|
5
|
+
* geometry and grading keep full precision and never read this text.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ANGLE_LABEL_DECIMALS = 0;
|
|
8
|
+
/**
|
|
9
|
+
* The measure an angle shows, as text — `undefined` unless its presentation
|
|
10
|
+
* sets `measureLabel: 'degrees'` and it resolves. Absent means hidden
|
|
11
|
+
* (ADR 0010 § 4), for every reader: the canvas label and the companion row both
|
|
12
|
+
* read this one function, so a measure the author hid is disclosed by neither.
|
|
13
|
+
*/
|
|
14
|
+
export declare function angleMeasureTextOf(context: GeometryContext, id: EntityId): string | undefined;
|
|
15
|
+
//# sourceMappingURL=angleMeasure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angleMeasure.d.ts","sourceRoot":"","sources":["../../src/renderer/angleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAExE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAA;AAErC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAQ7F"}
|
|
@@ -9,6 +9,7 @@ export interface RenderableGeometry {
|
|
|
9
9
|
objects: SceneEntity[];
|
|
10
10
|
capabilitiesOf: (id: EntityId) => Readonly<EntityCapabilities>;
|
|
11
11
|
labelOf: (id: EntityId) => string | undefined;
|
|
12
|
+
measureOf: (id: EntityId) => string | undefined;
|
|
12
13
|
isSnapTarget: (id: EntityId) => boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare function deriveRenderableGeometry(state: TeacherEditorState): RenderableGeometry;
|
|
@@ -9,6 +9,7 @@ export interface RenderableGeometry {
|
|
|
9
9
|
objects: SceneEntity[];
|
|
10
10
|
capabilitiesOf: (id: EntityId) => Readonly<EntityCapabilities>;
|
|
11
11
|
labelOf: (id: EntityId) => string | undefined;
|
|
12
|
+
measureOf: (id: EntityId) => string | undefined;
|
|
12
13
|
isSnapTarget: (id: EntityId) => boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare function deriveRenderableGeometry(state: TeacherEditorState): RenderableGeometry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveRenderableGeometry.d.ts","sourceRoot":"","sources":["../../src/renderer/deriveRenderableGeometry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAmB,MAAM,yBAAyB,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAGpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"deriveRenderableGeometry.d.ts","sourceRoot":"","sources":["../../src/renderer/deriveRenderableGeometry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAmB,MAAM,yBAAyB,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAGpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAsB/D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACnC,OAAO,EAAE,WAAW,EAAE,CAAA;IAGtB,cAAc,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,QAAQ,CAAC,kBAAkB,CAAC,CAAA;IAS9D,OAAO,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,MAAM,GAAG,SAAS,CAAA;IAI7C,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,MAAM,GAAG,SAAS,CAAA;IAK/C,YAAY,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAA;CACxC;AAID,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAsBtF;AAUD,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,aAAa,GACtB,kBAAkB,CAKpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveSemanticScene.d.ts","sourceRoot":"","sources":["../../src/renderer/deriveSemanticScene.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAKnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"deriveSemanticScene.d.ts","sourceRoot":"","sources":["../../src/renderer/deriveSemanticScene.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAKnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEjF,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEzE,MAAM,WAAW,cAAc;IAC7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ntityId } from '../geometry/entityModel.cjs';
|
|
3
|
+
import { SceneEntity } from '../geometry/hitTest.cjs';
|
|
4
|
+
import { Point, PointId } from '../geometry/point.cjs';
|
|
5
|
+
import { GeometryExercise } from '../schemas/exercise.schema.cjs';
|
|
6
|
+
import { ScreenPoint } from './gesturePolicy.cjs';
|
|
7
|
+
export interface DragSnapContext {
|
|
8
|
+
exercise: GeometryExercise;
|
|
9
|
+
attempt?: Record<EntityId, EntityDefinition>;
|
|
10
|
+
points: ReadonlyMap<PointId, Point>;
|
|
11
|
+
objects: readonly SceneEntity[];
|
|
12
|
+
canvas: CanvasSize;
|
|
13
|
+
}
|
|
14
|
+
export declare function snapDragFrame({ exercise, attempt, points, objects, canvas }: DragSnapContext, pointId: PointId, to: ScreenPoint, from: ScreenPoint): Point | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CanvasSize } from '../coordinates/transform.js';
|
|
2
|
+
import { EntityDefinition, EntityId } from '../geometry/entityModel.js';
|
|
3
|
+
import { SceneEntity } from '../geometry/hitTest.js';
|
|
4
|
+
import { Point, PointId } from '../geometry/point.js';
|
|
5
|
+
import { GeometryExercise } from '../schemas/exercise.schema.js';
|
|
6
|
+
import { ScreenPoint } from './gesturePolicy.js';
|
|
7
|
+
export interface DragSnapContext {
|
|
8
|
+
exercise: GeometryExercise;
|
|
9
|
+
attempt?: Record<EntityId, EntityDefinition>;
|
|
10
|
+
points: ReadonlyMap<PointId, Point>;
|
|
11
|
+
objects: readonly SceneEntity[];
|
|
12
|
+
canvas: CanvasSize;
|
|
13
|
+
}
|
|
14
|
+
export declare function snapDragFrame({ exercise, attempt, points, objects, canvas }: DragSnapContext, pointId: PointId, to: ScreenPoint, from: ScreenPoint): Point | null;
|
|
15
|
+
//# sourceMappingURL=dragSnap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragSnap.d.ts","sourceRoot":"","sources":["../../src/renderer/dragSnap.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,gBAAgB,CAAA;IAG1B,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAA;IAC5C,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACnC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,MAAM,EAAE,UAAU,CAAA;CACnB;AAMD,wBAAgB,aAAa,CAC3B,EAAE,QAAQ,EAAE,OAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,eAAe,EACpE,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,WAAW,GAChB,KAAK,GAAG,IAAI,CAed"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CanvasSize } from '../../coordinates/transform.cjs';
|
|
2
|
+
import { Point } from '../../geometry/point.cjs';
|
|
3
|
+
import { MathViewport } from '../../schemas/viewport.schema.cjs';
|
|
4
|
+
export interface AngleShapeProps {
|
|
5
|
+
id: string;
|
|
6
|
+
vertex: Point;
|
|
7
|
+
startTurn: number;
|
|
8
|
+
sweepTurn: number;
|
|
9
|
+
radius: number;
|
|
10
|
+
viewport: MathViewport;
|
|
11
|
+
canvas: CanvasSize;
|
|
12
|
+
color?: string;
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
dashed?: boolean;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
listening?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function AngleShape({ id, vertex, startTurn, sweepTurn, radius, viewport, canvas, color, strokeWidth, dashed, selected, opacity, listening, }: AngleShapeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CanvasSize } from '../../coordinates/transform.js';
|
|
2
|
+
import { Point } from '../../geometry/point.js';
|
|
3
|
+
import { MathViewport } from '../../schemas/viewport.schema.js';
|
|
4
|
+
export interface AngleShapeProps {
|
|
5
|
+
id: string;
|
|
6
|
+
vertex: Point;
|
|
7
|
+
startTurn: number;
|
|
8
|
+
sweepTurn: number;
|
|
9
|
+
radius: number;
|
|
10
|
+
viewport: MathViewport;
|
|
11
|
+
canvas: CanvasSize;
|
|
12
|
+
color?: string;
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
dashed?: boolean;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
listening?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function AngleShape({ id, vertex, startTurn, sweepTurn, radius, viewport, canvas, color, strokeWidth, dashed, selected, opacity, listening, }: AngleShapeProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=AngleShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AngleShape.d.ts","sourceRoot":"","sources":["../../../src/renderer/shapes/AngleShape.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAYjE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,KAAK,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAgBD,wBAAgB,UAAU,CAAC,EACzB,EAAE,EACF,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAiB,EACjB,WAAe,EACf,MAAc,EACd,QAAgB,EAChB,OAAW,EACX,SAAgB,GACjB,EAAE,eAAe,+BA+CjB"}
|
|
@@ -4,6 +4,7 @@ import { Point } from '../../geometry/point.cjs';
|
|
|
4
4
|
import { MathViewport } from '../../schemas/viewport.schema.cjs';
|
|
5
5
|
export interface EntityLabelProps {
|
|
6
6
|
text: string;
|
|
7
|
+
measured?: boolean;
|
|
7
8
|
descriptor: ShapeDescriptor;
|
|
8
9
|
viewport: MathViewport;
|
|
9
10
|
canvas: CanvasSize;
|
|
@@ -11,4 +12,11 @@ export interface EntityLabelProps {
|
|
|
11
12
|
opacity?: number;
|
|
12
13
|
}
|
|
13
14
|
export declare function labelAnchorOf(descriptor: ShapeDescriptor, viewport: MathViewport): Point | null;
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Screen pixels an angle measure's text centre sits beyond its mark, along the bisector
|
|
17
|
+
* (M3.5.d, decision B). A mark on short arms sits close to its vertex,
|
|
18
|
+
* so text drawn at the mark covers the vertex point's own label; this carries
|
|
19
|
+
* it clear of that label on a phone-sized canvas and off the mark's stroke.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ANGLE_LABEL_GAP_PX = 40;
|
|
22
|
+
export declare function EntityLabel({ text, measured, descriptor, viewport, canvas, color, opacity, }: EntityLabelProps): import("react").JSX.Element | null;
|
|
@@ -4,6 +4,7 @@ import { Point } from '../../geometry/point.js';
|
|
|
4
4
|
import { MathViewport } from '../../schemas/viewport.schema.js';
|
|
5
5
|
export interface EntityLabelProps {
|
|
6
6
|
text: string;
|
|
7
|
+
measured?: boolean;
|
|
7
8
|
descriptor: ShapeDescriptor;
|
|
8
9
|
viewport: MathViewport;
|
|
9
10
|
canvas: CanvasSize;
|
|
@@ -11,5 +12,12 @@ export interface EntityLabelProps {
|
|
|
11
12
|
opacity?: number;
|
|
12
13
|
}
|
|
13
14
|
export declare function labelAnchorOf(descriptor: ShapeDescriptor, viewport: MathViewport): Point | null;
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Screen pixels an angle measure's text centre sits beyond its mark, along the bisector
|
|
17
|
+
* (M3.5.d, decision B). A mark on short arms sits close to its vertex,
|
|
18
|
+
* so text drawn at the mark covers the vertex point's own label; this carries
|
|
19
|
+
* it clear of that label on a phone-sized canvas and off the mark's stroke.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ANGLE_LABEL_GAP_PX = 40;
|
|
22
|
+
export declare function EntityLabel({ text, measured, descriptor, viewport, canvas, color, opacity, }: EntityLabelProps): import("react").JSX.Element | null;
|
|
15
23
|
//# sourceMappingURL=EntityLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityLabel.d.ts","sourceRoot":"","sources":["../../../src/renderer/shapes/EntityLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityLabel.d.ts","sourceRoot":"","sources":["../../../src/renderer/shapes/EntityLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAajE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IAEZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,eAAe,CAAA;IAC3B,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAiDD,wBAAgB,aAAa,CAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI,CAS/F;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAgB,EAChB,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAiB,EACjB,OAAW,GACZ,EAAE,gBAAgB,sCAyClB"}
|
|
@@ -14,5 +14,6 @@ export interface EntityShapeProps {
|
|
|
14
14
|
opacity?: number;
|
|
15
15
|
listening?: boolean;
|
|
16
16
|
label?: string;
|
|
17
|
+
measured?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export declare function EntityShape({ descriptor, label, ...styling }: EntityShapeProps): ReactElement | null;
|
|
19
|
+
export declare function EntityShape({ descriptor, label, measured, ...styling }: EntityShapeProps): ReactElement | null;
|
|
@@ -14,6 +14,7 @@ export interface EntityShapeProps {
|
|
|
14
14
|
opacity?: number;
|
|
15
15
|
listening?: boolean;
|
|
16
16
|
label?: string;
|
|
17
|
+
measured?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export declare function EntityShape({ descriptor, label, ...styling }: EntityShapeProps): ReactElement | null;
|
|
19
|
+
export declare function EntityShape({ descriptor, label, measured, ...styling }: EntityShapeProps): ReactElement | null;
|
|
19
20
|
//# sourceMappingURL=EntityShape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityShape.d.ts","sourceRoot":"","sources":["../../../src/renderer/shapes/EntityShape.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"EntityShape.d.ts","sourceRoot":"","sources":["../../../src/renderer/shapes/EntityShape.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAmBjE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,eAAe,CAAA;IAC3B,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IAKnB,KAAK,CAAC,EAAE,MAAM,CAAA;IAGd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAsCD,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,KAAK,EACL,QAAQ,EACR,GAAG,OAAO,EACX,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CA6BxC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CanvasSize } from '../coordinates/transform.cjs';
|
|
2
2
|
import { SceneEntity } from '../geometry/hitTest.cjs';
|
|
3
|
+
import { ShapeDescriptor } from '../geometry/entityModel.cjs';
|
|
3
4
|
import { Point, PointId } from '../geometry/point.cjs';
|
|
4
5
|
import { ConstructionEndpoint } from '../store/constructionCommand.cjs';
|
|
5
6
|
import { SnapResult } from '../snapping/computeSnap.cjs';
|
|
@@ -12,6 +13,7 @@ interface UseConnectionPreviewArgs {
|
|
|
12
13
|
canvas: CanvasSize;
|
|
13
14
|
pendingObjectType: ObjectTypeName | null;
|
|
14
15
|
pendingFirstPointId: PointId | null;
|
|
16
|
+
pendingVertexPointId?: PointId | null;
|
|
15
17
|
connect: (from: ConstructionEndpoint, to: ConstructionEndpoint) => void;
|
|
16
18
|
pick: (id: PointId) => void;
|
|
17
19
|
objects?: readonly SceneEntity[];
|
|
@@ -19,6 +21,14 @@ interface UseConnectionPreviewArgs {
|
|
|
19
21
|
canCreatePoints?: boolean;
|
|
20
22
|
preserveCreatedPointOrigins?: boolean;
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The mark an angle tool's third tap on `thirdId` would commit: the committed
|
|
26
|
+
* definition itself, resolved and described exactly as the canvas draws the
|
|
27
|
+
* angle once it exists, so the preview and the angle agree by construction.
|
|
28
|
+
* Only an existing point is ever previewed, because only an existing point can
|
|
29
|
+
* be tapped (ADR 0009 § Amendment). Carries no label, so never a measure.
|
|
30
|
+
*/
|
|
31
|
+
export declare function anglePreviewShape(points: ReadonlyMap<PointId, Point>, firstId: PointId, vertexId: PointId, thirdId: PointId): ShapeDescriptor | null;
|
|
22
32
|
/**
|
|
23
33
|
* The shared "tap two points, or drag from one to another" gesture behind
|
|
24
34
|
* building a segment or a line, used identically by the teacher and student
|
|
@@ -29,9 +39,10 @@ interface UseConnectionPreviewArgs {
|
|
|
29
39
|
* `press`, `drag`, `release` and `cancel`, already classified against the drag
|
|
30
40
|
* threshold (RFC 0004 § Decision 4).
|
|
31
41
|
*/
|
|
32
|
-
export declare function useConnectionPreview({ points, viewport, canvas, pendingObjectType, pendingFirstPointId, connect, pick, objects, isSnapTarget, canCreatePoints, preserveCreatedPointOrigins, }: UseConnectionPreviewArgs): {
|
|
42
|
+
export declare function useConnectionPreview({ points, viewport, canvas, pendingObjectType, pendingFirstPointId, pendingVertexPointId, connect, pick, objects, isSnapTarget, canCreatePoints, preserveCreatedPointOrigins, }: UseConnectionPreviewArgs): {
|
|
33
43
|
connecting: boolean;
|
|
34
44
|
previewPoints: number[] | null;
|
|
45
|
+
previewAngle: ShapeDescriptor | null;
|
|
35
46
|
snapTargetId: string | null;
|
|
36
47
|
snapPreview: SnapResult | null;
|
|
37
48
|
press: (pointer: ScreenPoint, pressedPointId: PointId | null) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CanvasSize } from '../coordinates/transform.js';
|
|
2
2
|
import { SceneEntity } from '../geometry/hitTest.js';
|
|
3
|
+
import { ShapeDescriptor } from '../geometry/entityModel.js';
|
|
3
4
|
import { Point, PointId } from '../geometry/point.js';
|
|
4
5
|
import { ConstructionEndpoint } from '../store/constructionCommand.js';
|
|
5
6
|
import { SnapResult } from '../snapping/computeSnap.js';
|
|
@@ -12,6 +13,7 @@ interface UseConnectionPreviewArgs {
|
|
|
12
13
|
canvas: CanvasSize;
|
|
13
14
|
pendingObjectType: ObjectTypeName | null;
|
|
14
15
|
pendingFirstPointId: PointId | null;
|
|
16
|
+
pendingVertexPointId?: PointId | null;
|
|
15
17
|
connect: (from: ConstructionEndpoint, to: ConstructionEndpoint) => void;
|
|
16
18
|
pick: (id: PointId) => void;
|
|
17
19
|
objects?: readonly SceneEntity[];
|
|
@@ -19,6 +21,14 @@ interface UseConnectionPreviewArgs {
|
|
|
19
21
|
canCreatePoints?: boolean;
|
|
20
22
|
preserveCreatedPointOrigins?: boolean;
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The mark an angle tool's third tap on `thirdId` would commit: the committed
|
|
26
|
+
* definition itself, resolved and described exactly as the canvas draws the
|
|
27
|
+
* angle once it exists, so the preview and the angle agree by construction.
|
|
28
|
+
* Only an existing point is ever previewed, because only an existing point can
|
|
29
|
+
* be tapped (ADR 0009 § Amendment). Carries no label, so never a measure.
|
|
30
|
+
*/
|
|
31
|
+
export declare function anglePreviewShape(points: ReadonlyMap<PointId, Point>, firstId: PointId, vertexId: PointId, thirdId: PointId): ShapeDescriptor | null;
|
|
22
32
|
/**
|
|
23
33
|
* The shared "tap two points, or drag from one to another" gesture behind
|
|
24
34
|
* building a segment or a line, used identically by the teacher and student
|
|
@@ -29,9 +39,10 @@ interface UseConnectionPreviewArgs {
|
|
|
29
39
|
* `press`, `drag`, `release` and `cancel`, already classified against the drag
|
|
30
40
|
* threshold (RFC 0004 § Decision 4).
|
|
31
41
|
*/
|
|
32
|
-
export declare function useConnectionPreview({ points, viewport, canvas, pendingObjectType, pendingFirstPointId, connect, pick, objects, isSnapTarget, canCreatePoints, preserveCreatedPointOrigins, }: UseConnectionPreviewArgs): {
|
|
42
|
+
export declare function useConnectionPreview({ points, viewport, canvas, pendingObjectType, pendingFirstPointId, pendingVertexPointId, connect, pick, objects, isSnapTarget, canCreatePoints, preserveCreatedPointOrigins, }: UseConnectionPreviewArgs): {
|
|
33
43
|
connecting: boolean;
|
|
34
44
|
previewPoints: number[] | null;
|
|
45
|
+
previewAngle: ShapeDescriptor | null;
|
|
35
46
|
snapTargetId: string | null;
|
|
36
47
|
snapPreview: SnapResult | null;
|
|
37
48
|
press: (pointer: ScreenPoint, pressedPointId: PointId | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectionPreview.d.ts","sourceRoot":"","sources":["../../src/renderer/useConnectionPreview.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAA;AAEjC,OA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AAe,CAAC,EAAE,OAAO,CAAA;IAKzB,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC;AAgCD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,EACnC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,OAAO,GACf,eAAe,GAAG,IAAI,CAMxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,mBAAmB,EACnB,oBAA2B,EAC3B,OAAO,EACP,IAAI,EACJ,OAAY,EACZ,YAAY,EACZ,eAAuB,EACvB,2BAAkC,GACnC,EAAE,wBAAwB;;;;;;qBAoFD,WAAW,kBAAkB,OAAO,GAAG,IAAI,KAAG,IAAI;oBA0DnD,WAAW,KAAG,IAAI;qBAUjB,WAAW,GAAG,IAAI,KAAG,IAAI;uBAsDtC,WAAW,qBACD,OAAO,GAAG,IAAI,YACvB,OAAO,KAChB,OAAO;kBA0CS,IAAI;EAsBxB;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -18,7 +18,7 @@ export interface PointerGestureHandlers {
|
|
|
18
18
|
};
|
|
19
19
|
pointOnScreen(id: PointId): ScreenPoint | null;
|
|
20
20
|
canDragPoint(id: PointId): boolean;
|
|
21
|
-
dragPoint(id: PointId, to: ScreenPoint): void;
|
|
21
|
+
dragPoint(id: PointId, to: ScreenPoint, from: ScreenPoint): void;
|
|
22
22
|
endPointDrag(id: PointId): void;
|
|
23
23
|
tapPoint(id: PointId): void;
|
|
24
24
|
tapObject(id: string): void;
|
|
@@ -18,7 +18,7 @@ export interface PointerGestureHandlers {
|
|
|
18
18
|
};
|
|
19
19
|
pointOnScreen(id: PointId): ScreenPoint | null;
|
|
20
20
|
canDragPoint(id: PointId): boolean;
|
|
21
|
-
dragPoint(id: PointId, to: ScreenPoint): void;
|
|
21
|
+
dragPoint(id: PointId, to: ScreenPoint, from: ScreenPoint): void;
|
|
22
22
|
endPointDrag(id: PointId): void;
|
|
23
23
|
tapPoint(id: PointId): void;
|
|
24
24
|
tapObject(id: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePointerGestures.d.ts","sourceRoot":"","sources":["../../src/renderer/usePointerGestures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,KAAK,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"usePointerGestures.d.ts","sourceRoot":"","sources":["../../src/renderer/usePointerGestures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,E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AAU,EACjB,QAAQ,EAAE,sBAAsB,GAC/B,IAAI,CAmWN"}
|
|
@@ -43,6 +43,10 @@ export declare const circleDefinitionSchema: z.ZodObject<{
|
|
|
43
43
|
kind: z.ZodLiteral<"circle">;
|
|
44
44
|
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
45
45
|
}, z.core.$strict>;
|
|
46
|
+
export declare const angleDefinitionSchema: z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"angle">;
|
|
48
|
+
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
46
50
|
export declare const entityDefinitionSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
47
51
|
kind: z.ZodLiteral<"point">;
|
|
48
52
|
at: z.ZodObject<{
|
|
@@ -66,4 +70,7 @@ export declare const entityDefinitionSchema: z.ZodUnion<readonly [z.ZodUnion<rea
|
|
|
66
70
|
}, z.core.$strict>, z.ZodObject<{
|
|
67
71
|
kind: z.ZodLiteral<"circle">;
|
|
68
72
|
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
73
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"angle">;
|
|
75
|
+
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
|
|
69
76
|
}, z.core.$strict>]>;
|
|
@@ -43,6 +43,10 @@ export declare const circleDefinitionSchema: z.ZodObject<{
|
|
|
43
43
|
kind: z.ZodLiteral<"circle">;
|
|
44
44
|
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
45
45
|
}, z.core.$strict>;
|
|
46
|
+
export declare const angleDefinitionSchema: z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"angle">;
|
|
48
|
+
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
46
50
|
export declare const entityDefinitionSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
47
51
|
kind: z.ZodLiteral<"point">;
|
|
48
52
|
at: z.ZodObject<{
|
|
@@ -66,5 +70,8 @@ export declare const entityDefinitionSchema: z.ZodUnion<readonly [z.ZodUnion<rea
|
|
|
66
70
|
}, z.core.$strict>, z.ZodObject<{
|
|
67
71
|
kind: z.ZodLiteral<"circle">;
|
|
68
72
|
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
73
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"angle">;
|
|
75
|
+
parents: z.ZodReadonly<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
|
|
69
76
|
}, z.core.$strict>]>;
|
|
70
77
|
//# sourceMappingURL=entityDefinition.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityDefinition.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/entityDefinition.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqBvB,eAAO,MAAM,yBAAyB;;;;;;kBAK3B,CAAA;AAMX,eAAO,MAAM,6BAA6B;;;;kBAM/B,CAAA;AAKX,eAAO,MAAM,iCAAiC;;;;kBAMnC,CAAA;AAMX,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;oBAIhC,CAAA;
|
|
1
|
+
{"version":3,"file":"entityDefinition.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/entityDefinition.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqBvB,eAAO,MAAM,yBAAyB;;;;;;kBAK3B,CAAA;AAMX,eAAO,MAAM,6BAA6B;;;;kBAM/B,CAAA;AAKX,eAAO,MAAM,iCAAiC;;;;kBAMnC,CAAA;AAMX,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;oBAIhC,CAAA;AAeF,eAAO,MAAM,uBAAuB;;;kBAEzB,CAAA;AAEX,eAAO,MAAM,oBAAoB;;;kBAEtB,CAAA;AAIX,eAAO,MAAM,sBAAsB;;;kBAExB,CAAA;AAKX,eAAO,MAAM,qBAAqB;;;kBAEvB,CAAA;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;oBAMuB,CAAA"}
|
|
@@ -63,23 +63,44 @@ export declare function entityDocumentIssues(document: EntityDocumentShape, rule
|
|
|
63
63
|
* attempt declares is exactly the case that violates it.
|
|
64
64
|
*/
|
|
65
65
|
export declare function crossDocumentParentIssues(attempt: EntityDocumentShape, given: Record<EntityId, EntityDefinition>): EntityDocumentIssue[];
|
|
66
|
+
/** The two exercise fields the override invariant reads (ADR 0016). */
|
|
67
|
+
export interface GivenAuthority {
|
|
68
|
+
entities: Record<EntityId, EntityDefinition>;
|
|
69
|
+
draggableEntityIds: readonly EntityId[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether the student may drag this given (ADR 0016, RFC 0006): listed in
|
|
73
|
+
* `draggableEntityIds` **and** a free or `on` point. An intersection may be
|
|
74
|
+
* listed — the schema checks only that the id names a point — but it sits
|
|
75
|
+
* where its parents put it, so no drag moves it.
|
|
76
|
+
*
|
|
77
|
+
* One predicate for the goal rule, the re-declaration classes below, the
|
|
78
|
+
* context and the student store, so none of them can disagree about which
|
|
79
|
+
* givens an attempt has authority over.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isStudentDraggableGiven(exercise: GivenAuthority, id: EntityId): boolean;
|
|
66
82
|
/**
|
|
67
|
-
*
|
|
68
|
-
* a
|
|
83
|
+
* What an id both documents declare means (ADR 0016 § The invariant). An
|
|
84
|
+
* attempt may override only the *position* of a point the student may drag;
|
|
85
|
+
* it never redefines a given's dependencies.
|
|
69
86
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* `
|
|
87
|
+
* - `ignored` — a given point the student may not drag, re-declared as any
|
|
88
|
+
* point: unused, and dropped in silence on load, because every migrated v1
|
|
89
|
+
* attempt carries such re-declarations (ADR 0008 § Amendment);
|
|
90
|
+
* - `override` — a student-draggable given in its own origin form: free stays
|
|
91
|
+
* free, and `on H` stays on the same `H` with only `t` changed, within
|
|
92
|
+
* `[0, 1]` on a segment. The attempt's position wins;
|
|
93
|
+
* - `collision` — every other pair: a draggable given re-parented or given
|
|
94
|
+
* another form, or any pair that is not point and point. The loader refuses
|
|
95
|
+
* it and the context reports `duplicate-id`.
|
|
74
96
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* every migrated v1 attempt arrives (ADR 0008 § Amendment). Every other pair
|
|
78
|
-
* is one document claiming an id the other already gave a different meaning.
|
|
97
|
+
* An override has exactly the exercise's parents, and the exercise is acyclic,
|
|
98
|
+
* so no loadable attempt can close a dependency cycle through a given.
|
|
79
99
|
*/
|
|
80
|
-
export
|
|
100
|
+
export type GivenRedeclaration = 'ignored' | 'override' | 'collision';
|
|
101
|
+
export declare function classifyGivenRedeclaration(exercise: GivenAuthority, id: EntityId, given: EntityDefinition, declared: EntityDefinition): GivenRedeclaration;
|
|
81
102
|
/**
|
|
82
|
-
* The collisions of `
|
|
103
|
+
* The collisions of `classifyGivenRedeclaration()`, as load errors.
|
|
83
104
|
*
|
|
84
105
|
* The context reports these as `duplicate-id` issues and then resolves the id
|
|
85
106
|
* to the *exercise's* declaration, so an attempt declaring segment `A` over
|
|
@@ -88,7 +109,7 @@ export declare function isCrossDocumentIdCollision(given: EntityDefinition, decl
|
|
|
88
109
|
* downstream has to decide what a contested id means, because it never gets
|
|
89
110
|
* one.
|
|
90
111
|
*/
|
|
91
|
-
export declare function crossDocumentIdCollisionIssues(attempt: EntityDocumentShape,
|
|
112
|
+
export declare function crossDocumentIdCollisionIssues(attempt: EntityDocumentShape, exercise: GivenAuthority): EntityDocumentIssue[];
|
|
92
113
|
/** `answerEntityIds` and `draggableEntityIds` are the same list rule twice. */
|
|
93
114
|
export declare function entityIdListIssues(ids: readonly EntityId[], field: string, document: EntityDocumentShape, options?: {
|
|
94
115
|
pointsOnly?: boolean;
|
|
@@ -63,23 +63,44 @@ export declare function entityDocumentIssues(document: EntityDocumentShape, rule
|
|
|
63
63
|
* attempt declares is exactly the case that violates it.
|
|
64
64
|
*/
|
|
65
65
|
export declare function crossDocumentParentIssues(attempt: EntityDocumentShape, given: Record<EntityId, EntityDefinition>): EntityDocumentIssue[];
|
|
66
|
+
/** The two exercise fields the override invariant reads (ADR 0016). */
|
|
67
|
+
export interface GivenAuthority {
|
|
68
|
+
entities: Record<EntityId, EntityDefinition>;
|
|
69
|
+
draggableEntityIds: readonly EntityId[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether the student may drag this given (ADR 0016, RFC 0006): listed in
|
|
73
|
+
* `draggableEntityIds` **and** a free or `on` point. An intersection may be
|
|
74
|
+
* listed — the schema checks only that the id names a point — but it sits
|
|
75
|
+
* where its parents put it, so no drag moves it.
|
|
76
|
+
*
|
|
77
|
+
* One predicate for the goal rule, the re-declaration classes below, the
|
|
78
|
+
* context and the student store, so none of them can disagree about which
|
|
79
|
+
* givens an attempt has authority over.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isStudentDraggableGiven(exercise: GivenAuthority, id: EntityId): boolean;
|
|
66
82
|
/**
|
|
67
|
-
*
|
|
68
|
-
* a
|
|
83
|
+
* What an id both documents declare means (ADR 0016 § The invariant). An
|
|
84
|
+
* attempt may override only the *position* of a point the student may drag;
|
|
85
|
+
* it never redefines a given's dependencies.
|
|
69
86
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* `
|
|
87
|
+
* - `ignored` — a given point the student may not drag, re-declared as any
|
|
88
|
+
* point: unused, and dropped in silence on load, because every migrated v1
|
|
89
|
+
* attempt carries such re-declarations (ADR 0008 § Amendment);
|
|
90
|
+
* - `override` — a student-draggable given in its own origin form: free stays
|
|
91
|
+
* free, and `on H` stays on the same `H` with only `t` changed, within
|
|
92
|
+
* `[0, 1]` on a segment. The attempt's position wins;
|
|
93
|
+
* - `collision` — every other pair: a draggable given re-parented or given
|
|
94
|
+
* another form, or any pair that is not point and point. The loader refuses
|
|
95
|
+
* it and the context reports `duplicate-id`.
|
|
74
96
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* every migrated v1 attempt arrives (ADR 0008 § Amendment). Every other pair
|
|
78
|
-
* is one document claiming an id the other already gave a different meaning.
|
|
97
|
+
* An override has exactly the exercise's parents, and the exercise is acyclic,
|
|
98
|
+
* so no loadable attempt can close a dependency cycle through a given.
|
|
79
99
|
*/
|
|
80
|
-
export
|
|
100
|
+
export type GivenRedeclaration = 'ignored' | 'override' | 'collision';
|
|
101
|
+
export declare function classifyGivenRedeclaration(exercise: GivenAuthority, id: EntityId, given: EntityDefinition, declared: EntityDefinition): GivenRedeclaration;
|
|
81
102
|
/**
|
|
82
|
-
* The collisions of `
|
|
103
|
+
* The collisions of `classifyGivenRedeclaration()`, as load errors.
|
|
83
104
|
*
|
|
84
105
|
* The context reports these as `duplicate-id` issues and then resolves the id
|
|
85
106
|
* to the *exercise's* declaration, so an attempt declaring segment `A` over
|
|
@@ -88,7 +109,7 @@ export declare function isCrossDocumentIdCollision(given: EntityDefinition, decl
|
|
|
88
109
|
* downstream has to decide what a contested id means, because it never gets
|
|
89
110
|
* one.
|
|
90
111
|
*/
|
|
91
|
-
export declare function crossDocumentIdCollisionIssues(attempt: EntityDocumentShape,
|
|
112
|
+
export declare function crossDocumentIdCollisionIssues(attempt: EntityDocumentShape, exercise: GivenAuthority): EntityDocumentIssue[];
|
|
92
113
|
/** `answerEntityIds` and `draggableEntityIds` are the same list rule twice. */
|
|
93
114
|
export declare function entityIdListIssues(ids: readonly EntityId[], field: string, document: EntityDocumentShape, options?: {
|
|
94
115
|
pointsOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityDocument.d.ts","sourceRoot":"","sources":["../../src/schemas/entityDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAqB7F;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,CAAC,CAAC,OAAO,EACxD,KAAK,EAAE,KAAK,GACX,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAmBvD;AAED,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAA;IAC5C,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;CACnD;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;OAQG;IACH,qBAAqB,EAAE,OAAO,CAAA;CAC/B;
|
|
1
|
+
{"version":3,"file":"entityDocument.d.ts","sourceRoot":"","sources":["../../src/schemas/entityDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAqB7F;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,CAAC,CAAC,OAAO,EACxD,KAAK,E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Ac,EACxB,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,gBAAgB,GACzB,kBAAkB,CAUpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,cAAc,GACvB,mBAAmB,EAAE,CAevB;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,QAAQ,EAAE,EACxB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,mBAAmB,EAAE,CAevB"}
|
|
@@ -9,5 +9,8 @@ export declare const entityPresentationSchema: z.ZodObject<{
|
|
|
9
9
|
explicit: "explicit";
|
|
10
10
|
}>;
|
|
11
11
|
label: z.ZodOptional<z.ZodString>;
|
|
12
|
+
measureLabel: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
degrees: "degrees";
|
|
14
|
+
}>>;
|
|
12
15
|
}, z.core.$strict>;
|
|
13
16
|
//# sourceMappingURL=entityPresentation.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityPresentation.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/entityPresentation.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,gBAAgB;;;EAAmC,CAAA;AAMhE,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"entityPresentation.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/entityPresentation.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,gBAAgB;;;EAAmC,CAAA;AAMhE,eAAO,MAAM,wBAAwB;;;;;;;;;kBAWkC,CAAA"}
|