solid-panes 4.4.2-4 → 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.
- package/README.md +0 -30
- package/dist/_virtual/_rolldown/runtime.cjs.js +1 -1
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder-open.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/folder-open.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/globe.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/pencil.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/pencil.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/pencil.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/pencil.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/settings-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/settings-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/settings-2.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/settings-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/share-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/share-2.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/share-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/trash-2.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/users.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/users.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/users.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/users.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +14 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +19 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +292 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +22 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +15 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +266 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +19 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +19 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +321 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +13 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +36 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +468 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/helper.cjs.js +2 -0
- package/dist/components/file-explorer-header/helper.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/helper.d.ts +15 -0
- package/dist/components/file-explorer-header/helper.d.ts.map +1 -0
- package/dist/components/file-explorer-header/helper.esm.js +64 -0
- package/dist/components/file-explorer-header/helper.esm.js.map +1 -0
- package/dist/components/file-explorer-header/types.d.ts +2 -0
- package/dist/components/file-explorer-header/types.d.ts.map +1 -0
- package/dist/components/header/Header.cjs.js +1 -1
- package/dist/components/header/Header.cjs.js.map +1 -1
- package/dist/components/header/Header.esm.js +3 -3
- package/dist/components/navbar/Navbar.cjs.js +15 -0
- package/dist/components/navbar/Navbar.cjs.js.map +1 -0
- package/dist/components/navbar/Navbar.d.ts +14 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -0
- package/dist/components/navbar/Navbar.esm.js +232 -0
- package/dist/components/navbar/Navbar.esm.js.map +1 -0
- package/dist/components/navbar/Navbar.styles.cjs.js +2 -0
- package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -0
- package/dist/components/navbar/Navbar.styles.esm.js +7 -0
- package/dist/components/navbar/Navbar.styles.esm.js.map +1 -0
- package/dist/components/navbar/index.cjs.js +1 -0
- package/dist/components/navbar/index.d.ts +4 -0
- package/dist/components/navbar/index.d.ts.map +1 -0
- package/dist/components/navbar/index.esm.js +1 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js +16 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js.map +1 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +8 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +1 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js +215 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +18 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +16 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +260 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +1 -0
- package/dist/dashboard/homepage.cjs.js +1 -1
- package/dist/dashboard/homepage.cjs.js.map +1 -1
- package/dist/dashboard/homepage.esm.js +2 -2
- package/dist/dashboard/homepage.esm.js.map +1 -1
- package/dist/form/pane.cjs.js +1 -1
- package/dist/form/pane.cjs.js.map +1 -1
- package/dist/form/pane.esm.js +2 -1
- package/dist/form/pane.esm.js.map +1 -1
- package/dist/humanReadablePane2.cjs.js.map +1 -1
- package/dist/humanReadablePane2.esm.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/internal/internalPane2.cjs.js.map +1 -1
- package/dist/mainPage/header.cjs.js +1 -1
- package/dist/mainPage/header.cjs.js.map +1 -1
- package/dist/mainPage/header.d.ts.map +1 -1
- package/dist/mainPage/header.esm.js +64 -17
- package/dist/mainPage/header.esm.js.map +1 -1
- package/dist/mainPage/index.cjs.js +1 -1
- package/dist/mainPage/index.cjs.js.map +1 -1
- package/dist/mainPage/index.d.ts +1 -9
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.esm.js +19 -21
- package/dist/mainPage/index.esm.js.map +1 -1
- package/dist/mainPage/navbar.cjs.js +2 -0
- package/dist/mainPage/navbar.cjs.js.map +1 -0
- package/dist/mainPage/navbar.d.ts +3 -0
- package/dist/mainPage/navbar.d.ts.map +1 -0
- package/dist/mainPage/navbar.esm.js +66 -0
- package/dist/mainPage/navbar.esm.js.map +1 -0
- package/dist/outline/context.d.ts +1 -1
- package/dist/outline/manager2.cjs.js +1 -2
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +366 -532
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/queryByExample.esm.js +1 -0
- package/dist/outline/queryByExample.esm.js.map +1 -1
- package/dist/outline/sourcePaneIcon.d.ts +2 -0
- package/dist/outline/sourcePaneIcon.d.ts.map +1 -0
- package/dist/outline/userInput.cjs.js +3 -3
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +4 -6
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/pad/padPane2.cjs.js +1 -1
- package/dist/pad/padPane2.cjs.js.map +1 -1
- package/dist/pad/padPane2.esm.js +2 -1
- package/dist/pad/padPane2.esm.js.map +1 -1
- package/dist/schedule/schedulePane2.cjs.js +1 -1
- package/dist/schedule/schedulePane2.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.esm.js +2 -1
- package/dist/schedule/schedulePane2.esm.js.map +1 -1
- package/dist/social/editProfileDetails.cjs.js +1 -1
- package/dist/social/editProfileDetails.esm.js +1 -1
- package/dist/social/socialPane2.cjs.js +1 -1
- package/dist/social/socialPane2.esm.js +1 -1
- package/dist/social/socialSections.cjs.js.map +1 -1
- package/dist/transaction/pane.cjs.js.map +1 -1
- package/dist/transaction/pane.esm.js.map +1 -1
- package/dist/transaction/period.cjs.js.map +1 -1
- package/dist/transaction/period.esm.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
- package/dist/utils/paneUtils.cjs.js +2 -0
- package/dist/utils/paneUtils.cjs.js.map +1 -0
- package/dist/utils/paneUtils.d.ts +19 -0
- package/dist/utils/paneUtils.d.ts.map +1 -0
- package/dist/utils/paneUtils.esm.js +52 -0
- package/dist/utils/paneUtils.esm.js.map +1 -0
- package/dist/utils/podUtils.cjs.js +2 -0
- package/dist/utils/podUtils.cjs.js.map +1 -0
- package/dist/utils/podUtils.d.ts +4 -0
- package/dist/utils/podUtils.d.ts.map +1 -0
- package/dist/utils/podUtils.esm.js +46 -0
- package/dist/utils/podUtils.esm.js.map +1 -0
- package/dist/utils/webIdUtils.cjs.js +2 -0
- package/dist/utils/webIdUtils.cjs.js.map +1 -0
- package/dist/utils/webIdUtils.d.ts +6 -0
- package/dist/utils/webIdUtils.d.ts.map +1 -0
- package/dist/utils/webIdUtils.esm.js +48 -0
- package/dist/utils/webIdUtils.esm.js.map +1 -0
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +3 -3
- package/dist/versionInfo.esm.js.map +1 -1
- package/package.json +10 -13
- package/dist/icons/dashboard.cjs.js +0 -2
- package/dist/icons/dashboard.cjs.js.map +0 -1
- package/dist/icons/dashboard.esm.js +0 -6
- package/dist/icons/dashboard.esm.js.map +0 -1
- package/dist/icons/iconHelper.cjs.js +0 -2
- package/dist/icons/iconHelper.cjs.js.map +0 -1
- package/dist/icons/iconHelper.esm.js +0 -17
- package/dist/icons/iconHelper.esm.js.map +0 -1
- package/dist/icons/menu.cjs.js +0 -9
- package/dist/icons/menu.cjs.js.map +0 -1
- package/dist/icons/menu.esm.js +0 -6
- package/dist/icons/menu.esm.js.map +0 -1
- package/dist/mainPage/footer.cjs.js +0 -2
- package/dist/mainPage/footer.cjs.js.map +0 -1
- package/dist/mainPage/footer.d.ts +0 -13
- package/dist/mainPage/footer.d.ts.map +0 -1
- package/dist/mainPage/footer.esm.js +0 -18
- package/dist/mainPage/footer.esm.js.map +0 -1
- package/dist/mainPage/menu.d.ts +0 -6
- package/dist/mainPage/menu.d.ts.map +0 -1
- package/dist/mainPage/menu2.cjs.js +0 -2
- package/dist/mainPage/menu2.cjs.js.map +0 -1
- package/dist/mainPage/menu2.esm.js +0 -184
- package/dist/mainPage/menu2.esm.js.map +0 -1
- package/dist/profileUtils/ownerProfile.cjs.js +0 -2
- package/dist/profileUtils/ownerProfile.cjs.js.map +0 -1
- package/dist/profileUtils/ownerProfile.d.ts +0 -5
- package/dist/profileUtils/ownerProfile.d.ts.map +0 -1
- package/dist/profileUtils/ownerProfile.esm.js +0 -50
- package/dist/profileUtils/ownerProfile.esm.js.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { DialogComponent as e, customElement as t } from "solid-ui";
|
|
2
|
+
import { html as n } from "lit";
|
|
3
|
+
import { property as r } from "lit/decorators.js";
|
|
4
|
+
import "solid-ui/components/button";
|
|
5
|
+
import "solid-ui/components/dialog";
|
|
6
|
+
import "solid-ui/components/dialog-content";
|
|
7
|
+
import "solid-ui/components/dialog-footer";
|
|
8
|
+
//#region src/components/resource-actions-menu/DeleteResourceDialog.ts
|
|
9
|
+
var i, a, o, s, c, l, u;
|
|
10
|
+
function d(e, t, n) {
|
|
11
|
+
return (t = v(t)) in e ? Object.defineProperty(e, t, {
|
|
12
|
+
value: n,
|
|
13
|
+
enumerable: !0,
|
|
14
|
+
configurable: !0,
|
|
15
|
+
writable: !0
|
|
16
|
+
}) : e[t] = n, e;
|
|
17
|
+
}
|
|
18
|
+
function f(e, t, n) {
|
|
19
|
+
p(e, t), t.set(e, n);
|
|
20
|
+
}
|
|
21
|
+
function p(e, t) {
|
|
22
|
+
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
23
|
+
}
|
|
24
|
+
function m(e, t, n) {
|
|
25
|
+
return e.set(g(e, t), n), n;
|
|
26
|
+
}
|
|
27
|
+
function h(e, t) {
|
|
28
|
+
return e.get(g(e, t));
|
|
29
|
+
}
|
|
30
|
+
function g(e, t, n) {
|
|
31
|
+
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
32
|
+
throw TypeError("Private element is not present on this object");
|
|
33
|
+
}
|
|
34
|
+
function _(e, t, n, r, i, a) {
|
|
35
|
+
function o(e, t, n) {
|
|
36
|
+
return function(r, i) {
|
|
37
|
+
return n && n(r), e[t].call(r, i);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function s(e, t) {
|
|
41
|
+
for (var n = 0; n < e.length; n++) e[n].call(t);
|
|
42
|
+
return t;
|
|
43
|
+
}
|
|
44
|
+
function c(e, t, n, r) {
|
|
45
|
+
if (typeof e != "function" && (r || e !== void 0)) throw TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined"));
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
48
|
+
function l(e, t, n, r, i, a, s, l, u, d, f, p, m) {
|
|
49
|
+
function h(e) {
|
|
50
|
+
if (!m(e)) throw TypeError("Attempted to access private element on non-instance");
|
|
51
|
+
}
|
|
52
|
+
var g, _ = t[0], v = t[3], y = !l;
|
|
53
|
+
if (!y) {
|
|
54
|
+
n || Array.isArray(_) || (_ = [_]);
|
|
55
|
+
var x = {}, S = [], C = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
56
|
+
d ? (f || p ? x = {
|
|
57
|
+
get: b(function() {
|
|
58
|
+
return v(this);
|
|
59
|
+
}, r, "get"),
|
|
60
|
+
set: function(e) {
|
|
61
|
+
t[4](this, e);
|
|
62
|
+
}
|
|
63
|
+
} : x[C] = v, f || b(x[C], r, i === 2 ? "" : C)) : f || (x = Object.getOwnPropertyDescriptor(e, r));
|
|
64
|
+
}
|
|
65
|
+
for (var w = e, T = _.length - 1; T >= 0; T -= n ? 2 : 1) {
|
|
66
|
+
var E = _[T], D = n ? _[T - 1] : void 0, O = {}, k = {
|
|
67
|
+
kind: [
|
|
68
|
+
"field",
|
|
69
|
+
"accessor",
|
|
70
|
+
"method",
|
|
71
|
+
"getter",
|
|
72
|
+
"setter",
|
|
73
|
+
"class"
|
|
74
|
+
][i],
|
|
75
|
+
name: r,
|
|
76
|
+
metadata: a,
|
|
77
|
+
addInitializer: function(e, t) {
|
|
78
|
+
if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
79
|
+
c(t, "An initializer", "be", !0), s.push(t);
|
|
80
|
+
}.bind(null, O)
|
|
81
|
+
};
|
|
82
|
+
try {
|
|
83
|
+
if (y) (g = c(E.call(D, w, k), "class decorators", "return")) && (w = g);
|
|
84
|
+
else {
|
|
85
|
+
var A, j;
|
|
86
|
+
k.static = u, k.private = d, d ? i === 2 ? A = function(e) {
|
|
87
|
+
return h(e), x.value;
|
|
88
|
+
} : (i < 4 && (A = o(x, "get", h)), i !== 3 && (j = o(x, "set", h))) : (A = function(e) {
|
|
89
|
+
return e[r];
|
|
90
|
+
}, (i < 2 || i === 4) && (j = function(e, t) {
|
|
91
|
+
e[r] = t;
|
|
92
|
+
}));
|
|
93
|
+
var M = k.access = { has: d ? m.bind() : function(e) {
|
|
94
|
+
return r in e;
|
|
95
|
+
} };
|
|
96
|
+
if (A && (M.get = A), j && (M.set = j), w = E.call(D, p ? {
|
|
97
|
+
get: x.get,
|
|
98
|
+
set: x.set
|
|
99
|
+
} : x[C], k), p) {
|
|
100
|
+
if (typeof w == "object" && w) (g = c(w.get, "accessor.get")) && (x.get = g), (g = c(w.set, "accessor.set")) && (x.set = g), (g = c(w.init, "accessor.init")) && S.push(g);
|
|
101
|
+
else if (w !== void 0) throw TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
102
|
+
} else c(w, (f ? "field" : "method") + " decorators", "return") && (f ? S.push(w) : x[C] = w);
|
|
103
|
+
}
|
|
104
|
+
} finally {
|
|
105
|
+
O.v = !0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return (f || p) && l.push(function(e, t) {
|
|
109
|
+
for (var n = S.length - 1; n >= 0; n--) t = S[n].call(e, t);
|
|
110
|
+
return t;
|
|
111
|
+
}), f || y || (d ? p ? l.push(o(x, "get"), o(x, "set")) : l.push(i === 2 ? x[C] : o.call.bind(x[C])) : Object.defineProperty(e, r, x)), w;
|
|
112
|
+
}
|
|
113
|
+
function u(e, t) {
|
|
114
|
+
return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
115
|
+
configurable: !0,
|
|
116
|
+
enumerable: !0,
|
|
117
|
+
value: t
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
121
|
+
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
122
|
+
var i, a, o = [], c = function(t) {
|
|
123
|
+
return x(t) === e;
|
|
124
|
+
}, u = /* @__PURE__ */ new Map();
|
|
125
|
+
function d(e) {
|
|
126
|
+
e && o.push(s.bind(null, e));
|
|
127
|
+
}
|
|
128
|
+
for (var f = 0; f < t.length; f++) {
|
|
129
|
+
var p = t[f];
|
|
130
|
+
if (Array.isArray(p)) {
|
|
131
|
+
var m = p[1], h = p[2], g = p.length > 3, _ = 16 & m, y = !!(8 & m), b = (m &= 7) == 0, S = h + "/" + y;
|
|
132
|
+
if (!b && !g) {
|
|
133
|
+
var C = u.get(S);
|
|
134
|
+
if (!0 === C || C === 3 && m !== 4 || C === 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);
|
|
135
|
+
u.set(S, !(m > 2) || m);
|
|
136
|
+
}
|
|
137
|
+
l(y ? e : e.prototype, p, _, g ? "#" + h : v(h), m, r, y ? a ||= [] : i ||= [], o, y, g, b, m === 1, y && g ? c : n);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return d(i), d(a), o;
|
|
141
|
+
}(e, t, i, f);
|
|
142
|
+
return n.length || u(e, f), {
|
|
143
|
+
e: p,
|
|
144
|
+
get c() {
|
|
145
|
+
var t = [];
|
|
146
|
+
return n.length && [u(l(e, [n], r, e.name, 5, f, t), f), s.bind(null, t, e)];
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function v(e) {
|
|
151
|
+
var t = y(e, "string");
|
|
152
|
+
return typeof t == "symbol" ? t : t + "";
|
|
153
|
+
}
|
|
154
|
+
function y(e, t) {
|
|
155
|
+
if (typeof e != "object" || !e) return e;
|
|
156
|
+
var n = e[Symbol.toPrimitive];
|
|
157
|
+
if (n !== void 0) {
|
|
158
|
+
var r = n.call(e, t || "default");
|
|
159
|
+
if (typeof r != "object") return r;
|
|
160
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
161
|
+
}
|
|
162
|
+
return (t === "string" ? String : Number)(e);
|
|
163
|
+
}
|
|
164
|
+
function b(e, t, n) {
|
|
165
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
166
|
+
try {
|
|
167
|
+
Object.defineProperty(e, "name", {
|
|
168
|
+
configurable: !0,
|
|
169
|
+
value: n ? n + " " + t : t
|
|
170
|
+
});
|
|
171
|
+
} catch {}
|
|
172
|
+
return e;
|
|
173
|
+
}
|
|
174
|
+
function x(e) {
|
|
175
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
176
|
+
return e;
|
|
177
|
+
}
|
|
178
|
+
s = [t("resource-delete-dialog")];
|
|
179
|
+
var S, C = /*#__PURE__*/ new WeakMap();
|
|
180
|
+
u = (c = r({ type: String }), "resourceName"), i = class extends e {
|
|
181
|
+
constructor(...e) {
|
|
182
|
+
super(...e), f(this, C, (a(this), l(this, "this resource"))), d(this, "cancel", () => this.close(!1)), d(this, "confirm", () => this.close(!0));
|
|
183
|
+
}
|
|
184
|
+
get [u]() {
|
|
185
|
+
return h(C, this);
|
|
186
|
+
}
|
|
187
|
+
set resourceName(e) {
|
|
188
|
+
m(C, this, e);
|
|
189
|
+
}
|
|
190
|
+
render() {
|
|
191
|
+
return n`
|
|
192
|
+
<solid-ui-dialog title="Delete resource">
|
|
193
|
+
<solid-ui-dialog-content>
|
|
194
|
+
<p>Are you sure you want to permanently delete ${this.resourceName}?</p>
|
|
195
|
+
</solid-ui-dialog-content>
|
|
196
|
+
<solid-ui-dialog-footer>
|
|
197
|
+
<solid-ui-button variant="secondary" @click=${this.cancel}>
|
|
198
|
+
Go back
|
|
199
|
+
</solid-ui-button>
|
|
200
|
+
<solid-ui-button @click=${this.confirm}>
|
|
201
|
+
Yes
|
|
202
|
+
</solid-ui-button>
|
|
203
|
+
</solid-ui-dialog-footer>
|
|
204
|
+
</solid-ui-dialog>
|
|
205
|
+
`;
|
|
206
|
+
}
|
|
207
|
+
}, {e: [l, a], c: [S, o]} = _(i, [[
|
|
208
|
+
c,
|
|
209
|
+
1,
|
|
210
|
+
"resourceName"
|
|
211
|
+
]], s, 0, void 0, e), o();
|
|
212
|
+
//#endregion
|
|
213
|
+
export { S as default };
|
|
214
|
+
|
|
215
|
+
//# sourceMappingURL=DeleteResourceDialog.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteResourceDialog.esm.js","names":["customElement","DialogComponent","html","property","_classDecs","_DeleteResourceDialog","_A","WeakMap","_ref","_resourceNameDecs","type","String","DeleteResourceDialog","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_resourceName","_defineProperty","close","_classPrivateFieldGet","resourceName","v","_classPrivateFieldSet","render","cancel","confirm","_DeleteResourceDialog2","e","c","_initClass","_applyDecs","default"],"sources":["../../../src/components/resource-actions-menu/DeleteResourceDialog.ts"],"sourcesContent":["import { customElement, DialogComponent } from 'solid-ui'\nimport { html } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport 'solid-ui/components/button'\nimport 'solid-ui/components/dialog'\nimport 'solid-ui/components/dialog-content'\nimport 'solid-ui/components/dialog-footer'\n\n@customElement('resource-delete-dialog')\nexport default class DeleteResourceDialog extends DialogComponent<boolean> {\n @property({ type: String })\n accessor resourceName = 'this resource'\n\n private cancel = () => this.close(false)\n\n private confirm = () => this.close(true)\n\n protected render () {\n return html`\n <solid-ui-dialog title=\"Delete resource\">\n <solid-ui-dialog-content>\n <p>Are you sure you want to permanently delete ${this.resourceName}?</p>\n </solid-ui-dialog-content>\n <solid-ui-dialog-footer>\n <solid-ui-button variant=\"secondary\" @click=${this.cancel}>\n Go back\n </solid-ui-button>\n <solid-ui-button @click=${this.confirm}>\n Yes\n </solid-ui-button>\n </solid-ui-dialog-footer>\n </solid-ui-dialog>\n `\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAO0CI,IAAA,CAEzCJ,EAAc,wBAAwB,CAAC;AAAA,IAAAK,GAAAC,kBAAA,IAAAC,QAAA;AAAAC,KAAAC,IAErCN,EAAS,EAAEO,MAAMC,OAAO,CAAC,GAAC,iBAwB5BgB,IAAAf,cAzBiDX,EAAyB;CAAAY,YAAA,GAAAC,GAAA;EAIjCI,AAJiC,MAAA,GAAAJ,CAAA,GAAAC,EAAA,MAAAT,IAAAU,EAAA,IAAA,GAAAC,EAAA,MAEjD,eAAe,EAAA,GAAAC,EAAA,MAAA,gBAEhB,KAAKC,MAAM,EAAK,CAAC,GAAAD,EAAA,MAAA,iBAEhB,KAAKC,MAAM,EAAI,CAAC;CAAA;CAAA,KAAAX,KAAA;EAAA,OAAAY,EAAAd,GAAA,IAAA;CAAA;CAAA,IAJ/Be,aAAYC,GAAA;EAAAC,EAAAjB,GAAA,MAAAgB,CAAA;CAAA;CAMXE,SAAU;EAClB,OAAOtB,CAAI;;;2DAG4C,KAAKmB,aAAY;;;wDAGpB,KAAKI,OAAM;;;oCAG/B,KAAKC,QAAO;;;;;;CAM9C;AACF,GAAC,CAAAE,GAAA,CAAAX,GAAAD,IAAAa,GAAA,CAAAxB,GAAAyB,MAAAC,EAAAJ,GAAA,CAAA;CAAAlB;CAAA;CAAA;AAAA,CAAA,GAAAL,GAAA,GAAA,KAAA,GAzBiDH,CAAe,GAAA6B,EAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require("../../_virtual/~icons/lucide/ellipsis-vertical.cjs.js");const e=require("./DeleteResourceDialog.cjs.js");require("../../_virtual/~icons/lucide/trash-2.cjs.js");let t=require("solid-ui"),n=require("lit"),r=require("lit/decorators.js");require("solid-ui/components/button"),require("solid-ui/components/menu"),require("solid-ui/components/menu-item");var i,a,o,s,c,l,u,d,f,p,m;function h(e,t,n){g(e,t),t.set(e,n)}function g(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function _(e,t,n){return e.set(y(e,t),n),n}function v(e,t){return e.get(y(e,t))}function y(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function b(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:C(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||C(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var w=e,T=_.length-1;T>=0;T-=n?2:1){var E=_[T],D=n?_[T-1]:void 0,O={},k={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,O)};try{if(y)(g=c(E.call(D,w,k),`class decorators`,`return`))&&(w=g);else{var A,j;k.static=u,k.private=d,d?i===2?A=function(e){return h(e),b.value}:(i<4&&(A=o(b,`get`,h)),i!==3&&(j=o(b,`set`,h))):(A=function(e){return e[r]},(i<2||i===4)&&(j=function(e,t){e[r]=t}));var M=k.access={has:d?m.bind():function(e){return r in e}};if(A&&(M.get=A),j&&(M.set=j),w=E.call(D,p?{get:b.get,set:b.set}:b[S],k),p){if(typeof w==`object`&&w)(g=c(w.get,`accessor.get`))&&(b.get=g),(g=c(w.set,`accessor.set`))&&(b.set=g),(g=c(w.init,`accessor.init`))&&x.push(g);else if(w!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(w,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(w):b[S]=w)}}finally{O.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),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)),w}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return w(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var S=u.get(b);if(!0===S||S===3&&m!==4||S===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);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:x(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function x(e){var t=S(e,`string`);return typeof t==`symbol`?t:t+``}function S(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function w(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}s=[(0,r.customElement)(`resource-actions-menu`)];var T,E=new WeakMap,D=new WeakMap,O=new WeakMap;m=(c=(0,r.property)({attribute:!1}),u=(0,r.property)({type:String}),f=(0,r.property)({attribute:!1}),`store`),i=class extends t.WebComponent{constructor(...e){super(...e),h(this,E,(a(this),l(this))),h(this,D,d(this)),h(this,O,p(this,[]))}get[m](){return v(E,this)}set store(e){_(E,this,e)}get subjectUri(){return v(D,this)}set subjectUri(e){_(D,this,e)}get menuItems(){return v(O,this)}set menuItems(e){_(O,this,e)}confirmDelete(n){return new Promise(r=>{(0,t.showDialog)(e.default,{props:{resourceName:n},onClose:e=>r(e===!0)})})}async deleteResourceIfPresent(e,t){try{await e.fetcher.webOperation(`DELETE`,t)}catch(e){if((e?.response?.status??e?.status)===404)return;throw e}}async handleDelete(e){if(e.preventDefault(),!this.store?.fetcher||!this.subjectUri)return;let n=this.store,r=n.sym(this.subjectUri);if(await this.confirmDelete(t.utils.label(r)))try{await this.deleteResourceIfPresent(n,r.value);let e=this.subjectUri+`.acl`;e&&(await this.deleteResourceIfPresent(n,e),n.removeDocument(n.sym(e))),n.removeDocument(r)}catch{}}render(){return n.html`
|
|
2
|
+
<solid-ui-menu>
|
|
3
|
+
<solid-ui-button slot="trigger" variant="ghost" title="More options">
|
|
4
|
+
<icon-lucide-ellipsis-vertical slot="icon"></icon-lucide-ellipsis-vertical>
|
|
5
|
+
</solid-ui-button>
|
|
6
|
+
${this.menuItems.map(e=>n.html`
|
|
7
|
+
<solid-ui-menu-item @solid-ui-select=${t=>e.action(t)}>
|
|
8
|
+
${e.icon}
|
|
9
|
+
${e.label}
|
|
10
|
+
</solid-ui-menu-item>
|
|
11
|
+
`)}
|
|
12
|
+
<solid-ui-menu-item @solid-ui-select=${e=>this.handleDelete(e)}>
|
|
13
|
+
<icon-lucide-trash-2 slot="left-icon"></icon-lucide-trash-2>
|
|
14
|
+
Delete
|
|
15
|
+
</solid-ui-menu-item>
|
|
16
|
+
</solid-ui-menu>
|
|
17
|
+
`}},{e:[l,d,p,a],c:[T,o]}=b(i,[[c,1,`store`],[u,1,`subjectUri`],[f,1,`menuItems`]],s,0,void 0,t.WebComponent),o(),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return T}});
|
|
18
|
+
//# sourceMappingURL=ResourceActionsMenu.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceActionsMenu.cjs.js","names":["showDialog","utils","WebComponent","customElement","property","html","DeleteResourceDialog","_classDecs","_ResourceActionsMenu","_A","WeakMap","_B","_C","_ref","_storeDecs","attribute","_subjectUriDecs","type","String","_menuItemsDecs","ResourceActionsMenu","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_store","_init_subjectUri","_init_menuItems","_classPrivateFieldGet","store","v","_classPrivateFieldSet","subjectUri","menuItems","confirmDelete","resourceName","Promise","resolve","props","onClose","result","deleteResourceIfPresent","uri","fetcher","webOperation","err","status","response","handleDelete","event","preventDefault","resourceNode","sym","confirmation","label","value","aclUri","removeDocument","render","map","item","action","icon","_ResourceActionsMenu2","e","c","_initClass","_applyDecs","default"],"sources":["../../../src/components/resource-actions-menu/ResourceActionsMenu.ts"],"sourcesContent":["import { showDialog, utils, WebComponent } from 'solid-ui'\nimport { customElement, property } from 'lit/decorators.js'\nimport { html } from 'lit'\nimport 'solid-ui/components/button'\nimport 'solid-ui/components/menu'\nimport 'solid-ui/components/menu-item'\nimport DeleteResourceDialog from './DeleteResourceDialog'\nimport '~icons/lucide/ellipsis-vertical'\nimport '~icons/lucide/trash-2'\nimport { LiveStore } from 'rdflib'\n// TODO: Add Error Status section\n\n@customElement('resource-actions-menu')\nexport default class ResourceActionsMenu extends WebComponent {\n @property({ attribute: false })\n accessor store: LiveStore | undefined\n\n @property({ type: String })\n accessor subjectUri: string | undefined\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, icon?: HTMLElement, action: (event: Event) => void }> = []\n\n private confirmDelete (resourceName: string) {\n return new Promise<boolean>(resolve => {\n showDialog(DeleteResourceDialog, {\n props: { resourceName },\n onClose: (result) => resolve(result === true)\n })\n })\n }\n\n /* private gotoParentFolder(resourceUri: string) {\n const sourceContext = this.sourceContext\n const outliner = sourceContext?.context?.getOutliner?.(sourceContext.context.dom)\n\n if (!outliner) return\n\n const parentFolderUri = this.getParentFolderUri(resourceUri)\n ;(outliner as any).GotoSubject(sourceContext.context.session.store.sym(parentFolderUri), true, undefined, true, undefined)\n } */\n\n private async deleteResourceIfPresent (store: LiveStore, uri: string) {\n try {\n await store.fetcher.webOperation('DELETE', uri)\n } catch (err: any) {\n const status = err?.response?.status ?? err?.status\n if (status === 404) return\n throw err\n }\n }\n\n // TODO: Below is for a file only. I need to move this to a function\n // that function needs to check if it's a container and if so we can do the\n // recursive delete function.\n // dont' forget public and private type indexes.\n private async handleDelete (event: Event) {\n event.preventDefault()\n\n if (!this.store?.fetcher || !this.subjectUri) return\n\n const store = this.store\n const resourceNode = store.sym(this.subjectUri)\n\n const confirmation = await this.confirmDelete(utils.label(resourceNode))\n if (!confirmation) return\n\n try {\n await this.deleteResourceIfPresent(store, resourceNode.value)\n\n const aclUri = this.subjectUri + '.acl'\n if (aclUri) {\n await this.deleteResourceIfPresent(store, aclUri)\n store.removeDocument(store.sym(aclUri))\n }\n\n store.removeDocument(resourceNode)\n // this.gotoParentFolder(resourceNode.value)\n } catch (err) {\n // error('Error deleting resource:', err)\n // getStatusSection()?.showError('Failed to delete resource. Check console for details.')\n }\n }\n\n render () {\n return html`\n <solid-ui-menu>\n <solid-ui-button slot=\"trigger\" variant=\"ghost\" title=\"More options\">\n <icon-lucide-ellipsis-vertical slot=\"icon\"></icon-lucide-ellipsis-vertical>\n </solid-ui-button>\n ${this.menuItems.map(item => html`\n <solid-ui-menu-item @solid-ui-select=${(event: Event) => item.action(event)}>\n ${item.icon}\n ${item.label}\n </solid-ui-menu-item>\n `)}\n <solid-ui-menu-item @solid-ui-select=${(event: Event) => this.handleDelete(event)}>\n <icon-lucide-trash-2 slot=\"left-icon\"></icon-lucide-trash-2>\n Delete\n </solid-ui-menu-item>\n </solid-ui-menu>\n `\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WebComponent } from 'solid-ui';
|
|
2
|
+
import { LiveStore } from '../../../node_modules/rdflib';
|
|
3
|
+
export default class ResourceActionsMenu extends WebComponent {
|
|
4
|
+
accessor store: LiveStore | undefined;
|
|
5
|
+
accessor subjectUri: string | undefined;
|
|
6
|
+
accessor menuItems: Array<{
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: HTMLElement;
|
|
9
|
+
action: (event: Event) => void;
|
|
10
|
+
}>;
|
|
11
|
+
private confirmDelete;
|
|
12
|
+
private deleteResourceIfPresent;
|
|
13
|
+
private handleDelete;
|
|
14
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ResourceActionsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceActionsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/resource-actions-menu/ResourceActionsMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAA;AAG1D,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,+BAA+B,CAAA;AAEtC,OAAO,iCAAiC,CAAA;AACxC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAIlC,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAAY;IAE3D,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAA;IAGrC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAGvC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;KAAE,CAAC,CAAK;IAErG,OAAO,CAAC,aAAa;YAmBP,uBAAuB;YAcvB,YAAY;IA4B1B,MAAM;CAmBP"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import "../../_virtual/~icons/lucide/ellipsis-vertical.esm.js";
|
|
2
|
+
import e from "./DeleteResourceDialog.esm.js";
|
|
3
|
+
import "../../_virtual/~icons/lucide/trash-2.esm.js";
|
|
4
|
+
import { WebComponent as t, showDialog as n, utils as r } from "solid-ui";
|
|
5
|
+
import { html as i } from "lit";
|
|
6
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
7
|
+
import "solid-ui/components/button";
|
|
8
|
+
import "solid-ui/components/menu";
|
|
9
|
+
import "solid-ui/components/menu-item";
|
|
10
|
+
//#region src/components/resource-actions-menu/ResourceActionsMenu.ts
|
|
11
|
+
var s, c, l, u, d, f, p, m, h, g, _;
|
|
12
|
+
function v(e, t, n) {
|
|
13
|
+
y(e, t), t.set(e, n);
|
|
14
|
+
}
|
|
15
|
+
function y(e, t) {
|
|
16
|
+
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
17
|
+
}
|
|
18
|
+
function b(e, t, n) {
|
|
19
|
+
return e.set(S(e, t), n), n;
|
|
20
|
+
}
|
|
21
|
+
function x(e, t) {
|
|
22
|
+
return e.get(S(e, t));
|
|
23
|
+
}
|
|
24
|
+
function S(e, t, n) {
|
|
25
|
+
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
26
|
+
throw TypeError("Private element is not present on this object");
|
|
27
|
+
}
|
|
28
|
+
function C(e, t, n, r, i, a) {
|
|
29
|
+
function o(e, t, n) {
|
|
30
|
+
return function(r, i) {
|
|
31
|
+
return n && n(r), e[t].call(r, i);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function s(e, t) {
|
|
35
|
+
for (var n = 0; n < e.length; n++) e[n].call(t);
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
function c(e, t, n, r) {
|
|
39
|
+
if (typeof e != "function" && (r || e !== void 0)) throw TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined"));
|
|
40
|
+
return e;
|
|
41
|
+
}
|
|
42
|
+
function l(e, t, n, r, i, a, s, l, u, d, f, p, m) {
|
|
43
|
+
function h(e) {
|
|
44
|
+
if (!m(e)) throw TypeError("Attempted to access private element on non-instance");
|
|
45
|
+
}
|
|
46
|
+
var g, _ = t[0], v = t[3], y = !l;
|
|
47
|
+
if (!y) {
|
|
48
|
+
n || Array.isArray(_) || (_ = [_]);
|
|
49
|
+
var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
50
|
+
d ? (f || p ? b = {
|
|
51
|
+
get: E(function() {
|
|
52
|
+
return v(this);
|
|
53
|
+
}, r, "get"),
|
|
54
|
+
set: function(e) {
|
|
55
|
+
t[4](this, e);
|
|
56
|
+
}
|
|
57
|
+
} : b[S] = v, f || E(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
|
|
58
|
+
}
|
|
59
|
+
for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
|
|
60
|
+
var T = _[w], D = n ? _[w - 1] : void 0, O = {}, k = {
|
|
61
|
+
kind: [
|
|
62
|
+
"field",
|
|
63
|
+
"accessor",
|
|
64
|
+
"method",
|
|
65
|
+
"getter",
|
|
66
|
+
"setter",
|
|
67
|
+
"class"
|
|
68
|
+
][i],
|
|
69
|
+
name: r,
|
|
70
|
+
metadata: a,
|
|
71
|
+
addInitializer: function(e, t) {
|
|
72
|
+
if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
73
|
+
c(t, "An initializer", "be", !0), s.push(t);
|
|
74
|
+
}.bind(null, O)
|
|
75
|
+
};
|
|
76
|
+
try {
|
|
77
|
+
if (y) (g = c(T.call(D, C, k), "class decorators", "return")) && (C = g);
|
|
78
|
+
else {
|
|
79
|
+
var A, j;
|
|
80
|
+
k.static = u, k.private = d, d ? i === 2 ? A = function(e) {
|
|
81
|
+
return h(e), b.value;
|
|
82
|
+
} : (i < 4 && (A = o(b, "get", h)), i !== 3 && (j = o(b, "set", h))) : (A = function(e) {
|
|
83
|
+
return e[r];
|
|
84
|
+
}, (i < 2 || i === 4) && (j = function(e, t) {
|
|
85
|
+
e[r] = t;
|
|
86
|
+
}));
|
|
87
|
+
var M = k.access = { has: d ? m.bind() : function(e) {
|
|
88
|
+
return r in e;
|
|
89
|
+
} };
|
|
90
|
+
if (A && (M.get = A), j && (M.set = j), C = T.call(D, p ? {
|
|
91
|
+
get: b.get,
|
|
92
|
+
set: b.set
|
|
93
|
+
} : b[S], k), p) {
|
|
94
|
+
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);
|
|
95
|
+
else if (C !== void 0) throw TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
96
|
+
} else c(C, (f ? "field" : "method") + " decorators", "return") && (f ? x.push(C) : b[S] = C);
|
|
97
|
+
}
|
|
98
|
+
} finally {
|
|
99
|
+
O.v = !0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return (f || p) && l.push(function(e, t) {
|
|
103
|
+
for (var n = x.length - 1; n >= 0; n--) t = x[n].call(e, t);
|
|
104
|
+
return t;
|
|
105
|
+
}), 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;
|
|
106
|
+
}
|
|
107
|
+
function u(e, t) {
|
|
108
|
+
return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
109
|
+
configurable: !0,
|
|
110
|
+
enumerable: !0,
|
|
111
|
+
value: t
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
115
|
+
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
116
|
+
var i, a, o = [], c = function(t) {
|
|
117
|
+
return D(t) === e;
|
|
118
|
+
}, u = /* @__PURE__ */ new Map();
|
|
119
|
+
function d(e) {
|
|
120
|
+
e && o.push(s.bind(null, e));
|
|
121
|
+
}
|
|
122
|
+
for (var f = 0; f < t.length; f++) {
|
|
123
|
+
var p = t[f];
|
|
124
|
+
if (Array.isArray(p)) {
|
|
125
|
+
var m = p[1], h = p[2], g = p.length > 3, _ = 16 & m, v = !!(8 & m), y = (m &= 7) == 0, b = h + "/" + v;
|
|
126
|
+
if (!y && !g) {
|
|
127
|
+
var x = u.get(b);
|
|
128
|
+
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);
|
|
129
|
+
u.set(b, !(m > 2) || m);
|
|
130
|
+
}
|
|
131
|
+
l(v ? e : e.prototype, p, _, g ? "#" + h : w(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return d(i), d(a), o;
|
|
135
|
+
}(e, t, i, f);
|
|
136
|
+
return n.length || u(e, f), {
|
|
137
|
+
e: p,
|
|
138
|
+
get c() {
|
|
139
|
+
var t = [];
|
|
140
|
+
return n.length && [u(l(e, [n], r, e.name, 5, f, t), f), s.bind(null, t, e)];
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function w(e) {
|
|
145
|
+
var t = T(e, "string");
|
|
146
|
+
return typeof t == "symbol" ? t : t + "";
|
|
147
|
+
}
|
|
148
|
+
function T(e, t) {
|
|
149
|
+
if (typeof e != "object" || !e) return e;
|
|
150
|
+
var n = e[Symbol.toPrimitive];
|
|
151
|
+
if (n !== void 0) {
|
|
152
|
+
var r = n.call(e, t || "default");
|
|
153
|
+
if (typeof r != "object") return r;
|
|
154
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
155
|
+
}
|
|
156
|
+
return (t === "string" ? String : Number)(e);
|
|
157
|
+
}
|
|
158
|
+
function E(e, t, n) {
|
|
159
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
160
|
+
try {
|
|
161
|
+
Object.defineProperty(e, "name", {
|
|
162
|
+
configurable: !0,
|
|
163
|
+
value: n ? n + " " + t : t
|
|
164
|
+
});
|
|
165
|
+
} catch {}
|
|
166
|
+
return e;
|
|
167
|
+
}
|
|
168
|
+
function D(e) {
|
|
169
|
+
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
170
|
+
return e;
|
|
171
|
+
}
|
|
172
|
+
u = [a("resource-actions-menu")];
|
|
173
|
+
var O, k = /*#__PURE__*/ new WeakMap(), A = /*#__PURE__*/ new WeakMap(), j = /*#__PURE__*/ new WeakMap();
|
|
174
|
+
_ = (d = o({ attribute: !1 }), p = o({ type: String }), h = o({ attribute: !1 }), "store"), s = class extends t {
|
|
175
|
+
constructor(...e) {
|
|
176
|
+
super(...e), v(this, k, (c(this), f(this))), v(this, A, m(this)), v(this, j, g(this, []));
|
|
177
|
+
}
|
|
178
|
+
get [_]() {
|
|
179
|
+
return x(k, this);
|
|
180
|
+
}
|
|
181
|
+
set store(e) {
|
|
182
|
+
b(k, this, e);
|
|
183
|
+
}
|
|
184
|
+
get subjectUri() {
|
|
185
|
+
return x(A, this);
|
|
186
|
+
}
|
|
187
|
+
set subjectUri(e) {
|
|
188
|
+
b(A, this, e);
|
|
189
|
+
}
|
|
190
|
+
get menuItems() {
|
|
191
|
+
return x(j, this);
|
|
192
|
+
}
|
|
193
|
+
set menuItems(e) {
|
|
194
|
+
b(j, this, e);
|
|
195
|
+
}
|
|
196
|
+
confirmDelete(t) {
|
|
197
|
+
return new Promise((r) => {
|
|
198
|
+
n(e, {
|
|
199
|
+
props: { resourceName: t },
|
|
200
|
+
onClose: (e) => r(e === !0)
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
async deleteResourceIfPresent(e, t) {
|
|
205
|
+
try {
|
|
206
|
+
await e.fetcher.webOperation("DELETE", t);
|
|
207
|
+
} catch (e) {
|
|
208
|
+
if ((e?.response?.status ?? e?.status) === 404) return;
|
|
209
|
+
throw e;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async handleDelete(e) {
|
|
213
|
+
if (e.preventDefault(), !this.store?.fetcher || !this.subjectUri) return;
|
|
214
|
+
let t = this.store, n = t.sym(this.subjectUri);
|
|
215
|
+
if (await this.confirmDelete(r.label(n))) try {
|
|
216
|
+
await this.deleteResourceIfPresent(t, n.value);
|
|
217
|
+
let e = this.subjectUri + ".acl";
|
|
218
|
+
e && (await this.deleteResourceIfPresent(t, e), t.removeDocument(t.sym(e))), t.removeDocument(n);
|
|
219
|
+
} catch {}
|
|
220
|
+
}
|
|
221
|
+
render() {
|
|
222
|
+
return i`
|
|
223
|
+
<solid-ui-menu>
|
|
224
|
+
<solid-ui-button slot="trigger" variant="ghost" title="More options">
|
|
225
|
+
<icon-lucide-ellipsis-vertical slot="icon"></icon-lucide-ellipsis-vertical>
|
|
226
|
+
</solid-ui-button>
|
|
227
|
+
${this.menuItems.map((e) => i`
|
|
228
|
+
<solid-ui-menu-item @solid-ui-select=${(t) => e.action(t)}>
|
|
229
|
+
${e.icon}
|
|
230
|
+
${e.label}
|
|
231
|
+
</solid-ui-menu-item>
|
|
232
|
+
`)}
|
|
233
|
+
<solid-ui-menu-item @solid-ui-select=${(e) => this.handleDelete(e)}>
|
|
234
|
+
<icon-lucide-trash-2 slot="left-icon"></icon-lucide-trash-2>
|
|
235
|
+
Delete
|
|
236
|
+
</solid-ui-menu-item>
|
|
237
|
+
</solid-ui-menu>
|
|
238
|
+
`;
|
|
239
|
+
}
|
|
240
|
+
}, {e: [f, m, g, c], c: [O, l]} = C(s, [
|
|
241
|
+
[
|
|
242
|
+
d,
|
|
243
|
+
1,
|
|
244
|
+
"store"
|
|
245
|
+
],
|
|
246
|
+
[
|
|
247
|
+
p,
|
|
248
|
+
1,
|
|
249
|
+
"subjectUri"
|
|
250
|
+
],
|
|
251
|
+
[
|
|
252
|
+
h,
|
|
253
|
+
1,
|
|
254
|
+
"menuItems"
|
|
255
|
+
]
|
|
256
|
+
], u, 0, void 0, t), l();
|
|
257
|
+
//#endregion
|
|
258
|
+
export { O as default };
|
|
259
|
+
|
|
260
|
+
//# sourceMappingURL=ResourceActionsMenu.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceActionsMenu.esm.js","names":["showDialog","utils","WebComponent","customElement","property","html","DeleteResourceDialog","_classDecs","_ResourceActionsMenu","_A","WeakMap","_B","_C","_ref","_storeDecs","attribute","_subjectUriDecs","type","String","_menuItemsDecs","ResourceActionsMenu","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_store","_init_subjectUri","_init_menuItems","_classPrivateFieldGet","store","v","_classPrivateFieldSet","subjectUri","menuItems","confirmDelete","resourceName","Promise","resolve","props","onClose","result","deleteResourceIfPresent","uri","fetcher","webOperation","err","status","response","handleDelete","event","preventDefault","resourceNode","sym","confirmation","label","value","aclUri","removeDocument","render","map","item","action","icon","_ResourceActionsMenu2","e","c","_initClass","_applyDecs","default"],"sources":["../../../src/components/resource-actions-menu/ResourceActionsMenu.ts"],"sourcesContent":["import { showDialog, utils, WebComponent } from 'solid-ui'\nimport { customElement, property } from 'lit/decorators.js'\nimport { html } from 'lit'\nimport 'solid-ui/components/button'\nimport 'solid-ui/components/menu'\nimport 'solid-ui/components/menu-item'\nimport DeleteResourceDialog from './DeleteResourceDialog'\nimport '~icons/lucide/ellipsis-vertical'\nimport '~icons/lucide/trash-2'\nimport { LiveStore } from 'rdflib'\n// TODO: Add Error Status section\n\n@customElement('resource-actions-menu')\nexport default class ResourceActionsMenu extends WebComponent {\n @property({ attribute: false })\n accessor store: LiveStore | undefined\n\n @property({ type: String })\n accessor subjectUri: string | undefined\n\n @property({ attribute: false })\n accessor menuItems: Array<{ label: string, icon?: HTMLElement, action: (event: Event) => void }> = []\n\n private confirmDelete (resourceName: string) {\n return new Promise<boolean>(resolve => {\n showDialog(DeleteResourceDialog, {\n props: { resourceName },\n onClose: (result) => resolve(result === true)\n })\n })\n }\n\n /* private gotoParentFolder(resourceUri: string) {\n const sourceContext = this.sourceContext\n const outliner = sourceContext?.context?.getOutliner?.(sourceContext.context.dom)\n\n if (!outliner) return\n\n const parentFolderUri = this.getParentFolderUri(resourceUri)\n ;(outliner as any).GotoSubject(sourceContext.context.session.store.sym(parentFolderUri), true, undefined, true, undefined)\n } */\n\n private async deleteResourceIfPresent (store: LiveStore, uri: string) {\n try {\n await store.fetcher.webOperation('DELETE', uri)\n } catch (err: any) {\n const status = err?.response?.status ?? err?.status\n if (status === 404) return\n throw err\n }\n }\n\n // TODO: Below is for a file only. I need to move this to a function\n // that function needs to check if it's a container and if so we can do the\n // recursive delete function.\n // dont' forget public and private type indexes.\n private async handleDelete (event: Event) {\n event.preventDefault()\n\n if (!this.store?.fetcher || !this.subjectUri) return\n\n const store = this.store\n const resourceNode = store.sym(this.subjectUri)\n\n const confirmation = await this.confirmDelete(utils.label(resourceNode))\n if (!confirmation) return\n\n try {\n await this.deleteResourceIfPresent(store, resourceNode.value)\n\n const aclUri = this.subjectUri + '.acl'\n if (aclUri) {\n await this.deleteResourceIfPresent(store, aclUri)\n store.removeDocument(store.sym(aclUri))\n }\n\n store.removeDocument(resourceNode)\n // this.gotoParentFolder(resourceNode.value)\n } catch (err) {\n // error('Error deleting resource:', err)\n // getStatusSection()?.showError('Failed to delete resource. Check console for details.')\n }\n }\n\n render () {\n return html`\n <solid-ui-menu>\n <solid-ui-button slot=\"trigger\" variant=\"ghost\" title=\"More options\">\n <icon-lucide-ellipsis-vertical slot=\"icon\"></icon-lucide-ellipsis-vertical>\n </solid-ui-button>\n ${this.menuItems.map(item => html`\n <solid-ui-menu-item @solid-ui-select=${(event: Event) => item.action(event)}>\n ${item.icon}\n ${item.label}\n </solid-ui-menu-item>\n `)}\n <solid-ui-menu-item @solid-ui-select=${(event: Event) => this.handleDelete(event)}>\n <icon-lucide-trash-2 slot=\"left-icon\"></icon-lucide-trash-2>\n Delete\n </solid-ui-menu-item>\n </solid-ui-menu>\n `\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../
|
|
1
|
+
const e=require("../utils/webIdUtils.cjs.js");async function t(t,i,a){let o=await e.loadProfileFromURI(t),s=e.getName(i,o),c=document.createElement(`div`);return c.classList.add(`container`),c.appendChild(r(o.uri,s)),c.appendChild(n(s)),c}function n(e){let t=document.createElement(`section`),n=document.createElement(`h2`);n.innerText=`Data`,t.appendChild(n);let r=document.createElement(`div`);r.classList.add(`list-group`),t.appendChild(r);let i=document.createElement(`a`);return i.classList.add(`list-group-item`),i.href=window.document.location.href+`public/`,i.innerText=`View ${e}'s files`,r.appendChild(i),t}function r(e,t){let n=document.createElement(`a`);n.href=e,n.innerText=t;let r=document.createElement(`span`);r.innerText=`'s Profile`;let i=document.createElement(`h1`);return i.appendChild(n),i.appendChild(r),i}exports.generateHomepage=t;
|
|
2
2
|
//# sourceMappingURL=homepage.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homepage.cjs.js","names":[],"sources":["../../src/dashboard/homepage.ts"],"sourcesContent":["import { Fetcher, IndexedFormula, NamedNode } from 'rdflib'\nimport { loadProfileFromURI, getName } from '../
|
|
1
|
+
{"version":3,"file":"homepage.cjs.js","names":[],"sources":["../../src/dashboard/homepage.ts"],"sourcesContent":["import { Fetcher, IndexedFormula, NamedNode } from 'rdflib'\nimport { loadProfileFromURI, getName } from '../utils/webIdUtils'\n\nexport async function generateHomepage (\n uri: NamedNode,\n store: IndexedFormula,\n fetcher: Fetcher\n): Promise<HTMLElement> {\n const ownersProfile = await loadProfileFromURI(uri)\n const name = getName(store, ownersProfile)\n\n const wrapper = document.createElement('div')\n wrapper.classList.add('container')\n wrapper.appendChild(createTitle(ownersProfile.uri, name))\n wrapper.appendChild(createDataSection(name))\n\n return wrapper\n}\n\nfunction createDataSection (name: string): HTMLElement {\n const dataSection = document.createElement('section')\n\n const title = document.createElement('h2')\n title.innerText = 'Data'\n dataSection.appendChild(title)\n\n const listGroup = document.createElement('div')\n listGroup.classList.add('list-group')\n dataSection.appendChild(listGroup)\n\n const publicDataLink = document.createElement('a')\n publicDataLink.classList.add('list-group-item')\n publicDataLink.href = window.document.location.href + 'public/'\n publicDataLink.innerText = `View ${name}'s files`\n listGroup.appendChild(publicDataLink)\n\n return dataSection\n}\n\nfunction createTitle (uri: string, name: string): HTMLElement {\n const profileLink = document.createElement('a')\n profileLink.href = uri\n profileLink.innerText = name\n\n const profileLinkPost = document.createElement('span')\n profileLinkPost.innerText = '\\'s Profile'\n\n const title = document.createElement('h1')\n title.appendChild(profileLink)\n title.appendChild(profileLinkPost)\n\n return title\n}\n"],"mappings":"8CAGA,eAAsB,EACpB,EACA,EACA,EACsB,CACtB,IAAM,EAAgB,MAAM,EAAA,mBAAmB,CAAG,EAC5C,EAAO,EAAA,QAAQ,EAAO,CAAa,EAEnC,EAAU,SAAS,cAAc,KAAK,EAK5C,OAJA,EAAQ,UAAU,IAAI,WAAW,EACjC,EAAQ,YAAY,EAAY,EAAc,IAAK,CAAI,CAAC,EACxD,EAAQ,YAAY,EAAkB,CAAI,CAAC,EAEpC,CACT,CAEA,SAAS,EAAmB,EAA2B,CACrD,IAAM,EAAc,SAAS,cAAc,SAAS,EAE9C,EAAQ,SAAS,cAAc,IAAI,EACzC,EAAM,UAAY,OAClB,EAAY,YAAY,CAAK,EAE7B,IAAM,EAAY,SAAS,cAAc,KAAK,EAC9C,EAAU,UAAU,IAAI,YAAY,EACpC,EAAY,YAAY,CAAS,EAEjC,IAAM,EAAiB,SAAS,cAAc,GAAG,EAMjD,OALA,EAAe,UAAU,IAAI,iBAAiB,EAC9C,EAAe,KAAO,OAAO,SAAS,SAAS,KAAO,UACtD,EAAe,UAAY,QAAQ,EAAK,UACxC,EAAU,YAAY,CAAc,EAE7B,CACT,CAEA,SAAS,EAAa,EAAa,EAA2B,CAC5D,IAAM,EAAc,SAAS,cAAc,GAAG,EAC9C,EAAY,KAAO,EACnB,EAAY,UAAY,EAExB,IAAM,EAAkB,SAAS,cAAc,MAAM,EACrD,EAAgB,UAAY,aAE5B,IAAM,EAAQ,SAAS,cAAc,IAAI,EAIzC,OAHA,EAAM,YAAY,CAAW,EAC7B,EAAM,YAAY,CAAe,EAE1B,CACT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getName as e, loadProfileFromURI as t } from "../
|
|
1
|
+
import { getName as e, loadProfileFromURI as t } from "../utils/webIdUtils.esm.js";
|
|
2
2
|
//#region src/dashboard/homepage.ts
|
|
3
3
|
async function n(n, a, o) {
|
|
4
|
-
let s = await t(n
|
|
4
|
+
let s = await t(n), c = e(a, s), l = document.createElement("div");
|
|
5
5
|
return l.classList.add("container"), l.appendChild(i(s.uri, c)), l.appendChild(r(c)), l;
|
|
6
6
|
}
|
|
7
7
|
function r(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homepage.esm.js","names":[],"sources":["../../src/dashboard/homepage.ts"],"sourcesContent":["import { Fetcher, IndexedFormula, NamedNode } from 'rdflib'\nimport { loadProfileFromURI, getName } from '../
|
|
1
|
+
{"version":3,"file":"homepage.esm.js","names":[],"sources":["../../src/dashboard/homepage.ts"],"sourcesContent":["import { Fetcher, IndexedFormula, NamedNode } from 'rdflib'\nimport { loadProfileFromURI, getName } from '../utils/webIdUtils'\n\nexport async function generateHomepage (\n uri: NamedNode,\n store: IndexedFormula,\n fetcher: Fetcher\n): Promise<HTMLElement> {\n const ownersProfile = await loadProfileFromURI(uri)\n const name = getName(store, ownersProfile)\n\n const wrapper = document.createElement('div')\n wrapper.classList.add('container')\n wrapper.appendChild(createTitle(ownersProfile.uri, name))\n wrapper.appendChild(createDataSection(name))\n\n return wrapper\n}\n\nfunction createDataSection (name: string): HTMLElement {\n const dataSection = document.createElement('section')\n\n const title = document.createElement('h2')\n title.innerText = 'Data'\n dataSection.appendChild(title)\n\n const listGroup = document.createElement('div')\n listGroup.classList.add('list-group')\n dataSection.appendChild(listGroup)\n\n const publicDataLink = document.createElement('a')\n publicDataLink.classList.add('list-group-item')\n publicDataLink.href = window.document.location.href + 'public/'\n publicDataLink.innerText = `View ${name}'s files`\n listGroup.appendChild(publicDataLink)\n\n return dataSection\n}\n\nfunction createTitle (uri: string, name: string): HTMLElement {\n const profileLink = document.createElement('a')\n profileLink.href = uri\n profileLink.innerText = name\n\n const profileLinkPost = document.createElement('span')\n profileLinkPost.innerText = '\\'s Profile'\n\n const title = document.createElement('h1')\n title.appendChild(profileLink)\n title.appendChild(profileLinkPost)\n\n return title\n}\n"],"mappings":";;AAGA,eAAsB,EACpB,GACA,GACA,GACsB;CACtB,IAAM,IAAgB,MAAM,EAAmB,CAAG,GAC5C,IAAO,EAAQ,GAAO,CAAa,GAEnC,IAAU,SAAS,cAAc,KAAK;CAK5C,OAJA,EAAQ,UAAU,IAAI,WAAW,GACjC,EAAQ,YAAY,EAAY,EAAc,KAAK,CAAI,CAAC,GACxD,EAAQ,YAAY,EAAkB,CAAI,CAAC,GAEpC;AACT;AAEA,SAAS,EAAmB,GAA2B;CACrD,IAAM,IAAc,SAAS,cAAc,SAAS,GAE9C,IAAQ,SAAS,cAAc,IAAI;CAEzC,AADA,EAAM,YAAY,QAClB,EAAY,YAAY,CAAK;CAE7B,IAAM,IAAY,SAAS,cAAc,KAAK;CAE9C,AADA,EAAU,UAAU,IAAI,YAAY,GACpC,EAAY,YAAY,CAAS;CAEjC,IAAM,IAAiB,SAAS,cAAc,GAAG;CAMjD,OALA,EAAe,UAAU,IAAI,iBAAiB,GAC9C,EAAe,OAAO,OAAO,SAAS,SAAS,OAAO,WACtD,EAAe,YAAY,QAAQ,EAAK,WACxC,EAAU,YAAY,CAAc,GAE7B;AACT;AAEA,SAAS,EAAa,GAAa,GAA2B;CAC5D,IAAM,IAAc,SAAS,cAAc,GAAG;CAE9C,AADA,EAAY,OAAO,GACnB,EAAY,YAAY;CAExB,IAAM,IAAkB,SAAS,cAAc,MAAM;CACrD,EAAgB,YAAY;CAE5B,IAAM,IAAQ,SAAS,cAAc,IAAI;CAIzC,OAHA,EAAM,YAAY,CAAW,GAC7B,EAAM,YAAY,CAAe,GAE1B;AACT"}
|
package/dist/form/pane.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.formPane a,.formPane a:link{color:var(--color-text-link,#3b5998);text-decoration:none}.formPane a:visited{color:var(--color-text-link-visited,#3b5998);text-decoration:none}.formPane a:hover{color:var(--color-text-link-hover,#3b5998);font-weight:700}.formPane a:active{color:var(--color-text-link-active,#888);text-decoration:none}.formPane__message,.formPaneMessage{color:#666;margin:var(--spacing-xs,.5em) 0;padding:var(--spacing-xs,.35em) var(--spacing-xs,.5em)}.formPane__message--info{background-color:var(--color-main-block-bg,#eee)}.formPane__message--error{background-color:var(--color-log-error-bg,#fee)}.formPane__editButton{padding:var(--spacing-xs,.5rem);float:none;border:.5rem solid #fff;align-self:center;margin-left:auto;font-size:100%}.formPane .formPane__mobileTextareaValue>div{min-width:0;display:block;position:relative}.formPane .formPane__mobileTextareaValue>div>textarea{box-sizing:border-box;width:100%;min-width:0;max-width:100%}.formPane .formPane__mobileTextareaValue>div>button[type=button]{position:absolute;top:0;right:0;float:none!important}.formPane[data-layout=mobile] .formPane__mobileTextareaRow{align-items:stretch;flex-direction:column!important}.formPane[data-layout=mobile] .formPane__mobileTextareaLabel{padding-bottom:0;width:auto!important}.formPane[data-layout=mobile] .formPane__mobileTextareaValue{box-sizing:border-box;min-width:0;padding-right:var(--spacing-sm,.75rem);width:100%}.formPane[data-layout=mobile] .formPane__mobileTextareaValue textarea{box-sizing:border-box;width:100%;max-width:100%;margin-left:0!important;margin-right:0!important}@media (width<=960px){.formPane .formPane__mobileTextareaRow{align-items:stretch;flex-direction:column!important}.formPane .formPane__mobileTextareaLabel{padding-bottom:0;width:auto!important}.formPane .formPane__mobileTextareaValue{box-sizing:border-box;min-width:0;padding-right:var(--spacing-sm,.75rem);width:100%}.formPane .formPane__mobileTextareaValue textarea{box-sizing:border-box;width:100%;max-width:100%;margin-left:0!important;margin-right:0!important}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;let t=require("solid-ui");t=e.__toESM(t);let n=require("solid-logic"),r=require("rdflib");r=e.__toESM(r);var i=t.ns;function a(e){return e?.termType===`NamedNode`}function o(e,t){let n=t.doc?t.doc():void 0,r=e.each(t,i.rdf(`type`),void 0,n).filter(a),s=r.some(e=>e.sameTerm(i.ui(`Group`))),c=r.some(e=>!e.sameTerm(i.ui(`Group`))&&!e.sameTerm(i.ui(`Form`))),l=!!e.any(t,i.ui(`property`),void 0,n),u=e.any(t,i.ui(`parts`),void 0,n),d=!!u?.elements?.length||e.each(t,i.ui(`part`),void 0,n).length>0;s&&c&&l&&!d&&e.removeMany(t,i.rdf(`type`),i.ui(`Group`),n);let f=u?.elements??[];for(let t of f)a(t)&&o(e,t);let p=e.each(t,i.ui(`part`),void 0,n);for(let t of p)a(t)&&o(e,t)}function s(e){let t=Array.from(e.querySelectorAll(`textarea`));for(let e of t){let t=e.parentElement;for(;t;){let e=t.firstElementChild;if(e&&(e.classList.contains(`formFieldName`)||e.querySelector(`a`)!==null)&&t.children.length>=2){t.classList.add(`formPane__mobileTextareaRow`),e.classList.add(`formPane__mobileTextareaLabel`),t.children[1].classList.add(`formPane__mobileTextareaValue`);break}t=t.parentElement}}}var c={icon:t.icons.iconBase+`noun_122196.svg`,name:`form`,audience:[i.solid(`PowerUser`)],label:function(e,n){let r=t.widgets.formsFor(e).length;return t.log.debug(`Form pane: forms for `+e+`: `+r),r?``+r+` forms`:null},render:function(e,c){let l=c.session.store,u=c.dom,d=u.createElement(`div`);d.setAttribute(`class`,`formPane`);function f(e){let t=c.environment??{};e.dataset.layout=t.layout??`desktop`}f(d);let p=function(e,t=`info`){let n=u.createElement(`p`);return n.className=`formPane__message formPane__message--${t}`,d.appendChild(n).textContent=e,n},m=function(e){return p(e,`error`)},h=function(e,t){e||m(`Sorry, failed to save your change:
|
|
2
2
|
`+t)},g=n.authn.currentUser();g?l.each(g,i.ui(`workspace`)).length===0&&p(`You don't seem to have any workspaces defined. A workspace is a place on the web (http://..) or in the file system (file:///) to store application data.
|
|
3
|
-
`):p(`You are not logged in. If you log in and have workspaces then you would be able to select workspace in which to put this new information`);let _=function(e,n){l.fetcher.nowOrWhenFetched(e.uri,n,function(i,a){if(!i)return m(`Cannot load store `+e.uri+`: `+a);let c=t.widgets.formsFor(n);for(let i of c){o(l,i);let a=u.createElement(`h4`);if(a.classList.add(`formPane__heading`),d.appendChild(a),i.uri){let e=r.Util.uri.document(i.uri);e.uri!==i.uri&&d.appendChild(t.widgets.editFormButton(u,d,i,e,h)).classList.add(`formPane__editButton`)}let c=u.createElement(`a`);c.classList.add(`formPane__headingLink`),c.setAttribute(`href`,i.uri),a.insertBefore(c,a.firstChild),c.textContent=t.utils.label(i,!0),t.widgets.appendForm(u,d,{},n,i,e,h),s(d)}})},v=null,y=r.Util.uri.docpart(e.uri);l.updater.editable(y,l)&&(v=e.doc());let b=l.any(l.sym(y),i.link(`annotationStore`));if(!v&&a(b)&&(v=b),!v){let t=new Map;l.statementsMatching(e).forEach(function(e){e.why.value&&t.set(e.why.value,1)}),l.statementsMatching(void 0,void 0,e).forEach(function(e){e.why.value&&t.set(e.why.value,2)});let n=Array.from(t.entries()).sort(function([e,t],[n,r]){return t-r||e.localeCompare(n)});for(let[e]of n)if(e&&l.updater.editable(e,l)){v=l.sym(e);break}}let x=`2014`;if(v)_(v,e);else{m(`No suitable store is known, to edit <`+e.uri+`>.`);let n=t.login.selectWorkspace(u,{noun:`form`,appPathSegment:`form`},function(t){let n=t?l.sym(t):null;if(!n){m(`Workspace selection was cancelled.`);return}p(`Workspace selected OK: `+n.uri);let r=l.each(void 0,i.space(`workspace`),n).filter(a);for(let t=0;t<r.length;t++){let n=r[t],o=l.any(n,i.space(`store`)),s=l.any(n,i.cal(`dtstart`))?.value,c=l.any(n,i.cal(`dtend`))?.value;if(a(o)&&s&&c&&s<=x&&c>x){_(o,e);break}
|
|
3
|
+
`):p(`You are not logged in. If you log in and have workspaces then you would be able to select workspace in which to put this new information`);let _=function(e,n){l.fetcher.nowOrWhenFetched(e.uri,n,function(i,a){if(!i)return m(`Cannot load store `+e.uri+`: `+a);let c=t.widgets.formsFor(n);for(let i of c){o(l,i);let a=u.createElement(`h4`);if(a.classList.add(`formPane__heading`),d.appendChild(a),i.uri){let e=r.Util.uri.document(i.uri);e.uri!==i.uri&&d.appendChild(t.widgets.editFormButton(u,d,i,e,h)).classList.add(`formPane__editButton`)}let c=u.createElement(`a`);c.classList.add(`formPane__headingLink`),c.setAttribute(`href`,i.uri),a.insertBefore(c,a.firstChild),c.textContent=t.utils.label(i,!0),t.widgets.appendForm(u,d,{},n,i,e,h),s(d)}})},v=null,y=r.Util.uri.docpart(e.uri);l.updater.editable(y,l)&&(v=e.doc());let b=l.any(l.sym(y),i.link(`annotationStore`));if(!v&&a(b)&&(v=b),!v){let t=new Map;l.statementsMatching(e).forEach(function(e){e.why.value&&t.set(e.why.value,1)}),l.statementsMatching(void 0,void 0,e).forEach(function(e){e.why.value&&t.set(e.why.value,2)});let n=Array.from(t.entries()).sort(function([e,t],[n,r]){return t-r||e.localeCompare(n)});for(let[e]of n)if(e&&l.updater.editable(e,l)){v=l.sym(e);break}}let x=`2014`;if(v)_(v,e);else{m(`No suitable store is known, to edit <`+e.uri+`>.`);let n=t.login.selectWorkspace(u,{noun:`form`,appPathSegment:`form`},function(t){let n=t?l.sym(t):null;if(!n){m(`Workspace selection was cancelled.`);return}p(`Workspace selected OK: `+n.uri);let r=l.each(void 0,i.space(`workspace`),n).filter(a);for(let t=0;t<r.length;t++){let n=r[t],o=l.any(n,i.space(`store`)),s=l.any(n,i.cal(`dtstart`))?.value,c=l.any(n,i.cal(`dtend`))?.value;if(a(o)&&s&&c&&s<=x&&c>x){_(o,e);break}m(`Note no suitable annotation store in activity: `+n)}});d.appendChild(n)}return d}};exports.formPane=c;
|
|
4
4
|
//# sourceMappingURL=pane.cjs.js.map
|