This commit is contained in:
syuilo 2025-02-22 18:37:40 +09:00
parent 692b0761d6
commit 5b23857ced
7 changed files with 90 additions and 91 deletions

View File

@ -83,7 +83,7 @@ function extractUsageInfoFromTemplateAst(
}
function traverse(node: any) {
if (node.type === 1 && node.tag === 'MkSearchMarker') {
if (node.type === 1 && node.tag === 'SearchMarker') {
// 元々の props を staticProps に全て展開する
const staticProps: Record<string, string> = {};
if (node.props && Array.isArray(node.props)) {
@ -211,7 +211,7 @@ async function processVueFile(
if (ast) {
function traverse(node: any, currentParent?: any) {
if (node.type === 1 && node.tag === 'MkSearchMarker') {
if (node.type === 1 && node.tag === 'SearchMarker') {
// 行番号はコード先頭からの改行数で取得
const lineNumber = code.slice(0, node.loc.start.offset).split('\n').length;
// ファイルパスと行番号からハッシュ値を生成
@ -225,7 +225,7 @@ async function processVueFile(
node.__markerId = nodeMarkerId;
// 子マーカーの場合、親ノードに __children を設定しておく
if (currentParent && currentParent.type === 1 && currentParent.tag === 'MkSearchMarker') {
if (currentParent && currentParent.type === 1 && currentParent.tag === 'SearchMarker') {
currentParent.__children = currentParent.__children || [];
currentParent.__children.push(nodeMarkerId);
}
@ -245,7 +245,7 @@ async function processVueFile(
}
}
const newParent = node.type === 1 && node.tag === 'MkSearchMarker' ? node : currentParent;
const newParent = node.type === 1 && node.tag === 'SearchMarker' ? node : currentParent;
if (node.children && Array.isArray(node.children)) {
node.children.forEach(child => traverse(child, newParent));
}

View File

@ -3,8 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { App } from 'vue';
import Mfm from './global/MkMfm.js';
import MkA from './global/MkA.vue';
import MkAcct from './global/MkAcct.vue';
@ -26,6 +24,8 @@ import MkSpacer from './global/MkSpacer.vue';
import MkFooterSpacer from './global/MkFooterSpacer.vue';
import MkStickyContainer from './global/MkStickyContainer.vue';
import MkLazy from './global/MkLazy.vue';
import SearchMarker from './global/SearchMarker.vue';
import type { App } from 'vue';
export default function(app: App) {
for (const [key, value] of Object.entries(components)) {
@ -55,6 +55,7 @@ export const components = {
MkFooterSpacer: MkFooterSpacer,
MkStickyContainer: MkStickyContainer,
MkLazy: MkLazy,
SearchMarker: SearchMarker,
};
declare module '@vue/runtime-core' {
@ -80,5 +81,6 @@ declare module '@vue/runtime-core' {
MkFooterSpacer: typeof MkFooterSpacer;
MkStickyContainer: typeof MkStickyContainer;
MkLazy: typeof MkLazy;
SearchMarker: typeof SearchMarker;
}
}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkSearchSection :label="i18n.ts.general" :keywords="['general']" icon="ti ti-adjustments">
<div class="_gaps_m">
<MkSearchMarker
<SearchMarker
:label="i18n.ts.uiLanguage"
:keywords="['language']"
>
@ -21,9 +21,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</I18n>
</template>
</MkSelect>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.overridedDeviceKind"
:keywords="['device', 'type', 'kind', 'smartphone', 'tablet', 'desktop']"
>
@ -34,25 +34,25 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="tablet"><i class="ti ti-device-tablet"/> {{ i18n.ts.tablet }}</option>
<option value="desktop"><i class="ti ti-device-desktop"/> {{ i18n.ts.desktop }}</option>
</MkRadios>
</MkSearchMarker>
</SearchMarker>
<FormSection>
<div class="_gaps_s">
<MkSearchMarker
<SearchMarker
:label="i18n.ts.showFixedPostForm"
:keywords="['post', 'form', 'timeline']"
>
<MkSwitch v-model="showFixedPostForm">{{ i18n.ts.showFixedPostForm }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.showFixedPostFormInChannel"
:keywords="['post', 'form', 'timeline', 'channel']"
>
<MkSwitch v-model="showFixedPostFormInChannel">{{ i18n.ts.showFixedPostFormInChannel }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.pinnedList"
:keywords="['pinned', 'list']"
>
@ -62,7 +62,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton v-if="defaultStore.reactiveState.pinnedUserLists.value.length === 0" @click="setPinnedList()">{{ i18n.ts.add }}</MkButton>
<MkButton v-else danger @click="removePinnedList()"><i class="ti ti-trash"></i> {{ i18n.ts.remove }}</MkButton>
</MkFolder>
</MkSearchMarker>
</SearchMarker>
</div>
</FormSection>
@ -72,7 +72,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_m">
<div class="_gaps_s">
<MkSearchMarker
<SearchMarker
:label="i18n.ts.collapseRenotes"
:keywords="['renote', i18n.ts.collapseRenotesDescription]"
>
@ -80,65 +80,65 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.collapseRenotes }}</template>
<template #caption>{{ i18n.ts.collapseRenotesDescription }}</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.showNoteActionsOnlyHover"
:keywords="['hover', 'show', 'footer', 'action']"
>
<MkSwitch v-model="showNoteActionsOnlyHover">{{ i18n.ts.showNoteActionsOnlyHover }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.showClipButtonInNoteFooter"
:keywords="['footer', 'action', 'clip', 'show']"
>
<MkSwitch v-model="showClipButtonInNoteFooter">{{ i18n.ts.showClipButtonInNoteFooter }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.enableAdvancedMfm"
:keywords="['mfm', 'enable', 'show', 'advanced']"
>
<MkSwitch v-model="advancedMfm">{{ i18n.ts.enableAdvancedMfm }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.enableAnimatedMfm"
:keywords="['mfm', 'enable', 'show', 'animated']"
>
<MkSwitch v-if="advancedMfm" v-model="animatedMfm">{{ i18n.ts.enableAnimatedMfm }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.enableQuickAddMfmFunction"
:keywords="['mfm', 'enable', 'show', 'advanced', 'picker', 'form', 'function', 'fn']"
>
<MkSwitch v-if="advancedMfm" v-model="enableQuickAddMfmFunction">{{ i18n.ts.enableQuickAddMfmFunction }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.showReactionsCount"
:keywords="['reaction', 'count', 'show']"
>
<MkSwitch v-model="showReactionsCount">{{ i18n.ts.showReactionsCount }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.showGapBetweenNotesInTimeline"
:keywords="['note', 'timeline', 'gap']"
>
<MkSwitch v-model="showGapBetweenNotesInTimeline">{{ i18n.ts.showGapBetweenNotesInTimeline }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.loadRawImages"
:keywords="['image', 'photo', 'picture', 'media', 'thumbnail', 'quality', 'raw', 'attachment']"
>
<MkSwitch v-model="loadRawImages">{{ i18n.ts.loadRawImages }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.reactionsDisplaySize"
:keywords="['reaction', 'size', 'scale', 'display']"
>
@ -148,17 +148,17 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="medium">{{ i18n.ts.medium }}</option>
<option value="large">{{ i18n.ts.large }}</option>
</MkRadios>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.limitWidthOfReaction"
:keywords="['reaction', 'size', 'scale', 'display', 'width', 'limit']"
>
<MkSwitch v-model="limitWidthOfReaction">{{ i18n.ts.limitWidthOfReaction }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
</div>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.instanceTicker"
:keywords="['ticker', 'information', 'label', 'instance', 'server', 'host', 'federation']"
>
@ -168,9 +168,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="remote">{{ i18n.ts._instanceTicker.remote }}</option>
<option value="always">{{ i18n.ts._instanceTicker.always }}</option>
</MkSelect>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.displayOfSensitiveMedia"
:keywords="['attachment', 'image', 'photo', 'picture', 'media', 'thumbnail', 'nsfw', 'sensitive', 'display', 'show', 'hide', 'visibility']"
>
@ -180,9 +180,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="ignore">{{ i18n.ts._displayOfSensitiveMedia.ignore }}</option>
<option value="force">{{ i18n.ts._displayOfSensitiveMedia.force }}</option>
</MkSelect>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.mediaListWithOneImageAppearance"
:keywords="['attachment', 'image', 'photo', 'picture', 'media', 'thumbnail', 'list', 'size', 'height']"
>
@ -193,7 +193,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="1_1">{{ i18n.tsx.limitTo({ x: '1:1' }) }}</option>
<option value="2_3">{{ i18n.tsx.limitTo({ x: '2:3' }) }}</option>
</MkRadios>
</MkSearchMarker>
</SearchMarker>
</div>
</FormSection>
</MkSearchSection>
@ -203,14 +203,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.notificationDisplay }}</template>
<div class="_gaps_m">
<MkSearchMarker
<SearchMarker
:label="i18n.ts.useGroupedNotifications"
:keywords="['group']"
>
<MkSwitch v-model="useGroupedNotifications">{{ i18n.ts.useGroupedNotifications }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.position"
:keywords="['position']"
>
@ -221,9 +221,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="leftBottom"><i class="ti ti-align-box-left-bottom"></i> {{ i18n.ts.leftBottom }}</option>
<option value="rightBottom"><i class="ti ti-align-box-right-bottom"></i> {{ i18n.ts.rightBottom }}</option>
</MkRadios>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.stackAxis"
:keywords="['stack', 'axis', 'direction']"
>
@ -232,7 +232,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="vertical"><i class="ti ti-carousel-vertical"></i> {{ i18n.ts.vertical }}</option>
<option value="horizontal"><i class="ti ti-carousel-horizontal"></i> {{ i18n.ts.horizontal }}</option>
</MkRadios>
</MkSearchMarker>
</SearchMarker>
<MkButton @click="testNotification">{{ i18n.ts._notification.checkNotificationBehavior }}</MkButton>
</div>

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_gaps_m">
<MkSearchMarker
<SearchMarker
:locationLabel="[i18n.ts.muteAndBlock]"
icon="ti ti-ban"
:keywords="['mute', i18n.ts.wordMute]"
@ -17,18 +17,18 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_m">
<MkInfo>{{ i18n.ts.wordMuteDescription }}</MkInfo>
<MkSearchMarker
<SearchMarker
:locationLabel="[i18n.ts.muteAndBlock, i18n.ts.wordMute]"
icon="ti ti-ban"
:keywords="['showMutedWord', i18n.ts.showMutedWord]"
>
<MkSwitch v-model="showSoftWordMutedWord">{{ i18n.ts.showMutedWord }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<XWordMute :muted="$i.mutedWords" @save="saveMutedWords"/>
</div>
</MkFolder>
</MkSearchMarker>
</SearchMarker>
<MkFolder>
<template #icon><i class="ti ti-message-off"></i></template>
@ -163,7 +163,6 @@ import MkFolder from '@/components/MkFolder.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import { defaultStore } from '@/store';
import { reloadAsk } from '@/scripts/reload-ask.js';
import MkSearchMarker from '@/components/MkSearchMarker.vue';
const $i = signinRequired();

View File

@ -6,21 +6,21 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkSearchSection :label="i18n.ts.privacy" :keywords="['privacy']" icon="ti ti-lock-open">
<div class="_gaps_m">
<MkSearchMarker
<SearchMarker
:label="i18n.ts.makeFollowManuallyApprove"
:keywords="['follow', 'lock', i18n.ts.lockedAccountInfo]"
>
<MkSwitch v-model="isLocked" @update:modelValue="save()">{{ i18n.ts.makeFollowManuallyApprove }}<template #caption>{{ i18n.ts.lockedAccountInfo }}</template></MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.autoAcceptFollowed"
:keywords="['follow', 'auto', 'accept']"
>
<MkSwitch v-if="isLocked" v-model="autoAcceptFollowed" @update:modelValue="save()">{{ i18n.ts.autoAcceptFollowed }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.makeReactionsPublic"
:keywords="['reaction', 'public', i18n.ts.makeReactionsPublicDescription]"
>
@ -28,9 +28,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.makeReactionsPublic }}
<template #caption>{{ i18n.ts.makeReactionsPublicDescription }}</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.followingVisibility"
:keywords="['following', 'visibility']"
>
@ -40,9 +40,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
</MkSelect>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.followersVisibility"
:keywords="['follower', 'visibility']"
>
@ -52,9 +52,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
</MkSelect>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.hideOnlineStatus"
:keywords="['online', 'status', i18n.ts.hideOnlineStatusDescription]"
>
@ -62,9 +62,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.hideOnlineStatus }}
<template #caption>{{ i18n.ts.hideOnlineStatusDescription }}</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.noCrawle"
:keywords="['crawle', 'index', 'search', i18n.ts.noCrawleDescription]"
>
@ -72,9 +72,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.noCrawle }}
<template #caption>{{ i18n.ts.noCrawleDescription }}</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.preventAiLearning"
:keywords="['crawle', 'ai', i18n.ts.preventAiLearningDescription]"
>
@ -82,9 +82,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.preventAiLearning }}
<template #caption>{{ i18n.ts.preventAiLearningDescription }}</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.makeExplorable"
:keywords="['explore', i18n.ts.makeExplorableDescription]"
>
@ -92,14 +92,14 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.makeExplorable }}
<template #caption>{{ i18n.ts.makeExplorableDescription }}</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchSection :label="i18n.ts.lockdown" :keywords="['lockdown']">
<FormSection>
<template #label>{{ i18n.ts.lockdown }}<span class="_beta">{{ i18n.ts.beta }}</span></template>
<div class="_gaps_m">
<MkSearchMarker
<SearchMarker
:label="i18n.ts._accountSettings.requireSigninToViewContents"
:keywords="['login', 'signin', i18n.ts._accountSettings.requireSigninToViewContentsDescription1, i18n.ts._accountSettings.requireSigninToViewContentsDescription2, i18n.ts._accountSettings.requireSigninToViewContentsDescription3]"
>
@ -111,9 +111,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="instance.federation !== 'none'"><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription3 }}</div>
</template>
</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts._accountSettings.makeNotesFollowersOnlyBefore"
:keywords="['follower', i18n.ts._accountSettings.makeNotesFollowersOnlyBeforeDescription]"
>
@ -152,9 +152,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="instance.federation !== 'none'"><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
</template>
</FormSlot>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts._accountSettings.makeNotesHiddenBefore"
:keywords="['hidden', i18n.ts._accountSettings.makeNotesHiddenBeforeDescription]"
>
@ -193,21 +193,21 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="instance.federation !== 'none'"><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
</template>
</FormSlot>
</MkSearchMarker>
</SearchMarker>
</div>
</FormSection>
</MkSearchSection>
<FormSection>
<div class="_gaps_m">
<MkSearchMarker
<SearchMarker
:label="i18n.ts.rememberNoteVisibility"
:keywords="['remember', 'keep', 'note', 'visibility']"
>
<MkSwitch v-model="rememberNoteVisibility" @update:modelValue="save()">{{ i18n.ts.rememberNoteVisibility }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.defaultNoteVisibility"
:keywords="['default', 'note', 'visibility']"
>
@ -228,16 +228,16 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="defaultNoteLocalOnly">{{ i18n.ts._visibility.disableFederation }}</MkSwitch>
</div>
</MkFolder>
</MkSearchMarker>
</SearchMarker>
</div>
</FormSection>
<MkSearchMarker
<SearchMarker
:label="i18n.ts.keepCw"
:keywords="['remember', 'keep', 'note', 'cw']"
>
<MkSwitch v-model="keepCw" @update:modelValue="save()">{{ i18n.ts.keepCw }}</MkSwitch>
</MkSearchMarker>
</SearchMarker>
</div>
</MkSearchSection>
</template>
@ -258,7 +258,6 @@ import FormSlot from '@/components/form/slot.vue';
import { formatDateTimeString } from '@/scripts/format-time-string.js';
import MkInput from '@/components/MkInput.vue';
import * as os from '@/os.js';
import MkSearchMarker from '@/components/MkSearchMarker.vue';
const $i = signinRequired();

View File

@ -18,18 +18,18 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
<MkSearchMarker>
<SearchMarker>
<MkInput v-model="profile.name" :max="30" manualSave :mfmAutocomplete="['emoji']">
<template #label>{{ i18n.ts._profile.name }}</template>
</MkInput>
</MkSearchMarker>
</SearchMarker>
<MkSearchMarker>
<SearchMarker>
<MkTextarea v-model="profile.description" :max="500" tall manualSave mfmAutocomplete :mfmPreview="true">
<template #label>{{ i18n.ts._profile.description }}</template>
<template #caption>{{ i18n.ts._profile.youCanIncludeHashtags }}</template>
</MkTextarea>
</MkSearchMarker>
</SearchMarker>
<MkInput v-model="profile.location" manualSave>
<template #label>{{ i18n.ts.location }}</template>
@ -125,7 +125,6 @@ import MkButton from '@/components/MkButton.vue';
import MkInput from '@/components/MkInput.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkSelect from '@/components/MkSelect.vue';
import MkSearchMarker from '@/components/MkSearchMarker.vue';
import FormSplit from '@/components/form/split.vue';
import MkFolder from '@/components/MkFolder.vue';
import FormSlot from '@/components/form/slot.vue';