@wp-playground/components 3.1.47 → 3.1.48
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/PlaygroundFileEditor/file-explorer-sidebar.d.ts +2 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.js +894 -892
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import r, { forwardRef as
|
|
1
|
+
import r, { forwardRef as $t, useMemo as Ft, useState as ee, useRef as V, useEffect as W, useImperativeHandle as Wt, useLayoutEffect as qt, useCallback as Ue } from "react";
|
|
2
2
|
import { joinPaths as je, dirname as Le, normalizePath as Jt, basename as et, isParentOf as Xt, concatUint8Arrays as Qt } from "@php-wasm/util";
|
|
3
|
-
import { __experimentalTreeGrid as er, Popover as tr, NavigableMenu as rr, MenuItem as it, __experimentalTreeGridRow as nr, __experimentalTreeGridCell as ar, Button as tt, Modal as or, Icon as St, Tooltip as
|
|
3
|
+
import { __experimentalTreeGrid as er, Popover as tr, NavigableMenu as rr, MenuItem as it, __experimentalTreeGridRow as nr, __experimentalTreeGridCell as ar, Button as tt, Modal as or, Icon as St, Tooltip as Ht, VisuallyHidden as ir, Notice as lr } from "@wordpress/components";
|
|
4
4
|
import De from "classnames";
|
|
5
|
-
import { forwardRef as
|
|
5
|
+
import { forwardRef as Ut, cloneElement as sr, createElement as cr } from "@wordpress/element";
|
|
6
6
|
import ur from "clsx";
|
|
7
7
|
import { Compartment as Tt, EditorSelection as gt, EditorState as fr } from "@codemirror/state";
|
|
8
8
|
import { ViewPlugin as dr, lineNumbers as mr, highlightActiveLineGutter as pr, highlightActiveLine as hr, dropCursor as vr, rectangularSelection as wr, crosshairCursor as gr, EditorView as ct, keymap as Er } from "@codemirror/view";
|
|
9
|
-
import { history as yr, historyKeymap as _r, defaultKeymap as
|
|
10
|
-
import { highlightSelectionMatches as
|
|
9
|
+
import { history as yr, historyKeymap as _r, defaultKeymap as br, indentWithTab as xr } from "@codemirror/commands";
|
|
10
|
+
import { highlightSelectionMatches as Cr, searchKeymap as Rr } from "@codemirror/search";
|
|
11
11
|
import { closeBrackets as kr, autocompletion as Pr, closeBracketsKeymap as Sr, completionKeymap as Tr } from "@codemirror/autocomplete";
|
|
12
12
|
import { foldGutter as Dr, syntaxHighlighting as Ar, defaultHighlightStyle as Nr, indentOnInput as Fr, bracketMatching as Ir, foldKeymap as Lr } from "@codemirror/language";
|
|
13
13
|
import { php as ut } from "@codemirror/lang-php";
|
|
@@ -15,7 +15,7 @@ import { FilePickerTree as Or, BinaryFilePreview as Br } from "@wp-playground/co
|
|
|
15
15
|
import { logger as Xe } from "@php-wasm/logger";
|
|
16
16
|
import Lt from "@php-wasm/universal/mime-types";
|
|
17
17
|
import { createPortal as Mr } from "react-dom";
|
|
18
|
-
const
|
|
18
|
+
const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
19
19
|
"svg",
|
|
20
20
|
{
|
|
21
21
|
width: "32",
|
|
@@ -58,7 +58,7 @@ const Ma = (n) => /* @__PURE__ */ r.createElement(
|
|
|
58
58
|
strokeWidth: "1.93129"
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
|
-
),
|
|
61
|
+
), Va = (n) => /* @__PURE__ */ r.createElement(
|
|
62
62
|
"svg",
|
|
63
63
|
{
|
|
64
64
|
width: "16",
|
|
@@ -77,7 +77,7 @@ const Ma = (n) => /* @__PURE__ */ r.createElement(
|
|
|
77
77
|
fill: "#949494"
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
|
-
),
|
|
80
|
+
), $a = (n) => /* @__PURE__ */ r.createElement(
|
|
81
81
|
"svg",
|
|
82
82
|
{
|
|
83
83
|
width: "20",
|
|
@@ -122,7 +122,7 @@ const Ma = (n) => /* @__PURE__ */ r.createElement(
|
|
|
122
122
|
viewBox: "0 0 16 16"
|
|
123
123
|
},
|
|
124
124
|
/* @__PURE__ */ r.createElement("path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z" })
|
|
125
|
-
),
|
|
125
|
+
), Wa = (n) => /* @__PURE__ */ r.createElement(
|
|
126
126
|
"svg",
|
|
127
127
|
{
|
|
128
128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -141,7 +141,7 @@ const Ma = (n) => /* @__PURE__ */ r.createElement(
|
|
|
141
141
|
fill: "#949494"
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
|
-
),
|
|
144
|
+
), Ha = /* @__PURE__ */ r.createElement(
|
|
145
145
|
"svg",
|
|
146
146
|
{
|
|
147
147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -160,10 +160,10 @@ const Ma = (n) => /* @__PURE__ */ r.createElement(
|
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
);
|
|
163
|
-
function
|
|
163
|
+
function Ua(n) {
|
|
164
164
|
return `data:${n.mime};base64,${n.data}`;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function za({
|
|
167
167
|
size: n = 24,
|
|
168
168
|
sidebarActive: c = !1
|
|
169
169
|
}) {
|
|
@@ -208,7 +208,7 @@ function Ha({
|
|
|
208
208
|
)
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
-
const Ot =
|
|
211
|
+
const Ot = Ut(({
|
|
212
212
|
icon: n,
|
|
213
213
|
size: c = 24,
|
|
214
214
|
...f
|
|
@@ -229,16 +229,16 @@ var It = { exports: {} }, lt = {};
|
|
|
229
229
|
* LICENSE file in the root directory of this source tree.
|
|
230
230
|
*/
|
|
231
231
|
var Bt;
|
|
232
|
-
function
|
|
232
|
+
function $r() {
|
|
233
233
|
if (Bt) return lt;
|
|
234
234
|
Bt = 1;
|
|
235
235
|
var n = r, c = Symbol.for("react.element"), f = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, T = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
236
|
-
function k(
|
|
237
|
-
var _,
|
|
238
|
-
h !== void 0 && (
|
|
239
|
-
for (_ in
|
|
240
|
-
if (
|
|
241
|
-
return { $$typeof: c, type:
|
|
236
|
+
function k(D, A, h) {
|
|
237
|
+
var _, F = {}, S = null, K = null;
|
|
238
|
+
h !== void 0 && (S = "" + h), A.key !== void 0 && (S = "" + A.key), A.ref !== void 0 && (K = A.ref);
|
|
239
|
+
for (_ in A) l.call(A, _) && !d.hasOwnProperty(_) && (F[_] = A[_]);
|
|
240
|
+
if (D && D.defaultProps) for (_ in A = D.defaultProps, A) F[_] === void 0 && (F[_] = A[_]);
|
|
241
|
+
return { $$typeof: c, type: D, key: S, ref: K, props: F, _owner: T.current };
|
|
242
242
|
}
|
|
243
243
|
return lt.Fragment = f, lt.jsx = k, lt.jsxs = k, lt;
|
|
244
244
|
}
|
|
@@ -253,56 +253,56 @@ var st = {};
|
|
|
253
253
|
* LICENSE file in the root directory of this source tree.
|
|
254
254
|
*/
|
|
255
255
|
var Mt;
|
|
256
|
-
function
|
|
256
|
+
function Wr() {
|
|
257
257
|
return Mt || (Mt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
258
|
-
var n = r, c = Symbol.for("react.element"), f = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), k = Symbol.for("react.provider"),
|
|
259
|
-
function
|
|
258
|
+
var n = r, c = Symbol.for("react.element"), f = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), D = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), K = Symbol.for("react.offscreen"), B = Symbol.iterator, C = "@@iterator";
|
|
259
|
+
function G(e) {
|
|
260
260
|
if (e === null || typeof e != "object")
|
|
261
261
|
return null;
|
|
262
|
-
var s =
|
|
262
|
+
var s = B && e[B] || e[C];
|
|
263
263
|
return typeof s == "function" ? s : null;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
265
|
+
var y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
266
|
+
function x(e) {
|
|
267
267
|
{
|
|
268
|
-
for (var s = arguments.length, m = new Array(s > 1 ? s - 1 : 0),
|
|
269
|
-
m[
|
|
270
|
-
|
|
268
|
+
for (var s = arguments.length, m = new Array(s > 1 ? s - 1 : 0), R = 1; R < s; R++)
|
|
269
|
+
m[R - 1] = arguments[R];
|
|
270
|
+
z("error", e, m);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function z(e, s, m) {
|
|
274
274
|
{
|
|
275
|
-
var
|
|
275
|
+
var R = y.ReactDebugCurrentFrame, U = R.getStackAddendum();
|
|
276
276
|
U !== "" && (s += "%s", m = m.concat([U]));
|
|
277
|
-
var
|
|
278
|
-
return String(
|
|
277
|
+
var Z = m.map(function(j) {
|
|
278
|
+
return String(j);
|
|
279
279
|
});
|
|
280
|
-
|
|
280
|
+
Z.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, Z);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
|
|
283
|
+
var J = !1, oe = !1, de = !1, g = !1, $ = !1, N;
|
|
284
|
+
N = Symbol.for("react.module.reference");
|
|
285
285
|
function p(e) {
|
|
286
|
-
return !!(typeof e == "string" || typeof e == "function" || e === l || e === d ||
|
|
286
|
+
return !!(typeof e == "string" || typeof e == "function" || e === l || e === d || $ || e === T || e === h || e === _ || g || e === K || J || oe || de || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === F || e.$$typeof === k || e.$$typeof === D || e.$$typeof === A || // This needs to include all possible module reference object
|
|
287
287
|
// types supported by any Flight configuration anywhere since
|
|
288
288
|
// we don't know which Flight build this will end up being used
|
|
289
289
|
// with.
|
|
290
|
-
e.$$typeof ===
|
|
290
|
+
e.$$typeof === N || e.getModuleId !== void 0));
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
var
|
|
294
|
-
if (
|
|
295
|
-
return
|
|
292
|
+
function M(e, s, m) {
|
|
293
|
+
var R = e.displayName;
|
|
294
|
+
if (R)
|
|
295
|
+
return R;
|
|
296
296
|
var U = s.displayName || s.name || "";
|
|
297
297
|
return U !== "" ? m + "(" + U + ")" : m;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Y(e) {
|
|
300
300
|
return e.displayName || "Context";
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function te(e) {
|
|
303
303
|
if (e == null)
|
|
304
304
|
return null;
|
|
305
|
-
if (typeof e.tag == "number" &&
|
|
305
|
+
if (typeof e.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
306
306
|
return e.displayName || e.name || null;
|
|
307
307
|
if (typeof e == "string")
|
|
308
308
|
return e;
|
|
@@ -322,21 +322,21 @@ function $r() {
|
|
|
322
322
|
}
|
|
323
323
|
if (typeof e == "object")
|
|
324
324
|
switch (e.$$typeof) {
|
|
325
|
-
case
|
|
325
|
+
case D:
|
|
326
326
|
var s = e;
|
|
327
|
-
return
|
|
327
|
+
return Y(s) + ".Consumer";
|
|
328
328
|
case k:
|
|
329
329
|
var m = e;
|
|
330
|
-
return
|
|
331
|
-
case
|
|
332
|
-
return
|
|
333
|
-
case
|
|
334
|
-
var
|
|
335
|
-
return
|
|
336
|
-
case
|
|
337
|
-
var U = e,
|
|
330
|
+
return Y(m._context) + ".Provider";
|
|
331
|
+
case A:
|
|
332
|
+
return M(e, e.render, "ForwardRef");
|
|
333
|
+
case F:
|
|
334
|
+
var R = e.displayName || null;
|
|
335
|
+
return R !== null ? R : te(e.type) || "Memo";
|
|
336
|
+
case S: {
|
|
337
|
+
var U = e, Z = U._payload, j = U._init;
|
|
338
338
|
try {
|
|
339
|
-
return
|
|
339
|
+
return te(j(Z));
|
|
340
340
|
} catch {
|
|
341
341
|
return null;
|
|
342
342
|
}
|
|
@@ -344,18 +344,18 @@ function $r() {
|
|
|
344
344
|
}
|
|
345
345
|
return null;
|
|
346
346
|
}
|
|
347
|
-
var
|
|
348
|
-
function
|
|
347
|
+
var L = Object.assign, Q = 0, X, ve, me, Ne, Pe, re, Oe;
|
|
348
|
+
function ne() {
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
ne.__reactDisabledLog = !0;
|
|
351
351
|
function Me() {
|
|
352
352
|
{
|
|
353
|
-
if (
|
|
354
|
-
|
|
353
|
+
if (Q === 0) {
|
|
354
|
+
X = console.log, ve = console.info, me = console.warn, Ne = console.error, Pe = console.group, re = console.groupCollapsed, Oe = console.groupEnd;
|
|
355
355
|
var e = {
|
|
356
356
|
configurable: !0,
|
|
357
357
|
enumerable: !0,
|
|
358
|
-
value:
|
|
358
|
+
value: ne,
|
|
359
359
|
writable: !0
|
|
360
360
|
};
|
|
361
361
|
Object.defineProperties(console, {
|
|
@@ -368,146 +368,146 @@ function $r() {
|
|
|
368
368
|
groupEnd: e
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
|
-
|
|
371
|
+
Q++;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function _e() {
|
|
375
375
|
{
|
|
376
|
-
if (
|
|
376
|
+
if (Q--, Q === 0) {
|
|
377
377
|
var e = {
|
|
378
378
|
configurable: !0,
|
|
379
379
|
enumerable: !0,
|
|
380
380
|
writable: !0
|
|
381
381
|
};
|
|
382
382
|
Object.defineProperties(console, {
|
|
383
|
-
log:
|
|
384
|
-
value:
|
|
383
|
+
log: L({}, e, {
|
|
384
|
+
value: X
|
|
385
385
|
}),
|
|
386
|
-
info:
|
|
386
|
+
info: L({}, e, {
|
|
387
387
|
value: ve
|
|
388
388
|
}),
|
|
389
|
-
warn:
|
|
390
|
-
value:
|
|
389
|
+
warn: L({}, e, {
|
|
390
|
+
value: me
|
|
391
391
|
}),
|
|
392
|
-
error:
|
|
392
|
+
error: L({}, e, {
|
|
393
393
|
value: Ne
|
|
394
394
|
}),
|
|
395
|
-
group:
|
|
395
|
+
group: L({}, e, {
|
|
396
396
|
value: Pe
|
|
397
397
|
}),
|
|
398
|
-
groupCollapsed:
|
|
399
|
-
value:
|
|
398
|
+
groupCollapsed: L({}, e, {
|
|
399
|
+
value: re
|
|
400
400
|
}),
|
|
401
|
-
groupEnd:
|
|
401
|
+
groupEnd: L({}, e, {
|
|
402
402
|
value: Oe
|
|
403
403
|
})
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
|
|
406
|
+
Q < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
var ke =
|
|
409
|
+
var ke = y.ReactCurrentDispatcher, Fe;
|
|
410
410
|
function Se(e, s, m) {
|
|
411
411
|
{
|
|
412
412
|
if (Fe === void 0)
|
|
413
413
|
try {
|
|
414
414
|
throw Error();
|
|
415
415
|
} catch (U) {
|
|
416
|
-
var
|
|
417
|
-
Fe =
|
|
416
|
+
var R = U.stack.trim().match(/\n( *(at )?)/);
|
|
417
|
+
Fe = R && R[1] || "";
|
|
418
418
|
}
|
|
419
419
|
return `
|
|
420
420
|
` + Fe + e;
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
var
|
|
423
|
+
var fe = !1, H;
|
|
424
424
|
{
|
|
425
|
-
var
|
|
426
|
-
H = new
|
|
425
|
+
var w = typeof WeakMap == "function" ? WeakMap : Map;
|
|
426
|
+
H = new w();
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
if (!e ||
|
|
428
|
+
function he(e, s) {
|
|
429
|
+
if (!e || fe)
|
|
430
430
|
return "";
|
|
431
431
|
{
|
|
432
432
|
var m = H.get(e);
|
|
433
433
|
if (m !== void 0)
|
|
434
434
|
return m;
|
|
435
435
|
}
|
|
436
|
-
var
|
|
437
|
-
|
|
436
|
+
var R;
|
|
437
|
+
fe = !0;
|
|
438
438
|
var U = Error.prepareStackTrace;
|
|
439
439
|
Error.prepareStackTrace = void 0;
|
|
440
|
-
var
|
|
441
|
-
|
|
440
|
+
var Z;
|
|
441
|
+
Z = ke.current, ke.current = null, Me();
|
|
442
442
|
try {
|
|
443
443
|
if (s) {
|
|
444
|
-
var
|
|
444
|
+
var j = function() {
|
|
445
445
|
throw Error();
|
|
446
446
|
};
|
|
447
|
-
if (Object.defineProperty(
|
|
447
|
+
if (Object.defineProperty(j.prototype, "props", {
|
|
448
448
|
set: function() {
|
|
449
449
|
throw Error();
|
|
450
450
|
}
|
|
451
451
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
452
452
|
try {
|
|
453
|
-
Reflect.construct(
|
|
454
|
-
} catch (
|
|
455
|
-
|
|
453
|
+
Reflect.construct(j, []);
|
|
454
|
+
} catch (Ce) {
|
|
455
|
+
R = Ce;
|
|
456
456
|
}
|
|
457
|
-
Reflect.construct(e, [],
|
|
457
|
+
Reflect.construct(e, [], j);
|
|
458
458
|
} else {
|
|
459
459
|
try {
|
|
460
|
-
|
|
461
|
-
} catch (
|
|
462
|
-
|
|
460
|
+
j.call();
|
|
461
|
+
} catch (Ce) {
|
|
462
|
+
R = Ce;
|
|
463
463
|
}
|
|
464
|
-
e.call(
|
|
464
|
+
e.call(j.prototype);
|
|
465
465
|
}
|
|
466
466
|
} else {
|
|
467
467
|
try {
|
|
468
468
|
throw Error();
|
|
469
|
-
} catch (
|
|
470
|
-
|
|
469
|
+
} catch (Ce) {
|
|
470
|
+
R = Ce;
|
|
471
471
|
}
|
|
472
472
|
e();
|
|
473
473
|
}
|
|
474
|
-
} catch (
|
|
475
|
-
if (
|
|
476
|
-
for (var I =
|
|
477
|
-
`), Ee =
|
|
478
|
-
`), se = I.length - 1,
|
|
479
|
-
|
|
480
|
-
for (; se >= 1 &&
|
|
481
|
-
if (I[se] !== Ee[
|
|
482
|
-
if (se !== 1 ||
|
|
474
|
+
} catch (Ce) {
|
|
475
|
+
if (Ce && R && typeof Ce.stack == "string") {
|
|
476
|
+
for (var I = Ce.stack.split(`
|
|
477
|
+
`), Ee = R.stack.split(`
|
|
478
|
+
`), se = I.length - 1, ue = Ee.length - 1; se >= 1 && ue >= 0 && I[se] !== Ee[ue]; )
|
|
479
|
+
ue--;
|
|
480
|
+
for (; se >= 1 && ue >= 0; se--, ue--)
|
|
481
|
+
if (I[se] !== Ee[ue]) {
|
|
482
|
+
if (se !== 1 || ue !== 1)
|
|
483
483
|
do
|
|
484
|
-
if (se--,
|
|
484
|
+
if (se--, ue--, ue < 0 || I[se] !== Ee[ue]) {
|
|
485
485
|
var Te = `
|
|
486
486
|
` + I[se].replace(" at new ", " at ");
|
|
487
487
|
return e.displayName && Te.includes("<anonymous>") && (Te = Te.replace("<anonymous>", e.displayName)), typeof e == "function" && H.set(e, Te), Te;
|
|
488
488
|
}
|
|
489
|
-
while (se >= 1 &&
|
|
489
|
+
while (se >= 1 && ue >= 0);
|
|
490
490
|
break;
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
} finally {
|
|
494
|
-
|
|
494
|
+
fe = !1, ke.current = Z, _e(), Error.prepareStackTrace = U;
|
|
495
495
|
}
|
|
496
|
-
var Je = e ? e.displayName || e.name : "",
|
|
497
|
-
return typeof e == "function" && H.set(e,
|
|
496
|
+
var Je = e ? e.displayName || e.name : "", He = Je ? Se(Je) : "";
|
|
497
|
+
return typeof e == "function" && H.set(e, He), He;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
return
|
|
499
|
+
function pe(e, s, m) {
|
|
500
|
+
return he(e, !1);
|
|
501
501
|
}
|
|
502
502
|
function we(e) {
|
|
503
503
|
var s = e.prototype;
|
|
504
504
|
return !!(s && s.isReactComponent);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function b(e, s, m) {
|
|
507
507
|
if (e == null)
|
|
508
508
|
return "";
|
|
509
509
|
if (typeof e == "function")
|
|
510
|
-
return
|
|
510
|
+
return he(e, we(e));
|
|
511
511
|
if (typeof e == "string")
|
|
512
512
|
return Se(e);
|
|
513
513
|
switch (e) {
|
|
@@ -518,50 +518,50 @@ function $r() {
|
|
|
518
518
|
}
|
|
519
519
|
if (typeof e == "object")
|
|
520
520
|
switch (e.$$typeof) {
|
|
521
|
-
case
|
|
522
|
-
return
|
|
523
|
-
case
|
|
524
|
-
return
|
|
525
|
-
case
|
|
526
|
-
var
|
|
521
|
+
case A:
|
|
522
|
+
return pe(e.render);
|
|
523
|
+
case F:
|
|
524
|
+
return b(e.type, s, m);
|
|
525
|
+
case S: {
|
|
526
|
+
var R = e, U = R._payload, Z = R._init;
|
|
527
527
|
try {
|
|
528
|
-
return
|
|
528
|
+
return b(Z(U), s, m);
|
|
529
529
|
} catch {
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
return "";
|
|
534
534
|
}
|
|
535
|
-
var
|
|
536
|
-
function
|
|
535
|
+
var P = Object.prototype.hasOwnProperty, ie = {}, le = y.ReactDebugCurrentFrame;
|
|
536
|
+
function ce(e) {
|
|
537
537
|
if (e) {
|
|
538
|
-
var s = e._owner, m =
|
|
538
|
+
var s = e._owner, m = b(e.type, e._source, s ? s.type : null);
|
|
539
539
|
le.setExtraStackFrame(m);
|
|
540
540
|
} else
|
|
541
541
|
le.setExtraStackFrame(null);
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function be(e, s, m, R, U) {
|
|
544
544
|
{
|
|
545
|
-
var
|
|
546
|
-
for (var
|
|
547
|
-
if (
|
|
545
|
+
var Z = Function.call.bind(P);
|
|
546
|
+
for (var j in e)
|
|
547
|
+
if (Z(e, j)) {
|
|
548
548
|
var I = void 0;
|
|
549
549
|
try {
|
|
550
|
-
if (typeof e[
|
|
551
|
-
var Ee = Error((
|
|
550
|
+
if (typeof e[j] != "function") {
|
|
551
|
+
var Ee = Error((R || "React class") + ": " + m + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
552
552
|
throw Ee.name = "Invariant Violation", Ee;
|
|
553
553
|
}
|
|
554
|
-
I = e[
|
|
554
|
+
I = e[j](s, j, R, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
555
555
|
} catch (se) {
|
|
556
556
|
I = se;
|
|
557
557
|
}
|
|
558
|
-
I && !(I instanceof Error) && (
|
|
558
|
+
I && !(I instanceof Error) && (ce(U), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", R || "React class", m, j, typeof I), ce(null)), I instanceof Error && !(I.message in ie) && (ie[I.message] = !0, ce(U), x("Failed %s type: %s", m, I.message), ce(null));
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
var
|
|
562
|
+
var $e = Array.isArray;
|
|
563
563
|
function ge(e) {
|
|
564
|
-
return
|
|
564
|
+
return $e(e);
|
|
565
565
|
}
|
|
566
566
|
function Ie(e) {
|
|
567
567
|
{
|
|
@@ -581,16 +581,16 @@ function $r() {
|
|
|
581
581
|
}
|
|
582
582
|
function ft(e) {
|
|
583
583
|
if (at(e))
|
|
584
|
-
return
|
|
584
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ie(e)), Ge(e);
|
|
585
585
|
}
|
|
586
|
-
var dt =
|
|
586
|
+
var dt = y.ReactCurrentOwner, Et = {
|
|
587
587
|
key: !0,
|
|
588
588
|
ref: !0,
|
|
589
589
|
__self: !0,
|
|
590
590
|
__source: !0
|
|
591
|
-
}, mt,
|
|
591
|
+
}, mt, We;
|
|
592
592
|
function Ye(e) {
|
|
593
|
-
if (
|
|
593
|
+
if (P.call(e, "ref")) {
|
|
594
594
|
var s = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
595
595
|
if (s && s.isReactWarning)
|
|
596
596
|
return !1;
|
|
@@ -598,7 +598,7 @@ function $r() {
|
|
|
598
598
|
return e.ref !== void 0;
|
|
599
599
|
}
|
|
600
600
|
function yt(e) {
|
|
601
|
-
if (
|
|
601
|
+
if (P.call(e, "key")) {
|
|
602
602
|
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
603
603
|
if (s && s.isReactWarning)
|
|
604
604
|
return !1;
|
|
@@ -608,10 +608,10 @@ function $r() {
|
|
|
608
608
|
function _t(e, s) {
|
|
609
609
|
typeof e.ref == "string" && dt.current;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function bt(e, s) {
|
|
612
612
|
{
|
|
613
613
|
var m = function() {
|
|
614
|
-
mt || (mt = !0,
|
|
614
|
+
mt || (mt = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
615
615
|
};
|
|
616
616
|
m.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
617
617
|
get: m,
|
|
@@ -619,10 +619,10 @@ function $r() {
|
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function xt(e, s) {
|
|
623
623
|
{
|
|
624
624
|
var m = function() {
|
|
625
|
-
|
|
625
|
+
We || (We = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
626
626
|
};
|
|
627
627
|
m.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
628
628
|
get: m,
|
|
@@ -630,7 +630,7 @@ function $r() {
|
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
var
|
|
633
|
+
var Ct = function(e, s, m, R, U, Z, j) {
|
|
634
634
|
var I = {
|
|
635
635
|
// This tag allows us to uniquely identify this as a React Element
|
|
636
636
|
$$typeof: c,
|
|
@@ -638,9 +638,9 @@ function $r() {
|
|
|
638
638
|
type: e,
|
|
639
639
|
key: s,
|
|
640
640
|
ref: m,
|
|
641
|
-
props:
|
|
641
|
+
props: j,
|
|
642
642
|
// Record the component responsible for creating this element.
|
|
643
|
-
_owner:
|
|
643
|
+
_owner: Z
|
|
644
644
|
};
|
|
645
645
|
return I._store = {}, Object.defineProperty(I._store, "validated", {
|
|
646
646
|
configurable: !1,
|
|
@@ -651,7 +651,7 @@ function $r() {
|
|
|
651
651
|
configurable: !1,
|
|
652
652
|
enumerable: !1,
|
|
653
653
|
writable: !1,
|
|
654
|
-
value:
|
|
654
|
+
value: R
|
|
655
655
|
}), Object.defineProperty(I, "_source", {
|
|
656
656
|
configurable: !1,
|
|
657
657
|
enumerable: !1,
|
|
@@ -659,28 +659,28 @@ function $r() {
|
|
|
659
659
|
value: U
|
|
660
660
|
}), Object.freeze && (Object.freeze(I.props), Object.freeze(I)), I;
|
|
661
661
|
};
|
|
662
|
-
function pt(e, s, m,
|
|
662
|
+
function pt(e, s, m, R, U) {
|
|
663
663
|
{
|
|
664
|
-
var
|
|
664
|
+
var Z, j = {}, I = null, Ee = null;
|
|
665
665
|
m !== void 0 && (ft(m), I = "" + m), yt(s) && (ft(s.key), I = "" + s.key), Ye(s) && (Ee = s.ref, _t(s, U));
|
|
666
|
-
for (
|
|
667
|
-
|
|
666
|
+
for (Z in s)
|
|
667
|
+
P.call(s, Z) && !Et.hasOwnProperty(Z) && (j[Z] = s[Z]);
|
|
668
668
|
if (e && e.defaultProps) {
|
|
669
669
|
var se = e.defaultProps;
|
|
670
|
-
for (
|
|
671
|
-
|
|
670
|
+
for (Z in se)
|
|
671
|
+
j[Z] === void 0 && (j[Z] = se[Z]);
|
|
672
672
|
}
|
|
673
673
|
if (I || Ee) {
|
|
674
|
-
var
|
|
675
|
-
I &&
|
|
674
|
+
var ue = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
675
|
+
I && bt(j, ue), Ee && xt(j, ue);
|
|
676
676
|
}
|
|
677
|
-
return
|
|
677
|
+
return Ct(e, I, Ee, U, R, dt.current, j);
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
-
var Ze =
|
|
680
|
+
var Ze = y.ReactCurrentOwner, ot = y.ReactDebugCurrentFrame;
|
|
681
681
|
function Ve(e) {
|
|
682
682
|
if (e) {
|
|
683
|
-
var s = e._owner, m =
|
|
683
|
+
var s = e._owner, m = b(e.type, e._source, s ? s.type : null);
|
|
684
684
|
ot.setExtraStackFrame(m);
|
|
685
685
|
} else
|
|
686
686
|
ot.setExtraStackFrame(null);
|
|
@@ -693,7 +693,7 @@ function $r() {
|
|
|
693
693
|
function ht() {
|
|
694
694
|
{
|
|
695
695
|
if (Ze.current) {
|
|
696
|
-
var e =
|
|
696
|
+
var e = te(Ze.current.type);
|
|
697
697
|
if (e)
|
|
698
698
|
return `
|
|
699
699
|
|
|
@@ -727,8 +727,8 @@ Check the top-level render call using <` + m + ">.");
|
|
|
727
727
|
if (vt[m])
|
|
728
728
|
return;
|
|
729
729
|
vt[m] = !0;
|
|
730
|
-
var
|
|
731
|
-
e && e._owner && e._owner !== Ze.current && (
|
|
730
|
+
var R = "";
|
|
731
|
+
e && e._owner && e._owner !== Ze.current && (R = " It was passed a child from " + te(e._owner.type) + "."), Ve(e), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, R), Ve(null);
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
function t(e, s) {
|
|
@@ -737,16 +737,16 @@ Check the top-level render call using <` + m + ">.");
|
|
|
737
737
|
return;
|
|
738
738
|
if (ge(e))
|
|
739
739
|
for (var m = 0; m < e.length; m++) {
|
|
740
|
-
var
|
|
741
|
-
qe(
|
|
740
|
+
var R = e[m];
|
|
741
|
+
qe(R) && wt(R, s);
|
|
742
742
|
}
|
|
743
743
|
else if (qe(e))
|
|
744
744
|
e._store && (e._store.validated = !0);
|
|
745
745
|
else if (e) {
|
|
746
|
-
var U =
|
|
746
|
+
var U = G(e);
|
|
747
747
|
if (typeof U == "function" && U !== e.entries)
|
|
748
|
-
for (var
|
|
749
|
-
qe(
|
|
748
|
+
for (var Z = U.call(e), j; !(j = Z.next()).done; )
|
|
749
|
+
qe(j.value) && wt(j.value, s);
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
}
|
|
@@ -758,78 +758,78 @@ Check the top-level render call using <` + m + ">.");
|
|
|
758
758
|
var m;
|
|
759
759
|
if (typeof s == "function")
|
|
760
760
|
m = s.propTypes;
|
|
761
|
-
else if (typeof s == "object" && (s.$$typeof ===
|
|
761
|
+
else if (typeof s == "object" && (s.$$typeof === A || // Note: Memo only checks outer props here.
|
|
762
762
|
// Inner props are checked in the reconciler.
|
|
763
|
-
s.$$typeof ===
|
|
763
|
+
s.$$typeof === F))
|
|
764
764
|
m = s.propTypes;
|
|
765
765
|
else
|
|
766
766
|
return;
|
|
767
767
|
if (m) {
|
|
768
|
-
var
|
|
769
|
-
|
|
768
|
+
var R = te(s);
|
|
769
|
+
be(m, e.props, "prop", R, e);
|
|
770
770
|
} else if (s.PropTypes !== void 0 && !Ke) {
|
|
771
771
|
Ke = !0;
|
|
772
|
-
var U =
|
|
773
|
-
|
|
772
|
+
var U = te(s);
|
|
773
|
+
x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", U || "Unknown");
|
|
774
774
|
}
|
|
775
|
-
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved &&
|
|
775
|
+
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
778
|
function o(e) {
|
|
779
779
|
{
|
|
780
780
|
for (var s = Object.keys(e.props), m = 0; m < s.length; m++) {
|
|
781
|
-
var
|
|
782
|
-
if (
|
|
783
|
-
Ve(e),
|
|
781
|
+
var R = s[m];
|
|
782
|
+
if (R !== "children" && R !== "key") {
|
|
783
|
+
Ve(e), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", R), Ve(null);
|
|
784
784
|
break;
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
|
-
e.ref !== null && (Ve(e),
|
|
787
|
+
e.ref !== null && (Ve(e), x("Invalid attribute `ref` supplied to `React.Fragment`."), Ve(null));
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
790
|
var i = {};
|
|
791
|
-
function u(e, s, m,
|
|
791
|
+
function u(e, s, m, R, U, Z) {
|
|
792
792
|
{
|
|
793
|
-
var
|
|
794
|
-
if (!
|
|
793
|
+
var j = p(e);
|
|
794
|
+
if (!j) {
|
|
795
795
|
var I = "";
|
|
796
796
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (I += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
797
797
|
var Ee = Rt();
|
|
798
798
|
Ee ? I += Ee : I += ht();
|
|
799
799
|
var se;
|
|
800
|
-
e === null ? se = "null" : ge(e) ? se = "array" : e !== void 0 && e.$$typeof === c ? (se = "<" + (
|
|
800
|
+
e === null ? se = "null" : ge(e) ? se = "array" : e !== void 0 && e.$$typeof === c ? (se = "<" + (te(e.type) || "Unknown") + " />", I = " Did you accidentally export a JSX literal instead of a component?") : se = typeof e, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", se, I);
|
|
801
801
|
}
|
|
802
|
-
var
|
|
803
|
-
if (
|
|
804
|
-
return
|
|
805
|
-
if (
|
|
802
|
+
var ue = pt(e, s, m, U, Z);
|
|
803
|
+
if (ue == null)
|
|
804
|
+
return ue;
|
|
805
|
+
if (j) {
|
|
806
806
|
var Te = s.children;
|
|
807
807
|
if (Te !== void 0)
|
|
808
|
-
if (
|
|
808
|
+
if (R)
|
|
809
809
|
if (ge(Te)) {
|
|
810
810
|
for (var Je = 0; Je < Te.length; Je++)
|
|
811
811
|
t(Te[Je], e);
|
|
812
812
|
Object.freeze && Object.freeze(Te);
|
|
813
813
|
} else
|
|
814
|
-
|
|
814
|
+
x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
815
815
|
else
|
|
816
816
|
t(Te, e);
|
|
817
817
|
}
|
|
818
|
-
if (
|
|
819
|
-
var
|
|
818
|
+
if (P.call(s, "key")) {
|
|
819
|
+
var He = te(e), Ce = Object.keys(s).filter(function(Kt) {
|
|
820
820
|
return Kt !== "key";
|
|
821
|
-
}), Pt =
|
|
822
|
-
if (!i[
|
|
823
|
-
var Zt =
|
|
824
|
-
|
|
821
|
+
}), Pt = Ce.length > 0 ? "{key: someKey, " + Ce.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
822
|
+
if (!i[He + Pt]) {
|
|
823
|
+
var Zt = Ce.length > 0 ? "{" + Ce.join(": ..., ") + ": ...}" : "{}";
|
|
824
|
+
x(`A props object containing a "key" prop is being spread into JSX:
|
|
825
825
|
let props = %s;
|
|
826
826
|
<%s {...props} />
|
|
827
827
|
React keys must be passed directly to JSX without using spread:
|
|
828
828
|
let props = %s;
|
|
829
|
-
<%s key={someKey} {...props} />`, Pt,
|
|
829
|
+
<%s key={someKey} {...props} />`, Pt, He, Zt, He), i[He + Pt] = !0;
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
|
-
return e === l ? o(
|
|
832
|
+
return e === l ? o(ue) : a(ue), ue;
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
function v(e, s, m) {
|
|
@@ -838,12 +838,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
838
838
|
function E(e, s, m) {
|
|
839
839
|
return u(e, s, m, !1);
|
|
840
840
|
}
|
|
841
|
-
var
|
|
842
|
-
st.Fragment = l, st.jsx =
|
|
841
|
+
var ae = E, xe = v;
|
|
842
|
+
st.Fragment = l, st.jsx = ae, st.jsxs = xe;
|
|
843
843
|
}()), st;
|
|
844
844
|
}
|
|
845
|
-
process.env.NODE_ENV === "production" ? It.exports =
|
|
846
|
-
var Ae = It.exports, rt = (n) => cr("path", n), nt =
|
|
845
|
+
process.env.NODE_ENV === "production" ? It.exports = $r() : It.exports = Wr();
|
|
846
|
+
var Ae = It.exports, rt = (n) => cr("path", n), nt = Ut(
|
|
847
847
|
/**
|
|
848
848
|
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
|
849
849
|
* Other props will be passed through to svg component.
|
|
@@ -862,19 +862,19 @@ var Ae = It.exports, rt = (n) => cr("path", n), nt = Ht(
|
|
|
862
862
|
}
|
|
863
863
|
);
|
|
864
864
|
nt.displayName = "SVG";
|
|
865
|
-
const
|
|
865
|
+
const Hr = /* @__PURE__ */ Ae.jsx(nt, {
|
|
866
866
|
viewBox: "0 0 24 24",
|
|
867
867
|
xmlns: "http://www.w3.org/2000/svg",
|
|
868
868
|
children: /* @__PURE__ */ Ae.jsx(rt, {
|
|
869
869
|
d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
|
|
870
870
|
})
|
|
871
|
-
}),
|
|
871
|
+
}), Ur = /* @__PURE__ */ Ae.jsx(nt, {
|
|
872
872
|
xmlns: "http://www.w3.org/2000/svg",
|
|
873
873
|
viewBox: "0 0 24 24",
|
|
874
874
|
children: /* @__PURE__ */ Ae.jsx(rt, {
|
|
875
875
|
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
|
876
876
|
})
|
|
877
|
-
}),
|
|
877
|
+
}), zr = /* @__PURE__ */ Ae.jsx(nt, {
|
|
878
878
|
viewBox: "0 0 24 24",
|
|
879
879
|
xmlns: "http://www.w3.org/2000/svg",
|
|
880
880
|
children: /* @__PURE__ */ Ae.jsx(rt, {
|
|
@@ -916,10 +916,10 @@ function Dt(n) {
|
|
|
916
916
|
!d || d === "/" ? d = d === "/" ? `/${k}` : k : d = `${d}/${k}`, T.push(d);
|
|
917
917
|
return T;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function ze(n, c, f) {
|
|
920
920
|
return n && (n === c ? f : n.startsWith(c === "/" ? "/" : `${c}/`) ? f + n.slice(c.length) : n);
|
|
921
921
|
}
|
|
922
|
-
const nn =
|
|
922
|
+
const nn = $t(function({
|
|
923
923
|
withContextMenu: c = !0,
|
|
924
924
|
readOnly: f = !1,
|
|
925
925
|
filesystem: l,
|
|
@@ -927,36 +927,36 @@ const nn = zt(function({
|
|
|
927
927
|
initialSelectedPath: d,
|
|
928
928
|
onSelect: k = () => {
|
|
929
929
|
},
|
|
930
|
-
onDoubleClickFile:
|
|
931
|
-
},
|
|
932
|
-
const h = Ft(() => je("/", T || "/"), [T]), [_,
|
|
930
|
+
onDoubleClickFile: D
|
|
931
|
+
}, A) {
|
|
932
|
+
const h = Ft(() => je("/", T || "/"), [T]), [_, F] = ee(() => {
|
|
933
933
|
if (!d)
|
|
934
934
|
return {};
|
|
935
935
|
const t = {};
|
|
936
936
|
for (const a of Dt(d))
|
|
937
937
|
t[a] = !0;
|
|
938
938
|
return t;
|
|
939
|
-
}), [
|
|
939
|
+
}), [S, K] = ee(
|
|
940
940
|
() => d ?? null
|
|
941
|
-
), [
|
|
941
|
+
), [B, C] = ee(
|
|
942
942
|
() => d ?? null
|
|
943
|
-
), [
|
|
943
|
+
), [G, y] = ee({}), [x, z] = ee(
|
|
944
944
|
{}
|
|
945
|
-
), [
|
|
945
|
+
), [J, oe] = ee(null), [de, g] = ee(
|
|
946
946
|
null
|
|
947
|
-
),
|
|
948
|
-
for (const t of Object.keys(
|
|
949
|
-
clearTimeout(
|
|
950
|
-
},
|
|
951
|
-
const a =
|
|
952
|
-
a && (clearTimeout(a), delete
|
|
947
|
+
), $ = V({}), N = V(!1), p = V(null), M = V(null), Y = V(x), te = V(G), L = () => {
|
|
948
|
+
for (const t of Object.keys($.current))
|
|
949
|
+
clearTimeout($.current[t]), delete $.current[t];
|
|
950
|
+
}, Q = (t) => {
|
|
951
|
+
const a = $.current[t];
|
|
952
|
+
a && (clearTimeout(a), delete $.current[t]);
|
|
953
953
|
};
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}, [
|
|
957
|
-
|
|
958
|
-
}, [
|
|
959
|
-
const
|
|
954
|
+
W(() => {
|
|
955
|
+
Y.current = x;
|
|
956
|
+
}, [x]), W(() => {
|
|
957
|
+
te.current = G;
|
|
958
|
+
}, [G]);
|
|
959
|
+
const X = (t) => {
|
|
960
960
|
var o;
|
|
961
961
|
const a = (o = p.current) == null ? void 0 : o.querySelector(
|
|
962
962
|
`[data-path="${CSS.escape(t)}"]`
|
|
@@ -965,7 +965,7 @@ const nn = zt(function({
|
|
|
965
965
|
behavior: "smooth",
|
|
966
966
|
block: "nearest"
|
|
967
967
|
}));
|
|
968
|
-
}, ve = (t, a = "") => a ? je(a, t.name) : je("/", t.name),
|
|
968
|
+
}, ve = (t, a = "") => a ? je(a, t.name) : je("/", t.name), me = (t, a) => t.children ? t.children : G[a], Ne = async (t, a) => {
|
|
969
969
|
const o = await t.listFiles(a), i = [];
|
|
970
970
|
for (const u of o) {
|
|
971
971
|
const v = a === "/" ? `/${u}` : `${a}/${u}`, E = await t.isDir(v);
|
|
@@ -974,65 +974,65 @@ const nn = zt(function({
|
|
|
974
974
|
return i.sort((u, v) => {
|
|
975
975
|
var e;
|
|
976
976
|
if (u.type !== v.type) return u.type === "folder" ? -1 : 1;
|
|
977
|
-
const E = a === "/" ? `/${u.name}` : `${a}/${u.name}`,
|
|
978
|
-
if (
|
|
979
|
-
if (E ===
|
|
980
|
-
if (
|
|
977
|
+
const E = a === "/" ? `/${u.name}` : `${a}/${u.name}`, ae = a === "/" ? `/${v.name}` : `${a}/${v.name}`, xe = (e = we.current) == null ? void 0 : e.tempPath;
|
|
978
|
+
if (xe) {
|
|
979
|
+
if (E === xe) return -1;
|
|
980
|
+
if (ae === xe) return 1;
|
|
981
981
|
}
|
|
982
982
|
return u.name.localeCompare(v.name);
|
|
983
983
|
}), i;
|
|
984
|
-
}, Pe = async (t) => await Ne(l, t),
|
|
984
|
+
}, Pe = async (t) => await Ne(l, t), re = (t, a) => {
|
|
985
985
|
if (a.type !== "folder")
|
|
986
986
|
return a.children;
|
|
987
|
-
const o = a.children ??
|
|
988
|
-
return o ||
|
|
987
|
+
const o = a.children ?? te.current[t];
|
|
988
|
+
return o || Y.current[t] ? o : (z((i) => ({ ...i, [t]: !0 })), new Promise((i) => {
|
|
989
989
|
Pe(t).then((u) => {
|
|
990
|
-
|
|
990
|
+
y((v) => ({
|
|
991
991
|
...v,
|
|
992
992
|
[t]: u ?? []
|
|
993
993
|
})), i(u ?? []);
|
|
994
994
|
}).catch(() => {
|
|
995
995
|
i([]);
|
|
996
996
|
}).finally(() => {
|
|
997
|
-
|
|
997
|
+
z((u) => {
|
|
998
998
|
const v = { ...u };
|
|
999
999
|
return delete v[t], v;
|
|
1000
1000
|
});
|
|
1001
1001
|
});
|
|
1002
1002
|
}));
|
|
1003
1003
|
}, Oe = (t, a) => {
|
|
1004
|
-
a.type === "folder" && (typeof window > "u" ||
|
|
1005
|
-
|
|
1004
|
+
a.type === "folder" && (typeof window > "u" || $.current[t] || ($.current[t] = window.setTimeout(() => {
|
|
1005
|
+
F((o) => o[t] ? o : { ...o, [t]: !0 }), re(t, a), delete $.current[t];
|
|
1006
1006
|
}, 600)));
|
|
1007
|
-
},
|
|
1007
|
+
}, ne = (t) => (z((a) => ({ ...a, [t]: !0 })), new Promise((a) => {
|
|
1008
1008
|
Pe(t).then((o) => {
|
|
1009
|
-
|
|
1009
|
+
y((i) => ({
|
|
1010
1010
|
...i,
|
|
1011
1011
|
[t]: o ?? []
|
|
1012
1012
|
})), a(o ?? []);
|
|
1013
1013
|
}).catch(() => {
|
|
1014
1014
|
a([]);
|
|
1015
1015
|
}).finally(() => {
|
|
1016
|
-
|
|
1016
|
+
z((o) => {
|
|
1017
1017
|
const i = { ...o };
|
|
1018
1018
|
return delete i[t], i;
|
|
1019
1019
|
});
|
|
1020
1020
|
});
|
|
1021
1021
|
})), Me = (t, a, o) => {
|
|
1022
|
-
|
|
1022
|
+
F((i) => ({
|
|
1023
1023
|
...i,
|
|
1024
1024
|
[t]: o
|
|
1025
|
-
})), o ?
|
|
1025
|
+
})), o ? re(t, a) : y((i) => {
|
|
1026
1026
|
if (i[t] === void 0)
|
|
1027
1027
|
return i;
|
|
1028
1028
|
const u = { ...i };
|
|
1029
1029
|
return delete u[t], u;
|
|
1030
1030
|
});
|
|
1031
|
-
},
|
|
1031
|
+
}, _e = async (t) => {
|
|
1032
1032
|
if (!t) return;
|
|
1033
1033
|
const a = Dt(t);
|
|
1034
1034
|
if (a.length === 0) return;
|
|
1035
|
-
|
|
1035
|
+
F((u) => {
|
|
1036
1036
|
const v = { ...u };
|
|
1037
1037
|
for (const E of a)
|
|
1038
1038
|
v[E] = !0;
|
|
@@ -1042,38 +1042,38 @@ const nn = zt(function({
|
|
|
1042
1042
|
{ name: h, type: "folder" }
|
|
1043
1043
|
], i = "";
|
|
1044
1044
|
for (const u of a) {
|
|
1045
|
-
const v = o == null ? void 0 : o.find((
|
|
1045
|
+
const v = o == null ? void 0 : o.find((ae) => ve(ae, i) === u);
|
|
1046
1046
|
if (!v || v.type !== "folder") {
|
|
1047
1047
|
i = u, o = [];
|
|
1048
1048
|
continue;
|
|
1049
1049
|
}
|
|
1050
|
-
o = await
|
|
1050
|
+
o = await re(u, v) ?? te.current[u], i = u;
|
|
1051
1051
|
}
|
|
1052
1052
|
}, ke = (t, a) => {
|
|
1053
|
-
!t || !a || t === a || (
|
|
1053
|
+
!t || !a || t === a || (F((o) => {
|
|
1054
1054
|
let i = !1;
|
|
1055
1055
|
const u = { ...o };
|
|
1056
1056
|
for (const v of Object.keys(o)) {
|
|
1057
|
-
const E =
|
|
1057
|
+
const E = ze(v, t, a);
|
|
1058
1058
|
E && E !== v && (u[E] = o[v], delete u[v], i = !0);
|
|
1059
1059
|
}
|
|
1060
1060
|
return i ? u : o;
|
|
1061
|
-
}),
|
|
1061
|
+
}), y((o) => {
|
|
1062
1062
|
let i = !1;
|
|
1063
1063
|
const u = { ...o };
|
|
1064
1064
|
for (const v of Object.keys(o)) {
|
|
1065
|
-
const E =
|
|
1065
|
+
const E = ze(v, t, a);
|
|
1066
1066
|
E && E !== v && (u[E] = o[v], delete u[v], i = !0);
|
|
1067
1067
|
}
|
|
1068
1068
|
return i ? u : o;
|
|
1069
|
-
}),
|
|
1069
|
+
}), K((o) => ze(o, t, a)), C((o) => ze(o, t, a)));
|
|
1070
1070
|
}, Fe = () => {
|
|
1071
|
-
|
|
1071
|
+
oe(null), g(null), L();
|
|
1072
1072
|
}, Se = (t, a = !0) => {
|
|
1073
|
-
|
|
1074
|
-
},
|
|
1075
|
-
|
|
1076
|
-
|
|
1073
|
+
K(t), a && k(t);
|
|
1074
|
+
}, fe = Ft(() => [{ name: h, type: "folder" }], [h]), [H, w] = ee(null), [he, pe] = ee(null), we = V(null), b = f ? null : he;
|
|
1075
|
+
Wt(
|
|
1076
|
+
A,
|
|
1077
1077
|
() => ({
|
|
1078
1078
|
focusPath: (t, a = {}) => {
|
|
1079
1079
|
if (!t) return;
|
|
@@ -1082,14 +1082,14 @@ const nn = zt(function({
|
|
|
1082
1082
|
domFocus: i = !0,
|
|
1083
1083
|
notify: u = !1
|
|
1084
1084
|
} = a;
|
|
1085
|
-
o && Se(t, u),
|
|
1085
|
+
o && Se(t, u), C(t), i && X(t);
|
|
1086
1086
|
},
|
|
1087
1087
|
selectPath: (t) => {
|
|
1088
|
-
t && (Se(t),
|
|
1088
|
+
t && (Se(t), C(t), X(t));
|
|
1089
1089
|
},
|
|
1090
|
-
getSelectedPath: () =>
|
|
1091
|
-
expandToPath: async (t) => await
|
|
1092
|
-
refresh: async (t) => await
|
|
1090
|
+
getSelectedPath: () => S,
|
|
1091
|
+
expandToPath: async (t) => await _e(t),
|
|
1092
|
+
refresh: async (t) => await ne(t),
|
|
1093
1093
|
remapPath: ke,
|
|
1094
1094
|
createFile: async (t) => {
|
|
1095
1095
|
f || await Ye(t, "file", "untitled.php");
|
|
@@ -1104,53 +1104,53 @@ const nn = zt(function({
|
|
|
1104
1104
|
f || await Ke(t, a);
|
|
1105
1105
|
}
|
|
1106
1106
|
}),
|
|
1107
|
-
[
|
|
1107
|
+
[S, ne, ke, _e, f]
|
|
1108
1108
|
);
|
|
1109
|
-
const
|
|
1109
|
+
const P = V(!1), ie = V(
|
|
1110
1110
|
d ?? null
|
|
1111
|
-
), le =
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}, [h]),
|
|
1111
|
+
), le = V(d);
|
|
1112
|
+
W(() => {
|
|
1113
|
+
N.current = !1;
|
|
1114
|
+
}, [h]), W(() => {
|
|
1115
1115
|
d && d !== le.current ? ie.current = d : d || (ie.current = null), le.current = d;
|
|
1116
|
-
}, [d]),
|
|
1117
|
-
if (!d ||
|
|
1116
|
+
}, [d]), W(() => {
|
|
1117
|
+
if (!d || P.current)
|
|
1118
1118
|
return;
|
|
1119
|
-
|
|
1119
|
+
P.current = !0;
|
|
1120
1120
|
const t = Dt(d);
|
|
1121
|
-
|
|
1121
|
+
F((o) => {
|
|
1122
1122
|
const i = { ...o };
|
|
1123
1123
|
for (const u of t)
|
|
1124
1124
|
i[u] = !0;
|
|
1125
1125
|
return i;
|
|
1126
1126
|
});
|
|
1127
1127
|
const a = t[t.length - 1] || d;
|
|
1128
|
-
|
|
1129
|
-
}, [d,
|
|
1128
|
+
C(a), K(a), _e(d);
|
|
1129
|
+
}, [d, _e]), W(() => {
|
|
1130
1130
|
const t = ie.current;
|
|
1131
|
-
!t ||
|
|
1132
|
-
}, [
|
|
1133
|
-
if (!
|
|
1134
|
-
if (
|
|
1135
|
-
const t = ve(
|
|
1136
|
-
|
|
1131
|
+
!t || fe.length === 0 || (ie.current = null, _e(t));
|
|
1132
|
+
}, [fe, _e]), W(() => {
|
|
1133
|
+
if (!B) {
|
|
1134
|
+
if (fe.length > 0) {
|
|
1135
|
+
const t = ve(fe[0]);
|
|
1136
|
+
C(t);
|
|
1137
1137
|
}
|
|
1138
1138
|
return;
|
|
1139
1139
|
}
|
|
1140
|
-
|
|
1141
|
-
}, [
|
|
1142
|
-
if (
|
|
1140
|
+
b && b === B || X(B);
|
|
1141
|
+
}, [fe, B, b]), W(() => {
|
|
1142
|
+
if (fe.length === 0)
|
|
1143
1143
|
return;
|
|
1144
|
-
const t =
|
|
1145
|
-
if ((t == null ? void 0 : t.type) !== "folder" ||
|
|
1144
|
+
const t = fe[0];
|
|
1145
|
+
if ((t == null ? void 0 : t.type) !== "folder" || N.current)
|
|
1146
1146
|
return;
|
|
1147
1147
|
const a = t.name;
|
|
1148
|
-
|
|
1148
|
+
N.current = !0, F(
|
|
1149
1149
|
(o) => o[a] ? o : { ...o, [a]: !0 }
|
|
1150
|
-
), !
|
|
1151
|
-
}, [
|
|
1152
|
-
|
|
1153
|
-
}, []),
|
|
1150
|
+
), !te.current[a] && !Y.current[a] && re(a, t);
|
|
1151
|
+
}, [fe, re, h]), W(() => () => {
|
|
1152
|
+
M.current && clearTimeout(M.current), L();
|
|
1153
|
+
}, []), W(() => {
|
|
1154
1154
|
H && setTimeout(() => {
|
|
1155
1155
|
const t = document.querySelector(
|
|
1156
1156
|
'[role="menu"] [role="menuitem"]'
|
|
@@ -1158,40 +1158,40 @@ const nn = zt(function({
|
|
|
1158
1158
|
t && typeof t.focus == "function" && t.focus();
|
|
1159
1159
|
}, 0);
|
|
1160
1160
|
}, [H]);
|
|
1161
|
-
const [
|
|
1161
|
+
const [ce, be] = ee(""), $e = (t, a) => {
|
|
1162
1162
|
if (t.type === "folder")
|
|
1163
1163
|
return a;
|
|
1164
1164
|
const o = Le(a);
|
|
1165
1165
|
return o && o || "/";
|
|
1166
1166
|
}, ge = (t, a, o) => {
|
|
1167
|
-
const i =
|
|
1167
|
+
const i = $e(t, a);
|
|
1168
1168
|
return i ? o && Xt(o, i) ? { allowed: !1, state: "invalid", destination: null } : { allowed: !0, state: "valid", destination: i } : { allowed: !1, state: "invalid", destination: null };
|
|
1169
1169
|
}, Ie = (t, a, o) => {
|
|
1170
|
-
a.type !== "folder" && a.type !== "file" || (
|
|
1170
|
+
a.type !== "folder" && a.type !== "file" || (oe(o), g(null), t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData(
|
|
1171
1171
|
"application/x-wp-playground-path",
|
|
1172
1172
|
o
|
|
1173
1173
|
), t.dataTransfer.setData("text/plain", o)));
|
|
1174
1174
|
}, at = () => {
|
|
1175
1175
|
Fe();
|
|
1176
1176
|
}, Ge = (t, a, o) => {
|
|
1177
|
-
const i = ge(a, o,
|
|
1178
|
-
i.allowed && a.type === "folder" && Oe(o, a),
|
|
1177
|
+
const i = ge(a, o, J);
|
|
1178
|
+
i.allowed && a.type === "folder" && Oe(o, a), g((u) => (u == null ? void 0 : u.path) === o && u.state === i.state ? u : { path: o, state: i.state });
|
|
1179
1179
|
}, ft = (t, a, o) => {
|
|
1180
|
-
const i = ge(a, o,
|
|
1181
|
-
i.allowed && i.destination ? (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect =
|
|
1180
|
+
const i = ge(a, o, J);
|
|
1181
|
+
i.allowed && i.destination ? (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = J ? "move" : "copy"), a.type === "folder" && Oe(o, a), g((u) => (u == null ? void 0 : u.path) === o && u.state === i.state ? u : { path: o, state: i.state })) : (t.dataTransfer && (t.dataTransfer.dropEffect = "none"), Q(o), g((u) => (u == null ? void 0 : u.path) === o && u.state === "invalid" ? u : { path: o, state: "invalid" }));
|
|
1182
1182
|
}, dt = (t, a, o) => {
|
|
1183
|
-
|
|
1183
|
+
Q(o);
|
|
1184
1184
|
const i = t.relatedTarget;
|
|
1185
|
-
i && t.currentTarget.contains(i) ||
|
|
1185
|
+
i && t.currentTarget.contains(i) || g((u) => (u == null ? void 0 : u.path) === o ? null : u);
|
|
1186
1186
|
}, Et = async (t, a, o) => {
|
|
1187
|
-
const i =
|
|
1187
|
+
const i = J, u = ge(a, o, i);
|
|
1188
1188
|
if (!u.allowed || !u.destination) {
|
|
1189
1189
|
Fe();
|
|
1190
1190
|
return;
|
|
1191
1191
|
}
|
|
1192
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1192
|
+
t.preventDefault(), t.stopPropagation(), Q(o), g(null);
|
|
1193
1193
|
try {
|
|
1194
|
-
i ? await
|
|
1194
|
+
i ? await bt(i, u.destination) : await Ke(
|
|
1195
1195
|
t.dataTransfer,
|
|
1196
1196
|
u.destination
|
|
1197
1197
|
);
|
|
@@ -1199,35 +1199,35 @@ const nn = zt(function({
|
|
|
1199
1199
|
Fe();
|
|
1200
1200
|
}
|
|
1201
1201
|
}, mt = (t, a, o) => {
|
|
1202
|
-
c && (t.preventDefault(), t.stopPropagation(),
|
|
1202
|
+
c && (t.preventDefault(), t.stopPropagation(), pe(null), w({
|
|
1203
1203
|
absPath: o,
|
|
1204
1204
|
type: a.type,
|
|
1205
1205
|
x: t.clientX,
|
|
1206
1206
|
y: t.clientY
|
|
1207
1207
|
}));
|
|
1208
|
-
},
|
|
1208
|
+
}, We = async (t, a) => {
|
|
1209
1209
|
let o = a, i = 0;
|
|
1210
1210
|
const u = (E) => {
|
|
1211
|
-
const
|
|
1212
|
-
return
|
|
1211
|
+
const ae = E.lastIndexOf(".");
|
|
1212
|
+
return ae > 0 ? { stem: E.slice(0, ae), ext: E.slice(ae) } : { stem: E, ext: "" };
|
|
1213
1213
|
}, v = t === "/" ? "" : t;
|
|
1214
1214
|
for (; await (l == null ? void 0 : l.fileExists(`${v}/${o}`)) || await (l == null ? void 0 : l.isDir(`${v}/${o}`)); ) {
|
|
1215
1215
|
i += 1;
|
|
1216
|
-
const { stem: E, ext:
|
|
1217
|
-
o = `${E} (${i})${
|
|
1216
|
+
const { stem: E, ext: ae } = u(a);
|
|
1217
|
+
o = `${E} (${i})${ae}`;
|
|
1218
1218
|
}
|
|
1219
1219
|
return o;
|
|
1220
1220
|
}, Ye = async (t, a, o) => {
|
|
1221
1221
|
if (!l) return;
|
|
1222
|
-
let i = t ||
|
|
1222
|
+
let i = t || S || h;
|
|
1223
1223
|
try {
|
|
1224
1224
|
await l.isDir(i) || (i = Le(i));
|
|
1225
1225
|
} catch {
|
|
1226
1226
|
i = Le(i);
|
|
1227
1227
|
}
|
|
1228
|
-
const u = i, v = await
|
|
1229
|
-
a === "folder" ? await l.mkdir(E) : await l.writeFile(E, ""), we.current = { type: a, tempPath: E },
|
|
1230
|
-
|
|
1228
|
+
const u = i, v = await We(u, o), E = je(u, v);
|
|
1229
|
+
a === "folder" ? await l.mkdir(E) : await l.writeFile(E, ""), we.current = { type: a, tempPath: E }, pe(E), await ne(u), setTimeout(() => {
|
|
1230
|
+
C(E), X(E);
|
|
1231
1231
|
}, 0);
|
|
1232
1232
|
}, yt = async (t) => {
|
|
1233
1233
|
if (!l) return !1;
|
|
@@ -1250,7 +1250,7 @@ const nn = zt(function({
|
|
|
1250
1250
|
if (!await l.isDir(t).catch(() => !1))
|
|
1251
1251
|
throw a;
|
|
1252
1252
|
}
|
|
1253
|
-
},
|
|
1253
|
+
}, bt = async (t, a) => {
|
|
1254
1254
|
if (!l) return;
|
|
1255
1255
|
const o = et(t), i = je(a, o);
|
|
1256
1256
|
if (i === t || await yt(i))
|
|
@@ -1258,63 +1258,63 @@ const nn = zt(function({
|
|
|
1258
1258
|
const u = Le(t);
|
|
1259
1259
|
try {
|
|
1260
1260
|
await l.mv(t, i), ke(t, i);
|
|
1261
|
-
const v =
|
|
1262
|
-
|
|
1261
|
+
const v = ze(
|
|
1262
|
+
S,
|
|
1263
1263
|
t,
|
|
1264
1264
|
i
|
|
1265
1265
|
);
|
|
1266
|
-
|
|
1267
|
-
(E) =>
|
|
1268
|
-
),
|
|
1266
|
+
S && (S === t || S.startsWith(`${t}/`)) && k(v), C(
|
|
1267
|
+
(E) => ze(E, t, i)
|
|
1268
|
+
), F((E) => ({
|
|
1269
1269
|
...E,
|
|
1270
1270
|
[a]: !0
|
|
1271
1271
|
})), await Promise.all([
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
]),
|
|
1275
|
-
(E) =>
|
|
1276
|
-
),
|
|
1272
|
+
ne(u),
|
|
1273
|
+
ne(a)
|
|
1274
|
+
]), K(
|
|
1275
|
+
(E) => ze(E, t, i)
|
|
1276
|
+
), X(i);
|
|
1277
1277
|
} catch {
|
|
1278
1278
|
}
|
|
1279
|
-
},
|
|
1279
|
+
}, xt = (t) => {
|
|
1280
1280
|
const a = t;
|
|
1281
1281
|
return a.webkitGetAsEntry ? a.webkitGetAsEntry() : null;
|
|
1282
|
-
},
|
|
1282
|
+
}, Ct = (t) => new Promise((a, o) => {
|
|
1283
1283
|
t.file(a, o);
|
|
1284
1284
|
}), pt = async (t, a) => {
|
|
1285
1285
|
if (!l) return;
|
|
1286
|
-
const o = t.name || "untitled", i = await
|
|
1286
|
+
const o = t.name || "untitled", i = await We(a, o), u = je(a, i), v = new Uint8Array(await t.arrayBuffer());
|
|
1287
1287
|
await l.writeFile(u, v);
|
|
1288
1288
|
}, Ze = async (t, a) => {
|
|
1289
|
-
const o = await
|
|
1289
|
+
const o = await Ct(t);
|
|
1290
1290
|
await pt(o, a);
|
|
1291
1291
|
}, ot = async (t, a) => {
|
|
1292
|
-
const o = await
|
|
1292
|
+
const o = await We(
|
|
1293
1293
|
a,
|
|
1294
1294
|
t.name || "New Folder"
|
|
1295
1295
|
), i = je(a, o);
|
|
1296
1296
|
await _t(i);
|
|
1297
|
-
const u = t.createReader(), v = () => new Promise((E,
|
|
1297
|
+
const u = t.createReader(), v = () => new Promise((E, ae) => {
|
|
1298
1298
|
u.readEntries(
|
|
1299
|
-
(
|
|
1300
|
-
|
|
1299
|
+
(xe) => E(Array.from(xe)),
|
|
1300
|
+
ae
|
|
1301
1301
|
);
|
|
1302
1302
|
});
|
|
1303
1303
|
for (; ; ) {
|
|
1304
1304
|
const E = await v();
|
|
1305
1305
|
if (!E.length)
|
|
1306
1306
|
break;
|
|
1307
|
-
for (const
|
|
1308
|
-
|
|
1309
|
-
|
|
1307
|
+
for (const ae of E)
|
|
1308
|
+
ae.isFile ? await Ze(
|
|
1309
|
+
ae,
|
|
1310
1310
|
i
|
|
1311
|
-
) :
|
|
1312
|
-
|
|
1311
|
+
) : ae.isDirectory && await ot(
|
|
1312
|
+
ae,
|
|
1313
1313
|
i
|
|
1314
1314
|
);
|
|
1315
1315
|
}
|
|
1316
1316
|
}, Ve = (t, a) => qe([], t, a), Ke = (t, a) => {
|
|
1317
|
-
const i = Array.from(t.items).filter((v) => v.kind === "file").map((v) =>
|
|
1317
|
+
const i = Array.from(t.items).filter((v) => v.kind === "file").map((v) => xt(v)).filter((v) => !!v), u = Array.from(t.files);
|
|
1318
1318
|
return qe(i, u, a);
|
|
1319
1319
|
}, qe = async (t, a, o) => {
|
|
1320
1320
|
if (l) {
|
|
@@ -1330,7 +1330,7 @@ const nn = zt(function({
|
|
|
1330
1330
|
else
|
|
1331
1331
|
for (const i of a)
|
|
1332
1332
|
await pt(i, o);
|
|
1333
|
-
await
|
|
1333
|
+
await ne(o), F((i) => ({
|
|
1334
1334
|
...i,
|
|
1335
1335
|
[o]: !0
|
|
1336
1336
|
}));
|
|
@@ -1338,14 +1338,14 @@ const nn = zt(function({
|
|
|
1338
1338
|
}, ht = async (t, a) => {
|
|
1339
1339
|
if (!l) return;
|
|
1340
1340
|
const o = t;
|
|
1341
|
-
|
|
1341
|
+
w(null);
|
|
1342
1342
|
try {
|
|
1343
1343
|
a === "folder" ? await l.rmdir(o, { recursive: !0 }) : await l.unlink(o);
|
|
1344
1344
|
} catch {
|
|
1345
1345
|
} finally {
|
|
1346
|
-
|
|
1346
|
+
pe(null);
|
|
1347
1347
|
const i = Le(o);
|
|
1348
|
-
await
|
|
1348
|
+
await ne(i), S && (S === o || S.startsWith(`${o}/`)) && k(null);
|
|
1349
1349
|
}
|
|
1350
1350
|
}, Rt = async (t) => {
|
|
1351
1351
|
if (l)
|
|
@@ -1357,11 +1357,11 @@ const nn = zt(function({
|
|
|
1357
1357
|
}
|
|
1358
1358
|
}, vt = (t) => {
|
|
1359
1359
|
var a;
|
|
1360
|
-
if (!
|
|
1360
|
+
if (!he)
|
|
1361
1361
|
if (t.key.length === 1 && t.key.match(/\S/)) {
|
|
1362
|
-
const o =
|
|
1363
|
-
if (
|
|
1364
|
-
|
|
1362
|
+
const o = ce + t.key.toLowerCase();
|
|
1363
|
+
if (be(o), M.current && clearTimeout(M.current), M.current = setTimeout(() => {
|
|
1364
|
+
be("");
|
|
1365
1365
|
}, 1e3), !p.current)
|
|
1366
1366
|
return;
|
|
1367
1367
|
const i = Array.from(
|
|
@@ -1372,16 +1372,16 @@ const nn = zt(function({
|
|
|
1372
1372
|
u
|
|
1373
1373
|
));
|
|
1374
1374
|
for (let E = 0; E < i.length; E++) {
|
|
1375
|
-
const
|
|
1376
|
-
if ((a =
|
|
1377
|
-
|
|
1378
|
-
const e =
|
|
1379
|
-
e &&
|
|
1375
|
+
const ae = (v + E) % i.length, xe = i[ae];
|
|
1376
|
+
if ((a = xe.textContent) != null && a.toLowerCase().trim().startsWith(o)) {
|
|
1377
|
+
xe.focus();
|
|
1378
|
+
const e = xe.getAttribute("data-path");
|
|
1379
|
+
e && C(e);
|
|
1380
1380
|
break;
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
} else
|
|
1384
|
-
|
|
1384
|
+
be(""), M.current && clearTimeout(M.current);
|
|
1385
1385
|
}, kt = async (t, a) => {
|
|
1386
1386
|
if (f) return;
|
|
1387
1387
|
const o = we.current, i = (o == null ? void 0 : o.tempPath) === t, u = Le(t);
|
|
@@ -1395,23 +1395,23 @@ const nn = zt(function({
|
|
|
1395
1395
|
}
|
|
1396
1396
|
we.current = null;
|
|
1397
1397
|
}
|
|
1398
|
-
|
|
1398
|
+
pe(i ? null : t);
|
|
1399
1399
|
return;
|
|
1400
1400
|
}
|
|
1401
1401
|
let v = je(u, a), E = v;
|
|
1402
1402
|
if (E === t) {
|
|
1403
|
-
|
|
1403
|
+
pe(null);
|
|
1404
1404
|
const s = i && (o == null ? void 0 : o.type) === "file";
|
|
1405
1405
|
i && (we.current = null), setTimeout(() => {
|
|
1406
|
-
|
|
1406
|
+
C(E), X(E), s && D && D(E);
|
|
1407
1407
|
}, 0);
|
|
1408
1408
|
return;
|
|
1409
1409
|
}
|
|
1410
|
-
const
|
|
1411
|
-
if ((
|
|
1410
|
+
const ae = await l.fileExists(E), xe = await l.isDir(E);
|
|
1411
|
+
if ((ae || xe) && E !== t)
|
|
1412
1412
|
if (i)
|
|
1413
1413
|
try {
|
|
1414
|
-
const s = await
|
|
1414
|
+
const s = await We(
|
|
1415
1415
|
u === "/" ? "/" : u,
|
|
1416
1416
|
a
|
|
1417
1417
|
);
|
|
@@ -1419,12 +1419,12 @@ const nn = zt(function({
|
|
|
1419
1419
|
} catch {
|
|
1420
1420
|
}
|
|
1421
1421
|
else {
|
|
1422
|
-
|
|
1422
|
+
pe(t);
|
|
1423
1423
|
return;
|
|
1424
1424
|
}
|
|
1425
1425
|
let e = (o == null ? void 0 : o.type) === "folder";
|
|
1426
1426
|
try {
|
|
1427
|
-
await l.mv(t, v), o || (e = await l.isDir(v)), e && ke(t, E),
|
|
1427
|
+
await l.mv(t, v), o || (e = await l.isDir(v)), e && ke(t, E), S === t && k(E), await ne(u), C(E), X(E), i && !e && D && D(E);
|
|
1428
1428
|
} catch {
|
|
1429
1429
|
if (i)
|
|
1430
1430
|
try {
|
|
@@ -1434,43 +1434,43 @@ const nn = zt(function({
|
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
}
|
|
1436
1436
|
} finally {
|
|
1437
|
-
we.current = null,
|
|
1437
|
+
we.current = null, pe(null);
|
|
1438
1438
|
}
|
|
1439
1439
|
}, wt = async (t) => {
|
|
1440
1440
|
const a = we.current;
|
|
1441
1441
|
if (!l || (a == null ? void 0 : a.tempPath) !== t) {
|
|
1442
|
-
|
|
1442
|
+
pe((i) => i === t ? null : i);
|
|
1443
1443
|
return;
|
|
1444
1444
|
}
|
|
1445
1445
|
try {
|
|
1446
1446
|
a.type === "folder" ? await l.rmdir(t, { recursive: !0 }) : await l.unlink(t);
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
|
-
we.current = null,
|
|
1449
|
+
we.current = null, pe(null);
|
|
1450
1450
|
const o = Le(t);
|
|
1451
|
-
await
|
|
1451
|
+
await ne(o), C(o), X(o);
|
|
1452
1452
|
};
|
|
1453
|
-
return /* @__PURE__ */ r.createElement("div", { onKeyDown: vt, ref: p }, /* @__PURE__ */ r.createElement(er, { className: Re.filePickerTree },
|
|
1454
|
-
|
|
1453
|
+
return /* @__PURE__ */ r.createElement("div", { onKeyDown: vt, ref: p }, /* @__PURE__ */ r.createElement(er, { className: Re.filePickerTree }, fe.map((t, a) => /* @__PURE__ */ r.createElement(
|
|
1454
|
+
zt,
|
|
1455
1455
|
{
|
|
1456
1456
|
key: t.name,
|
|
1457
1457
|
node: t,
|
|
1458
1458
|
level: 0,
|
|
1459
1459
|
position: a + 1,
|
|
1460
|
-
setSize:
|
|
1460
|
+
setSize: fe.length,
|
|
1461
1461
|
expandedNodePaths: _,
|
|
1462
1462
|
onToggle: Me,
|
|
1463
|
-
selectedNode:
|
|
1464
|
-
focusPath: (o) =>
|
|
1465
|
-
focusedNode:
|
|
1463
|
+
selectedNode: S,
|
|
1464
|
+
focusPath: (o) => C(o),
|
|
1465
|
+
focusedNode: B,
|
|
1466
1466
|
selectPath: Se,
|
|
1467
1467
|
generatePath: ve,
|
|
1468
|
-
getChildren:
|
|
1468
|
+
getChildren: me,
|
|
1469
1469
|
onContextMenu: f ? void 0 : mt,
|
|
1470
|
-
renamingPath:
|
|
1470
|
+
renamingPath: b,
|
|
1471
1471
|
onRename: kt,
|
|
1472
1472
|
onRenameCancel: wt,
|
|
1473
|
-
dropIndicator:
|
|
1473
|
+
dropIndicator: de,
|
|
1474
1474
|
onDragStart: f ? void 0 : Ie,
|
|
1475
1475
|
onDragEnd: f ? void 0 : at,
|
|
1476
1476
|
onDragEnter: f ? void 0 : Ge,
|
|
@@ -1478,13 +1478,13 @@ const nn = zt(function({
|
|
|
1478
1478
|
onDragLeave: f ? void 0 : dt,
|
|
1479
1479
|
onDrop: f ? void 0 : Et,
|
|
1480
1480
|
rootPath: h,
|
|
1481
|
-
onDoubleClickFile:
|
|
1481
|
+
onDoubleClickFile: D
|
|
1482
1482
|
}
|
|
1483
1483
|
))), !f && H && /* @__PURE__ */ r.createElement(
|
|
1484
1484
|
tr,
|
|
1485
1485
|
{
|
|
1486
1486
|
placement: "bottom-start",
|
|
1487
|
-
onClose: () =>
|
|
1487
|
+
onClose: () => w(null),
|
|
1488
1488
|
anchor: {
|
|
1489
1489
|
getBoundingClientRect: () => ({
|
|
1490
1490
|
x: H.x,
|
|
@@ -1508,7 +1508,7 @@ const nn = zt(function({
|
|
|
1508
1508
|
{
|
|
1509
1509
|
role: "menuitem",
|
|
1510
1510
|
onClick: async () => {
|
|
1511
|
-
|
|
1511
|
+
w(null), await Ye(
|
|
1512
1512
|
H.absPath,
|
|
1513
1513
|
"file",
|
|
1514
1514
|
"untitled.php"
|
|
@@ -1521,7 +1521,7 @@ const nn = zt(function({
|
|
|
1521
1521
|
{
|
|
1522
1522
|
role: "menuitem",
|
|
1523
1523
|
onClick: async () => {
|
|
1524
|
-
|
|
1524
|
+
w(null), await Ye(
|
|
1525
1525
|
H.absPath,
|
|
1526
1526
|
"folder",
|
|
1527
1527
|
"New Folder"
|
|
@@ -1534,7 +1534,7 @@ const nn = zt(function({
|
|
|
1534
1534
|
{
|
|
1535
1535
|
role: "menuitem",
|
|
1536
1536
|
onClick: () => {
|
|
1537
|
-
|
|
1537
|
+
w(null), pe(H.absPath);
|
|
1538
1538
|
}
|
|
1539
1539
|
},
|
|
1540
1540
|
"Rename"
|
|
@@ -1543,7 +1543,7 @@ const nn = zt(function({
|
|
|
1543
1543
|
{
|
|
1544
1544
|
role: "menuitem",
|
|
1545
1545
|
onClick: async () => {
|
|
1546
|
-
|
|
1546
|
+
w(null), await Rt(
|
|
1547
1547
|
H.absPath
|
|
1548
1548
|
);
|
|
1549
1549
|
}
|
|
@@ -1561,7 +1561,7 @@ const nn = zt(function({
|
|
|
1561
1561
|
"Delete"
|
|
1562
1562
|
))
|
|
1563
1563
|
));
|
|
1564
|
-
}),
|
|
1564
|
+
}), zt = ({
|
|
1565
1565
|
node: n,
|
|
1566
1566
|
level: c,
|
|
1567
1567
|
position: f,
|
|
@@ -1569,90 +1569,90 @@ const nn = zt(function({
|
|
|
1569
1569
|
expandedNodePaths: T,
|
|
1570
1570
|
onToggle: d,
|
|
1571
1571
|
selectedNode: k,
|
|
1572
|
-
focusPath:
|
|
1573
|
-
focusedNode:
|
|
1572
|
+
focusPath: D,
|
|
1573
|
+
focusedNode: A,
|
|
1574
1574
|
selectPath: h,
|
|
1575
1575
|
generatePath: _,
|
|
1576
|
-
getChildren:
|
|
1577
|
-
onContextMenu:
|
|
1578
|
-
renamingPath:
|
|
1579
|
-
onRename:
|
|
1580
|
-
onRenameCancel:
|
|
1581
|
-
parentPath:
|
|
1582
|
-
dropIndicator:
|
|
1583
|
-
onDragStart:
|
|
1584
|
-
onDragEnd:
|
|
1585
|
-
onDragEnter:
|
|
1586
|
-
onDragOver:
|
|
1587
|
-
onDragLeave:
|
|
1588
|
-
onDrop:
|
|
1589
|
-
rootPath:
|
|
1590
|
-
onDoubleClickFile:
|
|
1576
|
+
getChildren: F,
|
|
1577
|
+
onContextMenu: S,
|
|
1578
|
+
renamingPath: K,
|
|
1579
|
+
onRename: B,
|
|
1580
|
+
onRenameCancel: C,
|
|
1581
|
+
parentPath: G = "",
|
|
1582
|
+
dropIndicator: y,
|
|
1583
|
+
onDragStart: x,
|
|
1584
|
+
onDragEnd: z,
|
|
1585
|
+
onDragEnter: J,
|
|
1586
|
+
onDragOver: oe,
|
|
1587
|
+
onDragLeave: de,
|
|
1588
|
+
onDrop: g,
|
|
1589
|
+
rootPath: $,
|
|
1590
|
+
onDoubleClickFile: N
|
|
1591
1591
|
}) => {
|
|
1592
|
-
const p = _(n,
|
|
1593
|
-
onDragEnter: (
|
|
1594
|
-
onDragOver: (
|
|
1595
|
-
onDragLeave: (
|
|
1596
|
-
onDrop: (
|
|
1597
|
-
},
|
|
1598
|
-
|
|
1599
|
-
var
|
|
1600
|
-
|
|
1601
|
-
var
|
|
1602
|
-
(
|
|
1603
|
-
}) : (
|
|
1604
|
-
}, [
|
|
1592
|
+
const p = _(n, G), M = T[p], Y = K === p, te = V(null), [L, Q] = ee(n.name), X = V(!1), ve = (y == null ? void 0 : y.path) === p, me = ve && (y == null ? void 0 : y.state) === "valid", Ne = ve && (y == null ? void 0 : y.state) === "invalid", Pe = !!x && !Y && p !== $, re = V(null), Oe = {
|
|
1593
|
+
onDragEnter: (w) => J == null ? void 0 : J(w, n, p),
|
|
1594
|
+
onDragOver: (w) => oe == null ? void 0 : oe(w, n, p),
|
|
1595
|
+
onDragLeave: (w) => de == null ? void 0 : de(w, n, p),
|
|
1596
|
+
onDrop: (w) => g == null ? void 0 : g(w, n, p)
|
|
1597
|
+
}, ne = F(n, p) ?? [];
|
|
1598
|
+
W(() => {
|
|
1599
|
+
var w;
|
|
1600
|
+
Y ? (Q(n.name), X.current = !1, typeof window < "u" && requestAnimationFrame ? requestAnimationFrame(() => {
|
|
1601
|
+
var he;
|
|
1602
|
+
(he = te.current) == null || he.select();
|
|
1603
|
+
}) : (w = te.current) == null || w.select()) : X.current = !1;
|
|
1604
|
+
}, [Y, n.name]);
|
|
1605
1605
|
const Me = () => {
|
|
1606
|
-
n.type === "folder" && d(p, n, !
|
|
1607
|
-
},
|
|
1608
|
-
var
|
|
1609
|
-
if (
|
|
1610
|
-
|
|
1611
|
-
`[data-path="${CSS.escape(
|
|
1612
|
-
)) == null ||
|
|
1613
|
-
else if (
|
|
1614
|
-
if (
|
|
1615
|
-
if (
|
|
1606
|
+
n.type === "folder" && d(p, n, !M);
|
|
1607
|
+
}, _e = (w) => {
|
|
1608
|
+
var he, pe;
|
|
1609
|
+
if (w.key === "ArrowLeft")
|
|
1610
|
+
M ? Me() : (he = document.querySelector(
|
|
1611
|
+
`[data-path="${CSS.escape(G)}"]`
|
|
1612
|
+
)) == null || he.focus(), w.preventDefault(), w.stopPropagation();
|
|
1613
|
+
else if (w.key === "ArrowRight") {
|
|
1614
|
+
if (M) {
|
|
1615
|
+
if (ne != null && ne.length) {
|
|
1616
1616
|
const we = _(
|
|
1617
|
-
|
|
1617
|
+
ne[0],
|
|
1618
1618
|
p
|
|
1619
1619
|
);
|
|
1620
|
-
(
|
|
1620
|
+
(pe = document.querySelector(
|
|
1621
1621
|
`[data-path="${CSS.escape(we)}"]`
|
|
1622
|
-
)) == null ||
|
|
1622
|
+
)) == null || pe.focus();
|
|
1623
1623
|
}
|
|
1624
1624
|
} else
|
|
1625
1625
|
Me();
|
|
1626
|
-
|
|
1627
|
-
} else
|
|
1628
|
-
}, ke = (
|
|
1629
|
-
|
|
1630
|
-
}, Fe = (
|
|
1631
|
-
|
|
1632
|
-
}, Se = (
|
|
1633
|
-
if (
|
|
1634
|
-
|
|
1626
|
+
w.preventDefault(), w.stopPropagation();
|
|
1627
|
+
} else w.key === " " || w.key === "Space" || w.key === "Spacebar" ? (n.type === "folder" && d(p, n, !M), w.preventDefault()) : w.key === "Enter" && (n.type === "folder" ? d(p, n, !M) : (h(p, !1), D(p), N ? N(p) : h(p, !0)), w.preventDefault());
|
|
1628
|
+
}, ke = (w) => {
|
|
1629
|
+
S == null || S(w, n, p);
|
|
1630
|
+
}, Fe = (w) => {
|
|
1631
|
+
w.preventDefault(), X.current = !0, B == null || B(p, L);
|
|
1632
|
+
}, Se = (w) => {
|
|
1633
|
+
if (w.key === "Escape") {
|
|
1634
|
+
w.preventDefault(), w.stopPropagation(), X.current = !0, C == null || C(p);
|
|
1635
1635
|
return;
|
|
1636
1636
|
}
|
|
1637
|
-
(
|
|
1638
|
-
},
|
|
1639
|
-
|
|
1637
|
+
(w.key === "ArrowLeft" || w.key === "ArrowRight" || w.key === "ArrowUp" || w.key === "ArrowDown") && w.stopPropagation();
|
|
1638
|
+
}, fe = () => {
|
|
1639
|
+
X.current || C == null || C(p), X.current = !1;
|
|
1640
1640
|
}, H = () => {
|
|
1641
1641
|
if (n.type === "folder") {
|
|
1642
|
-
Me(), h(p),
|
|
1642
|
+
Me(), h(p), D(p);
|
|
1643
1643
|
return;
|
|
1644
1644
|
}
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
|
|
1645
|
+
const w = re.current !== null;
|
|
1646
|
+
if (w && re.current && clearTimeout(re.current), re.current = null, w) {
|
|
1647
|
+
N ? N(p) : h(p, !0);
|
|
1648
1648
|
return;
|
|
1649
1649
|
}
|
|
1650
|
-
h(p, !1),
|
|
1651
|
-
|
|
1650
|
+
h(p, !1), D(p), h(p, !0), re.current = window.setTimeout(() => {
|
|
1651
|
+
re.current = null;
|
|
1652
1652
|
}, 300);
|
|
1653
1653
|
};
|
|
1654
|
-
return
|
|
1655
|
-
|
|
1654
|
+
return W(() => () => {
|
|
1655
|
+
re.current !== null && typeof window < "u" && clearTimeout(re.current);
|
|
1656
1656
|
}, []), /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
1657
1657
|
nr,
|
|
1658
1658
|
{
|
|
@@ -1660,7 +1660,7 @@ const nn = zt(function({
|
|
|
1660
1660
|
positionInSet: f,
|
|
1661
1661
|
setSize: l
|
|
1662
1662
|
},
|
|
1663
|
-
/* @__PURE__ */ r.createElement(ar, null, () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
1663
|
+
/* @__PURE__ */ r.createElement(ar, null, () => /* @__PURE__ */ r.createElement(r.Fragment, null, Y ? /* @__PURE__ */ r.createElement(
|
|
1664
1664
|
"form",
|
|
1665
1665
|
{
|
|
1666
1666
|
onSubmit: Fe,
|
|
@@ -1670,8 +1670,8 @@ const nn = zt(function({
|
|
|
1670
1670
|
"file-node-button",
|
|
1671
1671
|
{
|
|
1672
1672
|
[Re.selected]: k === p,
|
|
1673
|
-
[Re.focused]:
|
|
1674
|
-
[Re.dropTarget]:
|
|
1673
|
+
[Re.focused]: A === p,
|
|
1674
|
+
[Re.dropTarget]: me,
|
|
1675
1675
|
[Re.dropTargetInvalid]: Ne
|
|
1676
1676
|
}
|
|
1677
1677
|
),
|
|
@@ -1683,7 +1683,7 @@ const nn = zt(function({
|
|
|
1683
1683
|
jt,
|
|
1684
1684
|
{
|
|
1685
1685
|
node: n,
|
|
1686
|
-
isOpen: n.type === "folder" &&
|
|
1686
|
+
isOpen: n.type === "folder" && M,
|
|
1687
1687
|
level: c,
|
|
1688
1688
|
hideName: !0
|
|
1689
1689
|
}
|
|
@@ -1691,12 +1691,12 @@ const nn = zt(function({
|
|
|
1691
1691
|
/* @__PURE__ */ r.createElement(
|
|
1692
1692
|
"input",
|
|
1693
1693
|
{
|
|
1694
|
-
ref:
|
|
1694
|
+
ref: te,
|
|
1695
1695
|
className: Re.renameInput,
|
|
1696
|
-
value:
|
|
1697
|
-
onChange: (
|
|
1698
|
-
onBlur:
|
|
1699
|
-
onFocus: () =>
|
|
1696
|
+
value: L,
|
|
1697
|
+
onChange: (w) => Q(w.target.value),
|
|
1698
|
+
onBlur: fe,
|
|
1699
|
+
onFocus: () => D(p),
|
|
1700
1700
|
onKeyDown: Se
|
|
1701
1701
|
}
|
|
1702
1702
|
)
|
|
@@ -1705,12 +1705,12 @@ const nn = zt(function({
|
|
|
1705
1705
|
{
|
|
1706
1706
|
...Oe,
|
|
1707
1707
|
draggable: Pe,
|
|
1708
|
-
onDragStart: (
|
|
1709
|
-
onDragEnd: (
|
|
1708
|
+
onDragStart: (w) => x == null ? void 0 : x(w, n, p),
|
|
1709
|
+
onDragEnd: (w) => z == null ? void 0 : z(w, n, p),
|
|
1710
1710
|
onClick: H,
|
|
1711
|
-
onKeyDown:
|
|
1711
|
+
onKeyDown: _e,
|
|
1712
1712
|
onFocus: () => {
|
|
1713
|
-
|
|
1713
|
+
D(p);
|
|
1714
1714
|
},
|
|
1715
1715
|
onContextMenu: ke,
|
|
1716
1716
|
className: De(
|
|
@@ -1718,53 +1718,53 @@ const nn = zt(function({
|
|
|
1718
1718
|
"file-node-button",
|
|
1719
1719
|
{
|
|
1720
1720
|
[Re.selected]: k === p,
|
|
1721
|
-
[Re.focused]:
|
|
1722
|
-
[Re.dropTarget]:
|
|
1721
|
+
[Re.focused]: A === p,
|
|
1722
|
+
[Re.dropTarget]: me,
|
|
1723
1723
|
[Re.dropTargetInvalid]: Ne
|
|
1724
1724
|
}
|
|
1725
1725
|
),
|
|
1726
1726
|
"data-path": p,
|
|
1727
|
-
"data-expanded":
|
|
1727
|
+
"data-expanded": M ? "true" : "false"
|
|
1728
1728
|
},
|
|
1729
1729
|
/* @__PURE__ */ r.createElement(
|
|
1730
1730
|
jt,
|
|
1731
1731
|
{
|
|
1732
1732
|
node: n,
|
|
1733
|
-
isOpen: n.type === "folder" &&
|
|
1733
|
+
isOpen: n.type === "folder" && M,
|
|
1734
1734
|
level: c
|
|
1735
1735
|
}
|
|
1736
1736
|
)
|
|
1737
1737
|
)))
|
|
1738
|
-
),
|
|
1739
|
-
|
|
1738
|
+
), M && ne && ne.map((w, he) => /* @__PURE__ */ r.createElement(
|
|
1739
|
+
zt,
|
|
1740
1740
|
{
|
|
1741
|
-
key:
|
|
1742
|
-
node:
|
|
1741
|
+
key: w.name,
|
|
1742
|
+
node: w,
|
|
1743
1743
|
level: c + 1,
|
|
1744
|
-
position:
|
|
1745
|
-
setSize:
|
|
1744
|
+
position: he + 1,
|
|
1745
|
+
setSize: ne.length,
|
|
1746
1746
|
expandedNodePaths: T,
|
|
1747
1747
|
onToggle: d,
|
|
1748
1748
|
selectedNode: k,
|
|
1749
|
-
focusPath:
|
|
1750
|
-
focusedNode:
|
|
1749
|
+
focusPath: D,
|
|
1750
|
+
focusedNode: A,
|
|
1751
1751
|
selectPath: h,
|
|
1752
1752
|
generatePath: _,
|
|
1753
|
-
getChildren:
|
|
1754
|
-
onContextMenu:
|
|
1755
|
-
renamingPath:
|
|
1756
|
-
onRename:
|
|
1757
|
-
onRenameCancel:
|
|
1753
|
+
getChildren: F,
|
|
1754
|
+
onContextMenu: S,
|
|
1755
|
+
renamingPath: K,
|
|
1756
|
+
onRename: B,
|
|
1757
|
+
onRenameCancel: C,
|
|
1758
1758
|
parentPath: p,
|
|
1759
|
-
dropIndicator:
|
|
1760
|
-
onDragStart:
|
|
1761
|
-
onDragEnd:
|
|
1762
|
-
onDragEnter:
|
|
1763
|
-
onDragOver:
|
|
1764
|
-
onDragLeave:
|
|
1765
|
-
onDrop:
|
|
1766
|
-
rootPath:
|
|
1767
|
-
onDoubleClickFile:
|
|
1759
|
+
dropIndicator: y,
|
|
1760
|
+
onDragStart: x,
|
|
1761
|
+
onDragEnd: z,
|
|
1762
|
+
onDragEnter: J,
|
|
1763
|
+
onDragOver: oe,
|
|
1764
|
+
onDragLeave: de,
|
|
1765
|
+
onDrop: g,
|
|
1766
|
+
rootPath: $,
|
|
1767
|
+
onDoubleClickFile: N
|
|
1768
1768
|
}
|
|
1769
1769
|
)));
|
|
1770
1770
|
}, jt = ({ node: n, level: c, isOpen: f, hideName: l = !1 }) => {
|
|
@@ -1777,7 +1777,7 @@ const nn = zt(function({
|
|
|
1777
1777
|
"aria-hidden": "true",
|
|
1778
1778
|
dangerouslySetInnerHTML: { __html: T.join("") }
|
|
1779
1779
|
}
|
|
1780
|
-
), n.type === "folder" ? /* @__PURE__ */ r.createElement(Ot, { width: 16, icon: f ?
|
|
1780
|
+
), n.type === "folder" ? /* @__PURE__ */ r.createElement(Ot, { width: 16, icon: f ? Hr : Ur }) : /* @__PURE__ */ r.createElement("div", { style: { width: 16 } }, " "), /* @__PURE__ */ r.createElement(Ot, { width: 16, icon: n.type === "folder" ? jr : Vr }), !l && /* @__PURE__ */ r.createElement("span", { className: Re.fileName }, n.name));
|
|
1781
1781
|
}, an = "_control_kp9d9_1", on = "_browse-label_kp9d9_11", ln = "_path-preview_kp9d9_37", sn = "_modal_kp9d9_43", cn = "_modal-footer_kp9d9_48", Qe = {
|
|
1782
1782
|
control: an,
|
|
1783
1783
|
browseLabel: on,
|
|
@@ -1804,16 +1804,16 @@ function un({ path: n }) {
|
|
|
1804
1804
|
}
|
|
1805
1805
|
);
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function Ga({
|
|
1808
1808
|
value: n = "",
|
|
1809
1809
|
onChange: c,
|
|
1810
1810
|
filesystem: f
|
|
1811
1811
|
}) {
|
|
1812
|
-
const [l, T] =
|
|
1812
|
+
const [l, T] = ee(!1), d = () => T(!0), k = () => T(!1), [D, A] = ee(
|
|
1813
1813
|
n || null
|
|
1814
1814
|
);
|
|
1815
1815
|
function h(_) {
|
|
1816
|
-
_ == null || _.preventDefault(), c(
|
|
1816
|
+
_ == null || _.preventDefault(), c(D || ""), k();
|
|
1817
1817
|
}
|
|
1818
1818
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
1819
1819
|
tt,
|
|
@@ -1836,7 +1836,7 @@ function Ua({
|
|
|
1836
1836
|
{
|
|
1837
1837
|
filesystem: f,
|
|
1838
1838
|
initialSelectedPath: n,
|
|
1839
|
-
onSelect:
|
|
1839
|
+
onSelect: A
|
|
1840
1840
|
}
|
|
1841
1841
|
), /* @__PURE__ */ r.createElement("div", { className: Qe.modalFooter }, /* @__PURE__ */ r.createElement(tt, { type: "submit", variant: "primary" }, "Select Path")))
|
|
1842
1842
|
));
|
|
@@ -1866,14 +1866,14 @@ const fn = "_container_1h0az_1", dn = "_header_1h0az_9", mn = "_filename_1h0az_1
|
|
|
1866
1866
|
isAudio: c.startsWith("audio/")
|
|
1867
1867
|
};
|
|
1868
1868
|
};
|
|
1869
|
-
function
|
|
1869
|
+
function Ya({
|
|
1870
1870
|
filename: n,
|
|
1871
1871
|
mimeType: c,
|
|
1872
1872
|
dataUrl: f,
|
|
1873
1873
|
downloadUrl: l,
|
|
1874
1874
|
showHeader: T = !0
|
|
1875
1875
|
}) {
|
|
1876
|
-
const { isImage: d, isVideo: k, isAudio:
|
|
1876
|
+
const { isImage: d, isVideo: k, isAudio: D } = _n(c), A = T !== !1, h = !!(l && n), _ = () => h ? /* @__PURE__ */ r.createElement(
|
|
1877
1877
|
"a",
|
|
1878
1878
|
{
|
|
1879
1879
|
className: Be.downloadLink,
|
|
@@ -1881,7 +1881,7 @@ function Ga({
|
|
|
1881
1881
|
download: n
|
|
1882
1882
|
},
|
|
1883
1883
|
"Download"
|
|
1884
|
-
) : null,
|
|
1884
|
+
) : null, F = () => d ? /* @__PURE__ */ r.createElement(
|
|
1885
1885
|
"img",
|
|
1886
1886
|
{
|
|
1887
1887
|
className: Be.imagePreview,
|
|
@@ -1897,10 +1897,10 @@ function Ga({
|
|
|
1897
1897
|
},
|
|
1898
1898
|
/* @__PURE__ */ r.createElement("source", { src: f, type: c }),
|
|
1899
1899
|
"Your browser does not support the video tag."
|
|
1900
|
-
) :
|
|
1901
|
-
return /* @__PURE__ */ r.createElement("div", { className: Be.container },
|
|
1900
|
+
) : D ? /* @__PURE__ */ r.createElement("audio", { className: Be.audioPreview, controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: f, type: c }), "Your browser does not support the audio tag.") : /* @__PURE__ */ r.createElement("div", { className: Be.unsupportedMessage }, /* @__PURE__ */ r.createElement("p", null, "Preview unavailable for this file type."), h ? /* @__PURE__ */ r.createElement("p", null, _()) : /* @__PURE__ */ r.createElement("p", null, "Download the file to inspect its contents."));
|
|
1901
|
+
return /* @__PURE__ */ r.createElement("div", { className: Be.container }, A && /* @__PURE__ */ r.createElement("div", { className: Be.header }, /* @__PURE__ */ r.createElement("span", { className: Be.filename, title: n }, n), _()), /* @__PURE__ */ r.createElement("div", { className: Be.previewArea }, F()), !A && h && /* @__PURE__ */ r.createElement("div", { className: Be.actions }, _()));
|
|
1902
1902
|
}
|
|
1903
|
-
const At = /* @__PURE__ */ new Map(),
|
|
1903
|
+
const At = /* @__PURE__ */ new Map(), bn = async (n) => {
|
|
1904
1904
|
var T;
|
|
1905
1905
|
if (!n)
|
|
1906
1906
|
return ut();
|
|
@@ -1950,7 +1950,7 @@ const At = /* @__PURE__ */ new Map(), Cn = async (n) => {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
return At.set(f, l), l;
|
|
1952
1952
|
};
|
|
1953
|
-
class
|
|
1953
|
+
class xn {
|
|
1954
1954
|
constructor(c) {
|
|
1955
1955
|
this.view = c, this.handleClick = this.handleClick.bind(this), this.view.dom.addEventListener("mousedown", this.handleClick);
|
|
1956
1956
|
}
|
|
@@ -1975,9 +1975,9 @@ class bn {
|
|
|
1975
1975
|
this.view.dom.removeEventListener("mousedown", this.handleClick);
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
|
-
const
|
|
1979
|
-
(n) => new
|
|
1980
|
-
), Gt =
|
|
1978
|
+
const Cn = dr.define(
|
|
1979
|
+
(n) => new xn(n)
|
|
1980
|
+
), Gt = $t(
|
|
1981
1981
|
function({
|
|
1982
1982
|
code: c,
|
|
1983
1983
|
onChange: f,
|
|
@@ -1985,49 +1985,49 @@ const xn = dr.define(
|
|
|
1985
1985
|
className: T,
|
|
1986
1986
|
onSaveShortcut: d,
|
|
1987
1987
|
readOnly: k = !1,
|
|
1988
|
-
additionalExtensions:
|
|
1989
|
-
},
|
|
1990
|
-
const h =
|
|
1988
|
+
additionalExtensions: D
|
|
1989
|
+
}, A) {
|
|
1990
|
+
const h = V(
|
|
1991
1991
|
null
|
|
1992
|
-
), _ =
|
|
1993
|
-
return
|
|
1992
|
+
), _ = V(null), F = V(new Tt()), S = V(new Tt()), K = V(new Tt()), B = V(c), C = V(f), G = V(!1);
|
|
1993
|
+
return Wt(A, () => ({
|
|
1994
1994
|
focus: () => {
|
|
1995
|
-
var
|
|
1996
|
-
(
|
|
1995
|
+
var y;
|
|
1996
|
+
(y = _.current) == null || y.focus();
|
|
1997
1997
|
},
|
|
1998
1998
|
blur: () => {
|
|
1999
|
-
const
|
|
2000
|
-
|
|
1999
|
+
const y = _.current;
|
|
2000
|
+
y && y.contentDOM.blur();
|
|
2001
2001
|
},
|
|
2002
2002
|
getCursorPosition: () => _.current ? _.current.state.selection.main.anchor : null,
|
|
2003
|
-
setCursorPosition: (
|
|
2003
|
+
setCursorPosition: (y) => {
|
|
2004
2004
|
if (!_.current)
|
|
2005
2005
|
return;
|
|
2006
|
-
const
|
|
2007
|
-
|
|
2006
|
+
const x = Math.min(
|
|
2007
|
+
y,
|
|
2008
2008
|
_.current.state.doc.length
|
|
2009
|
-
),
|
|
2010
|
-
gt.range(
|
|
2009
|
+
), z = gt.create([
|
|
2010
|
+
gt.range(x, x)
|
|
2011
2011
|
]);
|
|
2012
2012
|
_.current.dispatch({
|
|
2013
|
-
selection:
|
|
2013
|
+
selection: z,
|
|
2014
2014
|
scrollIntoView: !0
|
|
2015
2015
|
});
|
|
2016
2016
|
}
|
|
2017
|
-
})),
|
|
2018
|
-
|
|
2019
|
-
}, [c]),
|
|
2020
|
-
|
|
2021
|
-
}, [f]),
|
|
2017
|
+
})), W(() => {
|
|
2018
|
+
B.current = c;
|
|
2019
|
+
}, [c]), W(() => {
|
|
2020
|
+
C.current = f;
|
|
2021
|
+
}, [f]), W(() => {
|
|
2022
2022
|
if (_.current)
|
|
2023
2023
|
return;
|
|
2024
|
-
const
|
|
2025
|
-
if (!
|
|
2024
|
+
const y = h.current;
|
|
2025
|
+
if (!y)
|
|
2026
2026
|
return;
|
|
2027
|
-
const
|
|
2027
|
+
const x = fr.create({
|
|
2028
2028
|
doc: c,
|
|
2029
2029
|
extensions: [
|
|
2030
|
-
|
|
2030
|
+
K.current.of(D ?? []),
|
|
2031
2031
|
mr(),
|
|
2032
2032
|
pr(),
|
|
2033
2033
|
hr(),
|
|
@@ -2035,9 +2035,9 @@ const xn = dr.define(
|
|
|
2035
2035
|
vr(),
|
|
2036
2036
|
wr(),
|
|
2037
2037
|
gr(),
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2038
|
+
Cn,
|
|
2039
|
+
F.current.of(ut()),
|
|
2040
|
+
S.current.of(
|
|
2041
2041
|
ct.editable.of(!k)
|
|
2042
2042
|
),
|
|
2043
2043
|
Ar(Nr),
|
|
@@ -2045,13 +2045,13 @@ const xn = dr.define(
|
|
|
2045
2045
|
Ir(),
|
|
2046
2046
|
kr(),
|
|
2047
2047
|
yr(),
|
|
2048
|
-
|
|
2048
|
+
Cr(),
|
|
2049
2049
|
Pr(),
|
|
2050
|
-
ct.updateListener.of((
|
|
2051
|
-
if (!
|
|
2050
|
+
ct.updateListener.of((J) => {
|
|
2051
|
+
if (!J.docChanged)
|
|
2052
2052
|
return;
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2053
|
+
const oe = J.state.doc.toString();
|
|
2054
|
+
oe !== B.current && (B.current = oe, C.current(oe));
|
|
2055
2055
|
}),
|
|
2056
2056
|
Er.of([
|
|
2057
2057
|
{
|
|
@@ -2064,72 +2064,73 @@ const xn = dr.define(
|
|
|
2064
2064
|
...Lr,
|
|
2065
2065
|
...Rr,
|
|
2066
2066
|
..._r,
|
|
2067
|
-
...
|
|
2068
|
-
|
|
2067
|
+
...br,
|
|
2068
|
+
xr
|
|
2069
2069
|
])
|
|
2070
2070
|
]
|
|
2071
|
-
}),
|
|
2072
|
-
return _.current =
|
|
2073
|
-
|
|
2071
|
+
}), z = new ct({ state: x, parent: y });
|
|
2072
|
+
return _.current = z, () => {
|
|
2073
|
+
z.destroy(), _.current = null;
|
|
2074
2074
|
};
|
|
2075
|
-
}, []),
|
|
2076
|
-
const
|
|
2077
|
-
|
|
2078
|
-
effects:
|
|
2079
|
-
|
|
2075
|
+
}, []), W(() => {
|
|
2076
|
+
const y = _.current;
|
|
2077
|
+
y && y.dispatch({
|
|
2078
|
+
effects: K.current.reconfigure(
|
|
2079
|
+
D ?? []
|
|
2080
2080
|
)
|
|
2081
2081
|
});
|
|
2082
|
-
}, [
|
|
2083
|
-
const
|
|
2084
|
-
if (!
|
|
2082
|
+
}, [D]), W(() => {
|
|
2083
|
+
const y = _.current;
|
|
2084
|
+
if (!y)
|
|
2085
2085
|
return;
|
|
2086
|
-
const
|
|
2087
|
-
c !==
|
|
2088
|
-
changes: { from: 0, to:
|
|
2086
|
+
const x = y.state.doc.toString();
|
|
2087
|
+
c !== x && y.dispatch({
|
|
2088
|
+
changes: { from: 0, to: y.state.doc.length, insert: c }
|
|
2089
2089
|
});
|
|
2090
|
-
}, [c]),
|
|
2091
|
-
var
|
|
2092
|
-
const
|
|
2093
|
-
if (!
|
|
2090
|
+
}, [c]), W(() => {
|
|
2091
|
+
var oe;
|
|
2092
|
+
const y = _.current;
|
|
2093
|
+
if (!y)
|
|
2094
2094
|
return;
|
|
2095
|
-
const
|
|
2096
|
-
(!
|
|
2097
|
-
effects:
|
|
2095
|
+
const x = (oe = l == null ? void 0 : l.split(".").pop()) == null ? void 0 : oe.toLowerCase();
|
|
2096
|
+
(!x || x === "php") && y.dispatch({
|
|
2097
|
+
effects: F.current.reconfigure(ut())
|
|
2098
2098
|
});
|
|
2099
|
-
let
|
|
2100
|
-
return
|
|
2101
|
-
|
|
2102
|
-
effects:
|
|
2099
|
+
let J = !1;
|
|
2100
|
+
return bn(l).then((de) => {
|
|
2101
|
+
J || !_.current || _.current.dispatch({
|
|
2102
|
+
effects: F.current.reconfigure(de)
|
|
2103
2103
|
});
|
|
2104
2104
|
}), () => {
|
|
2105
|
-
|
|
2105
|
+
J = !0;
|
|
2106
2106
|
};
|
|
2107
|
-
}, [l]),
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
effects:
|
|
2107
|
+
}, [l]), W(() => {
|
|
2108
|
+
const y = _.current;
|
|
2109
|
+
y && (y.hasFocus && (G.current = !0), y.dispatch({
|
|
2110
|
+
effects: S.current.reconfigure(
|
|
2111
2111
|
ct.editable.of(!k)
|
|
2112
2112
|
)
|
|
2113
2113
|
}));
|
|
2114
2114
|
}, [k]), qt(() => {
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2115
|
+
const y = _.current;
|
|
2116
|
+
y && G.current && !y.hasFocus && (y.focus(), G.current = !1);
|
|
2117
2117
|
}, [l, k]), /* @__PURE__ */ r.createElement("div", { ref: h, className: T });
|
|
2118
2118
|
}
|
|
2119
2119
|
);
|
|
2120
2120
|
Gt.displayName = "CodeEditor";
|
|
2121
|
-
const Rn = "
|
|
2121
|
+
const Rn = "_fileExplorerContainer_rb5rx_1", kn = "_dropActive_rb5rx_9", Pn = "_fileExplorerHeader_rb5rx_14", Sn = "_fileExplorerTitle_rb5rx_23", Tn = "_fileExplorerSubsectionTitle_rb5rx_31", Dn = "_fileExplorerActions_rb5rx_35", An = "_fileExplorerButton_rb5rx_41", Nn = "_fileExplorerIconButton_rb5rx_71", Fn = "_fileExplorerTree_rb5rx_83", In = "_dockPresentation_rb5rx_92", Ln = "_fileExplorerUploadButton_rb5rx_152", ye = {
|
|
2122
2122
|
fileExplorerContainer: Rn,
|
|
2123
2123
|
dropActive: kn,
|
|
2124
2124
|
fileExplorerHeader: Pn,
|
|
2125
2125
|
fileExplorerTitle: Sn,
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2126
|
+
fileExplorerSubsectionTitle: Tn,
|
|
2127
|
+
fileExplorerActions: Dn,
|
|
2128
|
+
fileExplorerButton: An,
|
|
2129
|
+
fileExplorerIconButton: Nn,
|
|
2130
|
+
fileExplorerTree: Fn,
|
|
2131
|
+
dockPresentation: In,
|
|
2132
|
+
fileExplorerUploadButton: Ln
|
|
2133
|
+
}, Yt = 1024 * 1024, On = (n) => {
|
|
2133
2134
|
const c = n.byteLength;
|
|
2134
2135
|
for (let f = 0; f < Math.min(c, 4096); f++)
|
|
2135
2136
|
if (n[f] === 0)
|
|
@@ -2143,22 +2144,22 @@ const Rn = "_fileExplorerContainer_8eol9_1", kn = "_dropActive_8eol9_9", Pn = "_
|
|
|
2143
2144
|
const f = new Blob([n]), l = URL.createObjectURL(f);
|
|
2144
2145
|
return setTimeout(() => URL.revokeObjectURL(l), 6e4), { url: l, filename: c };
|
|
2145
2146
|
};
|
|
2146
|
-
async function
|
|
2147
|
-
const f =
|
|
2147
|
+
async function Bn(n, c = Yt) {
|
|
2148
|
+
const f = Mn(n);
|
|
2148
2149
|
if (f !== void 0 && f > c)
|
|
2149
2150
|
return { type: "too-large" };
|
|
2150
2151
|
if (typeof n.stream == "function")
|
|
2151
|
-
return
|
|
2152
|
+
return jn(n, c);
|
|
2152
2153
|
const l = new Uint8Array(await n.arrayBuffer());
|
|
2153
2154
|
return l.byteLength > c ? { type: "too-large" } : { type: "inline", data: l };
|
|
2154
2155
|
}
|
|
2155
|
-
function
|
|
2156
|
+
function Mn(n) {
|
|
2156
2157
|
if (typeof n.filesize == "number")
|
|
2157
2158
|
return n.filesize;
|
|
2158
2159
|
if (typeof n.size == "number")
|
|
2159
2160
|
return n.size;
|
|
2160
2161
|
}
|
|
2161
|
-
async function
|
|
2162
|
+
async function jn(n, c) {
|
|
2162
2163
|
const f = n.stream().getReader(), l = [];
|
|
2163
2164
|
let T = 0;
|
|
2164
2165
|
try {
|
|
@@ -2180,11 +2181,11 @@ async function Mn(n, c) {
|
|
|
2180
2181
|
f.releaseLock();
|
|
2181
2182
|
}
|
|
2182
2183
|
}
|
|
2183
|
-
const
|
|
2184
|
+
const Vn = (n) => {
|
|
2184
2185
|
const c = n.split(".").pop();
|
|
2185
2186
|
return Lt[c] || Lt._default;
|
|
2186
|
-
},
|
|
2187
|
-
function
|
|
2187
|
+
}, $n = (n) => n.startsWith("image/") || n.startsWith("video/") || n.startsWith("audio/");
|
|
2188
|
+
function Wn({
|
|
2188
2189
|
filesystem: n,
|
|
2189
2190
|
currentPath: c,
|
|
2190
2191
|
selectedDirPath: f,
|
|
@@ -2192,239 +2193,240 @@ function zn({
|
|
|
2192
2193
|
onFileOpened: T,
|
|
2193
2194
|
onSelectionCleared: d,
|
|
2194
2195
|
onShowMessage: k,
|
|
2195
|
-
documentRoot:
|
|
2196
|
-
readOnly:
|
|
2196
|
+
documentRoot: D,
|
|
2197
|
+
readOnly: A = !1,
|
|
2197
2198
|
title: h = "Files",
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2199
|
+
mobileSubsectionTitle: _,
|
|
2200
|
+
showBinaryPreviewHeader: F = !0,
|
|
2201
|
+
dockPresentation: S = !1,
|
|
2202
|
+
useWordPressTooltips: K = !1
|
|
2201
2203
|
}) {
|
|
2202
|
-
const
|
|
2203
|
-
|
|
2204
|
-
!c || !
|
|
2204
|
+
const B = V(null), C = V(null), G = Ft(() => c ? Le(c) : f ?? D, [c, D]), [y, x] = ee(!1);
|
|
2205
|
+
W(() => {
|
|
2206
|
+
!c || !B.current || (l(Le(c)), B.current.focusPath(c, {
|
|
2205
2207
|
select: !0,
|
|
2206
2208
|
domFocus: !1,
|
|
2207
2209
|
notify: !1
|
|
2208
|
-
}),
|
|
2210
|
+
}), B.current.expandToPath(c));
|
|
2209
2211
|
}, [c, l]);
|
|
2210
|
-
const
|
|
2212
|
+
const z = async (g, $) => {
|
|
2211
2213
|
try {
|
|
2212
|
-
const
|
|
2213
|
-
if (
|
|
2214
|
-
const
|
|
2215
|
-
if (!
|
|
2214
|
+
const N = await n.read(g), p = await Bn(N);
|
|
2215
|
+
if (p.type === "too-large") {
|
|
2216
|
+
const L = Yt / 1024 / 1024;
|
|
2217
|
+
if (!S) {
|
|
2216
2218
|
await k(
|
|
2217
|
-
|
|
2218
|
-
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${
|
|
2219
|
+
g,
|
|
2220
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${L}MB).`), /* @__PURE__ */ r.createElement("p", null, "Open or download it outside the in-browser editor."))
|
|
2219
2221
|
);
|
|
2220
2222
|
return;
|
|
2221
2223
|
}
|
|
2222
|
-
const
|
|
2224
|
+
const Q = et(g) || "download";
|
|
2223
2225
|
await k(
|
|
2224
|
-
|
|
2225
|
-
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${
|
|
2226
|
+
g,
|
|
2227
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${L}MB).`), /* @__PURE__ */ r.createElement("p", null, /* @__PURE__ */ r.createElement(
|
|
2226
2228
|
tt,
|
|
2227
2229
|
{
|
|
2228
2230
|
type: "button",
|
|
2229
2231
|
variant: "link",
|
|
2230
2232
|
onClick: () => {
|
|
2231
|
-
|
|
2233
|
+
J(g, Q);
|
|
2232
2234
|
}
|
|
2233
2235
|
},
|
|
2234
2236
|
"Download ",
|
|
2235
|
-
|
|
2237
|
+
Q
|
|
2236
2238
|
)))
|
|
2237
2239
|
);
|
|
2238
2240
|
return;
|
|
2239
2241
|
}
|
|
2240
|
-
const
|
|
2241
|
-
if (
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
|
|
2242
|
+
const M = p.data, Y = et(g) || "download";
|
|
2243
|
+
if (On(M)) {
|
|
2244
|
+
const L = Vn(Y), { url: Q, filename: X } = Vt(
|
|
2245
|
+
M,
|
|
2246
|
+
Y
|
|
2245
2247
|
);
|
|
2246
|
-
if (
|
|
2247
|
-
const
|
|
2248
|
+
if ($n(L)) {
|
|
2249
|
+
const ve = new Blob([M], { type: L }), me = URL.createObjectURL(ve);
|
|
2248
2250
|
await k(
|
|
2249
|
-
|
|
2251
|
+
g,
|
|
2250
2252
|
/* @__PURE__ */ r.createElement(
|
|
2251
2253
|
Br,
|
|
2252
2254
|
{
|
|
2253
|
-
filename:
|
|
2254
|
-
mimeType:
|
|
2255
|
-
dataUrl:
|
|
2256
|
-
downloadUrl:
|
|
2257
|
-
showHeader:
|
|
2255
|
+
filename: X,
|
|
2256
|
+
mimeType: L,
|
|
2257
|
+
dataUrl: me,
|
|
2258
|
+
downloadUrl: Q,
|
|
2259
|
+
showHeader: F
|
|
2258
2260
|
}
|
|
2259
2261
|
)
|
|
2260
2262
|
);
|
|
2261
2263
|
return;
|
|
2262
2264
|
}
|
|
2263
2265
|
await k(
|
|
2264
|
-
|
|
2265
|
-
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, "Binary file. Cannot be edited."), /* @__PURE__ */ r.createElement("p", null, /* @__PURE__ */ r.createElement("a", { href:
|
|
2266
|
+
g,
|
|
2267
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, "Binary file. Cannot be edited."), /* @__PURE__ */ r.createElement("p", null, /* @__PURE__ */ r.createElement("a", { href: Q, download: X }, "Download ", X)))
|
|
2266
2268
|
);
|
|
2267
2269
|
return;
|
|
2268
2270
|
}
|
|
2269
|
-
const
|
|
2270
|
-
await T(
|
|
2271
|
-
} catch (
|
|
2272
|
-
Xe.error("Could not open file",
|
|
2271
|
+
const te = new TextDecoder("utf-8").decode(M);
|
|
2272
|
+
await T(g, te, $);
|
|
2273
|
+
} catch (N) {
|
|
2274
|
+
Xe.error("Could not open file", N), await k(null, "Could not open file.");
|
|
2273
2275
|
}
|
|
2274
|
-
},
|
|
2276
|
+
}, J = async (g, $) => {
|
|
2275
2277
|
try {
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
} catch (
|
|
2279
|
-
Xe.error("Could not download file",
|
|
2280
|
-
}
|
|
2281
|
-
},
|
|
2282
|
-
var
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
},
|
|
2286
|
-
var
|
|
2287
|
-
|
|
2278
|
+
const N = await n.read(g), p = new Uint8Array(await N.arrayBuffer()), { url: M } = Vt(p, $), Y = document.createElement("a");
|
|
2279
|
+
Y.href = M, Y.download = $, document.body.appendChild(Y), Y.click(), document.body.removeChild(Y);
|
|
2280
|
+
} catch (N) {
|
|
2281
|
+
Xe.error("Could not download file", N), await k(g, "Could not download file.");
|
|
2282
|
+
}
|
|
2283
|
+
}, oe = (g) => {
|
|
2284
|
+
var N;
|
|
2285
|
+
const $ = Array.from(g.target.files ?? []);
|
|
2286
|
+
g.target.value = "", $.length !== 0 && ((N = B.current) == null || N.importFiles($, f ?? D).catch((p) => Xe.error("Failed to import files", p)));
|
|
2287
|
+
}, de = (g) => {
|
|
2288
|
+
var $;
|
|
2289
|
+
g.dataTransfer.types.includes(
|
|
2288
2290
|
"application/x-wp-playground-path"
|
|
2289
|
-
) || (
|
|
2290
|
-
|
|
2291
|
-
f ??
|
|
2291
|
+
) || (g.preventDefault(), !A && (($ = B.current) == null || $.importDataTransfer(
|
|
2292
|
+
g.dataTransfer,
|
|
2293
|
+
f ?? D
|
|
2292
2294
|
).catch(
|
|
2293
|
-
(
|
|
2295
|
+
(N) => Xe.error("Failed to import dropped files", N)
|
|
2294
2296
|
)));
|
|
2295
2297
|
};
|
|
2296
2298
|
return /* @__PURE__ */ r.createElement(
|
|
2297
2299
|
"div",
|
|
2298
2300
|
{
|
|
2299
|
-
className: De(
|
|
2300
|
-
[
|
|
2301
|
-
[
|
|
2301
|
+
className: De(ye.fileExplorerContainer, {
|
|
2302
|
+
[ye.dropActive]: y,
|
|
2303
|
+
[ye.dockPresentation]: S
|
|
2302
2304
|
}),
|
|
2303
|
-
onDragEnter: (
|
|
2304
|
-
|
|
2305
|
+
onDragEnter: (g) => {
|
|
2306
|
+
g.dataTransfer.types.includes(
|
|
2305
2307
|
"application/x-wp-playground-path"
|
|
2306
|
-
) || (
|
|
2308
|
+
) || (g.preventDefault(), A || x(!0));
|
|
2307
2309
|
},
|
|
2308
|
-
onDragOver: (
|
|
2309
|
-
|
|
2310
|
+
onDragOver: (g) => {
|
|
2311
|
+
g.dataTransfer.types.includes(
|
|
2310
2312
|
"application/x-wp-playground-path"
|
|
2311
|
-
) || (
|
|
2313
|
+
) || (g.preventDefault(), g.dataTransfer.dropEffect = A ? "none" : "copy");
|
|
2312
2314
|
},
|
|
2313
|
-
onDragLeave: (
|
|
2314
|
-
const
|
|
2315
|
-
(
|
|
2315
|
+
onDragLeave: (g) => {
|
|
2316
|
+
const $ = g.relatedTarget;
|
|
2317
|
+
(!$ || !g.currentTarget.contains($)) && x(!1);
|
|
2316
2318
|
},
|
|
2317
|
-
onDropCapture: () =>
|
|
2318
|
-
onDrop:
|
|
2319
|
+
onDropCapture: () => x(!1),
|
|
2320
|
+
onDrop: de
|
|
2319
2321
|
},
|
|
2320
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
2322
|
+
/* @__PURE__ */ r.createElement("div", { className: ye.fileExplorerHeader }, /* @__PURE__ */ r.createElement("span", { className: ye.fileExplorerTitle }, h), _ ? /* @__PURE__ */ r.createElement("span", { className: ye.fileExplorerSubsectionTitle }, _) : null, A ? null : /* @__PURE__ */ r.createElement("div", { className: ye.fileExplorerActions }, /* @__PURE__ */ r.createElement(
|
|
2321
2323
|
Nt,
|
|
2322
2324
|
{
|
|
2323
2325
|
label: "Create new file",
|
|
2324
|
-
useWordPressTooltip:
|
|
2326
|
+
useWordPressTooltip: K
|
|
2325
2327
|
},
|
|
2326
2328
|
/* @__PURE__ */ r.createElement(
|
|
2327
2329
|
"button",
|
|
2328
2330
|
{
|
|
2329
2331
|
className: De(
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
+
ye.fileExplorerButton,
|
|
2333
|
+
ye.fileExplorerIconButton
|
|
2332
2334
|
),
|
|
2333
2335
|
type: "button",
|
|
2334
2336
|
onClick: () => {
|
|
2335
|
-
|
|
2337
|
+
B.current && B.current.createFile();
|
|
2336
2338
|
},
|
|
2337
2339
|
"aria-label": "Create new file",
|
|
2338
|
-
title:
|
|
2340
|
+
title: K ? void 0 : "Create new file"
|
|
2339
2341
|
},
|
|
2340
|
-
|
|
2342
|
+
S ? /* @__PURE__ */ r.createElement(Hn, null) : /* @__PURE__ */ r.createElement(St, { icon: Gr, size: 20 })
|
|
2341
2343
|
)
|
|
2342
2344
|
), /* @__PURE__ */ r.createElement(
|
|
2343
2345
|
Nt,
|
|
2344
2346
|
{
|
|
2345
2347
|
label: "Create new folder",
|
|
2346
|
-
useWordPressTooltip:
|
|
2348
|
+
useWordPressTooltip: K
|
|
2347
2349
|
},
|
|
2348
2350
|
/* @__PURE__ */ r.createElement(
|
|
2349
2351
|
"button",
|
|
2350
2352
|
{
|
|
2351
2353
|
className: De(
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
+
ye.fileExplorerButton,
|
|
2355
|
+
ye.fileExplorerIconButton
|
|
2354
2356
|
),
|
|
2355
2357
|
type: "button",
|
|
2356
2358
|
onClick: () => {
|
|
2357
|
-
|
|
2359
|
+
B.current && B.current.createFolder();
|
|
2358
2360
|
},
|
|
2359
2361
|
"aria-label": "Create new folder",
|
|
2360
|
-
title:
|
|
2362
|
+
title: K ? void 0 : "Create new folder"
|
|
2361
2363
|
},
|
|
2362
|
-
|
|
2364
|
+
S ? /* @__PURE__ */ r.createElement(Un, null) : /* @__PURE__ */ r.createElement(St, { icon: zr, size: 20 })
|
|
2363
2365
|
)
|
|
2364
2366
|
), /* @__PURE__ */ r.createElement(
|
|
2365
2367
|
Nt,
|
|
2366
2368
|
{
|
|
2367
2369
|
label: "Upload files",
|
|
2368
|
-
useWordPressTooltip:
|
|
2370
|
+
useWordPressTooltip: K
|
|
2369
2371
|
},
|
|
2370
2372
|
/* @__PURE__ */ r.createElement(
|
|
2371
2373
|
"button",
|
|
2372
2374
|
{
|
|
2373
2375
|
className: De(
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2376
|
+
ye.fileExplorerButton,
|
|
2377
|
+
ye.fileExplorerIconButton,
|
|
2378
|
+
ye.fileExplorerUploadButton
|
|
2377
2379
|
),
|
|
2378
2380
|
type: "button",
|
|
2379
2381
|
onClick: () => {
|
|
2380
|
-
var
|
|
2381
|
-
return (
|
|
2382
|
+
var g;
|
|
2383
|
+
return (g = C.current) == null ? void 0 : g.click();
|
|
2382
2384
|
},
|
|
2383
2385
|
"aria-label": "Upload files",
|
|
2384
|
-
title:
|
|
2386
|
+
title: K ? void 0 : "Upload files"
|
|
2385
2387
|
},
|
|
2386
2388
|
/* @__PURE__ */ r.createElement(
|
|
2387
2389
|
St,
|
|
2388
2390
|
{
|
|
2389
2391
|
icon: Yr,
|
|
2390
|
-
size:
|
|
2392
|
+
size: S ? 16 : 20
|
|
2391
2393
|
}
|
|
2392
2394
|
)
|
|
2393
2395
|
)
|
|
2394
2396
|
), /* @__PURE__ */ r.createElement(
|
|
2395
2397
|
"input",
|
|
2396
2398
|
{
|
|
2397
|
-
ref:
|
|
2399
|
+
ref: C,
|
|
2398
2400
|
type: "file",
|
|
2399
2401
|
multiple: !0,
|
|
2400
2402
|
style: { display: "none" },
|
|
2401
|
-
onChange:
|
|
2403
|
+
onChange: oe
|
|
2402
2404
|
}
|
|
2403
2405
|
))),
|
|
2404
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
2406
|
+
/* @__PURE__ */ r.createElement("div", { className: ye.fileExplorerTree }, /* @__PURE__ */ r.createElement(
|
|
2405
2407
|
Or,
|
|
2406
2408
|
{
|
|
2407
|
-
ref:
|
|
2408
|
-
readOnly:
|
|
2409
|
+
ref: B,
|
|
2410
|
+
readOnly: A,
|
|
2409
2411
|
filesystem: n,
|
|
2410
|
-
root:
|
|
2411
|
-
initialSelectedPath:
|
|
2412
|
-
onSelect: async (
|
|
2413
|
-
if (!
|
|
2414
|
-
l(
|
|
2412
|
+
root: D,
|
|
2413
|
+
initialSelectedPath: G,
|
|
2414
|
+
onSelect: async (g) => {
|
|
2415
|
+
if (!g) {
|
|
2416
|
+
l(D), await d();
|
|
2415
2417
|
return;
|
|
2416
2418
|
}
|
|
2417
2419
|
try {
|
|
2418
|
-
if (await n.isDir(
|
|
2419
|
-
l(
|
|
2420
|
+
if (await n.isDir(g)) {
|
|
2421
|
+
l(g);
|
|
2420
2422
|
return;
|
|
2421
2423
|
}
|
|
2422
2424
|
} catch {
|
|
2423
2425
|
}
|
|
2424
|
-
l(Le(
|
|
2426
|
+
l(Le(g)), await z(g, !1);
|
|
2425
2427
|
},
|
|
2426
|
-
onDoubleClickFile: async (
|
|
2427
|
-
await
|
|
2428
|
+
onDoubleClickFile: async (g) => {
|
|
2429
|
+
await z(g, !0);
|
|
2428
2430
|
}
|
|
2429
2431
|
}
|
|
2430
2432
|
))
|
|
@@ -2435,9 +2437,9 @@ function Nt({
|
|
|
2435
2437
|
useWordPressTooltip: c,
|
|
2436
2438
|
children: f
|
|
2437
2439
|
}) {
|
|
2438
|
-
return c ? /* @__PURE__ */ r.createElement(
|
|
2440
|
+
return c ? /* @__PURE__ */ r.createElement(Ht, { text: n, delay: 0, placement: "top" }, f) : f;
|
|
2439
2441
|
}
|
|
2440
|
-
const
|
|
2442
|
+
const Hn = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32", width: "24", height: "24", "aria-hidden": "true" }, /* @__PURE__ */ r.createElement(
|
|
2441
2443
|
"path",
|
|
2442
2444
|
{
|
|
2443
2445
|
d: "M11 6h7l5 5v12a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",
|
|
@@ -2464,7 +2466,7 @@ const $n = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32",
|
|
|
2464
2466
|
strokeWidth: "2",
|
|
2465
2467
|
strokeLinecap: "round"
|
|
2466
2468
|
}
|
|
2467
|
-
))),
|
|
2469
|
+
))), Un = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32", width: "24", height: "24", "aria-hidden": "true" }, /* @__PURE__ */ r.createElement(
|
|
2468
2470
|
"path",
|
|
2469
2471
|
{
|
|
2470
2472
|
d: "M6 9h7l3 3h10v11a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V9z",
|
|
@@ -2491,40 +2493,40 @@ const $n = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32",
|
|
|
2491
2493
|
strokeWidth: "2",
|
|
2492
2494
|
strokeLinecap: "round"
|
|
2493
2495
|
}
|
|
2494
|
-
))),
|
|
2495
|
-
container:
|
|
2496
|
-
content:
|
|
2497
|
-
sidebarWrapper:
|
|
2498
|
-
editorWrapper:
|
|
2499
|
-
editorHeader:
|
|
2500
|
-
editorPath:
|
|
2501
|
-
editorPathDirectory:
|
|
2502
|
-
editorPathFilename:
|
|
2503
|
-
editorPathPlaceholder:
|
|
2504
|
-
editorPathPortaled:
|
|
2505
|
-
editorHeaderActions:
|
|
2506
|
-
saveStatus:
|
|
2507
|
-
saveStatusSaving:
|
|
2508
|
-
saveStatusPending:
|
|
2509
|
-
saveStatusError:
|
|
2510
|
-
editor:
|
|
2511
|
-
placeholder:
|
|
2512
|
-
messageArea:
|
|
2513
|
-
mobileToggle:
|
|
2514
|
-
mobileOverlay:
|
|
2515
|
-
dockPresentation:
|
|
2516
|
-
dockDirtyIndicator:
|
|
2517
|
-
dockSaveButton:
|
|
2518
|
-
sidebarOpen:
|
|
2519
|
-
editorHeaderPathPortaled:
|
|
2520
|
-
},
|
|
2496
|
+
))), zn = "_container_a36e6_1", Gn = "_content_a36e6_9", Yn = "_sidebarWrapper_a36e6_17", Zn = "_editorWrapper_a36e6_28", Kn = "_editorHeader_a36e6_37", qn = "_editorPath_a36e6_49", Jn = "_editorPathDirectory_a36e6_61", Xn = "_editorPathFilename_a36e6_68", Qn = "_editorPathPlaceholder_a36e6_73", ea = "_editorPathPortaled_a36e6_77", ta = "_editorHeaderActions_a36e6_83", ra = "_saveStatus_a36e6_90", na = "_saveStatusSaving_a36e6_97", aa = "_saveStatusPending_a36e6_98", oa = "_saveStatusError_a36e6_102", ia = "_editor_a36e6_28", la = "_placeholder_a36e6_124", sa = "_messageArea_a36e6_135", ca = "_mobileToggle_a36e6_171", ua = "_mobileOverlay_a36e6_175", fa = "_dockPresentation_a36e6_181", da = "_dockDirtyIndicator_a36e6_205", ma = "_dockSaveButton_a36e6_214", pa = "_sidebarOpen_a36e6_269", ha = "_editorHeaderPathPortaled_a36e6_367", q = {
|
|
2497
|
+
container: zn,
|
|
2498
|
+
content: Gn,
|
|
2499
|
+
sidebarWrapper: Yn,
|
|
2500
|
+
editorWrapper: Zn,
|
|
2501
|
+
editorHeader: Kn,
|
|
2502
|
+
editorPath: qn,
|
|
2503
|
+
editorPathDirectory: Jn,
|
|
2504
|
+
editorPathFilename: Xn,
|
|
2505
|
+
editorPathPlaceholder: Qn,
|
|
2506
|
+
editorPathPortaled: ea,
|
|
2507
|
+
editorHeaderActions: ta,
|
|
2508
|
+
saveStatus: ra,
|
|
2509
|
+
saveStatusSaving: na,
|
|
2510
|
+
saveStatusPending: aa,
|
|
2511
|
+
saveStatusError: oa,
|
|
2512
|
+
editor: ia,
|
|
2513
|
+
placeholder: la,
|
|
2514
|
+
messageArea: sa,
|
|
2515
|
+
mobileToggle: ca,
|
|
2516
|
+
mobileOverlay: ua,
|
|
2517
|
+
dockPresentation: fa,
|
|
2518
|
+
dockDirtyIndicator: da,
|
|
2519
|
+
dockSaveButton: ma,
|
|
2520
|
+
sidebarOpen: pa,
|
|
2521
|
+
editorHeaderPathPortaled: ha
|
|
2522
|
+
}, va = 1500, wa = 700, ga = 1e3, O = {
|
|
2521
2523
|
IDLE: "idle",
|
|
2522
2524
|
PENDING: "pending",
|
|
2523
2525
|
SAVING: "saving",
|
|
2524
2526
|
SAVED: "saved",
|
|
2525
2527
|
ERROR: "error"
|
|
2526
2528
|
};
|
|
2527
|
-
function
|
|
2529
|
+
function Za({
|
|
2528
2530
|
filesystem: n,
|
|
2529
2531
|
isVisible: c = !0,
|
|
2530
2532
|
documentRoot: f,
|
|
@@ -2533,263 +2535,263 @@ function Ya({
|
|
|
2533
2535
|
dockPresentation: d = !1,
|
|
2534
2536
|
mobileHeaderTarget: k = null
|
|
2535
2537
|
}) {
|
|
2536
|
-
const [
|
|
2538
|
+
const [D, A] = ee(
|
|
2537
2539
|
f
|
|
2538
|
-
), [h, _] =
|
|
2540
|
+
), [h, _] = ee(null), [F, S] = ee(""), [K, B] = ee(!0), [C, G] = ee(O.IDLE), [y, x] = ee(null), [z, J] = ee("idle"), [oe, de] = ee(!1), [g, $] = ee(null), N = V(null), p = V(null), M = V(!1), Y = V(h), te = V(
|
|
2539
2541
|
n
|
|
2540
|
-
),
|
|
2542
|
+
), L = V(null), Q = V(null), X = V(
|
|
2541
2543
|
/* @__PURE__ */ new WeakMap()
|
|
2542
|
-
), ve =
|
|
2543
|
-
|
|
2544
|
-
|
|
2544
|
+
), ve = V(!0), me = V(/* @__PURE__ */ new Map()), Ne = V(!1);
|
|
2545
|
+
te.current = n, W(() => {
|
|
2546
|
+
Y.current = h;
|
|
2545
2547
|
}, [h]);
|
|
2546
|
-
const Pe =
|
|
2547
|
-
const { filesystem:
|
|
2548
|
-
}).then(() =>
|
|
2549
|
-
|
|
2548
|
+
const Pe = Ue(async (b) => {
|
|
2549
|
+
const { filesystem: P, path: ie, content: le } = b, ce = Q.current === b, be = X.current, ge = (be.get(P) ?? Promise.resolve()).catch(() => {
|
|
2550
|
+
}).then(() => P.writeFile(ie, le));
|
|
2551
|
+
be.set(P, ge);
|
|
2550
2552
|
let Ie = !1;
|
|
2551
2553
|
try {
|
|
2552
2554
|
await ge;
|
|
2553
2555
|
} catch (Ge) {
|
|
2554
2556
|
Ie = !0, Xe.error("Failed to save file", Ge);
|
|
2555
2557
|
}
|
|
2556
|
-
const at = ve.current &&
|
|
2557
|
-
|
|
2558
|
+
const at = ve.current && be.get(P) === ge && te.current === P && Y.current === ie && L.current === null;
|
|
2559
|
+
be.get(P) === ge && be.delete(P), Q.current === b && (Q.current = null), at && (G(Ie ? O.ERROR : O.SAVED), x(
|
|
2558
2560
|
Ie ? "Could not save changes. Try again." : null
|
|
2559
|
-
),
|
|
2560
|
-
}, []),
|
|
2561
|
-
const
|
|
2562
|
-
|
|
2561
|
+
), ce && J(Ie ? "idle" : "saved"));
|
|
2562
|
+
}, []), re = Ue(() => {
|
|
2563
|
+
const b = L.current;
|
|
2564
|
+
b && (p.current !== null && (window.clearTimeout(p.current), p.current = null), L.current = null, Pe(b));
|
|
2563
2565
|
}, [Pe]);
|
|
2564
|
-
|
|
2566
|
+
W(() => (ve.current = !0, () => {
|
|
2565
2567
|
ve.current = !1;
|
|
2566
|
-
}), []),
|
|
2567
|
-
var
|
|
2568
|
-
((
|
|
2569
|
-
}, [f, n,
|
|
2570
|
-
|
|
2571
|
-
}, [f, n]),
|
|
2568
|
+
}), []), W(() => () => {
|
|
2569
|
+
var b;
|
|
2570
|
+
((b = L.current) == null ? void 0 : b.filesystem) === n && re();
|
|
2571
|
+
}, [f, n, re]), W(() => {
|
|
2572
|
+
M.current = !0, A(f), S(""), _(null), B(!0), G(O.IDLE), x(null), de(!1), $(null), me.current.clear(), Ne.current = !1;
|
|
2573
|
+
}, [f, n]), W(() => {
|
|
2572
2574
|
if (!n || !l || Ne.current)
|
|
2573
2575
|
return;
|
|
2574
|
-
let
|
|
2576
|
+
let b = !1;
|
|
2575
2577
|
return (async () => {
|
|
2576
2578
|
try {
|
|
2577
|
-
if (await n.fileExists(l) && !
|
|
2579
|
+
if (await n.fileExists(l) && !b) {
|
|
2578
2580
|
const le = await n.readFileAsText(l);
|
|
2579
|
-
if (
|
|
2581
|
+
if (b)
|
|
2580
2582
|
return;
|
|
2581
|
-
|
|
2582
|
-
var
|
|
2583
|
-
(
|
|
2583
|
+
M.current = !0, _(l), S(le), B(!1), G(O.IDLE), x(null), setTimeout(() => {
|
|
2584
|
+
var ce;
|
|
2585
|
+
(ce = N.current) == null || ce.focus();
|
|
2584
2586
|
}, 100);
|
|
2585
2587
|
}
|
|
2586
2588
|
} catch (ie) {
|
|
2587
2589
|
Xe.debug("Could not auto-open initial path:", ie);
|
|
2588
2590
|
} finally {
|
|
2589
|
-
|
|
2591
|
+
b || (Ne.current = !0);
|
|
2590
2592
|
}
|
|
2591
2593
|
})(), () => {
|
|
2592
|
-
|
|
2594
|
+
b = !0;
|
|
2593
2595
|
};
|
|
2594
|
-
}, [n, l]),
|
|
2596
|
+
}, [n, l]), W(() => {
|
|
2595
2597
|
if (!n || !h) {
|
|
2596
|
-
p.current !== null && (window.clearTimeout(p.current), p.current = null),
|
|
2598
|
+
p.current !== null && (window.clearTimeout(p.current), p.current = null), L.current = null, h || G(O.IDLE);
|
|
2597
2599
|
return;
|
|
2598
2600
|
}
|
|
2599
|
-
if (
|
|
2600
|
-
|
|
2601
|
+
if (M.current) {
|
|
2602
|
+
M.current = !1, L.current = null;
|
|
2601
2603
|
return;
|
|
2602
2604
|
}
|
|
2603
|
-
p.current !== null && (window.clearTimeout(p.current), p.current = null),
|
|
2604
|
-
const
|
|
2605
|
+
p.current !== null && (window.clearTimeout(p.current), p.current = null), G(O.PENDING);
|
|
2606
|
+
const b = {
|
|
2605
2607
|
filesystem: n,
|
|
2606
2608
|
path: h,
|
|
2607
|
-
content:
|
|
2609
|
+
content: F
|
|
2608
2610
|
};
|
|
2609
|
-
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2612
|
-
},
|
|
2613
|
-
return p.current =
|
|
2614
|
-
p.current ===
|
|
2611
|
+
L.current = b;
|
|
2612
|
+
const P = window.setTimeout(() => {
|
|
2613
|
+
L.current === b && (p.current = null, L.current = null, G(O.SAVING), Pe(b));
|
|
2614
|
+
}, va);
|
|
2615
|
+
return p.current = P, () => {
|
|
2616
|
+
p.current === P && (window.clearTimeout(P), p.current = null);
|
|
2615
2617
|
};
|
|
2616
|
-
}, [
|
|
2617
|
-
if (
|
|
2618
|
+
}, [F, h, n, Pe]), W(() => {
|
|
2619
|
+
if (C !== O.SAVED)
|
|
2618
2620
|
return;
|
|
2619
|
-
const
|
|
2620
|
-
|
|
2621
|
-
(
|
|
2621
|
+
const b = window.setTimeout(() => {
|
|
2622
|
+
G(
|
|
2623
|
+
(P) => P === O.SAVED ? O.IDLE : P
|
|
2622
2624
|
);
|
|
2623
2625
|
}, 2e3);
|
|
2624
|
-
return () => window.clearTimeout(
|
|
2625
|
-
}, [
|
|
2626
|
-
|
|
2627
|
-
}, [
|
|
2628
|
-
if (
|
|
2626
|
+
return () => window.clearTimeout(b);
|
|
2627
|
+
}, [C]), W(() => {
|
|
2628
|
+
z === "idle" || C === O.SAVING || C === O.SAVED || J("idle");
|
|
2629
|
+
}, [z, C]), W(() => {
|
|
2630
|
+
if (z !== "saved")
|
|
2629
2631
|
return;
|
|
2630
|
-
const
|
|
2631
|
-
() =>
|
|
2632
|
-
|
|
2632
|
+
const b = window.setTimeout(
|
|
2633
|
+
() => J("idle"),
|
|
2634
|
+
ga
|
|
2633
2635
|
);
|
|
2634
|
-
return () => window.clearTimeout(
|
|
2635
|
-
}, [
|
|
2636
|
-
if (
|
|
2636
|
+
return () => window.clearTimeout(b);
|
|
2637
|
+
}, [z]), W(() => {
|
|
2638
|
+
if (z !== "waiting")
|
|
2637
2639
|
return;
|
|
2638
|
-
const
|
|
2639
|
-
() =>
|
|
2640
|
-
(
|
|
2640
|
+
const b = window.setTimeout(
|
|
2641
|
+
() => J(
|
|
2642
|
+
(P) => P === "waiting" ? "saving" : P
|
|
2641
2643
|
),
|
|
2642
|
-
|
|
2644
|
+
wa
|
|
2643
2645
|
);
|
|
2644
|
-
return () => window.clearTimeout(
|
|
2645
|
-
}, [
|
|
2646
|
-
const Oe =
|
|
2647
|
-
async (
|
|
2648
|
-
var
|
|
2649
|
-
const le = (
|
|
2650
|
-
le != null &&
|
|
2651
|
-
|
|
2646
|
+
return () => window.clearTimeout(b);
|
|
2647
|
+
}, [z]);
|
|
2648
|
+
const Oe = Ue(
|
|
2649
|
+
async (b, P, ie = !0) => {
|
|
2650
|
+
var ce;
|
|
2651
|
+
const le = (ce = N.current) == null ? void 0 : ce.getCursorPosition();
|
|
2652
|
+
le != null && Y.current && me.current.set(
|
|
2653
|
+
Y.current,
|
|
2652
2654
|
le
|
|
2653
|
-
),
|
|
2654
|
-
var
|
|
2655
|
-
const
|
|
2656
|
-
|
|
2655
|
+
), M.current = !0, _(b), S(P), $(null), B(!1), G(O.IDLE), x(null), de(!1), setTimeout(() => {
|
|
2656
|
+
var $e, ge, Ie;
|
|
2657
|
+
const be = me.current.get(b);
|
|
2658
|
+
be !== void 0 && (($e = N.current) == null || $e.setCursorPosition(be)), ie ? (ge = N.current) == null || ge.focus() : (Ie = N.current) == null || Ie.blur();
|
|
2657
2659
|
}, 50);
|
|
2658
2660
|
},
|
|
2659
2661
|
[]
|
|
2660
2662
|
);
|
|
2661
|
-
|
|
2663
|
+
W(() => {
|
|
2662
2664
|
var ie;
|
|
2663
2665
|
if (!h)
|
|
2664
2666
|
return;
|
|
2665
|
-
const
|
|
2666
|
-
var
|
|
2667
|
-
const le = (
|
|
2668
|
-
le != null &&
|
|
2669
|
-
}, 1e3),
|
|
2670
|
-
return
|
|
2671
|
-
var
|
|
2672
|
-
clearInterval(
|
|
2673
|
-
const le = (
|
|
2674
|
-
le != null &&
|
|
2667
|
+
const b = setInterval(() => {
|
|
2668
|
+
var ce;
|
|
2669
|
+
const le = (ce = N.current) == null ? void 0 : ce.getCursorPosition();
|
|
2670
|
+
le != null && me.current.set(h, le);
|
|
2671
|
+
}, 1e3), P = (ie = N.current) == null ? void 0 : ie.getCursorPosition();
|
|
2672
|
+
return P != null && me.current.set(h, P), () => {
|
|
2673
|
+
var ce;
|
|
2674
|
+
clearInterval(b);
|
|
2675
|
+
const le = (ce = N.current) == null ? void 0 : ce.getCursorPosition();
|
|
2676
|
+
le != null && me.current.set(h, le);
|
|
2675
2677
|
};
|
|
2676
|
-
}, [h]),
|
|
2678
|
+
}, [h]), W(() => {
|
|
2677
2679
|
if (!c || !h)
|
|
2678
2680
|
return;
|
|
2679
|
-
const
|
|
2681
|
+
const b = setTimeout(() => {
|
|
2680
2682
|
var ie;
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2683
|
+
const P = me.current.get(h);
|
|
2684
|
+
P !== void 0 && ((ie = N.current) == null || ie.setCursorPosition(P));
|
|
2683
2685
|
}, 100);
|
|
2684
|
-
return () => clearTimeout(
|
|
2686
|
+
return () => clearTimeout(b);
|
|
2685
2687
|
}, [c, h]);
|
|
2686
|
-
const
|
|
2687
|
-
var
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2690
|
-
}, []), Me =
|
|
2691
|
-
async (
|
|
2692
|
-
|
|
2688
|
+
const ne = Ue(async () => {
|
|
2689
|
+
var P;
|
|
2690
|
+
const b = (P = N.current) == null ? void 0 : P.getCursorPosition();
|
|
2691
|
+
b != null && Y.current && me.current.set(Y.current, b), M.current = !0, _(null), S(""), $(null), B(!0), G(O.IDLE), x(null);
|
|
2692
|
+
}, []), Me = Ue(
|
|
2693
|
+
async (b, P) => {
|
|
2694
|
+
M.current = !0, _(null), typeof P == "string" ? (S(P), $(null)) : (S(""), $(P)), B(!0), G(O.IDLE), x(null), de(!1);
|
|
2693
2695
|
},
|
|
2694
2696
|
[]
|
|
2695
|
-
),
|
|
2696
|
-
|
|
2697
|
-
}, [
|
|
2698
|
-
!
|
|
2697
|
+
), _e = Ue(() => {
|
|
2698
|
+
L.current && (Q.current = L.current, J("waiting"), G(O.SAVING), re());
|
|
2699
|
+
}, [re]), ke = Ue(() => {
|
|
2700
|
+
!L.current && C === O.ERROR && n && h && (L.current = {
|
|
2699
2701
|
filesystem: n,
|
|
2700
2702
|
path: h,
|
|
2701
|
-
content:
|
|
2702
|
-
}),
|
|
2703
|
-
}, [
|
|
2703
|
+
content: F
|
|
2704
|
+
}), L.current && (x(null), _e());
|
|
2705
|
+
}, [F, h, n, _e, C]), Fe = Ea(C, y), Se = ya(C, q), fe = _a(C);
|
|
2704
2706
|
let H = "Save";
|
|
2705
|
-
|
|
2706
|
-
const
|
|
2707
|
+
C === O.ERROR ? H = "Retry" : C === O.SAVED && z === "saved" ? H = "Saved" : C === O.SAVING && z === "saving" && (H = "Saving…");
|
|
2708
|
+
const w = C === O.PENDING || C === O.SAVING || C === O.ERROR;
|
|
2707
2709
|
if (!n)
|
|
2708
2710
|
return /* @__PURE__ */ r.createElement(
|
|
2709
2711
|
"div",
|
|
2710
2712
|
{
|
|
2711
|
-
className: De(
|
|
2712
|
-
[
|
|
2713
|
+
className: De(q.container, {
|
|
2714
|
+
[q.dockPresentation]: d
|
|
2713
2715
|
})
|
|
2714
2716
|
},
|
|
2715
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
2717
|
+
/* @__PURE__ */ r.createElement("div", { className: q.placeholder }, T)
|
|
2716
2718
|
);
|
|
2717
|
-
const
|
|
2719
|
+
const he = h ? Le(h) : null, pe = h ? et(h) : null, we = /* @__PURE__ */ r.createElement(
|
|
2718
2720
|
"div",
|
|
2719
2721
|
{
|
|
2720
|
-
className: De(
|
|
2721
|
-
[
|
|
2722
|
-
[
|
|
2722
|
+
className: De(q.editorPath, {
|
|
2723
|
+
[q.editorPathPlaceholder]: !(h != null && h.length),
|
|
2724
|
+
[q.editorPathPortaled]: k
|
|
2723
2725
|
}),
|
|
2724
2726
|
title: h ?? void 0
|
|
2725
2727
|
},
|
|
2726
|
-
|
|
2728
|
+
he && pe ? /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", { className: q.editorPathDirectory }, he === "/" ? "" : he), /* @__PURE__ */ r.createElement("span", { className: q.editorPathFilename }, "/", pe)) : `Browse files under ${f}`
|
|
2727
2729
|
);
|
|
2728
2730
|
return /* @__PURE__ */ r.createElement(
|
|
2729
2731
|
"div",
|
|
2730
2732
|
{
|
|
2731
|
-
className: De(
|
|
2732
|
-
[
|
|
2733
|
+
className: De(q.container, {
|
|
2734
|
+
[q.dockPresentation]: d
|
|
2733
2735
|
})
|
|
2734
2736
|
},
|
|
2735
2737
|
/* @__PURE__ */ r.createElement(
|
|
2736
2738
|
"div",
|
|
2737
2739
|
{
|
|
2738
|
-
className: De(
|
|
2739
|
-
[
|
|
2740
|
+
className: De(q.content, {
|
|
2741
|
+
[q.sidebarOpen]: oe
|
|
2740
2742
|
})
|
|
2741
2743
|
},
|
|
2742
2744
|
/* @__PURE__ */ r.createElement(
|
|
2743
2745
|
"div",
|
|
2744
2746
|
{
|
|
2745
|
-
className:
|
|
2746
|
-
onClick: () =>
|
|
2747
|
+
className: q.mobileOverlay,
|
|
2748
|
+
onClick: () => de(!1)
|
|
2747
2749
|
}
|
|
2748
2750
|
),
|
|
2749
|
-
/* @__PURE__ */ r.createElement("aside", { className:
|
|
2750
|
-
|
|
2751
|
+
/* @__PURE__ */ r.createElement("aside", { className: q.sidebarWrapper }, /* @__PURE__ */ r.createElement(
|
|
2752
|
+
Wn,
|
|
2751
2753
|
{
|
|
2752
2754
|
filesystem: n,
|
|
2753
2755
|
currentPath: h,
|
|
2754
|
-
selectedDirPath:
|
|
2755
|
-
setSelectedDirPath:
|
|
2756
|
+
selectedDirPath: D,
|
|
2757
|
+
setSelectedDirPath: A,
|
|
2756
2758
|
onFileOpened: Oe,
|
|
2757
|
-
onSelectionCleared:
|
|
2759
|
+
onSelectionCleared: ne,
|
|
2758
2760
|
onShowMessage: Me,
|
|
2759
2761
|
documentRoot: f,
|
|
2760
2762
|
dockPresentation: d,
|
|
2761
2763
|
useWordPressTooltips: d
|
|
2762
2764
|
}
|
|
2763
2765
|
)),
|
|
2764
|
-
/* @__PURE__ */ r.createElement("section", { className:
|
|
2766
|
+
/* @__PURE__ */ r.createElement("section", { className: q.editorWrapper }, /* @__PURE__ */ r.createElement(
|
|
2765
2767
|
"div",
|
|
2766
2768
|
{
|
|
2767
|
-
className: De(
|
|
2768
|
-
[
|
|
2769
|
+
className: De(q.editorHeader, {
|
|
2770
|
+
[q.editorHeaderPathPortaled]: k
|
|
2769
2771
|
})
|
|
2770
2772
|
},
|
|
2771
2773
|
/* @__PURE__ */ r.createElement(
|
|
2772
2774
|
tt,
|
|
2773
2775
|
{
|
|
2774
|
-
className:
|
|
2776
|
+
className: q.mobileToggle,
|
|
2775
2777
|
variant: "secondary",
|
|
2776
|
-
onClick: () =>
|
|
2778
|
+
onClick: () => de((b) => !b)
|
|
2777
2779
|
},
|
|
2778
|
-
|
|
2780
|
+
oe ? "Hide files" : "Browse files"
|
|
2779
2781
|
),
|
|
2780
2782
|
k ? Mr(we, k) : we,
|
|
2781
|
-
d && !
|
|
2783
|
+
d && !K && h ? /* @__PURE__ */ r.createElement("div", { className: q.editorHeaderActions }, w ? /* @__PURE__ */ r.createElement(
|
|
2782
2784
|
"span",
|
|
2783
2785
|
{
|
|
2784
|
-
className:
|
|
2786
|
+
className: q.dockDirtyIndicator,
|
|
2785
2787
|
"aria-hidden": "true"
|
|
2786
2788
|
}
|
|
2787
|
-
) : null, /* @__PURE__ */ r.createElement(
|
|
2789
|
+
) : null, /* @__PURE__ */ r.createElement(Ht, { text: fe, placement: "top" }, /* @__PURE__ */ r.createElement(
|
|
2788
2790
|
tt,
|
|
2789
2791
|
{
|
|
2790
2792
|
variant: "secondary",
|
|
2791
|
-
className:
|
|
2792
|
-
isDestructive:
|
|
2793
|
+
className: q.dockSaveButton,
|
|
2794
|
+
isDestructive: C === O.ERROR,
|
|
2793
2795
|
onClick: ke
|
|
2794
2796
|
},
|
|
2795
2797
|
H
|
|
@@ -2797,85 +2799,85 @@ function Ya({
|
|
|
2797
2799
|
"div",
|
|
2798
2800
|
{
|
|
2799
2801
|
className: De(
|
|
2800
|
-
|
|
2802
|
+
q.saveStatus,
|
|
2801
2803
|
Se
|
|
2802
2804
|
)
|
|
2803
2805
|
},
|
|
2804
2806
|
Fe
|
|
2805
2807
|
),
|
|
2806
|
-
d && !
|
|
2807
|
-
),
|
|
2808
|
+
d && !K && h ? /* @__PURE__ */ r.createElement(ir, { role: "status", "aria-live": "polite" }, fe) : null
|
|
2809
|
+
), y ? /* @__PURE__ */ r.createElement("div", { style: { padding: "8px 16px" } }, /* @__PURE__ */ r.createElement(lr, { status: "error", isDismissible: !1 }, y)) : null, h || F || g ? g ? /* @__PURE__ */ r.createElement("div", { className: q.messageArea }, g) : /* @__PURE__ */ r.createElement(
|
|
2808
2810
|
Gt,
|
|
2809
2811
|
{
|
|
2810
|
-
ref:
|
|
2811
|
-
code:
|
|
2812
|
-
onChange:
|
|
2812
|
+
ref: N,
|
|
2813
|
+
code: F,
|
|
2814
|
+
onChange: S,
|
|
2813
2815
|
currentPath: h,
|
|
2814
|
-
className:
|
|
2815
|
-
onSaveShortcut:
|
|
2816
|
-
readOnly:
|
|
2816
|
+
className: q.editor,
|
|
2817
|
+
onSaveShortcut: _e,
|
|
2818
|
+
readOnly: K
|
|
2817
2819
|
}
|
|
2818
|
-
) : /* @__PURE__ */ r.createElement("div", { className:
|
|
2820
|
+
) : /* @__PURE__ */ r.createElement("div", { className: q.placeholder }, T))
|
|
2819
2821
|
)
|
|
2820
2822
|
);
|
|
2821
2823
|
}
|
|
2822
|
-
function
|
|
2824
|
+
function Ea(n, c) {
|
|
2823
2825
|
switch (n) {
|
|
2824
|
-
case
|
|
2825
|
-
case
|
|
2826
|
+
case O.PENDING:
|
|
2827
|
+
case O.SAVING:
|
|
2826
2828
|
return "Saving…";
|
|
2827
|
-
case
|
|
2829
|
+
case O.SAVED:
|
|
2828
2830
|
return "Saved";
|
|
2829
|
-
case
|
|
2831
|
+
case O.ERROR:
|
|
2830
2832
|
return c ?? "Save failed";
|
|
2831
2833
|
default:
|
|
2832
2834
|
return "";
|
|
2833
2835
|
}
|
|
2834
2836
|
}
|
|
2835
|
-
function
|
|
2837
|
+
function ya(n, c) {
|
|
2836
2838
|
switch (n) {
|
|
2837
|
-
case
|
|
2839
|
+
case O.PENDING:
|
|
2838
2840
|
return c.saveStatusPending;
|
|
2839
|
-
case
|
|
2841
|
+
case O.SAVING:
|
|
2840
2842
|
return c.saveStatusSaving;
|
|
2841
|
-
case
|
|
2843
|
+
case O.ERROR:
|
|
2842
2844
|
return c.saveStatusError;
|
|
2843
2845
|
default:
|
|
2844
2846
|
return;
|
|
2845
2847
|
}
|
|
2846
2848
|
}
|
|
2847
|
-
function
|
|
2849
|
+
function _a(n) {
|
|
2848
2850
|
switch (n) {
|
|
2849
|
-
case
|
|
2851
|
+
case O.PENDING:
|
|
2850
2852
|
return "Unsaved changes. Click to save now.";
|
|
2851
|
-
case
|
|
2853
|
+
case O.SAVING:
|
|
2852
2854
|
return "Saving changes…";
|
|
2853
|
-
case
|
|
2855
|
+
case O.ERROR:
|
|
2854
2856
|
return "Saving failed. Click to retry.";
|
|
2855
2857
|
default:
|
|
2856
2858
|
return "All changes saved.";
|
|
2857
2859
|
}
|
|
2858
2860
|
}
|
|
2859
2861
|
export {
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
+
Ya as BinaryFilePreview,
|
|
2863
|
+
Wa as ClockIcon,
|
|
2862
2864
|
Gt as CodeEditor,
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
+
Wn as FileExplorerSidebar,
|
|
2866
|
+
Ga as FilePickerControl,
|
|
2865
2867
|
nn as FilePickerTree,
|
|
2866
2868
|
Yt as MAX_INLINE_FILE_BYTES,
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2869
|
+
Za as PlaygroundFileEditor,
|
|
2870
|
+
za as SiteManagerIcon,
|
|
2871
|
+
$a as WordPressIcon,
|
|
2870
2872
|
Vt as createDownloadUrl,
|
|
2871
2873
|
Vr as file,
|
|
2872
2874
|
jr as folder,
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2875
|
+
Ua as getLogoDataURL,
|
|
2876
|
+
Vn as getMimeType,
|
|
2877
|
+
$n as isPreviewableBinary,
|
|
2878
|
+
Ha as layout,
|
|
2879
|
+
ja as playgroundLogo,
|
|
2880
|
+
On as seemsLikeBinary,
|
|
2881
|
+
Va as temporaryStorage
|
|
2880
2882
|
};
|
|
2881
2883
|
//# sourceMappingURL=index.js.map
|