v0.1.12
版本发布时间: 2024-05-24 12:21:22
dream-num/univer最新发布版本:v0.1.12(2024-05-24 12:21:22)
🎊 Univer@v0.1.12
🚧 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:
- :octocat: GitHub Discussions
- 👾 Discord
📝 Changelog
Full changelog (2024-05-24)
Bug Fixes
-
export necessary types from ui package (c648310)
-
fix identifier name (c1b4e8b)
-
resolve warning about nested component updates from render methods (#2274) (4e7b4c5)
-
sheet: add info type for Message component, use barColor in ProgressBar (#2277) (7b411b3)
-
sheets-thread-comment: fix some ui issues & update readme.md (#2294) (b230655)
-
sheets-ui: fix doc plugins not loaded before sheet editor (#2279) (e467c1e)
-
ui: fix canvas popup direction definition error (0690697)
-
ui: fix position error (57d4e8a)
-
feat(ui)!: add support for hiding context menu (#2275) (3f12ad8), closes #2275
Features
- add support for customizable context menu & toolbar (#2273) (b253997)
- core: command service support get command type (6775a73)
- extract debugger plugin to standalone package (#2269) (f89e3bd)
- extract hooks for better customization (#2301) (2b75400)
- render-engine: facade adds onCellPointerOver,onCellDragOver,onCellDrop (#2240) (874fa27)
- sheets-conditional-formatting-ui: refactor manage rule selection options (ba56b60)
- sheets-thread-comment: comment support for sheets (#2228) (313ab79), closes #2121 #2120 #2114 #2112 #684 #2174 #2162 #715
- sheets-thread-comment: optimize comment mention source injector method (#2303) (a5a7b33)
- thread-comment: add data-source-service export (#2296) (41d0639)
- ui: popup enhance direction (#2281) (e9c27b7)
- ui: ui parts service support more generic situations (#2286) (415d5b8)
- umd: add thread comment support to the UMD bundle (#2288) (d909b5f)
BREAKING CHANGES
-
The default values for
header
andfooter
are now set to true. -
feat: update examples