refactor(frontend): use useTemplateRef for DOM referencing
This commit is contained in:
		@@ -30,7 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { ref, shallowRef } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkWindow from '@/components/MkWindow.vue';
 | 
			
		||||
import MkTextarea from '@/components/MkTextarea.vue';
 | 
			
		||||
@@ -47,7 +47,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const uiWindow = shallowRef<InstanceType<typeof MkWindow>>();
 | 
			
		||||
const uiWindow = useTemplateRef('uiWindow');
 | 
			
		||||
const comment = ref(props.initialComment ?? '');
 | 
			
		||||
 | 
			
		||||
function send() {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,10 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, useTemplateRef } from 'vue';
 | 
			
		||||
import isChromatic from 'chromatic/isChromatic';
 | 
			
		||||
 | 
			
		||||
const canvasEl = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const canvasEl = useTemplateRef('canvasEl');
 | 
			
		||||
 | 
			
		||||
const props = withDefaults(defineProps<{
 | 
			
		||||
	scale?: number;
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
@@ -37,8 +37,8 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
}>(), {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
async function ok() {
 | 
			
		||||
	if (props.announcement.needConfirmationToRead) {
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import XAntennaEditor from '@/components/MkAntennaEditor.vue';
 | 
			
		||||
@@ -40,7 +40,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void,
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 | 
			
		||||
function onAntennaCreated(newAntenna: Misskey.entities.Antenna) {
 | 
			
		||||
	emit('created', newAntenna);
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { markRaw, ref, shallowRef, computed, onUpdated, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
 | 
			
		||||
import { markRaw, ref, useTemplateRef, computed, onUpdated, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
 | 
			
		||||
import sanitizeHtml from 'sanitize-html';
 | 
			
		||||
import { emojilist, getEmojiName } from '@@/js/emojilist.js';
 | 
			
		||||
import { char2twemojiFilePath, char2fluentEmojiFilePath } from '@@/js/emoji-base.js';
 | 
			
		||||
@@ -139,7 +139,7 @@ const emit = defineEmits<{
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const suggests = ref<Element>();
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
 | 
			
		||||
const fetching = ref(true);
 | 
			
		||||
const users = ref<any[]>([]);
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { nextTick, onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
	type?: 'button' | 'submit' | 'reset';
 | 
			
		||||
@@ -64,8 +64,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'click', payload: MouseEvent): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
const ripples = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const ripples = useTemplateRef('ripples');
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
	if (props.autofocus) {
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, computed, onMounted, onBeforeUnmount, watch, onUnmounted } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, computed, onMounted, onBeforeUnmount, watch, onUnmounted } from 'vue';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
 | 
			
		||||
// APIs provided by Captcha services
 | 
			
		||||
@@ -69,7 +69,7 @@ const emit = defineEmits<{
 | 
			
		||||
 | 
			
		||||
const available = ref(false);
 | 
			
		||||
 | 
			
		||||
const captchaEl = shallowRef<HTMLDivElement | undefined>();
 | 
			
		||||
const captchaEl = useTemplateRef('captchaEl');
 | 
			
		||||
const captchaWidgetId = ref<string | undefined>(undefined);
 | 
			
		||||
const testcaptchaInput = ref('');
 | 
			
		||||
const testcaptchaPassed = ref(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -45,12 +45,8 @@ export type ChartSrc =
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
/* eslint-disable id-denylist --
 | 
			
		||||
  Chart.js has a `data` attribute in most chart definitions, which triggers the
 | 
			
		||||
  id-denylist violation when setting it. This is causing about 60+ lint issues.
 | 
			
		||||
  As this is part of Chart.js's API it makes sense to disable the check here.
 | 
			
		||||
*/
 | 
			
		||||
import { onMounted, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
 | 
			
		||||
import { onMounted, ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { misskeyApiGet } from '@/utility/misskey-api.js';
 | 
			
		||||
@@ -96,7 +92,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	nowForChromatic: undefined,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const legendEl = shallowRef<InstanceType<typeof MkChartLegend>>();
 | 
			
		||||
const legendEl = useTemplateRef('legendEl');
 | 
			
		||||
 | 
			
		||||
const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b));
 | 
			
		||||
const negate = arr => arr.map(x => -x);
 | 
			
		||||
@@ -134,7 +130,7 @@ let chartData: {
 | 
			
		||||
	bytes?: boolean;
 | 
			
		||||
} | null = null;
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement | null>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
const fetching = ref(true);
 | 
			
		||||
 | 
			
		||||
const getDate = (ago: number) => {
 | 
			
		||||
@@ -849,7 +845,7 @@ watch(() => [props.src, props.span], fetchAndRender);
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
	fetchAndRender();
 | 
			
		||||
});
 | 
			
		||||
/* eslint-enable id-denylist */
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" module>
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, watch, toRefs, shallowRef, nextTick } from 'vue';
 | 
			
		||||
import { ref, watch, toRefs, useTemplateRef, nextTick } from 'vue';
 | 
			
		||||
import { debounce } from 'throttle-debounce';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
@@ -61,7 +61,7 @@ const { modelValue } = toRefs(props);
 | 
			
		||||
const v = ref<string>(modelValue.value ?? '');
 | 
			
		||||
const focused = ref(false);
 | 
			
		||||
const changed = ref(false);
 | 
			
		||||
const inputEl = shallowRef<HTMLTextAreaElement>();
 | 
			
		||||
const inputEl = useTemplateRef('inputEl');
 | 
			
		||||
 | 
			
		||||
const focus = () => inputEl.value?.focus();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, toRefs } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, toRefs } from 'vue';
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
	modelValue: string | null;
 | 
			
		||||
@@ -39,7 +39,7 @@ const emit = defineEmits<{
 | 
			
		||||
 | 
			
		||||
const { modelValue } = toRefs(props);
 | 
			
		||||
const v = ref(modelValue.value);
 | 
			
		||||
const inputEl = shallowRef<HTMLElement>();
 | 
			
		||||
const inputEl = useTemplateRef('inputEl');
 | 
			
		||||
 | 
			
		||||
const onInput = () => {
 | 
			
		||||
	emit('update:modelValue', v.value ?? '');
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
 | 
			
		||||
@@ -58,9 +58,9 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	maxHeight: null,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const contentEl = shallowRef<HTMLElement>();
 | 
			
		||||
const headerEl = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const contentEl = useTemplateRef('contentEl');
 | 
			
		||||
const headerEl = useTemplateRef('headerEl');
 | 
			
		||||
const showBody = ref(props.expanded);
 | 
			
		||||
const ignoreOmit = ref(false);
 | 
			
		||||
const omitted = ref(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onBeforeUnmount, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, onBeforeUnmount, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import MkMenu from './MkMenu.vue';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
import contains from '@/utility/contains.js';
 | 
			
		||||
@@ -34,7 +34,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
 | 
			
		||||
const zIndex = ref<number>(os.claimZIndex('high'));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import Cropper from 'cropperjs';
 | 
			
		||||
import tinycolor from 'tinycolor2';
 | 
			
		||||
@@ -56,8 +56,8 @@ const props = defineProps<{
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const imgUrl = getProxiedImageUrl(props.file.url, undefined, true);
 | 
			
		||||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const imgEl = shallowRef<HTMLImageElement>();
 | 
			
		||||
const dialogEl = useTemplateRef('dialogEl');
 | 
			
		||||
const imgEl = useTemplateRef('imgEl');
 | 
			
		||||
let cropper: Cropper | null = null;
 | 
			
		||||
const loading = ref(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -57,14 +57,14 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import MkLink from '@/components/MkLink.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import MkKeyValue from '@/components/MkKeyValue.vue';
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
  emoji: Misskey.entities.EmojiDetailed,
 | 
			
		||||
	emoji: Misskey.entities.EmojiDetailed,
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const emit = defineEmits<{
 | 
			
		||||
@@ -73,7 +73,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialogEl = useTemplateRef('dialogEl');
 | 
			
		||||
 | 
			
		||||
function cancel() {
 | 
			
		||||
	emit('cancel');
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, computed } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, computed } from 'vue';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
@@ -117,7 +117,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
const inputValue = ref<string | number | null>(props.input?.default ?? null);
 | 
			
		||||
const selectedValue = ref(props.select?.default ?? null);
 | 
			
		||||
 
 | 
			
		||||
@@ -96,7 +96,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkButton from './MkButton.vue';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
@@ -129,8 +129,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'open-folder', v: Misskey.entities.DriveFolder): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const loadMoreFiles = shallowRef<InstanceType<typeof MkButton>>();
 | 
			
		||||
const fileInput = shallowRef<HTMLInputElement>();
 | 
			
		||||
const loadMoreFiles = useTemplateRef('loadMoreFiles');
 | 
			
		||||
const fileInput = useTemplateRef('fileInput');
 | 
			
		||||
 | 
			
		||||
const folder = ref<Misskey.entities.DriveFolder | null>(null);
 | 
			
		||||
const files = ref<Misskey.entities.DriveFile[]>([]);
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import XDrive from '@/components/MkDrive.vue';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
@@ -43,7 +43,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 | 
			
		||||
const selected = ref<Misskey.entities.DriveFile[] | Misskey.entities.DriveFolder[]>([]);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { shallowRef, ref, computed, nextTick, onMounted, onDeactivated, onUnmounted } from 'vue';
 | 
			
		||||
import { useTemplateRef, ref, computed, nextTick, onMounted, onDeactivated, onUnmounted } from 'vue';
 | 
			
		||||
import { url } from '@@/js/config.js';
 | 
			
		||||
import { embedRouteWithScrollbar } from '@@/js/embed-page.js';
 | 
			
		||||
import type { EmbeddableEntity, EmbedParams } from '@@/js/embed-page.js';
 | 
			
		||||
@@ -121,7 +121,7 @@ const props = defineProps<{
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
//#region Modalの制御
 | 
			
		||||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialogEl = useTemplateRef('dialogEl');
 | 
			
		||||
 | 
			
		||||
function cancel() {
 | 
			
		||||
	emit('cancel');
 | 
			
		||||
@@ -198,9 +198,9 @@ function doCopy() {
 | 
			
		||||
//#endregion
 | 
			
		||||
 | 
			
		||||
//#region プレビューのリサイズ
 | 
			
		||||
const resizerRootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const resizerRootEl = useTemplateRef('resizerRootEl');
 | 
			
		||||
const iframeLoading = ref(true);
 | 
			
		||||
const iframeEl = shallowRef<HTMLIFrameElement>();
 | 
			
		||||
const iframeEl = useTemplateRef('iframeEl');
 | 
			
		||||
const iframeHeight = ref(0);
 | 
			
		||||
const iframeScale = ref(1);
 | 
			
		||||
const iframeStyle = computed(() => {
 | 
			
		||||
 
 | 
			
		||||
@@ -115,7 +115,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, computed, watch, onMounted } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, computed, watch, onMounted } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import {
 | 
			
		||||
	emojilist,
 | 
			
		||||
@@ -157,8 +157,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'esc'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const searchEl = shallowRef<HTMLInputElement>();
 | 
			
		||||
const emojisEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const searchEl = useTemplateRef('searchEl');
 | 
			
		||||
const emojisEl = useTemplateRef('emojisEl');
 | 
			
		||||
 | 
			
		||||
const {
 | 
			
		||||
	emojiPickerScale,
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
import MkEmojiPicker from '@/components/MkEmojiPicker.vue';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
@@ -64,8 +64,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const picker = shallowRef<InstanceType<typeof MkEmojiPicker>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
const picker = useTemplateRef('picker');
 | 
			
		||||
 | 
			
		||||
function chosen(emoji: string) {
 | 
			
		||||
	emit('done', emoji);
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef, ref } from 'vue';
 | 
			
		||||
import { useTemplateRef, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import MkTextarea from '@/components/MkTextarea.vue';
 | 
			
		||||
@@ -42,7 +42,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 | 
			
		||||
const caption = ref(props.default);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { onMounted, ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import { miLocalStorage } from '@/local-storage.js';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
import { getBgColor } from '@/utility/get-bg-color.js';
 | 
			
		||||
@@ -46,7 +46,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	persistKey: null,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const parentBg = ref<string | null>(null);
 | 
			
		||||
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
 | 
			
		||||
const showBody = ref((props.persistKey && miLocalStorage.getItem(`${miLocalStoragePrefix}${props.persistKey}`)) ? (miLocalStorage.getItem(`${miLocalStoragePrefix}${props.persistKey}`) === 't') : props.expanded);
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onMounted, ref, shallowRef } from 'vue';
 | 
			
		||||
import { nextTick, onMounted, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
import { getBgColor } from '@/utility/get-bg-color.js';
 | 
			
		||||
 | 
			
		||||
@@ -74,7 +74,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	spacerMax: 22,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const bgSame = ref(false);
 | 
			
		||||
const opened = ref(props.defaultOpen);
 | 
			
		||||
const openedAtLeastOnce = ref(props.defaultOpen);
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { reactive, shallowRef } from 'vue';
 | 
			
		||||
import { reactive, useTemplateRef } from 'vue';
 | 
			
		||||
import MkInput from './MkInput.vue';
 | 
			
		||||
import MkTextarea from './MkTextarea.vue';
 | 
			
		||||
import MkSwitch from './MkSwitch.vue';
 | 
			
		||||
@@ -99,7 +99,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
const values = reactive({});
 | 
			
		||||
 | 
			
		||||
for (const item in props.form) {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, nextTick, watch, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, nextTick, watch, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
@@ -35,8 +35,8 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	label: '',
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement | null>(null);
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement | null>(null);
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
const now = new Date();
 | 
			
		||||
let chartInstance: Chart | null = null;
 | 
			
		||||
const fetching = ref(true);
 | 
			
		||||
 
 | 
			
		||||
@@ -26,12 +26,12 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, computed, nextTick, watch } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, computed, nextTick, watch } from 'vue';
 | 
			
		||||
import type { Tab } from '@/components/global/MkPageHeader.tabs.vue';
 | 
			
		||||
import { isHorizontalSwipeSwiping as isSwiping } from '@/utility/touch.js';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
 | 
			
		||||
const tabModel = defineModel<string>('tab');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,7 @@ const canvasPromise = new Promise<WorkerMultiDispatch | HTMLCanvasElement>(resol
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, nextTick, onMounted, onUnmounted, shallowRef, watch, ref } from 'vue';
 | 
			
		||||
import { computed, nextTick, onMounted, onUnmounted, useTemplateRef, watch, ref } from 'vue';
 | 
			
		||||
import { v4 as uuid } from 'uuid';
 | 
			
		||||
import { render } from 'buraha';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
@@ -120,9 +120,9 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const viewId = uuid();
 | 
			
		||||
const canvas = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const root = shallowRef<HTMLDivElement>();
 | 
			
		||||
const img = shallowRef<HTMLImageElement>();
 | 
			
		||||
const canvas = useTemplateRef('canvas');
 | 
			
		||||
const root = useTemplateRef('root');
 | 
			
		||||
const img = useTemplateRef('img');
 | 
			
		||||
const loaded = ref(false);
 | 
			
		||||
const canvasWidth = ref(64);
 | 
			
		||||
const canvasHeight = ref(64);
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, nextTick, ref, shallowRef, watch, computed, toRefs } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, nextTick, ref, useTemplateRef, watch, computed, toRefs } from 'vue';
 | 
			
		||||
import { debounce } from 'throttle-debounce';
 | 
			
		||||
import { useInterval } from '@@/js/use-interval.js';
 | 
			
		||||
import type { InputHTMLAttributes } from 'vue';
 | 
			
		||||
@@ -92,9 +92,9 @@ const focused = ref(false);
 | 
			
		||||
const changed = ref(false);
 | 
			
		||||
const invalid = ref(false);
 | 
			
		||||
const filled = computed(() => v.value !== '' && v.value != null);
 | 
			
		||||
const inputEl = shallowRef<HTMLInputElement>();
 | 
			
		||||
const prefixEl = shallowRef<HTMLElement>();
 | 
			
		||||
const suffixEl = shallowRef<HTMLElement>();
 | 
			
		||||
const inputEl = useTemplateRef('inputEl');
 | 
			
		||||
const prefixEl = useTemplateRef('prefixEl');
 | 
			
		||||
const suffixEl = useTemplateRef('suffixEl');
 | 
			
		||||
const height =
 | 
			
		||||
	props.small ? 33 :
 | 
			
		||||
	props.large ? 39 :
 | 
			
		||||
 
 | 
			
		||||
@@ -84,8 +84,9 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, ref, computed, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, ref, computed, useTemplateRef } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import type { HeatmapSource } from '@/components/MkHeatmap.vue';
 | 
			
		||||
import MkSelect from '@/components/MkSelect.vue';
 | 
			
		||||
import MkChart from '@/components/MkChart.vue';
 | 
			
		||||
import { useChartTooltip } from '@/use/use-chart-tooltip.js';
 | 
			
		||||
@@ -95,7 +96,6 @@ import { misskeyApiGet } from '@/utility/misskey-api.js';
 | 
			
		||||
import { instance } from '@/instance.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import MkHeatmap from '@/components/MkHeatmap.vue';
 | 
			
		||||
import type { HeatmapSource } from '@/components/MkHeatmap.vue';
 | 
			
		||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
 | 
			
		||||
import MkRetentionHeatmap from '@/components/MkRetentionHeatmap.vue';
 | 
			
		||||
import MkRetentionLineChart from '@/components/MkRetentionLineChart.vue';
 | 
			
		||||
@@ -109,8 +109,8 @@ const chartLimit = 500;
 | 
			
		||||
const chartSpan = ref<'hour' | 'day'>('hour');
 | 
			
		||||
const chartSrc = ref('active-users');
 | 
			
		||||
const heatmapSrc = ref<HeatmapSource>('active-users');
 | 
			
		||||
const subDoughnutEl = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const pubDoughnutEl = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const subDoughnutEl = useTemplateRef('subDoughnutEl');
 | 
			
		||||
const pubDoughnutEl = useTemplateRef('pubDoughnutEl');
 | 
			
		||||
 | 
			
		||||
const { handler: externalTooltipHandler1 } = useChartTooltip({
 | 
			
		||||
	position: 'middle',
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
import { navbarItemDef } from '@/navbar.js';
 | 
			
		||||
import { deviceKind } from '@/utility/device-kind.js';
 | 
			
		||||
@@ -48,7 +48,7 @@ const preferedModalType = (deviceKind === 'desktop' && props.src != null) ? 'pop
 | 
			
		||||
	deviceKind === 'smartphone' ? 'drawer' :
 | 
			
		||||
	'dialog';
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
const menu = prefer.s.menu;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef, watch, computed, ref, onDeactivated, onActivated, onMounted } from 'vue';
 | 
			
		||||
import { useTemplateRef, watch, computed, ref, onDeactivated, onActivated, onMounted } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
import type { Keymap } from '@/utility/hotkey.js';
 | 
			
		||||
@@ -151,8 +151,8 @@ function hasFocus() {
 | 
			
		||||
	return playerEl.value === document.activeElement || playerEl.value.contains(document.activeElement);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const playerEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const audioEl = shallowRef<HTMLAudioElement>();
 | 
			
		||||
const playerEl = useTemplateRef('playerEl');
 | 
			
		||||
const audioEl = useTemplateRef('audioEl');
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
 | 
			
		||||
const hide = ref((prefer.s.nsfw === 'force' || prefer.s.dataSaver.media) ? true : (props.audio.isSensitive && prefer.s.nsfw !== 'ignore'));
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, onMounted, onUnmounted, shallowRef } from 'vue';
 | 
			
		||||
import { computed, onMounted, onUnmounted, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import PhotoSwipeLightbox from 'photoswipe/lightbox';
 | 
			
		||||
import PhotoSwipe from 'photoswipe';
 | 
			
		||||
@@ -46,7 +46,7 @@ const props = defineProps<{
 | 
			
		||||
	raw?: boolean;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const gallery = shallowRef<HTMLDivElement>();
 | 
			
		||||
const gallery = useTemplateRef('gallery');
 | 
			
		||||
const pswpZIndex = os.claimZIndex('middle');
 | 
			
		||||
document.documentElement.style.setProperty('--mk-pswp-root-z-index', pswpZIndex.toString());
 | 
			
		||||
const count = computed(() => props.mediaList.filter(media => previewable(media)).length);
 | 
			
		||||
 
 | 
			
		||||
@@ -109,7 +109,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, computed, watch, onDeactivated, onActivated, onMounted } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, computed, watch, onDeactivated, onActivated, onMounted } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
import type { Keymap } from '@/utility/hotkey.js';
 | 
			
		||||
@@ -299,8 +299,8 @@ async function toggleSensitive(file: Misskey.entities.DriveFile) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MediaControl: Video State
 | 
			
		||||
const videoEl = shallowRef<HTMLVideoElement>();
 | 
			
		||||
const playerEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const videoEl = useTemplateRef('videoEl');
 | 
			
		||||
const playerEl = useTemplateRef('playerEl');
 | 
			
		||||
const isHoverring = ref(false);
 | 
			
		||||
const controlsShowing = computed(() => {
 | 
			
		||||
	if (!oncePlayed.value) return true;
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onMounted, onUnmounted, provide, shallowRef, watch } from 'vue';
 | 
			
		||||
import { nextTick, onMounted, onUnmounted, provide, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import MkMenu from './MkMenu.vue';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
 | 
			
		||||
@@ -28,7 +28,7 @@ const emit = defineEmits<{
 | 
			
		||||
 | 
			
		||||
provide('isNestingMenu', true);
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement>();
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const align = 'left';
 | 
			
		||||
 | 
			
		||||
const SCROLLBAR_THICKNESS = 16;
 | 
			
		||||
 
 | 
			
		||||
@@ -179,7 +179,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { computed, defineAsyncComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, unref, watch } from 'vue';
 | 
			
		||||
import { computed, defineAsyncComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, unref, watch } from 'vue';
 | 
			
		||||
import type { MenuItem, InnerMenuItem, MenuPending, MenuAction, MenuSwitch, MenuRadio, MenuRadioOption, MenuParent } from '@/types/menu.js';
 | 
			
		||||
import type { Keymap } from '@/utility/hotkey.js';
 | 
			
		||||
import MkSwitchButton from '@/components/MkSwitch.button.vue';
 | 
			
		||||
@@ -212,11 +212,11 @@ const big = isTouchUsing;
 | 
			
		||||
 | 
			
		||||
const isNestingMenu = inject<boolean>('isNestingMenu', false);
 | 
			
		||||
 | 
			
		||||
const itemsEl = shallowRef<HTMLElement>();
 | 
			
		||||
const itemsEl = useTemplateRef('itemsEl');
 | 
			
		||||
 | 
			
		||||
const items2 = ref<InnerMenuItem[]>();
 | 
			
		||||
 | 
			
		||||
const child = shallowRef<InstanceType<typeof XChild>>();
 | 
			
		||||
const child = useTemplateRef('child');
 | 
			
		||||
 | 
			
		||||
const keymap = {
 | 
			
		||||
	'up|k|shift+tab': {
 | 
			
		||||
@@ -257,7 +257,7 @@ watch(() => props.items, () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const childMenu = ref<MenuItem[] | null>();
 | 
			
		||||
const childTarget = shallowRef<HTMLElement | null>();
 | 
			
		||||
const childTarget = useTemplateRef('childTarget');
 | 
			
		||||
 | 
			
		||||
function closeChild() {
 | 
			
		||||
	childMenu.value = null;
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, normalizeClass, onMounted, onUnmounted, provide, watch, ref, shallowRef, computed } from 'vue';
 | 
			
		||||
import { nextTick, normalizeClass, onMounted, onUnmounted, provide, watch, ref, useTemplateRef, computed } from 'vue';
 | 
			
		||||
import type { Keymap } from '@/utility/hotkey.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { isTouchUsing } from '@/utility/touch.js';
 | 
			
		||||
@@ -100,8 +100,8 @@ const maxHeight = ref<number>();
 | 
			
		||||
const fixed = ref(false);
 | 
			
		||||
const transformOrigin = ref('center');
 | 
			
		||||
const showing = ref(true);
 | 
			
		||||
const modalRootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const content = shallowRef<HTMLElement>();
 | 
			
		||||
const modalRootEl = useTemplateRef('modalRootEl');
 | 
			
		||||
const content = useTemplateRef('content');
 | 
			
		||||
const zIndex = os.claimZIndex(props.zPriority);
 | 
			
		||||
const useSendAnime = ref(false);
 | 
			
		||||
const type = computed<ModalTypes>(() => {
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import MkModal from './MkModal.vue';
 | 
			
		||||
 | 
			
		||||
const props = withDefaults(defineProps<{
 | 
			
		||||
@@ -47,9 +47,9 @@ const emit = defineEmits<{
 | 
			
		||||
	(event: 'esc'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const headerEl = shallowRef<HTMLElement>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const headerEl = useTemplateRef('headerEl');
 | 
			
		||||
const bodyWidth = ref(0);
 | 
			
		||||
const bodyHeight = ref(0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -178,7 +178,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, inject, onMounted, ref, shallowRef, watch, provide } from 'vue';
 | 
			
		||||
import { computed, inject, onMounted, ref, useTemplateRef, watch, provide } from 'vue';
 | 
			
		||||
import * as mfm from 'mfm-js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { isLink } from '@@/js/is-link.js';
 | 
			
		||||
@@ -271,14 +271,14 @@ if (noteViewInterruptors.length > 0) {
 | 
			
		||||
 | 
			
		||||
const isRenote = Misskey.note.isPureRenote(note.value);
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const menuButton = shallowRef<HTMLElement>();
 | 
			
		||||
const renoteButton = shallowRef<HTMLElement>();
 | 
			
		||||
const renoteTime = shallowRef<HTMLElement>();
 | 
			
		||||
const reactButton = shallowRef<HTMLElement>();
 | 
			
		||||
const clipButton = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const menuButton = useTemplateRef('menuButton');
 | 
			
		||||
const renoteButton = useTemplateRef('renoteButton');
 | 
			
		||||
const renoteTime = useTemplateRef('renoteTime');
 | 
			
		||||
const reactButton = useTemplateRef('reactButton');
 | 
			
		||||
const clipButton = useTemplateRef('clipButton');
 | 
			
		||||
const appearNote = computed(() => getAppearNote(note.value));
 | 
			
		||||
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
 | 
			
		||||
const galleryEl = useTemplateRef('galleryEl');
 | 
			
		||||
const isMyRenote = $i && ($i.id === note.value.userId);
 | 
			
		||||
const showContent = ref(false);
 | 
			
		||||
const parsed = computed(() => appearNote.value.text ? mfm.parse(appearNote.value.text) : null);
 | 
			
		||||
 
 | 
			
		||||
@@ -211,7 +211,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, inject, onMounted, provide, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, inject, onMounted, provide, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as mfm from 'mfm-js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { isLink } from '@@/js/is-link.js';
 | 
			
		||||
@@ -290,14 +290,14 @@ if (noteViewInterruptors.length > 0) {
 | 
			
		||||
 | 
			
		||||
const isRenote = Misskey.note.isPureRenote(note.value);
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const menuButton = shallowRef<HTMLElement>();
 | 
			
		||||
const renoteButton = shallowRef<HTMLElement>();
 | 
			
		||||
const renoteTime = shallowRef<HTMLElement>();
 | 
			
		||||
const reactButton = shallowRef<HTMLElement>();
 | 
			
		||||
const clipButton = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const menuButton = useTemplateRef('menuButton');
 | 
			
		||||
const renoteButton = useTemplateRef('renoteButton');
 | 
			
		||||
const renoteTime = useTemplateRef('renoteTime');
 | 
			
		||||
const reactButton = useTemplateRef('reactButton');
 | 
			
		||||
const clipButton = useTemplateRef('clipButton');
 | 
			
		||||
const appearNote = computed(() => getAppearNote(note.value));
 | 
			
		||||
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
 | 
			
		||||
const galleryEl = useTemplateRef('galleryEl');
 | 
			
		||||
const isMyRenote = $i && ($i.id === note.value.userId);
 | 
			
		||||
const showContent = ref(false);
 | 
			
		||||
const isDeleted = ref(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import type { Paging } from '@/components/MkPagination.vue';
 | 
			
		||||
import MkNote from '@/components/MkNote.vue';
 | 
			
		||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
 | 
			
		||||
@@ -46,7 +46,7 @@ const props = defineProps<{
 | 
			
		||||
	disableAutoLoad?: boolean;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const pagingComponent = useTemplateRef('pagingComponent');
 | 
			
		||||
 | 
			
		||||
defineExpose({
 | 
			
		||||
	pagingComponent,
 | 
			
		||||
 
 | 
			
		||||
@@ -30,13 +30,13 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef } from 'vue';
 | 
			
		||||
import type { Ref } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef } from 'vue';
 | 
			
		||||
import { notificationTypes } from '@@/js/const.js';
 | 
			
		||||
import MkSwitch from './MkSwitch.vue';
 | 
			
		||||
import MkInfo from './MkInfo.vue';
 | 
			
		||||
import MkButton from './MkButton.vue';
 | 
			
		||||
import type { Ref } from 'vue';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import { notificationTypes } from '@@/js/const.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
 | 
			
		||||
type TypesMap = Record<typeof notificationTypes[number], Ref<boolean>>;
 | 
			
		||||
@@ -52,7 +52,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	excludeTypes: () => [],
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 | 
			
		||||
const typesMap = notificationTypes.reduce((p, t) => ({ ...p, [t]: ref<boolean>(!props.excludeTypes.includes(t)) }), {} as TypesMap);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onUnmounted, onDeactivated, onMounted, computed, shallowRef, onActivated } from 'vue';
 | 
			
		||||
import { onUnmounted, onDeactivated, onMounted, computed, useTemplateRef, onActivated } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import type { notificationTypes } from '@@/js/const.js';
 | 
			
		||||
import MkPagination from '@/components/MkPagination.vue';
 | 
			
		||||
@@ -41,7 +41,7 @@ const props = defineProps<{
 | 
			
		||||
	excludeTypes?: typeof notificationTypes[number][];
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const pagingComponent = useTemplateRef('pagingComponent');
 | 
			
		||||
 | 
			
		||||
const pagination = computed(() => prefer.r.useGroupedNotifications.value ? {
 | 
			
		||||
	endpoint: 'i/notifications-grouped' as const,
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
 | 
			
		||||
const props = withDefaults(defineProps<{
 | 
			
		||||
@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
	maxHeight: 200,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const content = shallowRef<HTMLElement>();
 | 
			
		||||
const content = useTemplateRef('content');
 | 
			
		||||
const omitted = ref(false);
 | 
			
		||||
const ignoreOmit = ref(false);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, onMounted, onUnmounted, provide, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, onMounted, onUnmounted, provide, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import { url } from '@@/js/config.js';
 | 
			
		||||
import type { PageMetadata } from '@/page.js';
 | 
			
		||||
import RouterView from '@/components/global/RouterView.vue';
 | 
			
		||||
@@ -57,7 +57,7 @@ const emit = defineEmits<{
 | 
			
		||||
const windowRouter = createRouter(props.initialPath);
 | 
			
		||||
 | 
			
		||||
const pageMetadata = ref<null | PageMetadata>(null);
 | 
			
		||||
const windowEl = shallowRef<InstanceType<typeof MkWindow>>();
 | 
			
		||||
const windowEl = useTemplateRef('windowEl');
 | 
			
		||||
const history = ref<{ path: string; }[]>([{
 | 
			
		||||
	path: windowRouter.getCurrentFullPath(),
 | 
			
		||||
}]);
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { computed, isRef, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { computed, isRef, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { useDocumentVisibility } from '@@/js/use-document-visibility.js';
 | 
			
		||||
import { onScrollTop, isTopVisible, getBodyScrollHeight, getScrollContainer, onScrollBottom, scrollToBottom, scroll, isBottomVisible } from '@@/js/scroll.js';
 | 
			
		||||
@@ -106,7 +106,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'status', error: boolean): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
 | 
			
		||||
// 遡り中かどうか
 | 
			
		||||
const backed = ref(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
@@ -54,8 +54,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'cancelled'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const passwordInput = shallowRef<InstanceType<typeof MkInput>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
const passwordInput = useTemplateRef('passwordInput');
 | 
			
		||||
const password = ref('');
 | 
			
		||||
const isBackupCode = ref(false);
 | 
			
		||||
const token = ref<string | null>(null);
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef } from 'vue';
 | 
			
		||||
import MkModal from './MkModal.vue';
 | 
			
		||||
import MkMenu from './MkMenu.vue';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
@@ -28,7 +28,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closing'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
const manualShowing = ref(true);
 | 
			
		||||
const hiding = ref(false);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue';
 | 
			
		||||
import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed, useTemplateRef } from 'vue';
 | 
			
		||||
import * as mfm from 'mfm-js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import insertTextAtCursor from 'insert-text-at-cursor';
 | 
			
		||||
@@ -165,11 +165,11 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'fileChangeSensitive', fileId: string, to: boolean): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const textareaEl = shallowRef<HTMLTextAreaElement | null>(null);
 | 
			
		||||
const cwInputEl = shallowRef<HTMLInputElement | null>(null);
 | 
			
		||||
const hashtagsInputEl = shallowRef<HTMLInputElement | null>(null);
 | 
			
		||||
const visibilityButton = shallowRef<HTMLElement>();
 | 
			
		||||
const otherSettingsButton = shallowRef<HTMLElement>();
 | 
			
		||||
const textareaEl = useTemplateRef('textareaEl');
 | 
			
		||||
const cwInputEl = useTemplateRef('cwInputEl');
 | 
			
		||||
const hashtagsInputEl = useTemplateRef('hashtagsInputEl');
 | 
			
		||||
const visibilityButton = useTemplateRef('visibilityButton');
 | 
			
		||||
const otherSettingsButton = useTemplateRef('otherSettingsButton');
 | 
			
		||||
 | 
			
		||||
const posting = ref(false);
 | 
			
		||||
const posted = ref(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -25,10 +25,10 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import type { PostFormProps } from '@/types/post-form.js';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
import MkPostForm from '@/components/MkPostForm.vue';
 | 
			
		||||
import type { PostFormProps } from '@/types/post-form.js';
 | 
			
		||||
 | 
			
		||||
const props = withDefaults(defineProps<PostFormProps & {
 | 
			
		||||
	instant?: boolean;
 | 
			
		||||
@@ -42,8 +42,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const form = shallowRef<InstanceType<typeof MkPostForm>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
function onPosted() {
 | 
			
		||||
	modal.value?.close({
 | 
			
		||||
 
 | 
			
		||||
@@ -23,9 +23,9 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, ref, shallowRef } from 'vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import { getScrollContainer } from '@@/js/scroll.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { isHorizontalSwipeSwiping } from '@/utility/touch.js';
 | 
			
		||||
 | 
			
		||||
const SCROLL_STOP = 10;
 | 
			
		||||
@@ -43,7 +43,7 @@ const pullDistance = ref(0);
 | 
			
		||||
let supportPointerDesktop = false;
 | 
			
		||||
let startScreenY: number | null = null;
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
let scrollEl: HTMLElement | null = null;
 | 
			
		||||
 | 
			
		||||
let disabled = false;
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, defineAsyncComponent, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { computed, defineAsyncComponent, onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import { isTouchUsing } from '@/utility/touch.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
 | 
			
		||||
@@ -58,8 +58,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'dragEnded', value: number): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const containerEl = shallowRef<HTMLElement>();
 | 
			
		||||
const thumbEl = shallowRef<HTMLElement>();
 | 
			
		||||
const containerEl = useTemplateRef('containerEl');
 | 
			
		||||
const thumbEl = useTemplateRef('thumbEl');
 | 
			
		||||
 | 
			
		||||
const rawValue = ref((props.modelValue - props.min) / (props.max - props.min));
 | 
			
		||||
const steppedRawValue = computed(() => {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { defineAsyncComponent, shallowRef } from 'vue';
 | 
			
		||||
import { defineAsyncComponent, useTemplateRef } from 'vue';
 | 
			
		||||
import { useTooltip } from '@/use/use-tooltip.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +20,7 @@ const props = defineProps<{
 | 
			
		||||
	withTooltip?: boolean;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const elRef = shallowRef();
 | 
			
		||||
const elRef = useTemplateRef('elRef');
 | 
			
		||||
 | 
			
		||||
if (props.withTooltip) {
 | 
			
		||||
	useTooltip(elRef, (showing) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, inject, onMounted, shallowRef, watch } from 'vue';
 | 
			
		||||
import { computed, inject, onMounted, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { getUnicodeEmoji } from '@@/js/emojilist.js';
 | 
			
		||||
import MkCustomEmojiDetailedDialog from './MkCustomEmojiDetailedDialog.vue';
 | 
			
		||||
@@ -50,7 +50,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'reactionToggled', emoji: string, newCount: number): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const buttonEl = shallowRef<HTMLElement>();
 | 
			
		||||
const buttonEl = useTemplateRef('buttonEl');
 | 
			
		||||
 | 
			
		||||
const emojiName = computed(() => props.reaction.replace(/:/g, '').replace(/@\./, ''));
 | 
			
		||||
const emoji = computed(() => customEmojisMap.get(emojiName.value) ?? getUnicodeEmoji(props.reaction));
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, nextTick, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, nextTick, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
@@ -23,8 +23,8 @@ import { initChart } from '@/utility/init-chart.js';
 | 
			
		||||
 | 
			
		||||
initChart();
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement | null>(null);
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement | null>(null);
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
let chartInstance: Chart | null = null;
 | 
			
		||||
const fetching = ref(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import tinycolor from 'tinycolor2';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
@@ -20,7 +20,7 @@ import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
 | 
			
		||||
initChart();
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement | null>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
 | 
			
		||||
const { handler: externalTooltipHandler } = useChartTooltip();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { shallowRef } from 'vue';
 | 
			
		||||
import { useTemplateRef } from 'vue';
 | 
			
		||||
import type { OpenOnRemoteOptions } from '@/utility/please-login.js';
 | 
			
		||||
import MkSignin from '@/components/MkSignin.vue';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
@@ -46,7 +46,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'cancelled'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
function onClose() {
 | 
			
		||||
	emit('cancelled');
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef, ref } from 'vue';
 | 
			
		||||
import { useTemplateRef, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import XSignup from '@/components/MkSignupDialog.form.vue';
 | 
			
		||||
import XServerRules from '@/components/MkSignupDialog.rules.vue';
 | 
			
		||||
@@ -52,7 +52,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 | 
			
		||||
const isAcceptedServerRule = ref(false);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, ref, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
 | 
			
		||||
 | 
			
		||||
const particles = ref<{
 | 
			
		||||
	id: string,
 | 
			
		||||
@@ -66,7 +66,7 @@ const particles = ref<{
 | 
			
		||||
	dur: number,
 | 
			
		||||
	color: string
 | 
			
		||||
}[]>([]);
 | 
			
		||||
const el = shallowRef<HTMLElement>();
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const width = ref(0);
 | 
			
		||||
const height = ref(0);
 | 
			
		||||
const colors = ['#FF1493', '#00FFFF', '#FFE202', '#FFE202', '#FFE202'];
 | 
			
		||||
 
 | 
			
		||||
@@ -92,15 +92,15 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { computed, onMounted, ref, shallowRef, toRefs } from 'vue';
 | 
			
		||||
import { computed, onMounted, ref, useTemplateRef, toRefs } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
import MkSwitch from '@/components/MkSwitch.vue';
 | 
			
		||||
import type {
 | 
			
		||||
	MkSystemWebhookEditorProps,
 | 
			
		||||
	MkSystemWebhookResult,
 | 
			
		||||
	SystemWebhookEventType,
 | 
			
		||||
} from '@/components/MkSystemWebhookEditor.impl.js';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
import MkSwitch from '@/components/MkSwitch.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
@@ -122,7 +122,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialogEl = useTemplateRef('dialogEl');
 | 
			
		||||
 | 
			
		||||
const props = defineProps<MkSystemWebhookEditorProps>();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, watch, onBeforeUnmount, ref, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, watch, onBeforeUnmount, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import tinycolor from 'tinycolor2';
 | 
			
		||||
 | 
			
		||||
const loaded = !!window.TagCanvas;
 | 
			
		||||
@@ -24,9 +24,9 @@ const computedStyle = getComputedStyle(document.documentElement);
 | 
			
		||||
const idForCanvas = Array.from({ length: 16 }, () => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)]).join('');
 | 
			
		||||
const idForTags = Array.from({ length: 16 }, () => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)]).join('');
 | 
			
		||||
const available = ref(false);
 | 
			
		||||
const rootEl = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
const canvasEl = shallowRef<HTMLCanvasElement | null>(null);
 | 
			
		||||
const tagsEl = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const canvasEl = useTemplateRef('canvasEl');
 | 
			
		||||
const tagsEl = useTemplateRef('tagsEl');
 | 
			
		||||
const width = ref(300);
 | 
			
		||||
 | 
			
		||||
watch(available, () => {
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, nextTick, ref, watch, computed, toRefs, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, nextTick, ref, watch, computed, toRefs, useTemplateRef } from 'vue';
 | 
			
		||||
import { debounce } from 'throttle-debounce';
 | 
			
		||||
import type { SuggestionType } from '@/utility/autocomplete.js';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
@@ -75,7 +75,7 @@ const focused = ref(false);
 | 
			
		||||
const changed = ref(false);
 | 
			
		||||
const invalid = ref(false);
 | 
			
		||||
const filled = computed(() => v.value !== '' && v.value != null);
 | 
			
		||||
const inputEl = shallowRef<HTMLTextAreaElement>();
 | 
			
		||||
const inputEl = useTemplateRef('inputEl');
 | 
			
		||||
const preview = ref(false);
 | 
			
		||||
let autocompleteWorker: Autocomplete | null = null;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, watch, onUnmounted, provide, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, watch, onUnmounted, provide, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import type { BasicTimelineType } from '@/timelines.js';
 | 
			
		||||
import type { Paging } from '@/components/MkPagination.vue';
 | 
			
		||||
@@ -67,8 +67,8 @@ type TimelineQueryType = {
 | 
			
		||||
	roleId?: string
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const prComponent = shallowRef<InstanceType<typeof MkPullToRefresh>>();
 | 
			
		||||
const tlComponent = shallowRef<InstanceType<typeof MkNotes>>();
 | 
			
		||||
const prComponent = useTemplateRef('prComponent');
 | 
			
		||||
const tlComponent = useTemplateRef('tlComponent');
 | 
			
		||||
 | 
			
		||||
let tlNotesCount = 0;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { shallowRef, ref } from 'vue';
 | 
			
		||||
import { useTemplateRef, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkInput from './MkInput.vue';
 | 
			
		||||
import MkSwitch from './MkSwitch.vue';
 | 
			
		||||
@@ -77,7 +77,7 @@ const emit = defineEmits<{
 | 
			
		||||
const defaultPermissions = Misskey.permissions.filter(p => !p.startsWith('read:admin') && !p.startsWith('write:admin'));
 | 
			
		||||
const adminPermissions = Misskey.permissions.filter(p => p.startsWith('read:admin') || p.startsWith('write:admin'));
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
const name = ref(props.initialName);
 | 
			
		||||
const permissionSwitches = ref({} as Record<(typeof Misskey.permissions)[number], boolean>);
 | 
			
		||||
const permissionSwitchesForAdmin = ref({} as Record<(typeof Misskey.permissions)[number], boolean>);
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onMounted, onUnmounted, shallowRef } from 'vue';
 | 
			
		||||
import { nextTick, onMounted, onUnmounted, useTemplateRef } from 'vue';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { calcPopupPosition } from '@/utility/popup-position.js';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
@@ -51,7 +51,7 @@ const emit = defineEmits<{
 | 
			
		||||
// タイミングによっては最初から showing = false な場合があり、その場合に closed 扱いにしないと永久にDOMに残ることになる
 | 
			
		||||
if (!props.showing) emit('closed');
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement>();
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const zIndex = os.claimZIndex('high');
 | 
			
		||||
 | 
			
		||||
function setPosition() {
 | 
			
		||||
 
 | 
			
		||||
@@ -148,7 +148,8 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import { host } from '@@/js/config.js';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import XNote from '@/components/MkTutorialDialog.Note.vue';
 | 
			
		||||
@@ -158,7 +159,6 @@ import XSensitive from '@/components/MkTutorialDialog.Sensitive.vue';
 | 
			
		||||
import MkAnimBg from '@/components/MkAnimBg.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { instance } from '@/instance.js';
 | 
			
		||||
import { host } from '@@/js/config.js';
 | 
			
		||||
import { claimAchievement } from '@/utility/achievements.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
 | 
			
		||||
@@ -170,7 +170,7 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
 | 
			
		||||
const page = ref(props.initialPage ?? 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -15,15 +15,15 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
import { version } from '@@/js/config.js';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkSparkle from '@/components/MkSparkle.vue';
 | 
			
		||||
import { version } from '@@/js/config.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { confetti } from '@/utility/confetti.js';
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
function whatIsNew() {
 | 
			
		||||
	modal.value?.close();
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, ref, computed, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, ref, computed, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { host as currentHost, hostname } from '@@/js/config.js';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
@@ -94,7 +94,7 @@ const host = ref('');
 | 
			
		||||
const users = ref<Misskey.entities.UserLite[]>([]);
 | 
			
		||||
const recentUsers = ref<Misskey.entities.UserDetailed[]>([]);
 | 
			
		||||
const selected = ref<Misskey.entities.UserLite | null>(null);
 | 
			
		||||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialogEl = useTemplateRef('dialogEl');
 | 
			
		||||
 | 
			
		||||
function search() {
 | 
			
		||||
	if (username.value === '' && host.value === '') {
 | 
			
		||||
 
 | 
			
		||||
@@ -128,7 +128,8 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { ref, shallowRef, watch, nextTick, defineAsyncComponent } from 'vue';
 | 
			
		||||
import { ref, useTemplateRef, watch, nextTick, defineAsyncComponent } from 'vue';
 | 
			
		||||
import { host } from '@@/js/config.js';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import XProfile from '@/components/MkUserSetupDialog.Profile.vue';
 | 
			
		||||
@@ -137,7 +138,6 @@ import XPrivacy from '@/components/MkUserSetupDialog.Privacy.vue';
 | 
			
		||||
import MkAnimBg from '@/components/MkAnimBg.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { instance } from '@/instance.js';
 | 
			
		||||
import { host } from '@@/js/config.js';
 | 
			
		||||
import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
@@ -146,9 +146,8 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'closed'): void;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
 | 
			
		||||
const dialog = useTemplateRef('dialog');
 | 
			
		||||
 
 | 
			
		||||
const page = ref(store.s.accountSetupWizard);
 | 
			
		||||
 | 
			
		||||
watch(page, () => {
 | 
			
		||||
 
 | 
			
		||||
@@ -42,12 +42,12 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, shallowRef, ref } from 'vue';
 | 
			
		||||
import { nextTick, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
const props = withDefaults(defineProps<{
 | 
			
		||||
	currentVisibility: typeof Misskey.noteVisibilities[number];
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef, ref, nextTick } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef, ref, nextTick } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import gradient from 'chartjs-plugin-gradient';
 | 
			
		||||
import tinycolor from 'tinycolor2';
 | 
			
		||||
@@ -25,7 +25,7 @@ import { initChart } from '@/utility/init-chart.js';
 | 
			
		||||
 | 
			
		||||
initChart();
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement | null>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
const now = new Date();
 | 
			
		||||
let chartInstance: Chart | null = null;
 | 
			
		||||
const chartLimit = 30;
 | 
			
		||||
 
 | 
			
		||||
@@ -14,10 +14,10 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { watch, shallowRef } from 'vue';
 | 
			
		||||
import { watch, useTemplateRef } from 'vue';
 | 
			
		||||
import MkModal from '@/components/MkModal.vue';
 | 
			
		||||
 | 
			
		||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
 | 
			
		||||
const modal = useTemplateRef('modal');
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
	success: boolean;
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onBeforeUnmount, onMounted, provide, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onBeforeUnmount, onMounted, provide, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import type { MenuItem } from '@/types/menu.js';
 | 
			
		||||
import contains from '@/utility/contains.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
@@ -114,7 +114,7 @@ const emit = defineEmits<{
 | 
			
		||||
 | 
			
		||||
provide('inWindow', true);
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement | null>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const showing = ref(true);
 | 
			
		||||
let beforeClickedAt = 0;
 | 
			
		||||
const maximized = ref(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ export type MkABehavior = 'window' | 'browser' | null;
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, inject, shallowRef } from 'vue';
 | 
			
		||||
import { computed, inject, useTemplateRef } from 'vue';
 | 
			
		||||
import { url } from '@@/js/config.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { copyToClipboard } from '@/utility/copy-to-clipboard.js';
 | 
			
		||||
@@ -32,7 +32,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
 | 
			
		||||
const behavior = props.behavior ?? inject<MkABehavior>('linkNavigationBehavior', null);
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement>();
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
 | 
			
		||||
defineExpose({ $el: el });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11,9 +11,9 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onMounted, onActivated, onBeforeUnmount, ref, shallowRef } from 'vue';
 | 
			
		||||
import { nextTick, onMounted, onActivated, onBeforeUnmount, ref, useTemplateRef } from 'vue';
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLDivElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const showing = ref(false);
 | 
			
		||||
 | 
			
		||||
const observer = new IntersectionObserver(
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ export type Tab = {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onMounted, onUnmounted, shallowRef, watch } from 'vue';
 | 
			
		||||
import { nextTick, onMounted, onUnmounted, useTemplateRef, watch } from 'vue';
 | 
			
		||||
import { prefer } from '@/preferences.js';
 | 
			
		||||
 | 
			
		||||
const props = withDefaults(defineProps<{
 | 
			
		||||
@@ -69,9 +69,9 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'tabClick', key: string);
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const tabHighlightEl = useTemplateRef('tabHighlightEl');
 | 
			
		||||
const tabRefs: Record<string, HTMLElement | null> = {};
 | 
			
		||||
const tabHighlightEl = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
 | 
			
		||||
function onTabMousedown(tab: Tab, ev: MouseEvent): void {
 | 
			
		||||
	// ユーザビリティの観点からmousedown時にはonClickは呼ばない
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, ref, inject, shallowRef, computed } from 'vue';
 | 
			
		||||
import { onMounted, onUnmounted, ref, inject, useTemplateRef, computed } from 'vue';
 | 
			
		||||
import tinycolor from 'tinycolor2';
 | 
			
		||||
import { scrollToTop } from '@@/js/scroll.js';
 | 
			
		||||
import XTabs from './MkPageHeader.tabs.vue';
 | 
			
		||||
@@ -75,7 +75,7 @@ const pageMetadata = computed(() => props.overridePageMetadata ?? injectedPageMe
 | 
			
		||||
const hideTitle = computed(() => inject('shouldOmitHeaderTitle', false) || props.hideTitle);
 | 
			
		||||
const thin_ = props.thin || inject('shouldHeaderThin', false);
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement | undefined>(undefined);
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const bg = ref<string | undefined>(undefined);
 | 
			
		||||
const narrow = ref(false);
 | 
			
		||||
const hasTabs = computed(() => props.tabs.length > 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -23,9 +23,8 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, onUnmounted, provide, inject, ref, watch, useTemplateRef } from 'vue';
 | 
			
		||||
import type { Ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
import { CURRENT_STICKY_BOTTOM, CURRENT_STICKY_TOP } from '@@/js/const.js';
 | 
			
		||||
import type { Ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const headerEl = useTemplateRef('headerEl');
 | 
			
		||||
 
 | 
			
		||||
@@ -39,10 +39,12 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
					{{ cell.value }}
 | 
			
		||||
				</div>
 | 
			
		||||
				<div v-else-if="cellType === 'boolean'">
 | 
			
		||||
					<div :class="[$style.bool, {
 | 
			
		||||
						[$style.boolTrue]: cell.value === true,
 | 
			
		||||
						'ti ti-check': cell.value === true,
 | 
			
		||||
					}]"></div>
 | 
			
		||||
					<div
 | 
			
		||||
						:class="[$style.bool, {
 | 
			
		||||
							[$style.boolTrue]: cell.value === true,
 | 
			
		||||
							'ti ti-check': cell.value === true,
 | 
			
		||||
						}]"
 | 
			
		||||
					></div>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div v-else-if="cellType === 'image'">
 | 
			
		||||
					<img
 | 
			
		||||
@@ -88,14 +90,14 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { computed, defineAsyncComponent, nextTick, onMounted, onUnmounted, ref, shallowRef, toRefs, watch } from 'vue';
 | 
			
		||||
import { computed, defineAsyncComponent, nextTick, onMounted, onUnmounted, ref, useTemplateRef, toRefs, watch } from 'vue';
 | 
			
		||||
import type { Size } from '@/components/grid/grid.js';
 | 
			
		||||
import type { CellValue, GridCell } from '@/components/grid/cell.js';
 | 
			
		||||
import type { GridRowSetting } from '@/components/grid/row.js';
 | 
			
		||||
import { GridEventEmitter } from '@/components/grid/grid.js';
 | 
			
		||||
import { useTooltip } from '@/use/use-tooltip.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { equalCellAddress, getCellAddress } from '@/components/grid/grid-utils.js';
 | 
			
		||||
import type { Size } from '@/components/grid/grid.js';
 | 
			
		||||
import type { CellValue, GridCell } from '@/components/grid/cell.js';
 | 
			
		||||
import type { GridRowSetting } from '@/components/grid/row.js';
 | 
			
		||||
 | 
			
		||||
const emit = defineEmits<{
 | 
			
		||||
	(ev: 'operation:beginEdit', sender: GridCell): void;
 | 
			
		||||
@@ -111,9 +113,9 @@ const props = defineProps<{
 | 
			
		||||
 | 
			
		||||
const { cell, bus } = toRefs(props);
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<InstanceType<typeof HTMLTableCellElement>>();
 | 
			
		||||
const contentAreaEl = shallowRef<InstanceType<typeof HTMLDivElement>>();
 | 
			
		||||
const inputAreaEl = shallowRef<InstanceType<typeof HTMLDivElement>>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const contentAreaEl = useTemplateRef('contentAreaEl');
 | 
			
		||||
const inputAreaEl = useTemplateRef('inputAreaEl');
 | 
			
		||||
 | 
			
		||||
/** 値が編集中かどうか */
 | 
			
		||||
const editing = ref<boolean>(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { nextTick, onBeforeUnmount, ref, shallowRef, computed } from 'vue';
 | 
			
		||||
import { nextTick, onBeforeUnmount, ref, useTemplateRef, computed } from 'vue';
 | 
			
		||||
import { version } from '@@/js/config.js';
 | 
			
		||||
import FormLink from '@/components/form/link.vue';
 | 
			
		||||
import FormSection from '@/components/form/section.vue';
 | 
			
		||||
@@ -403,7 +403,7 @@ const easterEggEmojis = ref<{
 | 
			
		||||
	emoji: string
 | 
			
		||||
}[]>([]);
 | 
			
		||||
const easterEggEngine = ref<{ stop: () => void } | null>(null);
 | 
			
		||||
const containerEl = shallowRef<HTMLElement>();
 | 
			
		||||
const containerEl = useTemplateRef('containerEl');
 | 
			
		||||
 | 
			
		||||
function iconLoaded() {
 | 
			
		||||
	const emojis = prefer.s.emojiPalettes[0].emojis;
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, onMounted, onUnmounted, ref, shallowRef, watch, nextTick, inject } from 'vue';
 | 
			
		||||
import { computed, onMounted, onUnmounted, ref, useTemplateRef, watch, nextTick, inject } from 'vue';
 | 
			
		||||
import tinycolor from 'tinycolor2';
 | 
			
		||||
import { scrollToTop } from '@@/js/scroll.js';
 | 
			
		||||
import { popupMenu } from '@/os.js';
 | 
			
		||||
@@ -68,9 +68,9 @@ const emit = defineEmits<{
 | 
			
		||||
 | 
			
		||||
const pageMetadata = inject(DI.pageMetadata);
 | 
			
		||||
 | 
			
		||||
const el = shallowRef<HTMLElement>(null);
 | 
			
		||||
const el = useTemplateRef('el');
 | 
			
		||||
const tabHighlightEl = useTemplateRef('tabHighlightEl');
 | 
			
		||||
const tabRefs = {};
 | 
			
		||||
const tabHighlightEl = shallowRef<HTMLElement | null>(null);
 | 
			
		||||
const bg = ref<string | null>(null);
 | 
			
		||||
const height = ref(0);
 | 
			
		||||
const hasTabs = computed(() => {
 | 
			
		||||
 
 | 
			
		||||
@@ -71,8 +71,9 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, onMounted, ref, shallowRef, toRefs } from 'vue';
 | 
			
		||||
import { computed, onMounted, ref, useTemplateRef, toRefs } from 'vue';
 | 
			
		||||
import { entities } from 'misskey-js';
 | 
			
		||||
import type { MkSystemWebhookResult } from '@/components/MkSystemWebhookEditor.impl.js';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkModalWindow from '@/components/MkModalWindow.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
@@ -80,7 +81,6 @@ import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
import MkSelect from '@/components/MkSelect.vue';
 | 
			
		||||
import { showSystemWebhookEditorDialog } from '@/components/MkSystemWebhookEditor.impl.js';
 | 
			
		||||
import type { MkSystemWebhookResult } from '@/components/MkSystemWebhookEditor.impl.js';
 | 
			
		||||
import MkSwitch from '@/components/MkSwitch.vue';
 | 
			
		||||
import MkDivider from '@/components/MkDivider.vue';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
@@ -100,7 +100,7 @@ const props = defineProps<{
 | 
			
		||||
 | 
			
		||||
const { mode, id } = toRefs(props);
 | 
			
		||||
 | 
			
		||||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
 | 
			
		||||
const dialogEl = useTemplateRef('dialogEl');
 | 
			
		||||
 | 
			
		||||
const loading = ref<number>(0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, shallowRef, ref } from 'vue';
 | 
			
		||||
import { computed, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import XHeader from './_header_.vue';
 | 
			
		||||
import MkSelect from '@/components/MkSelect.vue';
 | 
			
		||||
import MkPagination from '@/components/MkPagination.vue';
 | 
			
		||||
@@ -70,7 +70,7 @@ import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkInfo from '@/components/MkInfo.vue';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
 | 
			
		||||
const reports = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const reports = useTemplateRef('reports');
 | 
			
		||||
 | 
			
		||||
const state = ref('unresolved');
 | 
			
		||||
const reporterOrigin = ref('combined');
 | 
			
		||||
 
 | 
			
		||||
@@ -55,8 +55,9 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import XHeader from './_header_.vue';
 | 
			
		||||
import type { Paging } from '@/components/MkPagination.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
@@ -66,11 +67,10 @@ import MkSelect from '@/components/MkSelect.vue';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
import MkSwitch from '@/components/MkSwitch.vue';
 | 
			
		||||
import MkPagination from '@/components/MkPagination.vue';
 | 
			
		||||
import type { Paging } from '@/components/MkPagination.vue';
 | 
			
		||||
import MkInviteCode from '@/components/MkInviteCode.vue';
 | 
			
		||||
import { definePage } from '@/page.js';
 | 
			
		||||
 | 
			
		||||
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const pagingComponent = useTemplateRef('pagingComponent');
 | 
			
		||||
 | 
			
		||||
const type = ref('all');
 | 
			
		||||
const sort = ref('+createdAt');
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, shallowRef, ref } from 'vue';
 | 
			
		||||
import { computed, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import XHeader from './_header_.vue';
 | 
			
		||||
import XModLog from './modlog.ModLog.vue';
 | 
			
		||||
@@ -41,7 +41,7 @@ import { i18n } from '@/i18n.js';
 | 
			
		||||
import { definePage } from '@/page.js';
 | 
			
		||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
 | 
			
		||||
 | 
			
		||||
const logs = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const logs = useTemplateRef('logs');
 | 
			
		||||
 | 
			
		||||
const type = ref<string | null>(null);
 | 
			
		||||
const moderatorId = ref('');
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import gradient from 'chartjs-plugin-gradient';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
@@ -24,7 +24,7 @@ import { initChart } from '@/utility/init-chart.js';
 | 
			
		||||
 | 
			
		||||
initChart();
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
const now = new Date();
 | 
			
		||||
let chartInstance: Chart = null;
 | 
			
		||||
const chartLimit = 7;
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef, ref } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef, ref } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import gradient from 'chartjs-plugin-gradient';
 | 
			
		||||
import isChromatic from 'chromatic';
 | 
			
		||||
@@ -34,8 +34,8 @@ import { initChart } from '@/utility/init-chart.js';
 | 
			
		||||
initChart();
 | 
			
		||||
 | 
			
		||||
const chartLimit = 50;
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const chartEl2 = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
const chartEl2 = useTemplateRef('chartEl2');
 | 
			
		||||
const fetching = ref(true);
 | 
			
		||||
 | 
			
		||||
const { handler: externalTooltipHandler } = useChartTooltip();
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import { useChartTooltip } from '@/use/use-chart-tooltip.js';
 | 
			
		||||
import { initChart } from '@/utility/init-chart.js';
 | 
			
		||||
@@ -26,7 +26,7 @@ const props = defineProps<{
 | 
			
		||||
	data: InstanceForPie[];
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
 | 
			
		||||
const { handler: externalTooltipHandler } = useChartTooltip({
 | 
			
		||||
	position: 'middle',
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
import { useChartTooltip } from '@/use/use-chart-tooltip.js';
 | 
			
		||||
@@ -22,7 +22,7 @@ const props = defineProps<{
 | 
			
		||||
	type: string;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
 | 
			
		||||
const { handler: externalTooltipHandler } = useChartTooltip();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { markRaw, onMounted, onUnmounted, ref, shallowRef } from 'vue';
 | 
			
		||||
import { markRaw, onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import XChart from './overview.queue.chart.vue';
 | 
			
		||||
import type { ApQueueDomain } from '@/pages/admin/queue.vue';
 | 
			
		||||
@@ -48,10 +48,10 @@ const activeSincePrevTick = ref(0);
 | 
			
		||||
const active = ref(0);
 | 
			
		||||
const delayed = ref(0);
 | 
			
		||||
const waiting = ref(0);
 | 
			
		||||
const chartProcess = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartActive = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartDelayed = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartWaiting = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartProcess = useTemplateRef('chartProcess');
 | 
			
		||||
const chartActive = useTemplateRef('chartActive');
 | 
			
		||||
const chartDelayed = useTemplateRef('chartDelayed');
 | 
			
		||||
const chartWaiting = useTemplateRef('chartWaiting');
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
	domain: ApQueueDomain;
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { markRaw, onMounted, onBeforeUnmount, nextTick, shallowRef, ref, computed } from 'vue';
 | 
			
		||||
import { markRaw, onMounted, onBeforeUnmount, nextTick, shallowRef, ref, computed, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import XFederation from './overview.federation.vue';
 | 
			
		||||
import XInstances from './overview.instances.vue';
 | 
			
		||||
@@ -85,7 +85,7 @@ import { i18n } from '@/i18n.js';
 | 
			
		||||
import { definePage } from '@/page.js';
 | 
			
		||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
 | 
			
		||||
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const serverInfo = ref<Misskey.entities.ServerInfoResponse | null>(null);
 | 
			
		||||
const topSubInstancesForPie = ref<InstanceForPie[] | null>(null);
 | 
			
		||||
const topPubInstancesForPie = ref<InstanceForPie[] | null>(null);
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { onMounted, shallowRef } from 'vue';
 | 
			
		||||
import { onMounted, useTemplateRef } from 'vue';
 | 
			
		||||
import { Chart } from 'chart.js';
 | 
			
		||||
import { store } from '@/store.js';
 | 
			
		||||
import { useChartTooltip } from '@/use/use-chart-tooltip.js';
 | 
			
		||||
@@ -22,7 +22,7 @@ const props = defineProps<{
 | 
			
		||||
	type: string;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const chartEl = shallowRef<HTMLCanvasElement>(null);
 | 
			
		||||
const chartEl = useTemplateRef('chartEl');
 | 
			
		||||
 | 
			
		||||
const { handler: externalTooltipHandler } = useChartTooltip();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { markRaw, onMounted, onUnmounted, ref, shallowRef } from 'vue';
 | 
			
		||||
import { markRaw, onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import XChart from './queue.chart.chart.vue';
 | 
			
		||||
import type { ApQueueDomain } from '@/pages/admin/queue.vue';
 | 
			
		||||
@@ -65,10 +65,10 @@ const active = ref(0);
 | 
			
		||||
const delayed = ref(0);
 | 
			
		||||
const waiting = ref(0);
 | 
			
		||||
const jobs = ref<Misskey.Endpoints[`admin/queue/${ApQueueDomain}-delayed`]['res']>([]);
 | 
			
		||||
const chartProcess = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartActive = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartDelayed = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartWaiting = shallowRef<InstanceType<typeof XChart>>();
 | 
			
		||||
const chartProcess = useTemplateRef('chartProcess');
 | 
			
		||||
const chartActive = useTemplateRef('chartActive');
 | 
			
		||||
const chartDelayed = useTemplateRef('chartDelayed');
 | 
			
		||||
const chartWaiting = useTemplateRef('chartWaiting');
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
	domain: ApQueueDomain;
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, shallowRef, ref, watchEffect } from 'vue';
 | 
			
		||||
import { computed, useTemplateRef, ref, watchEffect } from 'vue';
 | 
			
		||||
import XHeader from './_header_.vue';
 | 
			
		||||
import { defaultMemoryStorage } from '@/memory-storage';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
@@ -82,7 +82,7 @@ type SearchQuery = {
 | 
			
		||||
	hostname?: string;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const paginationComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const paginationComponent = useTemplateRef('paginationComponent');
 | 
			
		||||
const storedQuery = JSON.parse(defaultMemoryStorage.getItem('admin-users-query') ?? '{}') as SearchQuery;
 | 
			
		||||
 | 
			
		||||
const sort = ref(storedQuery.sort ?? '+createdAt');
 | 
			
		||||
 
 | 
			
		||||
@@ -24,10 +24,10 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, watch, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, watch, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkTimeline from '@/components/MkTimeline.vue';
 | 
			
		||||
import { scroll } from '@@/js/scroll.js';
 | 
			
		||||
import MkTimeline from '@/components/MkTimeline.vue';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import { misskeyApi } from '@/utility/misskey-api.js';
 | 
			
		||||
import { definePage } from '@/page.js';
 | 
			
		||||
@@ -42,8 +42,8 @@ const props = defineProps<{
 | 
			
		||||
 | 
			
		||||
const antenna = ref<Misskey.entities.Antenna | null>(null);
 | 
			
		||||
const queue = ref(0);
 | 
			
		||||
const rootEl = shallowRef<HTMLElement>();
 | 
			
		||||
const tlEl = shallowRef<InstanceType<typeof MkTimeline>>();
 | 
			
		||||
const rootEl = useTemplateRef('rootEl');
 | 
			
		||||
const tlEl = useTemplateRef('tlEl');
 | 
			
		||||
 | 
			
		||||
function queueUpdated(q) {
 | 
			
		||||
	queue.value = q;
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, defineAsyncComponent, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, defineAsyncComponent, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
import MkPagination from '@/components/MkPagination.vue';
 | 
			
		||||
@@ -86,7 +86,7 @@ import { getProxiedImageUrl } from '@/utility/media-proxy.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { definePage } from '@/page.js';
 | 
			
		||||
 | 
			
		||||
const emojisPaginationComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const emojisPaginationComponent = useTemplateRef('emojisPaginationComponent');
 | 
			
		||||
 | 
			
		||||
const tab = ref('local');
 | 
			
		||||
const query = ref<string | null>(null);
 | 
			
		||||
 
 | 
			
		||||
@@ -191,7 +191,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, onDeactivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
 | 
			
		||||
import { computed, onDeactivated, onMounted, onUnmounted, ref, shallowRef, watch, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Matter from 'matter-js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { DropAndFusionGame } from 'misskey-bubble-game';
 | 
			
		||||
@@ -567,8 +567,8 @@ let game = new DropAndFusionGame({
 | 
			
		||||
});
 | 
			
		||||
attachGameEvents();
 | 
			
		||||
 | 
			
		||||
const containerEl = shallowRef<HTMLElement>();
 | 
			
		||||
const canvasEl = shallowRef<HTMLCanvasElement>();
 | 
			
		||||
const containerEl = useTemplateRef('containerEl');
 | 
			
		||||
const canvasEl = useTemplateRef('canvasEl');
 | 
			
		||||
const dropperX = ref(0);
 | 
			
		||||
const currentPick = shallowRef<{ id: string; mono: Mono } | null>(null);
 | 
			
		||||
const stock = shallowRef<{ id: string; mono: Mono }[]>([]);
 | 
			
		||||
 
 | 
			
		||||
@@ -63,7 +63,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { watch, ref, shallowRef, computed } from 'vue';
 | 
			
		||||
import { watch, ref, useTemplateRef, computed } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkUserList from '@/components/MkUserList.vue';
 | 
			
		||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
 | 
			
		||||
@@ -77,7 +77,7 @@ const props = defineProps<{
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const origin = ref('local');
 | 
			
		||||
const tagsEl = shallowRef<InstanceType<typeof MkFoldableSection>>();
 | 
			
		||||
const tagsEl = useTemplateRef('tagsEl');
 | 
			
		||||
const tagsLocal = ref<Misskey.entities.Hashtag[]>([]);
 | 
			
		||||
const tagsRemote = ref<Misskey.entities.Hashtag[]>([]);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, watch, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, watch, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import XFeatured from './explore.featured.vue';
 | 
			
		||||
import XUsers from './explore.users.vue';
 | 
			
		||||
import XRoles from './explore.roles.vue';
 | 
			
		||||
@@ -38,7 +38,7 @@ const props = withDefaults(defineProps<{
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const tab = ref(props.initialTab);
 | 
			
		||||
const tagsEl = shallowRef<InstanceType<typeof MkFoldableSection>>();
 | 
			
		||||
const tagsEl = useTemplateRef('tagsEl');
 | 
			
		||||
 | 
			
		||||
watch(() => props.tag, () => {
 | 
			
		||||
	if (tagsEl.value) tagsEl.value.toggleContent(props.tag == null);
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { shallowRef, computed, ref } from 'vue';
 | 
			
		||||
import { useTemplateRef, computed, ref } from 'vue';
 | 
			
		||||
import type { Paging } from '@/components/MkPagination.vue';
 | 
			
		||||
import MkPagination from '@/components/MkPagination.vue';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
@@ -57,7 +57,7 @@ import { infoImageUrl } from '@/instance.js';
 | 
			
		||||
import { $i } from '@/i.js';
 | 
			
		||||
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
 | 
			
		||||
 | 
			
		||||
const paginationComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const paginationComponent = useTemplateRef('paginationComponent');
 | 
			
		||||
 | 
			
		||||
const pagination = computed<Paging>(() => tab.value === 'list' ? {
 | 
			
		||||
	endpoint: 'following/requests/list',
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { computed, ref, shallowRef } from 'vue';
 | 
			
		||||
import { computed, ref, useTemplateRef } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import type { Paging } from '@/components/MkPagination.vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
@@ -47,7 +47,7 @@ import { definePage } from '@/page.js';
 | 
			
		||||
import { serverErrorImageUrl, instance } from '@/instance.js';
 | 
			
		||||
import { $i } from '@/i.js';
 | 
			
		||||
 | 
			
		||||
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
 | 
			
		||||
const pagingComponent = useTemplateRef('pagingComponent');
 | 
			
		||||
const currentInviteLimit = ref<null | number>(null);
 | 
			
		||||
const inviteLimit = (($i != null && $i.policies.inviteLimit) || (($i == null && instance.policies.inviteLimit))) as number;
 | 
			
		||||
const inviteLimitCycle = (($i != null && $i.policies.inviteLimitCycle) || ($i == null && instance.policies.inviteLimitCycle)) as number;
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user