π Univer@v0.1.13
π§ Important Note
This project is still in heavy development, and major API changes are expected. Your feedback is crucial! Please submit issues and suggestions to help us shape the future of Univer.
π Getting Started
If you're eager to explore Univer, check out our getting started documentation.
Dive into the world of collaborative document, spreadsheet, and presentation editing powered by Univer!
π What's new
π Highlights
In this release, we are excited to introduce a new set of features and improvements to enhance your Univer experience. Here are the highlights:
Floating Images
Now you can insert floating images into your spreadsheet / document to make your data more visually appealing. This feature allows you to add images to your sheet canvas area and adjust their position and size as needed.
- Install the following packages:
pnpm add @univerjs/drawing @univerjs/drawing-uiIf you want to use this feature in Univer Sheet, install the following package:
pnpm add @univerjs/sheets-drawing @univerjs/sheets-drawing-uiOr if you want to use this feature in Univer Doc, install the following package:
pnpm add @univerjs/docs-drawing @univerjs/docs-drawing-ui- Import the plugins:
import '@univerjs/drawing-ui/lib/index.css';
import '@univerjs/docs-drawing-ui/lib/index.css';
import { UniverDrawingPlugin } from '@univerjs/drawing';
import { UniverDrawingUIPlugin } from '@univerjs/drawing-ui';
// Use this feature in Univer Sheet
import { UniverSheetsDrawingPlugin } from '@univerjs/sheets-drawing';
import { UniverSheetsDrawingUIPlugin } from '@univerjs/sheets-drawing-ui';
// Use this feature in Univer Doc
import { UniverDocsDrawingPlugin} from '@univerjs/docs-drawing';
import { UniverDocsDrawingUIPlugin } from '@univerjs/docs-drawing-ui';- Add locale resources:
import { LocaleType, Tools } from '@univerjs/core'
+ import DrawingUIEnUS from '@univerjs/drawing-ui/locale/en-US';
// Use this feature in Univer Sheet
+ import SheetsDrawingUIEnUS from '@univerjs/sheets-drawing-ui/locale/en-US';
// Use this feature in Univer Doc
+ import DocsDrawingUIEnUS from '@univerjs/docs-drawing-ui/locale/en-US';
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.EN_US,
locales: {
[LocaleType.EN_US]: Tools.deepMerge(
+ DrawingUIEnUS,
// Use this feature in Univer Sheet
+ SheetsDrawingUIEnUS
// Use this feature in Univer Doc
+ DocsDrawingUIEnUS
),
},
});- Register the plugin:
univer.registerPlugin(UniverDrawingPlugin);
univer.registerPlugin(UniverDrawingUIPlugin);
// If you want to use this feature in Univer Sheet
univer.registerPlugin(UniverSheetsDrawingPlugin);
univer.registerPlugin(UniverSheetsDrawingUIPlugin);
// If you want to use this feature in Univer Doc
univer.registerPlugin(UniverDocsDrawingPlugin);
univer.registerPlugin(UniverDocsDrawingUIPlugin);In addition, @univerjs/sheets-drawing-ui provides an API to allow developers to add a floating image to the sheet canvas area.
import { SheetCanvasFloatDomManagerService } from '@univerjs/sheets-drawing-ui';
const floatDomService = accessor.get(SheetCanvasFloatDomManagerService);
floatDomService.addFloatDomToPosition({
allowTransform: true,
initPosition: {
startX: 200,
endX: 400,
startY: 200,
endY: 400,
},
componentKey: 'ImageDemo',
});Check out the documentation for more details.
Hyperlink
@univerjs/sheets-hyper-link-ui provides a hyperlink feature that allows users to create links for quick access to resources both within and outside of the spreadsheet, including web pages, files, email addresses, or other locations in the workbook.
For Usage:
import { UniverSheetsHyperLinkUIPlugin } from '@univerjs/sheets-hyper-link-ui';
univer.registerPlugin(UniverSheetsHyperLinkUIPlugin);Check out the documentation for more details.
Permission
Handle permission interception in front-end scenarios. When it detects that there is no corresponding permission for a certain action, it will terminate the code execution and prompt the user about the missing permission.
For Usage:
import { WorkbookEditablePermission } from '@univerjs/sheets';
import { IPermissionService } from '@univerjs/core';
class YourService {
constructor(@IPermissionService private _permissionService: IPermissionService) {
}
setWorkbookNotEditable() {
this._permissionService.updatePermissionPoint(new WorkbookEditablePermission('unitId').id, false);
}
setWorkbookEditable() {
this._permissionService.updatePermissionPoint(new WorkbookEditablePermission('unitId').id, true);
}
}Check out the documentation for more details.
π Breaking Changes
From v0.1.13, we have unified the way to import internationalization resources:
- import { enUS as DesignEnUS } from '@univerjs/design';
+ import DesignEnUS from '@univerjs/design/locale/en-US';And we have also removed the built-in Simplified Chinese language pack, developers need to import it themselves:
const univer = new Univer({
theme: defaultTheme,
+ locale: LocaleType.ZH_CN,
+ locales: {
+ [LocaleType.ZH_CN]: zhCN,
+ },
});Note: If you are troubled by importing a large number of internationalization resources and style files, you can use the univer plugins to import them, please refer to univer plugins.
π’ Special Thanks
Special thanks to the following contributors who have made this release possible:
π’ Join the Conversation
We welcome your input and insights as we embark on this exciting journey. Connect with us on:
π Changelog
Full changelog (2024-06-03)
Bug Fixes
- background position error in zen editor (#2313) (6e6f185)
- cell number display when set text wrap (#2314) (0144179)
- check cell data and remove linebreak in v filed (#2382) (cfc2e0a)
- clear format failed when not change selections (#2338) (07a4e0f)
- core: observer remove unregisterOnNextCall (#2334) (5c4f479)
- cursor size follow anchor glyph (#2365) (9d8bb89)
- design: resolve text overflow issue in Select component for long content (#2352) (0ff261d)
- drawing-ui: fix incomplete display of drawing panel styles (#2387) (9831db9)
- drawing: doc drawing same to sheet drawing (#2372) (e3f6654)
- dv 18n (#2370) (da8b06b)
- editor: add valid attribute (#1730) (2dee268)
- email link jump error (#2378) (950be43)
- fix get SSE param (07e0ebb)
- fix import error (#2384) (3345064)
- fix multiple dialogs being opened at the same time (#2341) (ce5d10c)
- fixed a typo in links (#2325) (f5162c9)
- fixed outdated start dev server command (#2320) (4fb451c)
- formula: case sensitive (#2329) (a6761dd)
- formula: progress for multiple calculation (#2342) (1169af4)
- formular confirm error (#2318) (1eca6d1)
- inline format support cursor (#2347) (94f2149)
- move row&col effects on filter-range (#2284) (200e655)
- network: fix http headers parsing (a1beac6)
- network: fix http type (#2359) (fe3ac1d)
- no need to set background to linebreak (#2335) (4140cb7)
- paste special (format only) will not paste richformat (#2098) (8cd421b)
- render-engine: optimize underline postion (#2164) (b0ccb91)
- render: dispose cycle (#2393) (bfe75db)
- sheet: active next sheet when remove sheet (#2305) (9a24216)
- sheet: border color (#2326) (1e2b4c3)
- sheet: insert row supports cell value (#2346) (c87246c)
- sheets: add exports (8a4b1f5)
- storybook failed because can not override name property (#2339) (5853999)
- ui: correct the resize listener target in toolbar (#2321) (734c4d2)
- underline in sheet cell (#2306) (5c6b010)
- update import paths for drawing UI panel in image panels (#2392) (e971e28)
Features
- add more exports from UI package (#2309) (916e3cc)
- change aux line color and default cell size (ce8b96a)
- change message and notification API (#2332) (5cc6881)
- doc-popup (#2322) (0123c54)
- drawing: sheets and docs drawing (#2324) (4853425)
- facade: add lifecycle hooks for facade (#2357) (ebb1d59)
- facade: click to get cell information, whether to merge and coordinates (#2362) (1300ebc)
- i18n: add i18n support to umd (452effb)
- message: add some option property for meesage, it use for custo⦠(#2340) (bf2c021)
- network: add http sse method (#2358) (a87c44a)
- permission remaining issues (#2375) (dade734)
- permission: support permission (#1931) (09fd989)
- render-engine: move cache to viewport (#2188) (a4e5b11), closes #676 #677 #676 #677 #700 #700
- sheet: add name observables on Workbook (fa76180)
- sheets-hyper-link: add hyper link for sheet (#2330) (09518aa)
- sheets-ui: support canvas float dom (#2343) (1f95047)
- support for tilting the cursor when italicized (#1932) (ac62428)
- toolbar: add automatic calculation of toolbar gap style (#2345) (91f3b7c)
- ui: not auto removing when duration is 0 (#2366) (a98e8ab)
