Commit Graph

143 Commits

Author SHA1 Message Date
Ryan Wang
760ba2347b Optimize editor styles (#7982)
* Refactor list toolbar items and unify icon sizing

* Replace MDI icons with Mingcute icons in editor extensions

* Replace MDI icons with Mingcute and other icon sets

* Unify button styles and icon sizing in editor UI

* Refactor editor icons and remove BlockCard component

* Refactor CommandsView menu styles and structure

* Add transition-colors to interactive UI components

* Refactor toolbar and toolbox item props typing

* Refactor BubbleItem props to use shared type

* Fix optional chaining for isActive prop in LinkBubbleButton

* Replace MDI icons with Mingcute icons in editor UI

* Refactor editor layout and styles for improved flexibility

* Refactor editor layout and update styles

* Replace icon set in CodeBlockViewRenderer

* Extend props types for toolbar, bubble, and toolbox items

* Refactor bubble components into subfolder

* Add BubbleButton component and update usage

* Refactor dropdown and toolbar item components

* Add image position dropdown to image bubble menu

* Refactor editor extension isActive checks to use class names

* Refactor gallery bubble items to use new UI components

* Refactor iframe align actions into dedicated component

* Refactor video position bubble to dropdown component

* Refactor input components and unify input UI

* Increase input container width from w-60 to w-64

* Refactor video size UI and update link popper widths

* Add audio position alignment to editor extension

* Refactor iframe and video size controls, update icons

* Add ResourceReplaceButton and refactor media replace UI

* Add configurable gap for gallery items

* Increase group size options to 10 in gallery

Expanded the selectable group size options in BubbleItemGroupSize.vue from 6 to 10, allowing users to choose larger group sizes for gallery items.

* Add danger type to cover delete dropdown item

* Add auto-focus to Input components in editor bubbles

* Add top margin to GalleryView node wrapper
2025-12-10 14:37:45 +08:00
Ryan Wang
a3eda32f01 Refactor attachment grid item and image preview components (#7989) 2025-12-08 10:14:40 +08:00
Ryan Wang
fca4c32519 Refactor dropdown component (#7978)
* Refactor dropdown components to use floating-vue directly

* Replace floating-vue with @halo-dev/components in editor

* Remove Dropdown.vue and update story usage

* Remove unused popper class and related styles

* Refactor gallery dropdowns to use VDropdownItem
2025-12-01 11:32:23 +08:00
Ryan Wang
488f9cc7c4 Make content fields required in post and content models (#7972)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.22.x

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

See #7967 

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

Fixes #7967 

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

```release-note
None
```
2025-12-01 02:39:37 +00:00
Ryan Wang
a204fbc86a Refactor editor package (#7968)
* Move extensions

Signed-off-by: Ryan Wang <i@ryanc.cc>

* Refactor editor extensions to use explicit naming

* Refactor attachment selector integration in editor

* Remove vue-demi from Vite external dependencies

* Add README for richtext-editor package

* Refactor attachment composable and update upload permissions

* Refactor editor i18n keys and move upload strings

* Refactor AllExtensions to ExtensionsKit and update usage

* Move heading id attribute to extension implementation

* Refactor i18n usage to use i18n.global.t

* Update README to reflect changes in editor extensions, replacing AllExtensions with ExtensionsKit

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-11-28 13:02:34 +08:00
Ryan Wang
6f711fc0cb Upgrade dev dependencies versions (#7960)
#### What type of PR is this?

/area ui
/kind cleanup

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

Upgrade dev dependencies versions

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

```release-note
None
```
2025-11-23 06:03:11 +00:00
Ryan Wang
d1c347ab37 Refactor attachment image preview section (#7944) 2025-11-18 11:56:03 +08:00
Ryan Wang
a94993a056 Add confirmType 'danger' to destructive dialogs (#7943) 2025-11-18 11:55:37 +08:00
Ryan Wang
b434574166 Refactor to use async component imports (#7941)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.22.x

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

Lazy load partial routes to optimize initial load speed

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

```release-note
None
```
2025-11-17 01:36:53 +00:00
Ryan Wang
ede40ad698 Enhance type hints for globally registered components (#7933)
* Enhance type hints for globally registered components

* Refactor Codemirror props and language support

* Update

Signed-off-by: Ryan Wang <i@ryanc.cc>

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-11-14 14:51:55 +08:00
Ryan Wang
ec22d038ca Refactor comment components to use async imports (#7932)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.22.x

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

Refactor comment components to use async imports.

before:

<img width="705" height="274" alt="image" src="https://github.com/user-attachments/assets/2e424722-90e4-4333-80f8-ef494f1e763d" />

after:

<img width="703" height="243" alt="image" src="https://github.com/user-attachments/assets/17045d1b-54fe-4a0b-860c-62ab47e9338f" />

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

```release-note
None
```
2025-11-13 08:38:48 +00:00
Ryan Wang
dab1ceb537 Lazy load some routes to improve initial render performance (#7930)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.22.x

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

Lazy load some routes to improve initial render performance

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

```release-note
懒加载 Console 和 UC 的部分路由,优化首屏渲染速度
```
2025-11-13 06:28:46 +00:00
Ryan Wang
ac88ee70cb Rename @halo-dev/console-shared to @halo-dev/ui-shared (#7926)
#### What type of PR is this?

/area ui
/kind api-change
/milestone 2.22.x

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

See #7925 

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

Fixes #7925 

#### Special notes for your reviewer:

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

```release-note
将 `@halo-dev/console-shared` 重命名为 `@halo-dev/ui-shared`
```
2025-11-10 16:20:41 +00:00
Ryan Wang
d9c3b1ffa1 Refactor extension point composables to use vue-query (#7915) 2025-11-07 18:03:53 +08:00
Ryan Wang
ad3b5c0680 Refactor UUID generation to shared utils.id.uuid (#7898) 2025-11-05 11:13:35 +08:00
Ryan Wang
150db051f8 Replace lodash-es with es-toolkit across codebase (#7896) 2025-11-05 11:08:57 +08:00
Ryan Wang
7fcec8fd0b Refactor filter status values to use string type (#7873)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.22.x

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

Fix comment and plugin list filtering not working correctly

This issue might have been caused by the VueUse dependency upgrade in #7819.

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

```release-note
None
```
2025-10-27 12:46:16 +00:00
Ryan Wang
e53bfd4edb Refactor user and global info stores to shared package (#7858)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.22.x

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

This PR moves the `currentUser` and `globalInfo` stores to the `@halo-dev/console-shared` package, making them easily accessible for plugins.

In addition, it’s now possible for plugins to define their own global stores using Pinia.

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

```release-note
- 在 `@halo-dev/console-shared` 包中提供 `stores` 对象,包含 currentUser 和 globalInfo。
- 支持在插件的 UI 中使用 Pinia 定义全局 Store
```
2025-10-23 10:32:14 +00:00
Ryan Wang
cc4ba4a361 Refactor permission checks to use shared utils (#7853)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.22.x

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

This PR introduces a developer-friendly utility for checking UI permissions, which is also exposed for use by plugins.

Usage:

```ts
import { utils } from "@halo-dev/console-shared"

utils.permission.has(['any:permission'])
```

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

```release-note
在 `@halo-dev/console-shared` 包中提供 UI 权限检查工具
```
2025-10-23 09:44:13 +00:00
Ryan Wang
f0e0ffd4a9 Add help text for attachment display name form (#7851)
Added a help message to the display name field in the attachment edit form, clarifying that the custom name is only for management interface display and does not affect the file name or access link.
2025-10-23 11:26:35 +08:00
Ryan Wang
75ae6215a0 Refactor date and attachment utils to shared package (#7847)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.22.x

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

This PR introduces date and attachment utilities into the `@halo-dev/console-shared` package. This makes it convenient for plugins to share and reuse these common functions.

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

```release-note
在 `@halo-dev/console-shared` 包中提供统一的 date 和 attachment 工具
```
2025-10-22 10:02:14 +00:00
Ryan Wang
825a932453 Refactor to use shallowRef for tab and provider arrays (#7837)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.22.x

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

This PR refactors the code to use shallowRef instead of ref in scenarios where deep reactivity for the properties of an object or array is unnecessary.

Using shallowRef is more performant in these cases as it avoids the overhead of making the entire data structure deeply reactive.

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

```release-note
None
```
2025-10-21 15:10:13 +00:00
Ryan Wang
5521965b9b Refactor AttachmentSelectorModal visibility handling (#7832)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.22.x

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

Replaces the 'visible' prop and v-model usage with internal modal ref and event-based close handling in AttachmentSelectorModal components. Updates all usages to use explicit visibility state and @close event, improving modal control and code consistency.

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

```release-note
None
```
2025-10-21 15:06:14 +00:00
Ryan Wang
1f4219ff3a Remove unused element visibility logic (#7826)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.22.x

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

Eliminated useTemplateRef and useElementVisibility from AttachmentThumbnailList.vue as they were no longer needed. The visibility check for the wrapper div was removed, simplifying the component.

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

```release-note
None
```
2025-10-18 12:16:18 +00:00
Ryan Wang
8da9ab6520 Add display priority to attachment policies (#7805)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-10-18 12:13:32 +08:00
Ryan Wang
86660fae86 Refactor attachment thumbnail preview components (#7819)
* Refactor attachment thumbnail preview components

Replaces AttachmentSingleThumbnailList and AttachmentSingleThumbnailItem with a new AttachmentThumbnailList component for improved thumbnail preview in attachment detail modals. Updates AttachmentDetailModal.vue in both console and user center modules to use the new component. Also removes the 'click to exit preview' feature and cleans up related code.

* Update vueuse packages and improve thumbnail visibility

Upgraded @vueuse dependencies to version 12.8.2 for improved compatibility and features. Modified AttachmentThumbnailList.vue to use the 'once' option with useElementVisibility for better performance.
2025-10-18 12:13:18 +08:00
Ryan Wang
f72977b9a7 Add cover image support to post editor (#7809)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.22.x

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

This PR adds support for setting a cover image directly in the post editor, making the process more intuitive and convenient.

<img width="948" height="341" alt="image" src="https://github.com/user-attachments/assets/e518c198-c10d-479b-854b-bd0af094d5e2" />
<img width="1284" height="743" alt="image" src="https://github.com/user-attachments/assets/3f7e3828-6df3-4185-bef9-b9d8b7c7d64a" />

Fixes https://github.com/halo-dev/halo/issues/7033
Fixes https://github.com/halo-dev/halo/issues/5699

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

```release-note
支持在文章编辑页面设置封面图
```
2025-10-17 10:27:51 +00:00
Ryan Wang
3bc0e8610d Bump rolldown-vite to 7.1.17 (#7804)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-10-15 12:48:20 +08:00
Ryan Wang
b21e77b911 Add hidden flag for attachment policies in upload UI (#7792)
#### What type of PR is this?

/area ui
/milestone 2.22.x
/kind feature

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

This PR adds an option in the storage policy settings to hide a policy from the upload interface.

This is useful because some storage policies are not intended for direct user uploads. Hiding them can help declutter the UI and prevent users from selecting them by mistake.

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

Fixes #7787 

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

```release-note
支持在附件上传界面隐藏部分存储策略
```
2025-10-03 17:04:28 +00:00
Ryan Wang
838b97b812 Refactor attachment policy form (#7790)
#### What type of PR is this?

/area ui
/milestone 2.22.x

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

Refactored AttachmentPolicyEditingModal.vue to group policy config fields under a 'config' group and improved the update logic to use JSON patch for displayName

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

```release-note
None
```
2025-10-03 03:42:26 +00:00
Ryan Wang
80d407cc6d Update external link visibility to use opacity transition (#7786)
Replaces 'hidden' and 'inline-block' classes with 'opacity-0' and 'group-hover:opacity-100' for external link icons in multiple components. This change enables smoother transitions and better control over the visibility of external link icons on hover.
2025-10-02 11:53:43 +08:00
Ryan Wang
5e6de80570 Remove thumbnails management feature and adapt new implementation 2025-10-02 10:31:17 +08:00
Ryan Wang
6bc81a9866 Improve navigation logic after publishing content (#7775) 2025-09-20 23:35:36 +08:00
Ryan Wang
ba23e6c07b Improve flex layout for category and menu list items (#7760) 2025-09-20 23:35:17 +08:00
Ryan Wang
d0f050ff86 Enable auto-height for textarea fields in forms (#7749)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

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

Add auto-height prop to  formkit textarea to support automatic resizing based on content length.

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

```release-note
Console 端的部分多行文本输入框支持自动高度。
```
2025-09-20 15:16:03 +00:00
Ryan Wang
bdbbbdf3af Disable persistence of selected group and policy in attachment upload modal (#7738)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

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

In the attachment upload modal, we previously persisted the user’s selected storage policy and group to make future uploads more convenient. However, this overlooked a common usage scenario—users often apply filters for storage policy and group in the attachment list before uploading. Persisting those previous selections could then conflict with the current filters and cause confusion. This PR removes the persistence of selected group and storage policy to avoid such mismatches.

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

Fixes #7713 

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

```release-note
在附件上传组件中取消所选分组和存储策略的持久化,默认选择为附件列表筛选条件相同的策略和分组。
```
2025-09-06 02:09:38 +00:00
Ryan Wang
568ebf5b70 Fix pending comments calculation in post list item (#7703)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

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

Fix pending comments calculation in post list item

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

```release-note
None
```
2025-08-19 07:03:16 +00:00
Ryan Wang
3487132154 Add support for hidden comments (#7679)
* Add 'hidden' field to comment and reply requests

Signed-off-by: Ryan Wang <i@ryanc.cc>

* Add support for filtering comments with hidden

* Specify hidden=false and approved=true for anonymous users

* Set default hidden flag only if null in comments

* Add 'private reply' option to comment modals

* Add private tag for hidden comments and replies

* Allow hiding comments only

* Enhance comment visibility logic to allow owners to view hidden comments

* Remove hidden input for reply form

Signed-off-by: Ryan Wang <i@ryanc.cc>

* Refine i18n

Signed-off-by: Ryan Wang <i@ryanc.cc>

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: John Niang <johnniang@foxmail.com>
2025-08-19 14:47:37 +08:00
Ryan Wang
7d51f38d96 Include subjectRefKey in comments queryKey (#7685) 2025-08-15 22:55:40 +08:00
Ryan Wang
f5af5a1550 Add subject-based comment list modal (#7681) 2025-08-13 15:43:50 +08:00
Ryan Wang
09cd1f7f74 Comments now support rich text formatting display (#7674)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

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

Comments now support rich text format display.

Still need to:

1. Test for XSS vulnerabilities
2. Optimize content styling
3. Editor

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

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

#### Special notes for your reviewer:

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

```release-note
评论内容支持以富文本格式显示
```
2025-08-12 06:26:47 +00:00
Ryan Wang
2cf0d6853a feat: add slug existence check when creating posts (#7617)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

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

This PR adds frontend support for checking whether an slug already exists when creating posts.

Note:

1. The current implementation isn’t perfect, some actions (like clicking the “Publish” button) don’t check for duplicate slug yet.
2. Slug checking in the user center might not be accurate, since it may not have permission to query all posts.

<img width="695" alt="image" src="https://github.com/user-attachments/assets/baa37a82-49c2-43be-a4d8-0e0f22a9d73b" />

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

Fixes https://github.com/halo-dev/halo/issues/7615
Fixes https://github.com/halo-dev/halo/issues/3332

#### Special notes for your reviewer:

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

```release-note
创建文章时支持检查别名是否重复
```
2025-07-27 05:19:17 +00:00
Ryan Wang
cc3b3323c7 feat: add slug existence check when creating categories and tags (#7616)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

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

This PR adds frontend support for checking if an slug already exists when creating post categories and tags.

<img width="701" alt="image" src="https://github.com/user-attachments/assets/050c2fc3-b82c-42f1-b58e-cf12c6852959" />

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

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

#### Special notes for your reviewer:

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

```release-note
创建文章分类和标签时支持检查别名是否已存在
```
2025-07-27 05:17:16 +00:00
Ryan Wang
395399f078 feat: add thumbnail records modal (#7630)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

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

Add thumbnail records viewing feature. The main goal is to keep track of failed thumbnail generations, making it easier to check if thumbnails were generated correctly and retry if needed.

<img width="1009" height="859" alt="image" src="https://github.com/user-attachments/assets/d968e416-0b88-45bf-a554-a0c1abcf97a0" />
<img width="1014" height="952" alt="image" src="https://github.com/user-attachments/assets/c5d1a11b-7acc-4ab5-a2da-cf9467cb6b70" />

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

Fixes #

#### Special notes for your reviewer:

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

```release-note
支持查看附件缩略图记录
```
2025-07-22 13:54:18 +00:00
Ryan Wang
3dd0d00288 fix: menu and post category dragging issue (#7608)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

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

Fix issue where menu items and post categories could not be reordered via drag-and-drop

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

Fixes #7607 

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

```release-note
修复菜单项和文章分类可能出现无法拖动排序的问题
```
2025-07-04 04:39:41 +00:00
Ryan Wang
a4a418b22e feat: add support for remote URL attachment downloads (#7602)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

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

Add support for remote URL attachment downloads

<img width="1031" alt="image" src="https://github.com/user-attachments/assets/f85eee2f-a40b-49ff-9ced-31136f59e67c" />

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

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

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

```release-note
支持通过远程地址下载到附件库
```
2025-07-04 04:37:40 +00:00
Ryan Wang
552eaec40b fix: bump rolldown vite version to fix css chunk issue (#7606)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.21.x

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

Bump rolldown-vite to 7.0.3 to fix a styling issue causing the attachment upload component to not load styles properly.

<img width="1234" alt="image" src="https://github.com/user-attachments/assets/ce12e4f1-fa86-4164-b1ce-b279f57407c5" />

Ref https://github.com/halo-sigs/plugin-moments/issues/150#issuecomment-3016260268

#### Special notes for your reviewer:

Need to test whether the attachment upload component works properly in both development and production environments, specifically in the console and UC.

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

```release-note
修复个人中心上传组件无法正常加载样式的问题。
```
2025-06-30 01:15:29 +00:00
Ryan Wang
5e28c6db0c chore: update prettier and simplify config (#7589)
#### What type of PR is this?

/area ui
/kind cleanup

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

Upgrade Prettier and related plugins, and simplify Prettier configuration.

Now, formatting for all packages will be managed by Prettier in the project root directory.

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

```release-note
None
```
2025-06-25 09:47:21 +00:00
Ryan Wang
1826c7dcbb chore: migrate eslint 9 (#7588)
#### What type of PR is this?

/area ui
/kind cleanup

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

Migrate to ESLint 9, use flat config file, and simplify ESLint configuration.

Now, linting for all packages will be managed by the configuration in the project root directory.

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

```release-note
None
```
2025-06-25 00:37:20 +00:00
Ryan Wang
0addf79aec fix: resolve comment content width issue (#7586)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

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

Fix the width issue of comment content, which was affected by https://github.com/halo-dev/halo/pull/7564 and is inconsistent with version 2.20.0

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

```release-note
修复 2.20.1 中评论管理中内容的宽度问题。
```
2025-06-24 15:23:15 +00:00