github dream-num/univer v1.4.0
đŸ—‚ïž Release v1.4.0

51 minutes ago

Univer 1.4.0 adds Office attachment workflows, shape merging in Slides, richer pivot filtering, and GETPIVOTDATA. This release also separates product-specific comment integrations and introduces several package and API migrations.

New features

Office attachments across Sheets, Docs, and Slides

Preserve embedded OLE files when working with Office documents, with actions to preview, download, rename, and delete attachments. Supported Office files can also be converted into independent online documents when the application provides the required collaboration, attachment, and exchange services.

Office export keeps the original embedded file by default. Applications can request the current confirmed version of a converted online document instead:

import { ExchangeFormat } from '@univerjs-pro/exchange-client';

const file = await univerAPI.exportSheetByUnitIdAsync(
    unitId,
    ExchangeFormat.XLSX,
    undefined,
    { oleAttachmentSource: 'online' }
);

The server must support this export option. Cross-type Office previews require the corresponding existing product UI module; conversion and preview use the existing drawing and exchange plugins.

Merge shapes in Slides

Combine supported selections with Union, Combine, Fragment, Intersect, and Subtract. The operations create new shape geometry and support undo/redo and collaboration. The first selected object determines the primary formatting and the subtraction direction.

Multiple filters and whole-day date filtering

Pivot tables and pivot charts can combine different filter categories on the same field after enabling Allow multiple filters per field. The option is off by default.

Fixed date filters also support whole-day comparison, so timestamps from the same day can match without requiring identical time values.

await pivotTable.setOptions({ allowMultipleFilters: true });

await pivotTable.setDateFilter(fieldId, {
    operator: univerAPI.Enum.ST_PivotFilterOperatorEnum.dateEqual,
    expected: dateSerial,
    useWholeDay: true,
});

Disabling multiple filters while combined filters are active clears the report's filters and the corresponding shared slicer/timeline selections. The UI asks for confirmation.

GETPIVOTDATA

Use GETPIVOTDATA to retrieve aggregated values from a visible PivotTable report:

=GETPIVOTDATA("Sales",$A$3,"Region","East")

The initial implementation reads the visible report from a single-cell anchor, searching up to 200 rows below and 50 columns to its right.

Paragraph word splitting

Docs now respects paragraph settings that allow Latin words to break across lines. A new control in paragraph settings makes this behavior editable and supports inherited and mixed paragraph states.

Product-specific comment integration packages

Image and chart comment Facade integrations have moved out of the generic shape-thread-comment Facade into four new packages:

Package Integration
@univerjs-pro/sheets-drawing-thread-comment Images in Sheets
@univerjs-pro/sheets-chart-thread-comment Charts in Sheets
@univerjs-pro/docs-drawing-thread-comment Images in Docs
@univerjs-pro/docs-chart-thread-comment Charts in Docs

These packages provide the existing createCommentAsync, getComments, and listCommentsAsync methods for their respective objects. Generic FShape comments remain in @univerjs-pro/shape-thread-comment.

Improvements and fixes

  • Formulas: Improve array-spill invalidation, shared-formula dependencies, and recalculation after worksheet-reference changes. Writing cell values through setValue/setValues now persists removal of the replaced formula.
  • Sheets: Preserve imported XLSX table differential formats and inherited font sizes while editing; improve merged-cell rendering, autofill after scrolling, and sheet renaming.
  • UI and mobile: Compact the two-row Ribbon before moving groups into More, improve keyboard navigation, and enforce permissions consistently in mobile controls and dialogs.
  • Collaboration: Reconnect after Chrome page freeze/resume, include filter/table models during snapshot formula replay, and authorize comment-only changesets with the Unit Comment permission.
  • Rendering and performance: Defer SmartArt reference-data initialization, correct spacing for charts with empty titles, preserve LaTeX formula backgrounds, and improve dark-mode editing panels.

Breaking changes and upgrading

Keep all @univerjs/* and @univerjs-pro/* dependencies used by your application on the same version.

Register the matching image/chart comment integration

Applications using image or chart comment methods must add the corresponding package and its Facade import. For example, in an existing Sheets application:

import { UniverSheetsDrawingThreadCommentPlugin } from '@univerjs-pro/sheets-drawing-thread-comment';
import '@univerjs-pro/sheets-drawing-thread-comment/facade';

univer.registerPlugin(UniverSheetsDrawingThreadCommentPlugin);

Apply the same pattern to the other integrations in the table above. Retain the generic shape-comment integration when using FShape comments.

Move Board ink Facade imports

The @univerjs-pro/ink/facade entry has been removed. Board ink methods now belong to FBoard:

-import '@univerjs-pro/ink/facade';
+import '@univerjs-pro/boards/facade';

Import Board ink enums and IBoardInkFacadeInsertOptions from @univerjs-pro/boards/facade as well.

Update custom Worker entry scripts

Use dedicated /worker entry points for worker-side plugins. For example:

-import { UniverRPCWorkerThreadPlugin } from '@univerjs/rpc';
-import { UniverSheetsPivotChartWorkerPlugin } from '@univerjs-pro/sheets-pivot-chart';
+import { UniverRPCWorkerThreadPlugin } from '@univerjs/rpc/worker';
+import { UniverSheetsPivotChartWorkerPlugin } from '@univerjs-pro/sheets-pivot-chart/worker';

The retained root exports for worker-only APIs are deprecated in 1.4.0, with removal planned for 1.5.0 as described below. Docs workers can now register UniverDocsWorkerPlugin from @univerjs/docs/worker instead of calling startDocsLayoutWorker directly. Worker presets have been updated to use the dedicated entries.

Update custom resource serializers

Redundant version/schemaVersion fields have been removed from affected resource payloads, including document formulas, external references, Slides tables, and Slides fonts. Update custom serializers, validators, and imports of the removed schema-version constants.

For example, a document-formula resource is now:

-const resource = { schemaVersion: 1, formulas: {} };
+const resource = { formulas: {} };

Protection and deployment notes

  • Applying worksheet/range protection or setting worksheet permission points clears the affected workbook's undo/redo history. Review workflows that apply protection after editing.
  • Deployments using the new OLE, shape-merge, or pivot-filter workflows need corresponding server-side support. Use an OLE-capable drawing model and compatible native exchange runtime at the import/export boundary.
  • The new table differential-format import requires matching Sheets, Sheets Numfmt, and native exchange components. Historical snapshots are not rewritten automatically; re-import the original XLSX when possible to adopt the new format handling.
  • Update self-hosted collaboration runtimes to receive the snapshot-replay and comment-permission fixes.

Upcoming breaking changes: Worker API cleanup

Removal of the deprecated Worker root exports is planned for 1.5.0, tracked in #8079 and its companion update. These exports are still available in 1.4.0, so custom Worker entry scripts can migrate before the next release.

Import the following APIs from their package's /worker entry instead of its root:

Package API moving to /worker
@univerjs/rpc UniverRPCWorkerThreadPlugin
@univerjs/rpc-node UniverRPCNodeWorkerPlugin
@univerjs/sheets-formula UniverRemoteSheetsFormulaPlugin
@univerjs/sheets-filter-ui UniverSheetsFilterUIWorkerPlugin
@univerjs/engine-render DocumentLayoutSession
@univerjs-pro/bases UniverRemoteBasesPlugin
@univerjs-pro/bases-dashboard UniverRemoteBaseDashboardPlugin
@univerjs-pro/sheets-pivot-chart UniverSheetsPivotChartWorkerPlugin

The two manual startup helpers also need migration:

  • Replace startDocsLayoutWorker from @univerjs/docs with UniverDocsWorkerPlugin from @univerjs/docs/worker.
  • Replace startPdfPageThumbnailWorker from @univerjs-pro/pdfs-ui with UniverPdfsUIWorkerPlugin from @univerjs-pro/pdfs-ui/worker.

For a Docs Worker entry:

import { Univer } from '@univerjs/core';
import { UniverDocsWorkerPlugin } from '@univerjs/docs/worker';

const univer = new Univer();
univer.registerPlugin(UniverDocsWorkerPlugin);

For a PDF thumbnail Worker entry:

import { UniverPdfsUIWorkerPlugin } from '@univerjs-pro/pdfs-ui/worker';
import { Univer } from '@univerjs/core';

const univer = new Univer();
univer.registerPlugin(UniverPdfsUIWorkerPlugin);

Apply these changes inside the Worker entry files. The built-in Worker presets in 1.4.0 already use the dedicated entry points.

Full changelog: v1.3.1
v1.4.0

Don't miss a new univer release

NewReleases is sending notifications on new releases.