2018-02-14 08:54:18 +02:00
|
|
|
<template>
|
2020-01-29 21:37:25 +02:00
|
|
|
<div class="yfudmmck">
|
2017-01-11 22:55:38 +02:00
|
|
|
<nav>
|
2018-02-14 08:54:18 +02:00
|
|
|
<div class="path" @contextmenu.prevent.stop="() => {}">
|
2022-01-18 16:06:16 +02:00
|
|
|
<XNavFolder
|
|
|
|
:class="{ current: folder == null }"
|
|
|
|
:parent-folder="folder"
|
|
|
|
@move="move"
|
|
|
|
@upload="upload"
|
2022-12-22 09:51:48 +02:00
|
|
|
@remove-file="removeFile"
|
|
|
|
@remove-folder="removeFolder"
|
2022-01-18 16:06:16 +02:00
|
|
|
/>
|
2020-04-21 18:34:56 +03:00
|
|
|
<template v-for="f in hierarchyFolders">
|
2022-12-19 12:01:30 +02:00
|
|
|
<span class="separator"><i class="ti ti-chevron-right"></i></span>
|
2022-01-18 16:06:16 +02:00
|
|
|
<XNavFolder
|
|
|
|
:folder="f"
|
|
|
|
:parent-folder="folder"
|
|
|
|
@move="move"
|
|
|
|
@upload="upload"
|
2022-12-22 09:51:48 +02:00
|
|
|
@remove-file="removeFile"
|
|
|
|
@remove-folder="removeFolder"
|
2022-01-18 16:06:16 +02:00
|
|
|
/>
|
2018-02-08 07:50:18 +02:00
|
|
|
</template>
|
2022-12-19 12:01:30 +02:00
|
|
|
<span v-if="folder != null" class="separator"><i class="ti ti-chevron-right"></i></span>
|
2021-11-19 12:36:12 +02:00
|
|
|
<span v-if="folder != null" class="folder current">{{ folder.name }}</span>
|
2017-01-11 22:55:38 +02:00
|
|
|
</div>
|
2022-12-19 12:01:30 +02:00
|
|
|
<button class="menu _button" @click="showMenu"><i class="ti ti-dots"></i></button>
|
2017-01-11 22:55:38 +02:00
|
|
|
</nav>
|
2022-07-15 13:15:23 +03:00
|
|
|
<div
|
|
|
|
ref="main" class="main"
|
2021-11-19 12:36:12 +02:00
|
|
|
:class="{ uploading: uploadings.length > 0, fetching }"
|
2018-02-14 08:54:18 +02:00
|
|
|
@dragover.prevent.stop="onDragover"
|
2018-02-26 23:35:16 +02:00
|
|
|
@dragenter="onDragenter"
|
2018-02-14 08:54:18 +02:00
|
|
|
@dragleave="onDragleave"
|
|
|
|
@drop.prevent.stop="onDrop"
|
2021-01-11 11:49:39 +02:00
|
|
|
@contextmenu.stop="onContextmenu"
|
2018-02-14 08:54:18 +02:00
|
|
|
>
|
2021-11-19 12:36:12 +02:00
|
|
|
<div ref="contents" class="contents">
|
|
|
|
<div v-show="folders.length > 0" ref="foldersContainer" class="folders">
|
2022-01-18 16:06:16 +02:00
|
|
|
<XFolder
|
|
|
|
v-for="(f, i) in folders"
|
|
|
|
:key="f.id"
|
|
|
|
v-anim="i"
|
|
|
|
class="folder"
|
|
|
|
:folder="f"
|
|
|
|
:select-mode="select === 'folder'"
|
|
|
|
:is-selected="selectedFolders.some(x => x.id === f.id)"
|
|
|
|
@chosen="chooseFolder"
|
|
|
|
@move="move"
|
|
|
|
@upload="upload"
|
2022-12-22 09:51:48 +02:00
|
|
|
@remove-file="removeFile"
|
|
|
|
@remove-folder="removeFolder"
|
2022-01-18 16:06:16 +02:00
|
|
|
@dragstart="isDragSource = true"
|
|
|
|
@dragend="isDragSource = false"
|
|
|
|
/>
|
2017-12-19 06:18:17 +02:00
|
|
|
<!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid -->
|
2021-11-19 12:36:12 +02:00
|
|
|
<div v-for="(n, i) in 16" :key="i" class="padding"></div>
|
2022-01-28 04:39:49 +02:00
|
|
|
<MkButton v-if="moreFolders" ref="moreFolders">{{ i18n.ts.loadMore }}</MkButton>
|
2017-01-11 22:55:38 +02:00
|
|
|
</div>
|
2021-11-19 12:36:12 +02:00
|
|
|
<div v-show="files.length > 0" ref="filesContainer" class="files">
|
2022-01-18 16:06:16 +02:00
|
|
|
<XFile
|
|
|
|
v-for="(file, i) in files"
|
|
|
|
:key="file.id"
|
|
|
|
v-anim="i"
|
|
|
|
class="file"
|
|
|
|
:file="file"
|
|
|
|
:select-mode="select === 'file'"
|
|
|
|
:is-selected="selectedFiles.some(x => x.id === file.id)"
|
|
|
|
@chosen="chooseFile"
|
|
|
|
@dragstart="isDragSource = true"
|
|
|
|
@dragend="isDragSource = false"
|
|
|
|
/>
|
2017-12-19 06:18:17 +02:00
|
|
|
<!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid -->
|
2021-11-19 12:36:12 +02:00
|
|
|
<div v-for="(n, i) in 16" :key="i" class="padding"></div>
|
2022-01-28 04:39:49 +02:00
|
|
|
<MkButton v-show="moreFiles" ref="loadMoreFiles" @click="fetchMoreFiles">{{ i18n.ts.loadMore }}</MkButton>
|
2017-01-11 22:55:38 +02:00
|
|
|
</div>
|
2021-11-19 12:36:12 +02:00
|
|
|
<div v-if="files.length == 0 && folders.length == 0 && !fetching" class="empty">
|
2022-01-18 16:06:16 +02:00
|
|
|
<p v-if="draghover">{{ i18n.t('empty-draghover') }}</p>
|
2022-01-28 04:39:49 +02:00
|
|
|
<p v-if="!draghover && folder == null"><strong>{{ i18n.ts.emptyDrive }}</strong><br/>{{ i18n.t('empty-drive-description') }}</p>
|
|
|
|
<p v-if="!draghover && folder != null">{{ i18n.ts.emptyFolder }}</p>
|
2016-12-29 00:49:51 +02:00
|
|
|
</div>
|
2017-01-11 22:55:38 +02:00
|
|
|
</div>
|
2020-10-17 14:12:00 +03:00
|
|
|
<MkLoading v-if="fetching"/>
|
2017-01-11 22:55:38 +02:00
|
|
|
</div>
|
2021-11-19 12:36:12 +02:00
|
|
|
<div v-if="draghover" class="dropzone"></div>
|
2022-01-18 16:06:16 +02:00
|
|
|
<input ref="fileInput" type="file" accept="*/*" multiple tabindex="-1" @change="onChangeFileInput"/>
|
2018-02-14 08:54:18 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { markRaw, nextTick, onActivated, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
|
|
import * as Misskey from 'misskey-js';
|
2022-09-06 12:21:49 +03:00
|
|
|
import MkButton from './MkButton.vue';
|
2022-08-30 18:24:33 +03:00
|
|
|
import XNavFolder from '@/components/MkDrive.navFolder.vue';
|
|
|
|
import XFolder from '@/components/MkDrive.folder.vue';
|
|
|
|
import XFile from '@/components/MkDrive.file.vue';
|
2021-11-11 19:02:25 +02:00
|
|
|
import * as os from '@/os';
|
2021-12-29 15:13:09 +02:00
|
|
|
import { stream } from '@/stream';
|
2022-01-18 16:06:16 +02:00
|
|
|
import { defaultStore } from '@/store';
|
|
|
|
import { i18n } from '@/i18n';
|
2022-04-28 05:14:03 +03:00
|
|
|
import { uploadFile, uploads } from '@/scripts/upload';
|
2022-01-18 16:06:16 +02:00
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
initialFolder?: Misskey.entities.DriveFolder;
|
|
|
|
type?: string;
|
|
|
|
multiple?: boolean;
|
|
|
|
select?: 'file' | 'folder' | null;
|
|
|
|
}>(), {
|
|
|
|
multiple: false,
|
|
|
|
select: null,
|
|
|
|
});
|
2018-02-14 08:54:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
const emit = defineEmits<{
|
2022-05-05 14:45:50 +03:00
|
|
|
(ev: 'selected', v: Misskey.entities.DriveFile | Misskey.entities.DriveFolder): void;
|
|
|
|
(ev: 'change-selection', v: Misskey.entities.DriveFile[] | Misskey.entities.DriveFolder[]): void;
|
|
|
|
(ev: 'move-root'): void;
|
|
|
|
(ev: 'cd', v: Misskey.entities.DriveFolder | null): void;
|
|
|
|
(ev: 'open-folder', v: Misskey.entities.DriveFolder): void;
|
2022-01-18 16:06:16 +02:00
|
|
|
}>();
|
|
|
|
|
|
|
|
const loadMoreFiles = ref<InstanceType<typeof MkButton>>();
|
|
|
|
const fileInput = ref<HTMLInputElement>();
|
|
|
|
|
|
|
|
const folder = ref<Misskey.entities.DriveFolder | null>(null);
|
|
|
|
const files = ref<Misskey.entities.DriveFile[]>([]);
|
|
|
|
const folders = ref<Misskey.entities.DriveFolder[]>([]);
|
|
|
|
const moreFiles = ref(false);
|
|
|
|
const moreFolders = ref(false);
|
|
|
|
const hierarchyFolders = ref<Misskey.entities.DriveFolder[]>([]);
|
|
|
|
const selectedFiles = ref<Misskey.entities.DriveFile[]>([]);
|
|
|
|
const selectedFolders = ref<Misskey.entities.DriveFolder[]>([]);
|
2022-04-28 05:14:03 +03:00
|
|
|
const uploadings = uploads;
|
2022-01-18 16:06:16 +02:00
|
|
|
const connection = stream.useChannel('drive');
|
2022-04-28 05:14:03 +03:00
|
|
|
const keepOriginal = ref<boolean>(defaultStore.state.keepOriginalUploading); // 外部渡しが多いので$refは使わないほうがよい
|
2022-01-18 16:06:16 +02:00
|
|
|
|
|
|
|
// ドロップされようとしているか
|
|
|
|
const draghover = ref(false);
|
|
|
|
|
|
|
|
// 自身の所有するアイテムがドラッグをスタートさせたか
|
|
|
|
// (自分自身の階層にドロップできないようにするためのフラグ)
|
|
|
|
const isDragSource = ref(false);
|
|
|
|
|
|
|
|
const fetching = ref(true);
|
|
|
|
|
|
|
|
const ilFilesObserver = new IntersectionObserver(
|
2022-07-15 13:15:23 +03:00
|
|
|
(entries) => entries.some((entry) => entry.isIntersecting) && !fetching.value && moreFiles.value && fetchMoreFiles(),
|
2022-06-10 08:36:55 +03:00
|
|
|
);
|
2022-01-18 16:06:16 +02:00
|
|
|
|
|
|
|
watch(folder, () => emit('cd', folder.value));
|
|
|
|
|
|
|
|
function onStreamDriveFileCreated(file: Misskey.entities.DriveFile) {
|
|
|
|
addFile(file, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onStreamDriveFileUpdated(file: Misskey.entities.DriveFile) {
|
|
|
|
const current = folder.value ? folder.value.id : null;
|
2022-05-05 14:45:50 +03:00
|
|
|
if (current !== file.folderId) {
|
2022-01-18 16:06:16 +02:00
|
|
|
removeFile(file);
|
|
|
|
} else {
|
|
|
|
addFile(file, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onStreamDriveFileDeleted(fileId: string) {
|
|
|
|
removeFile(fileId);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onStreamDriveFolderCreated(createdFolder: Misskey.entities.DriveFolder) {
|
|
|
|
addFolder(createdFolder, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onStreamDriveFolderUpdated(updatedFolder: Misskey.entities.DriveFolder) {
|
|
|
|
const current = folder.value ? folder.value.id : null;
|
2022-05-05 14:45:50 +03:00
|
|
|
if (current !== updatedFolder.parentId) {
|
2022-01-18 16:06:16 +02:00
|
|
|
removeFolder(updatedFolder);
|
|
|
|
} else {
|
|
|
|
addFolder(updatedFolder, true);
|
|
|
|
}
|
|
|
|
}
|
2020-05-31 06:53:06 +03:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function onStreamDriveFolderDeleted(folderId: string) {
|
|
|
|
removeFolder(folderId);
|
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-05-05 14:45:50 +03:00
|
|
|
function onDragover(ev: DragEvent): any {
|
|
|
|
if (!ev.dataTransfer) return;
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
// ドラッグ元が自分自身の所有するアイテムだったら
|
|
|
|
if (isDragSource.value) {
|
|
|
|
// 自分自身にはドロップさせない
|
2022-05-05 14:45:50 +03:00
|
|
|
ev.dataTransfer.dropEffect = 'none';
|
2022-01-18 16:06:16 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-05-31 06:53:06 +03:00
|
|
|
|
2022-05-05 14:45:50 +03:00
|
|
|
const isFile = ev.dataTransfer.items[0].kind === 'file';
|
|
|
|
const isDriveFile = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FILE_;
|
|
|
|
const isDriveFolder = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FOLDER_;
|
2022-01-18 16:06:16 +02:00
|
|
|
if (isFile || isDriveFile || isDriveFolder) {
|
2022-10-13 02:34:23 +03:00
|
|
|
switch (ev.dataTransfer.effectAllowed) {
|
|
|
|
case 'all':
|
|
|
|
case 'uninitialized':
|
|
|
|
case 'copy':
|
|
|
|
case 'copyLink':
|
|
|
|
case 'copyMove':
|
|
|
|
ev.dataTransfer.dropEffect = 'copy';
|
|
|
|
break;
|
|
|
|
case 'linkMove':
|
|
|
|
case 'move':
|
|
|
|
ev.dataTransfer.dropEffect = 'move';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ev.dataTransfer.dropEffect = 'none';
|
|
|
|
break;
|
|
|
|
}
|
2022-01-18 16:06:16 +02:00
|
|
|
} else {
|
2022-05-05 14:45:50 +03:00
|
|
|
ev.dataTransfer.dropEffect = 'none';
|
2022-01-18 16:06:16 +02:00
|
|
|
}
|
2018-02-14 08:54:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
return false;
|
|
|
|
}
|
2018-02-14 08:54:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function onDragenter() {
|
|
|
|
if (!isDragSource.value) draghover.value = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDragleave() {
|
|
|
|
draghover.value = false;
|
|
|
|
}
|
|
|
|
|
2022-05-05 14:45:50 +03:00
|
|
|
function onDrop(ev: DragEvent): any {
|
2022-01-18 16:06:16 +02:00
|
|
|
draghover.value = false;
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-05-05 14:45:50 +03:00
|
|
|
if (!ev.dataTransfer) return;
|
2022-01-18 16:06:16 +02:00
|
|
|
|
|
|
|
// ドロップされてきたものがファイルだったら
|
2022-05-05 14:45:50 +03:00
|
|
|
if (ev.dataTransfer.files.length > 0) {
|
|
|
|
for (const file of Array.from(ev.dataTransfer.files)) {
|
2022-01-18 16:06:16 +02:00
|
|
|
upload(file, folder.value);
|
2020-05-31 06:53:06 +03:00
|
|
|
}
|
2022-01-18 16:06:16 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//#region ドライブのファイル
|
2022-05-05 14:45:50 +03:00
|
|
|
const driveFile = ev.dataTransfer.getData(_DATA_TRANSFER_DRIVE_FILE_);
|
|
|
|
if (driveFile != null && driveFile !== '') {
|
2022-01-18 16:06:16 +02:00
|
|
|
const file = JSON.parse(driveFile);
|
2022-05-05 14:45:50 +03:00
|
|
|
if (files.value.some(f => f.id === file.id)) return;
|
2022-01-18 16:06:16 +02:00
|
|
|
removeFile(file.id);
|
|
|
|
os.api('drive/files/update', {
|
|
|
|
fileId: file.id,
|
2022-07-15 13:15:23 +03:00
|
|
|
folderId: folder.value ? folder.value.id : null,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region ドライブのフォルダ
|
2022-05-05 14:45:50 +03:00
|
|
|
const driveFolder = ev.dataTransfer.getData(_DATA_TRANSFER_DRIVE_FOLDER_);
|
|
|
|
if (driveFolder != null && driveFolder !== '') {
|
2022-01-18 16:06:16 +02:00
|
|
|
const droppedFolder = JSON.parse(driveFolder);
|
|
|
|
|
|
|
|
// 移動先が自分自身ならreject
|
2022-05-05 14:45:50 +03:00
|
|
|
if (folder.value && droppedFolder.id === folder.value.id) return false;
|
|
|
|
if (folders.value.some(f => f.id === droppedFolder.id)) return false;
|
2022-01-18 16:06:16 +02:00
|
|
|
removeFolder(droppedFolder.id);
|
|
|
|
os.api('drive/folders/update', {
|
|
|
|
folderId: droppedFolder.id,
|
2022-07-15 13:15:23 +03:00
|
|
|
parentId: folder.value ? folder.value.id : null,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(() => {
|
|
|
|
// noop
|
|
|
|
}).catch(err => {
|
|
|
|
switch (err) {
|
|
|
|
case 'detected-circular-definition':
|
|
|
|
os.alert({
|
2022-01-28 04:39:49 +02:00
|
|
|
title: i18n.ts.unableToProcess,
|
2022-07-15 13:15:23 +03:00
|
|
|
text: i18n.ts.circularReferenceFolder,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
2022-07-15 13:15:23 +03:00
|
|
|
text: i18n.ts.somethingHappened,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
2017-02-21 02:49:35 +02:00
|
|
|
}
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectLocalFile() {
|
|
|
|
fileInput.value?.click();
|
|
|
|
}
|
|
|
|
|
|
|
|
function urlUpload() {
|
|
|
|
os.inputText({
|
2022-01-28 04:39:49 +02:00
|
|
|
title: i18n.ts.uploadFromUrl,
|
2022-01-18 16:06:16 +02:00
|
|
|
type: 'url',
|
2022-07-15 13:15:23 +03:00
|
|
|
placeholder: i18n.ts.uploadFromUrlDescription,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(({ canceled, result: url }) => {
|
|
|
|
if (canceled || !url) return;
|
|
|
|
os.api('drive/files/upload-from-url', {
|
|
|
|
url: url,
|
2022-07-15 13:15:23 +03:00
|
|
|
folderId: folder.value ? folder.value.id : undefined,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
os.alert({
|
2022-01-28 04:39:49 +02:00
|
|
|
title: i18n.ts.uploadFromUrlRequested,
|
2022-07-15 13:15:23 +03:00
|
|
|
text: i18n.ts.uploadFromUrlMayTakeTime,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function createFolder() {
|
|
|
|
os.inputText({
|
2022-01-28 04:39:49 +02:00
|
|
|
title: i18n.ts.createFolder,
|
2022-07-15 13:15:23 +03:00
|
|
|
placeholder: i18n.ts.folderName,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(({ canceled, result: name }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
os.api('drive/folders/create', {
|
|
|
|
name: name,
|
2022-07-15 13:15:23 +03:00
|
|
|
parentId: folder.value ? folder.value.id : undefined,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(createdFolder => {
|
|
|
|
addFolder(createdFolder, true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
|
|
|
|
os.inputText({
|
2022-01-28 04:39:49 +02:00
|
|
|
title: i18n.ts.renameFolder,
|
|
|
|
placeholder: i18n.ts.inputNewFolderName,
|
2022-07-15 13:15:23 +03:00
|
|
|
default: folderToRename.name,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(({ canceled, result: name }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
os.api('drive/folders/update', {
|
|
|
|
folderId: folderToRename.id,
|
2022-07-15 13:15:23 +03:00
|
|
|
name: name,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(updatedFolder => {
|
|
|
|
// FIXME: 画面を更新するために自分自身に移動
|
|
|
|
move(updatedFolder);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) {
|
|
|
|
os.api('drive/folders/delete', {
|
2022-07-15 13:15:23 +03:00
|
|
|
folderId: folderToDelete.id,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(() => {
|
|
|
|
// 削除時に親フォルダに移動
|
|
|
|
move(folderToDelete.parentId);
|
|
|
|
}).catch(err => {
|
2022-06-10 08:36:55 +03:00
|
|
|
switch (err.id) {
|
2022-01-18 16:06:16 +02:00
|
|
|
case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
2022-01-28 04:39:49 +02:00
|
|
|
title: i18n.ts.unableToDelete,
|
2022-07-15 13:15:23 +03:00
|
|
|
text: i18n.ts.hasChildFilesOrFolders,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
2022-07-15 13:15:23 +03:00
|
|
|
text: i18n.ts.unableToDelete,
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
2022-07-15 13:15:23 +03:00
|
|
|
}
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
}
|
2018-02-26 23:25:17 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function onChangeFileInput() {
|
|
|
|
if (!fileInput.value?.files) return;
|
|
|
|
for (const file of Array.from(fileInput.value.files)) {
|
|
|
|
upload(file, folder.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function upload(file: File, folderToUpload?: Misskey.entities.DriveFolder | null) {
|
2022-05-05 14:45:50 +03:00
|
|
|
uploadFile(file, (folderToUpload && typeof folderToUpload === 'object') ? folderToUpload.id : null, undefined, keepOriginal.value).then(res => {
|
2022-01-18 16:06:16 +02:00
|
|
|
addFile(res, true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function chooseFile(file: Misskey.entities.DriveFile) {
|
2022-05-05 14:45:50 +03:00
|
|
|
const isAlreadySelected = selectedFiles.value.some(f => f.id === file.id);
|
2022-01-18 16:06:16 +02:00
|
|
|
if (props.multiple) {
|
|
|
|
if (isAlreadySelected) {
|
2022-05-05 14:45:50 +03:00
|
|
|
selectedFiles.value = selectedFiles.value.filter(f => f.id !== file.id);
|
2022-01-18 16:06:16 +02:00
|
|
|
} else {
|
|
|
|
selectedFiles.value.push(file);
|
|
|
|
}
|
|
|
|
emit('change-selection', selectedFiles.value);
|
|
|
|
} else {
|
|
|
|
if (isAlreadySelected) {
|
|
|
|
emit('selected', file);
|
|
|
|
} else {
|
|
|
|
selectedFiles.value = [file];
|
|
|
|
emit('change-selection', [file]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-26 23:25:17 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function chooseFolder(folderToChoose: Misskey.entities.DriveFolder) {
|
2022-05-05 14:45:50 +03:00
|
|
|
const isAlreadySelected = selectedFolders.value.some(f => f.id === folderToChoose.id);
|
2022-01-18 16:06:16 +02:00
|
|
|
if (props.multiple) {
|
|
|
|
if (isAlreadySelected) {
|
2022-05-05 14:45:50 +03:00
|
|
|
selectedFolders.value = selectedFolders.value.filter(f => f.id !== folderToChoose.id);
|
2022-01-18 16:06:16 +02:00
|
|
|
} else {
|
|
|
|
selectedFolders.value.push(folderToChoose);
|
|
|
|
}
|
|
|
|
emit('change-selection', selectedFolders.value);
|
|
|
|
} else {
|
|
|
|
if (isAlreadySelected) {
|
|
|
|
emit('selected', folderToChoose);
|
|
|
|
} else {
|
|
|
|
selectedFolders.value = [folderToChoose];
|
|
|
|
emit('change-selection', [folderToChoose]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function move(target?: Misskey.entities.DriveFolder) {
|
|
|
|
if (!target) {
|
|
|
|
goRoot();
|
|
|
|
return;
|
2022-05-05 14:45:50 +03:00
|
|
|
} else if (typeof target === 'object') {
|
2022-01-18 16:06:16 +02:00
|
|
|
target = target.id;
|
|
|
|
}
|
2018-02-26 23:35:16 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
fetching.value = true;
|
2018-02-18 05:35:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
os.api('drive/folders/show', {
|
2022-07-15 13:15:23 +03:00
|
|
|
folderId: target,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(folderToMove => {
|
|
|
|
folder.value = folderToMove;
|
|
|
|
hierarchyFolders.value = [];
|
2018-02-18 05:35:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
const dive = folderToDive => {
|
|
|
|
hierarchyFolders.value.unshift(folderToDive);
|
|
|
|
if (folderToDive.parent) dive(folderToDive.parent);
|
|
|
|
};
|
2018-02-18 05:35:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
if (folderToMove.parent) dive(folderToMove.parent);
|
2017-01-11 22:55:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
emit('open-folder', folderToMove);
|
|
|
|
fetch();
|
|
|
|
});
|
|
|
|
}
|
2017-01-11 22:55:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function addFolder(folderToAdd: Misskey.entities.DriveFolder, unshift = false) {
|
|
|
|
const current = folder.value ? folder.value.id : null;
|
2022-05-05 14:45:50 +03:00
|
|
|
if (current !== folderToAdd.parentId) return;
|
2017-02-16 22:46:14 +02:00
|
|
|
|
2022-05-05 14:45:50 +03:00
|
|
|
if (folders.value.some(f => f.id === folderToAdd.id)) {
|
2022-01-18 16:06:16 +02:00
|
|
|
const exist = folders.value.map(f => f.id).indexOf(folderToAdd.id);
|
|
|
|
folders.value[exist] = folderToAdd;
|
|
|
|
return;
|
|
|
|
}
|
2020-02-08 06:09:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
if (unshift) {
|
|
|
|
folders.value.unshift(folderToAdd);
|
|
|
|
} else {
|
|
|
|
folders.value.push(folderToAdd);
|
|
|
|
}
|
|
|
|
}
|
2017-02-21 02:49:35 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function addFile(fileToAdd: Misskey.entities.DriveFile, unshift = false) {
|
|
|
|
const current = folder.value ? folder.value.id : null;
|
2022-05-05 14:45:50 +03:00
|
|
|
if (current !== fileToAdd.folderId) return;
|
2016-12-29 00:49:51 +02:00
|
|
|
|
2022-05-05 14:45:50 +03:00
|
|
|
if (files.value.some(f => f.id === fileToAdd.id)) {
|
2022-01-18 16:06:16 +02:00
|
|
|
const exist = files.value.map(f => f.id).indexOf(fileToAdd.id);
|
|
|
|
files.value[exist] = fileToAdd;
|
|
|
|
return;
|
|
|
|
}
|
2016-12-29 00:49:51 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
if (unshift) {
|
|
|
|
files.value.unshift(fileToAdd);
|
|
|
|
} else {
|
|
|
|
files.value.push(fileToAdd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function removeFolder(folderToRemove: Misskey.entities.DriveFolder | string) {
|
|
|
|
const folderIdToRemove = typeof folderToRemove === 'object' ? folderToRemove.id : folderToRemove;
|
2022-05-05 14:45:50 +03:00
|
|
|
folders.value = folders.value.filter(f => f.id !== folderIdToRemove);
|
2022-01-18 16:06:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function removeFile(file: Misskey.entities.DriveFile | string) {
|
|
|
|
const fileId = typeof file === 'object' ? file.id : file;
|
2022-05-05 14:45:50 +03:00
|
|
|
files.value = files.value.filter(f => f.id !== fileId);
|
2022-01-18 16:06:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function appendFile(file: Misskey.entities.DriveFile) {
|
|
|
|
addFile(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
function appendFolder(folderToAppend: Misskey.entities.DriveFolder) {
|
|
|
|
addFolder(folderToAppend);
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
function prependFile(file: Misskey.entities.DriveFile) {
|
|
|
|
addFile(file, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function prependFolder(folderToPrepend: Misskey.entities.DriveFolder) {
|
|
|
|
addFolder(folderToPrepend, true);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
function goRoot() {
|
|
|
|
// 既にrootにいるなら何もしない
|
|
|
|
if (folder.value == null) return;
|
|
|
|
|
|
|
|
folder.value = null;
|
|
|
|
hierarchyFolders.value = [];
|
|
|
|
emit('move-root');
|
|
|
|
fetch();
|
|
|
|
}
|
|
|
|
|
|
|
|
async function fetch() {
|
|
|
|
folders.value = [];
|
|
|
|
files.value = [];
|
|
|
|
moreFolders.value = false;
|
|
|
|
moreFiles.value = false;
|
|
|
|
fetching.value = true;
|
|
|
|
|
|
|
|
const foldersMax = 30;
|
|
|
|
const filesMax = 30;
|
|
|
|
|
|
|
|
const foldersPromise = os.api('drive/folders', {
|
|
|
|
folderId: folder.value ? folder.value.id : null,
|
2022-07-15 13:15:23 +03:00
|
|
|
limit: foldersMax + 1,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(fetchedFolders => {
|
2022-05-05 14:45:50 +03:00
|
|
|
if (fetchedFolders.length === foldersMax + 1) {
|
2022-01-18 16:06:16 +02:00
|
|
|
moreFolders.value = true;
|
|
|
|
fetchedFolders.pop();
|
|
|
|
}
|
|
|
|
return fetchedFolders;
|
|
|
|
});
|
|
|
|
|
|
|
|
const filesPromise = os.api('drive/files', {
|
|
|
|
folderId: folder.value ? folder.value.id : null,
|
|
|
|
type: props.type,
|
2022-07-15 13:15:23 +03:00
|
|
|
limit: filesMax + 1,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(fetchedFiles => {
|
2022-05-05 14:45:50 +03:00
|
|
|
if (fetchedFiles.length === filesMax + 1) {
|
2022-01-18 16:06:16 +02:00
|
|
|
moreFiles.value = true;
|
|
|
|
fetchedFiles.pop();
|
|
|
|
}
|
|
|
|
return fetchedFiles;
|
|
|
|
});
|
2016-12-29 00:49:51 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
const [fetchedFolders, fetchedFiles] = await Promise.all([foldersPromise, filesPromise]);
|
2017-01-11 22:55:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
for (const x of fetchedFolders) appendFolder(x);
|
|
|
|
for (const x of fetchedFiles) appendFile(x);
|
2018-02-18 05:35:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
fetching.value = false;
|
|
|
|
}
|
2017-01-11 22:55:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
function fetchMoreFiles() {
|
|
|
|
fetching.value = true;
|
2017-01-11 22:55:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
const max = 30;
|
2018-02-18 05:35:18 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
// ファイル一覧取得
|
|
|
|
os.api('drive/files', {
|
|
|
|
folderId: folder.value ? folder.value.id : null,
|
|
|
|
type: props.type,
|
|
|
|
untilId: files.value[files.value.length - 1].id,
|
2022-07-15 13:15:23 +03:00
|
|
|
limit: max + 1,
|
2022-01-18 16:06:16 +02:00
|
|
|
}).then(files => {
|
2022-05-05 14:45:50 +03:00
|
|
|
if (files.length === max + 1) {
|
2022-01-18 16:06:16 +02:00
|
|
|
moreFiles.value = true;
|
|
|
|
files.pop();
|
|
|
|
} else {
|
|
|
|
moreFiles.value = false;
|
|
|
|
}
|
|
|
|
for (const x of files) appendFile(x);
|
|
|
|
fetching.value = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getMenu() {
|
|
|
|
return [{
|
2022-04-28 05:14:03 +03:00
|
|
|
type: 'switch',
|
|
|
|
text: i18n.ts.keepOriginalUploading,
|
|
|
|
ref: keepOriginal,
|
|
|
|
}, null, {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: i18n.ts.addFile,
|
2022-07-15 13:15:23 +03:00
|
|
|
type: 'label',
|
2022-01-18 16:06:16 +02:00
|
|
|
}, {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: i18n.ts.upload,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-upload',
|
2022-07-15 13:15:23 +03:00
|
|
|
action: () => { selectLocalFile(); },
|
2022-01-18 16:06:16 +02:00
|
|
|
}, {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: i18n.ts.fromUrl,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-link',
|
2022-07-15 13:15:23 +03:00
|
|
|
action: () => { urlUpload(); },
|
2022-01-18 16:06:16 +02:00
|
|
|
}, null, {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: folder.value ? folder.value.name : i18n.ts.drive,
|
2022-07-15 13:15:23 +03:00
|
|
|
type: 'label',
|
2022-01-18 16:06:16 +02:00
|
|
|
}, folder.value ? {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: i18n.ts.renameFolder,
|
2022-12-21 01:39:28 +02:00
|
|
|
icon: 'ti ti-forms',
|
2022-07-15 13:15:23 +03:00
|
|
|
action: () => { renameFolder(folder.value); },
|
2022-01-18 16:06:16 +02:00
|
|
|
} : undefined, folder.value ? {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: i18n.ts.deleteFolder,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-trash',
|
2022-07-15 13:15:23 +03:00
|
|
|
action: () => { deleteFolder(folder.value as Misskey.entities.DriveFolder); },
|
2022-01-18 16:06:16 +02:00
|
|
|
} : undefined, {
|
2022-01-28 04:39:49 +02:00
|
|
|
text: i18n.ts.createFolder,
|
2022-12-20 08:24:31 +02:00
|
|
|
icon: 'ti ti-folder-plus',
|
2022-07-15 13:15:23 +03:00
|
|
|
action: () => { createFolder(); },
|
2022-01-18 16:06:16 +02:00
|
|
|
}];
|
|
|
|
}
|
|
|
|
|
|
|
|
function showMenu(ev: MouseEvent) {
|
2022-01-28 05:20:42 +02:00
|
|
|
os.popupMenu(getMenu(), (ev.currentTarget ?? ev.target ?? undefined) as HTMLElement | undefined);
|
2022-01-18 16:06:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function onContextmenu(ev: MouseEvent) {
|
|
|
|
os.contextMenu(getMenu(), ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (defaultStore.state.enableInfiniteScroll && loadMoreFiles.value) {
|
|
|
|
nextTick(() => {
|
2022-06-10 08:36:55 +03:00
|
|
|
ilFilesObserver.observe(loadMoreFiles.value?.$el);
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
|
|
|
}
|
2017-01-11 22:55:38 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
connection.on('fileCreated', onStreamDriveFileCreated);
|
|
|
|
connection.on('fileUpdated', onStreamDriveFileUpdated);
|
|
|
|
connection.on('fileDeleted', onStreamDriveFileDeleted);
|
|
|
|
connection.on('folderCreated', onStreamDriveFolderCreated);
|
|
|
|
connection.on('folderUpdated', onStreamDriveFolderUpdated);
|
|
|
|
connection.on('folderDeleted', onStreamDriveFolderDeleted);
|
|
|
|
|
|
|
|
if (props.initialFolder) {
|
|
|
|
move(props.initialFolder);
|
|
|
|
} else {
|
|
|
|
fetch();
|
|
|
|
}
|
|
|
|
});
|
2016-12-29 00:49:51 +02:00
|
|
|
|
2022-01-18 16:06:16 +02:00
|
|
|
onActivated(() => {
|
|
|
|
if (defaultStore.state.enableInfiniteScroll) {
|
|
|
|
nextTick(() => {
|
2022-06-10 08:36:55 +03:00
|
|
|
ilFilesObserver.observe(loadMoreFiles.value?.$el);
|
2022-01-18 16:06:16 +02:00
|
|
|
});
|
2018-02-14 08:54:18 +02:00
|
|
|
}
|
|
|
|
});
|
2022-01-18 16:06:16 +02:00
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
connection.dispose();
|
|
|
|
ilFilesObserver.disconnect();
|
|
|
|
});
|
2018-02-14 08:54:18 +02:00
|
|
|
</script>
|
|
|
|
|
2022-12-27 11:29:39 +02:00
|
|
|
<style lang="scss" scoped>
|
2020-01-29 21:37:25 +02:00
|
|
|
.yfudmmck {
|
2020-11-03 03:27:00 +02:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
> nav {
|
2021-07-29 11:10:16 +03:00
|
|
|
display: flex;
|
2020-01-29 21:37:25 +02:00
|
|
|
z-index: 2;
|
|
|
|
width: 100%;
|
2020-10-17 14:12:00 +03:00
|
|
|
padding: 0 8px;
|
|
|
|
box-sizing: border-box;
|
2020-01-29 21:37:25 +02:00
|
|
|
overflow: auto;
|
|
|
|
font-size: 0.9em;
|
|
|
|
box-shadow: 0 1px 0 var(--divider);
|
|
|
|
|
|
|
|
&, * {
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .path {
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: bottom;
|
2022-07-15 13:15:23 +03:00
|
|
|
line-height: 42px;
|
2020-01-29 21:37:25 +02:00
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
> * {
|
|
|
|
display: inline-block;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0 8px;
|
2022-07-15 13:15:23 +03:00
|
|
|
line-height: 42px;
|
2020-01-29 21:37:25 +02:00
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
* {
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.current {
|
|
|
|
font-weight: bold;
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.separator {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
opacity: 0.5;
|
|
|
|
cursor: default;
|
|
|
|
|
2021-04-20 17:22:59 +03:00
|
|
|
> i {
|
2020-01-29 21:37:25 +02:00
|
|
|
margin: 0;
|
|
|
|
}
|
2019-05-05 03:27:55 +03:00
|
|
|
}
|
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
}
|
2021-07-29 11:10:16 +03:00
|
|
|
|
|
|
|
> .menu {
|
|
|
|
margin-left: auto;
|
2021-12-10 03:46:29 +02:00
|
|
|
padding: 0 12px;
|
2021-07-29 11:10:16 +03:00
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
> .main {
|
2020-11-03 03:27:00 +02:00
|
|
|
flex: 1;
|
2020-01-29 21:37:25 +02:00
|
|
|
overflow: auto;
|
2021-04-10 06:40:50 +03:00
|
|
|
padding: var(--margin);
|
2020-01-29 21:37:25 +02:00
|
|
|
|
|
|
|
&, * {
|
|
|
|
user-select: none;
|
|
|
|
}
|
2018-02-14 08:54:18 +02:00
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
&.fetching {
|
|
|
|
cursor: wait !important;
|
|
|
|
|
|
|
|
* {
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .contents {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.uploading {
|
|
|
|
height: calc(100% - 38px - 100px);
|
|
|
|
}
|
|
|
|
|
|
|
|
> .contents {
|
|
|
|
|
|
|
|
> .folders,
|
|
|
|
> .files {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
> .folder,
|
|
|
|
> .file {
|
|
|
|
flex-grow: 1;
|
2021-04-10 06:40:50 +03:00
|
|
|
width: 128px;
|
2020-01-29 21:37:25 +02:00
|
|
|
margin: 4px;
|
|
|
|
box-sizing: border-box;
|
2019-05-05 03:27:55 +03:00
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
|
|
|
|
> .padding {
|
|
|
|
flex-grow: 1;
|
|
|
|
pointer-events: none;
|
2021-04-10 06:40:50 +03:00
|
|
|
width: 128px + 8px;
|
2018-02-14 08:54:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
> .empty {
|
|
|
|
padding: 16px;
|
|
|
|
text-align: center;
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0.5;
|
2018-02-14 08:54:18 +02:00
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
> p {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-14 08:54:18 +02:00
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
> .dropzone {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: 38px;
|
|
|
|
width: 100%;
|
|
|
|
height: calc(100% - 38px);
|
|
|
|
border: dashed 2px var(--focus);
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> input {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
2018-02-14 08:54:18 +02:00
|
|
|
</style>
|