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 => {
os.alert({
type: 'success',
text: i18n.ts.abuseReported
text: i18n.ts.abuseReported,
});
uiWindow.value?.close();
emit('closed');

View File

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

View File

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

View File

@ -25,7 +25,7 @@ const label = computed(() => {
return concat([
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.poll != null ? [i18n.ts.poll] : []
props.note.poll != null ? [i18n.ts.poll] : [],
] as string[][]).join(' / ');
});

View File

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

View File

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

View File

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

View File

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

View File

@ -51,7 +51,7 @@ export default defineComponent({
text: '',
flag: true,
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: {
type: 'boolean',
default: true,
label: 'This is a boolean property'
label: 'This is a boolean property',
},
bar: {
type: 'number',
default: 300,
label: 'This is a number property'
label: 'This is a number property',
},
baz: {
type: 'string',
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) {
os.popupMenu([{
type: 'label',
text: 'Fruits'
text: 'Fruits',
}, {
text: 'Create some apples',
action: () => {},
@ -111,6 +111,6 @@ export default defineComponent({
action: () => {},
}], ev.currentTarget ?? ev.target);
},
}
},
});
</script>

View File

@ -24,21 +24,21 @@ import { Block } from '@/scripts/hpml/block';
export default defineComponent({
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: {
block: {
type: Object as PropType<Block>,
required: true
required: true,
},
hpml: {
type: Object as PropType<Hpml>,
required: true
required: true,
},
h: {
type: Number,
required: true
}
required: true,
},
},
});
</script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ export function install(plugin) {
const aiscript = new AiScript(createPluginEnv({
plugin: plugin,
storageKey: 'plugins:' + plugin.id
storageKey: 'plugins:' + plugin.id,
}), {
in: (q) => {
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]) => {
update(key.value, value.value);
})]);
}
},
});
}
@ -94,7 +94,7 @@ function registerUserAction({ pluginId, title, handler }) {
userActions.push({
title, handler: (user) => {
pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(user)]);
}
},
});
}
@ -102,7 +102,7 @@ function registerNoteAction({ pluginId, title, handler }) {
noteActions.push({
title, handler: (note) => {
pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]);
}
},
});
}
@ -110,7 +110,7 @@ function registerNoteViewInterruptor({ pluginId, handler }) {
noteViewInterruptors.push({
handler: async (note) => {
return utils.valToJs(await pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]));
}
},
});
}
@ -118,6 +118,6 @@ function registerNotePostInterruptor({ pluginId, handler }) {
notePostInterruptors.push({
handler: async (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(
string
.replace(/-/g, '+')
.replace(/_/g, '/')
.replace(/_/g, '/'),
),
c => c.charCodeAt(0)
c => c.charCodeAt(0),
);
case 'hex':
return new Uint8Array(
string
.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))
.reduce(
(str, byte) => str + byte.toString(16).padStart(2, '0'),
''
'',
);
}

View File

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

View File

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

View File

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

View File

@ -25,6 +25,6 @@ export async function genSearchQuery(v: any, q: string) {
return {
query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '),
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があるので
return `${instanceUrl}/proxy/${dummy}?${url.query({
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 = {
patterns: [],
callback,
allowRepeat: true
allowRepeat: true,
} as Action;
if (patterns.match(/^\(.*\)$/) !== null) {
@ -34,7 +34,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
which: [],
ctrl: false,
alt: false,
shift: false
shift: false,
} as Pattern;
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.shift === ev.shiftKey &&
pattern.alt === ev.altKey &&
!ev.metaKey
!ev.metaKey,
);
}

View File

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

View File

@ -14,22 +14,22 @@ export type Fn = {
export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null;
export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = {
text: { out: 'string', category: 'value', icon: 'ti ti-quote', },
multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', },
textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', },
number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', },
ref: { out: null, category: 'value', icon: 'fas fa-magic', },
aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic', },
fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt', },
text: { out: 'string', category: 'value', icon: 'ti ti-quote' },
multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left' },
textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list' },
number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up' },
ref: { out: null, category: 'value', icon: 'fas fa-magic' },
aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic' },
fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt' },
};
export const blockDefs = [
...Object.entries(literalDefs).map(([k, v]) => ({
type: k, out: v.out, category: v.category, icon: v.icon
type: k, out: v.out, category: v.category, icon: v.icon,
})),
...Object.entries(funcDefs).map(([k, v]) => ({
type: k, out: v.out, category: v.category, icon: v.icon
}))
type: k, out: v.out, category: v.category, icon: v.icon,
})),
];
export type PageVar = { name: string; value: any; type: Type; };
@ -82,7 +82,7 @@ export class HpmlScope {
throw new HpmlError(
`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) {
os.alert({
type: 'error',
text: i18n.ts.noSuchUser
text: i18n.ts.noSuchUser,
});
} else {
_notFound = true;

View File

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

View File

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

View File

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

View File

@ -5,6 +5,6 @@ export function showSuspendedDialog() {
return os.alert({
type: 'error',
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 {
id: uuid(),
name, desc, author, props, base
name, desc, author, props, base,
};
};

View File

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

View File

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

View File

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

View File

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

View File

@ -100,7 +100,7 @@ onMounted(() => {
props.connection.on('stats', onStats);
props.connection.on('statsLog', onStatsLog);
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('statsLog', onStatsLog);
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;
const [antennas, lists] = await Promise.all([
os.api('antennas/list'),
os.api('users/lists/list')
os.api('users/lists/list'),
]);
const antennaItems = antennas.map(antenna => ({
text: antenna.name,
@ -90,7 +90,7 @@ const choose = async (ev) => {
action: () => {
widgetProps.antenna = antenna;
setSrc('antenna');
}
},
}));
const listItems = lists.map(list => ({
text: list.name,
@ -98,24 +98,24 @@ const choose = async (ev) => {
action: () => {
widgetProps.list = list;
setSrc('list');
}
},
}));
os.popupMenu([{
text: i18n.ts._timelines.home,
icon: 'ti ti-home',
action: () => { setSrc('home'); }
action: () => { setSrc('home'); },
}, {
text: i18n.ts._timelines.local,
icon: 'ti ti-messages',
action: () => { setSrc('local'); }
action: () => { setSrc('local'); },
}, {
text: i18n.ts._timelines.social,
icon: 'ti ti-share',
action: () => { setSrc('social'); }
action: () => { setSrc('social'); },
}, {
text: i18n.ts._timelines.global,
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(() => {
menuOpened.value = false;
});