solid-panes 3.5.25-75daa316 → 3.5.25-991cd384
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/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js.map +1 -1
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js.map +1 -1
- package/lib/global.d.js.map +1 -1
- package/lib/home/homePane.js.map +1 -1
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/imagePane.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js.map +1 -1
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js.map +1 -1
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.js.map +1 -1
- package/lib/playlist/playlistPane.js.map +1 -1
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js.map +1 -1
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js.map +1 -1
- package/lib/test-import-export/testImportExport.js.map +1 -1
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/ui/pane.js.map +1 -1
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +2 -2
- package/src/versionInfo.ts +2 -2
package/lib/defaultPane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"defaultPane.js","names":["UI","require","$rdf","ns","module","exports","icon","icons","originalIconBase","name","audience","solid","label","_subject","render","subject","context","dom","filter","pred","inverse","session","paneRegistry","byName","predicates","uri","outliner","getOutliner","kb","store","log","info","location","canon","div","createElement","setAttribute","plist","statementsMatching","appendPropertyTRs","undefined","termType","value","slice","st","sym","link","updater","editable","rdf","Util","docpart","anyStatementMatching","why","holdingTr","holdingTd","img","src","addEventListener","addNewTripleIconMouseDownListener","e","UserInput","addNewPredicateObject","stopPropagation","preventDefault","className","appendChild"],"sources":["../src/defaultPane.js"],"sourcesContent":["/* Default Pane\n **\n ** This outline pane contains the properties which are\n ** normally displayed to the user. See also: internalPane\n ** This pane hides the ones considered too low-level for the normal user.\n */\n\nconst UI = require('solid-ui')\nconst $rdf = require('rdflib')\nconst ns = UI.ns\n\nmodule.exports = {\n icon: UI.icons.originalIconBase + 'about.png',\n\n name: 'default',\n\n audience: [ns.solid('Developer')],\n\n label: function (_subject) {\n return 'about '\n },\n\n render: function (subject, context) {\n const dom = context.dom\n\n const filter = function (pred, inverse) {\n if (\n typeof context.session.paneRegistry.byName('internal').predicates[\n pred.uri\n ] !== 'undefined'\n ) {\n return false\n }\n if (\n inverse &&\n pred.uri === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'\n ) {\n return false\n }\n return true\n }\n\n const outliner = context.getOutliner(dom)\n const kb = context.session.store\n // var outline = outliner; // @@\n UI.log.info('@defaultPane.render, dom is now ' + dom.location)\n subject = kb.canon(subject)\n const div = dom.createElement('div')\n div.setAttribute('class', 'defaultPane')\n // appendRemoveIcon(div, subject, div)\n\n let plist = kb.statementsMatching(subject)\n outliner.appendPropertyTRs(div, plist, false, filter)\n plist = kb.statementsMatching(undefined, undefined, subject)\n outliner.appendPropertyTRs(div, plist, true, filter)\n if (\n subject.termType === 'Literal' &&\n subject.value.slice(0, 7) === 'http://'\n ) {\n outliner.appendPropertyTRs(\n div,\n [$rdf.st(kb.sym(subject.value), UI.ns.link('uri'), subject)],\n true,\n filter\n )\n }\n if (\n (subject.termType === 'NamedNode' &&\n kb.updater.editable(UI.rdf.Util.uri.docpart(subject.uri), kb)) ||\n (subject.termType === 'BlankNode' &&\n kb.anyStatementMatching(subject) &&\n kb.anyStatementMatching(subject).why &&\n kb.anyStatementMatching(subject).why.uri &&\n kb.updater.editable(kb.anyStatementMatching(subject).why.uri))\n // check the document containing something about of the bnode @@ what about as object?\n /* ! && HCIoptions[\"bottom insert highlights\"].enabled */\n ) {\n const holdingTr = dom.createElement('tr') // these are to minimize required changes\n const holdingTd = dom.createElement('td') // in userinput.js\n holdingTd.setAttribute('colspan', '2')\n holdingTd.setAttribute('notSelectable', 'true')\n const img = dom.createElement('img')\n img.src = UI.icons.originalIconBase + 'tango/22-list-add-new.png'\n img.addEventListener('click', function addNewTripleIconMouseDownListener (\n e\n ) {\n outliner.UserInput.addNewPredicateObject(e)\n e.stopPropagation()\n e.preventDefault()\n })\n img.className = 'bottom-border-active'\n // img.addEventListener('click', thisOutline.UserInput.addNewPredicateObject,false)\n div\n .appendChild(holdingTr)\n .appendChild(holdingTd)\n .appendChild(img)\n }\n return div\n }\n}\n\n// ends\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,EAAE,GAAGC,OAAO,CAAC,UAAD,CAAlB;;AACA,IAAMC,IAAI,GAAGD,OAAO,CAAC,QAAD,CAApB;;AACA,IAAME,EAAE,GAAGH,EAAE,CAACG,EAAd;AAEAC,MAAM,CAACC,OAAP,GAAiB;EACfC,IAAI,EAAEN,EAAE,CAACO,KAAH,CAASC,gBAAT,GAA4B,WADnB;EAGfC,IAAI,EAAE,SAHS;EAKfC,QAAQ,EAAE,CAACP,EAAE,CAACQ,KAAH,CAAS,WAAT,CAAD,CALK;EAOfC,KAAK,EAAE,eAAUC,QAAV,EAAoB;IACzB,OAAO,QAAP;EACD,CATc;EAWfC,MAAM,EAAE,gBAAUC,OAAV,EAAmBC,OAAnB,EAA4B;IAClC,IAAMC,GAAG,GAAGD,OAAO,CAACC,GAApB;;IAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAUC,IAAV,EAAgBC,OAAhB,EAAyB;MACtC,IACE,OAAOJ,OAAO,CAACK,OAAR,CAAgBC,YAAhB,CAA6BC,MAA7B,CAAoC,UAApC,EAAgDC,UAAhD,CACLL,IAAI,CAACM,GADA,CAAP,KAEM,WAHR,EAIE;QACA,OAAO,KAAP;MACD;;MACD,IACEL,OAAO,IACPD,IAAI,CAACM,GAAL,KAAa,iDAFf,EAGE;QACA,OAAO,KAAP;MACD;;MACD,OAAO,IAAP;IACD,CAfD;;IAiBA,IAAMC,QAAQ,GAAGV,OAAO,CAACW,WAAR,CAAoBV,GAApB,CAAjB;IACA,IA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AOtB,GAAP;EACD;AAvFc,CAAjB,C,CA0FA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/dokieli/dokieliPane.js"],"names":["UI","require","$rdf","mime","DOKIELI_TEMPLATE","module","exports","icon","icons","iconBase","name","mintClass","ns","solid","label","subject","context","kb","session","store","allowed","hasContentTypeIn","x","displayables","cts","fetcher","getHeader","j","length","k","indexOf","hasContentTypeIn2","t","findTypeURIs","Util","mediaTypeClass","uri","link","mintNew","newPaneOptions","newInstance","newBase","endsWith","slice","sym","contentType","lookup","includes","console","log","htmlContents","filename","split","decodeURIComponent","encodedTitle","replace","Promise","resolve","webOperation","data","then","err","render","myDocument","dom","div","createElement","setAttribute","iframe","doc","ct","tr","appendChild"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,EAAE,GAAGC,OAAO,CAAC,UAAD,CAAlB;;AACA,IAAMC,IAAI,GAAGD,OAAO,CAAC,QAAD,CAApB;;AACA,IAAME,IAAI,GAAGF,OAAO,CAAC,YAAD,CAApB,C,CAEA;;;AAEA,IAAMG,gBAAgB,GAAGH,OAAO,CAAC,UAAD,CAAhC,C,CAA6C;;;AAE7CI,MAAM,CAACC,OAAP,GAAiB;AACfC,EAAAA,IAAI,EAAEP,EAAE,CAACQ,KAAH,CAASC,QAAT,GAAoB,kBADX;AAC+B;AAE9CC,EAAAA,IAAI,EAAE,SAHS;AAKfC,EAAAA,SAAS,EAAEX,EAAE,CAACY,EAAH,CAAMC,KAAN,CAAY,iBAAZ,CALI;AAK4B;AAE3CC,EAAAA,KAAK,EAAE,eAAUC,OAAV,EAAmBC,OAAnB,EAA4B;AACjC,QAAMC,EAAE,GAAGD,OAAO,CAACE,OAAR,CAAgBC,KAA3B;AACA,QAAMP,EAAE,GAAGZ,EAAE,CAACY,EAAd;AACA,QAAMQ,OAAO,GAAG,CACd;AACA,eAFc,EAGd,uBAHc,CAId;AACA;AALc,KAAhB;;AAQA,QAAMC,gBAAgB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A3B;AACA,QAAMC,GAAG,GAAGF,UAAU,CAACG,aAAX,CAAyB,KAAzB,CAAZ;AACA,QAAMjD,EAAE,GAAGD,OAAO,CAACE,OAAR,CAAgBC,KAA3B,CAHkC,CAKlC;;AACA8C,IAAAA,GAAG,CAACE,YAAJ,CAAiB,OAAjB,EAA0B,SAA1B;AACA,QAAMC,MAAM,GAAGL,UAAU,CAACG,aAAX,CAAyB,QAAzB,CAAf;AACAE,IAAAA,MAAM,CAACD,YAAP,CAAoB,KAApB,EAA2BpD,OAAO,CAACqB,GAAnC,EARkC,CAQM;;AACxCgC,IAAAA,MAAM,CAACD,YAAP,CAAoB,OAApB,EAA6B,KAA7B;AAEA,QAAM3C,GAAG,GAAGP,EAAE,CAACQ,OAAH,CAAWC,SAAX,CAAqBX,OAAO,CAACsD,GAAR,EAArB,EAAoC,cAApC,CAAZ;AACA,QAAMC,EAAE,GAAG9C,GAAG,GAAGA,GAAG,CAAC,CAAD,CAAN,GAAY,IAA1B;;AACA,QAAI8C,EAAJ,EAAQ;AACNtB,MAAAA,OAAO,CAACC,GAAR,CAAY,sBAAsBqB,EAAlC;AACD,KAFD,MAEO;AACLtB,MAAAA,OAAO,CAACC,GAAR,CAAY,oCAAZ;AACD,KAjBiC,CAmBlC;AACA;AACA;AACA;AACA;AAEA;;;AAEAmB,IAAAA,MAAM,CAACD,YAAP,CAAoB,OAApB,EAA6B,0CAA7B,EA3BkC,CA2BuC;AACzE;AACA;;AACA,QAAMI,EAAE,GAAGR,UAAU,CAACG,aAAX,CAAyB,IAAzB,CAAX;AACAK,IAAAA,EAAE,CAACC,WAAH,CAAeJ,MAAf;AACAH,IAAAA,GAAG,CAACO,WAAJ,CAAgBD,EAAhB;AACA,WAAON,GAAP;AACD;AAtJc,CAAjB,C,CAwJA","sourcesContent":["/* Human-readable editable \"Dokieli\" Pane\n **\n ** This outline pane contains the document contents for a Dokieli document\n ** The dokeili system allows the user to edit a document including anotations\n ** review. It does not use turtle, but RDF/a\n */\n\nconst UI = require('solid-ui')\nconst $rdf = require('rdflib')\nconst mime = require('mime-types')\n\n// const DOKIELI_TEMPLATE_URI = 'https://dokie.li/new' // Copy to make new dok\n\nconst DOKIELI_TEMPLATE = require('./new.js') // Distributed with this library\n\nmodule.exports = {\n icon: UI.icons.iconBase + 'dokieli-logo.png', // @@ improve? more like doccument?\n\n name: 'Dokieli',\n\n mintClass: UI.ns.solid('DokieliDocument'), // @@ A better class?\n\n label: function (subject, context) {\n const kb = context.session.store\n const ns = UI.ns\n const allowed = [\n // 'text/plain',\n 'text/html',\n 'application/xhtml+xml'\n // 'image/png', 'image/jpeg', 'application/pdf',\n // 'video/mp4'\n ]\n\n const hasContentTypeIn = function (kb, x, displayables) {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data coul d come from a fetch OR from ldp comtaimner\n const hasContentTypeIn2 = function (kb, x, displayables) {\n const t = kb.findTypeURIs(subject)\n for (let k = 0; k < displayables.length; k++) {\n if ($rdf.Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'view'\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n return 'Dok'\n }\n\n return null\n },\n\n // Create a new folder in a Solid system, with a dokieli editable document in it\n mintNew: function (context, newPaneOptions) {\n const kb = context.session.store\n let newInstance = newPaneOptions.newInstance\n if (!newInstance) {\n let uri = newPaneOptions.newBase\n if (uri.endsWith('/')) {\n uri = uri.slice(0, -1)\n newPaneOptions.newBase = uri\n }\n newInstance = kb.sym(uri)\n }\n\n const contentType = mime.lookup(newInstance.uri)\n if (!contentType || !contentType.includes('html')) {\n newInstance = $rdf.sym(newInstance.uri + '.html')\n }\n newPaneOptions.newInstance = newInstance // Save for creation system\n\n console.log('New dokieli will make: ' + newInstance)\n\n let htmlContents = DOKIELI_TEMPLATE\n let filename = newInstance.uri.split('/').slice(-1)[0]\n filename = decodeURIComponent(filename.split('.')[0])\n const encodedTitle = filename\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n htmlContents = htmlContents.replace('<title>', '<title>' + encodedTitle)\n htmlContents = htmlContents.replace(\n '</article>',\n '<h1>' + encodedTitle + '</h1></article>'\n )\n console.log('@@ New HTML for Dok:' + htmlContents)\n return new Promise(function (resolve) {\n kb.fetcher\n .webOperation('PUT', newInstance.uri, {\n data: htmlContents,\n contentType: 'text/html'\n })\n .then(function () {\n console.log(\n 'new Dokieli document created at ' + newPaneOptions.newInstance\n )\n resolve(newPaneOptions)\n })\n .catch(function (err) {\n console.log(\n 'Error creating dokelili dok at ' +\n newPaneOptions.newInstance +\n ': ' +\n err\n )\n })\n })\n },\n\n // Derived from: humanReadablePane .. share code?\n render: function (subject, context) {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.setAttribute('class', 'docView')\n const iframe = myDocument.createElement('IFRAME')\n iframe.setAttribute('src', subject.uri) // allow-same-origin\n iframe.setAttribute('class', 'doc')\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0] : null\n if (ct) {\n console.log('dokieliPane: c-t:' + ct)\n } else {\n console.log('dokieliPane: unknown content-type?')\n }\n\n // @@ NOte beflow - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n // You can;'t have any sandbox and allow plugins.\n // We could sandbox only HTML files I suppose.\n // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html\n\n // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static\n\n iframe.setAttribute('style', 'resize = both; height: 40em; width:40em;') // @@ improve guess\n // iframe.setAttribute('height', '480')\n // iframe.setAttribute('width', '640')\n const tr = myDocument.createElement('tr')\n tr.appendChild(iframe)\n div.appendChild(tr)\n return div\n }\n}\n// ends\n"],"file":"dokieliPane.js"}
|
|
1
|
+
{"version":3,"file":"dokieliPane.js","names":["UI","require","$rdf","mime","DOKIELI_TEMPLATE","module","exports","icon","icons","iconBase","name","mintClass","ns","solid","label","subject","context","kb","session","store","allowed","hasContentTypeIn","x","displayables","cts","fetcher","getHeader","j","length","k","indexOf","hasContentTypeIn2","t","findTypeURIs","Util","mediaTypeClass","uri","link","mintNew","newPaneOptions","newInstance","newBase","endsWith","slice","sym","contentType","lookup","includes","console","log","htmlContents","filename","split","decodeURIComponent","encodedTitle","replace","Promise","resolve","webOperation","data","then","err","render","myDocument","dom","div","createElement","setAttribute","iframe","doc","ct","tr","appendChild"],"sources":["../../src/dokieli/dokieliPane.js"],"sourcesContent":["/* Human-readable editable \"Dokieli\" Pane\n **\n ** This outline pane contains the document contents for a Dokieli document\n ** The dokeili system allows the user to edit a document including anotations\n ** review. It does not use turtle, but RDF/a\n */\n\nconst UI = require('solid-ui')\nconst $rdf = require('rdflib')\nconst mime = require('mime-types')\n\n// const DOKIELI_TEMPLATE_URI = 'https://dokie.li/new' // Copy to make new dok\n\nconst DOKIELI_TEMPLATE = require('./new.js') // Distributed with this library\n\nmodule.exports = {\n icon: UI.icons.iconBase + 'dokieli-logo.png', // @@ improve? more like doccument?\n\n name: 'Dokieli',\n\n mintClass: UI.ns.solid('DokieliDocument'), // @@ A better class?\n\n label: function (subject, context) {\n const kb = context.session.store\n const ns = UI.ns\n const allowed = [\n // 'text/plain',\n 'text/html',\n 'application/xhtml+xml'\n // 'image/png', 'image/jpeg', 'application/pdf',\n // 'video/mp4'\n ]\n\n const hasContentTypeIn = function (kb, x, displayables) {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data coul d come from a fetch OR from ldp comtaimner\n const hasContentTypeIn2 = function (kb, x, displayables) {\n const t = kb.findTypeURIs(subject)\n for (let k = 0; k < displayables.length; k++) {\n if ($rdf.Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'view'\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n return 'Dok'\n }\n\n return null\n },\n\n // Create a new folder in a Solid system, with a dokieli editable document in it\n mintNew: function (context, newPaneOptions) {\n const kb = context.session.store\n let newInstance = newPaneOptions.newInstance\n if (!newInstance) {\n let uri = newPaneOptions.newBase\n if (uri.endsWith('/')) {\n uri = uri.slice(0, -1)\n newPaneOptions.newBase = uri\n }\n newInstance = kb.sym(uri)\n }\n\n const contentType = mime.lookup(newInstance.uri)\n if (!contentType || !contentType.includes('html')) {\n newInstance = $rdf.sym(newInstance.uri + '.html')\n }\n newPaneOptions.newInstance = newInstance // Save for creation system\n\n console.log('New dokieli will make: ' + newInstance)\n\n let htmlContents = DOKIELI_TEMPLATE\n let filename = newInstance.uri.split('/').slice(-1)[0]\n filename = decodeURIComponent(filename.split('.')[0])\n const encodedTitle = filename\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n htmlContents = htmlContents.replace('<title>', '<title>' + encodedTitle)\n htmlContents = htmlContents.replace(\n '</article>',\n '<h1>' + encodedTitle + '</h1></article>'\n )\n console.log('@@ New HTML for Dok:' + htmlContents)\n return new Promise(function (resolve) {\n kb.fetcher\n .webOperation('PUT', newInstance.uri, {\n data: htmlContents,\n contentType: 'text/html'\n })\n .then(function () {\n console.log(\n 'new Dokieli document created at ' + newPaneOptions.newInstance\n )\n resolve(newPaneOptions)\n })\n .catch(function (err) {\n console.log(\n 'Error creating dokelili dok at ' +\n newPaneOptions.newInstance +\n ': ' +\n err\n )\n })\n })\n },\n\n // Derived from: humanReadablePane .. share code?\n render: function (subject, context) {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.setAttribute('class', 'docView')\n const iframe = myDocument.createElement('IFRAME')\n iframe.setAttribute('src', subject.uri) // allow-same-origin\n iframe.setAttribute('class', 'doc')\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0] : null\n if (ct) {\n console.log('dokieliPane: c-t:' + ct)\n } else {\n console.log('dokieliPane: unknown content-type?')\n }\n\n // @@ NOte beflow - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n // You can;'t have any sandbox and allow plugins.\n // We could sandbox only HTML files I suppose.\n // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html\n\n // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static\n\n iframe.setAttribute('style', 'resize = both; height: 40em; width:40em;') // @@ improve guess\n // iframe.setAttribute('height', '480')\n // iframe.setAttribute('width', '640')\n const tr = myDocument.createElement('tr')\n tr.appendChild(iframe)\n div.appendChild(tr)\n return div\n }\n}\n// ends\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,EAAE,GAAGC,OAAO,CAAC,UAAD,CAAlB;;AACA,IAAMC,IAAI,GAAGD,OAAO,CAAC,QAAD,CAApB;;AACA,IAAME,IAAI,GAAGF,OAAO,CAAC,YAAD,CAApB,C,CAEA;;;AAEA,IAAMG,gBAAgB,GAAGH,OAAO,CAAC,UAAD,CAAhC,C,CAA6C;;;AAE7CI,MAAM,CAACC,OAAP,GAAiB;EACfC,IAAI,EAAEP,EAAE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MAAf;IACAH,GAAG,CAACO,WAAJ,CAAgBD,EAAhB;IACA,OAAON,GAAP;EACD;AAtJc,CAAjB,C,CAwJA"}
|
package/lib/dokieli/new.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"new.js","names":["module","exports"],"sources":["../../src/dokieli/new.js"],"sourcesContent":["module.exports = `\n<!DOCTYPE html>\n<html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta charset=\"utf-8\" />\n <title></title>\n <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\" />\n <link href=\"https://dokie.li/media/css/basic.css\" media=\"all\" rel=\"stylesheet\" title=\"Basic\" />\n <link href=\"https://dokie.li/media/css/dokieli.css\" media=\"all\" rel=\"stylesheet\" />\n <script src=\"https://dokie.li/scripts/dokieli.js\"></script>\n </head>\n\n <body about=\"\" prefix=\"rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# owl: http://www.w3.org/2002/07/owl# xsd: http://www.w3.org/2001/XMLSchema# dcterms: http://purl.org/dc/terms/ dctypes: http://purl.org/dc/dcmitype/ foaf: http://xmlns.com/foaf/0.1/ pimspace: http://www.w3.org/ns/pim/space# cc: https://creativecommons.org/ns# skos: http://www.w3.org/2004/02/skos/core# prov: http://www.w3.org/ns/prov# mem: http://mementoweb.org/ns# qb: http://purl.org/linked-data/cube# schema: http://schema.org/ void: http://rdfs.org/ns/void# rsa: http://www.w3.org/ns/auth/rsa# cert: http://www.w3.org/ns/auth/cert# wgs: http://www.w3.org/2003/01/geo/wgs84_pos# bibo: http://purl.org/ontology/bibo/ sioc: http://rdfs.org/sioc/ns# doap: http://usefulinc.com/ns/doap# dbr: http://dbpedia.org/resource/ dbp: http://dbpedia.org/property/ sio: http://semanticscience.org/resource/ opmw: http://www.opmw.org/ontology/ deo: http://purl.org/spar/deo/ doco: http://purl.org/spar/doco/ cito: http://purl.org/spar/cito/ fabio: http://purl.org/spar/fabio/ oa: http://www.w3.org/ns/oa# as: https://www.w3.org/ns/activitystreams# ldp: http://www.w3.org/ns/ldp# solid: http://www.w3.org/ns/solid/terms# acl: http://www.w3.org/ns/auth/acl# dio: https://w3id.org/dio# rel: https://www.w3.org/ns/iana/link-relations/relation#\" typeof=\"schema:CreativeWork sioc:Post prov:Entity\">\n <main>\n <article about=\"\" typeof=\"schema:Article\">\n\n </article>\n </main>\n </body>\n</html>\n`\n"],"mappings":";;AAAAA,MAAM,CAACC,OAAP"}
|
package/lib/form/pane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/pane.js"],"names":["ns","UI","module","exports","icon","icons","iconBase","name","audience","solid","label","subject","n","widgets","formsFor","length","log","debug","render","context","kb","session","store","dom","mention","complain","message","style","pre","createElement","setAttribute","box","appendChild","textContent","complainIfBad","ok","body","me","authn","currentUser","ws","each","ui","renderFormsFor","fetcher","nowOrWhenFetched","uri","forms","i","form","heading","formStore","$rdf","Util","document","e","editFormButton","anchor","utils","appendForm","docuri","docpart","updater","editable","doc","any","sym","link","docs","docList","statementsMatching","forEach","st","why","undefined","d","push","sort","_followeach","path","oo","res","concat","slice","date","foobarbaz","login","selectWorkspace","activities","space","j","act","subjectDoc2","start","cal","value","end"],"mappings":";;;;AAKA;;AACA;;AACA;;;;;;AAPA;AACA;AACA;AACA;AAKA,IAAMA,EAAE,GAAGC,EAAE,CAACD,EAAd;AAEAE,MAAM,CAACC,OAAP,GAAiB;AACfC,EAAAA,IAAI,EAAEH,EAAE,CAACI,KAAH,CAASC,QAAT,GAAoB,iBADX;AAGfC,EAAAA,IAAI,EAAE,MAHS;AAKfC,EAAAA,QAAQ,EAAE,CAACR,EAAE,CAACS,KAAH,CAAS,WAAT,CAAD,CALK;AAOf;AACAC,EAAAA,KAAK,EAAE,eAAUC,OAAV,EAAmB;AACxB,QAAMC,CAAC,GAAGX,EAAE,CAACY,O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IAAIkD,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,UAAU,CAACzE,MAA/B,EAAuC2E,CAAC,EAAxC,EAA4C;AAC1C,cAAMC,GAAG,GAAGH,UAAU,CAACE,CAAD,CAAtB;AAEA,cAAME,WAAW,GAAGtE,KAAK,CAAC2C,GAAN,CAAUzB,EAAV,EAAcxC,EAAE,CAACyF,KAAH,CAAS,OAAT,CAAd,CAApB;AACA,cAAMI,KAAK,GAAGvE,KAAK,CAAC2C,GAAN,CAAUzB,EAAV,EAAcxC,EAAE,CAAC8F,GAAH,CAAO,SAAP,CAAd,EAAiCC,KAAjC,EAAd;AACA,cAAMC,GAAG,GAAG1E,KAAK,CAAC2C,GAAN,CAAUzB,EAAV,EAAcxC,EAAE,CAAC8F,GAAH,CAAO,OAAP,CAAd,EAA+BC,KAA/B,EAAZ;;AACA,cAAIH,WAAW,IAAIC,KAAf,IAAwBG,GAAxB,IAA+BH,KAAK,IAAIT,IAAxC,IAAgDY,GAAG,GAAGZ,IAA1D,EAAgE;AAC9DzC,YAAAA,cAAc,CAACiD,WAAD,EAAcjF,OAAd,CAAd;AACA;AACD,WAHD,MAGO;AACLc,YAAAA,QAAQ,CAAC,oDAAoDkE,GAArD,CAAR;AACD;AACF;AACF,OAjBiB,CAAlB;AAkBA5D,MAAAA,GAAG,CAACC,WAAJ,CAAgBqD,SAAhB;AACD;;AAED,WAAOtD,GAAP;AACD;AA7Mc,CAAjB","sourcesContent":["/*\n ** Pane for running existing forms for any object\n **\n */\n\nimport * as UI from 'solid-ui'\nimport { authn } from 'solid-logic'\nimport * as $rdf from 'rdflib'\nconst ns = UI.ns\n\nmodule.exports = {\n icon: UI.icons.iconBase + 'noun_122196.svg',\n\n name: 'form',\n\n audience: [ns.solid('PowerUser')],\n\n // Does the subject deserve this pane?\n label: function (subject) {\n const n = UI.widgets.formsFor(subject).length\n UI.log.debug('Form pane: forms for ' + subject + ': ' + n)\n if (!n) return null\n return '' + n + ' forms'\n },\n\n render: function (subject, context) {\n const kb = context.session.store\n const dom = context.dom\n\n const mention = function complain (message, style) {\n const pre = dom.createElement('p')\n pre.setAttribute('style', style || 'color: grey; background-color: white')\n box.appendChild(pre).textContent = message\n return pre\n }\n\n const complain = function complain (message, style) {\n mention(message, 'style', style || 'color: grey; background-color: #fdd;')\n }\n\n const complainIfBad = function (ok, body) {\n if (ok) {\n // setModifiedDate(store, kb, store);\n // rerender(box); // Deleted forms at the moment\n } else complain('Sorry, failed to save your change:\\n' + body)\n }\n\n // The question of where to store this data about subject\n // This in general needs a whole lot more thought\n // and it connects to the discoverbility through links\n\n // const t = kb.findTypeURIs(subject)\n\n const me = authn.currentUser()\n\n const box = dom.createElement('div')\n box.setAttribute('class', 'formPane')\n\n if (!me) {\n mention(\n 'You are not logged in. If you log in and have ' +\n 'workspaces then you would be able to select workspace in which ' +\n 'to put this new information'\n )\n } else {\n const ws = kb.each(me, ns.ui('workspace'))\n if (ws.length === 0) {\n mention(\n \"You don't seem to have any workspaces defined. \" +\n 'A workspace is a place on the web (http://..) or in ' +\n 'the file system (file:///) to store application data.\\n'\n )\n } else {\n // @@\n }\n }\n\n // Render forms using a given store\n\n const renderFormsFor = function (store, subject) {\n kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {\n if (!ok) return complain('Cannot load store ' + store.uri + ': ' + body)\n\n // Render the forms\n\n const forms = UI.widgets.formsFor(subject)\n\n // complain('Form for editing this form:');\n for (let i = 0; i < forms.length; i++) {\n const form = forms[i]\n const heading = dom.createElement('h4')\n box.appendChild(heading)\n if (form.uri) {\n const formStore = $rdf.Util.uri.document(form.uri)\n if (formStore.uri !== form.uri) {\n // The form is a hash-type URI\n const e = box.appendChild(\n UI.widgets.editFormButton(\n dom,\n box,\n form,\n formStore,\n complainIfBad\n )\n )\n e.setAttribute('style', 'float: right;')\n }\n }\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', form.uri)\n heading.appendChild(anchor)\n anchor.textContent = UI.utils.label(form, true)\n\n /* Keep tis as a reminder to let a New one have its URI given by user\n mention(\"Where will this information be stored?\")\n const ele = dom.createElement('input');\n box.appendChild(ele);\n ele.setAttribute('type', 'text');\n ele.setAttribute('size', '72');\n ele.setAttribute('maxlength', '1024');\n ele.setAttribute('style', 'font-size: 80%; color:#222;');\n ele.value = store.uri\n */\n\n UI.widgets.appendForm(\n dom,\n box,\n {},\n subject,\n form,\n store,\n complainIfBad\n )\n }\n }) // end: when store loded\n } // renderFormsFor\n\n // Figure out what store\n\n // Which places are editable and have stuff about the subject?\n\n let store = null\n\n // 1. The document URI of the subject itself\n const docuri = $rdf.Util.uri.docpart(subject.uri)\n if (subject.uri !== docuri && kb.updater.editable(docuri, kb)) {\n store = subject.doc()\n } // an editable data file with hash\n\n store = store || kb.any(kb.sym(docuri), ns.link('annotationStore'))\n\n // 2. where stuff is already stored\n if (!store) {\n const docs = {}\n const docList = []\n store.statementsMatching(subject).forEach(function (st) {\n docs[st.why.uri] = 1\n })\n store\n .statementsMatching(undefined, undefined, subject)\n .forEach(function (st) {\n docs[st.why.uri] = 2\n })\n for (const d in docs) docList.push(docs[d], d)\n docList.sort()\n for (let i = 0; i < docList.length; i++) {\n const uri = docList[i][1]\n if (uri && store.updater.editable(uri)) {\n store = store.sym(uri)\n break\n }\n }\n }\n\n // 3. In a workspace store\n // @@ TODO: Can probably remove _followeach (not done this time because the commit is a very safe refactor)\n const _followeach = function (kb, subject, path) {\n if (path.length === 0) return [subject]\n const oo = kb.each(subject, path[0])\n let res = []\n for (let i = 0; i < oo.length; i++) {\n res = res.concat(_followeach(kb, oo[i], path.slice(1)))\n }\n return res\n }\n\n const date = '2014' // @@@@@@@@@@@@ pass as parameter\n\n if (store) {\n // mention(\"@@ Ok, we have a store <\" + store.uri + \">.\");\n renderFormsFor(store, subject)\n } else {\n complain('No suitable store is known, to edit <' + subject.uri + '>.')\n const foobarbaz = UI.login.selectWorkspace(dom, function (ws) {\n mention('Workspace selected OK: ' + ws)\n\n const activities = store.each(undefined, ns.space('workspace'), ws)\n for (let j = 0; j < activities.length; j++) {\n const act = activities[j]\n\n const subjectDoc2 = store.any(ws, ns.space('store'))\n const start = store.any(ws, ns.cal('dtstart')).value()\n const end = store.any(ws, ns.cal('dtend')).value()\n if (subjectDoc2 && start && end && start <= date && end > date) {\n renderFormsFor(subjectDoc2, subject)\n break\n } else {\n complain('Note no suitable annotation store in activity: ' + act)\n }\n }\n })\n box.appendChild(foobarbaz)\n }\n\n return box\n }\n}\n"],"file":"pane.js"}
|
|
1
|
+
{"version":3,"file":"pane.js","names":["ns","UI","module","exports","icon","icons","iconBase","name","audience","solid","label","subject","n","widgets","formsFor","length","log","debug","render","context","kb","session","store","dom","mention","complain","message","style","pre","createElement","setAttribute","box","appendChild","textContent","complainIfBad","ok","body","me","authn","currentUser","ws","each","ui","renderFormsFor","fetcher","nowOrWhenFetched","uri","forms","i","form","heading","formStore","$rdf","Util","document","e","editFormButton","anchor","utils","appendForm","docuri","docpart","updater","editable","doc","any","sym","link","docs","docList","statementsMatching","forEach","st","why","undefined","d","push","sort","_followeach","path","oo","res","concat","slice","date","foobarbaz","login","selectWorkspace","activities","space","j","act","subjectDoc2","start","cal","value","end"],"sources":["../../src/form/pane.js"],"sourcesContent":["/*\n ** Pane for running existing forms for any object\n **\n */\n\nimport * as UI from 'solid-ui'\nimport { authn } from 'solid-logic'\nimport * as $rdf from 'rdflib'\nconst ns = UI.ns\n\nmodule.exports = {\n icon: UI.icons.iconBase + 'noun_122196.svg',\n\n name: 'form',\n\n audience: [ns.solid('PowerUser')],\n\n // Does the subject deserve this pane?\n label: function (subject) {\n const n = UI.widgets.formsFor(subject).length\n UI.log.debug('Form pane: forms for ' + subject + ': ' + n)\n if (!n) return null\n return '' + n + ' forms'\n },\n\n render: function (subject, context) {\n const kb = context.session.store\n const dom = context.dom\n\n const mention = function complain (message, style) {\n const pre = dom.createElement('p')\n pre.setAttribute('style', style || 'color: grey; background-color: white')\n box.appendChild(pre).textContent = message\n return pre\n }\n\n const complain = function complain (message, style) {\n mention(message, 'style', style || 'color: grey; background-color: #fdd;')\n }\n\n const complainIfBad = function (ok, body) {\n if (ok) {\n // setModifiedDate(store, kb, store);\n // rerender(box); // Deleted forms at the moment\n } else complain('Sorry, failed to save your change:\\n' + body)\n }\n\n // The question of where to store this data about subject\n // This in general needs a whole lot more thought\n // and it connects to the discoverbility through links\n\n // const t = kb.findTypeURIs(subject)\n\n const me = authn.currentUser()\n\n const box = dom.createElement('div')\n box.setAttribute('class', 'formPane')\n\n if (!me) {\n mention(\n 'You are not logged in. If you log in and have ' +\n 'workspaces then you would be able to select workspace in which ' +\n 'to put this new information'\n )\n } else {\n const ws = kb.each(me, ns.ui('workspace'))\n if (ws.length === 0) {\n mention(\n \"You don't seem to have any workspaces defined. \" +\n 'A workspace is a place on the web (http://..) or in ' +\n 'the file system (file:///) to store application data.\\n'\n )\n } else {\n // @@\n }\n }\n\n // Render forms using a given store\n\n const renderFormsFor = function (store, subject) {\n kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {\n if (!ok) return complain('Cannot load store ' + store.uri + ': ' + body)\n\n // Render the forms\n\n const forms = UI.widgets.formsFor(subject)\n\n // complain('Form for editing this form:');\n for (let i = 0; i < forms.length; i++) {\n const form = forms[i]\n const heading = dom.createElement('h4')\n box.appendChild(heading)\n if (form.uri) {\n const formStore = $rdf.Util.uri.document(form.uri)\n if (formStore.uri !== form.uri) {\n // The form is a hash-type URI\n const e = box.appendChild(\n UI.widgets.editFormButton(\n dom,\n box,\n form,\n formStore,\n complainIfBad\n )\n )\n e.setAttribute('style', 'float: right;')\n }\n }\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', form.uri)\n heading.appendChild(anchor)\n anchor.textContent = UI.utils.label(form, true)\n\n /* Keep tis as a reminder to let a New one have its URI given by user\n mention(\"Where will this information be stored?\")\n const ele = dom.createElement('input');\n box.appendChild(ele);\n ele.setAttribute('type', 'text');\n ele.setAttribute('size', '72');\n ele.setAttribute('maxlength', '1024');\n ele.setAttribute('style', 'font-size: 80%; color:#222;');\n ele.value = store.uri\n */\n\n UI.widgets.appendForm(\n dom,\n box,\n {},\n subject,\n form,\n store,\n complainIfBad\n )\n }\n }) // end: when store loded\n } // renderFormsFor\n\n // Figure out what store\n\n // Which places are editable and have stuff about the subject?\n\n let store = null\n\n // 1. The document URI of the subject itself\n const docuri = $rdf.Util.uri.docpart(subject.uri)\n if (subject.uri !== docuri && kb.updater.editable(docuri, kb)) {\n store = subject.doc()\n } // an editable data file with hash\n\n store = store || kb.any(kb.sym(docuri), ns.link('annotationStore'))\n\n // 2. where stuff is already stored\n if (!store) {\n const docs = {}\n const docList = []\n store.statementsMatching(subject).forEach(function (st) {\n docs[st.why.uri] = 1\n })\n store\n .statementsMatching(undefined, undefined, subject)\n .forEach(function (st) {\n docs[st.why.uri] = 2\n })\n for (const d in docs) docList.push(docs[d], d)\n docList.sort()\n for (let i = 0; i < docList.length; i++) {\n const uri = docList[i][1]\n if (uri && store.updater.editable(uri)) {\n store = store.sym(uri)\n break\n }\n }\n }\n\n // 3. In a workspace store\n // @@ TODO: Can probably remove _followeach (not done this time because the commit is a very safe refactor)\n const _followeach = function (kb, subject, path) {\n if (path.length === 0) return [subject]\n const oo = kb.each(subject, path[0])\n let res = []\n for (let i = 0; i < oo.length; i++) {\n res = res.concat(_followeach(kb, oo[i], path.slice(1)))\n }\n return res\n }\n\n const date = '2014' // @@@@@@@@@@@@ pass as parameter\n\n if (store) {\n // mention(\"@@ Ok, we have a store <\" + store.uri + \">.\");\n renderFormsFor(store, subject)\n } else {\n complain('No suitable store is known, to edit <' + subject.uri + '>.')\n const foobarbaz = UI.login.selectWorkspace(dom, function (ws) {\n mention('Workspace selected OK: ' + ws)\n\n const activities = store.each(undefined, ns.space('workspace'), ws)\n for (let j = 0; j < activities.length; j++) {\n const act = activities[j]\n\n const subjectDoc2 = store.any(ws, ns.space('store'))\n const start = store.any(ws, ns.cal('dtstart')).value()\n const end = store.any(ws, ns.cal('dtend')).value()\n if (subjectDoc2 && start && end && start <= date && end > date) {\n renderFormsFor(subjectDoc2, subject)\n break\n } else {\n complain('Note no suitable annotation store in activity: ' + act)\n }\n }\n })\n box.appendChild(foobarbaz)\n }\n\n return box\n }\n}\n"],"mappings":";;;;AAKA;;AACA;;AACA;;;;;;AAPA;AACA;AACA;AACA;AAKA,IAAMA,EAAE,GAAGC,EAAE,CAACD,EAAd;AAEAE,MAAM,CAACC,OAAP,GAAiB;EACfC,IAAI,EAAEH,EAAE,CAACI,KAAH,CAASC,QAAT,GAAoB,iBADX;EAGfC,IAAI,EAAE,MAHS;EAKfC,QAAQ,EAAE,CAACR,EAAE,CAACS,KAAH,CAAS,WAAT,CAAD,CALK;EAOf;EACAC,KAAK,EAAE,eAAUC,OAAV,EAAmB;IACxB,IAAMC,CAAC,GAAGX,EAAE,CAACY,OAAH,CAAWC,QAAX,CAAoBH,OAApB,EAA6BI,MAAvC;IACAd,EAAE,CAACe,GAAH,CAAOC,KAAP,CAAa,0BAA0BN,OAA1B,GAAoC,IAApC,GAA2CC,CAAxD;IACA,IAAI,CAACA,CAAL,EAAQ,OAAO,IAAP;IACR,OAAO,KAAKA,CAAL,GAAS,QAAhB;EACD,CAbc;EAefM,MAAM,EAAE,gBAAUP,OAAV,EAAmBQ,OAAnB,EAA4B;IAClC,IAAMC,EAAE,GAAGD,OAAO,CAACE,OAAR,CAAgBC,KAA3B;IACA,IAAMC,GAAG,GAAGJ,OAAO,CAACI,GAApB;;IAEA,IAAMC,OAAO,GAAG,SAASC,QAAT,CAAmBC,OAAnB,EAA4BC,KAA5B,EAAmC;MACjD,IAAMC,GAAG,GAAGL,GAAG,CAACM,aAAJ,CAAkB,GAAlB,CAAZ;MACAD,GAAG,CAACE,YAAJ,CAAiB,OAAjB,EAA0BH,KAAK,IAAI,sCAAnC;MACAI,GAAG,CAACC,WAAJ,CAAgBJ,GAAhB,EAAqBK,WAArB,GAAmCP,OAAnC;MACA,OAAOE,GAAP;IACD,CALD;;IAOA,IAAMH,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|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"global.d.js","names":[],"sources":["../src/global.d.ts"],"sourcesContent":["declare module '*.ttl' {\n const content: string\n export default content\n}\n"],"mappings":""}
|
package/lib/home/homePane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"homePane.js","names":["HomePaneSource","icon","icons","iconBase","global","name","label","render","subject","context","dom","showContent","homePaneContext","div","statusArea","me","appendChild","createElement","textContent","creationDiv","creationContext","login","filterAvailablePanes","session","paneRegistry","list","relevantPanes","create","newThingUI","registrationList","then","authContext","authn","currentUser"],"sources":["../../src/home/homePane.ts"],"sourcesContent":["/* Home Pane\n **\n ** The home pane is avaiable everywhere and allows a user\n ** to\n ** - keep track of their stuff\n ** - make new things, and possibly\n ** - keep track of accounts and workspaces etc\n **\n */\n\nimport { PaneDefinition } from 'pane-registry'\nimport { NamedNode } from 'rdflib'\nimport { authn } from 'solid-logic'\nimport { create, icons, login } from 'solid-ui'\nimport { CreateContext } from 'solid-ui/lib/create/types'\n\nconst HomePaneSource: PaneDefinition = {\n icon: icons.iconBase + 'noun_547570.svg', // noun_25830\n\n global: true,\n\n name: 'home',\n\n // Does the subject deserve an home pane?\n //\n // yes, always!\n //\n label: function () {\n return 'home'\n },\n\n render: function (subject, context) {\n const dom = context.dom\n const showContent = async function () {\n const homePaneContext = { div: div, dom: dom, statusArea: div, me: me }\n /*\n div.appendChild(dom.createElement('h4')).textContent = 'Login status'\n var loginStatusDiv = div.appendChild(context.dom.createElement('div'))\n // TODO: Find out what the actual type is:\n type UriType = unknown;\n loginStatusDiv.appendChild(UI.login.loginStatusBox(context.dom, () => {\n // Here we know new log in status\n }))\n */\n div.appendChild(dom.createElement('h4')).textContent =\n 'Create new thing somewhere'\n const creationDiv = div.appendChild(dom.createElement('div'))\n const creationContext: CreateContext = {\n div: creationDiv,\n dom: dom,\n statusArea: div,\n me: me\n }\n const relevantPanes = await login.filterAvailablePanes(\n context.session.paneRegistry.list\n )\n create.newThingUI(creationContext, context, relevantPanes) // newUI Have to pass panes down\n\n div.appendChild(dom.createElement('h4')).textContent = 'Private things'\n // TODO: Replace by a common, representative interface\n login\n .registrationList(homePaneContext, { private: true })\n .then(function (authContext) {\n div.appendChild(dom.createElement('h4')).textContent = 'Public things'\n div.appendChild(dom.createElement('p')).textContent =\n 'Things in this list are visible to others.'\n login\n .registrationList(authContext, { public: true })\n .then(function () {\n // done\n })\n })\n }\n\n const div = dom.createElement('div')\n const me: NamedNode = authn.currentUser() as NamedNode // this will be incorrect if not logged in\n\n showContent()\n\n return div\n }\n} // pane object\n\n// ends\nexport default HomePaneSource\n"],"mappings":";;;;;;;AAYA;;AACA;;;;;;AAGA,IAAMA,cAA8B,GAAG;EACrCC,IAAI,EAAEC,eAAMC,QAAN,GAAiB,iBADc;EACK;EAE1CC,MAAM,EAAE,IAH6B;EAKrCC,IAAI,EAAE,MAL+B;EAOrC;EACA;EACA;EACA;EACAC,KAAK,EAAE,iBAAY;IACjB,OAAO,MAAP;EACD,CAboC;EAerCC,MAAM,EAAE,gBAAUC,OAAV,EAAmBC,OAAnB,EAA4B;IAClC,IAAMC,GAAG,GAAGD,OAAO,CAACC,GAApB;;IACA,IAAMC,WAAW;MAAA,mEAAG;QAAA;QAAA;UAAA;YAAA;cAAA;gBACZC,eADY,GACM;kBAAEC,GAAG,EAAEA,GAAP;kBAAYH,GAAG,EAAEA,GAAjB;kBAAsBI,UAAU,EAAED,GAAlC;kBAAuCE,EAAE,EAAEA;gBAA3C,CADN;gBAElB;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;gBACMF,GAAG,CAACG,WAAJ,CAAgBN,GAAG,CAACO,aAAJ,CAAkB,IAAlB,CAAhB,EAAyCC,WAAzC,GACE,4BADF;gBAEMC,WAbY,GAaEN,GAAG,CAACG,WAAJ,CAAgBN,GAAG,CAACO,aAAJ,CAAkB,KAAlB,CAAhB,CAbF;gBAcZG,eAdY,GA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ACeb,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"humanReadablePane.js","names":["humanReadablePane","icon","icons","originalIconBase","name","label","subject","context","kb","session","store","allowed","hasContentTypeIn","x","displayables","cts","fetcher","getHeader","j","length","k","indexOf","hasContentTypeIn2","t","findTypeURIs","Util","mediaTypeClass","uri","ns","link","render","myDocument","dom","div","createElement","doc","ct","console","log","setAttribute","element","frame","markdownHtml","webOperation","then","response","markdownText","responseText","lines","Math","min","split","res","marked","parse","innerHTML","_fetch","blob","objectURL","URL","createObjectURL","tr","appendChild"],"sources":["../src/humanReadablePane.js"],"sourcesContent":["/* Human-readable Pane\n **\n ** This outline pane contains the document contents for an HTML document\n ** This is for peeking at a page, because the user might not want to leave the data browser.\n */\nimport { icons, ns } from 'solid-ui'\nimport { Util } from 'rdflib'\nimport { marked } from 'marked'\n\nconst humanReadablePane = {\n icon: icons.originalIconBase + 'tango/22-text-x-generic.png',\n\n name: 'humanReadable',\n\n label: function (subject, context) {\n const kb = context.session.store\n\n // See also the source pane, which has lower precedence.\n\n const allowed = [\n 'text/plain',\n 'text/html',\n 'text/markdown',\n 'application/xhtml+xml',\n 'image/png',\n 'image/jpeg',\n 'application/pdf',\n 'video/mp4'\n ]\n\n const hasContentTypeIn = function (kb, x, displayables) {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data could come from a fetch OR from ldp container\n const hasContentTypeIn2 = function (kb, x, displayables) {\n const t = kb.findTypeURIs(subject)\n for (let k = 0; k < displayables.length; k++) {\n if (Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'view'\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n return 'View'\n }\n\n return null\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0] : null\n if (ct) {\n console.log('humanReadablePane: c-t:' + ct)\n } else {\n console.log('humanReadablePane: unknown content-type?')\n }\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.setAttribute('class', 'docView')\n const element = ct === 'text/markdown' ? 'DIV' : 'IFRAME'\n const frame = myDocument.createElement(element)\n\n // render markdown to html\n const markdownHtml = function () {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const markdownText = response.responseText\n const lines = Math.min(30, markdownText.split(/\\n/).length + 5)\n const res = marked.parse(markdownText)\n frame.innerHTML = res\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)\n })\n }\n\n if (ct === 'text/markdown') {\n markdownHtml()\n } else if (ct !== 'text/html') {\n // get with authenticated fetch\n kb.fetcher._fetch(subject.uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(blob) {\n const objectURL = URL.createObjectURL(blob)\n frame.setAttribute('src', objectURL) // w640 h480 //\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height:120em; width:80em; resize: both; overflow: auto;`)\n })\n } else {\n frame.setAttribute('src', subject.uri) // allow-same-origin\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', 'resize = both; height:120em; width:80em;')\n }\n // @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n // You can't have any sandbox and allow plugins.\n // We could sandbox only HTML files I suppose.\n // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html\n\n // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static\n\n // iframe.setAttribute('height', '480')\n // iframe.setAttribute('width', '640')\n const tr = myDocument.createElement('TR')\n tr.appendChild(frame)\n div.appendChild(tr)\n return div\n }\n}\n\nexport default humanReadablePane\n// ends\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAPA;AACA;AACA;AACA;AACA;AAKA,IAAMA,iBAAiB,GAAG;EACxBC,IAAI,EAAEC,eAAMC,gBAAN,GAAyB,6BADP;EAGxBC,IAAI,EAAE,eAHkB;EAKxBC,KAAK,EAAE,eAAUC,OAAV,EAAmBC,OAAnB,EAA4B;IACjC,IAAMC,EAAE,GAAGD,OAAO,CAACE,OAAR,CAAgBC,KAA3B,CADiC,CAGjC;;IAEA,IAAMC,OAAO,GAAG,CACd,YADc,EAEd,WAFc,EAGd,eAHc,EAId,uBAJc,EAKd,WALc,EAMd,YANc,EAOd,iBAPc,EAQd,WARc,CAAhB;;IAWA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAAUJ,EAAV,EAAcK,CAAd,EAAiBC,YAAjB,EAA+B;MACtD,IAAMC,GAAG,GAAGP,EAAE,CAACQ,OAAH,CAAWC,SAAX,CAAqBJ,CAArB,EAAwB,cAAxB,CAAZ;;MACA,IAAIE,GAAJ,EAAS;QACP,KAAK,IAAIG,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,GAAG,CAACI,MAAxB,EAAgCD,CAAC,EAAjC,EAAqC;UACnC,KAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGN,YAAY,CAACK,MAAjC,EAAyCC,CAAC,EAA1C,EAA8C;YAC5C,IAAIL,GAAG,CAACG,CAAD,CAAH,CAAOG,OAAP,CAAeP,YAAY,CAACM,CAAD,CAA3B,KAAmC,CAAvC,EAA0C;cACxC,OAAO,IAAP;YACD;UACF;QACF;MACF;;MACD,OAAO,KAAP;IACD,CAZD,CAhBiC,CA8BjC;;;IACA,IAAME,iBA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AAP;MACD,CAHH,EAIGb,IAJH,CAIQ,UAASa,IAAT,EAAe;QACnB,IAAMC,SAAS,GAAGC,GAAG,CAACC,eAAJ,CAAoBH,IAApB,CAAlB;QACAhB,KAAK,CAACF,YAAN,CAAmB,KAAnB,EAA0BmB,SAA1B,EAFmB,CAEkB;;QACrCjB,KAAK,CAACF,YAAN,CAAmB,OAAnB,EAA4B,KAA5B;QACAE,KAAK,CAACF,YAAN,CAAmB,OAAnB;MACD,CATH;IAUD,CAZM,MAYA;MACLE,KAAK,CAACF,YAAN,CAAmB,KAAnB,EAA0BjC,OAAO,CAACqB,GAAlC,EADK,CACkC;;MACvCc,KAAK,CAACF,YAAN,CAAmB,OAAnB,EAA4B,KAA5B;MACAE,KAAK,CAACF,YAAN,CAAmB,OAAnB,EAA4B,0CAA5B;IACD,CAhDiC,CAiDlC;IACA;IACA;IACA;IACA;IAEA;IAEA;IACA;;;IACA,IAAMsB,EAAE,GAAG9B,UAAU,CAACG,aAAX,CAAyB,IAAzB,CAAX;IACA2B,EAAE,CAACC,WAAH,CAAerB,KAAf;IACAR,GAAG,CAAC6B,WAAJ,CAAgBD,EAAhB;IACA,OAAO5B,GAAP;EACD;AA5HuB,CAA1B;eA+HejC,iB,EACf"}
|
package/lib/imagePane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"imagePane.js","names":["UI","require","module","exports","icon","icons","originalIconBase","name","label","subject","context","store","session","anyStatementMatching","ns","rdf","sym","contentTypeMatch","x","contentTypes","cts","fetcher","getHeader","j","length","k","indexOf","suppressed","render","myDocument","dom","div","createElement","setAttribute","img","_fetch","uri","then","response","blob","myBlob","objectURL","URL","createObjectURL","tr","appendChild"],"sources":["../src/imagePane.js"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nconst UI = require('solid-ui')\n\nmodule.exports = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject, context) {\n const store = context.session.store\n if (\n !store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n )\n ) {\n // NB: Not dc: namespace!\n return null\n }\n\n // See also the source pane, which has lower precedence.\n\n const contentTypeMatch = function (store, x, contentTypes) {\n const cts = store.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < contentTypes.length; k++) {\n if (cts[j].indexOf(contentTypes[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n const suppressed = ['application/pdf']\n if (contentTypeMatch(store, subject, suppressed)) {\n return null\n }\n return 'view'\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const store = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'imageView')\n const img = myDocument.createElement('IMG')\n\n // get image with authenticated fetch\n store.fetcher._fetch(subject.uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL) // w640 h480 //\n })\n\n img.setAttribute('style', 'max-width: 100%; max-height: 100%;')\n // div.style['max-width'] = '640'\n // div.style['max-height'] = '480'\n const tr = myDocument.createElement('TR') // why need tr?\n tr.appendChild(img)\n div.appendChild(tr)\n return div\n }\n}\n\n// ends\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,IAAMA,EAAE,GAAGC,OAAO,CAAC,UAAD,CAAlB;;AAEAC,MAAM,CAACC,OAAP,GAAiB;EACfC,IAAI,EAAEJ,EAAE,CAACK,KAAH,CAASC,gBAAT,GAA4B,8BADnB;EAGfC,IAAI,EAAE,OAHS;EAKfC,KAAK,EAAE,eAAUC,OAAV,EAAmBC,OAAnB,EAA4B;IACjC,IAAMC,KAAK,GAAGD,OAAO,CAACE,OAAR,CAAgBD,KAA9B;;IACA,IACE,CAACA,KAAK,CAACE,oBAAN,CACCJ,OADD,EAECT,EAAE,CAACc,EAAH,CAA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AX,CAAyB,KAAzB,CAAZ,CALkC,CAOlC;;IACArB,KAAK,CAACU,OAAN,CAAcc,MAAd,CAAqB1B,OAAO,CAAC2B,GAA7B,EACGC,IADH,CACQ,UAASC,QAAT,EAAmB;MACvB,OAAOA,QAAQ,CAACC,IAAT,EAAP;IACD,CAHH,EAIGF,IAJH,CAIQ,UAASG,MAAT,EAAiB;MACrB,IAAMC,SAAS,GAAGC,GAAG,CAACC,eAAJ,CAAoBH,MAApB,CAAlB;MACAN,GAAG,CAACD,YAAJ,CAAiB,KAAjB,EAAwBQ,SAAxB,EAFqB,CAEc;IACpC,CAPH;;IASAP,GAAG,CAACD,YAAJ,CAAiB,OAAjB,EAA0B,oCAA1B,EAjBkC,CAkBlC;IACA;;IACA,IAAMW,EAAE,GAAGf,UAAU,CAACG,aAAX,CAAyB,IAAzB,CAAX,CApBkC,CAoBQ;;IAC1CY,EAAE,CAACC,WAAH,CAAeX,GAAf;IACAH,GAAG,CAACc,WAAJ,CAAgBD,EAAhB;IACA,OAAOb,GAAP;EACD;AAjEc,CAAjB,C,CAoEA"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["getOutliner","dom","outlineManager","context","list","paneForIcon","paneForPredicate","register","byName","store","solidLogicSingleton","OutlineManager","window","document","cjsOrEsModule","panes"],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport registerPanes from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport initMainPage from './mainPage'\n\nfunction getOutliner (dom) {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton\n )\n dom.outlineManager = new OutlineManager(context)\n }\n return dom.outlineManager\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n UI,\n versionInfo,\n initMainPage,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;;AACA;;;;AAEA;;AACA;;AACA;;AACA;;AAOA;;AACA;;;;;;;;AA1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA,SAASA,WAAT,CAAsBC,GAAtB,EAA2B;EACzB,IAAI,CAACA,GAAG,CAACC,cAAT,EAAyB;IACvB,IAAMC,OAAO,GAAG,4BACdF,GADc,EAEd;MAAEG,IAAI,EAAJA,kBAAF;MAAQC,WAAW,EAAXA,yBAAR;MAAqBC,gBAAgB,EAAhBA,8BAArB;MAAuCC,QAAQ,EAARA,sBAAvC;MAAiDC,MAAM,EAANA;IAAjD,CAFc,EAGRC,iBAHQ,EAIRC,+BAJQ,CAAhB;IAMAT,GAAG,CAACC,cAAJ,GAAqB,IAAIS,mBAAJ,CAAmBR,OAAnB,CAArB;EACD;;EACD,OAAOF,GAAG,CAACC,cAAX;AACD;;AAED,IAAI,OAAOU,MAAP,KAAkB,WAAtB,EAAmC;EACjCZ,WAAW,CAACY,MAAM,CAACC,QAAR,CAAX;AACD;;AAED,+BAAc,UAACC,aAAD;EAAA,OAAwB,4BAASA,aAAa,WAAb,IAAyBA,aAAlC,CAAxB;AAAA,CAAd,E,CAEA;AACA;AACA;AACA;;AAeA;AACA,IAAI,OAAOF,MAAP,KAAkB,WAAtB,EAAmC;EACjC;EAAOA,MAAN,CAAcG,KAAd,GAAsB;IACrBf,WAAW,EAAXA;EADqB,CAAtB;AAGF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/internalPane.ts"],"names":["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","err","str","Error","alert","isDocument","includes","controls","appendChild","style","width","margin","controlRow","deleteCell","isFolder","endsWith","noun","isProtectedUri","deleteButton","widgets","deleteButtonWithCheck","confirm","promise","refreshCell","refreshButton","button","iconBase","addEventListener","refresh","ok","errm","plist","statementsMatching","docURI","push","appNode","indexOf","split","updater","ed","editable","toString","outliner","getOutliner","appendPropertyTRs","classes","siteUri","site"],"mappings":";;;;;;;AAOA;;AACA;;AARA;AACA;AACA;AACA;AACA;;AACA;AAMA,IAAMA,IAAoB,GAAG;AAC3BC,EAAAA,IAAI,EAAEC,eAAMC,gBAAN,GAAyB,4BADJ;AAG3BC,EAAAA,IAAI,EAAE,UAHqB;AAK3BC,EAAAA,KAAK,EAAE,iBAAY;AACjB,WAAO,gBAAP,CADiB,CACO;AACzB,GAP0B;AAS3BC,EAAAA,MAAM,EAAE,gBAAUC,OAAV,EAA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uC,CAT7B;AASgC;AAC1C,gDAA4C,CAVlC;AAWV,yCAAqC,CAX3B;AAYV,oDAAgD,CAZtC;AAaV,sCAAkC;AAbxB,GApNe;AAoO3BwE,EAAAA,OAAO,EAAE;AACP;AACA,qDAAiD;AAF1C;AApOkB,CAA7B;;AA0OA,SAAS5B,cAAT,CAAyB1D,OAAzB,EAAsD;AACpD;AACA,MAAMuF,OAAO,GAAGvF,OAAO,CAACwF,IAAR,GAAezE,GAA/B;AACA,SACEf,OAAO,CAACe,GAAR,KAAgBwE,OAAhB,IACAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,UAD1B,IAEAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,cAF1B,IAGAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,WAH1B,IAIAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,oBAJ1B,IAKAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,+BAL1B,IAMAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,8BAN1B,IAOAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,yBAR5B;AAUD;;eAEc9F,I,EAEf","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"],"file":"internalPane.js"}
|
|
1
|
+
{"version":3,"file":"internalPane.js","names":["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","err","str","Error","alert","isDocument","includes","controls","appendChild","style","width","margin","controlRow","deleteCell","isFolder","endsWith","noun","isProtectedUri","deleteButton","widgets","deleteButtonWithCheck","confirm","promise","refreshCell","refreshButton","button","iconBase","addEventListener","refresh","ok","errm","plist","statementsMatching","docURI","push","appNode","indexOf","split","updater","ed","editable","toString","outliner","getOutliner","appendPropertyTRs","classes","siteUri","site"],"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;;AACA;;AARA;AACA;AACA;AACA;AACA;;AACA;AAMA,IAAMA,IAAoB,GAAG;EAC3BC,IAAI,EAAEC,eAAMC,gBAAN,GAAyB,4BADJ;EAG3BC,IAAI,EAAE,UAHqB;EAK3BC,KAAK,EAAE,iBAAY;IACjB,OAAO,gBAAP,CADiB,CACO;EACzB,CAP0B;EAS3BC,MAAM,EAAE,gBAAUC,OAAV,EAAmBC,OAAnB,EAA4B;IAClC,IAAMC,GAAG,GAAGD,OAAO,CAACC,GAApB;IACA,IAAMC,KAAK,GAAGF,OAAO,CAACG,OAAR,CAAgBD,KAA9B;IACA,IAAME,gBAAgB,GAAGF,KAAK,CAACG,KAAN,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1B,IAIAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,oBAJ1B,IAKAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,+BAL1B,IAMAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,8BAN1B,IAOAvF,OAAO,CAACe,GAAR,KAAgBwE,OAAO,GAAG,yBAR5B;AAUD;;eAEc9F,I,EAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"footer.js","names":["SOLID_PROJECT_URL","SOLID_PROJECT_NAME","createFooter","store","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;;AAEA;AACA;AACA;AACA,IAAMA,iBAAiB,GAAG,0BAA1B;AACA,IAAMC,kBAAkB,GAAG,kBAA3B;;AAEO,SAASC,YAAT,CAAuBC,KAAvB,EAAyC;EAC9C,yBAAWA,KAAX,EAAkBC,gBAAgB,EAAlC;AACD;;AAED,SAASA,gBAAT,GAA6B;EAC3B,OAAO;IACLC,eAAe,EAAEL,iBADZ;IAELM,gBAAgB,EAAEL;EAFb,CAAP;AAID"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"header.js","names":["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","getMenuItems","concat","push","GotoSubject","authn","currentUser","undefined","location","reload","getDashboardItems","items","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/**\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: helpMenuList }\n\n return headerOptions\n}\n\nasync function setUserMenu (outliner: any) {\n const showProfile = {\n label: SHOW_YOUR_PROFILE_MENU_ITEM,\n onclick: () => openUserProfile(outliner)\n }\n\n const logOut = {\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 = [showProfile]\n userMenuList = userMenuList.concat(await getMenuItems(outliner))\n userMenuList.push(logOut)\n\n return userMenuList\n}\n\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;;AACA;;;;;;AACA;AACA;AACA;AACA,IAAMA,cAAc,GAAGC,eAAMC,QAAN,GAAiB,eAAxC;AACA,IAAMC,cAAc,GAAG,sDAAvB;AAEA;AACA;AACA;;AACA,IAAMC,oBAAoB,GAAG,YAA7B;AACA,IAAMC,0BAA0B,GAAG,kBAAnC;AACA,IAAMC,2BAA2B,GAAG,mBAApC;AACA,IAAMC,iBAAiB,GAAG,SAA1B;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,sCAA5B;AACA,IAAMC,yBAAyB,GAAG,2CAAlC;;SAEsBC,Y;;;;;0EAAf,iBAA6BC,KAA7B,EAAoCC,QAApC;IAAA;MAAA;QAAA;UAAA;YAAA,cACLC,mBADK;YAAA,cACMF,KADN;YAAA;YAAA,OACmBG,WAAW,CAACF,QAAD,CAD9B;;UAAA;YAAA;YAAA,cAC0CG,gBAAgB,EAD1D;YAAA;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;AAIP,SAASA,gBAAT,GAA6B;EAC3B,IAAMC,YAAY,GAAG,CACnB;IAAEC,KAAK,EAAEb,oBAAT;IAA+Bc,GAAG,EAAEV,mBAApC;IAAyDW,MAAM,EAAE;EAAjE,CADmB,EAEnB;IAAEF,KAAK,EAAEZ,0BAAT;IAAqCa,GAAG,EAAET,yBAA1C;IAAqEU,MAAM,EAAE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B,QAAD,EAAW8B,OAAO,CAACE,OAAR,IAAmBF,OAAO,CAACG,QAAtC,CAAvB;gBAAA;cAFJ,CAAP;YAID,CALM,CAFT;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;SAUeF,iB;;;;;+EAAf,kBAAkC/B,QAAlC,EAAiDkC,IAAjD;IAAA;MAAA;QAAA;UAAA;YACElC,QAAQ,CAACmC,aAAT,CAAuB;cACrBD,IAAI,EAAJA;YADqB,CAAvB;;UADF;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["initMainPage","store","uri","outliner","document","window","location","href","subject","sym","GotoSubject","undefined","header","footer","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;;AACA;;AACA;;;;;;SAE8BA,Y;;;;;0EAAf,iBAA6BC,KAA7B,EAA+CC,GAA/C;IAAA;IAAA;MAAA;QAAA;UAAA;YACPC,QADO,GACI,wBAAYC,QAAZ,CADJ;YAEbF,GAAG,GAAGA,GAAG,IAAIG,MAAM,CAACC,QAAP,CAAgBC,IAA7B;YACIC,OAHS,GAGCN,GAHD;YAIb,IAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6BM,OAAO,GAAGP,KAAK,CAACQ,GAAN,CAAUP,GAAV,CAAV;YAC7BC,QAAQ,CAACO,WAAT,CAAqBF,OAArB,EAA8B,IAA9B,EAAoCG,SAApC,EAA+C,IAA/C,EAAqDA,SAArD;YALa;YAAA,OAMQ,0BAAaV,KAAb,EAAoBE,QAApB,CANR;;UAAA;YAMPS,MANO;YAOPC,MAPO,GAOE,0BAAaZ,KAAb,CAPF;YAAA,iCAQNa,OAAO,CAACC,GAAR,CAAY,CAACH,MAAD,EAASC,MAAT,CAAZ,CARM;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
|