Commit Graph

33 Commits (df195b12f2801b1de7119bd3552afa796ac44889)

Author SHA1 Message Date
Ryan Wang 998f4ccb45
refactor: improve axios instance parameters (#6550)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.0

#### What this PR does / why we need it:

优化默认的 axios 实例的参数:

1. baseURL 改为空字符串。
2. 默认优化数组参数。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-08-30 03:41:27 +00:00
Takagi 3be91fcb6f
refactor: enhance formkit select component to support additional features (#6473)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.19.x

#### What this PR does / why we need it:

此 PR 使用自定义的 Select 组件替换了原有的 Formkit Select 组件,原 Select 组件类型变为 `nativeSelect`。

新的 Select 组件具有如下功能:
- 增加多选、单选两种模式。
- 支持对内容进行搜索、过滤。
- 可使用接口远程加载,并可自定义数据获取。
- 支持扩展远程加载方式。
- 可创建新选项。
- 支持清空所有已选择项。
- 多选状态下可控制最大选择数量。
- 多选状态下可进行排序。

重构后的 Select 组件将自动兼容旧版组件。

使用方式如下:

```vue
<FormKit
  type="select"
  label="What country makes the best food?"
  name="countries"
  placeholder="Select a country"
  allow-create
  clearable
  sortable
  multiple
  searchable
  :max-count="3"
  :options="[
    { label: 'France', value: 'fr'},
    { label: 'Germany', value: 'de'},
    { label: 'Spain', value: 'es'},
    { label: 'Italy', value: 'ie' },
    { label: 'Greece', value: 'gr'},
  ]"
  help="Don’t worry, you can’t get this one wrong."
/>
```

#### How to test it?

1. 需要测试已使用的 Select 组件功能是否发生了变化。

测试在多选、单选状态下,Select 组件的功能是否可以正常使用。

测试在远程加载时,数据获取是否正常,是否可正常分页,加载状态是否显示。

#### Which issue(s) this PR fixes:

see https://github.com/halo-dev/halo/issues/4931#issuecomment-2060637101
see #6369 

#### Does this PR introduce a user-facing change?
```release-note
重构 FormKit 选择器组件以支持更多功能
```
2024-08-26 09:03:14 +00:00
Takagi 21db06a507
refactor: editor code block to be extensible by plugins (#6428)
#### What type of PR is this?

/kind improvement
/area editor
/area ui

#### What this PR does / why we need it:

此 PR 重构了默认编辑器中代码块的相关代码,使编辑器能够被插件扩展。这样做的优点是当用户使用例如 [highlightjs](https://github.com/halo-sigs/plugin-highlightjs) 这类的高亮插件时,可以保证在 Console 端选择的语言及主题可以在主题端完美适配。

具体做了以下几处重构:

1. 在默认编辑器的代码块中,不再提供高亮样式,代码块高亮将完全交由插件来适配。(但可以在默认的代码块中自定义输入语言,主题端自行处理)。
2. 为了防止出现重复的插件功能,将会根据插件优先级及加载顺序(后加载优先级高于先加载),对同类型且同名的插件进行过滤,只保留一个。
3. 重构代码块 `Select` 组件,使得选择语言或主题更加方便。
4. 为代码块提供主题的扩展设置项。

建议在此 PR 合并之后,由 Halo 默认提供一个高亮插件作为预设插件,这样可以用于解决原有功能升级之后丢失的问题。

<img width="1067" alt="image" src="https://github.com/user-attachments/assets/f9e2c5eb-a48a-4d2c-9fee-442e9d16ef19">

#### How to test it?

测试是否会改变已有代码块的语言等。
测试使用第三方插件之后,是否具有高亮。
设置高亮语言后,保存并刷新,查看高亮语言是否存在。主题同理。
查看主题端是否能够正常渲染。

#### Does this PR introduce a user-facing change?
```release-note
重构默认编辑器代码块使其能够被插件扩展。
```
2024-08-26 02:55:13 +00:00
Takagi d9bc8cfd03
chore: upgrade tiptap to 2.6.5 (#6503)
#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.19.x

#### What this PR does / why we need it:

升级 tiptap 相关依赖至 [2.6.5](https://github.com/ueberdosis/tiptap/releases/tag/v2.6.5)

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-08-23 07:36:58 +00:00
Ryan Wang a938712739
chore: bump vite-related dependencies (#6482)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

#### What this PR does / why we need it:

Bump vite-related dependencies

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-08-20 03:28:47 +00:00
Ryan Wang c2ac19f9d3
feat: add full-screen support to code input (#6453)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.19.x

#### What this PR does / why we need it:

Code 输入框支持全屏编辑。

<img width="530" alt="image" src="https://github.com/user-attachments/assets/c8465388-10fa-4b04-be52-c6a5bda6a2bc">

<img width="1906" alt="image" src="https://github.com/user-attachments/assets/aa6d14da-ef35-49b9-8d63-fde928d1f8e4">


#### Which issue(s) this PR fixes:

Fixes #6308 

#### Special notes for your reviewer:

需要在任意 Code 输入框中测试全屏功能是否正常。

#### Does this PR introduce a user-facing change?

```release-note
Code 输入框支持全屏编辑。
```
2024-08-13 03:44:56 +00:00
Ryan Wang 684c3b045b
chore: bump typescript version to 5.5.x (#6440)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

#### What this PR does / why we need it:

更新 typescript 依赖版本至 5.5.x,以尝试解决 VSCode Vue 插件频繁崩溃的问题。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-08-05 05:46:25 +00:00
Ryan Wang 429b832ba8
chore: bump tiptap version to 2.5.7 (#6403)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.18.x

#### What this PR does / why we need it:

升级 tiptap 的相关依赖至 2.5.7。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-07-29 10:11:53 +00:00
Ryan Wang 3c6df3b03c
chore: bump tiptap version to 2.5.1 (#6327)
#### What type of PR is this?

/area ui
/area editor
/kind improvement
/milestone 2.18.x

#### What this PR does / why we need it:

升级 Tiptap 相关依赖至 [2.5.0](https://tiptap.dev/blog/release-notes/say-hello-to-tiptap-2-5-our-most-performant-editor-yet)


#### Does this PR introduce a user-facing change?

```release-note
升级 Tiptap 相关依赖至 [2.5.0](https://tiptap.dev/blog/release-notes/say-hello-to-tiptap-2-5-our-most-performant-editor-yet)
```
2024-07-16 09:35:27 +00:00
Ryan Wang b673e4a24f
chore: regenerate API client (#6229)
#### What type of PR is this?

/area ui
/kind cleanup

#### What this PR does / why we need it:

重新生成 api client,移除无用的文件。并且此 PR 改进了生成的脚本,会在生成前删除旧的 api client 文件,保证不会遗留旧文件。


#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-07-01 07:01:17 +00:00
John Niang 59edade8bb
Merge pull request #6100 from guqing/feature/6023 2024-06-26 19:19:46 +08:00
Takagi 73798e86c6
feat: add gap cursor for top-level block nodes in default editor (#6103)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.17.x

#### What this PR does / why we need it:

目前想对块级节点进行换行是一件比较困难的事情,尤其是两个相邻的块级节点之间的想插入额外的一行时更加困难。间隙光标可以解决这一问题。

为默认编辑器的顶级块节点(pos.depth = 1)增加间隙光标的功能。当 NodeType 属性 `allowGapCursor` 为 true 时,将会在目标节点上启用间隙光标的功能。间隙光标将可能出现在目标节点的左上方与右下方。

<img width="909" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/fbbdc8fe-59c9-4ae3-a7c8-97a90607c785">

已知问题:
1. 对于 inlineContent 的节点,点击生成间隙光标时,光标会先出现在对应的内容上,会出现闪动的问题。
2. 在间隙光标上使用组合输入(例如中文输入)时,首个字母会被新增至新的一行。
3. CodeBlock 无法使用间隙光标(CodeBlock 自身问题,待适配)
~~4. 首行空文本无法被删除(与 Gap Cursor 问题无关,待适配  Paragraph)~~
~~5. 删除文本上方有可以添加间隙光标的块级节点时,无法触发间隙光标的 Backspace 事件(同 4,属于 Paragraph 适配问题)~~

目前已经启用此功能的节点:

- 表格
- 分栏卡片
- CodeBlock (无法生效)

#### How to test it?

测试间隙光标是否能够在表格与分栏卡片上出现。
测试间隙光标出现后,输入文本、使用快捷键等操作是否符合逻辑。
测试使用方向键调整间隙光标位置。

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器的块级节点增加间隙光标的功能。
```
2024-06-26 11:18:50 +00:00
Ryan Wang 2c9d94f034 Refine UI for device managment 2024-06-26 18:53:24 +08:00
Ryan Wang c74187c066 feat: add requests library as a global shared dependency 2024-06-25 12:31:44 +08:00
Ryan Wang af73a69e69
fix: resolve phantom dependency issue for iconify (#6120)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.17.x

#### What this PR does / why we need it:

修复关于 iconify 图标包的幽灵依赖问题,某些情况下,可能导致无法正常导入模块。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/6102

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-06-25 04:24:44 +00:00
Ryan Wang bf75a36df7
chore: revert @uppy/xhr-upload version to 3.6.0 (#6019)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.16.x

#### What this PR does / why we need it:

回退 `@uppy/xhr-upload` 的版本至 3.6.0,因为最新版本的 `@uppy/xhr-upload` 添加了重试机制和修改了错误异常的结构,并且当前重试参数并没有体现在文档和 API 中,所以暂时先回退至 3.6.0 以解决 https://github.com/halo-dev/halo/issues/6014

31cc47f3fb/packages/%40uppy/utils/src/fetcher.ts (L26)

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/6014

#### Special notes for your reviewer:

需要测试:

1. 附件上传功能
2. 上传已安装的插件或者主题,观察是否有提示升级。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-05-30 06:55:15 +00:00
Ryan Wang 22ce60b0e9
chore: bump uppy version (#5997)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

更新上传库 Uppy 的包依赖。

#### Does this PR introduce a user-facing change?

```release-note
更新上传库 Uppy 的包依赖。
```
2024-05-27 08:34:56 +00:00
Ryan Wang 99eae2f31b
refactor: simplify the code of reply creation modal (#5972)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

简化评论回复组件的代码。

#### Does this PR introduce a user-facing change?

```release-note
None 
```
2024-05-23 02:56:50 +00:00
Ryan Wang ce5757ae10
chore: bump up vue-related version (#5965)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

升级 Vue 生态的相关依赖,以及修复编译 packages 时的异常日志问题。

#### Does this PR introduce a user-facing change?

```release-note
升级 Vue 生态的相关依赖至最新版本。
```
2024-05-22 12:42:47 +00:00
Ryan Wang 9bfe3a66d5
refactor: improve code base of post category-related (#5958)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

优化文章分类管理相关的 UI 代码。

1. 使用 vue-draggable-plus 库代替 vuedraggable 库实现拖拽排序。vue-draggable-plus 是在 https://github.com/halo-dev/halo/pull/5914 中引入,替换的原因是 vuedraggable 库已经不再积极维护。
2. 改进分类编辑表单的逻辑,清理无用代码。

#### Special notes for your reviewer:

需要测试:

1. 测试文章分类拖拽排序功能是否表现正常。
2. 测试新增/编辑文章分类功能是否表现正常。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2024-05-22 02:52:46 +00:00
Ryan Wang 248d075481
chore: bump pnpm version to 9 (#5953)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

升级 pnpm 的版本至 9,以及 GitHub Actions 的 Node 版本改为了 20。

#### Does this PR introduce a user-facing change?

```release-note
升级 pnpm 的版本至 9
```
2024-05-21 03:24:45 +00:00
guqing c22b4e9ef4
refactor: optimize auth provider sorting with drag-and-drop support (#5914)
#### What type of PR is this?
/kind feature
/area core
/area ui
/milestone 2.16.x

#### What this PR does / why we need it:
优化认证方式的排序并支持拖动

#### Which issue(s) this PR fixes:
Fixes #5813

#### Does this PR introduce a user-facing change?
```release-note
优化认证方式的排序并支持拖动
```
2024-05-20 08:30:42 +00:00
Ryan Wang fc10ffaeb2
chore: bump tiptap version to 2.4.0 (#5951)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

升级 Tiptap 依赖至 2.4.0,https://github.com/ueberdosis/tiptap/releases/tag/v2.4.0

#### Does this PR introduce a user-facing change?

```release-note
升级 Tiptap 依赖至 [2.4.0](https://github.com/ueberdosis/tiptap/releases/tag/v2.4.0)
```
2024-05-20 04:54:41 +00:00
Ryan Wang b47015a36d
chore: bump vite to 5.x (#5920)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

#### What this PR does / why we need it:

升级 Vite 至 5.x。

#### Does this PR introduce a user-facing change?

```release-note
升级 UI 部分的 Vite 版本至 5.x。
```
2024-05-16 06:18:36 +00:00
Ryan Wang b05ed5814c
chore: bump tiptap version to 2.3.0 (#5655)
#### What type of PR is this?

/area ui
/kind improvement

#### What this PR does / why we need it:

升级 Tiptap 的版本为 2.3.0。

- https://github.com/ueberdosis/tiptap/releases/tag/v2.3.0
- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.6
- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.5
- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.4

#### Does this PR introduce a user-facing change?

```release-note
升级 Tiptap 的版本为 2.3.0。
```
2024-04-18 09:40:07 +00:00
Takagi 505f38a145
pref: optimize the rich text editor link paste logic (#5680)
#### What type of PR is this?

/kind improvement
/area editor
/area ui
/milestone 2.15.x

#### What this PR does / why we need it:

优化默认富文本编辑器中自动创建链接的逻辑。

- 移除了粘贴文本时,如果文本为链接则会自动转为链接的问题。
- 移除输入链接文本之后回车,会自动转化为链接的问题。
- 新增当选中的文本内容为链接时,点击链接按钮,将会自动转化选中的文本为链接。

#### How to test it?

在富文本编辑器中,测试如下场景:

1. 在浏览器地址栏复制一个链接,粘贴后不会再转为链接,而是一个普通文本。
2. 输入一段链接文本,按回车后是否不会再被转为链接。
3. 选中一段可以被解析为链接的地址,选中此地址,点击链接按钮,此地址是否会被默认转为链接。

#### Which issue(s) this PR fixes:

Fixes #5653 

#### Does this PR introduce a user-facing change?
```release-note
优化默认富文本编辑器中文本自动转为链接的相关逻辑
```
2024-04-13 00:50:08 +00:00
Ryan Wang 2af92396d4
feat: add image editor feature for attachment upload component (#5585)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.14.x

#### What this PR does / why we need it:

为上传附件的组件添加基本的图片编辑功能。

<img width="747" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/6816e045-ae4a-4d26-b3a4-23494fb39d5f">

#### Which issue(s) this PR fixes:

Fixes #5583 


#### Does this PR introduce a user-facing change?

```release-note
为上传附件的组件添加基本的图片编辑功能。
```
2024-03-25 04:16:08 +00:00
Ryan Wang 10d834d2ef
chore: bump overlayscrollbars version to 2.5.0 (#5471)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

#### What this PR does / why we need it:

升级 OverlayScrollbars 的依赖版本至 [2.5.0](https://github.com/KingSora/OverlayScrollbars/releases/tag/v2.5.0)

#### Does this PR introduce a user-facing change?

```release-note
升级 OverlayScrollbars 的依赖版本至 [2.5.0](https://github.com/KingSora/OverlayScrollbars/releases/tag/v2.5.0)。
```
2024-03-11 00:46:08 +00:00
Ryan Wang f5a9889b47
chore: bump formkit version to 1.5.x (#5395)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.x

#### What this PR does / why we need it:

升级 FormKit 的依赖版本至 1.5.x

Please see https://formkit.com/changelog#_150

#### Does this PR introduce a user-facing change?

```release-note
升级 FormKit 的依赖版本至 1.5.x
```
2024-02-29 09:57:39 +00:00
Ryan Wang 9e676712e4
chore: bump vue related packages version (#5384)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.x

#### What this PR does / why we need it:

升级 Vue 生态相关依赖至最新版本。

#### Does this PR introduce a user-facing change?

```release-note
升级 Vue 生态相关依赖至最新版本。
```
2024-02-22 03:12:07 +00:00
Ryan Wang 698bc30675
chore: bump axios version to 1.6.x (#5383)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.x

#### What this PR does / why we need it:

升级 Axios 依赖版本至 1.6.x

#### Does this PR introduce a user-facing change?

```release-note
升级 Axios 依赖版本至 1.6.x
```
2024-02-21 04:22:27 +00:00
Ryan Wang 14da9c919c
chore: bump tiptap version to 2.2.3 (#5382)
#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.13.x

#### What this PR does / why we need it:

升级 Tiptap 依赖至 https://github.com/ueberdosis/tiptap/releases/tag/v2.2.3

- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.0

#### Special notes for your reviewer:

测试方式:

1. `./gradlew :ui:build`
2. 测试编辑器的已有功能是否正常。
3. 安装若干已有编辑器插件,测试插件的功能是否正常。

#### Does this PR introduce a user-facing change?

```release-note
升级 Tiptap 依赖至 [2.2.3](https://github.com/ueberdosis/tiptap/releases/tag/v2.2.3)。
```
2024-02-21 03:40:28 +00:00
John Niang 15f7fe2d4f Move folder console to ui 2024-02-02 22:22:51 +08:00