folder-pane 4.0.1-0 → 4.0.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/~icons/lucide/chevron-left.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/chevron-left.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/{trash-2.esm.js → chevron-left.esm.js} +4 -4
- package/dist/_virtual/~icons/lucide/chevron-left.esm.js.map +1 -0
- package/dist/accessCache.cjs.js +2 -0
- package/dist/accessCache.cjs.js.map +1 -0
- package/dist/accessCache.d.ts +37 -0
- package/dist/accessCache.d.ts.map +1 -0
- package/dist/accessCache.esm.js +34 -0
- package/dist/accessCache.esm.js.map +1 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +38 -33
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +27 -5
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +305 -189
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js.map +1 -1
- package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js +1 -1
- package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js.map +1 -1
- package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js +1 -1
- package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js.map +1 -1
- package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js +2 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js.map +1 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts +16 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts.map +1 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js +293 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js.map +1 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js +2 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js.map +1 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js +6 -0
- package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js.map +1 -0
- package/dist/components/folder-pane-provider/index.cjs.js +1 -0
- package/dist/components/folder-pane-provider/index.d.ts +2 -0
- package/dist/components/folder-pane-provider/index.d.ts.map +1 -0
- package/dist/components/folder-pane-provider/index.esm.js +1 -0
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js +18 -19
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js.map +1 -1
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts +15 -2
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts.map +1 -1
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js +237 -108
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js.map +1 -1
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js +1 -1
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js.map +1 -1
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js +1 -1
- package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js.map +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js +32 -18
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js.map +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts +13 -2
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts.map +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js +191 -84
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js.map +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js.map +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js +1 -1
- package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js +91 -28
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.d.ts +36 -3
- package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.esm.js +520 -240
- package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
- package/dist/components/folder-pane-view/resourceLoad.cjs.js +2 -0
- package/dist/components/folder-pane-view/resourceLoad.cjs.js.map +1 -0
- package/dist/components/folder-pane-view/resourceLoad.d.ts +8 -0
- package/dist/components/folder-pane-view/resourceLoad.d.ts.map +1 -0
- package/dist/components/folder-pane-view/resourceLoad.esm.js +7 -0
- package/dist/components/folder-pane-view/resourceLoad.esm.js.map +1 -0
- package/dist/debug.cjs.js +2 -0
- package/dist/debug.cjs.js.map +1 -0
- package/dist/debug.d.ts +5 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.esm.js +10 -0
- package/dist/debug.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 +13 -0
- package/dist/folderPane.d.ts.map +1 -1
- package/dist/folderPane.esm.js +24 -13
- package/dist/folderPane.esm.js.map +1 -1
- package/dist/helpers.cjs.js +1 -1
- package/dist/helpers.cjs.js.map +1 -1
- package/dist/helpers.d.ts +12 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.esm.js +34 -14
- package/dist/helpers.esm.js.map +1 -1
- package/dist/primitives/context.cjs.js +2 -0
- package/dist/primitives/context.cjs.js.map +1 -0
- package/dist/primitives/context.d.ts +14 -0
- package/dist/primitives/context.d.ts.map +1 -0
- package/dist/primitives/context.esm.js +6 -0
- package/dist/primitives/context.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 +38 -0
- package/dist/requestQueue.d.ts.map +1 -0
- package/dist/requestQueue.esm.js +77 -0
- package/dist/requestQueue.esm.js.map +1 -0
- package/dist/resourceActionItems.cjs.js +2 -0
- package/dist/resourceActionItems.cjs.js.map +1 -0
- package/dist/resourceActionItems.d.ts +20 -0
- package/dist/resourceActionItems.d.ts.map +1 -0
- package/dist/resourceActionItems.esm.js +42 -0
- package/dist/resourceActionItems.esm.js.map +1 -0
- package/package.json +12 -8
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +0 -1
|
@@ -12,22 +12,35 @@ export default class FolderPaneSidebar extends WebComponent {
|
|
|
12
12
|
accessor resources: ResourceMap;
|
|
13
13
|
accessor expandedContainers: Set<string>;
|
|
14
14
|
accessor homeExpanded: boolean;
|
|
15
|
-
accessor
|
|
15
|
+
private accessor activeResourceId;
|
|
16
|
+
private pendingFocusResourceId;
|
|
16
17
|
private resourceGeneration;
|
|
18
|
+
private focusHomeOnUpdate;
|
|
17
19
|
private loadResources;
|
|
20
|
+
private getVisibleResources;
|
|
21
|
+
private getVisibleResourceIds;
|
|
22
|
+
private getParentResourceId;
|
|
23
|
+
private getFirstChildResource;
|
|
24
|
+
private getNextVisibleResourceId;
|
|
25
|
+
private getPreviousVisibleResourceId;
|
|
26
|
+
private isTreeFocused;
|
|
27
|
+
private focusResource;
|
|
28
|
+
private setActiveFromFocus;
|
|
18
29
|
refreshResources(container?: NamedNode): void;
|
|
19
30
|
private toggleContainer;
|
|
31
|
+
private reportExpansionError;
|
|
20
32
|
private isSelected;
|
|
21
|
-
private isNamed;
|
|
22
33
|
private getHomeResource;
|
|
23
34
|
private selectResource;
|
|
24
35
|
private renderRow;
|
|
25
36
|
private renderItem;
|
|
37
|
+
private handleKeydown;
|
|
26
38
|
private renderSpecialIcon;
|
|
27
39
|
private renderResourceItem;
|
|
28
40
|
private renderResourceGroup;
|
|
29
41
|
private renderTree;
|
|
30
42
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
43
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
31
44
|
render(): import('lit-html').TemplateResult<1>;
|
|
32
45
|
}
|
|
33
46
|
//# sourceMappingURL=FolderPaneSidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FolderPaneSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/folder-pane-sidebar/FolderPaneSidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,UAAU,CAAA;AAI7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClD,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,6BAA6B,CAAA;AACpC,OAAO,4BAA4B,CAAA;AACnC,OAAO,sBAAsB,CAAA;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"FolderPaneSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/folder-pane-sidebar/FolderPaneSidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,UAAU,CAAA;AAI7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClD,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,6BAA6B,CAAA;AACpC,OAAO,4BAA4B,CAAA;AACnC,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAMtF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY;IACzD,MAAM,CAAC,MAAM,MAAS;IAGtB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAO;IAGvC,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAY;IAGnD,QAAQ,CAAC,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAO;IAG7D,QAAQ,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAY;IAG5D,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAY;IAG3C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAY;IAGpD,QAAQ,CAAC,YAAY,UAAO;IAE5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IACvD,OAAO,CAAC,sBAAsB,CAAsB;IACpD,OAAO,CAAC,kBAAkB,CAAI;IAC9B,OAAO,CAAC,iBAAiB,CAAQ;IAEjC,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,4BAA4B;IAKpC,OAAO,CAAC,aAAa;YAMP,aAAa;IAiB3B,OAAO,CAAC,kBAAkB;IAQ1B,gBAAgB,CAAE,SAAS,CAAC,EAAE,SAAS;YAezB,eAAe;IAmD7B,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,SAAS;IAsCjB,OAAO,CAAC,UAAU;IAiClB,OAAO,CAAC,aAAa;IAiErB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,UAAU;IAqBlB,SAAS,CAAC,UAAU,CAAE,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAsB7D,SAAS,CAAC,OAAO,CAAE,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAmB1D,MAAM;CAOP"}
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../../_virtual/~icons/lucide/folder.esm.js";
|
|
3
|
-
import "../../_virtual/~icons/lucide/globe.esm.js";
|
|
4
|
-
import t from "./FolderPaneSidebar.styles.esm.js";
|
|
1
|
+
import e from "./FolderPaneSidebar.styles.esm.js";
|
|
5
2
|
import "../../_virtual/~icons/lucide/chevron-right.esm.js";
|
|
6
3
|
import "../../_virtual/~icons/lucide/circle-small.esm.js";
|
|
7
|
-
import "../../_virtual/~icons/lucide/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import "../../_virtual/~icons/lucide/folder.esm.js";
|
|
5
|
+
import { getResourcesForContainer as t } from "../../helpers.esm.js";
|
|
6
|
+
import { error as n } from "../../debug.esm.js";
|
|
7
|
+
import { WebComponent as r, customElement as i, utils as a } from "solid-ui";
|
|
8
|
+
import { html as o, nothing as s } from "lit";
|
|
9
|
+
import { property as c, state as l } from "lit/decorators.js";
|
|
10
|
+
import { repeat as u } from "lit/directives/repeat.js";
|
|
12
11
|
// src/components/folder-pane-sidebar/FolderPaneSidebar.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
|
|
12
|
+
var d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j, M, N, P, F, I, L, R, z, B, V;
|
|
13
|
+
function H(e, t, n) {
|
|
14
|
+
U(e, t), t.set(e, n);
|
|
16
15
|
}
|
|
17
|
-
function
|
|
16
|
+
function U(e, t) {
|
|
18
17
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
19
18
|
}
|
|
20
|
-
function
|
|
21
|
-
return e.set(
|
|
19
|
+
function W(e, t, n) {
|
|
20
|
+
return e.set(K(e, t), n), n;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
return e.get(
|
|
22
|
+
function G(e, t) {
|
|
23
|
+
return e.get(K(e, t));
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function K(e, t, n) {
|
|
27
26
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
28
27
|
throw TypeError("Private element is not present on this object");
|
|
29
28
|
}
|
|
30
|
-
function
|
|
31
|
-
return (t =
|
|
29
|
+
function q(e, t, n) {
|
|
30
|
+
return (t = Y(t)) in e ? Object.defineProperty(e, t, {
|
|
32
31
|
value: n,
|
|
33
32
|
enumerable: !0,
|
|
34
33
|
configurable: !0,
|
|
35
34
|
writable: !0
|
|
36
35
|
}) : e[t] = n, e;
|
|
37
36
|
}
|
|
38
|
-
function
|
|
37
|
+
function J(e, t, n, r, i, a) {
|
|
39
38
|
function o(e, t, n) {
|
|
40
39
|
return function(r, i) {
|
|
41
40
|
return n && n(r), e[t].call(r, i);
|
|
@@ -58,13 +57,13 @@ function q(e, t, n, r, i, a) {
|
|
|
58
57
|
n || Array.isArray(_) || (_ = [_]);
|
|
59
58
|
var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
60
59
|
d ? (f || p ? b = {
|
|
61
|
-
get:
|
|
60
|
+
get: Z(function() {
|
|
62
61
|
return v(this);
|
|
63
62
|
}, r, "get"),
|
|
64
63
|
set: function(e) {
|
|
65
64
|
t[4](this, e);
|
|
66
65
|
}
|
|
67
|
-
} : b[S] = v, f ||
|
|
66
|
+
} : b[S] = v, f || Z(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
|
|
68
67
|
}
|
|
69
68
|
for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
|
|
70
69
|
var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
|
|
@@ -124,7 +123,7 @@ function q(e, t, n, r, i, a) {
|
|
|
124
123
|
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
125
124
|
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
126
125
|
var i, a, o = [], c = function(t) {
|
|
127
|
-
return
|
|
126
|
+
return Q(t) === e;
|
|
128
127
|
}, u = /* @__PURE__ */ new Map();
|
|
129
128
|
function d(e) {
|
|
130
129
|
e && o.push(s.bind(null, e));
|
|
@@ -138,7 +137,7 @@ function q(e, t, n, r, i, a) {
|
|
|
138
137
|
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
138
|
u.set(b, !(m > 2) || m);
|
|
140
139
|
}
|
|
141
|
-
l(v ? e : e.prototype, p, _, g ? "#" + h :
|
|
140
|
+
l(v ? e : e.prototype, p, _, g ? "#" + h : Y(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
return d(i), d(a), o;
|
|
@@ -151,11 +150,11 @@ function q(e, t, n, r, i, a) {
|
|
|
151
150
|
}
|
|
152
151
|
};
|
|
153
152
|
}
|
|
154
|
-
function
|
|
155
|
-
var t =
|
|
153
|
+
function Y(e) {
|
|
154
|
+
var t = X(e, "string");
|
|
156
155
|
return typeof t == "symbol" ? t : t + "";
|
|
157
156
|
}
|
|
158
|
-
function
|
|
157
|
+
function X(e, t) {
|
|
159
158
|
if (typeof e != "object" || !e) return e;
|
|
160
159
|
var n;
|
|
161
160
|
if (typeof Symbol < "u" && (n = e[Symbol.toPrimitive]) !== void 0) {
|
|
@@ -165,7 +164,7 @@ function Y(e, t) {
|
|
|
165
164
|
}
|
|
166
165
|
return (t === "string" ? String : Number)(e);
|
|
167
166
|
}
|
|
168
|
-
function
|
|
167
|
+
function Z(e, t, n) {
|
|
169
168
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
170
169
|
try {
|
|
171
170
|
Object.defineProperty(e, "name", {
|
|
@@ -175,69 +174,130 @@ function X(e, t, n) {
|
|
|
175
174
|
} catch {}
|
|
176
175
|
return e;
|
|
177
176
|
}
|
|
178
|
-
function
|
|
177
|
+
function Q(e) {
|
|
179
178
|
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
180
179
|
return e;
|
|
181
180
|
}
|
|
182
|
-
function
|
|
181
|
+
function ee(e) {
|
|
183
182
|
return e;
|
|
184
183
|
}
|
|
185
|
-
|
|
184
|
+
C = [i("folder-pane-sidebar")];
|
|
186
185
|
var $;
|
|
187
|
-
new (
|
|
186
|
+
new (B = (p = /*#__PURE__*/ new WeakMap(), m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v = /*#__PURE__*/ new WeakMap(), y = /*#__PURE__*/ new WeakMap(), b = /*#__PURE__*/ new WeakMap(), V = (w = c({ attribute: !1 }), E = c({ attribute: !1 }), O = c({ attribute: !1 }), A = c({ attribute: !1 }), M = l(), P = l(), I = l(), R = l(), "store"), f = class extends r {
|
|
188
187
|
constructor(...e) {
|
|
189
|
-
super(...e),
|
|
188
|
+
super(...e), H(this, p, (x(this), T(this, null))), H(this, m, D(this, void 0)), H(this, h, k(this, null)), H(this, g, j(this, void 0)), H(this, _, N(this, /* @__PURE__ */ new Map())), H(this, v, F(this, /* @__PURE__ */ new Set())), H(this, y, L(this, !0)), H(this, b, z(this, null)), q(this, "pendingFocusResourceId", null), q(this, "resourceGeneration", 0), q(this, "focusHomeOnUpdate", !1);
|
|
190
189
|
}
|
|
191
|
-
get [
|
|
192
|
-
return
|
|
190
|
+
get [V]() {
|
|
191
|
+
return G(p, this);
|
|
193
192
|
}
|
|
194
193
|
set store(e) {
|
|
195
|
-
|
|
194
|
+
W(p, this, e);
|
|
196
195
|
}
|
|
197
196
|
get subject() {
|
|
198
|
-
return
|
|
197
|
+
return G(m, this);
|
|
199
198
|
}
|
|
200
199
|
set subject(e) {
|
|
201
|
-
|
|
200
|
+
W(m, this, e);
|
|
202
201
|
}
|
|
203
202
|
get resourceLogic() {
|
|
204
|
-
return
|
|
203
|
+
return G(h, this);
|
|
205
204
|
}
|
|
206
205
|
set resourceLogic(e) {
|
|
207
|
-
|
|
206
|
+
W(h, this, e);
|
|
208
207
|
}
|
|
209
208
|
get selectedResource() {
|
|
210
|
-
return
|
|
209
|
+
return G(g, this);
|
|
211
210
|
}
|
|
212
211
|
set selectedResource(e) {
|
|
213
|
-
|
|
212
|
+
W(g, this, e);
|
|
214
213
|
}
|
|
215
214
|
get resources() {
|
|
216
|
-
return
|
|
215
|
+
return G(_, this);
|
|
217
216
|
}
|
|
218
217
|
set resources(e) {
|
|
219
|
-
|
|
218
|
+
W(_, this, e);
|
|
220
219
|
}
|
|
221
220
|
get expandedContainers() {
|
|
222
|
-
return
|
|
221
|
+
return G(v, this);
|
|
223
222
|
}
|
|
224
223
|
set expandedContainers(e) {
|
|
225
|
-
|
|
224
|
+
W(v, this, e);
|
|
226
225
|
}
|
|
227
226
|
get homeExpanded() {
|
|
228
|
-
return
|
|
227
|
+
return G(y, this);
|
|
229
228
|
}
|
|
230
229
|
set homeExpanded(e) {
|
|
231
|
-
|
|
230
|
+
W(y, this, e);
|
|
232
231
|
}
|
|
233
|
-
get
|
|
234
|
-
return
|
|
232
|
+
get activeResourceId() {
|
|
233
|
+
return G(b, this);
|
|
235
234
|
}
|
|
236
|
-
set
|
|
237
|
-
|
|
235
|
+
set activeResourceId(e) {
|
|
236
|
+
W(b, this, e);
|
|
238
237
|
}
|
|
239
238
|
loadResources() {
|
|
240
|
-
|
|
239
|
+
let e = this.isTreeFocused(), n = new Map(this.getVisibleResources().map((e) => [e.id, e])), r = this.activeResourceId;
|
|
240
|
+
if (this.resourceGeneration++, !this.store || !this.subject) {
|
|
241
|
+
this.resources = /* @__PURE__ */ new Map(), this.expandedContainers = /* @__PURE__ */ new Set(), this.activeResourceId = null;
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.resources = t(this.subject, this.resourceLogic);
|
|
245
|
+
let i = this.getVisibleResourceIds();
|
|
246
|
+
if (r && !i.includes(r)) {
|
|
247
|
+
let e = n.get(r), t = null;
|
|
248
|
+
for (; e;) {
|
|
249
|
+
let r = this.getParentResourceId(e);
|
|
250
|
+
if (r && i.includes(r)) {
|
|
251
|
+
t = r;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
e = r ? n.get(r) : void 0;
|
|
255
|
+
}
|
|
256
|
+
this.activeResourceId = t ?? this.getHomeResource()?.id ?? null;
|
|
257
|
+
}
|
|
258
|
+
e && this.activeResourceId && (this.pendingFocusResourceId = this.activeResourceId);
|
|
259
|
+
}
|
|
260
|
+
getVisibleResources() {
|
|
261
|
+
let e = this.getHomeResource();
|
|
262
|
+
if (!e) return [];
|
|
263
|
+
let n = [e], r = (i) => {
|
|
264
|
+
let a = i.id === e.id ? this.homeExpanded : this.expandedContainers.has(i.id);
|
|
265
|
+
if (!i.isContainer || !a) return;
|
|
266
|
+
let o = i.id === e.id ? [...this.resources.values()] : [...t(i.subject, this.resourceLogic).values()];
|
|
267
|
+
for (let e of o) n.push(e), r(e);
|
|
268
|
+
};
|
|
269
|
+
return r(e), n;
|
|
270
|
+
}
|
|
271
|
+
getVisibleResourceIds() {
|
|
272
|
+
return this.getVisibleResources().map((e) => e.id);
|
|
273
|
+
}
|
|
274
|
+
getParentResourceId(e) {
|
|
275
|
+
return e.parentId ?? this.getHomeResource()?.id ?? null;
|
|
276
|
+
}
|
|
277
|
+
getFirstChildResource(e) {
|
|
278
|
+
return e.isContainer ? (e.id === this.getHomeResource()?.id ? [...this.resources.values()] : [...t(e.subject, this.resourceLogic).values()])[0] ?? null : null;
|
|
279
|
+
}
|
|
280
|
+
getNextVisibleResourceId(e) {
|
|
281
|
+
let t = this.getVisibleResourceIds();
|
|
282
|
+
return t[t.indexOf(e) + 1] ?? null;
|
|
283
|
+
}
|
|
284
|
+
getPreviousVisibleResourceId(e) {
|
|
285
|
+
let t = this.getVisibleResourceIds();
|
|
286
|
+
return t[t.indexOf(e) - 1] ?? null;
|
|
287
|
+
}
|
|
288
|
+
isTreeFocused() {
|
|
289
|
+
let e = this.renderRoot?.querySelector("[role=\"tree\"]"), t = this.renderRoot?.activeElement ?? document.activeElement;
|
|
290
|
+
return !!e && (e.contains(t) || document.activeElement === this);
|
|
291
|
+
}
|
|
292
|
+
async focusResource(e, t = !0, n = !1) {
|
|
293
|
+
if (!e || !n && !this.isTreeFocused()) return;
|
|
294
|
+
this.activeResourceId = e, await this.updateComplete;
|
|
295
|
+
let r = Array.from(this.renderRoot.querySelectorAll("[role=\"treeitem\"]")).find((t) => t.dataset.resourceId === e);
|
|
296
|
+
r?.isConnected ? (n || this.isTreeFocused()) && (this.pendingFocusResourceId = e, r.focus(), this.pendingFocusResourceId = null, t && typeof r.scrollIntoView == "function" && r.scrollIntoView({ block: "nearest" })) : this.pendingFocusResourceId = null;
|
|
297
|
+
}
|
|
298
|
+
setActiveFromFocus(e) {
|
|
299
|
+
let t = e.target.closest("[role=\"treeitem\"]");
|
|
300
|
+
this.pendingFocusResourceId && t?.dataset.resourceId !== this.pendingFocusResourceId || t && this.renderRoot?.activeElement && this.renderRoot.activeElement !== t || t?.dataset.resourceId && (this.activeResourceId = t.dataset.resourceId);
|
|
241
301
|
}
|
|
242
302
|
refreshResources(e) {
|
|
243
303
|
if (this.loadResources(), !e || !this.subject || e.sameTerm(this.subject)) return;
|
|
@@ -252,24 +312,43 @@ new (z = (f = /*#__PURE__*/ new WeakMap(), p = /*#__PURE__*/ new WeakMap(), m =
|
|
|
252
312
|
}
|
|
253
313
|
async toggleContainer(e) {
|
|
254
314
|
if (!e.isContainer) return;
|
|
255
|
-
let
|
|
256
|
-
if (
|
|
315
|
+
let n = this.resourceGeneration, r = this.subject, i = this.store, a = this.resourceLogic, o = this.isTreeFocused(), s = new Set(this.expandedContainers);
|
|
316
|
+
if (s.has(e.id)) {
|
|
317
|
+
s.delete(e.id), this.expandedContainers = s;
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
let c = this.store?.fetcher;
|
|
321
|
+
if (!c) this.reportExpansionError(e);
|
|
257
322
|
else {
|
|
258
323
|
try {
|
|
259
|
-
await
|
|
324
|
+
await c.load(e.subject);
|
|
260
325
|
} catch (t) {
|
|
261
|
-
|
|
326
|
+
if (n !== this.resourceGeneration || this.subject !== r || this.store !== i || this.resourceLogic !== a) return;
|
|
327
|
+
this.reportExpansionError(e, t);
|
|
262
328
|
return;
|
|
263
329
|
}
|
|
264
|
-
|
|
330
|
+
if (n === this.resourceGeneration && this.subject === r && this.store === i && this.resourceLogic === a && this.getVisibleResources().some((t) => t.id === e.id && t.subject.sameTerm(e.subject)) && (this.store && this.subject && (this.resources = t(this.subject, this.resourceLogic)), this.expandedContainers = new Set(this.expandedContainers).add(e.id), o && this.activeResourceId === e.id && this.isTreeFocused())) {
|
|
331
|
+
if (await this.updateComplete, this.activeResourceId !== e.id || !this.isTreeFocused()) return;
|
|
332
|
+
await this.focusResource(e.id, !1, !0);
|
|
333
|
+
}
|
|
265
334
|
}
|
|
266
335
|
}
|
|
336
|
+
reportExpansionError(e, t) {
|
|
337
|
+
t && n("Unable to expand storage container", t), this.dispatchEvent(new CustomEvent("folder-pane-resource-error", {
|
|
338
|
+
detail: {
|
|
339
|
+
title: `Unable to load ${a.label(e.subject)}`,
|
|
340
|
+
message: "Try expanding the folder again.",
|
|
341
|
+
retry: () => {
|
|
342
|
+
this.toggleContainer(e);
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
bubbles: !0,
|
|
346
|
+
composed: !0
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
267
349
|
isSelected(e) {
|
|
268
350
|
return e ? this.selectedResource?.sameTerm(e.subject) ?? !1 : !1;
|
|
269
351
|
}
|
|
270
|
-
isNamed(e, t) {
|
|
271
|
-
return i.label(e.subject).toLowerCase() === t;
|
|
272
|
-
}
|
|
273
352
|
getHomeResource() {
|
|
274
353
|
return this.subject ? {
|
|
275
354
|
id: this.subject.value,
|
|
@@ -285,28 +364,24 @@ new (z = (f = /*#__PURE__*/ new WeakMap(), p = /*#__PURE__*/ new WeakMap(), m =
|
|
|
285
364
|
composed: !0
|
|
286
365
|
}));
|
|
287
366
|
}
|
|
288
|
-
renderRow(e, t, n, r, i,
|
|
289
|
-
let s = e.isContainer ?
|
|
367
|
+
renderRow(e, t, n, r, i, a = !1) {
|
|
368
|
+
let s = e.isContainer ? o`
|
|
290
369
|
<button
|
|
291
370
|
class="resource-expand-button"
|
|
292
371
|
type="button"
|
|
293
372
|
tabindex="-1"
|
|
294
373
|
aria-label=${r ? `Collapse ${t}` : `Expand ${t}`}
|
|
295
|
-
@click=${(
|
|
296
|
-
|
|
374
|
+
@click=${(t) => {
|
|
375
|
+
t.preventDefault(), t.stopPropagation(), this.focusResource(e.id, !1).then(i);
|
|
297
376
|
}}
|
|
298
377
|
>
|
|
299
378
|
<icon-lucide-chevron-right></icon-lucide-chevron-right>
|
|
300
379
|
</button>
|
|
301
|
-
` :
|
|
302
|
-
return
|
|
380
|
+
` : o`<span class="resource-expand-spacer" aria-hidden="true"></span>`;
|
|
381
|
+
return o`
|
|
303
382
|
<div
|
|
304
|
-
class=${
|
|
305
|
-
tabindex="0"
|
|
383
|
+
class=${a ? "resource-row resource-row-special" : "resource-row"}
|
|
306
384
|
@click=${() => this.selectResource(e)}
|
|
307
|
-
@keydown=${(t) => {
|
|
308
|
-
t.key === "Enter" || t.key === " " ? (t.preventDefault(), this.selectResource(e)) : e.isContainer && (t.key === "ArrowRight" || t.key === "ArrowLeft") && t.key === "ArrowRight" !== r && (t.preventDefault(), i());
|
|
309
|
-
}}
|
|
310
385
|
>
|
|
311
386
|
${s}
|
|
312
387
|
${n}
|
|
@@ -314,116 +389,170 @@ new (z = (f = /*#__PURE__*/ new WeakMap(), p = /*#__PURE__*/ new WeakMap(), m =
|
|
|
314
389
|
</div>
|
|
315
390
|
`;
|
|
316
391
|
}
|
|
317
|
-
renderItem(e, t, n, r, i,
|
|
392
|
+
renderItem(e, t, n, r, i, a, c = !1) {
|
|
318
393
|
let l = this.isSelected(e);
|
|
319
|
-
return
|
|
394
|
+
return o`
|
|
320
395
|
<li
|
|
321
396
|
class=${l ? "resource-item selected" : "resource-item"}
|
|
322
397
|
notSelectable="false"
|
|
323
398
|
role="treeitem"
|
|
399
|
+
tabindex=${this.activeResourceId === e.id || this.activeResourceId === null && e.id === this.getHomeResource()?.id ? "0" : "-1"}
|
|
400
|
+
data-resource-id=${e.id}
|
|
324
401
|
aria-label=${t}
|
|
325
402
|
aria-selected=${String(l)}
|
|
326
|
-
aria-expanded=${e.isContainer ? String(r) :
|
|
403
|
+
aria-expanded=${e.isContainer ? String(r) : s}
|
|
327
404
|
data-expanded=${String(r)}
|
|
328
405
|
about=${e.subject.toNT()}
|
|
329
406
|
.subject=${e.subject}
|
|
407
|
+
@focusin=${this.setActiveFromFocus}
|
|
408
|
+
@keydown=${(t) => this.handleKeydown(t, e, r, i)}
|
|
330
409
|
>
|
|
331
410
|
${this.renderRow(e, t, n, r, i, c)}
|
|
332
|
-
${r ?
|
|
411
|
+
${r ? a : s}
|
|
333
412
|
</li>
|
|
334
413
|
`;
|
|
335
414
|
}
|
|
415
|
+
handleKeydown(e, t, n, r) {
|
|
416
|
+
if (e.target.closest("[role=\"treeitem\"]") !== e.currentTarget || ![
|
|
417
|
+
"ArrowDown",
|
|
418
|
+
"ArrowUp",
|
|
419
|
+
"Home",
|
|
420
|
+
"End",
|
|
421
|
+
"ArrowRight",
|
|
422
|
+
"ArrowLeft",
|
|
423
|
+
"Enter",
|
|
424
|
+
" "
|
|
425
|
+
].includes(e.key)) return;
|
|
426
|
+
e.stopPropagation();
|
|
427
|
+
let i = e.currentTarget.dataset.resourceId ?? t.id, a = this.getVisibleResources().find((e) => e.id === i);
|
|
428
|
+
a && (t = a, n = t.id === this.getHomeResource()?.id ? this.homeExpanded : this.expandedContainers.has(t.id), r = () => {
|
|
429
|
+
t.id === this.getHomeResource()?.id ? this.homeExpanded = !this.homeExpanded : this.toggleContainer(t);
|
|
430
|
+
}), this.activeResourceId = i;
|
|
431
|
+
let o = (t) => {
|
|
432
|
+
t && (e.preventDefault(), this.activeResourceId = t, this.focusResource(t, !0, !0));
|
|
433
|
+
};
|
|
434
|
+
switch (e.key) {
|
|
435
|
+
case "ArrowDown":
|
|
436
|
+
o(this.getNextVisibleResourceId(t.id));
|
|
437
|
+
break;
|
|
438
|
+
case "ArrowUp":
|
|
439
|
+
o(this.getPreviousVisibleResourceId(t.id));
|
|
440
|
+
break;
|
|
441
|
+
case "Home":
|
|
442
|
+
o(this.getVisibleResourceIds()[0] ?? null);
|
|
443
|
+
break;
|
|
444
|
+
case "End":
|
|
445
|
+
o(this.getVisibleResourceIds().slice(-1)[0] ?? null);
|
|
446
|
+
break;
|
|
447
|
+
case "ArrowRight":
|
|
448
|
+
if (!t.isContainer) break;
|
|
449
|
+
n ? o(this.getFirstChildResource(t)?.id ?? null) : (e.preventDefault(), r());
|
|
450
|
+
break;
|
|
451
|
+
case "ArrowLeft":
|
|
452
|
+
t.isContainer && n ? (e.preventDefault(), this.focusResource(t.id, !1, !0).then(r)) : o(this.getParentResourceId(t));
|
|
453
|
+
break;
|
|
454
|
+
case "Enter":
|
|
455
|
+
case " ": e.preventDefault(), this.selectResource(t);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
336
458
|
renderSpecialIcon(e) {
|
|
337
|
-
return
|
|
459
|
+
return o`<icon-lucide-folder></icon-lucide-folder>`;
|
|
338
460
|
}
|
|
339
|
-
renderResourceItem(
|
|
340
|
-
let
|
|
341
|
-
return this.renderItem(
|
|
342
|
-
this.toggleContainer(
|
|
461
|
+
renderResourceItem(e, n = a.label(e.subject), r) {
|
|
462
|
+
let i = this.expandedContainers.has(e.id), c = e.isContainer && i ? this.renderResourceGroup(t(e.subject, this.resourceLogic)) : s, l = r ? this.renderSpecialIcon(r) : o`<icon-lucide-circle-small></icon-lucide-circle-small>`;
|
|
463
|
+
return this.renderItem(e, n, l, i, () => {
|
|
464
|
+
this.toggleContainer(e);
|
|
343
465
|
}, c, !!r);
|
|
344
466
|
}
|
|
345
467
|
renderResourceGroup(e) {
|
|
346
468
|
let t = Array.isArray(e) ? e : [...e.values()];
|
|
347
|
-
return
|
|
469
|
+
return t.length === 0 ? s : o`
|
|
348
470
|
<ul role="group" class="resource-group">
|
|
349
|
-
${
|
|
471
|
+
${u(t, (e) => e.id, (e) => this.renderResourceItem(e))}
|
|
350
472
|
</ul>
|
|
351
473
|
`;
|
|
352
474
|
}
|
|
353
475
|
renderTree() {
|
|
354
476
|
let e = this.getHomeResource();
|
|
355
|
-
if (!e) return
|
|
356
|
-
let t = [...this.resources.values()]
|
|
357
|
-
|
|
358
|
-
return n >= 0 ? t.splice(n, 1)[0] : null;
|
|
359
|
-
}, r = n("public"), i = n("trash");
|
|
360
|
-
return a`
|
|
477
|
+
if (!e) return s;
|
|
478
|
+
let t = [...this.resources.values()];
|
|
479
|
+
return o`
|
|
361
480
|
<ul role="tree" class="resource-tree" aria-label="Storage resources">
|
|
362
481
|
${this.renderItem(e, "Home", this.renderSpecialIcon("folder"), this.homeExpanded, () => {
|
|
363
482
|
this.homeExpanded = !this.homeExpanded;
|
|
364
483
|
}, this.renderResourceGroup(t), !0)}
|
|
365
|
-
${r ? this.renderResourceItem(r, "Public", "globe") : o}
|
|
366
|
-
${i ? this.renderResourceItem(i, "Trash", "trash") : o}
|
|
367
484
|
</ul>
|
|
368
485
|
`;
|
|
369
486
|
}
|
|
370
487
|
willUpdate(e) {
|
|
371
|
-
super.willUpdate(e),
|
|
488
|
+
if (super.willUpdate(e), this.pendingFocusResourceId && !this.isTreeFocused() && (this.pendingFocusResourceId = null), e.has("subject")) {
|
|
489
|
+
let t = this.isTreeFocused();
|
|
490
|
+
this.focusHomeOnUpdate = !!this.subject && (t || e.get("subject") === void 0), this.expandedContainers = /* @__PURE__ */ new Set(), this.homeExpanded = !0, this.activeResourceId = this.subject?.value ?? null;
|
|
491
|
+
}
|
|
492
|
+
(e.has("store") || e.has("subject") || e.has("resourceLogic")) && this.loadResources();
|
|
493
|
+
}
|
|
494
|
+
updated(e) {
|
|
495
|
+
if (super.updated(e), this.focusHomeOnUpdate) {
|
|
496
|
+
let e = this.renderRoot.querySelector("[role=\"treeitem\"]");
|
|
497
|
+
e && (this.focusHomeOnUpdate = !1, e.focus(), this.pendingFocusResourceId = null);
|
|
498
|
+
} else if (this.pendingFocusResourceId) {
|
|
499
|
+
let e = Array.from(this.renderRoot.querySelectorAll("[role=\"treeitem\"]")).find((e) => e.dataset.resourceId === this.pendingFocusResourceId);
|
|
500
|
+
e?.isConnected && e.focus(), this.pendingFocusResourceId = null;
|
|
501
|
+
}
|
|
372
502
|
}
|
|
373
503
|
render() {
|
|
374
|
-
return
|
|
504
|
+
return o`
|
|
375
505
|
<aside>
|
|
376
|
-
${this.expansionError ? a`<div class="folder-pane-sidebar-error" role="alert">${this.expansionError}</div>` : o}
|
|
377
506
|
${this.renderTree()}
|
|
378
507
|
</aside>
|
|
379
508
|
`;
|
|
380
509
|
}
|
|
381
|
-
}, {e: [
|
|
510
|
+
}, {e: [T, D, k, j, N, F, L, z, x], c: [$, S]} = J(f, [
|
|
382
511
|
[
|
|
383
|
-
|
|
512
|
+
w,
|
|
384
513
|
1,
|
|
385
514
|
"store"
|
|
386
515
|
],
|
|
387
516
|
[
|
|
388
|
-
|
|
517
|
+
E,
|
|
389
518
|
1,
|
|
390
519
|
"subject"
|
|
391
520
|
],
|
|
392
521
|
[
|
|
393
|
-
|
|
522
|
+
O,
|
|
394
523
|
1,
|
|
395
524
|
"resourceLogic"
|
|
396
525
|
],
|
|
397
526
|
[
|
|
398
|
-
|
|
527
|
+
A,
|
|
399
528
|
1,
|
|
400
529
|
"selectedResource"
|
|
401
530
|
],
|
|
402
531
|
[
|
|
403
|
-
|
|
532
|
+
M,
|
|
404
533
|
1,
|
|
405
534
|
"resources"
|
|
406
535
|
],
|
|
407
536
|
[
|
|
408
|
-
|
|
537
|
+
P,
|
|
409
538
|
1,
|
|
410
539
|
"expandedContainers"
|
|
411
540
|
],
|
|
412
541
|
[
|
|
413
|
-
|
|
542
|
+
I,
|
|
414
543
|
1,
|
|
415
544
|
"homeExpanded"
|
|
416
545
|
],
|
|
417
546
|
[
|
|
418
|
-
|
|
547
|
+
R,
|
|
419
548
|
1,
|
|
420
|
-
"
|
|
549
|
+
"activeResourceId"
|
|
421
550
|
]
|
|
422
|
-
],
|
|
551
|
+
], C, 0, void 0, r), f), d = class extends ee {
|
|
423
552
|
constructor() {
|
|
424
|
-
super($),
|
|
553
|
+
super($), q(this, "styles", e), S();
|
|
425
554
|
}
|
|
426
|
-
},
|
|
555
|
+
}, q(d, B, void 0), d)();
|
|
427
556
|
export { $ as default };
|
|
428
557
|
|
|
429
558
|
//# sourceMappingURL=FolderPaneSidebar.esm.js.map
|