oasis-editor 0.0.106 → 0.0.107
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-CwVZxG1m.js → OasisEditorApp-BFNqDc07.js} +685 -55
- package/dist/app/controllers/tableResize/tableResizeGeometry.d.ts +3 -2
- package/dist/app/controllers/tableResize/tableResizeHitTest.d.ts +3 -2
- package/dist/app/controllers/useEditorLayout.d.ts +2 -0
- package/dist/app/controllers/useEditorNavigation.d.ts +4 -1
- package/dist/app/controllers/useEditorTableResize.d.ts +5 -1
- package/dist/{index-DdcPkCmB.js → index-4uLtMJwI.js} +13706 -14175
- package/dist/layoutProjection/index.d.ts +1 -0
- package/dist/layoutProjection/layoutMetricsEpoch.d.ts +2 -0
- package/dist/oasis-editor.js +55 -55
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/OasisEditorEditor.d.ts +3 -2
- package/dist/ui/app/EditorDragLayers.d.ts +5 -1
- package/dist/ui/app/EditorWorkspace.d.ts +2 -1
- package/dist/ui/app/buildEditorViewProps.d.ts +2 -0
- package/dist/ui/app/createEditorDocumentRuntime.d.ts +2 -0
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +2 -0
- package/dist/ui/app/useCanvasSurfaceHitResolver.d.ts +4 -3
- package/dist/ui/app/useEditorInteractionWiring.d.ts +2 -0
- package/dist/ui/canvas/canvasLayoutSnapshotProvider.d.ts +14 -0
- package/dist/ui/canvas/canvasSnapshotTypes.d.ts +2 -3
- package/dist/ui/canvas/canvasTextMeasurer.d.ts +3 -0
- package/dist/ui/components/DropCaret.d.ts +5 -1
- package/dist/ui/components/Outline/OutlinePanel.d.ts +5 -1
- package/dist/ui/editorUiTypes.d.ts +2 -1
- package/dist/ui/shells/DocumentShell.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Accessor, JSX } from 'solid-js';
|
|
2
2
|
import { ToolbarHost } from './components/Toolbar/state/createToolbarApi.js';
|
|
3
|
-
import { EditorLayoutParagraph, EditorState } from '../core/model.js';
|
|
3
|
+
import { EditorLayoutDocument, EditorLayoutParagraph, EditorState } from '../core/model.js';
|
|
4
4
|
import { ImportProgressState } from '../app/controllers/useEditorDocumentIO.js';
|
|
5
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;
|
|
9
9
|
export interface OasisEditorEditorLayoutProps {
|
|
10
|
+
documentLayout: Accessor<EditorLayoutDocument>;
|
|
10
11
|
measuredBlockHeights?: Accessor<Record<string, number>>;
|
|
11
12
|
measuredParagraphLayouts?: Accessor<Record<string, EditorLayoutParagraph>>;
|
|
12
13
|
viewportHeight?: number | string;
|
|
@@ -105,7 +106,7 @@ export interface OasisEditorEditorFileHandlers {
|
|
|
105
106
|
}
|
|
106
107
|
export interface OasisEditorEditorProps {
|
|
107
108
|
state: Accessor<EditorState>;
|
|
108
|
-
layout
|
|
109
|
+
layout: OasisEditorEditorLayoutProps;
|
|
109
110
|
overlays: OasisEditorEditorOverlayProps;
|
|
110
111
|
refs?: OasisEditorEditorRefProps;
|
|
111
112
|
surfaceHandlers: OasisEditorEditorSurfaceHandlers;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EditorState } from '../../core/model.js';
|
|
1
|
+
import { EditorLayoutDocument, EditorState } from '../../core/model.js';
|
|
2
|
+
import { CanvasLayoutSnapshotProvider } from '../canvas/canvasLayoutSnapshotProvider.js';
|
|
2
3
|
import { createEditorImageOperations } from '../../app/controllers/useEditorImageOperations.js';
|
|
3
4
|
import { createEditorTableResize } from '../../app/controllers/useEditorTableResize.js';
|
|
4
5
|
import { createEditorTableDrag } from '../../app/controllers/useEditorTableDrag.js';
|
|
@@ -7,6 +8,9 @@ import { createEditorTextDrag } from '../../app/controllers/useEditorTextDrag.js
|
|
|
7
8
|
export interface EditorDragLayersProps {
|
|
8
9
|
state: EditorState;
|
|
9
10
|
surfaceRef: HTMLDivElement | undefined;
|
|
11
|
+
documentLayout: () => EditorLayoutDocument;
|
|
12
|
+
snapshotProvider: CanvasLayoutSnapshotProvider;
|
|
13
|
+
zoomFactor?: () => number;
|
|
10
14
|
tableResize: ReturnType<typeof createEditorTableResize>;
|
|
11
15
|
imageOps: ReturnType<typeof createEditorImageOperations>;
|
|
12
16
|
tableDrag: ReturnType<typeof createEditorTableDrag>;
|
|
@@ -4,7 +4,7 @@ import { ShellProps } from '../shells/DocumentShell.js';
|
|
|
4
4
|
import { ToolbarHost } from '../components/Toolbar/state/createToolbarApi.js';
|
|
5
5
|
import { ToolbarRegistry } from '../components/Toolbar/registry/ToolbarRegistry.js';
|
|
6
6
|
import { MenuRegistry } from '../components/Menubar/menuRegistry.js';
|
|
7
|
-
import { EditorLayoutParagraph, EditorState } from '../../core/model.js';
|
|
7
|
+
import { EditorLayoutDocument, EditorLayoutParagraph, EditorState } from '../../core/model.js';
|
|
8
8
|
import { ToolbarLayoutMode, ToolbarViewMode } from '../OasisEditorAppProps.js';
|
|
9
9
|
import { OasisEditor } from '../../core/plugin.js';
|
|
10
10
|
|
|
@@ -34,6 +34,7 @@ export interface EditorWorkspaceView {
|
|
|
34
34
|
viewportHeight: () => number | string | undefined;
|
|
35
35
|
measuredBlockHeights: Accessor<Record<string, number>>;
|
|
36
36
|
measuredParagraphLayouts: Accessor<Record<string, EditorLayoutParagraph>>;
|
|
37
|
+
documentLayout: Accessor<EditorLayoutDocument>;
|
|
37
38
|
layout: OasisEditorEditorLayoutProps;
|
|
38
39
|
overlays: OasisEditorEditorOverlayProps;
|
|
39
40
|
refs: OasisEditorEditorRefProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Accessor, JSX } from 'solid-js';
|
|
2
2
|
import { CaretBox, CommentHighlightBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../editorUiTypes.js';
|
|
3
|
+
import { EditorLayoutDocument } from '../../core/model.js';
|
|
3
4
|
import { OasisEditorEditorFileHandlers, OasisEditorEditorInputHandlers, OasisEditorEditorLayoutProps, OasisEditorEditorOverlayProps, OasisEditorEditorRefProps, OasisEditorEditorSurfaceHandlers } from '../OasisEditorEditor.js';
|
|
4
5
|
import { createEditorFocusController } from './useEditorFocus.js';
|
|
5
6
|
import { createEditorSurfaceEvents } from '../../app/controllers/useEditorSurfaceEvents.js';
|
|
@@ -11,6 +12,7 @@ import { createEditorRevisionController } from '../../app/controllers/useEditorR
|
|
|
11
12
|
type ImportProgress = NonNullable<ReturnType<NonNullable<OasisEditorEditorOverlayProps["importProgress"]>>>;
|
|
12
13
|
/** Page sizing / zoom inputs that shape the layout prop bundle. */
|
|
13
14
|
export interface EditorViewLayoutInput {
|
|
15
|
+
documentLayout: Accessor<EditorLayoutDocument>;
|
|
14
16
|
viewportHeight: number | string | undefined;
|
|
15
17
|
className: string | undefined;
|
|
16
18
|
style: JSX.CSSProperties | undefined;
|
|
@@ -50,6 +50,8 @@ export declare function createEditorDocumentRuntime(deps: EditorDocumentRuntimeD
|
|
|
50
50
|
isImportInProgress: () => boolean;
|
|
51
51
|
measuredBlockHeights: import('solid-js').Accessor<Record<string, number>>;
|
|
52
52
|
measuredParagraphLayouts: import('solid-js').Accessor<Record<string, import('../../core/model.js').EditorLayoutParagraph>>;
|
|
53
|
+
documentLayout: import('solid-js').Accessor<import('../../core/model.js').EditorLayoutDocument>;
|
|
54
|
+
canvasSnapshotProvider: import('../canvas/canvasLayoutSnapshotProvider.js').CanvasLayoutSnapshotProvider;
|
|
53
55
|
inputBox: import('solid-js').Accessor<import('../editorUiTypes.js').InputBox>;
|
|
54
56
|
selectionBoxes: import('solid-js').Accessor<import('../editorUiTypes.js').SelectionBox[]>;
|
|
55
57
|
commentHighlights: import('solid-js').Accessor<import('../editorUiTypes.js').CommentHighlightBox[]>;
|
|
@@ -30,6 +30,8 @@ export interface EditorInteractionRuntimeDeps {
|
|
|
30
30
|
setPreferredColumnX: DocRuntime["setPreferredColumnX"];
|
|
31
31
|
measuredBlockHeights: DocRuntime["measuredBlockHeights"];
|
|
32
32
|
measuredParagraphLayouts: DocRuntime["measuredParagraphLayouts"];
|
|
33
|
+
documentLayout: DocRuntime["documentLayout"];
|
|
34
|
+
canvasSnapshotProvider: DocRuntime["canvasSnapshotProvider"];
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Phase B of the editor runtime: selection queries, the hit resolver, find &
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
-
import {
|
|
2
|
+
import { EditorLayoutDocument, EditorState } from '../../core/model.js';
|
|
3
3
|
import { SurfaceHit } from '../canvas/CanvasHitTestService.js';
|
|
4
|
+
import { CanvasLayoutSnapshotProvider } from '../canvas/canvasLayoutSnapshotProvider.js';
|
|
4
5
|
|
|
5
6
|
export declare function createCanvasSurfaceHitResolver(deps: {
|
|
6
7
|
state: Accessor<EditorState>;
|
|
7
8
|
surfaceRef: Accessor<HTMLDivElement | null>;
|
|
8
9
|
viewportRef: Accessor<HTMLElement | null>;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
documentLayout: Accessor<EditorLayoutDocument>;
|
|
11
|
+
canvasSnapshotProvider: CanvasLayoutSnapshotProvider;
|
|
11
12
|
zoomFactor: Accessor<number>;
|
|
12
13
|
}): {
|
|
13
14
|
resolveSurfaceHitAtPoint: (clientX: number, clientY: number, context?: {
|
|
@@ -39,6 +39,8 @@ export interface EditorInteractionWiringContext {
|
|
|
39
39
|
preferredColumnX: NavigationParams["preferredColumnX"];
|
|
40
40
|
setPreferredColumnX: NavigationParams["setPreferredColumnX"];
|
|
41
41
|
zoomFactor: NavigationParams["zoomFactor"];
|
|
42
|
+
documentLayout: NavigationParams["documentLayout"];
|
|
43
|
+
canvasSnapshotProvider: NavigationParams["canvasSnapshotProvider"];
|
|
42
44
|
resolveSurfaceHitAtPoint: TextDragParams["resolveSurfaceHitAtPoint"];
|
|
43
45
|
resolvePositionAtSurfacePoint: TableDragParams["resolvePositionAtSurfacePoint"];
|
|
44
46
|
tableOps: ReturnType<typeof createEditorTableOperations>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditorLayoutDocument, EditorState } from '../../core/model.js';
|
|
2
|
+
import { CanvasLayoutSnapshot } from './canvasSnapshotTypes.js';
|
|
3
|
+
|
|
4
|
+
export interface CanvasLayoutSnapshotProvider {
|
|
5
|
+
getCanvasLayoutSnapshot(options: {
|
|
6
|
+
surface: HTMLElement;
|
|
7
|
+
state: EditorState;
|
|
8
|
+
documentLayout: EditorLayoutDocument;
|
|
9
|
+
zoomFactor?: number;
|
|
10
|
+
}): CanvasLayoutSnapshot | null;
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function getCanvasPageRectSignature(surface: HTMLElement): string;
|
|
14
|
+
export declare function createCanvasLayoutSnapshotProvider(): CanvasLayoutSnapshotProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorEditingZone,
|
|
1
|
+
import { EditorEditingZone, EditorLayoutDocument, EditorParagraphNode, EditorPosition, EditorState, EditorTextBoxData } from '../../core/model.js';
|
|
2
2
|
import { CanvasUnsupportedReason } from './CanvasTableLayout.js';
|
|
3
3
|
import { VerticalRenderMode } from './verticalText.js';
|
|
4
4
|
|
|
@@ -156,8 +156,7 @@ export interface CanvasLayoutSnapshot {
|
|
|
156
156
|
export interface BuildCanvasLayoutSnapshotOptions {
|
|
157
157
|
surface: HTMLElement;
|
|
158
158
|
state: EditorState;
|
|
159
|
-
|
|
160
|
-
measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>;
|
|
159
|
+
documentLayout: EditorLayoutDocument;
|
|
161
160
|
/**
|
|
162
161
|
* Visual zoom factor (CSS `transform: scale(z)`) applied to the surface. The
|
|
163
162
|
* snapshot is built in "screen-anchored local" space so it is invariant under
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EditorLayoutDocument, EditorPosition, EditorState } from '../../core/model.js';
|
|
2
|
+
import { CanvasLayoutSnapshotProvider } from '../canvas/canvasLayoutSnapshotProvider.js';
|
|
2
3
|
|
|
3
4
|
export declare function DropCaret(props: {
|
|
4
5
|
surfaceRef: HTMLDivElement | undefined;
|
|
5
6
|
state: EditorState;
|
|
7
|
+
documentLayout: () => EditorLayoutDocument;
|
|
8
|
+
snapshotProvider: CanvasLayoutSnapshotProvider;
|
|
9
|
+
zoomFactor?: () => number;
|
|
6
10
|
targetPos: () => EditorPosition;
|
|
7
11
|
pointerPos?: () => {
|
|
8
12
|
x: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EditorState } from '../../../core/model.js';
|
|
1
|
+
import { EditorState, EditorLayoutDocument } from '../../../core/model.js';
|
|
2
|
+
import { CanvasLayoutSnapshotProvider } from '../../canvas/canvasLayoutSnapshotProvider.js';
|
|
2
3
|
|
|
3
4
|
export interface OutlinePanelProps {
|
|
4
5
|
state: EditorState;
|
|
@@ -6,5 +7,8 @@ export interface OutlinePanelProps {
|
|
|
6
7
|
defaultCollapsed?: boolean;
|
|
7
8
|
surfaceRef?: () => HTMLDivElement | undefined;
|
|
8
9
|
viewportRef?: () => HTMLDivElement | undefined;
|
|
10
|
+
documentLayout: () => EditorLayoutDocument;
|
|
11
|
+
zoomFactor?: () => number;
|
|
12
|
+
snapshotProvider: CanvasLayoutSnapshotProvider;
|
|
9
13
|
}
|
|
10
14
|
export declare function OutlinePanel(props: OutlinePanelProps): import("solid-js").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
-
import {
|
|
2
|
+
import { EditorLayoutDocument, EditorLayoutParagraph, EditorState } from '../core/model.js';
|
|
3
3
|
import { WrapPreset } from '../core/commands/floatingLayout.js';
|
|
4
4
|
import { ResizeHandleDirection } from './resizeGeometry.js';
|
|
5
5
|
export interface InputBox {
|
|
@@ -72,6 +72,7 @@ export interface LayoutOptionsOverlay {
|
|
|
72
72
|
}
|
|
73
73
|
export interface EditorSurfaceProps {
|
|
74
74
|
state: Accessor<EditorState>;
|
|
75
|
+
documentLayout: Accessor<EditorLayoutDocument>;
|
|
75
76
|
measuredBlockHeights?: Accessor<Record<string, number>>;
|
|
76
77
|
measuredParagraphLayouts?: Accessor<Record<string, EditorLayoutParagraph>>;
|
|
77
78
|
/**
|
|
@@ -3,7 +3,7 @@ import { OasisEditorEditorFileHandlers, OasisEditorEditorInputHandlers, OasisEdi
|
|
|
3
3
|
import { ToolbarHost } from '../components/Toolbar/state/createToolbarApi.js';
|
|
4
4
|
import { ToolbarRegistry } from '../components/Toolbar/registry/ToolbarRegistry.js';
|
|
5
5
|
import { MenuRegistry } from '../components/Menubar/menuRegistry.js';
|
|
6
|
-
import { EditorLayoutParagraph, EditorState } from '../../core/model.js';
|
|
6
|
+
import { EditorLayoutDocument, EditorLayoutParagraph, EditorState } from '../../core/model.js';
|
|
7
7
|
import { ToolbarLayoutMode, ToolbarViewMode } from '../OasisEditorAppProps.js';
|
|
8
8
|
import { OasisEditor } from '../../core/plugin.js';
|
|
9
9
|
|
|
@@ -24,9 +24,10 @@ export interface ShellProps {
|
|
|
24
24
|
isReadOnly: boolean;
|
|
25
25
|
measuredBlockHeights: Accessor<Record<string, number>>;
|
|
26
26
|
measuredParagraphLayouts: Accessor<Record<string, EditorLayoutParagraph>>;
|
|
27
|
+
documentLayout: Accessor<EditorLayoutDocument>;
|
|
27
28
|
viewportHeight: Accessor<number | string | undefined>;
|
|
28
29
|
showFloatingTableToolbar: Accessor<boolean>;
|
|
29
|
-
layout: Omit<OasisEditorEditorLayoutProps, "measuredBlockHeights" | "measuredParagraphLayouts" | "viewportHeight" | "readOnly">;
|
|
30
|
+
layout: Omit<OasisEditorEditorLayoutProps, "documentLayout" | "measuredBlockHeights" | "measuredParagraphLayouts" | "viewportHeight" | "readOnly">;
|
|
30
31
|
overlays: Omit<OasisEditorEditorOverlayProps, "toolbarHost" | "persistenceStatus" | "showFloatingTableToolbar">;
|
|
31
32
|
refs: OasisEditorEditorRefProps;
|
|
32
33
|
surfaceHandlers: OasisEditorEditorSurfaceHandlers;
|