solid-panes 3.6.1 → 3.6.2-352b1a3d

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 (42) hide show
  1. package/coverage/clover.xml +152 -0
  2. package/coverage/coverage-final.json +6 -0
  3. package/coverage/lcov-report/base.css +224 -0
  4. package/coverage/lcov-report/block-navigation.js +87 -0
  5. package/coverage/lcov-report/favicon.png +0 -0
  6. package/coverage/lcov-report/index.html +131 -0
  7. package/coverage/lcov-report/outline/index.html +161 -0
  8. package/coverage/lcov-report/outline/outlineIcons.js.html +565 -0
  9. package/coverage/lcov-report/outline/propertyViews.ts.html +196 -0
  10. package/coverage/lcov-report/outline/viewAsImage.ts.html +121 -0
  11. package/coverage/lcov-report/outline/viewAsMbox.ts.html +127 -0
  12. package/coverage/lcov-report/prettify.css +1 -0
  13. package/coverage/lcov-report/prettify.js +2 -0
  14. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  15. package/coverage/lcov-report/sorter.js +196 -0
  16. package/coverage/lcov-report/trustedApplications/index.html +116 -0
  17. package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +238 -0
  18. package/coverage/lcov.info +202 -0
  19. package/eslint.config.mjs +34 -0
  20. package/lib/dataContentPane.js +1 -0
  21. package/lib/dataContentPane.js.map +1 -1
  22. package/lib/dokieli/dokieliPane.js +46 -19
  23. package/lib/dokieli/dokieliPane.js.map +1 -1
  24. package/lib/humanReadablePane.js +39 -26
  25. package/lib/humanReadablePane.js.map +1 -1
  26. package/lib/trustedApplications/trustedApplications.utils.js +1 -1
  27. package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
  28. package/lib/versionInfo.js +20 -20
  29. package/lib/versionInfo.js.map +1 -1
  30. package/package.json +33 -32
  31. package/src/dashboard/languages/get-language-names.sh +0 -0
  32. package/src/dataContentPane.js +2 -1
  33. package/src/dokieli/dokieliPane.js +41 -19
  34. package/src/humanReadablePane.js +36 -26
  35. package/src/trustedApplications/trustedApplications.utils.ts +1 -1
  36. package/src/versionInfo.ts +20 -20
  37. package/timestamp.sh +0 -0
  38. package/.babelrc +0 -16
  39. package/.eslintignore +0 -3
  40. package/.eslintrc +0 -26
  41. package/.github/workflows/ci.yml +0 -82
  42. package/.nvmrc +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"humanReadablePane.js","names":["_solidUi","require","_rdflib","_marked","DOMPurify","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","humanReadablePane","icon","icons","originalIconBase","name","label","subject","context","kb","session","store","allowed","hasContentTypeIn","x","displayables","cts","fetcher","getHeader","j","length","k","indexOf","hasContentTypeIn2","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","clean","sanitize","innerHTML","concat","_fetch","blob","objectURL","URL","createObjectURL","tr","appendChild","_default","exports"],"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'\nimport * as DOMPurify from 'dompurify'\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 const clean = DOMPurify.sanitize(res)\n frame.innerHTML = clean\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,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAAsC,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,M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8CV,KAAK,oDAAiD,CAAC;MACjI,CAAC,CAAC;IACJ,CAAC;IAED,IAAIZ,EAAE,KAAK,eAAe,EAAE;MAC1BM,YAAY,CAAC,CAAC;IAChB,CAAC,MAAM,IAAIN,EAAE,KAAK,WAAW,EAAE;MAC7B;MACA3B,EAAE,CAACQ,OAAO,CAAC0C,MAAM,CAACpD,OAAO,CAACoB,GAAG,CAAC,CAC3BiB,IAAI,CAAC,UAASC,QAAQ,EAAE;QACvB,OAAOA,QAAQ,CAACe,IAAI,CAAC,CAAC;MACxB,CAAC,CAAC,CACDhB,IAAI,CAAC,UAASgB,IAAI,EAAE;QACnB,IAAMC,SAAS,GAAGC,GAAG,CAACC,eAAe,CAACH,IAAI,CAAC;QAC3CnB,KAAK,CAACF,YAAY,CAAC,KAAK,EAAEsB,SAAS,CAAC,EAAC;QACrCpB,KAAK,CAACF,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC;QAClCE,KAAK,CAACF,YAAY,CAAC,OAAO,4FAA4F,CAAC;MACzH,CAAC,CAAC;IACN,CAAC,MAAM;MACLE,KAAK,CAACF,YAAY,CAAC,KAAK,EAAEhC,OAAO,CAACoB,GAAG,CAAC,EAAC;MACvCc,KAAK,CAACF,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC;MAClCE,KAAK,CAACF,YAAY,CAAC,OAAO,EAAE,0CAA0C,CAAC;IACzE;IACA;IACA;IACA;IACA;IACA;;IAEA;;IAEA;IACA;IACA,IAAMyB,EAAE,GAAGjC,UAAU,CAACG,aAAa,CAAC,IAAI,CAAC;IACzC8B,EAAE,CAACC,WAAW,CAACxB,KAAK,CAAC;IACrBR,GAAG,CAACgC,WAAW,CAACD,EAAE,CAAC;IACnB,OAAO/B,GAAG;EACZ;AACF,CAAC;AAAA,IAAAiC,QAAA,GAAAC,OAAA,cAEclE,iBAAiB,EAChC","ignoreList":[]}
1
+ {"version":3,"file":"humanReadablePane.js","names":["_solidUi","require","_rdflib","_marked","_dompurify","_interopRequireDefault","e","__esModule","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","split","trim","console","log","setAttribute","element","frame","setIframeAttributes","blob","lines","URL","createObjectURL","type","concat","markdownHtml","webOperation","then","response","markdownText","responseText","Math","min","res","marked","parse","clean","DOMPurify","sanitize","innerHTML","error","_fetch","blobTextPromise","startsWith","text","Promise","resolve","blobText","_ref","newLines","includes","err","tr","appendChild","_default","exports"],"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'\nimport DOMPurify from 'dompurify';\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].split(';', 1)[0].trim() : null // remove content-type parameters\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 const setIframeAttributes = (frame, blob, lines) => {\n frame.setAttribute('src', URL.createObjectURL(blob));\n frame.setAttribute('type', blob.type);\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 // Apply sandbox attribute only for HTML files\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 if (blob.type === 'text/html' || blob.type === 'application/xhtml+xml') {\n frame.setAttribute('sandbox', 'allow-scripts allow-same-origin');\n }\n };\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 const clean = DOMPurify.sanitize(res)\n frame.innerHTML = clean\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)\n }).catch(error => {\n console.error('Error fetching markdown content:', error)\n frame.innerHTML = '<p>Error loading content</p>'\n })\n }\n\n if (ct === 'text/markdown') {\n markdownHtml()\n } else {\n // Fetch and process the blob\n kb.fetcher._fetch(subject.uri)\n .then(response => response.blob())\n .then(blob => {\n const blobTextPromise = blob.type.startsWith('text') ? blob.text() : Promise.resolve('')\n return blobTextPromise.then(blobText => ({ blob, blobText }))\n })\n .then(({ blob, blobText }) => {\n const newLines = blobText.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ? -10 : 5\n const lines = Math.min(30, blobText.split(/\\n/).length + newLines)\n setIframeAttributes(frame, blob, lines)\n })\n .catch(err => {\n console.log('Error fetching or processing blob:', err)\n })\n }\n\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,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAkC,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AARlC;AACA;AACA;AACA;AACA;;AAMA,IAAME,iBAAiB,GAAG;EACxBC,IAAI,EAAEC,cAAK,CAACC,gBAAgB,GAAG,6BAA6B;EAE5DC,IAAI,EAAE,eAAe;EAErBC,KAAK,EAAE,SAAPA,KAAKA,CAAYC,OAAO,EAAEC,OAAO,EAAE;IACjC,IAAMC,EAAE,GAAGD,OAAO,CAACE,OAAO,CAACC,KAAK;;IAEhC;;IAEA,IAAMC,OAAO,GAAG,CACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,WAAW,CACZ;IAED,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAaJ,EAAE,EAAEK,CAAC,EAAEC,YAAY,EAAE;MACtD,IAAMC,GAAG,GAAGP,EAAE,CAACQ,OAA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cAEcjF,iBAAiB,EAChC","ignoreList":[]}
@@ -21,7 +21,7 @@ function getStatementsToDelete(origin, person, kb, ns) {
21
21
  return statementsToDelete;
22
22
  }
23
23
  function getStatementsToAdd(origin, nodeName, modes, person, ns) {
24
- var application = new _rdflib.BlankNode("bn_".concat(nodeName));
24
+ var application = new _rdflib.BlankNode("bn_".concat(nodeName)); // NamedNode(`${person.doc().uri}#${nodeName}`)
25
25
  return [(0, _rdflib.st)(person, ns.acl('trustedApp'), application, person.doc()), (0, _rdflib.st)(application, ns.acl('origin'), origin, person.doc())].concat(_toConsumableArray(modes.map(function (mode) {
26
26
  return (0, _rdflib.sym)(mode);
27
27
  }).map(function (mode) {
@@ -1 +1 @@
1
- {"version":3,"file":"trustedApplications.utils.js","names":["_rdflib","require","_toConsumableArray","r","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","Symbol","iterator","isArray","length","e","n","getStatementsToDelete","origin","person","kb","ns","applicationStatements","statementsMatching","acl","statementsToDelete","reduce","memo","st","concat","subject","getStatementsToAdd","nodeName","modes","application","BlankNode","doc","map","mode","sym","generateRandomString","Math","random","substr"],"sources":["../../src/trustedApplications/trustedApplications.utils.ts"],"sourcesContent":["import { BlankNode, IndexedFormula, NamedNode, st, Literal, sym, Statement } from 'rdflib'\nimport { Namespaces } from 'solid-namespace'\n\nexport function getStatementsToDelete (\n origin: NamedNode | Literal,\n person: NamedNode,\n kb: IndexedFormula,\n ns: Namespaces\n): any {\n const applicationStatements = kb.statementsMatching(\n null,\n ns.acl('origin'),\n origin\n )\n const statementsToDelete = applicationStatements.reduce(\n (memo, st) => {\n return memo\n .concat(\n kb.statementsMatching(\n person,\n ns.acl('trustedApp'),\n st.subject as NamedNode\n )\n )\n .concat(kb.statementsMatching(st.subject))\n },\n [] as Array<Statement>\n )\n return statementsToDelete\n}\n\nexport function getStatementsToAdd (\n origin: NamedNode,\n nodeName: string,\n modes: string[],\n person: NamedNode,\n ns: Namespaces\n): any {\n const application = new BlankNode(`bn_${nodeName}`)\n return [\n st(person, ns.acl('trustedApp'), application, person.doc()),\n st(application, ns.acl('origin'), origin, person.doc()),\n ...modes\n .map(mode => sym(mode))\n .map(mode => st(application, ns.acl('mode'), mode, person.doc()))\n ]\n}\n\nexport function generateRandomString () {\n return Math.random().toString(36).substr(2, 5)\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAA0F,SAAAC,mBAAAC,CAAA,WAAAC,kBAAA,CAAAD,CAAA,KAAAE,gBAAA,CAAAF,CAAA,KAAAG,2BAAA,CAAAH,CAAA,KAAAI,kBAAA;AAAA,SAAAA,mBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA,2BAAAA,CAAA,SAAAO,iBAAA,CAAAP,CAAA,EAAAM,CAAA,OAAAE,CAAA,MAAAC,QAAA,CAAAC,IAAA,CAAAV,CAAA,EAAAW,KAAA,6BAAAH,CAAA,IAAAR,CAAA,CAAAY,WAAA,KAAAJ,CAAA,GAAAR,CAAA,CAAAY,WAAA,CAAAC,IAAA,aAAAL,CAAA,cAAAA,CAAA,GAAAM,KAAA,CAAAC,IAAA,CAAAf,CAAA,oBAAAQ,CAAA,+CAAAQ,IAAA,CAAAR,CAAA,IAAAD,iBAAA,CAAAP,CAAA,EAAAM,CAAA;AAAA,SAAAJ,iBAAAF,CAAA,8BAAAiB,MAAA,YAAAjB,CAAA,CAAAiB,MAAA,CAAAC,QAAA,aAAAlB,CAAA,uBAAAc,KAAA,CAAAC,IAAA,CAAAf,CAAA;AAAA,SAAAC,mBAAAD,CAAA,QAAAc,KAAA,CAAAK,OAAA,CAAAnB,CAAA,UAAAO,iBAAA,CAAAP,CAAA;AAAA,SAAAO,kBAAAP,CAAA,EAAAM,CAAA,aAAAA,CAAA,IAAAA,CAAA,GAAAN,CAAA,CAAAoB,MAAA,MAAAd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C,kBAAA,CACpDwC,KAAK,CACLI,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAI,IAAAC,WAAG,EAACD,IAAI,CAAC;EAAA,EAAC,CACtBD,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAI,IAAAV,UAAE,EAACM,WAAW,EAAEb,EAAE,CAACG,GAAG,CAAC,MAAM,CAAC,EAAEc,IAAI,EAAEnB,MAAM,CAACiB,GAAG,CAAC,CAAC,CAAC;EAAA,EAAC;AAEvE;AAEO,SAASI,oBAAoBA,CAAA,EAAI;EACtC,OAAOC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACvC,QAAQ,CAAC,EAAE,CAAC,CAACwC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AAChD","ignoreList":[]}
1
+ {"version":3,"file":"trustedApplications.utils.js","names":["_rdflib","require","_toConsumableArray","r","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","Symbol","iterator","isArray","length","e","n","getStatementsToDelete","origin","person","kb","ns","applicationStatements","statementsMatching","acl","statementsToDelete","reduce","memo","st","concat","subject","getStatementsToAdd","nodeName","modes","application","BlankNode","doc","map","mode","sym","generateRandomString","Math","random","substr"],"sources":["../../src/trustedApplications/trustedApplications.utils.ts"],"sourcesContent":["import { BlankNode, IndexedFormula, NamedNode, st, Literal, sym, Statement } from 'rdflib'\nimport { Namespaces } from 'solid-namespace'\n\nexport function getStatementsToDelete (\n origin: NamedNode | Literal,\n person: NamedNode,\n kb: IndexedFormula,\n ns: Namespaces\n): any {\n const applicationStatements = kb.statementsMatching(\n null,\n ns.acl('origin'),\n origin\n )\n const statementsToDelete = applicationStatements.reduce(\n (memo, st) => {\n return memo\n .concat(\n kb.statementsMatching(\n person,\n ns.acl('trustedApp'),\n st.subject as NamedNode\n )\n )\n .concat(kb.statementsMatching(st.subject))\n },\n [] as Array<Statement>\n )\n return statementsToDelete\n}\n\nexport function getStatementsToAdd (\n origin: NamedNode,\n nodeName: string,\n modes: string[],\n person: NamedNode,\n ns: Namespaces\n): any {\n const application = new BlankNode(`bn_${nodeName}`) // NamedNode(`${person.doc().uri}#${nodeName}`)\n return [\n st(person, ns.acl('trustedApp'), application, person.doc()),\n st(application, ns.acl('origin'), origin, person.doc()),\n ...modes\n .map(mode => sym(mode))\n .map(mode => st(application, ns.acl('mode'), mode, person.doc()))\n ]\n}\n\nexport function generateRandomString () {\n return Math.random().toString(36).substr(2, 5)\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAA0F,SAAAC,mBAAAC,CAAA,WAAAC,kBAAA,CAAAD,CAAA,KAAAE,gBAAA,CAAAF,CAAA,KAAAG,2BAAA,CAAAH,CAAA,KAAAI,kBAAA;AAAA,SAAAA,mBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA,2BAAAA,CAAA,SAAAO,iBAAA,CAAAP,CAAA,EAAAM,CAAA,OAAAE,CAAA,MAAAC,QAAA,CAAAC,IAAA,CAAAV,CAAA,EAAAW,KAAA,6BAAAH,CAAA,IAAAR,CAAA,CAAAY,WAAA,KAAAJ,CAAA,GAAAR,CAAA,CAAAY,WAAA,CAAAC,IAAA,aAAAL,CAAA,cAAAA,CAAA,GAAAM,KAAA,CAAAC,IAAA,CAAAf,CAAA,oBAAAQ,CAAA,+CAAAQ,IAAA,CAAAR,CAAA,IAAAD,iBAAA,CAAAP,CAAA,EAAAM,CAAA;AAAA,SAAAJ,iBAAAF,CAAA,8BAAAiB,MAAA,YAAAjB,CAAA,CAAAiB,MAAA,CAAAC,QAAA,aAAAlB,CAAA,uBAAAc,KAAA,CAAAC,IAAA,CAAAf,CAAA;AAAA,SAAAC,mBAAAD,CAAA,QAAAc,KAAA,CAAAK,OAAA,CAAAnB,CAAA,UAAAO,iBAAA,CAAAP,CAAA;AAAA,SAAAO,kBAAAP,CAAA,EAAAM,CA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,MAAM,EAAEC,MAAM,CAACiB,GAAG,CAAC,CAAC,CAAC,EAAAP,MAAA,CAAApC,kBAAA,CACpDwC,KAAK,CACLI,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAI,IAAAC,WAAG,EAACD,IAAI,CAAC;EAAA,EAAC,CACtBD,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAI,IAAAV,UAAE,EAACM,WAAW,EAAEb,EAAE,CAACG,GAAG,CAAC,MAAM,CAAC,EAAEc,IAAI,EAAEnB,MAAM,CAACiB,GAAG,CAAC,CAAC,CAAC;EAAA,EAAC;AAEvE;AAEO,SAASI,oBAAoBA,CAAA,EAAI;EACtC,OAAOC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACvC,QAAQ,CAAC,EAAE,CAAC,CAACwC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AAChD","ignoreList":[]}
@@ -5,35 +5,35 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = exports["default"] = {
8
- buildTime: "2024-11-22T21:37:03Z",
9
- commit: "112e11763714ff32a6e8446a02d60de1460e7a09",
8
+ buildTime: "2025-02-13T18:56:08Z",
9
+ commit: "352b1a3d67ab7f41752a2e2508bdde2ef7f8705e",
10
10
  npmInfo: {
11
- 'solid-panes': '3.6.1',
11
+ 'solid-panes': '3.6.2',
12
12
  npm: '8.19.4',
13
- node: '20.18.0',
14
- acorn: '8.12.1',
15
- ada: '2.9.0',
16
- ares: '1.33.1',
13
+ node: '18.20.6',
14
+ acorn: '8.13.0',
15
+ ada: '2.8.0',
16
+ ares: '1.29.0',
17
17
  base64: '0.5.2',
18
18
  brotli: '1.1.0',
19
- cjs_module_lexer: '1.4.1',
20
- cldr: '45.0',
21
- icu: '75.1',
22
- llhttp: '8.1.2',
23
- modules: '115',
19
+ cjs_module_lexer: '1.2.2',
20
+ cldr: '44.1',
21
+ icu: '74.2',
22
+ llhttp: '6.1.1',
23
+ modules: '108',
24
24
  napi: '9',
25
25
  nghttp2: '1.61.0',
26
26
  nghttp3: '0.7.0',
27
- ngtcp2: '1.1.0',
28
- openssl: '3.0.13+quic',
29
- simdutf: '5.5.0',
27
+ ngtcp2: '1.3.0',
28
+ openssl: '3.0.15+quic',
29
+ simdutf: '5.6.0',
30
30
  tz: '2024a',
31
- undici: '6.19.8',
31
+ undici: '5.28.5',
32
32
  unicode: '15.1',
33
- uv: '1.46.0',
34
- uvwasi: '0.0.21',
35
- v8: '11.3.244.8-node.23',
36
- zlib: '1.3.0.1-motley-71660e1'
33
+ uv: '1.44.2',
34
+ uvwasi: '0.0.19',
35
+ v8: '10.2.154.26-node.37',
36
+ zlib: '1.3.0.1-motley'
37
37
  }
38
38
  };
39
39
  //# sourceMappingURL=versionInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"versionInfo.js","names":["buildTime","commit","npmInfo","npm","node","acorn","ada","ares","base64","brotli","cjs_module_lexer","cldr","icu","llhttp","modules","napi","nghttp2","nghttp3","ngtcp2","openssl","simdutf","tz","undici","unicode","uv","uvwasi","v8","zlib"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export default {\nbuildTime: \"2024-11-22T21:37:03Z\",\ncommit: \"112e11763714ff32a6e8446a02d60de1460e7a09\",\nnpmInfo:\n{\n 'solid-panes': '3.6.1',\n npm: '8.19.4',\n node: '20.18.0',\n acorn: '8.12.1',\n ada: '2.9.0',\n ares: '1.33.1',\n base64: '0.5.2',\n brotli: '1.1.0',\n cjs_module_lexer: '1.4.1',\n cldr: '45.0',\n icu: '75.1',\n llhttp: '8.1.2',\n modules: '115',\n napi: '9',\n nghttp2: '1.61.0',\n nghttp3: '0.7.0',\n ngtcp2: '1.1.0',\n openssl: '3.0.13+quic',\n simdutf: '5.5.0',\n tz: '2024a',\n undici: '6.19.8',\n unicode: '15.1',\n uv: '1.46.0',\n uvwasi: '0.0.21',\n v8: '11.3.244.8-node.23',\n zlib: '1.3.0.1-motley-71660e1'\n}\n};\n"],"mappings":";;;;;;oCAAe;EACfA,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACP;IACE,aAAa,EAAE,OAAO;IACtBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,KAAK,EAAE,QAAQ;IACfC,GAAG,EAAE,OAAO;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,MAAM,EAAE,OAAO;IACfC,gBAAgB,EAAE,OAAO;IACzBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE,KAAK;IACdC,IAAI,EAAE,GAAG;IACTC,OAAO,EAAE,QAAQ;IACjBC,OAAO,EAAE,OAAO;IAChBC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE,aAAa;IACtBC,OAAO,EAAE,OAAO;IAChBC,EAAE,EAAE,OAAO;IACXC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,MAAM;IACfC,EAAE,EAAE,QAAQ;IACZC,MAAM,EAAE,QAAQ;IAChBC,EAAE,EAAE,oBAAoB;IACxBC,IAAI,EAAE;EACR;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"versionInfo.js","names":["buildTime","commit","npmInfo","npm","node","acorn","ada","ares","base64","brotli","cjs_module_lexer","cldr","icu","llhttp","modules","napi","nghttp2","nghttp3","ngtcp2","openssl","simdutf","tz","undici","unicode","uv","uvwasi","v8","zlib"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export default {\nbuildTime: \"2025-02-13T18:56:08Z\",\ncommit: \"352b1a3d67ab7f41752a2e2508bdde2ef7f8705e\",\nnpmInfo:\n{\n 'solid-panes': '3.6.2',\n npm: '8.19.4',\n node: '18.20.6',\n acorn: '8.13.0',\n ada: '2.8.0',\n ares: '1.29.0',\n base64: '0.5.2',\n brotli: '1.1.0',\n cjs_module_lexer: '1.2.2',\n cldr: '44.1',\n icu: '74.2',\n llhttp: '6.1.1',\n modules: '108',\n napi: '9',\n nghttp2: '1.61.0',\n nghttp3: '0.7.0',\n ngtcp2: '1.3.0',\n openssl: '3.0.15+quic',\n simdutf: '5.6.0',\n tz: '2024a',\n undici: '5.28.5',\n unicode: '15.1',\n uv: '1.44.2',\n uvwasi: '0.0.19',\n v8: '10.2.154.26-node.37',\n zlib: '1.3.0.1-motley'\n}\n};\n"],"mappings":";;;;;;oCAAe;EACfA,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACP;IACE,aAAa,EAAE,OAAO;IACtBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,KAAK,EAAE,QAAQ;IACfC,GAAG,EAAE,OAAO;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,MAAM,EAAE,OAAO;IACfC,gBAAgB,EAAE,OAAO;IACzBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE,KAAK;IACdC,IAAI,EAAE,GAAG;IACTC,OAAO,EAAE,QAAQ;IACjBC,OAAO,EAAE,OAAO;IAChBC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE,aAAa;IACtBC,OAAO,EAAE,OAAO;IAChBC,EAAE,EAAE,OAAO;IACXC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,MAAM;IACfC,EAAE,EAAE,QAAQ;IACZC,MAAM,EAAE,QAAQ;IAChBC,EAAE,EAAE,qBAAqB;IACzBC,IAAI,EAAE;EACR;AACA,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-panes",
3
- "version": "3.6.1",
3
+ "version": "3.6.2-352b1a3d",
4
4
  "description": "Solid-compatible Panes: applets and views for the mashlib and databrowser",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "lint-fix": "eslint 'src/**/*.js' 'src/**/*.ts' --fix",
18
18
  "test": "npm run lint && jest src/**/*test*",
19
19
  "test-watch": "npm run lint && jest --onlyChanged --watch",
20
- "prepublishOnly": "npm test && npm run build",
20
+ "ignore:prepublishOnly": "npm test && npm run build",
21
21
  "postversion": "git push origin main --follow-tags",
22
22
  "start": "npm install && npm run build-version && npx webpack serve --open"
23
23
  },
@@ -46,49 +46,50 @@
46
46
  "homepage": "https://github.com/solidos/solid-panes",
47
47
  "dependencies": {
48
48
  "@solid/better-simple-slideshow": "^0.1.0",
49
- "@types/jest": "^29.5.12",
50
- "activitystreams-pane": "^0.6.13",
51
- "chat-pane": "^2.4.26",
52
- "contacts-pane": "^2.6.12",
53
- "dompurify": "^3.0.11",
54
- "folder-pane": "^2.4.27",
55
- "issue-pane": "^2.4.19",
49
+ "@types/jest": "^29.5.14",
50
+ "activitystreams-pane": "^0.6.14",
51
+ "chat-pane": "^2.4.27",
52
+ "contacts-pane": "^2.6.13",
53
+ "dompurify": "^3.2.4",
54
+ "eslint": "^9.20.1",
55
+ "folder-pane": "^2.4.28",
56
+ "issue-pane": "^2.4.20",
56
57
  "marked": "^11.2.0",
57
- "meeting-pane": "^2.4.19",
58
+ "meeting-pane": "^2.4.20",
58
59
  "mime-types": "^2.1.35",
59
- "profile-pane": "^1.1.1",
60
- "rdflib": "^2.2.34",
61
- "solid-namespace": "^0.5.3",
62
- "solid-ui": "^2.5.0",
63
- "source-pane": "^2.2.27"
60
+ "profile-pane": "^1.1.2",
61
+ "rdflib": "^2.2.36",
62
+ "solid-namespace": "^0.5.4",
63
+ "solid-ui": "^2.5.1",
64
+ "source-pane": "^2.2.28"
64
65
  },
65
66
  "devDependencies": {
66
- "@babel/cli": "^7.24.1",
67
- "@babel/core": "^7.24.3",
68
- "@babel/preset-env": "^7.24.3",
69
- "@babel/preset-typescript": "^7.24.1",
67
+ "@babel/cli": "^7.26.4",
68
+ "@babel/core": "^7.26.7",
69
+ "@babel/preset-env": "^7.26.7",
70
+ "@babel/preset-typescript": "^7.26.0",
70
71
  "@testing-library/dom": "^9.3.4",
71
- "@testing-library/jest-dom": "^6.4.2",
72
- "@types/webpack-env": "^1.18.4",
73
- "@typescript-eslint/eslint-plugin": "^6.21.0",
74
- "@typescript-eslint/parser": "^6.21.0",
75
- "babel-loader": "^9.1.3",
72
+ "@testing-library/jest-dom": "^6.6.3",
73
+ "@types/webpack-env": "^1.18.8",
74
+ "@typescript-eslint/eslint-plugin": "^8.24.0",
75
+ "@typescript-eslint/parser": "^8.24.0",
76
+ "babel-loader": "^9.2.1",
76
77
  "babel-plugin-inline-import": "^3.0.0",
77
78
  "buffer": "^6.0.3",
78
- "eslint": "^8.57.0",
79
- "html-webpack-plugin": "^5.6.0",
79
+ "globals": "^15.15.0",
80
+ "html-webpack-plugin": "^5.6.3",
80
81
  "husky": "^8.0.3",
81
82
  "jest": "^29.7.0",
82
83
  "jest-environment-jsdom": "^29.7.0",
83
84
  "jest-fetch-mock": "^3.0.3",
84
- "lint-staged": "^15.2.2",
85
+ "lint-staged": "^15.4.3",
85
86
  "node-polyfill-webpack-plugin": "^2.0.1",
86
87
  "path-browserify": "^1.0.1",
87
- "react": "^18.2.0",
88
- "react-dom": "^18.2.0",
89
- "ts-jest": "^29.1.2",
90
- "typescript": "^5.4.3",
91
- "webpack": "^5.91.0",
88
+ "react": "^18.3.1",
89
+ "react-dom": "^18.3.1",
90
+ "ts-jest": "^29.2.5",
91
+ "typescript": "^5.7.3",
92
+ "webpack": "^5.97.1",
92
93
  "webpack-cli": "^5.1.4",
93
94
  "webpack-dev-server": "^4.15.2"
94
95
  },
File without changes
@@ -153,7 +153,7 @@ export const dataContentPane = {
153
153
  if (
154
154
  UI.utils.ancestor(newTable, 'TABLE') &&
155
155
  UI.utils.ancestor(newTable, 'TABLE').style.backgroundColor ===
156
- 'white'
156
+ 'white'
157
157
  ) {
158
158
  newTable.style.backgroundColor = '#eee'
159
159
  } else {
@@ -198,6 +198,7 @@ export const dataContentPane = {
198
198
  }
199
199
  for (let i = 0; i < roots.length; i++) {
200
200
  const tr = myDocument.createElement('tr')
201
+ tr.setAttribute('style', `background-color: ${i % 2 === 0 ? '#f0f0f0' : 'white'};`)
201
202
  rep.appendChild(tr)
202
203
  const subjectTD = myDocument.createElement('td')
203
204
  tr.appendChild(subjectTD)
@@ -47,7 +47,7 @@ export default {
47
47
 
48
48
  // This data coul d come from a fetch OR from ldp comtaimner
49
49
  const hasContentTypeIn2 = function (kb, x, displayables) {
50
- const t = kb.findTypeURIs(subject)
50
+ const t = kb.findTypeURIs(x)
51
51
  for (let k = 0; k < displayables.length; k++) {
52
52
  if ($rdf.Util.mediaTypeClass(displayables[k]).uri in t) {
53
53
  return true
@@ -90,7 +90,7 @@ export default {
90
90
  }
91
91
  newPaneOptions.newInstance = newInstance // Save for creation system
92
92
 
93
- console.log('New dokieli will make: ' + newInstance)
93
+ // console.log('New dokieli will make: ' + newInstance)
94
94
 
95
95
  let htmlContents = DOKIELI_TEMPLATE
96
96
  let filename = newInstance.uri.split('/').slice(-1)[0]
@@ -104,7 +104,7 @@ export default {
104
104
  '</article>',
105
105
  '<h1>' + encodedTitle + '</h1></article>'
106
106
  )
107
- console.log('@@ New HTML for Dok:' + htmlContents)
107
+ // console.log('@@ New HTML for Dok:' + htmlContents)
108
108
  return new Promise(function (resolve) {
109
109
  kb.fetcher
110
110
  .webOperation('PUT', newInstance.uri, {
@@ -119,7 +119,7 @@ export default {
119
119
  })
120
120
  .catch(function (err) {
121
121
  console.log(
122
- 'Error creating dokelili dok at ' +
122
+ 'Error creating dokieli doc at ' +
123
123
  newPaneOptions.newInstance +
124
124
  ': ' +
125
125
  err
@@ -137,29 +137,51 @@ export default {
137
137
  // @@ When we can, use CSP to turn off scripts within the iframe
138
138
  div.setAttribute('class', 'docView')
139
139
  const iframe = myDocument.createElement('IFRAME')
140
- iframe.setAttribute('src', subject.uri) // allow-same-origin
141
- iframe.setAttribute('class', 'doc')
140
+
141
+ // Function to set iframe attributes
142
+ const setIframeAttributes = (iframe, blob, lines) => {
143
+ const objectURL = URL.createObjectURL(blob)
144
+ iframe.setAttribute('src', objectURL)
145
+ iframe.setAttribute('type', blob.type)
146
+ iframe.setAttribute('class', 'doc')
147
+ iframe.setAttribute('style', `border: 1px solid; padding: 1em; height:${lines}em; width:800px; resize: both; overflow: auto;`)
148
+
149
+ // Apply sandbox attribute only for HTML files
150
+ // @@ NOte beflow - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
151
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
152
+ // You can;'t have any sandbox and allow plugins.
153
+ // We could sandbox only HTML files I suppose.
154
+ // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html
155
+ if (blob.type === 'text/html' || blob.type === 'application/xhtml+xml') {
156
+ iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin')
157
+ }
158
+ }
159
+
160
+ // Fetch and process the blob
161
+ kb.fetcher._fetch(subject.uri)
162
+ .then(response => response.blob())
163
+ .then(blob => {
164
+ const blobTextPromise = blob.type.startsWith('text') ? blob.text() : Promise.resolve('')
165
+ return blobTextPromise.then(blobText => ({ blob, blobText }))
166
+ })
167
+ .then(({ blob, blobText }) => {
168
+ const newLines = blobText.includes('<script src="https://dokie.li/scripts/dokieli.js">') ? -10 : 5
169
+ const lines = Math.min(30, blobText.split(/\n/).length + newLines)
170
+ setIframeAttributes(iframe, blob, lines)
171
+ })
172
+ .catch(err => {
173
+ console.log('Error fetching or processing blob:', err)
174
+ })
142
175
 
143
176
  const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
144
- const ct = cts ? cts[0] : null
177
+ const ct = cts ? cts[0].split(';', 1)[0].trim() : null
145
178
  if (ct) {
146
179
  console.log('dokieliPane: c-t:' + ct)
147
180
  } else {
148
181
  console.log('dokieliPane: unknown content-type?')
149
182
  }
150
183
 
151
- // @@ NOte beflow - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
152
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
153
- // You can;'t have any sandbox and allow plugins.
154
- // We could sandbox only HTML files I suppose.
155
- // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html
156
-
157
- // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static
158
-
159
- iframe.setAttribute('style', 'resize = both; height: 40em; width:40em;') // @@ improve guess
160
- // iframe.setAttribute('height', '480')
161
- // iframe.setAttribute('width', '640')
162
- const tr = myDocument.createElement('tr')
184
+ const tr = myDocument.createElement('tr')
163
185
  tr.appendChild(iframe)
164
186
  div.appendChild(tr)
165
187
  return div
@@ -6,7 +6,7 @@
6
6
  import { icons, ns } from 'solid-ui'
7
7
  import { Util } from 'rdflib'
8
8
  import { marked } from 'marked'
9
- import * as DOMPurify from 'dompurify'
9
+ import DOMPurify from 'dompurify';
10
10
 
11
11
  const humanReadablePane = {
12
12
  icon: icons.originalIconBase + 'tango/22-text-x-generic.png',
@@ -75,7 +75,7 @@ const humanReadablePane = {
75
75
  const kb = context.session.store
76
76
 
77
77
  const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
78
- const ct = cts ? cts[0] : null
78
+ const ct = cts ? cts[0].split(';', 1)[0].trim() : null // remove content-type parameters
79
79
  if (ct) {
80
80
  // console.log('humanReadablePane: c-t:' + ct)
81
81
  } else {
@@ -87,6 +87,22 @@ const humanReadablePane = {
87
87
  const element = ct === 'text/markdown' ? 'DIV' : 'IFRAME'
88
88
  const frame = myDocument.createElement(element)
89
89
 
90
+ const setIframeAttributes = (frame, blob, lines) => {
91
+ frame.setAttribute('src', URL.createObjectURL(blob));
92
+ frame.setAttribute('type', blob.type);
93
+ frame.setAttribute('class', 'doc');
94
+ frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`);
95
+
96
+ // Apply sandbox attribute only for HTML files
97
+ // @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
98
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
99
+ // You can't have any sandbox and allow plugins.
100
+ // We could sandbox only HTML files I suppose.
101
+ if (blob.type === 'text/html' || blob.type === 'application/xhtml+xml') {
102
+ frame.setAttribute('sandbox', 'allow-scripts allow-same-origin');
103
+ }
104
+ };
105
+
90
106
  // render markdown to html
91
107
  const markdownHtml = function () {
92
108
  kb.fetcher.webOperation('GET', subject.uri).then(response => {
@@ -97,38 +113,32 @@ const humanReadablePane = {
97
113
  frame.innerHTML = clean
98
114
  frame.setAttribute('class', 'doc')
99
115
  frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)
116
+ }).catch(error => {
117
+ console.error('Error fetching markdown content:', error)
118
+ frame.innerHTML = '<p>Error loading content</p>'
100
119
  })
101
120
  }
102
121
 
103
122
  if (ct === 'text/markdown') {
104
123
  markdownHtml()
105
- } else if (ct !== 'text/html') {
106
- // get with authenticated fetch
107
- kb.fetcher._fetch(subject.uri)
108
- .then(function(response) {
109
- return response.blob()
110
- })
111
- .then(function(blob) {
112
- const objectURL = URL.createObjectURL(blob)
113
- frame.setAttribute('src', objectURL) // w640 h480 //
114
- frame.setAttribute('class', 'doc')
115
- frame.setAttribute('style', `border: 1px solid; padding: 1em; height:120em; width:80em; resize: both; overflow: auto;`)
116
- })
117
124
  } else {
118
- frame.setAttribute('src', subject.uri) // allow-same-origin
119
- frame.setAttribute('class', 'doc')
120
- frame.setAttribute('style', 'resize = both; height:120em; width:80em;')
125
+ // Fetch and process the blob
126
+ kb.fetcher._fetch(subject.uri)
127
+ .then(response => response.blob())
128
+ .then(blob => {
129
+ const blobTextPromise = blob.type.startsWith('text') ? blob.text() : Promise.resolve('')
130
+ return blobTextPromise.then(blobText => ({ blob, blobText }))
131
+ })
132
+ .then(({ blob, blobText }) => {
133
+ const newLines = blobText.includes('<script src="https://dokie.li/scripts/dokieli.js">') ? -10 : 5
134
+ const lines = Math.min(30, blobText.split(/\n/).length + newLines)
135
+ setIframeAttributes(frame, blob, lines)
136
+ })
137
+ .catch(err => {
138
+ console.log('Error fetching or processing blob:', err)
139
+ })
121
140
  }
122
- // @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
123
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
124
- // You can't have any sandbox and allow plugins.
125
- // We could sandbox only HTML files I suppose.
126
- // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html
127
-
128
- // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static
129
141
 
130
- // iframe.setAttribute('height', '480')
131
- // iframe.setAttribute('width', '640')
132
142
  const tr = myDocument.createElement('TR')
133
143
  tr.appendChild(frame)
134
144
  div.appendChild(tr)
@@ -36,7 +36,7 @@ export function getStatementsToAdd (
36
36
  person: NamedNode,
37
37
  ns: Namespaces
38
38
  ): any {
39
- const application = new BlankNode(`bn_${nodeName}`)
39
+ const application = new BlankNode(`bn_${nodeName}`) // NamedNode(`${person.doc().uri}#${nodeName}`)
40
40
  return [
41
41
  st(person, ns.acl('trustedApp'), application, person.doc()),
42
42
  st(application, ns.acl('origin'), origin, person.doc()),
@@ -1,33 +1,33 @@
1
1
  export default {
2
- buildTime: "2024-11-22T21:37:03Z",
3
- commit: "112e11763714ff32a6e8446a02d60de1460e7a09",
2
+ buildTime: "2025-02-13T18:56:08Z",
3
+ commit: "352b1a3d67ab7f41752a2e2508bdde2ef7f8705e",
4
4
  npmInfo:
5
5
  {
6
- 'solid-panes': '3.6.1',
6
+ 'solid-panes': '3.6.2',
7
7
  npm: '8.19.4',
8
- node: '20.18.0',
9
- acorn: '8.12.1',
10
- ada: '2.9.0',
11
- ares: '1.33.1',
8
+ node: '18.20.6',
9
+ acorn: '8.13.0',
10
+ ada: '2.8.0',
11
+ ares: '1.29.0',
12
12
  base64: '0.5.2',
13
13
  brotli: '1.1.0',
14
- cjs_module_lexer: '1.4.1',
15
- cldr: '45.0',
16
- icu: '75.1',
17
- llhttp: '8.1.2',
18
- modules: '115',
14
+ cjs_module_lexer: '1.2.2',
15
+ cldr: '44.1',
16
+ icu: '74.2',
17
+ llhttp: '6.1.1',
18
+ modules: '108',
19
19
  napi: '9',
20
20
  nghttp2: '1.61.0',
21
21
  nghttp3: '0.7.0',
22
- ngtcp2: '1.1.0',
23
- openssl: '3.0.13+quic',
24
- simdutf: '5.5.0',
22
+ ngtcp2: '1.3.0',
23
+ openssl: '3.0.15+quic',
24
+ simdutf: '5.6.0',
25
25
  tz: '2024a',
26
- undici: '6.19.8',
26
+ undici: '5.28.5',
27
27
  unicode: '15.1',
28
- uv: '1.46.0',
29
- uvwasi: '0.0.21',
30
- v8: '11.3.244.8-node.23',
31
- zlib: '1.3.0.1-motley-71660e1'
28
+ uv: '1.44.2',
29
+ uvwasi: '0.0.19',
30
+ v8: '10.2.154.26-node.37',
31
+ zlib: '1.3.0.1-motley'
32
32
  }
33
33
  };
package/timestamp.sh CHANGED
File without changes
package/.babelrc DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- "@babel/preset-typescript"
5
- ],
6
- "plugins": [
7
- [
8
- "babel-plugin-inline-import",
9
- {
10
- "extensions": [
11
- ".ttl"
12
- ]
13
- }
14
- ]
15
- ]
16
- }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- dist
2
- lib
3
- typings/rdflib
package/.eslintrc DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "root": true,
3
- "env": {
4
- "browser": true,
5
- "es6": true,
6
- "node": true
7
- },
8
- "globals": {
9
- "Atomics": "readonly",
10
- "SharedArrayBuffer": "readonly"
11
- },
12
- "parser": "@typescript-eslint/parser",
13
- "plugins": [
14
- "@typescript-eslint"
15
- ],
16
- "rules": {
17
- "no-unused-vars": ["warn", {
18
- "argsIgnorePattern": "^_",
19
- "varsIgnorePattern": "^_"
20
- }],
21
- "@typescript-eslint/no-unused-vars": ["warn", {
22
- "argsIgnorePattern": "^_",
23
- "varsIgnorePattern": "^_"
24
- }]
25
- }
26
- }