From 0e4a111f81cceed275d9bec2695f6e401fb654d8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 12 Nov 2021 02:02:25 +0900 Subject: refactoring Resolve #7779 --- src/client/.eslintrc | 32 - src/client/@types/global.d.ts | 8 - src/client/@types/vue.d.ts | 5 - src/client/account.ts | 211 ---- src/client/components/abuse-report-window.vue | 79 -- src/client/components/analog-clock.vue | 150 --- src/client/components/autocomplete.vue | 502 -------- src/client/components/avatars.vue | 30 - src/client/components/captcha.vue | 123 -- src/client/components/channel-follow-button.vue | 140 --- src/client/components/channel-preview.vue | 165 --- src/client/components/chart.vue | 691 ----------- src/client/components/code-core.vue | 35 - src/client/components/code.vue | 27 - src/client/components/cw-button.vue | 70 -- src/client/components/date-separated-list.vue | 188 --- src/client/components/debobigego/base.vue | 65 -- src/client/components/debobigego/button.vue | 81 -- src/client/components/debobigego/debobigego.scss | 52 - src/client/components/debobigego/group.vue | 78 -- src/client/components/debobigego/info.vue | 47 - src/client/components/debobigego/input.vue | 292 ----- .../components/debobigego/key-value-view.vue | 38 - src/client/components/debobigego/link.vue | 103 -- src/client/components/debobigego/object-view.vue | 102 -- src/client/components/debobigego/pagination.vue | 42 - src/client/components/debobigego/radios.vue | 112 -- src/client/components/debobigego/range.vue | 122 -- src/client/components/debobigego/select.vue | 145 --- src/client/components/debobigego/suspense.vue | 101 -- src/client/components/debobigego/switch.vue | 132 --- src/client/components/debobigego/textarea.vue | 161 --- src/client/components/debobigego/tuple.vue | 36 - src/client/components/dialog.vue | 212 ---- src/client/components/drive-file-thumbnail.vue | 108 -- src/client/components/drive-select-dialog.vue | 70 -- src/client/components/drive-window.vue | 44 - src/client/components/drive.file.vue | 374 ------ src/client/components/drive.folder.vue | 326 ------ src/client/components/drive.nav-folder.vue | 135 --- src/client/components/drive.vue | 784 ------------- src/client/components/emoji-picker-dialog.vue | 76 -- src/client/components/emoji-picker-window.vue | 197 ---- src/client/components/emoji-picker.section.vue | 50 - src/client/components/emoji-picker.vue | 501 -------- src/client/components/featured-photos.vue | 32 - src/client/components/file-type-icon.vue | 28 - src/client/components/follow-button.vue | 210 ---- src/client/components/forgot-password.vue | 84 -- src/client/components/form-dialog.vue | 125 -- src/client/components/form/input.vue | 315 ----- src/client/components/form/radio.vue | 122 -- src/client/components/form/radios.vue | 54 - src/client/components/form/range.vue | 139 --- src/client/components/form/section.vue | 31 - src/client/components/form/select.vue | 312 ----- src/client/components/form/slot.vue | 50 - src/client/components/form/switch.vue | 150 --- src/client/components/form/textarea.vue | 252 ---- src/client/components/formula-core.vue | 34 - src/client/components/formula.vue | 23 - src/client/components/gallery-post-preview.vue | 126 -- src/client/components/global/a.vue | 138 --- src/client/components/global/acct.vue | 38 - src/client/components/global/ad.vue | 200 ---- src/client/components/global/avatar.vue | 163 --- src/client/components/global/ellipsis.vue | 34 - src/client/components/global/emoji.vue | 125 -- src/client/components/global/error.vue | 46 - src/client/components/global/header.vue | 360 ------ src/client/components/global/i18n.ts | 42 - src/client/components/global/loading.vue | 92 -- .../global/misskey-flavored-markdown.vue | 157 --- src/client/components/global/spacer.vue | 76 -- src/client/components/global/sticky-container.vue | 74 -- src/client/components/global/time.vue | 73 -- src/client/components/global/url.vue | 142 --- src/client/components/global/user-name.vue | 20 - src/client/components/google.vue | 64 - src/client/components/image-viewer.vue | 85 -- src/client/components/img-with-blurhash.vue | 100 -- src/client/components/index.ts | 37 - src/client/components/instance-stats.vue | 80 -- src/client/components/instance-ticker.vue | 62 - src/client/components/launch-pad.vue | 152 --- src/client/components/link.vue | 92 -- src/client/components/media-banner.vue | 107 -- src/client/components/media-caption.vue | 260 ----- src/client/components/media-image.vue | 155 --- src/client/components/media-list.vue | 167 --- src/client/components/media-video.vue | 97 -- src/client/components/mention.vue | 86 -- src/client/components/mfm.ts | 321 ----- src/client/components/mini-chart.vue | 90 -- src/client/components/modal-page-window.vue | 223 ---- src/client/components/note-detailed.vue | 1229 -------------------- src/client/components/note-header.vue | 115 -- src/client/components/note-preview.vue | 98 -- src/client/components/note-simple.vue | 113 -- src/client/components/note.sub.vue | 146 --- src/client/components/note.vue | 1228 ------------------- src/client/components/notes.vue | 130 --- .../components/notification-setting-window.vue | 99 -- src/client/components/notification.vue | 362 ------ src/client/components/notifications.vue | 159 --- src/client/components/number-diff.vue | 47 - src/client/components/page-preview.vue | 162 --- src/client/components/page-window.vue | 167 --- src/client/components/page/page.block.vue | 44 - src/client/components/page/page.button.vue | 66 -- src/client/components/page/page.canvas.vue | 49 - src/client/components/page/page.counter.vue | 52 - src/client/components/page/page.if.vue | 31 - src/client/components/page/page.image.vue | 40 - src/client/components/page/page.note.vue | 47 - src/client/components/page/page.number-input.vue | 55 - src/client/components/page/page.post.vue | 109 -- src/client/components/page/page.radio-button.vue | 45 - src/client/components/page/page.section.vue | 60 - src/client/components/page/page.switch.vue | 55 - src/client/components/page/page.text-input.vue | 55 - src/client/components/page/page.text.vue | 68 -- src/client/components/page/page.textarea-input.vue | 47 - src/client/components/page/page.textarea.vue | 39 - src/client/components/page/page.vue | 86 -- src/client/components/particle.vue | 114 -- src/client/components/poll-editor.vue | 251 ---- src/client/components/poll.vue | 174 --- src/client/components/post-form-attaches.vue | 193 --- src/client/components/post-form-dialog.vue | 19 - src/client/components/post-form.vue | 980 ---------------- src/client/components/queue-chart.vue | 232 ---- src/client/components/reaction-icon.vue | 25 - src/client/components/reaction-tooltip.vue | 51 - src/client/components/reactions-viewer.details.vue | 91 -- .../components/reactions-viewer.reaction.vue | 183 --- src/client/components/reactions-viewer.vue | 48 - src/client/components/remote-caution.vue | 35 - src/client/components/sample.vue | 116 -- src/client/components/signin-dialog.vue | 42 - src/client/components/signin.vue | 240 ---- src/client/components/signup-dialog.vue | 50 - src/client/components/signup.vue | 268 ----- src/client/components/sparkle.vue | 180 --- src/client/components/sub-note-content.vue | 62 - src/client/components/tab.vue | 73 -- src/client/components/taskmanager.api-window.vue | 72 -- src/client/components/taskmanager.vue | 233 ---- src/client/components/timeline.vue | 183 --- src/client/components/toast.vue | 73 -- src/client/components/token-generate-window.vue | 117 -- src/client/components/ui/button.vue | 262 ----- src/client/components/ui/container.vue | 262 ----- src/client/components/ui/context-menu.vue | 97 -- src/client/components/ui/folder.vue | 156 --- src/client/components/ui/hr.vue | 16 - src/client/components/ui/info.vue | 45 - src/client/components/ui/menu.vue | 278 ----- src/client/components/ui/modal-window.vue | 148 --- src/client/components/ui/modal.vue | 292 ----- src/client/components/ui/pagination.vue | 69 -- src/client/components/ui/popup-menu.vue | 42 - src/client/components/ui/popup.vue | 213 ---- src/client/components/ui/super-menu.vue | 148 --- src/client/components/ui/tooltip.vue | 92 -- src/client/components/ui/window.vue | 525 --------- src/client/components/updated.vue | 62 - src/client/components/url-preview-popup.vue | 60 - src/client/components/url-preview.vue | 334 ------ src/client/components/user-info.vue | 144 --- src/client/components/user-list.vue | 91 -- src/client/components/user-online-indicator.vue | 50 - src/client/components/user-preview.vue | 192 --- src/client/components/user-select-dialog.vue | 199 ---- src/client/components/users-dialog.vue | 147 --- src/client/components/visibility-picker.vue | 167 --- src/client/components/waiting-dialog.vue | 92 -- src/client/components/widgets.vue | 152 --- src/client/config.ts | 15 - src/client/directives/anim.ts | 18 - src/client/directives/appear.ts | 22 - src/client/directives/click-anime.ts | 29 - src/client/directives/follow-append.ts | 35 - src/client/directives/get-size.ts | 34 - src/client/directives/hotkey.ts | 24 - src/client/directives/index.ts | 26 - src/client/directives/particle.ts | 18 - src/client/directives/size.ts | 68 -- src/client/directives/sticky-container.ts | 15 - src/client/directives/tooltip.ts | 87 -- src/client/directives/user-preview.ts | 118 -- src/client/events.ts | 4 - src/client/filters/bytes.ts | 9 - src/client/filters/note.ts | 3 - src/client/filters/number.ts | 1 - src/client/filters/user.ts | 15 - src/client/i18n.ts | 13 - src/client/init.ts | 420 ------- src/client/instance.ts | 52 - src/client/menu.ts | 224 ---- src/client/os.ts | 501 -------- src/client/pages/_error_.vue | 94 -- src/client/pages/_loading_.vue | 10 - src/client/pages/about-misskey.vue | 238 ---- src/client/pages/about.vue | 123 -- src/client/pages/admin/abuses.vue | 170 --- src/client/pages/admin/ads.vue | 138 --- src/client/pages/admin/announcements.vue | 125 -- src/client/pages/admin/bot-protection.vue | 138 --- src/client/pages/admin/database.vue | 61 - src/client/pages/admin/email-settings.vue | 128 -- src/client/pages/admin/emoji-edit-dialog.vue | 120 -- src/client/pages/admin/emojis.vue | 263 ----- src/client/pages/admin/file-dialog.vue | 129 -- src/client/pages/admin/files-settings.vue | 93 -- src/client/pages/admin/files.vue | 209 ---- src/client/pages/admin/index.vue | 388 ------ src/client/pages/admin/instance-block.vue | 72 -- src/client/pages/admin/instance.vue | 321 ----- src/client/pages/admin/integrations-discord.vue | 85 -- src/client/pages/admin/integrations-github.vue | 85 -- src/client/pages/admin/integrations-twitter.vue | 85 -- src/client/pages/admin/integrations.vue | 74 -- src/client/pages/admin/metrics.vue | 472 -------- src/client/pages/admin/object-storage.vue | 155 --- src/client/pages/admin/other-settings.vue | 83 -- src/client/pages/admin/overview.vue | 236 ---- src/client/pages/admin/proxy-account.vue | 87 -- src/client/pages/admin/queue.chart.vue | 102 -- src/client/pages/admin/queue.vue | 73 -- src/client/pages/admin/relays.vue | 99 -- src/client/pages/admin/security.vue | 83 -- src/client/pages/admin/service-worker.vue | 85 -- src/client/pages/admin/settings.vue | 151 --- src/client/pages/admin/users.vue | 254 ---- src/client/pages/advanced-theme-editor.vue | 352 ------ src/client/pages/announcements.vue | 74 -- src/client/pages/antenna-timeline.vue | 147 --- src/client/pages/api-console.vue | 93 -- src/client/pages/auth.form.vue | 60 - src/client/pages/auth.vue | 95 -- src/client/pages/channel-editor.vue | 129 -- src/client/pages/channel.vue | 186 --- src/client/pages/channels.vue | 77 -- src/client/pages/clip.vue | 154 --- src/client/pages/drive.vue | 28 - src/client/pages/emojis.category.vue | 135 --- src/client/pages/emojis.emoji.vue | 94 -- src/client/pages/emojis.vue | 36 - src/client/pages/explore.vue | 261 ----- src/client/pages/favorites.vue | 60 - src/client/pages/featured.vue | 43 - src/client/pages/federation.vue | 265 ----- src/client/pages/follow-requests.vue | 153 --- src/client/pages/follow.vue | 65 -- src/client/pages/gallery/edit.vue | 168 --- src/client/pages/gallery/index.vue | 152 --- src/client/pages/gallery/post.vue | 282 ----- src/client/pages/instance-info.vue | 238 ---- src/client/pages/mentions.vue | 42 - src/client/pages/messages.vue | 45 - src/client/pages/messaging/index.vue | 307 ----- src/client/pages/messaging/messaging-room.form.vue | 348 ------ .../pages/messaging/messaging-room.message.vue | 350 ------ src/client/pages/messaging/messaging-room.vue | 470 -------- src/client/pages/mfm-cheat-sheet.vue | 365 ------ src/client/pages/miauth.vue | 100 -- src/client/pages/my-antennas/create.vue | 51 - src/client/pages/my-antennas/edit.vue | 56 - src/client/pages/my-antennas/editor.vue | 190 --- src/client/pages/my-antennas/index.vue | 71 -- src/client/pages/my-clips/index.vue | 104 -- src/client/pages/my-groups/group.vue | 184 --- src/client/pages/my-groups/index.vue | 121 -- src/client/pages/my-lists/index.vue | 88 -- src/client/pages/my-lists/list.vue | 170 --- src/client/pages/not-found.vue | 25 - src/client/pages/note.vue | 209 ---- src/client/pages/notifications.vue | 88 -- .../page-editor/els/page-editor.el.button.vue | 84 -- .../page-editor/els/page-editor.el.canvas.vue | 50 - .../page-editor/els/page-editor.el.counter.vue | 46 - .../pages/page-editor/els/page-editor.el.if.vue | 84 -- .../pages/page-editor/els/page-editor.el.image.vue | 72 -- .../pages/page-editor/els/page-editor.el.note.vue | 65 -- .../els/page-editor.el.number-input.vue | 46 - .../pages/page-editor/els/page-editor.el.post.vue | 43 - .../els/page-editor.el.radio-button.vue | 50 - .../page-editor/els/page-editor.el.section.vue | 96 -- .../page-editor/els/page-editor.el.switch.vue | 46 - .../page-editor/els/page-editor.el.text-input.vue | 39 - .../pages/page-editor/els/page-editor.el.text.vue | 57 - .../els/page-editor.el.textarea-input.vue | 40 - .../page-editor/els/page-editor.el.textarea.vue | 57 - .../pages/page-editor/page-editor.blocks.vue | 78 -- .../pages/page-editor/page-editor.container.vue | 159 --- .../pages/page-editor/page-editor.script-block.vue | 281 ----- src/client/pages/page-editor/page-editor.vue | 561 --------- src/client/pages/page.vue | 311 ----- src/client/pages/pages.vue | 96 -- src/client/pages/preview.vue | 32 - src/client/pages/reset-password.vue | 69 -- src/client/pages/reversi/game.board.vue | 528 --------- src/client/pages/reversi/game.setting.vue | 390 ------- src/client/pages/reversi/game.vue | 76 -- src/client/pages/reversi/index.vue | 279 ----- src/client/pages/room/preview.vue | 107 -- src/client/pages/room/room.vue | 285 ----- src/client/pages/scratchpad.vue | 149 --- src/client/pages/search.vue | 53 - src/client/pages/settings/2fa.vue | 247 ---- src/client/pages/settings/account-info.vue | 185 --- src/client/pages/settings/accounts.vue | 149 --- src/client/pages/settings/api.vue | 65 -- src/client/pages/settings/apps.vue | 113 -- src/client/pages/settings/custom-css.vue | 73 -- src/client/pages/settings/deck.vue | 107 -- src/client/pages/settings/delete-account.vue | 68 -- src/client/pages/settings/drive.vue | 147 --- src/client/pages/settings/email-address.vue | 70 -- src/client/pages/settings/email-notification.vue | 91 -- src/client/pages/settings/email.vue | 66 -- .../pages/settings/experimental-features.vue | 52 - src/client/pages/settings/general.vue | 223 ---- src/client/pages/settings/import-export.vue | 112 -- src/client/pages/settings/index.vue | 326 ------ src/client/pages/settings/integration.vue | 141 --- src/client/pages/settings/menu.vue | 117 -- src/client/pages/settings/mute-block.vue | 85 -- src/client/pages/settings/notifications.vue | 77 -- src/client/pages/settings/other.vue | 97 -- src/client/pages/settings/plugin.install.vue | 147 --- src/client/pages/settings/plugin.manage.vue | 115 -- src/client/pages/settings/plugin.vue | 44 - src/client/pages/settings/privacy.vue | 120 -- src/client/pages/settings/profile.vue | 281 ----- src/client/pages/settings/reaction.vue | 152 --- src/client/pages/settings/registry.keys.vue | 114 -- src/client/pages/settings/registry.value.vue | 149 --- src/client/pages/settings/registry.vue | 90 -- src/client/pages/settings/security.vue | 158 --- src/client/pages/settings/sounds.vue | 155 --- src/client/pages/settings/theme.install.vue | 105 -- src/client/pages/settings/theme.manage.vue | 105 -- src/client/pages/settings/theme.vue | 424 ------- src/client/pages/settings/update.vue | 95 -- src/client/pages/settings/word-mute.vue | 110 -- src/client/pages/share.vue | 184 --- src/client/pages/signup-complete.vue | 50 - src/client/pages/tag.vue | 57 - src/client/pages/test.vue | 259 ----- src/client/pages/theme-editor.vue | 306 ----- src/client/pages/timeline.tutorial.vue | 131 --- src/client/pages/timeline.vue | 225 ---- src/client/pages/user-ap-info.vue | 124 -- src/client/pages/user-info.vue | 245 ---- src/client/pages/user-list-timeline.vue | 147 --- src/client/pages/user/clips.vue | 50 - src/client/pages/user/follow-list.vue | 65 -- src/client/pages/user/gallery.vue | 56 - src/client/pages/user/index.activity.vue | 34 - src/client/pages/user/index.photos.vue | 107 -- src/client/pages/user/index.timeline.vue | 68 -- src/client/pages/user/index.vue | 829 ------------- src/client/pages/user/pages.vue | 49 - src/client/pages/user/reactions.vue | 81 -- src/client/pages/v.vue | 29 - src/client/pages/welcome.entrance.a.vue | 320 ----- src/client/pages/welcome.entrance.b.vue | 236 ---- src/client/pages/welcome.entrance.c.vue | 305 ----- src/client/pages/welcome.setup.vue | 102 -- src/client/pages/welcome.timeline.vue | 99 -- src/client/pages/welcome.vue | 38 - src/client/pizzax.ts | 153 --- src/client/plugin.ts | 124 -- src/client/router.ts | 149 --- src/client/scripts/2fa.ts | 33 - src/client/scripts/aiscript/api.ts | 44 - src/client/scripts/autocomplete.ts | 276 ----- src/client/scripts/check-word-mute.ts | 26 - src/client/scripts/collect-page-vars.ts | 48 - src/client/scripts/contains.ts | 9 - src/client/scripts/copy-to-clipboard.ts | 33 - .../scripts/extract-avg-color-from-blurhash.ts | 9 - src/client/scripts/focus.ts | 27 - src/client/scripts/form.ts | 31 - src/client/scripts/gen-search-query.ts | 31 - src/client/scripts/get-account-from-id.ts | 7 - src/client/scripts/get-md5.ts | 10 - src/client/scripts/get-static-image-url.ts | 16 - src/client/scripts/get-user-menu.ts | 205 ---- src/client/scripts/hotkey.ts | 88 -- src/client/scripts/hpml/block.ts | 109 -- src/client/scripts/hpml/evaluator.ts | 234 ---- src/client/scripts/hpml/expr.ts | 79 -- src/client/scripts/hpml/index.ts | 103 -- src/client/scripts/hpml/lib.ts | 246 ---- src/client/scripts/hpml/type-checker.ts | 189 --- src/client/scripts/idb-proxy.ts | 37 - src/client/scripts/initialize-sw.ts | 68 -- src/client/scripts/is-device-darkmode.ts | 3 - src/client/scripts/is-device-touch.ts | 1 - src/client/scripts/is-mobile.ts | 2 - src/client/scripts/keycode.ts | 33 - src/client/scripts/loading.ts | 11 - src/client/scripts/login-id.ts | 11 - src/client/scripts/lookup-user.ts | 37 - src/client/scripts/paging.ts | 246 ---- src/client/scripts/physics.ts | 152 --- src/client/scripts/please-login.ts | 14 - src/client/scripts/popout.ts | 22 - src/client/scripts/reaction-picker.ts | 41 - src/client/scripts/room/furniture.ts | 21 - src/client/scripts/room/furnitures.json5 | 407 ------- src/client/scripts/room/room.ts | 775 ------------ src/client/scripts/scroll.ts | 80 -- src/client/scripts/search.ts | 64 - src/client/scripts/select-file.ts | 89 -- src/client/scripts/show-suspended-dialog.ts | 10 - src/client/scripts/sound.ts | 34 - src/client/scripts/sticky-sidebar.ts | 50 - src/client/scripts/theme-editor.ts | 81 -- src/client/scripts/theme.ts | 127 -- src/client/scripts/unison-reload.ts | 15 - src/client/store.ts | 318 ----- src/client/style.scss | 562 --------- src/client/sw/compose-notification.ts | 99 -- src/client/sw/sw.ts | 123 -- src/client/symbols.ts | 1 - src/client/theme-store.ts | 34 - src/client/themes/_dark.json5 | 90 -- src/client/themes/_light.json5 | 90 -- src/client/themes/d-astro.json5 | 78 -- src/client/themes/d-black.json5 | 17 - src/client/themes/d-botanical.json5 | 26 - src/client/themes/d-dark.json5 | 26 - src/client/themes/d-future.json5 | 27 - src/client/themes/d-persimmon.json5 | 25 - src/client/themes/d-pumpkin.json5 | 88 -- src/client/themes/l-apricot.json5 | 22 - src/client/themes/l-light.json5 | 20 - src/client/themes/l-rainy.json5 | 21 - src/client/themes/l-sushi.json5 | 18 - src/client/themes/l-vivid.json5 | 82 -- src/client/tsconfig.json | 42 - src/client/ui/_common_/common.vue | 89 -- src/client/ui/_common_/sidebar.vue | 388 ------ src/client/ui/_common_/stream-indicator.vue | 70 -- src/client/ui/_common_/upload.vue | 134 --- src/client/ui/chat/date-separated-list.vue | 163 --- src/client/ui/chat/header-clock.vue | 62 - src/client/ui/chat/index.vue | 467 -------- src/client/ui/chat/note-header.vue | 112 -- src/client/ui/chat/note-preview.vue | 112 -- src/client/ui/chat/note.sub.vue | 137 --- src/client/ui/chat/note.vue | 1144 ------------------ src/client/ui/chat/notes.vue | 94 -- src/client/ui/chat/pages/channel.vue | 259 ----- src/client/ui/chat/pages/timeline.vue | 221 ---- src/client/ui/chat/post-form.vue | 773 ------------ src/client/ui/chat/side.vue | 157 --- src/client/ui/chat/store.ts | 17 - src/client/ui/chat/sub-note-content.vue | 62 - src/client/ui/chat/widgets.vue | 62 - src/client/ui/classic.header.vue | 210 ---- src/client/ui/classic.side.vue | 158 --- src/client/ui/classic.sidebar.vue | 263 ----- src/client/ui/classic.vue | 471 -------- src/client/ui/classic.widgets.vue | 84 -- src/client/ui/deck.vue | 229 ---- src/client/ui/deck/antenna-column.vue | 80 -- src/client/ui/deck/column-core.vue | 52 - src/client/ui/deck/column.vue | 408 ------- src/client/ui/deck/deck-store.ts | 298 ----- src/client/ui/deck/direct-column.vue | 55 - src/client/ui/deck/list-column.vue | 80 -- src/client/ui/deck/main-column.vue | 91 -- src/client/ui/deck/mentions-column.vue | 52 - src/client/ui/deck/notifications-column.vue | 53 - src/client/ui/deck/tl-column.vue | 137 --- src/client/ui/deck/widgets-column.vue | 71 -- src/client/ui/desktop.vue | 70 -- src/client/ui/universal.vue | 402 ------- src/client/ui/universal.widgets.vue | 79 -- src/client/ui/visitor.vue | 19 - src/client/ui/visitor/a.vue | 260 ----- src/client/ui/visitor/b.vue | 282 ----- src/client/ui/visitor/header.vue | 228 ---- src/client/ui/visitor/kanban.vue | 256 ---- src/client/ui/zen.vue | 106 -- src/client/widgets/activity.calendar.vue | 85 -- src/client/widgets/activity.chart.vue | 107 -- src/client/widgets/activity.vue | 82 -- src/client/widgets/aichan.vue | 59 - src/client/widgets/aiscript.vue | 163 --- src/client/widgets/button.vue | 95 -- src/client/widgets/calendar.vue | 204 ---- src/client/widgets/clock.vue | 55 - src/client/widgets/define.ts | 75 -- src/client/widgets/digital-clock.vue | 79 -- src/client/widgets/federation.vue | 145 --- src/client/widgets/index.ts | 45 - src/client/widgets/job-queue.vue | 183 --- src/client/widgets/memo.vue | 106 -- src/client/widgets/notifications.vue | 65 -- src/client/widgets/online-users.vue | 67 -- src/client/widgets/photos.vue | 113 -- src/client/widgets/post-form.vue | 23 - src/client/widgets/rss.vue | 89 -- src/client/widgets/server-metric/cpu-mem.vue | 174 --- src/client/widgets/server-metric/cpu.vue | 76 -- src/client/widgets/server-metric/disk.vue | 70 -- src/client/widgets/server-metric/index.vue | 82 -- src/client/widgets/server-metric/mem.vue | 85 -- src/client/widgets/server-metric/net.vue | 148 --- src/client/widgets/server-metric/pie.vue | 65 -- src/client/widgets/slideshow.vue | 167 --- src/client/widgets/timeline.vue | 116 -- src/client/widgets/trends.vue | 111 -- 519 files changed, 72011 deletions(-) delete mode 100644 src/client/.eslintrc delete mode 100644 src/client/@types/global.d.ts delete mode 100644 src/client/@types/vue.d.ts delete mode 100644 src/client/account.ts delete mode 100644 src/client/components/abuse-report-window.vue delete mode 100644 src/client/components/analog-clock.vue delete mode 100644 src/client/components/autocomplete.vue delete mode 100644 src/client/components/avatars.vue delete mode 100644 src/client/components/captcha.vue delete mode 100644 src/client/components/channel-follow-button.vue delete mode 100644 src/client/components/channel-preview.vue delete mode 100644 src/client/components/chart.vue delete mode 100644 src/client/components/code-core.vue delete mode 100644 src/client/components/code.vue delete mode 100644 src/client/components/cw-button.vue delete mode 100644 src/client/components/date-separated-list.vue delete mode 100644 src/client/components/debobigego/base.vue delete mode 100644 src/client/components/debobigego/button.vue delete mode 100644 src/client/components/debobigego/debobigego.scss delete mode 100644 src/client/components/debobigego/group.vue delete mode 100644 src/client/components/debobigego/info.vue delete mode 100644 src/client/components/debobigego/input.vue delete mode 100644 src/client/components/debobigego/key-value-view.vue delete mode 100644 src/client/components/debobigego/link.vue delete mode 100644 src/client/components/debobigego/object-view.vue delete mode 100644 src/client/components/debobigego/pagination.vue delete mode 100644 src/client/components/debobigego/radios.vue delete mode 100644 src/client/components/debobigego/range.vue delete mode 100644 src/client/components/debobigego/select.vue delete mode 100644 src/client/components/debobigego/suspense.vue delete mode 100644 src/client/components/debobigego/switch.vue delete mode 100644 src/client/components/debobigego/textarea.vue delete mode 100644 src/client/components/debobigego/tuple.vue delete mode 100644 src/client/components/dialog.vue delete mode 100644 src/client/components/drive-file-thumbnail.vue delete mode 100644 src/client/components/drive-select-dialog.vue delete mode 100644 src/client/components/drive-window.vue delete mode 100644 src/client/components/drive.file.vue delete mode 100644 src/client/components/drive.folder.vue delete mode 100644 src/client/components/drive.nav-folder.vue delete mode 100644 src/client/components/drive.vue delete mode 100644 src/client/components/emoji-picker-dialog.vue delete mode 100644 src/client/components/emoji-picker-window.vue delete mode 100644 src/client/components/emoji-picker.section.vue delete mode 100644 src/client/components/emoji-picker.vue delete mode 100644 src/client/components/featured-photos.vue delete mode 100644 src/client/components/file-type-icon.vue delete mode 100644 src/client/components/follow-button.vue delete mode 100644 src/client/components/forgot-password.vue delete mode 100644 src/client/components/form-dialog.vue delete mode 100644 src/client/components/form/input.vue delete mode 100644 src/client/components/form/radio.vue delete mode 100644 src/client/components/form/radios.vue delete mode 100644 src/client/components/form/range.vue delete mode 100644 src/client/components/form/section.vue delete mode 100644 src/client/components/form/select.vue delete mode 100644 src/client/components/form/slot.vue delete mode 100644 src/client/components/form/switch.vue delete mode 100644 src/client/components/form/textarea.vue delete mode 100644 src/client/components/formula-core.vue delete mode 100644 src/client/components/formula.vue delete mode 100644 src/client/components/gallery-post-preview.vue delete mode 100644 src/client/components/global/a.vue delete mode 100644 src/client/components/global/acct.vue delete mode 100644 src/client/components/global/ad.vue delete mode 100644 src/client/components/global/avatar.vue delete mode 100644 src/client/components/global/ellipsis.vue delete mode 100644 src/client/components/global/emoji.vue delete mode 100644 src/client/components/global/error.vue delete mode 100644 src/client/components/global/header.vue delete mode 100644 src/client/components/global/i18n.ts delete mode 100644 src/client/components/global/loading.vue delete mode 100644 src/client/components/global/misskey-flavored-markdown.vue delete mode 100644 src/client/components/global/spacer.vue delete mode 100644 src/client/components/global/sticky-container.vue delete mode 100644 src/client/components/global/time.vue delete mode 100644 src/client/components/global/url.vue delete mode 100644 src/client/components/global/user-name.vue delete mode 100644 src/client/components/google.vue delete mode 100644 src/client/components/image-viewer.vue delete mode 100644 src/client/components/img-with-blurhash.vue delete mode 100644 src/client/components/index.ts delete mode 100644 src/client/components/instance-stats.vue delete mode 100644 src/client/components/instance-ticker.vue delete mode 100644 src/client/components/launch-pad.vue delete mode 100644 src/client/components/link.vue delete mode 100644 src/client/components/media-banner.vue delete mode 100644 src/client/components/media-caption.vue delete mode 100644 src/client/components/media-image.vue delete mode 100644 src/client/components/media-list.vue delete mode 100644 src/client/components/media-video.vue delete mode 100644 src/client/components/mention.vue delete mode 100644 src/client/components/mfm.ts delete mode 100644 src/client/components/mini-chart.vue delete mode 100644 src/client/components/modal-page-window.vue delete mode 100644 src/client/components/note-detailed.vue delete mode 100644 src/client/components/note-header.vue delete mode 100644 src/client/components/note-preview.vue delete mode 100644 src/client/components/note-simple.vue delete mode 100644 src/client/components/note.sub.vue delete mode 100644 src/client/components/note.vue delete mode 100644 src/client/components/notes.vue delete mode 100644 src/client/components/notification-setting-window.vue delete mode 100644 src/client/components/notification.vue delete mode 100644 src/client/components/notifications.vue delete mode 100644 src/client/components/number-diff.vue delete mode 100644 src/client/components/page-preview.vue delete mode 100644 src/client/components/page-window.vue delete mode 100644 src/client/components/page/page.block.vue delete mode 100644 src/client/components/page/page.button.vue delete mode 100644 src/client/components/page/page.canvas.vue delete mode 100644 src/client/components/page/page.counter.vue delete mode 100644 src/client/components/page/page.if.vue delete mode 100644 src/client/components/page/page.image.vue delete mode 100644 src/client/components/page/page.note.vue delete mode 100644 src/client/components/page/page.number-input.vue delete mode 100644 src/client/components/page/page.post.vue delete mode 100644 src/client/components/page/page.radio-button.vue delete mode 100644 src/client/components/page/page.section.vue delete mode 100644 src/client/components/page/page.switch.vue delete mode 100644 src/client/components/page/page.text-input.vue delete mode 100644 src/client/components/page/page.text.vue delete mode 100644 src/client/components/page/page.textarea-input.vue delete mode 100644 src/client/components/page/page.textarea.vue delete mode 100644 src/client/components/page/page.vue delete mode 100644 src/client/components/particle.vue delete mode 100644 src/client/components/poll-editor.vue delete mode 100644 src/client/components/poll.vue delete mode 100644 src/client/components/post-form-attaches.vue delete mode 100644 src/client/components/post-form-dialog.vue delete mode 100644 src/client/components/post-form.vue delete mode 100644 src/client/components/queue-chart.vue delete mode 100644 src/client/components/reaction-icon.vue delete mode 100644 src/client/components/reaction-tooltip.vue delete mode 100644 src/client/components/reactions-viewer.details.vue delete mode 100644 src/client/components/reactions-viewer.reaction.vue delete mode 100644 src/client/components/reactions-viewer.vue delete mode 100644 src/client/components/remote-caution.vue delete mode 100644 src/client/components/sample.vue delete mode 100644 src/client/components/signin-dialog.vue delete mode 100755 src/client/components/signin.vue delete mode 100644 src/client/components/signup-dialog.vue delete mode 100644 src/client/components/signup.vue delete mode 100644 src/client/components/sparkle.vue delete mode 100644 src/client/components/sub-note-content.vue delete mode 100644 src/client/components/tab.vue delete mode 100644 src/client/components/taskmanager.api-window.vue delete mode 100644 src/client/components/taskmanager.vue delete mode 100644 src/client/components/timeline.vue delete mode 100644 src/client/components/toast.vue delete mode 100644 src/client/components/token-generate-window.vue delete mode 100644 src/client/components/ui/button.vue delete mode 100644 src/client/components/ui/container.vue delete mode 100644 src/client/components/ui/context-menu.vue delete mode 100644 src/client/components/ui/folder.vue delete mode 100644 src/client/components/ui/hr.vue delete mode 100644 src/client/components/ui/info.vue delete mode 100644 src/client/components/ui/menu.vue delete mode 100644 src/client/components/ui/modal-window.vue delete mode 100644 src/client/components/ui/modal.vue delete mode 100644 src/client/components/ui/pagination.vue delete mode 100644 src/client/components/ui/popup-menu.vue delete mode 100644 src/client/components/ui/popup.vue delete mode 100644 src/client/components/ui/super-menu.vue delete mode 100644 src/client/components/ui/tooltip.vue delete mode 100644 src/client/components/ui/window.vue delete mode 100644 src/client/components/updated.vue delete mode 100644 src/client/components/url-preview-popup.vue delete mode 100644 src/client/components/url-preview.vue delete mode 100644 src/client/components/user-info.vue delete mode 100644 src/client/components/user-list.vue delete mode 100644 src/client/components/user-online-indicator.vue delete mode 100644 src/client/components/user-preview.vue delete mode 100644 src/client/components/user-select-dialog.vue delete mode 100644 src/client/components/users-dialog.vue delete mode 100644 src/client/components/visibility-picker.vue delete mode 100644 src/client/components/waiting-dialog.vue delete mode 100644 src/client/components/widgets.vue delete mode 100644 src/client/config.ts delete mode 100644 src/client/directives/anim.ts delete mode 100644 src/client/directives/appear.ts delete mode 100644 src/client/directives/click-anime.ts delete mode 100644 src/client/directives/follow-append.ts delete mode 100644 src/client/directives/get-size.ts delete mode 100644 src/client/directives/hotkey.ts delete mode 100644 src/client/directives/index.ts delete mode 100644 src/client/directives/particle.ts delete mode 100644 src/client/directives/size.ts delete mode 100644 src/client/directives/sticky-container.ts delete mode 100644 src/client/directives/tooltip.ts delete mode 100644 src/client/directives/user-preview.ts delete mode 100644 src/client/events.ts delete mode 100644 src/client/filters/bytes.ts delete mode 100644 src/client/filters/note.ts delete mode 100644 src/client/filters/number.ts delete mode 100644 src/client/filters/user.ts delete mode 100644 src/client/i18n.ts delete mode 100644 src/client/init.ts delete mode 100644 src/client/instance.ts delete mode 100644 src/client/menu.ts delete mode 100644 src/client/os.ts delete mode 100644 src/client/pages/_error_.vue delete mode 100644 src/client/pages/_loading_.vue delete mode 100644 src/client/pages/about-misskey.vue delete mode 100644 src/client/pages/about.vue delete mode 100644 src/client/pages/admin/abuses.vue delete mode 100644 src/client/pages/admin/ads.vue delete mode 100644 src/client/pages/admin/announcements.vue delete mode 100644 src/client/pages/admin/bot-protection.vue delete mode 100644 src/client/pages/admin/database.vue delete mode 100644 src/client/pages/admin/email-settings.vue delete mode 100644 src/client/pages/admin/emoji-edit-dialog.vue delete mode 100644 src/client/pages/admin/emojis.vue delete mode 100644 src/client/pages/admin/file-dialog.vue delete mode 100644 src/client/pages/admin/files-settings.vue delete mode 100644 src/client/pages/admin/files.vue delete mode 100644 src/client/pages/admin/index.vue delete mode 100644 src/client/pages/admin/instance-block.vue delete mode 100644 src/client/pages/admin/instance.vue delete mode 100644 src/client/pages/admin/integrations-discord.vue delete mode 100644 src/client/pages/admin/integrations-github.vue delete mode 100644 src/client/pages/admin/integrations-twitter.vue delete mode 100644 src/client/pages/admin/integrations.vue delete mode 100644 src/client/pages/admin/metrics.vue delete mode 100644 src/client/pages/admin/object-storage.vue delete mode 100644 src/client/pages/admin/other-settings.vue delete mode 100644 src/client/pages/admin/overview.vue delete mode 100644 src/client/pages/admin/proxy-account.vue delete mode 100644 src/client/pages/admin/queue.chart.vue delete mode 100644 src/client/pages/admin/queue.vue delete mode 100644 src/client/pages/admin/relays.vue delete mode 100644 src/client/pages/admin/security.vue delete mode 100644 src/client/pages/admin/service-worker.vue delete mode 100644 src/client/pages/admin/settings.vue delete mode 100644 src/client/pages/admin/users.vue delete mode 100644 src/client/pages/advanced-theme-editor.vue delete mode 100644 src/client/pages/announcements.vue delete mode 100644 src/client/pages/antenna-timeline.vue delete mode 100644 src/client/pages/api-console.vue delete mode 100644 src/client/pages/auth.form.vue delete mode 100755 src/client/pages/auth.vue delete mode 100644 src/client/pages/channel-editor.vue delete mode 100644 src/client/pages/channel.vue delete mode 100644 src/client/pages/channels.vue delete mode 100644 src/client/pages/clip.vue delete mode 100644 src/client/pages/drive.vue delete mode 100644 src/client/pages/emojis.category.vue delete mode 100644 src/client/pages/emojis.emoji.vue delete mode 100644 src/client/pages/emojis.vue delete mode 100644 src/client/pages/explore.vue delete mode 100644 src/client/pages/favorites.vue delete mode 100644 src/client/pages/featured.vue delete mode 100644 src/client/pages/federation.vue delete mode 100644 src/client/pages/follow-requests.vue delete mode 100644 src/client/pages/follow.vue delete mode 100644 src/client/pages/gallery/edit.vue delete mode 100644 src/client/pages/gallery/index.vue delete mode 100644 src/client/pages/gallery/post.vue delete mode 100644 src/client/pages/instance-info.vue delete mode 100644 src/client/pages/mentions.vue delete mode 100644 src/client/pages/messages.vue delete mode 100644 src/client/pages/messaging/index.vue delete mode 100644 src/client/pages/messaging/messaging-room.form.vue delete mode 100644 src/client/pages/messaging/messaging-room.message.vue delete mode 100644 src/client/pages/messaging/messaging-room.vue delete mode 100644 src/client/pages/mfm-cheat-sheet.vue delete mode 100644 src/client/pages/miauth.vue delete mode 100644 src/client/pages/my-antennas/create.vue delete mode 100644 src/client/pages/my-antennas/edit.vue delete mode 100644 src/client/pages/my-antennas/editor.vue delete mode 100644 src/client/pages/my-antennas/index.vue delete mode 100644 src/client/pages/my-clips/index.vue delete mode 100644 src/client/pages/my-groups/group.vue delete mode 100644 src/client/pages/my-groups/index.vue delete mode 100644 src/client/pages/my-lists/index.vue delete mode 100644 src/client/pages/my-lists/list.vue delete mode 100644 src/client/pages/not-found.vue delete mode 100644 src/client/pages/note.vue delete mode 100644 src/client/pages/notifications.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.button.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.canvas.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.counter.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.if.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.image.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.note.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.number-input.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.post.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.radio-button.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.section.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.switch.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.text-input.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.text.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.textarea-input.vue delete mode 100644 src/client/pages/page-editor/els/page-editor.el.textarea.vue delete mode 100644 src/client/pages/page-editor/page-editor.blocks.vue delete mode 100644 src/client/pages/page-editor/page-editor.container.vue delete mode 100644 src/client/pages/page-editor/page-editor.script-block.vue delete mode 100644 src/client/pages/page-editor/page-editor.vue delete mode 100644 src/client/pages/page.vue delete mode 100644 src/client/pages/pages.vue delete mode 100644 src/client/pages/preview.vue delete mode 100644 src/client/pages/reset-password.vue delete mode 100644 src/client/pages/reversi/game.board.vue delete mode 100644 src/client/pages/reversi/game.setting.vue delete mode 100644 src/client/pages/reversi/game.vue delete mode 100644 src/client/pages/reversi/index.vue delete mode 100644 src/client/pages/room/preview.vue delete mode 100644 src/client/pages/room/room.vue delete mode 100644 src/client/pages/scratchpad.vue delete mode 100644 src/client/pages/search.vue delete mode 100644 src/client/pages/settings/2fa.vue delete mode 100644 src/client/pages/settings/account-info.vue delete mode 100644 src/client/pages/settings/accounts.vue delete mode 100644 src/client/pages/settings/api.vue delete mode 100644 src/client/pages/settings/apps.vue delete mode 100644 src/client/pages/settings/custom-css.vue delete mode 100644 src/client/pages/settings/deck.vue delete mode 100644 src/client/pages/settings/delete-account.vue delete mode 100644 src/client/pages/settings/drive.vue delete mode 100644 src/client/pages/settings/email-address.vue delete mode 100644 src/client/pages/settings/email-notification.vue delete mode 100644 src/client/pages/settings/email.vue delete mode 100644 src/client/pages/settings/experimental-features.vue delete mode 100644 src/client/pages/settings/general.vue delete mode 100644 src/client/pages/settings/import-export.vue delete mode 100644 src/client/pages/settings/index.vue delete mode 100644 src/client/pages/settings/integration.vue delete mode 100644 src/client/pages/settings/menu.vue delete mode 100644 src/client/pages/settings/mute-block.vue delete mode 100644 src/client/pages/settings/notifications.vue delete mode 100644 src/client/pages/settings/other.vue delete mode 100644 src/client/pages/settings/plugin.install.vue delete mode 100644 src/client/pages/settings/plugin.manage.vue delete mode 100644 src/client/pages/settings/plugin.vue delete mode 100644 src/client/pages/settings/privacy.vue delete mode 100644 src/client/pages/settings/profile.vue delete mode 100644 src/client/pages/settings/reaction.vue delete mode 100644 src/client/pages/settings/registry.keys.vue delete mode 100644 src/client/pages/settings/registry.value.vue delete mode 100644 src/client/pages/settings/registry.vue delete mode 100644 src/client/pages/settings/security.vue delete mode 100644 src/client/pages/settings/sounds.vue delete mode 100644 src/client/pages/settings/theme.install.vue delete mode 100644 src/client/pages/settings/theme.manage.vue delete mode 100644 src/client/pages/settings/theme.vue delete mode 100644 src/client/pages/settings/update.vue delete mode 100644 src/client/pages/settings/word-mute.vue delete mode 100644 src/client/pages/share.vue delete mode 100644 src/client/pages/signup-complete.vue delete mode 100644 src/client/pages/tag.vue delete mode 100644 src/client/pages/test.vue delete mode 100644 src/client/pages/theme-editor.vue delete mode 100644 src/client/pages/timeline.tutorial.vue delete mode 100644 src/client/pages/timeline.vue delete mode 100644 src/client/pages/user-ap-info.vue delete mode 100644 src/client/pages/user-info.vue delete mode 100644 src/client/pages/user-list-timeline.vue delete mode 100644 src/client/pages/user/clips.vue delete mode 100644 src/client/pages/user/follow-list.vue delete mode 100644 src/client/pages/user/gallery.vue delete mode 100644 src/client/pages/user/index.activity.vue delete mode 100644 src/client/pages/user/index.photos.vue delete mode 100644 src/client/pages/user/index.timeline.vue delete mode 100644 src/client/pages/user/index.vue delete mode 100644 src/client/pages/user/pages.vue delete mode 100644 src/client/pages/user/reactions.vue delete mode 100644 src/client/pages/v.vue delete mode 100644 src/client/pages/welcome.entrance.a.vue delete mode 100644 src/client/pages/welcome.entrance.b.vue delete mode 100644 src/client/pages/welcome.entrance.c.vue delete mode 100644 src/client/pages/welcome.setup.vue delete mode 100644 src/client/pages/welcome.timeline.vue delete mode 100644 src/client/pages/welcome.vue delete mode 100644 src/client/pizzax.ts delete mode 100644 src/client/plugin.ts delete mode 100644 src/client/router.ts delete mode 100644 src/client/scripts/2fa.ts delete mode 100644 src/client/scripts/aiscript/api.ts delete mode 100644 src/client/scripts/autocomplete.ts delete mode 100644 src/client/scripts/check-word-mute.ts delete mode 100644 src/client/scripts/collect-page-vars.ts delete mode 100644 src/client/scripts/contains.ts delete mode 100644 src/client/scripts/copy-to-clipboard.ts delete mode 100644 src/client/scripts/extract-avg-color-from-blurhash.ts delete mode 100644 src/client/scripts/focus.ts delete mode 100644 src/client/scripts/form.ts delete mode 100644 src/client/scripts/gen-search-query.ts delete mode 100644 src/client/scripts/get-account-from-id.ts delete mode 100644 src/client/scripts/get-md5.ts delete mode 100644 src/client/scripts/get-static-image-url.ts delete mode 100644 src/client/scripts/get-user-menu.ts delete mode 100644 src/client/scripts/hotkey.ts delete mode 100644 src/client/scripts/hpml/block.ts delete mode 100644 src/client/scripts/hpml/evaluator.ts delete mode 100644 src/client/scripts/hpml/expr.ts delete mode 100644 src/client/scripts/hpml/index.ts delete mode 100644 src/client/scripts/hpml/lib.ts delete mode 100644 src/client/scripts/hpml/type-checker.ts delete mode 100644 src/client/scripts/idb-proxy.ts delete mode 100644 src/client/scripts/initialize-sw.ts delete mode 100644 src/client/scripts/is-device-darkmode.ts delete mode 100644 src/client/scripts/is-device-touch.ts delete mode 100644 src/client/scripts/is-mobile.ts delete mode 100644 src/client/scripts/keycode.ts delete mode 100644 src/client/scripts/loading.ts delete mode 100644 src/client/scripts/login-id.ts delete mode 100644 src/client/scripts/lookup-user.ts delete mode 100644 src/client/scripts/paging.ts delete mode 100644 src/client/scripts/physics.ts delete mode 100644 src/client/scripts/please-login.ts delete mode 100644 src/client/scripts/popout.ts delete mode 100644 src/client/scripts/reaction-picker.ts delete mode 100644 src/client/scripts/room/furniture.ts delete mode 100644 src/client/scripts/room/furnitures.json5 delete mode 100644 src/client/scripts/room/room.ts delete mode 100644 src/client/scripts/scroll.ts delete mode 100644 src/client/scripts/search.ts delete mode 100644 src/client/scripts/select-file.ts delete mode 100644 src/client/scripts/show-suspended-dialog.ts delete mode 100644 src/client/scripts/sound.ts delete mode 100644 src/client/scripts/sticky-sidebar.ts delete mode 100644 src/client/scripts/theme-editor.ts delete mode 100644 src/client/scripts/theme.ts delete mode 100644 src/client/scripts/unison-reload.ts delete mode 100644 src/client/store.ts delete mode 100644 src/client/style.scss delete mode 100644 src/client/sw/compose-notification.ts delete mode 100644 src/client/sw/sw.ts delete mode 100644 src/client/symbols.ts delete mode 100644 src/client/theme-store.ts delete mode 100644 src/client/themes/_dark.json5 delete mode 100644 src/client/themes/_light.json5 delete mode 100644 src/client/themes/d-astro.json5 delete mode 100644 src/client/themes/d-black.json5 delete mode 100644 src/client/themes/d-botanical.json5 delete mode 100644 src/client/themes/d-dark.json5 delete mode 100644 src/client/themes/d-future.json5 delete mode 100644 src/client/themes/d-persimmon.json5 delete mode 100644 src/client/themes/d-pumpkin.json5 delete mode 100644 src/client/themes/l-apricot.json5 delete mode 100644 src/client/themes/l-light.json5 delete mode 100644 src/client/themes/l-rainy.json5 delete mode 100644 src/client/themes/l-sushi.json5 delete mode 100644 src/client/themes/l-vivid.json5 delete mode 100644 src/client/tsconfig.json delete mode 100644 src/client/ui/_common_/common.vue delete mode 100644 src/client/ui/_common_/sidebar.vue delete mode 100644 src/client/ui/_common_/stream-indicator.vue delete mode 100644 src/client/ui/_common_/upload.vue delete mode 100644 src/client/ui/chat/date-separated-list.vue delete mode 100644 src/client/ui/chat/header-clock.vue delete mode 100644 src/client/ui/chat/index.vue delete mode 100644 src/client/ui/chat/note-header.vue delete mode 100644 src/client/ui/chat/note-preview.vue delete mode 100644 src/client/ui/chat/note.sub.vue delete mode 100644 src/client/ui/chat/note.vue delete mode 100644 src/client/ui/chat/notes.vue delete mode 100644 src/client/ui/chat/pages/channel.vue delete mode 100644 src/client/ui/chat/pages/timeline.vue delete mode 100644 src/client/ui/chat/post-form.vue delete mode 100644 src/client/ui/chat/side.vue delete mode 100644 src/client/ui/chat/store.ts delete mode 100644 src/client/ui/chat/sub-note-content.vue delete mode 100644 src/client/ui/chat/widgets.vue delete mode 100644 src/client/ui/classic.header.vue delete mode 100644 src/client/ui/classic.side.vue delete mode 100644 src/client/ui/classic.sidebar.vue delete mode 100644 src/client/ui/classic.vue delete mode 100644 src/client/ui/classic.widgets.vue delete mode 100644 src/client/ui/deck.vue delete mode 100644 src/client/ui/deck/antenna-column.vue delete mode 100644 src/client/ui/deck/column-core.vue delete mode 100644 src/client/ui/deck/column.vue delete mode 100644 src/client/ui/deck/deck-store.ts delete mode 100644 src/client/ui/deck/direct-column.vue delete mode 100644 src/client/ui/deck/list-column.vue delete mode 100644 src/client/ui/deck/main-column.vue delete mode 100644 src/client/ui/deck/mentions-column.vue delete mode 100644 src/client/ui/deck/notifications-column.vue delete mode 100644 src/client/ui/deck/tl-column.vue delete mode 100644 src/client/ui/deck/widgets-column.vue delete mode 100644 src/client/ui/desktop.vue delete mode 100644 src/client/ui/universal.vue delete mode 100644 src/client/ui/universal.widgets.vue delete mode 100644 src/client/ui/visitor.vue delete mode 100644 src/client/ui/visitor/a.vue delete mode 100644 src/client/ui/visitor/b.vue delete mode 100644 src/client/ui/visitor/header.vue delete mode 100644 src/client/ui/visitor/kanban.vue delete mode 100644 src/client/ui/zen.vue delete mode 100644 src/client/widgets/activity.calendar.vue delete mode 100644 src/client/widgets/activity.chart.vue delete mode 100644 src/client/widgets/activity.vue delete mode 100644 src/client/widgets/aichan.vue delete mode 100644 src/client/widgets/aiscript.vue delete mode 100644 src/client/widgets/button.vue delete mode 100644 src/client/widgets/calendar.vue delete mode 100644 src/client/widgets/clock.vue delete mode 100644 src/client/widgets/define.ts delete mode 100644 src/client/widgets/digital-clock.vue delete mode 100644 src/client/widgets/federation.vue delete mode 100644 src/client/widgets/index.ts delete mode 100644 src/client/widgets/job-queue.vue delete mode 100644 src/client/widgets/memo.vue delete mode 100644 src/client/widgets/notifications.vue delete mode 100644 src/client/widgets/online-users.vue delete mode 100644 src/client/widgets/photos.vue delete mode 100644 src/client/widgets/post-form.vue delete mode 100644 src/client/widgets/rss.vue delete mode 100644 src/client/widgets/server-metric/cpu-mem.vue delete mode 100644 src/client/widgets/server-metric/cpu.vue delete mode 100644 src/client/widgets/server-metric/disk.vue delete mode 100644 src/client/widgets/server-metric/index.vue delete mode 100644 src/client/widgets/server-metric/mem.vue delete mode 100644 src/client/widgets/server-metric/net.vue delete mode 100644 src/client/widgets/server-metric/pie.vue delete mode 100644 src/client/widgets/slideshow.vue delete mode 100644 src/client/widgets/timeline.vue delete mode 100644 src/client/widgets/trends.vue (limited to 'src/client') diff --git a/src/client/.eslintrc b/src/client/.eslintrc deleted file mode 100644 index fffa28d9e4..0000000000 --- a/src/client/.eslintrc +++ /dev/null @@ -1,32 +0,0 @@ -{ - "env": { - "node": false, - }, - "extends": [ - "eslint:recommended", - "plugin:vue/recommended" - ], - "rules": { - "vue/require-v-for-key": 0, - "vue/max-attributes-per-line": 0, - "vue/html-indent": 0, - "vue/html-self-closing": 0, - "vue/no-unused-vars": 0, - "vue/attributes-order": 0, - "vue/require-prop-types": 0, - "vue/require-default-prop": 0, - "vue/html-closing-bracket-spacing": 0, - "vue/singleline-html-element-content-newline": 0, - "vue/no-v-html": 0 - }, - "globals": { - "_DEV_": false, - "_LANGS_": false, - "_VERSION_": false, - "_ENV_": false, - "_PERF_PREFIX_": false, - "_DATA_TRANSFER_DRIVE_FILE_": false, - "_DATA_TRANSFER_DRIVE_FOLDER_": false, - "_DATA_TRANSFER_DECK_COLUMN_": false - } -} diff --git a/src/client/@types/global.d.ts b/src/client/@types/global.d.ts deleted file mode 100644 index 84dde63b22..0000000000 --- a/src/client/@types/global.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare const _LANGS_: string[][]; -declare const _VERSION_: string; -declare const _ENV_: string; -declare const _DEV_: boolean; -declare const _PERF_PREFIX_: string; -declare const _DATA_TRANSFER_DRIVE_FILE_: string; -declare const _DATA_TRANSFER_DRIVE_FOLDER_: string; -declare const _DATA_TRANSFER_DECK_COLUMN_: string; diff --git a/src/client/@types/vue.d.ts b/src/client/@types/vue.d.ts deleted file mode 100644 index 8cb6130629..0000000000 --- a/src/client/@types/vue.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare module '*.vue' { - import type { DefineComponent } from 'vue'; - const component: DefineComponent<{}, {}, any>; - export default component; -} diff --git a/src/client/account.ts b/src/client/account.ts deleted file mode 100644 index a2165ebed1..0000000000 --- a/src/client/account.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { del, get, set } from '@client/scripts/idb-proxy'; -import { reactive } from 'vue'; -import { apiUrl } from '@client/config'; -import { waiting, api, popup, popupMenu, success } from '@client/os'; -import { unisonReload, reloadChannel } from '@client/scripts/unison-reload'; -import { showSuspendedDialog } from './scripts/show-suspended-dialog'; -import { i18n } from './i18n'; - -// TODO: 他のタブと永続化されたstateを同期 - -type Account = { - id: string; - token: string; - isModerator: boolean; - isAdmin: boolean; - isDeleted: boolean; -}; - -const data = localStorage.getItem('account'); - -// TODO: 外部からはreadonlyに -export const $i = data ? reactive(JSON.parse(data) as Account) : null; - -export async function signout() { - waiting(); - localStorage.removeItem('account'); - - //#region Remove account - const accounts = await getAccounts(); - accounts.splice(accounts.findIndex(x => x.id === $i.id), 1); - - if (accounts.length > 0) await set('accounts', accounts); - else await del('accounts'); - //#endregion - - //#region Remove service worker registration - try { - if (navigator.serviceWorker.controller) { - const registration = await navigator.serviceWorker.ready; - const push = await registration.pushManager.getSubscription(); - if (push) { - await fetch(`${apiUrl}/sw/unregister`, { - method: 'POST', - body: JSON.stringify({ - i: $i.token, - endpoint: push.endpoint, - }), - }); - } - } - - if (accounts.length === 0) { - await navigator.serviceWorker.getRegistrations() - .then(registrations => { - return Promise.all(registrations.map(registration => registration.unregister())); - }); - } - } catch (e) {} - //#endregion - - document.cookie = `igi=; path=/`; - - if (accounts.length > 0) login(accounts[0].token); - else unisonReload('/'); -} - -export async function getAccounts(): Promise<{ id: Account['id'], token: Account['token'] }[]> { - return (await get('accounts')) || []; -} - -export async function addAccount(id: Account['id'], token: Account['token']) { - const accounts = await getAccounts(); - if (!accounts.some(x => x.id === id)) { - await set('accounts', accounts.concat([{ id, token }])); - } -} - -function fetchAccount(token): Promise { - return new Promise((done, fail) => { - // Fetch user - fetch(`${apiUrl}/i`, { - method: 'POST', - body: JSON.stringify({ - i: token - }) - }) - .then(res => res.json()) - .then(res => { - if (res.error) { - if (res.error.id === 'a8c724b3-6e9c-4b46-b1a8-bc3ed6258370') { - showSuspendedDialog().then(() => { - signout(); - }); - } else { - signout(); - } - } else { - res.token = token; - done(res); - } - }) - .catch(fail); - }); -} - -export function updateAccount(data) { - for (const [key, value] of Object.entries(data)) { - $i[key] = value; - } - localStorage.setItem('account', JSON.stringify($i)); -} - -export function refreshAccount() { - return fetchAccount($i.token).then(updateAccount); -} - -export async function login(token: Account['token'], redirect?: string) { - waiting(); - if (_DEV_) console.log('logging as token ', token); - const me = await fetchAccount(token); - localStorage.setItem('account', JSON.stringify(me)); - await addAccount(me.id, token); - - if (redirect) { - // 他のタブは再読み込みするだけ - reloadChannel.postMessage(null); - // このページはredirectで指定された先に移動 - location.href = redirect; - return; - } - - unisonReload(); -} - -export async function openAccountMenu(ev: MouseEvent) { - function showSigninDialog() { - popup(import('@client/components/signin-dialog.vue'), {}, { - done: res => { - addAccount(res.id, res.i); - success(); - }, - }, 'closed'); - } - - function createAccount() { - popup(import('@client/components/signup-dialog.vue'), {}, { - done: res => { - addAccount(res.id, res.i); - switchAccountWithToken(res.i); - }, - }, 'closed'); - } - - async function switchAccount(account: any) { - const storedAccounts = await getAccounts(); - const token = storedAccounts.find(x => x.id === account.id).token; - switchAccountWithToken(token); - } - - function switchAccountWithToken(token: string) { - login(token); - } - - const storedAccounts = await getAccounts().then(accounts => accounts.filter(x => x.id !== $i.id)); - const accountsPromise = api('users/show', { userIds: storedAccounts.map(x => x.id) }); - - const accountItemPromises = storedAccounts.map(a => new Promise(res => { - accountsPromise.then(accounts => { - const account = accounts.find(x => x.id === a.id); - if (account == null) return res(null); - res({ - type: 'user', - user: account, - action: () => { switchAccount(account); } - }); - }); - })); - - popupMenu([...[{ - type: 'link', - text: i18n.locale.profile, - to: `/@${ $i.username }`, - avatar: $i, - }, null, ...accountItemPromises, { - icon: 'fas fa-plus', - text: i18n.locale.addAccount, - action: () => { - popupMenu([{ - text: i18n.locale.existingAccount, - action: () => { showSigninDialog(); }, - }, { - text: i18n.locale.createAccount, - action: () => { createAccount(); }, - }], ev.currentTarget || ev.target); - }, - }, { - type: 'link', - icon: 'fas fa-users', - text: i18n.locale.manageAccounts, - to: `/settings/accounts`, - }]], ev.currentTarget || ev.target, { - align: 'left' - }); -} - -// このファイルに書きたくないけどここに書かないと何故かVeturが認識しない -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $i: typeof $i; - } -} diff --git a/src/client/components/abuse-report-window.vue b/src/client/components/abuse-report-window.vue deleted file mode 100644 index 21a19385ae..0000000000 --- a/src/client/components/abuse-report-window.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/src/client/components/analog-clock.vue b/src/client/components/analog-clock.vue deleted file mode 100644 index bc572e5fff..0000000000 --- a/src/client/components/analog-clock.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue deleted file mode 100644 index e621b26229..0000000000 --- a/src/client/components/autocomplete.vue +++ /dev/null @@ -1,502 +0,0 @@ - - - - - diff --git a/src/client/components/avatars.vue b/src/client/components/avatars.vue deleted file mode 100644 index da862967dd..0000000000 --- a/src/client/components/avatars.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/src/client/components/captcha.vue b/src/client/components/captcha.vue deleted file mode 100644 index baa922506e..0000000000 --- a/src/client/components/captcha.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - diff --git a/src/client/components/channel-follow-button.vue b/src/client/components/channel-follow-button.vue deleted file mode 100644 index bd8627f6e8..0000000000 --- a/src/client/components/channel-follow-button.vue +++ /dev/null @@ -1,140 +0,0 @@ - - - - - diff --git a/src/client/components/channel-preview.vue b/src/client/components/channel-preview.vue deleted file mode 100644 index eb00052a78..0000000000 --- a/src/client/components/channel-preview.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - - - diff --git a/src/client/components/chart.vue b/src/client/components/chart.vue deleted file mode 100644 index ae9a5e79b1..0000000000 --- a/src/client/components/chart.vue +++ /dev/null @@ -1,691 +0,0 @@ - - - - - diff --git a/src/client/components/code-core.vue b/src/client/components/code-core.vue deleted file mode 100644 index 9cff7b4448..0000000000 --- a/src/client/components/code-core.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/src/client/components/code.vue b/src/client/components/code.vue deleted file mode 100644 index f5d6c5673a..0000000000 --- a/src/client/components/code.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/src/client/components/cw-button.vue b/src/client/components/cw-button.vue deleted file mode 100644 index 3a172f5d5e..0000000000 --- a/src/client/components/cw-button.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/src/client/components/date-separated-list.vue b/src/client/components/date-separated-list.vue deleted file mode 100644 index fa0b6d669c..0000000000 --- a/src/client/components/date-separated-list.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - diff --git a/src/client/components/debobigego/base.vue b/src/client/components/debobigego/base.vue deleted file mode 100644 index f551a3478b..0000000000 --- a/src/client/components/debobigego/base.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/button.vue b/src/client/components/debobigego/button.vue deleted file mode 100644 index b883e817a4..0000000000 --- a/src/client/components/debobigego/button.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/debobigego.scss b/src/client/components/debobigego/debobigego.scss deleted file mode 100644 index 833b656b66..0000000000 --- a/src/client/components/debobigego/debobigego.scss +++ /dev/null @@ -1,52 +0,0 @@ -._debobigegoPanel { - background: var(--panel); - border-radius: var(--radius); - transition: background 0.2s ease; - - &._debobigegoClickable { - &:hover { - //background: var(--panelHighlight); - } - - &:active { - background: var(--panelHighlight); - transition: background 0s; - } - } -} - -._debobigegoLabel, -._debobigegoCaption { - font-size: 80%; - color: var(--fgTransparentWeak); - - &:empty { - display: none; - } -} - -._debobigegoLabel { - position: sticky; - top: var(--stickyTop, 0px); - z-index: 2; - margin: -8px calc(var(--debobigegoXPadding) * -1) 0 calc(var(--debobigegoXPadding) * -1); - padding: 8px calc(var(--debobigegoContentHMargin) + var(--debobigegoXPadding)) 8px calc(var(--debobigegoContentHMargin) + var(--debobigegoXPadding)); - background: var(--X17); - -webkit-backdrop-filter: var(--blur, blur(10px)); - backdrop-filter: var(--blur, blur(10px)); -} - -._themeChanging_ ._debobigegoLabel { - transition: none !important; - background: transparent; -} - -._debobigegoCaption { - padding: 8px var(--debobigegoContentHMargin) 0 var(--debobigegoContentHMargin); -} - -._debobigegoItem { - & + ._debobigegoItem { - margin-top: 24px; - } -} diff --git a/src/client/components/debobigego/group.vue b/src/client/components/debobigego/group.vue deleted file mode 100644 index cba2c6ec94..0000000000 --- a/src/client/components/debobigego/group.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/info.vue b/src/client/components/debobigego/info.vue deleted file mode 100644 index 41afb03304..0000000000 --- a/src/client/components/debobigego/info.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/input.vue b/src/client/components/debobigego/input.vue deleted file mode 100644 index d113f04d27..0000000000 --- a/src/client/components/debobigego/input.vue +++ /dev/null @@ -1,292 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/key-value-view.vue b/src/client/components/debobigego/key-value-view.vue deleted file mode 100644 index 0e034a2d54..0000000000 --- a/src/client/components/debobigego/key-value-view.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/link.vue b/src/client/components/debobigego/link.vue deleted file mode 100644 index 885579eadf..0000000000 --- a/src/client/components/debobigego/link.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/object-view.vue b/src/client/components/debobigego/object-view.vue deleted file mode 100644 index ea79daa915..0000000000 --- a/src/client/components/debobigego/object-view.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/pagination.vue b/src/client/components/debobigego/pagination.vue deleted file mode 100644 index 2166f5065f..0000000000 --- a/src/client/components/debobigego/pagination.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/radios.vue b/src/client/components/debobigego/radios.vue deleted file mode 100644 index 071c013afb..0000000000 --- a/src/client/components/debobigego/radios.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - diff --git a/src/client/components/debobigego/range.vue b/src/client/components/debobigego/range.vue deleted file mode 100644 index 26fb0f37c6..0000000000 --- a/src/client/components/debobigego/range.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/select.vue b/src/client/components/debobigego/select.vue deleted file mode 100644 index 7a31371afc..0000000000 --- a/src/client/components/debobigego/select.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/suspense.vue b/src/client/components/debobigego/suspense.vue deleted file mode 100644 index e59e0ba12d..0000000000 --- a/src/client/components/debobigego/suspense.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/switch.vue b/src/client/components/debobigego/switch.vue deleted file mode 100644 index 9a69e18302..0000000000 --- a/src/client/components/debobigego/switch.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/textarea.vue b/src/client/components/debobigego/textarea.vue deleted file mode 100644 index 64e8d47126..0000000000 --- a/src/client/components/debobigego/textarea.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - - - diff --git a/src/client/components/debobigego/tuple.vue b/src/client/components/debobigego/tuple.vue deleted file mode 100644 index 8a4599fd64..0000000000 --- a/src/client/components/debobigego/tuple.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/client/components/dialog.vue b/src/client/components/dialog.vue deleted file mode 100644 index dd4932f61f..0000000000 --- a/src/client/components/dialog.vue +++ /dev/null @@ -1,212 +0,0 @@ - - - - - diff --git a/src/client/components/drive-file-thumbnail.vue b/src/client/components/drive-file-thumbnail.vue deleted file mode 100644 index 2cb1d98618..0000000000 --- a/src/client/components/drive-file-thumbnail.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - - - diff --git a/src/client/components/drive-select-dialog.vue b/src/client/components/drive-select-dialog.vue deleted file mode 100644 index ce6e2fa789..0000000000 --- a/src/client/components/drive-select-dialog.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - diff --git a/src/client/components/drive-window.vue b/src/client/components/drive-window.vue deleted file mode 100644 index 30b04091be..0000000000 --- a/src/client/components/drive-window.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/src/client/components/drive.file.vue b/src/client/components/drive.file.vue deleted file mode 100644 index b1be3d0cab..0000000000 --- a/src/client/components/drive.file.vue +++ /dev/null @@ -1,374 +0,0 @@ - - - - - diff --git a/src/client/components/drive.folder.vue b/src/client/components/drive.folder.vue deleted file mode 100644 index 4c09e7775a..0000000000 --- a/src/client/components/drive.folder.vue +++ /dev/null @@ -1,326 +0,0 @@ - - - - - diff --git a/src/client/components/drive.nav-folder.vue b/src/client/components/drive.nav-folder.vue deleted file mode 100644 index 913a1b5f92..0000000000 --- a/src/client/components/drive.nav-folder.vue +++ /dev/null @@ -1,135 +0,0 @@ - - - - - diff --git a/src/client/components/drive.vue b/src/client/components/drive.vue deleted file mode 100644 index 5dadf9a11f..0000000000 --- a/src/client/components/drive.vue +++ /dev/null @@ -1,784 +0,0 @@ - - - - - diff --git a/src/client/components/emoji-picker-dialog.vue b/src/client/components/emoji-picker-dialog.vue deleted file mode 100644 index aa17b8b250..0000000000 --- a/src/client/components/emoji-picker-dialog.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/src/client/components/emoji-picker-window.vue b/src/client/components/emoji-picker-window.vue deleted file mode 100644 index b7b884565b..0000000000 --- a/src/client/components/emoji-picker-window.vue +++ /dev/null @@ -1,197 +0,0 @@ - - - - - diff --git a/src/client/components/emoji-picker.section.vue b/src/client/components/emoji-picker.section.vue deleted file mode 100644 index 0ea3761429..0000000000 --- a/src/client/components/emoji-picker.section.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue deleted file mode 100644 index 85a12a08e6..0000000000 --- a/src/client/components/emoji-picker.vue +++ /dev/null @@ -1,501 +0,0 @@ - - - - - diff --git a/src/client/components/featured-photos.vue b/src/client/components/featured-photos.vue deleted file mode 100644 index c992a5d1fb..0000000000 --- a/src/client/components/featured-photos.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/src/client/components/file-type-icon.vue b/src/client/components/file-type-icon.vue deleted file mode 100644 index 95200b98c2..0000000000 --- a/src/client/components/file-type-icon.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/src/client/components/follow-button.vue b/src/client/components/follow-button.vue deleted file mode 100644 index 5eba9b1f6b..0000000000 --- a/src/client/components/follow-button.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - - - diff --git a/src/client/components/forgot-password.vue b/src/client/components/forgot-password.vue deleted file mode 100644 index 7fcf9aa720..0000000000 --- a/src/client/components/forgot-password.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/src/client/components/form-dialog.vue b/src/client/components/form-dialog.vue deleted file mode 100644 index 6353b7287e..0000000000 --- a/src/client/components/form-dialog.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - - - diff --git a/src/client/components/form/input.vue b/src/client/components/form/input.vue deleted file mode 100644 index 591eda9ed5..0000000000 --- a/src/client/components/form/input.vue +++ /dev/null @@ -1,315 +0,0 @@ - - - - - diff --git a/src/client/components/form/radio.vue b/src/client/components/form/radio.vue deleted file mode 100644 index 0f31d8fa0a..0000000000 --- a/src/client/components/form/radio.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/src/client/components/form/radios.vue b/src/client/components/form/radios.vue deleted file mode 100644 index 998a738202..0000000000 --- a/src/client/components/form/radios.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/src/client/components/form/range.vue b/src/client/components/form/range.vue deleted file mode 100644 index 4cfe66a8fc..0000000000 --- a/src/client/components/form/range.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - diff --git a/src/client/components/form/section.vue b/src/client/components/form/section.vue deleted file mode 100644 index 8eac40a0db..0000000000 --- a/src/client/components/form/section.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - - - diff --git a/src/client/components/form/select.vue b/src/client/components/form/select.vue deleted file mode 100644 index 363b3515fa..0000000000 --- a/src/client/components/form/select.vue +++ /dev/null @@ -1,312 +0,0 @@ - - - - - diff --git a/src/client/components/form/slot.vue b/src/client/components/form/slot.vue deleted file mode 100644 index 8580c1307d..0000000000 --- a/src/client/components/form/slot.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/src/client/components/form/switch.vue b/src/client/components/form/switch.vue deleted file mode 100644 index 85f8b7c870..0000000000 --- a/src/client/components/form/switch.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/src/client/components/form/textarea.vue b/src/client/components/form/textarea.vue deleted file mode 100644 index 048e9032df..0000000000 --- a/src/client/components/form/textarea.vue +++ /dev/null @@ -1,252 +0,0 @@ - - - - - diff --git a/src/client/components/formula-core.vue b/src/client/components/formula-core.vue deleted file mode 100644 index 6e35295ff5..0000000000 --- a/src/client/components/formula-core.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - diff --git a/src/client/components/formula.vue b/src/client/components/formula.vue deleted file mode 100644 index 6722ce38a1..0000000000 --- a/src/client/components/formula.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/src/client/components/gallery-post-preview.vue b/src/client/components/gallery-post-preview.vue deleted file mode 100644 index 5c3bdb1349..0000000000 --- a/src/client/components/gallery-post-preview.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - - - diff --git a/src/client/components/global/a.vue b/src/client/components/global/a.vue deleted file mode 100644 index 952dfb1841..0000000000 --- a/src/client/components/global/a.vue +++ /dev/null @@ -1,138 +0,0 @@ - - - diff --git a/src/client/components/global/acct.vue b/src/client/components/global/acct.vue deleted file mode 100644 index 70f2954cb0..0000000000 --- a/src/client/components/global/acct.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/src/client/components/global/ad.vue b/src/client/components/global/ad.vue deleted file mode 100644 index 8397b2229e..0000000000 --- a/src/client/components/global/ad.vue +++ /dev/null @@ -1,200 +0,0 @@ - - - - - diff --git a/src/client/components/global/avatar.vue b/src/client/components/global/avatar.vue deleted file mode 100644 index 395ed5d8ce..0000000000 --- a/src/client/components/global/avatar.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/client/components/global/ellipsis.vue b/src/client/components/global/ellipsis.vue deleted file mode 100644 index 0a46f486d6..0000000000 --- a/src/client/components/global/ellipsis.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/src/client/components/global/emoji.vue b/src/client/components/global/emoji.vue deleted file mode 100644 index f92e35c38f..0000000000 --- a/src/client/components/global/emoji.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - - - diff --git a/src/client/components/global/error.vue b/src/client/components/global/error.vue deleted file mode 100644 index 05a508a653..0000000000 --- a/src/client/components/global/error.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - - diff --git a/src/client/components/global/header.vue b/src/client/components/global/header.vue deleted file mode 100644 index 526db07fd3..0000000000 --- a/src/client/components/global/header.vue +++ /dev/null @@ -1,360 +0,0 @@ - - - - - diff --git a/src/client/components/global/i18n.ts b/src/client/components/global/i18n.ts deleted file mode 100644 index abf0c96856..0000000000 --- a/src/client/components/global/i18n.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { h, defineComponent } from 'vue'; - -export default defineComponent({ - props: { - src: { - type: String, - required: true, - }, - tag: { - type: String, - required: false, - default: 'span', - }, - textTag: { - type: String, - required: false, - default: null, - }, - }, - render() { - let str = this.src; - const parsed = [] as (string | { arg: string; })[]; - while (true) { - const nextBracketOpen = str.indexOf('{'); - const nextBracketClose = str.indexOf('}'); - - if (nextBracketOpen === -1) { - parsed.push(str); - break; - } else { - if (nextBracketOpen > 0) parsed.push(str.substr(0, nextBracketOpen)); - parsed.push({ - arg: str.substring(nextBracketOpen + 1, nextBracketClose) - }); - } - - str = str.substr(nextBracketClose + 1); - } - - return h(this.tag, parsed.map(x => typeof x === 'string' ? (this.textTag ? h(this.textTag, x) : x) : this.$slots[x.arg]())); - } -}); diff --git a/src/client/components/global/loading.vue b/src/client/components/global/loading.vue deleted file mode 100644 index 7bde53c12e..0000000000 --- a/src/client/components/global/loading.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - diff --git a/src/client/components/global/misskey-flavored-markdown.vue b/src/client/components/global/misskey-flavored-markdown.vue deleted file mode 100644 index c4f75bee93..0000000000 --- a/src/client/components/global/misskey-flavored-markdown.vue +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - diff --git a/src/client/components/global/spacer.vue b/src/client/components/global/spacer.vue deleted file mode 100644 index 1129d54c71..0000000000 --- a/src/client/components/global/spacer.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/src/client/components/global/sticky-container.vue b/src/client/components/global/sticky-container.vue deleted file mode 100644 index 859b2c1d73..0000000000 --- a/src/client/components/global/sticky-container.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/src/client/components/global/time.vue b/src/client/components/global/time.vue deleted file mode 100644 index 6a330a2307..0000000000 --- a/src/client/components/global/time.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/src/client/components/global/url.vue b/src/client/components/global/url.vue deleted file mode 100644 index 218729882d..0000000000 --- a/src/client/components/global/url.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - - - diff --git a/src/client/components/global/user-name.vue b/src/client/components/global/user-name.vue deleted file mode 100644 index bc93a8ea30..0000000000 --- a/src/client/components/global/user-name.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/src/client/components/google.vue b/src/client/components/google.vue deleted file mode 100644 index be724f038d..0000000000 --- a/src/client/components/google.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - diff --git a/src/client/components/image-viewer.vue b/src/client/components/image-viewer.vue deleted file mode 100644 index 7701ae926f..0000000000 --- a/src/client/components/image-viewer.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/src/client/components/img-with-blurhash.vue b/src/client/components/img-with-blurhash.vue deleted file mode 100644 index 7e80b00208..0000000000 --- a/src/client/components/img-with-blurhash.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/client/components/index.ts b/src/client/components/index.ts deleted file mode 100644 index 2340b228f8..0000000000 --- a/src/client/components/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { App } from 'vue'; - -import mfm from './global/misskey-flavored-markdown.vue'; -import a from './global/a.vue'; -import acct from './global/acct.vue'; -import avatar from './global/avatar.vue'; -import emoji from './global/emoji.vue'; -import userName from './global/user-name.vue'; -import ellipsis from './global/ellipsis.vue'; -import time from './global/time.vue'; -import url from './global/url.vue'; -import i18n from './global/i18n'; -import loading from './global/loading.vue'; -import error from './global/error.vue'; -import ad from './global/ad.vue'; -import header from './global/header.vue'; -import spacer from './global/spacer.vue'; -import stickyContainer from './global/sticky-container.vue'; - -export default function(app: App) { - app.component('I18n', i18n); - app.component('Mfm', mfm); - app.component('MkA', a); - app.component('MkAcct', acct); - app.component('MkAvatar', avatar); - app.component('MkEmoji', emoji); - app.component('MkUserName', userName); - app.component('MkEllipsis', ellipsis); - app.component('MkTime', time); - app.component('MkUrl', url); - app.component('MkLoading', loading); - app.component('MkError', error); - app.component('MkAd', ad); - app.component('MkHeader', header); - app.component('MkSpacer', spacer); - app.component('MkStickyContainer', stickyContainer); -} diff --git a/src/client/components/instance-stats.vue b/src/client/components/instance-stats.vue deleted file mode 100644 index fd0b75609f..0000000000 --- a/src/client/components/instance-stats.vue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - diff --git a/src/client/components/instance-ticker.vue b/src/client/components/instance-ticker.vue deleted file mode 100644 index 5674174558..0000000000 --- a/src/client/components/instance-ticker.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/src/client/components/launch-pad.vue b/src/client/components/launch-pad.vue deleted file mode 100644 index 9da62f1e0b..0000000000 --- a/src/client/components/launch-pad.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - - - diff --git a/src/client/components/link.vue b/src/client/components/link.vue deleted file mode 100644 index a887410331..0000000000 --- a/src/client/components/link.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - diff --git a/src/client/components/media-banner.vue b/src/client/components/media-banner.vue deleted file mode 100644 index 34065557bf..0000000000 --- a/src/client/components/media-banner.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/src/client/components/media-caption.vue b/src/client/components/media-caption.vue deleted file mode 100644 index b35b101d06..0000000000 --- a/src/client/components/media-caption.vue +++ /dev/null @@ -1,260 +0,0 @@ - - - - - diff --git a/src/client/components/media-image.vue b/src/client/components/media-image.vue deleted file mode 100644 index fd5e0b5f9b..0000000000 --- a/src/client/components/media-image.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - diff --git a/src/client/components/media-list.vue b/src/client/components/media-list.vue deleted file mode 100644 index c499525d84..0000000000 --- a/src/client/components/media-list.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - diff --git a/src/client/components/media-video.vue b/src/client/components/media-video.vue deleted file mode 100644 index 4d4a551653..0000000000 --- a/src/client/components/media-video.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/src/client/components/mention.vue b/src/client/components/mention.vue deleted file mode 100644 index 4c7030bf35..0000000000 --- a/src/client/components/mention.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - - - diff --git a/src/client/components/mfm.ts b/src/client/components/mfm.ts deleted file mode 100644 index ad6e711f6f..0000000000 --- a/src/client/components/mfm.ts +++ /dev/null @@ -1,321 +0,0 @@ -import { VNode, defineComponent, h } from 'vue'; -import * as mfm from 'mfm-js'; -import MkUrl from '@client/components/global/url.vue'; -import MkLink from '@client/components/link.vue'; -import MkMention from '@client/components/mention.vue'; -import MkEmoji from '@client/components/global/emoji.vue'; -import { concat } from '@client/../prelude/array'; -import MkFormula from '@client/components/formula.vue'; -import MkCode from '@client/components/code.vue'; -import MkGoogle from '@client/components/google.vue'; -import MkSparkle from '@client/components/sparkle.vue'; -import MkA from '@client/components/global/a.vue'; -import { host } from '@client/config'; -import { fnNameList } from '@/mfm/fn-name-list'; - -export default defineComponent({ - props: { - text: { - type: String, - required: true - }, - plain: { - type: Boolean, - default: false - }, - nowrap: { - type: Boolean, - default: false - }, - author: { - type: Object, - default: null - }, - i: { - type: Object, - default: null - }, - customEmojis: { - required: false, - }, - isNote: { - type: Boolean, - default: true - }, - }, - - render() { - if (this.text == null || this.text == '') return; - - const ast = (this.plain ? mfm.parsePlain : mfm.parse)(this.text, { fnNameList }); - - const validTime = (t: string | null | undefined) => { - if (t == null) return null; - return t.match(/^[0-9.]+s$/) ? t : null; - }; - - const genEl = (ast: mfm.MfmNode[]) => concat(ast.map((token): VNode[] => { - switch (token.type) { - case 'text': { - const text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n'); - - if (!this.plain) { - const res = []; - for (const t of text.split('\n')) { - res.push(h('br')); - res.push(t); - } - res.shift(); - return res; - } else { - return [text.replace(/\n/g, ' ')]; - } - } - - case 'bold': { - return [h('b', genEl(token.children))]; - } - - case 'strike': { - return [h('del', genEl(token.children))]; - } - - case 'italic': { - return h('i', { - style: 'font-style: oblique;' - }, genEl(token.children)); - } - - case 'fn': { - // TODO: CSSを文字列で組み立てていくと token.props.args.~~~ 経由でCSSインジェクションできるのでよしなにやる - let style; - switch (token.props.name) { - case 'tada': { - style = `font-size: 150%;` + (this.$store.state.animatedMfm ? 'animation: tada 1s linear infinite both;' : ''); - break; - } - case 'jelly': { - const speed = validTime(token.props.args.speed) || '1s'; - style = (this.$store.state.animatedMfm ? `animation: mfm-rubberBand ${speed} linear infinite both;` : ''); - break; - } - case 'twitch': { - const speed = validTime(token.props.args.speed) || '0.5s'; - style = this.$store.state.animatedMfm ? `animation: mfm-twitch ${speed} ease infinite;` : ''; - break; - } - case 'shake': { - const speed = validTime(token.props.args.speed) || '0.5s'; - style = this.$store.state.animatedMfm ? `animation: mfm-shake ${speed} ease infinite;` : ''; - break; - } - case 'spin': { - const direction = - token.props.args.left ? 'reverse' : - token.props.args.alternate ? 'alternate' : - 'normal'; - const anime = - token.props.args.x ? 'mfm-spinX' : - token.props.args.y ? 'mfm-spinY' : - 'mfm-spin'; - const speed = validTime(token.props.args.speed) || '1.5s'; - style = this.$store.state.animatedMfm ? `animation: ${anime} ${speed} linear infinite; animation-direction: ${direction};` : ''; - break; - } - case 'jump': { - style = this.$store.state.animatedMfm ? 'animation: mfm-jump 0.75s linear infinite;' : ''; - break; - } - case 'bounce': { - style = this.$store.state.animatedMfm ? 'animation: mfm-bounce 0.75s linear infinite; transform-origin: center bottom;' : ''; - break; - } - case 'flip': { - const transform = - (token.props.args.h && token.props.args.v) ? 'scale(-1, -1)' : - token.props.args.v ? 'scaleY(-1)' : - 'scaleX(-1)'; - style = `transform: ${transform};`; - break; - } - case 'x2': { - style = `font-size: 200%;`; - break; - } - case 'x3': { - style = `font-size: 400%;`; - break; - } - case 'x4': { - style = `font-size: 600%;`; - break; - } - case 'font': { - const family = - token.props.args.serif ? 'serif' : - token.props.args.monospace ? 'monospace' : - token.props.args.cursive ? 'cursive' : - token.props.args.fantasy ? 'fantasy' : - token.props.args.emoji ? 'emoji' : - token.props.args.math ? 'math' : - null; - if (family) style = `font-family: ${family};`; - break; - } - case 'blur': { - return h('span', { - class: '_mfm_blur_', - }, genEl(token.children)); - } - case 'rainbow': { - style = this.$store.state.animatedMfm ? 'animation: mfm-rainbow 1s linear infinite;' : ''; - break; - } - case 'sparkle': { - if (!this.$store.state.animatedMfm) { - return genEl(token.children); - } - let count = token.props.args.count ? parseInt(token.props.args.count) : 10; - if (count > 100) { - count = 100; - } - const speed = token.props.args.speed ? parseFloat(token.props.args.speed) : 1; - return h(MkSparkle, { - count, speed, - }, genEl(token.children)); - } - } - if (style == null) { - return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children), ']']); - } else { - return h('span', { - style: 'display: inline-block;' + style, - }, genEl(token.children)); - } - } - - case 'small': { - return [h('small', { - style: 'opacity: 0.7;' - }, genEl(token.children))]; - } - - case 'center': { - return [h('div', { - style: 'text-align:center;' - }, genEl(token.children))]; - } - - case 'url': { - return [h(MkUrl, { - key: Math.random(), - url: token.props.url, - rel: 'nofollow noopener', - })]; - } - - case 'link': { - return [h(MkLink, { - key: Math.random(), - url: token.props.url, - rel: 'nofollow noopener', - }, genEl(token.children))]; - } - - case 'mention': { - return [h(MkMention, { - key: Math.random(), - host: (token.props.host == null && this.author && this.author.host != null ? this.author.host : token.props.host) || host, - username: token.props.username - })]; - } - - case 'hashtag': { - return [h(MkA, { - key: Math.random(), - to: this.isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/explore/tags/${encodeURIComponent(token.props.hashtag)}`, - style: 'color:var(--hashtag);' - }, `#${token.props.hashtag}`)]; - } - - case 'blockCode': { - return [h(MkCode, { - key: Math.random(), - code: token.props.code, - lang: token.props.lang, - })]; - } - - case 'inlineCode': { - return [h(MkCode, { - key: Math.random(), - code: token.props.code, - inline: true - })]; - } - - case 'quote': { - if (!this.nowrap) { - return [h('div', { - class: 'quote' - }, genEl(token.children))]; - } else { - return [h('span', { - class: 'quote' - }, genEl(token.children))]; - } - } - - case 'emojiCode': { - return [h(MkEmoji, { - key: Math.random(), - emoji: `:${token.props.name}:`, - customEmojis: this.customEmojis, - normal: this.plain - })]; - } - - case 'unicodeEmoji': { - return [h(MkEmoji, { - key: Math.random(), - emoji: token.props.emoji, - customEmojis: this.customEmojis, - normal: this.plain - })]; - } - - case 'mathInline': { - return [h(MkFormula, { - key: Math.random(), - formula: token.props.formula, - block: false - })]; - } - - case 'mathBlock': { - return [h(MkFormula, { - key: Math.random(), - formula: token.props.formula, - block: true - })]; - } - - case 'search': { - return [h(MkGoogle, { - key: Math.random(), - q: token.props.query - })]; - } - - default: { - console.error('unrecognized ast type:', token.type); - - return []; - } - } - })); - - // Parse ast to DOM - return h('span', genEl(ast)); - } -}); diff --git a/src/client/components/mini-chart.vue b/src/client/components/mini-chart.vue deleted file mode 100644 index 0d01e4e4b5..0000000000 --- a/src/client/components/mini-chart.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/src/client/components/modal-page-window.vue b/src/client/components/modal-page-window.vue deleted file mode 100644 index e47d3dc62c..0000000000 --- a/src/client/components/modal-page-window.vue +++ /dev/null @@ -1,223 +0,0 @@ - - - - - diff --git a/src/client/components/note-detailed.vue b/src/client/components/note-detailed.vue deleted file mode 100644 index 568a2360d1..0000000000 --- a/src/client/components/note-detailed.vue +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - diff --git a/src/client/components/note-header.vue b/src/client/components/note-header.vue deleted file mode 100644 index 80bfea9b07..0000000000 --- a/src/client/components/note-header.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - - - diff --git a/src/client/components/note-preview.vue b/src/client/components/note-preview.vue deleted file mode 100644 index a474a01341..0000000000 --- a/src/client/components/note-preview.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - diff --git a/src/client/components/note-simple.vue b/src/client/components/note-simple.vue deleted file mode 100644 index 406a475cd9..0000000000 --- a/src/client/components/note-simple.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - diff --git a/src/client/components/note.sub.vue b/src/client/components/note.sub.vue deleted file mode 100644 index 157b65ec5c..0000000000 --- a/src/client/components/note.sub.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - diff --git a/src/client/components/note.vue b/src/client/components/note.vue deleted file mode 100644 index 681e819a22..0000000000 --- a/src/client/components/note.vue +++ /dev/null @@ -1,1228 +0,0 @@ - - - - - diff --git a/src/client/components/notes.vue b/src/client/components/notes.vue deleted file mode 100644 index 919cb29952..0000000000 --- a/src/client/components/notes.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - diff --git a/src/client/components/notification-setting-window.vue b/src/client/components/notification-setting-window.vue deleted file mode 100644 index 14e0b76cc6..0000000000 --- a/src/client/components/notification-setting-window.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - diff --git a/src/client/components/notification.vue b/src/client/components/notification.vue deleted file mode 100644 index ce1fa5b160..0000000000 --- a/src/client/components/notification.vue +++ /dev/null @@ -1,362 +0,0 @@ - - - - - diff --git a/src/client/components/notifications.vue b/src/client/components/notifications.vue deleted file mode 100644 index 78c1cce0c7..0000000000 --- a/src/client/components/notifications.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - - - diff --git a/src/client/components/number-diff.vue b/src/client/components/number-diff.vue deleted file mode 100644 index 690f89dd59..0000000000 --- a/src/client/components/number-diff.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - - diff --git a/src/client/components/page-preview.vue b/src/client/components/page-preview.vue deleted file mode 100644 index 090c4a6a6c..0000000000 --- a/src/client/components/page-preview.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - - - diff --git a/src/client/components/page-window.vue b/src/client/components/page-window.vue deleted file mode 100644 index bc7c5b7a19..0000000000 --- a/src/client/components/page-window.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.block.vue b/src/client/components/page/page.block.vue deleted file mode 100644 index ffd9ce89f9..0000000000 --- a/src/client/components/page/page.block.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/src/client/components/page/page.button.vue b/src/client/components/page/page.button.vue deleted file mode 100644 index c6ae675212..0000000000 --- a/src/client/components/page/page.button.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.canvas.vue b/src/client/components/page/page.canvas.vue deleted file mode 100644 index e26db597f2..0000000000 --- a/src/client/components/page/page.canvas.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.counter.vue b/src/client/components/page/page.counter.vue deleted file mode 100644 index dad7ac3da0..0000000000 --- a/src/client/components/page/page.counter.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.if.vue b/src/client/components/page/page.if.vue deleted file mode 100644 index a70525e07c..0000000000 --- a/src/client/components/page/page.if.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/src/client/components/page/page.image.vue b/src/client/components/page/page.image.vue deleted file mode 100644 index 14dedc98a0..0000000000 --- a/src/client/components/page/page.image.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.note.vue b/src/client/components/page/page.note.vue deleted file mode 100644 index 7a3f88bb1f..0000000000 --- a/src/client/components/page/page.note.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.number-input.vue b/src/client/components/page/page.number-input.vue deleted file mode 100644 index 5d9168f130..0000000000 --- a/src/client/components/page/page.number-input.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.post.vue b/src/client/components/page/page.post.vue deleted file mode 100644 index c20d7cade1..0000000000 --- a/src/client/components/page/page.post.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.radio-button.vue b/src/client/components/page/page.radio-button.vue deleted file mode 100644 index 590e59d706..0000000000 --- a/src/client/components/page/page.radio-button.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/src/client/components/page/page.section.vue b/src/client/components/page/page.section.vue deleted file mode 100644 index 81cab12501..0000000000 --- a/src/client/components/page/page.section.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.switch.vue b/src/client/components/page/page.switch.vue deleted file mode 100644 index 4d74e5df39..0000000000 --- a/src/client/components/page/page.switch.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.text-input.vue b/src/client/components/page/page.text-input.vue deleted file mode 100644 index 6e9ac0b543..0000000000 --- a/src/client/components/page/page.text-input.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.text.vue b/src/client/components/page/page.text.vue deleted file mode 100644 index 580c5a93bf..0000000000 --- a/src/client/components/page/page.text.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/src/client/components/page/page.textarea-input.vue b/src/client/components/page/page.textarea-input.vue deleted file mode 100644 index dfcb398937..0000000000 --- a/src/client/components/page/page.textarea-input.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/src/client/components/page/page.textarea.vue b/src/client/components/page/page.textarea.vue deleted file mode 100644 index cf953bf041..0000000000 --- a/src/client/components/page/page.textarea.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/src/client/components/page/page.vue b/src/client/components/page/page.vue deleted file mode 100644 index f125365c3d..0000000000 --- a/src/client/components/page/page.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - - - diff --git a/src/client/components/particle.vue b/src/client/components/particle.vue deleted file mode 100644 index d82705c1e8..0000000000 --- a/src/client/components/particle.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - - - diff --git a/src/client/components/poll-editor.vue b/src/client/components/poll-editor.vue deleted file mode 100644 index b28a1c8baa..0000000000 --- a/src/client/components/poll-editor.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - - - diff --git a/src/client/components/poll.vue b/src/client/components/poll.vue deleted file mode 100644 index b5d430f93b..0000000000 --- a/src/client/components/poll.vue +++ /dev/null @@ -1,174 +0,0 @@ - - - - - diff --git a/src/client/components/post-form-attaches.vue b/src/client/components/post-form-attaches.vue deleted file mode 100644 index 9365365653..0000000000 --- a/src/client/components/post-form-attaches.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - - - diff --git a/src/client/components/post-form-dialog.vue b/src/client/components/post-form-dialog.vue deleted file mode 100644 index aa23e3891e..0000000000 --- a/src/client/components/post-form-dialog.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue deleted file mode 100644 index 90df78895c..0000000000 --- a/src/client/components/post-form.vue +++ /dev/null @@ -1,980 +0,0 @@ - - - - - diff --git a/src/client/pages/messaging/messaging-room.message.vue b/src/client/pages/messaging/messaging-room.message.vue deleted file mode 100644 index a2740c0bdc..0000000000 --- a/src/client/pages/messaging/messaging-room.message.vue +++ /dev/null @@ -1,350 +0,0 @@ - - - - - diff --git a/src/client/pages/messaging/messaging-room.vue b/src/client/pages/messaging/messaging-room.vue deleted file mode 100644 index 76e58d5bc9..0000000000 --- a/src/client/pages/messaging/messaging-room.vue +++ /dev/null @@ -1,470 +0,0 @@ - - - - - diff --git a/src/client/pages/mfm-cheat-sheet.vue b/src/client/pages/mfm-cheat-sheet.vue deleted file mode 100644 index 5ff4317627..0000000000 --- a/src/client/pages/mfm-cheat-sheet.vue +++ /dev/null @@ -1,365 +0,0 @@ - - - - - diff --git a/src/client/pages/miauth.vue b/src/client/pages/miauth.vue deleted file mode 100644 index 39cd832838..0000000000 --- a/src/client/pages/miauth.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/client/pages/my-antennas/create.vue b/src/client/pages/my-antennas/create.vue deleted file mode 100644 index d4762411e7..0000000000 --- a/src/client/pages/my-antennas/create.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/src/client/pages/my-antennas/edit.vue b/src/client/pages/my-antennas/edit.vue deleted file mode 100644 index 9deafb4235..0000000000 --- a/src/client/pages/my-antennas/edit.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - - - diff --git a/src/client/pages/my-antennas/editor.vue b/src/client/pages/my-antennas/editor.vue deleted file mode 100644 index 93ab640030..0000000000 --- a/src/client/pages/my-antennas/editor.vue +++ /dev/null @@ -1,190 +0,0 @@ - - - - - diff --git a/src/client/pages/my-antennas/index.vue b/src/client/pages/my-antennas/index.vue deleted file mode 100644 index c27bb2c15e..0000000000 --- a/src/client/pages/my-antennas/index.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/client/pages/my-clips/index.vue b/src/client/pages/my-clips/index.vue deleted file mode 100644 index c4ca474748..0000000000 --- a/src/client/pages/my-clips/index.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - diff --git a/src/client/pages/my-groups/group.vue b/src/client/pages/my-groups/group.vue deleted file mode 100644 index bd5537cbfa..0000000000 --- a/src/client/pages/my-groups/group.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - - diff --git a/src/client/pages/my-groups/index.vue b/src/client/pages/my-groups/index.vue deleted file mode 100644 index 34f82f8a71..0000000000 --- a/src/client/pages/my-groups/index.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - diff --git a/src/client/pages/my-lists/index.vue b/src/client/pages/my-lists/index.vue deleted file mode 100644 index 687e9e630e..0000000000 --- a/src/client/pages/my-lists/index.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - diff --git a/src/client/pages/my-lists/list.vue b/src/client/pages/my-lists/list.vue deleted file mode 100644 index 049d370b4e..0000000000 --- a/src/client/pages/my-lists/list.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - - - diff --git a/src/client/pages/not-found.vue b/src/client/pages/not-found.vue deleted file mode 100644 index 5e7fe17f75..0000000000 --- a/src/client/pages/not-found.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/src/client/pages/note.vue b/src/client/pages/note.vue deleted file mode 100644 index 8e95430d67..0000000000 --- a/src/client/pages/note.vue +++ /dev/null @@ -1,209 +0,0 @@ - - - - - diff --git a/src/client/pages/notifications.vue b/src/client/pages/notifications.vue deleted file mode 100644 index 8d6adec48d..0000000000 --- a/src/client/pages/notifications.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.button.vue b/src/client/pages/page-editor/els/page-editor.el.button.vue deleted file mode 100644 index 85e9d7e711..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.button.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.canvas.vue b/src/client/pages/page-editor/els/page-editor.el.canvas.vue deleted file mode 100644 index c40d69a7c1..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.canvas.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.counter.vue b/src/client/pages/page-editor/els/page-editor.el.counter.vue deleted file mode 100644 index de7994e3ba..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.counter.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.if.vue b/src/client/pages/page-editor/els/page-editor.el.if.vue deleted file mode 100644 index 52f4dac22e..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.if.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.image.vue b/src/client/pages/page-editor/els/page-editor.el.image.vue deleted file mode 100644 index d96879f50d..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.image.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.note.vue b/src/client/pages/page-editor/els/page-editor.el.note.vue deleted file mode 100644 index 9feec395b7..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.note.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.number-input.vue b/src/client/pages/page-editor/els/page-editor.el.number-input.vue deleted file mode 100644 index 57b1397824..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.number-input.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.post.vue b/src/client/pages/page-editor/els/page-editor.el.post.vue deleted file mode 100644 index e21ccfd345..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.post.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.radio-button.vue b/src/client/pages/page-editor/els/page-editor.el.radio-button.vue deleted file mode 100644 index 62fb231f79..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.radio-button.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.section.vue b/src/client/pages/page-editor/els/page-editor.el.section.vue deleted file mode 100644 index 75bdf120c0..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.section.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.switch.vue b/src/client/pages/page-editor/els/page-editor.el.switch.vue deleted file mode 100644 index cf15f58c82..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.switch.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.text-input.vue b/src/client/pages/page-editor/els/page-editor.el.text-input.vue deleted file mode 100644 index 210199befd..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.text-input.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.text.vue b/src/client/pages/page-editor/els/page-editor.el.text.vue deleted file mode 100644 index 668dd5f52d..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.text.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.textarea-input.vue b/src/client/pages/page-editor/els/page-editor.el.textarea-input.vue deleted file mode 100644 index 14f36db2a1..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.textarea-input.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/els/page-editor.el.textarea.vue b/src/client/pages/page-editor/els/page-editor.el.textarea.vue deleted file mode 100644 index a29d5bd3f2..0000000000 --- a/src/client/pages/page-editor/els/page-editor.el.textarea.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/page-editor.blocks.vue b/src/client/pages/page-editor/page-editor.blocks.vue deleted file mode 100644 index c27162a26e..0000000000 --- a/src/client/pages/page-editor/page-editor.blocks.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/src/client/pages/page-editor/page-editor.container.vue b/src/client/pages/page-editor/page-editor.container.vue deleted file mode 100644 index afd261fac7..0000000000 --- a/src/client/pages/page-editor/page-editor.container.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/page-editor.script-block.vue b/src/client/pages/page-editor/page-editor.script-block.vue deleted file mode 100644 index 3313fc1ba9..0000000000 --- a/src/client/pages/page-editor/page-editor.script-block.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - - - diff --git a/src/client/pages/page-editor/page-editor.vue b/src/client/pages/page-editor/page-editor.vue deleted file mode 100644 index aefcc14564..0000000000 --- a/src/client/pages/page-editor/page-editor.vue +++ /dev/null @@ -1,561 +0,0 @@ - - - - - diff --git a/src/client/pages/page.vue b/src/client/pages/page.vue deleted file mode 100644 index 3ea687a35d..0000000000 --- a/src/client/pages/page.vue +++ /dev/null @@ -1,311 +0,0 @@ - - - - - diff --git a/src/client/pages/pages.vue b/src/client/pages/pages.vue deleted file mode 100644 index 6963682592..0000000000 --- a/src/client/pages/pages.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - diff --git a/src/client/pages/preview.vue b/src/client/pages/preview.vue deleted file mode 100644 index 3df446e676..0000000000 --- a/src/client/pages/preview.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/src/client/pages/reset-password.vue b/src/client/pages/reset-password.vue deleted file mode 100644 index 6dd9f24259..0000000000 --- a/src/client/pages/reset-password.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/src/client/pages/reversi/game.board.vue b/src/client/pages/reversi/game.board.vue deleted file mode 100644 index 0dd36faced..0000000000 --- a/src/client/pages/reversi/game.board.vue +++ /dev/null @@ -1,528 +0,0 @@ - - - - - diff --git a/src/client/pages/reversi/game.setting.vue b/src/client/pages/reversi/game.setting.vue deleted file mode 100644 index eb6f24e4ab..0000000000 --- a/src/client/pages/reversi/game.setting.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - diff --git a/src/client/pages/reversi/game.vue b/src/client/pages/reversi/game.vue deleted file mode 100644 index ae10b45b5b..0000000000 --- a/src/client/pages/reversi/game.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - diff --git a/src/client/pages/reversi/index.vue b/src/client/pages/reversi/index.vue deleted file mode 100644 index cedfd12089..0000000000 --- a/src/client/pages/reversi/index.vue +++ /dev/null @@ -1,279 +0,0 @@ - - - - - diff --git a/src/client/pages/room/preview.vue b/src/client/pages/room/preview.vue deleted file mode 100644 index 0cb6bcf04c..0000000000 --- a/src/client/pages/room/preview.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/src/client/pages/room/room.vue b/src/client/pages/room/room.vue deleted file mode 100644 index 671dca3577..0000000000 --- a/src/client/pages/room/room.vue +++ /dev/null @@ -1,285 +0,0 @@ - - - - - diff --git a/src/client/pages/scratchpad.vue b/src/client/pages/scratchpad.vue deleted file mode 100644 index 99164ec51f..0000000000 --- a/src/client/pages/scratchpad.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - diff --git a/src/client/pages/search.vue b/src/client/pages/search.vue deleted file mode 100644 index 8cf4d32a8f..0000000000 --- a/src/client/pages/search.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - diff --git a/src/client/pages/settings/2fa.vue b/src/client/pages/settings/2fa.vue deleted file mode 100644 index 386e7c635a..0000000000 --- a/src/client/pages/settings/2fa.vue +++ /dev/null @@ -1,247 +0,0 @@ - - - diff --git a/src/client/pages/settings/account-info.vue b/src/client/pages/settings/account-info.vue deleted file mode 100644 index 16ce91b12f..0000000000 --- a/src/client/pages/settings/account-info.vue +++ /dev/null @@ -1,185 +0,0 @@ - - - diff --git a/src/client/pages/settings/accounts.vue b/src/client/pages/settings/accounts.vue deleted file mode 100644 index d2966cc216..0000000000 --- a/src/client/pages/settings/accounts.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/api.vue b/src/client/pages/settings/api.vue deleted file mode 100644 index 5c7496e2f9..0000000000 --- a/src/client/pages/settings/api.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/src/client/pages/settings/apps.vue b/src/client/pages/settings/apps.vue deleted file mode 100644 index da4f672adf..0000000000 --- a/src/client/pages/settings/apps.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/custom-css.vue b/src/client/pages/settings/custom-css.vue deleted file mode 100644 index fd473a11fa..0000000000 --- a/src/client/pages/settings/custom-css.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/src/client/pages/settings/deck.vue b/src/client/pages/settings/deck.vue deleted file mode 100644 index e4b5c697c4..0000000000 --- a/src/client/pages/settings/deck.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/src/client/pages/settings/delete-account.vue b/src/client/pages/settings/delete-account.vue deleted file mode 100644 index 6bac214e04..0000000000 --- a/src/client/pages/settings/delete-account.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - diff --git a/src/client/pages/settings/drive.vue b/src/client/pages/settings/drive.vue deleted file mode 100644 index 2d73eb4df7..0000000000 --- a/src/client/pages/settings/drive.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/email-address.vue b/src/client/pages/settings/email-address.vue deleted file mode 100644 index f98b22ada7..0000000000 --- a/src/client/pages/settings/email-address.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - diff --git a/src/client/pages/settings/email-notification.vue b/src/client/pages/settings/email-notification.vue deleted file mode 100644 index 1b78621c3f..0000000000 --- a/src/client/pages/settings/email-notification.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - diff --git a/src/client/pages/settings/email.vue b/src/client/pages/settings/email.vue deleted file mode 100644 index adc62133ac..0000000000 --- a/src/client/pages/settings/email.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - diff --git a/src/client/pages/settings/experimental-features.vue b/src/client/pages/settings/experimental-features.vue deleted file mode 100644 index 971c45a628..0000000000 --- a/src/client/pages/settings/experimental-features.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/src/client/pages/settings/general.vue b/src/client/pages/settings/general.vue deleted file mode 100644 index 59dd251948..0000000000 --- a/src/client/pages/settings/general.vue +++ /dev/null @@ -1,223 +0,0 @@ - - - diff --git a/src/client/pages/settings/import-export.vue b/src/client/pages/settings/import-export.vue deleted file mode 100644 index eeaa1f1602..0000000000 --- a/src/client/pages/settings/import-export.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/index.vue b/src/client/pages/settings/index.vue deleted file mode 100644 index cf053dbe63..0000000000 --- a/src/client/pages/settings/index.vue +++ /dev/null @@ -1,326 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/integration.vue b/src/client/pages/settings/integration.vue deleted file mode 100644 index 7f398dde9d..0000000000 --- a/src/client/pages/settings/integration.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - diff --git a/src/client/pages/settings/menu.vue b/src/client/pages/settings/menu.vue deleted file mode 100644 index 31472eb0c1..0000000000 --- a/src/client/pages/settings/menu.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - diff --git a/src/client/pages/settings/mute-block.vue b/src/client/pages/settings/mute-block.vue deleted file mode 100644 index 18b2fc0af4..0000000000 --- a/src/client/pages/settings/mute-block.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - diff --git a/src/client/pages/settings/notifications.vue b/src/client/pages/settings/notifications.vue deleted file mode 100644 index 5f84349474..0000000000 --- a/src/client/pages/settings/notifications.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/src/client/pages/settings/other.vue b/src/client/pages/settings/other.vue deleted file mode 100644 index 2eb922453f..0000000000 --- a/src/client/pages/settings/other.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/src/client/pages/settings/plugin.install.vue b/src/client/pages/settings/plugin.install.vue deleted file mode 100644 index 709ef11abb..0000000000 --- a/src/client/pages/settings/plugin.install.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - diff --git a/src/client/pages/settings/plugin.manage.vue b/src/client/pages/settings/plugin.manage.vue deleted file mode 100644 index f1c27f1e3c..0000000000 --- a/src/client/pages/settings/plugin.manage.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/plugin.vue b/src/client/pages/settings/plugin.vue deleted file mode 100644 index 23f263bbbd..0000000000 --- a/src/client/pages/settings/plugin.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/privacy.vue b/src/client/pages/settings/privacy.vue deleted file mode 100644 index 5e0c259ca3..0000000000 --- a/src/client/pages/settings/privacy.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/src/client/pages/settings/profile.vue b/src/client/pages/settings/profile.vue deleted file mode 100644 index b993b5fc72..0000000000 --- a/src/client/pages/settings/profile.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/reaction.vue b/src/client/pages/settings/reaction.vue deleted file mode 100644 index a5ff46097d..0000000000 --- a/src/client/pages/settings/reaction.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/registry.keys.vue b/src/client/pages/settings/registry.keys.vue deleted file mode 100644 index d99002e50f..0000000000 --- a/src/client/pages/settings/registry.keys.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - diff --git a/src/client/pages/settings/registry.value.vue b/src/client/pages/settings/registry.value.vue deleted file mode 100644 index 06be5737e9..0000000000 --- a/src/client/pages/settings/registry.value.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - diff --git a/src/client/pages/settings/registry.vue b/src/client/pages/settings/registry.vue deleted file mode 100644 index e4fb230d5c..0000000000 --- a/src/client/pages/settings/registry.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/src/client/pages/settings/security.vue b/src/client/pages/settings/security.vue deleted file mode 100644 index e051685a82..0000000000 --- a/src/client/pages/settings/security.vue +++ /dev/null @@ -1,158 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/sounds.vue b/src/client/pages/settings/sounds.vue deleted file mode 100644 index 07310619c8..0000000000 --- a/src/client/pages/settings/sounds.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - diff --git a/src/client/pages/settings/theme.install.vue b/src/client/pages/settings/theme.install.vue deleted file mode 100644 index 9fbb28929d..0000000000 --- a/src/client/pages/settings/theme.install.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - diff --git a/src/client/pages/settings/theme.manage.vue b/src/client/pages/settings/theme.manage.vue deleted file mode 100644 index 1a11a664f0..0000000000 --- a/src/client/pages/settings/theme.manage.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - diff --git a/src/client/pages/settings/theme.vue b/src/client/pages/settings/theme.vue deleted file mode 100644 index c6be42251c..0000000000 --- a/src/client/pages/settings/theme.vue +++ /dev/null @@ -1,424 +0,0 @@ - - - - - diff --git a/src/client/pages/settings/update.vue b/src/client/pages/settings/update.vue deleted file mode 100644 index 8bc459e936..0000000000 --- a/src/client/pages/settings/update.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/src/client/pages/settings/word-mute.vue b/src/client/pages/settings/word-mute.vue deleted file mode 100644 index 53948b1b1e..0000000000 --- a/src/client/pages/settings/word-mute.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - diff --git a/src/client/pages/share.vue b/src/client/pages/share.vue deleted file mode 100644 index cb7347fae6..0000000000 --- a/src/client/pages/share.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - - diff --git a/src/client/pages/signup-complete.vue b/src/client/pages/signup-complete.vue deleted file mode 100644 index dada92031a..0000000000 --- a/src/client/pages/signup-complete.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/src/client/pages/tag.vue b/src/client/pages/tag.vue deleted file mode 100644 index 3ca9fe5c0c..0000000000 --- a/src/client/pages/tag.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - diff --git a/src/client/pages/test.vue b/src/client/pages/test.vue deleted file mode 100644 index fbab0112ed..0000000000 --- a/src/client/pages/test.vue +++ /dev/null @@ -1,259 +0,0 @@ - - - diff --git a/src/client/pages/theme-editor.vue b/src/client/pages/theme-editor.vue deleted file mode 100644 index 3b10396ab8..0000000000 --- a/src/client/pages/theme-editor.vue +++ /dev/null @@ -1,306 +0,0 @@ - - - - - diff --git a/src/client/pages/timeline.tutorial.vue b/src/client/pages/timeline.tutorial.vue deleted file mode 100644 index 4d10289fbf..0000000000 --- a/src/client/pages/timeline.tutorial.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/src/client/pages/timeline.vue b/src/client/pages/timeline.vue deleted file mode 100644 index 7b17d585f8..0000000000 --- a/src/client/pages/timeline.vue +++ /dev/null @@ -1,225 +0,0 @@ - - - - - diff --git a/src/client/pages/user-ap-info.vue b/src/client/pages/user-ap-info.vue deleted file mode 100644 index cbdff874ed..0000000000 --- a/src/client/pages/user-ap-info.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - diff --git a/src/client/pages/user-info.vue b/src/client/pages/user-info.vue deleted file mode 100644 index bf67fc853a..0000000000 --- a/src/client/pages/user-info.vue +++ /dev/null @@ -1,245 +0,0 @@ - - - - - diff --git a/src/client/pages/user-list-timeline.vue b/src/client/pages/user-list-timeline.vue deleted file mode 100644 index b5e37d4843..0000000000 --- a/src/client/pages/user-list-timeline.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - - - diff --git a/src/client/pages/user/clips.vue b/src/client/pages/user/clips.vue deleted file mode 100644 index 53ee554383..0000000000 --- a/src/client/pages/user/clips.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/src/client/pages/user/follow-list.vue b/src/client/pages/user/follow-list.vue deleted file mode 100644 index 1f5ab5993c..0000000000 --- a/src/client/pages/user/follow-list.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/src/client/pages/user/gallery.vue b/src/client/pages/user/gallery.vue deleted file mode 100644 index c21b3e6428..0000000000 --- a/src/client/pages/user/gallery.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - - - diff --git a/src/client/pages/user/index.activity.vue b/src/client/pages/user/index.activity.vue deleted file mode 100644 index be85c252e8..0000000000 --- a/src/client/pages/user/index.activity.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/src/client/pages/user/index.photos.vue b/src/client/pages/user/index.photos.vue deleted file mode 100644 index 5029c3feec..0000000000 --- a/src/client/pages/user/index.photos.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/src/client/pages/user/index.timeline.vue b/src/client/pages/user/index.timeline.vue deleted file mode 100644 index c3444f26f6..0000000000 --- a/src/client/pages/user/index.timeline.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/src/client/pages/user/index.vue b/src/client/pages/user/index.vue deleted file mode 100644 index 04585f3fd0..0000000000 --- a/src/client/pages/user/index.vue +++ /dev/null @@ -1,829 +0,0 @@ - - - - - diff --git a/src/client/pages/user/pages.vue b/src/client/pages/user/pages.vue deleted file mode 100644 index ece418cf62..0000000000 --- a/src/client/pages/user/pages.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - diff --git a/src/client/pages/user/reactions.vue b/src/client/pages/user/reactions.vue deleted file mode 100644 index 5ac7e01027..0000000000 --- a/src/client/pages/user/reactions.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/src/client/pages/v.vue b/src/client/pages/v.vue deleted file mode 100644 index 4440e8070e..0000000000 --- a/src/client/pages/v.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/src/client/pages/welcome.entrance.a.vue b/src/client/pages/welcome.entrance.a.vue deleted file mode 100644 index 8e26682cf8..0000000000 --- a/src/client/pages/welcome.entrance.a.vue +++ /dev/null @@ -1,320 +0,0 @@ - - - - - diff --git a/src/client/pages/welcome.entrance.b.vue b/src/client/pages/welcome.entrance.b.vue deleted file mode 100644 index 9dc7289b4d..0000000000 --- a/src/client/pages/welcome.entrance.b.vue +++ /dev/null @@ -1,236 +0,0 @@ - - - - - diff --git a/src/client/pages/welcome.entrance.c.vue b/src/client/pages/welcome.entrance.c.vue deleted file mode 100644 index a946df86d2..0000000000 --- a/src/client/pages/welcome.entrance.c.vue +++ /dev/null @@ -1,305 +0,0 @@ - - - - - diff --git a/src/client/pages/welcome.setup.vue b/src/client/pages/welcome.setup.vue deleted file mode 100644 index dfefecc8fa..0000000000 --- a/src/client/pages/welcome.setup.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/src/client/pages/welcome.timeline.vue b/src/client/pages/welcome.timeline.vue deleted file mode 100644 index bd07ac78db..0000000000 --- a/src/client/pages/welcome.timeline.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - diff --git a/src/client/pages/welcome.vue b/src/client/pages/welcome.vue deleted file mode 100644 index b6a715830d..0000000000 --- a/src/client/pages/welcome.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/src/client/pizzax.ts b/src/client/pizzax.ts deleted file mode 100644 index 396abc2418..0000000000 --- a/src/client/pizzax.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { onUnmounted, Ref, ref, watch } from 'vue'; -import { $i } from './account'; -import { api } from './os'; - -type StateDef = Record; - -type ArrayElement = A extends readonly (infer T)[] ? T : never; - -export class Storage { - public readonly key: string; - public readonly keyForLocalStorage: string; - - public readonly def: T; - - // TODO: これが実装されたらreadonlyにしたい: https://github.com/microsoft/TypeScript/issues/37487 - public readonly state: { [K in keyof T]: T[K]['default'] }; - public readonly reactiveState: { [K in keyof T]: Ref }; - - constructor(key: string, def: T) { - this.key = key; - this.keyForLocalStorage = 'pizzax::' + key; - this.def = def; - - // TODO: indexedDBにする - const deviceState = JSON.parse(localStorage.getItem(this.keyForLocalStorage) || '{}'); - const deviceAccountState = $i ? JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::' + $i.id) || '{}') : {}; - const registryCache = $i ? JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::cache::' + $i.id) || '{}') : {}; - - const state = {}; - const reactiveState = {}; - for (const [k, v] of Object.entries(def)) { - if (v.where === 'device' && Object.prototype.hasOwnProperty.call(deviceState, k)) { - state[k] = deviceState[k]; - } else if (v.where === 'account' && $i && Object.prototype.hasOwnProperty.call(registryCache, k)) { - state[k] = registryCache[k]; - } else if (v.where === 'deviceAccount' && Object.prototype.hasOwnProperty.call(deviceAccountState, k)) { - state[k] = deviceAccountState[k]; - } else { - state[k] = v.default; - if (_DEV_) console.log('Use default value', k, v.default); - } - } - for (const [k, v] of Object.entries(state)) { - reactiveState[k] = ref(v); - } - this.state = state as any; - this.reactiveState = reactiveState as any; - - if ($i) { - // なぜかsetTimeoutしないとapi関数内でエラーになる(おそらく循環参照してることに原因がありそう) - setTimeout(() => { - api('i/registry/get-all', { scope: ['client', this.key] }).then(kvs => { - const cache = {}; - for (const [k, v] of Object.entries(def)) { - if (v.where === 'account') { - if (Object.prototype.hasOwnProperty.call(kvs, k)) { - state[k] = kvs[k]; - reactiveState[k].value = kvs[k]; - cache[k] = kvs[k]; - } else { - state[k] = v.default; - reactiveState[k].value = v.default; - } - } - } - localStorage.setItem(this.keyForLocalStorage + '::cache::' + $i.id, JSON.stringify(cache)); - }); - }, 1); - - // TODO: streamingのuser storage updateイベントを監視して更新 - } - } - - public set(key: K, value: T[K]['default']): void { - if (_DEV_) console.log('set', key, value); - - this.state[key] = value; - this.reactiveState[key].value = value; - - switch (this.def[key].where) { - case 'device': { - const deviceState = JSON.parse(localStorage.getItem(this.keyForLocalStorage) || '{}'); - deviceState[key] = value; - localStorage.setItem(this.keyForLocalStorage, JSON.stringify(deviceState)); - break; - } - case 'deviceAccount': { - if ($i == null) break; - const deviceAccountState = JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::' + $i.id) || '{}'); - deviceAccountState[key] = value; - localStorage.setItem(this.keyForLocalStorage + '::' + $i.id, JSON.stringify(deviceAccountState)); - break; - } - case 'account': { - if ($i == null) break; - const cache = JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::cache::' + $i.id) || '{}'); - cache[key] = value; - localStorage.setItem(this.keyForLocalStorage + '::cache::' + $i.id, JSON.stringify(cache)); - api('i/registry/set', { - scope: ['client', this.key], - key: key, - value: value - }); - break; - } - } - } - - public push(key: K, value: ArrayElement): void { - const currentState = this.state[key]; - this.set(key, [...currentState, value]); - } - - public reset(key: keyof T) { - this.set(key, this.def[key].default); - } - - /** - * 特定のキーの、簡易的なgetter/setterを作ります - * 主にvue場で設定コントロールのmodelとして使う用 - */ - public makeGetterSetter(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]) { - const valueRef = ref(this.state[key]); - - const stop = watch(this.reactiveState[key], val => { - valueRef.value = val; - }); - - // NOTE: vueコンポーネント内で呼ばれない限りは、onUnmounted は無意味なのでメモリリークする - onUnmounted(() => { - stop(); - }); - - // TODO: VueのcustomRef使うと良い感じになるかも - return { - get: () => { - if (getter) { - return getter(valueRef.value); - } else { - return valueRef.value; - } - }, - set: (value: unknown) => { - const val = setter ? setter(value) : value; - this.set(key, val); - valueRef.value = val; - } - }; - } -} diff --git a/src/client/plugin.ts b/src/client/plugin.ts deleted file mode 100644 index 6bdc4fe4d5..0000000000 --- a/src/client/plugin.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { AiScript, utils, values } from '@syuilo/aiscript'; -import { deserialize } from '@syuilo/aiscript/built/serializer'; -import { jsToVal } from '@syuilo/aiscript/built/interpreter/util'; -import { createAiScriptEnv } from '@client/scripts/aiscript/api'; -import { dialog } from '@client/os'; -import { noteActions, notePostInterruptors, noteViewInterruptors, postFormActions, userActions } from '@client/store'; - -const pluginContexts = new Map(); - -export function install(plugin) { - console.info('Plugin installed:', plugin.name, 'v' + plugin.version); - - const aiscript = new AiScript(createPluginEnv({ - plugin: plugin, - storageKey: 'plugins:' + plugin.id - }), { - in: (q) => { - return new Promise(ok => { - dialog({ - title: q, - input: {} - }).then(({ canceled, result: a }) => { - ok(a); - }); - }); - }, - out: (value) => { - console.log(value); - }, - log: (type, params) => { - }, - }); - - initPlugin({ plugin, aiscript }); - - aiscript.exec(deserialize(plugin.ast)); -} - -function createPluginEnv(opts) { - const config = new Map(); - for (const [k, v] of Object.entries(opts.plugin.config || {})) { - config.set(k, jsToVal(opts.plugin.configData.hasOwnProperty(k) ? opts.plugin.configData[k] : v.default)); - } - - return { - ...createAiScriptEnv({ ...opts, token: opts.plugin.token }), - //#region Deprecated - 'Mk:register_post_form_action': values.FN_NATIVE(([title, handler]) => { - registerPostFormAction({ pluginId: opts.plugin.id, title: title.value, handler }); - }), - 'Mk:register_user_action': values.FN_NATIVE(([title, handler]) => { - registerUserAction({ pluginId: opts.plugin.id, title: title.value, handler }); - }), - 'Mk:register_note_action': values.FN_NATIVE(([title, handler]) => { - registerNoteAction({ pluginId: opts.plugin.id, title: title.value, handler }); - }), - //#endregion - 'Plugin:register_post_form_action': values.FN_NATIVE(([title, handler]) => { - registerPostFormAction({ pluginId: opts.plugin.id, title: title.value, handler }); - }), - 'Plugin:register_user_action': values.FN_NATIVE(([title, handler]) => { - registerUserAction({ pluginId: opts.plugin.id, title: title.value, handler }); - }), - 'Plugin:register_note_action': values.FN_NATIVE(([title, handler]) => { - registerNoteAction({ pluginId: opts.plugin.id, title: title.value, handler }); - }), - 'Plugin:register_note_view_interruptor': values.FN_NATIVE(([handler]) => { - registerNoteViewInterruptor({ pluginId: opts.plugin.id, handler }); - }), - 'Plugin:register_note_post_interruptor': values.FN_NATIVE(([handler]) => { - registerNotePostInterruptor({ pluginId: opts.plugin.id, handler }); - }), - 'Plugin:open_url': values.FN_NATIVE(([url]) => { - window.open(url.value, '_blank'); - }), - 'Plugin:config': values.OBJ(config), - }; -} - -function initPlugin({ plugin, aiscript }) { - pluginContexts.set(plugin.id, aiscript); -} - -function registerPostFormAction({ pluginId, title, handler }) { - postFormActions.push({ - title, handler: (form, update) => { - pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(form), values.FN_NATIVE(([key, value]) => { - update(key.value, value.value); - })]); - } - }); -} - -function registerUserAction({ pluginId, title, handler }) { - userActions.push({ - title, handler: (user) => { - pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(user)]); - } - }); -} - -function registerNoteAction({ pluginId, title, handler }) { - noteActions.push({ - title, handler: (note) => { - pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]); - } - }); -} - -function registerNoteViewInterruptor({ pluginId, handler }) { - noteViewInterruptors.push({ - handler: async (note) => { - return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)])); - } - }); -} - -function registerNotePostInterruptor({ pluginId, handler }) { - notePostInterruptors.push({ - handler: async (note) => { - return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)])); - } - }); -} diff --git a/src/client/router.ts b/src/client/router.ts deleted file mode 100644 index d57babffe5..0000000000 --- a/src/client/router.ts +++ /dev/null @@ -1,149 +0,0 @@ -import { defineAsyncComponent, markRaw } from 'vue'; -import { createRouter, createWebHistory } from 'vue-router'; -import MkLoading from '@client/pages/_loading_.vue'; -import MkError from '@client/pages/_error_.vue'; -import MkTimeline from '@client/pages/timeline.vue'; -import { $i } from './account'; -import { ui } from '@client/config'; - -const page = (path: string, ui?: string) => defineAsyncComponent({ - loader: ui ? () => import(`./ui/${ui}/pages/${path}.vue`) : () => import(`./pages/${path}.vue`), - loadingComponent: MkLoading, - errorComponent: MkError, -}); - -let indexScrollPos = 0; - -const defaultRoutes = [ - // NOTE: MkTimelineをdynamic importするとAsyncComponentWrapperが間に入るせいでkeep-aliveのコンポーネント指定が効かなくなる - { path: '/', name: 'index', component: $i ? MkTimeline : page('welcome') }, - { path: '/@:acct/:page?', name: 'user', component: page('user/index'), props: route => ({ acct: route.params.acct, page: route.params.page || 'index' }) }, - { path: '/@:user/pages/:page', component: page('page'), props: route => ({ pageName: route.params.page, username: route.params.user }) }, - { path: '/@:user/pages/:pageName/view-source', component: page('page-editor/page-editor'), props: route => ({ initUser: route.params.user, initPageName: route.params.pageName }) }, - { path: '/@:acct/room', props: true, component: page('room/room') }, - { path: '/settings/:page(.*)?', name: 'settings', component: page('settings/index'), props: route => ({ initialPage: route.params.page || null }) }, - { path: '/reset-password/:token?', component: page('reset-password'), props: route => ({ token: route.params.token }) }, - { path: '/signup-complete/:code', component: page('signup-complete'), props: route => ({ code: route.params.code }) }, - { path: '/announcements', component: page('announcements') }, - { path: '/about', component: page('about') }, - { path: '/about-misskey', component: page('about-misskey') }, - { path: '/featured', component: page('featured') }, - { path: '/theme-editor', component: page('theme-editor') }, - { path: '/advanced-theme-editor', component: page('advanced-theme-editor') }, - { path: '/explore', component: page('explore') }, - { path: '/explore/tags/:tag', props: true, component: page('explore') }, - { path: '/federation', component: page('federation') }, - { path: '/emojis', component: page('emojis') }, - { path: '/search', component: page('search') }, - { path: '/pages', name: 'pages', component: page('pages') }, - { path: '/pages/new', component: page('page-editor/page-editor') }, - { path: '/pages/edit/:pageId', component: page('page-editor/page-editor'), props: route => ({ initPageId: route.params.pageId }) }, - { path: '/gallery', component: page('gallery/index') }, - { path: '/gallery/new', component: page('gallery/edit') }, - { path: '/gallery/:postId/edit', component: page('gallery/edit'), props: route => ({ postId: route.params.postId }) }, - { path: '/gallery/:postId', component: page('gallery/post'), props: route => ({ postId: route.params.postId }) }, - { path: '/channels', component: page('channels') }, - { path: '/channels/new', component: page('channel-editor') }, - { path: '/channels/:channelId/edit', component: page('channel-editor'), props: true }, - { path: '/channels/:channelId', component: page('channel'), props: route => ({ channelId: route.params.channelId }) }, - { path: '/clips/:clipId', component: page('clip'), props: route => ({ clipId: route.params.clipId }) }, - { path: '/timeline/list/:listId', component: page('user-list-timeline'), props: route => ({ listId: route.params.listId }) }, - { path: '/timeline/antenna/:antennaId', component: page('antenna-timeline'), props: route => ({ antennaId: route.params.antennaId }) }, - { path: '/my/notifications', component: page('notifications') }, - { path: '/my/favorites', component: page('favorites') }, - { path: '/my/messages', component: page('messages') }, - { path: '/my/mentions', component: page('mentions') }, - { path: '/my/messaging', name: 'messaging', component: page('messaging/index') }, - { path: '/my/messaging/:user', component: page('messaging/messaging-room'), props: route => ({ userAcct: route.params.user }) }, - { path: '/my/messaging/group/:group', component: page('messaging/messaging-room'), props: route => ({ groupId: route.params.group }) }, - { path: '/my/drive', name: 'drive', component: page('drive') }, - { path: '/my/drive/folder/:folder', component: page('drive') }, - { path: '/my/follow-requests', component: page('follow-requests') }, - { path: '/my/lists', component: page('my-lists/index') }, - { path: '/my/lists/:list', component: page('my-lists/list') }, - { path: '/my/groups', component: page('my-groups/index') }, - { path: '/my/groups/:group', component: page('my-groups/group'), props: route => ({ groupId: route.params.group }) }, - { path: '/my/antennas', component: page('my-antennas/index') }, - { path: '/my/antennas/create', component: page('my-antennas/create') }, - { path: '/my/antennas/:antennaId', component: page('my-antennas/edit'), props: true }, - { path: '/my/clips', component: page('my-clips/index') }, - { path: '/scratchpad', component: page('scratchpad') }, - { path: '/admin/:page(.*)?', component: page('admin/index'), props: route => ({ initialPage: route.params.page || null }) }, - { path: '/admin', component: page('admin/index') }, - { path: '/notes/:note', name: 'note', component: page('note'), props: route => ({ noteId: route.params.note }) }, - { path: '/tags/:tag', component: page('tag'), props: route => ({ tag: route.params.tag }) }, - { path: '/user-info/:user', component: page('user-info'), props: route => ({ userId: route.params.user }) }, - { path: '/user-ap-info/:user', component: page('user-ap-info'), props: route => ({ userId: route.params.user }) }, - { path: '/instance-info/:host', component: page('instance-info'), props: route => ({ host: route.params.host }) }, - { path: '/games/reversi', component: page('reversi/index') }, - { path: '/games/reversi/:gameId', component: page('reversi/game'), props: route => ({ gameId: route.params.gameId }) }, - { path: '/mfm-cheat-sheet', component: page('mfm-cheat-sheet') }, - { path: '/api-console', component: page('api-console') }, - { path: '/preview', component: page('preview') }, - { path: '/test', component: page('test') }, - { path: '/auth/:token', component: page('auth') }, - { path: '/miauth/:session', component: page('miauth') }, - { path: '/authorize-follow', component: page('follow') }, - { path: '/share', component: page('share') }, - { path: '/:catchAll(.*)', component: page('not-found') } -]; - -const chatRoutes = [ - { path: '/timeline', component: page('timeline', 'chat'), props: route => ({ src: 'home' }) }, - { path: '/timeline/home', component: page('timeline', 'chat'), props: route => ({ src: 'home' }) }, - { path: '/timeline/local', component: page('timeline', 'chat'), props: route => ({ src: 'local' }) }, - { path: '/timeline/social', component: page('timeline', 'chat'), props: route => ({ src: 'social' }) }, - { path: '/timeline/global', component: page('timeline', 'chat'), props: route => ({ src: 'global' }) }, - { path: '/channels/:channelId', component: page('channel', 'chat'), props: route => ({ channelId: route.params.channelId }) }, -]; - -function margeRoutes(routes: any[]) { - const result = defaultRoutes; - for (const route of routes) { - const found = result.findIndex(x => x.path === route.path); - if (found > -1) { - result[found] = route; - } else { - result.unshift(route); - } - } - return result; -} - -export const router = createRouter({ - history: createWebHistory(), - routes: margeRoutes(ui === 'chat' ? chatRoutes : []), - // なんかHacky - // 通常の使い方をすると scroll メソッドの behavior を設定できないため、自前で window.scroll するようにする - scrollBehavior(to) { - window._scroll = () => { // さらにHacky - if (to.name === 'index') { - window.scroll({ top: indexScrollPos, behavior: 'instant' }); - const i = setInterval(() => { - window.scroll({ top: indexScrollPos, behavior: 'instant' }); - }, 10); - setTimeout(() => { - clearInterval(i); - }, 500); - } else { - window.scroll({ top: 0, behavior: 'instant' }); - } - }; - } -}); - -router.afterEach((to, from) => { - if (from.name === 'index') { - indexScrollPos = window.scrollY; - } -}); - -export function resolve(path: string) { - const resolved = router.resolve(path); - const route = resolved.matched[0]; - return { - component: markRaw(route.components.default), - // TODO: route.propsには関数以外も入る可能性があるのでよしなにハンドリングする - props: route.props?.default ? route.props.default(resolved) : resolved.params - }; -} diff --git a/src/client/scripts/2fa.ts b/src/client/scripts/2fa.ts deleted file mode 100644 index 00363cffa6..0000000000 --- a/src/client/scripts/2fa.ts +++ /dev/null @@ -1,33 +0,0 @@ -export function byteify(data: string, encoding: 'ascii' | 'base64' | 'hex') { - switch (encoding) { - case 'ascii': - return Uint8Array.from(data, c => c.charCodeAt(0)); - case 'base64': - return Uint8Array.from( - atob( - data - .replace(/-/g, '+') - .replace(/_/g, '/') - ), - c => c.charCodeAt(0) - ); - case 'hex': - return new Uint8Array( - data - .match(/.{1,2}/g) - .map(byte => parseInt(byte, 16)) - ); - } -} - -export function hexify(buffer: ArrayBuffer) { - return Array.from(new Uint8Array(buffer)) - .reduce( - (str, byte) => str + byte.toString(16).padStart(2, '0'), - '' - ); -} - -export function stringify(buffer: ArrayBuffer) { - return String.fromCharCode(... new Uint8Array(buffer)); -} diff --git a/src/client/scripts/aiscript/api.ts b/src/client/scripts/aiscript/api.ts deleted file mode 100644 index 5dd08f34ac..0000000000 --- a/src/client/scripts/aiscript/api.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { utils, values } from '@syuilo/aiscript'; -import * as os from '@client/os'; -import { $i } from '@client/account'; - -export function createAiScriptEnv(opts) { - let apiRequests = 0; - return { - USER_ID: $i ? values.STR($i.id) : values.NULL, - USER_NAME: $i ? values.STR($i.name) : values.NULL, - USER_USERNAME: $i ? values.STR($i.username) : values.NULL, - 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { - await os.dialog({ - type: type ? type.value : 'info', - title: title.value, - text: text.value, - }); - }), - 'Mk:confirm': values.FN_NATIVE(async ([title, text, type]) => { - const confirm = await os.dialog({ - type: type ? type.value : 'question', - showCancelButton: true, - title: title.value, - text: text.value, - }); - return confirm.canceled ? values.FALSE : values.TRUE; - }), - 'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => { - if (token) utils.assertString(token); - apiRequests++; - if (apiRequests > 16) return values.NULL; - const res = await os.api(ep.value, utils.valToJs(param), token ? token.value : (opts.token || null)); - return utils.jsToVal(res); - }), - 'Mk:save': values.FN_NATIVE(([key, value]) => { - utils.assertString(key); - localStorage.setItem('aiscript:' + opts.storageKey + ':' + key.value, JSON.stringify(utils.valToJs(value))); - return values.NULL; - }), - 'Mk:load': values.FN_NATIVE(([key]) => { - utils.assertString(key); - return utils.jsToVal(JSON.parse(localStorage.getItem('aiscript:' + opts.storageKey + ':' + key.value))); - }), - }; -} diff --git a/src/client/scripts/autocomplete.ts b/src/client/scripts/autocomplete.ts deleted file mode 100644 index c0c33b2c7e..0000000000 --- a/src/client/scripts/autocomplete.ts +++ /dev/null @@ -1,276 +0,0 @@ -import { Ref, ref } from 'vue'; -import * as getCaretCoordinates from 'textarea-caret'; -import { toASCII } from 'punycode/'; -import { popup } from '@client/os'; - -export class Autocomplete { - private suggestion: { - x: Ref; - y: Ref; - q: Ref; - close: Function; - } | null; - private textarea: any; - private vm: any; - private currentType: string; - private opts: { - model: string; - }; - private opening: boolean; - - private get text(): string { - return this.vm[this.opts.model]; - } - - private set text(text: string) { - this.vm[this.opts.model] = text; - } - - /** - * 対象のテキストエリアを与えてインスタンスを初期化します。 - */ - constructor(textarea, vm, opts) { - //#region BIND - this.onInput = this.onInput.bind(this); - this.complete = this.complete.bind(this); - this.close = this.close.bind(this); - //#endregion - - this.suggestion = null; - this.textarea = textarea; - this.vm = vm; - this.opts = opts; - this.opening = false; - - this.attach(); - } - - /** - * このインスタンスにあるテキストエリアの入力のキャプチャを開始します。 - */ - public attach() { - this.textarea.addEventListener('input', this.onInput); - } - - /** - * このインスタンスにあるテキストエリアの入力のキャプチャを解除します。 - */ - public detach() { - this.textarea.removeEventListener('input', this.onInput); - this.close(); - } - - /** - * テキスト入力時 - */ - private onInput() { - const caretPos = this.textarea.selectionStart; - const text = this.text.substr(0, caretPos).split('\n').pop()!; - - const mentionIndex = text.lastIndexOf('@'); - const hashtagIndex = text.lastIndexOf('#'); - const emojiIndex = text.lastIndexOf(':'); - const mfmTagIndex = text.lastIndexOf('$'); - - const max = Math.max( - mentionIndex, - hashtagIndex, - emojiIndex, - mfmTagIndex); - - if (max == -1) { - this.close(); - return; - } - - const isMention = mentionIndex != -1; - const isHashtag = hashtagIndex != -1; - const isMfmTag = mfmTagIndex != -1; - const isEmoji = emojiIndex != -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':'); - - let opened = false; - - if (isMention) { - const username = text.substr(mentionIndex + 1); - if (username != '' && username.match(/^[a-zA-Z0-9_]+$/)) { - this.open('user', username); - opened = true; - } else if (username === '') { - this.open('user', null); - opened = true; - } - } - - if (isHashtag && !opened) { - const hashtag = text.substr(hashtagIndex + 1); - if (!hashtag.includes(' ')) { - this.open('hashtag', hashtag); - opened = true; - } - } - - if (isEmoji && !opened) { - const emoji = text.substr(emojiIndex + 1); - if (!emoji.includes(' ')) { - this.open('emoji', emoji); - opened = true; - } - } - - if (isMfmTag && !opened) { - const mfmTag = text.substr(mfmTagIndex + 1); - if (!mfmTag.includes(' ')) { - this.open('mfmTag', mfmTag.replace('[', '')); - opened = true; - } - } - - if (!opened) { - this.close(); - } - } - - /** - * サジェストを提示します。 - */ - private async open(type: string, q: string | null) { - if (type != this.currentType) { - this.close(); - } - if (this.opening) return; - this.opening = true; - this.currentType = type; - - //#region サジェストを表示すべき位置を計算 - const caretPosition = getCaretCoordinates(this.textarea, this.textarea.selectionStart); - - const rect = this.textarea.getBoundingClientRect(); - - const x = rect.left + caretPosition.left - this.textarea.scrollLeft; - const y = rect.top + caretPosition.top - this.textarea.scrollTop; - //#endregion - - if (this.suggestion) { - this.suggestion.x.value = x; - this.suggestion.y.value = y; - this.suggestion.q.value = q; - - this.opening = false; - } else { - const _x = ref(x); - const _y = ref(y); - const _q = ref(q); - - const { dispose } = await popup(import('@client/components/autocomplete.vue'), { - textarea: this.textarea, - close: this.close, - type: type, - q: _q, - x: _x, - y: _y, - }, { - done: (res) => { - this.complete(res); - } - }); - - this.suggestion = { - q: _q, - x: _x, - y: _y, - close: () => dispose(), - }; - - this.opening = false; - } - } - - /** - * サジェストを閉じます。 - */ - private close() { - if (this.suggestion == null) return; - - this.suggestion.close(); - this.suggestion = null; - - this.textarea.focus(); - } - - /** - * オートコンプリートする - */ - private complete({ type, value }) { - this.close(); - - const caret = this.textarea.selectionStart; - - if (type == 'user') { - const source = this.text; - - const before = source.substr(0, caret); - const trimmedBefore = before.substring(0, before.lastIndexOf('@')); - const after = source.substr(caret); - - const acct = value.host === null ? value.username : `${value.username}@${toASCII(value.host)}`; - - // 挿入 - this.text = `${trimmedBefore}@${acct} ${after}`; - - // キャレットを戻す - this.vm.$nextTick(() => { - this.textarea.focus(); - const pos = trimmedBefore.length + (acct.length + 2); - this.textarea.setSelectionRange(pos, pos); - }); - } else if (type == 'hashtag') { - const source = this.text; - - const before = source.substr(0, caret); - const trimmedBefore = before.substring(0, before.lastIndexOf('#')); - const after = source.substr(caret); - - // 挿入 - this.text = `${trimmedBefore}#${value} ${after}`; - - // キャレットを戻す - this.vm.$nextTick(() => { - this.textarea.focus(); - const pos = trimmedBefore.length + (value.length + 2); - this.textarea.setSelectionRange(pos, pos); - }); - } else if (type == 'emoji') { - const source = this.text; - - const before = source.substr(0, caret); - const trimmedBefore = before.substring(0, before.lastIndexOf(':')); - const after = source.substr(caret); - - // 挿入 - this.text = trimmedBefore + value + after; - - // キャレットを戻す - this.vm.$nextTick(() => { - this.textarea.focus(); - const pos = trimmedBefore.length + value.length; - this.textarea.setSelectionRange(pos, pos); - }); - } else if (type == 'mfmTag') { - const source = this.text; - - const before = source.substr(0, caret); - const trimmedBefore = before.substring(0, before.lastIndexOf('$')); - const after = source.substr(caret); - - // 挿入 - this.text = `${trimmedBefore}$[${value} ]${after}`; - - // キャレットを戻す - this.vm.$nextTick(() => { - this.textarea.focus(); - const pos = trimmedBefore.length + (value.length + 3); - this.textarea.setSelectionRange(pos, pos); - }); - } - } -} diff --git a/src/client/scripts/check-word-mute.ts b/src/client/scripts/check-word-mute.ts deleted file mode 100644 index 3b1fa75b1e..0000000000 --- a/src/client/scripts/check-word-mute.ts +++ /dev/null @@ -1,26 +0,0 @@ -export async function checkWordMute(note: Record, me: Record | null | undefined, mutedWords: string[][]): Promise { - // 自分自身 - if (me && (note.userId === me.id)) return false; - - const words = mutedWords - // Clean up - .map(xs => xs.filter(x => x !== '')) - .filter(xs => xs.length > 0); - - if (words.length > 0) { - if (note.text == null) return false; - - const matched = words.some(and => - and.every(keyword => { - const regexp = keyword.match(/^\/(.+)\/(.*)$/); - if (regexp) { - return new RegExp(regexp[1], regexp[2]).test(note.text!); - } - return note.text!.includes(keyword); - })); - - if (matched) return true; - } - - return false; -} diff --git a/src/client/scripts/collect-page-vars.ts b/src/client/scripts/collect-page-vars.ts deleted file mode 100644 index a4096fb2c2..0000000000 --- a/src/client/scripts/collect-page-vars.ts +++ /dev/null @@ -1,48 +0,0 @@ -export function collectPageVars(content) { - const pageVars = []; - const collect = (xs: any[]) => { - for (const x of xs) { - if (x.type === 'textInput') { - pageVars.push({ - name: x.name, - type: 'string', - value: x.default || '' - }); - } else if (x.type === 'textareaInput') { - pageVars.push({ - name: x.name, - type: 'string', - value: x.default || '' - }); - } else if (x.type === 'numberInput') { - pageVars.push({ - name: x.name, - type: 'number', - value: x.default || 0 - }); - } else if (x.type === 'switch') { - pageVars.push({ - name: x.name, - type: 'boolean', - value: x.default || false - }); - } else if (x.type === 'counter') { - pageVars.push({ - name: x.name, - type: 'number', - value: 0 - }); - } else if (x.type === 'radioButton') { - pageVars.push({ - name: x.name, - type: 'string', - value: x.default || '' - }); - } else if (x.children) { - collect(x.children); - } - } - }; - collect(content); - return pageVars; -} diff --git a/src/client/scripts/contains.ts b/src/client/scripts/contains.ts deleted file mode 100644 index 770bda63bb..0000000000 --- a/src/client/scripts/contains.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default (parent, child, checkSame = true) => { - if (checkSame && parent === child) return true; - let node = child.parentNode; - while (node) { - if (node == parent) return true; - node = node.parentNode; - } - return false; -}; diff --git a/src/client/scripts/copy-to-clipboard.ts b/src/client/scripts/copy-to-clipboard.ts deleted file mode 100644 index ab13cab970..0000000000 --- a/src/client/scripts/copy-to-clipboard.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Clipboardに値をコピー(TODO: 文字列以外も対応) - */ -export default val => { - // 空div 生成 - const tmp = document.createElement('div'); - // 選択用のタグ生成 - const pre = document.createElement('pre'); - - // 親要素のCSSで user-select: none だとコピーできないので書き換える - pre.style.webkitUserSelect = 'auto'; - pre.style.userSelect = 'auto'; - - tmp.appendChild(pre).textContent = val; - - // 要素を画面外へ - const s = tmp.style; - s.position = 'fixed'; - s.right = '200%'; - - // body に追加 - document.body.appendChild(tmp); - // 要素を選択 - document.getSelection().selectAllChildren(tmp); - - // クリップボードにコピー - const result = document.execCommand('copy'); - - // 要素削除 - document.body.removeChild(tmp); - - return result; -}; diff --git a/src/client/scripts/extract-avg-color-from-blurhash.ts b/src/client/scripts/extract-avg-color-from-blurhash.ts deleted file mode 100644 index 123ab7a06d..0000000000 --- a/src/client/scripts/extract-avg-color-from-blurhash.ts +++ /dev/null @@ -1,9 +0,0 @@ -export function extractAvgColorFromBlurhash(hash: string) { - return typeof hash == 'string' - ? '#' + [...hash.slice(2, 6)] - .map(x => '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.indexOf(x)) - .reduce((a, c) => a * 83 + c, 0) - .toString(16) - .padStart(6, '0') - : undefined; -} diff --git a/src/client/scripts/focus.ts b/src/client/scripts/focus.ts deleted file mode 100644 index 0894877820..0000000000 --- a/src/client/scripts/focus.ts +++ /dev/null @@ -1,27 +0,0 @@ -export function focusPrev(el: Element | null, self = false, scroll = true) { - if (el == null) return; - if (!self) el = el.previousElementSibling; - if (el) { - if (el.hasAttribute('tabindex')) { - (el as HTMLElement).focus({ - preventScroll: !scroll - }); - } else { - focusPrev(el.previousElementSibling, true); - } - } -} - -export function focusNext(el: Element | null, self = false, scroll = true) { - if (el == null) return; - if (!self) el = el.nextElementSibling; - if (el) { - if (el.hasAttribute('tabindex')) { - (el as HTMLElement).focus({ - preventScroll: !scroll - }); - } else { - focusPrev(el.nextElementSibling, true); - } - } -} diff --git a/src/client/scripts/form.ts b/src/client/scripts/form.ts deleted file mode 100644 index 7bf6cec452..0000000000 --- a/src/client/scripts/form.ts +++ /dev/null @@ -1,31 +0,0 @@ -export type FormItem = { - label?: string; - type: 'string'; - default: string | null; - hidden?: boolean; - multiline?: boolean; -} | { - label?: string; - type: 'number'; - default: number | null; - hidden?: boolean; - step?: number; -} | { - label?: string; - type: 'boolean'; - default: boolean | null; - hidden?: boolean; -} | { - label?: string; - type: 'enum'; - default: string | null; - hidden?: boolean; - enum: string[]; -} | { - label?: string; - type: 'array'; - default: unknown[] | null; - hidden?: boolean; -}; - -export type Form = Record; diff --git a/src/client/scripts/gen-search-query.ts b/src/client/scripts/gen-search-query.ts deleted file mode 100644 index cafb3cccfe..0000000000 --- a/src/client/scripts/gen-search-query.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { parseAcct } from '@/misc/acct'; -import { host as localHost } from '@client/config'; - -export async function genSearchQuery(v: any, q: string) { - let host: string; - let userId: string; - if (q.split(' ').some(x => x.startsWith('@'))) { - for (const at of q.split(' ').filter(x => x.startsWith('@')).map(x => x.substr(1))) { - if (at.includes('.')) { - if (at === localHost || at === '.') { - host = null; - } else { - host = at; - } - } else { - const user = await v.os.api('users/show', parseAcct(at)).catch(x => null); - if (user) { - userId = user.id; - } else { - // todo: show error - } - } - } - - } - return { - query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '), - host: host, - userId: userId - }; -} diff --git a/src/client/scripts/get-account-from-id.ts b/src/client/scripts/get-account-from-id.ts deleted file mode 100644 index 065b41118c..0000000000 --- a/src/client/scripts/get-account-from-id.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { get } from '@client/scripts/idb-proxy'; - -export async function getAccountFromId(id: string) { - const accounts = await get('accounts') as { token: string; id: string; }[]; - if (!accounts) console.log('Accounts are not recorded'); - return accounts.find(e => e.id === id); -} diff --git a/src/client/scripts/get-md5.ts b/src/client/scripts/get-md5.ts deleted file mode 100644 index b002d762b1..0000000000 --- a/src/client/scripts/get-md5.ts +++ /dev/null @@ -1,10 +0,0 @@ -// スクリプトサイズがデカい -//import * as crypto from 'crypto'; - -export default (data: ArrayBuffer) => { - //const buf = new Buffer(data); - //const hash = crypto.createHash('md5'); - //hash.update(buf); - //return hash.digest('hex'); - return ''; -}; diff --git a/src/client/scripts/get-static-image-url.ts b/src/client/scripts/get-static-image-url.ts deleted file mode 100644 index 92c31914c7..0000000000 --- a/src/client/scripts/get-static-image-url.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { url as instanceUrl } from '@client/config'; -import * as url from '../../prelude/url'; - -export function getStaticImageUrl(baseUrl: string): string { - const u = new URL(baseUrl); - if (u.href.startsWith(`${instanceUrl}/proxy/`)) { - // もう既にproxyっぽそうだったらsearchParams付けるだけ - u.searchParams.set('static', '1'); - return u.href; - } - const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので - return `${instanceUrl}/proxy/${dummy}?${url.query({ - url: u.href, - static: '1' - })}`; -} diff --git a/src/client/scripts/get-user-menu.ts b/src/client/scripts/get-user-menu.ts deleted file mode 100644 index 3689a93b47..0000000000 --- a/src/client/scripts/get-user-menu.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { i18n } from '@client/i18n'; -import copyToClipboard from '@client/scripts/copy-to-clipboard'; -import { host } from '@client/config'; -import { getAcct } from '@/misc/acct'; -import * as os from '@client/os'; -import { userActions } from '@client/store'; -import { router } from '@client/router'; -import { $i } from '@client/account'; - -export function getUserMenu(user) { - const meId = $i ? $i.id : null; - - async function pushList() { - const t = i18n.locale.selectList; // なぜか後で参照すると null になるので最初にメモリに確保しておく - const lists = await os.api('users/lists/list'); - if (lists.length === 0) { - os.dialog({ - type: 'error', - text: i18n.locale.youHaveNoLists - }); - return; - } - const { canceled, result: listId } = await os.dialog({ - type: null, - title: t, - select: { - items: lists.map(list => ({ - value: list.id, text: list.name - })) - }, - showCancelButton: true - }); - if (canceled) return; - os.apiWithDialog('users/lists/push', { - listId: listId, - userId: user.id - }); - } - - async function inviteGroup() { - const groups = await os.api('users/groups/owned'); - if (groups.length === 0) { - os.dialog({ - type: 'error', - text: i18n.locale.youHaveNoGroups - }); - return; - } - const { canceled, result: groupId } = await os.dialog({ - type: null, - title: i18n.locale.group, - select: { - items: groups.map(group => ({ - value: group.id, text: group.name - })) - }, - showCancelButton: true - }); - if (canceled) return; - os.apiWithDialog('users/groups/invite', { - groupId: groupId, - userId: user.id - }); - } - - async function toggleMute() { - os.apiWithDialog(user.isMuted ? 'mute/delete' : 'mute/create', { - userId: user.id - }).then(() => { - user.isMuted = !user.isMuted; - }); - } - - async function toggleBlock() { - if (!await getConfirmed(user.isBlocking ? i18n.locale.unblockConfirm : i18n.locale.blockConfirm)) return; - - os.apiWithDialog(user.isBlocking ? 'blocking/delete' : 'blocking/create', { - userId: user.id - }).then(() => { - user.isBlocking = !user.isBlocking; - }); - } - - async function toggleSilence() { - if (!await getConfirmed(i18n.t(user.isSilenced ? 'unsilenceConfirm' : 'silenceConfirm'))) return; - - os.apiWithDialog(user.isSilenced ? 'admin/unsilence-user' : 'admin/silence-user', { - userId: user.id - }).then(() => { - user.isSilenced = !user.isSilenced; - }); - } - - async function toggleSuspend() { - if (!await getConfirmed(i18n.t(user.isSuspended ? 'unsuspendConfirm' : 'suspendConfirm'))) return; - - os.apiWithDialog(user.isSuspended ? 'admin/unsuspend-user' : 'admin/suspend-user', { - userId: user.id - }).then(() => { - user.isSuspended = !user.isSuspended; - }); - } - - function reportAbuse() { - os.popup(import('@client/components/abuse-report-window.vue'), { - user: user, - }, {}, 'closed'); - } - - async function getConfirmed(text: string): Promise { - const confirm = await os.dialog({ - type: 'warning', - showCancelButton: true, - title: 'confirm', - text, - }); - - return !confirm.canceled; - } - - let menu = [{ - icon: 'fas fa-at', - text: i18n.locale.copyUsername, - action: () => { - copyToClipboard(`@${user.username}@${user.host || host}`); - } - }, { - icon: 'fas fa-info-circle', - text: i18n.locale.info, - action: () => { - os.pageWindow(`/user-info/${user.id}`); - } - }, { - icon: 'fas fa-envelope', - text: i18n.locale.sendMessage, - action: () => { - os.post({ specified: user }); - } - }, meId != user.id ? { - type: 'link', - icon: 'fas fa-comments', - text: i18n.locale.startMessaging, - to: '/my/messaging/' + getAcct(user), - } : undefined, null, { - icon: 'fas fa-list-ul', - text: i18n.locale.addToList, - action: pushList - }, meId != user.id ? { - icon: 'fas fa-users', - text: i18n.locale.inviteToGroup, - action: inviteGroup - } : undefined] as any; - - if ($i && meId != user.id) { - menu = menu.concat([null, { - icon: user.isMuted ? 'fas fa-eye' : 'fas fa-eye-slash', - text: user.isMuted ? i18n.locale.unmute : i18n.locale.mute, - action: toggleMute - }, { - icon: 'fas fa-ban', - text: user.isBlocking ? i18n.locale.unblock : i18n.locale.block, - action: toggleBlock - }]); - - menu = menu.concat([null, { - icon: 'fas fa-exclamation-circle', - text: i18n.locale.reportAbuse, - action: reportAbuse - }]); - - if ($i && ($i.isAdmin || $i.isModerator)) { - menu = menu.concat([null, { - icon: 'fas fa-microphone-slash', - text: user.isSilenced ? i18n.locale.unsilence : i18n.locale.silence, - action: toggleSilence - }, { - icon: 'fas fa-snowflake', - text: user.isSuspended ? i18n.locale.unsuspend : i18n.locale.suspend, - action: toggleSuspend - }]); - } - } - - if ($i && meId === user.id) { - menu = menu.concat([null, { - icon: 'fas fa-pencil-alt', - text: i18n.locale.editProfile, - action: () => { - router.push('/settings/profile'); - } - }]); - } - - if (userActions.length > 0) { - menu = menu.concat([null, ...userActions.map(action => ({ - icon: 'fas fa-plug', - text: action.title, - action: () => { - action.handler(user); - } - }))]); - } - - return menu; -} diff --git a/src/client/scripts/hotkey.ts b/src/client/scripts/hotkey.ts deleted file mode 100644 index 2b3f491fd8..0000000000 --- a/src/client/scripts/hotkey.ts +++ /dev/null @@ -1,88 +0,0 @@ -import keyCode from './keycode'; - -type Keymap = Record; - -type Pattern = { - which: string[]; - ctrl?: boolean; - shift?: boolean; - alt?: boolean; -}; - -type Action = { - patterns: Pattern[]; - callback: Function; - allowRepeat: boolean; -}; - -const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, callback]): Action => { - const result = { - patterns: [], - callback: callback, - allowRepeat: true - } as Action; - - if (patterns.match(/^\(.*\)$/) !== null) { - result.allowRepeat = false; - patterns = patterns.slice(1, -1); - } - - result.patterns = patterns.split('|').map(part => { - const pattern = { - which: [], - ctrl: false, - alt: false, - shift: false - } as Pattern; - - const keys = part.trim().split('+').map(x => x.trim().toLowerCase()); - for (const key of keys) { - switch (key) { - case 'ctrl': pattern.ctrl = true; break; - case 'alt': pattern.alt = true; break; - case 'shift': pattern.shift = true; break; - default: pattern.which = keyCode(key).map(k => k.toLowerCase()); - } - } - - return pattern; - }); - - return result; -}); - -const ignoreElemens = ['input', 'textarea']; - -function match(e: KeyboardEvent, patterns: Action['patterns']): boolean { - const key = e.code.toLowerCase(); - return patterns.some(pattern => pattern.which.includes(key) && - pattern.ctrl === e.ctrlKey && - pattern.shift === e.shiftKey && - pattern.alt === e.altKey && - !e.metaKey - ); -} - -export const makeHotkey = (keymap: Keymap) => { - const actions = parseKeymap(keymap); - - return (e: KeyboardEvent) => { - if (document.activeElement) { - if (ignoreElemens.some(el => document.activeElement!.matches(el))) return; - if (document.activeElement.attributes['contenteditable']) return; - } - - for (const action of actions) { - const matched = match(e, action.patterns); - - if (matched) { - if (!action.allowRepeat && e.repeat) return; - - e.preventDefault(); - e.stopPropagation(); - action.callback(e); - break; - } - } - }; -}; diff --git a/src/client/scripts/hpml/block.ts b/src/client/scripts/hpml/block.ts deleted file mode 100644 index 804c5c1124..0000000000 --- a/src/client/scripts/hpml/block.ts +++ /dev/null @@ -1,109 +0,0 @@ -// blocks - -export type BlockBase = { - id: string; - type: string; -}; - -export type TextBlock = BlockBase & { - type: 'text'; - text: string; -}; - -export type SectionBlock = BlockBase & { - type: 'section'; - title: string; - children: (Block | VarBlock)[]; -}; - -export type ImageBlock = BlockBase & { - type: 'image'; - fileId: string | null; -}; - -export type ButtonBlock = BlockBase & { - type: 'button'; - text: any; - primary: boolean; - action: string; - content: string; - event: string; - message: string; - var: string; - fn: string; -}; - -export type IfBlock = BlockBase & { - type: 'if'; - var: string; - children: Block[]; -}; - -export type TextareaBlock = BlockBase & { - type: 'textarea'; - text: string; -}; - -export type PostBlock = BlockBase & { - type: 'post'; - text: string; - attachCanvasImage: boolean; - canvasId: string; -}; - -export type CanvasBlock = BlockBase & { - type: 'canvas'; - name: string; // canvas id - width: number; - height: number; -}; - -export type NoteBlock = BlockBase & { - type: 'note'; - detailed: boolean; - note: string | null; -}; - -export type Block = - TextBlock | SectionBlock | ImageBlock | ButtonBlock | IfBlock | TextareaBlock | PostBlock | CanvasBlock | NoteBlock | VarBlock; - -// variable blocks - -export type VarBlockBase = BlockBase & { - name: string; -}; - -export type NumberInputVarBlock = VarBlockBase & { - type: 'numberInput'; - text: string; -}; - -export type TextInputVarBlock = VarBlockBase & { - type: 'textInput'; - text: string; -}; - -export type SwitchVarBlock = VarBlockBase & { - type: 'switch'; - text: string; -}; - -export type RadioButtonVarBlock = VarBlockBase & { - type: 'radioButton'; - title: string; - values: string[]; -}; - -export type CounterVarBlock = VarBlockBase & { - type: 'counter'; - text: string; - inc: number; -}; - -export type VarBlock = - NumberInputVarBlock | TextInputVarBlock | SwitchVarBlock | RadioButtonVarBlock | CounterVarBlock; - -const varBlock = ['numberInput', 'textInput', 'switch', 'radioButton', 'counter']; -export function isVarBlock(block: Block): block is VarBlock { - return varBlock.includes(block.type); -} diff --git a/src/client/scripts/hpml/evaluator.ts b/src/client/scripts/hpml/evaluator.ts deleted file mode 100644 index 68d140ff50..0000000000 --- a/src/client/scripts/hpml/evaluator.ts +++ /dev/null @@ -1,234 +0,0 @@ -import autobind from 'autobind-decorator'; -import { PageVar, envVarsDef, Fn, HpmlScope, HpmlError } from '.'; -import { version } from '@client/config'; -import { AiScript, utils, values } from '@syuilo/aiscript'; -import { createAiScriptEnv } from '../aiscript/api'; -import { collectPageVars } from '../collect-page-vars'; -import { initHpmlLib, initAiLib } from './lib'; -import * as os from '@client/os'; -import { markRaw, ref, Ref, unref } from 'vue'; -import { Expr, isLiteralValue, Variable } from './expr'; - -/** - * Hpml evaluator - */ -export class Hpml { - private variables: Variable[]; - private pageVars: PageVar[]; - private envVars: Record; - public aiscript?: AiScript; - public pageVarUpdatedCallback?: values.VFn; - public canvases: Record = {}; - public vars: Ref> = ref({}); - public page: Record; - - private opts: { - randomSeed: string; visitor?: any; url?: string; - enableAiScript: boolean; - }; - - constructor(page: Hpml['page'], opts: Hpml['opts']) { - this.page = page; - this.variables = this.page.variables; - this.pageVars = collectPageVars(this.page.content); - this.opts = opts; - - if (this.opts.enableAiScript) { - this.aiscript = markRaw(new AiScript({ ...createAiScriptEnv({ - storageKey: 'pages:' + this.page.id - }), ...initAiLib(this)}, { - in: (q) => { - return new Promise(ok => { - os.dialog({ - title: q, - input: {} - }).then(({ canceled, result: a }) => { - ok(a); - }); - }); - }, - out: (value) => { - console.log(value); - }, - log: (type, params) => { - }, - })); - - this.aiscript.scope.opts.onUpdated = (name, value) => { - this.eval(); - }; - } - - const date = new Date(); - - this.envVars = { - AI: 'kawaii', - VERSION: version, - URL: this.page ? `${opts.url}/@${this.page.user.username}/pages/${this.page.name}` : '', - LOGIN: opts.visitor != null, - NAME: opts.visitor ? opts.visitor.name || opts.visitor.username : '', - USERNAME: opts.visitor ? opts.visitor.username : '', - USERID: opts.visitor ? opts.visitor.id : '', - NOTES_COUNT: opts.visitor ? opts.visitor.notesCount : 0, - FOLLOWERS_COUNT: opts.visitor ? opts.visitor.followersCount : 0, - FOLLOWING_COUNT: opts.visitor ? opts.visitor.followingCount : 0, - IS_CAT: opts.visitor ? opts.visitor.isCat : false, - SEED: opts.randomSeed ? opts.randomSeed : '', - YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`, - AISCRIPT_DISABLED: !this.opts.enableAiScript, - NULL: null - }; - - this.eval(); - } - - @autobind - public eval() { - try { - this.vars.value = this.evaluateVars(); - } catch (e) { - //this.onError(e); - } - } - - @autobind - public interpolate(str: string) { - if (str == null) return null; - return str.replace(/{(.+?)}/g, match => { - const v = unref(this.vars)[match.slice(1, -1).trim()]; - return v == null ? 'NULL' : v.toString(); - }); - } - - @autobind - public callAiScript(fn: string) { - try { - if (this.aiscript) this.aiscript.execFn(this.aiscript.scope.get(fn), []); - } catch (e) {} - } - - @autobind - public registerCanvas(id: string, canvas: any) { - this.canvases[id] = canvas; - } - - @autobind - public updatePageVar(name: string, value: any) { - const pageVar = this.pageVars.find(v => v.name === name); - if (pageVar !== undefined) { - pageVar.value = value; - if (this.pageVarUpdatedCallback) { - if (this.aiscript) this.aiscript.execFn(this.pageVarUpdatedCallback, [values.STR(name), utils.jsToVal(value)]); - } - } else { - throw new HpmlError(`No such page var '${name}'`); - } - } - - @autobind - public updateRandomSeed(seed: string) { - this.opts.randomSeed = seed; - this.envVars.SEED = seed; - } - - @autobind - private _interpolateScope(str: string, scope: HpmlScope) { - return str.replace(/{(.+?)}/g, match => { - const v = scope.getState(match.slice(1, -1).trim()); - return v == null ? 'NULL' : v.toString(); - }); - } - - @autobind - public evaluateVars(): Record { - const values: Record = {}; - - for (const [k, v] of Object.entries(this.envVars)) { - values[k] = v; - } - - for (const v of this.pageVars) { - values[v.name] = v.value; - } - - for (const v of this.variables) { - values[v.name] = this.evaluate(v, new HpmlScope([values])); - } - - return values; - } - - @autobind - private evaluate(expr: Expr, scope: HpmlScope): any { - - if (isLiteralValue(expr)) { - if (expr.type === null) { - return null; - } - - if (expr.type === 'number') { - return parseInt((expr.value as any), 10); - } - - if (expr.type === 'text' || expr.type === 'multiLineText') { - return this._interpolateScope(expr.value || '', scope); - } - - if (expr.type === 'textList') { - return this._interpolateScope(expr.value || '', scope).trim().split('\n'); - } - - if (expr.type === 'ref') { - return scope.getState(expr.value); - } - - if (expr.type === 'aiScriptVar') { - if (this.aiscript) { - try { - return utils.valToJs(this.aiscript.scope.get(expr.value)); - } catch (e) { - return null; - } - } else { - return null; - } - } - - // Define user function - if (expr.type == 'fn') { - return { - slots: expr.value.slots.map(x => x.name), - exec: (slotArg: Record) => { - return this.evaluate(expr.value.expression, scope.createChildScope(slotArg, expr.id)); - } - } as Fn; - } - return; - } - - // Call user function - if (expr.type.startsWith('fn:')) { - const fnName = expr.type.split(':')[1]; - const fn = scope.getState(fnName); - const args = {} as Record; - for (let i = 0; i < fn.slots.length; i++) { - const name = fn.slots[i]; - args[name] = this.evaluate(expr.args[i], scope); - } - return fn.exec(args); - } - - if (expr.args === undefined) return null; - - const funcs = initHpmlLib(expr, scope, this.opts.randomSeed, this.opts.visitor); - - // Call function - const fnName = expr.type; - const fn = (funcs as any)[fnName]; - if (fn == null) { - throw new HpmlError(`No such function '${fnName}'`); - } else { - return fn(...expr.args.map(x => this.evaluate(x, scope))); - } - } -} diff --git a/src/client/scripts/hpml/expr.ts b/src/client/scripts/hpml/expr.ts deleted file mode 100644 index 00e3ed118b..0000000000 --- a/src/client/scripts/hpml/expr.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { literalDefs, Type } from '.'; - -export type ExprBase = { - id: string; -}; - -// value - -export type EmptyValue = ExprBase & { - type: null; - value: null; -}; - -export type TextValue = ExprBase & { - type: 'text'; - value: string; -}; - -export type MultiLineTextValue = ExprBase & { - type: 'multiLineText'; - value: string; -}; - -export type TextListValue = ExprBase & { - type: 'textList'; - value: string; -}; - -export type NumberValue = ExprBase & { - type: 'number'; - value: number; -}; - -export type RefValue = ExprBase & { - type: 'ref'; - value: string; // value is variable name -}; - -export type AiScriptRefValue = ExprBase & { - type: 'aiScriptVar'; - value: string; // value is variable name -}; - -export type UserFnValue = ExprBase & { - type: 'fn'; - value: UserFnInnerValue; -}; -type UserFnInnerValue = { - slots: { - name: string; - type: Type; - }[]; - expression: Expr; -}; - -export type Value = - EmptyValue | TextValue | MultiLineTextValue | TextListValue | NumberValue | RefValue | AiScriptRefValue | UserFnValue; - -export function isLiteralValue(expr: Expr): expr is Value { - if (expr.type == null) return true; - if (literalDefs[expr.type]) return true; - return false; -} - -// call function - -export type CallFn = ExprBase & { // "fn:hoge" or string - type: string; - args: Expr[]; - value: null; -}; - -// variable -export type Variable = (Value | CallFn) & { - name: string; -}; - -// expression -export type Expr = Variable | Value | CallFn; diff --git a/src/client/scripts/hpml/index.ts b/src/client/scripts/hpml/index.ts deleted file mode 100644 index ac81eac2d9..0000000000 --- a/src/client/scripts/hpml/index.ts +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Hpml - */ - -import autobind from 'autobind-decorator'; -import { Hpml } from './evaluator'; -import { funcDefs } from './lib'; - -export type Fn = { - slots: string[]; - exec: (args: Record) => ReturnType; -}; - -export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null; - -export const literalDefs: Record = { - text: { out: 'string', category: 'value', icon: 'fas fa-quote-right', }, - multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', }, - textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', }, - number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', }, - ref: { out: null, category: 'value', icon: 'fas fa-magic', }, - aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic', }, - fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt', }, -}; - -export const blockDefs = [ - ...Object.entries(literalDefs).map(([k, v]) => ({ - type: k, out: v.out, category: v.category, icon: v.icon - })), - ...Object.entries(funcDefs).map(([k, v]) => ({ - type: k, out: v.out, category: v.category, icon: v.icon - })) -]; - -export type PageVar = { name: string; value: any; type: Type; }; - -export const envVarsDef: Record = { - AI: 'string', - URL: 'string', - VERSION: 'string', - LOGIN: 'boolean', - NAME: 'string', - USERNAME: 'string', - USERID: 'string', - NOTES_COUNT: 'number', - FOLLOWERS_COUNT: 'number', - FOLLOWING_COUNT: 'number', - IS_CAT: 'boolean', - SEED: null, - YMD: 'string', - AISCRIPT_DISABLED: 'boolean', - NULL: null, -}; - -export class HpmlScope { - private layerdStates: Record[]; - public name: string; - - constructor(layerdStates: HpmlScope['layerdStates'], name?: HpmlScope['name']) { - this.layerdStates = layerdStates; - this.name = name || 'anonymous'; - } - - @autobind - public createChildScope(states: Record, name?: HpmlScope['name']): HpmlScope { - const layer = [states, ...this.layerdStates]; - return new HpmlScope(layer, name); - } - - /** - * 指定した名前の変数の値を取得します - * @param name 変数名 - */ - @autobind - public getState(name: string): any { - for (const later of this.layerdStates) { - const state = later[name]; - if (state !== undefined) { - return state; - } - } - - throw new HpmlError( - `No such variable '${name}' in scope '${this.name}'`, { - scope: this.layerdStates - }); - } -} - -export class HpmlError extends Error { - public info?: any; - - constructor(message: string, info?: any) { - super(message); - - this.info = info; - - // Maintains proper stack trace for where our error was thrown (only available on V8) - if (Error.captureStackTrace) { - Error.captureStackTrace(this, HpmlError); - } - } -} diff --git a/src/client/scripts/hpml/lib.ts b/src/client/scripts/hpml/lib.ts deleted file mode 100644 index 2a1ac73a40..0000000000 --- a/src/client/scripts/hpml/lib.ts +++ /dev/null @@ -1,246 +0,0 @@ -import * as tinycolor from 'tinycolor2'; -import { Hpml } from './evaluator'; -import { values, utils } from '@syuilo/aiscript'; -import { Fn, HpmlScope } from '.'; -import { Expr } from './expr'; -import * as seedrandom from 'seedrandom'; - -/* TODO: https://www.chartjs.org/docs/latest/configuration/canvas-background.html#color -// https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs -Chart.pluginService.register({ - beforeDraw: (chart, easing) => { - if (chart.config.options.chartArea && chart.config.options.chartArea.backgroundColor) { - const ctx = chart.chart.ctx; - ctx.save(); - ctx.fillStyle = chart.config.options.chartArea.backgroundColor; - ctx.fillRect(0, 0, chart.chart.width, chart.chart.height); - ctx.restore(); - } - } -}); -*/ - -export function initAiLib(hpml: Hpml) { - return { - 'MkPages:updated': values.FN_NATIVE(([callback]) => { - hpml.pageVarUpdatedCallback = (callback as values.VFn); - }), - 'MkPages:get_canvas': values.FN_NATIVE(([id]) => { - utils.assertString(id); - const canvas = hpml.canvases[id.value]; - const ctx = canvas.getContext('2d'); - return values.OBJ(new Map([ - ['clear_rect', values.FN_NATIVE(([x, y, width, height]) => { ctx.clearRect(x.value, y.value, width.value, height.value); })], - ['fill_rect', values.FN_NATIVE(([x, y, width, height]) => { ctx.fillRect(x.value, y.value, width.value, height.value); })], - ['stroke_rect', values.FN_NATIVE(([x, y, width, height]) => { ctx.strokeRect(x.value, y.value, width.value, height.value); })], - ['fill_text', values.FN_NATIVE(([text, x, y, width]) => { ctx.fillText(text.value, x.value, y.value, width ? width.value : undefined); })], - ['stroke_text', values.FN_NATIVE(([text, x, y, width]) => { ctx.strokeText(text.value, x.value, y.value, width ? width.value : undefined); })], - ['set_line_width', values.FN_NATIVE(([width]) => { ctx.lineWidth = width.value; })], - ['set_font', values.FN_NATIVE(([font]) => { ctx.font = font.value; })], - ['set_fill_style', values.FN_NATIVE(([style]) => { ctx.fillStyle = style.value; })], - ['set_stroke_style', values.FN_NATIVE(([style]) => { ctx.strokeStyle = style.value; })], - ['begin_path', values.FN_NATIVE(() => { ctx.beginPath(); })], - ['close_path', values.FN_NATIVE(() => { ctx.closePath(); })], - ['move_to', values.FN_NATIVE(([x, y]) => { ctx.moveTo(x.value, y.value); })], - ['line_to', values.FN_NATIVE(([x, y]) => { ctx.lineTo(x.value, y.value); })], - ['arc', values.FN_NATIVE(([x, y, radius, startAngle, endAngle]) => { ctx.arc(x.value, y.value, radius.value, startAngle.value, endAngle.value); })], - ['rect', values.FN_NATIVE(([x, y, width, height]) => { ctx.rect(x.value, y.value, width.value, height.value); })], - ['fill', values.FN_NATIVE(() => { ctx.fill(); })], - ['stroke', values.FN_NATIVE(() => { ctx.stroke(); })], - ])); - }), - 'MkPages:chart': values.FN_NATIVE(([id, opts]) => { - /* TODO - utils.assertString(id); - utils.assertObject(opts); - const canvas = hpml.canvases[id.value]; - const color = getComputedStyle(document.documentElement).getPropertyValue('--accent'); - Chart.defaults.color = '#555'; - const chart = new Chart(canvas, { - type: opts.value.get('type').value, - data: { - labels: opts.value.get('labels').value.map(x => x.value), - datasets: opts.value.get('datasets').value.map(x => ({ - label: x.value.has('label') ? x.value.get('label').value : '', - data: x.value.get('data').value.map(x => x.value), - pointRadius: 0, - lineTension: 0, - borderWidth: 2, - borderColor: x.value.has('color') ? x.value.get('color') : color, - backgroundColor: tinycolor(x.value.has('color') ? x.value.get('color') : color).setAlpha(0.1).toRgbString(), - })) - }, - options: { - responsive: false, - devicePixelRatio: 1.5, - title: { - display: opts.value.has('title'), - text: opts.value.has('title') ? opts.value.get('title').value : '', - fontSize: 14, - }, - layout: { - padding: { - left: 32, - right: 32, - top: opts.value.has('title') ? 16 : 32, - bottom: 16 - } - }, - legend: { - display: opts.value.get('datasets').value.filter(x => x.value.has('label') && x.value.get('label').value).length === 0 ? false : true, - position: 'bottom', - labels: { - boxWidth: 16, - } - }, - tooltips: { - enabled: false, - }, - chartArea: { - backgroundColor: '#fff' - }, - ...(opts.value.get('type').value === 'radar' ? { - scale: { - ticks: { - display: opts.value.has('show_tick_label') ? opts.value.get('show_tick_label').value : false, - min: opts.value.has('min') ? opts.value.get('min').value : undefined, - max: opts.value.has('max') ? opts.value.get('max').value : undefined, - maxTicksLimit: 8, - }, - pointLabels: { - fontSize: 12 - } - } - } : { - scales: { - yAxes: [{ - ticks: { - display: opts.value.has('show_tick_label') ? opts.value.get('show_tick_label').value : true, - min: opts.value.has('min') ? opts.value.get('min').value : undefined, - max: opts.value.has('max') ? opts.value.get('max').value : undefined, - } - }] - } - }) - } - }); - */ - }) - }; -} - -export const funcDefs: Record = { - if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: 'fas fa-share-alt', }, - for: { in: ['number', 'function'], out: null, category: 'flow', icon: 'fas fa-recycle', }, - not: { in: ['boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag', }, - or: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag', }, - and: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag', }, - add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-plus', }, - subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-minus', }, - multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-times', }, - divide: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-divide', }, - mod: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-divide', }, - round: { in: ['number'], out: 'number', category: 'operation', icon: 'fas fa-calculator', }, - eq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: 'fas fa-equals', }, - notEq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: 'fas fa-not-equal', }, - gt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-greater-than', }, - lt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-less-than', }, - gtEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-greater-than-equal', }, - ltEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-less-than-equal', }, - strLen: { in: ['string'], out: 'number', category: 'text', icon: 'fas fa-quote-right', }, - strPick: { in: ['string', 'number'], out: 'string', category: 'text', icon: 'fas fa-quote-right', }, - strReplace: { in: ['string', 'string', 'string'], out: 'string', category: 'text', icon: 'fas fa-quote-right', }, - strReverse: { in: ['string'], out: 'string', category: 'text', icon: 'fas fa-quote-right', }, - join: { in: ['stringArray', 'string'], out: 'string', category: 'text', icon: 'fas fa-quote-right', }, - stringToNumber: { in: ['string'], out: 'number', category: 'convert', icon: 'fas fa-exchange-alt', }, - numberToString: { in: ['number'], out: 'string', category: 'convert', icon: 'fas fa-exchange-alt', }, - splitStrByLine: { in: ['string'], out: 'stringArray', category: 'convert', icon: 'fas fa-exchange-alt', }, - pick: { in: [null, 'number'], out: null, category: 'list', icon: 'fas fa-indent', }, - listLen: { in: [null], out: 'number', category: 'list', icon: 'fas fa-indent', }, - rannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: 'fas fa-dice', }, - dailyRannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: 'fas fa-dice', }, - seedRannum: { in: [null, 'number', 'number'], out: 'number', category: 'random', icon: 'fas fa-dice', }, - random: { in: ['number'], out: 'boolean', category: 'random', icon: 'fas fa-dice', }, - dailyRandom: { in: ['number'], out: 'boolean', category: 'random', icon: 'fas fa-dice', }, - seedRandom: { in: [null, 'number'], out: 'boolean', category: 'random', icon: 'fas fa-dice', }, - randomPick: { in: [0], out: 0, category: 'random', icon: 'fas fa-dice', }, - dailyRandomPick: { in: [0], out: 0, category: 'random', icon: 'fas fa-dice', }, - seedRandomPick: { in: [null, 0], out: 0, category: 'random', icon: 'fas fa-dice', }, - DRPWPM: { in: ['stringArray'], out: 'string', category: 'random', icon: 'fas fa-dice', }, // dailyRandomPickWithProbabilityMapping -}; - -export function initHpmlLib(expr: Expr, scope: HpmlScope, randomSeed: string, visitor?: any) { - - const date = new Date(); - const day = `${visitor ? visitor.id : ''} ${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`; - - const funcs: Record = { - not: (a: boolean) => !a, - or: (a: boolean, b: boolean) => a || b, - and: (a: boolean, b: boolean) => a && b, - eq: (a: any, b: any) => a === b, - notEq: (a: any, b: any) => a !== b, - gt: (a: number, b: number) => a > b, - lt: (a: number, b: number) => a < b, - gtEq: (a: number, b: number) => a >= b, - ltEq: (a: number, b: number) => a <= b, - if: (bool: boolean, a: any, b: any) => bool ? a : b, - for: (times: number, fn: Fn) => { - const result: any[] = []; - for (let i = 0; i < times; i++) { - result.push(fn.exec({ - [fn.slots[0]]: i + 1 - })); - } - return result; - }, - add: (a: number, b: number) => a + b, - subtract: (a: number, b: number) => a - b, - multiply: (a: number, b: number) => a * b, - divide: (a: number, b: number) => a / b, - mod: (a: number, b: number) => a % b, - round: (a: number) => Math.round(a), - strLen: (a: string) => a.length, - strPick: (a: string, b: number) => a[b - 1], - strReplace: (a: string, b: string, c: string) => a.split(b).join(c), - strReverse: (a: string) => a.split('').reverse().join(''), - join: (texts: string[], separator: string) => texts.join(separator || ''), - stringToNumber: (a: string) => parseInt(a), - numberToString: (a: number) => a.toString(), - splitStrByLine: (a: string) => a.split('\n'), - pick: (list: any[], i: number) => list[i - 1], - listLen: (list: any[]) => list.length, - random: (probability: number) => Math.floor(seedrandom(`${randomSeed}:${expr.id}`)() * 100) < probability, - rannum: (min: number, max: number) => min + Math.floor(seedrandom(`${randomSeed}:${expr.id}`)() * (max - min + 1)), - randomPick: (list: any[]) => list[Math.floor(seedrandom(`${randomSeed}:${expr.id}`)() * list.length)], - dailyRandom: (probability: number) => Math.floor(seedrandom(`${day}:${expr.id}`)() * 100) < probability, - dailyRannum: (min: number, max: number) => min + Math.floor(seedrandom(`${day}:${expr.id}`)() * (max - min + 1)), - dailyRandomPick: (list: any[]) => list[Math.floor(seedrandom(`${day}:${expr.id}`)() * list.length)], - seedRandom: (seed: any, probability: number) => Math.floor(seedrandom(seed)() * 100) < probability, - seedRannum: (seed: any, min: number, max: number) => min + Math.floor(seedrandom(seed)() * (max - min + 1)), - seedRandomPick: (seed: any, list: any[]) => list[Math.floor(seedrandom(seed)() * list.length)], - DRPWPM: (list: string[]) => { - const xs: any[] = []; - let totalFactor = 0; - for (const x of list) { - const parts = x.split(' '); - const factor = parseInt(parts.pop()!, 10); - const text = parts.join(' '); - totalFactor += factor; - xs.push({ factor, text }); - } - const r = seedrandom(`${day}:${expr.id}`)() * totalFactor; - let stackedFactor = 0; - for (const x of xs) { - if (r >= stackedFactor && r <= stackedFactor + x.factor) { - return x.text; - } else { - stackedFactor += x.factor; - } - } - return xs[0].text; - }, - }; - - return funcs; -} diff --git a/src/client/scripts/hpml/type-checker.ts b/src/client/scripts/hpml/type-checker.ts deleted file mode 100644 index 9633b3cd01..0000000000 --- a/src/client/scripts/hpml/type-checker.ts +++ /dev/null @@ -1,189 +0,0 @@ -import autobind from 'autobind-decorator'; -import { Type, envVarsDef, PageVar } from '.'; -import { Expr, isLiteralValue, Variable } from './expr'; -import { funcDefs } from './lib'; - -type TypeError = { - arg: number; - expect: Type; - actual: Type; -}; - -/** - * Hpml type checker - */ -export class HpmlTypeChecker { - public variables: Variable[]; - public pageVars: PageVar[]; - - constructor(variables: HpmlTypeChecker['variables'] = [], pageVars: HpmlTypeChecker['pageVars'] = []) { - this.variables = variables; - this.pageVars = pageVars; - } - - @autobind - public typeCheck(v: Expr): TypeError | null { - if (isLiteralValue(v)) return null; - - const def = funcDefs[v.type || '']; - if (def == null) { - throw new Error('Unknown type: ' + v.type); - } - - const generic: Type[] = []; - - for (let i = 0; i < def.in.length; i++) { - const arg = def.in[i]; - const type = this.infer(v.args[i]); - if (type === null) continue; - - if (typeof arg === 'number') { - if (generic[arg] === undefined) { - generic[arg] = type; - } else if (type !== generic[arg]) { - return { - arg: i, - expect: generic[arg], - actual: type - }; - } - } else if (type !== arg) { - return { - arg: i, - expect: arg, - actual: type - }; - } - } - - return null; - } - - @autobind - public getExpectedType(v: Expr, slot: number): Type { - const def = funcDefs[v.type || '']; - if (def == null) { - throw new Error('Unknown type: ' + v.type); - } - - const generic: Type[] = []; - - for (let i = 0; i < def.in.length; i++) { - const arg = def.in[i]; - const type = this.infer(v.args[i]); - if (type === null) continue; - - if (typeof arg === 'number') { - if (generic[arg] === undefined) { - generic[arg] = type; - } - } - } - - if (typeof def.in[slot] === 'number') { - return generic[def.in[slot]] || null; - } else { - return def.in[slot]; - } - } - - @autobind - public infer(v: Expr): Type { - if (v.type === null) return null; - if (v.type === 'text') return 'string'; - if (v.type === 'multiLineText') return 'string'; - if (v.type === 'textList') return 'stringArray'; - if (v.type === 'number') return 'number'; - if (v.type === 'ref') { - const variable = this.variables.find(va => va.name === v.value); - if (variable) { - return this.infer(variable); - } - - const pageVar = this.pageVars.find(va => va.name === v.value); - if (pageVar) { - return pageVar.type; - } - - const envVar = envVarsDef[v.value || '']; - if (envVar !== undefined) { - return envVar; - } - - return null; - } - if (v.type === 'aiScriptVar') return null; - if (v.type === 'fn') return null; // todo - if (v.type.startsWith('fn:')) return null; // todo - - const generic: Type[] = []; - - const def = funcDefs[v.type]; - - for (let i = 0; i < def.in.length; i++) { - const arg = def.in[i]; - if (typeof arg === 'number') { - const type = this.infer(v.args[i]); - - if (generic[arg] === undefined) { - generic[arg] = type; - } else { - if (type !== generic[arg]) { - generic[arg] = null; - } - } - } - } - - if (typeof def.out === 'number') { - return generic[def.out]; - } else { - return def.out; - } - } - - @autobind - public getVarByName(name: string): Variable { - const v = this.variables.find(x => x.name === name); - if (v !== undefined) { - return v; - } else { - throw new Error(`No such variable '${name}'`); - } - } - - @autobind - public getVarsByType(type: Type): Variable[] { - if (type == null) return this.variables; - return this.variables.filter(x => (this.infer(x) === null) || (this.infer(x) === type)); - } - - @autobind - public getEnvVarsByType(type: Type): string[] { - if (type == null) return Object.keys(envVarsDef); - return Object.entries(envVarsDef).filter(([k, v]) => v === null || type === v).map(([k, v]) => k); - } - - @autobind - public getPageVarsByType(type: Type): string[] { - if (type == null) return this.pageVars.map(v => v.name); - return this.pageVars.filter(v => type === v.type).map(v => v.name); - } - - @autobind - public isUsedName(name: string) { - if (this.variables.some(v => v.name === name)) { - return true; - } - - if (this.pageVars.some(v => v.name === name)) { - return true; - } - - if (envVarsDef[name]) { - return true; - } - - return false; - } -} diff --git a/src/client/scripts/idb-proxy.ts b/src/client/scripts/idb-proxy.ts deleted file mode 100644 index 5f76ae30bb..0000000000 --- a/src/client/scripts/idb-proxy.ts +++ /dev/null @@ -1,37 +0,0 @@ -// FirefoxのプライベートモードなどではindexedDBが使用不可能なので、 -// indexedDBが使えない環境ではlocalStorageを使う -import { - get as iget, - set as iset, - del as idel, -} from 'idb-keyval'; - -const fallbackName = (key: string) => `idbfallback::${key}`; - -let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true; - -if (idbAvailable) { - try { - await iset('idb-test', 'test'); - } catch (e) { - console.error('idb error', e); - idbAvailable = false; - } -} - -if (!idbAvailable) console.error('indexedDB is unavailable. It will use localStorage.'); - -export async function get(key: string) { - if (idbAvailable) return iget(key); - return JSON.parse(localStorage.getItem(fallbackName(key))); -} - -export async function set(key: string, val: any) { - if (idbAvailable) return iset(key, val); - return localStorage.setItem(fallbackName(key), JSON.stringify(val)); -} - -export async function del(key: string) { - if (idbAvailable) return idel(key); - return localStorage.removeItem(fallbackName(key)); -} diff --git a/src/client/scripts/initialize-sw.ts b/src/client/scripts/initialize-sw.ts deleted file mode 100644 index 6f1874572a..0000000000 --- a/src/client/scripts/initialize-sw.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { instance } from '@client/instance'; -import { $i } from '@client/account'; -import { api } from '@client/os'; -import { lang } from '@client/config'; - -export async function initializeSw() { - if (instance.swPublickey && - ('serviceWorker' in navigator) && - ('PushManager' in window) && - $i && $i.token) { - navigator.serviceWorker.register(`/sw.js`); - - navigator.serviceWorker.ready.then(registration => { - registration.active?.postMessage({ - msg: 'initialize', - lang, - }); - // SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters - registration.pushManager.subscribe({ - userVisibleOnly: true, - applicationServerKey: urlBase64ToUint8Array(instance.swPublickey) - }).then(subscription => { - function encode(buffer: ArrayBuffer | null) { - return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))); - } - - // Register - api('sw/register', { - endpoint: subscription.endpoint, - auth: encode(subscription.getKey('auth')), - publickey: encode(subscription.getKey('p256dh')) - }); - }) - // When subscribe failed - .catch(async (err: Error) => { - // 通知が許可されていなかったとき - if (err.name === 'NotAllowedError') { - return; - } - - // 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが - // 既に存在していることが原因でエラーになった可能性があるので、 - // そのサブスクリプションを解除しておく - const subscription = await registration.pushManager.getSubscription(); - if (subscription) subscription.unsubscribe(); - }); - }); - } -} - -/** - * Convert the URL safe base64 string to a Uint8Array - * @param base64String base64 string - */ -function urlBase64ToUint8Array(base64String: string): Uint8Array { - const padding = '='.repeat((4 - base64String.length % 4) % 4); - const base64 = (base64String + padding) - .replace(/-/g, '+') - .replace(/_/g, '/'); - - const rawData = window.atob(base64); - const outputArray = new Uint8Array(rawData.length); - - for (let i = 0; i < rawData.length; ++i) { - outputArray[i] = rawData.charCodeAt(i); - } - return outputArray; -} diff --git a/src/client/scripts/is-device-darkmode.ts b/src/client/scripts/is-device-darkmode.ts deleted file mode 100644 index 854f38e517..0000000000 --- a/src/client/scripts/is-device-darkmode.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function isDeviceDarkmode() { - return window.matchMedia('(prefers-color-scheme: dark)').matches; -} diff --git a/src/client/scripts/is-device-touch.ts b/src/client/scripts/is-device-touch.ts deleted file mode 100644 index 3f0bfefed2..0000000000 --- a/src/client/scripts/is-device-touch.ts +++ /dev/null @@ -1 +0,0 @@ -export const isDeviceTouch = 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0; diff --git a/src/client/scripts/is-mobile.ts b/src/client/scripts/is-mobile.ts deleted file mode 100644 index 60cb59f91e..0000000000 --- a/src/client/scripts/is-mobile.ts +++ /dev/null @@ -1,2 +0,0 @@ -const ua = navigator.userAgent.toLowerCase(); -export const isMobile = /mobile|iphone|ipad|android/.test(ua); diff --git a/src/client/scripts/keycode.ts b/src/client/scripts/keycode.ts deleted file mode 100644 index c127d54bb2..0000000000 --- a/src/client/scripts/keycode.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default (input: string): string[] => { - if (Object.keys(aliases).some(a => a.toLowerCase() === input.toLowerCase())) { - const codes = aliases[input]; - return Array.isArray(codes) ? codes : [codes]; - } else { - return [input]; - } -}; - -export const aliases = { - 'esc': 'Escape', - 'enter': ['Enter', 'NumpadEnter'], - 'up': 'ArrowUp', - 'down': 'ArrowDown', - 'left': 'ArrowLeft', - 'right': 'ArrowRight', - 'plus': ['NumpadAdd', 'Semicolon'], -}; - -/*! -* Programatically add the following -*/ - -// lower case chars -for (let i = 97; i < 123; i++) { - const char = String.fromCharCode(i); - aliases[char] = `Key${char.toUpperCase()}`; -} - -// numbers -for (let i = 0; i < 10; i++) { - aliases[i] = [`Numpad${i}`, `Digit${i}`]; -} diff --git a/src/client/scripts/loading.ts b/src/client/scripts/loading.ts deleted file mode 100644 index 4b0a560e34..0000000000 --- a/src/client/scripts/loading.ts +++ /dev/null @@ -1,11 +0,0 @@ -export default { - start: () => { - // TODO - }, - done: () => { - // TODO - }, - set: val => { - // TODO - } -}; diff --git a/src/client/scripts/login-id.ts b/src/client/scripts/login-id.ts deleted file mode 100644 index 0f9c6be4a9..0000000000 --- a/src/client/scripts/login-id.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function getUrlWithLoginId(url: string, loginId: string) { - const u = new URL(url, origin); - u.searchParams.append('loginId', loginId); - return u.toString(); -} - -export function getUrlWithoutLoginId(url: string) { - const u = new URL(url); - u.searchParams.delete('loginId'); - return u.toString(); -} diff --git a/src/client/scripts/lookup-user.ts b/src/client/scripts/lookup-user.ts deleted file mode 100644 index c393472ae8..0000000000 --- a/src/client/scripts/lookup-user.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { parseAcct } from '@/misc/acct'; -import { i18n } from '@client/i18n'; -import * as os from '@client/os'; - -export async function lookupUser() { - const { canceled, result } = await os.dialog({ - title: i18n.locale.usernameOrUserId, - input: true - }); - if (canceled) return; - - const show = (user) => { - os.pageWindow(`/user-info/${user.id}`); - }; - - const usernamePromise = os.api('users/show', parseAcct(result)); - const idPromise = os.api('users/show', { userId: result }); - let _notFound = false; - const notFound = () => { - if (_notFound) { - os.dialog({ - type: 'error', - text: i18n.locale.noSuchUser - }); - } else { - _notFound = true; - } - }; - usernamePromise.then(show).catch(e => { - if (e.code === 'NO_SUCH_USER') { - notFound(); - } - }); - idPromise.then(show).catch(e => { - notFound(); - }); -} diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts deleted file mode 100644 index 1da518efa1..0000000000 --- a/src/client/scripts/paging.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { markRaw } from 'vue'; -import * as os from '@client/os'; -import { onScrollTop, isTopVisible, getScrollPosition, getScrollContainer } from './scroll'; - -const SECOND_FETCH_LIMIT = 30; - -// reversed: items 配列の中身を逆順にする(新しい方が最後) - -export default (opts) => ({ - emits: ['queue'], - - data() { - return { - items: [], - queue: [], - offset: 0, - fetching: true, - moreFetching: false, - inited: false, - more: false, - backed: false, // 遡り中か否か - isBackTop: false, - }; - }, - - computed: { - empty(): boolean { - return this.items.length === 0 && !this.fetching && this.inited; - }, - - error(): boolean { - return !this.fetching && !this.inited; - }, - }, - - watch: { - pagination: { - handler() { - this.init(); - }, - deep: true - }, - - queue: { - handler(a, b) { - if (a.length === 0 && b.length === 0) return; - this.$emit('queue', this.queue.length); - }, - deep: true - } - }, - - created() { - opts.displayLimit = opts.displayLimit || 30; - this.init(); - }, - - activated() { - this.isBackTop = false; - }, - - deactivated() { - this.isBackTop = window.scrollY === 0; - }, - - methods: { - reload() { - this.items = []; - this.init(); - }, - - replaceItem(finder, data) { - const i = this.items.findIndex(finder); - this.items[i] = data; - }, - - removeItem(finder) { - const i = this.items.findIndex(finder); - this.items.splice(i, 1); - }, - - async init() { - this.queue = []; - this.fetching = true; - if (opts.before) opts.before(this); - let params = typeof this.pagination.params === 'function' ? this.pagination.params(true) : this.pagination.params; - if (params && params.then) params = await params; - if (params === null) return; - const endpoint = typeof this.pagination.endpoint === 'function' ? this.pagination.endpoint() : this.pagination.endpoint; - await os.api(endpoint, { - ...params, - limit: this.pagination.noPaging ? (this.pagination.limit || 10) : (this.pagination.limit || 10) + 1, - }).then(items => { - for (let i = 0; i < items.length; i++) { - const item = items[i]; - markRaw(item); - if (this.pagination.reversed) { - if (i === items.length - 2) item._shouldInsertAd_ = true; - } else { - if (i === 3) item._shouldInsertAd_ = true; - } - } - if (!this.pagination.noPaging && (items.length > (this.pagination.limit || 10))) { - items.pop(); - this.items = this.pagination.reversed ? [...items].reverse() : items; - this.more = true; - } else { - this.items = this.pagination.reversed ? [...items].reverse() : items; - this.more = false; - } - this.offset = items.length; - this.inited = true; - this.fetching = false; - if (opts.after) opts.after(this, null); - }, e => { - this.fetching = false; - if (opts.after) opts.after(this, e); - }); - }, - - async fetchMore() { - if (!this.more || this.fetching || this.moreFetching || this.items.length === 0) return; - this.moreFetching = true; - this.backed = true; - let params = typeof this.pagination.params === 'function' ? this.pagination.params(false) : this.pagination.params; - if (params && params.then) params = await params; - const endpoint = typeof this.pagination.endpoint === 'function' ? this.pagination.endpoint() : this.pagination.endpoint; - await os.api(endpoint, { - ...params, - limit: SECOND_FETCH_LIMIT + 1, - ...(this.pagination.offsetMode ? { - offset: this.offset, - } : { - untilId: this.pagination.reversed ? this.items[0].id : this.items[this.items.length - 1].id, - }), - }).then(items => { - for (let i = 0; i < items.length; i++) { - const item = items[i]; - markRaw(item); - if (this.pagination.reversed) { - if (i === items.length - 9) item._shouldInsertAd_ = true; - } else { - if (i === 10) item._shouldInsertAd_ = true; - } - } - if (items.length > SECOND_FETCH_LIMIT) { - items.pop(); - this.items = this.pagination.reversed ? [...items].reverse().concat(this.items) : this.items.concat(items); - this.more = true; - } else { - this.items = this.pagination.reversed ? [...items].reverse().concat(this.items) : this.items.concat(items); - this.more = false; - } - this.offset += items.length; - this.moreFetching = false; - }, e => { - this.moreFetching = false; - }); - }, - - async fetchMoreFeature() { - if (!this.more || this.fetching || this.moreFetching || this.items.length === 0) return; - this.moreFetching = true; - let params = typeof this.pagination.params === 'function' ? this.pagination.params(false) : this.pagination.params; - if (params && params.then) params = await params; - const endpoint = typeof this.pagination.endpoint === 'function' ? this.pagination.endpoint() : this.pagination.endpoint; - await os.api(endpoint, { - ...params, - limit: SECOND_FETCH_LIMIT + 1, - ...(this.pagination.offsetMode ? { - offset: this.offset, - } : { - sinceId: this.pagination.reversed ? this.items[0].id : this.items[this.items.length - 1].id, - }), - }).then(items => { - for (const item of items) { - markRaw(item); - } - if (items.length > SECOND_FETCH_LIMIT) { - items.pop(); - this.items = this.pagination.reversed ? [...items].reverse().concat(this.items) : this.items.concat(items); - this.more = true; - } else { - this.items = this.pagination.reversed ? [...items].reverse().concat(this.items) : this.items.concat(items); - this.more = false; - } - this.offset += items.length; - this.moreFetching = false; - }, e => { - this.moreFetching = false; - }); - }, - - prepend(item) { - if (this.pagination.reversed) { - const container = getScrollContainer(this.$el); - const pos = getScrollPosition(this.$el); - const viewHeight = container.clientHeight; - const height = container.scrollHeight; - const isBottom = (pos + viewHeight > height - 32); - if (isBottom) { - // オーバーフローしたら古いアイテムは捨てる - if (this.items.length >= opts.displayLimit) { - // このやり方だとVue 3.2以降アニメーションが動かなくなる - //this.items = this.items.slice(-opts.displayLimit); - while (this.items.length >= opts.displayLimit) { - this.items.shift(); - } - this.more = true; - } - } - this.items.push(item); - // TODO - } else { - const isTop = this.isBackTop || (document.body.contains(this.$el) && isTopVisible(this.$el)); - - if (isTop) { - // Prepend the item - this.items.unshift(item); - - // オーバーフローしたら古いアイテムは捨てる - if (this.items.length >= opts.displayLimit) { - // このやり方だとVue 3.2以降アニメーションが動かなくなる - //this.items = this.items.slice(0, opts.displayLimit); - while (this.items.length >= opts.displayLimit) { - this.items.pop(); - } - this.more = true; - } - } else { - this.queue.push(item); - onScrollTop(this.$el, () => { - for (const item of this.queue) { - this.prepend(item); - } - this.queue = []; - }); - } - } - }, - - append(item) { - this.items.push(item); - }, - } -}); diff --git a/src/client/scripts/physics.ts b/src/client/scripts/physics.ts deleted file mode 100644 index 445b6296eb..0000000000 --- a/src/client/scripts/physics.ts +++ /dev/null @@ -1,152 +0,0 @@ -import * as Matter from 'matter-js'; - -export function physics(container: HTMLElement) { - const containerWidth = container.offsetWidth; - const containerHeight = container.offsetHeight; - const containerCenterX = containerWidth / 2; - - // サイズ固定化(要らないかも?) - container.style.position = 'relative'; - container.style.boxSizing = 'border-box'; - container.style.width = `${containerWidth}px`; - container.style.height = `${containerHeight}px`; - - // create engine - const engine = Matter.Engine.create({ - constraintIterations: 4, - positionIterations: 8, - velocityIterations: 8, - }); - - const world = engine.world; - - // create renderer - const render = Matter.Render.create({ - engine: engine, - //element: document.getElementById('debug'), - options: { - width: containerWidth, - height: containerHeight, - background: 'transparent', // transparent to hide - wireframeBackground: 'transparent', // transparent to hide - } - }); - - // Disable to hide debug - Matter.Render.run(render); - - // create runner - const runner = Matter.Runner.create(); - Matter.Runner.run(runner, engine); - - const groundThickness = 1024; - const ground = Matter.Bodies.rectangle(containerCenterX, containerHeight + (groundThickness / 2), containerWidth, groundThickness, { - isStatic: true, - restitution: 0.1, - friction: 2 - }); - - //const wallRight = Matter.Bodies.rectangle(window.innerWidth+50, window.innerHeight/2, 100, window.innerHeight, wallopts); - //const wallLeft = Matter.Bodies.rectangle(-50, window.innerHeight/2, 100, window.innerHeight, wallopts); - - Matter.World.add(world, [ - ground, - //wallRight, - //wallLeft, - ]); - - const objEls = Array.from(container.children); - const objs = []; - for (const objEl of objEls) { - const left = objEl.dataset.physicsX ? parseInt(objEl.dataset.physicsX) : objEl.offsetLeft; - const top = objEl.dataset.physicsY ? parseInt(objEl.dataset.physicsY) : objEl.offsetTop; - - let obj; - if (objEl.classList.contains('_physics_circle_')) { - obj = Matter.Bodies.circle( - left + (objEl.offsetWidth / 2), - top + (objEl.offsetHeight / 2), - Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2, - { - restitution: 0.5 - } - ); - } else { - const style = window.getComputedStyle(objEl); - obj = Matter.Bodies.rectangle( - left + (objEl.offsetWidth / 2), - top + (objEl.offsetHeight / 2), - objEl.offsetWidth, - objEl.offsetHeight, - { - chamfer: { radius: parseInt(style.borderRadius || '0', 10) }, - restitution: 0.5 - } - ); - } - objEl.id = obj.id; - objs.push(obj); - } - - Matter.World.add(engine.world, objs); - - // Add mouse control - - const mouse = Matter.Mouse.create(container); - const mouseConstraint = Matter.MouseConstraint.create(engine, { - mouse: mouse, - constraint: { - stiffness: 0.1, - render: { - visible: false - } - } - }); - - Matter.World.add(engine.world, mouseConstraint); - - // keep the mouse in sync with rendering - render.mouse = mouse; - - for (const objEl of objEls) { - objEl.style.position = `absolute`; - objEl.style.top = 0; - objEl.style.left = 0; - objEl.style.margin = 0; - } - - window.requestAnimationFrame(update); - - let stop = false; - - function update() { - for (const objEl of objEls) { - const obj = objs.find(obj => obj.id.toString() === objEl.id.toString()); - if (obj == null) continue; - - const x = (obj.position.x - objEl.offsetWidth / 2); - const y = (obj.position.y - objEl.offsetHeight / 2); - const angle = obj.angle; - objEl.style.transform = `translate(${x}px, ${y}px) rotate(${angle}rad)`; - } - - if (!stop) { - window.requestAnimationFrame(update); - } - } - - // 奈落に落ちたオブジェクトは消す - const intervalId = setInterval(() => { - for (const obj of objs) { - if (obj.position.y > (containerHeight + 1024)) Matter.World.remove(world, obj); - } - }, 1000 * 10); - - return { - stop: () => { - stop = true; - Matter.Runner.stop(runner); - clearInterval(intervalId); - } - }; -} diff --git a/src/client/scripts/please-login.ts b/src/client/scripts/please-login.ts deleted file mode 100644 index a584e9fa96..0000000000 --- a/src/client/scripts/please-login.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { $i } from '@client/account'; -import { i18n } from '@client/i18n'; -import { dialog } from '@client/os'; - -export function pleaseLogin() { - if ($i) return; - - dialog({ - title: i18n.locale.signinRequired, - text: null - }); - - throw new Error('signin required'); -} diff --git a/src/client/scripts/popout.ts b/src/client/scripts/popout.ts deleted file mode 100644 index 6d92af4a05..0000000000 --- a/src/client/scripts/popout.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as config from '@client/config'; - -export function popout(path: string, w?: HTMLElement) { - let url = path.startsWith('http://') || path.startsWith('https://') ? path : config.url + path; - url += '?zen'; // TODO: ちゃんとURLパースしてクエリ付ける - if (w) { - const position = w.getBoundingClientRect(); - const width = parseInt(getComputedStyle(w, '').width, 10); - const height = parseInt(getComputedStyle(w, '').height, 10); - const x = window.screenX + position.left; - const y = window.screenY + position.top; - window.open(url, url, - `width=${width}, height=${height}, top=${y}, left=${x}`); - } else { - const width = 400; - const height = 500; - const x = window.top.outerHeight / 2 + window.top.screenY - (height / 2); - const y = window.top.outerWidth / 2 + window.top.screenX - (width / 2); - window.open(url, url, - `width=${width}, height=${height}, top=${x}, left=${y}`); - } -} diff --git a/src/client/scripts/reaction-picker.ts b/src/client/scripts/reaction-picker.ts deleted file mode 100644 index 38699c0979..0000000000 --- a/src/client/scripts/reaction-picker.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Ref, ref } from 'vue'; -import { popup } from '@client/os'; - -class ReactionPicker { - private src: Ref = ref(null); - private manualShowing = ref(false); - private onChosen?: Function; - private onClosed?: Function; - - constructor() { - // nop - } - - public async init() { - await popup(import('@client/components/emoji-picker-dialog.vue'), { - src: this.src, - asReactionPicker: true, - manualShowing: this.manualShowing - }, { - done: reaction => { - this.onChosen!(reaction); - }, - close: () => { - this.manualShowing.value = false; - }, - closed: () => { - this.src.value = null; - this.onClosed!(); - } - }); - } - - public show(src: HTMLElement, onChosen: Function, onClosed: Function) { - this.src.value = src; - this.manualShowing.value = true; - this.onChosen = onChosen; - this.onClosed = onClosed; - } -} - -export const reactionPicker = new ReactionPicker(); diff --git a/src/client/scripts/room/furniture.ts b/src/client/scripts/room/furniture.ts deleted file mode 100644 index 7734e32668..0000000000 --- a/src/client/scripts/room/furniture.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type RoomInfo = { - roomType: string; - carpetColor: string; - furnitures: Furniture[]; -}; - -export type Furniture = { - id: string; // 同じ家具が複数ある場合にそれぞれを識別するためのIDであり、家具IDではない - type: string; // こっちが家具ID(chairとか) - position: { - x: number; - y: number; - z: number; - }; - rotation: { - x: number; - y: number; - z: number; - }; - props?: Record; -}; diff --git a/src/client/scripts/room/furnitures.json5 b/src/client/scripts/room/furnitures.json5 deleted file mode 100644 index 4a40994107..0000000000 --- a/src/client/scripts/room/furnitures.json5 +++ /dev/null @@ -1,407 +0,0 @@ -// 家具メタデータ - -// 家具IDはglbファイル及びそのディレクトリ名と一致する必要があります - -// 家具にはユーザーが設定できるプロパティを設定可能です: -// -// props: { -// : -// } -// -// proptype一覧: -// * image ... 画像選択ダイアログを出し、その画像のURLが格納されます -// * color ... 色選択コントロールを出し、選択された色が格納されます - -// 家具にカスタムテクスチャを適用できるようにするには、textureプロパティに以下の追加の情報を含めます: -// 便宜上そのUVのどの部分にカスタムテクスチャを貼り合わせるかのエリアをテクスチャエリアと呼びます。 -// UVは1024*1024だと仮定します。 -// -// : { -// prop: <プロパティ名>, -// uv: { -// x: <テクスチャエリアX座標>, -// y: <テクスチャエリアY座標>, -// width: <テクスチャエリアの幅>, -// height: <テクスチャエリアの高さ>, -// }, -// } -// -// には、カスタムテクスチャを適用したいメッシュ名を指定します -// <プロパティ名>には、カスタムテクスチャとして使用する画像を格納するプロパティ(前述)名を指定します - -// 家具にカスタムカラーを適用できるようにするには、colorプロパティに以下の追加の情報を含めます: -// -// : <プロパティ名> -// -// には、カスタムカラーを適用したいマテリアル名を指定します -// <プロパティ名>には、カスタムカラーとして使用する色を格納するプロパティ(前述)名を指定します - -[ - { - id: "milk", - place: "floor" - }, - { - id: "bed", - place: "floor" - }, - { - id: "low-table", - place: "floor", - props: { - color: 'color' - }, - color: { - Table: 'color' - } - }, - { - id: "desk", - place: "floor", - props: { - color: 'color' - }, - color: { - Board: 'color' - } - }, - { - id: "chair", - place: "floor", - props: { - color: 'color' - }, - color: { - Chair: 'color' - } - }, - { - id: "chair2", - place: "floor", - props: { - color1: 'color', - color2: 'color' - }, - color: { - Cushion: 'color1', - Leg: 'color2' - } - }, - { - id: "fan", - place: "wall" - }, - { - id: "pc", - place: "floor" - }, - { - id: "plant", - place: "floor" - }, - { - id: "plant2", - place: "floor" - }, - { - id: "eraser", - place: "floor" - }, - { - id: "pencil", - place: "floor" - }, - { - id: "pudding", - place: "floor" - }, - { - id: "cardboard-box", - place: "floor" - }, - { - id: "cardboard-box2", - place: "floor" - }, - { - id: "cardboard-box3", - place: "floor" - }, - { - id: "book", - place: "floor", - props: { - color: 'color' - }, - color: { - Cover: 'color' - } - }, - { - id: "book2", - place: "floor" - }, - { - id: "piano", - place: "floor" - }, - { - id: "facial-tissue", - place: "floor" - }, - { - id: "server", - place: "floor" - }, - { - id: "moon", - place: "floor" - }, - { - id: "corkboard", - place: "wall" - }, - { - id: "mousepad", - place: "floor", - props: { - color: 'color' - }, - color: { - Pad: 'color' - } - }, - { - id: "monitor", - place: "floor", - props: { - screen: 'image' - }, - texture: { - Screen: { - prop: 'screen', - uv: { - x: 0, - y: 434, - width: 1024, - height: 588, - }, - }, - }, - }, - { - id: "tv", - place: "floor", - props: { - screen: 'image' - }, - texture: { - Screen: { - prop: 'screen', - uv: { - x: 0, - y: 434, - width: 1024, - height: 588, - }, - }, - }, - }, - { - id: "keyboard", - place: "floor" - }, - { - id: "carpet-stripe", - place: "floor", - props: { - color1: 'color', - color2: 'color' - }, - color: { - CarpetAreaA: 'color1', - CarpetAreaB: 'color2' - }, - }, - { - id: "mat", - place: "floor", - props: { - color: 'color' - }, - color: { - Mat: 'color' - } - }, - { - id: "color-box", - place: "floor", - props: { - color: 'color' - }, - color: { - main: 'color' - } - }, - { - id: "wall-clock", - place: "wall" - }, - { - id: "cube", - place: "floor", - props: { - color: 'color' - }, - color: { - Cube: 'color' - } - }, - { - id: "photoframe", - place: "wall", - props: { - photo: 'image', - color: 'color' - }, - texture: { - Photo: { - prop: 'photo', - uv: { - x: 0, - y: 342, - width: 1024, - height: 683, - }, - }, - }, - color: { - Frame: 'color' - } - }, - { - id: "pinguin", - place: "floor", - props: { - body: 'color', - belly: 'color' - }, - color: { - Body: 'body', - Belly: 'belly', - } - }, - { - id: "rubik-cube", - place: "floor", - }, - { - id: "poster-h", - place: "wall", - props: { - picture: 'image' - }, - texture: { - Poster: { - prop: 'picture', - uv: { - x: 0, - y: 277, - width: 1024, - height: 745, - }, - }, - }, - }, - { - id: "poster-v", - place: "wall", - props: { - picture: 'image' - }, - texture: { - Poster: { - prop: 'picture', - uv: { - x: 0, - y: 0, - width: 745, - height: 1024, - }, - }, - }, - }, - { - id: "sofa", - place: "floor", - props: { - color: 'color' - }, - color: { - Sofa: 'color' - } - }, - { - id: "spiral", - place: "floor", - props: { - color: 'color' - }, - color: { - Step: 'color' - } - }, - { - id: "bin", - place: "floor", - props: { - color: 'color' - }, - color: { - Bin: 'color' - } - }, - { - id: "cup-noodle", - place: "floor" - }, - { - id: "holo-display", - place: "floor", - props: { - image: 'image' - }, - texture: { - Image_Front: { - prop: 'image', - uv: { - x: 0, - y: 0, - width: 1024, - height: 1024, - }, - }, - Image_Back: { - prop: 'image', - uv: { - x: 0, - y: 0, - width: 1024, - height: 1024, - }, - }, - }, - }, - { - id: 'energy-drink', - place: "floor", - }, - { - id: 'doll-ai', - place: "floor", - }, - { - id: 'banknote', - place: "floor", - }, -] diff --git a/src/client/scripts/room/room.ts b/src/client/scripts/room/room.ts deleted file mode 100644 index 4450210c6c..0000000000 --- a/src/client/scripts/room/room.ts +++ /dev/null @@ -1,775 +0,0 @@ -import autobind from 'autobind-decorator'; -import { v4 as uuid } from 'uuid'; -import * as THREE from 'three'; -import { GLTFLoader, GLTF } from 'three/examples/jsm/loaders/GLTFLoader'; -import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; -import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; -import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js'; -import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'; -import { BloomPass } from 'three/examples/jsm/postprocessing/BloomPass.js'; -import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader.js'; -import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js'; -import { Furniture, RoomInfo } from './furniture'; -import { query as urlQuery } from '../../../prelude/url'; -const furnitureDefs = require('./furnitures.json5'); - -THREE.ImageUtils.crossOrigin = ''; - -type Options = { - graphicsQuality: Room['graphicsQuality']; - onChangeSelect: Room['onChangeSelect']; - useOrthographicCamera: boolean; -}; - -/** - * MisskeyRoom Core Engine - */ -export class Room { - private clock: THREE.Clock; - private scene: THREE.Scene; - private renderer: THREE.WebGLRenderer; - private camera: THREE.PerspectiveCamera | THREE.OrthographicCamera; - private controls: OrbitControls; - private composer: EffectComposer; - private mixers: THREE.AnimationMixer[] = []; - private furnitureControl: TransformControls; - private roomInfo: RoomInfo; - private graphicsQuality: 'cheep' | 'low' | 'medium' | 'high' | 'ultra'; - private roomObj: THREE.Object3D; - private objects: THREE.Object3D[] = []; - private selectedObject: THREE.Object3D = null; - private onChangeSelect: Function; - private isTransformMode = false; - private renderFrameRequestId: number; - - private get canvas(): HTMLCanvasElement { - return this.renderer.domElement; - } - - private get furnitures(): Furniture[] { - return this.roomInfo.furnitures; - } - - private set furnitures(furnitures: Furniture[]) { - this.roomInfo.furnitures = furnitures; - } - - private get enableShadow() { - return this.graphicsQuality != 'cheep'; - } - - private get usePostFXs() { - return this.graphicsQuality !== 'cheep' && this.graphicsQuality !== 'low'; - } - - private get shadowQuality() { - return ( - this.graphicsQuality === 'ultra' ? 16384 : - this.graphicsQuality === 'high' ? 8192 : - this.graphicsQuality === 'medium' ? 4096 : - this.graphicsQuality === 'low' ? 1024 : - 0); // cheep - } - - constructor(user, isMyRoom, roomInfo: RoomInfo, container: Element, options: Options) { - this.roomInfo = roomInfo; - this.graphicsQuality = options.graphicsQuality; - this.onChangeSelect = options.onChangeSelect; - - this.clock = new THREE.Clock(true); - - //#region Init a scene - this.scene = new THREE.Scene(); - - const width = container.clientWidth; - const height = container.clientHeight; - - //#region Init a renderer - this.renderer = new THREE.WebGLRenderer({ - antialias: false, - stencil: false, - alpha: false, - powerPreference: - this.graphicsQuality === 'ultra' ? 'high-performance' : - this.graphicsQuality === 'high' ? 'high-performance' : - this.graphicsQuality === 'medium' ? 'default' : - this.graphicsQuality === 'low' ? 'low-power' : - 'low-power' // cheep - }); - - this.renderer.setPixelRatio(window.devicePixelRatio); - this.renderer.setSize(width, height); - this.renderer.autoClear = false; - this.renderer.setClearColor(new THREE.Color(0x051f2d)); - this.renderer.shadowMap.enabled = this.enableShadow; - this.renderer.shadowMap.type = - this.graphicsQuality === 'ultra' ? THREE.PCFSoftShadowMap : - this.graphicsQuality === 'high' ? THREE.PCFSoftShadowMap : - this.graphicsQuality === 'medium' ? THREE.PCFShadowMap : - this.graphicsQuality === 'low' ? THREE.BasicShadowMap : - THREE.BasicShadowMap; // cheep - - container.insertBefore(this.canvas, container.firstChild); - //#endregion - - //#region Init a camera - this.camera = options.useOrthographicCamera - ? new THREE.OrthographicCamera( - width / - 2, width / 2, height / 2, height / - 2, -10, 10) - : new THREE.PerspectiveCamera(45, width / height); - - if (options.useOrthographicCamera) { - this.camera.position.x = 2; - this.camera.position.y = 2; - this.camera.position.z = 2; - this.camera.zoom = 100; - this.camera.updateProjectionMatrix(); - } else { - this.camera.position.x = 5; - this.camera.position.y = 2; - this.camera.position.z = 5; - } - - this.scene.add(this.camera); - //#endregion - - //#region AmbientLight - const ambientLight = new THREE.AmbientLight(0xffffff, 1); - this.scene.add(ambientLight); - //#endregion - - if (this.graphicsQuality !== 'cheep') { - //#region Room light - const roomLight = new THREE.SpotLight(0xffffff, 0.1); - - roomLight.position.set(0, 8, 0); - roomLight.castShadow = this.enableShadow; - roomLight.shadow.bias = -0.0001; - roomLight.shadow.mapSize.width = this.shadowQuality; - roomLight.shadow.mapSize.height = this.shadowQuality; - roomLight.shadow.camera.near = 0.1; - roomLight.shadow.camera.far = 9; - roomLight.shadow.camera.fov = 45; - - this.scene.add(roomLight); - //#endregion - } - - //#region Out light - const outLight1 = new THREE.SpotLight(0xffffff, 0.4); - outLight1.position.set(9, 3, -2); - outLight1.castShadow = this.enableShadow; - outLight1.shadow.bias = -0.001; // アクネ、アーチファクト対策 その代わりピーターパンが発生する可能性がある - outLight1.shadow.mapSize.width = this.shadowQuality; - outLight1.shadow.mapSize.height = this.shadowQuality; - outLight1.shadow.camera.near = 6; - outLight1.shadow.camera.far = 15; - outLight1.shadow.camera.fov = 45; - this.scene.add(outLight1); - - const outLight2 = new THREE.SpotLight(0xffffff, 0.2); - outLight2.position.set(-2, 3, 9); - outLight2.castShadow = false; - outLight2.shadow.bias = -0.001; // アクネ、アーチファクト対策 その代わりピーターパンが発生する可能性がある - outLight2.shadow.camera.near = 6; - outLight2.shadow.camera.far = 15; - outLight2.shadow.camera.fov = 45; - this.scene.add(outLight2); - //#endregion - - //#region Init a controller - this.controls = new OrbitControls(this.camera, this.canvas); - - this.controls.target.set(0, 1, 0); - this.controls.enableZoom = true; - this.controls.enablePan = isMyRoom; - this.controls.minPolarAngle = 0; - this.controls.maxPolarAngle = Math.PI / 2; - this.controls.minAzimuthAngle = 0; - this.controls.maxAzimuthAngle = Math.PI / 2; - this.controls.enableDamping = true; - this.controls.dampingFactor = 0.2; - //#endregion - - //#region POST FXs - if (!this.usePostFXs) { - this.composer = null; - } else { - const renderTarget = new THREE.WebGLRenderTarget(width, height, { - minFilter: THREE.LinearFilter, - magFilter: THREE.LinearFilter, - format: THREE.RGBFormat, - stencilBuffer: false, - }); - - const fxaa = new ShaderPass(FXAAShader); - fxaa.uniforms['resolution'].value = new THREE.Vector2(1 / width, 1 / height); - fxaa.renderToScreen = true; - - this.composer = new EffectComposer(this.renderer, renderTarget); - this.composer.addPass(new RenderPass(this.scene, this.camera)); - if (this.graphicsQuality === 'ultra') { - this.composer.addPass(new BloomPass(0.25, 30, 128.0, 512)); - } - this.composer.addPass(fxaa); - } - //#endregion - //#endregion - - //#region Label - //#region Avatar - const avatarUrl = `/proxy/?${urlQuery({ url: user.avatarUrl })}`; - - const textureLoader = new THREE.TextureLoader(); - textureLoader.crossOrigin = 'anonymous'; - - const iconTexture = textureLoader.load(avatarUrl); - iconTexture.wrapS = THREE.RepeatWrapping; - iconTexture.wrapT = THREE.RepeatWrapping; - iconTexture.anisotropy = 16; - - const avatarMaterial = new THREE.MeshBasicMaterial({ - map: iconTexture, - side: THREE.DoubleSide, - alphaTest: 0.5 - }); - - const iconGeometry = new THREE.PlaneGeometry(1, 1); - - const avatarObject = new THREE.Mesh(iconGeometry, avatarMaterial); - avatarObject.position.set(-3, 2.5, 2); - avatarObject.rotation.y = Math.PI / 2; - avatarObject.castShadow = false; - - this.scene.add(avatarObject); - //#endregion - - //#region Username - const name = user.username; - - new THREE.FontLoader().load('/assets/fonts/helvetiker_regular.typeface.json', font => { - const nameGeometry = new THREE.TextGeometry(name, { - size: 0.5, - height: 0, - curveSegments: 8, - font: font, - bevelThickness: 0, - bevelSize: 0, - bevelEnabled: false - }); - - const nameMaterial = new THREE.MeshLambertMaterial({ - color: 0xffffff - }); - - const nameObject = new THREE.Mesh(nameGeometry, nameMaterial); - nameObject.position.set(-3, 2.25, 1.25); - nameObject.rotation.y = Math.PI / 2; - nameObject.castShadow = false; - - this.scene.add(nameObject); - }); - //#endregion - //#endregion - - //#region Interaction - if (isMyRoom) { - this.furnitureControl = new TransformControls(this.camera, this.canvas); - this.scene.add(this.furnitureControl); - - // Hover highlight - this.canvas.onmousemove = this.onmousemove; - - // Click - this.canvas.onmousedown = this.onmousedown; - } - //#endregion - - //#region Init room - this.loadRoom(); - //#endregion - - //#region Load furnitures - for (const furniture of this.furnitures) { - this.loadFurniture(furniture).then(obj => { - this.scene.add(obj.scene); - this.objects.push(obj.scene); - }); - } - //#endregion - - // Start render - if (this.usePostFXs) { - this.renderWithPostFXs(); - } else { - this.renderWithoutPostFXs(); - } - } - - @autobind - private renderWithoutPostFXs() { - this.renderFrameRequestId = - window.requestAnimationFrame(this.renderWithoutPostFXs); - - // Update animations - const clock = this.clock.getDelta(); - for (const mixer of this.mixers) { - mixer.update(clock); - } - - this.controls.update(); - this.renderer.render(this.scene, this.camera); - } - - @autobind - private renderWithPostFXs() { - this.renderFrameRequestId = - window.requestAnimationFrame(this.renderWithPostFXs); - - // Update animations - const clock = this.clock.getDelta(); - for (const mixer of this.mixers) { - mixer.update(clock); - } - - this.controls.update(); - this.renderer.clear(); - this.composer.render(); - } - - @autobind - private loadRoom() { - const type = this.roomInfo.roomType; - new GLTFLoader().load(`/static-assets/client/room/rooms/${type}/${type}.glb`, gltf => { - gltf.scene.traverse(child => { - if (!(child instanceof THREE.Mesh)) return; - - child.receiveShadow = this.enableShadow; - - child.material = new THREE.MeshLambertMaterial({ - color: (child.material as THREE.MeshStandardMaterial).color, - map: (child.material as THREE.MeshStandardMaterial).map, - name: (child.material as THREE.MeshStandardMaterial).name, - }); - - // 異方性フィルタリング - if ((child.material as THREE.MeshLambertMaterial).map && this.graphicsQuality !== 'cheep') { - (child.material as THREE.MeshLambertMaterial).map.minFilter = THREE.LinearMipMapLinearFilter; - (child.material as THREE.MeshLambertMaterial).map.magFilter = THREE.LinearMipMapLinearFilter; - (child.material as THREE.MeshLambertMaterial).map.anisotropy = 8; - } - }); - - gltf.scene.position.set(0, 0, 0); - - this.scene.add(gltf.scene); - this.roomObj = gltf.scene; - if (this.roomInfo.roomType === 'default') { - this.applyCarpetColor(); - } - }); - } - - @autobind - private loadFurniture(furniture: Furniture) { - const def = furnitureDefs.find(d => d.id === furniture.type); - return new Promise((res, rej) => { - const loader = new GLTFLoader(); - loader.load(`/static-assets/client/room/furnitures/${furniture.type}/${furniture.type}.glb`, gltf => { - const model = gltf.scene; - - // Load animation - if (gltf.animations.length > 0) { - const mixer = new THREE.AnimationMixer(model); - this.mixers.push(mixer); - for (const clip of gltf.animations) { - mixer.clipAction(clip).play(); - } - } - - model.name = furniture.id; - model.position.x = furniture.position.x; - model.position.y = furniture.position.y; - model.position.z = furniture.position.z; - model.rotation.x = furniture.rotation.x; - model.rotation.y = furniture.rotation.y; - model.rotation.z = furniture.rotation.z; - - model.traverse(child => { - if (!(child instanceof THREE.Mesh)) return; - child.castShadow = this.enableShadow; - child.receiveShadow = this.enableShadow; - (child.material as THREE.MeshStandardMaterial).metalness = 0; - - // 異方性フィルタリング - if ((child.material as THREE.MeshStandardMaterial).map && this.graphicsQuality !== 'cheep') { - (child.material as THREE.MeshStandardMaterial).map.minFilter = THREE.LinearMipMapLinearFilter; - (child.material as THREE.MeshStandardMaterial).map.magFilter = THREE.LinearMipMapLinearFilter; - (child.material as THREE.MeshStandardMaterial).map.anisotropy = 8; - } - }); - - if (def.color) { // カスタムカラー - this.applyCustomColor(model); - } - - if (def.texture) { // カスタムテクスチャ - this.applyCustomTexture(model); - } - - res(gltf); - }, null, rej); - }); - } - - @autobind - private applyCarpetColor() { - this.roomObj.traverse(child => { - if (!(child instanceof THREE.Mesh)) return; - if (child.material && - (child.material as THREE.MeshStandardMaterial).name && - (child.material as THREE.MeshStandardMaterial).name === 'Carpet' - ) { - const colorHex = parseInt(this.roomInfo.carpetColor.substr(1), 16); - (child.material as THREE.MeshStandardMaterial).color.setHex(colorHex); - } - }); - } - - @autobind - private applyCustomColor(model: THREE.Object3D) { - const furniture = this.furnitures.find(furniture => furniture.id === model.name); - const def = furnitureDefs.find(d => d.id === furniture.type); - if (def.color == null) return; - model.traverse(child => { - if (!(child instanceof THREE.Mesh)) return; - for (const t of Object.keys(def.color)) { - if (!child.material || - !(child.material as THREE.MeshStandardMaterial).name || - (child.material as THREE.MeshStandardMaterial).name !== t - ) continue; - - const prop = def.color[t]; - const val = furniture.props ? furniture.props[prop] : undefined; - - if (val == null) continue; - - const colorHex = parseInt(val.substr(1), 16); - (child.material as THREE.MeshStandardMaterial).color.setHex(colorHex); - } - }); - } - - @autobind - private applyCustomTexture(model: THREE.Object3D) { - const furniture = this.furnitures.find(furniture => furniture.id === model.name); - const def = furnitureDefs.find(d => d.id === furniture.type); - if (def.texture == null) return; - - model.traverse(child => { - if (!(child instanceof THREE.Mesh)) return; - for (const t of Object.keys(def.texture)) { - if (child.name !== t) continue; - - const prop = def.texture[t].prop; - const val = furniture.props ? furniture.props[prop] : undefined; - - if (val == null) continue; - - const canvas = document.createElement('canvas'); - canvas.height = 1024; - canvas.width = 1024; - - child.material = new THREE.MeshLambertMaterial({ - emissive: 0x111111, - side: THREE.DoubleSide, - alphaTest: 0.5, - }); - - const img = new Image(); - img.crossOrigin = 'anonymous'; - img.onload = () => { - const uvInfo = def.texture[t].uv; - - const ctx = canvas.getContext('2d'); - ctx.drawImage(img, - 0, 0, img.width, img.height, - uvInfo.x, uvInfo.y, uvInfo.width, uvInfo.height); - - const texture = new THREE.Texture(canvas); - texture.wrapS = THREE.RepeatWrapping; - texture.wrapT = THREE.RepeatWrapping; - texture.anisotropy = 16; - texture.flipY = false; - - (child.material as THREE.MeshLambertMaterial).map = texture; - (child.material as THREE.MeshLambertMaterial).needsUpdate = true; - (child.material as THREE.MeshLambertMaterial).map.needsUpdate = true; - }; - img.src = val; - } - }); - } - - @autobind - private onmousemove(ev: MouseEvent) { - if (this.isTransformMode) return; - - const rect = (ev.target as HTMLElement).getBoundingClientRect(); - const x = ((ev.clientX - rect.left) / rect.width) * 2 - 1; - const y = -((ev.clientY - rect.top) / rect.height) * 2 + 1; - const pos = new THREE.Vector2(x, y); - - this.camera.updateMatrixWorld(); - - const raycaster = new THREE.Raycaster(); - raycaster.setFromCamera(pos, this.camera); - - const intersects = raycaster.intersectObjects(this.objects, true); - - for (const object of this.objects) { - if (this.isSelectedObject(object)) continue; - object.traverse(child => { - if (child instanceof THREE.Mesh) { - (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x000000); - } - }); - } - - if (intersects.length > 0) { - const intersected = this.getRoot(intersects[0].object); - if (this.isSelectedObject(intersected)) return; - intersected.traverse(child => { - if (child instanceof THREE.Mesh) { - (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x191919); - } - }); - } - } - - @autobind - private onmousedown(ev: MouseEvent) { - if (this.isTransformMode) return; - if (ev.target !== this.canvas || ev.button !== 0) return; - - const rect = (ev.target as HTMLElement).getBoundingClientRect(); - const x = ((ev.clientX - rect.left) / rect.width) * 2 - 1; - const y = -((ev.clientY - rect.top) / rect.height) * 2 + 1; - const pos = new THREE.Vector2(x, y); - - this.camera.updateMatrixWorld(); - - const raycaster = new THREE.Raycaster(); - raycaster.setFromCamera(pos, this.camera); - - const intersects = raycaster.intersectObjects(this.objects, true); - - for (const object of this.objects) { - object.traverse(child => { - if (child instanceof THREE.Mesh) { - (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x000000); - } - }); - } - - if (intersects.length > 0) { - const selectedObj = this.getRoot(intersects[0].object); - this.selectFurniture(selectedObj); - } else { - this.selectedObject = null; - this.onChangeSelect(null); - } - } - - @autobind - private getRoot(obj: THREE.Object3D): THREE.Object3D { - let found = false; - let x = obj.parent; - while (!found) { - if (x.parent.parent == null) { - found = true; - } else { - x = x.parent; - } - } - return x; - } - - @autobind - private isSelectedObject(obj: THREE.Object3D): boolean { - if (this.selectedObject == null) { - return false; - } else { - return obj.name === this.selectedObject.name; - } - } - - @autobind - private selectFurniture(obj: THREE.Object3D) { - this.selectedObject = obj; - this.onChangeSelect(obj); - obj.traverse(child => { - if (child instanceof THREE.Mesh) { - (child.material as THREE.MeshStandardMaterial).emissive.setHex(0xff0000); - } - }); - } - - /** - * 家具の移動/回転モードにします - * @param type 移動か回転か - */ - @autobind - public enterTransformMode(type: 'translate' | 'rotate') { - this.isTransformMode = true; - this.furnitureControl.setMode(type); - this.furnitureControl.attach(this.selectedObject); - this.controls.enableRotate = false; - } - - /** - * 家具の移動/回転モードを終了します - */ - @autobind - public exitTransformMode() { - this.isTransformMode = false; - this.furnitureControl.detach(); - this.controls.enableRotate = true; - } - - /** - * 家具プロパティを更新します - * @param key プロパティ名 - * @param value 値 - */ - @autobind - public updateProp(key: string, value: any) { - const furniture = this.furnitures.find(furniture => furniture.id === this.selectedObject.name); - if (furniture.props == null) furniture.props = {}; - furniture.props[key] = value; - this.applyCustomColor(this.selectedObject); - this.applyCustomTexture(this.selectedObject); - } - - /** - * 部屋に家具を追加します - * @param type 家具の種類 - */ - @autobind - public addFurniture(type: string) { - const furniture = { - id: uuid(), - type: type, - position: { - x: 0, - y: 0, - z: 0, - }, - rotation: { - x: 0, - y: 0, - z: 0, - }, - }; - - this.furnitures.push(furniture); - - this.loadFurniture(furniture).then(obj => { - this.scene.add(obj.scene); - this.objects.push(obj.scene); - }); - } - - /** - * 現在選択されている家具を部屋から削除します - */ - @autobind - public removeFurniture() { - this.exitTransformMode(); - const obj = this.selectedObject; - this.scene.remove(obj); - this.objects = this.objects.filter(object => object.name !== obj.name); - this.furnitures = this.furnitures.filter(furniture => furniture.id !== obj.name); - this.selectedObject = null; - this.onChangeSelect(null); - } - - /** - * 全ての家具を部屋から削除します - */ - @autobind - public removeAllFurnitures() { - this.exitTransformMode(); - for (const obj of this.objects) { - this.scene.remove(obj); - } - this.objects = []; - this.furnitures = []; - this.selectedObject = null; - this.onChangeSelect(null); - } - - /** - * 部屋の床の色を変更します - * @param color 色 - */ - @autobind - public updateCarpetColor(color: string) { - this.roomInfo.carpetColor = color; - this.applyCarpetColor(); - } - - /** - * 部屋の種類を変更します - * @param type 種類 - */ - @autobind - public changeRoomType(type: string) { - this.roomInfo.roomType = type; - this.scene.remove(this.roomObj); - this.loadRoom(); - } - - /** - * 部屋データを取得します - */ - @autobind - public getRoomInfo() { - for (const obj of this.objects) { - const furniture = this.furnitures.find(f => f.id === obj.name); - furniture.position.x = obj.position.x; - furniture.position.y = obj.position.y; - furniture.position.z = obj.position.z; - furniture.rotation.x = obj.rotation.x; - furniture.rotation.y = obj.rotation.y; - furniture.rotation.z = obj.rotation.z; - } - - return this.roomInfo; - } - - /** - * 選択されている家具を取得します - */ - @autobind - public getSelectedObject() { - return this.selectedObject; - } - - @autobind - public findFurnitureById(id: string) { - return this.furnitures.find(furniture => furniture.id === id); - } - - /** - * レンダリングを終了します - */ - @autobind - public destroy() { - // Stop render loop - window.cancelAnimationFrame(this.renderFrameRequestId); - - this.controls.dispose(); - this.scene.dispose(); - } -} diff --git a/src/client/scripts/scroll.ts b/src/client/scripts/scroll.ts deleted file mode 100644 index 621fe88105..0000000000 --- a/src/client/scripts/scroll.ts +++ /dev/null @@ -1,80 +0,0 @@ -type ScrollBehavior = 'auto' | 'smooth' | 'instant'; - -export function getScrollContainer(el: Element | null): Element | null { - if (el == null || el.tagName === 'BODY') return null; - const overflow = window.getComputedStyle(el).getPropertyValue('overflow'); - if (overflow.endsWith('auto')) { // xとyを個別に指定している場合、hidden auto みたいな値になる - return el; - } else { - return getScrollContainer(el.parentElement); - } -} - -export function getScrollPosition(el: Element | null): number { - const container = getScrollContainer(el); - return container == null ? window.scrollY : container.scrollTop; -} - -export function isTopVisible(el: Element | null): boolean { - const scrollTop = getScrollPosition(el); - const topPosition = el.offsetTop; // TODO: container内でのelの相対位置を取得できればより正確になる - - return scrollTop <= topPosition; -} - -export function onScrollTop(el: Element, cb) { - const container = getScrollContainer(el) || window; - const onScroll = ev => { - if (!document.body.contains(el)) return; - if (isTopVisible(el)) { - cb(); - container.removeEventListener('scroll', onScroll); - } - }; - container.addEventListener('scroll', onScroll, { passive: true }); -} - -export function onScrollBottom(el: Element, cb) { - const container = getScrollContainer(el) || window; - const onScroll = ev => { - if (!document.body.contains(el)) return; - const pos = getScrollPosition(el); - if (pos + el.clientHeight > el.scrollHeight - 1) { - cb(); - container.removeEventListener('scroll', onScroll); - } - }; - container.addEventListener('scroll', onScroll, { passive: true }); -} - -export function scroll(el: Element, options: { - top?: number; - left?: number; - behavior?: ScrollBehavior; -}) { - const container = getScrollContainer(el); - if (container == null) { - window.scroll(options); - } else { - container.scroll(options); - } -} - -export function scrollToTop(el: Element, options: { behavior?: ScrollBehavior; } = {}) { - scroll(el, { top: 0, ...options }); -} - -export function scrollToBottom(el: Element, options: { behavior?: ScrollBehavior; } = {}) { - scroll(el, { top: 99999, ...options }); // TODO: ちゃんと計算する -} - -export function isBottom(el: Element, asobi = 0) { - const container = getScrollContainer(el); - const current = container - ? el.scrollTop + el.offsetHeight - : window.scrollY + window.innerHeight; - const max = container - ? el.scrollHeight - : document.body.offsetHeight; - return current >= (max - asobi); -} diff --git a/src/client/scripts/search.ts b/src/client/scripts/search.ts deleted file mode 100644 index 2221f5f279..0000000000 --- a/src/client/scripts/search.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as os from '@client/os'; -import { i18n } from '@client/i18n'; -import { router } from '@client/router'; - -export async function search() { - const { canceled, result: query } = await os.dialog({ - title: i18n.locale.search, - input: true - }); - if (canceled || query == null || query === '') return; - - const q = query.trim(); - - if (q.startsWith('@') && !q.includes(' ')) { - router.push(`/${q}`); - return; - } - - if (q.startsWith('#')) { - router.push(`/tags/${encodeURIComponent(q.substr(1))}`); - return; - } - - // like 2018/03/12 - if (/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}/.test(q.replace(/-/g, '/'))) { - const date = new Date(q.replace(/-/g, '/')); - - // 日付しか指定されてない場合、例えば 2018/03/12 ならユーザーは - // 2018/03/12 のコンテンツを「含む」結果になることを期待するはずなので - // 23時間59分進める(そのままだと 2018/03/12 00:00:00 「まで」の - // 結果になってしまい、2018/03/12 のコンテンツは含まれない) - if (q.replace(/-/g, '/').match(/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}$/)) { - date.setHours(23, 59, 59, 999); - } - - // TODO - //v.$root.$emit('warp', date); - os.dialog({ - icon: 'fas fa-history', - iconOnly: true, autoClose: true - }); - return; - } - - if (q.startsWith('https://')) { - const promise = os.api('ap/show', { - uri: q - }); - - os.promiseDialog(promise, null, null, i18n.locale.fetchingAsApObject); - - const res = await promise; - - if (res.type === 'User') { - router.push(`/@${res.object.username}@${res.object.host}`); - } else if (res.type === 'Note') { - router.push(`/notes/${res.object.id}`); - } - - return; - } - - router.push(`/search?q=${encodeURIComponent(q)}`); -} diff --git a/src/client/scripts/select-file.ts b/src/client/scripts/select-file.ts deleted file mode 100644 index f7b971e113..0000000000 --- a/src/client/scripts/select-file.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as os from '@client/os'; -import { i18n } from '@client/i18n'; -import { defaultStore } from '@client/store'; - -export function selectFile(src: any, label: string | null, multiple = false) { - return new Promise((res, rej) => { - const chooseFileFromPc = () => { - const input = document.createElement('input'); - input.type = 'file'; - input.multiple = multiple; - input.onchange = () => { - const promises = Array.from(input.files).map(file => os.upload(file, defaultStore.state.uploadFolder)); - - Promise.all(promises).then(driveFiles => { - res(multiple ? driveFiles : driveFiles[0]); - }).catch(e => { - os.dialog({ - type: 'error', - text: e - }); - }); - - // 一応廃棄 - (window as any).__misskey_input_ref__ = null; - }; - - // https://qiita.com/fukasawah/items/b9dc732d95d99551013d - // iOS Safari で正常に動かす為のおまじない - (window as any).__misskey_input_ref__ = input; - - input.click(); - }; - - const chooseFileFromDrive = () => { - os.selectDriveFile(multiple).then(files => { - res(files); - }); - }; - - const chooseFileFromUrl = () => { - os.dialog({ - title: i18n.locale.uploadFromUrl, - input: { - placeholder: i18n.locale.uploadFromUrlDescription - } - }).then(({ canceled, result: url }) => { - if (canceled) return; - - const marker = Math.random().toString(); // TODO: UUIDとか使う - - const connection = os.stream.useChannel('main'); - connection.on('urlUploadFinished', data => { - if (data.marker === marker) { - res(multiple ? [data.file] : data.file); - connection.dispose(); - } - }); - - os.api('drive/files/upload-from-url', { - url: url, - folderId: defaultStore.state.uploadFolder, - marker - }); - - os.dialog({ - title: i18n.locale.uploadFromUrlRequested, - text: i18n.locale.uploadFromUrlMayTakeTime - }); - }); - }; - - os.popupMenu([label ? { - text: label, - type: 'label' - } : undefined, { - text: i18n.locale.upload, - icon: 'fas fa-upload', - action: chooseFileFromPc - }, { - text: i18n.locale.fromDrive, - icon: 'fas fa-cloud', - action: chooseFileFromDrive - }, { - text: i18n.locale.fromUrl, - icon: 'fas fa-link', - action: chooseFileFromUrl - }], src); - }); -} diff --git a/src/client/scripts/show-suspended-dialog.ts b/src/client/scripts/show-suspended-dialog.ts deleted file mode 100644 index dde829cdae..0000000000 --- a/src/client/scripts/show-suspended-dialog.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as os from '@client/os'; -import { i18n } from '@client/i18n'; - -export function showSuspendedDialog() { - return os.dialog({ - type: 'error', - title: i18n.locale.yourAccountSuspendedTitle, - text: i18n.locale.yourAccountSuspendedDescription - }); -} diff --git a/src/client/scripts/sound.ts b/src/client/scripts/sound.ts deleted file mode 100644 index c51fa8f215..0000000000 --- a/src/client/scripts/sound.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { ColdDeviceStorage } from '@client/store'; - -const cache = new Map(); - -export function getAudio(file: string, useCache = true): HTMLAudioElement { - let audio: HTMLAudioElement; - if (useCache && cache.has(file)) { - audio = cache.get(file); - } else { - audio = new Audio(`/static-assets/client/sounds/${file}.mp3`); - if (useCache) cache.set(file, audio); - } - return audio; -} - -export function setVolume(audio: HTMLAudioElement, volume: number): HTMLAudioElement { - const masterVolume = ColdDeviceStorage.get('sound_masterVolume'); - audio.volume = masterVolume - ((1 - volume) * masterVolume); - return audio; -} - -export function play(type: string) { - const sound = ColdDeviceStorage.get('sound_' + type as any); - if (sound.type == null) return; - playFile(sound.type, sound.volume); -} - -export function playFile(file: string, volume: number) { - const masterVolume = ColdDeviceStorage.get('sound_masterVolume'); - if (masterVolume === 0) return; - - const audio = setVolume(getAudio(file), volume); - audio.play(); -} diff --git a/src/client/scripts/sticky-sidebar.ts b/src/client/scripts/sticky-sidebar.ts deleted file mode 100644 index c67b8f37ac..0000000000 --- a/src/client/scripts/sticky-sidebar.ts +++ /dev/null @@ -1,50 +0,0 @@ -export class StickySidebar { - private lastScrollTop = 0; - private container: HTMLElement; - private el: HTMLElement; - private spacer: HTMLElement; - private marginTop: number; - private isTop = false; - private isBottom = false; - private offsetTop: number; - private globalHeaderHeight: number = 59; - - constructor(container: StickySidebar['container'], marginTop = 0, globalHeaderHeight = 0) { - this.container = container; - this.el = this.container.children[0] as HTMLElement; - this.el.style.position = 'sticky'; - this.spacer = document.createElement('div'); - this.container.prepend(this.spacer); - this.marginTop = marginTop; - this.offsetTop = this.container.getBoundingClientRect().top; - this.globalHeaderHeight = globalHeaderHeight; - } - - public calc(scrollTop: number) { - if (scrollTop > this.lastScrollTop) { // downscroll - const overflow = Math.max(0, this.globalHeaderHeight + (this.el.clientHeight + this.marginTop) - window.innerHeight); - this.el.style.bottom = null; - this.el.style.top = `${-overflow + this.marginTop + this.globalHeaderHeight}px`; - - this.isBottom = (scrollTop + window.innerHeight) >= (this.el.offsetTop + this.el.clientHeight); - - if (this.isTop) { - this.isTop = false; - this.spacer.style.marginTop = `${Math.max(0, this.globalHeaderHeight + this.lastScrollTop + this.marginTop - this.offsetTop)}px`; - } - } else { // upscroll - const overflow = this.globalHeaderHeight + (this.el.clientHeight + this.marginTop) - window.innerHeight; - this.el.style.top = null; - this.el.style.bottom = `${-overflow}px`; - - this.isTop = scrollTop + this.marginTop + this.globalHeaderHeight <= this.el.offsetTop; - - if (this.isBottom) { - this.isBottom = false; - this.spacer.style.marginTop = `${this.globalHeaderHeight + this.lastScrollTop + this.marginTop - this.offsetTop - overflow}px`; - } - } - - this.lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; - } -} diff --git a/src/client/scripts/theme-editor.ts b/src/client/scripts/theme-editor.ts deleted file mode 100644 index 3d69d2836a..0000000000 --- a/src/client/scripts/theme-editor.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { v4 as uuid} from 'uuid'; - -import { themeProps, Theme } from './theme'; - -export type Default = null; -export type Color = string; -export type FuncName = 'alpha' | 'darken' | 'lighten'; -export type Func = { type: 'func'; name: FuncName; arg: number; value: string; }; -export type RefProp = { type: 'refProp'; key: string; }; -export type RefConst = { type: 'refConst'; key: string; }; -export type Css = { type: 'css'; value: string; }; - -export type ThemeValue = Color | Func | RefProp | RefConst | Css | Default; - -export type ThemeViewModel = [ string, ThemeValue ][]; - -export const fromThemeString = (str?: string) : ThemeValue => { - if (!str) return null; - if (str.startsWith(':')) { - const parts = str.slice(1).split('<'); - const name = parts[0] as FuncName; - const arg = parseFloat(parts[1]); - const value = parts[2].startsWith('@') ? parts[2].slice(1) : ''; - return { type: 'func', name, arg, value }; - } else if (str.startsWith('@')) { - return { - type: 'refProp', - key: str.slice(1), - }; - } else if (str.startsWith('$')) { - return { - type: 'refConst', - key: str.slice(1), - }; - } else if (str.startsWith('"')) { - return { - type: 'css', - value: str.substr(1).trim(), - }; - } else { - return str; - } -}; - -export const toThemeString = (value: Color | Func | RefProp | RefConst | Css) => { - if (typeof value === 'string') return value; - switch (value.type) { - case 'func': return `:${value.name}<${value.arg}<@${value.value}`; - case 'refProp': return `@${value.key}`; - case 'refConst': return `$${value.key}`; - case 'css': return `" ${value.value}`; - } -}; - -export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: string, author: string, base: 'dark' | 'light'): Theme => { - const props = { } as { [key: string]: string }; - for (const [ key, value ] of vm) { - if (value === null) continue; - props[key] = toThemeString(value); - } - - return { - id: uuid(), - name, desc, author, props, base - }; -}; - -export const convertToViewModel = (theme: Theme): ThemeViewModel => { - const vm: ThemeViewModel = []; - // プロパティの登録 - vm.push(...themeProps.map(key => [ key, fromThemeString(theme.props[key])] as [ string, ThemeValue ])); - - // 定数の登録 - const consts = Object - .keys(theme.props) - .filter(k => k.startsWith('$')) - .map(k => [ k, fromThemeString(theme.props[k]) ] as [ string, ThemeValue ]); - - vm.push(...consts); - return vm; -}; diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts deleted file mode 100644 index 8b63821293..0000000000 --- a/src/client/scripts/theme.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { globalEvents } from '@client/events'; -import * as tinycolor from 'tinycolor2'; - -export type Theme = { - id: string; - name: string; - author: string; - desc?: string; - base?: 'dark' | 'light'; - props: Record; -}; - -export const lightTheme: Theme = require('@client/themes/_light.json5'); -export const darkTheme: Theme = require('@client/themes/_dark.json5'); - -export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X')); - -export const builtinThemes = [ - require('@client/themes/l-light.json5'), - require('@client/themes/l-apricot.json5'), - require('@client/themes/l-rainy.json5'), - require('@client/themes/l-vivid.json5'), - require('@client/themes/l-sushi.json5'), - - require('@client/themes/d-dark.json5'), - require('@client/themes/d-persimmon.json5'), - require('@client/themes/d-astro.json5'), - require('@client/themes/d-future.json5'), - require('@client/themes/d-botanical.json5'), - require('@client/themes/d-pumpkin.json5'), - require('@client/themes/d-black.json5'), -] as Theme[]; - -let timeout = null; - -export function applyTheme(theme: Theme, persist = true) { - if (timeout) clearTimeout(timeout); - - document.documentElement.classList.add('_themeChanging_'); - - timeout = setTimeout(() => { - document.documentElement.classList.remove('_themeChanging_'); - }, 1000); - - // Deep copy - const _theme = JSON.parse(JSON.stringify(theme)); - - if (_theme.base) { - const base = [lightTheme, darkTheme].find(x => x.id === _theme.base); - _theme.props = Object.assign({}, base.props, _theme.props); - } - - const props = compile(_theme); - - for (const tag of document.head.children) { - if (tag.tagName === 'META' && tag.getAttribute('name') === 'theme-color') { - tag.setAttribute('content', props['html']); - break; - } - } - - for (const [k, v] of Object.entries(props)) { - document.documentElement.style.setProperty(`--${k}`, v.toString()); - } - - if (persist) { - localStorage.setItem('theme', JSON.stringify(props)); - } - - // 色計算など再度行えるようにクライアント全体に通知 - globalEvents.emit('themeChanged'); -} - -function compile(theme: Theme): Record { - function getColor(val: string): tinycolor.Instance { - // ref (prop) - if (val[0] === '@') { - return getColor(theme.props[val.substr(1)]); - } - - // ref (const) - else if (val[0] === '$') { - return getColor(theme.props[val]); - } - - // func - else if (val[0] === ':') { - const parts = val.split('<'); - const func = parts.shift().substr(1); - const arg = parseFloat(parts.shift()); - const color = getColor(parts.join('<')); - - switch (func) { - case 'darken': return color.darken(arg); - case 'lighten': return color.lighten(arg); - case 'alpha': return color.setAlpha(arg); - case 'hue': return color.spin(arg); - case 'saturate': return color.saturate(arg); - } - } - - // other case - return tinycolor(val); - } - - const props = {}; - - for (const [k, v] of Object.entries(theme.props)) { - if (k.startsWith('$')) continue; // ignore const - - props[k] = v.startsWith('"') ? v.replace(/^"\s*/, '') : genValue(getColor(v)); - } - - return props; -} - -function genValue(c: tinycolor.Instance): string { - return c.toRgbString(); -} - -export function validateTheme(theme: Record): boolean { - if (theme.id == null || typeof theme.id !== 'string') return false; - if (theme.name == null || typeof theme.name !== 'string') return false; - if (theme.base == null || !['light', 'dark'].includes(theme.base)) return false; - if (theme.props == null || typeof theme.props !== 'object') return false; - return true; -} diff --git a/src/client/scripts/unison-reload.ts b/src/client/scripts/unison-reload.ts deleted file mode 100644 index 59af584c1b..0000000000 --- a/src/client/scripts/unison-reload.ts +++ /dev/null @@ -1,15 +0,0 @@ -// SafariがBroadcastChannel未実装なのでライブラリを使う -import { BroadcastChannel } from 'broadcast-channel'; - -export const reloadChannel = new BroadcastChannel('reload'); - -// BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。 -export function unisonReload(path?: string) { - if (path !== undefined) { - reloadChannel.postMessage(path); - location.href = path; - } else { - reloadChannel.postMessage(null); - location.reload(); - } -} diff --git a/src/client/store.ts b/src/client/store.ts deleted file mode 100644 index eea3955fac..0000000000 --- a/src/client/store.ts +++ /dev/null @@ -1,318 +0,0 @@ -import { markRaw, ref } from 'vue'; -import { Storage } from './pizzax'; -import { Theme } from './scripts/theme'; - -export const postFormActions = []; -export const userActions = []; -export const noteActions = []; -export const noteViewInterruptors = []; -export const notePostInterruptors = []; - -// TODO: それぞれいちいちwhereとかdefaultというキーを付けなきゃいけないの冗長なのでなんとかする(ただ型定義が面倒になりそう) -// あと、現行の定義の仕方なら「whereが何であるかに関わらずキー名の重複不可」という制約を付けられるメリットもあるからそのメリットを引き継ぐ方法も考えないといけない -export const defaultStore = markRaw(new Storage('base', { - tutorial: { - where: 'account', - default: 0 - }, - keepCw: { - where: 'account', - default: false - }, - showFullAcct: { - where: 'account', - default: false - }, - rememberNoteVisibility: { - where: 'account', - default: false - }, - defaultNoteVisibility: { - where: 'account', - default: 'public' - }, - defaultNoteLocalOnly: { - where: 'account', - default: false - }, - uploadFolder: { - where: 'account', - default: null as string | null - }, - pastedFileName: { - where: 'account', - default: 'yyyy-MM-dd HH-mm-ss [{{number}}]' - }, - memo: { - where: 'account', - default: null - }, - reactions: { - where: 'account', - default: ['👍', '❤️', '😆', '🤔', '😮', '🎉', '💢', '😥', '😇', '🍮'] - }, - mutedWords: { - where: 'account', - default: [] - }, - mutedAds: { - where: 'account', - default: [] as string[] - }, - - menu: { - where: 'deviceAccount', - default: [ - 'notifications', - 'messaging', - 'drive', - 'followRequests', - '-', - 'gallery', - 'featured', - 'explore', - 'announcements', - 'search', - '-', - 'ui', - ] - }, - visibility: { - where: 'deviceAccount', - default: 'public' as 'public' | 'home' | 'followers' | 'specified' - }, - localOnly: { - where: 'deviceAccount', - default: false - }, - widgets: { - where: 'deviceAccount', - default: [] as { - name: string; - id: string; - place: string | null; - data: Record; - }[] - }, - tl: { - where: 'deviceAccount', - default: { - src: 'home', - arg: null - } - }, - - serverDisconnectedBehavior: { - where: 'device', - default: 'quiet' as 'quiet' | 'reload' | 'dialog' - }, - nsfw: { - where: 'device', - default: 'respect' as 'respect' | 'force' | 'ignore' - }, - animation: { - where: 'device', - default: true - }, - animatedMfm: { - where: 'device', - default: true - }, - loadRawImages: { - where: 'device', - default: false - }, - imageNewTab: { - where: 'device', - default: false - }, - disableShowingAnimatedImages: { - where: 'device', - default: false - }, - disablePagesScript: { - where: 'device', - default: false - }, - useOsNativeEmojis: { - where: 'device', - default: false - }, - useBlurEffectForModal: { - where: 'device', - default: true - }, - useBlurEffect: { - where: 'device', - default: true - }, - showFixedPostForm: { - where: 'device', - default: false - }, - enableInfiniteScroll: { - where: 'device', - default: true - }, - useReactionPickerForContextMenu: { - where: 'device', - default: true - }, - showGapBetweenNotesInTimeline: { - where: 'device', - default: false - }, - darkMode: { - where: 'device', - default: false - }, - instanceTicker: { - where: 'device', - default: 'remote' as 'none' | 'remote' | 'always' - }, - reactionPickerWidth: { - where: 'device', - default: 1 - }, - reactionPickerHeight: { - where: 'device', - default: 1 - }, - recentlyUsedEmojis: { - where: 'device', - default: [] as string[] - }, - recentlyUsedUsers: { - where: 'device', - default: [] as string[] - }, - defaultSideView: { - where: 'device', - default: false - }, - menuDisplay: { - where: 'device', - default: 'sideFull' as 'sideFull' | 'sideIcon' | 'top' - }, - reportError: { - where: 'device', - default: false - }, - squareAvatars: { - where: 'device', - default: false - }, - postFormWithHashtags: { - where: 'device', - default: false - }, - postFormHashtags: { - where: 'device', - default: '' - }, - aiChanMode: { - where: 'device', - default: false - }, -})); - -// TODO: 他のタブと永続化されたstateを同期 - -const PREFIX = 'miux:'; - -type Plugin = { - id: string; - name: string; - active: boolean; - configData: Record; - token: string; - ast: any[]; -}; - -/** - * 常にメモリにロードしておく必要がないような設定情報を保管するストレージ(非リアクティブ) - */ -export class ColdDeviceStorage { - public static default = { - lightTheme: require('@client/themes/l-light.json5') as Theme, - darkTheme: require('@client/themes/d-dark.json5') as Theme, - syncDeviceDarkMode: true, - chatOpenBehavior: 'page' as 'page' | 'window' | 'popout', - plugins: [] as Plugin[], - mediaVolume: 0.5, - sound_masterVolume: 0.3, - sound_note: { type: 'syuilo/down', volume: 1 }, - sound_noteMy: { type: 'syuilo/up', volume: 1 }, - sound_notification: { type: 'syuilo/pope2', volume: 1 }, - sound_chat: { type: 'syuilo/pope1', volume: 1 }, - sound_chatBg: { type: 'syuilo/waon', volume: 1 }, - sound_antenna: { type: 'syuilo/triple', volume: 1 }, - sound_channel: { type: 'syuilo/square-pico', volume: 1 }, - sound_reversiPutBlack: { type: 'syuilo/kick', volume: 0.3 }, - sound_reversiPutWhite: { type: 'syuilo/snare', volume: 0.3 }, - roomGraphicsQuality: 'medium' as 'cheep' | 'low' | 'medium' | 'high' | 'ultra', - roomUseOrthographicCamera: true, - }; - - public static watchers = []; - - public static get(key: T): typeof ColdDeviceStorage.default[T] { - // TODO: indexedDBにする - // ただしその際はnullチェックではなくキー存在チェックにしないとダメ - // (indexedDBはnullを保存できるため、ユーザーが意図してnullを格納した可能性がある) - const value = localStorage.getItem(PREFIX + key); - if (value == null) { - return ColdDeviceStorage.default[key]; - } else { - return JSON.parse(value); - } - } - - public static set(key: T, value: typeof ColdDeviceStorage.default[T]): void { - localStorage.setItem(PREFIX + key, JSON.stringify(value)); - - for (const watcher of this.watchers) { - if (watcher.key === key) watcher.callback(value); - } - } - - public static watch(key, callback) { - this.watchers.push({ key, callback }); - } - - // TODO: VueのcustomRef使うと良い感じになるかも - public static ref(key: T) { - const v = ColdDeviceStorage.get(key); - const r = ref(v); - // TODO: このままではwatcherがリークするので開放する方法を考える - this.watch(key, v => { - r.value = v; - }); - return r; - } - - /** - * 特定のキーの、簡易的なgetter/setterを作ります - * 主にvue場で設定コントロールのmodelとして使う用 - */ - public static makeGetterSetter(key: K) { - // TODO: VueのcustomRef使うと良い感じになるかも - const valueRef = ColdDeviceStorage.ref(key); - return { - get: () => { - return valueRef.value; - }, - set: (value: unknown) => { - const val = value; - ColdDeviceStorage.set(key, val); - } - }; - } -} - -// このファイルに書きたくないけどここに書かないと何故かVeturが認識しない -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $store: typeof defaultStore; - } -} diff --git a/src/client/style.scss b/src/client/style.scss deleted file mode 100644 index 951d5a14f3..0000000000 --- a/src/client/style.scss +++ /dev/null @@ -1,562 +0,0 @@ -@charset "utf-8"; - -:root { - --radius: 12px; - --marginFull: 16px; - --marginHalf: 10px; - - --margin: var(--marginFull); - - @media (max-width: 500px) { - --margin: var(--marginHalf); - } - - //--ad: rgb(255 169 0 / 10%); -} - -::selection { - color: #fff; - background-color: var(--accent); -} - -html { - touch-action: manipulation; - background-color: var(--bg); - background-attachment: fixed; - background-size: cover; - background-position: center; - color: var(--fg); - overflow: auto; - overflow-wrap: break-word; - font-family: "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif; - line-height: 1.35; - text-size-adjust: 100%; - tab-size: 2; - - &, * { - scrollbar-color: var(--scrollbarHandle) inherit; - scrollbar-width: thin; - - &:hover { - scrollbar-color: var(--scrollbarHandleHover) inherit; - } - - &:active { - scrollbar-color: var(--accent) inherit; - } - - &::-webkit-scrollbar { - width: 6px; - height: 6px; - } - - &::-webkit-scrollbar-track { - background: inherit; - } - - &::-webkit-scrollbar-thumb { - background: var(--scrollbarHandle); - - &:hover { - background: var(--scrollbarHandleHover); - } - - &:active { - background: var(--accent); - } - } - } - - &.f-small { - font-size: 0.9em; - } - - &.f-large { - font-size: 1.1em; - } - - &.f-veryLarge { - font-size: 1.2em; - } - - &.useSystemFont { - font-family: sans-serif; - } -} - -html._themeChanging_ { - &, * { - transition: background 1s ease, border 1s ease !important; - } -} - -html, body { - margin: 0; - padding: 0; - scroll-behavior: smooth; -} - -a { - text-decoration: none; - cursor: pointer; - color: inherit; - tap-highlight-color: transparent; - -webkit-tap-highlight-color: transparent; - - &:hover { - text-decoration: underline; - } -} - -textarea, input { - tap-highlight-color: transparent; - -webkit-tap-highlight-color: transparent; -} - -optgroup, option { - background: var(--panel); - color: var(--fg); -} - -hr { - margin: var(--margin) 0 var(--margin) 0; - border: none; - height: 1px; - background: var(--divider); -} - -._noSelect { - user-select: none; - -webkit-user-select: none; - -webkit-touch-callout: none; -} - -._ghost { - &, * { - @extend ._noSelect; - pointer-events: none; - } -} - -._modalBg { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: var(--modalBg); - -webkit-backdrop-filter: var(--modalBgFilter); - backdrop-filter: var(--modalBgFilter); -} - -._shadow { - box-shadow: 0px 4px 32px var(--shadow) !important; -} - -._button { - appearance: none; - display: inline-block; - padding: 0; - margin: 0; // for Safari - background: none; - border: none; - cursor: pointer; - color: inherit; - touch-action: manipulation; - tap-highlight-color: transparent; - -webkit-tap-highlight-color: transparent; - font-size: 1em; - font-family: inherit; - line-height: inherit; - - &, * { - @extend ._noSelect; - } - - * { - pointer-events: none; - } - - &:focus-visible { - outline: none; - } - - &:disabled { - opacity: 0.5; - cursor: default; - } -} - -._buttonPrimary { - @extend ._button; - color: var(--fgOnAccent); - background: var(--accent); - - &:not(:disabled):hover { - background: var(--X8); - } - - &:not(:disabled):active { - background: var(--X9); - } -} - -._buttonGradate { - @extend ._buttonPrimary; - color: var(--fgOnAccent); - background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB)); - - &:not(:disabled):hover { - background: linear-gradient(90deg, var(--X8), var(--X8)); - } - - &:not(:disabled):active { - background: linear-gradient(90deg, var(--X8), var(--X8)); - } -} - -._help { - color: var(--accent); - cursor: help -} - -._textButton { - @extend ._button; - color: var(--accent); - - &:not(:disabled):hover { - text-decoration: underline; - } -} - -._inputs { - display: flex; - margin: 32px 0; - - &:first-child { - margin-top: 8px; - } - - &:last-child { - margin-bottom: 8px; - } - - > * { - flex: 1; - margin: 0 !important; - - &:not(:first-child) { - margin-left: 8px !important; - } - - &:not(:last-child) { - margin-right: 8px !important; - } - } -} - -._panel { - background: var(--panel); - border-radius: var(--radius); - overflow: clip; -} - -._block { - @extend ._panel; - - & + ._block { - margin-top: var(--margin); - } -} - -._gap { - margin: var(--margin) 0; -} - -// TODO: 廃止 -._card { - @extend ._panel; - - // TODO: _cardTitle に - > ._title { - margin: 0; - padding: 22px 32px; - font-size: 1em; - border-bottom: solid 1px var(--panelHeaderDivider); - font-weight: bold; - background: var(--panelHeaderBg); - color: var(--panelHeaderFg); - - @media (max-width: 500px) { - padding: 16px; - font-size: 1em; - } - } - - // TODO: _cardContent に - > ._content { - padding: 32px; - - @media (max-width: 500px) { - padding: 16px; - } - - &._noPad { - padding: 0 !important; - } - - & + ._content { - border-top: solid 0.5px var(--divider); - } - } - - // TODO: _cardFooter に - > ._footer { - border-top: solid 0.5px var(--divider); - padding: 24px 32px; - - @media (max-width: 500px) { - padding: 16px; - } - } -} - -._borderButton { - @extend ._button; - display: block; - width: 100%; - padding: 10px; - box-sizing: border-box; - text-align: center; - border: solid 0.5px var(--divider); - border-radius: var(--radius); - - &:active { - border-color: var(--accent); - } -} - -._window { - background: var(--panel); - border-radius: var(--radius); - contain: content; -} - -._popup { - background: var(--popup); - border-radius: var(--radius); - contain: layout; // ふき出しがボックスから飛び出て表示されるようなデザインをする場合もあるので paint は contain することができない -} - -// TODO: 廃止 -._monolithic_ { - ._section:not(:empty) { - box-sizing: border-box; - padding: var(--root-margin, 32px); - - @media (max-width: 500px) { - --root-margin: 10px; - } - - & + ._section:not(:empty) { - border-top: solid 0.5px var(--divider); - } - } -} - -._narrow_ ._card { - > ._title { - padding: 16px; - font-size: 1em; - } - - > ._content { - padding: 16px; - } - - > ._footer { - padding: 16px; - } -} - -._acrylic { - background: var(--acrylicPanel); - -webkit-backdrop-filter: var(--blur, blur(15px)); - backdrop-filter: var(--blur, blur(15px)); -} - -._inputSplit { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); - grid-gap: 8px; - margin: 1em 0; - - > * { - margin: 0 !important; - } -} - -._formBlock { - margin: 20px 0; -} - -._formRoot { - > ._formBlock:first-child { - margin-top: 0; - } - - > ._formBlock:last-child { - margin-bottom: 0; - } -} - -._table { - > ._row { - display: flex; - - &:not(:last-child) { - margin-bottom: 16px; - - @media (max-width: 500px) { - margin-bottom: 8px; - } - } - - > ._cell { - flex: 1; - - > ._label { - font-size: 80%; - opacity: 0.7; - - > ._icon { - margin-right: 4px; - display: none; - } - } - } - } -} - -._fullinfo { - padding: 64px 32px; - text-align: center; - - > img { - vertical-align: bottom; - height: 128px; - margin-bottom: 16px; - border-radius: 16px; - } -} - -._keyValue { - display: flex; - - > * { - flex: 1; - } -} - -._link { - color: var(--link); -} - -._caption { - font-size: 0.8em; - opacity: 0.7; -} - -._monospace { - font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace !important; -} - -._code { - @extend ._monospace; - background: #2d2d2d; - color: #ccc; - font-size: 14px; - line-height: 1.5; - padding: 5px; -} - -.prism-editor__textarea:focus { - outline: none; -} - -._zoom { - transition-duration: 0.5s, 0.5s; - transition-property: opacity, transform; - transition-timing-function: cubic-bezier(0,.5,.5,1); -} - -.zoom-enter-active, .zoom-leave-active { - transition: opacity 0.5s, transform 0.5s !important; -} -.zoom-enter-from, .zoom-leave-to { - opacity: 0; - transform: scale(0.9); -} - -@keyframes blink { - 0% { opacity: 1; transform: scale(1); } - 30% { opacity: 1; transform: scale(1); } - 90% { opacity: 0; transform: scale(0.5); } -} - -@keyframes tada { - from { - transform: scale3d(1, 1, 1); - } - - 10%, - 20% { - transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg); - } - - 30%, - 50%, - 70%, - 90% { - transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); - } - - 40%, - 60%, - 80% { - transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); - } - - to { - transform: scale3d(1, 1, 1); - } -} - -._anime_bounce { - will-change: transform; - animation: bounce ease 0.7s; - animation-iteration-count: 1; - transform-origin: 50% 50%; -} -._anime_bounce_ready { - will-change: transform; - transform: scaleX(0.90) scaleY(0.90) ; -} -._anime_bounce_standBy { - transition: transform 0.1s ease; -} - -@keyframes bounce{ - 0% { - transform: scaleX(0.90) scaleY(0.90) ; - } - 19% { - transform: scaleX(1.10) scaleY(1.10) ; - } - 48% { - transform: scaleX(0.95) scaleY(0.95) ; - } - 100% { - transform: scaleX(1.00) scaleY(1.00) ; - } -} diff --git a/src/client/sw/compose-notification.ts b/src/client/sw/compose-notification.ts deleted file mode 100644 index 7ed0a95359..0000000000 --- a/src/client/sw/compose-notification.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Notification composer of Service Worker - */ -declare var self: ServiceWorkerGlobalScope; - -import { getNoteSummary } from '@/misc/get-note-summary'; -import getUserName from '@/misc/get-user-name'; - -export default async function(type, data, i18n): Promise<[string, NotificationOptions] | null | undefined> { - if (!i18n) { - console.log('no i18n'); - return; - } - - switch (type) { - case 'driveFileCreated': // TODO (Server Side) - return [i18n.t('_notification.fileUploaded'), { - body: data.name, - icon: data.url - }]; - case 'notification': - switch (data.type) { - case 'mention': - return [i18n.t('_notification.youGotMention', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), - icon: data.user.avatarUrl - }]; - - case 'reply': - return [i18n.t('_notification.youGotReply', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), - icon: data.user.avatarUrl - }]; - - case 'renote': - return [i18n.t('_notification.youRenoted', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), - icon: data.user.avatarUrl - }]; - - case 'quote': - return [i18n.t('_notification.youGotQuote', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), - icon: data.user.avatarUrl - }]; - - case 'reaction': - return [`${data.reaction} ${getUserName(data.user)}`, { - body: getNoteSummary(data.note, i18n.locale), - icon: data.user.avatarUrl - }]; - - case 'pollVote': - return [i18n.t('_notification.youGotPoll', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), - icon: data.user.avatarUrl - }]; - - case 'follow': - return [i18n.t('_notification.youWereFollowed'), { - body: getUserName(data.user), - icon: data.user.avatarUrl - }]; - - case 'receiveFollowRequest': - return [i18n.t('_notification.youReceivedFollowRequest'), { - body: getUserName(data.user), - icon: data.user.avatarUrl - }]; - - case 'followRequestAccepted': - return [i18n.t('_notification.yourFollowRequestAccepted'), { - body: getUserName(data.user), - icon: data.user.avatarUrl - }]; - - case 'groupInvited': - return [i18n.t('_notification.youWereInvitedToGroup'), { - body: data.group.name - }]; - - default: - return null; - } - case 'unreadMessagingMessage': - if (data.groupId === null) { - return [i18n.t('_notification.youGotMessagingMessageFromUser', { name: getUserName(data.user) }), { - icon: data.user.avatarUrl, - tag: `messaging:user:${data.user.id}` - }]; - } - return [i18n.t('_notification.youGotMessagingMessageFromGroup', { name: data.group.name }), { - icon: data.user.avatarUrl, - tag: `messaging:group:${data.group.id}` - }]; - default: - return null; - } -} diff --git a/src/client/sw/sw.ts b/src/client/sw/sw.ts deleted file mode 100644 index 5be4eb9770..0000000000 --- a/src/client/sw/sw.ts +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Service Worker - */ -declare var self: ServiceWorkerGlobalScope; - -import { get, set } from 'idb-keyval'; -import composeNotification from '@client/sw/compose-notification'; -import { I18n } from '@/misc/i18n'; - -//#region Variables -const version = _VERSION_; -const cacheName = `mk-cache-${version}`; - -let lang: string; -let i18n: I18n; -let pushesPool: any[] = []; -//#endregion - -//#region Startup -get('lang').then(async prelang => { - if (!prelang) return; - lang = prelang; - return fetchLocale(); -}); -//#endregion - -//#region Lifecycle: Install -self.addEventListener('install', ev => { - self.skipWaiting(); -}); -//#endregion - -//#region Lifecycle: Activate -self.addEventListener('activate', ev => { - ev.waitUntil( - caches.keys() - .then(cacheNames => Promise.all( - cacheNames - .filter((v) => v !== cacheName) - .map(name => caches.delete(name)) - )) - .then(() => self.clients.claim()) - ); -}); -//#endregion - -//#region When: Fetching -self.addEventListener('fetch', ev => { - // Nothing to do -}); -//#endregion - -//#region When: Caught Notification -self.addEventListener('push', ev => { - // クライアント取得 - ev.waitUntil(self.clients.matchAll({ - includeUncontrolled: true - }).then(async clients => { - // クライアントがあったらストリームに接続しているということなので通知しない - if (clients.length != 0) return; - - const { type, body } = ev.data?.json(); - - // localeを読み込めておらずi18nがundefinedだった場合はpushesPoolにためておく - if (!i18n) return pushesPool.push({ type, body }); - - const n = await composeNotification(type, body, i18n); - if (n) return self.registration.showNotification(...n); - })); -}); -//#endregion - -//#region When: Caught a message from the client -self.addEventListener('message', ev => { - switch(ev.data) { - case 'clear': - return; // TODO - default: - break; - } - - if (typeof ev.data === 'object') { - // E.g. '[object Array]' → 'array' - const otype = Object.prototype.toString.call(ev.data).slice(8, -1).toLowerCase(); - - if (otype === 'object') { - if (ev.data.msg === 'initialize') { - lang = ev.data.lang; - set('lang', lang); - fetchLocale(); - } - } - } -}); -//#endregion - -//#region Function: (Re)Load i18n instance -async function fetchLocale() { - //#region localeファイルの読み込み - // Service Workerは何度も起動しそのたびにlocaleを読み込むので、CacheStorageを使う - const localeUrl = `/assets/locales/${lang}.${version}.json`; - let localeRes = await caches.match(localeUrl); - - if (!localeRes) { - localeRes = await fetch(localeUrl); - const clone = localeRes?.clone(); - if (!clone?.clone().ok) return; - - caches.open(cacheName).then(cache => cache.put(localeUrl, clone)); - } - - i18n = new I18n(await localeRes.json()); - //#endregion - - //#region i18nをきちんと読み込んだ後にやりたい処理 - for (const { type, body } of pushesPool) { - const n = await composeNotification(type, body, i18n); - if (n) self.registration.showNotification(...n); - } - pushesPool = []; - //#endregion -} -//#endregion diff --git a/src/client/symbols.ts b/src/client/symbols.ts deleted file mode 100644 index 6913f29c28..0000000000 --- a/src/client/symbols.ts +++ /dev/null @@ -1 +0,0 @@ -export const PAGE_INFO = Symbol('Page info'); diff --git a/src/client/theme-store.ts b/src/client/theme-store.ts deleted file mode 100644 index f291069692..0000000000 --- a/src/client/theme-store.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { api } from '@client/os'; -import { $i } from '@client/account'; -import { Theme } from './scripts/theme'; - -const lsCacheKey = $i ? `themes:${$i.id}` : ''; - -export function getThemes(): Theme[] { - return JSON.parse(localStorage.getItem(lsCacheKey) || '[]'); -} - -export async function fetchThemes(): Promise { - if ($i == null) return; - - try { - const themes = await api('i/registry/get', { scope: ['client'], key: 'themes' }); - localStorage.setItem(lsCacheKey, JSON.stringify(themes)); - } catch (e) { - if (e.code === 'NO_SUCH_KEY') return; - throw e; - } -} - -export async function addTheme(theme: Theme): Promise { - await fetchThemes(); - const themes = getThemes().concat(theme); - await api('i/registry/set', { scope: ['client'], key: 'themes', value: themes }); - localStorage.setItem(lsCacheKey, JSON.stringify(themes)); -} - -export async function removeTheme(theme: Theme): Promise { - const themes = getThemes().filter(t => t.id != theme.id); - await api('i/registry/set', { scope: ['client'], key: 'themes', value: themes }); - localStorage.setItem(lsCacheKey, JSON.stringify(themes)); -} diff --git a/src/client/themes/_dark.json5 b/src/client/themes/_dark.json5 deleted file mode 100644 index d8be16f60a..0000000000 --- a/src/client/themes/_dark.json5 +++ /dev/null @@ -1,90 +0,0 @@ -// ダークテーマのベーステーマ -// このテーマが直接使われることは無い -{ - id: 'dark', - - name: 'Dark', - author: 'syuilo', - desc: 'Default dark theme', - kind: 'dark', - - props: { - accent: '#86b300', - accentDarken: ':darken<10<@accent', - accentLighten: ':lighten<10<@accent', - accentedBg: ':alpha<0.15<@accent', - focus: ':alpha<0.3<@accent', - bg: '#000', - acrylicBg: ':alpha<0.5<@bg', - fg: '#dadada', - fgTransparentWeak: ':alpha<0.75<@fg', - fgTransparent: ':alpha<0.5<@fg', - fgHighlighted: ':lighten<3<@fg', - fgOnAccent: '#fff', - divider: 'rgba(255, 255, 255, 0.1)', - indicator: '@accent', - panel: ':lighten<3<@bg', - panelHighlight: ':lighten<3<@panel', - panelHeaderBg: ':lighten<3<@panel', - panelHeaderFg: '@fg', - panelHeaderDivider: 'rgba(0, 0, 0, 0)', - panelBorder: '" solid 1px var(--divider)', - acrylicPanel: ':alpha<0.5<@panel', - popup: ':lighten<3<@panel', - shadow: 'rgba(0, 0, 0, 0.3)', - header: ':alpha<0.7<@panel', - navBg: '@panel', - navFg: '@fg', - navHoverFg: ':lighten<17<@fg', - navActive: '@accent', - navIndicator: '@indicator', - link: '#44a4c1', - hashtag: '#ff9156', - mention: '@accent', - mentionMe: '@mention', - renote: '#229e82', - modalBg: 'rgba(0, 0, 0, 0.5)', - scrollbarHandle: 'rgba(255, 255, 255, 0.2)', - scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)', - dateLabelFg: '@fg', - infoBg: '#253142', - infoFg: '#fff', - infoWarnBg: '#42321c', - infoWarnFg: '#ffbd3e', - switchBg: 'rgba(255, 255, 255, 0.15)', - cwBg: '#687390', - cwFg: '#393f4f', - cwHoverBg: '#707b97', - buttonBg: 'rgba(255, 255, 255, 0.05)', - buttonHoverBg: 'rgba(255, 255, 255, 0.1)', - buttonGradateA: '@accent', - buttonGradateB: ':hue<20<@accent', - inputBorder: 'rgba(255, 255, 255, 0.1)', - inputBorderHover: 'rgba(255, 255, 255, 0.2)', - listItemHoverBg: 'rgba(255, 255, 255, 0.03)', - driveFolderBg: ':alpha<0.3<@accent', - wallpaperOverlay: 'rgba(0, 0, 0, 0.5)', - badge: '#31b1ce', - messageBg: '@bg', - success: '#86b300', - error: '#ec4137', - warn: '#ecb637', - htmlThemeColor: '@bg', - X2: ':darken<2<@panel', - X3: 'rgba(255, 255, 255, 0.05)', - X4: 'rgba(255, 255, 255, 0.1)', - X5: 'rgba(255, 255, 255, 0.05)', - X6: 'rgba(255, 255, 255, 0.15)', - X7: 'rgba(255, 255, 255, 0.05)', - X8: ':lighten<5<@accent', - X9: ':darken<5<@accent', - X10: ':alpha<0.4<@accent', - X11: 'rgba(0, 0, 0, 0.3)', - X12: 'rgba(255, 255, 255, 0.1)', - X13: 'rgba(255, 255, 255, 0.15)', - X14: ':alpha<0.5<@navBg', - X15: ':alpha<0<@panel', - X16: ':alpha<0.7<@panel', - X17: ':alpha<0.8<@bg', - }, -} diff --git a/src/client/themes/_light.json5 b/src/client/themes/_light.json5 deleted file mode 100644 index 251aa36c7a..0000000000 --- a/src/client/themes/_light.json5 +++ /dev/null @@ -1,90 +0,0 @@ -// ライトテーマのベーステーマ -// このテーマが直接使われることは無い -{ - id: 'light', - - name: 'Light', - author: 'syuilo', - desc: 'Default light theme', - kind: 'light', - - props: { - accent: '#86b300', - accentDarken: ':darken<10<@accent', - accentLighten: ':lighten<10<@accent', - accentedBg: ':alpha<0.15<@accent', - focus: ':alpha<0.3<@accent', - bg: '#fff', - acrylicBg: ':alpha<0.5<@bg', - fg: '#5f5f5f', - fgTransparentWeak: ':alpha<0.75<@fg', - fgTransparent: ':alpha<0.5<@fg', - fgHighlighted: ':darken<3<@fg', - fgOnAccent: '#fff', - divider: 'rgba(0, 0, 0, 0.1)', - indicator: '@accent', - panel: ':lighten<3<@bg', - panelHighlight: ':darken<3<@panel', - panelHeaderBg: ':lighten<3<@panel', - panelHeaderFg: '@fg', - panelHeaderDivider: 'rgba(0, 0, 0, 0)', - panelBorder: '" solid 1px var(--divider)', - acrylicPanel: ':alpha<0.5<@panel', - popup: ':lighten<3<@panel', - shadow: 'rgba(0, 0, 0, 0.1)', - header: ':alpha<0.7<@panel', - navBg: '@panel', - navFg: '@fg', - navHoverFg: ':darken<17<@fg', - navActive: '@accent', - navIndicator: '@indicator', - link: '#44a4c1', - hashtag: '#ff9156', - mention: '@accent', - mentionMe: '@mention', - renote: '#229e82', - modalBg: 'rgba(0, 0, 0, 0.3)', - scrollbarHandle: 'rgba(0, 0, 0, 0.2)', - scrollbarHandleHover: 'rgba(0, 0, 0, 0.4)', - dateLabelFg: '@fg', - infoBg: '#e5f5ff', - infoFg: '#72818a', - infoWarnBg: '#fff0db', - infoWarnFg: '#8f6e31', - switchBg: 'rgba(0, 0, 0, 0.15)', - cwBg: '#b1b9c1', - cwFg: '#fff', - cwHoverBg: '#bbc4ce', - buttonBg: 'rgba(0, 0, 0, 0.05)', - buttonHoverBg: 'rgba(0, 0, 0, 0.1)', - buttonGradateA: '@accent', - buttonGradateB: ':hue<20<@accent', - inputBorder: 'rgba(0, 0, 0, 0.1)', - inputBorderHover: 'rgba(0, 0, 0, 0.2)', - listItemHoverBg: 'rgba(0, 0, 0, 0.03)', - driveFolderBg: ':alpha<0.3<@accent', - wallpaperOverlay: 'rgba(255, 255, 255, 0.5)', - badge: '#31b1ce', - messageBg: '@bg', - success: '#86b300', - error: '#ec4137', - warn: '#ecb637', - htmlThemeColor: '@bg', - X2: ':darken<2<@panel', - X3: 'rgba(0, 0, 0, 0.05)', - X4: 'rgba(0, 0, 0, 0.1)', - X5: 'rgba(0, 0, 0, 0.05)', - X6: 'rgba(0, 0, 0, 0.25)', - X7: 'rgba(0, 0, 0, 0.05)', - X8: ':lighten<5<@accent', - X9: ':darken<5<@accent', - X10: ':alpha<0.4<@accent', - X11: 'rgba(0, 0, 0, 0.1)', - X12: 'rgba(0, 0, 0, 0.1)', - X13: 'rgba(0, 0, 0, 0.15)', - X14: ':alpha<0.5<@navBg', - X15: ':alpha<0<@panel', - X16: ':alpha<0.7<@panel', - X17: ':alpha<0.8<@bg', - }, -} diff --git a/src/client/themes/d-astro.json5 b/src/client/themes/d-astro.json5 deleted file mode 100644 index c6a927ec3a..0000000000 --- a/src/client/themes/d-astro.json5 +++ /dev/null @@ -1,78 +0,0 @@ -{ - id: '080a01c5-377d-4fbb-88cc-6bb5d04977ea', - base: 'dark', - name: 'Mi Astro Dark', - author: 'syuilo', - props: { - bg: '#232125', - fg: '#efdab9', - cwBg: '#687390', - cwFg: '#393f4f', - link: '#78b0a0', - warn: '#ecb637', - badge: '#31b1ce', - error: '#ec4137', - focus: ':alpha<0.3<@accent', - navBg: '@panel', - navFg: '@fg', - panel: '#2a272b', - accent: '#81c08b', - header: ':alpha<0.7<@bg', - infoBg: '#253142', - infoFg: '#fff', - renote: '#659CC8', - shadow: 'rgba(0, 0, 0, 0.3)', - divider: 'rgba(255, 255, 255, 0.1)', - hashtag: '#ff9156', - mention: '#ffd152', - modalBg: 'rgba(0, 0, 0, 0.5)', - success: '#86b300', - buttonBg: 'rgba(255, 255, 255, 0.05)', - acrylicBg: ':alpha<0.5<@bg', - cwHoverBg: '#707b97', - indicator: '@accent', - mentionMe: '#fb5d38', - messageBg: '@bg', - navActive: '@accent', - infoWarnBg: '#42321c', - infoWarnFg: '#ffbd3e', - navHoverFg: ':lighten<17<@fg', - dateLabelFg: '@fg', - inputBorder: 'rgba(255, 255, 255, 0.1)', - inputBorderHover: 'rgba(255, 255, 255, 0.2)', - panelBorder: '" solid 1px var(--divider)', - accentDarken: ':darken<10<@accent', - acrylicPanel: ':alpha<0.5<@panel', - navIndicator: '@accent', - accentLighten: ':lighten<10<@accent', - buttonHoverBg: 'rgba(255, 255, 255, 0.1)', - buttonGradateA: '@accent', - buttonGradateB: ':hue<-20<@accent', - driveFolderBg: ':alpha<0.3<@accent', - fgHighlighted: ':lighten<3<@fg', - panelHeaderBg: ':lighten<3<@panel', - panelHeaderFg: '@fg', - htmlThemeColor: '@bg', - panelHighlight: ':lighten<3<@panel', - listItemHoverBg: 'rgba(255, 255, 255, 0.03)', - scrollbarHandle: 'rgba(255, 255, 255, 0.2)', - wallpaperOverlay: 'rgba(0, 0, 0, 0.5)', - panelHeaderDivider: 'rgba(0, 0, 0, 0)', - scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)', - X2: ':darken<2<@panel', - X3: 'rgba(255, 255, 255, 0.05)', - X4: 'rgba(255, 255, 255, 0.1)', - X5: 'rgba(255, 255, 255, 0.05)', - X6: 'rgba(255, 255, 255, 0.15)', - X7: 'rgba(255, 255, 255, 0.05)', - X8: ':lighten<5<@accent', - X9: ':darken<5<@accent', - X10: ':alpha<0.4<@accent', - X11: 'rgba(0, 0, 0, 0.3)', - X12: 'rgba(255, 255, 255, 0.1)', - X13: 'rgba(255, 255, 255, 0.15)', - X14: ':alpha<0.5<@navBg', - X15: ':alpha<0<@panel', - X16: ':alpha<0.7<@panel', - }, -} diff --git a/src/client/themes/d-black.json5 b/src/client/themes/d-black.json5 deleted file mode 100644 index 3c18ebdaf1..0000000000 --- a/src/client/themes/d-black.json5 +++ /dev/null @@ -1,17 +0,0 @@ -{ - id: '8c539dc1-0fab-4d47-9194-39c508e9bfe1', - - name: 'Mi Black', - author: 'syuilo', - - base: 'dark', - - props: { - divider: '#2d2d2d', - panel: '#131313', - panelHeaderBg: '@panel', - panelHeaderDivider: '@divider', - shadow: 'rgba(255, 255, 255, 0.05)', - modalBg: 'rgba(255, 255, 255, 0.1)', - }, -} diff --git a/src/client/themes/d-botanical.json5 b/src/client/themes/d-botanical.json5 deleted file mode 100644 index c03b95e2d7..0000000000 --- a/src/client/themes/d-botanical.json5 +++ /dev/null @@ -1,26 +0,0 @@ -{ - id: '504debaf-4912-6a4c-5059-1db08a76b737', - - name: 'Mi Botanical Dark', - author: 'syuilo', - - base: 'dark', - - props: { - accent: 'rgb(148, 179, 0)', - bg: 'rgb(37, 38, 36)', - fg: 'rgb(216, 212, 199)', - fgHighlighted: '#fff', - divider: 'rgba(255, 255, 255, 0.14)', - panel: 'rgb(47, 47, 44)', - panelHeaderBg: '@panel', - panelHeaderDivider: '@divider', - header: ':alpha<0.7<@panel', - navBg: '#363636', - renote: '@accent', - mention: 'rgb(212, 153, 76)', - mentionMe: 'rgb(212, 210, 76)', - hashtag: '#5bcbb0', - link: '@accent', - }, -} diff --git a/src/client/themes/d-dark.json5 b/src/client/themes/d-dark.json5 deleted file mode 100644 index d24ce4df69..0000000000 --- a/src/client/themes/d-dark.json5 +++ /dev/null @@ -1,26 +0,0 @@ -{ - id: '8050783a-7f63-445a-b270-36d0f6ba1677', - - name: 'Mi Dark', - author: 'syuilo', - desc: 'Default light theme', - - base: 'dark', - - props: { - bg: '#232323', - fg: 'rgb(199, 209, 216)', - fgHighlighted: '#fff', - divider: 'rgba(255, 255, 255, 0.14)', - panel: '#2d2d2d', - panelHeaderBg: '@panel', - panelHeaderDivider: '@divider', - header: ':alpha<0.7<@panel', - navBg: '#363636', - renote: '@accent', - mention: '#da6d35', - mentionMe: '#d44c4c', - hashtag: '#4cb8d4', - link: '@accent', - }, -} diff --git a/src/client/themes/d-future.json5 b/src/client/themes/d-future.json5 deleted file mode 100644 index b6fa1ab0c1..0000000000 --- a/src/client/themes/d-future.json5 +++ /dev/null @@ -1,27 +0,0 @@ -{ - id: '32a637ef-b47a-4775-bb7b-bacbb823f865', - - name: 'Mi Future Dark', - author: 'syuilo', - - base: 'dark', - - props: { - accent: '#63e2b7', - bg: '#101014', - fg: '#D5D5D6', - fgHighlighted: '#fff', - fgOnAccent: '#000', - divider: 'rgba(255, 255, 255, 0.1)', - panel: '#18181c', - panelHeaderBg: '@panel', - panelHeaderDivider: '@divider', - renote: '@accent', - mention: '#f2c97d', - mentionMe: '@accent', - hashtag: '#70c0e8', - link: '#e88080', - buttonGradateA: '@accent', - buttonGradateB: ':saturate<30<:hue<30<@accent', - }, -} diff --git a/src/client/themes/d-persimmon.json5 b/src/client/themes/d-persimmon.json5 deleted file mode 100644 index e36265ff10..0000000000 --- a/src/client/themes/d-persimmon.json5 +++ /dev/null @@ -1,25 +0,0 @@ -{ - id: 'c503d768-7c70-4db2-a4e6-08264304bc8d', - - name: 'Mi Persimmon Dark', - author: 'syuilo', - - base: 'dark', - - props: { - accent: 'rgb(206, 102, 65)', - bg: 'rgb(31, 33, 31)', - fg: '#cdd8c7', - fgHighlighted: '#fff', - divider: 'rgba(255, 255, 255, 0.14)', - panel: 'rgb(41, 43, 41)', - infoFg: '@fg', - infoBg: '#333c3b', - navBg: '#141714', - renote: '@accent', - mention: '@accent', - mentionMe: '#de6161', - hashtag: '#68bad0', - link: '#a1c758', - }, -} diff --git a/src/client/themes/d-pumpkin.json5 b/src/client/themes/d-pumpkin.json5 deleted file mode 100644 index 064ca4577b..0000000000 --- a/src/client/themes/d-pumpkin.json5 +++ /dev/null @@ -1,88 +0,0 @@ -{ - id: '0b64fef3-02c7-20b5-dd87-b3f77e2b4301', - - name: 'Mi Pumpkin Dark', - author: 'syuilo', - - base: 'dark', - - props: { - X2: ':darken<2<@panel', - X3: 'rgba(255, 255, 255, 0.05)', - X4: 'rgba(255, 255, 255, 0.1)', - X5: 'rgba(255, 255, 255, 0.05)', - X6: 'rgba(255, 255, 255, 0.15)', - X7: 'rgba(255, 255, 255, 0.05)', - X8: ':lighten<5<@accent', - X9: ':darken<5<@accent', - bg: 'rgb(37, 32, 47)', - fg: '#e0d5c0', - X10: ':alpha<0.4<@accent', - X11: 'rgba(0, 0, 0, 0.3)', - X12: 'rgba(255, 255, 255, 0.1)', - X13: 'rgba(255, 255, 255, 0.15)', - X14: ':alpha<0.5<@navBg', - X15: ':alpha<0<@panel', - X16: ':alpha<0.7<@panel', - X17: ':alpha<0.8<@bg', - cwBg: '#687390', - cwFg: '#393f4f', - link: 'rgb(172, 193, 68)', - warn: '#ecb637', - badge: '#31b1ce', - error: '#ec4137', - focus: ':alpha<0.3<@accent', - navBg: '@panel', - navFg: '@fg', - panel: ':lighten<3<@bg', - popup: ':lighten<3<@panel', - accent: 'rgb(242, 133, 36)', - header: ':alpha<0.7<@panel', - infoBg: '#253142', - infoFg: '#fff', - renote: 'rgb(110, 179, 72)', - shadow: 'rgba(0, 0, 0, 0.3)', - divider: 'rgba(255, 255, 255, 0.1)', - hashtag: 'rgb(188, 90, 255)', - mention: 'rgb(72, 179, 139)', - modalBg: 'rgba(0, 0, 0, 0.5)', - success: '#86b300', - buttonBg: 'rgba(255, 255, 255, 0.05)', - switchBg: 'rgba(255, 255, 255, 0.15)', - acrylicBg: ':alpha<0.5<@bg', - cwHoverBg: '#707b97', - indicator: '@accent', - mentionMe: '@accent', - messageBg: '@bg', - navActive: '@accent', - accentedBg: ':alpha<0.15<@accent', - fgOnAccent: '#000', - infoWarnBg: '#42321c', - infoWarnFg: '#ffbd3e', - navHoverFg: ':lighten<17<@fg', - dateLabelFg: '@fg', - inputBorder: 'rgba(255, 255, 255, 0.1)', - panelBorder: '" solid 1px var(--divider)', - accentDarken: ':darken<10<@accent', - acrylicPanel: ':alpha<0.5<@panel', - navIndicator: '@indicator', - accentLighten: ':lighten<10<@accent', - buttonHoverBg: 'rgba(255, 255, 255, 0.1)', - driveFolderBg: ':alpha<0.3<@accent', - fgHighlighted: ':lighten<3<@fg', - fgTransparent: ':alpha<0.5<@fg', - panelHeaderBg: ':lighten<3<@panel', - panelHeaderFg: '@fg', - buttonGradateA: '@accent', - buttonGradateB: ':hue<20<@accent', - htmlThemeColor: '@bg', - panelHighlight: ':lighten<3<@panel', - listItemHoverBg: 'rgba(255, 255, 255, 0.03)', - scrollbarHandle: 'rgba(255, 255, 255, 0.2)', - inputBorderHover: 'rgba(255, 255, 255, 0.2)', - wallpaperOverlay: 'rgba(0, 0, 0, 0.5)', - fgTransparentWeak: ':alpha<0.75<@fg', - panelHeaderDivider: 'rgba(0, 0, 0, 0)', - scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)', - }, -} diff --git a/src/client/themes/l-apricot.json5 b/src/client/themes/l-apricot.json5 deleted file mode 100644 index 1ed5525575..0000000000 --- a/src/client/themes/l-apricot.json5 +++ /dev/null @@ -1,22 +0,0 @@ -{ - id: '0ff48d43-aab3-46e7-ab12-8492110d2e2b', - - name: 'Mi Apricot Light', - author: 'syuilo', - - base: 'light', - - props: { - accent: 'rgb(234, 154, 82)', - bg: '#e6e5e2', - fg: 'rgb(149, 143, 139)', - panel: '#EEECE8', - renote: '@accent', - link: '@accent', - mention: '@accent', - hashtag: '@accent', - inputBorder: 'rgba(0, 0, 0, 0.1)', - inputBorderHover: 'rgba(0, 0, 0, 0.2)', - infoBg: 'rgb(226, 235, 241)', - }, -} diff --git a/src/client/themes/l-light.json5 b/src/client/themes/l-light.json5 deleted file mode 100644 index 248355c945..0000000000 --- a/src/client/themes/l-light.json5 +++ /dev/null @@ -1,20 +0,0 @@ -{ - id: '4eea646f-7afa-4645-83e9-83af0333cd37', - - name: 'Mi Light', - author: 'syuilo', - desc: 'Default light theme', - - base: 'light', - - props: { - bg: '#f9f9f9', - fg: '#676767', - divider: '#e8e8e8', - header: ':alpha<0.7<@panel', - navBg: '#fff', - panel: '#fff', - panelHeaderDivider: '@divider', - mentionMe: 'rgb(0, 179, 70)', - }, -} diff --git a/src/client/themes/l-rainy.json5 b/src/client/themes/l-rainy.json5 deleted file mode 100644 index 283dd74c6c..0000000000 --- a/src/client/themes/l-rainy.json5 +++ /dev/null @@ -1,21 +0,0 @@ -{ - id: 'a58a0abb-ff8c-476a-8dec-0ad7837e7e96', - - name: 'Mi Rainy Light', - author: 'syuilo', - - base: 'light', - - props: { - accent: '#5db0da', - bg: 'rgb(246 248 249)', - fg: '#636b71', - panel: '#fff', - divider: 'rgb(230 233 234)', - panelHeaderDivider: '@divider', - renote: '@accent', - link: '@accent', - mention: '@accent', - hashtag: '@accent', - }, -} diff --git a/src/client/themes/l-sushi.json5 b/src/client/themes/l-sushi.json5 deleted file mode 100644 index 5846927d65..0000000000 --- a/src/client/themes/l-sushi.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - id: '213273e5-7d20-d5f0-6e36-1b6a4f67115c', - - name: 'Mi Sushi Light', - author: 'syuilo', - - base: 'light', - - props: { - accent: '#e36749', - bg: '#f0eee9', - fg: '#5f5f5f', - renote: '@accent', - link: '@accent', - mention: '@accent', - hashtag: '#229e82', - }, -} diff --git a/src/client/themes/l-vivid.json5 b/src/client/themes/l-vivid.json5 deleted file mode 100644 index b3c08f38ae..0000000000 --- a/src/client/themes/l-vivid.json5 +++ /dev/null @@ -1,82 +0,0 @@ -{ - id: '6128c2a9-5c54-43fe-a47d-17942356470b', - - name: 'Mi Vivid Light', - author: 'syuilo', - - base: 'light', - - props: { - bg: '#fafafa', - fg: '#444', - cwBg: '#b1b9c1', - cwFg: '#fff', - link: '#ff9400', - warn: '#ecb637', - badge: '#31b1ce', - error: '#ec4137', - focus: ':alpha<0.3<@accent', - navBg: '@panel', - navFg: '@fg', - panel: '#fff', - accent: '#008cff', - header: ':alpha<0.7<@panel', - infoBg: '#e5f5ff', - infoFg: '#72818a', - renote: '@accent', - shadow: 'rgba(0, 0, 0, 0.1)', - divider: 'rgba(0, 0, 0, 0.08)', - hashtag: '#92d400', - mention: '@accent', - modalBg: 'rgba(0, 0, 0, 0.3)', - success: '#86b300', - buttonBg: 'rgba(0, 0, 0, 0.05)', - acrylicBg: ':alpha<0.5<@bg', - cwHoverBg: '#bbc4ce', - indicator: '@accent', - mentionMe: '@mention', - messageBg: '@bg', - navActive: '@accent', - infoWarnBg: '#fff0db', - infoWarnFg: '#8f6e31', - navHoverFg: ':darken<17<@fg', - dateLabelFg: '@fg', - inputBorder: 'rgba(0, 0, 0, 0.1)', - inputBorderHover: 'rgba(0, 0, 0, 0.2)', - panelBorder: '" solid 1px var(--divider)', - accentDarken: ':darken<10<@accent', - acrylicPanel: ':alpha<0.5<@panel', - navIndicator: '@accent', - accentLighten: ':lighten<10<@accent', - buttonHoverBg: 'rgba(0, 0, 0, 0.1)', - driveFolderBg: ':alpha<0.3<@accent', - fgHighlighted: ':darken<3<@fg', - fgTransparent: ':alpha<0.5<@fg', - panelHeaderBg: ':lighten<3<@panel', - panelHeaderFg: '@fg', - htmlThemeColor: '@bg', - panelHighlight: ':darken<3<@panel', - listItemHoverBg: 'rgba(0, 0, 0, 0.03)', - scrollbarHandle: 'rgba(0, 0, 0, 0.2)', - wallpaperOverlay: 'rgba(255, 255, 255, 0.5)', - fgTransparentWeak: ':alpha<0.75<@fg', - panelHeaderDivider: '@divider', - scrollbarHandleHover: 'rgba(0, 0, 0, 0.4)', - X2: ':darken<2<@panel', - X3: 'rgba(0, 0, 0, 0.05)', - X4: 'rgba(0, 0, 0, 0.1)', - X5: 'rgba(0, 0, 0, 0.05)', - X6: 'rgba(0, 0, 0, 0.25)', - X7: 'rgba(0, 0, 0, 0.05)', - X8: ':lighten<5<@accent', - X9: ':darken<5<@accent', - X10: ':alpha<0.4<@accent', - X11: 'rgba(0, 0, 0, 0.1)', - X12: 'rgba(0, 0, 0, 0.1)', - X13: 'rgba(0, 0, 0, 0.15)', - X14: ':alpha<0.5<@navBg', - X15: ':alpha<0<@panel', - X16: ':alpha<0.7<@panel', - X17: ':alpha<0.8<@bg', - }, -} diff --git a/src/client/tsconfig.json b/src/client/tsconfig.json deleted file mode 100644 index 7a26047ddf..0000000000 --- a/src/client/tsconfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "compilerOptions": { - "allowJs": true, - "noEmitOnError": false, - "noImplicitAny": false, - "noImplicitReturns": true, - "noUnusedParameters": false, - "noUnusedLocals": true, - "noFallthroughCasesInSwitch": true, - "declaration": false, - "sourceMap": false, - "target": "es2017", - "module": "esnext", - "moduleResolution": "node", - "removeComments": false, - "noLib": false, - "strict": true, - "strictNullChecks": true, - "experimentalDecorators": true, - "resolveJsonModule": true, - "baseUrl": ".", - "paths": { - "@/*": ["../*"], - "@client/*": ["./*"], - "@lib/*": ["../../lib/*"], - }, - "typeRoots": [ - "node_modules/@types", - "src/@types", - "src/client/@types" - ], - "lib": [ - "esnext", - "dom", - "webworker" - ] - }, - "compileOnSave": false, - "include": [ - "./**/*.ts" - ] -} diff --git a/src/client/ui/_common_/common.vue b/src/client/ui/_common_/common.vue deleted file mode 100644 index 8da19a0984..0000000000 --- a/src/client/ui/_common_/common.vue +++ /dev/null @@ -1,89 +0,0 @@ - - - - - diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue deleted file mode 100644 index cd78b6ae46..0000000000 --- a/src/client/ui/_common_/sidebar.vue +++ /dev/null @@ -1,388 +0,0 @@ - - - - - diff --git a/src/client/ui/_common_/stream-indicator.vue b/src/client/ui/_common_/stream-indicator.vue deleted file mode 100644 index 23f2357d85..0000000000 --- a/src/client/ui/_common_/stream-indicator.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/src/client/ui/_common_/upload.vue b/src/client/ui/_common_/upload.vue deleted file mode 100644 index 25a807cd36..0000000000 --- a/src/client/ui/_common_/upload.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/date-separated-list.vue b/src/client/ui/chat/date-separated-list.vue deleted file mode 100644 index 12638cd230..0000000000 --- a/src/client/ui/chat/date-separated-list.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/header-clock.vue b/src/client/ui/chat/header-clock.vue deleted file mode 100644 index 69ec3cb64b..0000000000 --- a/src/client/ui/chat/header-clock.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/index.vue b/src/client/ui/chat/index.vue deleted file mode 100644 index 4c068b0d94..0000000000 --- a/src/client/ui/chat/index.vue +++ /dev/null @@ -1,467 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/note-header.vue b/src/client/ui/chat/note-header.vue deleted file mode 100644 index e40f22f588..0000000000 --- a/src/client/ui/chat/note-header.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/note-preview.vue b/src/client/ui/chat/note-preview.vue deleted file mode 100644 index beb38de644..0000000000 --- a/src/client/ui/chat/note-preview.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/note.sub.vue b/src/client/ui/chat/note.sub.vue deleted file mode 100644 index a284ba2bf4..0000000000 --- a/src/client/ui/chat/note.sub.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/note.vue b/src/client/ui/chat/note.vue deleted file mode 100644 index 0a054d1057..0000000000 --- a/src/client/ui/chat/note.vue +++ /dev/null @@ -1,1144 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/notes.vue b/src/client/ui/chat/notes.vue deleted file mode 100644 index 6690baf584..0000000000 --- a/src/client/ui/chat/notes.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/src/client/ui/chat/pages/channel.vue b/src/client/ui/chat/pages/channel.vue deleted file mode 100644 index d11d40b210..0000000000 --- a/src/client/ui/chat/pages/channel.vue +++ /dev/null @@ -1,259 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/pages/timeline.vue b/src/client/ui/chat/pages/timeline.vue deleted file mode 100644 index 0f9cd7f11e..0000000000 --- a/src/client/ui/chat/pages/timeline.vue +++ /dev/null @@ -1,221 +0,0 @@ - - - - - diff --git a/src/client/ui/chat/post-form.vue b/src/client/ui/chat/post-form.vue deleted file mode 100644 index e1e56dee35..0000000000 --- a/src/client/ui/chat/post-form.vue +++ /dev/null @@ -1,773 +0,0 @@ - - - - - diff --git a/src/client/widgets/button.vue b/src/client/widgets/button.vue deleted file mode 100644 index af6718c507..0000000000 --- a/src/client/widgets/button.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - diff --git a/src/client/widgets/calendar.vue b/src/client/widgets/calendar.vue deleted file mode 100644 index fe39145f0d..0000000000 --- a/src/client/widgets/calendar.vue +++ /dev/null @@ -1,204 +0,0 @@ - - - - - diff --git a/src/client/widgets/clock.vue b/src/client/widgets/clock.vue deleted file mode 100644 index d960c3809a..0000000000 --- a/src/client/widgets/clock.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/src/client/widgets/define.ts b/src/client/widgets/define.ts deleted file mode 100644 index 22b7fb30a1..0000000000 --- a/src/client/widgets/define.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { defineComponent } from 'vue'; -import { throttle } from 'throttle-debounce'; -import { Form } from '@client/scripts/form'; -import * as os from '@client/os'; - -export default function (data: { - name: string; - props?: () => T; -}) { - return defineComponent({ - props: { - widget: { - type: Object, - required: false - }, - settingCallback: { - required: false - } - }, - - emits: ['updateProps'], - - data() { - return { - props: this.widget ? JSON.parse(JSON.stringify(this.widget.data)) : {}, - save: throttle(3000, () => { - this.$emit('updateProps', this.props); - }), - }; - }, - - computed: { - id(): string { - return this.widget ? this.widget.id : null; - }, - }, - - created() { - this.mergeProps(); - - this.$watch('props', () => { - this.mergeProps(); - }, { deep: true }); - - if (this.settingCallback) this.settingCallback(this.setting); - }, - - methods: { - mergeProps() { - if (data.props) { - const defaultProps = data.props(); - for (const prop of Object.keys(defaultProps)) { - if (this.props.hasOwnProperty(prop)) continue; - this.props[prop] = defaultProps[prop].default; - } - } - }, - - async setting() { - const form = data.props(); - for (const item of Object.keys(form)) { - form[item].default = this.props[item]; - } - const { canceled, result } = await os.form(data.name, form); - if (canceled) return; - - for (const key of Object.keys(result)) { - this.props[key] = result[key]; - } - - this.save(); - }, - } - }); -} diff --git a/src/client/widgets/digital-clock.vue b/src/client/widgets/digital-clock.vue deleted file mode 100644 index 2202c9ed4b..0000000000 --- a/src/client/widgets/digital-clock.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/src/client/widgets/federation.vue b/src/client/widgets/federation.vue deleted file mode 100644 index 8ab7f594a2..0000000000 --- a/src/client/widgets/federation.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - - - diff --git a/src/client/widgets/index.ts b/src/client/widgets/index.ts deleted file mode 100644 index 51a82af080..0000000000 --- a/src/client/widgets/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { App, defineAsyncComponent } from 'vue'; - -export default function(app: App) { - app.component('MkwMemo', defineAsyncComponent(() => import('./memo.vue'))); - app.component('MkwNotifications', defineAsyncComponent(() => import('./notifications.vue'))); - app.component('MkwTimeline', defineAsyncComponent(() => import('./timeline.vue'))); - app.component('MkwCalendar', defineAsyncComponent(() => import('./calendar.vue'))); - app.component('MkwRss', defineAsyncComponent(() => import('./rss.vue'))); - app.component('MkwTrends', defineAsyncComponent(() => import('./trends.vue'))); - app.component('MkwClock', defineAsyncComponent(() => import('./clock.vue'))); - app.component('MkwActivity', defineAsyncComponent(() => import('./activity.vue'))); - app.component('MkwPhotos', defineAsyncComponent(() => import('./photos.vue'))); - app.component('MkwDigitalClock', defineAsyncComponent(() => import('./digital-clock.vue'))); - app.component('MkwFederation', defineAsyncComponent(() => import('./federation.vue'))); - app.component('MkwPostForm', defineAsyncComponent(() => import('./post-form.vue'))); - app.component('MkwSlideshow', defineAsyncComponent(() => import('./slideshow.vue'))); - app.component('MkwServerMetric', defineAsyncComponent(() => import('./server-metric/index.vue'))); - app.component('MkwOnlineUsers', defineAsyncComponent(() => import('./online-users.vue'))); - app.component('MkwJobQueue', defineAsyncComponent(() => import('./job-queue.vue'))); - app.component('MkwButton', defineAsyncComponent(() => import('./button.vue'))); - app.component('MkwAiscript', defineAsyncComponent(() => import('./aiscript.vue'))); - app.component('MkwAichan', defineAsyncComponent(() => import('./aichan.vue'))); -} - -export const widgets = [ - 'memo', - 'notifications', - 'timeline', - 'calendar', - 'rss', - 'trends', - 'clock', - 'activity', - 'photos', - 'digitalClock', - 'federation', - 'postForm', - 'slideshow', - 'serverMetric', - 'onlineUsers', - 'jobQueue', - 'button', - 'aiscript', - 'aichan', -]; diff --git a/src/client/widgets/job-queue.vue b/src/client/widgets/job-queue.vue deleted file mode 100644 index 327d8ede6d..0000000000 --- a/src/client/widgets/job-queue.vue +++ /dev/null @@ -1,183 +0,0 @@ - - - - - diff --git a/src/client/widgets/memo.vue b/src/client/widgets/memo.vue deleted file mode 100644 index 3f11e6409e..0000000000 --- a/src/client/widgets/memo.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - - - diff --git a/src/client/widgets/notifications.vue b/src/client/widgets/notifications.vue deleted file mode 100644 index 5e2648f5b9..0000000000 --- a/src/client/widgets/notifications.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/src/client/widgets/online-users.vue b/src/client/widgets/online-users.vue deleted file mode 100644 index 37060fca43..0000000000 --- a/src/client/widgets/online-users.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - diff --git a/src/client/widgets/photos.vue b/src/client/widgets/photos.vue deleted file mode 100644 index 25365d6b87..0000000000 --- a/src/client/widgets/photos.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - diff --git a/src/client/widgets/post-form.vue b/src/client/widgets/post-form.vue deleted file mode 100644 index 1f260c20d9..0000000000 --- a/src/client/widgets/post-form.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/src/client/widgets/rss.vue b/src/client/widgets/rss.vue deleted file mode 100644 index 6d19a86dff..0000000000 --- a/src/client/widgets/rss.vue +++ /dev/null @@ -1,89 +0,0 @@ - - - - - diff --git a/src/client/widgets/server-metric/cpu-mem.vue b/src/client/widgets/server-metric/cpu-mem.vue deleted file mode 100644 index ad9e6a8b0f..0000000000 --- a/src/client/widgets/server-metric/cpu-mem.vue +++ /dev/null @@ -1,174 +0,0 @@ - - - - - diff --git a/src/client/widgets/server-metric/cpu.vue b/src/client/widgets/server-metric/cpu.vue deleted file mode 100644 index 4478ee3065..0000000000 --- a/src/client/widgets/server-metric/cpu.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/src/client/widgets/server-metric/disk.vue b/src/client/widgets/server-metric/disk.vue deleted file mode 100644 index a3f5d0376b..0000000000 --- a/src/client/widgets/server-metric/disk.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/src/client/widgets/server-metric/index.vue b/src/client/widgets/server-metric/index.vue deleted file mode 100644 index 45cd8cebf2..0000000000 --- a/src/client/widgets/server-metric/index.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/src/client/widgets/server-metric/mem.vue b/src/client/widgets/server-metric/mem.vue deleted file mode 100644 index 92c0aa0c77..0000000000 --- a/src/client/widgets/server-metric/mem.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/src/client/widgets/server-metric/net.vue b/src/client/widgets/server-metric/net.vue deleted file mode 100644 index 569c15b58b..0000000000 --- a/src/client/widgets/server-metric/net.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - - - diff --git a/src/client/widgets/server-metric/pie.vue b/src/client/widgets/server-metric/pie.vue deleted file mode 100644 index 38dcf6fcd9..0000000000 --- a/src/client/widgets/server-metric/pie.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/src/client/widgets/slideshow.vue b/src/client/widgets/slideshow.vue deleted file mode 100644 index 2f079e0d42..0000000000 --- a/src/client/widgets/slideshow.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - diff --git a/src/client/widgets/timeline.vue b/src/client/widgets/timeline.vue deleted file mode 100644 index bd951d8565..0000000000 --- a/src/client/widgets/timeline.vue +++ /dev/null @@ -1,116 +0,0 @@ - - - diff --git a/src/client/widgets/trends.vue b/src/client/widgets/trends.vue deleted file mode 100644 index 8511bc718f..0000000000 --- a/src/client/widgets/trends.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - - - -- cgit v1.2.3-freya