solid-panes 3.7.3-f251a0e3 → 3.7.3-newStyle-363115da

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 (68) hide show
  1. package/dist/RDFXMLPane.js +2 -1
  2. package/dist/RDFXMLPane.js.map +1 -1
  3. package/dist/dashboard/basicPreferences.js +121 -129
  4. package/dist/dashboard/basicPreferences.js.map +1 -1
  5. package/dist/dashboard/dashboardPane.js +60 -54
  6. package/dist/dashboard/dashboardPane.js.map +1 -1
  7. package/dist/dashboard/homepage.js +45 -54
  8. package/dist/dashboard/homepage.js.map +1 -1
  9. package/dist/dataContentPane.js +3 -2
  10. package/dist/dataContentPane.js.map +1 -1
  11. package/dist/defaultPane.js +1 -1
  12. package/dist/defaultPane.js.map +1 -1
  13. package/dist/home/homePane.d.ts.map +1 -1
  14. package/dist/home/homePane.js +60 -55
  15. package/dist/home/homePane.js.map +1 -1
  16. package/dist/index.js +86 -25
  17. package/dist/index.js.map +1 -1
  18. package/dist/internal/internalPane.js +168 -179
  19. package/dist/internal/internalPane.js.map +1 -1
  20. package/dist/mainPage/footer.js +13 -7
  21. package/dist/mainPage/footer.js.map +1 -1
  22. package/dist/mainPage/header.js +60 -58
  23. package/dist/mainPage/header.js.map +1 -1
  24. package/dist/mainPage/index.js +19 -24
  25. package/dist/mainPage/index.js.map +1 -1
  26. package/dist/microblogPane/microblogPane.js +18 -17
  27. package/dist/microblogPane/microblogPane.js.map +1 -1
  28. package/dist/n3Pane.js +2 -1
  29. package/dist/n3Pane.js.map +1 -1
  30. package/dist/outline/context.js +17 -11
  31. package/dist/outline/context.js.map +1 -1
  32. package/dist/outline/manager.js +11 -11
  33. package/dist/outline/manager.js.map +1 -1
  34. package/dist/outline/propertyViews.js +39 -28
  35. package/dist/outline/propertyViews.js.map +1 -1
  36. package/dist/outline/queryByExample.js +4 -3
  37. package/dist/outline/queryByExample.js.map +1 -1
  38. package/dist/outline/userInput.js +13 -13
  39. package/dist/outline/userInput.js.map +1 -1
  40. package/dist/outline/viewAsImage.js +13 -5
  41. package/dist/outline/viewAsImage.js.map +1 -1
  42. package/dist/outline/viewAsMbox.js +20 -11
  43. package/dist/outline/viewAsMbox.js.map +1 -1
  44. package/dist/pad/padPane.js +395 -404
  45. package/dist/pad/padPane.js.map +1 -1
  46. package/dist/schedule/schedulePane.js +4 -5
  47. package/dist/schedule/schedulePane.js.map +1 -1
  48. package/dist/sharing/sharingPane.js +36 -32
  49. package/dist/sharing/sharingPane.js.map +1 -1
  50. package/dist/socialPane.js +2 -1
  51. package/dist/socialPane.js.map +1 -1
  52. package/dist/tabbed/tabbedPane.js +54 -51
  53. package/dist/tabbed/tabbedPane.js.map +1 -1
  54. package/dist/trustedApplications/trustedApplications.dom.js +134 -146
  55. package/dist/trustedApplications/trustedApplications.dom.js.map +1 -1
  56. package/dist/trustedApplications/trustedApplications.utils.js +20 -20
  57. package/dist/trustedApplications/trustedApplications.utils.js.map +1 -1
  58. package/dist/trustedApplications/trustedApplications.view.js +51 -57
  59. package/dist/trustedApplications/trustedApplications.view.js.map +1 -1
  60. package/dist/versionInfo.js +35 -29
  61. package/dist/versionInfo.js.map +1 -1
  62. package/package.json +31 -36
  63. package/dist/schedule/formsForSchedule.js +0 -124
  64. package/dist/schedule/formsForSchedule.js.map +0 -1
  65. package/dist/types.d.ts +0 -30
  66. package/dist/types.d.ts.map +0 -1
  67. package/dist/types.js +0 -2
  68. package/dist/types.js.map +0 -1
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.RDFXMLPane = void 0;
7
7
  var UI = _interopRequireWildcard(require("solid-ui"));
8
+ var $rdf = _interopRequireWildcard(require("rdflib"));
8
9
  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); }
9
10
  /* RDF/XML content Pane
10
11
  **
@@ -43,7 +44,7 @@ const RDFXMLPane = exports.RDFXMLPane = {
43
44
  kludge.add(s.subject, s.predicate, s.object)
44
45
  }
45
46
  */
46
- const sz = UI.rdf.Serializer(kb);
47
+ const sz = $rdf.Serializer(kb);
47
48
  sz.suggestNamespaces(kb.namespaces);
48
49
  sz.setBase(subject.uri);
49
50
  const str = sz.statementsToXML(sts);
@@ -1 +1 @@
1
- {"version":3,"file":"RDFXMLPane.js","names":["UI","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","RDFXMLPane","exports","icon","icons","originalIconBase","name","audience","solid","label","subject","context","store","session","findTypeURIs","statementsMatching","undefined","length","render","myDocument","dom","kb","div","createElement","setAttribute","sts","sz","rdf","Serializer","suggestNamespaces","namespaces","setBase","uri","str","statementsToXML","pre","appendChild","createTextNode"],"sources":["../src/RDFXMLPane.js"],"sourcesContent":["/* RDF/XML content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\n\nimport * as UI from 'solid-ui'\nconst ns = UI.ns\n\nexport const RDFXMLPane = {\n icon: UI.icons.originalIconBase + '22-text-xml4.png',\n\n name: 'RDFXML',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject, context) {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'As RDF/XML (' + n + ')'\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const kb = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'RDFXMLPane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const sts = kb.statementsMatching(undefined, undefined, undefined, subject) // @@ slow with current store!\n /*\n var kludge = kb.formula([]) // No features\n for (var i=0; i< sts.length; i++) {\n s = sts[i]\n kludge.add(s.subject, s.predicate, s.object)\n }\n */\n const sz = UI.rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const str = sz.statementsToXML(sts)\n const pre = myDocument.createElement('PRE')\n pre.appendChild(myDocument.createTextNode(str))\n div.appendChild(pre)\n return div\n }\n}\n\n// ends\n"],"mappings":";;;;;;AAOA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MA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IAC3CD,GAAG,CAACE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC;IACvC;IACA;IACA;IACA,MAAMC,GAAG,GAAGJ,EAAE,CAACN,kBAAkB,CAACC,SAAS,EAAEA,SAAS,EAAEA,SAAS,EAAEN,OAAO,CAAC,EAAC;IAC5E;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,MAAMgB,EAAE,GAAGhD,EAAE,CAACiD,GAAG,CAACC,UAAU,CAACP,EAAE,CAAC;IAChCK,EAAE,CAACG,iBAAiB,CAACR,EAAE,CAACS,UAAU,CAAC;IACnCJ,EAAE,CAACK,OAAO,CAACrB,OAAO,CAACsB,GAAG,CAAC;IACvB,MAAMC,GAAG,GAAGP,EAAE,CAACQ,eAAe,CAACT,GAAG,CAAC;IACnC,MAAMU,GAAG,GAAGhB,UAAU,CAACI,aAAa,CAAC,KAAK,CAAC;IAC3CY,GAAG,CAACC,WAAW,CAACjB,UAAU,CAACkB,cAAc,CAACJ,GAAG,CAAC,CAAC;IAC/CX,GAAG,CAACc,WAAW,CAACD,GAAG,CAAC;IACpB,OAAOb,GAAG;EACZ;AACF,CAAC;;AAED","ignoreList":[]}
1
+ {"version":3,"file":"RDFXMLPane.js","names":["UI","_interopRequireWildcard","require","$rdf","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","RDFXMLPane","exports","icon","icons","originalIconBase","name","audience","solid","label","subject","context","store","session","findTypeURIs","statementsMatching","undefined","length","render","myDocument","dom","kb","div","createElement","setAttribute","sts","sz","Serializer","suggestNamespaces","namespaces","setBase","uri","str","statementsToXML","pre","appendChild","createTextNode"],"sources":["../src/RDFXMLPane.js"],"sourcesContent":["/* RDF/XML content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\n\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\n\nconst ns = UI.ns\n\nexport const RDFXMLPane = {\n icon: UI.icons.originalIconBase + '22-text-xml4.png',\n\n name: 'RDFXML',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject, context) {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'As RDF/XML (' + n + ')'\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const kb = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'RDFXMLPane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const sts = kb.statementsMatching(undefined, undefined, undefined, subject) // @@ slow with current store!\n /*\n var kludge = kb.formula([]) // No features\n for (var i=0; i< sts.length; i++) {\n s = sts[i]\n kludge.add(s.subject, s.predicate, s.object)\n }\n */\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const str = sz.statementsToXML(sts)\n const pre = myDocument.createElement('PRE')\n pre.appendChild(myDocument.createTextNode(str))\n div.appendChild(pre)\n return div\n }\n}\n\n// ends\n"],"mappings":";;;;;;AAOA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,uBAAA,CAAAC,OAAA;AAA8B,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CA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IhC,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI;IACxB,OAAO,cAAc,GAAGA,CAAC,GAAG,GAAG;EACjC,CAAC;EAEDiC,MAAM,EAAE,SAAAA,CAAUR,OAAO,EAAEC,OAAO,EAAE;IAClC,MAAMQ,UAAU,GAAGR,OAAO,CAACS,GAAG;IAC9B,MAAMC,EAAE,GAAGV,OAAO,CAACE,OAAO,CAACD,KAAK;IAChC,MAAMU,GAAG,GAAGH,UAAU,CAACI,aAAa,CAAC,KAAK,CAAC;IAC3CD,GAAG,CAACE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC;IACvC;IACA;IACA;IACA,MAAMC,GAAG,GAAGJ,EAAE,CAACN,kBAAkB,CAACC,SAAS,EAAEA,SAAS,EAAEA,SAAS,EAAEN,OAAO,CAAC,EAAC;IAC5E;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,MAAMgB,EAAE,GAAG9C,IAAI,CAAC+C,UAAU,CAACN,EAAE,CAAC;IAC9BK,EAAE,CAACE,iBAAiB,CAACP,EAAE,CAACQ,UAAU,CAAC;IACnCH,EAAE,CAACI,OAAO,CAACpB,OAAO,CAACqB,GAAG,CAAC;IACvB,MAAMC,GAAG,GAAGN,EAAE,CAACO,eAAe,CAACR,GAAG,CAAC;IACnC,MAAMS,GAAG,GAAGf,UAAU,CAACI,aAAa,CAAC,KAAK,CAAC;IAC3CW,GAAG,CAACC,WAAW,CAAChB,UAAU,CAACiB,cAAc,CAACJ,GAAG,CAAC,CAAC;IAC/CV,GAAG,CAACa,WAAW,CAACD,GAAG,CAAC;IACpB,OAAOZ,GAAG;EACZ;AACF,CAAC;;AAED","ignoreList":[]}
@@ -1,109 +1,103 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { parse } from 'rdflib';
11
- import { icons, login, ns, widgets } from 'solid-ui';
12
- import ontologyData from './ontologyData.ttl';
13
- import preferencesFormText from './preferencesFormText.ttl';
14
- export const basicPreferencesPane = {
15
- icon: icons.iconBase + 'noun_Sliders_341315_000000.svg',
16
- name: 'basicPreferences',
17
- label: _subject => {
18
- return null;
19
- },
20
- // Render the pane
21
- // The subject should be the logged in user.
22
- render: (subject, context) => {
23
- const dom = context.dom;
24
- const store = context.session.store;
25
- function complainIfBad(ok, mess) {
26
- if (ok)
27
- return;
28
- container.appendChild(widgets.errorMessageBlock(dom, mess, '#fee'));
29
- }
30
- const container = dom.createElement('div');
31
- const formArea = setupUserTypesSection(container, dom);
32
- function loadData(doc, turtle) {
33
- doc = doc.doc(); // remove # from URI if nec
34
- if (!store.holds(undefined, undefined, undefined, doc)) {
35
- // If not loaded already
36
- ;
37
- parse(turtle, store, doc.uri, 'text/turtle', null); // Load form directly
38
- }
39
- }
40
- const preferencesForm = store.sym('urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597#this');
41
- loadData(preferencesForm, preferencesFormText);
42
- const ontologyExtra = store.sym('urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597-ONT');
43
- loadData(ontologyExtra, ontologyData);
44
- function doRender() {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const renderContext = yield login.ensureLoadedPreferences({
47
- dom,
48
- div: container
49
- });
50
- if (!renderContext.preferencesFile) {
51
- // Could be CORS
52
- console.log('Not doing private class preferences as no access to preferences file. ' +
53
- renderContext.preferencesFileError);
54
- return;
55
- }
56
- const appendedForm = widgets.appendForm(dom, formArea, {}, renderContext.me, preferencesForm, renderContext.preferencesFile, complainIfBad);
57
- appendedForm.style.borderStyle = 'none';
58
- const trustedApplicationsView = context.session.paneRegistry.byName('trustedApplications');
59
- if (trustedApplicationsView) {
60
- container.appendChild(trustedApplicationsView.render(null, context));
61
- }
62
- // @@ TODO Remove need for casting as any and bang (!) syntax
63
- addDeleteSection(container, store, renderContext.me, dom);
64
- });
65
- }
66
- doRender();
67
- return container;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.basicPreferencesPane = void 0;
7
+ var _rdflib = require("rdflib");
8
+ var _solidUi = require("solid-ui");
9
+ /* babel-plugin-inline-import './ontologyData.ttl' */
10
+ const ontologyData = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix schema: <http:/schema.org/>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n@prefix : <#>.\n\nsolid:User a rdfs:Class;\n rdfs:label \"user\"@en, \"utilisateur\"@fr;\n rdfs:comment \"\"\"Any person who might use a Solid-based system\"\"\";\n rdfs:subClassOf foaf:Person, schema:Person, vcard:Individual.\n\n# Since these options are opt-in, it is a bit strange to have new users opt in\n# That they are new users - also we do not use this class for anything specific\n# yet\n# solid:NewUser a rdfs:Class;\n# rdfs:label \"new user\"@en;\n# rdfs:comment \"\"\"A person who might use a Solid-based system who has a low\n# level of familiarity with technical details.\"\"\";\n# rdfs:subClassOf solid:User.\n\nsolid:PowerUser a rdfs:Class;\n rdfs:label \"power user\"@en;\n rdfs:comment \"\"\"A person who might use a Solid-based system\n who is prepared to be given a more complex interface in order\n to be provided with more pwerful features.\"\"\";\n rdfs:subClassOf solid:User.\n\n solid:Developer a rdfs:Class;\n rdfs:label \"Developer\";\n rdfs:comment \"\"\"Any person who might use a Solid-based system,\n who has software development skills.\"\"\";\n rdfs:subClassOf solid:User.\n";
11
+ /* babel-plugin-inline-import './preferencesFormText.ttl' */
12
+ const preferencesFormText = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix : <#>.\n\n:this <http://purl.org/dc/elements/1.1/title> \"Basic preferences\" ;\n a ui:Form ;\n ui:part :categorizeUser, :privateComment, :personalInformationHeading;\n ui:parts ( :personalInformationHeading :privateComment :categorizeUser ).\n\n:personalInformationHeading a ui:Heading;\n ui:contents \"Personal information\".\n\n:privateComment a ui:Comment;\n ui:contents \"This information is private.\".\n\n:categorizeUser a ui:Classifier;\n ui:label \"Level of user\"; ui:property rdf:type ; ui:category solid:User.\n";
13
+ const basicPreferencesPane = exports.basicPreferencesPane = {
14
+ icon: _solidUi.icons.iconBase + 'noun_Sliders_341315_000000.svg',
15
+ name: 'basicPreferences',
16
+ label: _subject => {
17
+ return null;
18
+ },
19
+ // Render the pane
20
+ // The subject should be the logged in user.
21
+ render: (subject, context) => {
22
+ const dom = context.dom;
23
+ const store = context.session.store;
24
+ function complainIfBad(ok, mess) {
25
+ if (ok) return;
26
+ container.appendChild(_solidUi.widgets.errorMessageBlock(dom, mess, '#fee'));
27
+ }
28
+ const container = dom.createElement('div');
29
+ const formArea = setupUserTypesSection(container, dom);
30
+ function loadData(doc, turtle) {
31
+ doc = doc.doc(); // remove # from URI if nec
32
+ if (!store.holds(undefined, undefined, undefined, doc)) {
33
+ // If not loaded already
34
+ ;
35
+ (0, _rdflib.parse)(turtle, store, doc.uri, 'text/turtle', null); // Load form directly
36
+ }
68
37
  }
38
+ const preferencesForm = store.sym('urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597#this');
39
+ loadData(preferencesForm, preferencesFormText);
40
+ const ontologyExtra = store.sym('urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597-ONT');
41
+ loadData(ontologyExtra, ontologyData);
42
+ async function doRender() {
43
+ const renderContext = await _solidUi.login.ensureLoadedPreferences({
44
+ dom,
45
+ div: container
46
+ });
47
+ if (!renderContext.preferencesFile) {
48
+ // Could be CORS
49
+ console.log('Not doing private class preferences as no access to preferences file. ' + renderContext.preferencesFileError);
50
+ return;
51
+ }
52
+ const appendedForm = _solidUi.widgets.appendForm(dom, formArea, {}, renderContext.me, preferencesForm, renderContext.preferencesFile, complainIfBad);
53
+ appendedForm.style.borderStyle = 'none';
54
+ const trustedApplicationsView = context.session.paneRegistry.byName('trustedApplications');
55
+ if (trustedApplicationsView) {
56
+ container.appendChild(trustedApplicationsView.render(null, context));
57
+ }
58
+
59
+ // @@ TODO Remove need for casting as any and bang (!) syntax
60
+ addDeleteSection(container, store, renderContext.me, dom);
61
+ }
62
+ doRender();
63
+ return container;
64
+ }
69
65
  };
70
66
  function setupUserTypesSection(container, dom) {
71
- const formContainer = createSection(container, dom, 'User types');
72
- const description = formContainer.appendChild(dom.createElement('p'));
73
- description.innerText = 'Here you can self-assign user types to help the data browser know which views you would like to access.';
74
- const userTypesLink = formContainer.appendChild(dom.createElement('a'));
75
- userTypesLink.href = 'https://github.com/solidos/userguide/#role';
76
- userTypesLink.innerText = 'Read more';
77
- const formArea = formContainer.appendChild(dom.createElement('div'));
78
- return formArea;
67
+ const formContainer = createSection(container, dom, 'User types');
68
+ const description = formContainer.appendChild(dom.createElement('p'));
69
+ description.innerText = 'Here you can self-assign user types to help the data browser know which views you would like to access.';
70
+ const userTypesLink = formContainer.appendChild(dom.createElement('a'));
71
+ userTypesLink.href = 'https://github.com/solidos/userguide/#role';
72
+ userTypesLink.innerText = 'Read more';
73
+ const formArea = formContainer.appendChild(dom.createElement('div'));
74
+ return formArea;
79
75
  }
80
- export default basicPreferencesPane;
81
- // ends
76
+ var _default = exports.default = basicPreferencesPane; // ends
82
77
  function addDeleteSection(container, store, profile, dom) {
83
- const section = createSection(container, dom, 'Delete account');
84
- const podServerNodes = store.each(profile, ns.space('storage'), null, profile.doc());
85
- const podServers = podServerNodes.map(node => node.value);
86
- const list = section.appendChild(dom.createElement('ul'));
87
- podServers.forEach((server) => __awaiter(this, void 0, void 0, function* () {
88
- const deletionLink = yield generateDeletionLink(server, dom);
89
- if (deletionLink) {
90
- const listItem = list.appendChild(dom.createElement('li'));
91
- listItem.appendChild(deletionLink);
92
- }
93
- }));
78
+ const section = createSection(container, dom, 'Delete account');
79
+ const podServerNodes = store.each(profile, _solidUi.ns.space('storage'), null, profile.doc());
80
+ const podServers = podServerNodes.map(node => node.value);
81
+ const list = section.appendChild(dom.createElement('ul'));
82
+ podServers.forEach(async server => {
83
+ const deletionLink = await generateDeletionLink(server, dom);
84
+ if (deletionLink) {
85
+ const listItem = list.appendChild(dom.createElement('li'));
86
+ listItem.appendChild(deletionLink);
87
+ }
88
+ });
94
89
  }
95
- function generateDeletionLink(podServer, dom) {
96
- return __awaiter(this, void 0, void 0, function* () {
97
- const link = dom.createElement('a');
98
- link.textContent = `Delete your account at ${podServer}`;
99
- const deletionUrl = yield getDeletionUrlForServer(podServer);
100
- if (typeof deletionUrl !== 'string') {
101
- return null;
102
- }
103
- link.href = deletionUrl;
104
- return link;
105
- });
90
+ async function generateDeletionLink(podServer, dom) {
91
+ const link = dom.createElement('a');
92
+ link.textContent = `Delete your account at ${podServer}`;
93
+ const deletionUrl = await getDeletionUrlForServer(podServer);
94
+ if (typeof deletionUrl !== 'string') {
95
+ return null;
96
+ }
97
+ link.href = deletionUrl;
98
+ return link;
106
99
  }
100
+
107
101
  /**
108
102
  * Hacky way to get the deletion link to a Pod
109
103
  *
@@ -119,37 +113,35 @@ function generateDeletionLink(podServer, dom) {
119
113
  * @returns URL of the page that Node Solid Server would offer to delete the account, or null if
120
114
  * the URLs we tried give invalid responses.
121
115
  */
122
- function getDeletionUrlForServer(server) {
123
- return __awaiter(this, void 0, void 0, function* () {
124
- const singleUserUrl = new URL(server);
125
- const multiUserUrl = new URL(server);
126
- multiUserUrl.pathname = singleUserUrl.pathname = '/account/delete';
127
- const hostnameParts = multiUserUrl.hostname.split('.');
128
- // Remove `vincent.` from `vincent.dev.inrupt.net`, for example:
129
- multiUserUrl.hostname = hostnameParts.slice(1).join('.');
130
- const multiUserNssResponse = yield fetch(multiUserUrl.href, {
131
- method: 'HEAD'
132
- });
133
- if (multiUserNssResponse.ok) {
134
- return multiUserUrl.href;
135
- }
136
- const singleUserNssResponse = yield fetch(singleUserUrl.href, {
137
- method: 'HEAD'
138
- });
139
- if (singleUserNssResponse.ok) {
140
- return singleUserUrl.href;
141
- }
142
- return null;
143
- });
116
+ async function getDeletionUrlForServer(server) {
117
+ const singleUserUrl = new URL(server);
118
+ const multiUserUrl = new URL(server);
119
+ multiUserUrl.pathname = singleUserUrl.pathname = '/account/delete';
120
+ const hostnameParts = multiUserUrl.hostname.split('.');
121
+ // Remove `vincent.` from `vincent.dev.inrupt.net`, for example:
122
+ multiUserUrl.hostname = hostnameParts.slice(1).join('.');
123
+ const multiUserNssResponse = await fetch(multiUserUrl.href, {
124
+ method: 'HEAD'
125
+ });
126
+ if (multiUserNssResponse.ok) {
127
+ return multiUserUrl.href;
128
+ }
129
+ const singleUserNssResponse = await fetch(singleUserUrl.href, {
130
+ method: 'HEAD'
131
+ });
132
+ if (singleUserNssResponse.ok) {
133
+ return singleUserUrl.href;
134
+ }
135
+ return null;
144
136
  }
145
137
  function createSection(container, dom, title) {
146
- const section = container.appendChild(dom.createElement('div'));
147
- section.style.border = '0.3em solid #418d99';
148
- section.style.borderRadius = '0.5em';
149
- section.style.padding = '0.7em';
150
- section.style.marginTop = '0.7em';
151
- const titleElement = section.appendChild(dom.createElement('h3'));
152
- titleElement.innerText = title;
153
- return section;
138
+ const section = container.appendChild(dom.createElement('div'));
139
+ section.style.border = '0.3em solid #418d99';
140
+ section.style.borderRadius = '0.5em';
141
+ section.style.padding = '0.7em';
142
+ section.style.marginTop = '0.7em';
143
+ const titleElement = section.appendChild(dom.createElement('h3'));
144
+ titleElement.innerText = title;
145
+ return section;
154
146
  }
155
147
  //# sourceMappingURL=basicPreferences.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"basicPreferences.js","sourceRoot":"","sources":["../../src/dashboard/basicPreferences.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAA6B,KAAK,EAAS,MAAM,QAAQ,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAmB;IAClD,IAAI,EAAE,KAAK,CAAC,QAAQ,GAAG,gCAAgC;IACvD,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,QAAQ,CAAC,EAAE;QAChB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,kBAAkB;IAClB,4CAA4C;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACvB,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,KAAc,CAAA;QAE5C,SAAS,aAAa,CAAE,EAAW,EAAE,IAAS;YAC5C,IAAI,EAAE;gBAAE,OAAM;YACd,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;QACrE,CAAC;QAED,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAE1C,MAAM,QAAQ,GAAG,qBAAqB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;QAEtD,SAAS,QAAQ,CAAE,GAAc,EAAE,MAAc;YAC/C,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,CAAA,CAAC,2BAA2B;YAC3C,IAAI,CAAC,KAAK,CAAC,KAAK,CAA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AAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAExD,MAAM,oBAAoB,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE;YAC1D,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;QACF,IAAI,oBAAoB,CAAC,EAAE,EAAE,CAAC;YAC5B,OAAO,YAAY,CAAC,IAAI,CAAA;QAC1B,CAAC;QAED,MAAM,qBAAqB,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;YAC5D,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;QACF,IAAI,qBAAqB,CAAC,EAAE,EAAE,CAAC;YAC7B,OAAO,aAAa,CAAC,IAAI,CAAA;QAC3B,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAED,SAAS,aAAa,CACpB,SAAkB,EAClB,GAAiB,EACjB,KAAa;IAEb,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;IAC/D,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAA;IAC5C,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,OAAO,CAAA;IACpC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;IAC/B,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,CAAA;IAEjC,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;IACjE,YAAY,CAAC,SAAS,GAAG,KAAK,CAAA;IAE9B,OAAO,OAAO,CAAA;AAChB,CAAC"}
1
+ {"version":3,"file":"basicPreferences.js","names":["_rdflib","require","_solidUi","ontologyData","preferencesFormText","basicPreferencesPane","exports","icon","icons","iconBase","name","label","_subject","render","subject","context","dom","store","session","complainIfBad","ok","mess","container","appendChild","widgets","errorMessageBlock","createElement","formArea","setupUserTypesSection","loadData","doc","turtle","holds","undefined","parse","uri","preferencesForm","sym","ontologyExtra","doRender","renderContext","login","ensureLoadedPreferences","div","preferencesFile","console","log","preferencesFileError","appendedForm","appendForm","me","style","borderStyle","trustedApplicationsView","paneRegistry","byName","addDeleteSection","formContainer","createSection","description","innerText","userTypesLink","href","_default","default","profile","section","podServerNodes","each","ns","space","podServers","map","node","value","list","forEach","server","deletionLink","generateDeletionLink","listItem","podServer","link","textContent","deletionUrl","getDeletionUrlForServer","singleUserUrl","URL","multiUserUrl","pathname","hostnameParts","hostname","split","slice","join","multiUserNssResponse","fetch","method","singleUserNssResponse","title","border","borderRadius","padding","marginTop","titleElement"],"sources":["../../src/dashboard/basicPreferences.ts"],"sourcesContent":["import { PaneDefinition } from 'pane-registry'\nimport { IndexedFormula, NamedNode, parse, Store } from 'rdflib'\nimport { icons, login, ns, widgets } from 'solid-ui'\nimport ontologyData from './ontologyData.ttl'\nimport preferencesFormText from './preferencesFormText.ttl'\n\nexport const basicPreferencesPane: PaneDefinition = {\n icon: icons.iconBase + 'noun_Sliders_341315_000000.svg',\n name: 'basicPreferences',\n label: _subject => {\n return null\n },\n\n // Render the pane\n // The subject should be the logged in user.\n render: (subject, context) => {\n const dom = context.dom\n const store = context.session.store as Store\n\n function complainIfBad (ok: Boolean, mess: any) {\n if (ok) return\n container.appendChild(widgets.errorMessageBlock(dom, mess, '#fee'))\n }\n\n const container = dom.createElement('div')\n\n const formArea = setupUserTypesSection(container, dom)\n\n function loadData (doc: NamedNode, turtle: String) {\n doc = doc.doc() // remove # from URI if nec\n if (!store.holds(undefined, undefined, undefined, doc)) {\n // If not loaded already\n ;(parse as any)(turtle, store, doc.uri, 'text/turtle', null) // Load form directly\n }\n }\n\n const preferencesForm = store.sym(\n 'urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597#this'\n )\n loadData(preferencesForm, preferencesFormText)\n\n const ontologyExtra = store.sym(\n 'urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597-ONT'\n )\n loadData(ontologyExtra, ontologyData)\n\n async function doRender () {\n const renderContext = await login.ensureLoadedPreferences({\n dom,\n div: container\n })\n if (!renderContext.preferencesFile) {\n // Could be CORS\n console.log(\n 'Not doing private class preferences as no access to preferences file. ' +\n renderContext.preferencesFileError\n )\n return\n }\n const appendedForm = widgets.appendForm(\n dom,\n formArea,\n {},\n renderContext.me,\n preferencesForm,\n renderContext.preferencesFile,\n complainIfBad\n )\n appendedForm.style.borderStyle = 'none'\n\n const trustedApplicationsView = context.session.paneRegistry.byName('trustedApplications')\n if (trustedApplicationsView) {\n container.appendChild(trustedApplicationsView.render(null, context))\n }\n\n // @@ TODO Remove need for casting as any and bang (!) syntax\n addDeleteSection(container, store, renderContext.me!, dom)\n }\n\n doRender()\n\n return container\n }\n}\n\nfunction setupUserTypesSection (\n container: Element,\n dom: HTMLDocument\n): Element {\n const formContainer = createSection(container, dom, 'User types')\n\n const description = formContainer.appendChild(dom.createElement('p'))\n description.innerText = 'Here you can self-assign user types to help the data browser know which views you would like to access.'\n\n const userTypesLink = formContainer.appendChild(dom.createElement('a'))\n userTypesLink.href = 'https://github.com/solidos/userguide/#role'\n userTypesLink.innerText = 'Read more'\n\n const formArea = formContainer.appendChild(dom.createElement('div'))\n\n return formArea\n}\n\nexport default basicPreferencesPane\n\n// ends\n\nfunction addDeleteSection (\n container: HTMLElement,\n store: IndexedFormula,\n profile: NamedNode,\n dom: HTMLDocument\n): void {\n const section = createSection(container, dom, 'Delete account')\n\n const podServerNodes = store.each(profile, ns.space('storage'), null, profile.doc())\n const podServers = podServerNodes.map(node => node.value)\n\n const list = section.appendChild(dom.createElement('ul'))\n\n podServers.forEach(async server => {\n const deletionLink = await generateDeletionLink(server, dom)\n if (deletionLink) {\n const listItem = list.appendChild(dom.createElement('li'))\n listItem.appendChild(deletionLink)\n }\n })\n}\n\nasync function generateDeletionLink (\n podServer: string,\n dom: HTMLDocument\n): Promise<HTMLElement | null> {\n const link = dom.createElement('a')\n link.textContent = `Delete your account at ${podServer}`\n const deletionUrl = await getDeletionUrlForServer(podServer)\n if (typeof deletionUrl !== 'string') {\n return null\n }\n link.href = deletionUrl\n return link\n}\n\n/**\n * Hacky way to get the deletion link to a Pod\n *\n * This function infers the deletion link by assuming the URL structure of Node Solid server.\n * In the future, Solid will hopefully provide a standardised way of discovering the deletion link:\n * https://github.com/solidos/data-interoperability-panel/issues/18\n *\n * If NSS is in multi-user mode (the case on inrupt.net and solid.community), the deletion URL for\n * vincent.dev.inrupt.net would be at dev.inrupt.net/account/delete. In single-user mode, the\n * deletion URL would be at vincent.dev.inrupt.net/account/delete.\n *\n * @param server Pod server containing the user's account.\n * @returns URL of the page that Node Solid Server would offer to delete the account, or null if\n * the URLs we tried give invalid responses.\n */\nasync function getDeletionUrlForServer (\n server: string\n): Promise<string | null> {\n const singleUserUrl = new URL(server)\n const multiUserUrl = new URL(server)\n multiUserUrl.pathname = singleUserUrl.pathname = '/account/delete'\n\n const hostnameParts = multiUserUrl.hostname.split('.')\n // Remove `vincent.` from `vincent.dev.inrupt.net`, for example:\n multiUserUrl.hostname = hostnameParts.slice(1).join('.')\n\n const multiUserNssResponse = await fetch(multiUserUrl.href, {\n method: 'HEAD'\n })\n if (multiUserNssResponse.ok) {\n return multiUserUrl.href\n }\n\n const singleUserNssResponse = await fetch(singleUserUrl.href, {\n method: 'HEAD'\n })\n if (singleUserNssResponse.ok) {\n return singleUserUrl.href\n }\n return null\n}\n\nfunction createSection (\n container: Element,\n dom: HTMLDocument,\n title: string\n): Element {\n const section = container.appendChild(dom.createElement('div'))\n section.style.border = '0.3em solid #418d99'\n section.style.borderRadius = '0.5em'\n section.style.padding = '0.7em'\n section.style.marginTop = '0.7em'\n\n const titleElement = section.appendChild(dom.createElement('h3'))\n titleElement.innerText = title\n\n return section\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAoD;AAAA,MAAAE,YAAA;AAA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AAkB,EAClBN,GAAiB,EACjBmF,KAAa,EACJ;EACT,MAAMjC,OAAO,GAAG5C,SAAS,CAACC,WAAW,CAACP,GAAG,CAACU,aAAa,CAAC,KAAK,CAAC,CAAC;EAC/DwC,OAAO,CAACf,KAAK,CAACiD,MAAM,GAAG,qBAAqB;EAC5ClC,OAAO,CAACf,KAAK,CAACkD,YAAY,GAAG,OAAO;EACpCnC,OAAO,CAACf,KAAK,CAACmD,OAAO,GAAG,OAAO;EAC/BpC,OAAO,CAACf,KAAK,CAACoD,SAAS,GAAG,OAAO;EAEjC,MAAMC,YAAY,GAAGtC,OAAO,CAAC3C,WAAW,CAACP,GAAG,CAACU,aAAa,CAAC,IAAI,CAAC,CAAC;EACjE8E,YAAY,CAAC5C,SAAS,GAAGuC,KAAK;EAE9B,OAAOjC,OAAO;AAChB","ignoreList":[]}
@@ -1,63 +1,69 @@
1
- import { icons } from 'solid-ui';
2
- import { authn, authSession, store } from 'solid-logic';
3
- import { generateHomepage } from './homepage';
4
- export const dashboardPane = {
5
- icon: icons.iconBase + 'noun_547570.svg',
6
- name: 'dashboard',
7
- label: subject => {
8
- console.log();
9
- if (subject.uri === subject.site().uri) {
10
- return 'Dashboard';
11
- }
12
- return null;
13
- },
14
- render: (subject, context) => {
15
- console.log('Dashboard Pane Render');
16
- const dom = context.dom;
17
- const container = dom.createElement('div');
18
- const runBuildPage = () => {
19
- container.innerHTML = '';
20
- buildPage(container, authn.currentUser() || null, context, subject);
21
- };
22
- authSession.events.on('login', () => {
23
- // console.log('On Login')
24
- runBuildPage();
25
- });
26
- authSession.events.on('sessionRestore', () => {
27
- // console.log('On Session Restore')
28
- runBuildPage();
29
- });
30
- // console.log('Initial Load')
31
- runBuildPage();
32
- return container;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.dashboardPane = void 0;
7
+ var _solidUi = require("solid-ui");
8
+ var _solidLogic = require("solid-logic");
9
+ var _homepage = require("./homepage");
10
+ const dashboardPane = exports.dashboardPane = {
11
+ icon: _solidUi.icons.iconBase + 'noun_547570.svg',
12
+ name: 'dashboard',
13
+ label: subject => {
14
+ console.log();
15
+ if (subject.uri === subject.site().uri) {
16
+ return 'Dashboard';
33
17
  }
18
+ return null;
19
+ },
20
+ render: (subject, context) => {
21
+ console.log('Dashboard Pane Render');
22
+ const dom = context.dom;
23
+ const container = dom.createElement('div');
24
+ const runBuildPage = () => {
25
+ container.innerHTML = '';
26
+ buildPage(container, _solidLogic.authn.currentUser() || null, context, subject);
27
+ };
28
+ _solidLogic.authSession.events.on('login', () => {
29
+ // console.log('On Login')
30
+ runBuildPage();
31
+ });
32
+ _solidLogic.authSession.events.on('sessionRestore', () => {
33
+ // console.log('On Session Restore')
34
+ runBuildPage();
35
+ });
36
+ // console.log('Initial Load')
37
+ runBuildPage();
38
+ return container;
39
+ }
34
40
  };
35
41
  function buildPage(container, webId, context, subject) {
36
- // if uri then SolidOS is a browse.html web app
37
- const uri = (new URL(window.location.href)).searchParams.get('uri');
38
- if (webId && (uri || webId.site().uri === subject.site().uri)) {
39
- return buildDashboard(container, context);
40
- }
41
- return buildHomePage(container, subject);
42
+ // if uri then SolidOS is a browse.html web app
43
+ const uri = new URL(window.location.href).searchParams.get('uri');
44
+ if (webId && (uri || webId.site().uri === subject.site().uri)) {
45
+ return buildDashboard(container, context);
46
+ }
47
+ return buildHomePage(container, subject);
42
48
  }
43
49
  function buildDashboard(container, context) {
44
- // console.log('build dashboard')
45
- // @@ TODO get a proper type
46
- const outliner = context.getOutliner(context.dom);
47
- outliner
48
- .getDashboard()
49
- .then((dashboard) => container.appendChild(dashboard));
50
+ // console.log('build dashboard')
51
+ // @@ TODO get a proper type
52
+ const outliner = context.getOutliner(context.dom);
53
+ outliner.getDashboard().then(dashboard => container.appendChild(dashboard));
50
54
  }
51
55
  function buildHomePage(container, subject) {
52
- // console.log('build home page')
53
- const wrapper = document.createElement('div');
54
- container.appendChild(wrapper);
55
- const shadow = wrapper.attachShadow({ mode: 'open' });
56
- const link = document.createElement('link');
57
- link.rel = 'stylesheet';
58
- link.href = '/common/css/bootstrap.min.css';
59
- shadow.appendChild(link);
60
- generateHomepage(subject, store, store.fetcher).then(homepage => shadow.appendChild(homepage));
56
+ // console.log('build home page')
57
+ const wrapper = document.createElement('div');
58
+ container.appendChild(wrapper);
59
+ const shadow = wrapper.attachShadow({
60
+ mode: 'open'
61
+ });
62
+ const link = document.createElement('link');
63
+ link.rel = 'stylesheet';
64
+ link.href = '/common/css/bootstrap.min.css';
65
+ shadow.appendChild(link);
66
+ (0, _homepage.generateHomepage)(subject, _solidLogic.store, _solidLogic.store.fetcher).then(homepage => shadow.appendChild(homepage));
61
67
  }
62
- export default dashboardPane;
68
+ var _default = exports.default = dashboardPane;
63
69
  //# sourceMappingURL=dashboardPane.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboardPane.js","sourceRoot":"","sources":["../../src/dashboard/dashboardPane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG7C,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,IAAI,EAAE,KAAK,CAAC,QAAQ,GAAG,iBAAiB;IACxC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,OAAO,CAAC,EAAE;QACf,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,OAAO,CAAC,GAAG,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC;YACvC,OAAO,WAAW,CAAA;QACpB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QAC3B,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAA;Q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,MAAM,QAAQ,GAAQ,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACtD,QAAQ;SACL,YAAY,EAAE;SACd,IAAI,CAAC,CAAC,SAAsB,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,SAAS,aAAa,CAAE,SAAsB,EAAE,OAAkB;IAChE,iCAAiC;IACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC7C,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,CAAC,GAAG,GAAG,YAAY,CAAA;IACvB,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAA;IAC3C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACxB,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,OAAkB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACzE,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAC7B,CAAA;AACH,CAAC;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"dashboardPane.js","names":["_solidUi","require","_solidLogic","_homepage","dashboardPane","exports","icon","icons","iconBase","name","label","subject","console","log","uri","site","render","context","dom","container","createElement","runBuildPage","innerHTML","buildPage","authn","currentUser","authSession","events","on","webId","URL","window","location","href","searchParams","get","buildDashboard","buildHomePage","outliner","getOutliner","getDashboard","then","dashboard","appendChild","wrapper","document","shadow","attachShadow","mode","link","rel","generateHomepage","store","fetcher","homepage","_default","default"],"sources":["../../src/dashboard/dashboardPane.ts"],"sourcesContent":["import { icons } from 'solid-ui'\nimport { authn, authSession, store } from 'solid-logic'\nimport { Fetcher, NamedNode } from 'rdflib'\nimport { generateHomepage } from './homepage'\nimport { DataBrowserContext, PaneDefinition } from 'pane-registry'\n\nexport const dashboardPane: PaneDefinition = {\n icon: icons.iconBase + 'noun_547570.svg',\n name: 'dashboard',\n label: subject => {\n console.log()\n if (subject.uri === subject.site().uri) {\n return 'Dashboard'\n }\n return null\n },\n render: (subject, context) => {\n console.log('Dashboard Pane Render')\n const dom = context.dom\n const container = dom.createElement('div')\n const runBuildPage = () => {\n container.innerHTML = ''\n buildPage(\n container,\n authn.currentUser() || null,\n context,\n subject\n )\n }\n\n authSession.events.on('login', () => {\n // console.log('On Login')\n runBuildPage()\n })\n authSession.events.on('sessionRestore', () => {\n // console.log('On Session Restore')\n runBuildPage()\n })\n // console.log('Initial Load')\n runBuildPage()\n\n return container\n }\n}\n\nfunction buildPage (\n container: HTMLElement,\n webId: NamedNode | null,\n context: DataBrowserContext,\n subject: NamedNode\n) {\n // if uri then SolidOS is a browse.html web app\n const uri = (new URL(window.location.href)).searchParams.get('uri')\n if (webId && (uri || webId.site().uri === subject.site().uri)) {\n return buildDashboard(container, context)\n }\n return buildHomePage(container, subject)\n}\n\nfunction buildDashboard (container: HTMLElement, context: DataBrowserContext) {\n // console.log('build dashboard')\n // @@ TODO get a proper type\n const outliner: any = context.getOutliner(context.dom)\n outliner\n .getDashboard()\n .then((dashboard: HTMLElement) => container.appendChild(dashboard))\n}\n\nfunction buildHomePage (container: HTMLElement, subject: NamedNode) {\n // console.log('build home page')\n const wrapper = document.createElement('div')\n container.appendChild(wrapper)\n const shadow = wrapper.attachShadow({ mode: 'open' })\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = '/common/css/bootstrap.min.css'\n shadow.appendChild(link)\n generateHomepage(subject, store, store.fetcher as Fetcher).then(homepage =>\n shadow.appendChild(homepage)\n )\n}\n\nexport default dashboardPane\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;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