move scripts

This commit is contained in:
kakkokari-gtyih 2024-07-09 19:15:23 +09:00
parent aaf02d575f
commit 434089521a
7 changed files with 8 additions and 7 deletions

View File

@ -39,7 +39,7 @@ import XVideo from '@/components/MkMediaVideo.vue';
import * as os from '@/os.js';
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
import { defaultStore } from '@/store.js';
import { focusParent } from '@/scripts/tms/focus.js';
import { focusParent } from '@/scripts/focus.js';
const props = defineProps<{
mediaList: Misskey.entities.DriveFile[];

View File

@ -108,8 +108,8 @@ import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { isTouchUsing } from '@/scripts/touch.js';
import { type Keymap } from '@/scripts/hotkey.js';
import { focusParent, isFocusable } from '@/scripts/tms/focus.js';
import { getNodeOrNull } from '@/scripts/tms/get-or-null.js';
import { focusParent, isFocusable } from '@/scripts/focus.js';
import { getNodeOrNull } from '@/scripts/get-or-null.js';
const childrenCache = new WeakMap<MenuParent, MenuItem[]>();
</script>

View File

@ -198,7 +198,7 @@ import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
import { shouldCollapsed } from '@/scripts/collapsed.js';
import { isEnabledUrlPreview } from '@/instance.js';
import { type Keymap } from '@/scripts/hotkey.js';
import { focusPrev, focusNext } from '@/scripts/tms/focus.js';
import { focusPrev, focusNext } from '@/scripts/focus.js';
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;

View File

@ -24,7 +24,7 @@ import MkContextMenu from '@/components/MkContextMenu.vue';
import { MenuItem } from '@/types/menu.js';
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
import { getHTMLElementOrNull } from '@/scripts/tms/get-or-null.js';
import { getHTMLElementOrNull } from '@/scripts/get-or-null.js';
export const openingWindowsCount = ref(0);

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { getElementOrNull, getNodeOrNull } from '@/scripts/tms/get-or-null.js';
import { getElementOrNull, getNodeOrNull } from '@/scripts/get-or-null.js';
type MaybeHTMLElement = EventTarget | Node | Element | HTMLElement;

View File

@ -2,6 +2,7 @@
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { getHTMLElementOrNull } from "@/scripts/get-or-null.js";
//#region types
export type Keymap = Record<string, CallbackFunction | CallbackObject>;
@ -55,7 +56,7 @@ export const makeHotkey = (keymap: Keymap) => {
if ('pswp' in window && window.pswp != null) return;
if (document.activeElement != null) {
if (IGNORE_ELEMENTS.includes(document.activeElement.tagName.toLowerCase())) return;
if ((document.activeElement as HTMLElement).isContentEditable) return;
if (getHTMLElementOrNull(document.activeElement)?.isContentEditable) return;
}
for (const action of actions) {
if (matchPatterns(ev, action)) {