chore: format
This commit is contained in:
parent
7787205358
commit
61ab0e8093
15 changed files with 40 additions and 44 deletions
|
@ -1048,8 +1048,9 @@ async function post() {
|
|||
|
||||
if (postAccount.value) {
|
||||
const storedAccounts = await getAccounts();
|
||||
token = storedAccounts.find((x) => x.id === postAccount.value.id)
|
||||
?.token;
|
||||
token = storedAccounts.find(
|
||||
(x) => x.id === postAccount.value.id,
|
||||
)?.token;
|
||||
}
|
||||
|
||||
posting.value = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(src, binding, vn) {
|
||||
const getBgColor = (el: HTMLElement) => {
|
||||
const style = window.getComputedStyle(el);
|
||||
|
@ -26,4 +26,4 @@ export default ({
|
|||
src.style.borderColor = myBg;
|
||||
}
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
beforeMount(src, binding, vn) {
|
||||
src.style.opacity = "0";
|
||||
src.style.transform = "scale(0.9)";
|
||||
|
@ -15,4 +15,4 @@ export default ({
|
|||
src.style.transform = "none";
|
||||
}, 1);
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(src, binding, vn) {
|
||||
const fn = binding.value;
|
||||
if (fn == null) return;
|
||||
|
@ -19,4 +19,4 @@ export default ({
|
|||
unmounted(src, binding, vn) {
|
||||
if (src._observer_) src._observer_.disconnect();
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { Directive } from "vue";
|
||||
// import { defaultStore } from "@/store";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(el, binding, vn) {
|
||||
/*
|
||||
if (!defaultStore.state.animation) return;
|
||||
|
@ -28,4 +28,4 @@ export default ({
|
|||
});
|
||||
*/
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { getScrollContainer, getScrollPosition } from "@/scripts/scroll";
|
||||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(src, binding, vn) {
|
||||
if (binding.value === false) return;
|
||||
|
||||
|
@ -36,4 +36,4 @@ export default ({
|
|||
unmounted(src, binding, vn) {
|
||||
if (src._ro_) src._ro_.unobserve(src);
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -35,7 +35,7 @@ function calc(src: Element) {
|
|||
info.fn(width, height);
|
||||
}
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(src, binding, vn) {
|
||||
const resize = new ResizeObserver((entries, observer) => {
|
||||
calc(src);
|
||||
|
@ -54,4 +54,4 @@ export default ({
|
|||
if (info.intersection) info.intersection.disconnect();
|
||||
mountings.delete(src);
|
||||
},
|
||||
} as Directive<Element, (w: number, h: number) => void>);
|
||||
} as Directive<Element, (w: number, h: number) => void>;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { makeHotkey } from "@/scripts/hotkey";
|
||||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
el._hotkey_global = binding.modifiers.global === true;
|
||||
|
||||
|
@ -21,4 +21,4 @@ export default ({
|
|||
el.removeEventListener("keydown", el._keyHandler);
|
||||
}
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(src, binding, vn) {
|
||||
const getBgColor = (el: HTMLElement) => {
|
||||
const style = window.getComputedStyle(el);
|
||||
|
@ -28,4 +28,4 @@ export default ({
|
|||
src.style.backgroundColor = "var(--panel)";
|
||||
}
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -88,7 +88,7 @@ function calc(el: Element) {
|
|||
}
|
||||
}
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(src, binding, vn) {
|
||||
const resize = new ResizeObserver((entries, observer) => {
|
||||
calc(src);
|
||||
|
@ -119,4 +119,4 @@ export default ({
|
|||
if (info.intersection) info.intersection.disconnect();
|
||||
mountings.delete(src);
|
||||
},
|
||||
} as Directive<Element, Value>);
|
||||
} as Directive<Element, Value>;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { defineAsyncComponent, ref } from "vue";
|
|||
const start = isTouchUsing ? "touchstart" : "mouseover";
|
||||
const end = isTouchUsing ? "touchend" : "mouseleave";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(el: HTMLElement, binding, vn) {
|
||||
const delay = binding.modifiers.noDelay ? 0 : 100;
|
||||
|
||||
|
@ -119,4 +119,4 @@ export default ({
|
|||
window.clearInterval(self.checkTimer);
|
||||
self.close();
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -104,7 +104,7 @@ export class UserPreview {
|
|||
}
|
||||
}
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(el: HTMLElement, binding, vn) {
|
||||
if (binding.value == null) return;
|
||||
|
||||
|
@ -121,4 +121,4 @@ export default ({
|
|||
const self = el._userPreviewDirective_;
|
||||
self.preview.detach();
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { vibrate } from "@/scripts/vibrate";
|
||||
import type { Directive } from "vue";
|
||||
|
||||
export default ({
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
const pattern = (binding.value as VibratePattern) ?? 20;
|
||||
el.addEventListener("mousedown", () => {
|
||||
vibrate(pattern);
|
||||
});
|
||||
},
|
||||
} as Directive);
|
||||
} as Directive;
|
||||
|
|
|
@ -80,15 +80,13 @@ function createPluginEnv(opts) {
|
|||
});
|
||||
}),
|
||||
// #endregion
|
||||
"Plugin:register_post_form_action": values.FN_NATIVE(
|
||||
([title, handler]) => {
|
||||
registerPostFormAction({
|
||||
pluginId: opts.plugin.id,
|
||||
title: title.value,
|
||||
handler,
|
||||
});
|
||||
},
|
||||
),
|
||||
"Plugin:register_post_form_action": values.FN_NATIVE(([title, handler]) => {
|
||||
registerPostFormAction({
|
||||
pluginId: opts.plugin.id,
|
||||
title: title.value,
|
||||
handler,
|
||||
});
|
||||
}),
|
||||
"Plugin:register_user_action": values.FN_NATIVE(([title, handler]) => {
|
||||
registerUserAction({
|
||||
pluginId: opts.plugin.id,
|
||||
|
|
|
@ -17,13 +17,10 @@ export function extractUrlFromMfm(
|
|||
});
|
||||
const urls: string[] = unique(urlNodes.map((x) => x.props.url));
|
||||
|
||||
return urls.reduce(
|
||||
(array, url) => {
|
||||
const urlWithoutHash = removeHash(url);
|
||||
if (!array.map((x) => removeHash(x)).includes(urlWithoutHash))
|
||||
array.push(url);
|
||||
return array;
|
||||
},
|
||||
[] as string[],
|
||||
);
|
||||
return urls.reduce((array, url) => {
|
||||
const urlWithoutHash = removeHash(url);
|
||||
if (!array.map((x) => removeHash(x)).includes(urlWithoutHash))
|
||||
array.push(url);
|
||||
return array;
|
||||
}, [] as string[]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue