## Summary `<input type=\"file\">` inside front-components was silently non-functional: - The host-side `serializeEvent` did not read `target.files`, so the worker received an empty `onChange` detail. - `SerializedEventData` had no `files` field. - The `html-input` schema in `AllowedHtmlElements` exposed neither `accept`, `multiple`, nor `capture` — the worker could not even configure the picker. This PR forwards file metadata (`name`, `size`, `type`, `lastModified`) through the existing serialized event detail and accepts the missing attributes on the `html-input` remote element. A new Storybook play test guards the regression by uploading single and multiple files via `userEvent.upload`. Reading file contents inside the worker is intentionally out of scope here and will need a separate host API bridge (the host has the `File` objects on the real input element; passing bytes through `postMessage` is a bigger design call).
46 lines
884 B
TypeScript
46 lines
884 B
TypeScript
export type SerializedFileData = {
|
|
name: string;
|
|
size: number;
|
|
type: string;
|
|
lastModified: number;
|
|
};
|
|
|
|
export type SerializedEventData = {
|
|
type: string;
|
|
altKey?: boolean;
|
|
ctrlKey?: boolean;
|
|
metaKey?: boolean;
|
|
shiftKey?: boolean;
|
|
clientX?: number;
|
|
clientY?: number;
|
|
pageX?: number;
|
|
pageY?: number;
|
|
screenX?: number;
|
|
screenY?: number;
|
|
offsetX?: number;
|
|
offsetY?: number;
|
|
movementX?: number;
|
|
movementY?: number;
|
|
button?: number;
|
|
buttons?: number;
|
|
key?: string;
|
|
code?: string;
|
|
repeat?: boolean;
|
|
value?: string;
|
|
checked?: boolean;
|
|
scrollTop?: number;
|
|
scrollLeft?: number;
|
|
deltaX?: number;
|
|
deltaY?: number;
|
|
deltaZ?: number;
|
|
deltaMode?: number;
|
|
currentTime?: number;
|
|
duration?: number;
|
|
paused?: boolean;
|
|
ended?: boolean;
|
|
volume?: number;
|
|
muted?: boolean;
|
|
playbackRate?: number;
|
|
files?: SerializedFileData[];
|
|
};
|