solid-panes 3.5.31 → 3.5.32
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/README.md +3 -3
- package/lib/humanReadablePane.js +7 -2
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/versionInfo.js +3 -3
- package/lib/versionInfo.js.map +1 -1
- package/package.json +16 -15
- package/src/humanReadablePane.js +4 -2
- package/src/versionInfo.ts +3 -3
package/README.md
CHANGED
|
@@ -61,9 +61,9 @@ npm install
|
|
|
61
61
|
npm run start
|
|
62
62
|
```
|
|
63
63
|
2. a browser window should automatically open at http://localhost:9000, if for some reason it doesn't go ahead and manually navigate there.
|
|
64
|
-
3. edit `dev/
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
3. Once you arrive at the Solid Pane Tester page, the `profile-pane` will be loaded by default. Proceed to edit `solid-panes/dev/loader.ts` and, at line 5, you should see `import Pane from 'profile-pane'`. Simply change `'profile-pane'` to your preferred pane/directory containing the pane of choice; for example, you could choose `'source-pane'` and bam, it will load that pane. For those who are new, you can go to the `solid-panes/src` directory and manually navigate through each individual folder. In most folders, you simply look for any file that has `pane` in the title. Copy and paste the `pane.js` file of your choice into the `solid-panes/dev/pane` folder, or you can import directly from the `src` directory. For example, importing from `'../src/dokieli/dokieliPane'` will work just fine. Each time you save `solid-panes/dev/loader.ts` while importing a different pane, your browser at `http://localhost:9000/` should automatically refresh. It's a good idea to keep the developer console open in your web browser to ensure panes are loading and rendering properly.
|
|
65
|
+
|
|
66
|
+
4. Another tip: to ensure you arrive at the proper destination, look at lines 48–53 in `solid-panes/dev/loader.ts`. You should see an event listener that is ready for a string. `renderPane('https://solidos.solidcommunity.net/Team/SolidOs%20team%20chat/index.ttl#this')` will be the default. Depending on the `pane.js` that you chose in the earlier import statements, the `renderPane` function determines the way you will see DOMContent inside of that particular pane. If you have created an `index.html` in your provider pod storage area, you could use `'https://yoursolidname.solidcommunity.net/profile/index.html'` inside of the `renderPane()` function parameters. You can edit the string manually in `solid-panes/dev/loader.ts`, or you can go to your developer console and type `renderPane('https://yoursolidname.solidcommunity.net/profile/index.html')` — just point to a part of your account that is congruent to the pane that you wish to import! :)
|
|
67
67
|
|
|
68
68
|
## Contributing panes
|
|
69
69
|
When you created a pane, you can either add it as an npm dependency
|
package/lib/humanReadablePane.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -7,6 +8,9 @@ exports["default"] = void 0;
|
|
|
7
8
|
var _solidUi = require("solid-ui");
|
|
8
9
|
var _rdflib = require("rdflib");
|
|
9
10
|
var _marked = require("marked");
|
|
11
|
+
var DOMPurify = _interopRequireWildcard(require("dompurify"));
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
14
|
/* Human-readable Pane
|
|
11
15
|
**
|
|
12
16
|
** This outline pane contains the document contents for an HTML document
|
|
@@ -62,7 +66,7 @@ var humanReadablePane = {
|
|
|
62
66
|
var cts = kb.fetcher.getHeader(subject.doc(), 'content-type');
|
|
63
67
|
var ct = cts ? cts[0] : null;
|
|
64
68
|
if (ct) {
|
|
65
|
-
console.log('humanReadablePane: c-t:' + ct)
|
|
69
|
+
// console.log('humanReadablePane: c-t:' + ct)
|
|
66
70
|
} else {
|
|
67
71
|
console.log('humanReadablePane: unknown content-type?');
|
|
68
72
|
}
|
|
@@ -78,7 +82,8 @@ var humanReadablePane = {
|
|
|
78
82
|
var markdownText = response.responseText;
|
|
79
83
|
var lines = Math.min(30, markdownText.split(/\n/).length + 5);
|
|
80
84
|
var res = _marked.marked.parse(markdownText);
|
|
81
|
-
|
|
85
|
+
var clean = DOMPurify.sanitize(res);
|
|
86
|
+
frame.innerHTML = clean;
|
|
82
87
|
frame.setAttribute('class', 'doc');
|
|
83
88
|
frame.setAttribute('style', "border: 1px solid; padding: 1em; height: ".concat(lines, "em; width: 800px; resize: both; overflow: auto;"));
|
|
84
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanReadablePane.js","names":["_solidUi","require","_rdflib","_marked","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","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'\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,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAPA;AACA;AACA;AACA;AACA;;AAKA,IAAMG,iBAAiB,GAAG;EACxBC,IAAI,EAAEC,cAAK,CAACC,gBAAgB,GAAG,6BAA6B;E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,KAAK,EAAEjC,OAAO,CAACqB,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,IAAMuB,EAAE,GAAG/B,UAAU,CAACG,aAAa,CAAC,IAAI,CAAC;IACzC4B,EAAE,CAACC,WAAW,CAACtB,KAAK,CAAC;IACrBR,GAAG,CAAC8B,WAAW,CAACD,EAAE,CAAC;IACnB,OAAO7B,GAAG;EACZ;AACF,CAAC;AAAA,IAAA+B,QAAA,GAEchE,iBAAiB,EAChC;AAAAiE,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"humanReadablePane.js","names":["_solidUi","require","_rdflib","_marked","DOMPurify","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","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","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,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,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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,GAEclE,iBAAiB,EAChC;AAAAmE,OAAA,cAAAD,QAAA"}
|
package/lib/versionInfo.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _default = {
|
|
8
|
-
buildTime: "2023-
|
|
9
|
-
commit: "
|
|
8
|
+
buildTime: "2023-03-17T15:26:14Z",
|
|
9
|
+
commit: "32b73b7d09660ebf8ec1fed046cd06e9b07beabe",
|
|
10
10
|
npmInfo: {
|
|
11
|
-
'solid-panes': '3.5.
|
|
11
|
+
'solid-panes': '3.5.32',
|
|
12
12
|
npm: '8.19.4',
|
|
13
13
|
node: '16.19.1',
|
|
14
14
|
v8: '9.4.146.26-node.24',
|
package/lib/versionInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionInfo.js","names":["buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode","ngtcp2","nghttp3","exports","_default"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export default {\nbuildTime: \"2023-
|
|
1
|
+
{"version":3,"file":"versionInfo.js","names":["buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode","ngtcp2","nghttp3","exports","_default"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export default {\nbuildTime: \"2023-03-17T15:26:14Z\",\ncommit: \"32b73b7d09660ebf8ec1fed046cd06e9b07beabe\",\nnpmInfo:\n{\n 'solid-panes': '3.5.32',\n npm: '8.19.4',\n node: '16.19.1',\n v8: '9.4.146.26-node.24',\n uv: '1.43.0',\n zlib: '1.2.11',\n brotli: '1.0.9',\n ares: '1.18.1',\n modules: '93',\n nghttp2: '1.47.0',\n napi: '8',\n llhttp: '6.0.10',\n openssl: '1.1.1t+quic',\n cldr: '41.0',\n icu: '71.1',\n tz: '2022f',\n unicode: '14.0',\n ngtcp2: '0.8.1',\n nghttp3: '0.7.0'\n}\n};\n"],"mappings":";;;;;;eAAe;EACfA,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACP;IACE,aAAa,EAAE,QAAQ;IACvBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAE,oBAAoB;IACxBC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,IAAI;IACbC,OAAO,EAAE,QAAQ;IACjBC,IAAI,EAAE,GAAG;IACTC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,aAAa;IACtBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,EAAE,EAAE,OAAO;IACXC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE;EACX;AACA,CAAC;AAAAC,OAAA,cAAAC,QAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-panes",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.32",
|
|
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",
|
|
@@ -46,34 +46,35 @@
|
|
|
46
46
|
"homepage": "https://github.com/solidos/solid-panes",
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@solid/better-simple-slideshow": "^0.1.0",
|
|
49
|
-
"activitystreams-pane": "0.6.
|
|
50
|
-
"chat-pane": "2.4.
|
|
51
|
-
"contacts-pane": "^2.6.
|
|
52
|
-
"
|
|
53
|
-
"
|
|
49
|
+
"activitystreams-pane": "0.6.11",
|
|
50
|
+
"chat-pane": "2.4.23",
|
|
51
|
+
"contacts-pane": "^2.6.10",
|
|
52
|
+
"dompurify": "^3.0.1",
|
|
53
|
+
"folder-pane": "^2.4.25",
|
|
54
|
+
"issue-pane": "2.4.17",
|
|
54
55
|
"marked": "^4.2.12",
|
|
55
|
-
"meeting-pane": "^2.3.
|
|
56
|
+
"meeting-pane": "^2.3.17",
|
|
56
57
|
"mime-types": "^2.1.35",
|
|
57
58
|
"profile-pane": "^1.0.16",
|
|
58
59
|
"solid-namespace": "^0.5.2",
|
|
59
|
-
"solid-ui": "2.4.
|
|
60
|
-
"source-pane": "^2.2.
|
|
60
|
+
"solid-ui": "2.4.27",
|
|
61
|
+
"source-pane": "^2.2.24"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@babel/cli": "^7.21.0",
|
|
64
|
-
"@babel/core": "^7.21.
|
|
65
|
+
"@babel/core": "^7.21.3",
|
|
65
66
|
"@babel/preset-env": "^7.20.2",
|
|
66
67
|
"@babel/preset-typescript": "^7.21.0",
|
|
67
68
|
"@testing-library/dom": "^8.20.0",
|
|
68
69
|
"@testing-library/jest-dom": "^5.16.5",
|
|
69
70
|
"@types/jest": "^27.5.2",
|
|
70
71
|
"@types/webpack-env": "^1.18.0",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
72
|
-
"@typescript-eslint/parser": "^5.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
73
|
+
"@typescript-eslint/parser": "^5.55.0",
|
|
73
74
|
"babel-loader": "^8.3.0",
|
|
74
75
|
"babel-plugin-inline-import": "^3.0.0",
|
|
75
76
|
"buffer": "^6.0.3",
|
|
76
|
-
"eslint": "^8.
|
|
77
|
+
"eslint": "^8.36.0",
|
|
77
78
|
"html-webpack-plugin": "^5.5.0",
|
|
78
79
|
"husky": "^7.0.4",
|
|
79
80
|
"jest": "^27.5.1",
|
|
@@ -85,9 +86,9 @@
|
|
|
85
86
|
"react-dom": "^18.2.0",
|
|
86
87
|
"ts-jest": "^27.1.5",
|
|
87
88
|
"typescript": "^4.9.5",
|
|
88
|
-
"webpack": "^5.
|
|
89
|
+
"webpack": "^5.76.2",
|
|
89
90
|
"webpack-cli": "^4.10.0",
|
|
90
|
-
"webpack-dev-server": "^4.
|
|
91
|
+
"webpack-dev-server": "^4.12.0"
|
|
91
92
|
},
|
|
92
93
|
"husky": {
|
|
93
94
|
"hooks": {
|
package/src/humanReadablePane.js
CHANGED
|
@@ -6,6 +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
10
|
|
|
10
11
|
const humanReadablePane = {
|
|
11
12
|
icon: icons.originalIconBase + 'tango/22-text-x-generic.png',
|
|
@@ -76,7 +77,7 @@ const humanReadablePane = {
|
|
|
76
77
|
const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
|
|
77
78
|
const ct = cts ? cts[0] : null
|
|
78
79
|
if (ct) {
|
|
79
|
-
console.log('humanReadablePane: c-t:' + ct)
|
|
80
|
+
// console.log('humanReadablePane: c-t:' + ct)
|
|
80
81
|
} else {
|
|
81
82
|
console.log('humanReadablePane: unknown content-type?')
|
|
82
83
|
}
|
|
@@ -92,7 +93,8 @@ const humanReadablePane = {
|
|
|
92
93
|
const markdownText = response.responseText
|
|
93
94
|
const lines = Math.min(30, markdownText.split(/\n/).length + 5)
|
|
94
95
|
const res = marked.parse(markdownText)
|
|
95
|
-
|
|
96
|
+
const clean = DOMPurify.sanitize(res)
|
|
97
|
+
frame.innerHTML = clean
|
|
96
98
|
frame.setAttribute('class', 'doc')
|
|
97
99
|
frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)
|
|
98
100
|
})
|
package/src/versionInfo.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
buildTime: "2023-
|
|
3
|
-
commit: "
|
|
2
|
+
buildTime: "2023-03-17T15:26:14Z",
|
|
3
|
+
commit: "32b73b7d09660ebf8ec1fed046cd06e9b07beabe",
|
|
4
4
|
npmInfo:
|
|
5
5
|
{
|
|
6
|
-
'solid-panes': '3.5.
|
|
6
|
+
'solid-panes': '3.5.32',
|
|
7
7
|
npm: '8.19.4',
|
|
8
8
|
node: '16.19.1',
|
|
9
9
|
v8: '9.4.146.26-node.24',
|