solid-panes 3.5.11 → 3.5.14-alpha
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/.github/workflows/ci.yml +1 -1
- package/README.md +4 -0
- package/lib/dashboard/basicPreferences.js +193 -264
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.d.ts.map +1 -1
- package/lib/dashboard/dashboardPane.js +57 -75
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.js +98 -100
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/form/pane.js +1 -1
- package/lib/form/pane.js.map +1 -1
- package/lib/home/homePane.js +112 -103
- package/lib/home/homePane.js.map +1 -1
- package/lib/humanReadablePane.js +55 -23
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +49 -89
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.js +180 -200
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.d.ts +3 -0
- package/lib/mainPage/footer.d.ts.map +1 -0
- package/lib/mainPage/footer.js +20 -0
- package/lib/mainPage/footer.js.map +1 -0
- package/lib/mainPage/header.d.ts +2 -0
- package/lib/mainPage/header.d.ts.map +1 -0
- package/lib/mainPage/header.js +142 -0
- package/lib/mainPage/header.js.map +1 -0
- package/lib/mainPage/index.d.ts +3 -0
- package/lib/mainPage/index.d.ts.map +1 -0
- package/lib/mainPage/index.js +63 -0
- package/lib/mainPage/index.js.map +1 -0
- package/lib/microblogPane/microblogPane.js +1 -1
- package/lib/outline/context.d.ts +2 -2
- package/lib/outline/context.d.ts.map +1 -1
- package/lib/outline/context.js +13 -17
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/manager.js +178 -150
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/propertyViews.js +32 -46
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/userInput.js +1 -1
- package/lib/outline/viewAsImage.js +22 -19
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.js +5 -15
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.js +406 -451
- package/lib/pad/padPane.js.map +1 -1
- package/lib/profile/editProfile.view.js +101 -124
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.js +12 -17
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js +1 -1
- package/lib/registerPanes.js.map +1 -1
- package/lib/sharing/sharingPane.js +33 -45
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.js +87 -77
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.js +173 -182
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +1 -1
- package/lib/trustedApplications/trustedApplications.utils.js +30 -36
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.js +91 -99
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/types.js +1 -4
- package/lib/types.js.map +1 -1
- package/lib/versionInfo.d.ts +0 -1
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +23 -29
- package/lib/versionInfo.js.map +1 -1
- package/package.json +22 -21
- package/src/dashboard/dashboardPane.ts +5 -3
- package/src/form/pane.js +1 -1
- package/src/humanReadablePane.js +38 -14
- package/src/index.ts +4 -3
- package/src/mainPage/footer.ts +19 -0
- package/src/mainPage/header.ts +75 -0
- package/src/mainPage/index.ts +20 -0
- package/src/outline/context.ts +2 -2
- package/src/outline/manager.js +26 -16
- package/src/registerPanes.js +2 -2
- package/src/versionInfo.ts +18 -19
- package/webpack.config.js +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { icons, authn, initHeader } from 'solid-ui'
|
|
2
|
+
/**
|
|
3
|
+
* menu icons
|
|
4
|
+
*/
|
|
5
|
+
const HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'
|
|
6
|
+
const SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* menu elements
|
|
10
|
+
*/
|
|
11
|
+
const USER_GUIDE_MENU_ITEM = 'User guide'
|
|
12
|
+
const REPORT_A_PROBLEM_MENU_ITEM = 'Report a problem'
|
|
13
|
+
const SHOW_YOUR_PROFILE_MENU_ITEM = 'Show your profile'
|
|
14
|
+
const LOG_OUT_MENU_ITEM = 'Log out'
|
|
15
|
+
/**
|
|
16
|
+
* URLS
|
|
17
|
+
*/
|
|
18
|
+
const USER_GUIDE_MENU_URL = 'https://solid.github.io/userguide/'
|
|
19
|
+
const REPORT_A_PROBLEM_MENU_URL = 'https://github.com/solid/solidos/issues'
|
|
20
|
+
|
|
21
|
+
export async function createHeader (store, outliner) {
|
|
22
|
+
initHeader(store, await setUserMenu(outliner), setHeaderOptions())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function setHeaderOptions () {
|
|
26
|
+
const helpMenuList = [
|
|
27
|
+
{ label: USER_GUIDE_MENU_ITEM, url: USER_GUIDE_MENU_URL, target: '_blank' },
|
|
28
|
+
{ label: REPORT_A_PROBLEM_MENU_ITEM, url: REPORT_A_PROBLEM_MENU_URL, target: '_blank' }
|
|
29
|
+
]
|
|
30
|
+
const headerOptions = { logo: SOLID_ICON_URL, helpIcon: HELP_MENU_ICON, helpMenuList: helpMenuList }
|
|
31
|
+
|
|
32
|
+
return headerOptions
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function setUserMenu (outliner: any) {
|
|
36
|
+
const showProfile = {
|
|
37
|
+
label: SHOW_YOUR_PROFILE_MENU_ITEM,
|
|
38
|
+
onclick: () => openUserProfile(outliner)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const logOut = {
|
|
42
|
+
label: LOG_OUT_MENU_ITEM,
|
|
43
|
+
onclick: () => {
|
|
44
|
+
authn.authSession.logout()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// the order of the menu is important here, show profile first and logout last
|
|
49
|
+
let userMenuList = [showProfile]
|
|
50
|
+
userMenuList = userMenuList.concat(await getMenuItems(outliner))
|
|
51
|
+
userMenuList.push(logOut)
|
|
52
|
+
|
|
53
|
+
return userMenuList
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function openUserProfile (outliner: any) {
|
|
57
|
+
outliner.GotoSubject(authn.currentUser(), true, undefined, true, undefined)
|
|
58
|
+
location.reload()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function getMenuItems (outliner: any) {
|
|
62
|
+
const items = await outliner.getDashboardItems()
|
|
63
|
+
return items.map((element) => {
|
|
64
|
+
return {
|
|
65
|
+
label: element.label,
|
|
66
|
+
onclick: () => openDashboardPane(outliner, element.tabName || element.paneName)
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function openDashboardPane (outliner: any, pane: string): Promise<void> {
|
|
72
|
+
outliner.showDashboard({
|
|
73
|
+
pane
|
|
74
|
+
})
|
|
75
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* Main Page
|
|
2
|
+
**
|
|
3
|
+
** This code is called in mashlib and renders the header and footer of the Databrowser.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { IndexedFormula, NamedNode } from 'rdflib'
|
|
7
|
+
import { getOutliner } from '../index'
|
|
8
|
+
import { createHeader } from './header'
|
|
9
|
+
import { createFooter } from './footer'
|
|
10
|
+
|
|
11
|
+
export default async function initMainPage (store: IndexedFormula, uri?: string|NamedNode|null) {
|
|
12
|
+
const outliner = getOutliner(document)
|
|
13
|
+
uri = uri || window.location.href
|
|
14
|
+
let subject = uri
|
|
15
|
+
if (typeof uri === 'string') subject = store.sym(uri)
|
|
16
|
+
outliner.GotoSubject(subject, true, undefined, true, undefined)
|
|
17
|
+
const header = createHeader(store, outliner)
|
|
18
|
+
const footer = createFooter(store)
|
|
19
|
+
return Promise.all([header, footer])
|
|
20
|
+
}
|
package/src/outline/context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataBrowserContext,
|
|
1
|
+
import { DataBrowserContext, PaneRegistry } from 'pane-registry'
|
|
2
2
|
import { getOutliner } from '../index'
|
|
3
|
-
import { SolidLogic } from 'solid-logic'
|
|
3
|
+
import { SolidLogic, LiveStore } from 'solid-logic'
|
|
4
4
|
|
|
5
5
|
export function createContext (
|
|
6
6
|
dom: HTMLDocument,
|
package/src/outline/manager.js
CHANGED
|
@@ -392,6 +392,7 @@ export default function (context) {
|
|
|
392
392
|
|
|
393
393
|
async function getDashboardItems () {
|
|
394
394
|
const me = UI.authn.currentUser()
|
|
395
|
+
if (!me) return []
|
|
395
396
|
const div = dom.createElement('div')
|
|
396
397
|
const [books, pods] = await Promise.all([getAddressBooks(), getPods()])
|
|
397
398
|
return [
|
|
@@ -416,7 +417,7 @@ export default function (context) {
|
|
|
416
417
|
|
|
417
418
|
async function getPods () {
|
|
418
419
|
async function addPodRoot (pod) { // namedNode
|
|
419
|
-
await
|
|
420
|
+
await checkForContainerRepresentation(pod)
|
|
420
421
|
if (kb.holds(pod, ns.rdf('type'), ns.space('Storage'), pod.doc())) {
|
|
421
422
|
pods.push(pod)
|
|
422
423
|
return true
|
|
@@ -444,25 +445,17 @@ export default function (context) {
|
|
|
444
445
|
const pods = kb.each(me, ns.space('storage'), null, me.doc())
|
|
445
446
|
|
|
446
447
|
try {
|
|
447
|
-
if
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (!kb.any(pod, ns.ldp('contains'), undefined, pod.doc())) {
|
|
452
|
-
await kb.fetcher.load(pod, { headers: { accept: 'text/turtle' } })
|
|
453
|
-
}
|
|
454
|
-
})
|
|
455
|
-
} else { // try to find podRoot from url
|
|
456
|
-
await addPodRootFromUrl(me.uri)
|
|
457
|
-
}
|
|
458
|
-
await addPodRootFromUrl(window.location.href.substring(0, window.location.href.lastIndexOf('/') + 1))
|
|
448
|
+
// if uri then SolidOS is a browse.html web app
|
|
449
|
+
const uri = (new URL(window.location.href)).searchParams.get('uri')
|
|
450
|
+
const podUrl = uri || window.location.href
|
|
451
|
+
await addPodRootFromUrl(podUrl.substring(0, podUrl.lastIndexOf('/') + 1))
|
|
459
452
|
} catch (err) {
|
|
460
453
|
console.error('cannot load container', err)
|
|
461
|
-
return []
|
|
462
454
|
}
|
|
455
|
+
if (!pods.length) return []
|
|
463
456
|
return pods.map((pod, index) => {
|
|
464
|
-
|
|
465
|
-
|
|
457
|
+
function split (item) { return item.uri.split('//')[1].slice(0, -1) }
|
|
458
|
+
const label = split(me).startsWith(split(pod)) ? 'Your storage' : split(pod)
|
|
466
459
|
return {
|
|
467
460
|
paneName: 'folder',
|
|
468
461
|
tabName: `folder-${index}`,
|
|
@@ -532,6 +525,12 @@ export default function (context) {
|
|
|
532
525
|
// finally - switch to showing dashboard
|
|
533
526
|
outlineContainer.style.display = 'none'
|
|
534
527
|
dashboardContainer.appendChild(dashboard)
|
|
528
|
+
const tab = dashboardContainer.querySelector(
|
|
529
|
+
`[data-global-pane-name="${options.pane}"]`
|
|
530
|
+
)
|
|
531
|
+
if (tab) {
|
|
532
|
+
tab.click()
|
|
533
|
+
}
|
|
535
534
|
|
|
536
535
|
function closeDashboard () {
|
|
537
536
|
dashboardContainer.style.display = 'none'
|
|
@@ -567,7 +566,18 @@ export default function (context) {
|
|
|
567
566
|
)
|
|
568
567
|
}
|
|
569
568
|
|
|
569
|
+
async function checkForContainerRepresentation (subject) {
|
|
570
|
+
// force reload for index.html with RDFa
|
|
571
|
+
if (!kb.any(subject, ns.ldp('contains'), undefined, subject.doc())) {
|
|
572
|
+
const response = await kb.fetcher.webOperation('GET', subject.uri, kb.fetcher.initFetchOptions(subject.uri, { headers: { accept: 'text/turtle' } }))
|
|
573
|
+
const containerTurtle = response.responseText
|
|
574
|
+
$rdf.parse(containerTurtle, kb, subject.uri, 'text/turtle')
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
570
578
|
async function getRelevantPanes (subject, context) {
|
|
579
|
+
// make sure container representation is loaded (when server returns index.html)
|
|
580
|
+
if (subject.uri.endsWith('/')) { await checkForContainerRepresentation(subject) }
|
|
571
581
|
const panes = context.session.paneRegistry
|
|
572
582
|
const relevantPanes = panes.list.filter(
|
|
573
583
|
pane => pane.label(subject, context) && !pane.global
|
package/src/registerPanes.js
CHANGED
|
@@ -13,7 +13,6 @@ module.exports = function registerPanes (register) {
|
|
|
13
13
|
register(require('issue-pane'))
|
|
14
14
|
register(require('contacts-pane'))
|
|
15
15
|
register(require('activitystreams-pane'))
|
|
16
|
-
register(require('markdown-pane').Pane)
|
|
17
16
|
|
|
18
17
|
register(require('./pad/padPane'))
|
|
19
18
|
// register(require('./argument/argumentPane.js')) // A position in an argument tree
|
|
@@ -54,8 +53,9 @@ module.exports = function registerPanes (register) {
|
|
|
54
53
|
register(require('./socialPane.js'))
|
|
55
54
|
|
|
56
55
|
register(require('./humanReadablePane.js')) // A web page as a web page -- how to escape to tabr?
|
|
57
|
-
register(require('
|
|
56
|
+
// register(require('markdown-pane').Pane) // replaced by markdown in humanReadablePane
|
|
58
57
|
|
|
58
|
+
register(require('./dataContentPane.js')) // Preferred for a data file
|
|
59
59
|
register(require('source-pane')) // edit source
|
|
60
60
|
register(require('./n3Pane.js'))
|
|
61
61
|
register(require('./RDFXMLPane.js'))
|
package/src/versionInfo.ts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
buildTime: '
|
|
3
|
-
commit: '
|
|
2
|
+
buildTime: '2022-01-18T23:23:17Z',
|
|
3
|
+
commit: '36b208831217a00e6be5f0fb39a379468f906c2b',
|
|
4
4
|
npmInfo:
|
|
5
5
|
{
|
|
6
|
-
'solid-panes': '3.5.
|
|
7
|
-
npm: '6.
|
|
8
|
-
ares: '1.
|
|
9
|
-
brotli: '1.0.
|
|
10
|
-
cldr: '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
v8: '7.5.288.22-node.16',
|
|
6
|
+
'solid-panes': '3.5.14',
|
|
7
|
+
npm: '6.14.13',
|
|
8
|
+
ares: '1.17.1',
|
|
9
|
+
brotli: '1.0.9',
|
|
10
|
+
cldr: '39.0',
|
|
11
|
+
icu: '69.1',
|
|
12
|
+
llhttp: '2.1.3',
|
|
13
|
+
modules: '83',
|
|
14
|
+
napi: '8',
|
|
15
|
+
nghttp2: '1.42.0',
|
|
16
|
+
node: '14.17.3',
|
|
17
|
+
openssl: '1.1.1k',
|
|
18
|
+
tz: '2021a',
|
|
19
|
+
unicode: '13.0',
|
|
20
|
+
uv: '1.41.0',
|
|
21
|
+
v8: '8.4.371.23-node.67',
|
|
23
22
|
zlib: '1.2.11'
|
|
24
23
|
}
|
|
25
24
|
}
|