MyGit

v0.1.12

dream-num/univer

版本发布时间: 2024-05-24 12:21:22

dream-num/univer最新发布版本:v0.1.12(2024-05-24 12:21:22)

🎊 Univer@v0.1.12

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

Comments for Univer Sheet

In this new version, we add comment function to univer, for using, following the guide bellow.

pnpm add @univerjs/sheets-thread-comment @univerjs/thread-comment-ui
import '@univerjs/thread-comment-ui/lib/index.css';
import '@univerjs/sheets-thread-comment/lib/index.css';

import { UniverSheetsThreadCommentPlugin, IThreadCommentMentionDataService} from '@univerjs/sheets-thread-comment';

const mockUser = {
  userID: 'mockId',
  name: 'MockUser',
  avatar: 'icon-url',
  anonymous: false,
  canBindAnonymous: false,
};

class CustomMentionDataService implements IThreadCommentMentionDataService {
  trigger: string = '@';

  // Get the common interface implementation of the mentioned user
  async getMentions(search: string) {
    return [
      {
        id: mockUser.userID,
        label: mockUser.name,
        type: 'user',
        icon: mockUser.avatar,
      },
      {
        id: '2',
        label: 'User2',
        type: 'user',
        icon: mockUser.avatar,
      },
    ];
  }
}

univer.registerPlugin(UniverSheetsThreadCommentPlugin, {
  overrides: [[IThreadCommentMentionDataService, { useClass: CustomMentionDataService }]],
});

Please refer to Comment / Annotation for more details.

New Cell Hooks

The new cell hook supports more event listeners and now supports: onCellPointerOver, onCellDragOver, onCellDrop. Please refer to our Univer Sheet API for more details.

Add support for hiding context menu

We have added the ability to hide the context menu in the Univer UI plugin. You can now disable the context menu by setting the contextMenu option to false.

univer.registerPlugin(UniverUIPlugin, {
+  contextMenu: false
});
Support for customizing the properties of menu items

Now all plugins that provide menu items support customizing the properties of menu items through configuration options, such as hiding, disabling, grouping, etc.

univer.registerPlugin(UniverSheetsUIPlugin, {
  menu: {
    [menuId: string]: {
      tooltip?: string
      group?: MenuGroup
      type?: MenuItemType
      icon?: string
      title?: string
      positions?: OneOrMany<MenuPosition | string>
      disabled?: boolean
      value?: string | number | boolean
      hidden?: boolean
      disabled?: boolean
      activated?: boolean
    },
  },
});

For example, to hide the bold menu item:

univer.registerPlugin(UniverSheetsUIPlugin, {
  menu: {
    'sheet.command.set-range-bold': {
      hidden: true,
    },
  },
});

💔 Breaking Changes

Now the header and footer options of the @univerjs/ui plugin are true by default. If you don't want the header and footer, you need to explicitly set them to false.

univer.registerPlugin(UniverUIPlugin, {
-  header: true;
-  footer: true;
});

🔮 Breaking Changes Preview

We will remove the built-in Chinese support in the next version (v0.1.13). If your project depends on Chinese support, please add Chinese language packages by yourself.

const univer = new Univer({
    theme: defaultTheme,
+   locale: LocaleType.ZH_CN,
+   locales: {
+       [LocaleType.ZH_CN]: zhCN,
+   },
});

We also changed the way to import language packages. In v0.1.13, you need to import language packages like this:

- import { enUS as DesignEnUS } from '@univerjs/design';
+ import DesignEnUS from '@univerjs/design/locale/en-US';

📢 Join the Conversation

We welcome your input and insights as we embark on this exciting journey. Connect with us on:

📝 Changelog

Full changelog (2024-05-24)

Bug Fixes

Features

BREAKING CHANGES

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-05-24发行的版本