solid-panes 4.4.2-5 → 4.4.2-6

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 (142) hide show
  1. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +2 -0
  2. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +1 -0
  3. package/dist/_virtual/~icons/lucide/arrow-left.esm.js +11 -0
  4. package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +1 -0
  5. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +2 -0
  6. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +1 -0
  7. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +11 -0
  8. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +1 -0
  9. package/dist/_virtual/~icons/lucide/globe.cjs.js +2 -0
  10. package/dist/_virtual/~icons/lucide/globe.cjs.js.map +1 -0
  11. package/dist/_virtual/~icons/lucide/globe.esm.js +11 -0
  12. package/dist/_virtual/~icons/lucide/globe.esm.js.map +1 -0
  13. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +2 -0
  14. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +1 -0
  15. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +11 -0
  16. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +1 -0
  17. package/dist/_virtual/~icons/lucide/pencil.cjs.js +2 -0
  18. package/dist/_virtual/~icons/lucide/pencil.cjs.js.map +1 -0
  19. package/dist/_virtual/~icons/lucide/pencil.esm.js +11 -0
  20. package/dist/_virtual/~icons/lucide/pencil.esm.js.map +1 -0
  21. package/dist/_virtual/~icons/lucide/share-2.cjs.js +2 -0
  22. package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +1 -0
  23. package/dist/_virtual/~icons/lucide/share-2.esm.js +11 -0
  24. package/dist/_virtual/~icons/lucide/share-2.esm.js.map +1 -0
  25. package/dist/_virtual/~icons/lucide/trash-2.cjs.js +2 -0
  26. package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +1 -0
  27. package/dist/_virtual/~icons/lucide/trash-2.esm.js +11 -0
  28. package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +1 -0
  29. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +14 -0
  30. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -0
  31. package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +19 -0
  32. package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +1 -0
  33. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +292 -0
  34. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +1 -0
  35. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +2 -0
  36. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +1 -0
  37. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +7 -0
  38. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +1 -0
  39. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +22 -0
  40. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -0
  41. package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +15 -0
  42. package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +1 -0
  43. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +266 -0
  44. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +1 -0
  45. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +2 -0
  46. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +1 -0
  47. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +7 -0
  48. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +1 -0
  49. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +19 -0
  50. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -0
  51. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +19 -0
  52. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +1 -0
  53. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +321 -0
  54. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +1 -0
  55. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +2 -0
  56. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +1 -0
  57. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +7 -0
  58. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +1 -0
  59. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +13 -0
  60. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -0
  61. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +36 -0
  62. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -0
  63. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +468 -0
  64. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -0
  65. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +2 -0
  66. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +1 -0
  67. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +7 -0
  68. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +1 -0
  69. package/dist/components/file-explorer-header/helper.cjs.js +2 -0
  70. package/dist/components/file-explorer-header/helper.cjs.js.map +1 -0
  71. package/dist/components/file-explorer-header/helper.d.ts +15 -0
  72. package/dist/components/file-explorer-header/helper.d.ts.map +1 -0
  73. package/dist/components/file-explorer-header/helper.esm.js +64 -0
  74. package/dist/components/file-explorer-header/helper.esm.js.map +1 -0
  75. package/dist/components/file-explorer-header/types.d.ts +2 -0
  76. package/dist/components/file-explorer-header/types.d.ts.map +1 -0
  77. package/dist/components/header/Header.cjs.js +1 -1
  78. package/dist/components/header/Header.cjs.js.map +1 -1
  79. package/dist/components/header/Header.esm.js +3 -3
  80. package/dist/components/navbar/Navbar.cjs.js +1 -1
  81. package/dist/components/navbar/Navbar.cjs.js.map +1 -1
  82. package/dist/components/navbar/Navbar.esm.js +3 -3
  83. package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js +16 -0
  84. package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js.map +1 -0
  85. package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +8 -0
  86. package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +1 -0
  87. package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js +215 -0
  88. package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js.map +1 -0
  89. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +18 -0
  90. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -0
  91. package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +16 -0
  92. package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +1 -0
  93. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +260 -0
  94. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +1 -0
  95. package/dist/dashboard/basicPreferences.cjs.js +1 -1
  96. package/dist/dashboard/basicPreferences.cjs.js.map +1 -1
  97. package/dist/dashboard/dashboardPane.cjs.js +1 -1
  98. package/dist/dashboard/dashboardPane.cjs.js.map +1 -1
  99. package/dist/home/homePane.cjs.js +1 -1
  100. package/dist/home/homePane.cjs.js.map +1 -1
  101. package/dist/internal/internalPane2.cjs.js +1 -1
  102. package/dist/internal/internalPane2.cjs.js.map +1 -1
  103. package/dist/mainPage/header.cjs.js +1 -1
  104. package/dist/mainPage/header.cjs.js.map +1 -1
  105. package/dist/outline/manager2.cjs.js +1 -2
  106. package/dist/outline/manager2.cjs.js.map +1 -1
  107. package/dist/outline/manager2.esm.js +351 -394
  108. package/dist/outline/manager2.esm.js.map +1 -1
  109. package/dist/outline/propertyViews.cjs.js +1 -1
  110. package/dist/outline/propertyViews.cjs.js.map +1 -1
  111. package/dist/outline/sourcePaneIcon.d.ts +2 -0
  112. package/dist/outline/sourcePaneIcon.d.ts.map +1 -0
  113. package/dist/pad/padPane2.cjs.js +1 -1
  114. package/dist/pad/padPane2.cjs.js.map +1 -1
  115. package/dist/sharing/sharingPane.cjs.js +1 -1
  116. package/dist/sharing/sharingPane.cjs.js.map +1 -1
  117. package/dist/social/editProfileDetails.cjs.js +1 -1
  118. package/dist/social/editProfileDetails.cjs.js.map +1 -1
  119. package/dist/social/editProfileDetails.esm.js +1 -1
  120. package/dist/social/socialPane2.cjs.js +1 -1
  121. package/dist/social/socialPane2.cjs.js.map +1 -1
  122. package/dist/social/socialSections.cjs.js +1 -1
  123. package/dist/social/socialSections.cjs.js.map +1 -1
  124. package/dist/social/triage.cjs.js +1 -1
  125. package/dist/social/triage.cjs.js.map +1 -1
  126. package/dist/tabbed/tabbedPane.cjs.js +1 -1
  127. package/dist/tabbed/tabbedPane.cjs.js.map +1 -1
  128. package/dist/trustedApplications/trustedApplications.dom.cjs.js +1 -1
  129. package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
  130. package/dist/trustedApplications/trustedApplications.utils.cjs.js +1 -1
  131. package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
  132. package/dist/trustedApplications/trustedApplications.view.cjs.js +1 -1
  133. package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -1
  134. package/dist/utils/podUtils.cjs.js +1 -1
  135. package/dist/utils/podUtils.cjs.js.map +1 -1
  136. package/dist/utils/webIdUtils.cjs.js +1 -1
  137. package/dist/utils/webIdUtils.cjs.js.map +1 -1
  138. package/dist/versionInfo.cjs.js +1 -1
  139. package/dist/versionInfo.cjs.js.map +1 -1
  140. package/dist/versionInfo.esm.js +3 -3
  141. package/dist/versionInfo.esm.js.map +1 -1
  142. package/package.json +3 -3
@@ -0,0 +1,468 @@
1
+ import "./FileExplorerHeader.esm.js";
2
+ import e from "./FileExplorerProvider.styles.esm.js";
3
+ import t from "../../icons/person.esm.js";
4
+ import n from "../../icons/friends.esm.js";
5
+ import { WebComponent as r, fileExplorerContext as i, utils as a } from "solid-ui";
6
+ import { html as o, nothing as s } from "lit";
7
+ import { provide as c } from "@lit/context";
8
+ import { customElement as l, property as u, state as d } from "lit/decorators.js";
9
+ //#region src/components/file-explorer-header/FileExplorerProvider.ts
10
+ var f, p, 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, fe, pe, me, he, ge, _e, ve;
11
+ function J(e, t, n) {
12
+ ye(e, t), t.set(e, n);
13
+ }
14
+ function ye(e, t) {
15
+ if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
16
+ }
17
+ function Y(e, t, n) {
18
+ return e.set(be(e, t), n), n;
19
+ }
20
+ function X(e, t) {
21
+ return e.get(be(e, t));
22
+ }
23
+ function be(e, t, n) {
24
+ if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
25
+ throw TypeError("Private element is not present on this object");
26
+ }
27
+ function Z(e, t, n) {
28
+ return (t = Q(t)) in e ? Object.defineProperty(e, t, {
29
+ value: n,
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0
33
+ }) : e[t] = n, e;
34
+ }
35
+ function xe(e, t, n, r, i, a) {
36
+ function o(e, t, n) {
37
+ return function(r, i) {
38
+ return n && n(r), e[t].call(r, i);
39
+ };
40
+ }
41
+ function s(e, t) {
42
+ for (var n = 0; n < e.length; n++) e[n].call(t);
43
+ return t;
44
+ }
45
+ function c(e, t, n, r) {
46
+ if (typeof e != "function" && (r || e !== void 0)) throw TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined"));
47
+ return e;
48
+ }
49
+ function l(e, t, n, r, i, a, s, l, u, d, f, p, m) {
50
+ function h(e) {
51
+ if (!m(e)) throw TypeError("Attempted to access private element on non-instance");
52
+ }
53
+ var g, _ = t[0], v = t[3], y = !l;
54
+ if (!y) {
55
+ n || Array.isArray(_) || (_ = [_]);
56
+ var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
57
+ d ? (f || p ? b = {
58
+ get: Ce(function() {
59
+ return v(this);
60
+ }, r, "get"),
61
+ set: function(e) {
62
+ t[4](this, e);
63
+ }
64
+ } : b[S] = v, f || Ce(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
65
+ }
66
+ for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
67
+ var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
68
+ kind: [
69
+ "field",
70
+ "accessor",
71
+ "method",
72
+ "getter",
73
+ "setter",
74
+ "class"
75
+ ][i],
76
+ name: r,
77
+ metadata: a,
78
+ addInitializer: function(e, t) {
79
+ if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
80
+ c(t, "An initializer", "be", !0), s.push(t);
81
+ }.bind(null, D)
82
+ };
83
+ try {
84
+ if (y) (g = c(T.call(E, C, O), "class decorators", "return")) && (C = g);
85
+ else {
86
+ var k, A;
87
+ O.static = u, O.private = d, d ? i === 2 ? k = function(e) {
88
+ return h(e), b.value;
89
+ } : (i < 4 && (k = o(b, "get", h)), i !== 3 && (A = o(b, "set", h))) : (k = function(e) {
90
+ return e[r];
91
+ }, (i < 2 || i === 4) && (A = function(e, t) {
92
+ e[r] = t;
93
+ }));
94
+ var j = O.access = { has: d ? m.bind() : function(e) {
95
+ return r in e;
96
+ } };
97
+ if (k && (j.get = k), A && (j.set = A), C = T.call(E, p ? {
98
+ get: b.get,
99
+ set: b.set
100
+ } : b[S], O), p) {
101
+ if (typeof C == "object" && C) (g = c(C.get, "accessor.get")) && (b.get = g), (g = c(C.set, "accessor.set")) && (b.set = g), (g = c(C.init, "accessor.init")) && x.push(g);
102
+ else if (C !== void 0) throw TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
103
+ } else c(C, (f ? "field" : "method") + " decorators", "return") && (f ? x.push(C) : b[S] = C);
104
+ }
105
+ } finally {
106
+ D.v = !0;
107
+ }
108
+ }
109
+ return (f || p) && l.push(function(e, t) {
110
+ for (var n = x.length - 1; n >= 0; n--) t = x[n].call(e, t);
111
+ return t;
112
+ }), f || y || (d ? p ? l.push(o(b, "get"), o(b, "set")) : l.push(i === 2 ? b[S] : o.call.bind(b[S])) : Object.defineProperty(e, r, b)), C;
113
+ }
114
+ function u(e, t) {
115
+ return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
116
+ configurable: !0,
117
+ enumerable: !0,
118
+ value: t
119
+ });
120
+ }
121
+ if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
122
+ var f = Object.create(d ?? null), p = function(e, t, n, r) {
123
+ var i, a, o = [], c = function(t) {
124
+ return we(t) === e;
125
+ }, u = /* @__PURE__ */ new Map();
126
+ function d(e) {
127
+ e && o.push(s.bind(null, e));
128
+ }
129
+ for (var f = 0; f < t.length; f++) {
130
+ var p = t[f];
131
+ if (Array.isArray(p)) {
132
+ var m = p[1], h = p[2], g = p.length > 3, _ = 16 & m, v = !!(8 & m), y = (m &= 7) == 0, b = h + "/" + v;
133
+ if (!y && !g) {
134
+ var x = u.get(b);
135
+ 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);
136
+ u.set(b, !(m > 2) || m);
137
+ }
138
+ 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);
139
+ }
140
+ }
141
+ return d(i), d(a), o;
142
+ }(e, t, i, f);
143
+ return n.length || u(e, f), {
144
+ e: p,
145
+ get c() {
146
+ var t = [];
147
+ return n.length && [u(l(e, [n], r, e.name, 5, f, t), f), s.bind(null, t, e)];
148
+ }
149
+ };
150
+ }
151
+ function Q(e) {
152
+ var t = Se(e, "string");
153
+ return typeof t == "symbol" ? t : t + "";
154
+ }
155
+ function Se(e, t) {
156
+ if (typeof e != "object" || !e) return e;
157
+ var n = e[Symbol.toPrimitive];
158
+ if (n !== void 0) {
159
+ var r = n.call(e, t || "default");
160
+ if (typeof r != "object") return r;
161
+ throw TypeError("@@toPrimitive must return a primitive value.");
162
+ }
163
+ return (t === "string" ? String : Number)(e);
164
+ }
165
+ function Ce(e, t, n) {
166
+ typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
167
+ try {
168
+ Object.defineProperty(e, "name", {
169
+ configurable: !0,
170
+ value: n ? n + " " + t : t
171
+ });
172
+ } catch {}
173
+ return e;
174
+ }
175
+ function we(e) {
176
+ if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
177
+ return e;
178
+ }
179
+ function Te(e) {
180
+ return e;
181
+ }
182
+ var Ee = t, De = n;
183
+ function Oe(e) {
184
+ return {
185
+ store: e.store,
186
+ subjectUri: e.subjectUri,
187
+ pane: e.pane,
188
+ soloPane: e.soloPane,
189
+ onBack: e.onBack,
190
+ openPane: e.openPane,
191
+ handleSharingClick: e.handleSharingClick,
192
+ paneSupportsEditing: e.paneSupportsEditing,
193
+ edit: e.edit
194
+ };
195
+ }
196
+ ee = [l("file-explorer-provider")];
197
+ var $;
198
+ new (_e = (m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v = /*#__PURE__*/ new WeakMap(), y = /*#__PURE__*/ new WeakMap(), b = /*#__PURE__*/ new WeakMap(), 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(), k = /*#__PURE__*/ new WeakMap(), ve = (te = u({ attribute: !1 }), re = u({ attribute: !1 }), ae = u({ attribute: !1 }), M = u({ attribute: !1 }), P = u({ attribute: !1 }), I = u({ attribute: !1 }), R = u({ attribute: !1 }), B = u({ attribute: !1 }), H = u({ attribute: !1 }), W = u({ attribute: !1 }), K = d(), se = d(), le = d(), de = d(), pe = d(), he = c({ context: i }), "context"), p = class extends r {
199
+ constructor(...e) {
200
+ super(...e), J(this, m, (A(this), ne(this, void 0))), J(this, h, ie(this, void 0)), J(this, g, oe(this, void 0)), J(this, _, N(this, [])), J(this, v, F(this, void 0)), J(this, y, L(this, {})), J(this, b, z(this, !0)), J(this, x, V(this, void 0)), J(this, S, U(this, void 0)), J(this, C, G(this, void 0)), J(this, w, q(this, [])), J(this, T, ce(this, !1)), J(this, E, ue(this, !1)), J(this, D, fe(this, !1)), Z(this, "beginEditingInSourcePane", () => {
201
+ this.querySelector("source-pane-source-provider")?.beginEditing?.();
202
+ }), J(this, O, me(this, {
203
+ onEdit: this.beginEditingInSourcePane,
204
+ isDirty: !1,
205
+ updateDirtyState: (e) => {
206
+ this.isDirty !== e && (this.isDirty = e, this.edit = {
207
+ ...this.edit,
208
+ isDirty: e
209
+ }, this.refreshFileExplorerContextValue());
210
+ }
211
+ })), J(this, k, ge(this, Oe({
212
+ store: this.context?.session.store,
213
+ subjectUri: this.subjectUri,
214
+ pane: this.pane,
215
+ soloPane: this.soloPane,
216
+ onBack: this.onBack,
217
+ openPane: this.openPane,
218
+ handleSharingClick: this.handleSharingClick,
219
+ paneSupportsEditing: !1,
220
+ edit: this.edit
221
+ })));
222
+ }
223
+ get [ve]() {
224
+ return X(m, this);
225
+ }
226
+ set context(e) {
227
+ Y(m, this, e);
228
+ }
229
+ get subjectUri() {
230
+ return X(h, this);
231
+ }
232
+ set subjectUri(e) {
233
+ Y(h, this, e);
234
+ }
235
+ get onBack() {
236
+ return X(g, this);
237
+ }
238
+ set onBack(e) {
239
+ Y(g, this, e);
240
+ }
241
+ get relevantPanes() {
242
+ return X(_, this);
243
+ }
244
+ set relevantPanes(e) {
245
+ Y(_, this, e);
246
+ }
247
+ get pane() {
248
+ return X(v, this);
249
+ }
250
+ set pane(e) {
251
+ Y(v, this, e);
252
+ }
253
+ get paneRenderOptions() {
254
+ return X(y, this);
255
+ }
256
+ set paneRenderOptions(e) {
257
+ Y(y, this, e);
258
+ }
259
+ get showHeader() {
260
+ return X(b, this);
261
+ }
262
+ set showHeader(e) {
263
+ Y(b, this, e);
264
+ }
265
+ get handleSharingClick() {
266
+ return X(x, this);
267
+ }
268
+ set handleSharingClick(e) {
269
+ Y(x, this, e);
270
+ }
271
+ get soloPane() {
272
+ return X(S, this);
273
+ }
274
+ set soloPane(e) {
275
+ Y(S, this, e);
276
+ }
277
+ get openPane() {
278
+ return X(C, this);
279
+ }
280
+ set openPane(e) {
281
+ Y(C, this, e);
282
+ }
283
+ get menuItems() {
284
+ return X(w, this);
285
+ }
286
+ set menuItems(e) {
287
+ Y(w, this, e);
288
+ }
289
+ get isEditing() {
290
+ return X(T, this);
291
+ }
292
+ set isEditing(e) {
293
+ Y(T, this, e);
294
+ }
295
+ get isDirty() {
296
+ return X(E, this);
297
+ }
298
+ set isDirty(e) {
299
+ Y(E, this, e);
300
+ }
301
+ get paneSupportsEditing() {
302
+ return X(D, this);
303
+ }
304
+ set paneSupportsEditing(e) {
305
+ Y(D, this, e);
306
+ }
307
+ get edit() {
308
+ return X(O, this);
309
+ }
310
+ set edit(e) {
311
+ Y(O, this, e);
312
+ }
313
+ get fileExplorerContextValue() {
314
+ return X(k, this);
315
+ }
316
+ set fileExplorerContextValue(e) {
317
+ Y(k, this, e);
318
+ }
319
+ openSelectedPane(e) {
320
+ !this.context?.session.store || !this.subjectUri || (this.paneSupportsEditing = e.name === "source", this.pane = e);
321
+ }
322
+ getPaneIcon(e, t, n) {
323
+ if (e) return typeof e.icon == "function" ? e.icon(t, n) : e.icon;
324
+ }
325
+ async getPaneItems(e, t, n) {
326
+ let r = t.dom;
327
+ return await Promise.all(n.map(async (n) => {
328
+ let i = n.label(e, t), o = "";
329
+ o = n.name === "profile" ? Ee : n.name === "social" ? De : await this.getPaneIcon(n, e, t);
330
+ let s = a.AJARImage(o, i, i, r);
331
+ return s.setAttribute("slot", "left-icon"), {
332
+ label: i,
333
+ icon: s,
334
+ action: () => this.openPane?.(e, n.name)
335
+ };
336
+ }));
337
+ }
338
+ refreshFileExplorerContextValue() {
339
+ this.fileExplorerContextValue = Oe({
340
+ store: this.context?.session.store,
341
+ subjectUri: this.subjectUri,
342
+ pane: this.pane,
343
+ soloPane: this.soloPane,
344
+ onBack: this.onBack,
345
+ openPane: this.openPane,
346
+ handleSharingClick: this.handleSharingClick,
347
+ paneSupportsEditing: this.paneSupportsEditing,
348
+ edit: this.edit
349
+ });
350
+ }
351
+ async refreshMenuItems() {
352
+ let e = this.context?.session.store;
353
+ if (!e || !this.subjectUri) return;
354
+ let t = e.sym(this.subjectUri), n = await this.getPaneItems(t, this.context, this.relevantPanes);
355
+ this.menuItems = n;
356
+ }
357
+ willUpdate(e) {
358
+ if (super.willUpdate(e), !this.context?.session.store) throw Error("The element is missing the required `context.session.store` value. Ensure the `context` property is set.");
359
+ if (!this.subjectUri) throw Error("The element is missing the required `subjectUri` property.");
360
+ (e.has("subjectUri") || e.has("relevantPanes") || e.has("context")) && this.refreshMenuItems().catch((e) => {
361
+ console.warn("Failed to refresh menu items", e);
362
+ }), (e.has("pane") || e.has("subjectUri") || e.has("context")) && (this.paneSupportsEditing = this.pane?.name === "source"), (e.has("context") || e.has("subjectUri") || e.has("pane") || e.has("soloPane") || e.has("onBack") || e.has("openPane") || e.has("handleSharingClick") || e.has("pane") || e.has("isDirty")) && this.refreshFileExplorerContextValue();
363
+ }
364
+ render() {
365
+ let e = (this.context?.session.store).sym(this.subjectUri);
366
+ return o`
367
+ <div class="file-explorer-provider">
368
+ ${this.showHeader ? o`
369
+ <file-explorer-header
370
+ .paneIcon=${this.getPaneIcon(this.pane, e, this.context)}
371
+ .menuItems=${this.menuItems}
372
+ .paneSupportsEditing=${this.paneSupportsEditing}
373
+ ></file-explorer-header>
374
+ ` : s}
375
+ <slot class="pane"></slot>
376
+ </div>
377
+ `;
378
+ }
379
+ }, {e: [ne, ie, oe, N, F, L, z, V, U, G, q, ce, ue, fe, me, ge, A], c: [$, j]} = xe(p, [
380
+ [
381
+ te,
382
+ 1,
383
+ "context"
384
+ ],
385
+ [
386
+ re,
387
+ 1,
388
+ "subjectUri"
389
+ ],
390
+ [
391
+ ae,
392
+ 1,
393
+ "onBack"
394
+ ],
395
+ [
396
+ M,
397
+ 1,
398
+ "relevantPanes"
399
+ ],
400
+ [
401
+ P,
402
+ 1,
403
+ "pane"
404
+ ],
405
+ [
406
+ I,
407
+ 1,
408
+ "paneRenderOptions"
409
+ ],
410
+ [
411
+ R,
412
+ 1,
413
+ "showHeader"
414
+ ],
415
+ [
416
+ B,
417
+ 1,
418
+ "handleSharingClick"
419
+ ],
420
+ [
421
+ H,
422
+ 1,
423
+ "soloPane"
424
+ ],
425
+ [
426
+ W,
427
+ 1,
428
+ "openPane"
429
+ ],
430
+ [
431
+ K,
432
+ 1,
433
+ "menuItems"
434
+ ],
435
+ [
436
+ se,
437
+ 1,
438
+ "isEditing"
439
+ ],
440
+ [
441
+ le,
442
+ 1,
443
+ "isDirty"
444
+ ],
445
+ [
446
+ de,
447
+ 1,
448
+ "paneSupportsEditing"
449
+ ],
450
+ [
451
+ pe,
452
+ 1,
453
+ "edit"
454
+ ],
455
+ [
456
+ he,
457
+ 1,
458
+ "fileExplorerContextValue"
459
+ ]
460
+ ], ee, 0, void 0, r), p), f = class extends Te {
461
+ constructor() {
462
+ super($), Z(this, "styles", e), j();
463
+ }
464
+ }, Z(f, _e, void 0), f)();
465
+ //#endregion
466
+ export { $ as default };
467
+
468
+ //# sourceMappingURL=FileExplorerProvider.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileExplorerProvider.esm.js","names":["html","nothing","utils","WebComponent","provide","fileExplorerContext","customElement","property","state","styles","personIcon","friendsIcon","PERSON_ICON","FRIENDS_ICON","createFileExplorerContextValue","value","store","subjectUri","pane","soloPane","onBack","openPane","handleSharingClick","paneSupportsEditing","edit","_classDecs","_FileExplorerProvider","_FileExplorerProvider2","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_ref","_contextDecs","attribute","_subjectUriDecs","_onBackDecs","_relevantPanesDecs","_paneDecs","_paneRenderOptionsDecs","_showHeaderDecs","_handleSharingClickDecs","_soloPaneDecs","_openPaneDecs","_menuItemsDecs","_isEditingDecs","_isDirtyDecs","_paneSupportsEditingDecs","_editDecs","_fileExplorerContextValueDecs","context","_FileExplorerProvider3","FileExplorerProvider","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_context","undefined","_init_subjectUri","_init_onBack","_init_relevantPanes","_init_pane","_init_paneRenderOptions","_init_showHeader","_init_handleSharingClick","_init_soloPane","_init_openPane","_init_menuItems","_init_isEditing","_init_isDirty","_init_paneSupportsEditing","_defineProperty","sourceProvider","querySelector","beginEditing","_init_edit","onEdit","beginEditingInSourcePane","isDirty","updateDirtyState","dirty","refreshFileExplorerContextValue","_init_fileExplorerContextValue","session","_classPrivateFieldGet","v","_classPrivateFieldSet","relevantPanes","paneRenderOptions","showHeader","menuItems","isEditing","fileExplorerContextValue","openSelectedPane","name","getPaneIcon","subject","icon","getPaneItems","dom","Promise","all","map","label","iconSrc","AJARImage","setAttribute","action","refreshMenuItems","sym","willUpdate","changedProperties","Error","has","catch","error","console","warn","render","e","c","_initClass","_applyDecs","_Class","_identity","default"],"sources":["../../../src/components/file-explorer-header/FileExplorerProvider.ts"],"sourcesContent":["import { html, nothing, type PropertyValues } from 'lit'\nimport type { NamedNode, LiveStore } from 'rdflib'\nimport { DataBrowserContext, type PaneDefinition } from 'pane-registry'\nimport { utils, WebComponent } from 'solid-ui'\nimport { provide } from '@lit/context'\nimport { fileExplorerContext, type FileExplorerContext, type FileExplorerEdit } from 'solid-ui'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport './FileExplorerHeader'\nimport styles from './FileExplorerProvider.styles.css'\nimport personIcon from '../../icons/person.svg'\nimport friendsIcon from '../../icons/friends.svg'\n\nconst PERSON_ICON = personIcon\nconst FRIENDS_ICON = friendsIcon\n\nfunction createFileExplorerContextValue (value: {\n store: LiveStore | undefined\n subjectUri: string | undefined\n pane?: PaneDefinition\n soloPane?: boolean\n onBack?: () => void\n openPane?: (subject: NamedNode, paneName: string) => void\n handleSharingClick?: () => void\n paneSupportsEditing?: boolean\n edit?: {\n onEdit?: () => void\n isDirty?: boolean\n updateDirtyState?: (dirty: boolean) => void\n }\n}): FileExplorerContext {\n return {\n store: value.store as LiveStore,\n subjectUri: value.subjectUri,\n pane: value.pane,\n soloPane: value.soloPane,\n onBack: value.onBack,\n openPane: value.openPane,\n handleSharingClick: value.handleSharingClick,\n paneSupportsEditing: value.paneSupportsEditing,\n edit: value.edit\n }\n}\n@customElement('file-explorer-provider')\nexport default class FileExplorerProvider extends WebComponent {\n static styles = styles\n\n @property({ attribute: false })\n accessor context: DataBrowserContext | undefined = undefined\n\n @property({ attribute: false })\n accessor subjectUri: string | undefined = undefined\n\n @property({ attribute: false })\n accessor onBack: (() => void) | undefined = undefined\n\n @property({ attribute: false })\n accessor relevantPanes: PaneDefinition[] = []\n\n @property({ attribute: false })\n accessor pane: PaneDefinition | undefined = undefined\n\n @property({ attribute: false })\n accessor paneRenderOptions: Record<string, unknown> = {}\n\n @property({ attribute: false })\n accessor showHeader: boolean = true\n\n @property({ attribute: false })\n accessor handleSharingClick: (() => void) | undefined = undefined\n\n // TODO: Need to research this more, brought it over from manager.\n @property({ attribute: false })\n accessor soloPane: boolean | undefined = undefined\n\n @property({ attribute: false })\n accessor openPane: ((subject: NamedNode, paneName: string) => void) | undefined = undefined\n\n @state()\n accessor menuItems: Array<{ label: string, icon?: HTMLElement, action: (event: Event) => void }> = []\n\n @state()\n accessor isEditing: boolean = false\n\n @state()\n accessor isDirty: boolean = false\n\n @state()\n accessor paneSupportsEditing: boolean = false\n\n // TODO: For now this works, but check if there is a better way.\n // because this means file explorer will know about the pane.\n // what if other panes want to use this. If so maybe we should\n // add more to the context to capture the provider for the pane that\n // will be editing... anyway this shouldn't be just for source pane.\n private beginEditingInSourcePane = () => {\n const sourceProvider = this.querySelector('source-pane-source-provider') as {\n beginEditing?: () => void\n } | null\n\n sourceProvider?.beginEditing?.()\n }\n\n // TODO: same as below. on Edit should be something more generic\n @state()\n accessor edit: FileExplorerEdit = {\n onEdit: this.beginEditingInSourcePane,\n isDirty: false,\n updateDirtyState: (dirty: boolean) => {\n if (this.isDirty === dirty) return\n\n this.isDirty = dirty\n this.edit = {\n ...this.edit,\n isDirty: dirty\n }\n this.refreshFileExplorerContextValue()\n }\n }\n\n @provide({ context: fileExplorerContext })\n accessor fileExplorerContextValue: FileExplorerContext = createFileExplorerContextValue({\n store: this.context?.session.store as LiveStore,\n subjectUri: this.subjectUri,\n pane: this.pane,\n soloPane: this.soloPane,\n onBack: this.onBack,\n openPane: this.openPane,\n handleSharingClick: this.handleSharingClick,\n paneSupportsEditing: false,\n edit: this.edit\n })\n\n // Change the state for the pane so it can show the new icon.\n openSelectedPane (pane: PaneDefinition) {\n const store = this.context?.session.store as LiveStore\n if (!store || !this.subjectUri) return\n this.paneSupportsEditing = pane.name === 'source'\n this.pane = pane\n }\n\n private getPaneIcon (pane, subject, context) {\n if (!pane) return undefined\n\n const icon = typeof pane.icon === 'function'\n ? pane.icon(subject, context)\n : pane.icon\n return icon\n }\n\n private async getPaneItems (subject, context, relevantPanes) {\n const dom = context.dom\n const menuItems = await Promise.all(relevantPanes.map(async pane => {\n const label = pane.label(subject, context)\n\n let iconSrc = ''\n if (pane.name === 'profile') {\n iconSrc = PERSON_ICON\n } else if (pane.name === 'social') {\n iconSrc = FRIENDS_ICON\n } else {\n iconSrc = await this.getPaneIcon(pane, subject, context)\n }\n\n const icon = utils.AJARImage(iconSrc, label, label, dom)\n icon.setAttribute('slot', 'left-icon')\n\n return {\n label,\n icon,\n action: () => this.openPane?.(subject, pane.name)\n }\n }))\n return menuItems\n }\n\n private refreshFileExplorerContextValue () {\n this.fileExplorerContextValue = createFileExplorerContextValue({\n store: this.context?.session.store as LiveStore,\n subjectUri: this.subjectUri,\n pane: this.pane,\n soloPane: this.soloPane,\n onBack: this.onBack,\n openPane: this.openPane,\n handleSharingClick: this.handleSharingClick,\n paneSupportsEditing: this.paneSupportsEditing,\n edit: this.edit\n })\n }\n\n private async refreshMenuItems () {\n const store = this.context?.session.store as LiveStore\n if (!store || !this.subjectUri) return\n\n const subject = store.sym(this.subjectUri)\n const menuItems = await this.getPaneItems(subject, this.context as DataBrowserContext, this.relevantPanes)\n\n this.menuItems = menuItems\n }\n\n protected willUpdate (changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties)\n const store = this.context?.session.store as LiveStore\n if (!store) {\n throw new Error('The element is missing the required `context.session.store` value. Ensure the `context` property is set.')\n }\n if (!this.subjectUri) {\n throw new Error('The element is missing the required `subjectUri` property.')\n }\n\n if (\n changedProperties.has('subjectUri') ||\n changedProperties.has('relevantPanes') ||\n changedProperties.has('context')\n ) {\n this.refreshMenuItems().catch(error => {\n console.warn('Failed to refresh menu items', error)\n })\n }\n\n if (changedProperties.has('pane') || changedProperties.has('subjectUri') || changedProperties.has('context')) {\n this.paneSupportsEditing = this.pane?.name === 'source'\n }\n\n if (\n changedProperties.has('context') ||\n changedProperties.has('subjectUri') ||\n changedProperties.has('pane') ||\n changedProperties.has('soloPane') ||\n changedProperties.has('onBack') ||\n changedProperties.has('openPane') ||\n changedProperties.has('handleSharingClick') ||\n changedProperties.has('pane') ||\n changedProperties.has('isDirty')\n ) {\n this.refreshFileExplorerContextValue()\n }\n }\n\n render () {\n const store = this.context?.session.store as LiveStore\n const subject = store.sym(this.subjectUri as string)\n return html`\n <div class=\"file-explorer-provider\">\n ${this.showHeader\n ? html`\n <file-explorer-header\n .paneIcon=${this.getPaneIcon(this.pane, subject, this.context as DataBrowserContext)}\n .menuItems=${this.menuItems}\n .paneSupportsEditing=${this.paneSupportsEditing}\n ></file-explorer-header>\n `\n : nothing}\n <slot class=\"pane\"></slot>\n </div>\n `\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAMY,KAAcF,GACdG,KAAeF;AAErB,SAASG,GAAgCC,GAcjB;CACtB,OAAO;EACLC,OAAOD,EAAMC;EACbC,YAAYF,EAAME;EAClBC,MAAMH,EAAMG;EACZC,UAAUJ,EAAMI;EAChBC,QAAQL,EAAMK;EACdC,UAAUN,EAAMM;EAChBC,oBAAoBP,EAAMO;EAC1BC,qBAAqBR,EAAMQ;EAC3BC,MAAMT,EAAMS;CACd;AACF;AAACC,KAAA,CACAnB,EAAc,wBAAwB,CAAC;AAAA,IAAAoB;AAAA,KAAAC,MAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,kBAAA,IAAAF,QAAA,GAAAG,kBAAA,IAAAH,QAAA,GAAAI,kBAAA,IAAAJ,QAAA,GAAAK,kBAAA,IAAAL,QAAA,GAAAM,kBAAA,IAAAN,QAAA,GAAAO,kBAAA,IAAAP,QAAA,GAAAQ,kBAAA,IAAAR,QAAA,GAAAS,kBAAA,IAAAT,QAAA,GAAAU,kBAAA,IAAAV,QA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AAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAArC,IAAA,GAAA,KAAA,GArNiDtB,CAAY,GAAA6D,IAAAyE,IAAA,cAAAC,GAAA;CAAAxE,cAAA;EAAA,MAAAxC,CAAA,GAAA2D,EAAA,MAAA,UAC5C5E,CAAM,GAAA8H,EAAA;CAAA;AAAA,GAAAlD,EAAAoD,GAAA9G,IAAA,KAAA,CAAA,GAAA8G,GAAA"}
@@ -0,0 +1,2 @@
1
+ var e=require("lit").css`:host{width:100%;min-width:0;display:block}:host .file-explorer-provider{flex-direction:column;width:100%;min-width:0;display:flex}:host slot.pane{flex:auto;width:100%;min-width:0;display:block;overflow:auto}`;exports.default=e;
2
+ //# sourceMappingURL=FileExplorerProvider.styles.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileExplorerProvider.styles.cjs.js","names":[],"sources":["../../../src/components/file-explorer-header/FileExplorerProvider.styles.css"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n min-width: 0;\n\n .file-explorer-provider {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n }\n\n slot.pane {\n display: block;\n flex: 1 1 auto;\n width: 100%;\n min-width: 0;\n overflow: auto;\n }\n}\n"],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { css as e } from "lit";
2
+ //#region src/components/file-explorer-header/FileExplorerProvider.styles.css
3
+ var t = e`:host{width:100%;min-width:0;display:block}:host .file-explorer-provider{flex-direction:column;width:100%;min-width:0;display:flex}:host slot.pane{flex:auto;width:100%;min-width:0;display:block;overflow:auto}`;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=FileExplorerProvider.styles.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileExplorerProvider.styles.esm.js","names":[],"sources":["../../../src/components/file-explorer-header/FileExplorerProvider.styles.css"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n min-width: 0;\n\n .file-explorer-provider {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n }\n\n slot.pane {\n display: block;\n flex: 1 1 auto;\n width: 100%;\n min-width: 0;\n overflow: auto;\n }\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ let e=require("solid-ui"),t=require("solid-logic");function n(e){let t=new Map;if(!e)return t;for(let n of e.split(`,`)){let e=n.trim().match(/^([A-Za-z]+)\s*=\s*"([^"]*)"$/);if(e){let[,n,r]=e,i=r.trim().split(/\s+/).filter(Boolean);t.set(n.toLowerCase(),new Set(i.map(e=>e.toLowerCase())))}}return t}function r(e){if(!e)return{canEdit:!1,isPublic:!1};let t=n(e),r=t.get(`user`)??new Set,i=t.get(`public`)??new Set;return{canEdit:r.has(`write`),isPublic:i.has(`read`)||i.has(`write`)}}function i(n,i,a){let o,s=!1,c=!1,l,u;if(a.headers&&a.headers.get(`content-type`)){o=a.headers.get(`content-type`)?.split(`;`)[0]??void 0;let t=r(a.headers.get(`wac-allow`));s=t.canEdit,c=t.isPublic,l=a.headers.get(`etag`)??void 0,u=n.anyValue(i,e.ns.dct(`modified`))||n.anyValue(i,e.ns.dc(`modified`))||void 0}else n.each(null,n.sym(`http://www.w3.org/2007/ont/link#requestedURI`),i).forEach(t=>{let a=n.any(t,n.sym(`http://www.w3.org/2007/ont/link#response`));if(a&&a.termType===`NamedNode`){o=n.anyValue(a,e.ns.httph(`content-type`))||void 0;let t=r(n.anyValue(a,e.ns.httph(`wac-allow`))||n.anyValue(a,e.ns.httph(`WAC-Allow`)));s=t.canEdit,c=t.isPublic,l=n.anyValue(a,e.ns.httph(`etag`))||void 0,u=n.anyValue(i,e.ns.dct(`modified`))||n.anyValue(i,e.ns.dc(`modified`))||void 0}});let d=n.any(i,t.ACL_LINK)?.value||void 0;return{contentType:o,canEdit:s,isPublic:c,aclUri:d,eTag:l,modified:u}}async function a(e,t){let n=await e.fetcher.webOperation(`GET`,t.uri),r=n.responseText;if(r===void 0)throw Error(`No text in response object!!`);let a=i(e,t,n);if(!a.contentType)throw Error(`No content-type available!`);return{content:r,metadata:a}}exports.fetchContentAndMetadata=a,exports.getResponseMetadata=i;
2
+ //# sourceMappingURL=helper.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.cjs.js","names":["ACL_LINK","ns","parseWacAllowHeader","headerValue","permissions","Map","entry","split","match","trim","permissionGroup","accessModes","modes","filter","Boolean","set","toLowerCase","Set","map","mode","deriveAccessFlags","wacAllow","canEdit","isPublic","userModes","get","publicModes","has","getResponseMetadata","store","subject","response","contentType","eTag","modified","headers","undefined","accessFlags","anyValue","dct","dc","reqs","each","sym","forEach","req","responseNode","any","termType","httph","aclUri","value","fetchContentAndMetadata","fetcher","webOperation","uri","content","responseText","Error","metadata"],"sources":["../../../src/components/file-explorer-header/helper.ts"],"sourcesContent":["// TODO: this code will need to be moved later\nimport { ACL_LINK } from 'solid-logic'\nimport { ns } from 'solid-ui'\nimport type { LiveStore, NamedNode } from 'rdflib'\n\nexport type FileExplorerResourceMetadata = {\n contentType: string | undefined\n canEdit: boolean\n isPublic: boolean\n aclUri: string | undefined\n eTag: string | undefined\n modified: string | undefined\n}\n\nfunction parseWacAllowHeader (headerValue: string | null | undefined) {\n const permissions = new Map<string, Set<string>>()\n if (!headerValue) return permissions\n\n for (const entry of headerValue.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) {\n const [, permissionGroup, accessModes] = match\n const modes = accessModes.trim().split(/\\s+/).filter(Boolean)\n permissions.set(permissionGroup.toLowerCase(), new Set(modes.map(mode => mode.toLowerCase())))\n }\n }\n\n return permissions\n}\n\nfunction deriveAccessFlags (wacAllow: string | null | undefined) {\n if (!wacAllow) {\n return { canEdit: false, isPublic: false }\n }\n\n const permissions = parseWacAllowHeader(wacAllow)\n const userModes = permissions.get('user') ?? new Set<string>()\n const publicModes = permissions.get('public') ?? new Set<string>()\n\n return {\n canEdit: userModes.has('write'),\n isPublic: publicModes.has('read') || publicModes.has('write')\n }\n}\n\nexport function getResponseMetadata (store: LiveStore, subject: NamedNode, response: Response): FileExplorerResourceMetadata {\n let contentType: string | undefined\n let canEdit = false\n let isPublic = false\n let eTag: string | undefined\n let modified: string | undefined\n\n if (response.headers && response.headers.get('content-type')) {\n contentType = response.headers.get('content-type')?.split(';')[0] ?? undefined\n const accessFlags = deriveAccessFlags(response.headers.get('wac-allow'))\n\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = response.headers.get('etag') ?? undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n } else {\n const reqs = store.each(\n null,\n store.sym('http://www.w3.org/2007/ont/link#requestedURI'),\n subject\n )\n reqs.forEach((req: any) => {\n const responseNode = store.any(\n req as any,\n store.sym('http://www.w3.org/2007/ont/link#response')\n )\n if (responseNode && responseNode.termType === 'NamedNode') {\n contentType = store.anyValue(responseNode as any, ns.httph('content-type')) || undefined\n const wacAllow = (store.anyValue(responseNode as any, ns.httph('wac-allow')) as string | undefined) ||\n (store.anyValue(responseNode as any, ns.httph('WAC-Allow')) as string | undefined)\n const accessFlags = deriveAccessFlags(wacAllow)\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = store.anyValue(responseNode as any, ns.httph('etag')) || undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n })\n }\n\n const aclUri = store.any(subject, ACL_LINK)?.value || undefined\n return { contentType, canEdit, isPublic, aclUri, eTag, modified }\n}\n\nexport async function fetchContentAndMetadata (store: LiveStore, subject: NamedNode): Promise<{ content: string, metadata: FileExplorerResourceMetadata }> {\n const fetcher = store.fetcher\n\n const response = await fetcher.webOperation('GET', subject.uri)\n const content = (response as Response & { responseText?: string }).responseText\n\n if (content === undefined) {\n throw new Error('No text in response object!!')\n }\n\n const metadata = getResponseMetadata(store, subject, response)\n if (!metadata.contentType) {\n throw new Error('No content-type available!')\n }\n\n return { content, metadata }\n}\n"],"mappings":"mDAcA,SAASE,EAAqBC,EAAwC,CACpE,IAAMC,EAAc,IAAIC,IACxB,GAAI,CAACF,EAAa,OAAOC,EAEzB,IAAK,IAAME,KAASH,EAAYI,MAAM,GAAG,EAAG,CAC1C,IAAMC,EAAQF,EAAMG,KAAK,CAAC,CAACD,MAAM,+BAA+B,EAChE,GAAIA,EAAO,CACT,GAAM,EAAGE,EAAiBC,GAAeH,EACnCI,EAAQD,EAAYF,KAAK,CAAC,CAACF,MAAM,KAAK,CAAC,CAACM,OAAOC,OAAO,EAC5DV,EAAYW,IAAIL,EAAgBM,YAAY,EAAG,IAAIC,IAAIL,EAAMM,IAAIC,GAAQA,EAAKH,YAAY,CAAC,CAAC,CAAC,CAC/F,CACF,CAEA,OAAOZ,CACT,CAEA,SAASgB,EAAmBC,EAAqC,CAC/D,GAAI,CAACA,EACH,MAAO,CAAEC,QAAS,GAAOC,SAAU,EAAM,EAG3C,IAAMnB,EAAcF,EAAoBmB,CAAQ,EAC1CG,EAAYpB,EAAYqB,IAAI,MAAM,GAAK,IAAIR,IAC3CS,EAActB,EAAYqB,IAAI,QAAQ,GAAK,IAAIR,IAErD,MAAO,CACLK,QAASE,EAAUG,IAAI,OAAO,EAC9BJ,SAAUG,EAAYC,IAAI,MAAM,GAAKD,EAAYC,IAAI,OAAO,CAC9D,CACF,CAEA,SAAgBC,EAAqBC,EAAkBC,EAAoBC,EAAkD,CAC3H,IAAIC,EACAV,EAAU,GACVC,EAAW,GACXU,EACAC,EAEJ,GAAIH,EAASI,SAAWJ,EAASI,QAAQV,IAAI,cAAc,EAAG,CAC5DO,EAAcD,EAASI,QAAQV,IAAI,cAAc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,UAASC,WAAU2B,SAAQjB,OAAMC,UAAS,CAClE,CAEA,eAAsBkB,EAAyBvB,EAAkBC,EAA0F,CAGzJ,IAAMC,EAAW,MAFDF,EAAMwB,QAESC,aAAa,MAAOxB,EAAQyB,GAAG,EACxDC,EAAWzB,EAAkD0B,aAEnE,GAAID,IAAYpB,IAAAA,GACd,MAAUsB,MAAM,8BAA8B,EAGhD,IAAMC,EAAW/B,EAAoBC,EAAOC,EAASC,CAAQ,EAC7D,GAAI,CAAC4B,EAAS3B,YACZ,MAAU0B,MAAM,4BAA4B,EAG9C,MAAO,CAAEF,UAASG,UAAS,CAC7B"}
@@ -0,0 +1,15 @@
1
+ import { LiveStore, NamedNode } from '../../../node_modules/rdflib';
2
+ export type FileExplorerResourceMetadata = {
3
+ contentType: string | undefined;
4
+ canEdit: boolean;
5
+ isPublic: boolean;
6
+ aclUri: string | undefined;
7
+ eTag: string | undefined;
8
+ modified: string | undefined;
9
+ };
10
+ export declare function getResponseMetadata(store: LiveStore, subject: NamedNode, response: Response): FileExplorerResourceMetadata;
11
+ export declare function fetchContentAndMetadata(store: LiveStore, subject: NamedNode): Promise<{
12
+ content: string;
13
+ metadata: FileExplorerResourceMetadata;
14
+ }>;
15
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/components/file-explorer-header/helper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElD,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAA;AAiCD,wBAAgB,mBAAmB,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,4BAA4B,CAyC3H;AAED,wBAAsB,uBAAuB,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,4BAA4B,CAAA;CAAE,CAAC,CAgBzJ"}
@@ -0,0 +1,64 @@
1
+ import { ns as e } from "solid-ui";
2
+ import { ACL_LINK as t } from "solid-logic";
3
+ //#region src/components/file-explorer-header/helper.ts
4
+ function n(e) {
5
+ let t = /* @__PURE__ */ new Map();
6
+ if (!e) return t;
7
+ for (let n of e.split(",")) {
8
+ let e = n.trim().match(/^([A-Za-z]+)\s*=\s*"([^"]*)"$/);
9
+ if (e) {
10
+ let [, n, r] = e, i = r.trim().split(/\s+/).filter(Boolean);
11
+ t.set(n.toLowerCase(), new Set(i.map((e) => e.toLowerCase())));
12
+ }
13
+ }
14
+ return t;
15
+ }
16
+ function r(e) {
17
+ if (!e) return {
18
+ canEdit: !1,
19
+ isPublic: !1
20
+ };
21
+ let t = n(e), r = t.get("user") ?? /* @__PURE__ */ new Set(), i = t.get("public") ?? /* @__PURE__ */ new Set();
22
+ return {
23
+ canEdit: r.has("write"),
24
+ isPublic: i.has("read") || i.has("write")
25
+ };
26
+ }
27
+ function i(n, i, a) {
28
+ let o, s = !1, c = !1, l, u;
29
+ if (a.headers && a.headers.get("content-type")) {
30
+ o = a.headers.get("content-type")?.split(";")[0] ?? void 0;
31
+ let t = r(a.headers.get("wac-allow"));
32
+ s = t.canEdit, c = t.isPublic, l = a.headers.get("etag") ?? void 0, u = n.anyValue(i, e.dct("modified")) || n.anyValue(i, e.dc("modified")) || void 0;
33
+ } else n.each(null, n.sym("http://www.w3.org/2007/ont/link#requestedURI"), i).forEach((t) => {
34
+ let a = n.any(t, n.sym("http://www.w3.org/2007/ont/link#response"));
35
+ if (a && a.termType === "NamedNode") {
36
+ o = n.anyValue(a, e.httph("content-type")) || void 0;
37
+ let t = r(n.anyValue(a, e.httph("wac-allow")) || n.anyValue(a, e.httph("WAC-Allow")));
38
+ s = t.canEdit, c = t.isPublic, l = n.anyValue(a, e.httph("etag")) || void 0, u = n.anyValue(i, e.dct("modified")) || n.anyValue(i, e.dc("modified")) || void 0;
39
+ }
40
+ });
41
+ let d = n.any(i, t)?.value || void 0;
42
+ return {
43
+ contentType: o,
44
+ canEdit: s,
45
+ isPublic: c,
46
+ aclUri: d,
47
+ eTag: l,
48
+ modified: u
49
+ };
50
+ }
51
+ async function a(e, t) {
52
+ let n = await e.fetcher.webOperation("GET", t.uri), r = n.responseText;
53
+ if (r === void 0) throw Error("No text in response object!!");
54
+ let a = i(e, t, n);
55
+ if (!a.contentType) throw Error("No content-type available!");
56
+ return {
57
+ content: r,
58
+ metadata: a
59
+ };
60
+ }
61
+ //#endregion
62
+ export { a as fetchContentAndMetadata, i as getResponseMetadata };
63
+
64
+ //# sourceMappingURL=helper.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.esm.js","names":["ACL_LINK","ns","parseWacAllowHeader","headerValue","permissions","Map","entry","split","match","trim","permissionGroup","accessModes","modes","filter","Boolean","set","toLowerCase","Set","map","mode","deriveAccessFlags","wacAllow","canEdit","isPublic","userModes","get","publicModes","has","getResponseMetadata","store","subject","response","contentType","eTag","modified","headers","undefined","accessFlags","anyValue","dct","dc","reqs","each","sym","forEach","req","responseNode","any","termType","httph","aclUri","value","fetchContentAndMetadata","fetcher","webOperation","uri","content","responseText","Error","metadata"],"sources":["../../../src/components/file-explorer-header/helper.ts"],"sourcesContent":["// TODO: this code will need to be moved later\nimport { ACL_LINK } from 'solid-logic'\nimport { ns } from 'solid-ui'\nimport type { LiveStore, NamedNode } from 'rdflib'\n\nexport type FileExplorerResourceMetadata = {\n contentType: string | undefined\n canEdit: boolean\n isPublic: boolean\n aclUri: string | undefined\n eTag: string | undefined\n modified: string | undefined\n}\n\nfunction parseWacAllowHeader (headerValue: string | null | undefined) {\n const permissions = new Map<string, Set<string>>()\n if (!headerValue) return permissions\n\n for (const entry of headerValue.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) {\n const [, permissionGroup, accessModes] = match\n const modes = accessModes.trim().split(/\\s+/).filter(Boolean)\n permissions.set(permissionGroup.toLowerCase(), new Set(modes.map(mode => mode.toLowerCase())))\n }\n }\n\n return permissions\n}\n\nfunction deriveAccessFlags (wacAllow: string | null | undefined) {\n if (!wacAllow) {\n return { canEdit: false, isPublic: false }\n }\n\n const permissions = parseWacAllowHeader(wacAllow)\n const userModes = permissions.get('user') ?? new Set<string>()\n const publicModes = permissions.get('public') ?? new Set<string>()\n\n return {\n canEdit: userModes.has('write'),\n isPublic: publicModes.has('read') || publicModes.has('write')\n }\n}\n\nexport function getResponseMetadata (store: LiveStore, subject: NamedNode, response: Response): FileExplorerResourceMetadata {\n let contentType: string | undefined\n let canEdit = false\n let isPublic = false\n let eTag: string | undefined\n let modified: string | undefined\n\n if (response.headers && response.headers.get('content-type')) {\n contentType = response.headers.get('content-type')?.split(';')[0] ?? undefined\n const accessFlags = deriveAccessFlags(response.headers.get('wac-allow'))\n\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = response.headers.get('etag') ?? undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n } else {\n const reqs = store.each(\n null,\n store.sym('http://www.w3.org/2007/ont/link#requestedURI'),\n subject\n )\n reqs.forEach((req: any) => {\n const responseNode = store.any(\n req as any,\n store.sym('http://www.w3.org/2007/ont/link#response')\n )\n if (responseNode && responseNode.termType === 'NamedNode') {\n contentType = store.anyValue(responseNode as any, ns.httph('content-type')) || undefined\n const wacAllow = (store.anyValue(responseNode as any, ns.httph('wac-allow')) as string | undefined) ||\n (store.anyValue(responseNode as any, ns.httph('WAC-Allow')) as string | undefined)\n const accessFlags = deriveAccessFlags(wacAllow)\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = store.anyValue(responseNode as any, ns.httph('etag')) || undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n })\n }\n\n const aclUri = store.any(subject, ACL_LINK)?.value || undefined\n return { contentType, canEdit, isPublic, aclUri, eTag, modified }\n}\n\nexport async function fetchContentAndMetadata (store: LiveStore, subject: NamedNode): Promise<{ content: string, metadata: FileExplorerResourceMetadata }> {\n const fetcher = store.fetcher\n\n const response = await fetcher.webOperation('GET', subject.uri)\n const content = (response as Response & { responseText?: string }).responseText\n\n if (content === undefined) {\n throw new Error('No text in response object!!')\n }\n\n const metadata = getResponseMetadata(store, subject, response)\n if (!metadata.contentType) {\n throw new Error('No content-type available!')\n }\n\n return { content, metadata }\n}\n"],"mappings":";;;AAcA,SAASE,EAAqBC,GAAwC;CACpE,IAAMC,oBAAc,IAAIC,IAAyB;CACjD,IAAI,CAACF,GAAa,OAAOC;CAEzB,KAAK,IAAME,KAASH,EAAYI,MAAM,GAAG,GAAG;EAC1C,IAAMC,IAAQF,EAAMG,KAAK,CAAC,CAACD,MAAM,+BAA+B;EAChE,IAAIA,GAAO;GACT,IAAM,GAAGE,GAAiBC,KAAeH,GACnCI,IAAQD,EAAYF,KAAK,CAAC,CAACF,MAAM,KAAK,CAAC,CAACM,OAAOC,OAAO;GAC5DV,EAAYW,IAAIL,EAAgBM,YAAY,GAAG,IAAIC,IAAIL,EAAMM,KAAIC,MAAQA,EAAKH,YAAY,CAAC,CAAC,CAAC;EAC/F;CACF;CAEA,OAAOZ;AACT;AAEA,SAASgB,EAAmBC,GAAqC;CAC/D,IAAI,CAACA,GACH,OAAO;EAAEC,SAAS;EAAOC,UAAU;CAAM;CAG3C,IAAMnB,IAAcF,EAAoBmB,CAAQ,GAC1CG,IAAYpB,EAAYqB,IAAI,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