folder-pane 4.0.1-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/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +21 -19
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +8 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +157 -115
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js +17 -15
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.d.ts +3 -0
- package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.esm.js +99 -80
- package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
- package/dist/folderPane.cjs.js +1 -1
- package/dist/folderPane.cjs.js.map +1 -1
- package/dist/folderPane.d.ts +13 -0
- package/dist/folderPane.d.ts.map +1 -1
- package/dist/folderPane.esm.js +16 -6
- package/dist/folderPane.esm.js.map +1 -1
- 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/package.json +1 -1
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { getContainerMemberCountLabel as e, getResourceAccessState as t, getResourcesForContainer as n } from "../../helpers.esm.js";
|
|
2
|
+
import { createRequestQueue as r } from "../../requestQueue.esm.js";
|
|
2
3
|
import "../../_virtual/~icons/lucide/file.esm.js";
|
|
3
4
|
import "../../_virtual/~icons/lucide/file-box.esm.js";
|
|
4
5
|
import "../../_virtual/~icons/lucide/folder.esm.js";
|
|
5
|
-
import
|
|
6
|
+
import i from "./FolderPaneContainer.styles.esm.js";
|
|
6
7
|
import "../../_virtual/~icons/lucide/globe.esm.js";
|
|
7
8
|
import "../../_virtual/~icons/lucide/lock-keyhole.esm.js";
|
|
8
|
-
import { FILE_EXPLORER_MANAGE_ACCESS_EVENT as
|
|
9
|
-
import { html as
|
|
10
|
-
import { property as
|
|
9
|
+
import { FILE_EXPLORER_MANAGE_ACCESS_EVENT as a, WebComponent as o, customElement as s, getRelevantPanes as c, utils as l } from "solid-ui";
|
|
10
|
+
import { html as u, nothing as d } from "lit";
|
|
11
|
+
import { property as f, state as p } from "lit/decorators.js";
|
|
11
12
|
import "solid-ui/components/resource-actions-menu";
|
|
12
13
|
// src/components/folder-pane-container/FolderPaneContainer.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
var m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j, ee, te, ne, re, ie, ae, oe, M, N, P, F, I, L, R, z, B, V, H, U, W, G, K, q, se, ce, le, ue, de;
|
|
15
|
+
function J(e, t, n) {
|
|
16
|
+
fe(e, t), t.set(e, n);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function fe(e, t) {
|
|
18
19
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return e.set(
|
|
21
|
+
function Y(e, t, n) {
|
|
22
|
+
return e.set(pe(e, t), n), n;
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return e.get(
|
|
24
|
+
function X(e, t) {
|
|
25
|
+
return e.get(pe(e, t));
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function pe(e, t, n) {
|
|
27
28
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
28
29
|
throw TypeError("Private element is not present on this object");
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
return (t =
|
|
31
|
+
function Z(e, t, n) {
|
|
32
|
+
return (t = Q(t)) in e ? Object.defineProperty(e, t, {
|
|
32
33
|
value: n,
|
|
33
34
|
enumerable: !0,
|
|
34
35
|
configurable: !0,
|
|
35
36
|
writable: !0
|
|
36
37
|
}) : e[t] = n, e;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function me(e, t, n, r, i, a) {
|
|
39
40
|
function o(e, t, n) {
|
|
40
41
|
return function(r, i) {
|
|
41
42
|
return n && n(r), e[t].call(r, i);
|
|
@@ -58,13 +59,13 @@ function fe(e, t, n, r, i, a) {
|
|
|
58
59
|
n || Array.isArray(_) || (_ = [_]);
|
|
59
60
|
var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
60
61
|
d ? (f || p ? b = {
|
|
61
|
-
get:
|
|
62
|
+
get: ge(function() {
|
|
62
63
|
return v(this);
|
|
63
64
|
}, r, "get"),
|
|
64
65
|
set: function(e) {
|
|
65
66
|
t[4](this, e);
|
|
66
67
|
}
|
|
67
|
-
} : b[S] = v, f ||
|
|
68
|
+
} : b[S] = v, f || ge(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
|
|
68
69
|
}
|
|
69
70
|
for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
|
|
70
71
|
var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
|
|
@@ -124,7 +125,7 @@ function fe(e, t, n, r, i, a) {
|
|
|
124
125
|
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
125
126
|
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
126
127
|
var i, a, o = [], c = function(t) {
|
|
127
|
-
return
|
|
128
|
+
return _e(t) === e;
|
|
128
129
|
}, u = /* @__PURE__ */ new Map();
|
|
129
130
|
function d(e) {
|
|
130
131
|
e && o.push(s.bind(null, e));
|
|
@@ -138,7 +139,7 @@ function fe(e, t, n, r, i, a) {
|
|
|
138
139
|
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);
|
|
139
140
|
u.set(b, !(m > 2) || m);
|
|
140
141
|
}
|
|
141
|
-
l(v ? e : e.prototype, p, _, g ? "#" + h :
|
|
142
|
+
l(v ? e : e.prototype, p, _, g ? "#" + h : Q(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
return d(i), d(a), o;
|
|
@@ -151,11 +152,11 @@ function fe(e, t, n, r, i, a) {
|
|
|
151
152
|
}
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
-
var t =
|
|
155
|
+
function Q(e) {
|
|
156
|
+
var t = he(e, "string");
|
|
156
157
|
return typeof t == "symbol" ? t : t + "";
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function he(e, t) {
|
|
159
160
|
if (typeof e != "object" || !e) return e;
|
|
160
161
|
var n;
|
|
161
162
|
if (typeof Symbol < "u" && (n = e[Symbol.toPrimitive]) !== void 0) {
|
|
@@ -165,7 +166,7 @@ function me(e, t) {
|
|
|
165
166
|
}
|
|
166
167
|
return (t === "string" ? String : Number)(e);
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function ge(e, t, n) {
|
|
169
170
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
170
171
|
try {
|
|
171
172
|
Object.defineProperty(e, "name", {
|
|
@@ -175,99 +176,99 @@ function he(e, t, n) {
|
|
|
175
176
|
} catch {}
|
|
176
177
|
return e;
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
+
function _e(e) {
|
|
179
180
|
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
180
181
|
return e;
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
+
function ve(e) {
|
|
183
184
|
return e;
|
|
184
185
|
}
|
|
185
|
-
|
|
186
|
+
j = [s("folder-pane-container")];
|
|
186
187
|
var $;
|
|
187
|
-
new (
|
|
188
|
+
new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v = /*#__PURE__*/ new WeakMap(), y = /*#__PURE__*/ new WeakMap(), b = /*#__PURE__*/ new WeakMap(), x = /*#__PURE__*/ new WeakMap(), S = /*#__PURE__*/ new WeakMap(), C = /*#__PURE__*/ new WeakMap(), w = /*#__PURE__*/ new WeakMap(), T = /*#__PURE__*/ new WeakMap(), E = /*#__PURE__*/ new WeakMap(), D = /*#__PURE__*/ new WeakMap(), O = /*#__PURE__*/ new WeakMap(), de = (ee = f({ attribute: !1 }), ne = f({ attribute: !1 }), ie = f({ attribute: !1 }), oe = f(), N = f(), F = f({
|
|
188
189
|
type: Boolean,
|
|
189
190
|
attribute: "hide-root-special-folders"
|
|
190
|
-
}),
|
|
191
|
+
}), L = p(), z = p(), V = p(), U = p(), G = p(), q = p(), ce = p(), "subject"), h = class extends o {
|
|
191
192
|
constructor(...e) {
|
|
192
|
-
super(...e),
|
|
193
|
+
super(...e), J(this, g, (k(this), te(this, void 0))), J(this, _, re(this, null)), J(this, v, ae(this, void 0)), J(this, y, M(this, "grid")), J(this, b, P(this, "")), J(this, x, I(this, !1)), J(this, S, R(this, /* @__PURE__ */ new Map())), J(this, C, B(this, [])), J(this, w, H(this, [])), J(this, T, W(this, /* @__PURE__ */ new Map())), J(this, E, K(this, /* @__PURE__ */ new Map())), J(this, D, se(this, !0)), J(this, O, le(this, void 0)), Z(this, "actionMenuGeneration", 0), Z(this, "resourceGeneration", 0), Z(this, "detailsQueue", r()), Z(this, "detailsObserver", void 0);
|
|
193
194
|
}
|
|
194
|
-
get [
|
|
195
|
-
return
|
|
195
|
+
get [de]() {
|
|
196
|
+
return X(g, this);
|
|
196
197
|
}
|
|
197
198
|
set subject(e) {
|
|
198
|
-
|
|
199
|
+
Y(g, this, e);
|
|
199
200
|
}
|
|
200
201
|
get resourceLogic() {
|
|
201
|
-
return
|
|
202
|
+
return X(_, this);
|
|
202
203
|
}
|
|
203
204
|
set resourceLogic(e) {
|
|
204
|
-
|
|
205
|
+
Y(_, this, e);
|
|
205
206
|
}
|
|
206
207
|
get browserContext() {
|
|
207
|
-
return
|
|
208
|
+
return X(v, this);
|
|
208
209
|
}
|
|
209
210
|
set browserContext(e) {
|
|
210
|
-
|
|
211
|
+
Y(v, this, e);
|
|
211
212
|
}
|
|
212
213
|
get view() {
|
|
213
|
-
return
|
|
214
|
+
return X(y, this);
|
|
214
215
|
}
|
|
215
216
|
set view(e) {
|
|
216
|
-
|
|
217
|
+
Y(y, this, e);
|
|
217
218
|
}
|
|
218
219
|
get searchQuery() {
|
|
219
|
-
return
|
|
220
|
+
return X(b, this);
|
|
220
221
|
}
|
|
221
222
|
set searchQuery(e) {
|
|
222
|
-
|
|
223
|
+
Y(b, this, e);
|
|
223
224
|
}
|
|
224
225
|
get hideRootSpecialFolders() {
|
|
225
|
-
return
|
|
226
|
+
return X(x, this);
|
|
226
227
|
}
|
|
227
228
|
set hideRootSpecialFolders(e) {
|
|
228
|
-
|
|
229
|
+
Y(x, this, e);
|
|
229
230
|
}
|
|
230
231
|
get resourceActionMenuItems() {
|
|
231
|
-
return
|
|
232
|
+
return X(S, this);
|
|
232
233
|
}
|
|
233
234
|
set resourceActionMenuItems(e) {
|
|
234
|
-
|
|
235
|
+
Y(S, this, e);
|
|
235
236
|
}
|
|
236
237
|
get resources() {
|
|
237
|
-
return
|
|
238
|
+
return X(C, this);
|
|
238
239
|
}
|
|
239
240
|
set resources(e) {
|
|
240
|
-
|
|
241
|
+
Y(C, this, e);
|
|
241
242
|
}
|
|
242
243
|
get optimisticResources() {
|
|
243
|
-
return
|
|
244
|
+
return X(w, this);
|
|
244
245
|
}
|
|
245
246
|
set optimisticResources(e) {
|
|
246
|
-
|
|
247
|
+
Y(w, this, e);
|
|
247
248
|
}
|
|
248
249
|
get resourceAccess() {
|
|
249
|
-
return
|
|
250
|
+
return X(T, this);
|
|
250
251
|
}
|
|
251
252
|
set resourceAccess(e) {
|
|
252
|
-
|
|
253
|
+
Y(T, this, e);
|
|
253
254
|
}
|
|
254
255
|
get memberLoad() {
|
|
255
|
-
return
|
|
256
|
+
return X(E, this);
|
|
256
257
|
}
|
|
257
258
|
set memberLoad(e) {
|
|
258
|
-
|
|
259
|
+
Y(E, this, e);
|
|
259
260
|
}
|
|
260
261
|
get loading() {
|
|
261
|
-
return
|
|
262
|
+
return X(D, this);
|
|
262
263
|
}
|
|
263
264
|
set loading(e) {
|
|
264
|
-
|
|
265
|
+
Y(D, this, e);
|
|
265
266
|
}
|
|
266
267
|
get loadError() {
|
|
267
|
-
return
|
|
268
|
+
return X(O, this);
|
|
268
269
|
}
|
|
269
270
|
set loadError(e) {
|
|
270
|
-
|
|
271
|
+
Y(O, this, e);
|
|
271
272
|
}
|
|
272
273
|
selectResource(e) {
|
|
273
274
|
this.dispatchEvent(new CustomEvent("resource-selected", {
|
|
@@ -286,7 +287,7 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
286
287
|
}
|
|
287
288
|
isRootSpecialFolder(e) {
|
|
288
289
|
if (!e.isContainer) return !1;
|
|
289
|
-
let t =
|
|
290
|
+
let t = l.label(e.subject).toLowerCase();
|
|
290
291
|
return t === "public" || t === "trash";
|
|
291
292
|
}
|
|
292
293
|
getResourcesFromStore() {
|
|
@@ -305,32 +306,41 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
305
306
|
}
|
|
306
307
|
get visibleResources() {
|
|
307
308
|
let e = this.searchQuery.trim().toLowerCase();
|
|
308
|
-
return e ? this.resources.filter((t) =>
|
|
309
|
+
return e ? this.resources.filter((t) => l.label(t.subject).toLowerCase().includes(e)) : this.resources;
|
|
309
310
|
}
|
|
310
311
|
async loadResources() {
|
|
311
312
|
let e = ++this.resourceGeneration, t = this.getResourcesFromStore();
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
this.
|
|
313
|
+
this.resources = t, this.loading = !1, this.loadError = void 0, e === this.resourceGeneration && this.loadResourceActionMenuItems(e);
|
|
314
|
+
}
|
|
315
|
+
loadResourceDetails(e) {
|
|
316
|
+
this.loadMemberCount(e), this.loadResourceAccess(e);
|
|
317
|
+
}
|
|
318
|
+
async loadMemberCount(e, t = this.resourceGeneration) {
|
|
319
|
+
if (!e.isContainer || this.memberLoad.has(e.id) || !this.browserContext) return;
|
|
320
|
+
let n = this.browserContext.session.store.fetcher;
|
|
321
|
+
this.memberLoad = new Map(this.memberLoad).set(e.id, "loading");
|
|
322
|
+
try {
|
|
323
|
+
if (await this.detailsQueue.run(() => n.load(e.subject)), t !== this.resourceGeneration) return;
|
|
324
|
+
this.memberLoad = new Map(this.memberLoad).set(e.id, "loaded");
|
|
325
|
+
} catch (n) {
|
|
326
|
+
if (t !== this.resourceGeneration) return;
|
|
327
|
+
console.warn("Unable to load folder-pane container member count", n), this.memberLoad = new Map(this.memberLoad).set(e.id, "error");
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
330
|
async loadResourceAccess(e, n = this.resourceGeneration) {
|
|
327
|
-
if (
|
|
328
|
-
|
|
331
|
+
if (this.resourceAccess.has(e.id) || !this.browserContext) return;
|
|
332
|
+
let r = this.browserContext.session.logic.resource;
|
|
333
|
+
this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
|
|
334
|
+
state: "unknown",
|
|
335
|
+
canManageAccess: !1
|
|
336
|
+
});
|
|
337
|
+
try {
|
|
338
|
+
let i = await this.detailsQueue.run(() => r.fetchMetadata(e.subject));
|
|
329
339
|
if (n !== this.resourceGeneration) return;
|
|
330
|
-
let
|
|
340
|
+
let a = t(i.access);
|
|
331
341
|
this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
|
|
332
|
-
state:
|
|
333
|
-
canManageAccess:
|
|
342
|
+
state: a,
|
|
343
|
+
canManageAccess: i.access.canManageAccess
|
|
334
344
|
});
|
|
335
345
|
} catch {
|
|
336
346
|
n === this.resourceGeneration && (this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
|
|
@@ -341,10 +351,40 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
341
351
|
}
|
|
342
352
|
renderAccessIndicator(e) {
|
|
343
353
|
let t = this.resourceAccess.get(e.id);
|
|
344
|
-
return t ? t.state === "public" ?
|
|
354
|
+
return t ? t.state === "public" ? u`<icon-lucide-globe class="resource-access-indicator resource-access-indicator--public" role="img" aria-label="Public" title="Public"></icon-lucide-globe>` : t.state === "private" ? u`<icon-lucide-lock-keyhole class="resource-access-indicator resource-access-indicator--private" role="img" aria-label="Private" title="Private"></icon-lucide-lock-keyhole>` : d : d;
|
|
355
|
+
}
|
|
356
|
+
resetResourceDetails() {
|
|
357
|
+
this.detailsQueue.clear(), this.detailsObserver?.disconnect(), this.resourceAccess = /* @__PURE__ */ new Map(), this.memberLoad = /* @__PURE__ */ new Map();
|
|
358
|
+
}
|
|
359
|
+
observeResourceItems() {
|
|
360
|
+
let e = Array.from(this.renderRoot.querySelectorAll("[data-resource-id]")), t = new Map(this.resources.map((e) => [e.id, e])), n = e.filter((e) => {
|
|
361
|
+
let n = t.get(e.dataset.resourceId);
|
|
362
|
+
return n && (n.isContainer && !this.memberLoad.has(n.id) || !this.resourceAccess.has(n.id));
|
|
363
|
+
});
|
|
364
|
+
if (n.length !== 0) {
|
|
365
|
+
if (typeof IntersectionObserver > "u") for (let e of n) this.loadResourceDetails(t.get(e.dataset.resourceId));
|
|
366
|
+
else {
|
|
367
|
+
this.detailsObserver ??= new IntersectionObserver((e) => {
|
|
368
|
+
for (let t of e) {
|
|
369
|
+
if (!t.isIntersecting) continue;
|
|
370
|
+
let e = t.target;
|
|
371
|
+
this.detailsObserver?.unobserve(e);
|
|
372
|
+
let n = this.resources.find((t) => t.id === e.dataset.resourceId);
|
|
373
|
+
n && this.loadResourceDetails(n);
|
|
374
|
+
}
|
|
375
|
+
}, { rootMargin: "200px" });
|
|
376
|
+
for (let e of n) this.detailsObserver.observe(e);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
connectedCallback() {
|
|
381
|
+
super.connectedCallback(), this.hasUpdated && this.requestUpdate();
|
|
382
|
+
}
|
|
383
|
+
disconnectedCallback() {
|
|
384
|
+
super.disconnectedCallback(), this.resourceGeneration++, this.resetResourceDetails();
|
|
345
385
|
}
|
|
346
386
|
async refresh(e = !0) {
|
|
347
|
-
if (this.resourceGeneration++, this.
|
|
387
|
+
if (this.resourceGeneration++, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.optimisticResources = [], e && this.subject && this.browserContext) try {
|
|
348
388
|
await this.browserContext.session.store.fetcher.load(this.subject, {
|
|
349
389
|
force: !0,
|
|
350
390
|
clearPreviousData: !0
|
|
@@ -362,7 +402,7 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
362
402
|
return;
|
|
363
403
|
}
|
|
364
404
|
let n = await Promise.all(this.resources.map(async (e) => {
|
|
365
|
-
let t = await
|
|
405
|
+
let t = await c(e.subject, this.browserContext, {
|
|
366
406
|
excludedPaneNames: ["sharing"],
|
|
367
407
|
fallbackPaneName: "internal"
|
|
368
408
|
}), n = await Promise.all(t.map(async (t) => {
|
|
@@ -387,17 +427,17 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
387
427
|
e === this.resourceGeneration && t === this.actionMenuGeneration && (this.resourceActionMenuItems = new Map(n));
|
|
388
428
|
}
|
|
389
429
|
updated(e) {
|
|
390
|
-
(e.has("subject") || e.has("resourceLogic") || e.has("browserContext") || e.has("hideRootSpecialFolders")) && (this.
|
|
430
|
+
(e.has("subject") || e.has("resourceLogic") || e.has("browserContext") || e.has("hideRootSpecialFolders")) && (this.resourceGeneration++, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.loadResources()), this.observeResourceItems();
|
|
391
431
|
}
|
|
392
432
|
openAccessControls(e) {
|
|
393
|
-
this.dispatchEvent(new CustomEvent(
|
|
433
|
+
this.dispatchEvent(new CustomEvent(a, {
|
|
394
434
|
detail: { subjectUri: e.subject.uri },
|
|
395
435
|
bubbles: !0,
|
|
396
436
|
composed: !0
|
|
397
437
|
}));
|
|
398
438
|
}
|
|
399
439
|
renderResourceActionsMenu(e, t) {
|
|
400
|
-
return
|
|
440
|
+
return u`
|
|
401
441
|
<div
|
|
402
442
|
class="resource-actions-menu resource-actions-menu--${t}"
|
|
403
443
|
@click=${(e) => e.stopPropagation()}
|
|
@@ -414,10 +454,11 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
414
454
|
`;
|
|
415
455
|
}
|
|
416
456
|
renderResourceItem(t) {
|
|
417
|
-
let n =
|
|
418
|
-
return
|
|
457
|
+
let n = l.label(t.subject), r = t.isContainer && this.memberLoad.get(t.id) === "loaded" ? this.getVisibleMemberCount(t) : -1;
|
|
458
|
+
return u`
|
|
419
459
|
<li
|
|
420
460
|
class="resource-list-item"
|
|
461
|
+
data-resource-id=${t.id}
|
|
421
462
|
notSelectable="false"
|
|
422
463
|
aria-selected="false"
|
|
423
464
|
aria-label=${n}
|
|
@@ -430,10 +471,10 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
430
471
|
>
|
|
431
472
|
<span class="resource-list-main">
|
|
432
473
|
<span class=${t.isContainer ? "resource-list-icon resource-list-icon--container" : "resource-list-icon"} aria-hidden="true">
|
|
433
|
-
${t.isContainer ?
|
|
474
|
+
${t.isContainer ? u`<icon-lucide-folder></icon-lucide-folder>` : u`<icon-lucide-file></icon-lucide-file>`}
|
|
434
475
|
</span>
|
|
435
476
|
<span class="resource-list-label">${n}</span>
|
|
436
|
-
${r >= 0 ?
|
|
477
|
+
${r >= 0 ? u`<span class="container-member-count">${e(r)}</span>` : d}
|
|
437
478
|
${this.renderAccessIndicator(t)}
|
|
438
479
|
</span>
|
|
439
480
|
${this.renderResourceActionsMenu(t, "list")}
|
|
@@ -441,7 +482,7 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
441
482
|
`;
|
|
442
483
|
}
|
|
443
484
|
renderListView(e) {
|
|
444
|
-
return
|
|
485
|
+
return u`
|
|
445
486
|
<ul class="resource-list" role="listbox" aria-label="Container resources">
|
|
446
487
|
<li class="resource-list-header" role="presentation" aria-hidden="true">
|
|
447
488
|
<span>Name</span>
|
|
@@ -452,10 +493,11 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
452
493
|
`;
|
|
453
494
|
}
|
|
454
495
|
renderGridItem(t) {
|
|
455
|
-
let n =
|
|
456
|
-
return
|
|
496
|
+
let n = l.label(t.subject), r = t.isContainer && this.memberLoad.get(t.id) === "loaded" ? this.getVisibleMemberCount(t) : -1;
|
|
497
|
+
return u`
|
|
457
498
|
<li
|
|
458
499
|
class="resource-grid-item"
|
|
500
|
+
data-resource-id=${t.id}
|
|
459
501
|
notSelectable="false"
|
|
460
502
|
aria-selected="false"
|
|
461
503
|
aria-label=${n}
|
|
@@ -467,11 +509,11 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
467
509
|
@keydown=${(e) => this.handleResourceKeyDown(e, t)}
|
|
468
510
|
>
|
|
469
511
|
<span class=${t.isContainer ? "resource-grid-icon resource-grid-icon--container" : "resource-grid-icon"} aria-hidden="true">
|
|
470
|
-
${t.isContainer ?
|
|
512
|
+
${t.isContainer ? u`<icon-lucide-folder></icon-lucide-folder>` : u`<icon-lucide-file></icon-lucide-file>`}
|
|
471
513
|
</span>
|
|
472
|
-
${t.isContainer ?
|
|
514
|
+
${t.isContainer ? u`<span class="resource-grid-label resource-grid-label--container">${n}</span>` : d}
|
|
473
515
|
<div class="resource-grid-item-footer">
|
|
474
|
-
${t.isContainer && r >= 0 ?
|
|
516
|
+
${t.isContainer && r >= 0 ? u`<span class="container-member-count">${e(r)}</span>` : t.isContainer ? d : u`<span class="resource-grid-label">${n}</span>`}
|
|
475
517
|
${this.renderAccessIndicator(t)}
|
|
476
518
|
</div>
|
|
477
519
|
${this.renderResourceActionsMenu(t, "grid")}
|
|
@@ -479,18 +521,18 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
479
521
|
`;
|
|
480
522
|
}
|
|
481
523
|
renderGridView(e) {
|
|
482
|
-
return
|
|
524
|
+
return u`
|
|
483
525
|
<ul class="resource-grid" role="listbox" aria-label="Container resources">
|
|
484
526
|
${e.map((e) => this.renderGridItem(e))}
|
|
485
527
|
</ul>
|
|
486
528
|
`;
|
|
487
529
|
}
|
|
488
530
|
renderEmptyContainer() {
|
|
489
|
-
return this.searchQuery.trim() ?
|
|
531
|
+
return this.searchQuery.trim() ? u`
|
|
490
532
|
<div class="folder-pane-container-empty-message" role="status">
|
|
491
533
|
<h2 class="folder-pane-container-empty-message-title">No resources match this search.</h2>
|
|
492
534
|
</div>
|
|
493
|
-
` :
|
|
535
|
+
` : u`
|
|
494
536
|
<div class="folder-pane-container-empty-message" role="status">
|
|
495
537
|
<div class="folder-pane-container-empty-message-icon" aria-hidden="true">
|
|
496
538
|
<icon-lucide-file-box></icon-lucide-file-box>
|
|
@@ -502,84 +544,84 @@ new (ce = (h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ =
|
|
|
502
544
|
}
|
|
503
545
|
render() {
|
|
504
546
|
let e = this.visibleResources;
|
|
505
|
-
return
|
|
547
|
+
return u`
|
|
506
548
|
<div class="folder-pane-container-content">
|
|
507
|
-
${this.loadError ?
|
|
508
|
-
${this.loading ?
|
|
549
|
+
${this.loadError ? u`<div class="folder-pane-container-error" role="alert">${this.loadError}</div>` : d}
|
|
550
|
+
${this.loading ? u`<div class="folder-pane-container-loading" role="status">Loading resources…</div>` : e.length > 0 ? this.view === "grid" ? this.renderGridView(e) : this.renderListView(e) : this.renderEmptyContainer()}
|
|
509
551
|
</div>
|
|
510
552
|
`;
|
|
511
553
|
}
|
|
512
|
-
}, {e: [
|
|
554
|
+
}, {e: [te, re, ae, M, P, I, R, B, H, W, K, se, le, k], c: [$, A]} = me(h, [
|
|
513
555
|
[
|
|
514
|
-
|
|
556
|
+
ee,
|
|
515
557
|
1,
|
|
516
558
|
"subject"
|
|
517
559
|
],
|
|
518
560
|
[
|
|
519
|
-
|
|
561
|
+
ne,
|
|
520
562
|
1,
|
|
521
563
|
"resourceLogic"
|
|
522
564
|
],
|
|
523
565
|
[
|
|
524
|
-
|
|
566
|
+
ie,
|
|
525
567
|
1,
|
|
526
568
|
"browserContext"
|
|
527
569
|
],
|
|
528
570
|
[
|
|
529
|
-
|
|
571
|
+
oe,
|
|
530
572
|
1,
|
|
531
573
|
"view"
|
|
532
574
|
],
|
|
533
575
|
[
|
|
534
|
-
|
|
576
|
+
N,
|
|
535
577
|
1,
|
|
536
578
|
"searchQuery"
|
|
537
579
|
],
|
|
538
580
|
[
|
|
539
|
-
|
|
581
|
+
F,
|
|
540
582
|
1,
|
|
541
583
|
"hideRootSpecialFolders"
|
|
542
584
|
],
|
|
543
585
|
[
|
|
544
|
-
|
|
586
|
+
L,
|
|
545
587
|
1,
|
|
546
588
|
"resourceActionMenuItems"
|
|
547
589
|
],
|
|
548
590
|
[
|
|
549
|
-
|
|
591
|
+
z,
|
|
550
592
|
1,
|
|
551
593
|
"resources"
|
|
552
594
|
],
|
|
553
595
|
[
|
|
554
|
-
|
|
596
|
+
V,
|
|
555
597
|
1,
|
|
556
598
|
"optimisticResources"
|
|
557
599
|
],
|
|
558
600
|
[
|
|
559
|
-
|
|
601
|
+
U,
|
|
560
602
|
1,
|
|
561
603
|
"resourceAccess"
|
|
562
604
|
],
|
|
563
605
|
[
|
|
564
|
-
|
|
606
|
+
G,
|
|
565
607
|
1,
|
|
566
608
|
"memberLoad"
|
|
567
609
|
],
|
|
568
610
|
[
|
|
569
|
-
|
|
611
|
+
q,
|
|
570
612
|
1,
|
|
571
613
|
"loading"
|
|
572
614
|
],
|
|
573
615
|
[
|
|
574
|
-
|
|
616
|
+
ce,
|
|
575
617
|
1,
|
|
576
618
|
"loadError"
|
|
577
619
|
]
|
|
578
|
-
],
|
|
620
|
+
], j, 0, void 0, o), h), m = class extends ve {
|
|
579
621
|
constructor() {
|
|
580
|
-
super($),
|
|
622
|
+
super($), Z(this, "styles", i), A();
|
|
581
623
|
}
|
|
582
|
-
},
|
|
624
|
+
}, Z(m, ue, void 0), m)();
|
|
583
625
|
export { $ as default };
|
|
584
626
|
|
|
585
627
|
//# sourceMappingURL=FolderPaneContainer.esm.js.map
|