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
refactor(worker)!: remove deprecated root exports (#8079)
白熱75994f7603b9
diff --git a/packages/docs/README.md b/packages/docs/README.mdindex 8d9f9e3bf3..710af1e158 100644--- a/packages/docs/README.md+++ b/packages/docs/README.md@@ -30,6 +30,18 @@ import { UniverDocsPlugin } from '@univerjs/docs';univer.registerPlugin(UniverDocsPlugin);```+## Worker usage++On the main thread, import `UniverDocsLayoutWorkerPlugin` from `@univerjs/docs`. Register it alongside `UniverDocsPlugin` and set `workerFactory` to a function that creates the layout worker.++In the worker entry, import `UniverDocsWorkerPlugin` from `@univerjs/docs/worker`:++```ts+import { UniverDocsWorkerPlugin } from '@univerjs/docs/worker';++univer.registerPlugin(UniverDocsWorkerPlugin);+```+## Heading collapse in Modern documentsModern documents (`DocumentFlavor.MODERN`) support collapsing Heading 1 through Heading 5.diff --git a/packages/docs/src/index.ts b/packages/docs/src/index.tsindex 506e9985cd..d7925c7af5 100644--- a/packages/docs/src/index.ts+++ b/packages/docs/src/index.ts@@ -70,10 +70,6 @@ export type {export { DocsLayoutWorkerCapabilityError, DocsLayoutWorkerClientService, UniverDocsLayoutWorkerPlugin } from './layout-worker';export type { IUniverDocsLayoutWorkerConfig } from './layout-worker/config/config';export type { IDocsLayoutWorkerCapabilities, IDocsLayoutWorkerFontProbe, IDocsLayoutWorkerRuntime } from './layout-worker/protocol';-export {- /** @deprecated Register UniverDocsWorkerPlugin from '@univerjs/docs/worker' instead. This root export will be removed in the next release. */- startDocsLayoutWorker,-} from './layout-worker/worker';export { UniverDocsPlugin } from './plugin';export { DocBlockMoveValidatorService } from './services/doc-block-move-validator.service';export type {diff --git a/packages/engine-formula/README.md b/packages/engine-formula/README.mdindex 615b6a448b..91b0f6ad2d 100644--- a/packages/engine-formula/README.md+++ b/packages/engine-formula/README.md@@ -30,6 +30,18 @@ import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';univer.registerPlugin(UniverFormulaEnginePlugin);```+## Worker usage++On the main thread, import `UniverFormulaEnginePlugin` from `@univerjs/engine-formula`. Set `notExecuteFormula: true` to delegate calculation to the worker.++In the worker entry, import `UniverFormulaEnginePlugin` from `@univerjs/engine-formula/worker`:++```ts+import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula/worker';++univer.registerPlugin(UniverFormulaEnginePlugin, { notExecuteFormula: false });+```+## Resources- [Documentation](https://docs.univer.ai)diff --git a/packages/engine-render/README.md b/packages/engine-render/README.mdindex 20f800e57d..768d461bc2 100644--- a/packages/engine-render/README.md+++ b/packages/engine-render/README.md@@ -30,6 +30,18 @@ import { UniverRenderEnginePlugin } from '@univerjs/engine-render';univer.registerPlugin(UniverRenderEnginePlugin);```+## Worker usage++On the main thread, import `UniverRenderEnginePlugin` from `@univerjs/engine-render`.++In the worker entry, import `DocumentLayoutSession` from `@univerjs/engine-render/worker`:++```ts+import { DocumentLayoutSession } from '@univerjs/engine-render/worker';+```++`DocumentLayoutSession` is a layout utility, not a plugin. For Docs layout workers, use the [Docs worker setup](../docs/README.md#worker-usage), which manages the session lifecycle.+## Resources- [Documentation](https://docs.univer.ai)diff --git a/packages/engine-render/src/index.ts b/packages/engine-render/src/index.tsindex f0184e793f..998aec95bf 100644--- a/packages/engine-render/src/index.ts+++ b/packages/engine-render/src/index.ts@@ -171,8 +171,4 @@ export { CanvasColorService, DumbCanvasColorService, ICanvasColorService } fromexport * from './shape';export * from './viewport';-export {- /** @deprecated Import from '@univerjs/engine-render/worker' instead. This root export will be removed in the next release. */- DocumentLayoutSession,-} from './worker';export type { IDocumentLayoutSessionStartOptions, IDocumentLayoutStepResult } from './worker-layout';diff --git a/packages/rpc-node/README.md b/packages/rpc-node/README.mdindex c884be71ab..f31038cb8e 100644--- a/packages/rpc-node/README.md+++ b/packages/rpc-node/README.md@@ -32,12 +32,21 @@ const workerSrc = fileURLToPath(new URL('./worker.js', import.meta.url));univer.registerPlugin(UniverRPCNodeMainPlugin, { workerSrc });```-The referenced worker module must create its own Univer instance and register `UniverRPCNodeWorkerPlugin`; see the [Node.js worker example](../../examples/src/node/sdk/worker.ts).--Exported plugin classes:+Main-thread plugin classes:- `UniverRPCNodeMainPlugin`-- `UniverRPCNodeWorkerPlugin`++## Worker usage++On the main thread, import `UniverRPCNodeMainPlugin` from `@univerjs/rpc-node`. Set `workerSrc` to the worker module path.++In the worker entry, import `UniverRPCNodeWorkerPlugin` from `@univerjs/rpc-node/worker`:++```ts+import { UniverRPCNodeWorkerPlugin } from '@univerjs/rpc-node/worker';++univer.registerPlugin(UniverRPCNodeWorkerPlugin);+```## Resourcesdiff --git a/packages/rpc-node/src/index.ts b/packages/rpc-node/src/index.tsindex deadd748ee..d0c328d884 100644--- a/packages/rpc-node/src/index.ts+++ b/packages/rpc-node/src/index.ts@@ -15,7 +15,3 @@*/export { UniverRPCNodeMainPlugin } from './plugin';-export {- /** @deprecated Import from '@univerjs/rpc-node/worker' instead. This root export will be removed in the next release. */- UniverRPCNodeWorkerPlugin,-} from './worker';diff --git a/packages/rpc/README.md b/packages/rpc/README.mdindex 11ea640028..0d2828456a 100644--- a/packages/rpc/README.md+++ b/packages/rpc/README.md@@ -32,12 +32,21 @@ univer.registerPlugin(UniverRPCMainThreadPlugin, { workerURL: worker });univer.onDispose(() => worker.terminate());```-The referenced worker module must create its own Univer instance and register `UniverRPCWorkerThreadPlugin`; see the [browser worker example](../../examples/src/sheets-mobile/worker.ts).--Exported plugin classes:+Main-thread plugin classes:- `UniverRPCMainThreadPlugin`-- `UniverRPCWorkerThreadPlugin`++## Worker usage++On the main thread, import `UniverRPCMainThreadPlugin` from `@univerjs/rpc`. Set `workerURL` to the worker URL or instance.++In the worker entry, import `UniverRPCWorkerThreadPlugin` from `@univerjs/rpc/worker`:++```ts+import { UniverRPCWorkerThreadPlugin } from '@univerjs/rpc/worker';++univer.registerPlugin(UniverRPCWorkerThreadPlugin);+```## Resourcesdiff --git a/packages/rpc/src/index.ts b/packages/rpc/src/index.tsindex cfe6dfff46..b3d4a403b8 100644--- a/packages/rpc/src/index.ts+++ b/packages/rpc/src/index.ts@@ -30,7 +30,3 @@ export { IRemoteSyncService } from './services/remote-instance/remote-instance.sexport { ChannelService, IRPCChannelService } from './services/rpc/channel.service';export { ChannelClient, ChannelServer, fromModule, toModule } from './services/rpc/rpc.service';export type { IMessageProtocol } from './services/rpc/rpc.service';-export {- /** @deprecated Import from '@univerjs/rpc/worker' instead. This root export will be removed in the next release. */- UniverRPCWorkerThreadPlugin,-} from './worker';diff --git a/packages/sheets-filter-ui/README.md b/packages/sheets-filter-ui/README.mdindex cedda456fa..54e54e8833 100644--- a/packages/sheets-filter-ui/README.md+++ b/packages/sheets-filter-ui/README.md@@ -34,11 +34,22 @@ univer.registerPlugin(UniverSheetsFilterUIPlugin);// Merge EnUS into your Univer locale map when this package contributes UI text.```-Exported plugin classes:+Main-thread plugin classes:- `UniverSheetsFilterUIPlugin`- `UniverSheetsFilterMobileUIPlugin`-- `UniverSheetsFilterUIWorkerPlugin`++## Worker usage++On the main thread, import `UniverSheetsFilterUIPlugin` from `@univerjs/sheets-filter-ui`.++In the worker entry, import `UniverSheetsFilterUIWorkerPlugin` from `@univerjs/sheets-filter-ui/worker`:++```ts+import { UniverSheetsFilterUIWorkerPlugin } from '@univerjs/sheets-filter-ui/worker';++univer.registerPlugin(UniverSheetsFilterUIWorkerPlugin);+```## Resourcesdiff --git a/packages/sheets-filter-ui/src/index.ts b/packages/sheets-filter-ui/src/index.tsindex 83963f2f74..5c8f5ac922 100644--- a/packages/sheets-filter-ui/src/index.ts+++ b/packages/sheets-filter-ui/src/index.ts@@ -22,7 +22,3 @@ export type { IUniverSheetsFilterUIConfig } from './config/config';export { menuSchema as SheetsFilterUIMenuSchema } from './menu/schema';export { UniverSheetsFilterMobileUIPlugin } from './mobile-plugin';export { UniverSheetsFilterUIPlugin } from './plugin';-export {- /** @deprecated Import from '@univerjs/sheets-filter-ui/worker' instead. This root export will be removed in the next release. */- UniverSheetsFilterUIWorkerPlugin,-} from './worker';diff --git a/packages/sheets-filter/README.md b/packages/sheets-filter/README.mdindex 2f219b11fa..11da96ee93 100644--- a/packages/sheets-filter/README.md+++ b/packages/sheets-filter/README.md@@ -39,6 +39,18 @@ const univer = new Univer({univer.registerPlugin(UniverSheetsFilterPlugin);```+## Worker usage++On the main thread, import `UniverSheetsFilterPlugin` from `@univerjs/sheets-filter`.++In the worker entry, import `UniverSheetsFilterPlugin` from `@univerjs/sheets-filter/worker`:++```ts+import { UniverSheetsFilterPlugin } from '@univerjs/sheets-filter/worker';++univer.registerPlugin(UniverSheetsFilterPlugin);+```+## Integration NotesUse this package with `@univerjs/sheets-filter-ui` when users need filter menus and panels.diff --git a/packages/sheets-formula/README.md b/packages/sheets-formula/README.mdindex 435fc7377a..bdd45b8a07 100644--- a/packages/sheets-formula/README.md+++ b/packages/sheets-formula/README.md@@ -33,10 +33,21 @@ univer.registerPlugin(UniverSheetsFormulaPlugin);// Merge EnUS into your Univer locale map when this package contributes UI text.```-Exported plugin classes:+Main-thread plugin classes:- `UniverSheetsFormulaPlugin`-- `UniverRemoteSheetsFormulaPlugin`++## Worker usage++On the main thread, import `UniverSheetsFormulaPlugin` from `@univerjs/sheets-formula`. Set `notExecuteFormula: true` to delegate calculation to the worker.++In the worker entry, import `UniverRemoteSheetsFormulaPlugin` from `@univerjs/sheets-formula/worker`:++```ts+import { UniverRemoteSheetsFormulaPlugin } from '@univerjs/sheets-formula/worker';++univer.registerPlugin(UniverRemoteSheetsFormulaPlugin);+```## Integration Notesdiff --git a/packages/sheets-formula/src/index.ts b/packages/sheets-formula/src/index.tsindex d5f3d398fe..a9340b84be 100644--- a/packages/sheets-formula/src/index.ts+++ b/packages/sheets-formula/src/index.ts@@ -32,7 +32,3 @@ export {RemoteRegisterFunctionService,} from './services/remote/remote-register-function.service';export { calculateFormula } from './util/calculate';-export {- /** @deprecated Import from '@univerjs/sheets-formula/worker' instead. This root export will be removed in the next release. */- UniverRemoteSheetsFormulaPlugin,-} from './worker';diff --git a/packages/sheets-table/README.md b/packages/sheets-table/README.mdindex d3bde42faf..1c99834fdd 100644--- a/packages/sheets-table/README.md+++ b/packages/sheets-table/README.md@@ -39,6 +39,18 @@ const univer = new Univer({univer.registerPlugin(UniverSheetsTablePlugin);```+## Worker usage++On the main thread, import `UniverSheetsTablePlugin` from `@univerjs/sheets-table`.++In the worker entry, import `UniverSheetsTablePlugin` from `@univerjs/sheets-table/worker`:++```ts+import { UniverSheetsTablePlugin } from '@univerjs/sheets-table/worker';++univer.registerPlugin(UniverSheetsTablePlugin);+```+## Integration NotesUse this package with `@univerjs/sheets-table-ui` when users need table controls in the sheet UI.diff --git a/packages/sheets/README.md b/packages/sheets/README.mdindex b1bb4d7446..f58c0634ad 100644--- a/packages/sheets/README.md+++ b/packages/sheets/README.md@@ -33,6 +33,18 @@ univer.registerPlugin(UniverSheetsPlugin);// Merge EnUS into your Univer locale map when this package contributes UI text.```+## Worker usage++On the main thread, import `UniverSheetsPlugin` from `@univerjs/sheets`. Set `notExecuteFormula: true` to delegate calculation to the worker.++In the worker entry, import `UniverSheetsPlugin` from `@univerjs/sheets/worker`:++```ts+import { UniverSheetsPlugin } from '@univerjs/sheets/worker';++univer.registerPlugin(UniverSheetsPlugin, { onlyRegisterFormulaRelatedMutations: true });+```+## Resources- [Documentation](https://docs.univer.ai)diff --git a/presets/packages/preset-sheets-core/README.md b/presets/packages/preset-sheets-core/README.mdindex 5daa95d5ac..394d8e1a5b 100644--- a/presets/packages/preset-sheets-core/README.md+++ b/presets/packages/preset-sheets-core/README.md@@ -31,6 +31,19 @@ import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core';// createUniver({ presets: [UniverSheetsCorePreset()] });```+## Worker usage++On the main thread, import `UniverSheetsCorePreset` from `@univerjs/preset-sheets-core`. Set `workerURL` to the worker URL or instance.++In the worker entry, import `UniverSheetsCoreWorkerPreset` from `@univerjs/preset-sheets-core/worker`:++```ts+import { UniverSheetsCoreWorkerPreset } from '@univerjs/preset-sheets-core/worker';+import { createUniver } from '@univerjs/presets';++createUniver({ presets: [UniverSheetsCoreWorkerPreset()] });+```+## Resources- [Documentation](https://docs.univer.ai)diff --git a/presets/packages/preset-sheets-filter/README.md b/presets/packages/preset-sheets-filter/README.mdindex 5f067a2b1a..6224ddc48b 100644--- a/presets/packages/preset-sheets-filter/README.md+++ b/presets/packages/preset-sheets-filter/README.md@@ -31,6 +31,20 @@ import { UniverSheetsFilterPreset } from '@univerjs/preset-sheets-filter';// createUniver({ presets: [UniverSheetsFilterPreset()] });```+## Worker usage++On the main thread, import `UniverSheetsFilterPreset` from `@univerjs/preset-sheets-filter`. Configure `workerURL` on `UniverSheetsCorePreset`.++In the worker entry, import `UniverSheetsFilterWorkerPreset` from `@univerjs/preset-sheets-filter/worker`:++```ts+import { UniverSheetsCoreWorkerPreset } from '@univerjs/preset-sheets-core/worker';+import { UniverSheetsFilterWorkerPreset } from '@univerjs/preset-sheets-filter/worker';+import { createUniver } from '@univerjs/presets';++createUniver({ presets: [UniverSheetsCoreWorkerPreset(), UniverSheetsFilterWorkerPreset()] });+```+## Resources- [Documentation](https://docs.univer.ai)