Commit Graph

5157 Commits (21db06a507098310cf95ecef4dca4d1b71144370)

Author SHA1 Message Date
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
John Niang fe842e8d77
Upgrade Spring Boot to 3.3.3 (#6512)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.19.0

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

See https://github.com/spring-projects/spring-boot/releases/tag/v3.3.3 for more.

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

```release-note
升级 Spring Boot 至 3.3.3
```
2024-08-26 02:51:13 +00:00
John Niang 50adc29e42
Respond not found if no theme template found (#6511)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.19.0

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

This PR refactors "Template Not Found Exception" into "NotFoundException" to prevent too many exception stacktraces in logs file.

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

Fixes #6501 

#### Special notes for your reviewer:

1. Activate default theme
2. Request <http://localhost:8090/categories>
3. See the result

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

```release-note
优化当主题模板找不到的异常提示
```
2024-08-26 02:47:12 +00:00
Ryan Wang 3767a5a239
feat: add H2 database usage warning to setup page (#6502)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

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

在初始化页面添加使用 H2 数据库的警告。

<img width="773" alt="image" src="https://github.com/user-attachments/assets/3be83064-2075-4d3d-9511-9c67ffb68076">

#### Special notes for your reviewer:

需要测试在首次安装的时候使用 H2 数据库时,初始化页面是否有警告界面。

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

```release-note
在初始化页面添加使用 H2 数据库的警告。
```
2024-08-26 02:29:12 +00:00
Ryan Wang 2b84b41987
feat: support changing attachment display name (#6504)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.19.x

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

支持修改附件的显示名称。

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

<img width="669" alt="image" src="https://github.com/user-attachments/assets/03571048-dfed-4714-ae86-f527ea6f0b08">

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

```release-note
支持修改附件的显示名称。
```
2024-08-25 15:11:11 +00:00
Ryan Wang c92bbd754a
feat: add filter options for attachment selector component (#6505)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.19.0

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

为附件选择组件添加更多筛选项支持。


<img width="1277" alt="image" src="https://github.com/user-attachments/assets/6c61a8cf-ae5d-4496-9a87-9403c5d4fc28">

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

Fixes https://github.com/halo-dev/halo/issues/4605
Fixes https://github.com/halo-dev/halo/issues/6352

#### Special notes for your reviewer:

需要测试附件选择组件的各项功能是否符合预期。

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

```release-note
为附件选择组件添加更多筛选项支持。
```
2024-08-25 15:05:11 +00:00
Ryan Wang 487b0d343c
fix: correct API endpoints related to backup issues (#6506)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.19.x

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

修复备份相关的 API 接口地址错误的问题,此问题由 https://github.com/halo-dev/halo/pull/6486 引入,后端修改地址之后,前端没有对应修改。

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

```release-note
None
```
2024-08-23 09:08:58 +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 6428b2f0e2
refactor: improve conditions for determining if a plugin needs to be reloaded (#6498)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

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

优化插件是否需要重载页面的判断条件,否则从低版本升级到 2.19 时,所有插件都会提示需要重载。

因为在 https://github.com/halo-dev/halo/pull/6470 中修改了 bundle.js 的结构,但升级到 2.19 之后可能并不会及时抛弃 bundle.js 的缓存,因为插件本身的 version 并没有改变,bundle.js 的 hash 参数也不会改变。

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

```release-note
None
```
2024-08-23 07:16:58 +00:00
Takagi 9b99698f1c
pref: use whitelist for allowed href values (#6499)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.19.x

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

使用白名单校验替换原有的黑名单校验,解决 a 标签潜在的安全问题。

移除自定义的解决方案,使用 Tiptap 所提供的白名单方案。

#### How to test it?

测试 a 标签的 href 链接是否会受到 xss 的影响。

同时测试 #5479 的情况是否还会发生。即默认富文本编辑器中当链接为纯数字时是否还会报错。

#### Does this PR introduce a user-facing change?
```release-note
使用白名单校验 a 标签的 href 用于解决潜在的安全问题。
```
2024-08-23 04:46:57 +00:00
guqing 87368df18a
fix: correct device information update during account switch (#6483)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
修复切换账号登录时设备信息更新不正确的问题

原因:
1. 使用 admin 账号登录,此时会记录 device_id 的 cookie
2. 退出登录,device_id 会保留在 cookie 中并随着新账号带到服务端
3. 服务端根据 device_id 查询当前设备是否有对应的记录,但是没有校验用户名是否与当前登陆的一致然后就去更新登录时间
4. 正确的处理是校验 device_id 是否有与之对应的记录并且用户名相同,如果不相同则认为是新设备重新生成 device_id

**how to test it?**
1. 先清理 cookie 然后使用一个账号登录
2. 退出登陆并切换新账号登录
3. 检查新登录的账号的设备信息是否正确

#### Does this PR introduce a user-facing change?
```release-note
修复切换账号登录时设备信息更新不正确的问题
```
2024-08-22 09:02:56 +00:00
guqing f9615d072d
chore: remove transactional annotation (#6492)
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
移除事务注解避免对索引创建产生影响,原因参考改动中的方法注释

**其中一点特别注意:**
在执行 `client.create(name, data)` 方法后,会尝试进行 `indexer.indexRecord` 操作。但 indexRecord 可能会因唯一索引中存在重复键而导致 indexRecord 失败,索引创建也会随之失败。为确保索引与数据的一致性,此时应回滚由 `client.create(name, data)` 对数据产生的影响,因此除非找到更佳的一致性问题解决方案,否则暂时不能移除此处的手动事务操作。

```java
 return client.create(name, version, data)
                .map(updated -> converter.convertFrom(type, updated))
                .doOnNext(extension -> indexer.indexRecord(convertToRealExtension(extension)))
                .as(transactionalOperator::transactional);
```
将变更传递给 extension watcher 是在 `doCreate` 或 `doUpdate` 成功之后才会被处理,因此这里的事务回滚不会对 watcher 造成影响

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-08-22 08:26:55 +00:00
guqing d8ec34b724
fix: previous and next post links included hidden posts (#6491)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
修复文章的上一篇下一篇链接包含了隐藏分类下的文章

#### Does this PR introduce a user-facing change?
```release-note
修复文章的上一篇下一篇链接包含了隐藏分类下的文章
```
2024-08-22 08:24:55 +00:00
Ryan Wang ad81f6dcb7
Merge pull request #6486 from JohnNiang/feat/restore-from-folder
Add support for restoring from backup root
2024-08-21 12:07:38 +08:00
Ryan Wang 6cd8dc8555 Adapt console for restoring from backup root
Signed-off-by: JohnNiang <johnniang@foxmail.com>
2024-08-21 11:46:30 +08:00
JohnNiang 3460d4c94b Add support for restoring from backup root
Signed-off-by: JohnNiang <johnniang@foxmail.com>
2024-08-21 11:45:49 +08:00
John Niang 3a782be607
Fix the problem that roles could not be granted sometimes (#6471)
#### What type of PR is this?

/kind improvement
/area core

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

This PR refactors searching roles by using index mechanism to speed up every request and fix the problem of not being able to grant roles to users sometimes.

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

Fixes #5807 
Fixes https://github.com/halo-dev/halo/issues/4954
Fixes https://github.com/halo-dev/halo/issues/5057

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

```release-note
修复有时无法给用户赋权限的问题
```
2024-08-21 03:22:50 +00:00
guqing 7ba5fc671f
chore: cleanup unused index for notification (#6481)
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
清理没有用到的索引

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-08-20 06:52:47 +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
guqing 30d482f0f8
refactor: optimize user creation (#6480)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
优化用户创建

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-08-19 07:38:42 +00:00
Ryan Wang 7774eb1a3a
refactor: use patch api to refactor menu drag-and-drop sorting feature (#6462)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

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

使用 patch 接口重构菜单项拖动排序等功能。

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

None

#### Special notes for your reviewer:

需要测试菜单项的拖动排序功能是否符合预期。

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

```release-note
使用 patch 接口重构菜单项拖动排序功能。
```
2024-08-16 14:42:33 +00:00
John Niang 10e3f57ca0
Merge pull request #6470 from guqing/refactor/4464 2024-08-16 09:55:47 +08:00
Ryan Wang d19c27ba52 feat: add prompt for users to reload page after plugin update 2024-08-15 17:30:01 +08:00
guqing 88b5e190a6 refactor: rename and restructure enabled plugins in bundle.js 2024-08-15 17:29:31 +08:00
Ryan Wang d011beb89b
refactor: improve part of the post operation logic using the patch api (#6464)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

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

使用 patch 接口重构文章的恢复、可见性修改等逻辑。

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

None

#### Special notes for your reviewer:

测试文章删除、恢复、可见性修改功能是否符合预期。

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

```release-note
使用 patch 接口重构文章的恢复、可见性修改等逻辑。
```
2024-08-14 06:59:57 +00:00
Ryan Wang d78547f963
refactor: use patch api to refactor category drag-and-drop sorting feature (#6461)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

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

使用 patch 接口重构分类拖动排序功能。

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

None

#### Special notes for your reviewer:

需要测试文章分类的拖动排序功能是否符合预期。

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

```release-note
使用 patch 接口重构分类拖动排序功能。
```
2024-08-14 06:57:56 +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 ddd59680e9
refactor: improve part of the page operation logic using the patch api (#6463)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.19.x

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

使用 patch 接口重构页面的删除、可见性修改等逻辑。

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

None

#### Special notes for your reviewer:

测试页面删除、可见性修改功能是否符合预期。

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

```release-note
使用 patch 接口重构页面的删除、可见性修改等逻辑。
```
2024-08-13 03:42:55 +00:00
Ryan Wang 62bc168184
chore: update github issue templates (#6457)
#### What type of PR is this?

None

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

Updated the issue template and added a reminder to disable all plugins to troubleshoot the problem.

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

```release-note
None
```
2024-08-12 08:22:53 +00:00
Takagi 332f4f8728
pref: pin save button to the bottom of the page in theme preview (#6449)
#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.19.x

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

将主题预览中的保存功能固定在底部,方便当主题设置项过多时进行保存。

为了不影响保存功能,因此此 PR 移除了本来在左下角悬浮的选择主题按钮。选择主题可以直接在右上角进行点击。

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

Fixes #6448 

#### Does this PR introduce a user-facing change?
```release-note
在主题预览界面中将保存按钮固定在底部
```
2024-08-08 08:24:37 +00:00
Takagi 94f28cc76e
fix: backspace on empty line doesn’t return to previous list item (#6445)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.19.x

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

修复默认编辑器中,当在列表的下一空白行使用退格键时,会导致无法回退至列表项中的问题。

#### How to test it?

1. 在编辑器中增加一个列表项。
2. 按两次回车跳出列表编辑器。
3. 按退格键。

查看退格键是否按一次就可以回到列表项,并且再次按时执行列表项的删除。

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

Fixes #6263

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中在空白行中按退格键无法回退到列表项中的问题
```
2024-08-08 08:22:38 +00:00
Takagi 6cfc92b29e
fix: saving settings in theme preview returns to homepage (#6447)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.19.x

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

此 PR 将主题预览及文章预览的 `iframe` 由 srcdoc 改为使用 src 加载。用于解决在主题预览时,如果点击保存设置,会导致主题端页面跳转至首页。

#### How to test it?

1. 打开主题预览界面。
2. 打开非首页的页面。
3. 点击保存配置。查看此时刷新页面后是否不再回到首页。

同时需要测试 #4047 中的场景是否还会再发生。

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

Fixes #6371 

#### Does this PR introduce a user-facing change?
```release-note
解决预览主题时保存设置,页面会跳转至首页的问题。
```
2024-08-08 08:20:38 +00:00
John Niang 40386557a7
Support filtering search result by types, ownerNames, categoryNames and tagNames (#6442)
#### What type of PR is this?

/kind improvement
/area core

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

This PR allows users to filter search result by types, owner names, category names and tag names.

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

```release-note
完善搜索引擎过滤功能
```
2024-08-08 04:58:37 +00:00
Takagi 457508f1cd
feat: support for previewing avif images in attachments (#6446)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.19.x

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

支持在附件库中预览 `image/avif` 的图片。

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

Fixes #6320 

#### Does this PR introduce a user-facing change?
```release-note
支持在附件库中预览 avif 类型的图片
```
2024-08-07 08:50:35 +00:00
困困鱼 4a4f8b655d
feat: make comment and reply list item operations extendable (#6438)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.18.x

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

评论和回复管理列表项的操作按钮支持被插件扩展。
![image](https://github.com/user-attachments/assets/20174eda-ec46-4ab2-b1d9-c27e4aaa6cba)
![image](https://github.com/user-attachments/assets/ac44c221-71f5-4077-8116-a92245c22697)


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

Fixes #6392 

#### Special notes for your reviewer:

需要评论和回复的关于列表的已有功能是否正常。

如果需要测试扩展点是否有效,可以使用此插件测试:[plugin-starter-1.0.0-SNAPSHOT.jar.zip](https://github.com/user-attachments/files/16482348/plugin-starter-1.0.0-SNAPSHOT.jar.zip)

```
export default definePlugin({
  components: {},
  routes: [],
  extensionPoints: {
    "comment:list-item:operation:create": (comment: Ref<ListedComment>) => {
      return [
        {
          priority: 21,
          component: markRaw(VDropdownItem),
          label: "测试评论菜单",
          visible: true,
          permissions: [],
          action: () => {
            console.log(comment)
          },
        },
      ];
    },
    "reply:list-item:operation:create": (reply: Ref<ListedReply>) => {
      return [
        {
          priority: 11,
          component: markRaw(VDropdownItem),
          label: "测试回复菜单",
          visible: true,
          permissions: [],
          action: () => {
            console.log(reply)
          },
        },
      ];
    },
  },
});
```

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

```release-note
Console 评论和回复管理列表项的操作按钮支持被插件扩展。
```
2024-08-05 06:56:25 +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 60bceb2acd
chore: update afdian url (#6441)
#### What type of PR is this?

/kind cleanup

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

更新爱发电的地址。

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

```release-note
None
```
2024-08-05 03:24:24 +00:00
John Niang 5147d3efff
Prepare for developing 2.19.0 (#6429)
#### What type of PR is this?

/kind cleanup
/area core

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

This is a regular updates after a new release.

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

```release-note
None
```
2024-08-02 04:56:14 +00:00
guqing 3822cbee15
chore: remove incorrect index declaration (#6427)
#### What type of PR is this?
/milestone 2.19.x
/area core
/kind cleanup

#### What this PR does / why we need it:
删除对文章错误的索引声明

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-08-01 08:14:10 +00:00
guqing 58fe872844
feat: add file size and type restriction for local file uploads (#6390)
#### What type of PR is this?
/kind feature
/area core

#### What this PR does / why we need it:
本次 PR 为本地附件存储策略增加了对上传单文件大小和文件类型限制的功能,具体包括:

1. 单文件大小限制:
实现了对单个文件上传大小的验证功能,确保上传文件不超过设定的最大值。
2. 文件类型限制:
添加了文件类型限制功能,使用 Apache Tika 读取上传文件的 magic numbers 得到文件 mime type 并根据用户配置来决定是否允许上传

参考链接:
- [List of file signatures](https://en.wikipedia.org/wiki/List_of_file_signatures)
- [File Magic Numbers: The Easy way to Identify File Extensions](https://library.mosse-institute.com/articles/2022/04/file-magic-numbers-the-easy-way-to-identify-file-extensions/file-magic-numbers-the-easy-way-to-identify-file-extensions.html)

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

#### Does this PR introduce a user-facing change?
```release-note
为本地附件存储策略增加了对上传单文件大小和文件类型限制的功能
```
2024-08-01 01:58:12 +00:00
guqing 39ff455178
feat: add extension point for excerpt generation (#6348)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.18.x

#### What this PR does / why we need it:
新增文章摘要生成扩展点用于扩展自动生成摘要的方式

#### Does this PR introduce a user-facing change?
```release-note
新增文章摘要生成扩展点用于扩展自动生成摘要的方式
```
2024-07-31 09:22:04 +00:00
guqing 0110438854
fix: NPE when saving system configuration (#6417)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x

#### What this PR does / why we need it:
修复保存系统配置时出现的 NPE 问题

此问题由于 PR #6346 导致
#### Which issue(s) this PR fixes:
Fixes #6416

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-07-31 04:10:02 +00:00
John Niang 8e8599b3c7
Refine debug logs of querying extensions (#6414)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.18.x

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

This PR refines debug logs of listing all extensions.

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

```release-note
None
```
2024-07-30 09:11:57 +00:00
Ryan Wang 0407970664
fix: remove unused code in system-setting.yaml (#6411)
#### What type of PR is this?

/kind cleanup
/area core

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

移除在 https://github.com/halo-dev/halo/pull/6403 中误推送的代码。

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


```release-note
None
```
2024-07-29 14:27:54 +00:00
Takagi 52feea8553
fix: solve the problem that highlighting will prevent the keys (#6387)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.18.x

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

此 PR 解决了使用高亮插件之后按 `up` 或 `down` 按键被阻止的问题。

此问题的来源为 https://github.com/halo-sigs/richtext-editor/pull/56 ,在此前的 PR 中为了解决设置字体大小后再次设置高亮,会导致高亮无法完全笼罩字体的问题。

但经过仔细排查,发现上述问题之前的解决方式有误,正确的原因应该是设置字体大小的 `span` 标签与设置高亮的 `mark` 标签顺序相反导致。如下所示:

<img width="1019" alt="image" src="https://github.com/user-attachments/assets/90c0926e-caab-40b6-91ae-97c075ef7225">

正确的情况应该是在 `span` 中包裹 `mark`。此 PR 提升了 `TextStyle` 的优先级,结果如下所示:

<img width="1022" alt="image" src="https://github.com/user-attachments/assets/e5e61d54-defd-493b-818c-c09faf55a7c1">

#### How to test it?

测试对文本使用高亮功能之后按 `up` 或 `down` 按键是否生效。
测试对在文本设置大小之后,使用高亮、删除线等样式是否正确。

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

Fixes #6381 

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中对文本使用高亮会导致按键被阻止的问题
```
2024-07-29 12:57:54 +00:00
Takagi fae5bf7ce9
fix: list items require multiple backspace presses to delete (#6408)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.18.x

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

目前当编辑器中列表内容为空时,需要按退格键多次才能删除掉此列表内容。

本 PR 在执行单行删除逻辑之前,会检查列表是否处于活动状态,如果是则不再执行单行删除的逻辑。列表会执行 ListKeyMap 相关快捷键。

#### How to test it?

1. 在默认富文本键入一个列表。
2. 使用退格键删除这个列表。
3. 查看是否可以一次就删除。

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

Fixes #6389 

#### Does this PR introduce a user-facing change?
```release-note
修复默认编辑器中列表项需要按多次退格键才可以删除的问题
```
2024-07-29 12:41:54 +00:00
guqing 5707f295f1
refactor: trigger plugin config updated event at startup (#6346)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.18.x

#### What this PR does / why we need it:
插件启动时触发一次插件配置更新事件以便进行资源初始化操作

之前配置插件完后重启/升级插件无法监听到事件则不方便初始化资源需要通过再次监听插件启动事件来实现,现在改为插件启动时可以监听到

#### Does this PR introduce a user-facing change?
```release-note
插件启动时触发一次插件配置更新事件以便进行资源初始化操作
```
2024-07-29 12:39:53 +00:00
Ryan Wang 2b32715184
refactor: remove padding style from editor column block (#6407)
#### What type of PR is this?

/area editor
/kind improvement
/milestone 2.18.x

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

移除编辑器 Column 的默认 padding 样式。

See https://github.com/halo-dev/halo/issues/6377#issue-2428912807

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

Fixes #6377 

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

```release-note
移除编辑器分栏卡片的默认 padding 样式。
```
2024-07-29 10:15:53 +00:00
Ryan Wang f7ee732c62
feat: add retry mechanism for publishing posts in user center (#6406)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.18.x

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

为个人中心发布文章的操作添加重试机制,方式后端因为乐观锁出现异常错误。

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

Fixes #6349 


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

```release-note
为个人中心发布文章的操作添加重试机制,方式后端因为乐观锁出现异常错误。
```
2024-07-29 10:13:54 +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