solid-panes 3.5.14 → 3.5.15

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.
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
- buildTime: '2021-12-31T16:09:18Z',
9
- commit: '0bd1160e1f47fd31e285531801373b170b63a663',
8
+ buildTime: '2022-01-28T10:16:20Z',
9
+ commit: 'ad1ef0272c97b0830f9cb8d74ab8d42af173bcc1',
10
10
  npmInfo: {
11
- 'solid-panes': '3.5.13',
11
+ 'solid-panes': '3.5.15',
12
12
  npm: '6.14.13',
13
13
  ares: '1.17.1',
14
14
  brotli: '1.0.9',
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/versionInfo.ts"],"names":["buildTime","commit","npmInfo","npm","ares","brotli","cldr","icu","llhttp","modules","napi","nghttp2","node","openssl","tz","unicode","uv","v8","zlib"],"mappings":";;;;;;eAAe;AACbA,EAAAA,SAAS,EAAE,sBADE;AAEbC,EAAAA,MAAM,EAAE,0CAFK;AAGbC,EAAAA,OAAO,EACT;AACE,mBAAe,QADjB;AAEEC,IAAAA,GAAG,EAAE,SAFP;AAGEC,IAAAA,IAAI,EAAE,QAHR;AAIEC,IAAAA,MAAM,EAAE,OAJV;AAKEC,IAAAA,IAAI,EAAE,MALR;AAMEC,IAAAA,GAAG,EAAE,MANP;AAOEC,IAAAA,MAAM,EAAE,OAPV;AAQEC,IAAAA,OAAO,EAAE,IARX;AASEC,IAAAA,IAAI,EAAE,GATR;AAUEC,IAAAA,OAAO,EAAE,QAVX;AAWEC,IAAAA,IAAI,EAAE,SAXR;AAYEC,IAAAA,OAAO,EAAE,QAZX;AAaEC,IAAAA,EAAE,EAAE,OAbN;AAcEC,IAAAA,OAAO,EAAE,MAdX;AAeEC,IAAAA,EAAE,EAAE,QAfN;AAgBEC,IAAAA,EAAE,EAAE,oBAhBN;AAiBEC,IAAAA,IAAI,EAAE;AAjBR;AAJe,C","sourcesContent":["export default {\n buildTime: '2021-12-31T16:09:18Z',\n commit: '0bd1160e1f47fd31e285531801373b170b63a663',\n npmInfo:\n{\n 'solid-panes': '3.5.13',\n npm: '6.14.13',\n ares: '1.17.1',\n brotli: '1.0.9',\n cldr: '39.0',\n icu: '69.1',\n llhttp: '2.1.3',\n modules: '83',\n napi: '8',\n nghttp2: '1.42.0',\n node: '14.17.3',\n openssl: '1.1.1k',\n tz: '2021a',\n unicode: '13.0',\n uv: '1.41.0',\n v8: '8.4.371.23-node.67',\n zlib: '1.2.11'\n}\n}\n"],"file":"versionInfo.js"}
1
+ {"version":3,"sources":["../src/versionInfo.ts"],"names":["buildTime","commit","npmInfo","npm","ares","brotli","cldr","icu","llhttp","modules","napi","nghttp2","node","openssl","tz","unicode","uv","v8","zlib"],"mappings":";;;;;;eAAe;AACbA,EAAAA,SAAS,EAAE,sBADE;AAEbC,EAAAA,MAAM,EAAE,0CAFK;AAGbC,EAAAA,OAAO,EACT;AACE,mBAAe,QADjB;AAEEC,IAAAA,GAAG,EAAE,SAFP;AAGEC,IAAAA,IAAI,EAAE,QAHR;AAIEC,IAAAA,MAAM,EAAE,OAJV;AAKEC,IAAAA,IAAI,EAAE,MALR;AAMEC,IAAAA,GAAG,EAAE,MANP;AAOEC,IAAAA,MAAM,EAAE,OAPV;AAQEC,IAAAA,OAAO,EAAE,IARX;AASEC,IAAAA,IAAI,EAAE,GATR;AAUEC,IAAAA,OAAO,EAAE,QAVX;AAWEC,IAAAA,IAAI,EAAE,SAXR;AAYEC,IAAAA,OAAO,EAAE,QAZX;AAaEC,IAAAA,EAAE,EAAE,OAbN;AAcEC,IAAAA,OAAO,EAAE,MAdX;AAeEC,IAAAA,EAAE,EAAE,QAfN;AAgBEC,IAAAA,EAAE,EAAE,oBAhBN;AAiBEC,IAAAA,IAAI,EAAE;AAjBR;AAJe,C","sourcesContent":["export default {\n buildTime: '2022-01-28T10:16:20Z',\n commit: 'ad1ef0272c97b0830f9cb8d74ab8d42af173bcc1',\n npmInfo:\n{\n 'solid-panes': '3.5.15',\n npm: '6.14.13',\n ares: '1.17.1',\n brotli: '1.0.9',\n cldr: '39.0',\n icu: '69.1',\n llhttp: '2.1.3',\n modules: '83',\n napi: '8',\n nghttp2: '1.42.0',\n node: '14.17.3',\n openssl: '1.1.1k',\n tz: '2021a',\n unicode: '13.0',\n uv: '1.41.0',\n v8: '8.4.371.23-node.67',\n zlib: '1.2.11'\n}\n}\n"],"file":"versionInfo.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-panes",
3
- "version": "3.5.14",
3
+ "version": "3.5.15",
4
4
  "description": "Solid-compatible Panes: applets and views for the mashlib and databrowser",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -45,27 +45,27 @@
45
45
  "homepage": "https://github.com/solid/solid-panes",
46
46
  "dependencies": {
47
47
  "@babel/polyfill": "^7.12.1",
48
- "@inrupt/solid-client-authn-browser": "^1.11.3",
49
48
  "@solid/better-simple-slideshow": "^0.1.0",
50
- "activitystreams-pane": "^0.6.2",
49
+ "activitystreams-pane": "^0.6.3",
51
50
  "babel-preset-env": "^1.7.0",
52
51
  "babel-preset-metalab": "^1.0.0",
53
- "chat-pane": "^2.4.13",
54
- "contacts-pane": "^2.5.6",
55
- "folder-pane": "^2.4.10",
56
- "issue-pane": "^2.4.8",
52
+ "chat-pane": "^2.4.14",
53
+ "contacts-pane": "^2.6.0",
54
+ "folder-pane": "^2.4.12",
55
+ "issue-pane": "^2.4.9",
57
56
  "marked": "^4.0.8",
58
- "meeting-pane": "^2.3.7",
57
+ "meeting-pane": "^2.3.8",
59
58
  "mime-types": "^2.1.34",
60
- "pane-registry": "^2.4.5",
59
+ "pane-registry": "^2.4.6",
61
60
  "path-browserify": "^1.0.1",
62
- "profile-pane": "^1.0.4",
63
- "rdflib": "^2.2.15",
61
+ "profile-pane": "^1.0.7",
62
+ "rdflib": "^2.2.17",
64
63
  "react": "^17.0.2",
65
64
  "react-dom": "^17.0.2",
65
+ "solid-logic": "^1.3.13",
66
66
  "solid-namespace": "^0.5.2",
67
- "solid-ui": "^2.4.14",
68
- "source-pane": "^2.2.13"
67
+ "solid-ui": "^2.4.15",
68
+ "source-pane": "^2.2.14"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@babel/cli": "^7.16.0",
package/src/index.ts CHANGED
@@ -14,6 +14,7 @@
14
14
  // var UI = require('solid-ui') // Note we will add the panes register to this.
15
15
  import versionInfo from './versionInfo'
16
16
  import * as UI from 'solid-ui'
17
+ import { LiveStore } from 'rdflib'
17
18
  import OutlineManager from './outline/manager.js'
18
19
  import registerPanes from './registerPanes.js'
19
20
  import {
@@ -21,10 +22,10 @@ import {
21
22
  paneForIcon,
22
23
  paneForPredicate,
23
24
  register,
24
- byName,
25
- LiveStore
25
+ byName
26
26
  } from 'pane-registry'
27
27
  import { createContext } from './outline/context'
28
+ import initMainPage from './mainPage'
28
29
 
29
30
  export function getOutliner (dom) {
30
31
  if (!dom.outlineManager) {
@@ -61,4 +62,4 @@ export {
61
62
  // where there are many occurrences of window and of window.document
62
63
  // But each DOM should have just one outline manager.
63
64
 
64
- export { OutlineManager, UI, versionInfo }
65
+ export { OutlineManager, UI, versionInfo, initMainPage }
@@ -0,0 +1,19 @@
1
+ import { IndexedFormula } from 'rdflib'
2
+ import { initFooter } from 'solid-ui'
3
+
4
+ /**
5
+ * links in the footer
6
+ */
7
+ const SOLID_PROJECT_URL = 'https://solidproject.org'
8
+ const SOLID_PROJECT_NAME = 'solidproject.org'
9
+
10
+ export function createFooter (store: IndexedFormula) {
11
+ initFooter(store, setFooterOptions())
12
+ }
13
+
14
+ function setFooterOptions () {
15
+ return {
16
+ solidProjectUrl: SOLID_PROJECT_URL,
17
+ solidProjectName: SOLID_PROJECT_NAME
18
+ }
19
+ }
@@ -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 = await createHeader(store, outliner)
18
+ const footer = createFooter(store)
19
+ return Promise.all([header, footer])
20
+ }
@@ -1,6 +1,7 @@
1
- import { DataBrowserContext, LiveStore, PaneRegistry } from 'pane-registry'
1
+ import { DataBrowserContext, PaneRegistry } from 'pane-registry'
2
2
  import { getOutliner } from '../index'
3
3
  import { SolidLogic } from 'solid-logic'
4
+ import { LiveStore } from 'rdflib'
4
5
 
5
6
  export function createContext (
6
7
  dom: HTMLDocument,
@@ -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 [
@@ -1,9 +1,9 @@
1
1
  export default {
2
- buildTime: '2021-12-31T16:09:18Z',
3
- commit: '0bd1160e1f47fd31e285531801373b170b63a663',
2
+ buildTime: '2022-01-28T10:16:20Z',
3
+ commit: 'ad1ef0272c97b0830f9cb8d74ab8d42af173bcc1',
4
4
  npmInfo:
5
5
  {
6
- 'solid-panes': '3.5.13',
6
+ 'solid-panes': '3.5.15',
7
7
  npm: '6.14.13',
8
8
  ares: '1.17.1',
9
9
  brotli: '1.0.9',