#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.20.x
#### What this PR does / why we need it:
Bump vue version to [3.5.11](https://github.com/vuejs/core/blob/main/CHANGELOG.md#3511-2024-10-03)
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.20.x
#### What this PR does / why we need it:
升级 UI 项目的 Vue 版本至 3.5.x。
#### Does this PR introduce a user-facing change?
```release-note
升级 UI 项目的 Vue 版本至 3.5.x。
```
#### What type of PR is this?
/area ui
/kind bug
/milestone 2.20.x
#### What this PR does / why we need it:
修复编辑器中有序列表的样式问题。
#### Which issue(s) this PR fixes:
Fixes#6615
#### 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 bumps all version to 2.20.0 to prepare for next development.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.19.x
#### What this PR does / why we need it:
为默认编辑器格式刷及清除格式扩展增加 name,用于解决其重名而导致被错误过滤的问题
Fixes#6562
#### How to test it?
查看默认编辑中格式刷及清除格式功能是否存在且运行正常。
#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器格式刷及清除格式功能不存在的问题
```
#### What type of PR is this?
/kind bug
/area editor
/area ui
/milestone 2.19.x
#### What this PR does / why we need it:
在上传的文件中执行 `resetUpload` 方法之前,提前验证是否可以进行更新。
#### How to test it?
测试删除图片或变更图片位置时,默认编辑器是否会进行报错。
#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器删除图片后报错的问题
```
#### 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
重构默认编辑器代码块使其能够被插件扩展。
```
#### 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
```
#### 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 用于解决潜在的安全问题。
```
#### 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
```
#### 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
解决默认编辑器中在空白行中按退格键无法回退到列表项中的问题
```
#### 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
```
#### 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
解决默认编辑器中对文本使用高亮会导致按键被阻止的问题
```
#### 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
修复默认编辑器中列表项需要按多次退格键才可以删除的问题
```
#### 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 样式。
```
#### 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
```
#### What type of PR is this?
/kind feature
/area editor
#### What this PR does / why we need it:
支持在默认编辑器中使用 Tab 键实现首行缩进的功能。
当光标处于文本首行时,按下 Tab 键会触发首行缩进。
在首行缩进的情况下或者选中一段文本,再次按下 Tab 键会触发整段缩进。
#### How to test it?
测试文本块及区域标题块首行按下 Tab 键是否可以正常触发首行缩进
#### Which issue(s) this PR fixes:
Fixes#6316
#### Does this PR introduce a user-facing change?
```release-note
默认编辑器增加 Tab 快捷键首行缩进功能
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.18.x
#### What this PR does / why we need it:
在默认编辑器中,选中一个跨多个节点的 text 时,selection 会变为 RangeSelection,此时冒泡菜单将不会出现。
此 RP 将 RangeSelection 添加至 text 的冒泡菜单验证中,使得冒泡菜单可以出现。
#### How to test it?
测试跨行选中多个无序列表时,是否出现冒泡菜单。
#### Which issue(s) this PR fixes:
Fixes#6267
#### 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 bumps Halo version into 2.18.0 for next development iteration.
#### 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:
为图片跳转链接增加在新窗口打开的选项。
#### How to test it?
测试新窗口打开是否正常可用。
#### Which issue(s) this PR fixes:
Fixes#6109
#### 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:
为默认编辑器代码块增加折叠功能。
<img width="892" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/8325cba9-08ce-4bd7-98b6-6bc28fe52daf">
#### How to test it?
测试折叠功能是否可用。
测试重新打开文章之后代码块是否仍旧处于折叠状态。
#### Which issue(s) this PR fixes:
Fixes#6166
#### 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:
由于 RangeSelection 可能将一些并不想展示为模拟选中效果的节点进行了转换,因此将 RangeSelection 中模拟选中的效果,由默认的自动设置为 true,变为 false。
之后需要由节点自行设置 `fakeSelection: true` 后才会展示为模拟选中的效果,否则保持原本的选择样式。
#### How to test it?
测试使用 Mod-a 全选后,listItem 等节点是否会展示为模拟选中的效果。
#### 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:
重新组织和固定 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 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?
/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 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
```
#### 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 生态的相关依赖至最新版本。
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.16.x
#### What this PR does / why we need it:
移除使用 `Backspace` 进行缩进的功能。此功能会导致选中无序列表文本至起始位置时,按 `Backspace` 快捷键会导致无序列表解除当前层级。
#### How to test it?
测试从后往前选中无序列表文本至文本起始位置,然后按下 `Backspace` 快捷键。此时应当只删除文本而不会调整无序列表层级。
#### Which issue(s) this PR fixes:
Fixes#5925
#### Does this PR introduce a user-facing change?
```release-note
修复默认编辑器中列表使用 Backspace 快捷键删除选中文本的错误行为
```
#### What type of PR is this?
/kind improvement
/area editor
/milestone 2.16.x
#### What this PR does / why we need it:
优化默认编辑器代码块 `Backspace` 快捷键逻辑。如下所示:
1. 选中内容时进行删除,保证光标仍处于代码块内。
2. 光标处于代码块首位或者代码块没有内容时,不再删除代码块。
#### How to test it?
测试默认编辑器代码块功能。查看是否符合上述逻辑
#### Which issue(s) this PR fixes:
Fixes#5927
#### Does this PR introduce a user-facing change?
```release-note
优化默认编辑器代码块 Backspace 快捷键逻辑
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.16.x
#### What this PR does / why we need it:
当工具栏菜单出现溢出时,由于 `justify-content` 会始终保持居中状态,因此会导致溢出的内容被遮挡。
考虑到 [justify-content:safe](https://developer.mozilla.org/zh-CN/docs/Web/CSS/justify-content#safe) 在 safari 上具有兼容性问题,因此修改 HTML 结构,使用 `text-align` 来使菜单居中。
#### How to test it?
测试在菜单栏溢出时,溢出的内容是否被遮挡。
#### Which issue(s) this PR fixes:
Fixes#5926
#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中顶部工具栏菜单溢出后被遮挡的问题
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.16.x
#### What this PR does / why we need it:
默认编辑器中的表格**首行被合并单元格**之后,将会出现当前表在刷新之后宽度被重置为默认。此 PR 改正了计算宽度,使其首次刷新时,也能返回正确的数组。
#### How to test it?
1. 将表格首行使用合并单元格之后,改变表格宽度。
2. 刷新表格,查看表格宽度是否不再变为默认宽度。
#### Which issue(s) this PR fixes:
Fixes#5767
#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中的表格首行合并单元格后会出现宽度重置的问题
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.16.x
#### What this PR does / why we need it:
目前表格在监听到滚动时,会重新设置 `TextSelection` 用于阴影的显示。
本 PR 将设置 `TextSelection` 更改为重新执行一次 `Transaction` 。这样可以解决在滚动时光标错位的问题。
#### How to test it?
编写表格时,测试当编写内容出现滚动条时,是否会导致文本错位。
测试滚动表格时,光标位置是否会发生改变。
#### Which issue(s) this PR fixes:
Fixes#5924
#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中滚动表格时会导致光标变换的问题
```
#### 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。
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
This is a regular action after releasing a minor version.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area editor
#### What this PR does / why we need it:
为默认编辑器表格增加 `Tab` 与 `Shift-Tab` 切换至上一个单元格或下一个单元格。具体功能如下:
1. 使用 Tab 快捷键从左向右切换至下一个单元格,当光标在最后一个单元格时,使用 Tab 键新建一行并跳转至新一行的第一个单元格。
2. 使用 Shift + Tab 快捷键从右向左来切换至上一个单元格。
#### How to test it?
测试在默认编辑器中 `Tab` 快捷键切换单元格是否生效。
测试在合并单元格等各种表格操作下,切换单元格是否生效。
#### Which issue(s) this PR fixes:
Fixes#5771
#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器表格增加 Tab 快捷键切换单元格的功能
```
#### What type of PR is this?
/kind improvement
/area editor
/milestone 2.15.x
#### What this PR does / why we need it:
本 PR 对富文本编辑器中工具栏和冒泡菜单进行精简。
- 对默认富文本冒泡菜单及顶部工具栏相同类型的功能进行了折叠。
- 删除在 text 的冒泡菜单中,不属于当前选中文本的功能,例如转换为代码块等,这些实际上是段落的功能,并非是文本的功能。而 textAlign 目前也仅仅用在标题和行上,因此也移除。
#### How to test it?
查看默认富文本编辑器工具栏中,折叠的功能是否正常。选中文本,查看文本中是否不包含段落相关的功能。
#### Which issue(s) this PR fixes:
Fixes#5669
#### Does this PR introduce a user-facing change?
```release-note
对默认富文本编辑器中的工具栏进行折叠及精简优化。
```
#### What type of PR is this?
/kind bug
/area editor
/milestone 2.15.x
#### What this PR does / why we need it:
在编写多行文本后,粘贴代码块时,会出现粘贴的内容插入错误,其与代码块分割开。
[例如 #5736 中的示例所示](https://github.com/halo-dev/halo/assets/44745967/4b1ef8dc-60bf-47fd-b64d-23b0d6537d9e)
在本 PR 中,在创建 CodeBlock 时,将 Text 转为 `TextNode` 后,一同传入作为 `CodeBlock` 的 content。
另外为了保证插入代码块之后,光标处于代码块中,将会从插入位置的 from 开始往文档顶部搜索。
#### How to test it?
测试示例中的场景下,代码块插入是否正常。
测试在代码块前后放入其他代码块或者其他块,插入代码块后光标是否在代码块中。
#### Which issue(s) this PR fixes:
Fixes#5736
#### Does this PR introduce a user-facing change?
```release-note
修复默认编辑器中粘贴代码块会出现错行的问题
```
#### What type of PR is this?
/kind feature
/area editor
/area ui
#### What this PR does / why we need it:
为默认富文本编辑器添加格式刷扩展。用以给 text node 复制格式。
使用方式:
1. 选中一串具有格式的文本
2. 点击格式刷或者使用 `Shift + Mod + c` 快捷键复制格式。
3. 选中需要进行格式处理的文本
4. 松开鼠标,格式刷生效。
#### How to test it?
测试格式刷功能是否正常可用。需要测试 text node 以及 block node 内部的 text 格式功能。
#### Which issue(s) this PR fixes:
Fixes#5591
#### Does this PR introduce a user-facing change?
```release-note
为默认富文本编辑器添加格式刷扩展。
```
#### What type of PR is this?
/kind improvement
/area editor
#### What this PR does / why we need it:
优化默认富文本编辑器中,顶部工具栏子菜单的弹出方式,将原有的鼠标移入弹出改为点击左键弹出。并且为了显示效果,将会在具有子菜单的工具栏后方显示额外的下拉图标。
#### How to test it?
查看顶部工具栏子菜单弹出方式是否已改变。(插入组件未进行更改,仍旧保持原有鼠标移入弹出方式)
#### Which issue(s) this PR fixes:
Fixes#5668
#### Does this PR introduce a user-facing change?
```release-note
优化默认富文本编辑器中顶部工具栏的子菜单弹出方式
```
#### 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
优化默认富文本编辑器中文本自动转为链接的相关逻辑
```