mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-06 03:50:18 +02:00
fix(demo): fix file manager (again)
This commit is contained in:
parent
2464b62a59
commit
3a8ec41293
7 changed files with 20 additions and 16 deletions
|
@ -27,13 +27,13 @@
|
|||
"@yume-chan/event": "^0.0.16",
|
||||
"@yume-chan/scrcpy": "^0.0.16",
|
||||
"@yume-chan/stream-extra": "^0.0.16",
|
||||
"@yume-chan/stream-saver": "^2.0.6",
|
||||
"@yume-chan/struct": "^0.0.16",
|
||||
"mobx": "^6.5.0",
|
||||
"mobx-react-lite": "^3.4.0",
|
||||
"next": "12.1.6",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"streamsaver": "^2.0.5",
|
||||
"xterm": "^4.18.0",
|
||||
"xterm-addon-fit": "^0.5.0",
|
||||
"xterm-addon-search": "^0.8.2",
|
||||
|
|
|
@ -22,7 +22,8 @@ interface ListItem extends AdbSyncEntry {
|
|||
}
|
||||
|
||||
function toListItem(item: AdbSyncEntry): ListItem {
|
||||
return { ...item, key: item.name! };
|
||||
(item as ListItem).key = item.name;
|
||||
return item as ListItem;
|
||||
}
|
||||
|
||||
const classNames = mergeStyleSets({
|
||||
|
@ -580,9 +581,8 @@ const FileManager: NextPage = (): JSX.Element | null => {
|
|||
|
||||
const selection = useConst(() => new Selection({
|
||||
onSelectionChanged() {
|
||||
const selectedItems = selection.getSelection() as ListItem[];
|
||||
runInAction(() => {
|
||||
state.selectedItems = selectedItems;
|
||||
state.selectedItems = selection.getSelection() as ListItem[];
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
|
|
@ -32,12 +32,12 @@ export function pickFile(options: { multiple?: boolean; } & PickFileOptions): Pr
|
|||
});
|
||||
}
|
||||
|
||||
let StreamSaver: typeof import('streamsaver');
|
||||
let StreamSaver: typeof import('@yume-chan/stream-saver');
|
||||
if (typeof window !== 'undefined') {
|
||||
const { publicRuntimeConfig } = getConfig();
|
||||
// Can't use `import` here because ESM is read-only (can't set `mitm` field)
|
||||
// Add `await` here because top-level await is on, so every import can be a `Promise`
|
||||
StreamSaver = require('streamsaver');
|
||||
StreamSaver = require('@yume-chan/stream-saver');
|
||||
StreamSaver.mitm = publicRuntimeConfig.basePath + '/StreamSaver/mitm.html';
|
||||
}
|
||||
|
||||
|
|
2
apps/demo/streamsaver.d.ts
vendored
2
apps/demo/streamsaver.d.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
declare module 'streamsaver' {
|
||||
declare module '@yume-chan/stream-saver' {
|
||||
type OriginalWriteableStream = typeof WritableStream;
|
||||
|
||||
namespace StreamSaver {
|
||||
|
|
15
common/config/rush/pnpm-lock.yaml
generated
15
common/config/rush/pnpm-lock.yaml
generated
|
@ -34,6 +34,7 @@ specifiers:
|
|||
'@types/react': 17.0.27
|
||||
'@types/w3c-web-usb': ^1.0.4
|
||||
'@yume-chan/async': ^2.2.0
|
||||
'@yume-chan/stream-saver': ^2.0.6
|
||||
clsx: ^1.1.1
|
||||
cross-env: ^7.0.3
|
||||
eslint: 8.8.0
|
||||
|
@ -50,7 +51,6 @@ specifiers:
|
|||
react: ^17.0.2
|
||||
react-dom: ^17.0.2
|
||||
source-map-loader: ^3.0.1
|
||||
streamsaver: ^2.0.5
|
||||
ts-jest: ^28.0.2
|
||||
tslib: ^2.4.0
|
||||
typescript: ^4.7.3
|
||||
|
@ -96,6 +96,7 @@ dependencies:
|
|||
'@types/react': 17.0.27
|
||||
'@types/w3c-web-usb': 1.0.6
|
||||
'@yume-chan/async': 2.2.0
|
||||
'@yume-chan/stream-saver': 2.0.6
|
||||
clsx: 1.1.1
|
||||
cross-env: 7.0.3
|
||||
eslint: 8.8.0
|
||||
|
@ -112,7 +113,6 @@ dependencies:
|
|||
react: 17.0.2
|
||||
react-dom: 17.0.2_react@17.0.2
|
||||
source-map-loader: 3.0.1
|
||||
streamsaver: 2.0.6
|
||||
ts-jest: 28.0.2_jest@28.1.0+typescript@4.7.3
|
||||
tslib: 2.4.0
|
||||
typescript: 4.7.3
|
||||
|
@ -3716,6 +3716,10 @@ packages:
|
|||
tslib: 2.4.0
|
||||
dev: false
|
||||
|
||||
/@yume-chan/stream-saver/2.0.6:
|
||||
resolution: {integrity: sha512-DzRADjLoHcz18ocgGHvLIanapxygX3o9dlWwE32EUZqhyAsopfdvZ79ttR9+7pqAXIQamP9M4mbDy8hHgFKOIA==}
|
||||
dev: false
|
||||
|
||||
/abab/2.0.6:
|
||||
resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
|
||||
dev: false
|
||||
|
@ -11626,7 +11630,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
/yauzl/2.10.0:
|
||||
resolution: {integrity: sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=}
|
||||
resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
|
||||
dependencies:
|
||||
buffer-crc32: 0.2.13
|
||||
fd-slicer: 1.1.0
|
||||
|
@ -11638,7 +11642,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
/yuv-buffer/1.0.0:
|
||||
resolution: {integrity: sha1-CaRUhY103yvDHNWI7dcP/Lhr/Jo=}
|
||||
resolution: {integrity: sha512-5r5u7g7Dbdrwao/z8c4harQIpZwaNuzXjQXtgdFxTjr5Pm2eMmxIuckkKOONEM7fkiMNkeffXs6EPNESvAVzVg==}
|
||||
dev: false
|
||||
|
||||
/yuv-canvas/1.2.11:
|
||||
|
@ -11773,7 +11777,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/demo.tgz_@mdx-js+react@1.6.22:
|
||||
resolution: {integrity: sha512-zgB2e4Rm+X2QP17UAobmYDdnwia1nplNwILfyeE2kSWGpm7o7JgGdcB/CZZXqwz1D96ajC/Tii/cywRfdw/wFA==, tarball: file:projects/demo.tgz}
|
||||
resolution: {integrity: sha512-ka03075sagGgXY4P/nVu//O48M8jNZaP5dMUPGAxda9jePXuNLn/yJ2VksYKs+5FX4wBwHOJGsV6W1BHZ9OdjA==, tarball: file:projects/demo.tgz}
|
||||
id: file:projects/demo.tgz
|
||||
name: '@rush-temp/demo'
|
||||
version: 0.0.0
|
||||
|
@ -11788,6 +11792,7 @@ packages:
|
|||
'@next/mdx': 11.1.4_f56c41adb6190c4680be4a1c0222355d
|
||||
'@types/react': 17.0.27
|
||||
'@yume-chan/async': 2.2.0
|
||||
'@yume-chan/stream-saver': 2.0.6
|
||||
eslint: 8.8.0
|
||||
eslint-config-next: 12.1.6_eb41e2b74cbdc8b36435b8542a7e399f
|
||||
mobx: 6.5.0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
|
||||
{
|
||||
"pnpmShrinkwrapHash": "864574e3d8d3518b3174c10c0faaf84c0c591446"
|
||||
"pnpmShrinkwrapHash": "bf16f3255c332901e19482849fb80f854fed53dd"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { StructAsyncDeserializeStream, StructDeserializeStream, StructFieldDefinition, StructFieldValue, StructOptions, STRUCT_VALUE_SYMBOL } from './basic/index.js';
|
||||
import { StructDefaultOptions, StructValue } from './basic/index.js';
|
||||
import { StructAsyncDeserializeStream, StructDefaultOptions, StructDeserializeStream, StructFieldDefinition, StructFieldValue, StructOptions, StructValue, STRUCT_VALUE_SYMBOL } from './basic/index.js';
|
||||
import { SyncPromise } from "./sync-promise.js";
|
||||
import { BigIntFieldDefinition, BigIntFieldType, BufferFieldSubType, FixedLengthBufferLikeFieldDefinition, NumberFieldDefinition, NumberFieldType, StringBufferFieldSubType, Uint8ArrayBufferFieldSubType, VariableLengthBufferLikeFieldDefinition, type FixedLengthBufferLikeFieldOptions, type LengthField, type VariableLengthBufferLikeFieldOptions } from './types/index.js';
|
||||
import type { Evaluate, Identity, Overwrite, ValueOrPromise } from "./utils.js";
|
||||
|
@ -566,7 +565,7 @@ export class Struct<
|
|||
const override = this._postDeserialized.call(object, object);
|
||||
// If it returns a new value, use that as result
|
||||
// Otherwise it only inspects/mutates the object in place.
|
||||
if (override) {
|
||||
if (override !== undefined) {
|
||||
return override;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue