tasmota-esp-web-tools 11.1.10 → 12.0.0
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.
- package/dist/components/ew-checkbox.d.ts +9 -0
- package/dist/components/ew-checkbox.js +6 -0
- package/dist/components/ew-circular-progress.d.ts +9 -0
- package/dist/components/ew-circular-progress.js +6 -0
- package/dist/components/{ewt-console.d.ts → ew-console.d.ts} +7 -1
- package/dist/components/ew-console.js +230 -0
- package/dist/components/ew-dialog.d.ts +9 -0
- package/dist/components/ew-dialog.js +6 -0
- package/dist/components/ew-divider.d.ts +9 -0
- package/dist/components/ew-divider.js +6 -0
- package/dist/components/ew-filled-select.d.ts +9 -0
- package/dist/components/ew-filled-select.js +7 -0
- package/dist/components/ew-filled-text-field.d.ts +10 -0
- package/dist/components/ew-filled-text-field.js +12 -0
- package/dist/components/ew-icon-button.d.ts +9 -0
- package/dist/components/ew-icon-button.js +7 -0
- package/dist/components/ew-list-item.d.ts +9 -0
- package/dist/components/ew-list-item.js +6 -0
- package/dist/components/ew-list.d.ts +9 -0
- package/dist/components/ew-list.js +6 -0
- package/dist/components/{ewt-littlefs-manager.d.ts → ew-littlefs-manager.d.ts} +1 -2
- package/dist/components/{ewt-littlefs-manager.js → ew-littlefs-manager.js} +35 -44
- package/dist/components/ew-select-option.d.ts +9 -0
- package/dist/components/ew-select-option.js +6 -0
- package/dist/components/ew-text-button.d.ts +9 -0
- package/dist/components/ew-text-button.js +7 -0
- package/dist/components/svg.d.ts +13 -0
- package/dist/components/svg.js +104 -1
- package/dist/install-button.js +5 -8
- package/dist/install-dialog.d.ts +17 -12
- package/dist/install-dialog.js +345 -302
- package/dist/no-port-picked/no-port-picked-dialog.d.ts +3 -2
- package/dist/no-port-picked/no-port-picked-dialog.js +104 -102
- package/dist/pages/{ewt-page-message.d.ts → ew-page-message.d.ts} +2 -2
- package/dist/pages/{ewt-page-message.js → ew-page-message.js} +7 -2
- package/dist/pages/{ewt-page-progress.d.ts → ew-page-progress.d.ts} +1 -1
- package/dist/pages/{ewt-page-progress.js → ew-page-progress.js} +5 -6
- package/dist/styles.js +19 -22
- package/dist/util/console-color.d.ts +15 -1
- package/dist/util/console-color.js +201 -103
- package/dist/util/line-break-transformer.js +16 -4
- package/dist/util/timestamp-transformer.d.ts +3 -0
- package/dist/util/timestamp-transformer.js +32 -0
- package/dist/web/index-DUmRg0Cu.js +131 -0
- package/dist/web/install-button.js +1 -1
- package/dist/web/install-dialog-G4pq1_-U.js +1457 -0
- package/dist/web/styles-D69gtq6_.js +116 -0
- package/js/modules/index-DUmRg0Cu.js +131 -0
- package/js/modules/install-button.js +1 -1
- package/js/modules/install-dialog-G4pq1_-U.js +1457 -0
- package/js/modules/styles-D69gtq6_.js +116 -0
- package/package.json +4 -9
- package/dist/components/ewt-button.d.ts +0 -9
- package/dist/components/ewt-button.js +0 -17
- package/dist/components/ewt-checkbox.d.ts +0 -9
- package/dist/components/ewt-checkbox.js +0 -6
- package/dist/components/ewt-circular-progress.d.ts +0 -9
- package/dist/components/ewt-circular-progress.js +0 -6
- package/dist/components/ewt-console.js +0 -149
- package/dist/components/ewt-dialog.d.ts +0 -9
- package/dist/components/ewt-dialog.js +0 -14
- package/dist/components/ewt-formfield.d.ts +0 -9
- package/dist/components/ewt-formfield.js +0 -6
- package/dist/components/ewt-icon-button.d.ts +0 -9
- package/dist/components/ewt-icon-button.js +0 -6
- package/dist/components/ewt-list-item.d.ts +0 -9
- package/dist/components/ewt-list-item.js +0 -6
- package/dist/components/ewt-select.d.ts +0 -9
- package/dist/components/ewt-select.js +0 -15
- package/dist/components/ewt-textfield.d.ts +0 -9
- package/dist/components/ewt-textfield.js +0 -15
- package/dist/web/index-BK6drzlv.js +0 -135
- package/dist/web/install-dialog-CeRFRNMk.js +0 -1284
- package/dist/web/styles-ntwzvT31.js +0 -101
- package/js/modules/index-BK6drzlv.js +0 -135
- package/js/modules/install-dialog-CeRFRNMk.js +0 -1284
- package/js/modules/styles-ntwzvT31.js +0 -101
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Checkbox } from "@material/web/checkbox/internal/checkbox.js";
|
|
2
|
+
export declare class EwCheckbox extends Checkbox {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-checkbox": EwCheckbox;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Checkbox } from "@material/web/checkbox/internal/checkbox.js";
|
|
2
|
+
import { styles } from "@material/web/checkbox/internal/checkbox-styles.js";
|
|
3
|
+
export class EwCheckbox extends Checkbox {
|
|
4
|
+
}
|
|
5
|
+
EwCheckbox.styles = [styles];
|
|
6
|
+
customElements.define("ew-checkbox", EwCheckbox);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CircularProgress } from "@material/web/progress/internal/circular-progress.js";
|
|
2
|
+
export declare class EwCircularProgress extends CircularProgress {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-circular-progress": EwCircularProgress;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CircularProgress } from "@material/web/progress/internal/circular-progress.js";
|
|
2
|
+
import { styles } from "@material/web/progress/internal/circular-progress-styles.js";
|
|
3
|
+
export class EwCircularProgress extends CircularProgress {
|
|
4
|
+
}
|
|
5
|
+
EwCircularProgress.styles = [styles];
|
|
6
|
+
customElements.define("ew-circular-progress", EwCircularProgress);
|
|
@@ -6,15 +6,21 @@ export declare class EwtConsole extends HTMLElement {
|
|
|
6
6
|
onReset?: () => Promise<void>;
|
|
7
7
|
private _console?;
|
|
8
8
|
private _cancelConnection?;
|
|
9
|
+
private _clickHandler?;
|
|
10
|
+
private _commandHistory;
|
|
11
|
+
private _historyIndex;
|
|
12
|
+
private _currentInput;
|
|
9
13
|
logs(): string;
|
|
10
14
|
connectedCallback(): void;
|
|
11
15
|
private _connect;
|
|
16
|
+
private _navigateHistory;
|
|
12
17
|
private _sendCommand;
|
|
13
18
|
disconnect(): Promise<void>;
|
|
19
|
+
disconnectedCallback(): void;
|
|
14
20
|
reset(): Promise<void>;
|
|
15
21
|
}
|
|
16
22
|
declare global {
|
|
17
23
|
interface HTMLElementTagNameMap {
|
|
18
|
-
"
|
|
24
|
+
"ew-console": EwtConsole;
|
|
19
25
|
}
|
|
20
26
|
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { ColoredConsole, coloredConsoleStyles } from "../util/console-color";
|
|
2
|
+
import { sleep } from "../util/sleep";
|
|
3
|
+
import { LineBreakTransformer } from "../util/line-break-transformer";
|
|
4
|
+
import { TimestampTransformer } from "../util/timestamp-transformer";
|
|
5
|
+
export class EwtConsole extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.allowInput = true;
|
|
9
|
+
this._commandHistory = [];
|
|
10
|
+
this._historyIndex = -1;
|
|
11
|
+
this._currentInput = "";
|
|
12
|
+
}
|
|
13
|
+
logs() {
|
|
14
|
+
var _a;
|
|
15
|
+
return ((_a = this._console) === null || _a === void 0 ? void 0 : _a.logs()) || "";
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
var _a;
|
|
19
|
+
if (this._console) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// attachShadow throws if a shadow root already exists; reuse it on reattach
|
|
23
|
+
const shadowRoot = (_a = this.shadowRoot) !== null && _a !== void 0 ? _a : this.attachShadow({ mode: "open" });
|
|
24
|
+
shadowRoot.innerHTML = `
|
|
25
|
+
<style>
|
|
26
|
+
:host, input {
|
|
27
|
+
background-color: #1c1c1c;
|
|
28
|
+
color: #ddd;
|
|
29
|
+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
|
|
30
|
+
monospace;
|
|
31
|
+
line-height: 1.45;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
form {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
padding: 0 8px 0 16px;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
}
|
|
42
|
+
input {
|
|
43
|
+
flex: 1;
|
|
44
|
+
padding: 4px;
|
|
45
|
+
margin: 0 8px;
|
|
46
|
+
border: 0;
|
|
47
|
+
outline: none;
|
|
48
|
+
}
|
|
49
|
+
${coloredConsoleStyles}
|
|
50
|
+
</style>
|
|
51
|
+
<div class="log"></div>
|
|
52
|
+
${this.allowInput
|
|
53
|
+
? `<form>
|
|
54
|
+
<span aria-hidden="true">></span>
|
|
55
|
+
<input aria-label="Serial command" autofocus>
|
|
56
|
+
</form>
|
|
57
|
+
`
|
|
58
|
+
: ""}
|
|
59
|
+
`;
|
|
60
|
+
this._console = new ColoredConsole(this.shadowRoot.querySelector("div"));
|
|
61
|
+
if (this.allowInput) {
|
|
62
|
+
const input = this.shadowRoot.querySelector("input");
|
|
63
|
+
this._clickHandler = () => {
|
|
64
|
+
var _a;
|
|
65
|
+
// Only focus input if user didn't select some text
|
|
66
|
+
if (((_a = getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) === "") {
|
|
67
|
+
input.focus();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this.addEventListener("click", this._clickHandler);
|
|
71
|
+
input.addEventListener("keydown", (ev) => {
|
|
72
|
+
if (ev.key === "Enter") {
|
|
73
|
+
ev.preventDefault();
|
|
74
|
+
ev.stopPropagation();
|
|
75
|
+
this._sendCommand();
|
|
76
|
+
}
|
|
77
|
+
else if (ev.key === "ArrowUp") {
|
|
78
|
+
ev.preventDefault();
|
|
79
|
+
this._navigateHistory(input, 1);
|
|
80
|
+
}
|
|
81
|
+
else if (ev.key === "ArrowDown") {
|
|
82
|
+
ev.preventDefault();
|
|
83
|
+
this._navigateHistory(input, -1);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
// User is editing — reset history navigation
|
|
87
|
+
this._historyIndex = -1;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const abortController = new AbortController();
|
|
92
|
+
const connection = this._connect(abortController.signal);
|
|
93
|
+
this._cancelConnection = () => {
|
|
94
|
+
abortController.abort();
|
|
95
|
+
return connection;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
async _connect(signal) {
|
|
99
|
+
this.logger.debug("Starting console read loop");
|
|
100
|
+
// Capture a stable reference; addLine() becomes a no-op after destroy()
|
|
101
|
+
const consoleView = this._console;
|
|
102
|
+
if (!this.port.readable) {
|
|
103
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("");
|
|
104
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("");
|
|
105
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("Terminal disconnected: Port readable stream not available");
|
|
106
|
+
this.logger.error("Port readable stream not available - port may need to be reopened at correct baudrate");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
await this.port.readable
|
|
111
|
+
.pipeThrough(new TextDecoderStream(), { signal })
|
|
112
|
+
.pipeThrough(new TransformStream(new LineBreakTransformer()))
|
|
113
|
+
.pipeThrough(new TransformStream(new TimestampTransformer()))
|
|
114
|
+
.pipeTo(new WritableStream({
|
|
115
|
+
write: (line) => {
|
|
116
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine(line);
|
|
117
|
+
},
|
|
118
|
+
}));
|
|
119
|
+
if (!signal.aborted) {
|
|
120
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("");
|
|
121
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("");
|
|
122
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("Terminal disconnected");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
if (!signal.aborted) {
|
|
127
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("");
|
|
128
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine("");
|
|
129
|
+
consoleView === null || consoleView === void 0 ? void 0 : consoleView.addLine(`Terminal disconnected: ${err}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
await sleep(100);
|
|
134
|
+
this.logger.debug("Finished console read loop");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
_navigateHistory(input, direction) {
|
|
138
|
+
if (this._commandHistory.length === 0)
|
|
139
|
+
return;
|
|
140
|
+
// Save current input before navigating away
|
|
141
|
+
if (this._historyIndex === -1) {
|
|
142
|
+
this._currentInput = input.value;
|
|
143
|
+
}
|
|
144
|
+
const newIndex = this._historyIndex + direction;
|
|
145
|
+
if (newIndex < 0) {
|
|
146
|
+
// Back to current (unsent) input
|
|
147
|
+
this._historyIndex = -1;
|
|
148
|
+
input.value = this._currentInput;
|
|
149
|
+
}
|
|
150
|
+
else if (newIndex < this._commandHistory.length) {
|
|
151
|
+
this._historyIndex = newIndex;
|
|
152
|
+
input.value = this._commandHistory[this._historyIndex];
|
|
153
|
+
}
|
|
154
|
+
// Move cursor to end
|
|
155
|
+
const len = input.value.length;
|
|
156
|
+
input.setSelectionRange(len, len);
|
|
157
|
+
}
|
|
158
|
+
async _sendCommand() {
|
|
159
|
+
var _a, _b;
|
|
160
|
+
const input = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("input");
|
|
161
|
+
if (!input || !this.port.writable)
|
|
162
|
+
return;
|
|
163
|
+
const value = input.value;
|
|
164
|
+
const writer = this.port.writable.getWriter();
|
|
165
|
+
try {
|
|
166
|
+
await writer.write(new TextEncoder().encode(`${value}\r\n`));
|
|
167
|
+
(_b = this._console) === null || _b === void 0 ? void 0 : _b.addLine(`> ${value}\r\n`);
|
|
168
|
+
if (input.isConnected) {
|
|
169
|
+
// Add to history (skip empty, skip consecutive duplicates, cap at 100)
|
|
170
|
+
if (value && value !== this._commandHistory[0]) {
|
|
171
|
+
this._commandHistory.unshift(value);
|
|
172
|
+
if (this._commandHistory.length > 100) {
|
|
173
|
+
this._commandHistory.pop();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
this._historyIndex = -1;
|
|
177
|
+
this._currentInput = "";
|
|
178
|
+
input.value = "";
|
|
179
|
+
input.focus();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
try {
|
|
184
|
+
writer.releaseLock();
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
this.logger.error("Ignoring release lock error", err);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async disconnect() {
|
|
192
|
+
var _a;
|
|
193
|
+
if (this._clickHandler) {
|
|
194
|
+
this.removeEventListener("click", this._clickHandler);
|
|
195
|
+
this._clickHandler = undefined;
|
|
196
|
+
}
|
|
197
|
+
if (this._cancelConnection) {
|
|
198
|
+
await this._cancelConnection();
|
|
199
|
+
this._cancelConnection = undefined;
|
|
200
|
+
}
|
|
201
|
+
(_a = this._console) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
202
|
+
this._console = undefined;
|
|
203
|
+
}
|
|
204
|
+
disconnectedCallback() {
|
|
205
|
+
var _a;
|
|
206
|
+
if (this._clickHandler) {
|
|
207
|
+
this.removeEventListener("click", this._clickHandler);
|
|
208
|
+
this._clickHandler = undefined;
|
|
209
|
+
}
|
|
210
|
+
if (this._cancelConnection) {
|
|
211
|
+
this._cancelConnection();
|
|
212
|
+
this._cancelConnection = undefined;
|
|
213
|
+
}
|
|
214
|
+
(_a = this._console) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
215
|
+
this._console = undefined;
|
|
216
|
+
}
|
|
217
|
+
async reset() {
|
|
218
|
+
this.logger.debug("Triggering reset.");
|
|
219
|
+
if (this.onReset) {
|
|
220
|
+
try {
|
|
221
|
+
await this.onReset();
|
|
222
|
+
}
|
|
223
|
+
catch (err) {
|
|
224
|
+
this.logger.error("Reset callback failed:", err);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
await sleep(1000);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
customElements.define("ew-console", EwtConsole);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Divider } from "@material/web/divider/internal/divider.js";
|
|
2
|
+
import { styles } from "@material/web/divider/internal/divider-styles.js";
|
|
3
|
+
export class EwDivider extends Divider {
|
|
4
|
+
}
|
|
5
|
+
EwDivider.styles = [styles];
|
|
6
|
+
customElements.define("ew-divider", EwDivider);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FilledSelect } from "@material/web/select/internal/filled-select.js";
|
|
2
|
+
export declare class EwFilledSelect extends FilledSelect {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-filled-select": EwFilledSelect;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FilledSelect } from "@material/web/select/internal/filled-select.js";
|
|
2
|
+
import { styles } from "@material/web/select/internal/filled-select-styles.js";
|
|
3
|
+
import { styles as sharedStyles } from "@material/web/select/internal/shared-styles.js";
|
|
4
|
+
export class EwFilledSelect extends FilledSelect {
|
|
5
|
+
}
|
|
6
|
+
EwFilledSelect.styles = [sharedStyles, styles];
|
|
7
|
+
customElements.define("ew-filled-select", EwFilledSelect);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FilledTextField } from "@material/web/textfield/internal/filled-text-field.js";
|
|
2
|
+
export declare class EwFilledTextField extends FilledTextField {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
protected readonly fieldTag: import("lit-html/static.js").StaticValue;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"ew-filled-text-field": EwFilledTextField;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { styles as filledStyles } from "@material/web/textfield/internal/filled-styles.js";
|
|
2
|
+
import { FilledTextField } from "@material/web/textfield/internal/filled-text-field.js";
|
|
3
|
+
import { styles as sharedStyles } from "@material/web/textfield/internal/shared-styles.js";
|
|
4
|
+
import { literal } from "lit/static-html.js";
|
|
5
|
+
export class EwFilledTextField extends FilledTextField {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.fieldTag = literal `md-filled-field`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
EwFilledTextField.styles = [sharedStyles, filledStyles];
|
|
12
|
+
customElements.define("ew-filled-text-field", EwFilledTextField);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IconButton } from "@material/web/iconbutton/internal/icon-button.js";
|
|
2
|
+
export declare class EwIconButton extends IconButton {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-icon-button": EwIconButton;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IconButton } from "@material/web/iconbutton/internal/icon-button.js";
|
|
2
|
+
import { styles as sharedStyles } from "@material/web/iconbutton/internal/shared-styles.js";
|
|
3
|
+
import { styles } from "@material/web/iconbutton/internal/standard-styles.js";
|
|
4
|
+
export class EwIconButton extends IconButton {
|
|
5
|
+
}
|
|
6
|
+
EwIconButton.styles = [sharedStyles, styles];
|
|
7
|
+
customElements.define("ew-icon-button", EwIconButton);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ListItemEl as ListItem } from "@material/web/list/internal/listitem/list-item.js";
|
|
2
|
+
export declare class EwListItem extends ListItem {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-list-item": EwListItem;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ListItemEl as ListItem } from "@material/web/list/internal/listitem/list-item.js";
|
|
2
|
+
import { styles } from "@material/web/list/internal/listitem/list-item-styles.js";
|
|
3
|
+
export class EwListItem extends ListItem {
|
|
4
|
+
}
|
|
5
|
+
EwListItem.styles = [styles];
|
|
6
|
+
customElements.define("ew-list-item", EwListItem);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import type { Partition } from "../partition.js";
|
|
3
|
-
import "./
|
|
4
|
-
import "./ewt-textfield";
|
|
3
|
+
import "./ew-text-button";
|
|
5
4
|
export declare class EwtLittleFSManager extends LitElement {
|
|
6
5
|
partition: Partition;
|
|
7
6
|
espStub: any;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, html, css } from "lit";
|
|
3
3
|
import { customElement, property, state } from "lit/decorators.js";
|
|
4
|
-
import "./
|
|
5
|
-
import "./ewt-textfield";
|
|
4
|
+
import "./ew-text-button";
|
|
6
5
|
// Dynamic import for LittleFS WASM module
|
|
7
6
|
let _wasmBasePath = null;
|
|
8
7
|
let _littleFSModule = null;
|
|
@@ -458,38 +457,32 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
458
457
|
</div>
|
|
459
458
|
|
|
460
459
|
<div class="littlefs-controls">
|
|
461
|
-
<
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
<ewt-button
|
|
472
|
-
label="Write to Flash"
|
|
473
|
-
@click=${this._writeToFlash}
|
|
474
|
-
?disabled=${this._busy}
|
|
475
|
-
></ewt-button>
|
|
476
|
-
<ewt-button
|
|
477
|
-
label="Close"
|
|
460
|
+
<ew-text-button @click=${this._refreshFiles} ?disabled=${this._busy}
|
|
461
|
+
>Refresh</ew-text-button
|
|
462
|
+
>
|
|
463
|
+
<ew-text-button @click=${this._backupImage} ?disabled=${this._busy}
|
|
464
|
+
>Backup Image</ew-text-button
|
|
465
|
+
>
|
|
466
|
+
<ew-text-button @click=${this._writeToFlash} ?disabled=${this._busy}
|
|
467
|
+
>Write to Flash</ew-text-button
|
|
468
|
+
>
|
|
469
|
+
<ew-text-button
|
|
478
470
|
@click=${() => {
|
|
479
471
|
this._cleanup();
|
|
480
472
|
if (this.onClose)
|
|
481
473
|
this.onClose();
|
|
482
474
|
}}
|
|
483
475
|
?disabled=${this._busy}
|
|
484
|
-
|
|
476
|
+
>Close</ew-text-button
|
|
477
|
+
>
|
|
485
478
|
</div>
|
|
486
479
|
|
|
487
480
|
<div class="littlefs-breadcrumb">
|
|
488
|
-
<
|
|
489
|
-
label="↑ Up"
|
|
481
|
+
<ew-text-button
|
|
490
482
|
@click=${this._navigateUp}
|
|
491
483
|
?disabled=${this._currentPath === "/" || this._busy}
|
|
492
|
-
|
|
484
|
+
>↑ Up</ew-text-button
|
|
485
|
+
>
|
|
493
486
|
<span>${this._currentPath || "/"}</span>
|
|
494
487
|
</div>
|
|
495
488
|
|
|
@@ -499,16 +492,14 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
499
492
|
@change=${this._handleFileSelect}
|
|
500
493
|
?disabled=${this._busy}
|
|
501
494
|
/>
|
|
502
|
-
<
|
|
503
|
-
label="Upload File"
|
|
495
|
+
<ew-text-button
|
|
504
496
|
@click=${this._uploadFile}
|
|
505
497
|
?disabled=${!this._selectedFile || this._busy}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
></ewt-button>
|
|
498
|
+
>Upload File</ew-text-button
|
|
499
|
+
>
|
|
500
|
+
<ew-text-button @click=${this._createFolder} ?disabled=${this._busy}
|
|
501
|
+
>New Folder</ew-text-button
|
|
502
|
+
>
|
|
512
503
|
</div>
|
|
513
504
|
|
|
514
505
|
<div class="littlefs-files">
|
|
@@ -560,19 +551,19 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
560
551
|
<div class="file-actions">
|
|
561
552
|
${entry.type === "file"
|
|
562
553
|
? html `
|
|
563
|
-
<
|
|
564
|
-
label="Download"
|
|
554
|
+
<ew-text-button
|
|
565
555
|
@click=${() => this._downloadFile(entry.path)}
|
|
566
556
|
?disabled=${this._busy}
|
|
567
|
-
|
|
557
|
+
>Download</ew-text-button
|
|
558
|
+
>
|
|
568
559
|
`
|
|
569
560
|
: ""}
|
|
570
|
-
<
|
|
561
|
+
<ew-text-button
|
|
571
562
|
class="danger"
|
|
572
|
-
label="Delete"
|
|
573
563
|
@click=${() => this._deleteFile(entry.path, entry.type)}
|
|
574
564
|
?disabled=${this._busy}
|
|
575
|
-
|
|
565
|
+
>Delete</ew-text-button
|
|
566
|
+
>
|
|
576
567
|
</div>
|
|
577
568
|
</td>
|
|
578
569
|
</tr>
|
|
@@ -594,7 +585,7 @@ EwtLittleFSManager.styles = css `
|
|
|
594
585
|
max-width: 100%;
|
|
595
586
|
margin: 0 auto;
|
|
596
587
|
padding: 15px;
|
|
597
|
-
border: 2px solid var(--
|
|
588
|
+
border: 2px solid var(--md-sys-color-primary, #03a9f4);
|
|
598
589
|
border-radius: 10px;
|
|
599
590
|
background-color: rgba(3, 169, 244, 0.05);
|
|
600
591
|
box-sizing: border-box;
|
|
@@ -602,7 +593,7 @@ EwtLittleFSManager.styles = css `
|
|
|
602
593
|
|
|
603
594
|
h3 {
|
|
604
595
|
margin: 0 0 15px 0;
|
|
605
|
-
color: var(--
|
|
596
|
+
color: var(--md-sys-color-primary, #03a9f4);
|
|
606
597
|
font-size: 18px;
|
|
607
598
|
font-weight: 600;
|
|
608
599
|
}
|
|
@@ -641,8 +632,8 @@ EwtLittleFSManager.styles = css `
|
|
|
641
632
|
height: 100%;
|
|
642
633
|
background: linear-gradient(
|
|
643
634
|
90deg,
|
|
644
|
-
var(--
|
|
645
|
-
var(--
|
|
635
|
+
var(--md-sys-color-primary, #03a9f4) 0%,
|
|
636
|
+
var(--md-sys-color-primary, #03a9f4) 100%
|
|
646
637
|
);
|
|
647
638
|
transition: width 0.3s ease;
|
|
648
639
|
}
|
|
@@ -680,7 +671,7 @@ EwtLittleFSManager.styles = css `
|
|
|
680
671
|
.disk-version {
|
|
681
672
|
font-size: 11px;
|
|
682
673
|
padding: 2px 6px;
|
|
683
|
-
background-color: var(--
|
|
674
|
+
background-color: var(--md-sys-color-primary, #03a9f4);
|
|
684
675
|
color: white;
|
|
685
676
|
border-radius: 4px;
|
|
686
677
|
}
|
|
@@ -783,7 +774,7 @@ EwtLittleFSManager.styles = css `
|
|
|
783
774
|
}
|
|
784
775
|
|
|
785
776
|
.file-name.clickable:hover {
|
|
786
|
-
color: var(--
|
|
777
|
+
color: var(--md-sys-color-primary, #03a9f4);
|
|
787
778
|
text-decoration: underline;
|
|
788
779
|
}
|
|
789
780
|
|
|
@@ -797,7 +788,7 @@ EwtLittleFSManager.styles = css `
|
|
|
797
788
|
}
|
|
798
789
|
|
|
799
790
|
.danger {
|
|
800
|
-
--
|
|
791
|
+
--md-sys-color-primary: var(--danger-color, #db4437);
|
|
801
792
|
}
|
|
802
793
|
`;
|
|
803
794
|
__decorate([
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SelectOptionEl } from "@material/web/select/internal/selectoption/select-option.js";
|
|
2
|
+
export declare class EwSelectOption extends SelectOptionEl {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-select-option": EwSelectOption;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { styles } from "@material/web/menu/internal/menuitem/menu-item-styles.js";
|
|
2
|
+
import { SelectOptionEl } from "@material/web/select/internal/selectoption/select-option.js";
|
|
3
|
+
export class EwSelectOption extends SelectOptionEl {
|
|
4
|
+
}
|
|
5
|
+
EwSelectOption.styles = [styles];
|
|
6
|
+
customElements.define("ew-select-option", EwSelectOption);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextButton } from "@material/web/button/internal/text-button.js";
|
|
2
|
+
export declare class EwTextButton extends TextButton {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"ew-text-button": EwTextButton;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { styles as sharedStyles } from "@material/web/button/internal/shared-styles.js";
|
|
2
|
+
import { TextButton } from "@material/web/button/internal/text-button.js";
|
|
3
|
+
import { styles as textStyles } from "@material/web/button/internal/text-styles.js";
|
|
4
|
+
export class EwTextButton extends TextButton {
|
|
5
|
+
}
|
|
6
|
+
EwTextButton.styles = [sharedStyles, textStyles];
|
|
7
|
+
customElements.define("ew-text-button", EwTextButton);
|