solid-panes 4.2.6 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/0314353e28ce6e5539af.svg +9 -0
- package/dist/04567ff683933c35c465.png +0 -0
- package/dist/10163fd9b5a0e00d63a0.png +0 -0
- package/dist/1234dcb2eec2e45f252b.png +0 -0
- package/dist/20899934157df4db56cb.png +0 -0
- package/dist/33760bf79f097f449da5.png +0 -0
- package/dist/4cceba29ab33b1ddd9bb.svg +6 -0
- package/dist/578d2b6ed32e7624164e.png +0 -0
- package/dist/5f62a5b2b7e99b9640c7.png +0 -0
- package/dist/6525766ecd288ec60129.png +0 -0
- package/dist/7800be6f6c4b5b0f4f20.png +0 -0
- package/dist/7b7538c6f6b317968009.svg +9 -0
- package/dist/92d03142abe6efc0b42d.svg +6 -0
- package/dist/976473cf5fe24d657d4b.png +0 -0
- package/dist/RDFXMLPane.js +1 -0
- package/dist/bda84f59e7216675a208.png +0 -0
- package/dist/cd68e8f3990ba8b2139e.png +0 -0
- package/dist/dashboard/basicPreferences.d.ts.map +1 -1
- package/dist/dashboard/basicPreferences.js +1 -0
- package/dist/dashboard/dashboardPane.d.ts.map +1 -1
- package/dist/dashboard/dashboardPane.js +9 -3
- package/dist/dashboard/homepage.d.ts +1 -1
- package/dist/dashboard/homepage.d.ts.map +1 -1
- package/dist/dashboard/homepage.js +5 -35
- package/dist/e7074a7e2cb69e51cfd3.png +0 -0
- package/dist/f3772696fb7ee53c23d8.png +0 -0
- package/dist/form/pane.js +1 -1
- package/dist/home/homePane.d.ts.map +1 -1
- package/dist/home/homePane.js +2 -0
- package/dist/humanReadablePane.js +34 -8
- package/dist/icons/clock.svg +7 -0
- package/dist/icons/comment.svg +6 -0
- package/dist/icons/dashboard.svg +9 -0
- package/dist/icons/downArrow.svg +6 -0
- package/dist/icons/folder.svg +6 -0
- package/dist/icons/friends.svg +9 -0
- package/dist/icons/help.svg +8 -0
- package/dist/icons/iconHelper.d.ts +2 -0
- package/dist/icons/iconHelper.d.ts.map +1 -0
- package/dist/icons/iconHelper.js +23 -0
- package/dist/icons/menu.svg +8 -0
- package/dist/icons/person.svg +6 -0
- package/dist/icons/personInCircle.svg +8 -0
- package/dist/icons/sharing.svg +10 -0
- package/dist/icons/signOut.svg +8 -0
- package/dist/icons/signup.png +0 -0
- package/dist/icons/star.svg +3 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -4
- package/dist/internal/internalPane.d.ts.map +1 -1
- package/dist/internal/internalPane.js +1 -0
- package/dist/mainPage/footer.d.ts +14 -2
- package/dist/mainPage/footer.d.ts.map +1 -1
- package/dist/mainPage/footer.js +21 -13
- package/dist/mainPage/header.d.ts +16 -1
- package/dist/mainPage/header.d.ts.map +1 -1
- package/dist/mainPage/header.js +179 -61
- package/dist/mainPage/index.d.ts +15 -1
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.js +38 -7
- package/dist/mainPage/menu.css +243 -0
- package/dist/mainPage/menu.d.ts +7 -0
- package/dist/mainPage/menu.d.ts.map +1 -0
- package/dist/mainPage/menu.js +409 -0
- package/dist/n3Pane.js +1 -0
- package/dist/outline/context.d.ts +2 -2
- package/dist/outline/context.d.ts.map +1 -1
- package/dist/outline/context.js +5 -2
- package/dist/outline/manager.css +12 -14
- package/dist/outline/manager.js +152 -81
- package/dist/outline/userInput.js +6 -3
- package/dist/pad/padPane.css +36 -0
- package/dist/pad/padPane.d.ts +1 -0
- package/dist/pad/padPane.d.ts.map +1 -1
- package/dist/pad/padPane.js +32 -21
- package/dist/playlist/playlistPane.js +2 -6
- package/dist/profileUtils/ownerProfile.d.ts +5 -0
- package/dist/profileUtils/ownerProfile.d.ts.map +1 -0
- package/dist/profileUtils/ownerProfile.js +84 -0
- package/dist/registerPanes.js +4 -4
- package/dist/slideshow/slideshowPane.js +1 -1
- package/dist/social/editProfileDetails.d.ts +19 -0
- package/dist/social/editProfileDetails.d.ts.map +1 -0
- package/dist/social/editProfileDetails.js +267 -0
- package/dist/social/icons.d.ts +5 -0
- package/dist/social/icons.d.ts.map +1 -0
- package/dist/social/icons.js +60 -0
- package/dist/social/socialPane.css +804 -0
- package/dist/social/socialPane.d.ts +30 -0
- package/dist/social/socialPane.d.ts.map +1 -0
- package/dist/social/socialPane.js +558 -0
- package/dist/social/socialSections.d.ts +66 -0
- package/dist/social/socialSections.d.ts.map +1 -0
- package/dist/social/socialSections.js +317 -0
- package/dist/solid-panes.js +29050 -13866
- package/dist/solid-panes.js.map +1 -1
- package/dist/solid-panes.min.js +2235 -247
- package/dist/solid-panes.min.js.map +1 -1
- package/dist/style/tabbedtab.css +0 -124
- package/dist/tabbed/tabbedPane.d.ts.map +1 -1
- package/dist/tabbed/tabbedPane.js +2 -0
- package/dist/versionInfo.js +3 -3
- package/package.json +13 -8
- package/dist/socialPane.js +0 -430
package/dist/outline/context.js
CHANGED
|
@@ -5,14 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createContext = createContext;
|
|
7
7
|
var _index = require("../index");
|
|
8
|
-
function createContext(dom, paneRegistry, store, logic) {
|
|
8
|
+
function createContext(dom, paneRegistry, store, logic, environment) {
|
|
9
9
|
return {
|
|
10
10
|
dom,
|
|
11
11
|
getOutliner: _index.getOutliner,
|
|
12
12
|
session: {
|
|
13
13
|
paneRegistry,
|
|
14
|
+
// @ts-ignore
|
|
14
15
|
store,
|
|
16
|
+
// @ts-ignore
|
|
15
17
|
logic
|
|
16
|
-
}
|
|
18
|
+
},
|
|
19
|
+
environment
|
|
17
20
|
};
|
|
18
21
|
}
|
package/dist/outline/manager.css
CHANGED
|
@@ -31,21 +31,18 @@
|
|
|
31
31
|
|
|
32
32
|
.paneShown {
|
|
33
33
|
width: 24px;
|
|
34
|
-
border
|
|
35
|
-
border-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
margin-left: 1em;
|
|
40
|
-
padding: 3px;
|
|
41
|
-
background-color: #ffd;
|
|
34
|
+
border: none !important;
|
|
35
|
+
border-radius: var(--border-radius-md, 0.5rem);
|
|
36
|
+
margin-left: var(--spacing-small, 0.1rem);
|
|
37
|
+
padding: 0.188rem; /* 3px */
|
|
38
|
+
background-color: var(--header-menu-item-hover, #e6dcff) !important;
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
.paneHidden {
|
|
45
42
|
width: 24px;
|
|
46
|
-
border-radius: 0.
|
|
47
|
-
margin-left:
|
|
48
|
-
padding: 3px
|
|
43
|
+
border-radius: var(--border-radius-md, 0.5rem);
|
|
44
|
+
margin-left: var(--spacing-small, 0.1rem);
|
|
45
|
+
padding: 0.188rem; /* 3px */
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
.header {
|
|
@@ -57,12 +54,13 @@
|
|
|
57
54
|
|
|
58
55
|
.strongHeader {
|
|
59
56
|
font-size: 150%;
|
|
60
|
-
margin: 0 0.
|
|
61
|
-
padding: 0.
|
|
57
|
+
margin: 0 0.6rem 0 0;
|
|
58
|
+
padding: 0.1rem 0.4rem;
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
.tableFullWidth {
|
|
65
62
|
width: 100%;
|
|
63
|
+
background: var(--color-background, #F8F9FB) !important;
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
.placeholderTable {
|
|
@@ -70,7 +68,7 @@
|
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
.tdFlex {
|
|
73
|
-
margin: 0.
|
|
71
|
+
margin: var(--spacing-xxxs, 0.2rem);
|
|
74
72
|
border: none;
|
|
75
73
|
padding: 0;
|
|
76
74
|
vertical-align: top;
|
package/dist/outline/manager.js
CHANGED
|
@@ -13,6 +13,12 @@ var _propertyViews = require("./propertyViews");
|
|
|
13
13
|
var _outlineIcons = require("./outlineIcons.js");
|
|
14
14
|
var _userInput = require("./userInput.js");
|
|
15
15
|
var queryByExample = _interopRequireWildcard(require("./queryByExample.js"));
|
|
16
|
+
var _ownerProfile = require("../profileUtils/ownerProfile");
|
|
17
|
+
var _person = _interopRequireDefault(require("../icons/person.svg"));
|
|
18
|
+
var _friends = _interopRequireDefault(require("../icons/friends.svg"));
|
|
19
|
+
var _folder = _interopRequireDefault(require("../icons/folder.svg"));
|
|
20
|
+
var _dashboard = _interopRequireDefault(require("../icons/dashboard.svg"));
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
23
|
/* istanbul ignore file */
|
|
18
24
|
/* -*- coding: utf-8-dos -*-
|
|
@@ -21,6 +27,11 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
21
27
|
|
|
22
28
|
// @@ chec
|
|
23
29
|
|
|
30
|
+
const PERSON_ICON = _person.default;
|
|
31
|
+
const FRIENDS_ICON = _friends.default;
|
|
32
|
+
const FOLDER_ICON = _folder.default;
|
|
33
|
+
const DASHBOARD_ICON = _dashboard.default;
|
|
34
|
+
|
|
24
35
|
/* global alert XPathResult sourceWidget */
|
|
25
36
|
// XPathResult?
|
|
26
37
|
|
|
@@ -29,6 +40,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
29
40
|
function _default(context) {
|
|
30
41
|
const dom = context.dom;
|
|
31
42
|
this.document = context.dom;
|
|
43
|
+
this.context = context;
|
|
32
44
|
this.outlineIcons = _outlineIcons.outlineIcons;
|
|
33
45
|
this.labeller = this.labeller || {};
|
|
34
46
|
this.labeller.LanguagePreference = ''; // for now
|
|
@@ -54,6 +66,16 @@ function _default(context) {
|
|
|
54
66
|
const table = getOutlineContainer();
|
|
55
67
|
table.outline = this;
|
|
56
68
|
};
|
|
69
|
+
this.getLayoutMode = function () {
|
|
70
|
+
const envLayout = this.context?.environment?.layout;
|
|
71
|
+
if (envLayout === 'mobile' || envLayout === 'desktop') return envLayout;
|
|
72
|
+
if (typeof window !== 'undefined' && window.matchMedia) {
|
|
73
|
+
const viewportWidth = Math.round(Math.min(window.innerWidth, window.visualViewport?.width || window.innerWidth));
|
|
74
|
+
const isTouchInput = window.matchMedia('(pointer: coarse)').matches || navigator.maxTouchPoints > 0;
|
|
75
|
+
return viewportWidth <= 768 || isTouchInput && viewportWidth <= 1024 ? 'mobile' : 'desktop';
|
|
76
|
+
}
|
|
77
|
+
return 'desktop';
|
|
78
|
+
};
|
|
57
79
|
|
|
58
80
|
/** benchmark a function **/
|
|
59
81
|
benchmark.lastkbsize = 0;
|
|
@@ -155,6 +177,10 @@ function _default(context) {
|
|
|
155
177
|
td.classList.add('obj');
|
|
156
178
|
td.setAttribute('notSelectable', 'false');
|
|
157
179
|
td.style.margin = '0.2em';
|
|
180
|
+
if (!obj) {
|
|
181
|
+
td.textContent = 'No object available.';
|
|
182
|
+
return td;
|
|
183
|
+
}
|
|
158
184
|
td.style.border = 'none';
|
|
159
185
|
td.style.padding = '0';
|
|
160
186
|
td.style.verticalAlign = 'top';
|
|
@@ -253,31 +279,15 @@ function _default(context) {
|
|
|
253
279
|
throw new Error('Not logged in');
|
|
254
280
|
}
|
|
255
281
|
const items = await getDashboardItems();
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
div
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const me = _solidLogic.authn.currentUser();
|
|
266
|
-
thisOutline.GotoSubject(item.subject || me, true, pane, false, undefined, table);
|
|
267
|
-
}
|
|
268
|
-
div.appendChild(UI.tabs.tabWidget({
|
|
269
|
-
dom,
|
|
270
|
-
subject: me,
|
|
271
|
-
items,
|
|
272
|
-
renderMain,
|
|
273
|
-
renderTab,
|
|
274
|
-
ordered: true,
|
|
275
|
-
orientation: 0,
|
|
276
|
-
backgroundColor: '#eeeeee',
|
|
277
|
-
// black?
|
|
278
|
-
selectedTab: options.selectedTab,
|
|
279
|
-
onClose: options.onClose
|
|
280
|
-
}));
|
|
282
|
+
const selectedItem = options.selectedTab ? items.find(item => item.paneName === options.selectedTab || item.tabName === options.selectedTab) : items[0];
|
|
283
|
+
if (!selectedItem) {
|
|
284
|
+
return div;
|
|
285
|
+
}
|
|
286
|
+
div.dataset.globalPaneName = selectedItem.tabName || selectedItem.paneName;
|
|
287
|
+
const content = div.appendChild(dom.createElement('div'));
|
|
288
|
+
const pane = paneRegistry.byName(selectedItem.paneName); // 20190701
|
|
289
|
+
const table = content.appendChild(dom.createElement('table'));
|
|
290
|
+
thisOutline.GotoSubject(selectedItem.subject || me, true, pane, false, undefined, table);
|
|
281
291
|
return div;
|
|
282
292
|
}
|
|
283
293
|
this.getDashboard = globalAppTabs;
|
|
@@ -285,24 +295,38 @@ function _default(context) {
|
|
|
285
295
|
const me = _solidLogic.authn.currentUser();
|
|
286
296
|
if (!me) return [];
|
|
287
297
|
const div = dom.createElement('div');
|
|
288
|
-
const
|
|
289
|
-
return [{
|
|
290
|
-
paneName: 'home',
|
|
291
|
-
label: 'Your stuff',
|
|
292
|
-
icon: UI.icons.iconBase + 'noun_547570.svg'
|
|
293
|
-
}, {
|
|
294
|
-
paneName: 'basicPreferences',
|
|
295
|
-
label: 'Preferences',
|
|
296
|
-
icon: UI.icons.iconBase + 'noun_Sliders_341315_00000.svg'
|
|
297
|
-
}, {
|
|
298
|
+
const panes = [{
|
|
298
299
|
paneName: 'profile',
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
subject: me,
|
|
301
|
+
label: 'Your profile',
|
|
302
|
+
icon: PERSON_ICON
|
|
301
303
|
}, {
|
|
304
|
+
paneName: 'social',
|
|
305
|
+
// loads socialPane
|
|
306
|
+
subject: me,
|
|
307
|
+
label: 'Your friends',
|
|
308
|
+
icon: FRIENDS_ICON
|
|
309
|
+
}];
|
|
310
|
+
const [pods] = await Promise.all([getPods()]);
|
|
311
|
+
panes.push(...pods);
|
|
312
|
+
panes.push(
|
|
313
|
+
/* not in use since redesign of profile-pane
|
|
314
|
+
{
|
|
302
315
|
paneName: 'editProfile',
|
|
303
316
|
label: 'Edit your Profile',
|
|
304
317
|
icon: UI.icons.iconBase + 'noun_492246.svg'
|
|
305
|
-
}
|
|
318
|
+
},
|
|
319
|
+
*/
|
|
320
|
+
{
|
|
321
|
+
paneName: 'home',
|
|
322
|
+
label: 'Your dashboard',
|
|
323
|
+
icon: DASHBOARD_ICON
|
|
324
|
+
}, {
|
|
325
|
+
paneName: 'basicPreferences',
|
|
326
|
+
label: 'Your preferences',
|
|
327
|
+
icon: UI.icons.iconBase + 'noun_Sliders_341315_000000.svg'
|
|
328
|
+
});
|
|
329
|
+
return panes;
|
|
306
330
|
async function getPods() {
|
|
307
331
|
async function addPodStorage(pod) {
|
|
308
332
|
// namedNode
|
|
@@ -332,10 +356,10 @@ function _default(context) {
|
|
|
332
356
|
}
|
|
333
357
|
// load pod's storages from profile
|
|
334
358
|
let pods = kb.each(me, ns.space('storage'), null, me.doc());
|
|
335
|
-
pods.map(async pod => {
|
|
359
|
+
await Promise.all(pods.map(async pod => {
|
|
336
360
|
// TODO use addPodStorageFromUrl(pod.uri) to check for pim:Storage ???
|
|
337
361
|
await loadContainerRepresentation(pod);
|
|
338
|
-
});
|
|
362
|
+
}));
|
|
339
363
|
try {
|
|
340
364
|
// if uri then SolidOS is a browse.html web app
|
|
341
365
|
const uri = new URL(window.location.href).searchParams.get('uri');
|
|
@@ -354,19 +378,20 @@ function _default(context) {
|
|
|
354
378
|
}
|
|
355
379
|
pods = uniques(pods);
|
|
356
380
|
if (!pods.length) return [];
|
|
357
|
-
return pods.map((pod, index) => {
|
|
381
|
+
return Promise.all(pods.map(async (pod, index) => {
|
|
358
382
|
function split(item) {
|
|
359
383
|
return item.uri.split('//')[1].slice(0, -1);
|
|
360
384
|
}
|
|
361
|
-
const
|
|
385
|
+
const ownerName = (await (0, _ownerProfile.getNameOfPodOwner)(pod, kb, sf)) || '';
|
|
386
|
+
const label = split(me).startsWith(split(pod)) ? 'Your storage' : ownerName.trim() !== '' ? ownerName + '\'s storage' : split(pod);
|
|
362
387
|
return {
|
|
363
388
|
paneName: 'folder',
|
|
364
389
|
tabName: `folder-${index}`,
|
|
365
390
|
label,
|
|
366
391
|
subject: pod,
|
|
367
|
-
icon:
|
|
392
|
+
icon: FOLDER_ICON
|
|
368
393
|
};
|
|
369
|
-
});
|
|
394
|
+
}));
|
|
370
395
|
}
|
|
371
396
|
async function getAddressBooks() {
|
|
372
397
|
try {
|
|
@@ -397,62 +422,91 @@ function _default(context) {
|
|
|
397
422
|
* @param {string} [options.pane] To open a specific dashboard pane
|
|
398
423
|
* @returns {Promise<void>}
|
|
399
424
|
*/
|
|
400
|
-
|
|
425
|
+
function closeDashboard() {
|
|
426
|
+
const dashboardContainer = getDashboardContainer();
|
|
427
|
+
const outlineContainer = getOutlineContainer();
|
|
428
|
+
dashboardContainer.innerHTML = '';
|
|
429
|
+
hideGlobalContainer(dashboardContainer);
|
|
430
|
+
showGlobalContainer(outlineContainer);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Register the closeDashboard listener only once
|
|
434
|
+
_solidLogic.authSession.events.on('logout', closeDashboard);
|
|
435
|
+
function showGlobalContainer(container) {
|
|
436
|
+
container.removeAttribute('hidden');
|
|
437
|
+
container.style.display = '';
|
|
438
|
+
}
|
|
439
|
+
function hideGlobalContainer(container) {
|
|
440
|
+
container.setAttribute('hidden', '');
|
|
441
|
+
container.style.display = 'none';
|
|
442
|
+
}
|
|
443
|
+
async function showDashboard(subject, options = {}) {
|
|
401
444
|
const dashboardContainer = getDashboardContainer();
|
|
402
445
|
const outlineContainer = getOutlineContainer();
|
|
403
|
-
|
|
404
|
-
if
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
446
|
+
|
|
447
|
+
// reuse existing dashboard if already rendered for the same pane and subject
|
|
448
|
+
if (dashboardContainer.childNodes.length > 0) {
|
|
449
|
+
const existingDashboard = dashboardContainer.firstElementChild;
|
|
450
|
+
if (existingDashboard && options.pane && existingDashboard.dataset.globalPaneName === options.pane && existingDashboard.dataset.subject === (subject && subject.value || '')) {
|
|
451
|
+
hideGlobalContainer(outlineContainer);
|
|
452
|
+
showGlobalContainer(dashboardContainer);
|
|
410
453
|
return;
|
|
411
454
|
}
|
|
412
|
-
|
|
455
|
+
dashboardContainer.innerHTML = '';
|
|
413
456
|
}
|
|
414
457
|
|
|
415
458
|
// create a new dashboard if not already present
|
|
416
459
|
const dashboard = await globalAppTabs({
|
|
417
|
-
selectedTab: options.pane
|
|
418
|
-
onClose: closeDashboard
|
|
460
|
+
selectedTab: options.pane
|
|
461
|
+
// onClose: closeDashboard
|
|
419
462
|
});
|
|
420
463
|
|
|
421
|
-
// close the dashboard if user log out
|
|
422
|
-
_solidLogic.authSession.events.on('logout', closeDashboard);
|
|
423
|
-
|
|
424
464
|
// finally - switch to showing dashboard
|
|
425
|
-
outlineContainer
|
|
465
|
+
hideGlobalContainer(outlineContainer);
|
|
466
|
+
showGlobalContainer(dashboardContainer);
|
|
426
467
|
dashboardContainer.appendChild(dashboard);
|
|
427
|
-
const tab = dashboardContainer.querySelector(`[data-global-pane-name="${options.pane}"]`);
|
|
428
|
-
if (tab) {
|
|
429
|
-
tab.click();
|
|
430
|
-
}
|
|
431
|
-
function closeDashboard() {
|
|
432
|
-
dashboardContainer.style.display = 'none';
|
|
433
|
-
outlineContainer.style.display = 'inherit';
|
|
434
|
-
}
|
|
435
468
|
}
|
|
436
469
|
this.showDashboard = showDashboard;
|
|
437
470
|
function getDashboardContainer() {
|
|
438
|
-
return getOrCreateContainer('GlobalDashboard');
|
|
471
|
+
return getOrCreateContainer('GlobalDashboard', 'Dashboard');
|
|
439
472
|
}
|
|
440
473
|
function getOutlineContainer() {
|
|
441
|
-
return getOrCreateContainer('
|
|
474
|
+
return getOrCreateContainer('OutlineView', 'Resource browser');
|
|
442
475
|
}
|
|
443
476
|
|
|
444
477
|
/**
|
|
445
478
|
* Get element with id or create a new on the fly with that id
|
|
446
479
|
*
|
|
447
480
|
* @param {string} id The ID of the element you want to get or create
|
|
481
|
+
* @param {string} [ariaLabel] Optional aria-label for accessibility
|
|
448
482
|
* @returns {HTMLElement}
|
|
449
483
|
*/
|
|
450
484
|
function getOrCreateContainer(id) {
|
|
485
|
+
const containerHost = document.getElementById('app-view') || document.getElementById('MainContent') || document.querySelector('[role="main"]') || document.body;
|
|
486
|
+
|
|
487
|
+
// OutlineView is a table
|
|
488
|
+
if (id === 'OutlineView') {
|
|
489
|
+
const existingOutline = document.getElementById('OutlineView');
|
|
490
|
+
if (existingOutline) {
|
|
491
|
+
return existingOutline;
|
|
492
|
+
}
|
|
493
|
+
if (containerHost) {
|
|
494
|
+
const OutlineView = document.createElement('table');
|
|
495
|
+
OutlineView.id = 'OutlineView';
|
|
496
|
+
OutlineView.classList.add('outline-view');
|
|
497
|
+
OutlineView.setAttribute('aria-label', 'Resource browser');
|
|
498
|
+
containerHost.appendChild(OutlineView);
|
|
499
|
+
return OutlineView;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// or we deal with the section GlobalDashboard
|
|
451
504
|
return document.getElementById(id) || (() => {
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
505
|
+
const GlobalDashboard = document.createElement('section');
|
|
506
|
+
GlobalDashboard.id = id;
|
|
507
|
+
GlobalDashboard.setAttribute('aria-label', 'Dashboard');
|
|
508
|
+
GlobalDashboard.classList.add('global-dashboard');
|
|
509
|
+
return containerHost.appendChild(GlobalDashboard);
|
|
456
510
|
})();
|
|
457
511
|
}
|
|
458
512
|
async function loadContainerRepresentation(subject) {
|
|
@@ -504,7 +558,14 @@ function _default(context) {
|
|
|
504
558
|
// if only one, simplify interface
|
|
505
559
|
relevantPanes.forEach((pane, index) => {
|
|
506
560
|
const label = pane.label(subject, context);
|
|
507
|
-
|
|
561
|
+
let iconSrc = '';
|
|
562
|
+
if (pane.name === 'profile') {
|
|
563
|
+
iconSrc = PERSON_ICON;
|
|
564
|
+
} else if (pane.name === 'social') {
|
|
565
|
+
iconSrc = FRIENDS_ICON;
|
|
566
|
+
} else {
|
|
567
|
+
iconSrc = typeof pane.icon === 'function' ? pane.icon(subject, context) : pane.icon;
|
|
568
|
+
}
|
|
508
569
|
const ico = UI.utils.AJARImage(iconSrc, label, label, dom);
|
|
509
570
|
|
|
510
571
|
// Handle async icon functions
|
|
@@ -567,6 +628,9 @@ function _default(context) {
|
|
|
567
628
|
const second = containingTable.firstChild.nextSibling;
|
|
568
629
|
const row = dom.createElement('tr');
|
|
569
630
|
const cell = row.appendChild(dom.createElement('td'));
|
|
631
|
+
cell.setAttribute('colspan', '2');
|
|
632
|
+
cell.style.textAlign = 'left';
|
|
633
|
+
cell.style.width = '100%';
|
|
570
634
|
cell.appendChild(paneDiv);
|
|
571
635
|
if (second) containingTable.insertBefore(row, second);else containingTable.appendChild(row);
|
|
572
636
|
row.pane = pane;
|
|
@@ -611,7 +675,7 @@ function _default(context) {
|
|
|
611
675
|
tr.setAttribute('class', 'hoverControl');
|
|
612
676
|
}
|
|
613
677
|
const td = tr.appendChild(dom.createElement('td'));
|
|
614
|
-
td.setAttribute('style', 'margin: 0.2em; border: none; padding: 0; vertical-align: top;' + 'display:flex; justify-content: space-between; flex-direction: row;');
|
|
678
|
+
td.setAttribute('style', 'margin: 0.2em; border: none; padding-top: 0; padding-bottom: 0; vertical-align: top;' + 'display:flex; justify-content: space-between; flex-direction: row;' + 'background-color: var(--color-background, #F8F9FB);');
|
|
615
679
|
td.setAttribute('notSelectable', 'true');
|
|
616
680
|
td.setAttribute('about', subject.toNT());
|
|
617
681
|
td.setAttribute('colspan', '2');
|
|
@@ -625,7 +689,7 @@ function _default(context) {
|
|
|
625
689
|
icon.addEventListener('click', collapseMouseDownListener);
|
|
626
690
|
const strong = header.appendChild(dom.createElement('h1'));
|
|
627
691
|
strong.appendChild(dom.createTextNode(UI.utils.label(subject)));
|
|
628
|
-
strong.style = 'font-size: 150%; margin: 0 0.6em 0 0; padding: 0.1em 0.4em;';
|
|
692
|
+
strong.style = 'font-size: 150%; margin: 0 0.6em 0 0; padding: 0.1em 0.4em;' + 'background-color: var(--color-background, #F8F9FB);';
|
|
629
693
|
UI.widgets.makeDraggable(strong, subject);
|
|
630
694
|
}
|
|
631
695
|
header.appendChild(await renderPaneIconTray(td, {
|
|
@@ -702,6 +766,10 @@ function _default(context) {
|
|
|
702
766
|
}
|
|
703
767
|
const row = dom.createElement('tr');
|
|
704
768
|
const cell = row.appendChild(dom.createElement('td'));
|
|
769
|
+
cell.setAttribute('colspan', '2');
|
|
770
|
+
cell.style.textAlign = 'left';
|
|
771
|
+
cell.style.width = '100%';
|
|
772
|
+
cell.style.backgroundColor = 'var(--color-background, #F8F9FB)';
|
|
705
773
|
cell.appendChild(paneDiv);
|
|
706
774
|
if (tr1.firstPane.requireQueryButton && dom.getElementById('queryButton')) {
|
|
707
775
|
dom.getElementById('queryButton').removeAttribute('style');
|
|
@@ -1304,7 +1372,7 @@ function _default(context) {
|
|
|
1304
1372
|
outline.GotoSubject(object, true);
|
|
1305
1373
|
/* //deal with this later
|
|
1306
1374
|
deselectAll();
|
|
1307
|
-
var newTr=dom.getElementById('
|
|
1375
|
+
var newTr=dom.getElementById('OutlineView').lastChild;
|
|
1308
1376
|
setSelected(newTr.firstChild.firstChild.childNodes[1].lastChild,true);
|
|
1309
1377
|
function setSelectedAfterward(uri){
|
|
1310
1378
|
deselectAll();
|
|
@@ -1875,10 +1943,10 @@ function _default(context) {
|
|
|
1875
1943
|
@param pane -- optional -- pane to be used for expanded display
|
|
1876
1944
|
@param solo -- optional -- the window will be cleared out and only the subject displayed
|
|
1877
1945
|
@param referer -- optional -- where did we hear about this from anyway?
|
|
1878
|
-
@param table -- option --
|
|
1946
|
+
@param table -- option -- default is an HTML table element in which to put the outline.
|
|
1879
1947
|
*/
|
|
1880
1948
|
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
|
|
1881
|
-
table = table ||
|
|
1949
|
+
table = table || getOutlineContainer('OutlineView'); // if does not exist create a compatible host in the current shell
|
|
1882
1950
|
if (solo) {
|
|
1883
1951
|
UI.utils.emptyNode(table);
|
|
1884
1952
|
table.style.width = '100%';
|
|
@@ -1910,8 +1978,11 @@ function _default(context) {
|
|
|
1910
1978
|
paneName: pane.name
|
|
1911
1979
|
} : {};
|
|
1912
1980
|
try {
|
|
1913
|
-
|
|
1914
|
-
|
|
1981
|
+
const currentUrl = new URL(document.location.href);
|
|
1982
|
+
const targetUrl = new URL(subject.uri, document.location.href);
|
|
1983
|
+
if (currentUrl.origin === targetUrl.origin) {
|
|
1984
|
+
dom.defaultView.history.pushState(stateObj, subject.uri, subject.uri);
|
|
1985
|
+
}
|
|
1915
1986
|
} catch (e) {
|
|
1916
1987
|
console.log(e);
|
|
1917
1988
|
}
|
|
@@ -1069,9 +1069,12 @@ function UserInput(outline) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
}, false);
|
|
1071
1071
|
window.addEventListener('mousedown', UserInput.Mousedown, false);
|
|
1072
|
-
document.getElementById('
|
|
1073
|
-
|
|
1074
|
-
|
|
1072
|
+
const outlineView = document.getElementById('OutlineView');
|
|
1073
|
+
if (outlineView) {
|
|
1074
|
+
outlineView.oncontextmenu = function () {
|
|
1075
|
+
return false;
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1075
1078
|
if (e.button === 2) {
|
|
1076
1079
|
// right click
|
|
1077
1080
|
UserInput.switchMode();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.pad-layout {
|
|
2
|
+
background-color: white;
|
|
3
|
+
min-width: 94%;
|
|
4
|
+
margin-right: 3%;
|
|
5
|
+
margin-left: 3%;
|
|
6
|
+
min-height: 13em;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pad-row {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pad-main {
|
|
19
|
+
flex: 1 1 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pad-controls {
|
|
24
|
+
gap: 0.5em;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pad-cell {
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (max-width: 600px) {
|
|
33
|
+
.pad-controls .pad-cell {
|
|
34
|
+
flex: 1 1 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/dist/pad/padPane.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"padPane.d.ts","sourceRoot":"","sources":["../../src/pad/padPane.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"padPane.d.ts","sourceRoot":"","sources":["../../src/pad/padPane.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,eAAe,CAAA;AAKtB,QAAA,MAAM,OAAO,EAAE,cA0iBd,CAAA;AAGD,eAAe,OAAO,CAAA"}
|
package/dist/pad/padPane.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _solidUi = require("solid-ui");
|
|
8
8
|
var _solidLogic = require("solid-logic");
|
|
9
9
|
var _rdflib = require("rdflib");
|
|
10
|
+
require("./padPane.css");
|
|
10
11
|
/* pad Pane
|
|
11
12
|
**
|
|
12
13
|
*/
|
|
@@ -18,6 +19,7 @@ const paneDef = {
|
|
|
18
19
|
audience: [_solidUi.ns.solid('PowerUser')],
|
|
19
20
|
// Does the subject deserve an pad pane?
|
|
20
21
|
label: function (subject, context) {
|
|
22
|
+
// @ts-ignore
|
|
21
23
|
const t = context.session.store.findTypeURIs(subject);
|
|
22
24
|
if (t['http://www.w3.org/ns/pim/pad#Notepad']) {
|
|
23
25
|
return 'pad';
|
|
@@ -26,6 +28,7 @@ const paneDef = {
|
|
|
26
28
|
},
|
|
27
29
|
mintClass: _solidUi.ns.pad('Notepad'),
|
|
28
30
|
mintNew: function (context, newPaneOptions) {
|
|
31
|
+
// @ts-ignore
|
|
29
32
|
const store = context.session.store;
|
|
30
33
|
const updater = store.updater;
|
|
31
34
|
if (newPaneOptions.me && !newPaneOptions.me.uri) {
|
|
@@ -65,6 +68,7 @@ const paneDef = {
|
|
|
65
68
|
// @@ TODO Set better type for paneOptions
|
|
66
69
|
render: function (subject, context, paneOptions) {
|
|
67
70
|
const dom = context.dom;
|
|
71
|
+
// @ts-ignore
|
|
68
72
|
const store = context.session.store;
|
|
69
73
|
// Utility functions
|
|
70
74
|
const complainIfBad = function (ok, message) {
|
|
@@ -375,29 +379,36 @@ const paneDef = {
|
|
|
375
379
|
const div = dom.createElement('div');
|
|
376
380
|
|
|
377
381
|
// Build the DOM
|
|
378
|
-
const structure = div.appendChild(dom.createElement('
|
|
379
|
-
structure.
|
|
380
|
-
const naviLoginoutTR = structure.appendChild(dom.createElement('
|
|
381
|
-
naviLoginoutTR.
|
|
382
|
-
naviLoginoutTR.appendChild(dom.createElement('
|
|
383
|
-
naviLoginoutTR.appendChild(dom.createElement('
|
|
384
|
-
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
const
|
|
382
|
+
const structure = div.appendChild(dom.createElement('div')); // responsive flex layout
|
|
383
|
+
structure.className = 'pad-layout';
|
|
384
|
+
const naviLoginoutTR = structure.appendChild(dom.createElement('div'));
|
|
385
|
+
naviLoginoutTR.className = 'pad-row';
|
|
386
|
+
naviLoginoutTR.appendChild(dom.createElement('div')); // naviLoginout1
|
|
387
|
+
naviLoginoutTR.appendChild(dom.createElement('div'));
|
|
388
|
+
naviLoginoutTR.appendChild(dom.createElement('div'));
|
|
389
|
+
const naviTop = structure.appendChild(dom.createElement('div')); // stuff
|
|
390
|
+
naviTop.className = 'pad-row';
|
|
391
|
+
const naviMain = naviTop.appendChild(dom.createElement('div'));
|
|
392
|
+
naviMain.className = 'pad-main';
|
|
393
|
+
const naviMiddle = structure.appendChild(dom.createElement('div')); // controls
|
|
394
|
+
naviMiddle.className = 'pad-row pad-controls';
|
|
395
|
+
const naviMiddle1 = naviMiddle.appendChild(dom.createElement('div'));
|
|
396
|
+
naviMiddle1.className = 'pad-cell';
|
|
397
|
+
const naviMiddle2 = naviMiddle.appendChild(dom.createElement('div'));
|
|
398
|
+
naviMiddle2.className = 'pad-cell';
|
|
399
|
+
const naviMiddle3 = naviMiddle.appendChild(dom.createElement('div'));
|
|
400
|
+
naviMiddle3.className = 'pad-cell';
|
|
401
|
+
const naviStatus = structure.appendChild(dom.createElement('div')); // status etc
|
|
402
|
+
naviStatus.className = 'pad-row';
|
|
392
403
|
const statusArea = naviStatus.appendChild(dom.createElement('div'));
|
|
393
|
-
const naviSpawn = structure.appendChild(dom.createElement('
|
|
404
|
+
const naviSpawn = structure.appendChild(dom.createElement('div')); // create new
|
|
405
|
+
naviSpawn.className = 'pad-row';
|
|
394
406
|
const spawnArea = naviSpawn.appendChild(dom.createElement('div'));
|
|
395
|
-
const naviMenu = structure.appendChild(dom.createElement('
|
|
396
|
-
naviMenu.setAttribute('class', 'naviMenu');
|
|
397
|
-
|
|
398
|
-
naviMenu.appendChild(dom.createElement('
|
|
399
|
-
naviMenu.appendChild(dom.createElement('
|
|
400
|
-
naviMenu.appendChild(dom.createElement('td'));
|
|
407
|
+
const naviMenu = structure.appendChild(dom.createElement('div'));
|
|
408
|
+
naviMenu.setAttribute('class', 'pad-row naviMenu');
|
|
409
|
+
naviMenu.appendChild(dom.createElement('div')); // naviLeft
|
|
410
|
+
naviMenu.appendChild(dom.createElement('div'));
|
|
411
|
+
naviMenu.appendChild(dom.createElement('div'));
|
|
401
412
|
const options = {
|
|
402
413
|
statusArea,
|
|
403
414
|
timingArea: naviMiddle1
|
|
@@ -78,18 +78,14 @@ var _default = exports.default = {
|
|
|
78
78
|
div.setAttribute('class', 'imageView');
|
|
79
79
|
img = myDocument.createElement('IFRAME');
|
|
80
80
|
img.setAttribute('src', uri);
|
|
81
|
-
img.setAttribute('width', 560);
|
|
82
|
-
img.setAttribute('height', 315);
|
|
83
81
|
img.setAttribute('frameborder', 0);
|
|
84
|
-
img.setAttribute('style', '
|
|
82
|
+
img.setAttribute('style', 'width: 100%; aspect-ratio: 16/9; max-width: 100%; border: 0;');
|
|
85
83
|
img.setAttribute('allowfullscreen', 'true');
|
|
86
84
|
} else {
|
|
87
85
|
div.setAttribute('class', 'imageView');
|
|
88
86
|
img = myDocument.createElement('IMG');
|
|
89
87
|
img.setAttribute('src', obj.value);
|
|
90
|
-
img.setAttribute('
|
|
91
|
-
img.setAttribute('height', 315);
|
|
92
|
-
img.setAttribute('style', 'max-width: 560; max-height: 315;');
|
|
88
|
+
img.setAttribute('style', 'max-width: 100%; height: auto;');
|
|
93
89
|
}
|
|
94
90
|
let descDiv;
|
|
95
91
|
if (index) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Fetcher, IndexedFormula, NamedNode } from 'rdflib';
|
|
2
|
+
export declare function loadProfileFromURI(uri: NamedNode, store: IndexedFormula, fetcher: Fetcher): Promise<NamedNode>;
|
|
3
|
+
export declare function getNameOfPodOwner(pod: NamedNode, store: IndexedFormula, fetcher: Fetcher): Promise<string>;
|
|
4
|
+
export declare function getName(store: IndexedFormula, ownersProfile: NamedNode): string;
|
|
5
|
+
//# sourceMappingURL=ownerProfile.d.ts.map
|