@kitschpatrol/tweakpane-plugin-file-import 1.1.2-beta.2 → 1.2.0-fork.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,58 +0,0 @@
1
- import { Controller, Value, ViewProps } from '@tweakpane/core';
2
- import { FilePluginView } from '../view/view.js';
3
- interface Config {
4
- value: Value<File | null>;
5
- viewProps: ViewProps;
6
- invalidFiletypeMessage: string;
7
- lineCount: number;
8
- filetypes?: string[];
9
- }
10
- export declare class FilePluginController implements Controller<FilePluginView> {
11
- readonly value: Value<File | null>;
12
- readonly view: FilePluginView;
13
- readonly viewProps: ViewProps;
14
- private readonly config;
15
- constructor(doc: Document, config: Config);
16
- /**
17
- * Called when the value of the input changes.
18
- * @param event change event.
19
- */
20
- private onFile;
21
- /**
22
- * Shows warning text for 5 seconds.
23
- */
24
- private showWarning;
25
- /**
26
- * Checks if the file is valid with the given filetypes.
27
- * @param file File object
28
- * @returns true if the file is valid.
29
- */
30
- private isFileValid;
31
- /**
32
- * Event handler when the delete HTML button is clicked.
33
- * It resets the `rawValue` of the controller.
34
- */
35
- private onDeleteClick;
36
- /**
37
- * Called when the user drags over a file.
38
- * Updates the style of the container.
39
- * @param event drag event.
40
- */
41
- private onDragOver;
42
- /**
43
- * Called when the user leaves the container while dragging.
44
- * Updates the style of the container.
45
- */
46
- private onDragLeave;
47
- /**
48
- * Called when the user drops a file in the container.
49
- * Either shows a warning if it's invalid or updates the value if it's valid.
50
- * @param ev drag event.
51
- */
52
- private onDrop;
53
- /**
54
- * Called when the value (bound to the controller) changes (e.g. when the file is selected).
55
- */
56
- private handleValueChange;
57
- }
58
- export {};
@@ -1,3 +0,0 @@
1
- export declare const id = "file-input";
2
- export declare const css = "__css__";
3
- export declare const plugins: import("@tweakpane/core").InputBindingPlugin<File | null, string, import("./plugin.js").PluginInputParams>[];
@@ -1,8 +0,0 @@
1
- import { BaseInputParams, InputBindingPlugin } from '@tweakpane/core';
2
- export interface PluginInputParams extends BaseInputParams {
3
- view: 'file-input';
4
- invalidFiletypeMessage?: string;
5
- lineCount?: number;
6
- filetypes?: string[];
7
- }
8
- export declare const TweakpaneFileInputPlugin: InputBindingPlugin<File | null, string, PluginInputParams>;
@@ -1,24 +0,0 @@
1
- import { Value, View, ViewProps } from '@tweakpane/core';
2
- interface Config {
3
- value: Value<File | null>;
4
- viewProps: ViewProps;
5
- invalidFiletypeMessage: string;
6
- lineCount: number;
7
- filetypes?: string[];
8
- }
9
- export declare class FilePluginView implements View {
10
- readonly element: HTMLElement;
11
- readonly container: HTMLElement;
12
- input: HTMLInputElement;
13
- text: HTMLSpanElement;
14
- warning: HTMLSpanElement;
15
- fileIcon: HTMLElement;
16
- deleteButton: HTMLButtonElement;
17
- constructor(doc: Document, config: Config);
18
- /**
19
- * Changes the style of the container based on whether the user is dragging or not.
20
- * @param state if the user is dragging or not.
21
- */
22
- changeDraggingState(state: boolean): void;
23
- }
24
- export {};