@a3s-lab/office 0.12.0 → 0.13.0
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/README.md +99 -6
- package/dist/0~1403.js +20 -12
- package/dist/0~2805.js +241 -241
- package/dist/0~4980.js +1 -1
- package/dist/0~5050.js +1 -20
- package/dist/0~5093.js +547 -547
- package/dist/0~7048.js +31 -29
- package/dist/0~document-editor.js +694 -90
- package/dist/0~pdf-viewer.js +41 -10
- package/dist/0~presentation-editor.js +8 -6
- package/dist/0~spreadsheet-editor.js +11528 -10094
- package/dist/0~work-document-import-worker-client.js +237 -0
- package/dist/0~work-docx-export.js +1 -1
- package/dist/0~work-docx-import.js +1 -1
- package/dist/0~work-docx-large-document-import.js +559 -0
- package/dist/0~work-office-diagnostics.js +46 -32
- package/dist/4104.js +4092 -3210
- package/dist/432.js +51 -7
- package/dist/4476.js +201 -7
- package/dist/5184.js +24 -2
- package/dist/{8928.js → 6282.js} +2338 -93
- package/dist/8715.js +895 -888
- package/dist/9356.js +3 -1
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -9
- package/dist/internal/features/work/editors/document-external-content.d.ts +1 -1
- package/dist/internal/features/work/editors/presentation-slide-canvas.d.ts +3 -1
- package/dist/internal/features/work/editors/presentation-slide-thumbnail.d.ts +3 -2
- package/dist/internal/features/work/editors/presentation-thumbnail-rail.d.ts +2 -1
- package/dist/internal/features/work/editors/presentation-workspace.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-border-ribbon.d.ts +5 -0
- package/dist/internal/features/work/editors/spreadsheet-calculation-projection.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-border-command.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-border.d.ts +14 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill-command.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill.d.ts +12 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-range.d.ts +14 -0
- package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +159 -0
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +8 -4
- package/dist/internal/features/work/editors/spreadsheet-editor-support.d.ts +8 -2
- package/dist/internal/features/work/editors/spreadsheet-home-format-ribbon.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-in-place-workbook-sync.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-operation-projection.d.ts +14 -0
- package/dist/internal/features/work/editors/spreadsheet-structure-selection.d.ts +7 -0
- package/dist/internal/features/work/editors/use-document-pagination.d.ts +5 -0
- package/dist/internal/features/work/editors/use-presentation-design-commands.d.ts +2 -1
- package/dist/internal/features/work/editors/use-spreadsheet-workbook-sync.d.ts +2 -1
- package/dist/internal/features/work/spreadsheet-history-value.d.ts +1 -0
- package/dist/internal/features/work/spreadsheet-sparse.d.ts +6 -1
- package/dist/internal/features/work/work-document-chunk-geometry.d.ts +28 -0
- package/dist/internal/features/work/work-document-chunk-node.d.ts +23 -0
- package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
- package/dist/internal/features/work/work-document-html-fingerprint.d.ts +15 -0
- package/dist/internal/features/work/work-document-import-worker-client.d.ts +13 -0
- package/dist/internal/features/work/work-document-import-worker-protocol.d.ts +36 -0
- package/dist/internal/features/work/work-document-import.worker.d.ts +1 -0
- package/dist/internal/features/work/work-document-incremental-layout.d.ts +1 -1
- package/dist/internal/features/work/work-document-integrity-index.d.ts +14 -0
- package/dist/internal/features/work/work-document-lazy-block.d.ts +3 -0
- package/dist/internal/features/work/work-document-lazy-html.d.ts +21 -0
- package/dist/internal/features/work/work-document-lazy-model.d.ts +29 -0
- package/dist/internal/features/work/work-document-lazy-pagination-measurement.d.ts +3 -0
- package/dist/internal/features/work/work-document-lazy-preview.d.ts +21 -0
- package/dist/internal/features/work/work-document-lazy-update.d.ts +14 -0
- package/dist/internal/features/work/work-document-model.d.ts +18 -2
- package/dist/internal/features/work/work-document-page-surface-registry.d.ts +16 -0
- package/dist/internal/features/work/work-document-pagination-dom.d.ts +1 -0
- package/dist/internal/features/work/work-document-pagination-types.d.ts +1 -0
- package/dist/internal/features/work/work-document-pagination.d.ts +1 -1
- package/dist/internal/features/work/work-document-text-statistics.d.ts +25 -0
- package/dist/internal/features/work/work-document-windowing.d.ts +23 -0
- package/dist/internal/features/work/work-docx-large-document-import.d.ts +35 -0
- package/dist/internal/features/work/work-docx-large-document-parser.d.ts +29 -0
- package/dist/internal/features/work/work-file-import.d.ts +5 -0
- package/dist/internal/features/work/work-file-io.d.ts +3 -3
- package/dist/internal/features/work/work-file-kind.d.ts +5 -0
- package/dist/internal/features/work/work-office-diagnostics.d.ts +10 -1
- package/dist/internal/features/work/work-ooxml-package.d.ts +8 -0
- package/dist/internal/features/work/work-presentation-layouts.d.ts +7 -1
- package/dist/internal/features/work/work-repository.d.ts +1 -0
- package/dist/internal/features/work/work-spreadsheet-compatibility-summary.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-file-export.d.ts +2 -0
- package/dist/internal/features/work/work-spreadsheet-file-import.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-import-diagnostics.d.ts +2 -0
- package/dist/internal/features/work/work-spreadsheet-import-worker-client.d.ts +6 -0
- package/dist/internal/features/work/work-spreadsheet-import-worker-protocol.d.ts +32 -0
- package/dist/internal/features/work/work-spreadsheet-import.worker.d.ts +1 -0
- package/dist/internal/features/work/work-spreadsheet-matrix-profile.d.ts +64 -0
- package/dist/internal/features/work/work-spreadsheet-package-scan-worker-client.d.ts +6 -0
- package/dist/internal/features/work/work-spreadsheet-package-scan-worker-protocol.d.ts +49 -0
- package/dist/internal/features/work/work-spreadsheet-package-scan.worker.d.ts +1 -0
- package/dist/internal/features/work/work-xlsx-formula-diagnostics.d.ts +3 -1
- package/dist/internal/features/work/work-xlsx-formulas.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-interop.d.ts +6 -5
- package/dist/internal/features/work/work-xlsx-pivot-diagnostics.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-plain-fast-path.d.ts +54 -0
- package/dist/internal/features/work/work-xlsx-style-gate.d.ts +1 -0
- package/dist/internal/features/work/work-xlsx-worksheet-scan.d.ts +12 -0
- package/dist/internal/features/work/work-xlsx-worksheet.d.ts +12 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/office-kernel.worker.js +31 -29
- package/dist/react.d.ts +7 -1
- package/dist/styles.css +440 -3
- package/dist/work-document-import.worker.js +558 -0
- package/dist/work-spreadsheet-import.worker.js +24745 -0
- package/dist/work-spreadsheet-import.worker.js.LICENSE.txt +3 -0
- package/dist/work-spreadsheet-package-scan.worker.js +4157 -0
- package/dist/work-spreadsheet-package-scan.worker.js.LICENSE.txt +11 -0
- package/docs/latest/en/browser-editor-architecture.md +351 -15
- package/package.json +19 -1
package/dist/9356.js
CHANGED
|
@@ -51,7 +51,9 @@ class WorkFileImportController {
|
|
|
51
51
|
}
|
|
52
52
|
async yieldToMainThread() {
|
|
53
53
|
this.throwIfAborted();
|
|
54
|
-
|
|
54
|
+
const taskScheduler = globalThis.scheduler;
|
|
55
|
+
if ('function' == typeof taskScheduler?.yield) await taskScheduler.yield();
|
|
56
|
+
else await new Promise((resolve)=>setTimeout(resolve, 0));
|
|
55
57
|
this.throwIfAborted();
|
|
56
58
|
}
|
|
57
59
|
complete() {
|
package/dist/core.js
CHANGED
|
@@ -4,7 +4,7 @@ export { DOCUMENT_SNAPSHOT_MEDIA_TYPE, DOCUMENT_SNAPSHOT_SCHEMA, DOCUMENT_SNAPSH
|
|
|
4
4
|
export { OFFICE_COLLABORATION_NAMESPACE, OFFICE_COLLABORATION_PROTOCOL, OfficeCollaborationError, createOfficeCollaborationSession, readOfficeCollaborationMetadata } from "./9787.js";
|
|
5
5
|
export { assertPdfCollaborationSource, createOfficePdfCollaborationBinding, initializeOfficePdfCollaboration, readOfficePdfCollaboration, readOfficePdfCollaborationSource, replaceOfficePdfCollaboration } from "./3818.js";
|
|
6
6
|
export { createArtifact, createOfficeId, officeTemplates } from "./5184.js";
|
|
7
|
-
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./
|
|
7
|
+
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./6282.js";
|
|
8
8
|
export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
|
|
9
9
|
export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
|
|
10
10
|
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./4476.js";
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { DocumentEditor, MarkdownEditor, PDF_EVIDENCE_COORDINATE_BASIS, PdfViewe
|
|
|
7
7
|
export { OFFICE_COLLABORATION_NAMESPACE, OFFICE_COLLABORATION_PROTOCOL, OfficeCollaborationError, createOfficeCollaborationSession, readOfficeCollaborationMetadata } from "./9787.js";
|
|
8
8
|
export { assertPdfCollaborationSource, createOfficePdfCollaborationBinding, initializeOfficePdfCollaboration, readOfficePdfCollaboration, readOfficePdfCollaborationSource, replaceOfficePdfCollaboration } from "./3818.js";
|
|
9
9
|
export { createArtifact, createOfficeId, officeTemplates } from "./5184.js";
|
|
10
|
-
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./
|
|
10
|
+
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./6282.js";
|
|
11
11
|
export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
|
|
12
12
|
export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
|
|
13
13
|
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./4476.js";
|
|
@@ -3,6 +3,7 @@ import type { WorkspaceContextMenuItem } from '../../workspace/components/worksp
|
|
|
3
3
|
import { type WorkAgentProposalRequest, type WorkAgentProposalTarget } from '../work-agent-proposal';
|
|
4
4
|
import type { WorkEditorAgentRequest } from '../work-agent-request';
|
|
5
5
|
import type { WorkDocumentSelectionAction, WorkDocumentSelectionMenuIcon, WorkDocumentSelectionMenuItem } from '../work-document-selection-menu';
|
|
6
|
+
export { type DocumentTextStatistics, documentTextStatistics, documentWordCount, } from '../work-document-text-statistics';
|
|
6
7
|
export declare function documentEditorSelectionText(editor: Pick<Editor, 'state'>): string;
|
|
7
8
|
export declare function documentAgentMenuItems(selection: string, onAgentRequest: (request: WorkEditorAgentRequest) => void | Promise<void>, proposalOptions?: {
|
|
8
9
|
target: WorkAgentProposalTarget;
|
|
@@ -27,12 +28,3 @@ interface CustomSelectionMenuItem<Context> {
|
|
|
27
28
|
export declare function customSelectionMenuItems<Context>(items: readonly CustomSelectionMenuItem<Context>[], createAction: () => CustomSelectionAction<Context>): WorkspaceContextMenuItem[];
|
|
28
29
|
export declare function documentPageCount(editor: Editor): number;
|
|
29
30
|
export declare function documentCurrentPage(editor: Editor): number;
|
|
30
|
-
export declare function documentWordCount(value: string): number;
|
|
31
|
-
export interface DocumentTextStatistics {
|
|
32
|
-
characterCountWithSpaces: number;
|
|
33
|
-
characterCountWithoutSpaces: number;
|
|
34
|
-
paragraphCount: number;
|
|
35
|
-
wordCount: number;
|
|
36
|
-
}
|
|
37
|
-
export declare function documentTextStatistics(editor: Pick<Editor, 'getText' | 'state'>): DocumentTextStatistics;
|
|
38
|
-
export {};
|
|
@@ -5,7 +5,7 @@ export type ExternalDocumentContentResult = 'applied' | 'unchanged' | 'unsupport
|
|
|
5
5
|
* Returns whether an editor transaction represents a user-authored document
|
|
6
6
|
* change that the controlled host must persist.
|
|
7
7
|
*/
|
|
8
|
-
export declare function shouldPublishDocumentUpdate(transaction: Transaction): boolean;
|
|
8
|
+
export declare function shouldPublishDocumentUpdate(transaction: Transaction, appendedTransactions?: readonly Transaction[]): boolean;
|
|
9
9
|
/**
|
|
10
10
|
* Applies controlled host content as the smallest ProseMirror transaction.
|
|
11
11
|
* This keeps selections, editor instances, and local history stable while an
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type WorkPresentationDesignContent } from '../work-presentation-layouts';
|
|
1
2
|
import type { WorkPresentationContent, WorkSlide, WorkSlideElement } from '../work-types';
|
|
2
|
-
export declare function SlideCanvas({ content, slide, interactive, aspectRatio, showPlaceholders, }: {
|
|
3
|
+
export declare function SlideCanvas({ content, designContent, slide, interactive, aspectRatio, showPlaceholders, }: {
|
|
3
4
|
content?: WorkPresentationContent;
|
|
5
|
+
designContent?: WorkPresentationDesignContent;
|
|
4
6
|
slide: WorkSlide;
|
|
5
7
|
interactive: boolean;
|
|
6
8
|
aspectRatio: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { WorkspaceContextMenuEvent } from '../../workspace/components/workspace-context-menu';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WorkPresentationDesignContent } from '../work-presentation-layouts';
|
|
3
|
+
import type { WorkSlide } from '../work-types';
|
|
3
4
|
export declare function PresentationSlideThumbnail({ content, slide, index, selected, slideCount, aspectRatio, variant, renderPreview, onFocus, onSelect, onDelete, onNavigate, onContextMenu, onDoubleClick, }: {
|
|
4
|
-
content:
|
|
5
|
+
content: WorkPresentationDesignContent;
|
|
5
6
|
slide: WorkSlide;
|
|
6
7
|
index: number;
|
|
7
8
|
selected: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import type { WorkspaceContextMenuEvent } from '../../workspace/components/workspace-context-menu';
|
|
3
|
+
import type { WorkPresentationDesignContent } from '../work-presentation-layouts';
|
|
3
4
|
import type { WorkPresentationContent, WorkSlide, WorkSlideElement } from '../work-types';
|
|
4
5
|
export declare function PresentationThumbnailRail({ aspectRatio, content, designContent, selectedSlide, viewMode, zoom, mobileCloseButtonRef, mobileNavigationModal, mobileNavigationId, onAddSlide, onCloseMobileNavigation, onDeleteSlide, onOpenContextMenu, onSelectSlide, onViewModeChange, }: {
|
|
5
6
|
aspectRatio: string;
|
|
6
7
|
content: WorkPresentationContent;
|
|
7
|
-
designContent:
|
|
8
|
+
designContent: WorkPresentationDesignContent;
|
|
8
9
|
selectedSlide: WorkSlide;
|
|
9
10
|
viewMode: 'normal' | 'sorter';
|
|
10
11
|
zoom: number;
|
|
@@ -2,6 +2,7 @@ import type { Editor } from '@tiptap/core';
|
|
|
2
2
|
import { type PointerEvent, type RefObject } from 'react';
|
|
3
3
|
import type { OfficeKernelPresentationSnapGuide } from '../../../kernel/office-kernel-protocol';
|
|
4
4
|
import { type WorkspaceContextMenuEvent } from '../../workspace/components/workspace-context-menu';
|
|
5
|
+
import type { WorkPresentationDesignContent } from '../work-presentation-layouts';
|
|
5
6
|
import type { WorkPresentationContent, WorkPresentationLayout, WorkPresentationMaster, WorkSlide, WorkSlideElement } from '../work-types';
|
|
6
7
|
import type { PresentationEditorCommands } from './presentation-command-types';
|
|
7
8
|
import type { PresentationDesignMode } from './presentation-editor-types';
|
|
@@ -15,7 +16,7 @@ export interface PresentationWorkspaceProps {
|
|
|
15
16
|
canvasRef: RefObject<HTMLElement | null>;
|
|
16
17
|
commands: PresentationWorkspaceCommands;
|
|
17
18
|
content: WorkPresentationContent;
|
|
18
|
-
designContent:
|
|
19
|
+
designContent: WorkPresentationDesignContent;
|
|
19
20
|
designMode: PresentationDesignMode;
|
|
20
21
|
inheritedElements: WorkSlideElement[];
|
|
21
22
|
placeholderGuides: WorkSlideElement[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
2
|
+
export declare function SpreadsheetBorderRibbon({ can, commands, }: {
|
|
3
|
+
can: SpreadsheetEditorCanCommands;
|
|
4
|
+
commands: SpreadsheetEditorCommands;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -16,6 +16,10 @@ export interface SpreadsheetKernelOperationProjection {
|
|
|
16
16
|
sourceChanged: boolean;
|
|
17
17
|
workbook: SpreadsheetKernelWorkbook;
|
|
18
18
|
}
|
|
19
|
+
export interface SpreadsheetKernelWorkbookPreparation {
|
|
20
|
+
hasFormulaCells: boolean;
|
|
21
|
+
workbook: SpreadsheetKernelWorkbook | null;
|
|
22
|
+
}
|
|
19
23
|
interface SpreadsheetKernelSourceState {
|
|
20
24
|
cellCount: number;
|
|
21
25
|
fingerprintA: bigint;
|
|
@@ -24,6 +28,12 @@ interface SpreadsheetKernelSourceState {
|
|
|
24
28
|
structureKey: string;
|
|
25
29
|
}
|
|
26
30
|
export declare function createSpreadsheetKernelWorkbook(content: Pick<WorkSpreadsheetContent, 'sheets'>): SpreadsheetKernelWorkbook | null;
|
|
31
|
+
/**
|
|
32
|
+
* Prepares automatic calculation without compiling a value-only workbook that
|
|
33
|
+
* cannot produce any formula result. A later formula edit will prepare a fresh
|
|
34
|
+
* snapshot from the updated controlled content.
|
|
35
|
+
*/
|
|
36
|
+
export declare function prepareSpreadsheetKernelWorkbook(content: Pick<WorkSpreadsheetContent, 'sheets'>): SpreadsheetKernelWorkbookPreparation;
|
|
27
37
|
export declare function refreshSpreadsheetKernelWorkbook(sheets: readonly Sheet[], fallbackCells: readonly SpreadsheetKernelFallbackCell[]): SpreadsheetKernelWorkbook | null;
|
|
28
38
|
export declare function projectSpreadsheetKernelWorkbookOperations(previous: SpreadsheetKernelWorkbook, sheets: readonly WorkSpreadsheetSheet[], operations: readonly Op[]): SpreadsheetKernelOperationProjection | null;
|
|
29
39
|
export declare function spreadsheetOperationsMayChangeCalculation(operations: readonly Op[], workbook?: SpreadsheetKernelWorkbook | null): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SpreadsheetCommandContext, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
2
|
+
import { type OfficeEditorExtension } from './office-editor-extension';
|
|
3
|
+
export declare function createSpreadsheetCellBorderExtension(): OfficeEditorExtension<SpreadsheetCommandContext, SpreadsheetEditorCommands>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WorkSpreadsheetContent } from '../work-types';
|
|
2
|
+
import { type SpreadsheetCellRangeInput } from './spreadsheet-cell-range';
|
|
3
|
+
export declare const spreadsheetCellBorderTargets: readonly ["top", "bottom", "left", "right", "none", "all", "outside", "inside", "horizontal", "vertical", "diagonal"];
|
|
4
|
+
export type SpreadsheetCellBorderTarget = (typeof spreadsheetCellBorderTargets)[number];
|
|
5
|
+
export declare const spreadsheetCellBorderStyles: readonly ["thin", "dotted", "dashed", "dash-dot", "dash-dot-dot", "medium", "medium-dashed", "medium-dash-dot", "medium-dash-dot-dot", "thick"];
|
|
6
|
+
export type SpreadsheetCellBorderStyle = (typeof spreadsheetCellBorderStyles)[number];
|
|
7
|
+
export interface SpreadsheetCellBorderFormat {
|
|
8
|
+
target: SpreadsheetCellBorderTarget;
|
|
9
|
+
color: string;
|
|
10
|
+
style: SpreadsheetCellBorderStyle;
|
|
11
|
+
}
|
|
12
|
+
export declare const MAX_SPREADSHEET_DIAGONAL_BORDER_CELLS = 4096;
|
|
13
|
+
export declare function canSetSpreadsheetCellBorders(content: WorkSpreadsheetContent, sheetId: string, range: SpreadsheetCellRangeInput, format: SpreadsheetCellBorderFormat): boolean;
|
|
14
|
+
export declare function setSpreadsheetCellBorders(content: WorkSpreadsheetContent, sheetId: string, range: SpreadsheetCellRangeInput, format: SpreadsheetCellBorderFormat): WorkSpreadsheetContent | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SpreadsheetCommandContext, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
2
|
+
import { type OfficeEditorExtension } from './office-editor-extension';
|
|
3
|
+
export declare function createSpreadsheetCellFillExtension(): OfficeEditorExtension<SpreadsheetCommandContext, SpreadsheetEditorCommands>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkSpreadsheetSheet } from '../work-types';
|
|
2
|
+
import { type SpreadsheetCellRange, type SpreadsheetCellRangeInput } from './spreadsheet-cell-range';
|
|
3
|
+
export declare const spreadsheetCellFillMaximumCells = 50000;
|
|
4
|
+
export type SpreadsheetCellFillDirection = 'down' | 'left' | 'right' | 'up';
|
|
5
|
+
export interface SpreadsheetCellFillPlan {
|
|
6
|
+
applyRange: SpreadsheetCellRange;
|
|
7
|
+
copyRange: SpreadsheetCellRange;
|
|
8
|
+
direction: SpreadsheetCellFillDirection;
|
|
9
|
+
targetCellCount: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function planSpreadsheetCellFill(selection: SpreadsheetCellRangeInput, direction: SpreadsheetCellFillDirection, maximumCells?: number): SpreadsheetCellFillPlan | null;
|
|
12
|
+
export declare function canApplySpreadsheetCellFill(sheet: WorkSpreadsheetSheet | undefined, plan: SpreadsheetCellFillPlan): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SpreadsheetCellRange {
|
|
2
|
+
row: [number, number];
|
|
3
|
+
column: [number, number];
|
|
4
|
+
}
|
|
5
|
+
export interface SpreadsheetCellRangeInput {
|
|
6
|
+
row: readonly number[];
|
|
7
|
+
column: readonly number[];
|
|
8
|
+
}
|
|
9
|
+
export declare function normalizeSpreadsheetCellRange(value: SpreadsheetCellRangeInput): SpreadsheetCellRange | null;
|
|
10
|
+
export declare function parseSpreadsheetCellRange(value: unknown): SpreadsheetCellRange | null;
|
|
11
|
+
export declare function subtractSpreadsheetCellRange(source: SpreadsheetCellRange, removed: SpreadsheetCellRange): SpreadsheetCellRange[];
|
|
12
|
+
export declare function spreadsheetCellRangesIntersect(left: SpreadsheetCellRange, right: SpreadsheetCellRange): boolean;
|
|
13
|
+
export declare function spreadsheetCellRangeContains(range: SpreadsheetCellRange, row: number, column: number): boolean;
|
|
14
|
+
export declare function spreadsheetCellRangeArea(range: SpreadsheetCellRange): number;
|
|
@@ -159,6 +159,119 @@ export declare const spreadsheetCommandCatalog: {
|
|
|
159
159
|
readonly editor: readonly ["Mod-u"];
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
|
+
readonly strike: {
|
|
163
|
+
readonly id: "font.strike";
|
|
164
|
+
readonly label: "删除线";
|
|
165
|
+
readonly location: {
|
|
166
|
+
readonly area: "ribbon";
|
|
167
|
+
readonly tab: "home";
|
|
168
|
+
readonly group: "font";
|
|
169
|
+
};
|
|
170
|
+
readonly shortcut: {
|
|
171
|
+
readonly label: "Cmd/Ctrl+5";
|
|
172
|
+
readonly aria: "Control+5 Meta+5";
|
|
173
|
+
readonly editor: readonly ["Mod-5"];
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
readonly borderTop: {
|
|
177
|
+
readonly id: "font.borderTop";
|
|
178
|
+
readonly label: "上框线";
|
|
179
|
+
readonly location: {
|
|
180
|
+
readonly area: "ribbon";
|
|
181
|
+
readonly tab: "home";
|
|
182
|
+
readonly group: "font";
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
readonly borderBottom: {
|
|
186
|
+
readonly id: "font.borderBottom";
|
|
187
|
+
readonly label: "下框线";
|
|
188
|
+
readonly location: {
|
|
189
|
+
readonly area: "ribbon";
|
|
190
|
+
readonly tab: "home";
|
|
191
|
+
readonly group: "font";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
readonly borderLeft: {
|
|
195
|
+
readonly id: "font.borderLeft";
|
|
196
|
+
readonly label: "左框线";
|
|
197
|
+
readonly location: {
|
|
198
|
+
readonly area: "ribbon";
|
|
199
|
+
readonly tab: "home";
|
|
200
|
+
readonly group: "font";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly borderRight: {
|
|
204
|
+
readonly id: "font.borderRight";
|
|
205
|
+
readonly label: "右框线";
|
|
206
|
+
readonly location: {
|
|
207
|
+
readonly area: "ribbon";
|
|
208
|
+
readonly tab: "home";
|
|
209
|
+
readonly group: "font";
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
readonly borderNone: {
|
|
213
|
+
readonly id: "font.borderNone";
|
|
214
|
+
readonly label: "无框线";
|
|
215
|
+
readonly location: {
|
|
216
|
+
readonly area: "ribbon";
|
|
217
|
+
readonly tab: "home";
|
|
218
|
+
readonly group: "font";
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
readonly borderAll: {
|
|
222
|
+
readonly id: "font.borderAll";
|
|
223
|
+
readonly label: "所有框线";
|
|
224
|
+
readonly location: {
|
|
225
|
+
readonly area: "ribbon";
|
|
226
|
+
readonly tab: "home";
|
|
227
|
+
readonly group: "font";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
readonly borderOutside: {
|
|
231
|
+
readonly id: "font.borderOutside";
|
|
232
|
+
readonly label: "外侧框线";
|
|
233
|
+
readonly location: {
|
|
234
|
+
readonly area: "ribbon";
|
|
235
|
+
readonly tab: "home";
|
|
236
|
+
readonly group: "font";
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly borderInside: {
|
|
240
|
+
readonly id: "font.borderInside";
|
|
241
|
+
readonly label: "内部框线";
|
|
242
|
+
readonly location: {
|
|
243
|
+
readonly area: "ribbon";
|
|
244
|
+
readonly tab: "home";
|
|
245
|
+
readonly group: "font";
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
readonly borderHorizontal: {
|
|
249
|
+
readonly id: "font.borderHorizontal";
|
|
250
|
+
readonly label: "内部横框线";
|
|
251
|
+
readonly location: {
|
|
252
|
+
readonly area: "ribbon";
|
|
253
|
+
readonly tab: "home";
|
|
254
|
+
readonly group: "font";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly borderVertical: {
|
|
258
|
+
readonly id: "font.borderVertical";
|
|
259
|
+
readonly label: "内部竖框线";
|
|
260
|
+
readonly location: {
|
|
261
|
+
readonly area: "ribbon";
|
|
262
|
+
readonly tab: "home";
|
|
263
|
+
readonly group: "font";
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
readonly borderDiagonal: {
|
|
267
|
+
readonly id: "font.borderDiagonal";
|
|
268
|
+
readonly label: "斜线框线";
|
|
269
|
+
readonly location: {
|
|
270
|
+
readonly area: "ribbon";
|
|
271
|
+
readonly tab: "home";
|
|
272
|
+
readonly group: "font";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
162
275
|
readonly mergeAndCenter: {
|
|
163
276
|
readonly id: "alignment.mergeAndCenter";
|
|
164
277
|
readonly label: "合并居中";
|
|
@@ -272,6 +385,52 @@ export declare const spreadsheetCommandCatalog: {
|
|
|
272
385
|
readonly group: "cells";
|
|
273
386
|
};
|
|
274
387
|
};
|
|
388
|
+
readonly fillDown: {
|
|
389
|
+
readonly id: "editing.fillDown";
|
|
390
|
+
readonly label: "向下填充";
|
|
391
|
+
readonly location: {
|
|
392
|
+
readonly area: "ribbon";
|
|
393
|
+
readonly tab: "home";
|
|
394
|
+
readonly group: "editing";
|
|
395
|
+
};
|
|
396
|
+
readonly shortcut: {
|
|
397
|
+
readonly label: "Cmd/Ctrl+D";
|
|
398
|
+
readonly aria: "Control+D Meta+D";
|
|
399
|
+
readonly editor: readonly ["Mod-d"];
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
readonly fillRight: {
|
|
403
|
+
readonly id: "editing.fillRight";
|
|
404
|
+
readonly label: "向右填充";
|
|
405
|
+
readonly location: {
|
|
406
|
+
readonly area: "ribbon";
|
|
407
|
+
readonly tab: "home";
|
|
408
|
+
readonly group: "editing";
|
|
409
|
+
};
|
|
410
|
+
readonly shortcut: {
|
|
411
|
+
readonly label: "Cmd/Ctrl+R";
|
|
412
|
+
readonly aria: "Control+R Meta+R";
|
|
413
|
+
readonly editor: readonly ["Mod-r"];
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
readonly fillUp: {
|
|
417
|
+
readonly id: "editing.fillUp";
|
|
418
|
+
readonly label: "向上填充";
|
|
419
|
+
readonly location: {
|
|
420
|
+
readonly area: "ribbon";
|
|
421
|
+
readonly tab: "home";
|
|
422
|
+
readonly group: "editing";
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
readonly fillLeft: {
|
|
426
|
+
readonly id: "editing.fillLeft";
|
|
427
|
+
readonly label: "向左填充";
|
|
428
|
+
readonly location: {
|
|
429
|
+
readonly area: "ribbon";
|
|
430
|
+
readonly tab: "home";
|
|
431
|
+
readonly group: "editing";
|
|
432
|
+
};
|
|
433
|
+
};
|
|
275
434
|
readonly clearAll: {
|
|
276
435
|
readonly id: "editing.clearAll";
|
|
277
436
|
readonly label: "清除全部";
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { Cell, Selection, Sheet } from '@fortune-sheet/core';
|
|
2
|
+
import { type SpreadsheetGridSize } from '../spreadsheet-sparse';
|
|
2
3
|
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
4
|
import { type OfficeEditorCanCommands, type OfficeEditorExtension } from './office-editor-extension';
|
|
4
5
|
import { type SpreadsheetCellClearMode } from './spreadsheet-cell-clear';
|
|
6
|
+
import type { SpreadsheetCellBorderFormat } from './spreadsheet-cell-border';
|
|
7
|
+
import type { SpreadsheetCellFillDirection } from './spreadsheet-cell-fill';
|
|
5
8
|
import { type SpreadsheetCellMergeCommand } from './spreadsheet-cell-merge';
|
|
6
|
-
import { type SpreadsheetFreezePanePreset } from './spreadsheet-freeze-panes';
|
|
7
9
|
import type { SpreadsheetFormatPainterMode } from './spreadsheet-format-painter';
|
|
10
|
+
import { type SpreadsheetFreezePanePreset } from './spreadsheet-freeze-panes';
|
|
8
11
|
import { type SpreadsheetKeyboardSelection, type SpreadsheetSelectionMove, type SpreadsheetSelectionScope } from './spreadsheet-keyboard-navigation';
|
|
9
12
|
import { type SpreadsheetSheetMoveDirection } from './spreadsheet-sheet-model';
|
|
10
13
|
export interface SpreadsheetWorkbookCommandPort {
|
|
14
|
+
autoFillCell: (copyRange: SpreadsheetCommandRange, applyRange: SpreadsheetCommandRange, direction: SpreadsheetCellFillDirection) => void;
|
|
11
15
|
batchCallApis: (apiCalls: Array<{
|
|
12
16
|
name: string;
|
|
13
17
|
args: unknown[];
|
|
@@ -22,9 +26,6 @@ export interface SpreadsheetWorkbookCommandPort {
|
|
|
22
26
|
insertRowOrColumn: (type: SpreadsheetStructureAxis, index: number, count: number, direction: 'lefttop' | 'rightbottom', options?: {
|
|
23
27
|
id?: string;
|
|
24
28
|
}) => void;
|
|
25
|
-
deleteRowOrColumn: (type: SpreadsheetStructureAxis, start: number, end: number, options?: {
|
|
26
|
-
id?: string;
|
|
27
|
-
}) => void;
|
|
28
29
|
hideRowOrColumn: (rowOrColumnInfo: string[], type: SpreadsheetStructureAxis) => void;
|
|
29
30
|
showRowOrColumn: (rowOrColumnInfo: string[], type: SpreadsheetStructureAxis) => void;
|
|
30
31
|
setCellValuesByRange: (values: unknown[][], range: SpreadsheetCommandRange, options?: {
|
|
@@ -111,6 +112,7 @@ export interface SpreadsheetEditorCommands {
|
|
|
111
112
|
deleteSelectedStructure: (axis: SpreadsheetStructureAxis) => boolean;
|
|
112
113
|
deleteSheet: (sheetId: string) => boolean;
|
|
113
114
|
duplicateSheet: (sheetId: string) => boolean;
|
|
115
|
+
fillSelectedCells: (direction: SpreadsheetCellFillDirection) => boolean;
|
|
114
116
|
hideSheet: (sheetId: string) => boolean;
|
|
115
117
|
insertSelectedStructure: (axis: SpreadsheetStructureAxis, position: SpreadsheetStructureInsertPosition) => boolean;
|
|
116
118
|
mergeSelectedCells: (command: SpreadsheetCellMergeCommand) => boolean;
|
|
@@ -123,6 +125,7 @@ export interface SpreadsheetEditorCommands {
|
|
|
123
125
|
renameSheet: (sheetId: string, name: string) => boolean;
|
|
124
126
|
redo: () => boolean;
|
|
125
127
|
setCellFormat: (attribute: keyof Cell, value: unknown) => boolean;
|
|
128
|
+
setSelectedCellBorders: (format: SpreadsheetCellBorderFormat) => boolean;
|
|
126
129
|
setFreezePanes: (preset: SpreadsheetFreezePanePreset) => boolean;
|
|
127
130
|
setGridLines: (visible: boolean) => boolean;
|
|
128
131
|
selectCellRange: (scope: SpreadsheetSelectionScope) => boolean;
|
|
@@ -149,6 +152,7 @@ export interface SpreadsheetCommandContext {
|
|
|
149
152
|
history: SpreadsheetHistoryCommandPort | null;
|
|
150
153
|
onChange: (content: WorkSpreadsheetContent) => void;
|
|
151
154
|
selection: SpreadsheetCommandSelection | null;
|
|
155
|
+
targetSheetGridSize?: SpreadsheetGridSize | null;
|
|
152
156
|
targetSheetId: string;
|
|
153
157
|
toolbarCell: Cell | null;
|
|
154
158
|
view: SpreadsheetViewCommandPort | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cell, Selection } from '@fortune-sheet/core';
|
|
1
|
+
import type { Cell, Op, Selection } from '@fortune-sheet/core';
|
|
2
2
|
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
3
|
import type { OfficeSelectOption } from './office-select';
|
|
4
4
|
export interface SpreadsheetSelectionSummary {
|
|
@@ -21,9 +21,15 @@ export declare function spreadsheetFontSizeOptions(current: number | undefined):
|
|
|
21
21
|
export declare function spreadsheetFontFamilyOptions(current: string | undefined): OfficeSelectOption[];
|
|
22
22
|
export declare function spreadsheetSheetsWithFiniteSelections(sheets: WorkSpreadsheetContent['sheets']): WorkSpreadsheetContent['sheets'];
|
|
23
23
|
export declare function spreadsheetSheetsForFortune(sheets: WorkSpreadsheetContent['sheets']): WorkSpreadsheetContent['sheets'];
|
|
24
|
-
export declare function spreadsheetSheetsFromFortune(sheets: WorkSpreadsheetContent['sheets'], sourceSheets: WorkSpreadsheetContent['sheets']): WorkSpreadsheetContent['sheets'];
|
|
24
|
+
export declare function spreadsheetSheetsFromFortune(sheets: WorkSpreadsheetContent['sheets'], sourceSheets: WorkSpreadsheetContent['sheets'], operations?: readonly Op[]): WorkSpreadsheetContent['sheets'];
|
|
25
25
|
export declare function finiteSpreadsheetSelection(selection: Selection | undefined): Selection;
|
|
26
26
|
export declare function sameSpreadsheetWorkbookState(changed: WorkSpreadsheetContent['sheets'], rendered: WorkSpreadsheetContent['sheets']): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Answers the workbook equality check from Fortune's exact operation batch
|
|
29
|
+
* without walking unrelated matrix cells. A null result requires the legacy
|
|
30
|
+
* full comparison because the batch is missing or too broad to prove safely.
|
|
31
|
+
*/
|
|
32
|
+
export declare function sameSpreadsheetWorkbookStateAfterOperations(changed: WorkSpreadsheetContent['sheets'], rendered: WorkSpreadsheetContent['sheets'], operations: readonly Op[]): boolean | null;
|
|
27
33
|
export declare function sameSpreadsheetHistoryContent(left: WorkSpreadsheetContent, right: WorkSpreadsheetContent): boolean;
|
|
28
34
|
export declare function spreadsheetContentWithSelection(content: WorkSpreadsheetContent, sheetId: string, selection: Selection | null | undefined): WorkSpreadsheetContent;
|
|
29
35
|
export declare function isSpreadsheetNativeTextUndoTarget(target: EventTarget | null): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import type { SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
3
|
+
interface SpreadsheetHomeFormatRibbonProps {
|
|
4
|
+
can: SpreadsheetEditorCanCommands;
|
|
5
|
+
commands: SpreadsheetEditorCommands;
|
|
6
|
+
toolbarCell: Cell | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function SpreadsheetFontRibbonGroup({ can, commands, toolbarCell, }: SpreadsheetHomeFormatRibbonProps): import("react").JSX.Element;
|
|
9
|
+
export declare function SpreadsheetNumberRibbonGroup({ can, commands, toolbarCell, }: SpreadsheetHomeFormatRibbonProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkbookInstance } from '@fortune-sheet/react';
|
|
2
|
+
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
|
+
type SpreadsheetWorkbookUpdateTarget = Pick<WorkbookInstance, 'updateSheet'>;
|
|
4
|
+
/**
|
|
5
|
+
* Replaces only the data of an already-mounted, structurally simple workbook.
|
|
6
|
+
* Fortune keeps additional active-sheet state outside `luckysheetfile`, so
|
|
7
|
+
* richer workbook structures must continue through the remount path.
|
|
8
|
+
*/
|
|
9
|
+
export declare function synchronizeSpreadsheetWorkbookInPlace(workbook: SpreadsheetWorkbookUpdateTarget | null, previous: WorkSpreadsheetContent, next: WorkSpreadsheetContent, projectedSheets: WorkSpreadsheetContent['sheets'], preview: boolean): boolean;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Op } from '@fortune-sheet/core';
|
|
2
|
+
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
|
+
export declare const MAXIMUM_INCREMENTAL_SPREADSHEET_OPERATIONS = 10000;
|
|
4
|
+
export interface SpreadsheetOperationProjection {
|
|
5
|
+
affectedCellCount: number;
|
|
6
|
+
sheets: WorkSpreadsheetContent['sheets'];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Reconciles a bounded Fortune operation batch against authenticated
|
|
10
|
+
* controlled matrices. Only the outer matrix and affected rows/cells are
|
|
11
|
+
* copied; structural or incomplete batches return null for the full-scan
|
|
12
|
+
* compatibility path.
|
|
13
|
+
*/
|
|
14
|
+
export declare function projectSpreadsheetSheetsFromFortuneOperations(sheets: WorkSpreadsheetContent['sheets'], sourceSheets: WorkSpreadsheetContent['sheets'], operations: readonly Op[]): SpreadsheetOperationProjection | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpreadsheetKeyboardSelection } from './spreadsheet-keyboard-navigation';
|
|
2
|
+
/**
|
|
3
|
+
* Fortune clears its live selection after deleting rows or columns. Keep the
|
|
4
|
+
* user's selection on the structure that moved into the deleted range while
|
|
5
|
+
* clamping terminal deletions to the new grid boundary.
|
|
6
|
+
*/
|
|
7
|
+
export declare function spreadsheetSelectionAfterStructureDeletion(selection: SpreadsheetKeyboardSelection, axis: 'column' | 'row', extent: number, start: number, end: number): SpreadsheetKeyboardSelection;
|
|
@@ -52,6 +52,11 @@ export interface UseDocumentPaginationValue {
|
|
|
52
52
|
export declare function useDocumentPagination({ editor, documentRevision, enabled, layoutKey, page, selectionVersion, wasmUrl, layoutFonts, loadedLayoutFontIds, }: UseDocumentPaginationOptions): UseDocumentPaginationValue;
|
|
53
53
|
export declare function createDocumentFieldPaginationContextResolver(pagination: DocumentPaginationResult): WorkDocumentFieldContextResolver;
|
|
54
54
|
export declare function documentResizeObservationPositions(blocks: readonly MeasuredDocumentLayoutBlock[]): ReadonlyMap<HTMLElement, number>;
|
|
55
|
+
export declare function documentResizeObservationTargets(editorDom: HTMLElement, blocks: readonly MeasuredDocumentLayoutBlock[]): {
|
|
56
|
+
observedBlockCount: number;
|
|
57
|
+
positions: ReadonlyMap<HTMLElement, number>;
|
|
58
|
+
scope: 'blocks' | 'document';
|
|
59
|
+
};
|
|
55
60
|
export declare function documentPaginationPageDescriptors(layout: OfficeKernelLayoutResult, blocks: readonly MeasuredDocumentLayoutBlock[], documentNode?: ProseMirrorNode): DocumentPaginationPageDescriptor[];
|
|
56
61
|
export declare function deriveDocumentPaginationPageDescriptors(layout: OfficeKernelLayoutResult, blocks: readonly MeasuredDocumentLayoutBlock[], documentNode?: ProseMirrorNode, previousPages?: readonly DocumentPaginationPageDescriptor[], requestedReusedPageCount?: number): DocumentPaginationPageDescriptorDerivation;
|
|
57
62
|
export declare function pageForPosition(pagination: DocumentPaginationResult, position: number): number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WorkPresentationDesignContent } from '../work-presentation-layouts';
|
|
1
2
|
import type { WorkPresentationContent, WorkPresentationLayout, WorkPresentationMaster, WorkSlide, WorkSlideElement } from '../work-types';
|
|
2
3
|
import type { PresentationDesignMode } from './presentation-editor-types';
|
|
3
4
|
export interface PresentationDesignCommands {
|
|
@@ -18,7 +19,7 @@ export interface PresentationDesignCommands {
|
|
|
18
19
|
export declare function usePresentationDesignCommands({ activeElements, activeTargetId, designContent, designMode, designOpen, onChange, onClearSelection, onCloseComments, onEditElement, onSetDesignMode, onSetDesignOpen, selectedLayout, selectedMaster, selectedSlide, }: {
|
|
19
20
|
activeElements: readonly WorkSlideElement[];
|
|
20
21
|
activeTargetId: string | undefined;
|
|
21
|
-
designContent:
|
|
22
|
+
designContent: WorkPresentationDesignContent;
|
|
22
23
|
designMode: PresentationDesignMode;
|
|
23
24
|
designOpen: boolean;
|
|
24
25
|
onChange: (content: WorkPresentationContent) => void;
|
|
@@ -7,4 +7,5 @@ export interface SpreadsheetWorkbookSyncController {
|
|
|
7
7
|
recordOperations: (operations: readonly Op[]) => void;
|
|
8
8
|
takeOperations: () => Op[];
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type SpreadsheetExternalWorkbookSynchronizer = (previous: WorkSpreadsheetContent, next: WorkSpreadsheetContent) => boolean;
|
|
11
|
+
export declare function useSpreadsheetWorkbookSync(content: WorkSpreadsheetContent, synchronizeExternalWorkbook?: SpreadsheetExternalWorkbookSynchronizer): SpreadsheetWorkbookSyncController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sameSpreadsheetHistoryValue(left: unknown, right: unknown): boolean;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { CellMatrix } from '@fortune-sheet/core';
|
|
1
|
+
import type { CellMatrix, Sheet } from '@fortune-sheet/core';
|
|
2
|
+
export interface SpreadsheetGridSize {
|
|
3
|
+
rowCount: number;
|
|
4
|
+
columnCount: number;
|
|
5
|
+
}
|
|
2
6
|
export declare function sparseArrayIndexes(values: readonly unknown[] | undefined): number[];
|
|
3
7
|
export declare function sparseArrayEntries<T>(values: readonly T[] | undefined): Array<[number, T]>;
|
|
4
8
|
export declare function sparseMatrixColumnCount(matrix: CellMatrix | undefined): number;
|
|
9
|
+
export declare function spreadsheetGridSize(sheet: Pick<Sheet, 'column' | 'data' | 'row'> | undefined): SpreadsheetGridSize | null;
|
|
5
10
|
export declare function cloneSparseMatrix(source: CellMatrix | undefined): CellMatrix;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
export interface DocumentChunkGeometry {
|
|
3
|
+
containerId?: string;
|
|
4
|
+
end: number;
|
|
5
|
+
from: number;
|
|
6
|
+
id: string;
|
|
7
|
+
paginationExtraHeight: number;
|
|
8
|
+
start: number;
|
|
9
|
+
to: number;
|
|
10
|
+
}
|
|
11
|
+
export interface DocumentChunkPosition {
|
|
12
|
+
ancestorIds: readonly string[];
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function documentChunkViewportRange(geometry: readonly {
|
|
17
|
+
end: number;
|
|
18
|
+
start: number;
|
|
19
|
+
}[], viewportTop: number, viewportBottom: number): {
|
|
20
|
+
end: number;
|
|
21
|
+
start: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function documentChunkGeometry(document: ProseMirrorNode, breaks: readonly {
|
|
24
|
+
position: number;
|
|
25
|
+
spacerHeight: number;
|
|
26
|
+
}[]): DocumentChunkGeometry[];
|
|
27
|
+
export declare function documentChunkPositions(document: ProseMirrorNode): ReadonlyMap<string, DocumentChunkPosition>;
|
|
28
|
+
export declare function documentChunkId(node: ProseMirrorNode): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { Node } from '@tiptap/core';
|
|
3
|
+
import { type EditorState, type Transaction } from '@tiptap/pm/state';
|
|
4
|
+
import type { WorkDocumentContent, WorkDocumentNode } from './work-types';
|
|
5
|
+
interface DocumentChunkOptions {
|
|
6
|
+
getContent: () => WorkDocumentContent | null;
|
|
7
|
+
trustInitialIntegrityFeatures: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface DocumentChunkHydrationMeta {
|
|
10
|
+
ids: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export interface DocumentChunkVisibleIdsMeta {
|
|
13
|
+
visibleIds: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export declare const DOCUMENT_CHUNK_PAGINATION_META = "documentChunkPaginationGeometry";
|
|
16
|
+
export declare const DOCUMENT_CHUNK_VISIBLE_IDS_META = "documentChunkVisibleIds";
|
|
17
|
+
export declare const DOCUMENT_CHUNK_HYDRATION_META = "documentChunkLazyHydration";
|
|
18
|
+
export { documentChunkViewportRange } from './work-document-chunk-geometry';
|
|
19
|
+
export declare const DocumentChunk: Node<DocumentChunkOptions, any>;
|
|
20
|
+
export declare function documentLazyChunkContentForEditor(editor: Editor, chunkId: string): readonly WorkDocumentNode[] | null;
|
|
21
|
+
export declare function documentTransactionsOnlyHydrateChunks(transactions: readonly Transaction[]): boolean;
|
|
22
|
+
export declare function selectedDocumentChunkId(state: Pick<EditorState, 'doc' | 'selection'>): string | null;
|
|
23
|
+
export declare function documentChunkMountedIds(state: EditorState): readonly string[] | null;
|
|
@@ -9,5 +9,6 @@ export interface WorkDocumentExtensionOptions {
|
|
|
9
9
|
onContentChange?: (content: WorkDocumentContent) => void;
|
|
10
10
|
onTrackingChange?: (enabled: boolean) => void;
|
|
11
11
|
rotateTrackedTextIdentities?: () => boolean;
|
|
12
|
+
trustInitialIntegrityFeatures?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare function createWorkDocumentExtensions(options?: WorkDocumentExtensionOptions): Extensions;
|