oasis-editor 0.0.114 → 0.0.116
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-XloOiKSu.js → OasisEditorApp-DY_N4M54.js} +424 -366
- package/dist/adapters/react.d.ts +11 -0
- package/dist/adapters/ui.d.ts +2 -0
- package/dist/adapters/vue.d.ts +23 -0
- package/dist/assets/{importDocxWorker-D0F0jbcF.js → importDocxWorker-nIS-zjkj.js} +1 -1
- package/dist/core/decorationGeometry.d.ts +10 -0
- package/dist/core/gradientAxis.d.ts +11 -0
- package/dist/core/html/inlineImageParser.d.ts +7 -0
- package/dist/core/layoutConstants.d.ts +18 -0
- package/dist/core/textStyleMappings.d.ts +2 -0
- package/dist/export/pdf/draw/drawFragment.d.ts +4 -4
- package/dist/export/pdf/draw/fragment/pdfColor.d.ts +1 -0
- package/dist/export/pdf/draw/fragment/pdfEmphasisAndTabLeaders.d.ts +5 -0
- package/dist/export/pdf/draw/fragment/pdfGradient.d.ts +4 -0
- package/dist/export/pdf/draw/fragment/pdfRunBackground.d.ts +12 -0
- package/dist/export/pdf/draw/fragment/pdfTextChunks.d.ts +25 -0
- package/dist/export/pdf/draw/fragment/pdfTextDecoration.d.ts +4 -0
- package/dist/{index-CwpzM--5.js → index-DLKF27_V.js} +1211 -1121
- package/dist/layoutProjection/blocksPaginationTypes.d.ts +2 -0
- package/dist/layoutProjection/headerFooterLayoutContext.d.ts +2 -0
- package/dist/layoutProjection/paginationTrack.d.ts +2 -0
- package/dist/layoutProjection/paragraphPagination.d.ts +8 -3
- package/dist/layoutProjection/sectionPagination.d.ts +3 -0
- package/dist/layoutProjection/tableRowSlicing.d.ts +2 -1
- package/dist/oasis-editor.js +55 -55
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/react.d.ts +7 -8
- package/dist/react.js +18 -22
- package/dist/ui/canvas/CanvasTableLayout.d.ts +12 -63
- package/dist/ui/canvas/canvasParagraphPainter.d.ts +4 -22
- package/dist/ui/canvas/paragraph/canvasEmphasis.d.ts +3 -0
- package/dist/ui/canvas/paragraph/canvasInlineImage.d.ts +26 -0
- package/dist/ui/canvas/paragraph/canvasRunBackground.d.ts +13 -0
- package/dist/ui/canvas/paragraph/canvasTabLeaders.d.ts +4 -0
- package/dist/ui/canvas/paragraph/canvasTextDecoration.d.ts +4 -0
- package/dist/ui/canvas/paragraph/canvasTextEffects.d.ts +43 -0
- package/dist/ui/canvas/table/assembleCellEntries.d.ts +15 -0
- package/dist/ui/canvas/table/prepareCells.d.ts +53 -0
- package/dist/ui/canvas/table/resolveRowHeights.d.ts +9 -0
- package/dist/ui/canvas/table/tableCellGeometry.d.ts +37 -0
- package/dist/ui/canvas/table/types.d.ts +63 -0
- package/dist/ui/components/FindReplace/FindReplaceDialog.d.ts +1 -2
- package/dist/ui/components/Menubar/Menubar.d.ts +1 -2
- package/dist/ui/components/PageBreak.d.ts +1 -1
- package/dist/ui.d.ts +2 -42
- package/dist/ui.js +19 -18
- package/dist/utils/performanceMetrics.d.ts +0 -6
- package/dist/utils/round.d.ts +7 -0
- package/dist/vue.d.ts +22 -8
- package/dist/vue.js +18 -24
- package/package.json +9 -6
package/dist/react.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OasisEditorAppProps, OasisEditorClient } from '../index.ts';
|
|
3
3
|
|
|
4
4
|
export type ReactOasisEditorProps = OasisEditorAppProps & {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Receives the mounted Oasis client. Props are mount-only for this adapter;
|
|
7
|
+
* remount the component to apply a new editor configuration.
|
|
8
|
+
*/
|
|
9
|
+
onClient?: (client: OasisEditorClient) => void;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
11
|
export declare const OasisEditor: React.FC<ReactOasisEditorProps>;
|
package/dist/react.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { mount } from "oasis-editor";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
props.onClient?.(instanceRef.current);
|
|
12
|
-
}
|
|
13
|
-
return () => {
|
|
14
|
-
instanceRef.current?.unmount();
|
|
15
|
-
instanceRef.current = null;
|
|
1
|
+
import f, { useRef as i, useEffect as a } from "react";
|
|
2
|
+
import { mount as m } from "oasis-editor";
|
|
3
|
+
const R = (e) => {
|
|
4
|
+
var r, u;
|
|
5
|
+
const n = i(null), t = i(null);
|
|
6
|
+
return a(() => {
|
|
7
|
+
var c;
|
|
8
|
+
return n.current && (t.current = m(n.current, e), (c = e.onClient) == null || c.call(e, t.current)), () => {
|
|
9
|
+
var l;
|
|
10
|
+
(l = t.current) == null || l.unmount(), t.current = null;
|
|
16
11
|
};
|
|
17
|
-
}, [])
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className: props.ui?.class,
|
|
22
|
-
style: props.ui?.style,
|
|
12
|
+
}, []), f.createElement("div", {
|
|
13
|
+
ref: n,
|
|
14
|
+
className: (r = e.ui) == null ? void 0 : r.class,
|
|
15
|
+
style: (u = e.ui) == null ? void 0 : u.style
|
|
23
16
|
});
|
|
24
|
-
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
R as OasisEditor
|
|
20
|
+
};
|
|
@@ -1,73 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { projectParagraphLayout } from '../../layoutProjection/index.js';
|
|
3
|
-
import { VerticalRenderMode } from './verticalText.js';
|
|
1
|
+
import { EditorState, EditorTableNode } from '../../core/model.js';
|
|
4
2
|
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export interface CanvasTableParagraphLayoutEntry {
|
|
13
|
-
paragraph: EditorParagraphNode;
|
|
14
|
-
lines: ReturnType<typeof projectParagraphLayout>["lines"];
|
|
3
|
+
export type { CanvasUnsupportedReason, CanvasTableBorderSpec, CanvasTableParagraphLayoutEntry, CanvasTableCellLayoutEntry, CanvasTableLayoutResult, } from './table/types.js';
|
|
4
|
+
export { resolveCanvasTableWidth } from './table/tableCellGeometry.js';
|
|
5
|
+
export declare function buildCanvasTableLayout(options: {
|
|
6
|
+
table: EditorTableNode;
|
|
7
|
+
state: EditorState;
|
|
8
|
+
pageIndex: number;
|
|
15
9
|
originX: number;
|
|
16
10
|
originY: number;
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
}
|
|
20
|
-
export interface CanvasTableCellLayoutEntry {
|
|
21
|
-
tableId: string;
|
|
22
|
-
rowIndex: number;
|
|
23
|
-
cellIndex: number;
|
|
24
|
-
left: number;
|
|
25
|
-
top: number;
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
contentLeft: number;
|
|
29
|
-
contentTop: number;
|
|
30
11
|
contentWidth: number;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
anchorPosition: EditorPosition;
|
|
34
|
-
padding: {
|
|
35
|
-
top: number;
|
|
36
|
-
right: number;
|
|
37
|
-
bottom: number;
|
|
38
|
-
left: number;
|
|
39
|
-
};
|
|
40
|
-
borders: {
|
|
41
|
-
top: CanvasTableBorderSpec;
|
|
42
|
-
right: CanvasTableBorderSpec;
|
|
43
|
-
bottom: CanvasTableBorderSpec;
|
|
44
|
-
left: CanvasTableBorderSpec;
|
|
45
|
-
topLeftToBottomRight?: CanvasTableBorderSpec;
|
|
46
|
-
topRightToBottomLeft?: CanvasTableBorderSpec;
|
|
47
|
-
};
|
|
48
|
-
paragraphs: CanvasTableParagraphLayoutEntry[];
|
|
49
|
-
/** Vertical text flow inside this cell (`horizontal` when not rotated). */
|
|
50
|
-
verticalMode: VerticalRenderMode;
|
|
51
|
-
revision?: EditorRevisionMetadata & {
|
|
52
|
-
type: "insert" | "delete" | "merge" | "property";
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export interface CanvasTableLayoutResult {
|
|
12
|
+
estimatedHeight: number;
|
|
13
|
+
}): {
|
|
56
14
|
tableId: string;
|
|
57
15
|
left: number;
|
|
58
16
|
top: number;
|
|
59
17
|
width: number;
|
|
60
18
|
height: number;
|
|
61
19
|
rowHeights: number[];
|
|
62
|
-
cells: CanvasTableCellLayoutEntry[];
|
|
63
|
-
unsupported: CanvasUnsupportedReason[];
|
|
64
|
-
}
|
|
65
|
-
export declare function buildCanvasTableLayout(options: {
|
|
66
|
-
table: EditorTableNode;
|
|
67
|
-
state: EditorState;
|
|
68
|
-
pageIndex: number;
|
|
69
|
-
originX: number;
|
|
70
|
-
originY: number;
|
|
71
|
-
contentWidth: number;
|
|
72
|
-
estimatedHeight: number;
|
|
73
|
-
}): CanvasTableLayoutResult;
|
|
20
|
+
cells: import('./CanvasTableLayout.js').CanvasTableCellLayoutEntry[];
|
|
21
|
+
unsupported: import('./CanvasTableLayout.js').CanvasUnsupportedReason[];
|
|
22
|
+
};
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
import { EditorLayoutLine,
|
|
1
|
+
import { EditorLayoutLine, EditorParagraphNode, EditorState } from '../../core/model.js';
|
|
2
2
|
import { CanvasBlockPainters } from './canvasBlockPainters.js';
|
|
3
|
+
import { drawFloatingImagesForParagraph } from './paragraph/canvasInlineImage.js';
|
|
3
4
|
|
|
4
5
|
export { applyCanvasTextFeatureHints, resolveCanvasFontFamily, resolveCanvasTextRenderMetrics, resolveCanvasRunPaintStyle, } from './canvasFontResolution.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* `drawFloatingTextBoxesForParagraph`. Split into `behind`/`front` layers so a
|
|
8
|
-
* `behindDoc` image renders under the text and others render over it.
|
|
9
|
-
*/
|
|
10
|
-
export declare function drawFloatingImagesForParagraph(options: {
|
|
11
|
-
ctx: CanvasRenderingContext2D;
|
|
12
|
-
paragraphLines: EditorLayoutLine[];
|
|
13
|
-
state: EditorState;
|
|
14
|
-
pageSettings: EditorPageSettings;
|
|
15
|
-
contentLeft: number;
|
|
16
|
-
contentTop: number;
|
|
17
|
-
contentWidth: number;
|
|
18
|
-
paragraphTop: number;
|
|
19
|
-
onUpdate: () => void;
|
|
20
|
-
layer: "behind" | "front";
|
|
21
|
-
}): void;
|
|
6
|
+
export { resolveFragmentPaintBounds } from './paragraph/canvasRunBackground.js';
|
|
7
|
+
export { drawFloatingImagesForParagraph };
|
|
22
8
|
export declare function drawParagraph(ctx: CanvasRenderingContext2D, paragraph: EditorParagraphNode, lines: EditorLayoutLine[], state: EditorState, originX: number, originY: number, onUpdate: () => void, painters: CanvasBlockPainters, pageIndex?: number): void;
|
|
23
|
-
export declare function resolveFragmentPaintBounds(line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number]): {
|
|
24
|
-
left: number;
|
|
25
|
-
right: number;
|
|
26
|
-
} | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EditorLayoutLine } from '../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare function drawFragmentEmphasis(ctx: CanvasRenderingContext2D, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], slotByOffset: Map<number, EditorLayoutLine["slots"][number]>, originX: number, originY: number, mark: string, color: string): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EditorImageRunData, EditorLayoutLine, EditorPageSettings, EditorState } from '../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Draw an inline image fragment, honoring crop (`a:srcRect`), rotation
|
|
5
|
+
* (`a:xfrm/@rot`) and horizontal/vertical flips.
|
|
6
|
+
*/
|
|
7
|
+
export declare function drawImageFragment(ctx: CanvasRenderingContext2D, img: CanvasImageSource & {
|
|
8
|
+
naturalWidth: number;
|
|
9
|
+
naturalHeight: number;
|
|
10
|
+
}, image: EditorImageRunData, x: number, y: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* Draws the floating images anchored within a paragraph (behind or front layer).
|
|
13
|
+
*/
|
|
14
|
+
export declare function drawFloatingImagesForParagraph(options: {
|
|
15
|
+
ctx: CanvasRenderingContext2D;
|
|
16
|
+
paragraphLines: EditorLayoutLine[];
|
|
17
|
+
state: EditorState;
|
|
18
|
+
pageSettings: EditorPageSettings;
|
|
19
|
+
contentLeft: number;
|
|
20
|
+
contentTop: number;
|
|
21
|
+
contentWidth: number;
|
|
22
|
+
paragraphTop: number;
|
|
23
|
+
onUpdate: () => void;
|
|
24
|
+
layer: "behind" | "front";
|
|
25
|
+
}): void;
|
|
26
|
+
export declare function drawInlineImageFragment(ctx: CanvasRenderingContext2D, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], state: EditorState, originX: number, originY: number, onUpdate: () => void): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditorLayoutLine } from '../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare function resolveFragmentPaintBounds(line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number]): {
|
|
4
|
+
left: number;
|
|
5
|
+
right: number;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare function drawFragmentHighlight(ctx: CanvasRenderingContext2D, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], originX: number, originY: number, color: string): void;
|
|
8
|
+
export declare function drawFragmentShading(ctx: CanvasRenderingContext2D, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], originX: number, originY: number, color: string): void;
|
|
9
|
+
export declare function drawFragmentBorder(ctx: CanvasRenderingContext2D, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], originX: number, originY: number, border: {
|
|
10
|
+
width: number;
|
|
11
|
+
type: "solid" | "dashed" | "dotted" | "none";
|
|
12
|
+
color: string;
|
|
13
|
+
}): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EditorLayoutLine, EditorParagraphNode, EditorState } from '../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare function resolveTabLeader(paragraph: EditorParagraphNode, line: EditorLayoutLine, tabLeft: number, state: EditorState): "dot" | "hyphen" | "underscore" | "heavy" | "middleDot" | undefined;
|
|
4
|
+
export declare function drawTabLeader(ctx: CanvasRenderingContext2D, leader: NonNullable<ReturnType<typeof resolveTabLeader>>, x1: number, x2: number, y: number): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UnderlineStyle } from '../../../core/textStyleMappings.js';
|
|
2
|
+
import { EditorLayoutLine } from '../../../core/model.js';
|
|
3
|
+
|
|
4
|
+
export declare function drawTextDecoration(ctx: CanvasRenderingContext2D, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], originX: number, originY: number, kind: "underline" | "strike" | "doubleStrike", underlineStyle?: UnderlineStyle, underlineColor?: string): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EditorLayoutLine, resolveEffectiveTextStyleForParagraph } from '../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare function hexToRgba(color: string, alpha: number): string;
|
|
4
|
+
export declare function resolveCanvasTextFill(ctx: CanvasRenderingContext2D, styles: ReturnType<typeof resolveEffectiveTextStyleForParagraph>, line: EditorLayoutLine, fragment: EditorLayoutLine["fragments"][number], originX: number, originY: number): string | CanvasGradient;
|
|
5
|
+
export declare function drawStyledText(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, scale: number, styles: {
|
|
6
|
+
outline?: boolean;
|
|
7
|
+
shadow?: boolean;
|
|
8
|
+
emboss?: boolean;
|
|
9
|
+
imprint?: boolean;
|
|
10
|
+
textOutline?: {
|
|
11
|
+
widthPt: number;
|
|
12
|
+
color?: string;
|
|
13
|
+
} | null;
|
|
14
|
+
textShadow?: {
|
|
15
|
+
color: string;
|
|
16
|
+
alpha?: number;
|
|
17
|
+
blurPt: number;
|
|
18
|
+
distPt: number;
|
|
19
|
+
dirDeg: number;
|
|
20
|
+
} | null;
|
|
21
|
+
glow?: {
|
|
22
|
+
color: string;
|
|
23
|
+
alpha?: number;
|
|
24
|
+
radiusPt: number;
|
|
25
|
+
} | null;
|
|
26
|
+
reflection?: {
|
|
27
|
+
blurPt: number;
|
|
28
|
+
startAlpha: number;
|
|
29
|
+
startPos: number;
|
|
30
|
+
endAlpha: number;
|
|
31
|
+
endPos: number;
|
|
32
|
+
distPt: number;
|
|
33
|
+
} | null;
|
|
34
|
+
}): void;
|
|
35
|
+
export declare function drawFragmentReflection(ctx: CanvasRenderingContext2D, fragment: EditorLayoutLine["fragments"][number], slotByOffset: Map<number, EditorLayoutLine["slots"][number]>, styles: ReturnType<typeof resolveEffectiveTextStyleForParagraph>, originX: number, baselineY: number, reflection: {
|
|
36
|
+
blurPt: number;
|
|
37
|
+
startAlpha: number;
|
|
38
|
+
endAlpha: number;
|
|
39
|
+
distPt: number;
|
|
40
|
+
}): void;
|
|
41
|
+
export declare function getRenderedChar(char: string, styles: {
|
|
42
|
+
allCaps?: boolean;
|
|
43
|
+
}): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EditorTableNode } from '../../../core/model.js';
|
|
2
|
+
import { CanvasTableCellLayoutEntry } from './types.js';
|
|
3
|
+
import { PreparedCell } from './prepareCells.js';
|
|
4
|
+
|
|
5
|
+
export declare function assembleCellEntries(options: {
|
|
6
|
+
prepared: PreparedCell[];
|
|
7
|
+
rowHeights: number[];
|
|
8
|
+
rowOffsets: number[];
|
|
9
|
+
columnOffsets: number[];
|
|
10
|
+
tableLeft: number;
|
|
11
|
+
originY: number;
|
|
12
|
+
cellSpacingPx: number;
|
|
13
|
+
table: EditorTableNode;
|
|
14
|
+
}): CanvasTableCellLayoutEntry[];
|
|
15
|
+
export declare function buildRowOffsets(rowHeights: number[], cellSpacingPx: number): number[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EditorParagraphNode, EditorState, EditorTableCellNode, EditorTableNode } from '../../../core/model.js';
|
|
2
|
+
import { projectParagraphLayout } from '../../../layoutProjection/index.js';
|
|
3
|
+
import { VerticalRenderMode } from '../verticalText.js';
|
|
4
|
+
import { buildTableCellLayout } from '../../../core/tableLayout.js';
|
|
5
|
+
import { CanvasTableBorderSpec, CanvasUnsupportedReason } from './types.js';
|
|
6
|
+
|
|
7
|
+
export interface PreparedCell {
|
|
8
|
+
rowIndex: number;
|
|
9
|
+
cellIndex: number;
|
|
10
|
+
cell: EditorTableCellNode;
|
|
11
|
+
visualCol: number;
|
|
12
|
+
colSpan: number;
|
|
13
|
+
rowSpan: number;
|
|
14
|
+
width: number;
|
|
15
|
+
padding: {
|
|
16
|
+
top: number;
|
|
17
|
+
right: number;
|
|
18
|
+
bottom: number;
|
|
19
|
+
left: number;
|
|
20
|
+
};
|
|
21
|
+
borders: {
|
|
22
|
+
top: CanvasTableBorderSpec;
|
|
23
|
+
right: CanvasTableBorderSpec;
|
|
24
|
+
bottom: CanvasTableBorderSpec;
|
|
25
|
+
left: CanvasTableBorderSpec;
|
|
26
|
+
topLeftToBottomRight?: CanvasTableBorderSpec;
|
|
27
|
+
topRightToBottomLeft?: CanvasTableBorderSpec;
|
|
28
|
+
};
|
|
29
|
+
contentWidthPx: number;
|
|
30
|
+
projectedParagraphs: Array<{
|
|
31
|
+
paragraph: EditorParagraphNode;
|
|
32
|
+
lines: ReturnType<typeof projectParagraphLayout>["lines"];
|
|
33
|
+
height: number;
|
|
34
|
+
spacingBefore: number;
|
|
35
|
+
spacingAfter: number;
|
|
36
|
+
}>;
|
|
37
|
+
contentNaturalHeightPx: number;
|
|
38
|
+
verticalMode: VerticalRenderMode;
|
|
39
|
+
}
|
|
40
|
+
export declare function prepareCells(options: {
|
|
41
|
+
table: EditorTableNode;
|
|
42
|
+
sourceTable: EditorTableNode;
|
|
43
|
+
tableEntries: ReturnType<typeof buildTableCellLayout>;
|
|
44
|
+
columnOffsets: number[];
|
|
45
|
+
cellSpacingPx: number;
|
|
46
|
+
visualColumnCount: number;
|
|
47
|
+
effectiveRowStyles: EditorTableNode["rows"][number]["style"][];
|
|
48
|
+
state: EditorState;
|
|
49
|
+
pageIndex: number;
|
|
50
|
+
}): {
|
|
51
|
+
prepared: PreparedCell[];
|
|
52
|
+
unsupported: CanvasUnsupportedReason[];
|
|
53
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EditorTableNode } from '../../../core/model.js';
|
|
2
|
+
import { PreparedCell } from './prepareCells.js';
|
|
3
|
+
|
|
4
|
+
export declare function resolveRowHeights(options: {
|
|
5
|
+
prepared: PreparedCell[];
|
|
6
|
+
table: EditorTableNode;
|
|
7
|
+
effectiveRowStyles: EditorTableNode["rows"][number]["style"][];
|
|
8
|
+
estimatedHeight: number;
|
|
9
|
+
}): number[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EditorBorderStyle, EditorParagraphNode, EditorTableCellNode, EditorTableNode } from '../../../core/model.js';
|
|
2
|
+
import { CanvasTableBorderSpec } from './types.js';
|
|
3
|
+
|
|
4
|
+
export declare function toPx(value: number): number;
|
|
5
|
+
export declare function parseDimensionToPx(value: number | string | undefined): number | null;
|
|
6
|
+
export declare function resolveDefaultBorder(): CanvasTableBorderSpec;
|
|
7
|
+
export declare function resolveBorder(border: EditorBorderStyle | undefined): CanvasTableBorderSpec;
|
|
8
|
+
export declare function resolveCellPadding(cell: EditorTableCellNode): {
|
|
9
|
+
top: number;
|
|
10
|
+
right: number;
|
|
11
|
+
bottom: number;
|
|
12
|
+
left: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function resolveVerticalContentOffset(cell: EditorTableCellNode, contentHeightPx: number, contentNaturalHeightPx: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Returns a paragraph clone whose inline image runs have been scaled
|
|
17
|
+
* down so they never exceed `maxImageWidthPx`. Aspect ratio is preserved.
|
|
18
|
+
* If no image needs shrinking, returns the original paragraph reference.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fitImagesToCellWidth(paragraph: EditorParagraphNode, maxImageWidthPx: number): EditorParagraphNode;
|
|
21
|
+
/**
|
|
22
|
+
* Folds a `characterScale` (percent) into every run of `paragraph`, multiplying
|
|
23
|
+
* any scale a run already carries. Used to compress/expand `w:tcFitText` cell
|
|
24
|
+
* text horizontally so a single line fills the cell's content width.
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyFitTextScale(paragraph: EditorParagraphNode, scalePercent: number): EditorParagraphNode;
|
|
27
|
+
export declare function resolveCanvasTableWidth(table: EditorTableNode, contentWidth: number): number;
|
|
28
|
+
export declare function resolveTableIndentLeft(table: EditorTableNode): number;
|
|
29
|
+
/**
|
|
30
|
+
* `w:tblCellSpacing` resolved to pixels.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveTableCellSpacingPx(table: EditorTableNode): number;
|
|
33
|
+
/**
|
|
34
|
+
* Horizontal offset of the table's left edge from the content origin, honoring
|
|
35
|
+
* `w:jc` (`table.style.align`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveTableLeftOffset(table: EditorTableNode, tableWidth: number, contentWidth: number): number;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EditorParagraphNode, EditorPosition, EditorRevisionMetadata } from '../../../core/model.js';
|
|
2
|
+
import { projectParagraphLayout } from '../../../layoutProjection/index.js';
|
|
3
|
+
import { VerticalRenderMode } from '../verticalText.js';
|
|
4
|
+
|
|
5
|
+
export type CanvasUnsupportedReason = "unsupported:v-span" | "unsupported:v-merge" | "unsupported:nested-table";
|
|
6
|
+
export interface CanvasTableBorderSpec {
|
|
7
|
+
width: number;
|
|
8
|
+
color: string;
|
|
9
|
+
type: "solid" | "dashed" | "dotted" | "none";
|
|
10
|
+
}
|
|
11
|
+
export interface CanvasTableParagraphLayoutEntry {
|
|
12
|
+
paragraph: EditorParagraphNode;
|
|
13
|
+
lines: ReturnType<typeof projectParagraphLayout>["lines"];
|
|
14
|
+
originX: number;
|
|
15
|
+
originY: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
export interface CanvasTableCellLayoutEntry {
|
|
20
|
+
tableId: string;
|
|
21
|
+
rowIndex: number;
|
|
22
|
+
cellIndex: number;
|
|
23
|
+
left: number;
|
|
24
|
+
top: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
contentLeft: number;
|
|
28
|
+
contentTop: number;
|
|
29
|
+
contentWidth: number;
|
|
30
|
+
contentHeight: number;
|
|
31
|
+
shading?: string;
|
|
32
|
+
anchorPosition: EditorPosition;
|
|
33
|
+
padding: {
|
|
34
|
+
top: number;
|
|
35
|
+
right: number;
|
|
36
|
+
bottom: number;
|
|
37
|
+
left: number;
|
|
38
|
+
};
|
|
39
|
+
borders: {
|
|
40
|
+
top: CanvasTableBorderSpec;
|
|
41
|
+
right: CanvasTableBorderSpec;
|
|
42
|
+
bottom: CanvasTableBorderSpec;
|
|
43
|
+
left: CanvasTableBorderSpec;
|
|
44
|
+
topLeftToBottomRight?: CanvasTableBorderSpec;
|
|
45
|
+
topRightToBottomLeft?: CanvasTableBorderSpec;
|
|
46
|
+
};
|
|
47
|
+
paragraphs: CanvasTableParagraphLayoutEntry[];
|
|
48
|
+
/** Vertical text flow inside this cell (`horizontal` when not rotated). */
|
|
49
|
+
verticalMode: VerticalRenderMode;
|
|
50
|
+
revision?: EditorRevisionMetadata & {
|
|
51
|
+
type: "insert" | "delete" | "merge" | "property";
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface CanvasTableLayoutResult {
|
|
55
|
+
tableId: string;
|
|
56
|
+
left: number;
|
|
57
|
+
top: number;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
rowHeights: number[];
|
|
61
|
+
cells: CanvasTableCellLayoutEntry[];
|
|
62
|
+
unsupported: CanvasUnsupportedReason[];
|
|
63
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
2
1
|
import { UseEditorFindReplaceResult } from '../../../app/controllers/useEditorFindReplace.js';
|
|
3
2
|
|
|
4
3
|
export interface FindReplaceDialogProps {
|
|
5
4
|
fr: UseEditorFindReplaceResult;
|
|
6
5
|
}
|
|
7
|
-
export declare function FindReplaceDialog(props: FindReplaceDialogProps): JSX.Element;
|
|
6
|
+
export declare function FindReplaceDialog(props: FindReplaceDialogProps): import("solid-js").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
2
1
|
import { MenuRegistry, MenubarHost } from './menuRegistry.js';
|
|
3
2
|
|
|
4
3
|
export interface MenubarProps {
|
|
5
4
|
host: () => MenubarHost;
|
|
6
5
|
registry: MenuRegistry;
|
|
7
6
|
}
|
|
8
|
-
export declare function Menubar(props: MenubarProps): JSX.Element;
|
|
7
|
+
export declare function Menubar(props: MenubarProps): import("solid-js").JSX.Element;
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
Checkbox,
|
|
4
|
-
ColorPicker,
|
|
5
|
-
Dialog,
|
|
6
|
-
DialogFooter,
|
|
7
|
-
GridPicker,
|
|
8
|
-
IconButton,
|
|
9
|
-
Menu,
|
|
10
|
-
Popover,
|
|
11
|
-
Select,
|
|
12
|
-
SelectField,
|
|
13
|
-
Separator,
|
|
14
|
-
SplitButton,
|
|
15
|
-
Tabs,
|
|
16
|
-
TextField,
|
|
17
|
-
ToolbarButton,
|
|
18
|
-
ToolbarColorPicker,
|
|
19
|
-
} from "oasis-editor";
|
|
20
|
-
|
|
21
|
-
export type {
|
|
22
|
-
ButtonProps,
|
|
23
|
-
CheckboxProps,
|
|
24
|
-
ColorPickerKind,
|
|
25
|
-
ColorPickerProps,
|
|
26
|
-
DialogFooterProps,
|
|
27
|
-
DialogProps,
|
|
28
|
-
GridPickerProps,
|
|
29
|
-
IconButtonProps,
|
|
30
|
-
MenuProps,
|
|
31
|
-
PopoverProps,
|
|
32
|
-
PopoverTriggerApi,
|
|
33
|
-
SelectFieldOption,
|
|
34
|
-
SelectFieldProps,
|
|
35
|
-
SeparatorProps,
|
|
36
|
-
SplitButtonProps,
|
|
37
|
-
TabsItem,
|
|
38
|
-
TabsProps,
|
|
39
|
-
TextFieldProps,
|
|
40
|
-
ToolbarButtonProps,
|
|
41
|
-
ToolbarSelectProps,
|
|
42
|
-
} from "oasis-editor";
|
|
1
|
+
export { Button, Checkbox, ColorPicker, ColorPicker as ToolbarColorPicker, Dialog, DialogFooter, GridPicker, IconButton, Menu, Popover, Select, SelectField, Separator, SplitButton, Tabs, TextField, ToolbarButton, } from '../index.ts';
|
|
2
|
+
export type { ButtonProps, CheckboxProps, ColorPickerKind, ColorPickerProps, DialogFooterProps, DialogProps, GridPickerProps, IconButtonProps, MenuProps, PopoverProps, PopoverTriggerApi, SelectFieldOption, SelectFieldProps, SeparatorProps, SplitButtonProps, TabsItem, TabsProps, TextFieldProps, ToolbarButtonProps, ToolbarSelectProps, } from '../index.ts';
|
package/dist/ui.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { Button as r, Checkbox as t, ColorPicker as l, Dialog as i, DialogFooter as a, GridPicker as c, IconButton as n, Menu as k, Popover as u, Select as P, SelectField as b, Separator as p, SplitButton as B, Tabs as C, TextField as S, ToolbarButton as T, ColorPicker as d } from "oasis-editor";
|
|
1
2
|
export {
|
|
2
|
-
Button,
|
|
3
|
-
Checkbox,
|
|
4
|
-
ColorPicker,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
3
|
+
r as Button,
|
|
4
|
+
t as Checkbox,
|
|
5
|
+
l as ColorPicker,
|
|
6
|
+
i as Dialog,
|
|
7
|
+
a as DialogFooter,
|
|
8
|
+
c as GridPicker,
|
|
9
|
+
n as IconButton,
|
|
10
|
+
k as Menu,
|
|
11
|
+
u as Popover,
|
|
12
|
+
P as Select,
|
|
13
|
+
b as SelectField,
|
|
14
|
+
p as Separator,
|
|
15
|
+
B as SplitButton,
|
|
16
|
+
C as Tabs,
|
|
17
|
+
S as TextField,
|
|
18
|
+
T as ToolbarButton,
|
|
19
|
+
d as ToolbarColorPicker
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rounds `value` to `decimals` fractional digits. Equivalent to the
|
|
3
|
+
* `Math.round(value * 10 ** decimals) / 10 ** decimals` idiom that was repeated
|
|
4
|
+
* across the import, UI and metrics layers (audit #27); results are
|
|
5
|
+
* byte-identical to those inline expressions.
|
|
6
|
+
*/
|
|
7
|
+
export declare function roundTo(value: number, decimals: number): number;
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { OasisEditorAppProps, OasisEditorClient } from "oasis-editor";
|
|
1
|
+
import { OasisEditorAppProps, OasisEditorClient } from '../index.ts';
|
|
3
2
|
|
|
4
|
-
export declare const OasisEditor: DefineComponent<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export declare const OasisEditor: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
config: {
|
|
5
|
+
type: () => OasisEditorAppProps;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
class: StringConstructor;
|
|
9
|
+
style: () => string | Record<string, unknown>;
|
|
10
|
+
onClient: () => (client: OasisEditorClient) => void;
|
|
11
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
14
|
+
config: {
|
|
15
|
+
type: () => OasisEditorAppProps;
|
|
16
|
+
default: () => {};
|
|
17
|
+
};
|
|
18
|
+
class: StringConstructor;
|
|
19
|
+
style: () => string | Record<string, unknown>;
|
|
20
|
+
onClient: () => (client: OasisEditorClient) => void;
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
config: OasisEditorAppProps;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|