github dream-num/univer v0.1.13
πŸŽ‰ Release v0.1.13

latest releases: v0.15.0, v0.14.0, v0.13.0...
19 months ago

🎊 Univer@v0.1.13

Univer Banner

🚧 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.

  1. Install the following packages:
pnpm add @univerjs/drawing @univerjs/drawing-ui

If you want to use this feature in Univer Sheet, install the following package:

 pnpm add @univerjs/sheets-drawing @univerjs/sheets-drawing-ui

Or if you want to use this feature in Univer Doc, install the following package:

 pnpm add @univerjs/docs-drawing @univerjs/docs-drawing-ui
  1. 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';
  1. 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
    ),
  },
});
  1. 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

Features

Don't miss a new univer release

NewReleases is sending notifications on new releases.