From 75c7914fb1aed0b38a460e2242f9562bc4ef7bb0 Mon Sep 17 00:00:00 2001 From: qwqcode <22412567+qwqcode@users.noreply.github.com> Date: Fri, 27 Oct 2023 22:24:53 +0800 Subject: [PATCH] refactor(ui/types): better `ArtalkType` import and export (#620) --- .../src/components/PageEditor.vue | 14 ++++++------ .../src/components/SiteCreate.vue | 6 ++--- .../src/components/SiteEditor.vue | 10 ++++----- .../src/components/SiteSwitcher.vue | 1 - .../src/components/UserEditor.vue | 4 ++-- ui/packages/artalk-sidebar/src/global.ts | 4 ++-- .../artalk-sidebar/src/pages/pages.vue | 8 +++---- .../artalk-sidebar/src/pages/sites.vue | 14 ++++++------ .../artalk-sidebar/src/pages/transfer.vue | 1 - .../artalk-sidebar/src/pages/users.vue | 12 +++++----- ui/packages/artalk-sidebar/src/stores/nav.ts | 4 ++-- ui/packages/artalk/package.json | 1 + ui/packages/artalk/src/api/api-base.ts | 6 ++--- ui/packages/artalk/src/api/comment.ts | 2 +- ui/packages/artalk/src/api/index.ts | 6 ++--- ui/packages/artalk/src/api/page.ts | 2 +- ui/packages/artalk/src/api/request.ts | 8 +++---- ui/packages/artalk/src/api/site.ts | 2 +- ui/packages/artalk/src/api/system.ts | 2 +- ui/packages/artalk/src/api/user.ts | 2 +- ui/packages/artalk/src/artalk.ts | 11 +++------- ui/packages/artalk/src/comment/comment.ts | 5 ++--- .../artalk/src/components/action-btn.ts | 6 ++--- ui/packages/artalk/src/components/dialog.ts | 6 ++--- ui/packages/artalk/src/config.ts | 2 +- ui/packages/artalk/src/context.ts | 5 +---- ui/packages/artalk/src/data.ts | 3 +-- ui/packages/artalk/src/defaults.ts | 2 +- ui/packages/artalk/src/editor/editor.ts | 6 ++--- ui/packages/artalk/src/editor/state.ts | 3 +-- ui/packages/artalk/src/layer/layer.ts | 4 ++-- ui/packages/artalk/src/layer/sidebar-layer.ts | 4 ++-- ui/packages/artalk/src/lib/checker/index.ts | 9 ++++---- ui/packages/artalk/src/lib/component.ts | 7 +++--- ui/packages/artalk/src/lib/dark-mode.ts | 10 ++++----- ui/packages/artalk/src/lib/user.ts | 7 +++--- ui/packages/artalk/src/lib/utils.ts | 8 +++---- ui/packages/artalk/src/list/comment.ts | 5 ++--- ui/packages/artalk/src/list/layout.ts | 2 +- ui/packages/artalk/src/list/list.ts | 4 ++-- ui/packages/artalk/src/list/nest.ts | 2 +- ui/packages/artalk/src/list/page.ts | 3 +-- .../artalk/src/list/paginator/index.ts | 3 +-- .../artalk/src/list/paginator/read-more.ts | 2 +- ui/packages/artalk/src/main.ts | 2 ++ .../artalk/src/plugins/conf-remoter.ts | 3 +-- ui/packages/artalk/src/plugins/editor-kit.ts | 3 +-- .../artalk/src/plugins/editor/_plug.ts | 3 +-- .../artalk/src/plugins/editor/emoticons.ts | 2 +- .../artalk/src/plugins/editor/index.ts | 2 +- .../artalk/src/plugins/editor/state-edit.ts | 2 +- .../artalk/src/plugins/editor/state-reply.ts | 2 +- .../artalk/src/plugins/editor/submit-add.ts | 2 +- .../artalk/src/plugins/editor/submit.ts | 2 +- ui/packages/artalk/src/plugins/index.ts | 2 +- .../artalk/src/plugins/list/copyright.ts | 2 +- ui/packages/artalk/src/plugins/list/count.ts | 2 +- .../artalk/src/plugins/list/dropdown.ts | 2 +- .../artalk/src/plugins/list/error-dialog.ts | 3 +-- ui/packages/artalk/src/plugins/list/fetch.ts | 3 +-- .../artalk/src/plugins/list/goto-first.ts | 2 +- ui/packages/artalk/src/plugins/list/goto.ts | 2 +- ui/packages/artalk/src/plugins/list/index.ts | 2 +- .../artalk/src/plugins/list/loading.ts | 2 +- .../artalk/src/plugins/list/no-comment.ts | 2 +- .../artalk/src/plugins/list/reach-bottom.ts | 2 +- .../artalk/src/plugins/list/sidebar-btn.ts | 2 +- .../artalk/src/plugins/list/time-ticking.ts | 2 +- .../artalk/src/plugins/list/unread-badge.ts | 2 +- ui/packages/artalk/src/plugins/list/unread.ts | 2 +- .../artalk/src/plugins/list/with-editor.ts | 4 +--- ui/packages/artalk/src/plugins/markdown.ts | 2 +- ui/packages/artalk/src/plugins/stat.ts | 3 +-- .../artalk/src/plugins/version-check.ts | 2 +- ui/packages/artalk/src/service.ts | 22 +++++++++---------- .../types/{artalk-config.d.ts => config.ts} | 4 ++-- .../artalk/types/{context.d.ts => context.ts} | 6 ++--- .../types/{artalk-data.d.ts => data.ts} | 0 .../artalk/types/{editor.d.ts => editor.ts} | 2 +- .../artalk/types/{event.d.ts => event.ts} | 4 ++-- ui/packages/artalk/types/index.ts | 6 +++++ ui/packages/artalk/types/plugin.d.ts | 4 ---- ui/packages/artalk/types/plugin.ts | 3 +++ ui/packages/artalk/vite.config.ts | 1 + 84 files changed, 164 insertions(+), 184 deletions(-) rename ui/packages/artalk/types/{artalk-config.d.ts => config.ts} (97%) rename ui/packages/artalk/types/{context.d.ts => context.ts} (94%) rename ui/packages/artalk/types/{artalk-data.d.ts => data.ts} (100%) rename ui/packages/artalk/types/{editor.d.ts => editor.ts} (97%) rename ui/packages/artalk/types/{event.d.ts => event.ts} (95%) create mode 100644 ui/packages/artalk/types/index.ts delete mode 100644 ui/packages/artalk/types/plugin.d.ts create mode 100644 ui/packages/artalk/types/plugin.ts diff --git a/ui/packages/artalk-sidebar/src/components/PageEditor.vue b/ui/packages/artalk-sidebar/src/components/PageEditor.vue index 9b430fe65..482f1661c 100644 --- a/ui/packages/artalk-sidebar/src/components/PageEditor.vue +++ b/ui/packages/artalk-sidebar/src/components/PageEditor.vue @@ -1,19 +1,19 @@