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.
- package/dist/{OasisEditorApp-WP25r3Sz.js → OasisEditorApp-c25tbt9o.js} +423 -159
- package/dist/app/controllers/createCropSession.d.ts +2 -2
- package/dist/app/controllers/createResizeSession.d.ts +1 -1
- package/dist/app/controllers/createRotateSession.d.ts +1 -1
- package/dist/app/controllers/pointerGesture.d.ts +17 -0
- package/dist/app/controllers/tableResize/tableResizeTypes.d.ts +2 -2
- package/dist/app/controllers/useEditorImageOperations.d.ts +6 -6
- package/dist/app/controllers/useEditorSurfaceEvents.d.ts +7 -5
- package/dist/app/controllers/useEditorTableCornerResize.d.ts +1 -1
- package/dist/app/controllers/useEditorTableDrag.d.ts +2 -2
- package/dist/app/controllers/useEditorTextBoxOperations.d.ts +2 -2
- package/dist/app/controllers/useEditorTextDrag.d.ts +1 -1
- package/dist/app/controllers/useEditorTextInput.d.ts +3 -0
- package/dist/core/commands/text.d.ts +1 -1
- package/dist/core/commands/textDeletion.d.ts +9 -0
- package/dist/core/transactionMergeKeys.d.ts +1 -0
- package/dist/{index-CdeBKnqS.js → index-sfDgngZ-.js} +99 -65
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +2 -2
- package/dist/ui/OasisEditorEditorProps.d.ts +16 -13
- package/dist/ui/app/buildEditorViewProps.d.ts +8 -8
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +18 -13
- package/dist/ui/app/useEditorFocus.d.ts +1 -0
- package/dist/ui/app/useEditorInteractionWiring.d.ts +1 -0
- package/dist/ui/editorUiTypes.d.ts +8 -8
- package/dist/ui/overlays/ResizeHandlesOverlay.d.ts +3 -3
- package/dist/ui/overlays/TableHandlesOverlay.d.ts +2 -2
- package/package.json +2 -1
|
@@ -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:
|
|
25
|
-
startMove: (paragraphId: string, paragraphOffset: number, event:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
64
|
-
|
|
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:
|
|
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
|
-
|
|
64
|
+
handleImagePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
|
|
65
65
|
currentTarget: HTMLElement;
|
|
66
66
|
}) => void;
|
|
67
|
-
|
|
67
|
+
handleImageResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
|
|
68
68
|
currentTarget: HTMLElement;
|
|
69
69
|
}) => void;
|
|
70
|
-
|
|
70
|
+
handleImageRotateHandlePointerDown: (paragraphId: string, paragraphOffset: number, event: PointerEvent & {
|
|
71
71
|
currentTarget: HTMLElement;
|
|
72
72
|
}) => void;
|
|
73
|
-
|
|
73
|
+
handleImageCropHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
|
|
74
74
|
currentTarget: HTMLElement;
|
|
75
75
|
}) => void;
|
|
76
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
42
|
+
handleSurfacePointerDown: (event: PointerEvent) => void;
|
|
41
43
|
handleSurfaceClick: (event: MouseEvent) => void;
|
|
42
44
|
handleSurfaceDblClick: (event: MouseEvent) => void;
|
|
43
|
-
|
|
45
|
+
handleParagraphPointerDown: (_paragraphId: string, event: PointerEvent & {
|
|
44
46
|
currentTarget: HTMLParagraphElement;
|
|
45
47
|
}) => void;
|
|
46
48
|
stopDragging: () => void;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
+
handleTextBoxResizeHandlePointerDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: PointerEvent & {
|
|
20
20
|
currentTarget: HTMLElement;
|
|
21
21
|
}) => void;
|
|
22
|
-
|
|
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:
|
|
38
|
+
tryStartTextDrag: (event: PointerEvent, hit: SurfaceHit | null) => boolean;
|
|
39
39
|
stopDrag: () => void;
|
|
40
40
|
};
|
|
41
41
|
export {};
|
|
@@ -22,6 +22,9 @@ declare function createEditorTextInputImpl(deps: UseEditorTextInputProps): {
|
|
|
22
22
|
currentTarget: HTMLTextAreaElement;
|
|
23
23
|
}) => void;
|
|
24
24
|
handleCompositionStart: () => void;
|
|
25
|
+
handleCompositionUpdate: (event: CompositionEvent & {
|
|
26
|
+
currentTarget: HTMLTextAreaElement;
|
|
27
|
+
}) => void;
|
|
25
28
|
handleCompositionEnd: (event: CompositionEvent & {
|
|
26
29
|
currentTarget: HTMLTextAreaElement;
|
|
27
30
|
}) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { moveOrCopySelectionToPosition, insertTextAtSelection, insertPlainTextAtSelection, insertMathAtSelection, updateMathRun, } from './textEditing.js';
|
|
2
|
-
export { deleteBackward, deleteForward } from './textDeletion.js';
|
|
2
|
+
export { deleteBackward, deleteForward, deleteCharsBackwardRaw, } from './textDeletion.js';
|
|
3
3
|
export { toggleTextStyle, clearSelectedTextFormatting, setTextStyleValue, } from './textFormatting.js';
|
|
4
4
|
export { type TextCaseMode, transformSelectedText, changeSelectedTextCase, } from './textCase.js';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { EditorState } from '../model.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Removes `count` UTF-16 code units immediately before the caret, inside the
|
|
5
|
+
* focused paragraph only.
|
|
6
|
+
*
|
|
7
|
+
* Unlike `deleteBackward` this never marks revisions when track changes is on
|
|
8
|
+
* and never merges paragraphs: it exists to retract IME composition previews,
|
|
9
|
+
* which are provisional text the user has not committed yet.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deleteCharsBackwardRaw(state: EditorState, count: number): EditorState;
|
|
3
12
|
export declare function deleteBackward(state: EditorState): EditorState;
|
|
4
13
|
export declare function deleteForward(state: EditorState): EditorState;
|
|
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2863
2863
|
onCleanup(() => {
|
|
2864
2864
|
cancelled = true;
|
|
2865
2865
|
});
|
|
2866
|
-
import("./OasisEditorApp-
|
|
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
|
|
25984
|
-
return props.
|
|
25983
|
+
get onSurfacePointerDown() {
|
|
25984
|
+
return props.onSurfacePointerDown;
|
|
25985
25985
|
},
|
|
25986
25986
|
get onSurfaceClick() {
|
|
25987
25987
|
return props.onSurfaceClick;
|
|
25988
25988
|
},
|
|
25989
|
-
get
|
|
25990
|
-
return props.
|
|
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, "
|
|
26095
|
+
addEventListener(_el$3, "pointermove", props.onSurfacePointerMove, true);
|
|
26096
26096
|
addEventListener(_el$3, "click", props.onSurfaceClick, true);
|
|
26097
|
-
addEventListener(_el$3, "
|
|
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, "
|
|
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(["
|
|
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(
|
|
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(
|
|
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(
|
|
43532
|
-
element,
|
|
43533
|
-
|
|
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(
|
|
43540
|
-
element,
|
|
43541
|
-
|
|
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 {
|
|
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 {
|
|
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$.$$
|
|
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.$$
|
|
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.$$
|
|
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(["
|
|
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.$$
|
|
48876
|
+
_el$2.$$pointerdown = (event) => {
|
|
48860
48877
|
props.onMoveStart(event);
|
|
48861
48878
|
};
|
|
48862
|
-
_el$3.$$
|
|
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(["
|
|
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, "
|
|
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
|
|
49240
|
-
return surfaceHandlers().
|
|
49256
|
+
get onSurfacePointerDown() {
|
|
49257
|
+
return surfaceHandlers().onSurfacePointerDown;
|
|
49241
49258
|
},
|
|
49242
49259
|
get onSurfaceClick() {
|
|
49243
49260
|
return surfaceHandlers().onSurfaceClick;
|
|
49244
49261
|
},
|
|
49245
|
-
get
|
|
49246
|
-
return surfaceHandlers().
|
|
49262
|
+
get onSurfacePointerMove() {
|
|
49263
|
+
return surfaceHandlers().onSurfacePointerMove;
|
|
49247
49264
|
},
|
|
49248
49265
|
get onSurfaceDblClick() {
|
|
49249
49266
|
return surfaceHandlers().onSurfaceDblClick;
|
|
49250
49267
|
},
|
|
49251
|
-
get
|
|
49252
|
-
return surfaceHandlers().
|
|
49268
|
+
get onParagraphPointerDown() {
|
|
49269
|
+
return surfaceHandlers().onParagraphPointerDown;
|
|
49253
49270
|
},
|
|
49254
|
-
get
|
|
49255
|
-
return surfaceHandlers().
|
|
49271
|
+
get onImagePointerDown() {
|
|
49272
|
+
return surfaceHandlers().onImagePointerDown;
|
|
49256
49273
|
},
|
|
49257
|
-
get
|
|
49258
|
-
return surfaceHandlers().
|
|
49274
|
+
get onImageResizeHandlePointerDown() {
|
|
49275
|
+
return surfaceHandlers().onImageResizeHandlePointerDown;
|
|
49259
49276
|
},
|
|
49260
|
-
get
|
|
49261
|
-
return surfaceHandlers().
|
|
49277
|
+
get onTextBoxResizeHandlePointerDown() {
|
|
49278
|
+
return surfaceHandlers().onTextBoxResizeHandlePointerDown;
|
|
49262
49279
|
},
|
|
49263
|
-
get
|
|
49264
|
-
return surfaceHandlers().
|
|
49280
|
+
get onTableDragHandlePointerDown() {
|
|
49281
|
+
return surfaceHandlers().onTableDragHandlePointerDown;
|
|
49265
49282
|
},
|
|
49266
|
-
get
|
|
49267
|
-
return surfaceHandlers().
|
|
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().
|
|
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().
|
|
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().
|
|
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()).
|
|
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()).
|
|
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().
|
|
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().
|
|
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().
|
|
49435
|
+
surfaceHandlers().onTableDragHandlePointerDown(table.tableId, event);
|
|
49419
49436
|
},
|
|
49420
49437
|
onResizeStart: (event) => {
|
|
49421
49438
|
const table = selectedTable();
|
|
49422
49439
|
if (!table) return;
|
|
49423
|
-
surfaceHandlers().
|
|
49440
|
+
surfaceHandlers().onTableCornerResizeHandlePointerDown(table.tableId, event);
|
|
49424
49441
|
}
|
|
49425
49442
|
}), _el$5);
|
|
49426
49443
|
insert(_el$4, createComponent(Show, {
|
|
@@ -49465,6 +49482,7 @@ function OasisEditorEditor(props) {
|
|
|
49465
49482
|
addEventListener(_el$5, "focus", inputHandlers().onInputFocus);
|
|
49466
49483
|
addEventListener(_el$5, "cut", inputHandlers().onCut);
|
|
49467
49484
|
addEventListener(_el$5, "copy", inputHandlers().onCopy);
|
|
49485
|
+
addEventListener(_el$5, "compositionupdate", inputHandlers().onCompositionUpdate);
|
|
49468
49486
|
addEventListener(_el$5, "compositionstart", inputHandlers().onCompositionStart);
|
|
49469
49487
|
addEventListener(_el$5, "compositionend", inputHandlers().onCompositionEnd);
|
|
49470
49488
|
addEventListener(_el$5, "blur", inputHandlers().onInputBlur);
|
|
@@ -49528,7 +49546,7 @@ function OasisEditorEditor(props) {
|
|
|
49528
49546
|
return _el$;
|
|
49529
49547
|
})();
|
|
49530
49548
|
}
|
|
49531
|
-
delegateEvents(["
|
|
49549
|
+
delegateEvents(["pointerdown", "contextmenu", "input", "keydown"]);
|
|
49532
49550
|
function resolveFloatingTopLeft(floating, opts) {
|
|
49533
49551
|
const emuToPx2 = (value2) => value2 === void 0 ? 0 : value2 / EMU_PER_PX;
|
|
49534
49552
|
const h = floating.positionH;
|
|
@@ -52158,7 +52176,9 @@ function collectParagraphsDeep(blocks) {
|
|
|
52158
52176
|
function recordRemovedParagraphRelocations(before, after, context2) {
|
|
52159
52177
|
const oldParagraphs = collectParagraphsDeep([before]);
|
|
52160
52178
|
const newParagraphs = collectParagraphsDeep([after]);
|
|
52161
|
-
const newById = new Map(
|
|
52179
|
+
const newById = new Map(
|
|
52180
|
+
newParagraphs.map((paragraph) => [paragraph.id, paragraph])
|
|
52181
|
+
);
|
|
52162
52182
|
for (let index = 0; index < oldParagraphs.length; index += 1) {
|
|
52163
52183
|
const paragraph = oldParagraphs[index];
|
|
52164
52184
|
if (newById.has(paragraph.id) || context2.paragraphRelocations.has(paragraph.id)) {
|
|
@@ -52704,14 +52724,19 @@ function transformAnchor(anchor, transforms, relocations) {
|
|
|
52704
52724
|
return paragraphId === anchor.paragraphId && offset === anchor.offset ? anchor : { ...anchor, paragraphId, offset };
|
|
52705
52725
|
}
|
|
52706
52726
|
function transformBookmarks(document2, transforms, relocations) {
|
|
52707
|
-
if (!document2.bookmarks || transforms.size === 0 && relocations.size === 0)
|
|
52727
|
+
if (!document2.bookmarks || transforms.size === 0 && relocations.size === 0)
|
|
52728
|
+
return;
|
|
52708
52729
|
let changed = false;
|
|
52709
52730
|
const items = { ...document2.bookmarks.items };
|
|
52710
52731
|
const order = [];
|
|
52711
52732
|
for (const id of document2.bookmarks.order) {
|
|
52712
52733
|
const bookmark = document2.bookmarks.items[id];
|
|
52713
52734
|
if (!bookmark) continue;
|
|
52714
|
-
const mappedStart = transformAnchor(
|
|
52735
|
+
const mappedStart = transformAnchor(
|
|
52736
|
+
bookmark.start,
|
|
52737
|
+
transforms,
|
|
52738
|
+
relocations
|
|
52739
|
+
);
|
|
52715
52740
|
const mappedEnd = transformAnchor(bookmark.end, transforms, relocations);
|
|
52716
52741
|
const start = mappedStart ?? (bookmark.start ? mappedEnd : void 0);
|
|
52717
52742
|
const end = mappedEnd ?? (bookmark.end ? mappedStart : void 0);
|
|
@@ -52729,15 +52754,24 @@ function transformBookmarks(document2, transforms, relocations) {
|
|
|
52729
52754
|
if (changed) document2.bookmarks = { ...document2.bookmarks, items, order };
|
|
52730
52755
|
}
|
|
52731
52756
|
function transformComments(comments, transforms, relocations) {
|
|
52732
|
-
if (!comments || transforms.size === 0 && relocations.size === 0)
|
|
52757
|
+
if (!comments || transforms.size === 0 && relocations.size === 0)
|
|
52758
|
+
return comments;
|
|
52733
52759
|
let changed = false;
|
|
52734
52760
|
const items = { ...comments.items };
|
|
52735
52761
|
const order = [];
|
|
52736
52762
|
for (const id of comments.order) {
|
|
52737
52763
|
const comment = comments.items[id];
|
|
52738
52764
|
if (!comment) continue;
|
|
52739
|
-
const mappedStart = transformAnchor(
|
|
52740
|
-
|
|
52765
|
+
const mappedStart = transformAnchor(
|
|
52766
|
+
comment.start,
|
|
52767
|
+
transforms,
|
|
52768
|
+
relocations
|
|
52769
|
+
);
|
|
52770
|
+
const mappedEnd = transformAnchor(
|
|
52771
|
+
comment.end,
|
|
52772
|
+
transforms,
|
|
52773
|
+
relocations
|
|
52774
|
+
);
|
|
52741
52775
|
const start = mappedStart ?? (comment.start ? mappedEnd : void 0);
|
|
52742
52776
|
const end = mappedEnd ?? (comment.end ? mappedStart : void 0);
|
|
52743
52777
|
if (!start && !end) {
|