oasis-editor 0.0.12 → 0.0.13
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-DsSNl4Fj.js → OasisEditorApp-DYcAe_1n.js} +213 -19
- package/dist/app/controllers/useEditorLayout.d.ts +2 -1
- package/dist/assets/{importDocxWorker-CtcRQ7NG.js → importDocxWorker-cjz15bhS.js} +1 -1
- package/dist/core/editorState.d.ts +1 -0
- package/dist/core/model/index.d.ts +1 -0
- package/dist/core/model/types/document.d.ts +7 -0
- package/dist/core/model/types/documentComments.d.ts +50 -0
- package/dist/export/docx/commentsXml.d.ts +34 -0
- package/dist/export/docx/docxTypes.d.ts +7 -0
- package/dist/import/docx/comments.d.ts +12 -0
- package/dist/import/docx/commentsXml.d.ts +14 -0
- package/dist/import/docx/runs/types.d.ts +10 -0
- package/dist/import/docx/runs.d.ts +5 -1
- package/dist/{index-BUOuw27s.js → index-CWev1Jg0.js} +466 -109
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/OasisEditorEditor.d.ts +2 -1
- package/dist/ui/app/buildEditorViewProps.d.ts +2 -1
- package/dist/ui/canvas/CanvasCommentGeometry.d.ts +13 -0
- package/dist/ui/components/CommentHighlightOverlay.d.ts +16 -0
- package/dist/ui/editorUiTypes.d.ts +8 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Accessor, JSX } from '../solid-js';
|
|
|
2
2
|
import { ToolbarHost } from '../components/Toolbar/state/createToolbarApi.js';
|
|
3
3
|
import { EditorLayoutParagraph, EditorState } from '../../core/model.js';
|
|
4
4
|
import { ImportProgressState } from '../../app/controllers/useEditorDocumentIO.js';
|
|
5
|
-
import { CaretBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../editorUiTypes.js';
|
|
5
|
+
import { CaretBox, CommentHighlightBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../editorUiTypes.js';
|
|
6
6
|
import { ResizeHandleDirection } from '../resizeGeometry.js';
|
|
7
7
|
|
|
8
8
|
type ImportProgress = ImportProgressState;
|
|
@@ -17,6 +17,7 @@ export interface OasisEditorEditorLayoutProps {
|
|
|
17
17
|
}
|
|
18
18
|
export interface OasisEditorEditorOverlayProps {
|
|
19
19
|
selectionBoxes: Accessor<SelectionBox[]>;
|
|
20
|
+
commentHighlights: Accessor<CommentHighlightBox[]>;
|
|
20
21
|
selectedImageBox: Accessor<SelectedImageBox | null>;
|
|
21
22
|
selectedTextBoxBox: Accessor<SelectedTextBoxBox | null>;
|
|
22
23
|
caretBox: Accessor<CaretBox>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Accessor, JSX } from '../../solid-js';
|
|
2
|
-
import { CaretBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../../../editorUiTypes.js';
|
|
2
|
+
import { CaretBox, CommentHighlightBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../../../editorUiTypes.js';
|
|
3
3
|
import { OasisEditorEditorFileHandlers, OasisEditorEditorInputHandlers, OasisEditorEditorLayoutProps, OasisEditorEditorOverlayProps, OasisEditorEditorRefProps, OasisEditorEditorSurfaceHandlers } from '../../../OasisEditorEditor.js';
|
|
4
4
|
import { createEditorFocusController } from '../../useEditorFocus.js';
|
|
5
5
|
import { createEditorSurfaceEvents } from '../../../../app/controllers/useEditorSurfaceEvents.js';
|
|
@@ -20,6 +20,7 @@ export interface EditorViewPropsContext {
|
|
|
20
20
|
className: string | undefined;
|
|
21
21
|
style: JSX.CSSProperties | undefined;
|
|
22
22
|
selectionBoxes: Accessor<SelectionBox[]>;
|
|
23
|
+
commentHighlights: Accessor<CommentHighlightBox[]>;
|
|
23
24
|
selectedImageBox: Accessor<SelectedImageBox | null>;
|
|
24
25
|
selectedTextBoxBox: Accessor<SelectedTextBoxBox | null>;
|
|
25
26
|
layoutOptions: LayoutOptionsOverlay;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { CommentHighlightBox } from '../../../editorUiTypes.js';
|
|
3
|
+
import { CanvasLayoutSnapshot } from '../../CanvasLayoutSnapshot.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Project each document comment's start/end anchors into highlight rectangles
|
|
7
|
+
* over the commented text, reusing the canvas layout snapshot's per-line slot
|
|
8
|
+
* positions (the same machinery `computeCanvasSelectionGeometry` uses for the
|
|
9
|
+
* live selection). Multi-line and cross-paragraph comments yield one box per
|
|
10
|
+
* covered line; every box carries its `commentId` so the overlay can group them
|
|
11
|
+
* and resolve the popup body on hover.
|
|
12
|
+
*/
|
|
13
|
+
export declare function computeCommentHighlights(snapshot: CanvasLayoutSnapshot, state: EditorState): CommentHighlightBox[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Accessor } from '../../solid-js';
|
|
2
|
+
import { EditorComment } from '../../../../core/model.js';
|
|
3
|
+
import { CommentHighlightBox } from '../../../editorUiTypes.js';
|
|
4
|
+
|
|
5
|
+
export interface CommentHighlightOverlayProps {
|
|
6
|
+
boxes: Accessor<CommentHighlightBox[]>;
|
|
7
|
+
/** Comment bodies keyed by their editor-local id, for the hover popup. */
|
|
8
|
+
commentsById: Accessor<Record<string, EditorComment>>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Renders the highlight rectangles over commented text and, on hover/click of a
|
|
12
|
+
* highlight, a small popup with the comment's author/date/text (mirroring the
|
|
13
|
+
* track-changes `RevisionOverlay`). Hit-testing happens on the overlay divs
|
|
14
|
+
* themselves (`pointer-events: auto`), so no canvas hit-test plumbing is needed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function CommentHighlightOverlay(props: CommentHighlightOverlayProps): import("solid-js").JSX.Element;
|
|
@@ -48,6 +48,14 @@ export interface RevisionBox {
|
|
|
48
48
|
left: number;
|
|
49
49
|
top: number;
|
|
50
50
|
}
|
|
51
|
+
/** One highlight rectangle over a commented text range, tagged with its id. */
|
|
52
|
+
export interface CommentHighlightBox {
|
|
53
|
+
commentId: string;
|
|
54
|
+
left: number;
|
|
55
|
+
top: number;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
}
|
|
51
59
|
/**
|
|
52
60
|
* State and actions backing the Word-style "Layout Options" popup for the
|
|
53
61
|
* selected image or text box.
|