#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
重新组织和固定 UI 部分代码的 imports 导入,防止后续因为 imports 的顺序造成不必要的 diff。
基于:https://github.com/halo-dev/halo/pull/6151
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area editor
/milestone 2.17.x
#### What this PR does / why we need it:
在用户设置 iframe 相关的 src 时,检测设置的链接是否符合白名单。如果不符合则不允许设置。
see https://github.com/ueberdosis/tiptap/pull/5160
#### How to test it?
测试在 iframe 中的 src 输入 `javascript: alert("1")` 时是否会触发 javascript
#### Does this PR introduce a user-facing change?
```release-note
处理默认编辑器中 iframe 标签的 src 属性可能存在的风险
```
#### What type of PR is this?
/kind feature
/area ui
/milestone 2.17.x
#### What this PR does / why we need it:
为 formkit 增加动态列表的 input。
使用方式:
```
- $formkit: list
name: users
label: Users
addLabel: Add User
min: 1
max: 3
itemType: string
children:
- $formkit: text
index: "$index"
validation: required
```
> [!NOTE]
> `list` 组件有且只有一个子节点,并且必须为子节点传递 `index` 属性。若想提供多个字段,则建议使用 `group` 组件包裹。
#### How to test it?
测试动态数组是否正常可用。保存的结果是否为 `{users: ["", ""]}`
#### Which issue(s) this PR fixes:
Fixes#6098
#### Does this PR introduce a user-facing change?
```release-note
为 Formkit 增加动态列表的 input 组件 list
```
#### What type of PR is this?
/kind feature
/area editor
/milestone 2.17.x
#### What this PR does / why we need it:
为默认编辑器添加 `RangeSelection` 选择器。
<img width="989" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/c976cf99-0d6e-4346-9b05-8b9b0dc95183">
它的功能基本与 TextSelection 相反,例如:
1. TextSelection 支持光标展示,RangeSelection 不允许空内容,即它并不支持光标。
2. TextSelection 会抛弃被选择的 Node 节点部分偏移量,而 RangeSelection 会扩展偏移量至 Node 节点结束。
3. TextSelection 支持 Text 而 RangeSelection 支持 Node 节点。
`RangeSelection` 可以用于范围选中块节点并进行操作,可用于全选内容并进行删除操作。
#### How to test it?
测试使用点击,拖拽,释放鼠标的操作,能否选中某些节点。
测试删除选中的节点。
#### Which issue(s) this PR fixes:
Fixes#5194
#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器添加 RangeSelection 选择器
```
#### What type of PR is this?
/kind bug
/area ui
/milestone 2.17.x
#### What this PR does / why we need it:
解决自动保存失效的问题
#### How to test it?
测试文章、页面输入内容后,点击其他页面是否能够自动保存。
#### Which issue(s) this PR fixes:
Fixes#6129
#### Does this PR introduce a user-facing change?
```release-note
解决文章自动保存失效的问题
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
移除用户创建/编辑表单的手机号字段,当前手机号在系统中没有任何使用。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
在文章编辑页面,打开文章设置时,支持保存标题,防止已修改的标题恢复为之前的值。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/6058
#### Does this PR introduce a user-facing change?
```release-note
优化文章编辑页面自动保存标题的功能
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
升级 pf4j 至 3.12.0 版本以解决插件依赖解析不正确的问题
#### Which issue(s) this PR fixes:
Fixes#5616
#### Does this PR introduce a user-facing change?
```release-note
升级 pf4j 至 3.12.0 版本以解决插件依赖解析不正确的问题
```
#### What type of PR is this?
/kind improvement
/kind api-change
/area core
#### What this PR does / why we need it:
This PR refactors ExtensionGetter implementation to add a support of enabling extension point(s). Here is an example of data field of `system` config map:
```json
{
"data": {
"extensionPointEnabled": "{ \"search-engine\": [\"search-engine-algolia\"]}"
},
```
> 1. The `search-engine` is a name of extension point definition.
> 2. The `search-engine-algolia` is a name of extension definition.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind bug
#### What this PR does / why we need it:
修复 api client 默认请求根地址不正确的问题。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### 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
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
使用新的 [patch](https://github.com/halo-dev/halo/pull/6031) 接口重构附件的移动功能。
#### Special notes for your reviewer:
1. 测试附件移动至其他分组的功能是否正常。
2. 测试删除附件分组,选择 **删除并将附件移动至未分组** 选项,观察删除分组之后,其中的附件是否已经移动到未分组。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
简化插件启动的接口,改为之前单独提供的修改插件状态的接口,而不是修改 `spec.enabled`。
#### Special notes for your reviewer:
需要测试:
1. 手动安装插件之后,启动插件。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
使用新的 patch 接口重构评论相关的逻辑。
#### Special notes for your reviewer:
需要测试:
1. 审核评论和回复功能。
2. 批量审核评论和回复功能。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind bug
/milestone 2.17.x
#### What this PR does / why we need it:
修复首次上传附件时,没有默认选择第一个存储策略的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/6094
#### Does this PR introduce a user-facing change?
```release-note
修复首次上传附件时,没有默认选择第一个存储策略的问题。
```
#### What type of PR is this?
/area ui
/kind bug
/milestone 2.17.x
#### What this PR does / why we need it:
修复新建文章时,没有自动选择之前所选编辑器的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/6091
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
修复新建文章时,没有自动选择之前所选编辑器的问题。
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
此次变更为文章分类引入了一个新的 `preventParentPostCascadeQuery` 布尔属性,用于控制分类及其子分类下的文章显示方式。具体变更包括:
- 在分类结构中增加了 `preventParentPostCascadeQuery` 属性。
- 当分类的 `preventParentPostCascadeQuery` 属性设置为 `true` 时,该分类的文章数量不会汇总到父分类中。
- 更新了树结构遍历逻辑,以支持对 `preventParentPostCascadeQuery` 属性的处理。
- 确保独立分类中的文章显示受控,不向上级分类进行聚合。
- 增加了相应的测试用例,以验证在不同树结构中 `preventParentPostCascadeQuery` 属性的功能性。
#### Which issue(s) this PR fixes:
Fixes#5663Fixes#4923
Fixes https://github.com/halo-dev/halo/issues/3418
#### Does this PR introduce a user-facing change?
```release-note
新增独立分类选项用于控制关联的子分类下的文章显示以提供更灵活的内容管理方式
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
This PR adds patch method for all extensions API.
Patch example:
```bash
http -a admin:admin PATCH http://localhost:8090/apis/plugin.halo.run/v1alpha1/plugins/app-store-integration \
Content-Type:application/json-patch+json \
--raw='[{"op": "replace", "path": "/spec/enabled", "value": false}]'
```
#### Which issue(s) this PR fixes:
Fixes#2311
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
支持在分类上为关联的文章统一设置渲染模板
现在文章的模板生效顺序为:
1. 文章关联的分类上设置的文章模板,如果有多个则选择第一个
2. 文章上设置的自定义模板
3. 文章的默认模板
#### Which issue(s) this PR fixes:
Fixes#6101
#### Does this PR introduce a user-facing change?
```release-note
支持在分类上为关联的文章统一设置渲染模板
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
修复已验证邮箱可以重复的问题
如果出现多个重复的已验证邮箱,则只保留一个其他的设置为未验证
#### Does this PR introduce a user-facing change?
```release-note
修复已验证邮箱可以重复的问题
```
#### What type of PR is this?
/kind feature
/area core
/area plugin
#### What this PR does / why we need it:
This PR enhance usage of SharedEvent annotation to add support for publishing events among plugins.
#### How to test?
1. Clone repository https://github.com/halo-dev/plugin-starter
2. Change build.gradle as following:
```gradle
dependencies {
implementation platform('run.halo.tools.platform:plugin:2.17.0-SNAPSHOT')
```
3. Change StarterPlugin as following:
```java
@Component
public class StarterPlugin extends BasePlugin {
private final ApplicationContext appContext;
public StarterPlugin(PluginContext pluginContext, ApplicationContext appContext) {
super(pluginContext);
this.appContext = appContext;
}
@Override
public void start() {
appContext.publishEvent(new PostDeletedEvent(this, "fake-plugin"));
}
@Override
public void stop() {
}
@EventListener(PostDeletedEvent.class)
public void onApplicationEvent(PostDeletedEvent event) {
System.out.println("Post deleted event received in plugin: " + event.getName());
}
}
```
4. Add a listener to Halo core
```java
@EventListener(PostDeletedEvent.class)
public void onApplicationEvent(PostDeletedEvent event) {
System.out.println("Post deleted event received in core: " + event.getName());
}
```
5. Build plugin and install plugin
6. Enable the plugin and see the result
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area ui
/milestone 2.17.x
#### What this PR does / why we need it:
为主题增加导入及导出配置的功能。
<img width="1666" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/3574b33e-0293-427c-9036-5d82948aa7f2">
#### How to test it?
测试主题导入及导出功能是否正常可用。
测试当前主题下的不同版本导入导出后数据是否正常。
测试在当前主题下使用其他主题导出的配置是否会报错。
#### Which issue(s) this PR fixes:
Fixes#1073
#### Does this PR introduce a user-facing change?
```release-note
为单个主题配置增加导入与导出的功能。
```
#### What type of PR is this?
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
Fixes #
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
```
#### What type of PR is this?
/kind improvement
/area editor
/milestone 2.17.x
#### What this PR does / why we need it:
将默认编辑器中代码块的缩进由一个制表符(\t),更改为两个空格` {2}`。
#### How to test it?
测试使用 `Tab` 即 `Shift + Tab` 缩进时,是否每次缩进两个空格而不是一个制表符。
#### Does this PR introduce a user-facing change?
```release-note
优化默认编辑器代码块缩进为两个空格。
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.17.x
#### What this PR does / why we need it:
当前在编辑器中粘贴内容后,如果不修改任意标题或新增标题,则无法为当前标题自动生成标题 ID,进而导致锚点失效。
本 PR 将在编辑器触发内容更改后,如果是粘贴的内容,则直接触发生成标题 ID。
#### How to test it?
新建一篇文章并粘贴一段带标题的内容后直接发布。
查看发布后的文章是否可以在主题端使用锚点跳转。
#### Which issue(s) this PR fixes:
Fixes#6056
#### Does this PR introduce a user-facing change?
```release-note
解决在默认编辑器中粘贴的内容无法生成标题 ID 的问题
```
#### What type of PR is this?
/kind bug
/area editor
/area ui
#### What this PR does / why we need it:
当前为默认编辑器设置焦点的时机放在 `onMounted` 时,但此时默认编辑器可能还未加载成功且标题也为能成功加载,因此无法保证正确设置标题焦点。
当前 PR 将此时机放置在默认编辑器创建完成之后的 `onCreate` ,此时将能够保证焦点设置成功。
#### How to test it?
测试默认编辑器能否正常设置标题或内容的焦点。
#### Which issue(s) this PR fixes:
Fixes#6060
#### Does this PR introduce a user-facing change?
```release-note
解决使用默认编辑器时无法正确设置焦点的问题
```
#### What type of PR is this?
/kind regression
/area plugin
/milestone 2.17.x
#### What this PR does / why we need it:
This PR reverts changes of generating bundle resource version in <https://github.com/halo-dev/halo/pull/6028>.
Because the changes were adapted realtime change of bundle files for plugin developers in plugin development runtime mode, but I ignored it.
#### Special notes for your reviewer:
1. Try to start Halo in plugin development mode
2. Change and rebuild ui resources
3. Refresh console and check the result
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
When initialized for the first time, the folder `${halo.work-dir}/themes` does not exist, resulting in the `themes` path being ignored when invoking `themeRootResource.createRelative(themeName + "/templates/assets/");`. It works very well after restarting.
This PR fixes the problem by resolving theme resource directly rather than delegating to PathResourceResolver.
#### Which issue(s) this PR fixes:
Fixes#6048
#### Does this PR introduce a user-facing change?
```release-note
修复首次初始化后无法正常访问主题资源的问题
```
#### What type of PR is this?
/kind failing-test
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
I wrongly invoked `Arraylist#add`(probes) method in multi threads. So the unit test was unstable and might encounter the problem as follows:
```java
Expected :1
Actual :0
<Click to see difference>
org.opentest4j.AssertionFailedError: expected: <1> but was: <0>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:166)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:161)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:632)
at run.halo.app.core.extension.service.impl.PluginServiceImplTest$BundleCacheTest.concurrentComputeBundleFileIfAbsent(PluginServiceImplTest.java:460)
```
See https://github.com/halo-dev/halo/actions/runs/9382059472/job/25832681545 for more.
This PR moves the invocation outside thread tasks.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.16.x
#### What this PR does / why we need it:
补充缺失的系统设置默认值。
#### Does this PR introduce a user-facing change?
```release-note
修复系统设置未保存导致无法正常注册的问题
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
This PR upgrades Gradle to 8.8. See https://github.com/gradle/gradle/releases/tag/v8.8.0 for more.
#### Does this PR introduce a user-facing change?
```release-note
升级 Gradle 至 8.8
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
This is a regular update after a release.
#### Does this PR introduce a user-facing change?
```release-note
None
```