style: add missing trailing commas (#9387)

This commit is contained in:
Kagami Sascha Rosylight 2022-12-22 16:01:59 +09:00 committed by GitHub
parent 9314ceae36
commit f1fd1d2585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
79 changed files with 320 additions and 320 deletions

View File

@ -50,7 +50,7 @@ function send() {
}, undefined).then(res => { }, undefined).then(res => {
os.alert({ os.alert({
type: 'success', type: 'success',
text: i18n.ts.abuseReported text: i18n.ts.abuseReported,
}); });
uiWindow.value?.close(); uiWindow.value?.close();
emit('closed'); emit('closed');

View File

@ -86,7 +86,7 @@ for (const x of customEmojis) {
name: x.name, name: x.name,
emoji: `:${x.name}:`, emoji: `:${x.name}:`,
url: x.url, url: x.url,
isCustomEmoji: true isCustomEmoji: true,
}); });
if (x.aliases) { if (x.aliases) {
@ -96,7 +96,7 @@ for (const x of customEmojis) {
aliasOf: x.name, aliasOf: x.name,
emoji: `:${x.name}:`, emoji: `:${x.name}:`,
url: x.url, url: x.url,
isCustomEmoji: true isCustomEmoji: true,
}); });
} }
} }
@ -193,7 +193,7 @@ function exec() {
os.api('users/search-by-username-and-host', { os.api('users/search-by-username-and-host', {
username: props.q, username: props.q,
limit: 10, limit: 10,
detail: false detail: false,
}).then(searchedUsers => { }).then(searchedUsers => {
users.value = searchedUsers as any[]; users.value = searchedUsers as any[];
fetching.value = false; fetching.value = false;
@ -215,7 +215,7 @@ function exec() {
} else { } else {
os.api('hashtags/search', { os.api('hashtags/search', {
query: props.q, query: props.q,
limit: 30 limit: 30,
}).then(searchedHashtags => { }).then(searchedHashtags => {
hashtags.value = searchedHashtags as any[]; hashtags.value = searchedHashtags as any[];
fetching.value = false; fetching.value = false;

View File

@ -18,7 +18,7 @@ const users = ref([]);
onMounted(async () => { onMounted(async () => {
users.value = await os.api('users/show', { users.value = await os.api('users/show', {
userIds: props.userIds userIds: props.userIds,
}); });
}); });
</script> </script>

View File

@ -25,7 +25,7 @@ const label = computed(() => {
return concat([ return concat([
props.note.text ? [i18n.t('_cw.chars', { count: length(props.note.text) })] : [], props.note.text ? [i18n.t('_cw.chars', { count: length(props.note.text) })] : [],
props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length })] : [], props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length })] : [],
props.note.poll != null ? [i18n.ts.poll] : [] props.note.poll != null ? [i18n.ts.poll] : [],
] as string[][]).join(' / '); ] as string[][]).join(' / ');
}); });

View File

@ -109,7 +109,7 @@ function onDrop(ev: DragEvent) {
emit('removeFile', file.id); emit('removeFile', file.id);
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
folderId: props.folder ? props.folder.id : null folderId: props.folder ? props.folder.id : null,
}); });
} }
//#endregion //#endregion
@ -123,7 +123,7 @@ function onDrop(ev: DragEvent) {
emit('removeFolder', folder.id); emit('removeFolder', folder.id);
os.api('drive/folders/update', { os.api('drive/folders/update', {
folderId: folder.id, folderId: folder.id,
parentId: props.folder ? props.folder.id : null parentId: props.folder ? props.folder.id : null,
}); });
} }
//#endregion //#endregion

View File

@ -32,12 +32,12 @@ export default defineComponent({
expanded: { expanded: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true,
}, },
persistKey: { persistKey: {
type: String, type: String,
required: false, required: false,
default: null default: null,
}, },
}, },
data() { data() {
@ -51,7 +51,7 @@ export default defineComponent({
if (this.persistKey) { if (this.persistKey) {
localStorage.setItem(localStoragePrefix + this.persistKey, this.showBody ? 't' : 'f'); localStorage.setItem(localStoragePrefix + this.persistKey, this.showBody ? 't' : 'f');
} }
} },
}, },
mounted() { mounted() {
function getParentBg(el: Element | null): string { function getParentBg(el: Element | null): string {
@ -91,7 +91,7 @@ export default defineComponent({
afterLeave(el) { afterLeave(el) {
el.style.height = null; el.style.height = null;
}, },
} },
}); });
</script> </script>

View File

@ -12,20 +12,20 @@ export default defineComponent({
props: { props: {
formula: { formula: {
type: String, type: String,
required: true required: true,
}, },
block: { block: {
type: Boolean, type: Boolean,
required: true required: true,
} },
}, },
computed: { computed: {
compiledFormula(): any { compiledFormula(): any {
return katex.renderToString(this.formula, { return katex.renderToString(this.formula, {
throwOnError: false throwOnError: false,
} as any); } as any);
} },
} },
}); });
</script> </script>

View File

@ -70,7 +70,7 @@ function subscribe() {
// SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters // SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters
return promiseDialog(registration.pushManager.subscribe({ return promiseDialog(registration.pushManager.subscribe({
userVisibleOnly: true, userVisibleOnly: true,
applicationServerKey: urlBase64ToUint8Array(instance.swPublickey) applicationServerKey: urlBase64ToUint8Array(instance.swPublickey),
}) })
.then(async subscription => { .then(async subscription => {
pushSubscription = subscription; pushSubscription = subscription;
@ -79,7 +79,7 @@ function subscribe() {
pushRegistrationInServer = await api('sw/register', { pushRegistrationInServer = await api('sw/register', {
endpoint: subscription.endpoint, endpoint: subscription.endpoint,
auth: encode(subscription.getKey('auth')), auth: encode(subscription.getKey('auth')),
publickey: encode(subscription.getKey('p256dh')) publickey: encode(subscription.getKey('p256dh')),
}); });
}, async err => { // When subscribe failed }, async err => { // When subscribe failed
// //

View File

@ -51,7 +51,7 @@ export default defineComponent({
text: '', text: '',
flag: true, flag: true,
radio: 'misskey', radio: 'misskey',
mfm: `Hello world! This is an @example mention. BTW you are @${this.$i ? this.$i.username : 'guest'}.\nAlso, here is ${config.url} and [example link](${config.url}). for more details, see https://example.com.\nAs you know #misskey is open-source software.` mfm: `Hello world! This is an @example mention. BTW you are @${this.$i ? this.$i.username : 'guest'}.\nAlso, here is ${config.url} and [example link](${config.url}). for more details, see https://example.com.\nAs you know #misskey is open-source software.`,
}; };
}, },
@ -69,17 +69,17 @@ export default defineComponent({
foo: { foo: {
type: 'boolean', type: 'boolean',
default: true, default: true,
label: 'This is a boolean property' label: 'This is a boolean property',
}, },
bar: { bar: {
type: 'number', type: 'number',
default: 300, default: 300,
label: 'This is a number property' label: 'This is a number property',
}, },
baz: { baz: {
type: 'string', type: 'string',
default: 'Misskey makes you happy.', default: 'Misskey makes you happy.',
label: 'This is a string property' label: 'This is a string property',
}, },
}); });
}, },
@ -95,7 +95,7 @@ export default defineComponent({
async openMenu(ev) { async openMenu(ev) {
os.popupMenu([{ os.popupMenu([{
type: 'label', type: 'label',
text: 'Fruits' text: 'Fruits',
}, { }, {
text: 'Create some apples', text: 'Create some apples',
action: () => {}, action: () => {},
@ -111,6 +111,6 @@ export default defineComponent({
action: () => {}, action: () => {},
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
}, },
} },
}); });
</script> </script>

View File

@ -24,21 +24,21 @@ import { Block } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
XText, XSection, XImage, XButton, XNumberInput, XTextInput, XTextareaInput, XTextarea, XPost, XSwitch, XIf, XCounter, XRadioButton, XCanvas, XNote XText, XSection, XImage, XButton, XNumberInput, XTextInput, XTextareaInput, XTextarea, XPost, XSwitch, XIf, XCounter, XRadioButton, XCanvas, XNote,
}, },
props: { props: {
block: { block: {
type: Object as PropType<Block>, type: Object as PropType<Block>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
}, },
h: { h: {
type: Number, type: Number,
required: true required: true,
} },
}, },
}); });
</script> </script>

View File

@ -13,24 +13,24 @@ import { Hpml } from '@/scripts/hpml/evaluator';
export default defineComponent({ export default defineComponent({
components: { components: {
MkButton MkButton,
}, },
props: { props: {
block: { block: {
type: Object as PropType<ButtonBlock>, type: Object as PropType<ButtonBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
methods: { methods: {
click() { click() {
if (this.block.action === 'dialog') { if (this.block.action === 'dialog') {
this.hpml.eval(); this.hpml.eval();
os.alert({ os.alert({
text: this.hpml.interpolate(this.block.content) text: this.hpml.interpolate(this.block.content),
}); });
} else if (this.block.action === 'resetRandom') { } else if (this.block.action === 'resetRandom') {
this.hpml.updateRandomSeed(Math.random()); this.hpml.updateRandomSeed(Math.random());
@ -40,19 +40,19 @@ export default defineComponent({
pageId: this.hpml.page.id, pageId: this.hpml.page.id,
event: this.block.event, event: this.block.event,
...(this.block.var ? { ...(this.block.var ? {
var: unref(this.hpml.vars)[this.block.var] var: unref(this.hpml.vars)[this.block.var],
} : {}) } : {}),
}); });
os.alert({ os.alert({
type: 'success', type: 'success',
text: this.hpml.interpolate(this.block.message) text: this.hpml.interpolate(this.block.message),
}); });
} else if (this.block.action === 'callAiScript') { } else if (this.block.action === 'callAiScript') {
this.hpml.callAiScript(this.block.fn); this.hpml.callAiScript(this.block.fn);
} }
} },
} },
}); });
</script> </script>

View File

@ -14,12 +14,12 @@ export default defineComponent({
props: { props: {
block: { block: {
type: Object as PropType<CanvasBlock>, type: Object as PropType<CanvasBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const canvas: Ref<any> = ref(null); const canvas: Ref<any> = ref(null);
@ -29,9 +29,9 @@ export default defineComponent({
}); });
return { return {
canvas canvas,
}; };
} },
}); });
</script> </script>

View File

@ -13,17 +13,17 @@ import { Hpml } from '@/scripts/hpml/evaluator';
export default defineComponent({ export default defineComponent({
components: { components: {
MkButton MkButton,
}, },
props: { props: {
block: { block: {
type: Object as PropType<CounterVarBlock>, type: Object as PropType<CounterVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -36,9 +36,9 @@ export default defineComponent({
} }
return { return {
click click,
}; };
} },
}); });
</script> </script>

View File

@ -11,21 +11,21 @@ import { defineComponent, defineAsyncComponent, PropType } from 'vue';
export default defineComponent({ export default defineComponent({
components: { components: {
XBlock: defineAsyncComponent(() => import('./page.block.vue')) XBlock: defineAsyncComponent(() => import('./page.block.vue')),
}, },
props: { props: {
block: { block: {
type: Object as PropType<IfBlock>, type: Object as PropType<IfBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
}, },
h: { h: {
type: Number, type: Number,
required: true required: true,
} },
}, },
}); });
</script> </script>

View File

@ -20,8 +20,8 @@ export default defineComponent({
props: { props: {
block: { block: {
type: Object as PropType<NoteBlock>, type: Object as PropType<NoteBlock>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const note: Ref<Record<string, any> | null> = ref(null); const note: Ref<Record<string, any> | null> = ref(null);
@ -34,9 +34,9 @@ export default defineComponent({
}); });
return { return {
note note,
}; };
} },
}); });
</script> </script>

View File

@ -15,17 +15,17 @@ import { NumberInputVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkInput MkInput,
}, },
props: { props: {
block: { block: {
type: Object as PropType<NumberInputVarBlock>, type: Object as PropType<NumberInputVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -39,9 +39,9 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View File

@ -14,17 +14,17 @@ import { RadioButtonVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkRadio MkRadio,
}, },
props: { props: {
block: { block: {
type: Object as PropType<RadioButtonVarBlock>, type: Object as PropType<RadioButtonVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -38,8 +38,8 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View File

@ -16,20 +16,20 @@ import { Hpml } from '@/scripts/hpml/evaluator';
export default defineComponent({ export default defineComponent({
components: { components: {
XBlock: defineAsyncComponent(() => import('./page.block.vue')) XBlock: defineAsyncComponent(() => import('./page.block.vue')),
}, },
props: { props: {
block: { block: {
type: Object as PropType<SectionBlock>, type: Object as PropType<SectionBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
}, },
h: { h: {
required: true required: true,
} },
}, },
}); });
</script> </script>

View File

@ -13,17 +13,17 @@ import { SwitchVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkSwitch MkSwitch,
}, },
props: { props: {
block: { block: {
type: Object as PropType<SwitchVarBlock>, type: Object as PropType<SwitchVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -37,9 +37,9 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View File

@ -15,17 +15,17 @@ import { TextInputVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkInput MkInput,
}, },
props: { props: {
block: { block: {
type: Object as PropType<TextInputVarBlock>, type: Object as PropType<TextInputVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -39,9 +39,9 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View File

@ -19,12 +19,12 @@ export default defineComponent({
props: { props: {
block: { block: {
type: Object as PropType<TextBlock>, type: Object as PropType<TextBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
data() { data() {
return { return {
@ -38,15 +38,15 @@ export default defineComponent({
} else { } else {
return []; return [];
} }
} },
}, },
watch: { watch: {
'hpml.vars': { 'hpml.vars': {
handler() { handler() {
this.text = this.hpml.interpolate(this.block.text); this.text = this.hpml.interpolate(this.block.text);
}, },
deep: true deep: true,
} },
}, },
}); });
</script> </script>

View File

@ -16,17 +16,17 @@ import { TextInputVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkTextarea MkTextarea,
}, },
props: { props: {
block: { block: {
type: Object as PropType<TextInputVarBlock>, type: Object as PropType<TextInputVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -40,8 +40,8 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View File

@ -10,17 +10,17 @@ import MkTextarea from '../form/textarea.vue';
export default defineComponent({ export default defineComponent({
components: { components: {
MkTextarea MkTextarea,
}, },
props: { props: {
block: { block: {
type: Object as PropType<TextBlock>, type: Object as PropType<TextBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
data() { data() {
return { return {
@ -32,8 +32,8 @@ export default defineComponent({
handler() { handler() {
this.text = this.hpml.interpolate(this.block.text); this.text = this.hpml.interpolate(this.block.text);
}, },
deep: true deep: true,
} },
} },
}); });
</script> </script>

View File

@ -15,12 +15,12 @@ import { defaultStore } from '@/store';
export default defineComponent({ export default defineComponent({
components: { components: {
XBlock XBlock,
}, },
props: { props: {
page: { page: {
type: Object as PropType<Record<string, any>>, type: Object as PropType<Record<string, any>>,
required: true required: true,
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
@ -28,7 +28,7 @@ export default defineComponent({
randomSeed: Math.random(), randomSeed: Math.random(),
visitor: $i, visitor: $i,
url: url, url: url,
enableAiScript: !defaultStore.state.disablePagesScript enableAiScript: !defaultStore.state.disablePagesScript,
}); });
onMounted(() => { onMounted(() => {

View File

@ -18,5 +18,5 @@ export default {
unmounted(src, binding, vn) { unmounted(src, binding, vn) {
if (src._observer_) src._observer_.disconnect(); if (src._observer_) src._observer_.disconnect();
} },
} as Directive; } as Directive;

View File

@ -27,5 +27,5 @@ export default {
el.classList.add('_anime_bounce_standBy'); el.classList.add('_anime_bounce_standBy');
}); });
*/ */
} },
} as Directive; } as Directive;

View File

@ -31,5 +31,5 @@ export default {
unmounted(src, binding, vn) { unmounted(src, binding, vn) {
if (src._ro_) src._ro_.unobserve(src); if (src._ro_) src._ro_.unobserve(src);
} },
} as Directive; } as Directive;

View File

@ -39,7 +39,7 @@ export default {
}); });
resize.observe(src); resize.observe(src);
mountings.set(src, { resize, fn: binding.value, }); mountings.set(src, { resize, fn: binding.value });
calc(src); calc(src);
}, },
@ -50,5 +50,5 @@ export default {
info.resize.disconnect(); info.resize.disconnect();
if (info.intersection) info.intersection.disconnect(); if (info.intersection) info.intersection.disconnect();
mountings.delete(src); mountings.delete(src);
} },
} as Directive<Element, (w: number, h: number) => void>; } as Directive<Element, (w: number, h: number) => void>;

View File

@ -20,5 +20,5 @@ export default {
} else { } else {
el.removeEventListener('keydown', el._keyHandler); el.removeEventListener('keydown', el._keyHandler);
} }
} },
} as Directive; } as Directive;

View File

@ -14,5 +14,5 @@ export default {
popup(Ripple, { x, y }, {}, 'end'); popup(Ripple, { x, y }, {}, 'end');
}); });
} },
}; };

View File

@ -29,7 +29,7 @@ function getClassOrder(width: number, queue: Value): ClassOrder {
remove: [ remove: [
...(queue.max ? queue.max.filter(v => width > v).map(getMaxClass) : []), ...(queue.max ? queue.max.filter(v => width > v).map(getMaxClass) : []),
...(queue.min ? queue.min.filter(v => width < v).map(getMinClass) : []), ...(queue.min ? queue.min.filter(v => width < v).map(getMinClass) : []),
] ],
}; };
} }
@ -103,5 +103,5 @@ export default {
info.resize.disconnect(); info.resize.disconnect();
if (info.intersection) info.intersection.disconnect(); if (info.intersection) info.intersection.disconnect();
mountings.delete(src); mountings.delete(src);
} },
} as Directive<Element, Value>; } as Directive<Element, Value>;

View File

@ -27,7 +27,7 @@ export class UserPreview {
popup(defineAsyncComponent(() => import('@/components/MkUserPreview.vue')), { popup(defineAsyncComponent(() => import('@/components/MkUserPreview.vue')), {
showing, showing,
q: this.user, q: this.user,
source: this.el source: this.el,
}, { }, {
mouseover: () => { mouseover: () => {
window.clearTimeout(this.hideTimer); window.clearTimeout(this.hideTimer);
@ -41,7 +41,7 @@ export class UserPreview {
this.promise = { this.promise = {
cancel: () => { cancel: () => {
showing.value = false; showing.value = false;
} },
}; };
this.checkTimer = window.setInterval(() => { this.checkTimer = window.setInterval(() => {
@ -114,5 +114,5 @@ export default {
const self = el._userPreviewDirective_; const self = el._userPreviewDirective_;
self.preview.detach(); self.preview.detach();
} },
} as Directive; } as Directive;

View File

@ -14,7 +14,7 @@ export const instance: Misskey.entities.InstanceMetadata = reactive(instanceData
export async function fetchInstance() { export async function fetchInstance() {
const meta = await api('meta', { const meta = await api('meta', {
detail: false detail: false,
}); });
for (const [k, v] of Object.entries(meta)) { for (const [k, v] of Object.entries(meta)) {

View File

@ -65,7 +65,7 @@ import {
Legend, Legend,
Title, Title,
Tooltip, Tooltip,
SubTitle SubTitle,
} from 'chart.js'; } from 'chart.js';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import MkSelect from '@/components/form/select.vue'; import MkSelect from '@/components/form/select.vue';
@ -89,7 +89,7 @@ Chart.register(
Legend, Legend,
Title, Title,
Tooltip, Tooltip,
SubTitle SubTitle,
); );
const alpha = (hex, a) => { const alpha = (hex, a) => {
@ -155,13 +155,13 @@ export default defineComponent({
this.connection.on('statsLog', this.onStatsLog); this.connection.on('statsLog', this.onStatsLog);
this.connection.send('requestLog', { this.connection.send('requestLog', {
id: Math.random().toString().substr(2, 8), id: Math.random().toString().substr(2, 8),
length: 150 length: 150,
}); });
this.$nextTick(() => { this.$nextTick(() => {
this.queueConnection.send('requestLog', { this.queueConnection.send('requestLog', {
id: Math.random().toString().substr(2, 8), id: Math.random().toString().substr(2, 8),
length: 200 length: 200,
}); });
}); });
}); });
@ -190,7 +190,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderColor: '#86b300', borderColor: '#86b300',
backgroundColor: alpha('#86b300', 0.1), backgroundColor: alpha('#86b300', 0.1),
data: [] data: [],
}, { }, {
label: 'MEM (active)', label: 'MEM (active)',
pointRadius: 0, pointRadius: 0,
@ -198,7 +198,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderColor: '#935dbf', borderColor: '#935dbf',
backgroundColor: alpha('#935dbf', 0.02), backgroundColor: alpha('#935dbf', 0.02),
data: [] data: [],
}, { }, {
label: 'MEM (used)', label: 'MEM (used)',
pointRadius: 0, pointRadius: 0,
@ -207,8 +207,8 @@ export default defineComponent({
borderColor: '#935dbf', borderColor: '#935dbf',
borderDash: [5, 5], borderDash: [5, 5],
fill: false, fill: false,
data: [] data: [],
}] }],
}, },
options: { options: {
aspectRatio: 3, aspectRatio: 3,
@ -217,14 +217,14 @@ export default defineComponent({
left: 16, left: 16,
right: 16, right: 16,
top: 16, top: 16,
bottom: 0 bottom: 0,
} },
}, },
legend: { legend: {
position: 'bottom', position: 'bottom',
labels: { labels: {
boxWidth: 16, boxWidth: 16,
} },
}, },
scales: { scales: {
x: { x: {
@ -235,7 +235,7 @@ export default defineComponent({
}, },
ticks: { ticks: {
display: false, display: false,
} },
}, },
y: { y: {
position: 'right', position: 'right',
@ -246,15 +246,15 @@ export default defineComponent({
}, },
ticks: { ticks: {
display: false, display: false,
max: 100 max: 100,
} },
} },
}, },
tooltips: { tooltips: {
intersect: false, intersect: false,
mode: 'index', mode: 'index',
} },
} },
})); }));
}, },
@ -271,7 +271,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderColor: '#94a029', borderColor: '#94a029',
backgroundColor: alpha('#94a029', 0.1), backgroundColor: alpha('#94a029', 0.1),
data: [] data: [],
}, { }, {
label: 'Out', label: 'Out',
pointRadius: 0, pointRadius: 0,
@ -279,8 +279,8 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderColor: '#ff9156', borderColor: '#ff9156',
backgroundColor: alpha('#ff9156', 0.1), backgroundColor: alpha('#ff9156', 0.1),
data: [] data: [],
}] }],
}, },
options: { options: {
aspectRatio: 3, aspectRatio: 3,
@ -289,14 +289,14 @@ export default defineComponent({
left: 16, left: 16,
right: 16, right: 16,
top: 16, top: 16,
bottom: 0 bottom: 0,
} },
}, },
legend: { legend: {
position: 'bottom', position: 'bottom',
labels: { labels: {
boxWidth: 16, boxWidth: 16,
} },
}, },
scales: { scales: {
x: { x: {
@ -306,8 +306,8 @@ export default defineComponent({
zeroLineColor: this.gridColor, zeroLineColor: this.gridColor,
}, },
ticks: { ticks: {
display: false display: false,
} },
}, },
y: { y: {
position: 'right', position: 'right',
@ -318,14 +318,14 @@ export default defineComponent({
}, },
ticks: { ticks: {
display: false, display: false,
} },
} },
}, },
tooltips: { tooltips: {
intersect: false, intersect: false,
mode: 'index', mode: 'index',
} },
} },
})); }));
}, },
@ -342,7 +342,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderColor: '#94a029', borderColor: '#94a029',
backgroundColor: alpha('#94a029', 0.1), backgroundColor: alpha('#94a029', 0.1),
data: [] data: [],
}, { }, {
label: 'Write', label: 'Write',
pointRadius: 0, pointRadius: 0,
@ -350,8 +350,8 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderColor: '#ff9156', borderColor: '#ff9156',
backgroundColor: alpha('#ff9156', 0.1), backgroundColor: alpha('#ff9156', 0.1),
data: [] data: [],
}] }],
}, },
options: { options: {
aspectRatio: 3, aspectRatio: 3,
@ -360,14 +360,14 @@ export default defineComponent({
left: 16, left: 16,
right: 16, right: 16,
top: 16, top: 16,
bottom: 0 bottom: 0,
} },
}, },
legend: { legend: {
position: 'bottom', position: 'bottom',
labels: { labels: {
boxWidth: 16, boxWidth: 16,
} },
}, },
scales: { scales: {
x: { x: {
@ -377,8 +377,8 @@ export default defineComponent({
zeroLineColor: this.gridColor, zeroLineColor: this.gridColor,
}, },
ticks: { ticks: {
display: false display: false,
} },
}, },
y: { y: {
position: 'right', position: 'right',
@ -389,14 +389,14 @@ export default defineComponent({
}, },
ticks: { ticks: {
display: false, display: false,
} },
} },
}, },
tooltips: { tooltips: {
intersect: false, intersect: false,
mode: 'index', mode: 'index',
} },
} },
})); }));
}, },
@ -458,7 +458,7 @@ export default defineComponent({
resume() { resume() {
this.paused = false; this.paused = false;
}, },
} },
}); });
</script> </script>

View File

@ -26,7 +26,7 @@ import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
MkButton MkButton,
}, },
props: ['session'], props: ['session'],
computed: { computed: {
@ -37,12 +37,12 @@ export default defineComponent({
}, },
app(): any { app(): any {
return this.session.app; return this.session.app;
} },
}, },
methods: { methods: {
cancel() { cancel() {
os.api('auth/deny', { os.api('auth/deny', {
token: this.session.token token: this.session.token,
}).then(() => { }).then(() => {
this.$emit('denied'); this.$emit('denied');
}); });
@ -50,11 +50,11 @@ export default defineComponent({
accept() { accept() {
os.api('auth/accept', { os.api('auth/accept', {
token: this.session.token token: this.session.token,
}).then(() => { }).then(() => {
this.$emit('accepted'); this.$emit('accepted');
}); });
} },
} },
}); });
</script> </script>

View File

@ -28,7 +28,7 @@ function menu(ev) {
action: () => { action: () => {
copyToClipboard(`:${props.emoji.name}:`); copyToClipboard(`:${props.emoji.name}:`);
os.success(); os.success();
} },
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
} }
</script> </script>

View File

@ -58,8 +58,8 @@ withDefaults(defineProps<{
message: null, message: null,
primary: false, primary: false,
var: null, var: null,
fn: null fn: null,
} },
}); });
</script> </script>

View File

@ -32,7 +32,7 @@ withDefaults(defineProps<{
value: { value: {
name: '', name: '',
width: 300, width: 300,
height: 200 height: 200,
} },
}); });
</script> </script>

View File

@ -28,7 +28,7 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
name: '' name: '',
} },
}); });
</script> </script>

View File

@ -42,8 +42,8 @@ const props = withDefaults(defineProps<{
}>(), { }>(), {
value: { value: {
children: [], children: [],
var: null var: null,
} },
}); });
const getPageBlockList = inject<(any) => any>('getPageBlockList'); const getPageBlockList = inject<(any) => any>('getPageBlockList');
@ -51,7 +51,7 @@ const getPageBlockList = inject<(any) => any>('getPageBlockList');
async function add() { async function add() {
const { canceled, result: type } = await os.select({ const { canceled, result: type } = await os.select({
title: i18n.ts._pages.chooseBlock, title: i18n.ts._pages.chooseBlock,
groupedItems: getPageBlockList() groupedItems: getPageBlockList(),
}); });
if (canceled) return; if (canceled) return;

View File

@ -25,8 +25,8 @@ const props = withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
fileId: null fileId: null,
} },
}); });
let file: any = $ref(null); let file: any = $ref(null);
@ -43,7 +43,7 @@ onMounted(async () => {
await choose(); await choose();
} else { } else {
os.api('drive/files/show', { os.api('drive/files/show', {
fileId: props.value.fileId fileId: props.value.fileId,
}).then(fileResponse => { }).then(fileResponse => {
file = fileResponse; file = fileResponse;
}); });

View File

@ -31,8 +31,8 @@ const props = withDefaults(defineProps<{
}>(), { }>(), {
value: { value: {
note: null, note: null,
detailed: false detailed: false,
} },
}); });
let id: any = $ref(props.value.note); let id: any = $ref(props.value.note);
@ -47,6 +47,6 @@ watch(id, async () => {
note = await os.api('notes/show', { noteId: props.value.note }); note = await os.api('notes/show', { noteId: props.value.note });
}, { }, {
immediate: true immediate: true,
}); });
</script> </script>

View File

@ -28,7 +28,7 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
name: '' name: '',
} },
}); });
</script> </script>

View File

@ -25,7 +25,7 @@ withDefaults(defineProps<{
value: { value: {
text: '', text: '',
attachCanvasImage: false, attachCanvasImage: false,
canvasId: '' canvasId: '',
} },
}); });
</script> </script>

View File

@ -25,8 +25,8 @@ const props = withDefaults(defineProps<{
value: { value: {
name: '', name: '',
title: '', title: '',
values: [] values: [],
} },
}); });
let values: string = $ref(props.value.values.join('\n')); let values: string = $ref(props.value.values.join('\n'));
@ -34,6 +34,6 @@ let values: string = $ref(props.value.values.join('\n'));
watch(values, () => { watch(values, () => {
props.value.values = values.split('\n'); props.value.values = values.split('\n');
}, { }, {
deep: true deep: true,
}); });
</script> </script>

View File

@ -33,8 +33,8 @@ const props = withDefaults(defineProps<{
}>(), { }>(), {
value: { value: {
title: null, title: null,
children: [] children: [],
} },
}); });
const getPageBlockList = inject<(any) => any>('getPageBlockList'); const getPageBlockList = inject<(any) => any>('getPageBlockList');
@ -42,7 +42,7 @@ const getPageBlockList = inject<(any) => any>('getPageBlockList');
async function rename() { async function rename() {
const { canceled, result: title } = await os.inputText({ const { canceled, result: title } = await os.inputText({
title: 'Enter title', title: 'Enter title',
default: props.value.title default: props.value.title,
}); });
if (canceled) return; if (canceled) return;
props.value.title = title; props.value.title = title;
@ -51,7 +51,7 @@ async function rename() {
async function add() { async function add() {
const { canceled, result: type } = await os.select({ const { canceled, result: type } = await os.select({
title: i18n.ts._pages.chooseBlock, title: i18n.ts._pages.chooseBlock,
groupedItems: getPageBlockList() groupedItems: getPageBlockList(),
}); });
if (canceled) return; if (canceled) return;

View File

@ -22,8 +22,8 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
name: '' name: '',
} },
}); });
</script> </script>

View File

@ -21,7 +21,7 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
name: '' name: '',
} },
}); });
</script> </script>

View File

@ -18,8 +18,8 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
text: '' text: '',
} },
}); });
</script> </script>

View File

@ -22,7 +22,7 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
name: '' name: '',
} },
}); });
</script> </script>

View File

@ -18,8 +18,8 @@ withDefaults(defineProps<{
value: any value: any
}>(), { }>(), {
value: { value: {
text: '' text: '',
} },
}); });
</script> </script>

View File

@ -31,24 +31,24 @@ export default defineComponent({
props: { props: {
expanded: { expanded: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
removable: { removable: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
draggable: { draggable: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
error: { error: {
required: false, required: false,
default: null default: null,
}, },
warn: { warn: {
required: false, required: false,
default: null default: null,
} },
}, },
emits: ['toggle', 'remove'], emits: ['toggle', 'remove'],
data() { data() {
@ -63,8 +63,8 @@ export default defineComponent({
}, },
remove() { remove() {
this.$emit('remove'); this.$emit('remove');
} },
} },
}); });
</script> </script>

View File

@ -78,17 +78,17 @@ export default defineComponent({
props: { props: {
getExpectedType: { getExpectedType: {
required: false, required: false,
default: null default: null,
}, },
modelValue: { modelValue: {
required: true required: true,
}, },
title: { title: {
required: false required: false,
}, },
removable: { removable: {
required: false, required: false,
default: false default: false,
}, },
hpml: { hpml: {
required: true, required: true,
@ -101,8 +101,8 @@ export default defineComponent({
}, },
draggable: { draggable: {
required: false, required: false,
default: false default: false,
} },
}, },
data() { data() {
@ -131,11 +131,11 @@ export default defineComponent({
handler() { handler() {
this.modelValue.value.slots = this.slots.split('\n').map(x => ({ this.modelValue.value.slots = this.slots.split('\n').map(x => ({
name: x, name: x,
type: null type: null,
})); }));
}, },
deep: true deep: true,
} },
}, },
created() { created() {
@ -150,7 +150,7 @@ export default defineComponent({
const id = uuid(); const id = uuid();
this.modelValue.value = { this.modelValue.value = {
slots: [], slots: [],
expression: { id, type: null } expression: { id, type: null },
}; };
return; return;
} }
@ -194,13 +194,13 @@ export default defineComponent({
const emptySlotIndex = args.findIndex(x => x.type === null); const emptySlotIndex = args.findIndex(x => x.type === null);
if (emptySlotIndex !== -1 && emptySlotIndex < args.length) { if (emptySlotIndex !== -1 && emptySlotIndex < args.length) {
this.warn = { this.warn = {
slot: emptySlotIndex slot: emptySlotIndex,
}; };
} else { } else {
this.warn = null; this.warn = null;
} }
}, { }, {
deep: true deep: true,
}); });
this.$watch(() => this.hpml.variables, () => { this.$watch(() => this.hpml.variables, () => {
@ -208,7 +208,7 @@ export default defineComponent({
this.error = this.hpml.typeCheck(this.modelValue); this.error = this.hpml.typeCheck(this.modelValue);
} }
}, { }, {
deep: true deep: true,
}); });
}, },
@ -216,7 +216,7 @@ export default defineComponent({
async changeType() { async changeType() {
const { canceled, result: type } = await os.select({ const { canceled, result: type } = await os.select({
title: this.$ts._pages.selectType, title: this.$ts._pages.selectType,
groupedItems: this.getScriptBlockList(this.getExpectedType ? this.getExpectedType() : null) groupedItems: this.getScriptBlockList(this.getExpectedType ? this.getExpectedType() : null),
}); });
if (canceled) return; if (canceled) return;
this.modelValue.type = type; this.modelValue.type = type;
@ -224,8 +224,8 @@ export default defineComponent({
_getExpectedType(slot: number) { _getExpectedType(slot: number) {
return this.hpml.getExpectedType(this.modelValue, slot); return this.hpml.getExpectedType(this.modelValue, slot);
} },
} },
}); });
</script> </script>

View File

@ -82,7 +82,7 @@ export default defineComponent({
os.api('hashtags/list', { os.api('hashtags/list', {
sort: '+mentionedLocalUsers', sort: '+mentionedLocalUsers',
limit: 8 limit: 8,
}).then(tags => { }).then(tags => {
this.tags = tags; this.tags = tags;
}); });
@ -91,13 +91,13 @@ export default defineComponent({
methods: { methods: {
signin() { signin() {
os.popup(XSigninDialog, { os.popup(XSigninDialog, {
autoSet: true autoSet: true,
}, {}, 'closed'); }, {}, 'closed');
}, },
signup() { signup() {
os.popup(XSignupDialog, { os.popup(XSignupDialog, {
autoSet: true autoSet: true,
}, {}, 'closed'); }, {}, 'closed');
}, },
@ -107,24 +107,24 @@ export default defineComponent({
icon: 'ti ti-info-circle', icon: 'ti ti-info-circle',
action: () => { action: () => {
os.pageWindow('/about'); os.pageWindow('/about');
} },
}, { }, {
text: this.$ts.aboutMisskey, text: this.$ts.aboutMisskey,
icon: 'ti ti-info-circle', icon: 'ti ti-info-circle',
action: () => { action: () => {
os.pageWindow('/about-misskey'); os.pageWindow('/about-misskey');
} },
}, null, { }, null, {
text: this.$ts.help, text: this.$ts.help,
icon: 'ti ti-question-circle', icon: 'ti ti-question-circle',
action: () => { action: () => {
window.open(`https://misskey-hub.net/help.md`, '_blank'); window.open(`https://misskey-hub.net/help.md`, '_blank');
} },
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
}, },
number number,
} },
}); });
</script> </script>

View File

@ -102,7 +102,7 @@ export default defineComponent({
os.api('hashtags/list', { os.api('hashtags/list', {
sort: '+mentionedLocalUsers', sort: '+mentionedLocalUsers',
limit: 8 limit: 8,
}).then(tags => { }).then(tags => {
this.tags = tags; this.tags = tags;
}); });
@ -111,13 +111,13 @@ export default defineComponent({
methods: { methods: {
signin() { signin() {
os.popup(XSigninDialog, { os.popup(XSigninDialog, {
autoSet: true autoSet: true,
}, {}, 'closed'); }, {}, 'closed');
}, },
signup() { signup() {
os.popup(XSignupDialog, { os.popup(XSignupDialog, {
autoSet: true autoSet: true,
}, {}, 'closed'); }, {}, 'closed');
}, },
@ -127,24 +127,24 @@ export default defineComponent({
icon: 'ti ti-info-circle', icon: 'ti ti-info-circle',
action: () => { action: () => {
os.pageWindow('/about'); os.pageWindow('/about');
} },
}, { }, {
text: this.$ts.aboutMisskey, text: this.$ts.aboutMisskey,
icon: 'ti ti-info-circle', icon: 'ti ti-info-circle',
action: () => { action: () => {
os.pageWindow('/about-misskey'); os.pageWindow('/about-misskey');
} },
}, null, { }, null, {
text: this.$ts.help, text: this.$ts.help,
icon: 'ti ti-question-circle', icon: 'ti ti-question-circle',
action: () => { action: () => {
window.open(`https://misskey-hub.net/help.md`, '_blank'); window.open(`https://misskey-hub.net/help.md`, '_blank');
} },
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
}, },
number number,
} },
}); });
</script> </script>

View File

@ -32,7 +32,7 @@ export default defineComponent({
components: { components: {
XReactionsViewer, XReactionsViewer,
XMediaList, XMediaList,
XPoll XPoll,
}, },
data() { data() {
@ -52,7 +52,7 @@ export default defineComponent({
if (this.$refs.scroll.clientHeight > window.innerHeight) { if (this.$refs.scroll.clientHeight > window.innerHeight) {
this.isScrolling = true; this.isScrolling = true;
} }
} },
}); });
</script> </script>

View File

@ -12,7 +12,7 @@ export function install(plugin) {
const aiscript = new AiScript(createPluginEnv({ const aiscript = new AiScript(createPluginEnv({
plugin: plugin, plugin: plugin,
storageKey: 'plugins:' + plugin.id storageKey: 'plugins:' + plugin.id,
}), { }), {
in: (q) => { in: (q) => {
return new Promise(ok => { return new Promise(ok => {
@ -86,7 +86,7 @@ function registerPostFormAction({ pluginId, title, handler }) {
pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(form), values.FN_NATIVE(([key, value]) => { pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(form), values.FN_NATIVE(([key, value]) => {
update(key.value, value.value); update(key.value, value.value);
})]); })]);
} },
}); });
} }
@ -94,7 +94,7 @@ function registerUserAction({ pluginId, title, handler }) {
userActions.push({ userActions.push({
title, handler: (user) => { title, handler: (user) => {
pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(user)]); pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(user)]);
} },
}); });
} }
@ -102,7 +102,7 @@ function registerNoteAction({ pluginId, title, handler }) {
noteActions.push({ noteActions.push({
title, handler: (note) => { title, handler: (note) => {
pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]); pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]);
} },
}); });
} }
@ -110,7 +110,7 @@ function registerNoteViewInterruptor({ pluginId, handler }) {
noteViewInterruptors.push({ noteViewInterruptors.push({
handler: async (note) => { handler: async (note) => {
return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)])); return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]));
} },
}); });
} }
@ -118,6 +118,6 @@ function registerNotePostInterruptor({ pluginId, handler }) {
notePostInterruptors.push({ notePostInterruptors.push({
handler: async (note) => { handler: async (note) => {
return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)])); return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]));
} },
}); });
} }

View File

@ -7,15 +7,15 @@ export function byteify(string: string, encoding: 'ascii' | 'base64' | 'hex') {
atob( atob(
string string
.replace(/-/g, '+') .replace(/-/g, '+')
.replace(/_/g, '/') .replace(/_/g, '/'),
), ),
c => c.charCodeAt(0) c => c.charCodeAt(0),
); );
case 'hex': case 'hex':
return new Uint8Array( return new Uint8Array(
string string
.match(/.{1,2}/g) .match(/.{1,2}/g)
.map(byte => parseInt(byte, 16)) .map(byte => parseInt(byte, 16)),
); );
} }
} }
@ -24,7 +24,7 @@ export function hexify(buffer: ArrayBuffer) {
return Array.from(new Uint8Array(buffer)) return Array.from(new Uint8Array(buffer))
.reduce( .reduce(
(str, byte) => str + byte.toString(16).padStart(2, '0'), (str, byte) => str + byte.toString(16).padStart(2, '0'),
'' '',
); );
} }

View File

@ -171,7 +171,7 @@ export class Autocomplete {
}, { }, {
done: (res) => { done: (res) => {
this.complete(res); this.complete(res);
} },
}); });
this.suggestion = { this.suggestion = {

View File

@ -4,7 +4,7 @@ export function focusPrev(el: Element | null, self = false, scroll = true) {
if (el) { if (el) {
if (el.hasAttribute('tabindex')) { if (el.hasAttribute('tabindex')) {
(el as HTMLElement).focus({ (el as HTMLElement).focus({
preventScroll: !scroll preventScroll: !scroll,
}); });
} else { } else {
focusPrev(el.previousElementSibling, true); focusPrev(el.previousElementSibling, true);
@ -18,7 +18,7 @@ export function focusNext(el: Element | null, self = false, scroll = true) {
if (el) { if (el) {
if (el.hasAttribute('tabindex')) { if (el.hasAttribute('tabindex')) {
(el as HTMLElement).focus({ (el as HTMLElement).focus({
preventScroll: !scroll preventScroll: !scroll,
}); });
} else { } else {
focusPrev(el.nextElementSibling, true); focusPrev(el.nextElementSibling, true);

View File

@ -7,7 +7,7 @@ const defaultLocaleStringFormats: {[index: string]: string} = {
'hour': 'numeric', 'hour': 'numeric',
'minute': 'numeric', 'minute': 'numeric',
'second': 'numeric', 'second': 'numeric',
'timeZoneName': 'short' 'timeZoneName': 'short',
}; };
function formatLocaleString(date: Date, format: string): string { function formatLocaleString(date: Date, format: string): string {

View File

@ -25,6 +25,6 @@ export async function genSearchQuery(v: any, q: string) {
return { return {
query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '), query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '),
host: host, host: host,
userId: userId userId: userId,
}; };
} }

View File

@ -11,6 +11,6 @@ export function getStaticImageUrl(baseUrl: string): string {
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
return `${instanceUrl}/proxy/${dummy}?${url.query({ return `${instanceUrl}/proxy/${dummy}?${url.query({
url: u.href, url: u.href,
static: '1' static: '1',
})}`; })}`;
} }

View File

@ -21,7 +21,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
const result = { const result = {
patterns: [], patterns: [],
callback, callback,
allowRepeat: true allowRepeat: true,
} as Action; } as Action;
if (patterns.match(/^\(.*\)$/) !== null) { if (patterns.match(/^\(.*\)$/) !== null) {
@ -34,7 +34,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
which: [], which: [],
ctrl: false, ctrl: false,
alt: false, alt: false,
shift: false shift: false,
} as Pattern; } as Pattern;
const keys = part.trim().split('+').map(x => x.trim().toLowerCase()); const keys = part.trim().split('+').map(x => x.trim().toLowerCase());
@ -61,7 +61,7 @@ function match(ev: KeyboardEvent, patterns: Action['patterns']): boolean {
pattern.ctrl === ev.ctrlKey && pattern.ctrl === ev.ctrlKey &&
pattern.shift === ev.shiftKey && pattern.shift === ev.shiftKey &&
pattern.alt === ev.altKey && pattern.alt === ev.altKey &&
!ev.metaKey !ev.metaKey,
); );
} }

View File

@ -35,7 +35,7 @@ export class Hpml {
if (this.opts.enableAiScript) { if (this.opts.enableAiScript) {
this.aiscript = markRaw(new AiScript({ ...createAiScriptEnv({ this.aiscript = markRaw(new AiScript({ ...createAiScriptEnv({
storageKey: 'pages:' + this.page.id storageKey: 'pages:' + this.page.id,
}), ...initAiLib(this) }, { }), ...initAiLib(this) }, {
in: (q) => { in: (q) => {
return new Promise(ok => { return new Promise(ok => {
@ -75,7 +75,7 @@ export class Hpml {
SEED: opts.randomSeed ? opts.randomSeed : '', SEED: opts.randomSeed ? opts.randomSeed : '',
YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`, YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`,
AISCRIPT_DISABLED: !this.opts.enableAiScript, AISCRIPT_DISABLED: !this.opts.enableAiScript,
NULL: null NULL: null,
}; };
this.eval(); this.eval();
@ -198,7 +198,7 @@ export class Hpml {
slots: expr.value.slots.map(x => x.name), slots: expr.value.slots.map(x => x.name),
exec: (slotArg: Record<string, any>) => { exec: (slotArg: Record<string, any>) => {
return this.evaluate(expr.value.expression, scope.createChildScope(slotArg, expr.id)); return this.evaluate(expr.value.expression, scope.createChildScope(slotArg, expr.id));
} },
} as Fn; } as Fn;
} }
return; return;

View File

@ -14,22 +14,22 @@ export type Fn = {
export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null; export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null;
export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = { export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = {
text: { out: 'string', category: 'value', icon: 'ti ti-quote', }, text: { out: 'string', category: 'value', icon: 'ti ti-quote' },
multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', }, multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left' },
textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', }, textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list' },
number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', }, number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up' },
ref: { out: null, category: 'value', icon: 'fas fa-magic', }, ref: { out: null, category: 'value', icon: 'fas fa-magic' },
aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic', }, aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic' },
fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt', }, fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt' },
}; };
export const blockDefs = [ export const blockDefs = [
...Object.entries(literalDefs).map(([k, v]) => ({ ...Object.entries(literalDefs).map(([k, v]) => ({
type: k, out: v.out, category: v.category, icon: v.icon type: k, out: v.out, category: v.category, icon: v.icon,
})), })),
...Object.entries(funcDefs).map(([k, v]) => ({ ...Object.entries(funcDefs).map(([k, v]) => ({
type: k, out: v.out, category: v.category, icon: v.icon type: k, out: v.out, category: v.category, icon: v.icon,
})) })),
]; ];
export type PageVar = { name: string; value: any; type: Type; }; export type PageVar = { name: string; value: any; type: Type; };
@ -82,7 +82,7 @@ export class HpmlScope {
throw new HpmlError( throw new HpmlError(
`No such variable '${name}' in scope '${this.name}'`, { `No such variable '${name}' in scope '${this.name}'`, {
scope: this.layerdStates scope: this.layerdStates,
}); });
} }
} }

View File

@ -19,7 +19,7 @@ export async function lookupUser() {
if (_notFound) { if (_notFound) {
os.alert({ os.alert({
type: 'error', type: 'error',
text: i18n.ts.noSuchUser text: i18n.ts.noSuchUser,
}); });
} else { } else {
_notFound = true; _notFound = true;

View File

@ -29,7 +29,7 @@ export function physics(container: HTMLElement) {
height: containerHeight, height: containerHeight,
background: 'transparent', // transparent to hide background: 'transparent', // transparent to hide
wireframeBackground: 'transparent', // transparent to hide wireframeBackground: 'transparent', // transparent to hide
} },
}); });
// Disable to hide debug // Disable to hide debug
@ -43,7 +43,7 @@ export function physics(container: HTMLElement) {
const ground = Matter.Bodies.rectangle(containerCenterX, containerHeight + (groundThickness / 2), containerWidth, groundThickness, { const ground = Matter.Bodies.rectangle(containerCenterX, containerHeight + (groundThickness / 2), containerWidth, groundThickness, {
isStatic: true, isStatic: true,
restitution: 0.1, restitution: 0.1,
friction: 2 friction: 2,
}); });
//const wallRight = Matter.Bodies.rectangle(window.innerWidth+50, window.innerHeight/2, 100, window.innerHeight, wallopts); //const wallRight = Matter.Bodies.rectangle(window.innerWidth+50, window.innerHeight/2, 100, window.innerHeight, wallopts);
@ -68,8 +68,8 @@ export function physics(container: HTMLElement) {
top + (objEl.offsetHeight / 2), top + (objEl.offsetHeight / 2),
Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2, Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2,
{ {
restitution: 0.5 restitution: 0.5,
} },
); );
} else { } else {
const style = window.getComputedStyle(objEl); const style = window.getComputedStyle(objEl);
@ -80,8 +80,8 @@ export function physics(container: HTMLElement) {
objEl.offsetHeight, objEl.offsetHeight,
{ {
chamfer: { radius: parseInt(style.borderRadius || '0', 10) }, chamfer: { radius: parseInt(style.borderRadius || '0', 10) },
restitution: 0.5 restitution: 0.5,
} },
); );
} }
objEl.id = obj.id.toString(); objEl.id = obj.id.toString();
@ -98,9 +98,9 @@ export function physics(container: HTMLElement) {
constraint: { constraint: {
stiffness: 0.1, stiffness: 0.1,
render: { render: {
visible: false visible: false,
} },
} },
}); });
Matter.World.add(engine.world, mouseConstraint); Matter.World.add(engine.world, mouseConstraint);
@ -147,6 +147,6 @@ export function physics(container: HTMLElement) {
stop = true; stop = true;
Matter.Runner.stop(runner); Matter.Runner.stop(runner);
window.clearInterval(intervalId); window.clearInterval(intervalId);
} },
}; };
} }

View File

@ -8,7 +8,7 @@ export function pleaseLogin(path?: string) {
popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), { popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
autoSet: true, autoSet: true,
message: i18n.ts.signinRequired message: i18n.ts.signinRequired,
}, { }, {
cancelled: () => { cancelled: () => {
if (path) { if (path) {

View File

@ -15,7 +15,7 @@ class ReactionPicker {
await popup(defineAsyncComponent(() => import('@/components/MkEmojiPickerDialog.vue')), { await popup(defineAsyncComponent(() => import('@/components/MkEmojiPickerDialog.vue')), {
src: this.src, src: this.src,
asReactionPicker: true, asReactionPicker: true,
manualShowing: this.manualShowing manualShowing: this.manualShowing,
}, { }, {
done: reaction => { done: reaction => {
this.onChosen!(reaction); this.onChosen!(reaction);
@ -26,7 +26,7 @@ class ReactionPicker {
closed: () => { closed: () => {
this.src.value = null; this.src.value = null;
this.onClosed!(); this.onClosed!();
} },
}); });
} }

View File

@ -5,6 +5,6 @@ export function showSuspendedDialog() {
return os.alert({ return os.alert({
type: 'error', type: 'error',
title: i18n.ts.yourAccountSuspendedTitle, title: i18n.ts.yourAccountSuspendedTitle,
text: i18n.ts.yourAccountSuspendedDescription text: i18n.ts.yourAccountSuspendedDescription,
}); });
} }

View File

@ -61,7 +61,7 @@ export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: st
return { return {
id: uuid(), id: uuid(),
name, desc, author, props, base name, desc, author, props, base,
}; };
}; };

View File

@ -60,8 +60,8 @@ export function useNoteCapture(props: {
...choices[choice], ...choices[choice],
votes: choices[choice].votes + 1, votes: choices[choice].votes + 1,
...($i && (body.userId === $i.id) ? { ...($i && (body.userId === $i.id) ? {
isVoted: true isVoted: true,
} : {}) } : {}),
}; };
note.value.poll.choices = choices; note.value.poll.choices = choices;

View File

@ -14,13 +14,13 @@ import XWidgets from '@/components/MkWidgets.vue';
export default defineComponent({ export default defineComponent({
components: { components: {
XWidgets XWidgets,
}, },
props: { props: {
place: { place: {
type: String, type: String,
} },
}, },
emits: ['mounted'], emits: ['mounted'],
@ -57,10 +57,10 @@ export default defineComponent({
updateWidgets(widgets) { updateWidgets(widgets) {
this.$store.set('widgets', [ this.$store.set('widgets', [
...this.$store.state.widgets.filter(w => w.place !== this.place), ...this.$store.state.widgets.filter(w => w.place !== this.place),
...widgets ...widgets,
]); ]);
} },
} },
}); });
</script> </script>

View File

@ -25,7 +25,7 @@ const pagination = {
endpoint: 'notes/mentions' as const, endpoint: 'notes/mentions' as const,
limit: 10, limit: 10,
params: { params: {
visibility: 'specified' visibility: 'specified',
}, },
}; };
</script> </script>

View File

@ -47,7 +47,7 @@ props.activity.slice().forEach((d, i) => {
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth(),
day: date.getDate(), day: date.getDate(),
weekday: date.getDay() weekday: date.getDay(),
}; };
d.v = peak === 0 ? 0 : d.total / (peak / 2); d.v = peak === 0 ? 0 : d.total / (peak / 2);

View File

@ -100,7 +100,7 @@ onMounted(() => {
props.connection.on('stats', onStats); props.connection.on('stats', onStats);
props.connection.on('statsLog', onStatsLog); props.connection.on('statsLog', onStatsLog);
props.connection.send('requestLog', { props.connection.send('requestLog', {
id: Math.random().toString().substr(2, 8) id: Math.random().toString().substr(2, 8),
}); });
}); });

View File

@ -70,7 +70,7 @@ onMounted(() => {
props.connection.on('stats', onStats); props.connection.on('stats', onStats);
props.connection.on('statsLog', onStatsLog); props.connection.on('statsLog', onStatsLog);
props.connection.send('requestLog', { props.connection.send('requestLog', {
id: Math.random().toString().substr(2, 8) id: Math.random().toString().substr(2, 8),
}); });
}); });

View File

@ -82,7 +82,7 @@ const choose = async (ev) => {
menuOpened.value = true; menuOpened.value = true;
const [antennas, lists] = await Promise.all([ const [antennas, lists] = await Promise.all([
os.api('antennas/list'), os.api('antennas/list'),
os.api('users/lists/list') os.api('users/lists/list'),
]); ]);
const antennaItems = antennas.map(antenna => ({ const antennaItems = antennas.map(antenna => ({
text: antenna.name, text: antenna.name,
@ -90,7 +90,7 @@ const choose = async (ev) => {
action: () => { action: () => {
widgetProps.antenna = antenna; widgetProps.antenna = antenna;
setSrc('antenna'); setSrc('antenna');
} },
})); }));
const listItems = lists.map(list => ({ const listItems = lists.map(list => ({
text: list.name, text: list.name,
@ -98,24 +98,24 @@ const choose = async (ev) => {
action: () => { action: () => {
widgetProps.list = list; widgetProps.list = list;
setSrc('list'); setSrc('list');
} },
})); }));
os.popupMenu([{ os.popupMenu([{
text: i18n.ts._timelines.home, text: i18n.ts._timelines.home,
icon: 'ti ti-home', icon: 'ti ti-home',
action: () => { setSrc('home'); } action: () => { setSrc('home'); },
}, { }, {
text: i18n.ts._timelines.local, text: i18n.ts._timelines.local,
icon: 'ti ti-messages', icon: 'ti ti-messages',
action: () => { setSrc('local'); } action: () => { setSrc('local'); },
}, { }, {
text: i18n.ts._timelines.social, text: i18n.ts._timelines.social,
icon: 'ti ti-share', icon: 'ti ti-share',
action: () => { setSrc('social'); } action: () => { setSrc('social'); },
}, { }, {
text: i18n.ts._timelines.global, text: i18n.ts._timelines.global,
icon: 'ti ti-world', icon: 'ti ti-world',
action: () => { setSrc('global'); } action: () => { setSrc('global'); },
}, antennaItems.length > 0 ? null : undefined, ...antennaItems, listItems.length > 0 ? null : undefined, ...listItems], ev.currentTarget ?? ev.target).then(() => { }, antennaItems.length > 0 ? null : undefined, ...antennaItems, listItems.length > 0 ? null : undefined, ...listItems], ev.currentTarget ?? ev.target).then(() => {
menuOpened.value = false; menuOpened.value = false;
}); });