folder-pane 4.0.1-1 → 4.1.0

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 (117) hide show
  1. package/README.md +4 -0
  2. package/dist/_virtual/~icons/lucide/chevron-left.cjs.js +2 -0
  3. package/dist/_virtual/~icons/lucide/chevron-left.cjs.js.map +1 -0
  4. package/dist/_virtual/~icons/lucide/{trash-2.esm.js → chevron-left.esm.js} +4 -4
  5. package/dist/_virtual/~icons/lucide/chevron-left.esm.js.map +1 -0
  6. package/dist/accessCache.cjs.js +2 -0
  7. package/dist/accessCache.cjs.js.map +1 -0
  8. package/dist/accessCache.d.ts +37 -0
  9. package/dist/accessCache.d.ts.map +1 -0
  10. package/dist/accessCache.esm.js +34 -0
  11. package/dist/accessCache.esm.js.map +1 -0
  12. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +50 -38
  13. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
  14. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +29 -5
  15. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
  16. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +321 -194
  17. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
  18. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js +1 -1
  19. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js.map +1 -1
  20. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js +1 -1
  21. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js.map +1 -1
  22. package/dist/components/folder-pane-content/FolderPaneContent.cjs.js.map +1 -1
  23. package/dist/components/folder-pane-content/FolderPaneContent.esm.js.map +1 -1
  24. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js +1 -1
  25. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js.map +1 -1
  26. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js +1 -1
  27. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js.map +1 -1
  28. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js +2 -0
  29. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js.map +1 -0
  30. package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts +16 -0
  31. package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts.map +1 -0
  32. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js +293 -0
  33. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js.map +1 -0
  34. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js +2 -0
  35. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js.map +1 -0
  36. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js +6 -0
  37. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js.map +1 -0
  38. package/dist/components/folder-pane-provider/index.cjs.js +1 -0
  39. package/dist/components/folder-pane-provider/index.d.ts +2 -0
  40. package/dist/components/folder-pane-provider/index.d.ts.map +1 -0
  41. package/dist/components/folder-pane-provider/index.esm.js +1 -0
  42. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js +23 -23
  43. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js.map +1 -1
  44. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts +17 -2
  45. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts.map +1 -1
  46. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js +249 -113
  47. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js.map +1 -1
  48. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js +1 -1
  49. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js.map +1 -1
  50. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js +1 -1
  51. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js.map +1 -1
  52. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.cjs.js.map +1 -1
  53. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.esm.js.map +1 -1
  54. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.cjs.js.map +1 -1
  55. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.esm.js.map +1 -1
  56. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js +35 -21
  57. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js.map +1 -1
  58. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts +14 -2
  59. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts.map +1 -1
  60. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js +201 -88
  61. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js.map +1 -1
  62. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js +1 -1
  63. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js.map +1 -1
  64. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js +1 -1
  65. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js.map +1 -1
  66. package/dist/components/folder-pane-view/FolderPaneView.cjs.js +90 -29
  67. package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
  68. package/dist/components/folder-pane-view/FolderPaneView.d.ts +41 -5
  69. package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
  70. package/dist/components/folder-pane-view/FolderPaneView.esm.js +573 -266
  71. package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
  72. package/dist/components/folder-pane-view/resourceLoad.cjs.js +2 -0
  73. package/dist/components/folder-pane-view/resourceLoad.cjs.js.map +1 -0
  74. package/dist/components/folder-pane-view/resourceLoad.d.ts +8 -0
  75. package/dist/components/folder-pane-view/resourceLoad.d.ts.map +1 -0
  76. package/dist/components/folder-pane-view/resourceLoad.esm.js +7 -0
  77. package/dist/components/folder-pane-view/resourceLoad.esm.js.map +1 -0
  78. package/dist/debug.cjs.js +2 -0
  79. package/dist/debug.cjs.js.map +1 -0
  80. package/dist/debug.d.ts +5 -0
  81. package/dist/debug.d.ts.map +1 -0
  82. package/dist/debug.esm.js +10 -0
  83. package/dist/debug.esm.js.map +1 -0
  84. package/dist/folderPane.cjs.js +2 -2
  85. package/dist/folderPane.cjs.js.map +1 -1
  86. package/dist/folderPane.d.ts +2 -2
  87. package/dist/folderPane.d.ts.map +1 -1
  88. package/dist/folderPane.esm.js +13 -10
  89. package/dist/folderPane.esm.js.map +1 -1
  90. package/dist/helpers.cjs.js +1 -1
  91. package/dist/helpers.cjs.js.map +1 -1
  92. package/dist/helpers.d.ts +13 -2
  93. package/dist/helpers.d.ts.map +1 -1
  94. package/dist/helpers.esm.js +34 -14
  95. package/dist/helpers.esm.js.map +1 -1
  96. package/dist/primitives/context.cjs.js +2 -0
  97. package/dist/primitives/context.cjs.js.map +1 -0
  98. package/dist/primitives/context.d.ts +14 -0
  99. package/dist/primitives/context.d.ts.map +1 -0
  100. package/dist/primitives/context.esm.js +6 -0
  101. package/dist/primitives/context.esm.js.map +1 -0
  102. package/dist/requestQueue.cjs.js +1 -1
  103. package/dist/requestQueue.cjs.js.map +1 -1
  104. package/dist/requestQueue.d.ts +10 -2
  105. package/dist/requestQueue.d.ts.map +1 -1
  106. package/dist/requestQueue.esm.js +32 -22
  107. package/dist/requestQueue.esm.js.map +1 -1
  108. package/dist/resourceActionItems.cjs.js +2 -0
  109. package/dist/resourceActionItems.cjs.js.map +1 -0
  110. package/dist/resourceActionItems.d.ts +19 -0
  111. package/dist/resourceActionItems.d.ts.map +1 -0
  112. package/dist/resourceActionItems.esm.js +42 -0
  113. package/dist/resourceActionItems.esm.js.map +1 -0
  114. package/package.json +12 -8
  115. package/dist/_virtual/~icons/lucide/trash-2.cjs.js +0 -2
  116. package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +0 -1
  117. package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +0 -1
@@ -1,42 +1,48 @@
1
- import { getContainerMemberCountLabel as e, getResourceAccessState as t, getResourcesForContainer as n } from "../../helpers.esm.js";
2
- import { createRequestQueue as r } from "../../requestQueue.esm.js";
1
+ import { resourceAccessCache as e } from "../../accessCache.esm.js";
2
+ import { loadResourcePaneMenuItems as t } from "../../resourceActionItems.esm.js";
3
+ import { getContainerMemberCountLabel as n, getResourceAccessState as r, getResourcesForContainer as i, readStoredWacAllow as a } from "../../helpers.esm.js";
4
+ import { createRequestQueue as o } from "../../requestQueue.esm.js";
5
+ import { warn as s } from "../../debug.esm.js";
3
6
  import "../../_virtual/~icons/lucide/file.esm.js";
4
7
  import "../../_virtual/~icons/lucide/file-box.esm.js";
5
8
  import "../../_virtual/~icons/lucide/folder.esm.js";
6
- import i from "./FolderPaneContainer.styles.esm.js";
7
9
  import "../../_virtual/~icons/lucide/globe.esm.js";
8
10
  import "../../_virtual/~icons/lucide/lock-keyhole.esm.js";
9
- import { FILE_EXPLORER_MANAGE_ACCESS_EVENT as a, WebComponent as o, customElement as s, getRelevantPanes as c, utils as l } from "solid-ui";
10
- import { html as u, nothing as d } from "lit";
11
- import { property as f, state as p } from "lit/decorators.js";
11
+ import c from "./FolderPaneContainer.styles.esm.js";
12
+ import { WebComponent as l, customElement as u, utils as d, widgets as f } from "solid-ui";
13
+ import { authSession as p, authn as m } from "solid-logic";
14
+ import { html as h, nothing as g } from "lit";
15
+ import { property as _, state as v } from "lit/decorators.js";
16
+ import { ref as y } from "lit/directives/ref.js";
17
+ import { repeat as b } from "lit/directives/repeat.js";
12
18
  import "solid-ui/components/resource-actions-menu";
13
19
  // src/components/folder-pane-container/FolderPaneContainer.ts
14
- var m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j, ee, te, ne, re, ie, ae, oe, M, N, P, F, I, L, R, z, B, V, H, U, W, G, K, q, se, ce, le, ue, de;
15
- function J(e, t, n) {
16
- fe(e, t), t.set(e, n);
20
+ var x, S, C, w, T, E, D, O, k, A, j, M, N, P, F, I, L, ee, te, ne, re, ie, ae, oe, R, z, B, V, H, U, W, G, K, q, se, ce, le, ue, de, fe, pe, me, he, ge, _e, ve, ye, be, xe, J, Se, Ce;
21
+ function Y(e, t, n) {
22
+ we(e, t), t.set(e, n);
17
23
  }
18
- function fe(e, t) {
24
+ function we(e, t) {
19
25
  if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
20
26
  }
21
- function Y(e, t, n) {
22
- return e.set(pe(e, t), n), n;
27
+ function X(e, t, n) {
28
+ return e.set(Te(e, t), n), n;
23
29
  }
24
- function X(e, t) {
25
- return e.get(pe(e, t));
30
+ function Z(e, t) {
31
+ return e.get(Te(e, t));
26
32
  }
27
- function pe(e, t, n) {
33
+ function Te(e, t, n) {
28
34
  if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
29
35
  throw TypeError("Private element is not present on this object");
30
36
  }
31
- function Z(e, t, n) {
32
- return (t = Q(t)) in e ? Object.defineProperty(e, t, {
37
+ function Q(e, t, n) {
38
+ return (t = De(t)) in e ? Object.defineProperty(e, t, {
33
39
  value: n,
34
40
  enumerable: !0,
35
41
  configurable: !0,
36
42
  writable: !0
37
43
  }) : e[t] = n, e;
38
44
  }
39
- function me(e, t, n, r, i, a) {
45
+ function Ee(e, t, n, r, i, a) {
40
46
  function o(e, t, n) {
41
47
  return function(r, i) {
42
48
  return n && n(r), e[t].call(r, i);
@@ -59,13 +65,13 @@ function me(e, t, n, r, i, a) {
59
65
  n || Array.isArray(_) || (_ = [_]);
60
66
  var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
61
67
  d ? (f || p ? b = {
62
- get: ge(function() {
68
+ get: ke(function() {
63
69
  return v(this);
64
70
  }, r, "get"),
65
71
  set: function(e) {
66
72
  t[4](this, e);
67
73
  }
68
- } : b[S] = v, f || ge(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
74
+ } : b[S] = v, f || ke(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
69
75
  }
70
76
  for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
71
77
  var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
@@ -125,7 +131,7 @@ function me(e, t, n, r, i, a) {
125
131
  if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
126
132
  var f = Object.create(d ?? null), p = function(e, t, n, r) {
127
133
  var i, a, o = [], c = function(t) {
128
- return _e(t) === e;
134
+ return Ae(t) === e;
129
135
  }, u = /* @__PURE__ */ new Map();
130
136
  function d(e) {
131
137
  e && o.push(s.bind(null, e));
@@ -139,7 +145,7 @@ function me(e, t, n, r, i, a) {
139
145
  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);
140
146
  u.set(b, !(m > 2) || m);
141
147
  }
142
- l(v ? e : e.prototype, p, _, g ? "#" + h : Q(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
148
+ 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);
143
149
  }
144
150
  }
145
151
  return d(i), d(a), o;
@@ -152,11 +158,11 @@ function me(e, t, n, r, i, a) {
152
158
  }
153
159
  };
154
160
  }
155
- function Q(e) {
156
- var t = he(e, "string");
161
+ function De(e) {
162
+ var t = Oe(e, "string");
157
163
  return typeof t == "symbol" ? t : t + "";
158
164
  }
159
- function he(e, t) {
165
+ function Oe(e, t) {
160
166
  if (typeof e != "object" || !e) return e;
161
167
  var n;
162
168
  if (typeof Symbol < "u" && (n = e[Symbol.toPrimitive]) !== void 0) {
@@ -166,7 +172,7 @@ function he(e, t) {
166
172
  }
167
173
  return (t === "string" ? String : Number)(e);
168
174
  }
169
- function ge(e, t, n) {
175
+ function ke(e, t, n) {
170
176
  typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
171
177
  try {
172
178
  Object.defineProperty(e, "name", {
@@ -176,99 +182,137 @@ function ge(e, t, n) {
176
182
  } catch {}
177
183
  return e;
178
184
  }
179
- function _e(e) {
185
+ function Ae(e) {
180
186
  if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
181
187
  return e;
182
188
  }
183
- function ve(e) {
189
+ function je(e) {
184
190
  return e;
185
191
  }
186
- j = [s("folder-pane-container")];
192
+ ne = [u("folder-pane-container")];
187
193
  var $;
188
- new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v = /*#__PURE__*/ new WeakMap(), y = /*#__PURE__*/ new WeakMap(), b = /*#__PURE__*/ new WeakMap(), x = /*#__PURE__*/ new WeakMap(), S = /*#__PURE__*/ new WeakMap(), C = /*#__PURE__*/ new WeakMap(), w = /*#__PURE__*/ new WeakMap(), T = /*#__PURE__*/ new WeakMap(), E = /*#__PURE__*/ new WeakMap(), D = /*#__PURE__*/ new WeakMap(), O = /*#__PURE__*/ new WeakMap(), de = (ee = f({ attribute: !1 }), ne = f({ attribute: !1 }), ie = f({ attribute: !1 }), oe = f(), N = f(), F = f({
194
+ new (Se = (C = /*#__PURE__*/ new WeakMap(), w = /*#__PURE__*/ new WeakMap(), T = /*#__PURE__*/ new WeakMap(), E = /*#__PURE__*/ new WeakMap(), D = /*#__PURE__*/ new WeakMap(), O = /*#__PURE__*/ new WeakMap(), k = /*#__PURE__*/ new WeakMap(), A = /*#__PURE__*/ new WeakMap(), j = /*#__PURE__*/ new WeakMap(), M = /*#__PURE__*/ new WeakMap(), N = /*#__PURE__*/ new WeakMap(), P = /*#__PURE__*/ new WeakMap(), F = /*#__PURE__*/ new WeakMap(), I = /*#__PURE__*/ new WeakMap(), L = /*#__PURE__*/ new WeakMap(), Ce = (re = _({ attribute: !1 }), ae = _({ attribute: !1 }), R = _({ attribute: !1 }), B = _(), H = _(), W = _({
189
195
  type: Boolean,
190
- attribute: "hide-root-special-folders"
191
- }), L = p(), z = p(), V = p(), U = p(), G = p(), q = p(), ce = p(), "subject"), h = class extends o {
192
- constructor(...e) {
193
- super(...e), J(this, g, (k(this), te(this, void 0))), J(this, _, re(this, null)), J(this, v, ae(this, void 0)), J(this, y, M(this, "grid")), J(this, b, P(this, "")), J(this, x, I(this, !1)), J(this, S, R(this, /* @__PURE__ */ new Map())), J(this, C, B(this, [])), J(this, w, H(this, [])), J(this, T, W(this, /* @__PURE__ */ new Map())), J(this, E, K(this, /* @__PURE__ */ new Map())), J(this, D, se(this, !0)), J(this, O, le(this, void 0)), Z(this, "actionMenuGeneration", 0), Z(this, "resourceGeneration", 0), Z(this, "detailsQueue", r()), Z(this, "detailsObserver", void 0);
196
+ attribute: "can-upload"
197
+ }), K = _({
198
+ type: Boolean,
199
+ attribute: "upload-busy"
200
+ }), se = v(), le = v(), de = v(), pe = v(), he = v(), _e = v(), ye = v(), xe = v(), "subject"), S = class extends l {
201
+ constructor(...t) {
202
+ super(...t), Y(this, C, (ee(this), ie(this, void 0))), Y(this, w, oe(this, null)), Y(this, T, z(this, void 0)), Y(this, E, V(this, "grid")), Y(this, D, U(this, "")), Y(this, O, G(this, !1)), Y(this, k, q(this, !1)), Y(this, A, ce(this, /* @__PURE__ */ new Map())), Y(this, j, ue(this, [])), Y(this, M, fe(this, [])), Y(this, N, me(this, /* @__PURE__ */ new Map())), Y(this, P, ge(this, /* @__PURE__ */ new Map())), Y(this, F, ve(this, !0)), Y(this, I, be(this, void 0)), Y(this, L, J(this, !1)), Q(this, "resourceActionMenuLoads", /* @__PURE__ */ new Map()), Q(this, "resourceGeneration", 0), Q(this, "authGeneration", 0), Q(this, "updateWorkScheduled", !1), Q(this, "fileDragDepth", 0), Q(this, "draggableItems", /* @__PURE__ */ new WeakSet()), Q(this, "detailsQueue", o({ concurrency: 2 })), Q(this, "detailsObserver", void 0), Q(this, "authListenersAttached", !1), Q(this, "handleFileDragEnter", (e) => {
203
+ this.canUpload && this.hasDraggedFiles(e) && (e.preventDefault(), e.stopPropagation(), this.fileDragDepth++, this.dragActive = !0, e.dataTransfer && (e.dataTransfer.dropEffect = "copy"));
204
+ }), Q(this, "handleFileDragLeave", (e) => {
205
+ this.fileDragDepth !== 0 && (e.preventDefault(), e.stopPropagation(), this.fileDragDepth = Math.max(0, this.fileDragDepth - 1), this.dragActive = this.fileDragDepth > 0);
206
+ }), Q(this, "handleFileDragOver", (e) => {
207
+ this.canUpload && this.hasDraggedFiles(e) && (e.preventDefault(), e.stopPropagation(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"));
208
+ }), Q(this, "handleFileDrop", (e) => {
209
+ let t = e.dataTransfer, n = Array.from(e.dataTransfer?.files ?? []), r = Array.from(t?.items ?? []).some((e) => e.webkitGetAsEntry?.()?.isDirectory === !0);
210
+ (n.length || r) && (e.preventDefault(), e.stopPropagation(), this.fileDragDepth = 0, this.dragActive = !1, r ? this.dispatchEvent(new CustomEvent("folder-pane-upload-rejected", {
211
+ detail: { message: "Folder drops are not supported. Select files instead." },
212
+ bubbles: !0,
213
+ composed: !0
214
+ })) : this.uploadBusy ? this.dispatchEvent(new CustomEvent("folder-pane-upload-rejected", {
215
+ detail: { message: "Please wait for the current upload or creation to finish." },
216
+ bubbles: !0,
217
+ composed: !0
218
+ })) : this.canUpload && this.dispatchEvent(new CustomEvent("folder-pane-upload-files", {
219
+ detail: { files: n },
220
+ bubbles: !0,
221
+ composed: !0
222
+ })));
223
+ }), Q(this, "handleAuthChange", () => {
224
+ this.authGeneration++, e.clear(), this.detailsQueue.clear(), this.resourceAccess = /* @__PURE__ */ new Map(), this.memberLoad = /* @__PURE__ */ new Map(), this.resourceActionMenuLoads = /* @__PURE__ */ new Map(), this.requestUpdate();
225
+ });
194
226
  }
195
- get [de]() {
196
- return X(g, this);
227
+ get [Ce]() {
228
+ return Z(C, this);
197
229
  }
198
230
  set subject(e) {
199
- Y(g, this, e);
231
+ X(C, this, e);
200
232
  }
201
233
  get resourceLogic() {
202
- return X(_, this);
234
+ return Z(w, this);
203
235
  }
204
236
  set resourceLogic(e) {
205
- Y(_, this, e);
237
+ X(w, this, e);
206
238
  }
207
239
  get browserContext() {
208
- return X(v, this);
240
+ return Z(T, this);
209
241
  }
210
242
  set browserContext(e) {
211
- Y(v, this, e);
243
+ X(T, this, e);
212
244
  }
213
245
  get view() {
214
- return X(y, this);
246
+ return Z(E, this);
215
247
  }
216
248
  set view(e) {
217
- Y(y, this, e);
249
+ X(E, this, e);
218
250
  }
219
251
  get searchQuery() {
220
- return X(b, this);
252
+ return Z(D, this);
221
253
  }
222
254
  set searchQuery(e) {
223
- Y(b, this, e);
255
+ X(D, this, e);
224
256
  }
225
- get hideRootSpecialFolders() {
226
- return X(x, this);
257
+ get canUpload() {
258
+ return Z(O, this);
227
259
  }
228
- set hideRootSpecialFolders(e) {
229
- Y(x, this, e);
260
+ set canUpload(e) {
261
+ X(O, this, e);
262
+ }
263
+ get uploadBusy() {
264
+ return Z(k, this);
265
+ }
266
+ set uploadBusy(e) {
267
+ X(k, this, e);
230
268
  }
231
269
  get resourceActionMenuItems() {
232
- return X(S, this);
270
+ return Z(A, this);
233
271
  }
234
272
  set resourceActionMenuItems(e) {
235
- Y(S, this, e);
273
+ X(A, this, e);
236
274
  }
237
275
  get resources() {
238
- return X(C, this);
276
+ return Z(j, this);
239
277
  }
240
278
  set resources(e) {
241
- Y(C, this, e);
279
+ X(j, this, e);
242
280
  }
243
281
  get optimisticResources() {
244
- return X(w, this);
282
+ return Z(M, this);
245
283
  }
246
284
  set optimisticResources(e) {
247
- Y(w, this, e);
285
+ X(M, this, e);
248
286
  }
249
287
  get resourceAccess() {
250
- return X(T, this);
288
+ return Z(N, this);
251
289
  }
252
290
  set resourceAccess(e) {
253
- Y(T, this, e);
291
+ X(N, this, e);
254
292
  }
255
293
  get memberLoad() {
256
- return X(E, this);
294
+ return Z(P, this);
257
295
  }
258
296
  set memberLoad(e) {
259
- Y(E, this, e);
297
+ X(P, this, e);
260
298
  }
261
299
  get loading() {
262
- return X(D, this);
300
+ return Z(F, this);
263
301
  }
264
302
  set loading(e) {
265
- Y(D, this, e);
303
+ X(F, this, e);
266
304
  }
267
305
  get loadError() {
268
- return X(O, this);
306
+ return Z(I, this);
269
307
  }
270
308
  set loadError(e) {
271
- Y(O, this, e);
309
+ X(I, this, e);
310
+ }
311
+ get dragActive() {
312
+ return Z(L, this);
313
+ }
314
+ set dragActive(e) {
315
+ X(L, this, e);
272
316
  }
273
317
  selectResource(e) {
274
318
  this.dispatchEvent(new CustomEvent("resource-selected", {
@@ -277,6 +321,12 @@ new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v =
277
321
  composed: !0
278
322
  }));
279
323
  }
324
+ makeResourceDraggable(e, t) {
325
+ e && !this.draggableItems.has(e) && (f.makeDraggable(e, t.subject), this.draggableItems.add(e));
326
+ }
327
+ hasDraggedFiles(e) {
328
+ return Array.from(e.dataTransfer?.types ?? []).includes("Files");
329
+ }
280
330
  handleResourceKeyDown(e, t) {
281
331
  e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.selectResource(t));
282
332
  }
@@ -285,14 +335,9 @@ new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v =
285
335
  let t = this.resourceLogic;
286
336
  return t.getContainerMembers(e.subject).filter((e) => !t.isHiddenFile(e)).length;
287
337
  }
288
- isRootSpecialFolder(e) {
289
- if (!e.isContainer) return !1;
290
- let t = l.label(e.subject).toLowerCase();
291
- return t === "public" || t === "trash";
292
- }
293
338
  getResourcesFromStore() {
294
- let e = this.subject ? [...n(this.subject, this.resourceLogic).values()] : [], t = this.optimisticResources.filter((t) => !e.some((e) => e.id === t.id)), r = [...e, ...t];
295
- return this.hideRootSpecialFolders ? r.filter((e) => !this.isRootSpecialFolder(e)) : r;
339
+ let e = this.subject ? [...i(this.subject, this.resourceLogic).values()] : [], t = this.optimisticResources.filter((t) => !e.some((e) => e.id === t.id));
340
+ return [...e, ...t];
296
341
  }
297
342
  addOptimisticResource(e) {
298
343
  if (!this.resourceLogic || this.optimisticResources.some((t) => t.id === e.value)) return;
@@ -306,53 +351,82 @@ new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v =
306
351
  }
307
352
  get visibleResources() {
308
353
  let e = this.searchQuery.trim().toLowerCase();
309
- return e ? this.resources.filter((t) => l.label(t.subject).toLowerCase().includes(e)) : this.resources;
354
+ return e ? this.resources.filter((t) => d.label(t.subject).toLowerCase().includes(e)) : this.resources;
310
355
  }
311
356
  async loadResources() {
312
- let e = ++this.resourceGeneration, t = this.getResourcesFromStore();
313
- this.resources = t, this.loading = !1, this.loadError = void 0, e === this.resourceGeneration && this.loadResourceActionMenuItems(e);
357
+ ++this.resourceGeneration, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.resourceActionMenuLoads = /* @__PURE__ */ new Map();
358
+ let e = this.getResourcesFromStore();
359
+ this.resources = e, this.loading = !1, this.loadError = void 0, this.resourceGeneration;
314
360
  }
315
361
  loadResourceDetails(e) {
316
- this.loadMemberCount(e), this.loadResourceAccess(e);
362
+ let t = this.authGeneration, n = this.viewer;
363
+ e.isContainer ? this.loadContainerDetails(e, this.resourceGeneration, t, n) : this.loadResourceAccess(e, this.resourceGeneration, t, n);
364
+ }
365
+ isCurrentAccessRequest(e, t, n) {
366
+ return e === this.resourceGeneration && t === this.authGeneration && n === this.viewer;
367
+ }
368
+ async loadContainerDetails(e, t = this.resourceGeneration, n = this.authGeneration, r = this.viewer) {
369
+ if (!this.browserContext || !this.isCurrentAccessRequest(t, n, r)) return;
370
+ let i = !this.resourceAccess.has(e.id);
371
+ if (i && (this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
372
+ state: "unknown",
373
+ canManageAccess: !1
374
+ })), await this.loadMemberCount(e, t, n, r), !i || !this.isCurrentAccessRequest(t, n, r)) return;
375
+ let o = this.memberLoad.get(e.id), s = a(this.browserContext.session.store.fetcher.getHeader(e.subject, "wac-allow"));
376
+ s ? this.setResourceAccess(e, {
377
+ state: s.isPublic ? "public" : "private",
378
+ canManageAccess: s.canManageAccess
379
+ }) : o === "error" ? this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
380
+ state: "error",
381
+ canManageAccess: !1
382
+ }) : (this.resourceAccess = new Map(this.resourceAccess), this.resourceAccess.delete(e.id), await this.loadResourceAccess(e, t, n, r));
317
383
  }
318
- async loadMemberCount(e, t = this.resourceGeneration) {
384
+ async loadMemberCount(e, t = this.resourceGeneration, n = this.authGeneration, r = this.viewer) {
319
385
  if (!e.isContainer || this.memberLoad.has(e.id) || !this.browserContext) return;
320
- let n = this.browserContext.session.store.fetcher;
386
+ let i = this.browserContext.session.store.fetcher;
321
387
  this.memberLoad = new Map(this.memberLoad).set(e.id, "loading");
322
388
  try {
323
- if (await this.detailsQueue.run(() => n.load(e.subject)), t !== this.resourceGeneration) return;
389
+ if (await this.detailsQueue.run(() => i.load(e.subject)), !this.isCurrentAccessRequest(t, n, r)) return;
324
390
  this.memberLoad = new Map(this.memberLoad).set(e.id, "loaded");
325
- } catch (n) {
326
- if (t !== this.resourceGeneration) return;
327
- console.warn("Unable to load folder-pane container member count", n), this.memberLoad = new Map(this.memberLoad).set(e.id, "error");
391
+ } catch (i) {
392
+ if (!this.isCurrentAccessRequest(t, n, r)) return;
393
+ s("Unable to load folder-pane container member count", i);
394
+ let a = i instanceof Error ? i.message : String(i), o = /parse|syntax|turtle|unexpected token/i.test(a) ? "parse-error" : "error";
395
+ this.memberLoad = new Map(this.memberLoad).set(e.id, o);
328
396
  }
329
397
  }
330
- async loadResourceAccess(e, n = this.resourceGeneration) {
331
- if (this.resourceAccess.has(e.id) || !this.browserContext) return;
332
- let r = this.browserContext.session.logic.resource;
333
- this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
398
+ get viewer() {
399
+ return m.currentUser?.()?.value;
400
+ }
401
+ setResourceAccess(t, n, r = this.authGeneration, i = this.viewer, a = this.resourceGeneration) {
402
+ this.isCurrentAccessRequest(a, r, i) && (this.resourceAccess = new Map(this.resourceAccess).set(t.id, n), e.set(i, t.subject.uri, n));
403
+ }
404
+ async loadResourceAccess(t, n = this.resourceGeneration, i = this.authGeneration, a = this.viewer) {
405
+ if (this.resourceAccess.has(t.id) || !this.browserContext || !this.isCurrentAccessRequest(n, i, a)) return;
406
+ let o = e.get(a, t.subject.uri);
407
+ if (o) {
408
+ this.resourceAccess = new Map(this.resourceAccess).set(t.id, o);
409
+ return;
410
+ }
411
+ let s = this.browserContext.session.logic.resource;
412
+ this.resourceAccess = new Map(this.resourceAccess).set(t.id, {
334
413
  state: "unknown",
335
414
  canManageAccess: !1
336
415
  });
337
416
  try {
338
- let i = await this.detailsQueue.run(() => r.fetchMetadata(e.subject));
339
- if (n !== this.resourceGeneration) return;
340
- let a = t(i.access);
341
- this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
342
- state: a,
343
- canManageAccess: i.access.canManageAccess
344
- });
417
+ let e = await this.detailsQueue.run(() => s.fetchMetadata(t.subject));
418
+ if (!this.isCurrentAccessRequest(n, i, a)) return;
419
+ this.setResourceAccess(t, {
420
+ state: r(e.access),
421
+ canManageAccess: e.access.canManageAccess
422
+ }, i, a, n);
345
423
  } catch {
346
- n === this.resourceGeneration && (this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
424
+ this.isCurrentAccessRequest(n, i, a) && (this.resourceAccess = new Map(this.resourceAccess).set(t.id, {
347
425
  state: "error",
348
426
  canManageAccess: !1
349
427
  }));
350
428
  }
351
429
  }
352
- renderAccessIndicator(e) {
353
- let t = this.resourceAccess.get(e.id);
354
- return t ? t.state === "public" ? u`<icon-lucide-globe class="resource-access-indicator resource-access-indicator--public" role="img" aria-label="Public" title="Public"></icon-lucide-globe>` : t.state === "private" ? u`<icon-lucide-lock-keyhole class="resource-access-indicator resource-access-indicator--private" role="img" aria-label="Private" title="Private"></icon-lucide-lock-keyhole>` : d : d;
355
- }
356
430
  resetResourceDetails() {
357
431
  this.detailsQueue.clear(), this.detailsObserver?.disconnect(), this.resourceAccess = /* @__PURE__ */ new Map(), this.memberLoad = /* @__PURE__ */ new Map();
358
432
  }
@@ -378,66 +452,97 @@ new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v =
378
452
  }
379
453
  }
380
454
  connectedCallback() {
381
- super.connectedCallback(), this.hasUpdated && this.requestUpdate();
455
+ super.connectedCallback(), this.authListenersAttached ||= (p.events.on("login", this.handleAuthChange), p.events.on("logout", this.handleAuthChange), !0), this.hasUpdated && this.requestUpdate();
382
456
  }
383
457
  disconnectedCallback() {
384
- super.disconnectedCallback(), this.resourceGeneration++, this.resetResourceDetails();
458
+ this.authListenersAttached &&= (p.events.off("login", this.handleAuthChange), p.events.off("logout", this.handleAuthChange), !1), super.disconnectedCallback(), this.resourceGeneration++, this.resourceActionMenuLoads = /* @__PURE__ */ new Map(), this.resetResourceDetails();
385
459
  }
386
- async refresh(e = !0) {
387
- if (this.resourceGeneration++, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.optimisticResources = [], e && this.subject && this.browserContext) try {
460
+ async refresh(t = !0) {
461
+ if (e.clear(), this.resourceGeneration++, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.resourceActionMenuLoads = /* @__PURE__ */ new Map(), this.resourceAccess = /* @__PURE__ */ new Map(), this.optimisticResources = [], t && this.subject && this.browserContext) try {
388
462
  await this.browserContext.session.store.fetcher.load(this.subject, {
389
463
  force: !0,
390
464
  clearPreviousData: !0
391
465
  });
392
466
  } catch (e) {
393
- await this.loadResources(), this.loadError = "The folder could not be refreshed. Showing the last known listing.", console.warn("Unable to refresh folder-pane container", e);
467
+ await this.loadResources(), this.loadError = "The folder could not be refreshed. Showing the last known listing.", s("Unable to refresh folder-pane container", e);
394
468
  return;
395
469
  }
396
470
  await this.loadResources();
397
471
  }
398
- async loadResourceActionMenuItems(e = this.resourceGeneration) {
399
- let t = ++this.actionMenuGeneration;
400
- if (!this.browserContext) {
401
- this.resourceActionMenuItems = /* @__PURE__ */ new Map();
402
- return;
403
- }
404
- let n = await Promise.all(this.resources.map(async (e) => {
405
- let t = await c(e.subject, this.browserContext, {
406
- excludedPaneNames: ["sharing"],
407
- fallbackPaneName: "internal"
408
- }), n = await Promise.all(t.map(async (t) => {
409
- let n = t.label(e.subject, this.browserContext) || t.name, r = t.icon;
410
- return {
411
- label: n,
412
- icon: typeof r == "function" ? await r(e.subject, this.browserContext) : r,
413
- action: () => {
414
- this.dispatchEvent(new CustomEvent("resource-open-pane", {
415
- detail: {
416
- resource: e.subject,
417
- paneName: t.name
418
- },
419
- bubbles: !0,
420
- composed: !0
421
- }));
422
- }
423
- };
424
- }));
425
- return [e.id, n];
472
+ updated(e) {
473
+ e.has("canUpload") && !this.canUpload && (this.fileDragDepth = 0, this.dragActive = !1), (e.has("subject") || e.has("resourceLogic") || e.has("browserContext")) && !this.updateWorkScheduled ? (this.updateWorkScheduled = !0, queueMicrotask(() => {
474
+ this.updateWorkScheduled = !1, this.isConnected && (this.resourceGeneration++, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.loadResources(), this.observeResourceItems());
475
+ })) : this.observeResourceItems();
476
+ }
477
+ openAccessControls(t) {
478
+ e.delete(t.subject.uri), this.dispatchEvent(new CustomEvent("resource-open-pane", {
479
+ detail: {
480
+ resource: t.subject,
481
+ paneName: "sharing"
482
+ },
483
+ bubbles: !0,
484
+ composed: !0
426
485
  }));
427
- e === this.resourceGeneration && t === this.actionMenuGeneration && (this.resourceActionMenuItems = new Map(n));
428
486
  }
429
- updated(e) {
430
- (e.has("subject") || e.has("resourceLogic") || e.has("browserContext") || e.has("hideRootSpecialFolders")) && (this.resourceGeneration++, this.resetResourceDetails(), this.resourceActionMenuItems = /* @__PURE__ */ new Map(), this.loadResources()), this.observeResourceItems();
487
+ setResourceActionMenuItems(e, t) {
488
+ this.resourceActionMenuItems = new Map(this.resourceActionMenuItems).set(e.id, t);
431
489
  }
432
- openAccessControls(e) {
433
- this.dispatchEvent(new CustomEvent(a, {
434
- detail: { subjectUri: e.subject.uri },
490
+ renderAccessIndicator(e) {
491
+ let t = this.resourceAccess.get(e.id);
492
+ return t?.state === "public" ? h`<icon-lucide-globe class="resource-access-indicator resource-access-indicator--public" role="img" aria-label="Public" title="Public"></icon-lucide-globe>` : t?.state === "private" ? h`<icon-lucide-lock-keyhole class="resource-access-indicator resource-access-indicator--private" role="img" aria-label="Private" title="Private"></icon-lucide-lock-keyhole>` : g;
493
+ }
494
+ openResourcePane(e, t) {
495
+ this.dispatchEvent(new CustomEvent("resource-open-pane", {
496
+ detail: {
497
+ resource: e,
498
+ paneName: t
499
+ },
435
500
  bubbles: !0,
436
501
  composed: !0
437
502
  }));
438
503
  }
504
+ async loadResourceActionMenuItems(e) {
505
+ if (!this.browserContext) return;
506
+ let n = this.authGeneration, i = this.viewer, a = this.resourceActionMenuLoads.get(e.id);
507
+ if (a === "loading" || a === "loaded") return;
508
+ let o = this.resourceGeneration;
509
+ if (!this.isCurrentAccessRequest(o, n, i)) return;
510
+ this.resourceActionMenuLoads.set(e.id, "loading");
511
+ let c = this.browserContext.session.logic.resource.fetchMetadata(e.subject).then((e) => e.access).catch((e) => {
512
+ s("Unable to load folder-pane access metadata for resource actions", e);
513
+ });
514
+ try {
515
+ let r = await t({
516
+ resource: e.subject,
517
+ isContainer: e.isContainer,
518
+ context: this.browserContext,
519
+ resourceLogic: this.resourceLogic,
520
+ openPane: (e, t, n) => {
521
+ n.stopPropagation(), this.openResourcePane(e, t);
522
+ },
523
+ isCurrent: () => this.isCurrentAccessRequest(o, n, i)
524
+ });
525
+ if (!r) return;
526
+ this.setResourceActionMenuItems(e, r), this.resourceActionMenuLoads.set(e.id, "loaded");
527
+ } catch (t) {
528
+ if (!this.isCurrentAccessRequest(o, n, i)) return;
529
+ this.resourceActionMenuLoads.set(e.id, "error"), s("Unable to load resource panes for folder-pane action menu", t);
530
+ } finally {
531
+ let t = await c;
532
+ this.isCurrentAccessRequest(o, n, i) && t ? this.setResourceAccess(e, {
533
+ state: r(t),
534
+ canManageAccess: t.canManageAccess
535
+ }, n, i, o) : this.isCurrentAccessRequest(o, n, i) && (this.resourceAccess = new Map(this.resourceAccess).set(e.id, {
536
+ state: "error",
537
+ canManageAccess: !1
538
+ }));
539
+ }
540
+ }
541
+ handleResourceActionsMenuClick(e) {
542
+ this.loadResourceActionMenuItems(e);
543
+ }
439
544
  renderResourceActionsMenu(e, t) {
440
- return u`
545
+ return h`
441
546
  <div
442
547
  class="resource-actions-menu resource-actions-menu--${t}"
443
548
  @click=${(e) => e.stopPropagation()}
@@ -449,90 +554,95 @@ new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v =
449
554
  .showAccessInMenu=${!0}
450
555
  .canManageAccess=${this.resourceAccess.get(e.id)?.canManageAccess === !0}
451
556
  .menuItems=${this.resourceActionMenuItems.get(e.id) || []}
557
+ @click=${() => this.handleResourceActionsMenuClick(e)}
452
558
  ></solid-ui-resource-actions-menu>
453
559
  </div>
454
560
  `;
455
561
  }
456
- renderResourceItem(t) {
457
- let n = l.label(t.subject), r = t.isContainer && this.memberLoad.get(t.id) === "loaded" ? this.getVisibleMemberCount(t) : -1;
458
- return u`
562
+ renderResourceItem(e) {
563
+ let t = d.label(e.subject), r = e.isContainer && this.memberLoad.get(e.id) === "loaded" ? this.getVisibleMemberCount(e) : -1;
564
+ return h`
459
565
  <li
566
+ ${y((t) => this.makeResourceDraggable(t, e))}
460
567
  class="resource-list-item"
461
- data-resource-id=${t.id}
568
+ data-resource-id=${e.id}
462
569
  notSelectable="false"
463
570
  aria-selected="false"
464
- aria-label=${n}
465
- about=${t.subject.toNT()}
571
+ aria-label=${t}
572
+ about=${e.subject.toNT()}
466
573
  role="option"
467
574
  tabindex="0"
468
- .subject=${t.subject}
469
- @click=${() => this.selectResource(t)}
470
- @keydown=${(e) => this.handleResourceKeyDown(e, t)}
575
+ .subject=${e.subject}
576
+ @click=${() => this.selectResource(e)}
577
+ @keydown=${(t) => this.handleResourceKeyDown(t, e)}
471
578
  >
472
579
  <span class="resource-list-main">
473
- <span class=${t.isContainer ? "resource-list-icon resource-list-icon--container" : "resource-list-icon"} aria-hidden="true">
474
- ${t.isContainer ? u`<icon-lucide-folder></icon-lucide-folder>` : u`<icon-lucide-file></icon-lucide-file>`}
580
+ <span class=${e.isContainer ? "resource-list-icon resource-list-icon--container" : "resource-list-icon"} aria-hidden="true">
581
+ ${e.isContainer ? h`<icon-lucide-folder></icon-lucide-folder>` : h`<icon-lucide-file></icon-lucide-file>`}
582
+ </span>
583
+ <span class="resource-list-label">${t}</span>
584
+ <span class="resource-list-meta">
585
+ ${r >= 0 ? h`<span class="container-member-count">${n(r)}</span>` : g}
586
+ ${this.renderAccessIndicator(e)}
475
587
  </span>
476
- <span class="resource-list-label">${n}</span>
477
- ${r >= 0 ? u`<span class="container-member-count">${e(r)}</span>` : d}
478
- ${this.renderAccessIndicator(t)}
479
588
  </span>
480
- ${this.renderResourceActionsMenu(t, "list")}
589
+ ${this.renderResourceActionsMenu(e, "list")}
481
590
  </li>
482
591
  `;
483
592
  }
484
593
  renderListView(e) {
485
- return u`
594
+ return h`
486
595
  <ul class="resource-list" role="listbox" aria-label="Container resources">
487
596
  <li class="resource-list-header" role="presentation" aria-hidden="true">
488
597
  <span>Name</span>
489
598
  <span>Actions</span>
490
599
  </li>
491
- ${e.map((e) => this.renderResourceItem(e))}
600
+ ${b(e, (e) => e.id, (e) => this.renderResourceItem(e))}
492
601
  </ul>
493
602
  `;
494
603
  }
495
- renderGridItem(t) {
496
- let n = l.label(t.subject), r = t.isContainer && this.memberLoad.get(t.id) === "loaded" ? this.getVisibleMemberCount(t) : -1;
497
- return u`
604
+ renderGridItem(e) {
605
+ let t = d.label(e.subject), r = e.isContainer && this.memberLoad.get(e.id) === "loaded" ? this.getVisibleMemberCount(e) : -1;
606
+ return h`
498
607
  <li
608
+ ${y((t) => this.makeResourceDraggable(t, e))}
499
609
  class="resource-grid-item"
500
- data-resource-id=${t.id}
610
+ data-resource-id=${e.id}
501
611
  notSelectable="false"
502
612
  aria-selected="false"
503
- aria-label=${n}
504
- about=${t.subject.toNT()}
613
+ aria-label=${t}
614
+ about=${e.subject.toNT()}
505
615
  role="option"
506
616
  tabindex="0"
507
- .subject=${t.subject}
508
- @click=${() => this.selectResource(t)}
509
- @keydown=${(e) => this.handleResourceKeyDown(e, t)}
617
+ .subject=${e.subject}
618
+ @click=${() => this.selectResource(e)}
619
+ @keydown=${(t) => this.handleResourceKeyDown(t, e)}
510
620
  >
511
- <span class=${t.isContainer ? "resource-grid-icon resource-grid-icon--container" : "resource-grid-icon"} aria-hidden="true">
512
- ${t.isContainer ? u`<icon-lucide-folder></icon-lucide-folder>` : u`<icon-lucide-file></icon-lucide-file>`}
621
+ <span class=${e.isContainer ? "resource-grid-icon resource-grid-icon--container" : "resource-grid-icon"} aria-hidden="true">
622
+ ${e.isContainer ? h`<icon-lucide-folder></icon-lucide-folder>` : h`<icon-lucide-file></icon-lucide-file>`}
513
623
  </span>
514
- ${t.isContainer ? u`<span class="resource-grid-label resource-grid-label--container">${n}</span>` : d}
624
+ ${e.isContainer ? h`<span class="resource-grid-label resource-grid-label--container">${t}</span>` : g}
515
625
  <div class="resource-grid-item-footer">
516
- ${t.isContainer && r >= 0 ? u`<span class="container-member-count">${e(r)}</span>` : t.isContainer ? d : u`<span class="resource-grid-label">${n}</span>`}
517
- ${this.renderAccessIndicator(t)}
626
+ ${e.isContainer ? r < 0 ? g : h`<span class="container-member-count">${n(r)}</span>` : h`<span class="resource-grid-label">${t}</span>`}
627
+ ${this.renderAccessIndicator(e)}
518
628
  </div>
519
- ${this.renderResourceActionsMenu(t, "grid")}
629
+ ${this.renderResourceActionsMenu(e, "grid")}
520
630
  </li>
521
631
  `;
522
632
  }
523
633
  renderGridView(e) {
524
- return u`
634
+ return h`
525
635
  <ul class="resource-grid" role="listbox" aria-label="Container resources">
526
- ${e.map((e) => this.renderGridItem(e))}
636
+ ${b(e, (e) => e.id, (e) => this.renderGridItem(e))}
527
637
  </ul>
528
638
  `;
529
639
  }
530
640
  renderEmptyContainer() {
531
- return this.searchQuery.trim() ? u`
641
+ return this.searchQuery.trim() ? h`
532
642
  <div class="folder-pane-container-empty-message" role="status">
533
643
  <h2 class="folder-pane-container-empty-message-title">No resources match this search.</h2>
534
644
  </div>
535
- ` : u`
645
+ ` : h`
536
646
  <div class="folder-pane-container-empty-message" role="status">
537
647
  <div class="folder-pane-container-empty-message-icon" aria-hidden="true">
538
648
  <icon-lucide-file-box></icon-lucide-file-box>
@@ -544,84 +654,101 @@ new (ue = (g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v =
544
654
  }
545
655
  render() {
546
656
  let e = this.visibleResources;
547
- return u`
548
- <div class="folder-pane-container-content">
549
- ${this.loadError ? u`<div class="folder-pane-container-error" role="alert">${this.loadError}</div>` : d}
550
- ${this.loading ? u`<div class="folder-pane-container-loading" role="status">Loading resources…</div>` : e.length > 0 ? this.view === "grid" ? this.renderGridView(e) : this.renderListView(e) : this.renderEmptyContainer()}
657
+ return h`
658
+ <div
659
+ class="folder-pane-container-content"
660
+ data-drag-active=${String(this.dragActive)}
661
+ @dragenter=${this.handleFileDragEnter}
662
+ @dragleave=${this.handleFileDragLeave}
663
+ @dragover=${this.handleFileDragOver}
664
+ @drop=${this.handleFileDrop}
665
+ >
666
+ ${this.loadError ? h`<div class="folder-pane-container-error" role="alert">${this.loadError}</div>` : g}
667
+ ${this.loading ? h`<div class="folder-pane-container-loading" role="status">Loading resources…</div>` : e.length > 0 ? this.view === "grid" ? this.renderGridView(e) : this.renderListView(e) : this.renderEmptyContainer()}
551
668
  </div>
552
669
  `;
553
670
  }
554
- }, {e: [te, re, ae, M, P, I, R, B, H, W, K, se, le, k], c: [$, A]} = me(h, [
671
+ }, {e: [ie, oe, z, V, U, G, q, ce, ue, fe, me, ge, ve, be, J, ee], c: [$, te]} = Ee(S, [
555
672
  [
556
- ee,
673
+ re,
557
674
  1,
558
675
  "subject"
559
676
  ],
560
677
  [
561
- ne,
678
+ ae,
562
679
  1,
563
680
  "resourceLogic"
564
681
  ],
565
682
  [
566
- ie,
683
+ R,
567
684
  1,
568
685
  "browserContext"
569
686
  ],
570
687
  [
571
- oe,
688
+ B,
572
689
  1,
573
690
  "view"
574
691
  ],
575
692
  [
576
- N,
693
+ H,
577
694
  1,
578
695
  "searchQuery"
579
696
  ],
580
697
  [
581
- F,
698
+ W,
582
699
  1,
583
- "hideRootSpecialFolders"
700
+ "canUpload"
584
701
  ],
585
702
  [
586
- L,
703
+ K,
704
+ 1,
705
+ "uploadBusy"
706
+ ],
707
+ [
708
+ se,
587
709
  1,
588
710
  "resourceActionMenuItems"
589
711
  ],
590
712
  [
591
- z,
713
+ le,
592
714
  1,
593
715
  "resources"
594
716
  ],
595
717
  [
596
- V,
718
+ de,
597
719
  1,
598
720
  "optimisticResources"
599
721
  ],
600
722
  [
601
- U,
723
+ pe,
602
724
  1,
603
725
  "resourceAccess"
604
726
  ],
605
727
  [
606
- G,
728
+ he,
607
729
  1,
608
730
  "memberLoad"
609
731
  ],
610
732
  [
611
- q,
733
+ _e,
612
734
  1,
613
735
  "loading"
614
736
  ],
615
737
  [
616
- ce,
738
+ ye,
617
739
  1,
618
740
  "loadError"
741
+ ],
742
+ [
743
+ xe,
744
+ 1,
745
+ "dragActive"
619
746
  ]
620
- ], j, 0, void 0, o), h), m = class extends ve {
747
+ ], ne, 0, void 0, l), S), x = class extends je {
621
748
  constructor() {
622
- super($), Z(this, "styles", i), A();
749
+ super($), Q(this, "styles", c), te();
623
750
  }
624
- }, Z(m, ue, void 0), m)();
751
+ }, Q(x, Se, void 0), x)();
625
752
  export { $ as default };
626
753
 
627
754
  //# sourceMappingURL=FolderPaneContainer.esm.js.map