solid-panes 4.2.2 → 4.2.3-583c15bd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/RDFXMLPane.js +1 -2
  2. package/dist/argument/argumentPane.js +1 -2
  3. package/dist/attach/attachPane.js +1 -2
  4. package/dist/audio/audioPane.js +1 -2
  5. package/dist/classInstancePane.js +1 -2
  6. package/dist/dataContentPane.js +12 -10
  7. package/dist/defaultPane.js +1 -2
  8. package/dist/dokieli/dokieliPane.js +1 -2
  9. package/dist/dokieli/new.js +1 -2
  10. package/dist/form/pane.js +1 -2
  11. package/dist/humanReadablePane.js +12 -10
  12. package/dist/imagePane.js +1 -2
  13. package/dist/internal/internalPane.d.ts +1 -0
  14. package/dist/internal/internalPane.d.ts.map +1 -1
  15. package/dist/microblogPane/mbStyle.css +267 -0
  16. package/dist/microblogPane/microblogPane.js +1 -2
  17. package/dist/n3Pane.js +1 -2
  18. package/dist/outline/manager.css +80 -0
  19. package/dist/outline/manager.js +14 -11
  20. package/dist/outline/outlineIcons.js +1 -2
  21. package/dist/outline/queryByExample.js +1 -2
  22. package/dist/outline/userInput.js +1 -2
  23. package/dist/pad/padPane.d.ts +1 -0
  24. package/dist/pad/padPane.d.ts.map +1 -1
  25. package/dist/playlist/playlistPane.js +1 -2
  26. package/dist/registerPanes.js +1 -2
  27. package/dist/schedule/schedulePane.js +27 -3
  28. package/dist/slideshow/slideshowPane.js +1 -2
  29. package/dist/socialPane.js +1 -2
  30. package/dist/solid-panes.js +49702 -0
  31. package/dist/solid-panes.js.map +1 -0
  32. package/dist/solid-panes.min.js +290 -0
  33. package/dist/solid-panes.min.js.map +1 -0
  34. package/dist/styles/dataContentPane.css +23 -0
  35. package/dist/styles/humanReadablePane.css +8 -0
  36. package/dist/styles/internalPane.css +12 -0
  37. package/dist/styles/padPane.css +13 -0
  38. package/dist/styles/tabbedtab.css +1347 -0
  39. package/dist/tableViewPane.js +1 -2
  40. package/dist/transaction/pane.js +1 -2
  41. package/dist/transaction/period.js +1 -2
  42. package/dist/trip/tripPane.js +1 -2
  43. package/dist/ui/pane.js +1 -2
  44. package/dist/video/videoPane.js +1 -2
  45. package/package.json +13 -12
  46. package/dist/RDFXMLPane.js.map +0 -1
  47. package/dist/argument/argumentPane.js.map +0 -1
  48. package/dist/attach/attachPane.js.map +0 -1
  49. package/dist/audio/audioPane.js.map +0 -1
  50. package/dist/classInstancePane.js.map +0 -1
  51. package/dist/dashboard/basicPreferences.js +0 -147
  52. package/dist/dashboard/basicPreferences.js.map +0 -1
  53. package/dist/dashboard/dashboardPane.js +0 -68
  54. package/dist/dashboard/dashboardPane.js.map +0 -1
  55. package/dist/dashboard/homepage.js +0 -73
  56. package/dist/dashboard/homepage.js.map +0 -1
  57. package/dist/dataContentPane.js.map +0 -1
  58. package/dist/defaultPane.js.map +0 -1
  59. package/dist/dokieli/dokieliPane.js.map +0 -1
  60. package/dist/dokieli/new.js.map +0 -1
  61. package/dist/form/pane.js.map +0 -1
  62. package/dist/home/homePane.js +0 -73
  63. package/dist/home/homePane.js.map +0 -1
  64. package/dist/humanReadablePane.js.map +0 -1
  65. package/dist/imagePane.js.map +0 -1
  66. package/dist/index.js +0 -109
  67. package/dist/index.js.map +0 -1
  68. package/dist/internal/internalPane.js +0 -184
  69. package/dist/internal/internalPane.js.map +0 -1
  70. package/dist/mainPage/footer.js +0 -22
  71. package/dist/mainPage/footer.js.map +0 -1
  72. package/dist/mainPage/header.js +0 -86
  73. package/dist/mainPage/header.js.map +0 -1
  74. package/dist/mainPage/index.js +0 -25
  75. package/dist/mainPage/index.js.map +0 -1
  76. package/dist/microblogPane/microblogPane.js.map +0 -1
  77. package/dist/n3Pane.js.map +0 -1
  78. package/dist/outline/context.js +0 -19
  79. package/dist/outline/context.js.map +0 -1
  80. package/dist/outline/manager.js.map +0 -1
  81. package/dist/outline/outlineIcons.js.map +0 -1
  82. package/dist/outline/propertyViews.js +0 -44
  83. package/dist/outline/propertyViews.js.map +0 -1
  84. package/dist/outline/queryByExample.js.map +0 -1
  85. package/dist/outline/userInput.js.map +0 -1
  86. package/dist/outline/viewAsImage.js +0 -15
  87. package/dist/outline/viewAsImage.js.map +0 -1
  88. package/dist/outline/viewAsMbox.js +0 -22
  89. package/dist/outline/viewAsMbox.js.map +0 -1
  90. package/dist/pad/padPane.js +0 -411
  91. package/dist/pad/padPane.js.map +0 -1
  92. package/dist/playlist/playlistPane.js.map +0 -1
  93. package/dist/registerPanes.js.map +0 -1
  94. package/dist/schedule/schedulePane.js.map +0 -1
  95. package/dist/sharing/sharingPane.js +0 -49
  96. package/dist/sharing/sharingPane.js.map +0 -1
  97. package/dist/slideshow/slideshowPane.js.map +0 -1
  98. package/dist/socialPane.js.map +0 -1
  99. package/dist/tabbed/tabbedPane.js +0 -58
  100. package/dist/tabbed/tabbedPane.js.map +0 -1
  101. package/dist/tableViewPane.js.map +0 -1
  102. package/dist/transaction/pane.js.map +0 -1
  103. package/dist/transaction/period.js.map +0 -1
  104. package/dist/trip/tripPane.js.map +0 -1
  105. package/dist/trustedApplications/trustedApplications.dom.js +0 -146
  106. package/dist/trustedApplications/trustedApplications.dom.js.map +0 -1
  107. package/dist/trustedApplications/trustedApplications.utils.js +0 -24
  108. package/dist/trustedApplications/trustedApplications.utils.js.map +0 -1
  109. package/dist/trustedApplications/trustedApplications.view.js +0 -56
  110. package/dist/trustedApplications/trustedApplications.view.js.map +0 -1
  111. package/dist/ui/pane.js.map +0 -1
  112. package/dist/versionInfo.js +0 -36
  113. package/dist/versionInfo.js.map +0 -1
  114. package/dist/video/videoPane.js.map +0 -1
@@ -1,184 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _solidUi = require("solid-ui");
8
- var _rdflib = require("rdflib");
9
- /* Internal Pane
10
- **
11
- ** This outline pane contains the properties which are
12
- ** internal to the user's interaction with the web, and are not normally displayed
13
- */
14
- /* global alert confirm */
15
-
16
- const pane = {
17
- icon: _solidUi.icons.originalIconBase + 'tango/22-emblem-system.png',
18
- name: 'internal',
19
- label: function () {
20
- return 'under the hood'; // There is often a URI even of no statements
21
- },
22
- render: function (subject, context) {
23
- const dom = context.dom;
24
- const store = context.session.store;
25
- const canonizedSubject = store.canon(subject);
26
- const types = store.findTypeURIs(canonizedSubject);
27
- function filter(pred) {
28
- if (types['http://www.w3.org/2007/ont/link#ProtocolEvent']) return true; // display everything for them
29
- const view = context.session.paneRegistry.byName('internal');
30
- return view && view.predicates && !!(typeof view.predicates[pred.uri] !== 'undefined');
31
- }
32
- const div = dom.createElement('div');
33
- div.setAttribute('class', 'internalPane');
34
- div.setAttribute('style', 'background-color: #ddddff; padding: 0.5em; border-radius: 1em;');
35
- function deleteRecursive(kb, folder) {
36
- const fetcher = kb.fetcher;
37
- if (!fetcher) {
38
- console.error('No fetcher available');
39
- return;
40
- }
41
- return new Promise(function (resolve, reject) {
42
- fetcher.load(folder).then(function () {
43
- const promises = kb.each(folder, _solidUi.ns.ldp('contains')).map(file => {
44
- if (kb.holds(file, _solidUi.ns.rdf('type'), _solidUi.ns.ldp('BasicContainer'))) {
45
- return deleteRecursive(kb, file);
46
- } else {
47
- console.log('deleteRecursive leaf file: ' + file);
48
- return fetcher.webOperation('DELETE', file.uri);
49
- }
50
- });
51
- Promise.all(promises).then(() => {
52
- console.log('deleteRecursive empty folder: ' + folder);
53
- fetcher.webOperation('DELETE', folder.uri).then(() => {
54
- console.log('Deleted Ok: ' + folder);
55
- resolve(undefined);
56
- }).catch(err => {
57
- const str = 'Unable to delete ' + folder + ': ' + err;
58
- console.log(str);
59
- reject(new Error(str));
60
- });
61
- resolve(undefined);
62
- }, err => {
63
- alert(err);
64
- reject(err);
65
- });
66
- });
67
- });
68
- }
69
- const isDocument = subject.uri && !subject.uri.includes('#');
70
- if (isDocument) {
71
- const controls = div.appendChild(dom.createElement('table'));
72
- controls.style.width = '100%';
73
- controls.style.margin = '1em';
74
- const controlRow = controls.appendChild(dom.createElement('tr'));
75
- const deleteCell = controlRow.appendChild(dom.createElement('td'));
76
- const isFolder = subject.uri && subject.uri.endsWith('/') || store.holds(subject, _solidUi.ns.rdf('type'), _solidUi.ns.ldp('Container'));
77
- const noun = isFolder ? 'folder' : 'file';
78
- if (!isProtectedUri(subject)) {
79
- console.log(subject);
80
- const deleteButton = _solidUi.widgets.deleteButtonWithCheck(dom, deleteCell, noun, function () {
81
- if (!confirm(`Are you sure you want to delete ${subject}? This cannot be undone.`)) {
82
- return;
83
- }
84
- // @@ TODO Remove casing of store.fetcher
85
- if (!store.fetcher) {
86
- throw new Error('Store has no fetcher');
87
- }
88
- const promise = isFolder ? deleteRecursive(store, subject) || Promise.resolve() : store.fetcher.webOperation('DELETE', subject.uri) || Promise.resolve();
89
- promise.then(() => {
90
- const str = 'Deleted: ' + subject;
91
- console.log(str);
92
- }).catch(err => {
93
- const str = 'Unable to delete ' + subject + ': ' + err;
94
- console.log(str);
95
- alert(str);
96
- });
97
- });
98
- deleteButton.style = 'height: 2em;';
99
- deleteButton.class = ''; // Remove hover hide
100
- deleteCell.appendChild(deleteButton);
101
- }
102
- const refreshCell = controlRow.appendChild(dom.createElement('td'));
103
- const refreshButton = _solidUi.widgets.button(dom, _solidUi.icons.iconBase + 'noun_479395.svg', 'refresh');
104
- refreshCell.appendChild(refreshButton);
105
- refreshButton.addEventListener('click', () => {
106
- if (!store.fetcher) {
107
- throw new Error('Store has no fetcher');
108
- }
109
- store.fetcher.refresh(subject, function (ok, errm) {
110
- let str;
111
- if (ok) {
112
- str = 'Refreshed OK: ' + subject;
113
- } else {
114
- str = 'Error refreshing: ' + subject + ': ' + errm;
115
- }
116
- console.log(str);
117
- alert(str);
118
- });
119
- });
120
- }
121
- let plist = store.statementsMatching(subject);
122
- let docURI = '';
123
- if (!store.fetcher) {
124
- throw new Error('Store has no fetcher');
125
- }
126
- if (subject.uri) {
127
- plist.push((0, _rdflib.st)(subject, (0, _rdflib.sym)('http://www.w3.org/2007/ont/link#uri'), subject.uri,
128
- // @@ TODO Remove casting
129
- store.fetcher.appNode));
130
- if (subject.uri.indexOf('#') >= 0) {
131
- docURI = subject.uri.split('#')[0];
132
- plist.push((0, _rdflib.st)(subject, (0, _rdflib.sym)('http://www.w3.org/2007/ont/link#documentURI'), subject.uri.split('#')[0],
133
- // @@ TODO Remove casting
134
- store.fetcher.appNode));
135
- plist.push((0, _rdflib.st)(subject, (0, _rdflib.sym)('http://www.w3.org/2007/ont/link#document'), (0, _rdflib.sym)(subject.uri.split('#')[0]), store.fetcher.appNode));
136
- } else {
137
- docURI = subject.uri;
138
- }
139
- }
140
- if (docURI) {
141
- if (!store.updater) {
142
- throw new Error('Store has no updater');
143
- }
144
- const ed = store.updater.editable(docURI);
145
- if (ed) {
146
- plist.push((0, _rdflib.st)(subject, (0, _rdflib.sym)('http://www.w3.org/ns/rww#editable'), (0, _rdflib.literal)(ed.toString()), store.fetcher.appNode));
147
- }
148
- }
149
- // @@ TODO get a proper type
150
- const outliner = context.getOutliner(dom);
151
- outliner.appendPropertyTRs(div, plist, false, filter);
152
- plist = store.statementsMatching(undefined, undefined, subject);
153
- outliner.appendPropertyTRs(div, plist, true, filter);
154
- return div;
155
- },
156
- predicates: {
157
- // Predicates used for inner workings. Under the hood
158
- 'http://www.w3.org/2007/ont/link#request': 1,
159
- 'http://www.w3.org/2007/ont/link#requestedBy': 1,
160
- 'http://www.w3.org/2007/ont/link#source': 1,
161
- 'http://www.w3.org/2007/ont/link#session': 2,
162
- // 2= test neg but display
163
- 'http://www.w3.org/2007/ont/link#uri': 1,
164
- 'http://www.w3.org/2007/ont/link#documentURI': 1,
165
- 'http://www.w3.org/2007/ont/link#document': 1,
166
- 'http://www.w3.org/2007/ont/link#all': 1,
167
- // From userinput.js
168
- 'http://www.w3.org/2007/ont/link#Document': 1,
169
- 'http://www.w3.org/ns/rww#editable': 1,
170
- 'http://www.w3.org/2000/01/rdf-schema#seeAlso': 1,
171
- 'http://www.w3.org/2002/07/owl#': 1
172
- },
173
- classes: {
174
- // Things which are inherently already undercover
175
- 'http://www.w3.org/2007/ont/link#ProtocolEvent': 1
176
- }
177
- };
178
- function isProtectedUri(subject) {
179
- // TODO: Could make the code below smarter by removing some of the redundancy by creating a recursive function, but did not bother now
180
- const siteUri = subject.site().uri;
181
- return subject.uri === siteUri || subject.uri === siteUri + 'profile/' || subject.uri === siteUri + 'profile/card' || subject.uri === siteUri + 'settings/' || subject.uri === siteUri + 'settings/prefs.ttl' || subject.uri === siteUri + 'settings/privateTypeIndex.ttl' || subject.uri === siteUri + 'settings/publicTypeIndex.ttl' || subject.uri === siteUri + 'settings/serverSide.ttl';
182
- }
183
- var _default = exports.default = pane; // ends
184
- //# sourceMappingURL=internalPane.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internalPane.js","names":["_solidUi","require","_rdflib","pane","icon","icons","originalIconBase","name","label","render","subject","context","dom","store","session","canonizedSubject","canon","types","findTypeURIs","filter","pred","view","paneRegistry","byName","predicates","uri","div","createElement","setAttribute","deleteRecursive","kb","folder","fetcher","console","error","Promise","resolve","reject","load","then","promises","each","ns","ldp","map","file","holds","rdf","log","webOperation","all","undefined","catch","err","str","Error","alert","isDocument","includes","controls","appendChild","style","width","margin","controlRow","deleteCell","isFolder","endsWith","noun","isProtectedUri","deleteButton","widgets","deleteButtonWithCheck","confirm","promise","class","refreshCell","refreshButton","button","iconBase","addEventListener","refresh","ok","errm","plist","statementsMatching","docURI","push","st","sym","appNode","indexOf","split","updater","ed","editable","literal","toString","outliner","getOutliner","appendPropertyTRs","classes","siteUri","site","_default","exports","default"],"sources":["../../src/internal/internalPane.ts"],"sourcesContent":["/* Internal Pane\n **\n ** This outline pane contains the properties which are\n ** internal to the user's interaction with the web, and are not normally displayed\n */\n/* global alert confirm */\n\nimport { icons, ns, widgets } from 'solid-ui'\nimport { BlankNode, IndexedFormula, literal, NamedNode, st, sym, Variable, Store } from 'rdflib'\nimport { PaneDefinition } from 'pane-registry'\n\nconst pane: PaneDefinition = {\n icon: icons.originalIconBase + 'tango/22-emblem-system.png',\n\n name: 'internal',\n\n label: function () {\n return 'under the hood' // There is often a URI even of no statements\n },\n\n render: function (subject, context) {\n const dom = context.dom\n const store = context.session.store as Store\n const canonizedSubject = store.canon(subject) as BlankNode | NamedNode | Variable\n const types = store.findTypeURIs(canonizedSubject)\n\n function filter (pred: NamedNode) {\n if (types['http://www.w3.org/2007/ont/link#ProtocolEvent']) return true // display everything for them\n const view = context.session.paneRegistry.byName('internal')\n return (\n view &&\n view.predicates &&\n !!(typeof view.predicates[pred.uri] !== 'undefined')\n )\n }\n\n const div = dom.createElement('div')\n div.setAttribute('class', 'internalPane')\n div.setAttribute(\n 'style',\n 'background-color: #ddddff; padding: 0.5em; border-radius: 1em;'\n )\n\n function deleteRecursive (kb: IndexedFormula, folder: NamedNode) {\n const fetcher = (kb as any).fetcher\n if (!fetcher) {\n console.error('No fetcher available')\n return\n }\n return new Promise(function (resolve, reject) {\n fetcher.load(folder).then(function () {\n const promises = kb.each(folder, ns.ldp('contains')).map(file => {\n if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {\n return deleteRecursive(kb, file as NamedNode)\n } else {\n console.log('deleteRecursive leaf file: ' + file)\n return fetcher.webOperation('DELETE', (file as NamedNode).uri)\n }\n })\n Promise.all(promises).then(\n () => {\n console.log('deleteRecursive empty folder: ' + folder)\n fetcher\n .webOperation('DELETE', folder.uri)\n .then(() => {\n console.log('Deleted Ok: ' + folder)\n resolve(undefined)\n })\n .catch((err: string) => {\n const str = 'Unable to delete ' + folder + ': ' + err\n console.log(str)\n reject(new Error(str))\n })\n resolve(undefined)\n },\n err => {\n alert(err)\n reject(err)\n }\n )\n })\n })\n }\n\n const isDocument = subject.uri && !subject.uri.includes('#')\n if (isDocument) {\n const controls = div.appendChild(dom.createElement('table'))\n controls.style.width = '100%'\n controls.style.margin = '1em'\n const controlRow = controls.appendChild(dom.createElement('tr'))\n\n const deleteCell = controlRow.appendChild(dom.createElement('td'))\n const isFolder =\n (subject.uri && subject.uri.endsWith('/')) ||\n store.holds(subject, ns.rdf('type'), ns.ldp('Container'))\n const noun = isFolder ? 'folder' : 'file'\n if (!isProtectedUri(subject)) {\n console.log(subject)\n const deleteButton = widgets.deleteButtonWithCheck(\n dom,\n deleteCell,\n noun,\n function () {\n if (\n !confirm(\n `Are you sure you want to delete ${subject}? This cannot be undone.`\n )\n ) {\n return\n }\n // @@ TODO Remove casing of store.fetcher\n if (!store.fetcher) {\n throw new Error('Store has no fetcher')\n }\n const promise = isFolder\n ? (deleteRecursive(store, subject) || Promise.resolve())\n : store.fetcher.webOperation('DELETE', subject.uri) || Promise.resolve()\n promise\n .then(() => {\n const str = 'Deleted: ' + subject\n console.log(str)\n })\n .catch((err: any) => {\n const str = 'Unable to delete ' + subject + ': ' + err\n console.log(str)\n alert(str)\n })\n }\n )\n deleteButton.style = 'height: 2em;'\n deleteButton.class = '' // Remove hover hide\n deleteCell.appendChild(deleteButton)\n }\n\n const refreshCell = controlRow.appendChild(dom.createElement('td'))\n const refreshButton = widgets.button(\n dom,\n icons.iconBase + 'noun_479395.svg',\n 'refresh'\n )\n refreshCell.appendChild(refreshButton)\n refreshButton.addEventListener('click', () => {\n if (!store.fetcher) {\n throw new Error('Store has no fetcher')\n }\n store.fetcher.refresh(subject, function (\n ok,\n errm\n ) {\n let str\n if (ok) {\n str = 'Refreshed OK: ' + subject\n } else {\n str = 'Error refreshing: ' + subject + ': ' + errm\n }\n console.log(str)\n alert(str)\n })\n })\n }\n\n let plist = store.statementsMatching(subject)\n let docURI = ''\n if (!store.fetcher) {\n throw new Error('Store has no fetcher')\n }\n\n if (subject.uri) {\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/2007/ont/link#uri'),\n subject.uri as any, // @@ TODO Remove casting\n store.fetcher.appNode\n )\n )\n if (subject.uri.indexOf('#') >= 0) {\n docURI = subject.uri.split('#')[0]\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/2007/ont/link#documentURI'),\n subject.uri.split('#')[0] as any, // @@ TODO Remove casting\n store.fetcher.appNode\n )\n )\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/2007/ont/link#document'),\n sym(subject.uri.split('#')[0]),\n store.fetcher.appNode\n )\n )\n } else {\n docURI = subject.uri\n }\n }\n if (docURI) {\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n\n const ed = store.updater.editable(docURI)\n if (ed) {\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/ns/rww#editable'),\n literal(ed.toString()),\n store.fetcher.appNode\n )\n )\n }\n }\n // @@ TODO get a proper type\n const outliner: any = context.getOutliner(dom)\n outliner.appendPropertyTRs(div, plist, false, filter)\n plist = store.statementsMatching(undefined, undefined, subject)\n outliner.appendPropertyTRs(div, plist, true, filter)\n return div\n },\n\n predicates: {\n // Predicates used for inner workings. Under the hood\n 'http://www.w3.org/2007/ont/link#request': 1,\n 'http://www.w3.org/2007/ont/link#requestedBy': 1,\n 'http://www.w3.org/2007/ont/link#source': 1,\n 'http://www.w3.org/2007/ont/link#session': 2, // 2= test neg but display\n 'http://www.w3.org/2007/ont/link#uri': 1,\n 'http://www.w3.org/2007/ont/link#documentURI': 1,\n 'http://www.w3.org/2007/ont/link#document': 1,\n 'http://www.w3.org/2007/ont/link#all': 1, // From userinput.js\n 'http://www.w3.org/2007/ont/link#Document': 1,\n 'http://www.w3.org/ns/rww#editable': 1,\n 'http://www.w3.org/2000/01/rdf-schema#seeAlso': 1,\n 'http://www.w3.org/2002/07/owl#': 1\n },\n\n classes: {\n // Things which are inherently already undercover\n 'http://www.w3.org/2007/ont/link#ProtocolEvent': 1\n }\n}\n\nfunction isProtectedUri (subject: NamedNode): boolean {\n // TODO: Could make the code below smarter by removing some of the redundancy by creating a recursive function, but did not bother now\n const siteUri = subject.site().uri\n return (\n subject.uri === siteUri ||\n subject.uri === siteUri + 'profile/' ||\n subject.uri === siteUri + 'profile/card' ||\n subject.uri === siteUri + 'settings/' ||\n subject.uri === siteUri + 'settings/prefs.ttl' ||\n subject.uri === siteUri + 'settings/privateTypeIndex.ttl' ||\n subject.uri === siteUri + 'settings/publicTypeIndex.ttl' ||\n subject.uri === siteUri + 'settings/serverSide.ttl'\n )\n}\n\nexport default pane\n\n// ends\n"],"mappings":";;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;;AAMA,MAAME,IAAoB,GAAG;EAC3BC,IAAI,EAAEC,cAAK,CAACC,gBAAgB,GAAG,4BAA4B;EAE3DC,IAAI,EAAE,UAAU;EAEhBC,KAAK,EAAE,SAAAA,CAAA,EAAY;IACjB,OAAO,gBAAgB,EAAC;EAC1B,CAAC;EAEDC,MAAM,EAAE,SAAAA,CAAUC,OAAO,EAAEC,OAAO,EAAE;IAClC,MAAMC,GAAG,GAAGD,OAAO,CAACC,GAAG;IACvB,MAAMC,KAAK,GAAGF,OAAO,CAACG,OAAO,CAACD,KAAc;IAC5C,MAAME,gBAAgB,GAAGF,KAAK,CAACG,KAAK,CAACN,OAAO,CAAqC;IACjF,MAAMO,KAAK,GAAGJ,KAAK,CAACK,YAAY,CAACH,gBAAgB,CAAC;IAElD,SAASI,MAAMA,CAAEC,IAAe,EAAE;MAChC,IAAIH,KAAK,CAAC,+CAA+C,CAAC,EAAE,OAAO,IAAI,EAAC;MACxE,MAAMI,IAAI,GAAGV,OAAO,CAACG,OAAO,CAACQ,YAAY,CAACC,MAAM,CAAC,UAAU,CAAC;MAC5D,OACEF,IAAI,IACJA,IAAI,CAACG,UAAU,IACf,CAAC,EAAE,OAAOH,IAAI,CAACG,UAAU,CAACJ,IAAI,CAACK,GAAG,CAAC,KAAK,WAAW,CAAC;IAExD;IAEA,MAAMC,GAAG,GAAGd,GAAG,CAACe,aAAa,CAAC,KAAK,CAAC;IACpCD,GAAG,CAACE,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC;IACzCF,GAAG,CAACE,Y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ict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFooter = createFooter;
7
- var _solidUi = require("solid-ui");
8
- /**
9
- * links in the footer
10
- */
11
- const SOLID_PROJECT_URL = 'https://solidproject.org';
12
- const SOLID_PROJECT_NAME = 'solidproject.org';
13
- function createFooter(store) {
14
- (0, _solidUi.initFooter)(store, setFooterOptions());
15
- }
16
- function setFooterOptions() {
17
- return {
18
- solidProjectUrl: SOLID_PROJECT_URL,
19
- solidProjectName: SOLID_PROJECT_NAME
20
- };
21
- }
22
- //# sourceMappingURL=footer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"footer.js","names":["_solidUi","require","SOLID_PROJECT_URL","SOLID_PROJECT_NAME","createFooter","store","initFooter","setFooterOptions","solidProjectUrl","solidProjectName"],"sources":["../../src/mainPage/footer.ts"],"sourcesContent":["import { LiveStore } from 'rdflib'\nimport { initFooter } from 'solid-ui'\n\n/**\n * links in the footer\n*/\nconst SOLID_PROJECT_URL = 'https://solidproject.org'\nconst SOLID_PROJECT_NAME = 'solidproject.org'\n\nexport function createFooter (store: LiveStore) {\n initFooter(store, setFooterOptions())\n}\n\nfunction setFooterOptions () {\n return {\n solidProjectUrl: SOLID_PROJECT_URL,\n solidProjectName: SOLID_PROJECT_NAME\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,0BAA0B;AACpD,MAAMC,kBAAkB,GAAG,kBAAkB;AAEtC,SAASC,YAAYA,CAAEC,KAAgB,EAAE;EAC9C,IAAAC,mBAAU,EAACD,KAAK,EAAEE,gBAAgB,CAAC,CAAC,CAAC;AACvC;AAEA,SAASA,gBAAgBA,CAAA,EAAI;EAC3B,OAAO;IACLC,eAAe,EAAEN,iBAAiB;IAClCO,gBAAgB,EAAEN;EACpB,CAAC;AACH","ignoreList":[]}
@@ -1,86 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createHeader = createHeader;
7
- var _solidLogic = require("solid-logic");
8
- var _solidUi = require("solid-ui");
9
- /**
10
- * menu icons
11
- */
12
- const HELP_MENU_ICON = _solidUi.icons.iconBase + 'noun_help.svg';
13
- const SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg';
14
-
15
- /**
16
- * menu elements
17
- */
18
- const USER_GUIDE_MENU_ITEM = 'User guide';
19
- const REPORT_A_PROBLEM_MENU_ITEM = 'Report a problem';
20
- const SHOW_YOUR_PROFILE_MENU_ITEM = 'Show your profile';
21
- const LOG_OUT_MENU_ITEM = 'Log out';
22
- /**
23
- * URLS
24
- */
25
- const USER_GUIDE_MENU_URL = 'https://solidos.github.io/userguide/';
26
- const REPORT_A_PROBLEM_MENU_URL = 'https://github.com/solidos/solidos/issues';
27
- async function createHeader(store, outliner) {
28
- (0, _solidUi.initHeader)(store, await setUserMenu(outliner), setHeaderOptions());
29
- }
30
- function setHeaderOptions() {
31
- const helpMenuList = [{
32
- label: USER_GUIDE_MENU_ITEM,
33
- url: USER_GUIDE_MENU_URL,
34
- target: '_blank'
35
- }, {
36
- label: REPORT_A_PROBLEM_MENU_ITEM,
37
- url: REPORT_A_PROBLEM_MENU_URL,
38
- target: '_blank'
39
- }];
40
- const headerOptions = {
41
- logo: SOLID_ICON_URL,
42
- helpIcon: HELP_MENU_ICON,
43
- helpMenuList
44
- };
45
- return headerOptions;
46
- }
47
- async function setUserMenu(outliner) {
48
- // @ts-ignore: showProfile is used conditionally
49
- const showProfile = {
50
- label: SHOW_YOUR_PROFILE_MENU_ITEM,
51
- onclick: () => openUserProfile(outliner)
52
- };
53
- const logOut = {
54
- label: LOG_OUT_MENU_ITEM,
55
- onclick: () => {
56
- _solidLogic.authSession.logout();
57
- }
58
- };
59
-
60
- // the order of the menu is important here, show profile first and logout last
61
- let userMenuList = []; // was [showProfile]
62
- userMenuList = userMenuList.concat(await getMenuItems(outliner));
63
- userMenuList.push(logOut);
64
- return userMenuList;
65
- }
66
-
67
- // Does not work to jump to user profile,
68
- function openUserProfile(outliner) {
69
- outliner.GotoSubject(_solidLogic.authn.currentUser(), true, undefined, true, undefined);
70
- location.reload();
71
- }
72
- async function getMenuItems(outliner) {
73
- const items = await outliner.getDashboardItems();
74
- return items.map(element => {
75
- return {
76
- label: element.label,
77
- onclick: () => openDashboardPane(outliner, element.tabName || element.paneName)
78
- };
79
- });
80
- }
81
- async function openDashboardPane(outliner, pane) {
82
- outliner.showDashboard({
83
- pane
84
- });
85
- }
86
- //# sourceMappingURL=header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.js","names":["_solidLogic","require","_solidUi","HELP_MENU_ICON","icons","iconBase","SOLID_ICON_URL","USER_GUIDE_MENU_ITEM","REPORT_A_PROBLEM_MENU_ITEM","SHOW_YOUR_PROFILE_MENU_ITEM","LOG_OUT_MENU_ITEM","USER_GUIDE_MENU_URL","REPORT_A_PROBLEM_MENU_URL","createHeader","store","outliner","initHeader","setUserMenu","setHeaderOptions","helpMenuList","label","url","target","headerOptions","logo","helpIcon","showProfile","onclick","openUserProfile","logOut","authSession","logout","userMenuList","concat","getMenuItems","push","GotoSubject","authn","currentUser","undefined","location","reload","items","getDashboardItems","map","element","openDashboardPane","tabName","paneName","pane","showDashboard"],"sources":["../../src/mainPage/header.ts"],"sourcesContent":["import { authSession, authn } from 'solid-logic'\nimport { icons, initHeader } from 'solid-ui'\n/**\n * menu icons\n*/\nconst HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\n/**\n * menu elements\n*/\nconst USER_GUIDE_MENU_ITEM = 'User guide'\nconst REPORT_A_PROBLEM_MENU_ITEM = 'Report a problem'\nconst SHOW_YOUR_PROFILE_MENU_ITEM = 'Show your profile'\nconst LOG_OUT_MENU_ITEM = 'Log out'\n\ntype UserMenuItem = { label: string; onclick: () => void }\n/**\n * URLS\n */\nconst USER_GUIDE_MENU_URL = 'https://solidos.github.io/userguide/'\nconst REPORT_A_PROBLEM_MENU_URL = 'https://github.com/solidos/solidos/issues'\n\nexport async function createHeader (store, outliner) {\n initHeader(store, await setUserMenu(outliner), setHeaderOptions())\n}\n\nfunction setHeaderOptions () {\n const helpMenuList = [\n { label: USER_GUIDE_MENU_ITEM, url: USER_GUIDE_MENU_URL, target: '_blank' },\n { label: REPORT_A_PROBLEM_MENU_ITEM, url: REPORT_A_PROBLEM_MENU_URL, target: '_blank' }\n ]\n const headerOptions = { logo: SOLID_ICON_URL, helpIcon: HELP_MENU_ICON, helpMenuList }\n\n return headerOptions\n}\n\nasync function setUserMenu (outliner: any) {\n // @ts-ignore: showProfile is used conditionally\n const showProfile = {\n label: SHOW_YOUR_PROFILE_MENU_ITEM,\n onclick: () => openUserProfile(outliner)\n }\n\n const logOut: UserMenuItem = {\n label: LOG_OUT_MENU_ITEM,\n onclick: () => {\n authSession.logout()\n }\n }\n\n // the order of the menu is important here, show profile first and logout last\n let userMenuList:UserMenuItem[] = [] // was [showProfile]\n userMenuList = userMenuList.concat(await getMenuItems(outliner))\n userMenuList.push(logOut)\n\n return userMenuList\n}\n\n// Does not work to jump to user profile,\nfunction openUserProfile (outliner: any) {\n outliner.GotoSubject(authn.currentUser(), true, undefined, true, undefined)\n location.reload()\n}\n\nasync function getMenuItems (outliner: any) {\n const items = await outliner.getDashboardItems()\n return items.map((element) => {\n return {\n label: element.label,\n onclick: () => openDashboardPane(outliner, element.tabName || element.paneName)\n }\n })\n}\n\nasync function openDashboardPane (outliner: any, pane: string): Promise<void> {\n outliner.showDashboard({\n pane\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA;AACA;AACA;AACA,MAAME,cAAc,GAAGC,cAAK,CAACC,QAAQ,GAAG,eAAe;AACvD,MAAMC,cAAc,GAAG,sDAAsD;;AAE7E;AACA;AACA;AACA,MAAMC,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,MAAM,CAAC;EAEzB,OAAOG,YAAY;AACrB;;AAEA;AACA,SAASJ,eAAeA,CAAEb,QAAa,EAAE;EACvCA,QAAQ,CAACqB,WAAW,CAACC,iBAAK,CAACC,WAAW,CAAC,CAAC,EAAE,IAAI,EAAEC,SAAS,EAAE,IAAI,EAAEA,SAAS,CAAC;EAC3EC,QAAQ,CAACC,MAAM,CAAC,CAAC;AACnB;AAEA,eAAeP,YAAYA,CAAEnB,QAAa,EAAE;EAC1C,MAAM2B,KAAK,GAAG,MAAM3B,QAAQ,CAAC4B,iBAAiB,CAAC,CAAC;EAChD,OAAOD,KAAK,CAACE,GAAG,CAAEC,OAAO,IAAK;IAC5B,OAAO;MACLzB,KAAK,EAAEyB,OAAO,CAACzB,KAAK;MACpBO,OAAO,EAAEA,CAAA,KAAMmB,iBAAiB,CAAC/B,QAAQ,EAAE8B,OAAO,CAACE,OAAO,IAAIF,OAAO,CAACG,QAAQ;IAChF,CAAC;EACH,CAAC,CAAC;AACJ;AAEA,eAAeF,iBAAiBA,CAAE/B,QAAa,EAAEkC,IAAY,EAAiB;EAC5ElC,QAAQ,CAACmC,aAAa,CAAC;IACrBD;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = initMainPage;
7
- var _index = require("../index");
8
- var _header = require("./header");
9
- var _footer = require("./footer");
10
- /* Main Page
11
- **
12
- ** This code is called in mashlib and renders the header and footer of the Databrowser.
13
- */
14
-
15
- async function initMainPage(store, uri) {
16
- const outliner = (0, _index.getOutliner)(document);
17
- uri = uri || window.location.href;
18
- let subject = uri;
19
- if (typeof uri === 'string') subject = store.sym(uri);
20
- outliner.GotoSubject(subject, true, undefined, true, undefined);
21
- const header = await (0, _header.createHeader)(store, outliner);
22
- const footer = (0, _footer.createFooter)(store);
23
- return Promise.all([header, footer]);
24
- }
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_index","require","_header","_footer","initMainPage","store","uri","outliner","getOutliner","document","window","location","href","subject","sym","GotoSubject","undefined","header","createHeader","footer","createFooter","Promise","all"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and footer of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { getOutliner } from '../index'\nimport { createHeader } from './header'\nimport { createFooter } from './footer'\n\nexport default async function initMainPage (store: LiveStore, uri?: string | NamedNode | null) {\n const outliner = getOutliner(document)\n uri = uri || window.location.href\n let subject = uri\n if (typeof uri === 'string') subject = store.sym(uri)\n outliner.GotoSubject(subject, true, undefined, true, undefined)\n const header = await createHeader(store, outliner)\n const footer = createFooter(store)\n return Promise.all([header, footer])\n}\n"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AARA;AACA;AACA;AACA;;AAOe,eAAeG,YAAYA,CAAEC,KAAgB,EAAEC,GAA+B,EAAE;EAC7F,MAAMC,QAAQ,GAAG,IAAAC,kBAAW,EAACC,QAAQ,CAAC;EACtCH,GAAG,GAAGA,GAAG,IAAII,MAAM,CAACC,QAAQ,CAACC,IAAI;EACjC,IAAIC,OAAO,GAAGP,GAAG;EACjB,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAEO,OAAO,GAAGR,KAAK,CAACS,GAAG,CAACR,GAAG,CAAC;EACrDC,QAAQ,CAACQ,WAAW,CAACF,OAAO,EAAE,IAAI,EAAEG,SAAS,EAAE,IAAI,EAAEA,SAAS,CAAC;EAC/D,MAAMC,MAAM,GAAG,MAAM,IAAAC,oBAAY,EAACb,KAAK,EAAEE,QAAQ,CAAC;EAClD,MAAMY,MAAM,GAAG,IAAAC,oBAAY,EAACf,KAAK,CAAC;EAClC,OAAOgB,OAAO,CAACC,GAAG,CAAC,CAACL,MAAM,EAAEE,MAAM,CAAC,CAAC;AACtC","ignoreList":[]}