folder-pane 4.0.1-1 → 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.
Files changed (110) hide show
  1. package/dist/_virtual/~icons/lucide/chevron-left.cjs.js +2 -0
  2. package/dist/_virtual/~icons/lucide/chevron-left.cjs.js.map +1 -0
  3. package/dist/_virtual/~icons/lucide/{trash-2.esm.js → chevron-left.esm.js} +4 -4
  4. package/dist/_virtual/~icons/lucide/chevron-left.esm.js.map +1 -0
  5. package/dist/accessCache.cjs.js +2 -0
  6. package/dist/accessCache.cjs.js.map +1 -0
  7. package/dist/accessCache.d.ts +37 -0
  8. package/dist/accessCache.d.ts.map +1 -0
  9. package/dist/accessCache.esm.js +34 -0
  10. package/dist/accessCache.esm.js.map +1 -0
  11. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +38 -35
  12. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
  13. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +19 -5
  14. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
  15. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +271 -197
  16. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
  17. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js +1 -1
  18. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js.map +1 -1
  19. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js +1 -1
  20. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js.map +1 -1
  21. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js +1 -1
  22. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js.map +1 -1
  23. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js +1 -1
  24. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js.map +1 -1
  25. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js +2 -0
  26. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js.map +1 -0
  27. package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts +16 -0
  28. package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts.map +1 -0
  29. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js +293 -0
  30. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js.map +1 -0
  31. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js +2 -0
  32. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js.map +1 -0
  33. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js +6 -0
  34. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js.map +1 -0
  35. package/dist/components/folder-pane-provider/index.cjs.js +1 -0
  36. package/dist/components/folder-pane-provider/index.d.ts +2 -0
  37. package/dist/components/folder-pane-provider/index.d.ts.map +1 -0
  38. package/dist/components/folder-pane-provider/index.esm.js +1 -0
  39. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js +18 -19
  40. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js.map +1 -1
  41. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts +15 -2
  42. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts.map +1 -1
  43. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js +237 -108
  44. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js.map +1 -1
  45. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js +1 -1
  46. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js.map +1 -1
  47. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js +1 -1
  48. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js.map +1 -1
  49. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js +32 -18
  50. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js.map +1 -1
  51. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts +13 -2
  52. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts.map +1 -1
  53. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js +191 -84
  54. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js.map +1 -1
  55. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js +1 -1
  56. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js.map +1 -1
  57. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js +1 -1
  58. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js.map +1 -1
  59. package/dist/components/folder-pane-view/FolderPaneView.cjs.js +90 -29
  60. package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
  61. package/dist/components/folder-pane-view/FolderPaneView.d.ts +35 -5
  62. package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
  63. package/dist/components/folder-pane-view/FolderPaneView.esm.js +495 -234
  64. package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
  65. package/dist/components/folder-pane-view/resourceLoad.cjs.js +2 -0
  66. package/dist/components/folder-pane-view/resourceLoad.cjs.js.map +1 -0
  67. package/dist/components/folder-pane-view/resourceLoad.d.ts +8 -0
  68. package/dist/components/folder-pane-view/resourceLoad.d.ts.map +1 -0
  69. package/dist/components/folder-pane-view/resourceLoad.esm.js +7 -0
  70. package/dist/components/folder-pane-view/resourceLoad.esm.js.map +1 -0
  71. package/dist/debug.cjs.js +2 -0
  72. package/dist/debug.cjs.js.map +1 -0
  73. package/dist/debug.d.ts +5 -0
  74. package/dist/debug.d.ts.map +1 -0
  75. package/dist/debug.esm.js +10 -0
  76. package/dist/debug.esm.js.map +1 -0
  77. package/dist/folderPane.cjs.js +2 -2
  78. package/dist/folderPane.cjs.js.map +1 -1
  79. package/dist/folderPane.d.ts +2 -2
  80. package/dist/folderPane.d.ts.map +1 -1
  81. package/dist/folderPane.esm.js +20 -19
  82. package/dist/folderPane.esm.js.map +1 -1
  83. package/dist/helpers.cjs.js +1 -1
  84. package/dist/helpers.cjs.js.map +1 -1
  85. package/dist/helpers.d.ts +12 -1
  86. package/dist/helpers.d.ts.map +1 -1
  87. package/dist/helpers.esm.js +34 -14
  88. package/dist/helpers.esm.js.map +1 -1
  89. package/dist/primitives/context.cjs.js +2 -0
  90. package/dist/primitives/context.cjs.js.map +1 -0
  91. package/dist/primitives/context.d.ts +14 -0
  92. package/dist/primitives/context.d.ts.map +1 -0
  93. package/dist/primitives/context.esm.js +6 -0
  94. package/dist/primitives/context.esm.js.map +1 -0
  95. package/dist/requestQueue.cjs.js +1 -1
  96. package/dist/requestQueue.cjs.js.map +1 -1
  97. package/dist/requestQueue.d.ts +10 -2
  98. package/dist/requestQueue.d.ts.map +1 -1
  99. package/dist/requestQueue.esm.js +32 -22
  100. package/dist/requestQueue.esm.js.map +1 -1
  101. package/dist/resourceActionItems.cjs.js +2 -0
  102. package/dist/resourceActionItems.cjs.js.map +1 -0
  103. package/dist/resourceActionItems.d.ts +20 -0
  104. package/dist/resourceActionItems.d.ts.map +1 -0
  105. package/dist/resourceActionItems.esm.js +42 -0
  106. package/dist/resourceActionItems.esm.js.map +1 -0
  107. package/package.json +12 -8
  108. package/dist/_virtual/~icons/lucide/trash-2.cjs.js +0 -2
  109. package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +0 -1
  110. package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +0 -1
@@ -1,23 +1,28 @@
1
- import { getIndexedApplicationSubject as e, getIndexedContainer as t, getPaneLabel as n, isAccessDeniedError as r, isContainerResource as i, isJavaScriptFile as a } from "../../helpers.esm.js";
1
+ import { resourceAccessCache as e } from "../../accessCache.esm.js";
2
2
  import "../folder-pane-container/index.esm.js";
3
3
  import "../folder-pane-sidebar/index.esm.js";
4
4
  import "../folder-pane-content/index.esm.js";
5
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";
6
+ import "../../_virtual/~icons/lucide/chevron-left.esm.js";
7
+ import { getIndexedApplicationSubject as t, getIndexedContainer as n, getPaneLabel as r, isAccessDeniedError as i, isContainerResource as a, isJavaScriptFile as o } from "../../helpers.esm.js";
8
+ import { invalidateRenderRequest as s, isCurrentRenderRequest as c } from "./renderRequest.esm.js";
9
+ import l from "../folder-pane-storage-header/FolderPaneCreateDialog.esm.js";
10
+ import { invalidCreationNameMessage as u, isSafeCreationName as d } from "../../creationSafety.esm.js";
11
+ import { PaneMintError as f, mintPaneInstance as p, setMintStatus as m } from "../../mintPaneInstance.esm.js";
12
+ import { error as h, warn as g } from "../../debug.esm.js";
13
+ import { clearFailedResource as _ } from "./resourceLoad.esm.js";
14
+ import { FILE_EXPLORER_BACK_EVENT as v, FILE_EXPLORER_OPEN_PANE_EVENT as y, WebComponent as b, aclControl as x, composeExplorer as S, customElement as C, getPreferredPane as w, getRelevantPanes as T, isExplorerEvent as E, log as D, ns as O, preparePaneMenuItems as k, showDialog as A, widgets as j } from "solid-ui";
15
+ import { authSession as M, authn as N } from "solid-logic";
16
+ import { html as P, nothing as ee } from "lit";
17
+ import { property as F, query as I, state as L } from "lit/decorators.js";
18
+ import "solid-ui/components/button";
14
19
  import "solid-ui/components/file-explorer-provider";
15
20
  import "solid-ui/components/error-state";
16
21
  import "solid-ui/components/file-explorer-header";
17
22
  // 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;
23
+ var te, ne, re, ie, ae, oe, se, ce, le, ue, de, fe, pe, me, he, ge, _e, ve, ye, be, xe, Se, Ce, we, Te, Ee, De, Oe, ke, Ae, je, Me, Ne, Pe, Fe, Ie, Le, Re, ze;
19
24
  function R(e, t, n) {
20
- return (t = De(t)) in e ? Object.defineProperty(e, t, {
25
+ return (t = Ue(t)) in e ? Object.defineProperty(e, t, {
21
26
  value: n,
22
27
  enumerable: !0,
23
28
  configurable: !0,
@@ -25,22 +30,22 @@ function R(e, t, n) {
25
30
  }) : e[t] = n, e;
26
31
  }
27
32
  function z(e, t, n) {
28
- we(e, t), t.set(e, n);
33
+ Be(e, t), t.set(e, n);
29
34
  }
30
- function we(e, t) {
35
+ function Be(e, t) {
31
36
  if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
32
37
  }
33
38
  function B(e, t, n) {
34
- return e.set(Te(e, t), n), n;
39
+ return e.set(Ve(e, t), n), n;
35
40
  }
36
41
  function V(e, t) {
37
- return e.get(Te(e, t));
42
+ return e.get(Ve(e, t));
38
43
  }
39
- function Te(e, t, n) {
44
+ function Ve(e, t, n) {
40
45
  if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
41
46
  throw TypeError("Private element is not present on this object");
42
47
  }
43
- function Ee(e, t, n, r, i, a) {
48
+ function He(e, t, n, r, i, a) {
44
49
  function o(e, t, n) {
45
50
  return function(r, i) {
46
51
  return n && n(r), e[t].call(r, i);
@@ -63,13 +68,13 @@ function Ee(e, t, n, r, i, a) {
63
68
  n || Array.isArray(_) || (_ = [_]);
64
69
  var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
65
70
  d ? (f || p ? b = {
66
- get: ke(function() {
71
+ get: Ge(function() {
67
72
  return v(this);
68
73
  }, r, "get"),
69
74
  set: function(e) {
70
75
  t[4](this, e);
71
76
  }
72
- } : b[S] = v, f || ke(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
77
+ } : b[S] = v, f || Ge(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
73
78
  }
74
79
  for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
75
80
  var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
@@ -129,7 +134,7 @@ function Ee(e, t, n, r, i, a) {
129
134
  if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
130
135
  var f = Object.create(d ?? null), p = function(e, t, n, r) {
131
136
  var i, a, o = [], c = function(t) {
132
- return Ae(t) === e;
137
+ return Ke(t) === e;
133
138
  }, u = /* @__PURE__ */ new Map();
134
139
  function d(e) {
135
140
  e && o.push(s.bind(null, e));
@@ -143,7 +148,7 @@ function Ee(e, t, n, r, i, a) {
143
148
  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
149
  u.set(b, !(m > 2) || m);
145
150
  }
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);
151
+ l(v ? e : e.prototype, p, _, g ? "#" + h : Ue(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
147
152
  }
148
153
  }
149
154
  return d(i), d(a), o;
@@ -156,11 +161,11 @@ function Ee(e, t, n, r, i, a) {
156
161
  }
157
162
  };
158
163
  }
159
- function De(e) {
160
- var t = Oe(e, "string");
164
+ function Ue(e) {
165
+ var t = We(e, "string");
161
166
  return typeof t == "symbol" ? t : t + "";
162
167
  }
163
- function Oe(e, t) {
168
+ function We(e, t) {
164
169
  if (typeof e != "object" || !e) return e;
165
170
  var n;
166
171
  if (typeof Symbol < "u" && (n = e[Symbol.toPrimitive]) !== void 0) {
@@ -170,7 +175,7 @@ function Oe(e, t) {
170
175
  }
171
176
  return (t === "string" ? String : Number)(e);
172
177
  }
173
- function ke(e, t, n) {
178
+ function Ge(e, t, n) {
174
179
  typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
175
180
  try {
176
181
  Object.defineProperty(e, "name", {
@@ -180,100 +185,113 @@ function ke(e, t, n) {
180
185
  } catch {}
181
186
  return e;
182
187
  }
183
- function Ae(e) {
188
+ function Ke(e) {
184
189
  if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
185
190
  return e;
186
191
  }
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({
192
+ function H(e, t) {
193
+ if (!Number.isFinite(t) || t <= 320) return 256;
194
+ let n = t - 320;
195
+ return n < 180 ? 256 : Math.min(480, n, Math.max(180, Number.isFinite(e) ? e : 256));
196
+ }
197
+ ie = [C("folder-pane-view")];
198
+ var qe, 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(), Je = /*#__PURE__*/ new WeakMap(), Ye = /*#__PURE__*/ new WeakMap(), Xe = /*#__PURE__*/ new WeakMap(), Ze = /*#__PURE__*/ new WeakMap(), Qe = /*#__PURE__*/ new WeakMap(), $e = /*#__PURE__*/ new WeakMap(), $ = /*#__PURE__*/ new WeakMap();
199
+ ze = (ae = F({ attribute: !1 }), se = F({ attribute: !1 }), le = F({
190
200
  type: Boolean,
191
201
  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();
202
+ }), de = L(), pe = L(), he = L(), _e = L(), ye = L(), xe = L(), Ce = L(), Te = L(), De = L(), ke = L(), je = I("folder-pane-content"), Ne = I(".folder-pane-full-view"), Fe = I("folder-pane-sidebar"), Le = I(".folder-pane-status"), "browserContext"), te = class extends b {
203
+ constructor(...t) {
204
+ super(...t), z(this, U, (ne(this), oe(this, void 0))), z(this, W, ce(this, void 0)), z(this, G, ue(this, !1)), z(this, K, fe(this, void 0)), z(this, q, me(this, void 0)), z(this, J, ge(this, "grid")), z(this, Y, ve(this, "")), z(this, X, be(this, !1)), z(this, Z, Se(this, 256)), z(this, Q, we(this, 480)), z(this, Je, Ee(this, void 0)), z(this, Ye, Oe(this, !1)), z(this, Xe, Ae(this, !1)), R(this, "initialLoadGeneration", 0), R(this, "renderGeneration", 0), R(this, "permissionGeneration", 0), R(this, "permissionRequest", void 0), R(this, "creationInFlight", !1), R(this, "authListenersAttached", !1), R(this, "dropProtectionAttached", !1), R(this, "sidebarResizeObserver", void 0), R(this, "responsiveLayoutInitialized", !1), R(this, "sidebarDrag", void 0), z(this, Ze, Me(this, null)), z(this, Qe, Pe(this, null)), z(this, $e, Ie(this, null)), z(this, $, Re(this, null)), R(this, "handleAuthChange", () => {
205
+ e.clear(), this.refreshCreationPermission(!0), this.requestUpdate();
199
206
  }), R(this, "handleCreatePane", async (e) => {
200
- if (e.stopPropagation(), this.creationInFlight || !D.currentUser()) return;
207
+ if (e.stopPropagation(), this.creationInFlight || !N.currentUser()) return;
201
208
  let t = e.detail?.pane;
202
209
  if (!t?.mintNew) return;
203
- let r = this.getActiveContainer(), i = this.ownerDocument, a = this.statusArea;
204
- if (!r || !a) return;
210
+ let n = this.getActiveContainer(), i = this.ownerDocument, a = this.statusArea;
211
+ if (!n || !a) return;
205
212
  this.creationInFlight = !0;
206
- let o = ++this.renderGeneration, s = n(t);
213
+ let o = ++this.renderGeneration, s = r(t);
207
214
  try {
208
215
  let e = await new Promise((e) => {
209
- w(u, {
216
+ A(l, {
210
217
  props: { label: s },
211
218
  onClose: e
212
219
  });
213
220
  });
214
- if (!e || !D.currentUser() || o !== this.renderGeneration || this.getActiveContainer()?.sameTerm(r) !== !0) return;
215
- if (!l(e)) {
216
- p(a, "error", c);
221
+ if (!e || !N.currentUser() || o !== this.renderGeneration || this.getActiveContainer()?.sameTerm(n) !== !0) return;
222
+ if (!d(e)) {
223
+ m(a, "error", u);
217
224
  return;
218
225
  }
219
226
  this.clearContentForCreation();
220
- let n = await f({
227
+ let r = await p({
221
228
  context: this.browserContext,
222
- container: r,
229
+ container: n,
223
230
  pane: t,
224
231
  name: e,
225
232
  noun: s,
226
233
  statusArea: a,
227
- me: D.currentUser() ?? void 0,
234
+ me: N.currentUser() ?? void 0,
228
235
  dom: i
229
- }), d = o === this.renderGeneration && this.getActiveContainer()?.sameTerm(r) === !0;
236
+ }), c = o === this.renderGeneration && this.getActiveContainer()?.sameTerm(n) === !0;
230
237
  await this.showCreatedResource({
231
- container: r,
232
- ...n,
238
+ container: n,
239
+ ...r,
233
240
  pane: t,
234
- newInstance: d ? n.newInstance : void 0
241
+ newInstance: c ? r.newInstance : void 0
235
242
  });
236
243
  } 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)}`);
244
+ h("Unable to create folder-pane resource", e), !(e instanceof f) && this.statusArea && m(this.statusArea, "error", `Unable to create ${s}: ${e instanceof Error ? e.message : String(e)}`);
238
245
  } finally {
239
246
  this.creationInFlight = !1;
240
247
  }
241
248
  }), R(this, "handleUpload", (e) => {
242
- if (e.stopPropagation(), this.creationInFlight || !D.currentUser()) return;
249
+ if (e.stopPropagation(), this.creationInFlight || !N.currentUser()) return;
243
250
  let t = this.getActiveContainer(), n = this.statusArea;
244
251
  if (!t || !n || !this.store) return;
245
252
  let r = this.ownerDocument.createElement("input");
246
253
  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;
254
+ let e = Array.from(r.files ?? []), i = e.filter((e) => d(e.name));
255
+ if (e.filter((e) => !d(e.name)).forEach((e) => m(n, "error", `${e.name}: ${u}`)), !i.length) return;
249
256
  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());
257
+ let a = this.renderGeneration, o = this.browserContext, s = i.length, c = Promise.resolve();
258
+ m(n, "progress", `Uploading ${i.length} file${i.length === 1 ? "" : "s"}`);
259
+ let l = () => {
260
+ s--, s === 0 && (this.creationInFlight = !1, n.dataset.status === "progress" && n.replaceChildren());
254
261
  };
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);
262
+ j.uploadFiles(this.store.fetcher, i, t.uri, t.uri, (e, n) => {
263
+ c = c.then(() => {
264
+ let e = this.renderGeneration === a && this.browserContext === o;
265
+ return this.showCreatedResource({
266
+ container: t,
267
+ containedResource: this.store.sym(n),
268
+ newInstance: i.length === 1 && e ? this.store.sym(n) : void 0
269
+ });
270
+ }).finally(l);
260
271
  }, (e, t) => {
261
- p(n, "error", t), s();
272
+ m(n, "error", t), l();
262
273
  });
263
274
  }), r.click();
264
275
  }), R(this, "clearContentError", () => {
265
276
  this.contentError = void 0;
266
277
  }), R(this, "retryContent", () => {
267
- let e = this.selectedResource, t = this.subject;
268
- (e || t) && (this.clearContentError(), e ? this.showResourceInContentView(e) : t && this.showInitialContainer(t));
278
+ let e = this.contentError?.retry;
279
+ if (e) {
280
+ this.clearContentError(), e();
281
+ return;
282
+ }
283
+ let t = this.selectedResource, n = this.subject;
284
+ (t || n) && (this.clearContentError(), t ? this.showResourceInContentView(t, void 0, !1, !0) : n && (this.store && _(this.store.fetcher, n), this.showInitialContainer(n)));
269
285
  }), R(this, "handleResourceSelected", (e) => {
270
286
  let t = e.detail?.resource;
271
287
  t && (e.stopPropagation(), this.searchQuery = "", this.showSubject(t));
272
288
  }), R(this, "handleResourceOpenPane", (e) => {
273
289
  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));
290
+ t && r && (e.stopPropagation(), this.searchQuery = "", r.name === "folder" ? this.showSubject(t, r) : this.showSubject(t, typeof r?.render == "function" ? r : void 0));
275
291
  }), R(this, "handleSelectHome", () => {
276
- this.searchQuery = "", this.subject && this.showSubject(this.subject);
292
+ this.searchQuery = "";
293
+ let e = this.subject && this.standaloneBreadcrumbRoot?.sameTerm(this.subject) ? this.subject : this.standaloneBreadcrumbRoot;
294
+ e && this.showSubject(e);
277
295
  }), R(this, "handleSearch", (e) => {
278
296
  e.stopPropagation(), this.searchQuery = e.detail?.query || "";
279
297
  let t = this.resourceTarget?.querySelector("folder-pane-container");
@@ -284,36 +302,81 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
284
302
  }), R(this, "handleContainerViewChange", (e) => {
285
303
  let t = e.detail?.view;
286
304
  t && (e.stopPropagation(), this.setContainerView(t));
305
+ }), R(this, "updateSidebarBounds", () => {
306
+ this.isConnected && (this.sidebarMaximumWidth = H(480, this.sidebarAvailableWidth), this.resizeSidebar(this.sidebarWidth));
307
+ }), R(this, "handleSidebarPointerDown", (e) => {
308
+ if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag || e.button !== 0 || !e.isPrimary) return;
309
+ e.preventDefault();
310
+ let t = e.currentTarget;
311
+ t.setPointerCapture(e.pointerId), t.focus(), this.sidebarDrag = {
312
+ separator: t,
313
+ pointerId: e.pointerId,
314
+ startX: e.clientX,
315
+ startWidth: this.sidebarWidth
316
+ }, this.requestUpdate();
317
+ }), R(this, "handleSidebarPointerMove", (e) => {
318
+ let t = this.sidebarDrag;
319
+ this.isConnected && !this.sidebarCollapsed && t && t.pointerId === e.pointerId && this.resizeSidebar(t.startWidth + e.clientX - t.startX);
320
+ }), R(this, "handleSidebarPointerEnd", (e) => {
321
+ this.sidebarDrag?.pointerId === e.pointerId && this.finishSidebarResize();
322
+ }), R(this, "handleSidebarResizeKey", (e) => {
323
+ if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag || e.altKey || e.ctrlKey || e.metaKey) return;
324
+ let t;
325
+ switch (e.key) {
326
+ case "ArrowLeft":
327
+ t = this.sidebarWidth - 16;
328
+ break;
329
+ case "ArrowRight":
330
+ t = this.sidebarWidth + 16;
331
+ break;
332
+ case "Home":
333
+ t = 180;
334
+ break;
335
+ case "End":
336
+ t = 480;
337
+ break;
338
+ default: return;
339
+ }
340
+ e.preventDefault(), e.stopPropagation(), this.resizeSidebar(t);
341
+ }), R(this, "handleSidebarToggle", async (e) => {
342
+ e.stopPropagation();
343
+ let t = this.sidebar, n = this.renderRoot.querySelector(".folder-pane-sidebar-resize-handle"), r = !!t && (t.matches(":focus-within") || t.shadowRoot?.activeElement != null), i = n === this.ownerDocument.activeElement;
344
+ this.finishSidebarResize(), this.sidebarCollapsed = !this.sidebarCollapsed, this.sidebarCollapsed && (r || i) && (await this.updateComplete, this.renderRoot.querySelector(".folder-pane-sidebar-toggle")?.focus());
345
+ }), R(this, "handleFolderPaneResourceError", (e) => {
346
+ e.stopPropagation();
347
+ let t = e.detail?.title || "Unable to load this folder", n = e.detail?.message || "The folder could not be loaded. Try again.";
348
+ this.showContentError({
349
+ title: t,
350
+ message: n,
351
+ retry: e.detail?.retry
352
+ }, !1);
287
353
  });
288
354
  }
289
- get [L]() {
290
- return V(H, this);
355
+ get [ze]() {
356
+ return V(U, this);
291
357
  }
292
358
  set browserContext(e) {
293
- B(H, this, e);
359
+ B(U, this, e);
294
360
  }
295
361
  get store() {
296
362
  return this.browserContext?.session.store;
297
363
  }
298
364
  get subject() {
299
- return V(U, this);
365
+ return V(W, this);
300
366
  }
301
367
  set subject(e) {
302
- B(U, this, e);
368
+ B(W, this, e);
303
369
  }
304
370
  get resourceLogic() {
305
371
  return this.browserContext?.session.logic.resource;
306
372
  }
307
- get fullView() {
308
- return V(W, this);
373
+ get displayedResource() {
374
+ return this.selectedResource ?? this.subject;
309
375
  }
310
- set fullView(e) {
311
- B(W, this, e);
312
- }
313
- get hideStorageHeader() {
376
+ get fullView() {
314
377
  return V(G, this);
315
378
  }
316
- set hideStorageHeader(e) {
379
+ set fullView(e) {
317
380
  B(G, this, e);
318
381
  }
319
382
  get selectedResource() {
@@ -322,42 +385,78 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
322
385
  set selectedResource(e) {
323
386
  B(K, this, e);
324
387
  }
325
- get containerView() {
388
+ get standaloneBreadcrumbRoot() {
326
389
  return V(q, this);
327
390
  }
328
- set containerView(e) {
391
+ set standaloneBreadcrumbRoot(e) {
329
392
  B(q, this, e);
330
393
  }
331
- get searchQuery() {
394
+ get containerView() {
332
395
  return V(J, this);
333
396
  }
334
- set searchQuery(e) {
397
+ set containerView(e) {
335
398
  B(J, this, e);
336
399
  }
337
- get contentError() {
400
+ get searchQuery() {
338
401
  return V(Y, this);
339
402
  }
340
- set contentError(e) {
403
+ set searchQuery(e) {
341
404
  B(Y, this, e);
342
405
  }
343
- get contentView() {
406
+ get sidebarCollapsed() {
344
407
  return V(X, this);
345
408
  }
346
- set contentView(e) {
409
+ set sidebarCollapsed(e) {
347
410
  B(X, this, e);
348
411
  }
349
- get fullViewTarget() {
412
+ get sidebarWidth() {
350
413
  return V(Z, this);
351
414
  }
352
- set fullViewTarget(e) {
415
+ set sidebarWidth(e) {
353
416
  B(Z, this, e);
354
417
  }
355
- get sidebar() {
418
+ get sidebarMaximumWidth() {
356
419
  return V(Q, this);
357
420
  }
358
- set sidebar(e) {
421
+ set sidebarMaximumWidth(e) {
359
422
  B(Q, this, e);
360
423
  }
424
+ get contentError() {
425
+ return V(Je, this);
426
+ }
427
+ set contentError(e) {
428
+ B(Je, this, e);
429
+ }
430
+ get showingContainer() {
431
+ return V(Ye, this);
432
+ }
433
+ set showingContainer(e) {
434
+ B(Ye, this, e);
435
+ }
436
+ get canCreate() {
437
+ return V(Xe, this);
438
+ }
439
+ set canCreate(e) {
440
+ B(Xe, this, e);
441
+ }
442
+ get contentView() {
443
+ return V(Ze, this);
444
+ }
445
+ set contentView(e) {
446
+ B(Ze, this, e);
447
+ }
448
+ get fullViewTarget() {
449
+ return V(Qe, this);
450
+ }
451
+ set fullViewTarget(e) {
452
+ B(Qe, this, e);
453
+ }
454
+ get sidebar() {
455
+ return V($e, this);
456
+ }
457
+ set sidebar(e) {
458
+ B($e, this, e);
459
+ }
361
460
  get statusArea() {
362
461
  return V($, this);
363
462
  }
@@ -368,19 +467,40 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
368
467
  return this;
369
468
  }
370
469
  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);
470
+ super.connectedCallback();
471
+ let e = this.querySelector(".folder-pane-main-content");
472
+ e && this.sidebarResizeObserver?.observe(e), this.dropProtectionAttached ||= (x.preventBrowserDropEvents(this.ownerDocument), !0), this.addEventListener("folder-pane-create-pane", this.handleCreatePane), this.addEventListener("folder-pane-upload", this.handleUpload), this.addEventListener("resource-open-pane", this.handleResourceOpenPane), this.authListenersAttached ||= (M.events.on("login", this.handleAuthChange), M.events.on("logout", this.handleAuthChange), !0);
372
473
  }
373
474
  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();
475
+ this.finishSidebarResize(), this.sidebarResizeObserver?.disconnect(), this.renderGeneration = s(this.renderGeneration), this.initialLoadGeneration++, this.removeEventListener("folder-pane-create-pane", this.handleCreatePane), this.removeEventListener("folder-pane-upload", this.handleUpload), this.removeEventListener("resource-open-pane", this.handleResourceOpenPane), this.authListenersAttached &&= (M.events.off("login", this.handleAuthChange), M.events.off("logout", this.handleAuthChange), !1), super.disconnectedCallback();
476
+ }
477
+ firstUpdated() {
478
+ if (this.updateSidebarBounds(), typeof ResizeObserver < "u") {
479
+ this.sidebarResizeObserver = new ResizeObserver((e) => {
480
+ this.updateSidebarBounds();
481
+ let t = e[0]?.contentRect.width ?? 0;
482
+ this.responsiveLayoutInitialized || t <= 0 || (this.responsiveLayoutInitialized = !0, t < 768 && this.handleSidebarToggle(new Event("folder-pane-responsive-collapse")));
483
+ });
484
+ let e = this.querySelector(".folder-pane-main-content");
485
+ e && this.sidebarResizeObserver.observe(e), this.sidebarResizeObserver.observe(this);
486
+ }
375
487
  }
376
488
  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));
489
+ (e.has("subject") || e.has("browserContext")) && this.subject ? (this.standaloneBreadcrumbRoot = this.fullView ? this.getStandaloneBreadcrumbRoot(this.subject) : this.subject, (e.has("subject") || e.has("browserContext")) && (this.selectedResource = void 0, this.renderGeneration++, this.initialLoadGeneration++), this.refreshCreationPermission(), this.showInitialContainer(this.subject)) : (e.has("selectedResource") && this.refreshCreationPermission(), e.has("fullView") && e.get("fullView") !== void 0 && (this.subject && (this.standaloneBreadcrumbRoot = this.fullView ? this.getStandaloneBreadcrumbRoot(this.subject) : this.subject), this.selectedResource ? this.showResourceInContentView(this.selectedResource) : this.subject && this.renderContainerView(this.subject)));
490
+ }
491
+ getStandaloneBreadcrumbRoot(e) {
492
+ try {
493
+ let t = new URL(e.uri), n = t.pathname.split("/").filter(Boolean);
494
+ return n.length <= 1 ? e : this.store?.sym(`${t.origin}/${n[0]}/`) ?? e;
495
+ } catch {
496
+ return e;
497
+ }
378
498
  }
379
499
  get resourceTarget() {
380
500
  return this.fullView ? this.fullViewTarget : this.contentView;
381
501
  }
382
- showContentError(e) {
383
- this.resourceTarget?.replaceChildren(), this.contentError = e;
502
+ showContentError(e, t = !0) {
503
+ t && this.resourceTarget?.replaceChildren(), this.contentError = e;
384
504
  }
385
505
  renderAccessDeniedScreen() {
386
506
  this.showContentError({
@@ -388,6 +508,21 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
388
508
  message: "You do not have access to the contents of this container."
389
509
  });
390
510
  }
511
+ async loadResource(e, t = !1) {
512
+ let n = this.store;
513
+ if (!n) return;
514
+ let r = n.fetcher;
515
+ t && _(r, e);
516
+ try {
517
+ await r.load(e);
518
+ } catch (n) {
519
+ if (!t || !i(n) || !N.currentUser()) throw n;
520
+ await r.load(e, {
521
+ force: !0,
522
+ clearPreviousData: !0
523
+ });
524
+ }
525
+ }
391
526
  openCreatedResource(e, t) {
392
527
  this.searchQuery = "";
393
528
  let n = t?.name ? this.browserContext?.session.paneRegistry.byName(t.name) ?? t : t;
@@ -395,10 +530,23 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
395
530
  }
396
531
  getActiveContainer() {
397
532
  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}/`;
533
+ if (e && this.resourceLogic && a(e, this.resourceLogic)) return e;
534
+ let t = this.fullView ? this.standaloneBreadcrumbRoot : this.subject, n = e?.dir(), r = t?.uri.endsWith("/") ? t.uri : `${t?.uri}/`;
400
535
  return t && n && r && n.uri.startsWith(r) ? n : this.subject;
401
536
  }
537
+ refreshCreationPermission(e = !1) {
538
+ let t = this.getActiveContainer(), n = this.browserContext?.session.logic.resource;
539
+ if (!e && t && n && this.permissionRequest?.containerUri === t.uri && this.permissionRequest.resourceLogic === n) return;
540
+ let r = ++this.permissionGeneration;
541
+ this.canCreate = !1, this.permissionRequest = t && n ? {
542
+ containerUri: t.uri,
543
+ resourceLogic: n
544
+ } : void 0, t && n && n.fetchMetadata(t).then((e) => {
545
+ r === this.permissionGeneration && this.getActiveContainer()?.sameTerm(t) === !0 && (this.canCreate = e.access.canEdit);
546
+ }).catch((e) => {
547
+ r === this.permissionGeneration && (this.permissionRequest = void 0, g("Unable to determine folder creation permission", e));
548
+ });
549
+ }
402
550
  clearContentForCreation() {
403
551
  this.resourceTarget?.replaceChildren();
404
552
  }
@@ -412,12 +560,12 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
412
560
  clearPreviousData: !0
413
561
  }), !0;
414
562
  } catch (t) {
415
- return S.warn("Unable to reload " + e.uri + ": " + t), !1;
563
+ return D.warn("Unable to reload " + e.uri + ": " + t), !1;
416
564
  }
417
565
  }, c = await s(e);
418
566
  if (t.uri.endsWith("/")) {
419
567
  await s(t);
420
- let e = i.each(t, C.ldp("contains"), void 0, t.doc());
568
+ let e = i.each(t, O.ldp("contains"), void 0, t.doc());
421
569
  for (let t of e) t.termType === "NamedNode" && i.fetcher.getState(t.value) === "failed" && i.fetcher.unload(t);
422
570
  }
423
571
  this.sidebar?.refreshResources?.(e);
@@ -429,45 +577,37 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
429
577
  if (!t) return;
430
578
  this.contentError = void 0;
431
579
  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);
580
+ n.subject = e, n.resourceLogic = this.resourceLogic ?? null, n.browserContext = this.browserContext, n.view = this.containerView, n.searchQuery = this.searchQuery, this.showingContainer = !0, t.replaceChildren(n);
433
581
  }
434
582
  async showInitialContainer(e) {
435
583
  let t = ++this.initialLoadGeneration;
436
- if (a(e)) this.showSubject(e);
584
+ if (o(e)) this.showSubject(e);
437
585
  else if (this.store && this.resourceLogic) {
438
586
  try {
439
- await this.store.fetcher.load(e);
587
+ await this.loadResource(e);
440
588
  } catch (n) {
441
589
  if (t !== this.initialLoadGeneration || !this.subject?.sameTerm(e)) return;
442
- if (r(n)) {
590
+ if (i(n)) {
443
591
  this.resourceTarget && this.renderAccessDeniedScreen();
444
592
  return;
445
593
  }
446
- S.error("Unable to load storage container: " + n), this.showContentError({
594
+ D.error("Unable to load storage container: " + n), this.showContentError({
447
595
  title: "Unable to load this folder",
448
596
  message: "The folder could not be loaded. Try again."
449
597
  });
450
598
  return;
451
599
  }
452
- t === this.initialLoadGeneration && this.subject?.sameTerm(e) && (this.sidebar?.refreshResources?.(), this.selectedResource || this.showSubject(e));
600
+ t === this.initialLoadGeneration && this.subject?.sameTerm(e) && (this.sidebar?.refreshResources?.(), this.requestUpdate(), this.selectedResource || this.showSubject(e));
453
601
  }
454
602
  }
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
603
  async renderExplorerInto(e, t, n, r = {}) {
464
604
  if (!this.browserContext) return;
465
- let i = await b(t, this.browserContext, {
605
+ let i = await T(t, this.browserContext, {
466
606
  excludedPaneNames: ["sharing"],
467
607
  fallbackPaneName: "internal"
468
608
  });
469
609
  if (r.isCurrent && !r.isCurrent()) return;
470
- let a = n || this.getPaneForSubject(t, i);
610
+ let a = n || w(t, this.browserContext, i);
471
611
  if (!a) {
472
612
  this.renderExplorerError(t, "No pane is available to display this resource.");
473
613
  return;
@@ -476,29 +616,31 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
476
616
  try {
477
617
  o = a.render(t, this.browserContext, r.paneOptions || {});
478
618
  } catch (e) {
479
- S.error("Unable to render selected pane: " + e), this.renderExplorerError(t, "The selected pane could not render this resource.");
619
+ D.error("Unable to render selected pane: " + e), this.renderExplorerError(t, "The selected pane could not render this resource.");
480
620
  return;
481
621
  }
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;
622
+ let s = e.ownerDocument.createElement("solid-ui-file-explorer-provider"), l = await k({
623
+ subject: t,
624
+ context: this.browserContext,
625
+ panes: i,
626
+ openPane: (e, t) => {
627
+ s.dispatchEvent(new CustomEvent(y, {
628
+ bubbles: !0,
629
+ composed: !0,
630
+ detail: {
631
+ subjectUri: e.uri,
632
+ paneName: t
633
+ }
634
+ }));
635
+ }
636
+ });
637
+ s.addEventListener(v, (e) => {
638
+ if (!E(e, s)) return;
639
+ e.stopPropagation();
640
+ let n = this.getActiveContainer() || this.subject || t;
641
+ this.renderGeneration++, this.selectedResource = n, this.renderContainerView(n);
642
+ }), s.addEventListener(y, (n) => {
643
+ if (!E(n, s)) return;
502
644
  n.stopPropagation();
503
645
  let i = n.detail?.paneName, a = i ? this.browserContext?.session.paneRegistry.byName(i) : void 0;
504
646
  if (a) {
@@ -509,12 +651,17 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
509
651
  };
510
652
  this.renderExplorerInto(e, t, a, {
511
653
  ...r,
512
- isCurrent: () => s(n, this.renderGeneration, this.selectedResource?.uri, this.browserContext)
654
+ paneOptions: a.name === "folder" ? {
655
+ folderView: "container",
656
+ fullView: !0,
657
+ solo: !0
658
+ } : r.paneOptions,
659
+ isCurrent: () => c(n, this.renderGeneration, this.selectedResource?.uri, this.browserContext)
513
660
  }).catch((e) => {
514
- S.error("Unable to switch selected pane: " + e);
661
+ D.error("Unable to switch selected pane: " + e);
515
662
  });
516
663
  }
517
- }), v(c, {
664
+ }), S(s, {
518
665
  context: this.browserContext,
519
666
  subjectUri: t.uri,
520
667
  pane: a,
@@ -524,7 +671,7 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
524
671
  menuItems: l
525
672
  },
526
673
  paneElement: o
527
- }), (!r.isCurrent || r.isCurrent()) && (this.contentError = void 0, e.replaceChildren(c));
674
+ }), (!r.isCurrent || r.isCurrent()) && (this.contentError = void 0, this.showingContainer = !1, e.replaceChildren(s));
528
675
  }
529
676
  renderExplorerError(e, t) {
530
677
  this.showContentError({
@@ -532,134 +679,223 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
532
679
  message: e.uri
533
680
  });
534
681
  }
535
- async showResourceInContentView(t, n, o = !1) {
536
- let c = ++this.renderGeneration;
682
+ async showResourceInContentView(e, n, r = !1, s = !1) {
683
+ let l = ++this.renderGeneration;
537
684
  try {
538
- let l = this.resourceTarget;
539
- if (!l || !this.store || !this.resourceLogic) return;
540
- let u = {
541
- generation: c,
542
- subjectUri: t.uri,
685
+ let u = this.resourceTarget, d = this.browserContext;
686
+ if (!u || !this.store || !this.resourceLogic || !d) return;
687
+ let f = {
688
+ generation: l,
689
+ subjectUri: e.uri,
543
690
  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);
691
+ }, p = (e) => c(f, this.renderGeneration, this.selectedResource?.uri, this.browserContext) && e.uri === f.subjectUri;
692
+ if (!p(e)) return;
693
+ if (this.subject?.sameTerm(e) && !n && !r && a(e, this.resourceLogic)) {
694
+ this.renderContainerView(e);
548
695
  return;
549
696
  }
550
- if (i(t, this.resourceLogic)) {
697
+ if (a(e, this.resourceLogic) && (n?.name !== "source" || r)) {
551
698
  try {
552
- await this.store.fetcher.load(t);
553
- } catch (e) {
554
- if (!d(t)) return;
555
- if (r(e)) {
699
+ await this.loadResource(e, s);
700
+ } catch (t) {
701
+ if (!p(e)) return;
702
+ if (i(t)) {
556
703
  this.renderAccessDeniedScreen();
557
704
  return;
558
705
  }
559
- S.error("Unable to load selected container: " + e), this.showContentError({
706
+ D.error("Unable to load selected container: " + t), this.showContentError({
560
707
  title: "Unable to load this folder",
561
708
  message: "The folder could not be loaded. Try again."
562
709
  });
563
710
  return;
564
711
  }
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));
712
+ if (!p(e)) return;
713
+ if (this.sidebar?.refreshResources?.(), n?.name === "folder") {
714
+ this.renderContainerView(e);
715
+ return;
716
+ }
717
+ if (n?.name !== "sharing" && (r || this.resourceLogic.containerHasIndexDocument(e))) {
718
+ let r = this.store.sym(t(e, n?.name));
568
719
  try {
569
- await this.store.fetcher.load(i.doc());
570
- } catch (e) {
571
- if (!d(t)) return;
572
- if (r(e)) {
720
+ await this.loadResource(r.doc(), s);
721
+ } catch (t) {
722
+ if (!p(e)) return;
723
+ if (i(t)) {
573
724
  this.renderAccessDeniedScreen();
574
725
  return;
575
726
  }
576
- S.error("Unable to load container index document: " + e);
727
+ D.error("Unable to load container index document: " + t);
577
728
  }
578
- await this.renderExplorerInto(l, i, n, {
579
- isCurrent: () => d(t),
729
+ await this.renderExplorerInto(u, r, n, {
730
+ isCurrent: () => p(e),
731
+ showHeader: !1
732
+ });
733
+ return;
734
+ }
735
+ let a = await T(e, d, {
736
+ excludedPaneNames: ["sharing"],
737
+ fallbackPaneName: "internal"
738
+ });
739
+ if (!p(e)) return;
740
+ let o = n || w(e, d, a);
741
+ if (o?.name !== "folder") {
742
+ await this.renderExplorerInto(u, e, o, {
743
+ isCurrent: () => p(e),
580
744
  showHeader: !1
581
745
  });
582
746
  return;
583
747
  }
584
- this.renderContainerView(t);
748
+ this.renderContainerView(e);
585
749
  return;
586
750
  }
587
751
  try {
588
- await this.store.fetcher.load(t);
589
- } catch (e) {
590
- if (!d(t)) return;
591
- if (r(e)) {
752
+ await this.loadResource(e, s);
753
+ } catch (t) {
754
+ if (!p(e)) return;
755
+ if (i(t)) {
592
756
  this.renderAccessDeniedScreen();
593
757
  return;
594
758
  }
595
- S.warn("Unable to load selected resource metadata: " + e);
759
+ D.warn("Unable to load selected resource metadata: " + t);
596
760
  }
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.");
761
+ if (!p(e)) return;
762
+ let m = o(e) ? this.browserContext?.session.paneRegistry.byName("source") : void 0;
763
+ if (!n && o(e) && !m) {
764
+ this.renderExplorerError(e, "The Source pane is unavailable to display this JavaScript file.");
601
765
  return;
602
766
  }
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)) {
767
+ await this.renderExplorerInto(u, e, n || m, { isCurrent: () => p(e) });
768
+ } catch (t) {
769
+ if (D.error("Unable to render selected resource: " + t), l === this.renderGeneration && this.resourceTarget) {
770
+ if (i(t)) {
607
771
  this.renderAccessDeniedScreen();
608
772
  return;
609
773
  }
610
- this.renderExplorerError(t, "Unable to display the selected resource.");
774
+ this.renderExplorerError(e, "Unable to display the selected resource.");
611
775
  }
612
776
  }
613
777
  }
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);
778
+ showSubject(e, t) {
779
+ let r = t?.name !== "sharing", i = r ? n(e) : void 0, o = i && this.store ? this.store.sym(i) : void 0, s = o ?? e, c = r && !o && !!this.resourceLogic && a(e, this.resourceLogic) && this.resourceLogic.containerHasIndexDocument(e);
780
+ this.selectedResource = s, this.showResourceInContentView(s, t, !!o || c);
617
781
  }
618
782
  setContainerView(e) {
619
783
  this.containerView = e;
620
784
  let t = this.resourceTarget?.querySelector("folder-pane-container");
621
785
  t && (t.view = e);
622
786
  }
787
+ get sidebarAvailableWidth() {
788
+ let e = this.renderRoot.querySelector(".folder-pane-main-content"), t = this.renderRoot.querySelector(".folder-pane-sidebar-resizer");
789
+ return (e?.clientWidth ?? 0) - (t?.getBoundingClientRect().width ?? 0);
790
+ }
791
+ resizeSidebar(e) {
792
+ this.sidebarWidth = H(e, this.sidebarAvailableWidth);
793
+ }
794
+ finishSidebarResize() {
795
+ let e = this.sidebarDrag;
796
+ e && (this.sidebarDrag = void 0, e.separator.hasPointerCapture(e.pointerId) && e.separator.releasePointerCapture(e.pointerId), this.isConnected && this.requestUpdate());
797
+ }
623
798
  render() {
624
- return this.fullView ? O`
625
- ${this.renderContentError()}
799
+ return this.fullView ? P`
800
+ <folder-pane-provider
801
+ .rootResource=${this.subject}
802
+ .displayedResource=${this.displayedResource}
803
+ .activeContainer=${this.getActiveContainer()}
804
+ .view=${this.containerView}
805
+ .searchQuery=${this.searchQuery}
806
+ .canCreate=${this.canCreate}
807
+ >
808
+ ${this.showingContainer ? this.renderStorageHeader() : ee}
809
+ ${this.renderContentError()}
810
+ <div
811
+ class="folder-pane-full-view"
812
+ ?hidden=${!!this.contentError}
813
+ @resource-selected=${this.handleResourceSelected}
814
+ ></div>
815
+ <div class="folder-pane-status"></div>
816
+ </folder-pane-provider>
817
+ ` : P`
818
+ <folder-pane-provider
819
+ .rootResource=${this.subject}
820
+ .displayedResource=${this.displayedResource}
821
+ .activeContainer=${this.getActiveContainer()}
822
+ .view=${this.containerView}
823
+ .searchQuery=${this.searchQuery}
824
+ .canCreate=${this.canCreate}
825
+ .sidebarCollapsed=${this.sidebarCollapsed}
826
+ >
827
+ ${this.renderStorageHeader()}
626
828
  <div
627
- class="folder-pane-full-view"
628
- ?hidden=${!!this.contentError}
829
+ class="folder-pane-main-content"
830
+ data-sidebar-collapsed=${String(this.sidebarCollapsed)}
831
+ style=${`--folder-pane-sidebar-width: ${this.sidebarWidth}px`}
629
832
  @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>
833
+ @folder-pane-resource-error=${this.handleFolderPaneResourceError}
834
+ @folder-pane-toggle-sidebar=${this.handleSidebarToggle}
835
+ >
836
+ <folder-pane-sidebar
837
+ ?inert=${this.sidebarCollapsed}
838
+ aria-hidden=${this.sidebarCollapsed ? "true" : "false"}
839
+ .store=${this.store}
840
+ .resourceLogic=${this.resourceLogic}
841
+ .subject=${this.subject}
842
+ .selectedResource=${this.displayedResource}
843
+ ></folder-pane-sidebar>
844
+ <div
845
+ class="folder-pane-sidebar-resizer"
846
+ data-resizing=${String(!!this.sidebarDrag)}
847
+ >
848
+ <div
849
+ class="folder-pane-sidebar-resize-handle"
850
+ role="separator"
851
+ aria-orientation="vertical"
852
+ aria-label="Resize navigation sidebar"
853
+ aria-valuemin=${180}
854
+ aria-valuemax=${this.sidebarMaximumWidth}
855
+ aria-valuenow=${this.sidebarWidth}
856
+ tabindex=${this.sidebarCollapsed ? -1 : 0}
857
+ ?hidden=${this.sidebarCollapsed}
858
+ ?inert=${this.sidebarCollapsed}
859
+ @pointerdown=${this.handleSidebarPointerDown}
860
+ @pointermove=${this.handleSidebarPointerMove}
861
+ @pointerup=${this.handleSidebarPointerEnd}
862
+ @pointercancel=${this.handleSidebarPointerEnd}
863
+ @lostpointercapture=${this.handleSidebarPointerEnd}
864
+ @keydown=${this.handleSidebarResizeKey}
865
+ ></div>
866
+ <button
867
+ type="button"
868
+ class="folder-pane-sidebar-toggle"
869
+ aria-label=${this.sidebarCollapsed ? "Expand navigation" : "Collapse navigation"}
870
+ aria-expanded=${String(!this.sidebarCollapsed)}
871
+ @click=${this.handleSidebarToggle}
872
+ >
873
+ <icon-lucide-chevron-left
874
+ class=${`folder-pane-sidebar-toggle-icon${this.sidebarCollapsed ? " folder-pane-sidebar-toggle-icon-collapsed" : ""}`}
875
+ aria-hidden="true"
876
+ ></icon-lucide-chevron-left>
877
+ </button>
878
+ </div>
879
+ <div class="folder-pane-content-column">
880
+ ${this.renderContentError()}
881
+ <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>
882
+ <div class="folder-pane-status"></div>
883
+ </div>
649
884
  </div>
650
- </div>
885
+ </folder-pane-provider>
651
886
  `;
652
887
  }
653
888
  renderStorageHeader() {
654
- return O`
889
+ return P`
655
890
  <folder-pane-storage-header
656
891
  .subject=${this.subject}
657
- .selectedResource=${this.selectedResource ?? this.subject}
892
+ .breadcrumbRoot=${this.standaloneBreadcrumbRoot}
893
+ .selectedResource=${this.displayedResource}
658
894
  .browserContext=${this.browserContext}
659
895
  .paneList=${this.browserContext?.session.paneRegistry.list ?? []}
660
896
  .view=${this.containerView}
661
897
  .searchQuery=${this.searchQuery}
662
- .canCreate=${!!D.currentUser()}
898
+ .canCreate=${this.canCreate}
663
899
  @folder-pane-select-home=${this.handleSelectHome}
664
900
  @folder-pane-select-resource=${this.handleSelectBreadcrumbResource}
665
901
  @folder-pane-change-view=${this.handleContainerViewChange}
@@ -668,7 +904,7 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
668
904
  `;
669
905
  }
670
906
  renderContentError() {
671
- return this.contentError ? O`
907
+ return this.contentError ? P`
672
908
  <div class="folder-pane-resource-error" role="status">
673
909
  <solid-ui-error-state
674
910
  .title=${this.contentError.title}
@@ -678,70 +914,95 @@ L = (ie = A({ attribute: !1 }), oe = A({ attribute: !1 }), ce = A({
678
914
  <button type="button" @click=${this.retryContent}>Retry</button>
679
915
  </solid-ui-error-state>
680
916
  </div>
681
- ` : k;
917
+ ` : ee;
682
918
  }
683
- }, {e: [ae, se, le, de, pe, he, _e, P, I, ye, xe, Ce, te], c: [je, ne]} = Ee(ee, [
919
+ }, {e: [oe, ce, ue, fe, me, ge, ve, be, Se, we, Ee, Oe, Ae, Me, Pe, Ie, Re, ne], c: [qe, re]} = He(te, [
684
920
  [
685
- ie,
921
+ ae,
686
922
  1,
687
923
  "browserContext"
688
924
  ],
689
925
  [
690
- oe,
926
+ se,
691
927
  1,
692
928
  "subject"
693
929
  ],
694
930
  [
695
- ce,
931
+ le,
696
932
  1,
697
933
  "fullView"
698
934
  ],
699
935
  [
700
- ue,
936
+ de,
701
937
  1,
702
- "hideStorageHeader"
938
+ "selectedResource"
703
939
  ],
704
940
  [
705
- fe,
941
+ pe,
706
942
  1,
707
- "selectedResource"
943
+ "standaloneBreadcrumbRoot"
708
944
  ],
709
945
  [
710
- me,
946
+ he,
711
947
  1,
712
948
  "containerView"
713
949
  ],
714
950
  [
715
- ge,
951
+ _e,
716
952
  1,
717
953
  "searchQuery"
718
954
  ],
719
955
  [
720
- N,
956
+ ye,
957
+ 1,
958
+ "sidebarCollapsed"
959
+ ],
960
+ [
961
+ xe,
962
+ 1,
963
+ "sidebarWidth"
964
+ ],
965
+ [
966
+ Ce,
967
+ 1,
968
+ "sidebarMaximumWidth"
969
+ ],
970
+ [
971
+ Te,
721
972
  1,
722
973
  "contentError"
723
974
  ],
724
975
  [
725
- F,
976
+ De,
977
+ 1,
978
+ "showingContainer"
979
+ ],
980
+ [
981
+ ke,
982
+ 1,
983
+ "canCreate"
984
+ ],
985
+ [
986
+ je,
726
987
  1,
727
988
  "contentView"
728
989
  ],
729
990
  [
730
- ve,
991
+ Ne,
731
992
  1,
732
993
  "fullViewTarget"
733
994
  ],
734
995
  [
735
- be,
996
+ Fe,
736
997
  1,
737
998
  "sidebar"
738
999
  ],
739
1000
  [
740
- Se,
1001
+ Le,
741
1002
  1,
742
1003
  "statusArea"
743
1004
  ]
744
- ], re, 0, void 0, g), ne();
745
- export { je as default };
1005
+ ], ie, 0, void 0, b), re();
1006
+ export { H as clampSidebarWidth, qe as default };
746
1007
 
747
1008
  //# sourceMappingURL=FolderPaneView.esm.js.map