Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
feat(sheet): support fork file (#3549)
Gpound.liu6a475a73d8f3
diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex 821431d44d..8932371933 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -114,7 +114,7 @@ export { DependentOn, PluginService } from './services/plugin/plugin.service';export { type DependencyOverride, mergeOverrideWithDependencies } from './services/plugin/plugin-override';export { IResourceLoaderService } from './services/resource-loader/type';export { ResourceManagerService } from './services/resource-manager/resource-manager.service';-export type { IResourceHook } from './services/resource-manager/type';+export type { IResourceHook, IResources } from './services/resource-manager/type';export { IResourceManagerService } from './services/resource-manager/type';export { type IStyleSheet, ThemeService } from './services/theme/theme.service';diff --git a/packages/core/src/services/resource-manager/type.ts b/packages/core/src/services/resource-manager/type.tsindex 45589d9230..51fc56e846 100644--- a/packages/core/src/services/resource-manager/type.ts+++ b/packages/core/src/services/resource-manager/type.ts@@ -28,7 +28,8 @@ export interface IResourceHook<T = any> {businesses: UniverInstanceType[];onLoad: (unitID: string, resource: T) => void;onUnLoad: (unitID: string) => void;- toJson: (unitID: string) => string;+ toJson: (unitID: string, model?: T) => string;+parseJson: (bytes: string) => T;}diff --git a/packages/sheets-drawing/src/controllers/sheet-drawing.controller.ts b/packages/sheets-drawing/src/controllers/sheet-drawing.controller.tsindex 01d89f92d5..4c6bf920f8 100644--- a/packages/sheets-drawing/src/controllers/sheet-drawing.controller.ts+++ b/packages/sheets-drawing/src/controllers/sheet-drawing.controller.ts@@ -37,8 +37,8 @@ export class SheetsDrawingLoadController extends Disposable {}private _initSnapshot() {- const toJson = (unitId: string) => {- const map = this._sheetDrawingService.getDrawingDataForUnit(unitId);+ const toJson = (unitId: string, model?: IDrawingSubunitMap<ISheetDrawing>) => {+ const map = model || this._sheetDrawingService.getDrawingDataForUnit(unitId);if (map) {return JSON.stringify(map);}@@ -58,7 +58,7 @@ export class SheetsDrawingLoadController extends Disposable {this._resourceManagerService.registerPluginResource<IDrawingSubunitMap<ISheetDrawing>>({pluginName: SHEET_DRAWING_PLUGIN,businesses: [UniverInstanceType.UNIVER_SHEET],- toJson: (unitId) => toJson(unitId),+ toJson: (unitId, model) => toJson(unitId, model),parseJson: (json) => parseJson(json),onUnLoad: (unitId) => {this._sheetDrawingService.removeDrawingDataForUnit(unitId);diff --git a/packages/sheets-drawing/src/index.ts b/packages/sheets-drawing/src/index.tsindex 6c095eb89e..b862e01344 100644--- a/packages/sheets-drawing/src/index.ts+++ b/packages/sheets-drawing/src/index.ts@@ -14,8 +14,10 @@* limitations under the License.*/+/* eslint-disable perfectionist/sort-exports */export { UniverSheetsDrawingPlugin } from './plugin';export { ISheetDrawingService, SheetDrawingAnchorType } from './services/sheet-drawing.service';+export { SHEET_DRAWING_PLUGIN } from './controllers/sheet-drawing.controller';export type { IFloatDomData, ISheetDrawing, ISheetDrawingPosition, ISheetFloatDom } from './services/sheet-drawing.service';// #region - all commands