diff options
| author | anatawa12 <anatawa12@icloud.com> | 2025-04-05 08:46:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-05 08:46:17 +0900 |
| commit | 5949bb6c7fec5616e9d3f9ba21eb1ab1b41ed905 (patch) | |
| tree | a09f7a48c07d0b99fc7c071cc22d88706ef045d7 /packages/frontend/src/utility | |
| parent | New Crowdin updates (#15740) (diff) | |
| download | sharkey-5949bb6c7fec5616e9d3f9ba21eb1ab1b41ed905.tar.gz sharkey-5949bb6c7fec5616e9d3f9ba21eb1ab1b41ed905.tar.bz2 sharkey-5949bb6c7fec5616e9d3f9ba21eb1ab1b41ed905.zip | |
fix: unnecesary HMR when we opened setting page (#15756)
* refactor: add MarkerIdAssigner instead of processVueFile and remove transformedCodeCache object
* chore: add minimatch, a glob matcher
* chore: expose MarkerIdAssigner from plugin
* Revert "chore: expose MarkerIdAssigner from plugin"
This reverts commit 88c6d820f8635c35f1c15b4aac0987075d7cf8aa.
* chore: add plugin to generate virtual module
* chore: parse inlining earlier
* chore: use virtual module in search
* chore: use remove old generation
* chore: fix type errors
* chore: add patch to workaround vitejs/vite#19792
* chore: improve filtering files to process
* chore: rename plugin
* docs: add comment for plugin ordering
* fix: unnecessary log
* fix: spdx license header
Diffstat (limited to 'packages/frontend/src/utility')
| -rw-r--r-- | packages/frontend/src/utility/autogen/settings-search-index.ts | 993 | ||||
| -rw-r--r-- | packages/frontend/src/utility/settings-search-index.ts | 43 | ||||
| -rw-r--r-- | packages/frontend/src/utility/virtual.d.ts | 18 |
3 files changed, 61 insertions, 993 deletions
diff --git a/packages/frontend/src/utility/autogen/settings-search-index.ts b/packages/frontend/src/utility/autogen/settings-search-index.ts deleted file mode 100644 index 7f800d2b70..0000000000 --- a/packages/frontend/src/utility/autogen/settings-search-index.ts +++ /dev/null @@ -1,993 +0,0 @@ - -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -// This file was automatically generated by create-search-index. -// Do not edit this file. - -import { i18n } from '@/i18n.js'; - -export type SearchIndexItem = { - id: string; - path?: string; - label: string; - keywords: string[]; - icon?: string; - children?: SearchIndexItem[]; -}; - -export const searchIndexes: SearchIndexItem[] = [ - { - id: 'flXd1LC7r', - children: [ - { - id: 'hB11H5oul', - label: i18n.ts.syncDeviceDarkMode, - keywords: ['sync', 'device', 'dark', 'light', 'mode'], - }, - { - id: 'fDbLtIKeo', - label: i18n.ts.themeForLightMode, - keywords: ['light', 'theme'], - }, - { - id: 'CsSVILKpX', - label: i18n.ts.themeForDarkMode, - keywords: ['dark', 'theme'], - }, - { - id: 'jwW5HULqA', - label: i18n.ts._settings.enableSyncThemesBetweenDevices, - keywords: ['sync', 'themes', 'devices'], - }, - ], - label: i18n.ts.theme, - keywords: ['theme'], - path: '/settings/theme', - icon: 'ti ti-palette', - }, - { - id: '6fFIRXUww', - children: [ - { - id: 'EcwZE7dCl', - label: i18n.ts.notUseSound, - keywords: ['mute'], - }, - { - id: '9MxYVIf7k', - label: i18n.ts.useSoundOnlyWhenActive, - keywords: ['active', 'mute'], - }, - { - id: '94afQxKat', - label: i18n.ts.masterVolume, - keywords: ['volume', 'master'], - }, - ], - label: i18n.ts.sounds, - keywords: ['sounds', i18n.ts._settings.soundsBanner], - path: '/settings/sounds', - icon: 'ti ti-music', - }, - { - id: '5BjnxMfYV', - children: [ - { - id: '75QPEg57v', - children: [ - { - id: 'CiHijRkGG', - label: i18n.ts.changePassword, - keywords: [], - }, - ], - label: i18n.ts.password, - keywords: ['password'], - }, - { - id: '2fa', - children: [ - { - id: 'qCXM0HtJ7', - label: i18n.ts.totp, - keywords: ['totp', 'app', i18n.ts.totpDescription], - }, - { - id: '3g1RePuD9', - label: i18n.ts.securityKeyAndPasskey, - keywords: ['security', 'key', 'passkey'], - }, - { - id: 'pFRud5u8k', - label: i18n.ts.passwordLessLogin, - keywords: ['password', 'less', 'key', 'passkey', 'login', 'signin', i18n.ts.passwordLessLoginDescription], - }, - ], - label: i18n.ts['2fa'], - keywords: ['2fa'], - }, - ], - label: i18n.ts.security, - keywords: ['security', i18n.ts._settings.securityBanner], - path: '/settings/security', - icon: 'ti ti-lock', - }, - { - id: 'w4L6myH61', - children: [ - { - id: 'ru8DrOn3J', - label: i18n.ts._profile.changeBanner, - keywords: ['banner', 'change'], - }, - { - id: 'CCnD8Apnu', - label: i18n.ts._profile.changeAvatar, - keywords: ['avatar', 'icon', 'change'], - }, - { - id: 'yFEVCJxFX', - label: i18n.ts._profile.name, - keywords: ['name'], - }, - { - id: '2O1S5reaB', - label: i18n.ts._profile.description, - keywords: ['description', 'bio'], - }, - { - id: 'pWi4OLS8g', - label: i18n.ts.location, - keywords: ['location', 'locale'], - }, - { - id: 'oLO5X6Wtw', - label: i18n.ts.birthday, - keywords: ['birthday', 'birthdate', 'age'], - }, - { - id: 'm2trKwPgq', - label: i18n.ts.language, - keywords: ['language', 'locale'], - }, - { - id: 'kfDZxCDp9', - label: i18n.ts._profile.metadataEdit, - keywords: ['metadata'], - }, - { - id: 'uPt3MFymp', - label: i18n.ts._profile.followedMessage, - keywords: ['follow', 'message', i18n.ts._profile.followedMessageDescription], - }, - { - id: 'wuGg0tBjw', - label: i18n.ts.reactionAcceptance, - keywords: ['reaction'], - }, - { - id: 'EezPpmMnf', - children: [ - { - id: 'f2cRLh8ad', - label: i18n.ts.flagAsCat, - keywords: ['cat'], - }, - { - id: 'eVoViiF3h', - label: i18n.ts.flagAsBot, - keywords: ['bot'], - }, - ], - label: i18n.ts.advancedSettings, - keywords: [], - }, - ], - label: i18n.ts.profile, - keywords: ['profile'], - path: '/settings/profile', - icon: 'ti ti-user', - }, - { - id: '2rp9ka5Ht', - children: [ - { - id: 'BhAQiHogN', - label: i18n.ts.makeFollowManuallyApprove, - keywords: ['follow', 'lock', i18n.ts.lockedAccountInfo], - }, - { - id: '4DeWGsPaD', - label: i18n.ts.autoAcceptFollowed, - keywords: ['follow', 'auto', 'accept'], - }, - { - id: 'iaM6zUmO9', - label: i18n.ts.makeReactionsPublic, - keywords: ['reaction', 'public', i18n.ts.makeReactionsPublicDescription], - }, - { - id: '5Q6uhghzV', - label: i18n.ts.followingVisibility, - keywords: ['following', 'visibility'], - }, - { - id: 'pZ9q65FX5', - label: i18n.ts.followersVisibility, - keywords: ['follower', 'visibility'], - }, - { - id: 'DMS4yvAGg', - label: i18n.ts.hideOnlineStatus, - keywords: ['online', 'status', i18n.ts.hideOnlineStatusDescription], - }, - { - id: '8rEsGuN8w', - label: i18n.ts.noCrawle, - keywords: ['crawle', 'index', 'search', i18n.ts.noCrawleDescription], - }, - { - id: 's7LdSpiLn', - label: i18n.ts.preventAiLearning, - keywords: ['crawle', 'ai', i18n.ts.preventAiLearningDescription], - }, - { - id: 'l2Wf1s2ad', - label: i18n.ts.makeExplorable, - keywords: ['explore', i18n.ts.makeExplorableDescription], - }, - { - id: 'xEYlOghao', - label: i18n.ts._chat.chatAllowedUsers, - keywords: ['chat'], - }, - { - id: 'BnOtlyaAh', - children: [ - { - id: 'BzMIVBpL0', - label: i18n.ts._accountSettings.requireSigninToViewContents, - keywords: ['login', 'signin'], - }, - { - id: 'jJUqPqBAv', - label: i18n.ts._accountSettings.makeNotesFollowersOnlyBefore, - keywords: ['follower', i18n.ts._accountSettings.makeNotesFollowersOnlyBeforeDescription], - }, - { - id: 'ra10txIFV', - label: i18n.ts._accountSettings.makeNotesHiddenBefore, - keywords: ['hidden', i18n.ts._accountSettings.makeNotesHiddenBeforeDescription], - }, - ], - label: i18n.ts.lockdown, - keywords: ['lockdown'], - }, - ], - label: i18n.ts.privacy, - keywords: ['privacy', i18n.ts._settings.privacyBanner], - path: '/settings/privacy', - icon: 'ti ti-lock-open', - }, - { - id: '3yCAv0IsZ', - children: [ - { - id: 'AKvDrxSj5', - children: [ - { - id: 'a5b9RjEvq', - label: i18n.ts.uiLanguage, - keywords: ['language'], - }, - { - id: '9ragaff40', - label: i18n.ts.overridedDeviceKind, - keywords: ['device', 'type', 'kind', 'smartphone', 'tablet', 'desktop'], - }, - { - id: 'lfI3yMX9g', - label: i18n.ts.showAvatarDecorations, - keywords: ['avatar', 'icon', 'decoration', 'show'], - }, - { - id: '31Y4IcGEf', - label: i18n.ts.alwaysConfirmFollow, - keywords: ['follow', 'confirm', 'always'], - }, - { - id: '78q2asrLS', - label: i18n.ts.highlightSensitiveMedia, - keywords: ['highlight', 'sensitive', 'nsfw', 'image', 'photo', 'picture', 'media', 'thumbnail'], - }, - { - id: 'zydOfGYip', - label: i18n.ts.confirmWhenRevealingSensitiveMedia, - keywords: ['sensitive', 'nsfw', 'media', 'image', 'photo', 'picture', 'attachment', 'confirm'], - }, - { - id: 'wqpOC22Zm', - label: i18n.ts.enableAdvancedMfm, - keywords: ['mfm', 'enable', 'show', 'advanced'], - }, - { - id: 'c98gbF9c6', - label: i18n.ts.enableInfiniteScroll, - keywords: ['auto', 'load', 'auto', 'more', 'scroll'], - }, - { - id: '6ANRSOaNg', - label: i18n.ts.emojiStyle, - keywords: ['emoji', 'style', 'native', 'system', 'fluent', 'twemoji'], - }, - ], - label: i18n.ts.general, - keywords: ['general'], - }, - { - id: '5G6O6qdis', - children: [ - { - id: 'khT3n6byY', - label: i18n.ts.showFixedPostForm, - keywords: ['post', 'form', 'timeline'], - }, - { - id: 'q5ElfNSou', - label: i18n.ts.showFixedPostFormInChannel, - keywords: ['post', 'form', 'timeline', 'channel'], - }, - { - id: '3GcWIaZf8', - label: i18n.ts.collapseRenotes, - keywords: ['renote', i18n.ts.collapseRenotesDescription], - }, - { - id: 'd2H4E5ys6', - label: i18n.ts.showGapBetweenNotesInTimeline, - keywords: ['note', 'timeline', 'gap'], - }, - { - id: '1LHOhDKGW', - label: i18n.ts.disableStreamingTimeline, - keywords: ['disable', 'streaming', 'timeline'], - }, - { - id: 'DSzwvTp7i', - label: i18n.ts.pinnedList, - keywords: ['pinned', 'list'], - }, - { - id: 'ykifk3NHS', - label: i18n.ts.showNoteActionsOnlyHover, - keywords: ['hover', 'show', 'footer', 'action'], - }, - { - id: 'tLGyaQagB', - label: i18n.ts.showClipButtonInNoteFooter, - keywords: ['footer', 'action', 'clip', 'show'], - }, - { - id: '7W6g8Dcqz', - label: i18n.ts.showReactionsCount, - keywords: ['reaction', 'count', 'show'], - }, - { - id: 'uAOoH3LFF', - label: i18n.ts.confirmOnReact, - keywords: ['reaction', 'confirm'], - }, - { - id: 'eCiyZLC8n', - label: i18n.ts.loadRawImages, - keywords: ['image', 'photo', 'picture', 'media', 'thumbnail', 'quality', 'raw', 'attachment'], - }, - { - id: '68u9uRmFP', - label: i18n.ts.useReactionPickerForContextMenu, - keywords: ['reaction', 'picker', 'contextmenu', 'open'], - }, - { - id: 'yxehrHZ6x', - label: i18n.ts.reactionsDisplaySize, - keywords: ['reaction', 'size', 'scale', 'display'], - }, - { - id: 'gi8ILaE2Z', - label: i18n.ts.limitWidthOfReaction, - keywords: ['reaction', 'size', 'scale', 'display', 'width', 'limit'], - }, - { - id: 'cEQJZ7DQG', - label: i18n.ts.mediaListWithOneImageAppearance, - keywords: ['attachment', 'image', 'photo', 'picture', 'media', 'thumbnail', 'list', 'size', 'height'], - }, - { - id: 'haX4QVulD', - label: i18n.ts.instanceTicker, - keywords: ['ticker', 'information', 'label', 'instance', 'server', 'host', 'federation'], - }, - { - id: 'pneYnQekL', - label: i18n.ts.displayOfSensitiveMedia, - keywords: ['attachment', 'image', 'photo', 'picture', 'media', 'thumbnail', 'nsfw', 'sensitive', 'display', 'show', 'hide', 'visibility'], - }, - ], - label: i18n.ts._settings.timelineAndNote, - keywords: ['timeline', 'note'], - }, - { - id: 'eJ2jme16W', - children: [ - { - id: 'ErMQr6LQk', - label: i18n.ts.keepCw, - keywords: ['remember', 'keep', 'note', 'cw'], - }, - { - id: 'zrJicawH9', - label: i18n.ts.rememberNoteVisibility, - keywords: ['remember', 'keep', 'note', 'visibility'], - }, - { - id: 'BaQfrVO82', - label: i18n.ts.enableQuickAddMfmFunction, - keywords: ['mfm', 'enable', 'show', 'advanced', 'picker', 'form', 'function', 'fn'], - }, - { - id: 'C2WYcVM1d', - label: i18n.ts.defaultNoteVisibility, - keywords: ['default', 'note', 'visibility'], - }, - ], - label: i18n.ts.postForm, - keywords: ['post', 'form'], - }, - { - id: 'sQXSA6gik', - children: [ - { - id: 'rICn8stqk', - label: i18n.ts.useGroupedNotifications, - keywords: ['group'], - }, - { - id: 'xFmAg2tDe', - label: i18n.ts.position, - keywords: ['position'], - }, - { - id: 'Ek4Cw3VPq', - label: i18n.ts.stackAxis, - keywords: ['stack', 'axis', 'direction'], - }, - ], - label: i18n.ts.notifications, - keywords: ['notification'], - }, - { - id: 'gDVCqZfxm', - children: [ - { - id: 'ei8Ix3s4S', - label: i18n.ts._settings._chat.showSenderName, - keywords: ['show', 'sender', 'name'], - }, - { - id: '2E7vdIUQd', - label: i18n.ts._settings._chat.sendOnEnter, - keywords: ['send', 'enter', 'newline'], - }, - ], - label: i18n.ts.chat, - keywords: ['chat', 'messaging'], - }, - { - id: '96LnS1sxB', - children: [ - { - id: 'vPQPvmntL', - label: i18n.ts.reduceUiAnimation, - keywords: ['animation', 'motion', 'reduce'], - }, - { - id: 'wfJ91vwzq', - label: i18n.ts.disableShowingAnimatedImages, - keywords: ['disable', 'animation', 'image', 'photo', 'picture', 'media', 'thumbnail', 'gif'], - }, - { - id: '42b1L4xdq', - label: i18n.ts.enableAnimatedMfm, - keywords: ['mfm', 'enable', 'show', 'animated'], - }, - { - id: 'dLkRNHn3k', - label: i18n.ts.enableHorizontalSwipe, - keywords: ['swipe', 'horizontal', 'tab'], - }, - { - id: 'BvooTWFW5', - label: i18n.ts.keepScreenOn, - keywords: ['keep', 'screen', 'display', 'on'], - }, - { - id: 'yzbghkAq0', - label: i18n.ts.useNativeUIForVideoAudioPlayer, - keywords: ['native', 'system', 'video', 'audio', 'player', 'media'], - }, - { - id: 'aSbKFHbOy', - label: i18n.ts._settings.makeEveryTextElementsSelectable, - keywords: ['text', 'selectable'], - }, - { - id: 'bTcAsPvNz', - label: i18n.ts.menuStyle, - keywords: ['menu', 'style', 'popup', 'drawer'], - }, - { - id: 'lSVBaLnyW', - label: i18n.ts._contextMenu.title, - keywords: ['contextmenu', 'system', 'native'], - }, - { - id: 'pec0uMPq5', - label: i18n.ts.fontSize, - keywords: ['font', 'size'], - }, - { - id: 'Eh7vTluDO', - label: i18n.ts.useSystemFont, - keywords: ['font', 'system', 'native'], - }, - ], - label: i18n.ts.accessibility, - keywords: ['accessibility', i18n.ts._settings.accessibilityBanner], - }, - { - id: 'vTRSKf1JA', - children: [ - { - id: '2VjlA02wB', - label: i18n.ts.turnOffToImprovePerformance, - keywords: ['blur'], - }, - { - id: 'f6J0lmg1g', - label: i18n.ts.turnOffToImprovePerformance, - keywords: ['blur', 'modal'], - }, - { - id: 'hQqXhfNg8', - label: i18n.ts.turnOffToImprovePerformance, - keywords: ['sticky'], - }, - ], - label: i18n.ts.performance, - keywords: ['performance'], - }, - { - id: 'utM8dEobb', - label: i18n.ts.dataSaver, - keywords: ['datasaver'], - }, - { - id: 'gOUvwkE9t', - children: [ - { - id: 'iUMUvFURf', - label: i18n.ts.squareAvatars, - keywords: ['avatar', 'icon', 'square'], - }, - { - id: 'ceyPO9Ywi', - label: i18n.ts.seasonalScreenEffect, - keywords: ['effect', 'show'], - }, - { - id: 'ztwIlsXhP', - label: i18n.ts.openImageInNewTab, - keywords: ['image', 'photo', 'picture', 'media', 'thumbnail', 'new', 'tab'], - }, - { - id: 'vLSsQbZEo', - label: i18n.ts.withRepliesByDefaultForNewlyFollowed, - keywords: ['follow', 'replies'], - }, - { - id: 'hQt85bBIX', - label: i18n.ts.whenServerDisconnected, - keywords: ['server', 'disconnect', 'reconnect', 'reload', 'streaming'], - }, - { - id: 'C9SyK2m0', - label: i18n.ts.numberOfPageCache, - keywords: ['cache', 'page'], - }, - { - id: '2U0iVUtfW', - label: i18n.ts.forceShowAds, - keywords: ['ad', 'show'], - }, - { - id: '1rA7ADEXY', - label: i18n.ts.hemisphere, - keywords: [], - }, - { - id: 'vRayx89Rt', - label: i18n.ts.additionalEmojiDictionary, - keywords: ['emoji', 'dictionary', 'additional', 'extra'], - }, - ], - label: i18n.ts.other, - keywords: ['other'], - }, - ], - label: i18n.ts.preferences, - keywords: ['general', 'preferences', i18n.ts._settings.preferencesBanner], - path: '/settings/preferences', - icon: 'ti ti-adjustments', - }, - { - id: 'mwkwtw83Y', - label: i18n.ts.plugins, - keywords: ['plugin', 'addon', 'extension', i18n.ts._settings.pluginBanner], - path: '/settings/plugin', - icon: 'ti ti-plug', - }, - { - id: 'F1uK9ssiY', - children: [ - { - id: 'E0ndmaP6Q', - label: i18n.ts._role.policies, - keywords: ['account', 'info'], - }, - { - id: 'r5SjfwZJc', - label: i18n.ts.rolesAssignedToMe, - keywords: ['roles'], - }, - { - id: 'cm7LrjgaW', - label: i18n.ts.accountMigration, - keywords: ['account', 'move', 'migration'], - }, - { - id: 'ozfqNviP3', - label: i18n.ts.closeAccount, - keywords: ['account', 'close', 'delete', i18n.ts._accountDelete.requestAccountDelete], - }, - { - id: 'tpywgkpxy', - label: i18n.ts.experimentalFeatures, - keywords: ['experimental', 'feature', 'flags'], - }, - { - id: 'zWbGKohZ2', - label: i18n.ts.developer, - keywords: ['developer', 'mode', 'debug'], - }, - ], - label: i18n.ts.other, - keywords: ['other'], - path: '/settings/other', - icon: 'ti ti-dots', - }, - { - id: '9bNikHWzQ', - children: [ - { - id: 't6XtfnRm9', - label: i18n.ts._settings.showNavbarSubButtons, - keywords: ['navbar', 'sidebar', 'toggle', 'button', 'sub'], - }, - ], - label: i18n.ts.navbar, - keywords: ['navbar', 'menu', 'sidebar'], - path: '/settings/navbar', - icon: 'ti ti-list', - }, - { - id: '3icEvyv2D', - children: [ - { - id: 'lO3uFTkPN', - children: [ - { - id: '5JKaXRqyt', - label: i18n.ts.showMutedWord, - keywords: ['show'], - }, - ], - label: i18n.ts.wordMute, - keywords: ['note', 'word', 'soft', 'mute', 'hide'], - }, - { - id: 'fMkjL3dK4', - label: i18n.ts.hardWordMute, - keywords: ['note', 'word', 'hard', 'mute', 'hide'], - }, - { - id: 'cimSzQXN0', - label: i18n.ts.instanceMute, - keywords: ['note', 'server', 'instance', 'host', 'federation', 'mute', 'hide'], - }, - { - id: 'gq8rPy3Du', - label: `${i18n.ts.mutedUsers} (${ i18n.ts.renote })`, - keywords: ['renote', 'mute', 'hide', 'user'], - }, - { - id: 'mh2r7EUbF', - label: i18n.ts.mutedUsers, - keywords: ['note', 'mute', 'hide', 'user'], - }, - { - id: 'AUS1OgHrn', - label: i18n.ts.blockedUsers, - keywords: ['block', 'user'], - }, - ], - label: i18n.ts.muteAndBlock, - keywords: ['mute', 'block', i18n.ts._settings.muteAndBlockBanner], - path: '/settings/mute-block', - icon: 'ti ti-ban', - }, - { - id: 'yR1OSyLiT', - children: [ - { - id: 'yMJzyzOUk', - label: i18n.ts._emojiPalette.enableSyncBetweenDevicesForPalettes, - keywords: ['sync', 'palettes', 'devices'], - }, - { - id: 'wCE09vgZr', - label: i18n.ts._emojiPalette.paletteForMain, - keywords: ['main', 'palette'], - }, - { - id: 'uCzRPrSNx', - label: i18n.ts._emojiPalette.paletteForReaction, - keywords: ['reaction', 'palette'], - }, - { - id: 'hgQr28WUk', - children: [ - { - id: 'fY04NIHSQ', - label: i18n.ts.size, - keywords: ['emoji', 'picker', 'scale', 'size'], - }, - { - id: '3j7vlaL7t', - label: i18n.ts.numberOfColumn, - keywords: ['emoji', 'picker', 'width', 'column', 'size'], - }, - { - id: 'zPX8z1Bcy', - label: i18n.ts.height, - keywords: ['emoji', 'picker', 'height', 'size'], - }, - { - id: '2CSkZa4tl', - label: i18n.ts.style, - keywords: ['emoji', 'picker', 'style'], - }, - ], - label: i18n.ts.emojiPickerDisplay, - keywords: ['emoji', 'picker', 'display'], - }, - ], - label: i18n.ts.emojiPalette, - keywords: ['emoji', 'palette'], - path: '/settings/emoji-palette', - icon: 'ti ti-mood-happy', - }, - { - id: '3Tcxw4Fwl', - children: [ - { - id: 'iIai9O65I', - label: i18n.ts.emailAddress, - keywords: ['email', 'address'], - }, - { - id: 'i6cC6oi0m', - label: i18n.ts.receiveAnnouncementFromInstance, - keywords: ['announcement', 'email'], - }, - { - id: 'C1YTinP11', - label: i18n.ts.emailNotification, - keywords: ['notification', 'email'], - }, - ], - label: i18n.ts.email, - keywords: ['email'], - path: '/settings/email', - icon: 'ti ti-mail', - }, - { - id: 'tnYoppRiv', - children: [ - { - id: 'cN3dsGNxu', - label: i18n.ts.usageAmount, - keywords: ['capacity', 'usage'], - }, - { - id: 'rOAOU2P6C', - label: i18n.ts.statistics, - keywords: ['statistics', 'usage'], - }, - { - id: 'uXGlQXATx', - label: i18n.ts.uploadFolder, - keywords: ['default', 'upload', 'folder'], - }, - { - id: 'goQdtf3dD', - label: i18n.ts.keepOriginalFilename, - keywords: ['keep', 'original', 'filename', i18n.ts.keepOriginalFilenameDescription], - }, - { - id: '83xRo0XJl', - label: i18n.ts.alwaysMarkSensitive, - keywords: ['always', 'default', 'mark', 'nsfw', 'sensitive', 'media', 'file'], - }, - { - id: 'BrBqZL35E', - label: i18n.ts.enableAutoSensitive, - keywords: ['auto', 'nsfw', 'sensitive', 'media', 'file', i18n.ts.enableAutoSensitiveDescription], - }, - ], - label: i18n.ts.drive, - keywords: ['drive', i18n.ts._settings.driveBanner], - path: '/settings/drive', - icon: 'ti ti-cloud', - }, - { - id: 'FfZdOs8y', - children: [ - { - id: 'B1ZU6Ur54', - label: i18n.ts._deck.enableSyncBetweenDevicesForProfiles, - keywords: ['sync', 'profiles', 'devices'], - }, - { - id: 'wWH4pxMQN', - label: i18n.ts._deck.useSimpleUiForNonRootPages, - keywords: ['ui', 'root', 'page'], - }, - { - id: '3LR509BvD', - label: i18n.ts.defaultNavigationBehaviour, - keywords: ['default', 'navigation', 'behaviour', 'window'], - }, - { - id: 'ybU8RLXgm', - label: i18n.ts._deck.alwaysShowMainColumn, - keywords: ['always', 'show', 'main', 'column'], - }, - { - id: 'xRasZyAVl', - label: i18n.ts._deck.columnAlign, - keywords: ['column', 'align'], - }, - { - id: '6qcyPd0oJ', - label: i18n.ts._deck.deckMenuPosition, - keywords: ['menu', 'position'], - }, - { - id: '4zk2Now4S', - label: i18n.ts._deck.navbarPosition, - keywords: ['navbar', 'position'], - }, - { - id: 'CGNtJ2I3n', - label: i18n.ts._deck.columnGap, - keywords: ['column', 'gap', 'margin'], - }, - { - id: 'rxPDMo7bE', - label: i18n.ts.setWallpaper, - keywords: ['wallpaper'], - }, - ], - label: i18n.ts.deck, - keywords: ['deck', 'ui'], - path: '/settings/deck', - icon: 'ti ti-columns', - }, - { - id: 'BlJ2rsw9h', - children: [ - { - id: '9bLU1nIjt', - label: i18n.ts._settings.api, - keywords: ['api', 'app', 'token', 'accessToken'], - }, - { - id: '5VSGOVYR0', - label: i18n.ts._settings.webhook, - keywords: ['webhook'], - }, - ], - label: i18n.ts._settings.serviceConnection, - keywords: ['app', 'service', 'connect', 'webhook', 'api', 'token', i18n.ts._settings.serviceConnectionBanner], - path: '/settings/connect', - icon: 'ti ti-link', - }, - { - id: 'gtaOSdIJB', - label: i18n.ts.avatarDecorations, - keywords: ['avatar', 'icon', 'decoration'], - path: '/settings/avatar-decoration', - icon: 'ti ti-sparkles', - }, - { - id: 'zK6posor9', - label: i18n.ts.accounts, - keywords: ['accounts'], - path: '/settings/accounts', - icon: 'ti ti-users', - }, - { - id: '330Q4mf8E', - children: [ - { - id: 'eGSjUDIKu', - label: i18n.ts._exportOrImport.allNotes, - keywords: ['notes'], - }, - { - id: 'iMDgUVgRu', - label: i18n.ts._exportOrImport.favoritedNotes, - keywords: ['favorite', 'notes'], - }, - { - id: '3y6KgkVbT', - label: i18n.ts._exportOrImport.clips, - keywords: ['clip', 'notes'], - }, - { - id: 'cKiHkj8HE', - label: i18n.ts._exportOrImport.followingList, - keywords: ['following', 'users'], - }, - { - id: '3zzmQXn0t', - label: i18n.ts._exportOrImport.userLists, - keywords: ['user', 'lists'], - }, - { - id: '3ZGXcEqWZ', - label: i18n.ts._exportOrImport.muteList, - keywords: ['mute', 'users'], - }, - { - id: '84oL7B1Dr', - label: i18n.ts._exportOrImport.blockingList, - keywords: ['block', 'users'], - }, - { - id: 'ckqi48Kbl', - label: i18n.ts.antennas, - keywords: ['antennas'], - }, - ], - label: i18n.ts._settings.accountData, - keywords: ['import', 'export', 'data', 'archive', i18n.ts._settings.accountDataBanner], - path: '/settings/account-data', - icon: 'ti ti-package', - }, -] as const; - -export type SearchIndex = typeof searchIndexes; diff --git a/packages/frontend/src/utility/settings-search-index.ts b/packages/frontend/src/utility/settings-search-index.ts new file mode 100644 index 0000000000..22e2407b15 --- /dev/null +++ b/packages/frontend/src/utility/settings-search-index.ts @@ -0,0 +1,43 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { searchIndexes as generated } from 'search-index:settings'; +import type { GeneratedSearchIndexItem } from 'search-index:settings'; + +export type SearchIndexItem = { + id: string; + path?: string; + label: string; + keywords: string[]; + icon?: string; + children?: SearchIndexItem[]; +}; + +const rootMods = new Map(generated.map(item => [item.id, item])); + +function walk(item: GeneratedSearchIndexItem) { + if (item.inlining) { + for (const id of item.inlining) { + const inline = rootMods.get(id); + if (inline) { + (item.children ??= []).push(inline); + rootMods.delete(id); + } else { + console.log('[Settings Search Index] Failed to inline', id); + } + } + } + + for (const child of item.children ?? []) { + walk(child); + } +} + +for (const item of generated) { + walk(item); +} + +export const searchIndexes: SearchIndexItem[] = generated; + diff --git a/packages/frontend/src/utility/virtual.d.ts b/packages/frontend/src/utility/virtual.d.ts new file mode 100644 index 0000000000..59470a1f5e --- /dev/null +++ b/packages/frontend/src/utility/virtual.d.ts @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +declare module 'search-index:settings' { + export type GeneratedSearchIndexItem = { + id: string; + path?: string; + label: string; + keywords: string[]; + icon?: string; + inlining?: string[]; + children?: GeneratedSearchIndexItem[]; + }; + + export const searchIndexes: GeneratedSearchIndexItem[]; +} |