folder-pane 4.0.0 → 4.0.1-1
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/declarations.d.ts +4 -4
- package/dist/_virtual/~icons/lucide/chevron-down.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/chevron-down.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/chevron-down.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/chevron-down.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/chevron-right.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/chevron-right.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/chevron-right.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/chevron-right.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/circle-small.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/circle-small.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/circle-small.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/circle-small.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/file-box.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/file-box.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/file-box.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/file-box.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/file.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/file.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/file.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/file.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder-open.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/folder-open.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/folder.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/folder.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/globe.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/layout-grid.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/layout-grid.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/layout-grid.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/layout-grid.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/list.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/list.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/list.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/list.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/plus.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/plus.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/plus.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/plus.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/search.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/search.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/search.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/search.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/trash-2.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/upload.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/upload.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/upload.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/upload.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/x.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/x.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/x.esm.js +10 -0
- package/dist/_virtual/~icons/lucide/x.esm.js.map +1 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +93 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +52 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +627 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js +2 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js.map +1 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js +6 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js.map +1 -0
- package/dist/components/folder-pane-container/index.cjs.js +1 -0
- package/dist/components/folder-pane-container/index.d.ts +2 -0
- package/dist/components/folder-pane-container/index.d.ts.map +1 -0
- package/dist/components/folder-pane-container/index.esm.js +1 -0
- package/dist/components/folder-pane-content/FolderPaneContent.cjs.js +4 -0
- package/dist/components/folder-pane-content/FolderPaneContent.cjs.js.map +1 -0
- package/dist/components/folder-pane-content/FolderPaneContent.d.ts +6 -0
- package/dist/components/folder-pane-content/FolderPaneContent.d.ts.map +1 -0
- package/dist/components/folder-pane-content/FolderPaneContent.esm.js +176 -0
- package/dist/components/folder-pane-content/FolderPaneContent.esm.js.map +1 -0
- package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js +2 -0
- package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js.map +1 -0
- package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js +6 -0
- package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js.map +1 -0
- package/dist/components/folder-pane-content/index.cjs.js +1 -0
- package/dist/components/folder-pane-content/index.d.ts +2 -0
- package/dist/components/folder-pane-content/index.d.ts.map +1 -0
- package/dist/components/folder-pane-content/index.esm.js +1 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js +53 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js.map +1 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts +33 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts.map +1 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js +429 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js.map +1 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js +2 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js.map +1 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js +6 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js.map +1 -0
- package/dist/components/folder-pane-sidebar/index.cjs.js +1 -0
- package/dist/components/folder-pane-sidebar/index.d.ts +2 -0
- package/dist/components/folder-pane-sidebar/index.d.ts.map +1 -0
- package/dist/components/folder-pane-sidebar/index.esm.js +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.cjs.js +32 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.cjs.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.d.ts +15 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.d.ts.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.esm.js +290 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.esm.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.cjs.js +2 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.cjs.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.esm.js +6 -0
- package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.esm.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js +79 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts +27 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js +437 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js +2 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js.map +1 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js +6 -0
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js.map +1 -0
- package/dist/components/folder-pane-storage-header/index.cjs.js +1 -0
- package/dist/components/folder-pane-storage-header/index.d.ts +2 -0
- package/dist/components/folder-pane-storage-header/index.d.ts.map +1 -0
- package/dist/components/folder-pane-storage-header/index.esm.js +1 -0
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js +53 -0
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -0
- package/dist/components/folder-pane-view/FolderPaneView.d.ts +85 -0
- package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -0
- package/dist/components/folder-pane-view/FolderPaneView.esm.js +747 -0
- package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -0
- package/dist/components/folder-pane-view/index.cjs.js +1 -0
- package/dist/components/folder-pane-view/index.d.ts +2 -0
- package/dist/components/folder-pane-view/index.d.ts.map +1 -0
- package/dist/components/folder-pane-view/index.esm.js +1 -0
- package/dist/components/folder-pane-view/renderRequest.cjs.js +2 -0
- package/dist/components/folder-pane-view/renderRequest.cjs.js.map +1 -0
- package/dist/components/folder-pane-view/renderRequest.d.ts +8 -0
- package/dist/components/folder-pane-view/renderRequest.d.ts.map +1 -0
- package/dist/components/folder-pane-view/renderRequest.esm.js +10 -0
- package/dist/components/folder-pane-view/renderRequest.esm.js.map +1 -0
- package/dist/creationSafety.cjs.js +2 -0
- package/dist/creationSafety.cjs.js.map +1 -0
- package/dist/creationSafety.d.ts +9 -0
- package/dist/creationSafety.d.ts.map +1 -0
- package/dist/creationSafety.esm.js +17 -0
- package/dist/creationSafety.esm.js.map +1 -0
- package/dist/folderPane.cjs.js +2 -2
- package/dist/folderPane.cjs.js.map +1 -1
- package/dist/folderPane.d.ts +15 -1
- package/dist/folderPane.d.ts.map +1 -1
- package/dist/folderPane.esm.js +33 -60
- package/dist/folderPane.esm.js.map +1 -1
- package/dist/helpers.cjs.js +2 -0
- package/dist/helpers.cjs.js.map +1 -0
- package/dist/helpers.d.ts +30 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.esm.js +59 -0
- package/dist/helpers.esm.js.map +1 -0
- package/dist/index.esm.js +1 -2
- package/dist/mintPaneInstance.cjs.js +2 -0
- package/dist/mintPaneInstance.cjs.js.map +1 -0
- package/dist/mintPaneInstance.d.ts +43 -0
- package/dist/mintPaneInstance.d.ts.map +1 -0
- package/dist/mintPaneInstance.esm.js +104 -0
- package/dist/mintPaneInstance.esm.js.map +1 -0
- package/dist/requestQueue.cjs.js +2 -0
- package/dist/requestQueue.cjs.js.map +1 -0
- package/dist/requestQueue.d.ts +30 -0
- package/dist/requestQueue.d.ts.map +1 -0
- package/dist/requestQueue.esm.js +67 -0
- package/dist/requestQueue.esm.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +8 -5
- package/dist/_virtual/_rolldown/runtime.cjs.js +0 -1
|
@@ -0,0 +1,747 @@
|
|
|
1
|
+
import { getIndexedApplicationSubject as e, getIndexedContainer as t, getPaneLabel as n, isAccessDeniedError as r, isContainerResource as i, isJavaScriptFile as a } from "../../helpers.esm.js";
|
|
2
|
+
import "../folder-pane-container/index.esm.js";
|
|
3
|
+
import "../folder-pane-sidebar/index.esm.js";
|
|
4
|
+
import "../folder-pane-content/index.esm.js";
|
|
5
|
+
import "../folder-pane-storage-header/index.esm.js";
|
|
6
|
+
import { invalidateRenderRequest as o, isCurrentRenderRequest as s } from "./renderRequest.esm.js";
|
|
7
|
+
import { invalidCreationNameMessage as c, isSafeCreationName as l } from "../../creationSafety.esm.js";
|
|
8
|
+
import u from "../folder-pane-storage-header/FolderPaneCreateDialog.esm.js";
|
|
9
|
+
import { PaneMintError as d, mintPaneInstance as f, setMintStatus as p } from "../../mintPaneInstance.esm.js";
|
|
10
|
+
import { FILE_EXPLORER_BACK_EVENT as m, FILE_EXPLORER_OPEN_PANE_EVENT as h, WebComponent as g, aclControl as _, composeExplorer as v, customElement as y, getRelevantPanes as b, isExplorerEvent as x, log as S, ns as C, showDialog as w, widgets as T } from "solid-ui";
|
|
11
|
+
import { authSession as E, authn as D } from "solid-logic";
|
|
12
|
+
import { html as O, nothing as k } from "lit";
|
|
13
|
+
import { property as A, query as j, state as M } from "lit/decorators.js";
|
|
14
|
+
import "solid-ui/components/file-explorer-provider";
|
|
15
|
+
import "solid-ui/components/error-state";
|
|
16
|
+
import "solid-ui/components/file-explorer-header";
|
|
17
|
+
// src/components/folder-pane-view/FolderPaneView.ts
|
|
18
|
+
var ee, te, ne, re, ie, ae, oe, se, ce, le, ue, de, fe, pe, me, he, ge, _e, N, P, F, I, ve, ye, be, xe, Se, Ce, L;
|
|
19
|
+
function R(e, t, n) {
|
|
20
|
+
return (t = De(t)) in e ? Object.defineProperty(e, t, {
|
|
21
|
+
value: n,
|
|
22
|
+
enumerable: !0,
|
|
23
|
+
configurable: !0,
|
|
24
|
+
writable: !0
|
|
25
|
+
}) : e[t] = n, e;
|
|
26
|
+
}
|
|
27
|
+
function z(e, t, n) {
|
|
28
|
+
we(e, t), t.set(e, n);
|
|
29
|
+
}
|
|
30
|
+
function we(e, t) {
|
|
31
|
+
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
32
|
+
}
|
|
33
|
+
function B(e, t, n) {
|
|
34
|
+
return e.set(Te(e, t), n), n;
|
|
35
|
+
}
|
|
36
|
+
function V(e, t) {
|
|
37
|
+
return e.get(Te(e, t));
|
|
38
|
+
}
|
|
39
|
+
function Te(e, t, n) {
|
|
40
|
+
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
41
|
+
throw TypeError("Private element is not present on this object");
|
|
42
|
+
}
|
|
43
|
+
function Ee(e, t, n, r, i, a) {
|
|
44
|
+
function o(e, t, n) {
|
|
45
|
+
return function(r, i) {
|
|
46
|
+
return n && n(r), e[t].call(r, i);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function s(e, t) {
|
|
50
|
+
for (var n = 0; n < e.length; n++) e[n].call(t);
|
|
51
|
+
return t;
|
|
52
|
+
}
|
|
53
|
+
function c(e, t, n, r) {
|
|
54
|
+
if (typeof e != "function" && (r || e !== void 0)) throw TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined"));
|
|
55
|
+
return e;
|
|
56
|
+
}
|
|
57
|
+
function l(e, t, n, r, i, a, s, l, u, d, f, p, m) {
|
|
58
|
+
function h(e) {
|
|
59
|
+
if (!m(e)) throw TypeError("Attempted to access private element on non-instance");
|
|
60
|
+
}
|
|
61
|
+
var g, _ = t[0], v = t[3], y = !l;
|
|
62
|
+
if (!y) {
|
|
63
|
+
n || Array.isArray(_) || (_ = [_]);
|
|
64
|
+
var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
65
|
+
d ? (f || p ? b = {
|
|
66
|
+
get: ke(function() {
|
|
67
|
+
return v(this);
|
|
68
|
+
}, r, "get"),
|
|
69
|
+
set: function(e) {
|
|
70
|
+
t[4](this, e);
|
|
71
|
+
}
|
|
72
|
+
} : b[S] = v, f || ke(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
|
|
73
|
+
}
|
|
74
|
+
for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
|
|
75
|
+
var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
|
|
76
|
+
kind: [
|
|
77
|
+
"field",
|
|
78
|
+
"accessor",
|
|
79
|
+
"method",
|
|
80
|
+
"getter",
|
|
81
|
+
"setter",
|
|
82
|
+
"class"
|
|
83
|
+
][i],
|
|
84
|
+
name: r,
|
|
85
|
+
metadata: a,
|
|
86
|
+
addInitializer: function(e, t) {
|
|
87
|
+
if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
88
|
+
c(t, "An initializer", "be", !0), s.push(t);
|
|
89
|
+
}.bind(null, D)
|
|
90
|
+
};
|
|
91
|
+
try {
|
|
92
|
+
if (y) (g = c(T.call(E, C, O), "class decorators", "return")) && (C = g);
|
|
93
|
+
else {
|
|
94
|
+
var k, A;
|
|
95
|
+
O.static = u, O.private = d, d ? i === 2 ? k = function(e) {
|
|
96
|
+
return h(e), b.value;
|
|
97
|
+
} : (i < 4 && (k = o(b, "get", h)), i !== 3 && (A = o(b, "set", h))) : (k = function(e) {
|
|
98
|
+
return e[r];
|
|
99
|
+
}, (i < 2 || i === 4) && (A = function(e, t) {
|
|
100
|
+
e[r] = t;
|
|
101
|
+
}));
|
|
102
|
+
var j = O.access = { has: d ? m.bind() : function(e) {
|
|
103
|
+
return r in e;
|
|
104
|
+
} };
|
|
105
|
+
if (k && (j.get = k), A && (j.set = A), C = T.call(E, p ? {
|
|
106
|
+
get: b.get,
|
|
107
|
+
set: b.set
|
|
108
|
+
} : b[S], O), p) {
|
|
109
|
+
if (typeof C == "object" && C) (g = c(C.get, "accessor.get")) && (b.get = g), (g = c(C.set, "accessor.set")) && (b.set = g), (g = c(C.init, "accessor.init")) && x.push(g);
|
|
110
|
+
else if (C !== void 0) throw TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
111
|
+
} else c(C, (f ? "field" : "method") + " decorators", "return") && (f ? x.push(C) : b[S] = C);
|
|
112
|
+
}
|
|
113
|
+
} finally {
|
|
114
|
+
D.v = !0;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return (f || p) && l.push(function(e, t) {
|
|
118
|
+
for (var n = x.length - 1; n >= 0; n--) t = x[n].call(e, t);
|
|
119
|
+
return t;
|
|
120
|
+
}), f || y || (d ? p ? l.push(o(b, "get"), o(b, "set")) : l.push(i === 2 ? b[S] : o.call.bind(b[S])) : Object.defineProperty(e, r, b)), C;
|
|
121
|
+
}
|
|
122
|
+
function u(e, t) {
|
|
123
|
+
return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
124
|
+
configurable: !0,
|
|
125
|
+
enumerable: !0,
|
|
126
|
+
value: t
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
130
|
+
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
131
|
+
var i, a, o = [], c = function(t) {
|
|
132
|
+
return Ae(t) === e;
|
|
133
|
+
}, u = /* @__PURE__ */ new Map();
|
|
134
|
+
function d(e) {
|
|
135
|
+
e && o.push(s.bind(null, e));
|
|
136
|
+
}
|
|
137
|
+
for (var f = 0; f < t.length; f++) {
|
|
138
|
+
var p = t[f];
|
|
139
|
+
if (Array.isArray(p)) {
|
|
140
|
+
var m = p[1], h = p[2], g = p.length > 3, _ = 16 & m, v = !!(8 & m), y = (m &= 7) == 0, b = h + "/" + v;
|
|
141
|
+
if (!y && !g) {
|
|
142
|
+
var x = u.get(b);
|
|
143
|
+
if (!0 === x || x === 3 && m !== 4 || x === 4 && m !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
|
|
144
|
+
u.set(b, !(m > 2) || m);
|
|
145
|
+
}
|
|
146
|
+
l(v ? e : e.prototype, p, _, g ? "#" + h : De(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return d(i), d(a), o;
|
|
150
|
+
}(e, t, i, f);
|
|
151
|
+
return n.length || u(e, f), {
|
|
152
|
+
e: p,
|
|
153
|
+
get c() {
|
|
154
|
+
var t = [];
|
|
155
|
+
return n.length && [u(l(e, [n], r, e.name, 5, f, t), f), s.bind(null, t, e)];
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function De(e) {
|
|
160
|
+
var t = Oe(e, "string");
|
|
161
|
+
return typeof t == "symbol" ? t : t + "";
|
|
162
|
+
}
|
|
163
|
+
function Oe(e, t) {
|
|
164
|
+
if (typeof e != "object" || !e) return e;
|
|
165
|
+
var n;
|
|
166
|
+
if (typeof Symbol < "u" && (n = e[Symbol.toPrimitive]) !== void 0) {
|
|
167
|
+
var r = n.call(e, t || "default");
|
|
168
|
+
if (typeof r != "object") return r;
|
|
169
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
170
|
+
}
|
|
171
|
+
return (t === "string" ? String : Number)(e);
|
|
172
|
+
}
|
|
173
|
+
function ke(e, t, n) {
|
|
174
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
175
|
+
try {
|
|
176
|
+
Object.defineProperty(e, "name", {
|
|
177
|
+
configurable: !0,
|
|
178
|
+
value: n ? n + " " + t : t
|
|
179
|
+
});
|
|
180
|
+
} catch {}
|
|
181
|
+
return e;
|
|
182
|
+
}
|
|
183
|
+
function Ae(e) {
|
|
184
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
185
|
+
return e;
|
|
186
|
+
}
|
|
187
|
+
re = [y("folder-pane-view")];
|
|
188
|
+
var je, H = /*#__PURE__*/ new WeakMap(), U = /*#__PURE__*/ new WeakMap(), W = /*#__PURE__*/ new WeakMap(), G = /*#__PURE__*/ new WeakMap(), K = /*#__PURE__*/ new WeakMap(), q = /*#__PURE__*/ new WeakMap(), J = /*#__PURE__*/ new WeakMap(), Y = /*#__PURE__*/ new WeakMap(), X = /*#__PURE__*/ new WeakMap(), Z = /*#__PURE__*/ new WeakMap(), Q = /*#__PURE__*/ new WeakMap(), $ = /*#__PURE__*/ new WeakMap();
|
|
189
|
+
L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
|
|
190
|
+
type: Boolean,
|
|
191
|
+
attribute: "full-view"
|
|
192
|
+
}), ue = A({
|
|
193
|
+
type: Boolean,
|
|
194
|
+
attribute: "hide-storage-header"
|
|
195
|
+
}), fe = M(), me = M(), ge = M(), N = M(), F = j("folder-pane-content"), ve = j(".folder-pane-full-view"), be = j("folder-pane-sidebar"), Se = j(".folder-pane-status"), "browserContext"), ee = class extends g {
|
|
196
|
+
constructor(...e) {
|
|
197
|
+
super(...e), z(this, H, (te(this), ae(this, void 0))), z(this, U, se(this, void 0)), z(this, W, le(this, !1)), z(this, G, de(this, !1)), z(this, K, pe(this, void 0)), z(this, q, he(this, "grid")), z(this, J, _e(this, "")), z(this, Y, P(this, void 0)), R(this, "initialLoadGeneration", 0), R(this, "renderGeneration", 0), R(this, "creationInFlight", !1), R(this, "authListenersAttached", !1), R(this, "dropProtectionAttached", !1), z(this, X, I(this, null)), z(this, Z, ye(this, null)), z(this, Q, xe(this, null)), z(this, $, Ce(this, null)), R(this, "handleAuthChange", () => {
|
|
198
|
+
this.requestUpdate();
|
|
199
|
+
}), R(this, "handleCreatePane", async (e) => {
|
|
200
|
+
if (e.stopPropagation(), this.creationInFlight || !D.currentUser()) return;
|
|
201
|
+
let t = e.detail?.pane;
|
|
202
|
+
if (!t?.mintNew) return;
|
|
203
|
+
let r = this.getActiveContainer(), i = this.ownerDocument, a = this.statusArea;
|
|
204
|
+
if (!r || !a) return;
|
|
205
|
+
this.creationInFlight = !0;
|
|
206
|
+
let o = ++this.renderGeneration, s = n(t);
|
|
207
|
+
try {
|
|
208
|
+
let e = await new Promise((e) => {
|
|
209
|
+
w(u, {
|
|
210
|
+
props: { label: s },
|
|
211
|
+
onClose: e
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
if (!e || !D.currentUser() || o !== this.renderGeneration || this.getActiveContainer()?.sameTerm(r) !== !0) return;
|
|
215
|
+
if (!l(e)) {
|
|
216
|
+
p(a, "error", c);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.clearContentForCreation();
|
|
220
|
+
let n = await f({
|
|
221
|
+
context: this.browserContext,
|
|
222
|
+
container: r,
|
|
223
|
+
pane: t,
|
|
224
|
+
name: e,
|
|
225
|
+
noun: s,
|
|
226
|
+
statusArea: a,
|
|
227
|
+
me: D.currentUser() ?? void 0,
|
|
228
|
+
dom: i
|
|
229
|
+
}), d = o === this.renderGeneration && this.getActiveContainer()?.sameTerm(r) === !0;
|
|
230
|
+
await this.showCreatedResource({
|
|
231
|
+
container: r,
|
|
232
|
+
...n,
|
|
233
|
+
pane: t,
|
|
234
|
+
newInstance: d ? n.newInstance : void 0
|
|
235
|
+
});
|
|
236
|
+
} catch (e) {
|
|
237
|
+
console.error("Unable to create folder-pane resource", e), !(e instanceof d) && this.statusArea && p(this.statusArea, "error", `Unable to create ${s}: ${e instanceof Error ? e.message : String(e)}`);
|
|
238
|
+
} finally {
|
|
239
|
+
this.creationInFlight = !1;
|
|
240
|
+
}
|
|
241
|
+
}), R(this, "handleUpload", (e) => {
|
|
242
|
+
if (e.stopPropagation(), this.creationInFlight || !D.currentUser()) return;
|
|
243
|
+
let t = this.getActiveContainer(), n = this.statusArea;
|
|
244
|
+
if (!t || !n || !this.store) return;
|
|
245
|
+
let r = this.ownerDocument.createElement("input");
|
|
246
|
+
r.type = "file", r.multiple = !0, r.addEventListener("change", () => {
|
|
247
|
+
let e = Array.from(r.files ?? []), i = e.filter((e) => l(e.name));
|
|
248
|
+
if (e.filter((e) => !l(e.name)).forEach((e) => p(n, "error", `${e.name}: ${c}`)), !i.length) return;
|
|
249
|
+
this.creationInFlight = !0;
|
|
250
|
+
let a = i.length, o = Promise.resolve();
|
|
251
|
+
p(n, "progress", `Uploading ${i.length} file${i.length === 1 ? "" : "s"}`);
|
|
252
|
+
let s = () => {
|
|
253
|
+
a--, a === 0 && (this.creationInFlight = !1, n.dataset.status === "progress" && n.replaceChildren());
|
|
254
|
+
};
|
|
255
|
+
T.uploadFiles(this.store.fetcher, i, t.uri, t.uri, (e, n) => {
|
|
256
|
+
o = o.then(() => this.showCreatedResource({
|
|
257
|
+
container: t,
|
|
258
|
+
containedResource: this.store.sym(n)
|
|
259
|
+
})).finally(s);
|
|
260
|
+
}, (e, t) => {
|
|
261
|
+
p(n, "error", t), s();
|
|
262
|
+
});
|
|
263
|
+
}), r.click();
|
|
264
|
+
}), R(this, "clearContentError", () => {
|
|
265
|
+
this.contentError = void 0;
|
|
266
|
+
}), R(this, "retryContent", () => {
|
|
267
|
+
let e = this.selectedResource, t = this.subject;
|
|
268
|
+
(e || t) && (this.clearContentError(), e ? this.showResourceInContentView(e) : t && this.showInitialContainer(t));
|
|
269
|
+
}), R(this, "handleResourceSelected", (e) => {
|
|
270
|
+
let t = e.detail?.resource;
|
|
271
|
+
t && (e.stopPropagation(), this.searchQuery = "", this.showSubject(t));
|
|
272
|
+
}), R(this, "handleResourceOpenPane", (e) => {
|
|
273
|
+
let t = e.detail?.resource, n = e.detail?.paneName, r = n ? this.browserContext?.session.paneRegistry.byName(n) : void 0;
|
|
274
|
+
t && r && (e.stopPropagation(), this.searchQuery = "", this.showSubject(t, typeof r?.render == "function" ? r : void 0));
|
|
275
|
+
}), R(this, "handleSelectHome", () => {
|
|
276
|
+
this.searchQuery = "", this.subject && this.showSubject(this.subject);
|
|
277
|
+
}), R(this, "handleSearch", (e) => {
|
|
278
|
+
e.stopPropagation(), this.searchQuery = e.detail?.query || "";
|
|
279
|
+
let t = this.resourceTarget?.querySelector("folder-pane-container");
|
|
280
|
+
t && (t.searchQuery = this.searchQuery);
|
|
281
|
+
}), R(this, "handleSelectBreadcrumbResource", (e) => {
|
|
282
|
+
let t = e.detail?.resource;
|
|
283
|
+
t && (e.stopPropagation(), this.showSubject(t));
|
|
284
|
+
}), R(this, "handleContainerViewChange", (e) => {
|
|
285
|
+
let t = e.detail?.view;
|
|
286
|
+
t && (e.stopPropagation(), this.setContainerView(t));
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
get [L]() {
|
|
290
|
+
return V(H, this);
|
|
291
|
+
}
|
|
292
|
+
set browserContext(e) {
|
|
293
|
+
B(H, this, e);
|
|
294
|
+
}
|
|
295
|
+
get store() {
|
|
296
|
+
return this.browserContext?.session.store;
|
|
297
|
+
}
|
|
298
|
+
get subject() {
|
|
299
|
+
return V(U, this);
|
|
300
|
+
}
|
|
301
|
+
set subject(e) {
|
|
302
|
+
B(U, this, e);
|
|
303
|
+
}
|
|
304
|
+
get resourceLogic() {
|
|
305
|
+
return this.browserContext?.session.logic.resource;
|
|
306
|
+
}
|
|
307
|
+
get fullView() {
|
|
308
|
+
return V(W, this);
|
|
309
|
+
}
|
|
310
|
+
set fullView(e) {
|
|
311
|
+
B(W, this, e);
|
|
312
|
+
}
|
|
313
|
+
get hideStorageHeader() {
|
|
314
|
+
return V(G, this);
|
|
315
|
+
}
|
|
316
|
+
set hideStorageHeader(e) {
|
|
317
|
+
B(G, this, e);
|
|
318
|
+
}
|
|
319
|
+
get selectedResource() {
|
|
320
|
+
return V(K, this);
|
|
321
|
+
}
|
|
322
|
+
set selectedResource(e) {
|
|
323
|
+
B(K, this, e);
|
|
324
|
+
}
|
|
325
|
+
get containerView() {
|
|
326
|
+
return V(q, this);
|
|
327
|
+
}
|
|
328
|
+
set containerView(e) {
|
|
329
|
+
B(q, this, e);
|
|
330
|
+
}
|
|
331
|
+
get searchQuery() {
|
|
332
|
+
return V(J, this);
|
|
333
|
+
}
|
|
334
|
+
set searchQuery(e) {
|
|
335
|
+
B(J, this, e);
|
|
336
|
+
}
|
|
337
|
+
get contentError() {
|
|
338
|
+
return V(Y, this);
|
|
339
|
+
}
|
|
340
|
+
set contentError(e) {
|
|
341
|
+
B(Y, this, e);
|
|
342
|
+
}
|
|
343
|
+
get contentView() {
|
|
344
|
+
return V(X, this);
|
|
345
|
+
}
|
|
346
|
+
set contentView(e) {
|
|
347
|
+
B(X, this, e);
|
|
348
|
+
}
|
|
349
|
+
get fullViewTarget() {
|
|
350
|
+
return V(Z, this);
|
|
351
|
+
}
|
|
352
|
+
set fullViewTarget(e) {
|
|
353
|
+
B(Z, this, e);
|
|
354
|
+
}
|
|
355
|
+
get sidebar() {
|
|
356
|
+
return V(Q, this);
|
|
357
|
+
}
|
|
358
|
+
set sidebar(e) {
|
|
359
|
+
B(Q, this, e);
|
|
360
|
+
}
|
|
361
|
+
get statusArea() {
|
|
362
|
+
return V($, this);
|
|
363
|
+
}
|
|
364
|
+
set statusArea(e) {
|
|
365
|
+
B($, this, e);
|
|
366
|
+
}
|
|
367
|
+
createRenderRoot() {
|
|
368
|
+
return this;
|
|
369
|
+
}
|
|
370
|
+
connectedCallback() {
|
|
371
|
+
super.connectedCallback(), this.dropProtectionAttached ||= (_.preventBrowserDropEvents(this.ownerDocument), !0), this.addEventListener("folder-pane-create-pane", this.handleCreatePane), this.addEventListener("folder-pane-upload", this.handleUpload), this.authListenersAttached ||= (E.events.on("login", this.handleAuthChange), E.events.on("logout", this.handleAuthChange), !0);
|
|
372
|
+
}
|
|
373
|
+
disconnectedCallback() {
|
|
374
|
+
this.renderGeneration = o(this.renderGeneration), this.initialLoadGeneration++, this.removeEventListener("folder-pane-create-pane", this.handleCreatePane), this.removeEventListener("folder-pane-upload", this.handleUpload), this.authListenersAttached &&= (E.events.off("login", this.handleAuthChange), E.events.off("logout", this.handleAuthChange), !1), super.disconnectedCallback();
|
|
375
|
+
}
|
|
376
|
+
updated(e) {
|
|
377
|
+
(e.has("subject") || e.has("browserContext")) && this.subject ? ((e.has("subject") || e.has("browserContext")) && (this.selectedResource = void 0, this.renderGeneration++, this.initialLoadGeneration++), this.showInitialContainer(this.subject)) : e.has("fullView") && e.get("fullView") !== void 0 && (this.selectedResource ? this.showResourceInContentView(this.selectedResource) : this.subject && this.renderContainerView(this.subject));
|
|
378
|
+
}
|
|
379
|
+
get resourceTarget() {
|
|
380
|
+
return this.fullView ? this.fullViewTarget : this.contentView;
|
|
381
|
+
}
|
|
382
|
+
showContentError(e) {
|
|
383
|
+
this.resourceTarget?.replaceChildren(), this.contentError = e;
|
|
384
|
+
}
|
|
385
|
+
renderAccessDeniedScreen() {
|
|
386
|
+
this.showContentError({
|
|
387
|
+
title: "Access denied",
|
|
388
|
+
message: "You do not have access to the contents of this container."
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
openCreatedResource(e, t) {
|
|
392
|
+
this.searchQuery = "";
|
|
393
|
+
let n = t?.name ? this.browserContext?.session.paneRegistry.byName(t.name) ?? t : t;
|
|
394
|
+
this.showSubject(e, typeof n?.render == "function" ? n : void 0);
|
|
395
|
+
}
|
|
396
|
+
getActiveContainer() {
|
|
397
|
+
let e = this.selectedResource;
|
|
398
|
+
if (e && this.resourceLogic && i(e, this.resourceLogic)) return e;
|
|
399
|
+
let t = this.subject, n = e?.dir(), r = t?.uri.endsWith("/") ? t.uri : `${t?.uri}/`;
|
|
400
|
+
return t && n && r && n.uri.startsWith(r) ? n : this.subject;
|
|
401
|
+
}
|
|
402
|
+
clearContentForCreation() {
|
|
403
|
+
this.resourceTarget?.replaceChildren();
|
|
404
|
+
}
|
|
405
|
+
async showCreatedResource({ container: e, containedResource: t, newInstance: n, pane: r }) {
|
|
406
|
+
let i = this.store;
|
|
407
|
+
if (!i) return;
|
|
408
|
+
let a = this.renderGeneration, o = this.browserContext, s = async (e) => {
|
|
409
|
+
try {
|
|
410
|
+
return await i.fetcher.load(e, {
|
|
411
|
+
force: !0,
|
|
412
|
+
clearPreviousData: !0
|
|
413
|
+
}), !0;
|
|
414
|
+
} catch (t) {
|
|
415
|
+
return S.warn("Unable to reload " + e.uri + ": " + t), !1;
|
|
416
|
+
}
|
|
417
|
+
}, c = await s(e);
|
|
418
|
+
if (t.uri.endsWith("/")) {
|
|
419
|
+
await s(t);
|
|
420
|
+
let e = i.each(t, C.ldp("contains"), void 0, t.doc());
|
|
421
|
+
for (let t of e) t.termType === "NamedNode" && i.fetcher.getState(t.value) === "failed" && i.fetcher.unload(t);
|
|
422
|
+
}
|
|
423
|
+
this.sidebar?.refreshResources?.(e);
|
|
424
|
+
let l = this.resourceTarget?.querySelector("folder-pane-container");
|
|
425
|
+
!c && l?.addOptimisticResource && l.addOptimisticResource(t), c && l?.refresh?.(), n && this.isConnected && this.renderGeneration === a && this.browserContext === o && this.openCreatedResource(n, r);
|
|
426
|
+
}
|
|
427
|
+
renderContainerView(e) {
|
|
428
|
+
let t = this.resourceTarget;
|
|
429
|
+
if (!t) return;
|
|
430
|
+
this.contentError = void 0;
|
|
431
|
+
let n = document.createElement("folder-pane-container");
|
|
432
|
+
n.subject = e, n.resourceLogic = this.resourceLogic ?? null, n.browserContext = this.browserContext, n.view = this.containerView, n.searchQuery = this.searchQuery, n.hideRootSpecialFolders = this.subject ? e.sameTerm(this.subject) : !1, t.replaceChildren(n);
|
|
433
|
+
}
|
|
434
|
+
async showInitialContainer(e) {
|
|
435
|
+
let t = ++this.initialLoadGeneration;
|
|
436
|
+
if (a(e)) this.showSubject(e);
|
|
437
|
+
else if (this.store && this.resourceLogic) {
|
|
438
|
+
try {
|
|
439
|
+
await this.store.fetcher.load(e);
|
|
440
|
+
} catch (n) {
|
|
441
|
+
if (t !== this.initialLoadGeneration || !this.subject?.sameTerm(e)) return;
|
|
442
|
+
if (r(n)) {
|
|
443
|
+
this.resourceTarget && this.renderAccessDeniedScreen();
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
S.error("Unable to load storage container: " + n), this.showContentError({
|
|
447
|
+
title: "Unable to load this folder",
|
|
448
|
+
message: "The folder could not be loaded. Try again."
|
|
449
|
+
});
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
t === this.initialLoadGeneration && this.subject?.sameTerm(e) && (this.sidebar?.refreshResources?.(), this.selectedResource || this.showSubject(e));
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
getPaneForSubject(e, t) {
|
|
456
|
+
let n = this.store && (this.store.any(e, C.ui("mintClass"), void 0, e.doc()) || this.store.any(e.doc(), C.ui("mintClass"), void 0, e.doc()));
|
|
457
|
+
if (n) {
|
|
458
|
+
let e = t.find((e) => e.mintClass?.sameTerm(n));
|
|
459
|
+
if (e) return e;
|
|
460
|
+
}
|
|
461
|
+
return t.find((t) => t.shouldGetFocus?.(e)) || t[0];
|
|
462
|
+
}
|
|
463
|
+
async renderExplorerInto(e, t, n, r = {}) {
|
|
464
|
+
if (!this.browserContext) return;
|
|
465
|
+
let i = await b(t, this.browserContext, {
|
|
466
|
+
excludedPaneNames: ["sharing"],
|
|
467
|
+
fallbackPaneName: "internal"
|
|
468
|
+
});
|
|
469
|
+
if (r.isCurrent && !r.isCurrent()) return;
|
|
470
|
+
let a = n || this.getPaneForSubject(t, i);
|
|
471
|
+
if (!a) {
|
|
472
|
+
this.renderExplorerError(t, "No pane is available to display this resource.");
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
let o;
|
|
476
|
+
try {
|
|
477
|
+
o = a.render(t, this.browserContext, r.paneOptions || {});
|
|
478
|
+
} catch (e) {
|
|
479
|
+
S.error("Unable to render selected pane: " + e), this.renderExplorerError(t, "The selected pane could not render this resource.");
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
let c = e.ownerDocument.createElement("solid-ui-file-explorer-provider"), l = i.map((e) => {
|
|
483
|
+
let n = e.label(t, this.browserContext);
|
|
484
|
+
if (n) return {
|
|
485
|
+
label: n,
|
|
486
|
+
action: (n) => {
|
|
487
|
+
c.dispatchEvent(new CustomEvent(h, {
|
|
488
|
+
bubbles: !0,
|
|
489
|
+
composed: !0,
|
|
490
|
+
detail: {
|
|
491
|
+
subjectUri: t.uri,
|
|
492
|
+
paneName: e.name
|
|
493
|
+
}
|
|
494
|
+
}));
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
}).filter((e) => e !== void 0);
|
|
498
|
+
c.addEventListener(m, (e) => {
|
|
499
|
+
x(e, c) && (e.stopPropagation(), this.renderGeneration++, this.selectedResource = void 0, this.renderContainerView(this.subject || t));
|
|
500
|
+
}), c.addEventListener(h, (n) => {
|
|
501
|
+
if (!x(n, c)) return;
|
|
502
|
+
n.stopPropagation();
|
|
503
|
+
let i = n.detail?.paneName, a = i ? this.browserContext?.session.paneRegistry.byName(i) : void 0;
|
|
504
|
+
if (a) {
|
|
505
|
+
let n = {
|
|
506
|
+
generation: ++this.renderGeneration,
|
|
507
|
+
subjectUri: t.uri,
|
|
508
|
+
context: this.browserContext
|
|
509
|
+
};
|
|
510
|
+
this.renderExplorerInto(e, t, a, {
|
|
511
|
+
...r,
|
|
512
|
+
isCurrent: () => s(n, this.renderGeneration, this.selectedResource?.uri, this.browserContext)
|
|
513
|
+
}).catch((e) => {
|
|
514
|
+
S.error("Unable to switch selected pane: " + e);
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}), v(c, {
|
|
518
|
+
context: this.browserContext,
|
|
519
|
+
subjectUri: t.uri,
|
|
520
|
+
pane: a,
|
|
521
|
+
relevantPanes: i,
|
|
522
|
+
header: r.showHeader === !1 ? void 0 : {
|
|
523
|
+
paneIcon: a.icon,
|
|
524
|
+
menuItems: l
|
|
525
|
+
},
|
|
526
|
+
paneElement: o
|
|
527
|
+
}), (!r.isCurrent || r.isCurrent()) && (this.contentError = void 0, e.replaceChildren(c));
|
|
528
|
+
}
|
|
529
|
+
renderExplorerError(e, t) {
|
|
530
|
+
this.showContentError({
|
|
531
|
+
title: t,
|
|
532
|
+
message: e.uri
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
async showResourceInContentView(t, n, o = !1) {
|
|
536
|
+
let c = ++this.renderGeneration;
|
|
537
|
+
try {
|
|
538
|
+
let l = this.resourceTarget;
|
|
539
|
+
if (!l || !this.store || !this.resourceLogic) return;
|
|
540
|
+
let u = {
|
|
541
|
+
generation: c,
|
|
542
|
+
subjectUri: t.uri,
|
|
543
|
+
context: this.browserContext
|
|
544
|
+
}, d = (e) => s(u, this.renderGeneration, this.selectedResource?.uri, this.browserContext) && e.uri === u.subjectUri;
|
|
545
|
+
if (!d(t)) return;
|
|
546
|
+
if (this.subject?.sameTerm(t) && !o && !a(t)) {
|
|
547
|
+
this.renderContainerView(t);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
if (i(t, this.resourceLogic)) {
|
|
551
|
+
try {
|
|
552
|
+
await this.store.fetcher.load(t);
|
|
553
|
+
} catch (e) {
|
|
554
|
+
if (!d(t)) return;
|
|
555
|
+
if (r(e)) {
|
|
556
|
+
this.renderAccessDeniedScreen();
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
S.error("Unable to load selected container: " + e), this.showContentError({
|
|
560
|
+
title: "Unable to load this folder",
|
|
561
|
+
message: "The folder could not be loaded. Try again."
|
|
562
|
+
});
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (!d(t)) return;
|
|
566
|
+
if (this.sidebar?.refreshResources?.(), o || this.resourceLogic.containerHasIndexDocument(t)) {
|
|
567
|
+
let i = this.store.sym(e(t, n?.name));
|
|
568
|
+
try {
|
|
569
|
+
await this.store.fetcher.load(i.doc());
|
|
570
|
+
} catch (e) {
|
|
571
|
+
if (!d(t)) return;
|
|
572
|
+
if (r(e)) {
|
|
573
|
+
this.renderAccessDeniedScreen();
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
S.error("Unable to load container index document: " + e);
|
|
577
|
+
}
|
|
578
|
+
await this.renderExplorerInto(l, i, n, {
|
|
579
|
+
isCurrent: () => d(t),
|
|
580
|
+
showHeader: !1
|
|
581
|
+
});
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
this.renderContainerView(t);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
try {
|
|
588
|
+
await this.store.fetcher.load(t);
|
|
589
|
+
} catch (e) {
|
|
590
|
+
if (!d(t)) return;
|
|
591
|
+
if (r(e)) {
|
|
592
|
+
this.renderAccessDeniedScreen();
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
S.warn("Unable to load selected resource metadata: " + e);
|
|
596
|
+
}
|
|
597
|
+
if (!d(t)) return;
|
|
598
|
+
let f = a(t) ? this.browserContext?.session.paneRegistry.byName("source") : void 0;
|
|
599
|
+
if (!n && a(t) && !f) {
|
|
600
|
+
this.renderExplorerError(t, "The Source pane is unavailable to display this JavaScript file.");
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
await this.renderExplorerInto(l, t, n || f, { isCurrent: () => d(t) });
|
|
604
|
+
} catch (e) {
|
|
605
|
+
if (S.error("Unable to render selected resource: " + e), c === this.renderGeneration && this.resourceTarget) {
|
|
606
|
+
if (r(e)) {
|
|
607
|
+
this.renderAccessDeniedScreen();
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
this.renderExplorerError(t, "Unable to display the selected resource.");
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
showSubject(e, n) {
|
|
615
|
+
let r = t(e), a = r && this.store ? this.store.sym(r) : void 0, o = a ?? e, s = !a && !!this.resourceLogic && i(e, this.resourceLogic) && this.resourceLogic.containerHasIndexDocument(e);
|
|
616
|
+
this.selectedResource = o, this.showResourceInContentView(o, n, !!a || s);
|
|
617
|
+
}
|
|
618
|
+
setContainerView(e) {
|
|
619
|
+
this.containerView = e;
|
|
620
|
+
let t = this.resourceTarget?.querySelector("folder-pane-container");
|
|
621
|
+
t && (t.view = e);
|
|
622
|
+
}
|
|
623
|
+
render() {
|
|
624
|
+
return this.fullView ? O`
|
|
625
|
+
${this.renderContentError()}
|
|
626
|
+
<div
|
|
627
|
+
class="folder-pane-full-view"
|
|
628
|
+
?hidden=${!!this.contentError}
|
|
629
|
+
@resource-selected=${this.handleResourceSelected}
|
|
630
|
+
@resource-open-pane=${this.handleResourceOpenPane}
|
|
631
|
+
></div>
|
|
632
|
+
` : O`
|
|
633
|
+
${this.hideStorageHeader ? k : this.renderStorageHeader()}
|
|
634
|
+
<div
|
|
635
|
+
class="folder-pane-main-content"
|
|
636
|
+
@resource-selected=${this.handleResourceSelected}
|
|
637
|
+
@resource-open-pane=${this.handleResourceOpenPane}
|
|
638
|
+
>
|
|
639
|
+
<folder-pane-sidebar
|
|
640
|
+
.store=${this.store}
|
|
641
|
+
.resourceLogic=${this.resourceLogic}
|
|
642
|
+
.subject=${this.subject}
|
|
643
|
+
.selectedResource=${this.selectedResource ?? this.subject}
|
|
644
|
+
></folder-pane-sidebar>
|
|
645
|
+
<div class="folder-pane-content-column">
|
|
646
|
+
<div class="folder-pane-status"></div>
|
|
647
|
+
${this.renderContentError()}
|
|
648
|
+
<folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>
|
|
649
|
+
</div>
|
|
650
|
+
</div>
|
|
651
|
+
`;
|
|
652
|
+
}
|
|
653
|
+
renderStorageHeader() {
|
|
654
|
+
return O`
|
|
655
|
+
<folder-pane-storage-header
|
|
656
|
+
.subject=${this.subject}
|
|
657
|
+
.selectedResource=${this.selectedResource ?? this.subject}
|
|
658
|
+
.browserContext=${this.browserContext}
|
|
659
|
+
.paneList=${this.browserContext?.session.paneRegistry.list ?? []}
|
|
660
|
+
.view=${this.containerView}
|
|
661
|
+
.searchQuery=${this.searchQuery}
|
|
662
|
+
.canCreate=${!!D.currentUser()}
|
|
663
|
+
@folder-pane-select-home=${this.handleSelectHome}
|
|
664
|
+
@folder-pane-select-resource=${this.handleSelectBreadcrumbResource}
|
|
665
|
+
@folder-pane-change-view=${this.handleContainerViewChange}
|
|
666
|
+
@folder-pane-search=${this.handleSearch}
|
|
667
|
+
></folder-pane-storage-header>
|
|
668
|
+
`;
|
|
669
|
+
}
|
|
670
|
+
renderContentError() {
|
|
671
|
+
return this.contentError ? O`
|
|
672
|
+
<div class="folder-pane-resource-error" role="status">
|
|
673
|
+
<solid-ui-error-state
|
|
674
|
+
.title=${this.contentError.title}
|
|
675
|
+
.message=${this.contentError.message}
|
|
676
|
+
@close=${this.clearContentError}
|
|
677
|
+
>
|
|
678
|
+
<button type="button" @click=${this.retryContent}>Retry</button>
|
|
679
|
+
</solid-ui-error-state>
|
|
680
|
+
</div>
|
|
681
|
+
` : k;
|
|
682
|
+
}
|
|
683
|
+
}, {e: [ae, se, le, de, pe, he, _e, P, I, ye, xe, Ce, te], c: [je, ne]} = Ee(ee, [
|
|
684
|
+
[
|
|
685
|
+
ie,
|
|
686
|
+
1,
|
|
687
|
+
"browserContext"
|
|
688
|
+
],
|
|
689
|
+
[
|
|
690
|
+
oe,
|
|
691
|
+
1,
|
|
692
|
+
"subject"
|
|
693
|
+
],
|
|
694
|
+
[
|
|
695
|
+
ce,
|
|
696
|
+
1,
|
|
697
|
+
"fullView"
|
|
698
|
+
],
|
|
699
|
+
[
|
|
700
|
+
ue,
|
|
701
|
+
1,
|
|
702
|
+
"hideStorageHeader"
|
|
703
|
+
],
|
|
704
|
+
[
|
|
705
|
+
fe,
|
|
706
|
+
1,
|
|
707
|
+
"selectedResource"
|
|
708
|
+
],
|
|
709
|
+
[
|
|
710
|
+
me,
|
|
711
|
+
1,
|
|
712
|
+
"containerView"
|
|
713
|
+
],
|
|
714
|
+
[
|
|
715
|
+
ge,
|
|
716
|
+
1,
|
|
717
|
+
"searchQuery"
|
|
718
|
+
],
|
|
719
|
+
[
|
|
720
|
+
N,
|
|
721
|
+
1,
|
|
722
|
+
"contentError"
|
|
723
|
+
],
|
|
724
|
+
[
|
|
725
|
+
F,
|
|
726
|
+
1,
|
|
727
|
+
"contentView"
|
|
728
|
+
],
|
|
729
|
+
[
|
|
730
|
+
ve,
|
|
731
|
+
1,
|
|
732
|
+
"fullViewTarget"
|
|
733
|
+
],
|
|
734
|
+
[
|
|
735
|
+
be,
|
|
736
|
+
1,
|
|
737
|
+
"sidebar"
|
|
738
|
+
],
|
|
739
|
+
[
|
|
740
|
+
Se,
|
|
741
|
+
1,
|
|
742
|
+
"statusArea"
|
|
743
|
+
]
|
|
744
|
+
], re, 0, void 0, g), ne();
|
|
745
|
+
export { je as default };
|
|
746
|
+
|
|
747
|
+
//# sourceMappingURL=FolderPaneView.esm.js.map
|