oasis-editor 0.0.186 → 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.
@@ -21,7 +21,7 @@ export interface CropSessionDeps {
21
21
  * stack on release.
22
22
  */
23
23
  export declare function createCropSession(deps: CropSessionDeps): {
24
- start: (paragraphId: string, paragraphOffset: number, handleDirection: ResizeHandleDirection, event: MouseEvent, initialState: EditorState) => void;
25
- startMove: (paragraphId: string, paragraphOffset: number, event: MouseEvent, initialState: EditorState) => void;
24
+ start: (paragraphId: string, paragraphOffset: number, handleDirection: ResizeHandleDirection, event: PointerEvent, initialState: EditorState) => void;
25
+ startMove: (paragraphId: string, paragraphOffset: number, event: PointerEvent, initialState: EditorState) => void;
26
26
  stop: () => void;
27
27
  };
@@ -40,6 +40,6 @@ export interface ResizeSessionDeps {
40
40
  * supplied by {@link ResizeSessionAdapter}.
41
41
  */
42
42
  export declare function createResizeSession(adapter: ResizeSessionAdapter, deps: ResizeSessionDeps): {
43
- start: (paragraphId: string, paragraphOffset: number, handleDirection: ResizeHandleDirection, event: MouseEvent, initialState: EditorState) => void;
43
+ start: (paragraphId: string, paragraphOffset: number, handleDirection: ResizeHandleDirection, event: PointerEvent, initialState: EditorState) => void;
44
44
  stop: () => void;
45
45
  };
@@ -29,7 +29,7 @@ export interface RotateSessionDeps {
29
29
  * pre-rotation state onto the undo stack on release.
30
30
  */
31
31
  export declare function createRotateSession(adapter: RotateSessionAdapter, deps: RotateSessionDeps): {
32
- start: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
32
+ start: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
33
33
  currentTarget: HTMLElement;
34
34
  }, initialState: EditorState) => void;
35
35
  stop: () => void;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Tracks which pointer owns an in-flight drag gesture.
3
+ *
4
+ * Drag sessions listen on `window`, so every pointer on the screen reaches
5
+ * their move/up handlers. Without this filter a second finger — a thumb coming
6
+ * to rest on the page, or the start of a pinch — would steer a drag that
7
+ * another pointer began, snapping the dragged object to the wrong place.
8
+ */
9
+ export interface PointerGesture {
10
+ /** Records the pointer that started the gesture. */
11
+ claim: (event: Pick<PointerEvent, "pointerId">) => void;
12
+ /** Whether an event belongs to the pointer that started the gesture. */
13
+ owns: (event: Pick<PointerEvent, "pointerId">) => boolean;
14
+ /** Forgets the owner so the next gesture can claim it. */
15
+ release: () => void;
16
+ }
17
+ export declare function createPointerGesture(): PointerGesture;
@@ -60,7 +60,7 @@ export interface TableResizeState {
60
60
  }
61
61
  export interface TableResizeOps {
62
62
  resizing: () => TableResizeState | null;
63
- handleMouseMove: (event: MouseEvent) => void;
64
- handleMouseDown: (event: MouseEvent) => boolean;
63
+ handlePointerMove: (event: PointerEvent) => void;
64
+ handlePointerDown: (event: PointerEvent) => boolean;
65
65
  stop: () => void;
66
66
  }
@@ -56,24 +56,24 @@ declare function createEditorImageOperationsImpl(deps: EditorImageOperationsDeps
56
56
  height: number;
57
57
  src: string;
58
58
  } | null;
59
- startImageDrag: (paragraphId: string, paragraphOffset: number, event: MouseEvent, pointerBounds?: ImagePointerBounds) => void;
59
+ startImageDrag: (paragraphId: string, paragraphOffset: number, event: PointerEvent, pointerBounds?: ImagePointerBounds) => void;
60
60
  stopImageDrag: () => void;
61
61
  stopImageResize: () => void;
62
62
  stopImageRotate: () => void;
63
63
  stopImageCrop: () => void;
64
- handleImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
64
+ handleImagePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
65
65
  currentTarget: HTMLElement;
66
66
  }) => void;
67
- handleImageResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
67
+ handleImageResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
68
68
  currentTarget: HTMLElement;
69
69
  }) => void;
70
- handleImageRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
70
+ handleImageRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
71
71
  currentTarget: HTMLElement;
72
72
  }) => void;
73
- handleImageCropHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
73
+ handleImageCropHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
74
74
  currentTarget: HTMLElement;
75
75
  }) => void;
76
- handleImageCropBodyMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
76
+ handleImageCropBodyPointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
77
77
  currentTarget: HTMLElement;
78
78
  }) => void;
79
79
  };
@@ -5,12 +5,12 @@ export interface UseEditorSurfaceEventsProps {
5
5
  state: () => EditorState;
6
6
  applyState: (newState: EditorState) => void;
7
7
  tableResize: {
8
- handleMouseDown: (event: MouseEvent) => boolean;
8
+ handlePointerDown: (event: PointerEvent) => boolean;
9
9
  };
10
10
  imageOps: {
11
11
  stopImageDrag: () => void;
12
12
  stopImageResize: () => void;
13
- startImageDrag: (paragraphId: string, paragraphOffset: number, event: MouseEvent, pointerBounds?: {
13
+ startImageDrag: (paragraphId: string, paragraphOffset: number, event: PointerEvent, pointerBounds?: {
14
14
  left: number;
15
15
  top: number;
16
16
  width: number;
@@ -21,13 +21,15 @@ export interface UseEditorSurfaceEventsProps {
21
21
  clearPreferredColumn: () => void;
22
22
  resetTransactionGrouping: () => void;
23
23
  focusInputAfterPointerSelection: () => void;
24
+ /** Synchronous focus, required for touch to raise the on-screen keyboard. */
25
+ focusInputSync: () => void;
24
26
  resolveSurfaceHitAtPoint: (clientX: number, clientY: number, context?: {
25
27
  forDrag?: boolean;
26
28
  pierce?: boolean;
27
29
  }) => SurfaceHit | null;
28
30
  getParagraphById: (doc: EditorState["document"], id: string) => EditorParagraphNode | undefined;
29
31
  textDrag?: {
30
- tryStartTextDrag: (event: MouseEvent, hit: SurfaceHit | null) => boolean;
32
+ tryStartTextDrag: (event: PointerEvent, hit: SurfaceHit | null) => boolean;
31
33
  };
32
34
  logger: {
33
35
  debug: (msg: string) => void;
@@ -37,10 +39,10 @@ export interface UseEditorSurfaceEventsProps {
37
39
  }
38
40
  export declare function createEditorSurfaceEvents(deps: UseEditorSurfaceEventsProps): ReturnType<typeof createEditorSurfaceEventsImpl>;
39
41
  declare function createEditorSurfaceEventsImpl(deps: UseEditorSurfaceEventsProps): {
40
- handleSurfaceMouseDown: (event: MouseEvent) => void;
42
+ handleSurfacePointerDown: (event: PointerEvent) => void;
41
43
  handleSurfaceClick: (event: MouseEvent) => void;
42
44
  handleSurfaceDblClick: (event: MouseEvent) => void;
43
- handleParagraphMouseDown: (_paragraphId: string, event: MouseEvent & {
45
+ handleParagraphPointerDown: (_paragraphId: string, event: PointerEvent & {
44
46
  currentTarget: HTMLParagraphElement;
45
47
  }) => void;
46
48
  stopDragging: () => void;
@@ -31,7 +31,7 @@ export interface TableCornerResizeOps {
31
31
  width: number;
32
32
  height: number;
33
33
  } | null>;
34
- handleMouseDown: (tableId: string, event: MouseEvent) => void;
34
+ handlePointerDown: (tableId: string, event: PointerEvent) => void;
35
35
  stop: () => void;
36
36
  }
37
37
  /**
@@ -3,7 +3,7 @@ import { EditorState, EditorPosition } from '../../core/model.js';
3
3
  export interface TableDragOps {
4
4
  dragging: () => boolean;
5
5
  startClientY: () => number;
6
- handleMouseDown: (tableId: string, event: MouseEvent) => void;
6
+ handlePointerDown: (tableId: string, event: PointerEvent) => void;
7
7
  dropTargetPos: () => EditorPosition | null;
8
8
  stop: () => void;
9
9
  }
@@ -32,7 +32,7 @@ declare function createEditorTableDragImpl(deps: {
32
32
  y: number;
33
33
  }>;
34
34
  dropTargetPos: import('solid-js').Accessor<EditorPosition | null>;
35
- handleMouseDown: (tableId: string, event: MouseEvent) => void;
35
+ handlePointerDown: (tableId: string, event: PointerEvent) => void;
36
36
  stop: () => void;
37
37
  };
38
38
  export {};
@@ -16,10 +16,10 @@ export interface EditorTextBoxOperationsDeps {
16
16
  }
17
17
  export declare function createEditorTextBoxOperations(deps: EditorTextBoxOperationsDeps): ReturnType<typeof createEditorTextBoxOperationsImpl>;
18
18
  declare function createEditorTextBoxOperationsImpl(deps: EditorTextBoxOperationsDeps): {
19
- handleTextBoxResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
19
+ handleTextBoxResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
20
20
  currentTarget: HTMLElement;
21
21
  }) => void;
22
- handleTextBoxRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
22
+ handleTextBoxRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
23
23
  currentTarget: HTMLElement;
24
24
  }) => void;
25
25
  stopTextBoxResize: () => void;
@@ -35,7 +35,7 @@ declare function createEditorTextDragImpl(deps: EditorTextDragDeps): {
35
35
  top: number;
36
36
  height: number;
37
37
  } | null>;
38
- tryStartTextDrag: (event: MouseEvent, hit: SurfaceHit | null) => boolean;
38
+ tryStartTextDrag: (event: PointerEvent, hit: SurfaceHit | null) => boolean;
39
39
  stopDrag: () => void;
40
40
  };
41
41
  export {};
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
2863
2863
  onCleanup(() => {
2864
2864
  cancelled = true;
2865
2865
  });
2866
- import("./OasisEditorApp-voAqwV96.js").then((m) => {
2866
+ import("./OasisEditorApp-c25tbt9o.js").then((m) => {
2867
2867
  cancelled = true;
2868
2868
  setProgress(1);
2869
2869
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -25980,14 +25980,14 @@ function CanvasEditorSurface(props) {
25980
25980
  get paintGeneration() {
25981
25981
  return layoutMetricsEpoch();
25982
25982
  },
25983
- get onSurfaceMouseDown() {
25984
- return props.onSurfaceMouseDown;
25983
+ get onSurfacePointerDown() {
25984
+ return props.onSurfacePointerDown;
25985
25985
  },
25986
25986
  get onSurfaceClick() {
25987
25987
  return props.onSurfaceClick;
25988
25988
  },
25989
- get onSurfaceMouseMove() {
25990
- return props.onSurfaceMouseMove;
25989
+ get onSurfacePointerMove() {
25990
+ return props.onSurfacePointerMove;
25991
25991
  },
25992
25992
  get onSurfaceDblClick() {
25993
25993
  return props.onSurfaceDblClick;
@@ -26092,9 +26092,9 @@ function CanvasPage(props) {
26092
26092
  return (() => {
26093
26093
  var _el$3 = _tmpl$3$l(), _el$4 = _el$3.firstChild;
26094
26094
  addEventListener(_el$3, "dblclick", props.onSurfaceDblClick, true);
26095
- addEventListener(_el$3, "mousemove", props.onSurfaceMouseMove, true);
26095
+ addEventListener(_el$3, "pointermove", props.onSurfacePointerMove, true);
26096
26096
  addEventListener(_el$3, "click", props.onSurfaceClick, true);
26097
- addEventListener(_el$3, "mousedown", props.onSurfaceMouseDown, true);
26097
+ addEventListener(_el$3, "pointerdown", props.onSurfacePointerDown, true);
26098
26098
  var _ref$ = canvasRef;
26099
26099
  typeof _ref$ === "function" ? use(_ref$, _el$4) : canvasRef = _el$4;
26100
26100
  insert(_el$3, createComponent(For, {
@@ -26103,7 +26103,7 @@ function CanvasPage(props) {
26103
26103
  },
26104
26104
  children: (revision) => (() => {
26105
26105
  var _el$5 = _tmpl$4$d();
26106
- addEventListener(_el$5, "mousedown", props.onSurfaceMouseDown, true);
26106
+ addEventListener(_el$5, "pointerdown", props.onSurfacePointerDown, true);
26107
26107
  _el$5.addEventListener("mouseleave", (event) => {
26108
26108
  var _a2;
26109
26109
  return (_a2 = props.onRevisionMouseLeave) == null ? void 0 : _a2.call(props, revision.id, event);
@@ -26141,7 +26141,7 @@ function CanvasPage(props) {
26141
26141
  return _el$3;
26142
26142
  })();
26143
26143
  }
26144
- delegateEvents(["mousedown", "click", "mousemove", "dblclick"]);
26144
+ delegateEvents(["pointerdown", "click", "pointermove", "dblclick"]);
26145
26145
  function selectionOverlapsRun(runStart, runEnd, selectionStart, selectionEnd) {
26146
26146
  return Math.max(runStart, selectionStart) < Math.min(runEnd, selectionEnd);
26147
26147
  }
@@ -40162,7 +40162,11 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
40162
40162
  continue;
40163
40163
  }
40164
40164
  if (element.localName === "sdt") {
40165
- const sdtContent = getFirstChildByTagNameNS(element, WORD_NS$3, "sdtContent");
40165
+ const sdtContent = getFirstChildByTagNameNS(
40166
+ element,
40167
+ WORD_NS$3,
40168
+ "sdtContent"
40169
+ );
40166
40170
  if (!sdtContent) {
40167
40171
  continue;
40168
40172
  }
@@ -43472,7 +43476,10 @@ function createSdtEnvelope(parent, wrapper) {
43472
43476
  const document2 = parent.ownerDocument;
43473
43477
  if (!document2) return null;
43474
43478
  const sdt = document2.createElementNS(WORD_NS$1, "w:sdt");
43475
- const properties = parseWordFragment$1(serializeSdtPrXml(wrapper.sdtPr), "sdtPr");
43479
+ const properties = parseWordFragment$1(
43480
+ serializeSdtPrXml(wrapper.sdtPr),
43481
+ "sdtPr"
43482
+ );
43476
43483
  if (properties) {
43477
43484
  sdt.appendChild(properties.cloneNode(true));
43478
43485
  }
@@ -43528,18 +43535,22 @@ function wrapTableStructuralSdts(table, tableElement) {
43528
43535
  if (cellElements.length !== row.cells.length) continue;
43529
43536
  wrapSequence(
43530
43537
  rowElement,
43531
- cellElements.map((element, cellIndex) => ({
43532
- element,
43533
- wrappers: row.cells[cellIndex].sdtWrappers ?? []
43534
- }))
43538
+ cellElements.map(
43539
+ (element, cellIndex) => ({
43540
+ element,
43541
+ wrappers: row.cells[cellIndex].sdtWrappers ?? []
43542
+ })
43543
+ )
43535
43544
  );
43536
43545
  }
43537
43546
  wrapSequence(
43538
43547
  tableElement,
43539
- rowElements.map((element, rowIndex) => ({
43540
- element,
43541
- wrappers: table.rows[rowIndex].sdtWrappers ?? []
43542
- }))
43548
+ rowElements.map(
43549
+ (element, rowIndex) => ({
43550
+ element,
43551
+ wrappers: table.rows[rowIndex].sdtWrappers ?? []
43552
+ })
43553
+ )
43543
43554
  );
43544
43555
  }
43545
43556
  function elementChildren$1(node) {
@@ -44346,9 +44357,7 @@ function serializeRunRevisionWrapper(innerXml, revision) {
44346
44357
  }
44347
44358
  function serializeMoveRangeMarker(marker) {
44348
44359
  const element = `move${marker.move === "from" ? "From" : "To"}Range${marker.edge === "start" ? "Start" : "End"}`;
44349
- const attributes = [
44350
- `w:id="${revisionNumericId(marker.id)}"`
44351
- ];
44360
+ const attributes = [`w:id="${revisionNumericId(marker.id)}"`];
44352
44361
  if (marker.displacedByCustomXml !== void 0) {
44353
44362
  attributes.push(
44354
44363
  `w:displacedByCustomXml="${escapeXml(marker.displacedByCustomXml)}"`
@@ -44452,7 +44461,11 @@ function serializeParagraphDecorations(style2) {
44452
44461
  return parts;
44453
44462
  }
44454
44463
  function serializeParagraphPropertyRevision(revision) {
44455
- const { propertyRevision: _nestedRevision, styleId, ...previous } = revision.previous;
44464
+ const {
44465
+ propertyRevision: _nestedRevision,
44466
+ styleId,
44467
+ ...previous
44468
+ } = revision.previous;
44456
44469
  const serialized = serializeParagraphStyleXml(previous);
44457
44470
  const inner = serialized ? serialized.slice("<w:pPr>".length, -"</w:pPr>".length) : "";
44458
44471
  const styleXml = styleId ? `<w:pStyle w:val="${escapeXml(styleId)}"/>` : "";
@@ -44756,7 +44769,11 @@ function normalizeHighlightForDocx(highlight) {
44756
44769
  return bestName;
44757
44770
  }
44758
44771
  function serializeRunPropertyRevision(revision) {
44759
- const { propertyRevision: _nestedRevision, styleId, ...previous } = revision.previous;
44772
+ const {
44773
+ propertyRevision: _nestedRevision,
44774
+ styleId,
44775
+ ...previous
44776
+ } = revision.previous;
44760
44777
  const serialized = serializeRunProperties(previous);
44761
44778
  const inner = serialized ? serialized.slice("<w:rPr>".length, -"</w:rPr>".length) : "";
44762
44779
  const styleXml = styleId ? `<w:rStyle w:val="${escapeXml(styleId)}"/>` : "";
@@ -48704,7 +48721,7 @@ var _tmpl$$G = /* @__PURE__ */ template(`<button aria-hidden=true class=oasis-ed
48704
48721
  function ResizeHandlesOverlay(props) {
48705
48722
  return (() => {
48706
48723
  var _el$ = _tmpl$2$p();
48707
- _el$.$$mousedown = (event) => {
48724
+ _el$.$$pointerdown = (event) => {
48708
48725
  if (props.readOnly || !props.box() || !props.onBodyMouseDown) {
48709
48726
  return;
48710
48727
  }
@@ -48720,7 +48737,7 @@ function ResizeHandlesOverlay(props) {
48720
48737
  each: RESIZE_HANDLE_DIRECTIONS,
48721
48738
  children: (direction) => (() => {
48722
48739
  var _el$3 = _tmpl$3$h();
48723
- _el$3.$$mousedown = (event) => {
48740
+ _el$3.$$pointerdown = (event) => {
48724
48741
  if (!props.box()) {
48725
48742
  return;
48726
48743
  }
@@ -48735,7 +48752,7 @@ function ResizeHandlesOverlay(props) {
48735
48752
  },
48736
48753
  get children() {
48737
48754
  var _el$2 = _tmpl$$G();
48738
- _el$2.$$mousedown = (event) => {
48755
+ _el$2.$$pointerdown = (event) => {
48739
48756
  var _a2;
48740
48757
  if (!props.box()) {
48741
48758
  return;
@@ -48774,7 +48791,7 @@ function ResizeHandlesOverlay(props) {
48774
48791
  return _el$;
48775
48792
  })();
48776
48793
  }
48777
- delegateEvents(["mousedown"]);
48794
+ delegateEvents(["pointerdown"]);
48778
48795
  var _tmpl$$F = /* @__PURE__ */ template(`<div aria-hidden=true class=oasis-editor-image-crop-preview><img alt>`);
48779
48796
  function fraction(value2) {
48780
48797
  return Number.isFinite(value2) ? Math.max(0, Math.min(0.99, value2 ?? 0)) : 0;
@@ -48856,10 +48873,10 @@ function TableHandlesOverlay(props) {
48856
48873
  },
48857
48874
  children: (box) => (() => {
48858
48875
  var _el$ = _tmpl$$E(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
48859
- _el$2.$$mousedown = (event) => {
48876
+ _el$2.$$pointerdown = (event) => {
48860
48877
  props.onMoveStart(event);
48861
48878
  };
48862
- _el$3.$$mousedown = (event) => {
48879
+ _el$3.$$pointerdown = (event) => {
48863
48880
  props.onResizeStart(event);
48864
48881
  };
48865
48882
  createRenderEffect((_p$) => {
@@ -48879,7 +48896,7 @@ function TableHandlesOverlay(props) {
48879
48896
  })()
48880
48897
  });
48881
48898
  }
48882
- delegateEvents(["mousedown"]);
48899
+ delegateEvents(["pointerdown"]);
48883
48900
  const ZOOM_MIN = 50;
48884
48901
  const ZOOM_MAX = 200;
48885
48902
  const ZOOM_STEP = 10;
@@ -49002,7 +49019,7 @@ function EditorStatusBar(props) {
49002
49019
  })();
49003
49020
  }
49004
49021
  delegateEvents(["click", "input"]);
49005
- var _tmpl$$B = /* @__PURE__ */ template(`<div data-testid=editor-editor-shell><div class=oasis-editor-editor data-testid=editor-editor><div class=oasis-editor-editor-zoom-sizer><div class=oasis-editor-editor-scroll-content data-testid=editor-editor-scroll-content style="position:absolute;top:0px;transform-origin:top left"><textarea aria-label="Editor input"autocomplete=off autocapitalize=off class=oasis-editor-input data-testid=editor-input value style=pointer-events:none></textarea><input data-testid=editor-import-docx-input type=file style=display:none><input accept="image/png, image/jpeg, image/gif"data-testid=editor-insert-image-input type=file style=display:none>`);
49022
+ var _tmpl$$B = /* @__PURE__ */ template(`<div data-testid=editor-editor-shell><div class=oasis-editor-editor data-testid=editor-editor><div class=oasis-editor-editor-zoom-sizer><div class=oasis-editor-editor-scroll-content data-testid=editor-editor-scroll-content style="position:absolute;top:0px;transform-origin:top left"><textarea aria-label="Editor input"autocomplete=off autocapitalize=off autocorrect=off class=oasis-editor-input data-testid=editor-input enterkeyhint=enter inputmode=text value style=pointer-events:none></textarea><input data-testid=editor-import-docx-input type=file style=display:none><input accept="image/png, image/jpeg, image/gif"data-testid=editor-insert-image-input type=file style=display:none>`);
49006
49023
  function OasisEditorEditor(props) {
49007
49024
  const layout = () => props.layout;
49008
49025
  const overlays = () => props.overlays;
@@ -49171,7 +49188,7 @@ function OasisEditorEditor(props) {
49171
49188
  }
49172
49189
  }), _el$2);
49173
49190
  addEventListener(_el$2, "contextmenu", surfaceHandlers().onEditorContextMenu, true);
49174
- addEventListener(_el$2, "mousedown", surfaceHandlers().onEditorMouseDown, true);
49191
+ addEventListener(_el$2, "pointerdown", surfaceHandlers().onEditorPointerDown, true);
49175
49192
  addEventListener(_el$2, "drop", surfaceHandlers().onDrop);
49176
49193
  addEventListener(_el$2, "dragover", surfaceHandlers().onDragOver);
49177
49194
  use((el) => {
@@ -49236,35 +49253,35 @@ function OasisEditorEditor(props) {
49236
49253
  return layout().measuredParagraphLayouts;
49237
49254
  },
49238
49255
  viewportRef: () => viewportElement ?? void 0,
49239
- get onSurfaceMouseDown() {
49240
- return surfaceHandlers().onSurfaceMouseDown;
49256
+ get onSurfacePointerDown() {
49257
+ return surfaceHandlers().onSurfacePointerDown;
49241
49258
  },
49242
49259
  get onSurfaceClick() {
49243
49260
  return surfaceHandlers().onSurfaceClick;
49244
49261
  },
49245
- get onSurfaceMouseMove() {
49246
- return surfaceHandlers().onSurfaceMouseMove;
49262
+ get onSurfacePointerMove() {
49263
+ return surfaceHandlers().onSurfacePointerMove;
49247
49264
  },
49248
49265
  get onSurfaceDblClick() {
49249
49266
  return surfaceHandlers().onSurfaceDblClick;
49250
49267
  },
49251
- get onParagraphMouseDown() {
49252
- return surfaceHandlers().onParagraphMouseDown;
49268
+ get onParagraphPointerDown() {
49269
+ return surfaceHandlers().onParagraphPointerDown;
49253
49270
  },
49254
- get onImageMouseDown() {
49255
- return surfaceHandlers().onImageMouseDown;
49271
+ get onImagePointerDown() {
49272
+ return surfaceHandlers().onImagePointerDown;
49256
49273
  },
49257
- get onImageResizeHandleMouseDown() {
49258
- return surfaceHandlers().onImageResizeHandleMouseDown;
49274
+ get onImageResizeHandlePointerDown() {
49275
+ return surfaceHandlers().onImageResizeHandlePointerDown;
49259
49276
  },
49260
- get onTextBoxResizeHandleMouseDown() {
49261
- return surfaceHandlers().onTextBoxResizeHandleMouseDown;
49277
+ get onTextBoxResizeHandlePointerDown() {
49278
+ return surfaceHandlers().onTextBoxResizeHandlePointerDown;
49262
49279
  },
49263
- get onTableDragHandleMouseDown() {
49264
- return surfaceHandlers().onTableDragHandleMouseDown;
49280
+ get onTableDragHandlePointerDown() {
49281
+ return surfaceHandlers().onTableDragHandlePointerDown;
49265
49282
  },
49266
- get onTableCornerResizeHandleMouseDown() {
49267
- return surfaceHandlers().onTableCornerResizeHandleMouseDown;
49283
+ get onTableCornerResizeHandlePointerDown() {
49284
+ return surfaceHandlers().onTableCornerResizeHandlePointerDown;
49268
49285
  },
49269
49286
  get onRevisionMouseEnter() {
49270
49287
  return surfaceHandlers().onRevisionMouseEnter;
@@ -49328,17 +49345,17 @@ function OasisEditorEditor(props) {
49328
49345
  if (!image) return;
49329
49346
  event.preventDefault();
49330
49347
  event.stopPropagation();
49331
- surfaceHandlers().onImageResizeHandleMouseDown(image.paragraphId, image.startOffset, direction, event);
49348
+ surfaceHandlers().onImageResizeHandlePointerDown(image.paragraphId, image.startOffset, direction, event);
49332
49349
  },
49333
49350
  onRotateStart: (event) => {
49334
49351
  const image = selectedImage();
49335
49352
  if (!image) return;
49336
- surfaceHandlers().onImageRotateHandleMouseDown(image.paragraphId, image.startOffset, event);
49353
+ surfaceHandlers().onImageRotateHandlePointerDown(image.paragraphId, image.startOffset, event);
49337
49354
  },
49338
49355
  onBodyMouseDown: (event) => {
49339
49356
  const image = selectedImage();
49340
49357
  if (!image) return;
49341
- surfaceHandlers().onImageMouseDown(image.paragraphId, image.startOffset, event);
49358
+ surfaceHandlers().onImagePointerDown(image.paragraphId, image.startOffset, event);
49342
49359
  }
49343
49360
  });
49344
49361
  },
@@ -49373,13 +49390,13 @@ function OasisEditorEditor(props) {
49373
49390
  if (!image) return;
49374
49391
  event.preventDefault();
49375
49392
  event.stopPropagation();
49376
- (_b2 = (_a2 = surfaceHandlers()).onImageCropHandleMouseDown) == null ? void 0 : _b2.call(_a2, image.paragraphId, image.startOffset, direction, event);
49393
+ (_b2 = (_a2 = surfaceHandlers()).onImageCropHandlePointerDown) == null ? void 0 : _b2.call(_a2, image.paragraphId, image.startOffset, direction, event);
49377
49394
  },
49378
49395
  onBodyMouseDown: (event) => {
49379
49396
  var _a2, _b2;
49380
49397
  const image = selectedImage();
49381
49398
  if (!image) return;
49382
- (_b2 = (_a2 = surfaceHandlers()).onImageCropBodyMouseDown) == null ? void 0 : _b2.call(_a2, image.paragraphId, image.startOffset, event);
49399
+ (_b2 = (_a2 = surfaceHandlers()).onImageCropBodyPointerDown) == null ? void 0 : _b2.call(_a2, image.paragraphId, image.startOffset, event);
49383
49400
  }
49384
49401
  })];
49385
49402
  }
@@ -49399,12 +49416,12 @@ function OasisEditorEditor(props) {
49399
49416
  if (!textBox) return;
49400
49417
  event.preventDefault();
49401
49418
  event.stopPropagation();
49402
- surfaceHandlers().onTextBoxResizeHandleMouseDown(textBox.paragraphId, textBox.startOffset, direction, event);
49419
+ surfaceHandlers().onTextBoxResizeHandlePointerDown(textBox.paragraphId, textBox.startOffset, direction, event);
49403
49420
  },
49404
49421
  onRotateStart: (event) => {
49405
49422
  const textBox = selectedTextBox();
49406
49423
  if (!textBox) return;
49407
- surfaceHandlers().onTextBoxRotateHandleMouseDown(textBox.paragraphId, textBox.startOffset, event);
49424
+ surfaceHandlers().onTextBoxRotateHandlePointerDown(textBox.paragraphId, textBox.startOffset, event);
49408
49425
  }
49409
49426
  }), _el$5);
49410
49427
  insert(_el$4, createComponent(TableHandlesOverlay, {
@@ -49415,12 +49432,12 @@ function OasisEditorEditor(props) {
49415
49432
  onMoveStart: (event) => {
49416
49433
  const table = selectedTable();
49417
49434
  if (!table) return;
49418
- surfaceHandlers().onTableDragHandleMouseDown(table.tableId, event);
49435
+ surfaceHandlers().onTableDragHandlePointerDown(table.tableId, event);
49419
49436
  },
49420
49437
  onResizeStart: (event) => {
49421
49438
  const table = selectedTable();
49422
49439
  if (!table) return;
49423
- surfaceHandlers().onTableCornerResizeHandleMouseDown(table.tableId, event);
49440
+ surfaceHandlers().onTableCornerResizeHandlePointerDown(table.tableId, event);
49424
49441
  }
49425
49442
  }), _el$5);
49426
49443
  insert(_el$4, createComponent(Show, {
@@ -49529,7 +49546,7 @@ function OasisEditorEditor(props) {
49529
49546
  return _el$;
49530
49547
  })();
49531
49548
  }
49532
- delegateEvents(["mousedown", "contextmenu", "input", "keydown"]);
49549
+ delegateEvents(["pointerdown", "contextmenu", "input", "keydown"]);
49533
49550
  function resolveFloatingTopLeft(floating, opts) {
49534
49551
  const emuToPx2 = (value2) => value2 === void 0 ? 0 : value2 / EMU_PER_PX;
49535
49552
  const h = floating.positionH;
@@ -52159,7 +52176,9 @@ function collectParagraphsDeep(blocks) {
52159
52176
  function recordRemovedParagraphRelocations(before, after, context2) {
52160
52177
  const oldParagraphs = collectParagraphsDeep([before]);
52161
52178
  const newParagraphs = collectParagraphsDeep([after]);
52162
- const newById = new Map(newParagraphs.map((paragraph) => [paragraph.id, paragraph]));
52179
+ const newById = new Map(
52180
+ newParagraphs.map((paragraph) => [paragraph.id, paragraph])
52181
+ );
52163
52182
  for (let index = 0; index < oldParagraphs.length; index += 1) {
52164
52183
  const paragraph = oldParagraphs[index];
52165
52184
  if (newById.has(paragraph.id) || context2.paragraphRelocations.has(paragraph.id)) {
@@ -52705,14 +52724,19 @@ function transformAnchor(anchor, transforms, relocations) {
52705
52724
  return paragraphId === anchor.paragraphId && offset === anchor.offset ? anchor : { ...anchor, paragraphId, offset };
52706
52725
  }
52707
52726
  function transformBookmarks(document2, transforms, relocations) {
52708
- if (!document2.bookmarks || transforms.size === 0 && relocations.size === 0) return;
52727
+ if (!document2.bookmarks || transforms.size === 0 && relocations.size === 0)
52728
+ return;
52709
52729
  let changed = false;
52710
52730
  const items = { ...document2.bookmarks.items };
52711
52731
  const order = [];
52712
52732
  for (const id of document2.bookmarks.order) {
52713
52733
  const bookmark = document2.bookmarks.items[id];
52714
52734
  if (!bookmark) continue;
52715
- const mappedStart = transformAnchor(bookmark.start, transforms, relocations);
52735
+ const mappedStart = transformAnchor(
52736
+ bookmark.start,
52737
+ transforms,
52738
+ relocations
52739
+ );
52716
52740
  const mappedEnd = transformAnchor(bookmark.end, transforms, relocations);
52717
52741
  const start = mappedStart ?? (bookmark.start ? mappedEnd : void 0);
52718
52742
  const end = mappedEnd ?? (bookmark.end ? mappedStart : void 0);
@@ -52730,15 +52754,24 @@ function transformBookmarks(document2, transforms, relocations) {
52730
52754
  if (changed) document2.bookmarks = { ...document2.bookmarks, items, order };
52731
52755
  }
52732
52756
  function transformComments(comments, transforms, relocations) {
52733
- if (!comments || transforms.size === 0 && relocations.size === 0) return comments;
52757
+ if (!comments || transforms.size === 0 && relocations.size === 0)
52758
+ return comments;
52734
52759
  let changed = false;
52735
52760
  const items = { ...comments.items };
52736
52761
  const order = [];
52737
52762
  for (const id of comments.order) {
52738
52763
  const comment = comments.items[id];
52739
52764
  if (!comment) continue;
52740
- const mappedStart = transformAnchor(comment.start, transforms, relocations);
52741
- const mappedEnd = transformAnchor(comment.end, transforms, relocations);
52765
+ const mappedStart = transformAnchor(
52766
+ comment.start,
52767
+ transforms,
52768
+ relocations
52769
+ );
52770
+ const mappedEnd = transformAnchor(
52771
+ comment.end,
52772
+ transforms,
52773
+ relocations
52774
+ );
52742
52775
  const start = mappedStart ?? (comment.start ? mappedEnd : void 0);
52743
52776
  const end = mappedEnd ?? (comment.end ? mappedStart : void 0);
52744
52777
  if (!start && !end) {