oasis-editor 0.0.185 → 0.0.187

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.
Files changed (29) hide show
  1. package/dist/{OasisEditorApp-WP25r3Sz.js → OasisEditorApp-c25tbt9o.js} +423 -159
  2. package/dist/app/controllers/createCropSession.d.ts +2 -2
  3. package/dist/app/controllers/createResizeSession.d.ts +1 -1
  4. package/dist/app/controllers/createRotateSession.d.ts +1 -1
  5. package/dist/app/controllers/pointerGesture.d.ts +17 -0
  6. package/dist/app/controllers/tableResize/tableResizeTypes.d.ts +2 -2
  7. package/dist/app/controllers/useEditorImageOperations.d.ts +6 -6
  8. package/dist/app/controllers/useEditorSurfaceEvents.d.ts +7 -5
  9. package/dist/app/controllers/useEditorTableCornerResize.d.ts +1 -1
  10. package/dist/app/controllers/useEditorTableDrag.d.ts +2 -2
  11. package/dist/app/controllers/useEditorTextBoxOperations.d.ts +2 -2
  12. package/dist/app/controllers/useEditorTextDrag.d.ts +1 -1
  13. package/dist/app/controllers/useEditorTextInput.d.ts +3 -0
  14. package/dist/core/commands/text.d.ts +1 -1
  15. package/dist/core/commands/textDeletion.d.ts +9 -0
  16. package/dist/core/transactionMergeKeys.d.ts +1 -0
  17. package/dist/{index-CdeBKnqS.js → index-sfDgngZ-.js} +99 -65
  18. package/dist/oasis-editor.css +1 -1
  19. package/dist/oasis-editor.js +1 -1
  20. package/dist/oasis-editor.umd.cjs +2 -2
  21. package/dist/ui/OasisEditorEditorProps.d.ts +16 -13
  22. package/dist/ui/app/buildEditorViewProps.d.ts +8 -8
  23. package/dist/ui/app/createEditorInteractionRuntime.d.ts +18 -13
  24. package/dist/ui/app/useEditorFocus.d.ts +1 -0
  25. package/dist/ui/app/useEditorInteractionWiring.d.ts +1 -0
  26. package/dist/ui/editorUiTypes.d.ts +8 -8
  27. package/dist/ui/overlays/ResizeHandlesOverlay.d.ts +3 -3
  28. package/dist/ui/overlays/TableHandlesOverlay.d.ts +2 -2
  29. package/package.json +2 -1
@@ -48,37 +48,37 @@ export interface OasisEditorEditorRefProps {
48
48
  export interface OasisEditorEditorSurfaceHandlers {
49
49
  onDragOver: (event: DragEvent) => void;
50
50
  onDrop: (event: DragEvent) => void;
51
- onEditorMouseDown: (event: MouseEvent) => void;
52
- onSurfaceMouseDown: (event: MouseEvent) => void;
51
+ onEditorPointerDown: (event: PointerEvent) => void;
52
+ onSurfacePointerDown: (event: PointerEvent) => void;
53
53
  onSurfaceClick?: (event: MouseEvent) => void;
54
- onSurfaceMouseMove?: (event: MouseEvent) => void;
54
+ onSurfacePointerMove?: (event: PointerEvent) => void;
55
55
  onSurfaceDblClick: (event: MouseEvent) => void;
56
- onParagraphMouseDown: (paragraphId: string, event: MouseEvent & {
56
+ onParagraphPointerDown: (paragraphId: string, event: PointerEvent & {
57
57
  currentTarget: HTMLParagraphElement;
58
58
  }) => void;
59
- onImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
59
+ onImagePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
60
60
  currentTarget: HTMLElement;
61
61
  }) => void;
62
- onImageResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
62
+ onImageResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
63
63
  currentTarget: HTMLElement;
64
64
  }) => void;
65
- onTextBoxResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
65
+ onTextBoxResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
66
66
  currentTarget: HTMLElement;
67
67
  }) => void;
68
- onImageRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
68
+ onImageRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
69
69
  currentTarget: HTMLElement;
70
70
  }) => void;
71
- onImageCropHandleMouseDown?: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
71
+ onImageCropHandlePointerDown?: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
72
72
  currentTarget: HTMLElement;
73
73
  }) => void;
74
- onImageCropBodyMouseDown?: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
74
+ onImageCropBodyPointerDown?: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
75
75
  currentTarget: HTMLElement;
76
76
  }) => void;
77
- onTextBoxRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
77
+ onTextBoxRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
78
78
  currentTarget: HTMLElement;
79
79
  }) => void;
80
- onTableDragHandleMouseDown: (tableId: string, event: MouseEvent) => void;
81
- onTableCornerResizeHandleMouseDown: (tableId: string, event: MouseEvent) => void;
80
+ onTableDragHandlePointerDown: (tableId: string, event: PointerEvent) => void;
81
+ onTableCornerResizeHandlePointerDown: (tableId: string, event: PointerEvent) => void;
82
82
  onRevisionMouseEnter: (revisionId: string, event: MouseEvent) => void;
83
83
  onRevisionMouseLeave?: (revisionId: string, event: MouseEvent) => void;
84
84
  onEditorContextMenu?: (event: MouseEvent) => void;
@@ -90,6 +90,9 @@ export interface OasisEditorEditorInputHandlers {
90
90
  currentTarget: HTMLTextAreaElement;
91
91
  }) => void;
92
92
  onCompositionStart: () => void;
93
+ onCompositionUpdate: (event: CompositionEvent & {
94
+ currentTarget: HTMLTextAreaElement;
95
+ }) => void;
93
96
  onCopy: (event: ClipboardEvent & {
94
97
  currentTarget: HTMLTextAreaElement;
95
98
  }) => void;
@@ -55,14 +55,14 @@ export interface EditorViewSurfaceInput {
55
55
  tableDrag: ReturnType<typeof createEditorTableDrag>;
56
56
  revisionController: ReturnType<typeof createEditorRevisionController>;
57
57
  handleDrop: OasisEditorEditorSurfaceHandlers["onDrop"];
58
- onEditorMouseDown: OasisEditorEditorSurfaceHandlers["onEditorMouseDown"];
59
- handleImageMouseDown: OasisEditorEditorSurfaceHandlers["onImageMouseDown"];
60
- handleImageResizeHandleMouseDown: OasisEditorEditorSurfaceHandlers["onImageResizeHandleMouseDown"];
61
- handleTextBoxResizeHandleMouseDown: OasisEditorEditorSurfaceHandlers["onTextBoxResizeHandleMouseDown"];
62
- handleImageRotateHandleMouseDown: OasisEditorEditorSurfaceHandlers["onImageRotateHandleMouseDown"];
63
- handleImageCropHandleMouseDown: NonNullable<OasisEditorEditorSurfaceHandlers["onImageCropHandleMouseDown"]>;
64
- handleImageCropBodyMouseDown: NonNullable<OasisEditorEditorSurfaceHandlers["onImageCropBodyMouseDown"]>;
65
- handleTextBoxRotateHandleMouseDown: OasisEditorEditorSurfaceHandlers["onTextBoxRotateHandleMouseDown"];
58
+ onEditorPointerDown: OasisEditorEditorSurfaceHandlers["onEditorPointerDown"];
59
+ handleImagePointerDown: OasisEditorEditorSurfaceHandlers["onImagePointerDown"];
60
+ handleImageResizeHandlePointerDown: OasisEditorEditorSurfaceHandlers["onImageResizeHandlePointerDown"];
61
+ handleTextBoxResizeHandlePointerDown: OasisEditorEditorSurfaceHandlers["onTextBoxResizeHandlePointerDown"];
62
+ handleImageRotateHandlePointerDown: OasisEditorEditorSurfaceHandlers["onImageRotateHandlePointerDown"];
63
+ handleImageCropHandlePointerDown: NonNullable<OasisEditorEditorSurfaceHandlers["onImageCropHandlePointerDown"]>;
64
+ handleImageCropBodyPointerDown: NonNullable<OasisEditorEditorSurfaceHandlers["onImageCropBodyPointerDown"]>;
65
+ handleTextBoxRotateHandlePointerDown: OasisEditorEditorSurfaceHandlers["onTextBoxRotateHandlePointerDown"];
66
66
  handleEditorContextMenu: (event: MouseEvent) => void;
67
67
  }
68
68
  /** Text-input / clipboard / keyboard handlers for the input bundle. */
@@ -14,6 +14,8 @@ export interface EditorInteractionRuntimeDeps {
14
14
  cloneState: (state: EditorState) => EditorState;
15
15
  focusInput: () => void;
16
16
  focusInputAfterPointerSelection: () => void;
17
+ /** Synchronous focus, required for touch to raise the on-screen keyboard. */
18
+ focusInputSync: () => void;
17
19
  surfaceRef: () => HTMLDivElement | undefined;
18
20
  viewportRef: () => HTMLDivElement | undefined;
19
21
  zoomFactor: () => number;
@@ -107,32 +109,32 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
107
109
  height: number;
108
110
  src: string;
109
111
  } | null;
110
- startImageDrag: (paragraphId: string, paragraphOffset: number, event: MouseEvent, pointerBounds?: import('../../app/controllers/useEditorImageOperations.js').ImagePointerBounds) => void;
112
+ startImageDrag: (paragraphId: string, paragraphOffset: number, event: PointerEvent, pointerBounds?: import('../../app/controllers/useEditorImageOperations.js').ImagePointerBounds) => void;
111
113
  stopImageDrag: () => void;
112
114
  stopImageResize: () => void;
113
115
  stopImageRotate: () => void;
114
116
  stopImageCrop: () => void;
115
- handleImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
117
+ handleImagePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
116
118
  currentTarget: HTMLElement;
117
119
  }) => void;
118
- handleImageResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: import('../resizeGeometry.js').ResizeHandleDirection, event: MouseEvent & {
120
+ handleImageResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: import('../resizeGeometry.js').ResizeHandleDirection, event: PointerEvent & {
119
121
  currentTarget: HTMLElement;
120
122
  }) => void;
121
- handleImageRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
123
+ handleImageRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
122
124
  currentTarget: HTMLElement;
123
125
  }) => void;
124
- handleImageCropHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: import('../resizeGeometry.js').ResizeHandleDirection, event: MouseEvent & {
126
+ handleImageCropHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: import('../resizeGeometry.js').ResizeHandleDirection, event: PointerEvent & {
125
127
  currentTarget: HTMLElement;
126
128
  }) => void;
127
- handleImageCropBodyMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
129
+ handleImageCropBodyPointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
128
130
  currentTarget: HTMLElement;
129
131
  }) => void;
130
132
  };
131
133
  textBoxOps: {
132
- handleTextBoxResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: import('../resizeGeometry.js').ResizeHandleDirection, event: MouseEvent & {
134
+ handleTextBoxResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: import('../resizeGeometry.js').ResizeHandleDirection, event: PointerEvent & {
133
135
  currentTarget: HTMLElement;
134
136
  }) => void;
135
- handleTextBoxRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
137
+ handleTextBoxRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
136
138
  currentTarget: HTMLElement;
137
139
  }) => void;
138
140
  stopTextBoxResize: () => void;
@@ -145,7 +147,7 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
145
147
  applyToolbarValueStyleCommand: <K extends "link" | "styleId" | "underlineStyle" | "textEffect" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
146
148
  applyToolbarBooleanStyleCommand: (key: import('../toolbarStyleState.js').BooleanStyleKey) => void;
147
149
  };
148
- onEditorMouseDown: (event: MouseEvent) => void;
150
+ onEditorPointerDown: (event: PointerEvent) => void;
149
151
  tableResize: import('../../app/controllers/useEditorTableResize.js').TableResizeOps;
150
152
  tableCornerResize: import('../../app/controllers/useEditorTableCornerResize.js').TableCornerResizeOps;
151
153
  tableDrag: {
@@ -162,7 +164,7 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
162
164
  y: number;
163
165
  }>;
164
166
  dropTargetPos: import('solid-js').Accessor<EditorPosition | null>;
165
- handleMouseDown: (tableId: string, event: MouseEvent) => void;
167
+ handlePointerDown: (tableId: string, event: PointerEvent) => void;
166
168
  stop: () => void;
167
169
  };
168
170
  revisionController: {
@@ -183,14 +185,14 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
183
185
  top: number;
184
186
  height: number;
185
187
  } | null>;
186
- tryStartTextDrag: (event: MouseEvent, hit: import('../canvas/CanvasHitTestService.js').SurfaceHit | null) => boolean;
188
+ tryStartTextDrag: (event: PointerEvent, hit: import('../canvas/CanvasHitTestService.js').SurfaceHit | null) => boolean;
187
189
  stopDrag: () => void;
188
190
  };
189
191
  surfaceEventsWithTextDrag: {
190
- handleSurfaceMouseDown: (event: MouseEvent) => void;
192
+ handleSurfacePointerDown: (event: PointerEvent) => void;
191
193
  handleSurfaceClick: (event: MouseEvent) => void;
192
194
  handleSurfaceDblClick: (event: MouseEvent) => void;
193
- handleParagraphMouseDown: (_paragraphId: string, event: MouseEvent & {
195
+ handleParagraphPointerDown: (_paragraphId: string, event: PointerEvent & {
194
196
  currentTarget: HTMLParagraphElement;
195
197
  }) => void;
196
198
  stopDragging: () => void;
@@ -200,6 +202,9 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
200
202
  currentTarget: HTMLTextAreaElement;
201
203
  }) => void;
202
204
  handleCompositionStart: () => void;
205
+ handleCompositionUpdate: (event: CompositionEvent & {
206
+ currentTarget: HTMLTextAreaElement;
207
+ }) => void;
203
208
  handleCompositionEnd: (event: CompositionEvent & {
204
209
  currentTarget: HTMLTextAreaElement;
205
210
  }) => void;
@@ -5,6 +5,7 @@ export interface EditorFocusController {
5
5
  setFocused: Setter<boolean>;
6
6
  focusInput: () => void;
7
7
  focusInputAfterPointerSelection: () => void;
8
+ focusInputSync: () => void;
8
9
  viewportRef: HTMLDivElement | undefined;
9
10
  surfaceRef: HTMLDivElement | undefined;
10
11
  textareaRef: HTMLTextAreaElement | undefined;
@@ -32,6 +32,7 @@ export interface EditorInteractionWiringContext {
32
32
  logger: EditorLogger;
33
33
  focusInput: TableDragParams["focusInput"];
34
34
  focusInputAfterPointerSelection: TextDragParams["focusInputAfterPointerSelection"];
35
+ focusInputSync: () => void;
35
36
  clearPreferredColumn: TextDragParams["clearPreferredColumn"];
36
37
  resetTransactionGrouping: TextDragParams["resetTransactionGrouping"];
37
38
  surfaceRef: () => HTMLDivElement | undefined;
@@ -92,24 +92,24 @@ export interface EditorSurfaceProps {
92
92
  * pages render in full (legacy behaviour).
93
93
  */
94
94
  viewportRef?: () => HTMLElement | undefined;
95
- onSurfaceMouseDown: (event: MouseEvent) => void;
95
+ onSurfacePointerDown: (event: PointerEvent) => void;
96
96
  onSurfaceClick?: (event: MouseEvent) => void;
97
- onSurfaceMouseMove?: (event: MouseEvent) => void;
97
+ onSurfacePointerMove?: (event: PointerEvent) => void;
98
98
  onSurfaceDblClick: (event: MouseEvent) => void;
99
- onParagraphMouseDown: (paragraphId: string, event: MouseEvent & {
99
+ onParagraphPointerDown: (paragraphId: string, event: PointerEvent & {
100
100
  currentTarget: HTMLParagraphElement;
101
101
  }) => void;
102
- onImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
102
+ onImagePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
103
103
  currentTarget: HTMLElement;
104
104
  }) => void;
105
- onImageResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
105
+ onImageResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
106
106
  currentTarget: HTMLElement;
107
107
  }) => void;
108
- onTextBoxResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
108
+ onTextBoxResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
109
109
  currentTarget: HTMLElement;
110
110
  }) => void;
111
- onTableDragHandleMouseDown: (tableId: string, event: MouseEvent) => void;
112
- onTableCornerResizeHandleMouseDown: (tableId: string, event: MouseEvent) => void;
111
+ onTableDragHandlePointerDown: (tableId: string, event: PointerEvent) => void;
112
+ onTableCornerResizeHandlePointerDown: (tableId: string, event: PointerEvent) => void;
113
113
  onRevisionMouseEnter: (revisionId: string, event: MouseEvent) => void;
114
114
  onRevisionMouseLeave?: (revisionId: string, event: MouseEvent) => void;
115
115
  }
@@ -15,15 +15,15 @@ export interface ResizeHandlesOverlayProps {
15
15
  variantClass: string;
16
16
  /** Current rotation in degrees, applied as a CSS transform on the overlay. */
17
17
  rotation?: () => number;
18
- onResizeStart: (direction: ResizeHandleDirection, event: MouseEvent & {
18
+ onResizeStart: (direction: ResizeHandleDirection, event: PointerEvent & {
19
19
  currentTarget: HTMLElement;
20
20
  }) => void;
21
21
  /** Optional handler for pressing the overlay body (e.g. image drag-to-move). */
22
- onBodyMouseDown?: (event: MouseEvent & {
22
+ onBodyMouseDown?: (event: PointerEvent & {
23
23
  currentTarget: HTMLElement;
24
24
  }) => void;
25
25
  /** Optional handler for pressing the rotation knob. */
26
- onRotateStart?: (event: MouseEvent & {
26
+ onRotateStart?: (event: PointerEvent & {
27
27
  currentTarget: HTMLElement;
28
28
  }) => void;
29
29
  }
@@ -6,11 +6,11 @@ export interface TableHandlesOverlayProps {
6
6
  box: () => SelectedTableBox | null;
7
7
  readOnly: boolean;
8
8
  /** Press on the top-left move handle (drag/reorder the whole table). */
9
- onMoveStart: (event: MouseEvent & {
9
+ onMoveStart: (event: PointerEvent & {
10
10
  currentTarget: HTMLElement;
11
11
  }) => void;
12
12
  /** Press on the bottom-right corner handle (proportional resize). */
13
- onResizeStart: (event: MouseEvent & {
13
+ onResizeStart: (event: PointerEvent & {
14
14
  currentTarget: HTMLElement;
15
15
  }) => void;
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.185",
3
+ "version": "0.0.187",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -55,6 +55,7 @@
55
55
  "preview": "vite preview",
56
56
  "test:perf": "playwright test",
57
57
  "test:smoke": "playwright test --config playwright.smoke.config.ts",
58
+ "test:e2e": "playwright test --config playwright.e2e.config.ts",
58
59
  "wasm:build": "wasm-pack build ./rust-core --target web --out-dir ../public/wasm",
59
60
  "dev:rust": "npm run wasm:build && vite",
60
61
  "build:all": "npm run wasm:build && npm run build",