@@ -2,6 +2,20 @@ import type { BehaviorContext, Selection } from '../editing-session'
22import { describe , expect , it , vi } from 'vitest'
33import { selectionMiddleware } from './selection'
44
5+ const geometry : BehaviorContext [ 'geometry' ] = {
6+ getPageGeometry : ( ) => ( {
7+ pageOffset : { x : 0 , y : 0 } ,
8+ zoom : 1 ,
9+ scroll : { x : 0 , y : 0 } ,
10+ documentUnit : 'px' ,
11+ } ) ,
12+ screenToDocument : point => point ,
13+ documentToScreen : point => point ,
14+ documentToLocal : point => point ,
15+ localToDocument : point => point ,
16+ getSelectionRects : ( ) => [ ] ,
17+ }
18+
519function createContext ( hit : Selection | null ) : BehaviorContext {
620 let currentSelection : Selection | null = {
721 type : 'table.cell' ,
@@ -31,9 +45,7 @@ function createContext(hit: Selection | null): BehaviorContext {
3145 hitTest : ( ) => hit ,
3246 } ,
3347 tx : { } as BehaviorContext [ 'tx' ] ,
34- geometry : {
35- documentToLocal : point => point ,
36- } as BehaviorContext [ 'geometry' ] ,
48+ geometry,
3749 selectionStore : {
3850 get selection ( ) {
3951 return currentSelection
0 commit comments