@a3s-lab/office 0.11.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 +121 -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 +4272 -2753
- 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 +3 -3
- package/dist/0~work-docx-large-document-import.js +559 -0
- package/dist/0~work-office-diagnostics.js +51 -35
- package/dist/0~work-pptx-import.js +2 -2
- package/dist/4104.js +4127 -3037
- package/dist/432.js +51 -7
- package/dist/4476.js +280 -69
- package/dist/5184.js +24 -2
- package/dist/{8928.js → 6282.js} +2338 -93
- package/dist/8715.js +1201 -1156
- package/dist/9356.js +128 -8
- package/dist/core.d.ts +1 -0
- 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 -1
- 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-collaboration.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 +10 -0
- 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-file-io.d.ts +2 -1
- 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-import.d.ts +2 -1
- 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-data.d.ts +7 -1
- package/dist/internal/features/work/work-file-import.d.ts +33 -0
- package/dist/internal/features/work/work-file-io.d.ts +5 -4
- package/dist/internal/features/work/work-file-kind.d.ts +5 -0
- package/dist/internal/features/work/work-markdown-file-io.d.ts +2 -1
- package/dist/internal/features/work/work-office-diagnostics.d.ts +12 -2
- package/dist/internal/features/work/work-ooxml-package.d.ts +8 -0
- package/dist/internal/features/work/work-pptx-import.d.ts +1 -1
- package/dist/internal/features/work/work-presentation-file-io.d.ts +2 -1
- 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-spreadsheet-protection.d.ts +2 -0
- package/dist/internal/features/work/work-types.d.ts +22 -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 +8 -17
- 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 +26 -4
package/dist/9356.js
CHANGED
|
@@ -1,10 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
],
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const stageRanges = {
|
|
2
|
+
reading: [
|
|
3
|
+
0,
|
|
4
|
+
0.2
|
|
5
|
+
],
|
|
6
|
+
parsing: [
|
|
7
|
+
0.2,
|
|
8
|
+
0.75
|
|
9
|
+
],
|
|
10
|
+
analyzing: [
|
|
11
|
+
0.75,
|
|
12
|
+
0.95
|
|
13
|
+
],
|
|
14
|
+
finalizing: [
|
|
15
|
+
0.95,
|
|
16
|
+
1
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
class WorkFileImportController {
|
|
20
|
+
options;
|
|
21
|
+
totalBytes;
|
|
22
|
+
progress = 0;
|
|
23
|
+
constructor(options, totalBytes){
|
|
24
|
+
this.options = options;
|
|
25
|
+
this.totalBytes = totalBytes;
|
|
26
|
+
}
|
|
27
|
+
get signal() {
|
|
28
|
+
return this.options.signal;
|
|
29
|
+
}
|
|
30
|
+
throwIfAborted() {
|
|
31
|
+
if (!this.signal?.aborted) return;
|
|
32
|
+
throw workFileImportAbortError(this.signal.reason);
|
|
33
|
+
}
|
|
34
|
+
report(stage, stageProgress, bytesRead = this.totalBytes) {
|
|
35
|
+
this.throwIfAborted();
|
|
36
|
+
const boundedStageProgress = Math.max(0, Math.min(1, stageProgress));
|
|
37
|
+
const [start, end] = stageRanges[stage];
|
|
38
|
+
this.progress = Math.max(this.progress, start + (end - start) * boundedStageProgress);
|
|
39
|
+
this.options.onProgress?.({
|
|
40
|
+
stage,
|
|
41
|
+
stageProgress: boundedStageProgress,
|
|
42
|
+
progress: this.progress,
|
|
43
|
+
bytesRead: Math.max(0, Math.min(this.totalBytes, bytesRead)),
|
|
44
|
+
totalBytes: this.totalBytes
|
|
45
|
+
});
|
|
46
|
+
this.throwIfAborted();
|
|
47
|
+
}
|
|
48
|
+
async checkpoint(stage, stageProgress) {
|
|
49
|
+
this.report(stage, stageProgress);
|
|
50
|
+
await this.yieldToMainThread();
|
|
51
|
+
}
|
|
52
|
+
async yieldToMainThread() {
|
|
53
|
+
this.throwIfAborted();
|
|
54
|
+
const taskScheduler = globalThis.scheduler;
|
|
55
|
+
if ('function' == typeof taskScheduler?.yield) await taskScheduler.yield();
|
|
56
|
+
else await new Promise((resolve)=>setTimeout(resolve, 0));
|
|
57
|
+
this.throwIfAborted();
|
|
58
|
+
}
|
|
59
|
+
complete() {
|
|
60
|
+
this.report('finalizing', 1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function workFileImportAbortError(reason) {
|
|
64
|
+
if (reason instanceof Error && 'AbortError' === reason.name) return reason;
|
|
65
|
+
if ("u" > typeof DOMException) return new DOMException('Office file import was cancelled.', 'AbortError');
|
|
66
|
+
const error = new Error('Office file import was cancelled.');
|
|
67
|
+
error.name = 'AbortError';
|
|
68
|
+
return error;
|
|
69
|
+
}
|
|
70
|
+
const WORK_FILE_READ_CHUNK_BYTES = 4194304;
|
|
71
|
+
async function materializeWorkFile(file, controller = new WorkFileImportController({}, file.size)) {
|
|
72
|
+
return (await materializeWorkFileSource(file, controller)).file;
|
|
73
|
+
}
|
|
74
|
+
async function materializeWorkFileSource(file, controller) {
|
|
75
|
+
const bytes = await readWorkFileBytes(file, controller);
|
|
76
|
+
return {
|
|
77
|
+
bytes,
|
|
78
|
+
file: new File([
|
|
79
|
+
bytes
|
|
80
|
+
], file.name, {
|
|
81
|
+
lastModified: file.lastModified,
|
|
82
|
+
type: file.type
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async function readWorkFileBytes(file, controller) {
|
|
87
|
+
controller.report('reading', 0, 0);
|
|
88
|
+
if (file.size <= WORK_FILE_READ_CHUNK_BYTES) {
|
|
89
|
+
const bytes = await abortableArrayBuffer(file.arrayBuffer(), controller);
|
|
90
|
+
controller.report('reading', 1, bytes.byteLength);
|
|
91
|
+
return bytes;
|
|
92
|
+
}
|
|
93
|
+
const bytes = new Uint8Array(file.size);
|
|
94
|
+
for(let offset = 0; offset < file.size; offset += WORK_FILE_READ_CHUNK_BYTES){
|
|
95
|
+
controller.throwIfAborted();
|
|
96
|
+
const end = Math.min(file.size, offset + WORK_FILE_READ_CHUNK_BYTES);
|
|
97
|
+
const chunk = await abortableArrayBuffer(file.slice(offset, end).arrayBuffer(), controller);
|
|
98
|
+
bytes.set(new Uint8Array(chunk), offset);
|
|
99
|
+
controller.report('reading', end / file.size, end);
|
|
100
|
+
if (end < file.size) await controller.yieldToMainThread();
|
|
101
|
+
}
|
|
102
|
+
return bytes.buffer;
|
|
103
|
+
}
|
|
104
|
+
async function abortableArrayBuffer(pending, controller) {
|
|
105
|
+
controller.throwIfAborted();
|
|
106
|
+
const signal = controller.signal;
|
|
107
|
+
if (!signal) return pending;
|
|
108
|
+
return new Promise((resolve, reject)=>{
|
|
109
|
+
const abort = ()=>{
|
|
110
|
+
cleanup();
|
|
111
|
+
try {
|
|
112
|
+
controller.throwIfAborted();
|
|
113
|
+
} catch (error) {
|
|
114
|
+
reject(error);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const cleanup = ()=>signal.removeEventListener('abort', abort);
|
|
118
|
+
signal.addEventListener('abort', abort, {
|
|
119
|
+
once: true
|
|
120
|
+
});
|
|
121
|
+
pending.then((bytes)=>{
|
|
122
|
+
cleanup();
|
|
123
|
+
resolve(bytes);
|
|
124
|
+
}, (error)=>{
|
|
125
|
+
cleanup();
|
|
126
|
+
reject(error);
|
|
127
|
+
});
|
|
8
128
|
});
|
|
9
129
|
}
|
|
10
|
-
export { materializeWorkFile };
|
|
130
|
+
export { WorkFileImportController, materializeWorkFile, materializeWorkFileSource };
|
package/dist/core.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type { WorkEditorAgentRequest as EditorAgentRequest } from './internal/fe
|
|
|
21
21
|
export type { WorkDocumentReviewConflict as DocumentReviewConflict, WorkDocumentReviewConflictEvent as DocumentReviewConflictEvent, WorkDocumentReviewConflictReason as DocumentReviewConflictReason, WorkDocumentReviewKind as DocumentReviewKind, } from './internal/features/work/work-document-review-conflicts';
|
|
22
22
|
export type { WorkDocumentSelectionCommandFailure as DocumentSelectionCommandFailure, WorkDocumentSelectionCommandResult as DocumentSelectionCommandResult, WorkDocumentSelectionCommands as DocumentSelectionCommands, WorkDocumentSelectionContext as DocumentSelectionContext, WorkDocumentSelectionMenuIcon as DocumentSelectionMenuIcon, WorkDocumentSelectionMenuItem as DocumentSelectionMenuItem, WorkDocumentSelectionSnapshot as DocumentSelectionSnapshot, WorkGetDocumentSelectionMenuItems as GetDocumentSelectionMenuItems, } from './internal/features/work/work-document-selection-menu';
|
|
23
23
|
export type { WorkArtifactExportOptions as ArtifactExportOptions } from './internal/features/work/work-file-io';
|
|
24
|
+
export type { WorkFileImportOptions as OfficeFileImportOptions, WorkFileImportProgress as OfficeFileImportProgress, WorkFileImportStage as OfficeFileImportStage, } from './internal/features/work/work-file-import';
|
|
24
25
|
export { createWorkArtifactBlob as createArtifactBlob, exportWorkArtifact as downloadArtifact, importWorkFile as importOfficeFile, WORK_IMPORT_ACCEPT as OFFICE_FILE_ACCEPT, workKindForFile as officeKindForFile, } from './internal/features/work/work-file-io';
|
|
25
26
|
export { decodeWorkDocumentSnapshot as decodeDocumentSnapshot, encodeWorkDocumentSnapshot as encodeDocumentSnapshot, WORK_DOCUMENT_SNAPSHOT_MEDIA_TYPE as DOCUMENT_SNAPSHOT_MEDIA_TYPE, WORK_DOCUMENT_SNAPSHOT_SCHEMA as DOCUMENT_SNAPSHOT_SCHEMA, WORK_DOCUMENT_SNAPSHOT_VERSION as DOCUMENT_SNAPSHOT_VERSION, type WorkDocumentSnapshot as DocumentSnapshot, } from './internal/features/work/work-document-snapshot';
|
|
26
27
|
export { applyWorkDocumentSource as applyDocumentSource, projectWorkDocumentSource as projectDocumentSource, WORK_DOCUMENT_SOURCE_MEDIA_TYPE as DOCUMENT_SOURCE_MEDIA_TYPE, WORK_DOCUMENT_SOURCE_SCHEMA as DOCUMENT_SOURCE_SCHEMA, WORK_DOCUMENT_SOURCE_VERSION as DOCUMENT_SOURCE_VERSION, type WorkDocumentSource as DocumentSource, } from './internal/features/work/work-document-source';
|
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,8 +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'], operations?: readonly Op[]): WorkSpreadsheetContent['sheets'];
|
|
24
25
|
export declare function finiteSpreadsheetSelection(selection: Selection | undefined): Selection;
|
|
25
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;
|
|
26
33
|
export declare function sameSpreadsheetHistoryContent(left: WorkSpreadsheetContent, right: WorkSpreadsheetContent): boolean;
|
|
27
34
|
export declare function spreadsheetContentWithSelection(content: WorkSpreadsheetContent, sheetId: string, selection: Selection | null | undefined): WorkSpreadsheetContent;
|
|
28
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;
|