Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
docs: wzhudev (#693)
Wenzhao Hu8d7f40d486d5
diff --git a/LICENSE b/LICENSE.txtsimilarity index 100%rename from LICENSErename to LICENSE.txtdiff --git a/README.md b/README.mdindex ceff6d46a6..ef977f7816 100644--- a/README.md+++ b/README.md@@ -14,7 +14,8 @@ Univer is an open source collaborative solution that aims to empower the collaboWe provide JavaScript part of code in the repository, including a canvas-based framework for building documents, spreadsheets, slides.-> ⚠️ This project is still in heavy development.+> ⚠️ This project is still in heavy development. Use it at your own risk.+## Demo- [Univer Demo](https://dream-num.github.io/univer-demo/)diff --git a/apps/docs/LICENSE.txt b/apps/docs/LICENSE.txtnew file mode 100644index 0000000000..63f44cc3ac--- /dev/null+++ b/apps/docs/LICENSE.txt@@ -0,0 +1,360 @@+Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International+Public License++By exercising the Licensed Rights (defined below), You accept and agree+to be bound by the terms and conditions of this Creative Commons+Attribution-NonCommercial-ShareAlike 4.0 International Public License+("Public License"). To the extent this Public License may be+interpreted as a contract, You are granted the Licensed Rights in+consideration of Your acceptance of these terms and conditions, and the+Licensor grants You such rights in consideration of benefits the+Licensor receives from making the Licensed Material available under+these terms and conditions.+++Section 1 -- Definitions.++ a. Adapted Material means material subject to Copyright and Similar+ Rights that is derived from or based upon the Licensed Material+ and in which the Licensed Material is translated, altered,+ arranged, transformed, or otherwise modified in a manner requiring+ permission under the Copyright and Similar Rights held by the+ Licensor. For purposes of this Public License, where the Licensed+ Material is a musical work, performance, or sound recording,+ Adapted Material is always produced where the Licensed Material is+ synched in timed relation with a moving image.++ b. Adapter's License means the license You apply to Your Copyright+ and Similar Rights in Your contributions to Adapted Material in+ accordance with the terms and conditions of this Public License.++ c. BY-NC-SA Compatible License means a license listed at+ creativecommons.org/compatiblelicenses, approved by Creative+ Commons as essentially the equivalent of this Public License.++ d. Copyright and Similar Rights means copyright and/or similar rights+ closely related to copyright including, without limitation,+ performance, broadcast, sound recording, and Sui Generis Database+ Rights, without regard to how the rights are labeled or+ categorized. For purposes of this Public License, the rights+ specified in Section 2(b)(1)-(2) are not Copyright and Similar+ Rights.++ e. Effective Technological Measures means those measures that, in the+ absence of proper authority, may not be circumvented under laws+ fulfilling obligations under Article 11 of the WIPO Copyright+ Treaty adopted on December 20, 1996, and/or similar international+ agreements.++ f. Exceptions and Limitations means fair use, fair dealing, and/or+ any other exception or limitation to Copyright and Similar Rights+ that applies to Your use of the Licensed Material.++ g. License Elements means the license attributes listed in the name+ of a Creative Commons Public License. The License Elements of this+ Public License are Attribution, NonCommercial, and ShareAlike.++ h. Licensed Material means the artistic or literary work, database,+ or other material to which the Licensor applied this Public+ License.++ i. Licensed Rights means the rights granted to You subject to the+ terms and conditions of this Public License, which are limited to+ all Copyright and Similar Rights that apply to Your use of the+ Licensed Material and that the Licensor has authority to license.++ j. Licensor means the individual(s) or entity(ies) granting rights+ under this Public License.++ k. NonCommercial means not primarily intended for or directed towards+ commercial advantage or monetary compensation. For purposes of+ this Public License, the exchange of the Licensed Material for+ other material subject to Copyright and Similar Rights by digital+ file-sharing or similar means is NonCommercial provided there is+ no payment of monetary compensation in connection with the+ exchange.++ l. Share means to provide material to the public by any means or+ process that requires permission under the Licensed Rights, such+ as reproduction, public display, public performance, distribution,+ dissemination, communication, or importation, and to make material+ available to the public including in ways that members of the+ public may access the material from a place and at a time+ individually chosen by them.++ m. Sui Generis Database Rights means rights other than copyright+ resulting from Directive 96/9/EC of the European Parliament and of+ the Council of 11 March 1996 on the legal protection of databases,+ as amended and/or succeeded, as well as other essentially+ equivalent rights anywhere in the world.++ n. You means the individual or entity exercising the Licensed Rights+ under this Public License. Your has a corresponding meaning.+++Section 2 -- Scope.++ a. License grant.++ 1. Subject to the terms and conditions of this Public License,+ the Licensor hereby grants You a worldwide, royalty-free,+ non-sublicensable, non-exclusive, irrevocable license to+ exercise the Licensed Rights in the Licensed Material to:++ a. reproduce and Share the Licensed Material, in whole or+ in part, for NonCommercial purposes only; and++ b. produce, reproduce, and Share Adapted Material for+ NonCommercial purposes only.++ 2. Exceptions and Limitations. For the avoidance of doubt, where+ Exceptions and Limitations apply to Your use, this Public+ License does not apply, and You do not need to comply with+ its terms and conditions.++ 3. Term. The term of this Public License is specified in Section+ 6(a).++ 4. Media and formats; technical modifications allowed. The+ Licensor authorizes You to exercise the Licensed Rights in+ all media and formats whether now known or hereafter created,+ and to make technical modifications necessary to do so. The+ Licensor waives and/or agrees not to assert any right or+ authority to forbid You from making technical modifications+ necessary to exercise the Licensed Rights, including+ technical modifications necessary to circumvent Effective+ Technological Measures. For purposes of this Public License,+ simply making modifications authorized by this Section 2(a)+ (4) never produces Adapted Material.++ 5. Downstream recipients.++ a. Offer from the Licensor -- Licensed Material. Every+ recipient of the Licensed Material automatically+ receives an offer from the Licensor to exercise the+ Licensed Rights under the terms and conditions of this+ Public License.++ b. Additional offer from the Licensor -- Adapted Material.+ Every recipient of Adapted Material from You+ automatically receives an offer from the Licensor to+ exercise the Licensed Rights in the Adapted Material+ under the conditions of the Adapter's License You apply.++ c. No downstream restrictions. You may not offer or impose+ any additional or different terms or conditions on, or+ apply any Effective Technological Measures to, the+ Licensed Material if doing so restricts exercise of the+ Licensed Rights by any recipient of the Licensed+ Material.++ 6. No endorsement. Nothing in this Public License constitutes or+ may be construed as permission to assert or imply that You+ are, or that Your use of the Licensed Material is, connected+ with, or sponsored, endorsed, or granted official status by,+ the Licensor or others designated to receive attribution as+ provided in Section 3(a)(1)(A)(i).++ b. Other rights.++ 1. Moral rights, such as the right of integrity, are not+ licensed under this Public License, nor are publicity,+ privacy, and/or other similar personality rights; however, to+ the extent possible, the Licensor waives and/or agrees not to+ assert any such rights held by the Licensor to the limited+ extent necessary to allow You to exercise the Licensed+ Rights, but not otherwise.++ 2. Patent and trademark rights are not licensed under this+ Public License.++ 3. To the extent possible, the Licensor waives any right to+ collect royalties from You for the exercise of the Licensed+ Rights, whether directly or through a collecting society+ under any voluntary or waivable statutory or compulsory+ licensing scheme. In all other cases the Licensor expressly+ reserves any right to collect such royalties, including when+ the Licensed Material is used other than for NonCommercial+ purposes.+++Section 3 -- License Conditions.++Your exercise of the Licensed Rights is expressly made subject to the+following conditions.++ a. Attribution.++ 1. If You Share the Licensed Material (including in modified+ form), You must:++ a. retain the following if it is supplied by the Licensor+ with the Licensed Material:++ i. identification of the creator(s) of the Licensed+ Material and any others designated to receive+ attribution, in any reasonable manner requested by+ the Licensor (including by pseudonym if+ designated);++ ii. a copyright notice;++ iii. a notice that refers to this Public License;++ iv. a notice that refers to the disclaimer of+ warranties;++ v. a URI or hyperlink to the Licensed Material to the+ extent reasonably practicable;++ b. indicate if You modified the Licensed Material and+ retain an indication of any previous modifications; and++ c. indicate the Licensed Material is licensed under this+ Public License, and include the text of, or the URI or+ hyperlink to, this Public License.++ 2. You may satisfy the conditions in Section 3(a)(1) in any+ reasonable manner based on the medium, means, and context in+ which You Share the Licensed Material. For example, it may be+ reasonable to satisfy the conditions by providing a URI or+ hyperlink to a resource that includes the required+ information.+ 3. If requested by the Licensor, You must remove any of the+ information required by Section 3(a)(1)(A) to the extent+ reasonably practicable.++ b. ShareAlike.++ In addition to the conditions in Section 3(a), if You Share+ Adapted Material You produce, the following conditions also apply.++ 1. The Adapter's License You apply must be a Creative Commons+ license with the same License Elements, this version or+ later, or a BY-NC-SA Compatible License.++ 2. You must include the text of, or the URI or hyperlink to, the+ Adapter's License You apply. You may satisfy this condition+ in any reasonable manner based on the medium, means, and+ context in which You Share Adapted Material.++ 3. You may not offer or impose any additional or different terms+ or conditions on, or apply any Effective Technological+ Measures to, Adapted Material that restrict exercise of the+ rights granted under the Adapter's License You apply.+++Section 4 -- Sui Generis Database Rights.++Where the Licensed Rights include Sui Generis Database Rights that+apply to Your use of the Licensed Material:++ a. for the avoidance of doubt, Section 2(a)(1) grants You the right+ to extract, reuse, reproduce, and Share all or a substantial+ portion of the contents of the database for NonCommercial purposes+ only;++ b. if You include all or a substantial portion of the database+ contents in a database in which You have Sui Generis Database+ Rights, then the database in which You have Sui Generis Database+ Rights (but not its individual contents) is Adapted Material,+ including for purposes of Section 3(b); and++ c. You must comply with the conditions in Section 3(a) if You Share+ all or a substantial portion of the contents of the database.++For the avoidance of doubt, this Section 4 supplements and does not+replace Your obligations under this Public License where the Licensed+Rights include other Copyright and Similar Rights.+++Section 5 -- Disclaimer of Warranties and Limitation of Liability.++ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.++ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.++ c. The disclaimer of warranties and limitation of liability provided+ above shall be interpreted in a manner that, to the extent+ possible, most closely approximates an absolute disclaimer and+ waiver of all liability.+++Section 6 -- Term and Termination.++ a. This Public License applies for the term of the Copyright and+ Similar Rights licensed here. However, if You fail to comply with+ this Public License, then Your rights under this Public License+ terminate automatically.++ b. Where Your right to use the Licensed Material has terminated under+ Section 6(a), it reinstates:++ 1. automatically as of the date the violation is cured, provided+ it is cured within 30 days of Your discovery of the+ violation; or++ 2. upon express reinstatement by the Licensor.++ For the avoidance of doubt, this Section 6(b) does not affect any+ right the Licensor may have to seek remedies for Your violations+ of this Public License.++ c. For the avoidance of doubt, the Licensor may also offer the+ Licensed Material under separate terms or conditions or stop+ distributing the Licensed Material at any time; however, doing so+ will not terminate this Public License.++ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public+ License.+++Section 7 -- Other Terms and Conditions.++ a. The Licensor shall not be bound by any additional or different+ terms or conditions communicated by You unless expressly agreed.++ b. Any arrangements, understandings, or agreements regarding the+ Licensed Material not stated herein are separate from and+ independent of the terms and conditions of this Public License.+++Section 8 -- Interpretation.++ a. For the avoidance of doubt, this Public License does not, and+ shall not be interpreted to, reduce, limit, restrict, or impose+ conditions on any use of the Licensed Material that could lawfully+ be made without permission under this Public License.++ b. To the extent possible, if any provision of this Public License is+ deemed unenforceable, it shall be automatically reformed to the+ minimum extent necessary to make it enforceable. If the provision+ cannot be reformed, it shall be severed from this Public License+ without affecting the enforceability of the remaining terms and+ conditions.++ c. No term or condition of this Public License will be waived and no+ failure to comply consented to unless expressly agreed to by the+ Licensor.++ d. Nothing in this Public License constitutes or may be interpreted+ as a limitation upon, or waiver of, any privileges and immunities+ that apply to the Licensor or You, including from the legal+ processes of any jurisdiction or authority.\ No newline at end of filediff --git a/apps/docs/README.md b/apps/docs/README.mdindex e69de29bb2..493dcddb02 100644--- a/apps/docs/README.md+++ b/apps/docs/README.md@@ -0,0 +1,5 @@+# Univer Documentation++## License++[CC-BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed)diff --git a/apps/docs/docs/tutorial/architecture/architecture.md b/apps/docs/docs/tutorial/architecture/architecture.mdindex 1c6aeb62ad..69293bd255 100644--- a/apps/docs/docs/tutorial/architecture/architecture.md+++ b/apps/docs/docs/tutorial/architecture/architecture.md@@ -122,7 +122,7 @@ export class YourService {## 命令系统-在 Univer 当中,对应用状态和数据的变更需要通过命令系统执行。命令系统本身是对应用逻辑的抽象,解耦逻辑的执行过程和其参数,Univer 在此基础上实现协同编辑、宏录制、撤销重做、跟随浏览等能力。+在 Univer 当中,对应用状态和数据的变更需要通过命令系统执行。命令系统本身是对应用逻辑的抽象,解耦逻辑的执行过程和其参数。@univerjs/core 中提供了命令服务,插件可以将业务逻辑封装在命令里,并通过依赖注入系统获取到其他模块从而执行业务逻辑。@@ -166,7 +166,7 @@ export interface ICommandInfo<T extends object = object> {* **协同编辑**:一个协同编辑插件可以监听所有 `MUTATION` 类型命令,并通过协同编辑算法将 `MUTATION` 发送到其他协同端,再通过 `ICommandService` 重新执行这些 `MUTATION`。* **协同光标**:监听选区变化的 `OPERATION` 并发送到其他端,其他端通过解析参数来绘制协同光标* **Live Share**:监听滚动和缩放 `OPERATION` 并发送到观众端,观众可以同步演示者的浏览位置-* 宏录制+* 操作录制等等。diff --git a/apps/docs/docs/tutorial/architecture/extensibility.md b/apps/docs/docs/tutorial/architecture/extensibility.mddeleted file mode 100644index 2eff4fd8c1..0000000000--- a/apps/docs/docs/tutorial/architecture/extensibility.md+++ /dev/null@@ -1,5 +0,0 @@-----sidebar_position: 3------# 可使用的扩展能力\ No newline at end of filediff --git a/apps/docs/docs/tutorial/architecture/formula.md b/apps/docs/docs/tutorial/architecture/formula.mdindex 49b6eb2864..2d81b66fb9 100644--- a/apps/docs/docs/tutorial/architecture/formula.md+++ b/apps/docs/docs/tutorial/architecture/formula.md@@ -1,5 +1,5 @@----sidebar_position: 4+sidebar_position: 2----# 公式引擎架构\ No newline at end of file+# 公式引擎架构diff --git a/apps/docs/docs/tutorial/architecture/renderer.md b/apps/docs/docs/tutorial/architecture/renderer.mdindex b3f16a3673..a9737f788b 100644--- a/apps/docs/docs/tutorial/architecture/renderer.md+++ b/apps/docs/docs/tutorial/architecture/renderer.md@@ -1,5 +1,5 @@----sidebar_position: 5+sidebar_position: 3---# 渲染引擎架构diff --git a/apps/docs/docs/tutorial/architecture/sheet-architecture.md b/apps/docs/docs/tutorial/architecture/sheet-architecture.mddeleted file mode 100644index 53fd4c645f..0000000000--- a/apps/docs/docs/tutorial/architecture/sheet-architecture.md+++ /dev/null@@ -1,11 +0,0 @@-----sidebar_position: 2------# Univer Sheet 架构--如同在[架构概要](./architecture) 中所提到的,Univer 以插件化的方式来实现各种功能,Univer Sheet 业务逻辑的实现也是通过插件来完成的,此小节将会介绍 Univer Sheet 的架构。--Univer Sheet 的插件架构如下图所示:--*上图并未绘制出全部的模块,仅做示意*。diff --git a/apps/docs/docs/tutorial/architecture/web-worker.mdx b/apps/docs/docs/tutorial/architecture/web-worker.mdxindex f0fddf45b9..72f509c3e6 100644--- a/apps/docs/docs/tutorial/architecture/web-worker.mdx+++ b/apps/docs/docs/tutorial/architecture/web-worker.mdx@@ -1,5 +1,5 @@----sidebar_position: 6+sidebar_position: 4---# Web Worker 架构diff --git a/apps/docs/docs/tutorial/extend/command.md b/apps/docs/docs/tutorial/extend/command.mdindex e3581dd208..df8418d12e 100644--- a/apps/docs/docs/tutorial/extend/command.md+++ b/apps/docs/docs/tutorial/extend/command.md@@ -1,5 +1,87 @@----sidebar_position: 4+sidebar_position: 2----# 扩展命令\ No newline at end of file+# 扩展命令++:::info+建议在阅读本小节内容之前先[了解 Univer 的命令系统](/docs/tutorial/architecture/#命令系统)。+:::++## 创建新命令++创建一个命令需要两个步骤:++第一步,创建一个实现 `ICommand` 接口的对象:++```ts+import { ICommand, CommandType } from '@univer/core';++export interface IYourCommandInterface {+ // Your command's param's interface.+}++export const YourCommand: ICommand = {+ name: 'your-command',+ type: CommandType.COMMAND,+ handler: async (accessor: IAccessor, params?: IYourCommandInterface) => {+ // Implement your business logic here.+ }+}+```++命令需要声明以下属性:++1. `name`:命令的名称,必须唯一;我们建议以 `业务域:类型:含义` 的方式来命名,例如 `sheet.command.copy`、`sheet.command.paste` 等+2. `type`:命令的类型+3. `handler`:命令的执行逻辑,接收一个 `IAccessor` 对象以及命令参数,通过 `IAccessor` 对象可以访问 Univer 的依赖注入系统++命令可接收参数,参数需要是一个对象,接口由你的业务逻辑决定。当然一个命令也可以不接收参数,此时 `handler` 的第二个参数为 `undefined`。++第二步,将 Command 注册到命令服务上:++```ts+import { ICommandService, Disposable } from '@univer/core';++export class YourController extends Disposable {+ constructor(+ @ICommandService private readonly _commandService: ICommandService+ ) {+ this.disposeWithMe(this._commandService.registerCommand(YourCommand));+ }+}+```++之后就可以通过 `ICommandService` 来执行命令了。实践中常用的方式是通过 UI 触发,请参考[拓展 UI](/docs/tutorial/extend/ui)。++### Undo / Redo++Univer 提供了 undo redo 的能力,如果你的命令需要接入,需要在命令的 `handler` 回调函数中调用 `IUndoRedoService` 的对应方法:++```ts+import { IUndoRedoService } from '@univer/core';++export const YourCommand: ICommand = {+ name: 'your-command',+ type: CommandType.COMMAND,+ handler: async (accessor: IAccessor, params?: IYourCommandInterface) => {+ const undoRedoService = accessor.get(IUndoRedoService);++ undoRedoService.pushUndoRedo({+ unitID: 'your-documents-id',+ undoMutations: [/** mutations for undo */],+ redoMutations: [/** mutations for do and redo */],+ });+ }+}+```++## 扩展已有命令++除了创建新命令,Univer 还支持扩展已有的命令,这在扩展 Univer 内置能力时尤其必要。以下介绍三个比较典型的场景。++### 在其他 COMMAND 执行的时机补充 MUTATIONS++### 扩展复制粘贴++### 扩展下拉填充diff --git a/apps/docs/docs/tutorial/extend/model.md b/apps/docs/docs/tutorial/extend/model.mdnew file mode 100644index 0000000000..71685531b6--- /dev/null+++ b/apps/docs/docs/tutorial/extend/model.md@@ -0,0 +1,9 @@+---+sidebar_position: 4+---++# 插件自定义模型++Univer 允许用户自定义插件需要存储在文档快照上的模型。++## 模型引用化diff --git a/apps/docs/docs/tutorial/extend/write-a-plugin.md b/apps/docs/docs/tutorial/extend/write-a-plugin.mdindex df7890f64c..628b665c0a 100644--- a/apps/docs/docs/tutorial/extend/write-a-plugin.md+++ b/apps/docs/docs/tutorial/extend/write-a-plugin.md@@ -1,5 +1,5 @@----sidebar_position: 2+sidebar_position: 1---# 自定义插件\ No newline at end of filediff --git a/apps/docs/docs/tutorial/intro.md b/apps/docs/docs/tutorial/intro.mdindex de70d7caa5..a2120ed0f2 100644--- a/apps/docs/docs/tutorial/intro.md+++ b/apps/docs/docs/tutorial/intro.md@@ -6,33 +6,26 @@ sidebar_position: 1TODO: Logo Here-Univer 是一套企业协同办公文档与数据解决方案,-[](https://badge.fury.io/js/@univerjs%2Fcore)+Univer 是一套企业文档与数据协同解决方案,包括电子表格、文档和幻灯片三大文档类型,高可扩展性设计使得开发者可以在 Univer 的基础上定制个性化功能。## 特性-* 📈 支持电子表格,后续还会支持文档和幻灯片-* 🌌 高度可扩展的架构设计- * 🔌 插件化架构,文档的能力可按需组合,支持自定义插件,方便二次开发- * 💄 提供组件库和图标-* ⚡ 高性能- * ✏️ 统一高效的渲染引擎和公式引擎,基于 Canvas- * 🧮 高性能的公式引擎,支持 Web Worker-* 🌍 国际化支持+- 📈 支持电子表格,后续还会支持文档和幻灯片+- 🌌 高度可扩展的架构设计+ - 🔌 插件化架构,文档的能力可按需组合,支持自定义插件,方便二次开发+ - 💄 提供组件库和图标以帮助开发者呈现一致的用户体验+- ⚡ 高性能+ - ✏️ 统一高效的渲染引擎和公式引擎,基于 Canvas+ - 🧮 高性能的公式引擎,支持 Web Worker+- 🌍 国际化支持## 如何使用-如果你不想在本地设置开发环境,我们准备了一个在线 IDE 来帮助你快速体验使用 Univer 开发,点击[这里](/playground)访问。+如果你不想在本地设置开发环境,我们准备了一个在线 IDE 来帮助你快速体验使用 Univer 开发,点击[这里](/playground)。如果你喜欢本地的开发方式,请参考[快速上手](/docs/category/quick-start)。-## 链接--* [官网](https://univer.work)-* [GitHub](https://github.com/dream-num/univer)-* [知乎专栏](https://www.zhihu.com/org/meng-shu-ke-ji)-## 如何贡献我们欢迎任何形式的贡献,包括但不限于[提交 issue](https://github.com/dream-num/univer/issues/new/choose)、提交 PR、参与讨论等。请在参与 Univer 的开发之前阅读[贡献指南](https://github.com/dream-num/univer/contributingguide)。@@ -45,18 +38,31 @@ Univer 是一套企业协同办公文档与数据解决方案,1. [GitHub Discussions](https://github.com/dream-num/univer/discussions)1. 加入 Univer 中文社群+## 链接++- [官网](https://univer.work)+- [GitHub](https://github.com/dream-num/univer)+- [知乎专栏](https://www.zhihu.com/org/meng-shu-ke-ji)+## 授权协议-Univer 的核心代码在 MIT 协议下开源。Univer 同时提供商业授权,如果你的产品需要进阶功能或者部署方面的支持,可以联系我们获取商业授权。Univer 商业授权包括以下内容:+[Univer 的核心代码](https://github.com/dream-num/univer)在 MIT 协议下开源,任何组织和个人都可以免费使用其源代码和 npm 包。++[本文档](https://github.com/dream-num/univer/tree/dev/apps/docs)在 CC-BY-NC-SA 4.0 协议下开源,任何组织和个人都可以免费使用,但不允许用于商业目的。++## 商业授权++Univer 同时提供商业授权(企业版),包括以下内容:-* 👨💻 多人协同编辑和协同浏览-* 🛜 数据连接器-* 🎚️ 私有化部署咨询服务+- 👨💻 多人协同编辑和协同浏览+- 🛜 数据连接器+- 🎚️ 私有化部署咨询服务-可以通过以下方式咨询商业授权:+如果你需要商业授权,可以通过以下方式咨询:-* 商务合作邮箱 [email protected]-* 商务电话 +(86) 186 0163 9309-* 添加企业微信+- 访问我们的[官方网站](https://univer.ai)+- 商务合作邮箱 [email protected]+- 商务电话 +(86) 186 0163 9309+- 添加企业微信<img width="300" src="/img/business-qr-code.jpg" />diff --git a/apps/docs/docs/tutorial/plugins/_category_.json b/apps/docs/docs/tutorial/plugins/_category_.jsonindex 97ac1a2964..402f844b06 100644--- a/apps/docs/docs/tutorial/plugins/_category_.json+++ b/apps/docs/docs/tutorial/plugins/_category_.json@@ -3,7 +3,7 @@"position": 4,"link": {"type": "generated-index",- "description": "Univer 的能力可以通过插件来扩展,这里列出了所有可用的官方插件并简要介绍了它们提供的能力。了解如何使用这些插件提供的能力,请参考 \"扩展 Univer\" 小节。"+ "description": "Univer 的能力可以通过插件来扩展,这里列出了所有可用的官方插件并简要介绍了它们提供的能力。了解如何使用这些插件提供的能力,请参考 \"扩展 Univer\" 小节。了解这些 plugin 暴露的模块和其 API,请参考插件对应的 API 文档。"}}diff --git a/apps/docs/docs/tutorial/plugins/common/_category_.json b/apps/docs/docs/tutorial/plugins/common/_category_.jsonindex 4db886eb97..ada17ac384 100644--- a/apps/docs/docs/tutorial/plugins/common/_category_.json+++ b/apps/docs/docs/tutorial/plugins/common/_category_.json@@ -3,7 +3,7 @@"position": 1,"link": {"type": "generated-index",- "description": "通用插件提供了 Univer 中的基础能力,可以被上层业务的插件所依赖。"+ "description": "通用插件提供了 Univer 中的基础能力。"}}diff --git a/apps/docs/docs/tutorial/plugins/common/base-render.md b/apps/docs/docs/tutorial/plugins/common/base-render.mddeleted file mode 100644index 0bbc163437..0000000000--- a/apps/docs/docs/tutorial/plugins/common/base-render.md+++ /dev/null@@ -1,5 +0,0 @@-----sidebar_position: 3------# @univerjs/engine-render\ No newline at end of filediff --git a/apps/docs/docs/tutorial/plugins/common/core.md b/apps/docs/docs/tutorial/plugins/common/core.mdindex 824771ce60..32a36e317d 100644--- a/apps/docs/docs/tutorial/plugins/common/core.md+++ b/apps/docs/docs/tutorial/plugins/common/core.md@@ -4,9 +4,11 @@ sidebar_position: 1# @univerjs/core-@univerjs/core 是 Univer 的核心仓库,它提供了一些基础的功能,包括:+[](https://badge.fury.io/js/@univerjs%2Fcore)-- 提供作为应用入口和其他 plugin 挂载点的 `Univer` 类+@univerjs/core 是 Univer 的核心仓库,它提供的基础能力包括:++- 提供作为应用入口和其他 plugin 挂载点的 `Univer` 类型,以及管理不同类型文档的 `UniverDoc` 和 `UniverSheet` 类型- 各个类型文档的基本模型- 定义或者实现一些基础服务,例如- 权限控制@@ -21,11 +23,3 @@ sidebar_position: 1- 资源管理@univerjs/core 的 API 请参考 API 文档。--## Univer Sheet Models--* UniverSheet 类型,它负责管理 Sheet 相关的 plugin-* Workbook 类型,它是一个工作簿,包含多个 Worksheet,存储工作簿的元数据-* Worksheet 类型,它是一个工作表,存储每个子表的数据--## Univer Doc Modelsdiff --git a/apps/docs/docs/tutorial/plugins/common/design.md b/apps/docs/docs/tutorial/plugins/common/design.mdindex 8c56630420..71de3521cc 100644--- a/apps/docs/docs/tutorial/plugins/common/design.md+++ b/apps/docs/docs/tutorial/plugins/common/design.md@@ -4,6 +4,8 @@ sidebar_position: 9# @univerjs/design+[](https://badge.fury.io/js/@univerjs%2Fdesign)+为了让 Univer 的插件 UI 能够有更好的一致性,也为了降低用户自定义开发时的工作量,我们提供了一些基础的设计规范和组件。组件基于 React 和 less 开发,可以访问[组件库网站](https://univer-design.vercel.app/?path=/docs/design-design-token-default--docs)了解更多信息。diff --git a/apps/docs/docs/tutorial/plugins/common/engine-formula.md b/apps/docs/docs/tutorial/plugins/common/engine-formula.mdnew file mode 100644index 0000000000..1e40f2e937--- /dev/null+++ b/apps/docs/docs/tutorial/plugins/common/engine-formula.md@@ -0,0 +1,9 @@+---+sidebar_position: 4+---++# @univerjs/engine-formula++[](https://badge.fury.io/js/@univerjs%2Fengine-formula)++@univerjs/engine-formula 是一个公式引擎,它提供了一套公式计算的基础能力。包括公式字符串解析,公式计算,公式依赖分析等。diff --git a/apps/docs/docs/tutorial/plugins/common/engine-numfmt.md b/apps/docs/docs/tutorial/plugins/common/engine-numfmt.mdnew file mode 100644index 0000000000..3298289e76--- /dev/null+++ b/apps/docs/docs/tutorial/plugins/common/engine-numfmt.md@@ -0,0 +1,9 @@+---+sidebar_position: 5+---++# @univerjs/engine-numfmt++[](https://badge.fury.io/js/@univerjs%2Fengine-numfmt)++@univerjs/engine-numfmt 提供在不同的文档中对数字进行格式化的能力。diff --git a/apps/docs/docs/tutorial/plugins/common/engine-render.md b/apps/docs/docs/tutorial/plugins/common/engine-render.mdnew file mode 100644index 0000000000..2ff4aad33b--- /dev/null+++ b/apps/docs/docs/tutorial/plugins/common/engine-render.md@@ -0,0 +1,9 @@+---+sidebar_position: 3+---++# @univerjs/engine-render++[](https://badge.fury.io/js/@univerjs%2Fengine-render)++@univerjs/engine-render 提供在 canvas 元素上渲染 Univer 文档的能力。包括绘制图形元素、处理光标交互、处理滚动缩放等能力。各类文档的渲染层在 @univerjs/engine-render 提供的基础设施上进行扩展。diff --git a/apps/docs/docs/tutorial/plugins/common/formula.md b/apps/docs/docs/tutorial/plugins/common/formula.mddeleted file mode 100644index a60207c0a5..0000000000--- a/apps/docs/docs/tutorial/plugins/common/formula.md+++ /dev/null@@ -1 +0,0 @@-# @univerjs/engine-formula\ No newline at end of filediff --git a/apps/docs/docs/tutorial/plugins/common/icon.md b/apps/docs/docs/tutorial/plugins/common/icons.mdsimilarity index 72%rename from apps/docs/docs/tutorial/plugins/common/icon.mdrename to apps/docs/docs/tutorial/plugins/common/icons.mdindex 79f362de96..a3df50a81b 100644--- a/apps/docs/docs/tutorial/plugins/common/icon.md+++ b/apps/docs/docs/tutorial/plugins/common/icons.md@@ -4,6 +4,8 @@ sidebar_position: 10# @univerjs/icons+[](https://badge.fury.io/js/@univerjs%2Ficons)+出于和 [@univerjs/design](/docs/tutorial/plugins/common/design) 相似的目的,我们也提供了一些基础图标。你可以访问[图标库网站](https://univer-icons.vercel.app/)了解更多信息。diff --git a/apps/docs/docs/tutorial/plugins/common/numfmt.md b/apps/docs/docs/tutorial/plugins/common/numfmt.mddeleted file mode 100644index b6f037b9cb..0000000000--- a/apps/docs/docs/tutorial/plugins/common/numfmt.md+++ /dev/null@@ -1 +0,0 @@-# @univerjs/engine-numfmt\ No newline at end of filediff --git a/apps/docs/docs/tutorial/plugins/common/rpc.md b/apps/docs/docs/tutorial/plugins/common/rpc.mdindex c51f1c4967..9590a29e9a 100644--- a/apps/docs/docs/tutorial/plugins/common/rpc.md+++ b/apps/docs/docs/tutorial/plugins/common/rpc.md@@ -3,3 +3,9 @@ sidebar_position: 6---# @univerjs/rpc++[](https://badge.fury.io/js/@univerjs%2Frpc)++在处理一些比较耗时的任务——例如公式计算——时,Univer 可以将它们转移到主线程之外的地方进行,例如 Web Worker 线程中。@univerjs/rpc 提供了一套 RPC 机制,使得在主线程和其他线程之间进行通信变得简单。++详情请参考 [Web Worker 架构](/docs/tutorial/architecture/web-worker)。\ No newline at end of filediff --git a/apps/docs/docs/tutorial/plugins/common/ui.md b/apps/docs/docs/tutorial/plugins/common/ui.mdindex 7a27c1f9f5..f1f2ee4520 100644--- a/apps/docs/docs/tutorial/plugins/common/ui.md+++ b/apps/docs/docs/tutorial/plugins/common/ui.md@@ -4,8 +4,9 @@ sidebar_position: 2# @univerjs/ui-@univerjs/ui 定义了基本的 UI 服务,并基于 React 提供了一套桌面端的 Workbench 实现。+[](https://badge.fury.io/js/@univerjs%2Fui)+@univerjs/ui 定义了基本的 UI 服务,并基于 React 提供了一套桌面端的 Workbench 实现。## UI 服务@@ -13,10 +14,10 @@ UI 服务定义了一些在客户端运行,但与特定的宿主无关(例这些 UI 服务包括:-* 菜单服务,用于注册菜单项以及其对应的 command-* 快捷键服务,用于注册快捷键以及其对应的 command-* 剪贴板服务,从剪贴板读取或写入数据-* 弹窗服务,包括 confirm 和 dialog 等+- 菜单服务,用于注册菜单项以及其对应的 command+- 快捷键服务,用于注册快捷键以及其对应的 command+- 剪贴板服务,从剪贴板读取或写入数据+- 弹窗服务,包括 confirm 和 dialog 等等等。@@ -26,5 +27,4 @@ UI 服务定义了一些在客户端运行,但与特定的宿主无关(例-----@univerjs/ui 的 API 请参考 API 文档。\ No newline at end of file+@univerjs/ui 的 API 请参考 API 文档。diff --git a/apps/docs/docs/tutorial/plugins/common/uniscript.md b/apps/docs/docs/tutorial/plugins/common/uniscript.mdnew file mode 100644index 0000000000..5d6560d365--- /dev/null+++ b/apps/docs/docs/tutorial/plugins/common/uniscript.md@@ -0,0 +1,17 @@+---+sidebar_position: 10+---++# @univerjs/uniscript (experimental)++[](https://badge.fury.io/js/@univerjs%2Funiscript)++@univerjs/uniscript 提供了以个基于 TypeScript 的 DSL,可以用来操作 Univer 的数据结构和业务逻辑。++++用户可以在 @univerjs/uniscript 提供的代码编辑器中编写业务逻辑,以达成更加灵活的业务需求。如图所示,用户可以编写一段 Uniscript 用于从选区中读取身份证号并验证这些身份证号的合法性,把不合法的身份证号的背景标记为红色。++:::info+Uniscript 仍在试验阶段,建议不要在生产环境中使用。你可以在[路线图](/docs/tutorial/roadmap)了解 Uniscript 的迭代计划。+:::diff --git a/apps/docs/docs/tutorial/plugins/sheet/sheets-formula.md b/apps/docs/docs/tutorial/plugins/sheet/sheets-formula.mdindex 6f260b4397..c93ccecfca 100644--- a/apps/docs/docs/tutorial/plugins/sheet/sheets-formula.md+++ b/apps/docs/docs/tutorial/plugins/sheet/sheets-formula.md@@ -2,4 +2,12 @@sidebar_position: 3----# @univerjs/sheets-formula\ No newline at end of file+# @univerjs/sheets-formula++[](https://badge.fury.io/js/@univerjs%2Fsheets-formula)++@univerjs/sheets-formula 提供了在电子表格中编辑公式的能力,例如自动补全、公式提示、公式的下拉填充以及复制粘贴等等。++:::note+公式计算是电子表格的核心功能之一,因此公式计算调度是在 @univerjs/sheets 中进行的。+:::diff --git a/apps/docs/docs/tutorial/plugins/sheet/sheets-numfmt.md b/apps/docs/docs/tutorial/plugins/sheet/sheets-numfmt.mdindex 79fb7a39a9..25d041100b 100644--- a/apps/docs/docs/tutorial/plugins/sheet/sheets-numfmt.md+++ b/apps/docs/docs/tutorial/plugins/sheet/sheets-numfmt.md@@ -4,8 +4,10 @@ sidebar_position: 5# @univerjs/sheets-numfmt-提供数字格式的编辑能力。+[](https://badge.fury.io/js/@univerjs%2Fsheets-numfmt)++提供数字格式的编辑能力,例如编辑面板、工具栏按钮等等。:::note-数字格式是电子表格的核心功能之一,因此数字格式的解析处理是在 base-sheets 中进行的。该插件仅提供数字格式的编辑能力,例如编辑面板、工具栏按钮等等。+数字格式是电子表格的核心功能之一,因此数字格式的解析处理是在 @univerjs/sheets 中进行的。:::diff --git a/apps/docs/docs/tutorial/plugins/sheet/sheets-ui.md b/apps/docs/docs/tutorial/plugins/sheet/sheets-ui.mdindex 589169d71b..2f1569a7ce 100644--- a/apps/docs/docs/tutorial/plugins/sheet/sheets-ui.md+++ b/apps/docs/docs/tutorial/plugins/sheet/sheets-ui.md@@ -4,6 +4,8 @@ sidebar_position: 2# @univerjs/sheets-ui+[](https://badge.fury.io/js/@univerjs%2Fsheets-ui)+@univerjs/sheets-ui 提供了 sheet 的 UI,包括:* sheet 基础功能的快捷键diff --git a/apps/docs/docs/tutorial/plugins/sheet/sheets.md b/apps/docs/docs/tutorial/plugins/sheet/sheets.mdindex 7e4f6ae8d4..5637cc9624 100644--- a/apps/docs/docs/tutorial/plugins/sheet/sheets.md+++ b/apps/docs/docs/tutorial/plugins/sheet/sheets.md@@ -4,14 +4,17 @@ sidebar_position: 1# @univerjs/sheets+[](https://badge.fury.io/js/@univerjs%2Fsheets)+@univerjs/sheet 承载 sheet 的主要(基础)业务逻辑,base-sheets 被设计为 UI 无关,因此也可以运行在 Node.js 环境中,借此可以实现协同编辑等功能。@univerjs/sheets 为 Univer Sheet 提供了以下能力:* 提供核心能力,例如数字格式、选区管理、权限等等* 更改电子表格数据的 commands / mutations--+* 公式核心能力+* 数字格式核心能力+* 电子表格的 canvas 绘制## `SheetInterceptorService`diff --git a/apps/docs/docs/tutorial/plugins/univer-doc/base-docs.md b/apps/docs/docs/tutorial/plugins/univer-doc/base-docs.mddeleted file mode 100644index 87a478c4d1..0000000000--- a/apps/docs/docs/tutorial/plugins/univer-doc/base-docs.md+++ /dev/null@@ -1,6 +0,0 @@-----sidebar_position: 1------# @univerjs/docs-diff --git a/apps/docs/docs/tutorial/plugins/univer-doc/docs-ui.md b/apps/docs/docs/tutorial/plugins/univer-doc/docs-ui.mdnew file mode 100644index 0000000000..e01d5ddfe9--- /dev/null+++ b/apps/docs/docs/tutorial/plugins/univer-doc/docs-ui.md@@ -0,0 +1,13 @@+---+sidebar_position: 2+---++# @univerjs/docs-ui (experimental)++[](https://badge.fury.io/js/@univerjs%2Fdocs-ui)++@univerjs/docs-ui 提供了 Doc 的 UI。++:::info+@univer/js 仍在试验阶段,建议不要在生产环境中使用。你可以在[路线图](/docs/tutorial/roadmap)了解迭代计划。+:::diff --git a/apps/docs/docs/tutorial/plugins/univer-doc/docs.md b/apps/docs/docs/tutorial/plugins/univer-doc/docs.mdnew file mode 100644index 0000000000..4b2206cc12--- /dev/null+++ b/apps/docs/docs/tutorial/plugins/univer-doc/docs.md@@ -0,0 +1,15 @@+---+sidebar_position: 1+---++# @univerjs/docs++[](https://badge.fury.io/js/@univerjs%2Fdocs)++@univerjs/docs 提供了富文本模型的基本业务,包括以下能力:++* 提供选区逻辑+* 更改富文本数据的 commands / mutations 等+* 文档的 canvas 绘制++@univerjs/docs 还为其他业务的编辑器提供支持,例如电子表格的单元格编辑器和公式编辑器等。diff --git a/apps/docs/docs/tutorial/plugins/univer-doc/ui-plugin-docs.md b/apps/docs/docs/tutorial/plugins/univer-doc/ui-plugin-docs.mddeleted file mode 100644index 9ba0a48fca..0000000000--- a/apps/docs/docs/tutorial/plugins/univer-doc/ui-plugin-docs.md+++ /dev/null@@ -1,5 +0,0 @@-----sidebar_position: 2------# @univerjs/docs-ui\ No newline at end of filediff --git a/apps/docs/docs/tutorial/releases.md b/apps/docs/docs/tutorial/releases.mdindex 61061a78ab..70656b2801 100644--- a/apps/docs/docs/tutorial/releases.md+++ b/apps/docs/docs/tutorial/releases.md@@ -6,8 +6,9 @@ sidebar_position: 2### 0.1.0-2023-12-yy+2023-12-20-首个公开测试版本+> 首个公开版本++* 发布 Univer Sheet 以及官方文档-* 发布 Univer Sheetdiff --git a/apps/docs/docs/tutorial/roadmap.md b/apps/docs/docs/tutorial/roadmap.mdindex 46cabce012..7372023927 100644--- a/apps/docs/docs/tutorial/roadmap.md+++ b/apps/docs/docs/tutorial/roadmap.md@@ -4,14 +4,30 @@ sidebar_position: 9# 路线图-这里是 Univer 后续的开发计划。+这里是 Univer 后续的开发计划。你可以通过 Feature Request 向我们提交需求,请参考[贡献指南](/docs/tutorial/contributing),我们会结合社区的反馈调整开发计划。-你可以通过 Feature Request 向我们提交你的需求,请参考[贡献指南](/docs/tutorial/contributing),我们会结合社区的反馈调整开发计划。+我们也会在社区同步商业授权版(企业版)的开发计划和进度,如果你对商业授权提供的能力感兴趣,可以[联系我们](/docs/tutorial/intro#商业授权)。## 2024 Q1-### Univer Sheet+### Univer Workspace-### Univer Doc+* 推出无界文档模式+* 支持可以和同事一起浏览的 Live Share 模式(企业版)-## 2024 Q2\ No newline at end of file+### Univer Sheet 电子表格++* Uniscript 支持录制操作并从操作生成 Uniscript+* 根据社区反馈增加高级功能,逐步上线筛选、条件格式、数据验证等功能+* Sheet 支持协同编辑(企业版)++### Univer Doc 文档++* 发布作为独立产品的 Doc 文档+* Doc 支持协同编辑(企业版)++## 2024 Q2 - Q3++### Univer Slide 幻灯片++* 发布作为独立产品的 Slide 幻灯片diff --git a/apps/docs/static/img/uniscript.jpeg b/apps/docs/static/img/uniscript.jpegnew file mode 100644index 0000000000..272f2309bbBinary files /dev/null and b/apps/docs/static/img/uniscript.jpeg differdiff --git a/packages/core/src/services/command/command.service.ts b/packages/core/src/services/command/command.service.tsindex 3566df53ec..3abd49a2f8 100644--- a/packages/core/src/services/command/command.service.ts+++ b/packages/core/src/services/command/command.service.ts@@ -26,7 +26,11 @@ export interface ICommand<P extends object = object, R = boolean> {handler(accessor: IAccessor, params?: P): Promise<R> | R;- /** When this command is unregistered, this function would be called. */+ /**+ * When this command is unregistered, this function would be called.+ *+ * @deprecated+ */onDispose?: () => void;}diff --git a/packages/uniscript/src/locale/zh-CN.ts b/packages/uniscript/src/locale/zh-CN.tsindex ff8b4c5632..5fe2f12573 100644--- a/packages/uniscript/src/locale/zh-CN.ts+++ b/packages/uniscript/src/locale/zh-CN.ts@@ -1 +1,11 @@-export default {};+export default {+ 'script-panel': {+ title: 'Uniscript',+ tooltip: {+ 'menu-button': '打开收起 Uniscript 面板',+ },+ panel: {+ execute: '执行 Uniscript',+ },+ },+};