chore: bump docusaurus version to 3.x (#395)

升级 Docusaurus 版本至 3.x

参照 https://docusaurus.io/zh-CN/docs/migration/v3 升级指南。

Fixes #394 

/kind improvement

```release-note
None
```
This commit is contained in:
Ryan Wang
2024-08-09 22:12:40 +08:00
committed by GitHub
parent 4a53db88f4
commit 250c0180d7
537 changed files with 9282 additions and 7911 deletions

View File

@@ -52,4 +52,4 @@ function handleSubmit () {
|---------|------------------------------------|---------|-----------------------------------------|
| `group` | string | 无,必填 | 定义组件所属的分组。 |
| `kind` | string | 无,必填 | 定义组件的种类。 |
| `value` | { [key: string]: string; } \| null | null | 可选,包含键值对的对象或空值,用于存储数据。 |
| `value` | \{ [key: string]: string; \} \| null \| null | 可选,包含键值对的对象或空值,用于存储数据。 |

View File

@@ -37,7 +37,7 @@ const items = [
| 属性名 | 类型 | 默认值 | 描述 |
|--------------|-----------------------------------------------------------|-----------|--------------------------------------------------|
| `items` | { label: string; value?: string \| boolean \| number; }[] | 无,必填 | 包含 `label` 和可选 `value` 的对象数组。 |
| `items` | \{ label: string; value?: string \| boolean \| number; \}[] | 无,必填 | 包含 `label` 和可选 `value` 的对象数组。 |
| `label` | string | 无,必填 | 组件的标签文本。 |
| `modelValue` | string \| boolean \| number | undefined | 可选,用于绑定到组件的值,可以是字符串、布尔值或数字。 |

View File

@@ -27,7 +27,7 @@ import { VButton } from "@halo-dev/components";
</template>
```
所有可用的基础组件以及文档可查阅:<https://halo-ui-components.pages.dev>
所有可用的基础组件以及文档可查阅:[https://halo-ui-components.pages.dev](https://halo-ui-components.pages.dev)
## 业务组件和指令

View File

@@ -27,7 +27,7 @@ const groupName = ref('my-test-group')
| 属性名 | 类型 | 默认值 | 描述 |
|---------------------|----------------------------------------------------------------|-----------|------------------------------|
| `restrictions` | Restrictions | undefined | 可选,指定任何限制。 |
| `meta` | Record<string, unknown> | undefined | 可选,要发送的额外元数据。 |
| `meta` | Record\<string, unknown\> | undefined | 可选,要发送的额外元数据。 |
| `autoProceed` | boolean | false | 可选,在某些操作后自动继续。 |
| `allowedMetaFields` | string[] | undefined | 可选,指定允许的元数据字段。 |
| `endpoint` | string | 无,必填 | 数据发送到的端点URL。 |

View File

@@ -85,7 +85,7 @@ export default definePlugin({
## 实现案例
- <https://github.com/halo-dev/plugin-s3>
- [https://github.com/halo-dev/plugin-s3](https://github.com/halo-dev/plugin-s3)
## 类型定义

View File

@@ -143,4 +143,4 @@ const handleSelect = async (url: string) => {
## 实现案例
- <https://github.com/halo-sigs/plugin-unsplash>
- [https://github.com/halo-sigs/plugin-unsplash](https://github.com/halo-sigs/plugin-unsplash)

View File

@@ -111,4 +111,4 @@ const stripHtmlTags = (str: string) => {
## 实现案例
- <https://github.com/halo-sigs/plugin-moments>
- [https://github.com/halo-sigs/plugin-moments](https://github.com/halo-sigs/plugin-moments)

View File

@@ -18,7 +18,7 @@ export default definePlugin({
```
:::info 提示
AnyExtension 类型来自 [Tiptap](https://github.com/ueberdosis/tiptap),这意味着 Halo 默认编辑器的扩展点返回类型与 Tiptap 的扩展完全一致Tiptap 的扩展文档可参考:<https://tiptap.dev/docs/editor/api/extensions>。此外Halo 也为默认编辑器的扩展提供了一些独有的参数,用于实现工具栏、指令等扩展。
AnyExtension 类型来自 [Tiptap](https://github.com/ueberdosis/tiptap),这意味着 Halo 默认编辑器的扩展点返回类型与 Tiptap 的扩展完全一致Tiptap 的扩展文档可参考:[https://tiptap.dev/docs/editor/api/extensions](https://tiptap.dev/docs/editor/api/extensions)。此外Halo 也为默认编辑器的扩展提供了一些独有的参数,用于实现工具栏、指令等扩展。
:::
### Halo 独有扩展
@@ -60,7 +60,7 @@ export interface ExtensionOptions {
![顶部工具栏扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-toolbar.png)
<https://github.com/halo-sigs/richtext-editor/pull/16> 中,我们实现了对顶部工具栏的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolbarItems` 函数即可,如:
[https://github.com/halo-sigs/richtext-editor/pull/16](https://github.com/halo-sigs/richtext-editor/pull/16) 中,我们实现了对顶部工具栏的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolbarItems` 函数即可,如:
```ts
{
@@ -130,7 +130,7 @@ addOptions() {
![工具箱扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-toolbox.png)
<https://github.com/halo-sigs/richtext-editor/pull/27> 中,我们实现了对编辑器工具箱区域的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolboxItems` 函数即可,如:
[https://github.com/halo-sigs/richtext-editor/pull/27](https://github.com/halo-sigs/richtext-editor/pull/27) 中,我们实现了对编辑器工具箱区域的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolboxItems` 函数即可,如:
```ts
{
@@ -201,7 +201,7 @@ Slash Command (斜杠命令)的扩展,可用于在当前行快捷执行功
![Slash Command 扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-slash-command.png)
<https://github.com/halo-sigs/richtext-editor/pull/16> 中,我们实现了对 Slash Command 指令的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getCommandMenuItems` 函数即可,如:
[https://github.com/halo-sigs/richtext-editor/pull/16](https://github.com/halo-sigs/richtext-editor/pull/16) 中,我们实现了对 Slash Command 指令的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getCommandMenuItems` 函数即可,如:
```ts
{
@@ -263,7 +263,7 @@ addOptions() {
![悬浮菜单扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-bubble-menu.png)
<https://github.com/halo-sigs/richtext-editor/pull/38> 中,我们重构了对编辑器悬浮区域的扩展,如果需要对某个块进行支持,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getBubbleMenu` 函数即可,如:
[https://github.com/halo-sigs/richtext-editor/pull/38](https://github.com/halo-sigs/richtext-editor/pull/38) 中,我们重构了对编辑器悬浮区域的扩展,如果需要对某个块进行支持,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getBubbleMenu` 函数即可,如:
```ts
{
@@ -296,7 +296,7 @@ interface BubbleMenuProps {
from?: number;
to?: number;
}) => boolean;
tippyOptions?: Record<string, unknown>; // 可自由定制悬浮菜单所用的 tippy 组件的选项
tippyOptions?: Record\<string, unknown\>; // 可自由定制悬浮菜单所用的 tippy 组件的选项
getRenderContainer?: (node: HTMLElement) => HTMLElement; // 悬浮菜单所基准的 DOM
defaultAnimation?: boolean; // 是否启用默认动画。默认为 true
}
@@ -373,7 +373,7 @@ addOptions() {
![拖拽功能扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-drag.png)
<https://github.com/halo-sigs/richtext-editor/pull/48> 中,我们实现了对所有元素的拖拽功能,如果需要让当前扩展支持拖拽,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getDraggable` 函数,并让其返回 true 即可。如:
[https://github.com/halo-sigs/richtext-editor/pull/48](https://github.com/halo-sigs/richtext-editor/pull/48) 中,我们实现了对所有元素的拖拽功能,如果需要让当前扩展支持拖拽,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getDraggable` 函数,并让其返回 true 即可。如:
```ts
{
@@ -474,6 +474,6 @@ addOptions() {
## 实现案例
- <https://github.com/halo-sigs/plugin-hybrid-edit-block>
- <https://github.com/halo-sigs/plugin-katex>
- <https://github.com/halo-sigs/plugin-text-diagram>
- [https://github.com/halo-sigs/plugin-hybrid-edit-block](https://github.com/halo-sigs/plugin-hybrid-edit-block)
- [https://github.com/halo-sigs/plugin-katex](https://github.com/halo-sigs/plugin-katex)
- [https://github.com/halo-sigs/plugin-text-diagram](https://github.com/halo-sigs/plugin-text-diagram)

View File

@@ -179,10 +179,10 @@ code {
</style>
```
> 来源:<https://vuejs.org/examples/#markdown>
> 来源:[https://vuejs.org/examples/#markdown](https://vuejs.org/examples/#markdown)
## 实现案例
- <https://github.com/halo-sigs/plugin-stackedit>
- <https://github.com/halo-sigs/plugin-bytemd>
- <https://github.com/justice2001/halo-plugin-vditor>
- [https://github.com/halo-sigs/plugin-stackedit](https://github.com/halo-sigs/plugin-stackedit)
- [https://github.com/halo-sigs/plugin-bytemd](https://github.com/halo-sigs/plugin-bytemd)
- [https://github.com/justice2001/halo-plugin-vditor](https://github.com/justice2001/halo-plugin-vditor)

View File

@@ -2,7 +2,7 @@
export interface OperationItem<T> {
priority: number; // 排序优先级
component: Raw<Component>; // 菜单项组件
props?: Record<string, unknown>; // 菜单项组件属性
props?: Record\<string, unknown\>; // 菜单项组件属性
action?: (item?: T) => void; // 菜单项点击事件
label?: string; // 菜单项标题
hidden?: boolean; // 菜单项是否隐藏

View File

@@ -33,7 +33,7 @@ export interface PluginInstallationTab {
id: string; // 选项卡 ID
label: string; // 选项卡标题
component: Raw<Component>; // 选项卡面板组件
props?: Record<string, unknown>; // 选项卡面板组件属性
props?: Record\<string, unknown\>; // 选项卡面板组件属性
permissions?: string[]; // 选项卡 UI 权限
priority: number; // 选项卡排序优先级
}
@@ -41,4 +41,4 @@ export interface PluginInstallationTab {
## 实现案例
- <https://github.com/halo-dev/plugin-app-store>
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)

View File

@@ -33,7 +33,7 @@ export interface EntityFieldItem {
priority: number;
position: "start" | "end";
component: Raw<Component>;
props?: Record<string, unknown>;
props?: Record\<string, unknown\>;
permissions?: string[];
hidden?: boolean;
}
@@ -71,7 +71,7 @@ export default definePlugin({
## 实现案例
- <https://github.com/halo-dev/plugin-app-store>
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
## 类型定义

View File

@@ -42,7 +42,7 @@ import OperationItem from "./interface/OperationItem.md";
## 实现案例
- <https://github.com/halo-dev/plugin-app-store>
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
## 类型定义

View File

@@ -37,7 +37,7 @@ export interface PluginTab {
其中,`component` 组件可以注入inject以下属性
- `plugin`:当前插件对象,类型为 Ref<[Plugin](#plugin)>。
- `plugin`:当前插件对象,类型为 Ref\<[Plugin](#plugin)\>。
## 示例
@@ -77,7 +77,7 @@ const plugin = inject<Ref<Plugin | undefined>>("plugin");
## 实现案例
- <https://github.com/halo-dev/plugin-app-store>
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
## 类型定义

View File

@@ -33,7 +33,7 @@ export interface EntityFieldItem {
priority: number;
position: "start" | "end";
component: Raw<Component>;
props?: Record<string, unknown>;
props?: Record\<string, unknown\>;
permissions?: string[];
hidden?: boolean;
}

View File

@@ -78,7 +78,7 @@ export default definePlugin({
## 实现案例
- <https://github.com/halo-dev/plugin-app-store>
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
## 类型定义

View File

@@ -33,7 +33,7 @@ export interface ThemeListTab {
id: string; // 选项卡 ID
label: string; // 选项卡标题
component: Raw<Component>; // 选项卡面板组件
props?: Record<string, unknown>; // 选项卡面板组件属性
props?: Record\<string, unknown\>; // 选项卡面板组件属性
permissions?: string[]; // 选项卡 UI 权限
priority: number; // 选项卡排序优先级
}
@@ -41,4 +41,4 @@ export interface ThemeListTab {
## 实现案例
- <https://github.com/halo-dev/plugin-app-store>
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)