solid-panes 4.4.2-6 → 4.4.2-7
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/dist/RDFXMLPane2.cjs.js +1 -1
- package/dist/RDFXMLPane2.esm.js +1 -1
- package/dist/audio/audioPane.cjs.js +1 -1
- package/dist/audio/audioPane.cjs.js.map +1 -1
- package/dist/audio/audioPane.esm.js +13 -10
- package/dist/audio/audioPane.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +1 -1
- package/dist/n3Pane2.cjs.js +1 -1
- package/dist/n3Pane2.esm.js +1 -1
- package/dist/outline/manager2.cjs.js +1 -1
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +12 -10
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/userInput.cjs.js +1 -1
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +6 -4
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/social/socialSections.cjs.js +1 -1
- package/dist/social/socialSections.cjs.js.map +1 -1
- package/dist/social/socialSections.esm.js +7 -6
- package/dist/social/socialSections.esm.js.map +1 -1
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +3 -3
- package/dist/versionInfo.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/RDFXMLPane2.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.rdfxml-pane{border-top:solid 2px var(--color-data-pane-border-top,black);border-left:solid 2px var(--color-data-pane-border-top,black);border-bottom:solid 2px var(--color-data-pane-border-side,#777);border-right:solid 2px var(--color-data-pane-border-side,#777);color:var(--color-text-brown,#440);box-sizing:border-box;padding:1rem}.rdfxml-pane__source{box-sizing:border-box;white-space:pre;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.rdfxml-pane{border-top:solid 2px var(--color-data-pane-border-top,black);border-left:solid 2px var(--color-data-pane-border-top,black);border-bottom:solid 2px var(--color-data-pane-border-side,#777);border-right:solid 2px var(--color-data-pane-border-side,#777);width:100%;min-width:0;color:var(--color-text-brown,#440);box-sizing:border-box;padding:1rem}.rdfxml-pane__source{box-sizing:border-box;white-space:pre;min-width:0;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(0, 1fr);align-items:start;min-width:0;display:grid}.rdfxml-pane__line-indent{width:var(--rdfxml-indent,0);display:block}.rdfxml-pane__line-content{white-space:pre}.rdfxml-pane[data-layout=mobile] .rdfxml-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.rdfxml-pane[data-layout=mobile] .rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(0, 1fr)}.rdfxml-pane[data-layout=mobile] .rdfxml-pane__line-content{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0}@media (width<=576px){.rdfxml-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(0, 1fr)}.rdfxml-pane__line-content{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");;let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns;function i(e){if(e.trim().length===0)return 0;let t=0;for(let n of e){if(n===` `){t+=1;continue}if(n===` `){t+=2;continue}break}return Math.max(t,2)}function a(e){return e.replace(/^[ \t]+/,``)}var o={icon:t.icons.originalIconBase+`22-text-xml4.png`,name:`RDFXML`,audience:[r.solid(`Developer`)],label:function(e,t){let n=t.session.store;if(`http://www.w3.org/2007/ont/link#ProtocolEvent`in n.findTypeURIs(e))return null;let r=n.statementsMatching(void 0,void 0,void 0,e).length;return r===0?null:`As RDF/XML (`+r+`)`},render:function(e,t){let r=t.dom,o=t.session.store;function s(e){let n=t.environment??{};e.dataset.layout=n.layout??`desktop`}let c=r.createElement(`div`);c.setAttribute(`class`,`rdfxml-pane`),s(c);let l=o.statementsMatching(void 0,void 0,void 0,e),u=n.Serializer(o);u.suggestNamespaces(o.namespaces),u.setBase(e.uri);let d=u.statementsToXML(l),f=r.createElement(`div`);return f.classList.add(`rdfxml-pane__source`),d.split(`
|
|
2
2
|
`).forEach(e=>{let t=r.createElement(`div`),n=r.createElement(`span`),o=r.createElement(`span`),s=i(e);t.classList.add(`rdfxml-pane__line`),t.style.setProperty(`--rdfxml-indent`,`${s}ch`),n.classList.add(`rdfxml-pane__line-indent`),n.setAttribute(`aria-hidden`,`true`),o.classList.add(`rdfxml-pane__line-content`),o.textContent=e.length>0?a(e):` `,t.appendChild(n),t.appendChild(o),f.appendChild(t)}),c.appendChild(f),c}};exports.RDFXMLPane=o;
|
|
3
3
|
//# sourceMappingURL=RDFXMLPane2.cjs.js.map
|
package/dist/RDFXMLPane2.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.rdfxml-pane{border-top:solid 2px var(--color-data-pane-border-top,black);border-left:solid 2px var(--color-data-pane-border-top,black);border-bottom:solid 2px var(--color-data-pane-border-side,#777);border-right:solid 2px var(--color-data-pane-border-side,#777);color:var(--color-text-brown,#440);box-sizing:border-box;padding:1rem}.rdfxml-pane__source{box-sizing:border-box;white-space:pre;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.rdfxml-pane{border-top:solid 2px var(--color-data-pane-border-top,black);border-left:solid 2px var(--color-data-pane-border-top,black);border-bottom:solid 2px var(--color-data-pane-border-side,#777);border-right:solid 2px var(--color-data-pane-border-side,#777);width:100%;min-width:0;color:var(--color-text-brown,#440);box-sizing:border-box;padding:1rem}.rdfxml-pane__source{box-sizing:border-box;white-space:pre;min-width:0;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(0, 1fr);align-items:start;min-width:0;display:grid}.rdfxml-pane__line-indent{width:var(--rdfxml-indent,0);display:block}.rdfxml-pane__line-content{white-space:pre}.rdfxml-pane[data-layout=mobile] .rdfxml-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.rdfxml-pane[data-layout=mobile] .rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(0, 1fr)}.rdfxml-pane[data-layout=mobile] .rdfxml-pane__line-content{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0}@media (width<=576px){.rdfxml-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.rdfxml-pane__line{grid-template-columns:var(--rdfxml-indent,0) minmax(0, 1fr)}.rdfxml-pane__line-content{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
import * as e from "solid-ui";
|
|
3
3
|
import * as t from "rdflib";
|
|
4
4
|
//#region src/RDFXMLPane.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../_virtual/_rolldown/runtime.cjs.js");let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns,i={icon:t.icons.iconBase+`noun_534313.svg`,name:`audio`,label:function(e,t){let r=t.session.store.findTypeURIs(e),i=n.Util.mediaTypeClass(`audio/*`).uri.split(`*`)[0];for(let e in r)if(e.startsWith(i))return`Play audio`;return null},render:function(e,t){let n=t.session.store,i=t.dom,a={autoplay:!1,chain:!0,chainAlbums:!0,loop:!1},o=function(e){let t=e.lastIndexOf(`.`);return t<0||t<e.lastIndexOf(`/`)?e:e.slice(0,t)},s=function(e){let t=n.any(void 0,r.ldp(`contains`),e);if(!t)return!1;let i=n.each(t,r.ldp(`contains`));if(i.length<2)return!1;let a=e.uri;for(let e=0;e<i.length;e++){let t=i[e].uri;if(a.length>t.length&&a.startsWith(o(t))||a.endsWith(`.m4a`)&&t.endsWith(`.mp3`)&&o(a)===o(t))return!0}return!1},c=function(e){let t=e.uri.split(`/`).slice(-3),n=function(e){try{return decodeURIComponent(e)}catch{return e}};h.textContent=n(t[0]),g.textContent=n(t[1]),_.textContent=n(o(t[2]))},l=function(e,t){return new Promise(function(i){if(t||=0,!a.chain)return i(null);let o=n.any(void 0,r.ldp(`contains`),e)||e.dir();if(!o)return i(null);n.fetcher.load(o).then(function(s){let c=n.each(o,r.ldp(`contains`)),u;c.sort();for(let s=0;s<c.length;s++)if(e.uri===c[s].uri)if(u=(s+1)%c.length,u===0)if(a.chainAlbums){if(t===1||!a.chainAlbums)return i(null);l(o,t+1).then(function(e){e&&n.fetcher.load(e).then(function(t){let a=n.each(e,r.ldp(`contains`));return a.length===0?i(null):(a.sort(),console.log(`New Album: `+e),i(a[0]))})})}else return a.loop?i(c[u]):i(null)
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs.js");let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns,i={icon:t.icons.iconBase+`noun_534313.svg`,name:`audio`,label:function(e,t){let r=t.session.store.findTypeURIs(e),i=n.Util.mediaTypeClass(`audio/*`).uri.split(`*`)[0];for(let e in r)if(e.startsWith(i))return`Play audio`;return null},render:function(e,t){let n=t.session.store,i=t.dom,a={autoplay:!1,chain:!0,chainAlbums:!0,loop:!1},o=function(e){let t=e.lastIndexOf(`.`);return t<0||t<e.lastIndexOf(`/`)?e:e.slice(0,t)},s=function(e){let t=n.any(void 0,r.ldp(`contains`),e);if(!t)return!1;let i=n.each(t,r.ldp(`contains`));if(i.length<2)return!1;let a=e.uri;for(let e=0;e<i.length;e++){let t=i[e].uri;if(a.length>t.length&&a.startsWith(o(t))||a.endsWith(`.m4a`)&&t.endsWith(`.mp3`)&&o(a)===o(t))return!0}return!1},c=function(e){let t=e.uri.split(`/`).slice(-3),n=function(e){try{return decodeURIComponent(e)}catch{return e}};h.textContent=n(t[0]),g.textContent=n(t[1]),_.textContent=n(o(t[2]))},l=function(e,t){return new Promise(function(i){if(t||=0,!a.chain)return i(null);let o=n.any(void 0,r.ldp(`contains`),e)||e.dir();if(!o)return i(null);n.fetcher.load(o).then(function(s){let c=n.each(o,r.ldp(`contains`)),u;c.sort();for(let s=0;s<c.length;s++)if(e.uri===c[s].uri){if(u=(s+1)%c.length,u===0){if(a.chainAlbums){if(t===1||!a.chainAlbums)return i(null);l(o,t+1).then(function(e){e&&n.fetcher.load(e).then(function(t){let a=n.each(e,r.ldp(`contains`));return a.length===0?i(null):(a.sort(),console.log(`New Album: `+e),i(a[0]))})})}else return a.loop?i(c[u]):i(null)}else return i(c[u])}})})},u=function(e){let t=n.sym(e.target.getAttribute(`src`));if(!a.chain)return;let r=function(t){let n=t;l(n).then(function(t){if(!t){console.log(`No successor to `+n);return}s(t)?(console.log(`Ignoring redundant `+t),r(t)):(console.log(`Moving on to `+t),c(t),v.appendChild(d(t,!0)),v.removeChild(e.target))})};r(t)},d=function(e,t){let r=i.createElement(`audio`);return r.setAttribute(`controls`,`yes`),n.fetcher._fetch(e.uri).then(function(e){return e.blob()}).then(function(e){let t=URL.createObjectURL(e);r.setAttribute(`src`,t)}),t&&r.setAttribute(`autoplay`,`autoplay`),r.addEventListener(`ended`,u,!1),r},f=i.createElement(`div`),p=f.appendChild(i.createElement(`table`)),m=`padding: 0.3em; color:white; background-color: black;`,h=p.appendChild(i.createElement(`tr`));h.style.cssText=m;let g=p.appendChild(i.createElement(`tr`));g.style.cssText=m;let _=p.appendChild(i.createElement(`tr`));_.style.cssText=m;let v=p.appendChild(i.createElement(`tr`));return c(e),v.appendChild(d(e,a.autoplay)),!n.holds(void 0,r.ldp(`contains`),e)&&e.dir()&&n.fetcher.load(e.dir()),f}};exports.default=i;
|
|
2
2
|
//# sourceMappingURL=audioPane.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audioPane.cjs.js","names":["UI","$rdf"],"sources":["../../src/audio/audioPane.js"],"sourcesContent":["/* Single audio play Pane\n **\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nconst ns = UI.ns\n\nexport default {\n icon: UI.icons.iconBase + 'noun_534313.svg',\n\n name: 'audio',\n\n // Does the subject deserve an audio play pane?\n label: function (subject, context) {\n const kb = context.session.store\n const typeURIs = kb.findTypeURIs(subject)\n\n const prefix = $rdf.Util.mediaTypeClass('audio/*').uri.split('*')[0]\n for (const t in typeURIs) {\n if (t.startsWith(prefix)) return 'Play audio'\n }\n return null\n },\n\n render: function (subject, context) {\n const kb = context.session.store\n const dom = context.dom\n const options = {\n autoplay: false,\n chain: true,\n chainAlbums: true,\n loop: false\n }\n\n const removeExtension = function (str) {\n const dot = str.lastIndexOf('.')\n if (dot < 0) return str // if any\n const slash = str.lastIndexOf('/')\n if (dot < slash) return str\n return str.slice(0, dot)\n }\n\n // True if there is another file like song.mp3 when this is \"song 1.mp3\"\n // or this is song.m4a\n //\n const looksRedundant = function (x) {\n const folder = kb.any(undefined, ns.ldp('contains'), x)\n if (!folder) return false\n const contents = kb.each(folder, ns.ldp('contains'))\n if (contents.length < 2) return false\n const thisName = x.uri\n for (let k = 0; k < contents.length; k++) {\n const otherName = contents[k].uri\n if (\n thisName.length > otherName.length &&\n thisName.startsWith(removeExtension(otherName))\n ) {\n return true\n }\n if (\n thisName.endsWith('.m4a') &&\n otherName.endsWith('.mp3') &&\n removeExtension(thisName) === removeExtension(otherName)\n ) {\n return true\n }\n }\n return false\n }\n\n // Alternative methods could include:\n // Accesing metadata in the audio contol, or paring the audio file\n const guessNames = function (x) {\n const a = x.uri.split('/').slice(-3) // Hope artist, album, track\n const decode = function (str) {\n try {\n return decodeURIComponent(str)\n } catch (e) {\n return str\n }\n }\n artistRow.textContent = decode(a[0])\n albumRow.textContent = decode(a[1])\n trackRow.textContent = decode(removeExtension(a[2]))\n }\n\n const moveOn = function (current, level) {\n return new Promise(function (resolve) {\n level = level || 0\n if (!options.chain) return resolve(null)\n // Ideally navigate graph else cheat with URI munging:\n const folder =\n kb.any(undefined, ns.ldp('contains'), current) || current.dir()\n if (!folder) return resolve(null)\n kb.fetcher.load(folder).then(function (_xhr) {\n const contents = kb.each(folder, ns.ldp('contains')) // @@ load if not loaded\n // if (contents.length < 2) return resolve(null) NO might move on from 1-track album\n let j\n contents.sort() // sort by URI which hopefully will get tracks in order\n for (let i = 0; i < contents.length; i++) {\n if (current.uri === contents[i].uri) {\n j = (i + 1) % contents.length\n if (j === 0) {\n if (!options.chainAlbums) {\n if (options.loop) {\n return resolve(contents[j])\n }\n return resolve(null) // No more music needed\n } else {\n // chain albums\n if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee\n moveOn(folder, level + 1).then(function (folder2) {\n if (folder2) {\n kb.fetcher.load(folder2).then(function (_xhr) {\n const contents = kb.each(folder2, ns.ldp('contains'))\n if (contents.length === 0) return resolve(null)\n contents.sort()\n console.log('New Album: ' + folder2)\n return resolve(contents[0]) // Start off new album\n })\n }\n })\n }\n } else {\n return resolve(contents[j])\n }\n }\n } // for\n })\n })\n }\n const endedListener = function (event) {\n const current = kb.sym(event.target.getAttribute('src'))\n if (!options.chain) return\n const tryNext = function (cur) {\n const current = cur\n moveOn(current).then(function (next) {\n if (!next) {\n console.log('No successor to ' + current)\n return\n }\n if (!looksRedundant(next)) {\n console.log('Moving on to ' + next)\n guessNames(next)\n controlRow.appendChild(audioControl(next, true)) // Force autoplay\n controlRow.removeChild(event.target)\n } else {\n console.log('Ignoring redundant ' + next)\n tryNext(next)\n }\n })\n }\n tryNext(current)\n }\n\n const audioControl = function (song, autoplay) {\n const audio = dom.createElement('audio')\n audio.setAttribute('controls', 'yes')\n // get audio with authenticated fetch\n kb.fetcher._fetch(song.uri)\n .then(function (response) {\n return response.blob()\n })\n .then(function (myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n audio.setAttribute('src', objectURL) // w640 h480 //\n })\n\n if (autoplay) {\n audio.setAttribute('autoplay', 'autoplay') // Make this a personal preference\n }\n audio.addEventListener('ended', endedListener, false)\n return audio\n }\n\n const div = dom.createElement('div')\n const table = div.appendChild(dom.createElement('table'))\n const labelStyle = 'padding: 0.3em; color:white; background-color: black;'\n const artistRow = table.appendChild(dom.createElement('tr'))\n artistRow.style.cssText = labelStyle\n const albumRow = table.appendChild(dom.createElement('tr'))\n albumRow.style.cssText = labelStyle\n const trackRow = table.appendChild(dom.createElement('tr'))\n trackRow.style.cssText = labelStyle\n const controlRow = table.appendChild(dom.createElement('tr'))\n guessNames(subject)\n controlRow.appendChild(audioControl(subject, options.autoplay))\n\n if (!kb.holds(undefined, ns.ldp('contains'), subject) && subject.dir()) {\n kb.fetcher.load(subject.dir()) // Prefetch enclosing @@ or playlist\n }\n\n return div\n }\n}\n\n// ends\n"],"mappings":"wIAKA,IAAM,EAAKA,EAAG,GAEd,EAAe,CACb,KAAMA,EAAG,MAAM,SAAW,kBAE1B,KAAM,QAGN,MAAO,SAAU,EAAS,EAAS,CAEjC,IAAM,EADK,EAAQ,QAAQ,MACP,aAAa,CAAO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YAAY,EAAI,cAAc,IAAI,CAAC,EAQ5D,OAPA,EAAW,CAAO,EAClB,EAAW,YAAY,EAAa,EAAS,EAAQ,QAAQ,CAAC,EAE1D,CAAC,EAAG,MAAM,IAAA,GAAW,EAAG,IAAI,UAAU,EAAG,CAAO,GAAK,EAAQ,IAAI,GACnE,EAAG,QAAQ,KAAK,EAAQ,IAAI,CAAC,EAGxB,CACT,CACF"}
|
|
1
|
+
{"version":3,"file":"audioPane.cjs.js","names":["UI","$rdf"],"sources":["../../src/audio/audioPane.js"],"sourcesContent":["/* Single audio play Pane\n **\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nconst ns = UI.ns\n\nexport default {\n icon: UI.icons.iconBase + 'noun_534313.svg',\n\n name: 'audio',\n\n // Does the subject deserve an audio play pane?\n label: function (subject, context) {\n const kb = context.session.store\n const typeURIs = kb.findTypeURIs(subject)\n\n const prefix = $rdf.Util.mediaTypeClass('audio/*').uri.split('*')[0]\n for (const t in typeURIs) {\n if (t.startsWith(prefix)) return 'Play audio'\n }\n return null\n },\n\n render: function (subject, context) {\n const kb = context.session.store\n const dom = context.dom\n const options = {\n autoplay: false,\n chain: true,\n chainAlbums: true,\n loop: false\n }\n\n const removeExtension = function (str) {\n const dot = str.lastIndexOf('.')\n if (dot < 0) return str // if any\n const slash = str.lastIndexOf('/')\n if (dot < slash) return str\n return str.slice(0, dot)\n }\n\n // True if there is another file like song.mp3 when this is \"song 1.mp3\"\n // or this is song.m4a\n //\n const looksRedundant = function (x) {\n const folder = kb.any(undefined, ns.ldp('contains'), x)\n if (!folder) return false\n const contents = kb.each(folder, ns.ldp('contains'))\n if (contents.length < 2) return false\n const thisName = x.uri\n for (let k = 0; k < contents.length; k++) {\n const otherName = contents[k].uri\n if (\n thisName.length > otherName.length &&\n thisName.startsWith(removeExtension(otherName))\n ) {\n return true\n }\n if (\n thisName.endsWith('.m4a') &&\n otherName.endsWith('.mp3') &&\n removeExtension(thisName) === removeExtension(otherName)\n ) {\n return true\n }\n }\n return false\n }\n\n // Alternative methods could include:\n // Accesing metadata in the audio contol, or paring the audio file\n const guessNames = function (x) {\n const a = x.uri.split('/').slice(-3) // Hope artist, album, track\n const decode = function (str) {\n try {\n return decodeURIComponent(str)\n } catch (e) {\n return str\n }\n }\n artistRow.textContent = decode(a[0])\n albumRow.textContent = decode(a[1])\n trackRow.textContent = decode(removeExtension(a[2]))\n }\n\n const moveOn = function (current, level) {\n return new Promise(function (resolve) {\n level = level || 0\n if (!options.chain) return resolve(null)\n // Ideally navigate graph else cheat with URI munging:\n const folder =\n kb.any(undefined, ns.ldp('contains'), current) || current.dir()\n if (!folder) return resolve(null)\n kb.fetcher.load(folder).then(function (_xhr) {\n const contents = kb.each(folder, ns.ldp('contains')) // @@ load if not loaded\n // if (contents.length < 2) return resolve(null) NO might move on from 1-track album\n let j\n contents.sort() // sort by URI which hopefully will get tracks in order\n for (let i = 0; i < contents.length; i++) {\n if (current.uri === contents[i].uri) {\n j = (i + 1) % contents.length\n if (j === 0) {\n if (!options.chainAlbums) {\n if (options.loop) {\n return resolve(contents[j])\n }\n return resolve(null) // No more music needed\n } else {\n // chain albums\n if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee\n moveOn(folder, level + 1).then(function (folder2) {\n if (folder2) {\n kb.fetcher.load(folder2).then(function (_xhr) {\n const contents = kb.each(folder2, ns.ldp('contains'))\n if (contents.length === 0) return resolve(null)\n contents.sort()\n console.log('New Album: ' + folder2)\n return resolve(contents[0]) // Start off new album\n })\n }\n })\n }\n } else {\n return resolve(contents[j])\n }\n }\n } // for\n })\n })\n }\n const endedListener = function (event) {\n const current = kb.sym(event.target.getAttribute('src'))\n if (!options.chain) return\n const tryNext = function (cur) {\n const current = cur\n moveOn(current).then(function (next) {\n if (!next) {\n console.log('No successor to ' + current)\n return\n }\n if (!looksRedundant(next)) {\n console.log('Moving on to ' + next)\n guessNames(next)\n controlRow.appendChild(audioControl(next, true)) // Force autoplay\n controlRow.removeChild(event.target)\n } else {\n console.log('Ignoring redundant ' + next)\n tryNext(next)\n }\n })\n }\n tryNext(current)\n }\n\n const audioControl = function (song, autoplay) {\n const audio = dom.createElement('audio')\n audio.setAttribute('controls', 'yes')\n // get audio with authenticated fetch\n kb.fetcher._fetch(song.uri)\n .then(function (response) {\n return response.blob()\n })\n .then(function (myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n audio.setAttribute('src', objectURL) // w640 h480 //\n })\n\n if (autoplay) {\n audio.setAttribute('autoplay', 'autoplay') // Make this a personal preference\n }\n audio.addEventListener('ended', endedListener, false)\n return audio\n }\n\n const div = dom.createElement('div')\n const table = div.appendChild(dom.createElement('table'))\n const labelStyle = 'padding: 0.3em; color:white; background-color: black;'\n const artistRow = table.appendChild(dom.createElement('tr'))\n artistRow.style.cssText = labelStyle\n const albumRow = table.appendChild(dom.createElement('tr'))\n albumRow.style.cssText = labelStyle\n const trackRow = table.appendChild(dom.createElement('tr'))\n trackRow.style.cssText = labelStyle\n const controlRow = table.appendChild(dom.createElement('tr'))\n guessNames(subject)\n controlRow.appendChild(audioControl(subject, options.autoplay))\n\n if (!kb.holds(undefined, ns.ldp('contains'), subject) && subject.dir()) {\n kb.fetcher.load(subject.dir()) // Prefetch enclosing @@ or playlist\n }\n\n return div\n }\n}\n\n// ends\n"],"mappings":"wIAKA,IAAM,EAAKA,EAAG,GAEd,EAAe,CACb,KAAMA,EAAG,MAAM,SAAW,kBAE1B,KAAM,QAGN,MAAO,SAAU,EAAS,EAAS,CAEjC,IAAM,EADK,EAAQ,QAAQ,MACP,aAAa,CAAO,EAElC,EAASC,EAAK,KAAK,eAAe,SAAS,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,GAClE,IAAK,IAAM,KAAK,EACd,GAAI,EAAE,WAAW,CAAM,EAAG,MAAO,aAEnC,OAAO,IACT,EAEA,OAAQ,SAAU,EAAS,EAAS,CAClC,IAAM,EAAK,EAAQ,QAAQ,MACrB,EAAM,EAAQ,IACd,EAA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I,CAAC,EAGxB,CACT,CACF"}
|
|
@@ -46,16 +46,19 @@ var n = e.ns, r = {
|
|
|
46
46
|
r.fetcher.load(o).then(function(s) {
|
|
47
47
|
let c = r.each(o, n.ldp("contains")), u;
|
|
48
48
|
c.sort();
|
|
49
|
-
for (let s = 0; s < c.length; s++) if (e.uri === c[s].uri)
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
for (let s = 0; s < c.length; s++) if (e.uri === c[s].uri) {
|
|
50
|
+
if (u = (s + 1) % c.length, u === 0) {
|
|
51
|
+
if (a.chainAlbums) {
|
|
52
|
+
if (t === 1 || !a.chainAlbums) return i(null);
|
|
53
|
+
l(o, t + 1).then(function(e) {
|
|
54
|
+
e && r.fetcher.load(e).then(function(t) {
|
|
55
|
+
let a = r.each(e, n.ldp("contains"));
|
|
56
|
+
return a.length === 0 ? i(null) : (a.sort(), console.log("New Album: " + e), i(a[0]));
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
} else return a.loop ? i(c[u]) : i(null);
|
|
60
|
+
} else return i(c[u]);
|
|
61
|
+
}
|
|
59
62
|
});
|
|
60
63
|
});
|
|
61
64
|
}, u = function(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audioPane.esm.js","names":["ns"],"sources":["../../src/audio/audioPane.js"],"sourcesContent":["/* Single audio play Pane\n **\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nconst ns = UI.ns\n\nexport default {\n icon: UI.icons.iconBase + 'noun_534313.svg',\n\n name: 'audio',\n\n // Does the subject deserve an audio play pane?\n label: function (subject, context) {\n const kb = context.session.store\n const typeURIs = kb.findTypeURIs(subject)\n\n const prefix = $rdf.Util.mediaTypeClass('audio/*').uri.split('*')[0]\n for (const t in typeURIs) {\n if (t.startsWith(prefix)) return 'Play audio'\n }\n return null\n },\n\n render: function (subject, context) {\n const kb = context.session.store\n const dom = context.dom\n const options = {\n autoplay: false,\n chain: true,\n chainAlbums: true,\n loop: false\n }\n\n const removeExtension = function (str) {\n const dot = str.lastIndexOf('.')\n if (dot < 0) return str // if any\n const slash = str.lastIndexOf('/')\n if (dot < slash) return str\n return str.slice(0, dot)\n }\n\n // True if there is another file like song.mp3 when this is \"song 1.mp3\"\n // or this is song.m4a\n //\n const looksRedundant = function (x) {\n const folder = kb.any(undefined, ns.ldp('contains'), x)\n if (!folder) return false\n const contents = kb.each(folder, ns.ldp('contains'))\n if (contents.length < 2) return false\n const thisName = x.uri\n for (let k = 0; k < contents.length; k++) {\n const otherName = contents[k].uri\n if (\n thisName.length > otherName.length &&\n thisName.startsWith(removeExtension(otherName))\n ) {\n return true\n }\n if (\n thisName.endsWith('.m4a') &&\n otherName.endsWith('.mp3') &&\n removeExtension(thisName) === removeExtension(otherName)\n ) {\n return true\n }\n }\n return false\n }\n\n // Alternative methods could include:\n // Accesing metadata in the audio contol, or paring the audio file\n const guessNames = function (x) {\n const a = x.uri.split('/').slice(-3) // Hope artist, album, track\n const decode = function (str) {\n try {\n return decodeURIComponent(str)\n } catch (e) {\n return str\n }\n }\n artistRow.textContent = decode(a[0])\n albumRow.textContent = decode(a[1])\n trackRow.textContent = decode(removeExtension(a[2]))\n }\n\n const moveOn = function (current, level) {\n return new Promise(function (resolve) {\n level = level || 0\n if (!options.chain) return resolve(null)\n // Ideally navigate graph else cheat with URI munging:\n const folder =\n kb.any(undefined, ns.ldp('contains'), current) || current.dir()\n if (!folder) return resolve(null)\n kb.fetcher.load(folder).then(function (_xhr) {\n const contents = kb.each(folder, ns.ldp('contains')) // @@ load if not loaded\n // if (contents.length < 2) return resolve(null) NO might move on from 1-track album\n let j\n contents.sort() // sort by URI which hopefully will get tracks in order\n for (let i = 0; i < contents.length; i++) {\n if (current.uri === contents[i].uri) {\n j = (i + 1) % contents.length\n if (j === 0) {\n if (!options.chainAlbums) {\n if (options.loop) {\n return resolve(contents[j])\n }\n return resolve(null) // No more music needed\n } else {\n // chain albums\n if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee\n moveOn(folder, level + 1).then(function (folder2) {\n if (folder2) {\n kb.fetcher.load(folder2).then(function (_xhr) {\n const contents = kb.each(folder2, ns.ldp('contains'))\n if (contents.length === 0) return resolve(null)\n contents.sort()\n console.log('New Album: ' + folder2)\n return resolve(contents[0]) // Start off new album\n })\n }\n })\n }\n } else {\n return resolve(contents[j])\n }\n }\n } // for\n })\n })\n }\n const endedListener = function (event) {\n const current = kb.sym(event.target.getAttribute('src'))\n if (!options.chain) return\n const tryNext = function (cur) {\n const current = cur\n moveOn(current).then(function (next) {\n if (!next) {\n console.log('No successor to ' + current)\n return\n }\n if (!looksRedundant(next)) {\n console.log('Moving on to ' + next)\n guessNames(next)\n controlRow.appendChild(audioControl(next, true)) // Force autoplay\n controlRow.removeChild(event.target)\n } else {\n console.log('Ignoring redundant ' + next)\n tryNext(next)\n }\n })\n }\n tryNext(current)\n }\n\n const audioControl = function (song, autoplay) {\n const audio = dom.createElement('audio')\n audio.setAttribute('controls', 'yes')\n // get audio with authenticated fetch\n kb.fetcher._fetch(song.uri)\n .then(function (response) {\n return response.blob()\n })\n .then(function (myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n audio.setAttribute('src', objectURL) // w640 h480 //\n })\n\n if (autoplay) {\n audio.setAttribute('autoplay', 'autoplay') // Make this a personal preference\n }\n audio.addEventListener('ended', endedListener, false)\n return audio\n }\n\n const div = dom.createElement('div')\n const table = div.appendChild(dom.createElement('table'))\n const labelStyle = 'padding: 0.3em; color:white; background-color: black;'\n const artistRow = table.appendChild(dom.createElement('tr'))\n artistRow.style.cssText = labelStyle\n const albumRow = table.appendChild(dom.createElement('tr'))\n albumRow.style.cssText = labelStyle\n const trackRow = table.appendChild(dom.createElement('tr'))\n trackRow.style.cssText = labelStyle\n const controlRow = table.appendChild(dom.createElement('tr'))\n guessNames(subject)\n controlRow.appendChild(audioControl(subject, options.autoplay))\n\n if (!kb.holds(undefined, ns.ldp('contains'), subject) && subject.dir()) {\n kb.fetcher.load(subject.dir()) // Prefetch enclosing @@ or playlist\n }\n\n return div\n }\n}\n\n// ends\n"],"mappings":";;;AAKA,IAAMA,IAAK,EAAG,IAEd,IAAe;CACb,MAAM,EAAG,MAAM,WAAW;CAE1B,MAAM;CAGN,OAAO,SAAU,GAAS,GAAS;EAEjC,IAAM,IADK,EAAQ,QAAQ,MACP,aAAa,CAAO,GAElC,IAAS,EAAK,KAAK,eAAe,SAAS,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;EAClE,KAAK,IAAM,KAAK,GACd,IAAI,EAAE,WAAW,CAAM,GAAG,OAAO;EAEnC,OAAO;CACT;CAEA,QAAQ,SAAU,GAAS,GAAS;EAClC,IAAM,IAAK,EAAQ,QAAQ,OACrB,IAAM,EAAQ,KACd,IAAU;GACd,UAAU;GACV,OAAO;GACP,aAAa;GACb,MAAM;EACR,GAEM,IAAkB,SAAU,GAAK;GACrC,IAAM,IAAM,EAAI,YAAY,GAAG;GAI/B,OAHI,IAAM,KAEN,IADU,EAAI,YAAY,GAChB,IAAU,IACjB,EAAI,MAAM,GAAG,CAAG;EACzB,GAKM,IAAiB,SAAU,GAAG;GAClC,IAAM,IAAS,EAAG,IAAI,KAAA,GAAWA,EAAG,IAAI,UAAU,GAAG,CAAC;GACtD,IAAI,CAAC,GAAQ,OAAO;GACpB,IAAM,IAAW,EAAG,KAAK,GAAQA,EAAG,IAAI,UAAU,CAAC;GACnD,IAAI,EAAS,SAAS,GAAG,OAAO;GAChC,IAAM,IAAW,EAAE;GACnB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAS,QAAQ,KAAK;IACxC,IAAM,IAAY,EAAS,EAAE,CAAC;IAO9B,IALE,EAAS,SAAS,EAAU,UAC5B,EAAS,WAAW,EAAgB,CAAS,CAAC,KAK9C,EAAS,SAAS,MAAM,KACxB,EAAU,SAAS,MAAM,KAC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I,cAAc,KAAK,GAC7B,IAAQ,EAAI,YAAY,EAAI,cAAc,OAAO,CAAC,GAClD,IAAa,yDACb,IAAY,EAAM,YAAY,EAAI,cAAc,IAAI,CAAC;EAC3D,EAAU,MAAM,UAAU;EAC1B,IAAM,IAAW,EAAM,YAAY,EAAI,cAAc,IAAI,CAAC;EAC1D,EAAS,MAAM,UAAU;EACzB,IAAM,IAAW,EAAM,YAAY,EAAI,cAAc,IAAI,CAAC;EAC1D,EAAS,MAAM,UAAU;EACzB,IAAM,IAAa,EAAM,YAAY,EAAI,cAAc,IAAI,CAAC;EAQ5D,OAPA,EAAW,CAAO,GAClB,EAAW,YAAY,EAAa,GAAS,EAAQ,QAAQ,CAAC,GAE1D,CAAC,EAAG,MAAM,KAAA,GAAWA,EAAG,IAAI,UAAU,GAAG,CAAO,KAAK,EAAQ,IAAI,KACnE,EAAG,QAAQ,KAAK,EAAQ,IAAI,CAAC,GAGxB;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"audioPane.esm.js","names":["ns"],"sources":["../../src/audio/audioPane.js"],"sourcesContent":["/* Single audio play Pane\n **\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nconst ns = UI.ns\n\nexport default {\n icon: UI.icons.iconBase + 'noun_534313.svg',\n\n name: 'audio',\n\n // Does the subject deserve an audio play pane?\n label: function (subject, context) {\n const kb = context.session.store\n const typeURIs = kb.findTypeURIs(subject)\n\n const prefix = $rdf.Util.mediaTypeClass('audio/*').uri.split('*')[0]\n for (const t in typeURIs) {\n if (t.startsWith(prefix)) return 'Play audio'\n }\n return null\n },\n\n render: function (subject, context) {\n const kb = context.session.store\n const dom = context.dom\n const options = {\n autoplay: false,\n chain: true,\n chainAlbums: true,\n loop: false\n }\n\n const removeExtension = function (str) {\n const dot = str.lastIndexOf('.')\n if (dot < 0) return str // if any\n const slash = str.lastIndexOf('/')\n if (dot < slash) return str\n return str.slice(0, dot)\n }\n\n // True if there is another file like song.mp3 when this is \"song 1.mp3\"\n // or this is song.m4a\n //\n const looksRedundant = function (x) {\n const folder = kb.any(undefined, ns.ldp('contains'), x)\n if (!folder) return false\n const contents = kb.each(folder, ns.ldp('contains'))\n if (contents.length < 2) return false\n const thisName = x.uri\n for (let k = 0; k < contents.length; k++) {\n const otherName = contents[k].uri\n if (\n thisName.length > otherName.length &&\n thisName.startsWith(removeExtension(otherName))\n ) {\n return true\n }\n if (\n thisName.endsWith('.m4a') &&\n otherName.endsWith('.mp3') &&\n removeExtension(thisName) === removeExtension(otherName)\n ) {\n return true\n }\n }\n return false\n }\n\n // Alternative methods could include:\n // Accesing metadata in the audio contol, or paring the audio file\n const guessNames = function (x) {\n const a = x.uri.split('/').slice(-3) // Hope artist, album, track\n const decode = function (str) {\n try {\n return decodeURIComponent(str)\n } catch (e) {\n return str\n }\n }\n artistRow.textContent = decode(a[0])\n albumRow.textContent = decode(a[1])\n trackRow.textContent = decode(removeExtension(a[2]))\n }\n\n const moveOn = function (current, level) {\n return new Promise(function (resolve) {\n level = level || 0\n if (!options.chain) return resolve(null)\n // Ideally navigate graph else cheat with URI munging:\n const folder =\n kb.any(undefined, ns.ldp('contains'), current) || current.dir()\n if (!folder) return resolve(null)\n kb.fetcher.load(folder).then(function (_xhr) {\n const contents = kb.each(folder, ns.ldp('contains')) // @@ load if not loaded\n // if (contents.length < 2) return resolve(null) NO might move on from 1-track album\n let j\n contents.sort() // sort by URI which hopefully will get tracks in order\n for (let i = 0; i < contents.length; i++) {\n if (current.uri === contents[i].uri) {\n j = (i + 1) % contents.length\n if (j === 0) {\n if (!options.chainAlbums) {\n if (options.loop) {\n return resolve(contents[j])\n }\n return resolve(null) // No more music needed\n } else {\n // chain albums\n if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee\n moveOn(folder, level + 1).then(function (folder2) {\n if (folder2) {\n kb.fetcher.load(folder2).then(function (_xhr) {\n const contents = kb.each(folder2, ns.ldp('contains'))\n if (contents.length === 0) return resolve(null)\n contents.sort()\n console.log('New Album: ' + folder2)\n return resolve(contents[0]) // Start off new album\n })\n }\n })\n }\n } else {\n return resolve(contents[j])\n }\n }\n } // for\n })\n })\n }\n const endedListener = function (event) {\n const current = kb.sym(event.target.getAttribute('src'))\n if (!options.chain) return\n const tryNext = function (cur) {\n const current = cur\n moveOn(current).then(function (next) {\n if (!next) {\n console.log('No successor to ' + current)\n return\n }\n if (!looksRedundant(next)) {\n console.log('Moving on to ' + next)\n guessNames(next)\n controlRow.appendChild(audioControl(next, true)) // Force autoplay\n controlRow.removeChild(event.target)\n } else {\n console.log('Ignoring redundant ' + next)\n tryNext(next)\n }\n })\n }\n tryNext(current)\n }\n\n const audioControl = function (song, autoplay) {\n const audio = dom.createElement('audio')\n audio.setAttribute('controls', 'yes')\n // get audio with authenticated fetch\n kb.fetcher._fetch(song.uri)\n .then(function (response) {\n return response.blob()\n })\n .then(function (myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n audio.setAttribute('src', objectURL) // w640 h480 //\n })\n\n if (autoplay) {\n audio.setAttribute('autoplay', 'autoplay') // Make this a personal preference\n }\n audio.addEventListener('ended', endedListener, false)\n return audio\n }\n\n const div = dom.createElement('div')\n const table = div.appendChild(dom.createElement('table'))\n const labelStyle = 'padding: 0.3em; color:white; background-color: black;'\n const artistRow = table.appendChild(dom.createElement('tr'))\n artistRow.style.cssText = labelStyle\n const albumRow = table.appendChild(dom.createElement('tr'))\n albumRow.style.cssText = labelStyle\n const trackRow = table.appendChild(dom.createElement('tr'))\n trackRow.style.cssText = labelStyle\n const controlRow = table.appendChild(dom.createElement('tr'))\n guessNames(subject)\n controlRow.appendChild(audioControl(subject, options.autoplay))\n\n if (!kb.holds(undefined, ns.ldp('contains'), subject) && subject.dir()) {\n kb.fetcher.load(subject.dir()) // Prefetch enclosing @@ or playlist\n }\n\n return div\n }\n}\n\n// ends\n"],"mappings":";;;AAKA,IAAMA,IAAK,EAAG,IAEd,IAAe;CACb,MAAM,EAAG,MAAM,WAAW;CAE1B,MAAM;CAGN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AS,MAAM,UAAU;EACzB,IAAM,IAAW,EAAM,YAAY,EAAI,cAAc,IAAI,CAAC;EAC1D,EAAS,MAAM,UAAU;EACzB,IAAM,IAAa,EAAM,YAAY,EAAI,cAAc,IAAI,CAAC;EAQ5D,OAPA,EAAW,CAAO,GAClB,EAAW,YAAY,EAAa,GAAS,EAAQ,QAAQ,CAAC,GAE1D,CAAC,EAAG,MAAM,KAAA,GAAWA,EAAG,IAAI,UAAU,GAAG,CAAO,KAAK,EAAQ,IAAI,KACnE,EAAG,QAAQ,KAAK,EAAQ,IAAI,CAAC,GAGxB;CACT;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=require("lit").css`:host div{text-align:right;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}:host div>*{flex:0 auto}:host .dirtyIndicator{color:#92400e;white-space:nowrap;background:#fffbeb;border:1px solid #f59e0b;border-radius:999px;align-items:center;padding:4px 8px;font-size:.72rem;font-weight:600;line-height:1;display:inline-flex}@media (width<=900px){:host div{padding-right:3px}}@media (width<=600px){:host div{justify-content:flex-start;gap:5px}}`;exports.default=e;
|
|
1
|
+
var e=require("lit").css`:host{flex:0 auto;min-width:0}:host div{text-align:right;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}:host div>*{flex:0 auto}:host .dirtyIndicator{color:#92400e;white-space:nowrap;background:#fffbeb;border:1px solid #f59e0b;border-radius:999px;align-items:center;padding:4px 8px;font-size:.72rem;font-weight:600;line-height:1;display:inline-flex}@media (width<=900px){:host div{padding-right:3px}}@media (width<=600px){:host div{justify-content:flex-start;gap:5px}}`;exports.default=e;
|
|
2
2
|
//# sourceMappingURL=FileExplorerHeaderControls.styles.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerHeaderControls.styles.cjs.js","names":[],"sources":["../../../src/components/file-explorer-header/FileExplorerHeaderControls.styles.css"],"sourcesContent":[":host {\n div {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 6px;\n flex: 0 0 auto;\n text-align: right;\n }\n\n /* generative ai */\n div > * {\n flex: 0 1 auto;\n }\n\n /* TODO: look into what colors to use this is just to show */\n .dirtyIndicator {\n display: inline-flex;\n align-items: center;\n border: 1px solid #F59E0B;\n color: #92400E;\n background: #FFFBEB;\n border-radius: 999px;\n font-size: 0.72rem;\n font-weight: 600;\n line-height: 1;\n padding: 4px 8px;\n white-space: nowrap;\n }\n\n @media (max-width: 900px) {\n div {\n padding-right: 3px;\n }\n }\n\n @media (max-width: 600px) {\n div {\n justify-content: flex-start;\n gap: 5px;\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"FileExplorerHeaderControls.styles.cjs.js","names":[],"sources":["../../../src/components/file-explorer-header/FileExplorerHeaderControls.styles.css"],"sourcesContent":[":host {\n flex: 0 1 auto;\n min-width: 0;\n\n div {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 6px;\n flex: 0 0 auto;\n text-align: right;\n }\n\n /* generative ai */\n div > * {\n flex: 0 1 auto;\n }\n\n /* TODO: look into what colors to use this is just to show */\n .dirtyIndicator {\n display: inline-flex;\n align-items: center;\n border: 1px solid #F59E0B;\n color: #92400E;\n background: #FFFBEB;\n border-radius: 999px;\n font-size: 0.72rem;\n font-weight: 600;\n line-height: 1;\n padding: 4px 8px;\n white-space: nowrap;\n }\n\n @media (max-width: 900px) {\n div {\n padding-right: 3px;\n }\n }\n\n @media (max-width: 600px) {\n div {\n justify-content: flex-start;\n gap: 5px;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css as e } from "lit";
|
|
2
2
|
//#region src/components/file-explorer-header/FileExplorerHeaderControls.styles.css
|
|
3
|
-
var t = e`:host div{text-align:right;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}:host div>*{flex:0 auto}:host .dirtyIndicator{color:#92400e;white-space:nowrap;background:#fffbeb;border:1px solid #f59e0b;border-radius:999px;align-items:center;padding:4px 8px;font-size:.72rem;font-weight:600;line-height:1;display:inline-flex}@media (width<=900px){:host div{padding-right:3px}}@media (width<=600px){:host div{justify-content:flex-start;gap:5px}}`;
|
|
3
|
+
var t = e`:host{flex:0 auto;min-width:0}:host div{text-align:right;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}:host div>*{flex:0 auto}:host .dirtyIndicator{color:#92400e;white-space:nowrap;background:#fffbeb;border:1px solid #f59e0b;border-radius:999px;align-items:center;padding:4px 8px;font-size:.72rem;font-weight:600;line-height:1;display:inline-flex}@media (width<=900px){:host div{padding-right:3px}}@media (width<=600px){:host div{justify-content:flex-start;gap:5px}}`;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { t as default };
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExplorerHeaderControls.styles.esm.js","names":[],"sources":["../../../src/components/file-explorer-header/FileExplorerHeaderControls.styles.css"],"sourcesContent":[":host {\n div {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 6px;\n flex: 0 0 auto;\n text-align: right;\n }\n\n /* generative ai */\n div > * {\n flex: 0 1 auto;\n }\n\n /* TODO: look into what colors to use this is just to show */\n .dirtyIndicator {\n display: inline-flex;\n align-items: center;\n border: 1px solid #F59E0B;\n color: #92400E;\n background: #FFFBEB;\n border-radius: 999px;\n font-size: 0.72rem;\n font-weight: 600;\n line-height: 1;\n padding: 4px 8px;\n white-space: nowrap;\n }\n\n @media (max-width: 900px) {\n div {\n padding-right: 3px;\n }\n }\n\n @media (max-width: 600px) {\n div {\n justify-content: flex-start;\n gap: 5px;\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"FileExplorerHeaderControls.styles.esm.js","names":[],"sources":["../../../src/components/file-explorer-header/FileExplorerHeaderControls.styles.css"],"sourcesContent":[":host {\n flex: 0 1 auto;\n min-width: 0;\n\n div {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 6px;\n flex: 0 0 auto;\n text-align: right;\n }\n\n /* generative ai */\n div > * {\n flex: 0 1 auto;\n }\n\n /* TODO: look into what colors to use this is just to show */\n .dirtyIndicator {\n display: inline-flex;\n align-items: center;\n border: 1px solid #F59E0B;\n color: #92400E;\n background: #FFFBEB;\n border-radius: 999px;\n font-size: 0.72rem;\n font-weight: 600;\n line-height: 1;\n padding: 4px 8px;\n white-space: nowrap;\n }\n\n @media (max-width: 900px) {\n div {\n padding-right: 3px;\n }\n }\n\n @media (max-width: 600px) {\n div {\n justify-content: flex-start;\n gap: 5px;\n }\n }\n}\n"],"mappings":""}
|
package/dist/n3Pane2.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border-top:solid 1px var(--color-data-pane-border-top,black);border-left:solid 1px var(--color-data-pane-border-top,black);border-bottom:solid 1px var(--color-data-pane-border-side,#777);border-right:solid 1px var(--color-data-pane-border-side,#777);color:var(--color-text-blue,#004);box-sizing:border-box;padding:1rem}.n3-pane__source{box-sizing:border-box;white-space:pre;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.n3-pane__line{white-space:pre}.n3-pane[data-layout=mobile] .n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane[data-layout=mobile] .n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}@media (width<=576px){.n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");;let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns;function i(e){if(e.trim().length===0)return 0;let t=0;for(let n of e){if(n===` `){t+=1;continue}if(n===` `){t+=2;continue}break}return Math.max(t,2)}var a={icon:t.icons.originalIconBase+`w3c/n3_smaller.png`,name:`n3`,audience:[r.solid(`Developer`)],label:function(e,t){let n=t.session.store;if(`http://www.w3.org/2007/ont/link#ProtocolEvent`in n.findTypeURIs(e))return null;let r=n.statementsMatching(void 0,void 0,void 0,e).length;return r===0?null:`Data (`+r+`) as N3`},render:function(e,t){let r=t.dom,a=t.session.store;function o(e){let n=t.environment??{};e.dataset.layout=n.layout??`desktop`}let s=r.createElement(`div`);s.setAttribute(`class`,`n3-pane`),o(s);let c=a.statementsMatching(void 0,void 0,void 0,e),l=n.Serializer(a);l.suggestNamespaces(a.namespaces),l.setBase(e.uri);let u=l.statementsToN3(c),d=r.createElement(`div`);return d.classList.add(`n3-pane__source`),u.split(`
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border-top:solid 1px var(--color-data-pane-border-top,black);border-left:solid 1px var(--color-data-pane-border-top,black);border-bottom:solid 1px var(--color-data-pane-border-side,#777);border-right:solid 1px var(--color-data-pane-border-side,#777);width:100%;min-width:0;color:var(--color-text-blue,#004);box-sizing:border-box;padding:1rem}.n3-pane__source{box-sizing:border-box;white-space:pre;min-width:0;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.n3-pane__line{white-space:pre}.n3-pane[data-layout=mobile] .n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane[data-layout=mobile] .n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}@media (width<=576px){.n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");;let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns;function i(e){if(e.trim().length===0)return 0;let t=0;for(let n of e){if(n===` `){t+=1;continue}if(n===` `){t+=2;continue}break}return Math.max(t,2)}var a={icon:t.icons.originalIconBase+`w3c/n3_smaller.png`,name:`n3`,audience:[r.solid(`Developer`)],label:function(e,t){let n=t.session.store;if(`http://www.w3.org/2007/ont/link#ProtocolEvent`in n.findTypeURIs(e))return null;let r=n.statementsMatching(void 0,void 0,void 0,e).length;return r===0?null:`Data (`+r+`) as N3`},render:function(e,t){let r=t.dom,a=t.session.store;function o(e){let n=t.environment??{};e.dataset.layout=n.layout??`desktop`}let s=r.createElement(`div`);s.setAttribute(`class`,`n3-pane`),o(s);let c=a.statementsMatching(void 0,void 0,void 0,e),l=n.Serializer(a);l.suggestNamespaces(a.namespaces),l.setBase(e.uri);let u=l.statementsToN3(c),d=r.createElement(`div`);return d.classList.add(`n3-pane__source`),u.split(`
|
|
2
2
|
`).forEach(e=>{let t=r.createElement(`div`),n=i(e);t.classList.add(`n3-pane__line`),t.style.setProperty(`--n3-indent`,`${n}ch`),t.textContent=e.length>0?e:` `,d.appendChild(t)}),s.appendChild(d),s}};exports.n3Pane=a;
|
|
3
3
|
//# sourceMappingURL=n3Pane2.cjs.js.map
|
package/dist/n3Pane2.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border-top:solid 1px var(--color-data-pane-border-top,black);border-left:solid 1px var(--color-data-pane-border-top,black);border-bottom:solid 1px var(--color-data-pane-border-side,#777);border-right:solid 1px var(--color-data-pane-border-side,#777);color:var(--color-text-blue,#004);box-sizing:border-box;padding:1rem}.n3-pane__source{box-sizing:border-box;white-space:pre;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.n3-pane__line{white-space:pre}.n3-pane[data-layout=mobile] .n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane[data-layout=mobile] .n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}@media (width<=576px){.n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border-top:solid 1px var(--color-data-pane-border-top,black);border-left:solid 1px var(--color-data-pane-border-top,black);border-bottom:solid 1px var(--color-data-pane-border-side,#777);border-right:solid 1px var(--color-data-pane-border-side,#777);width:100%;min-width:0;color:var(--color-text-blue,#004);box-sizing:border-box;padding:1rem}.n3-pane__source{box-sizing:border-box;white-space:pre;min-width:0;max-width:100%;margin:0;font-family:monospace;font-size:120%;overflow-x:auto}.n3-pane__line{white-space:pre}.n3-pane[data-layout=mobile] .n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane[data-layout=mobile] .n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}@media (width<=576px){.n3-pane__source{overflow-wrap:anywhere;word-break:break-word;white-space:normal}.n3-pane__line{white-space:pre-wrap;padding-left:var(--n3-indent,0);text-indent:calc(-1 * var(--n3-indent,0))}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
import * as e from "solid-ui";
|
|
3
3
|
import * as t from "rdflib";
|
|
4
4
|
//#region src/n3Pane.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.obj{vertical-align:top;border:none;margin:.2em;padding:0}.iconTD{vertical-align:top;border:none;width:0;margin:.2em;padding:0}.labelTD{width:100%}.file-explorer-header{flex-wrap:wrap;justify-content:flex-start;align-items:center;display:flex}.strongHeader{margin:0 .6rem 0 0;padding:.1rem .4rem;font-size:150%}.tableFullWidth{width:100%;background:var(--color-background,#f8f9fb)!important}.placeholderTable{width:100%}.tdFlex{border:1px solid var(--color-border,#444);vertical-align:top;background:var(--solid-ui-color-white,#fff);border-radius:5px;flex-direction:row;justify-content:space-between;display:flex;overflow:hidden}.paneDiv,.exceptionPane{width:100%;min-width:0;display:block}.objectValue--literal{white-space:pre-wrap}.objectValue--integer,.objectValue--decimal,.objectValue--double{text-align:right;display:block}.objectValueAccessIcon,.objectValueLinkIcon,.phoneIcon{vertical-align:middle;display:inline-block}.objectValueLinkIcon,.phoneIcon{width:12px;height:12px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;const t=require("./propertyViews.cjs.js"),n=require("./outlineIcons.cjs.js"),r=require("./userInput.cjs.js"),i=require("./queryByExample.cjs.js"),a=require("../utils/webIdUtils.cjs.js"),o=require("../utils/podUtils.cjs.js");require("../components/file-explorer-header/FileExplorerProvider.cjs.js");let s=require("solid-ui");s=e.__toESM(s);let c=require("solid-logic"),l=require("pane-registry");l=e.__toESM(l);let u=require("rdflib");u=e.__toESM(u);function d(e){let d=e.dom;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let f=this,p=this,m=[];this.selection=m,this.ancestor=s.utils.ancestor,this.sparql=u.UpdateManager,this.kb=c.store;let h=c.store,g=c.store.fetcher;d.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let _=this.outlineElement;this.init=function(){let e=b();e.outline=this},this.getLayoutMode=function(){let e=this.context?.environment?.layout;if(e===`mobile`||e===`desktop`)return e;if(typeof window<`u`&&window.matchMedia){let e=Math.round(Math.min(window.innerWidth,window.visualViewport?.width||window.innerWidth)),t=window.matchMedia(`(pointer: coarse)`).matches||navigator.maxTouchPoints>0;return e<=768||t&&e<=1024?`mobile`:`desktop`}return`desktop`},v.lastkbsize=0;function v(e){let t=[];for(let e=arguments.length-1;e>0;e--)t[e-1]=arguments[e];let n=new Date().getTime(),r=e.apply(e,t),i=new Date().getTime();return s.log.info(`BENCHMARK: kb delta: `+(h.statements.length-v.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),v.lastkbsize=h.statements.length,r}function y(e,t,r){let i=s.utils.AJARImage(n.outlineIcons.src.icon_remove_node,`remove`,void 0,d);return i.addEventListener(`click`,K),i.node=r,i.setAttribute(`about`,t.toNT()),i.style.marginLeft=`5px`,i.style.marginRight=`10px`,e.appendChild(i),i}this.appendAccessIcons=function(e,t,n){if(n.termType!==`NamedNode`)return;let r=e.uris(n);r.sort();let i=null;for(let e=0;e<r.length;e++)r[e]!==i&&(i=r[e],p.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=u.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=g.getState(r),a,o,c;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,c=G;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,c=U;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,c=W,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,c=U;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,c=U,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,c=U,o=`cannot fetch`;break;default:s.log.error(`?? state = `+i)}let l=s.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),d);return l.classList.add(`objectValueAccessIcon`),l.setAttribute(`uri`,t),l.addEventListener(`click`,c),P(l,r),e.appendChild(l),l},this.outlineObjectTD=function(e,t,n,r){let i=d.createElement(`td`);return i.classList.add(`obj`),i.setAttribute(`notSelectable`,`false`),e?((e.termType===`NamedNode`||e.termType===`BlankNode`||e.termType===`Literal`&&e.value.slice&&(e.value.slice(0,6)===`ftp://`||e.value.slice(0,8)===`https://`||e.value.slice(0,7)===`http://`))&&(i.setAttribute(`about`,e.toNT()),i.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-expand-trans.png`,`expand`,void 0,d)).addEventListener(`click`,V)),i.setAttribute(`class`,`obj`),h.whether(e,s.ns.rdf(`type`),s.ns.link(`Request`))&&(i.className=`undetermined`),t||=ne,i.appendChild(t(e)),n&&y(i,e,n),i.tabulatorSelect=function(){z(this,!0)},i.tabulatorDeselect=function(){z(this,!1)},i.addEventListener(`click`,q),i):(i.textContent=`No object available.`,i)},this.outlinePredicateTD=function(e,t,r,i){let a=d.createElement(`TD`);a.setAttribute(`about`,e.toNT()),a.setAttribute(`class`,i?`pred internal`:`pred`);let o;switch(e.termType){case`BlankNode`:a.className=`undetermined`;break;case`NamedNode`:o=s.utils.predicateLabelForXML(e,r);break;case`Collection`:o=s.utils.predicateLabelForXML(e.elements[0],r)}o=o?o.slice(0,1).toUpperCase()+o.slice(1):`...`;let c=d.createElement(`TD`);c.classList.add(`labelTD`),c.setAttribute(`notSelectable`,`true`),c.appendChild(d.createTextNode(o)),a.appendChild(c),c.style.width=`100%`,a.appendChild(N.construct(d));for(let e in n.outlineIcons.termWidgets){if(!t||!t.AJAR_statement)break;n.outlineIcons.termWidgets[e].filter&&n.outlineIcons.termWidgets[e].filter(t.AJAR_statement,`pred`,r)&&N.addIcon(a,n.outlineIcons.termWidgets[e])}return a.tabulatorSelect=function(){z(this,!0)},a.tabulatorDeselect=function(){z(this,!1)},a.addEventListener(`click`,q),a};function b(){return C(`OutlineView`,`Resource browser`)}function x(){return document.querySelector(`solid-panes-navbar`)}function S(){let e=x();e&&e.classList.remove(`navbar--hidden`)}function C(e){if(document.getElementById(`MainContent`)||document.body,e===`OutlineView`){let e=document.getElementById(`OutlineView`);if(e)return e;let t=document.getElementById(`MainContent`)||document.body;if(t){let e=document.createElement(`table`);return e.id=`OutlineView`,e.classList.add(`outline-view`),e.setAttribute(`aria-label`,`Resource browser`),t.appendChild(e),e}}}async function w(e,t){e.uri.endsWith(`/`)&&await o.loadContainerRepresentation(e);let n=t.session.paneRegistry,r=n.list.filter(n=>n.label(e,t)&&!n.global&&n.name!==`sharing`);if(r.length===0)return[n.byName(`internal`)];let i=await s.login.filterAvailablePanes(r);return i.length===0?[r[0]]:n.list.indexOf(r[0])<n.list.indexOf(i[0])?[r[0]].concat(i):i}function T(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function E(e){let t=d.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function D(t,n,r,i){if(!t||!r)return;let a;try{s.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=d.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=d.createElement(`pre`);a.appendChild(t),t.appendChild(d.createTextNode(s.utils.stackString(e)))}a.classList.add(`paneDiv`);let o=t.querySelector(`.paneDiv`);o?o.replaceWith(a):t.appendChild(a)}function O(e,t){let n=d.getElementById(`OutlineView`);if(!n)return;let r=e.toNT(),i=n.querySelector(`td.paneView[about="`+r+`"]`);if(!i)return;let a=i.querySelector(`file-explorer-provider`);if(a){if(!t){s.log.warn(`outline: Unable to open pane in place: pane is undefined.`);return}E(!!t.requireQueryButton),a.openSelectedPane?.(t),D(a,e,t,a.paneRenderOptions)}}async function ee(t,n,r){r||={};let i=d.createElement(`tr`);r.hover&&i.classList.add(`hoverControl`);let o=i.appendChild(d.createElement(`td`));o.classList.add(`paneView`,`tdFlex`),o.setAttribute(`notSelectable`,`true`),o.setAttribute(`about`,t.toNT()),o.setAttribute(`colspan`,`2`);let s=o.appendChild(d.createElement(`file-explorer-provider`));s.context=e,s.subjectUri=t.uri,s.onBack=()=>H({target:s});let c=r.hideList?[]:await w(t,e);return s.relevantPanes=c,s.pane=n||T(c,t),s.showHeader=!(t&&t.uri&&t.site&&t.site().uri===t.uri)&&!a.isWebIdUri(t),s.paneRenderOptions=r,s.soloPane=r.solo,s.openPane=(e,t)=>O(e,l.byName(t)),s.handleSharingClick=()=>O(t,l.byName(`sharing`)),s.pane&&(i.classList.add(`outlinePaneRow`),D(s,t,s.pane,r)),i}function k(e){let t=e.parentNode,n=t.parentNode,r=d.createElement(`table`);r.classList.add(`placeholderTable`),n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let A=this.propertyTable=function(e,t,n,r){return s.log.debug(`Property table for: `+e),e=h.canon(e),t?(s.log.info(`Re-expand: `+t),t):(t=d.createElement(`table`),t.classList.add(`tableFullWidth`),ee(e,n,r).then(e=>{t.appendChild(e)}),t)};function j(e,t,n){let r=e.createElement(`TR`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`);let i=p.outlinePredicateTD(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=j;function M(e,t,n,r){if(s.log.debug(`Property list length = `+t.length),t.length===0)return``;let i,a,o;n?(i=function(e){return e.subject},t=t.sort(s.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(s.utils.RDFComparePredicateObject));let c=t.length;for(a=0;a<c;a++){let l=t[a];if(r&&!r(l.predicate,n))continue;let u=j(d,l,n);e.appendChild(u);let m=u.firstChild,g=$.defaults[l.predicate.uri],_=0,v=0,y=0;for(o=0;o+a<c&&t[a+o].predicate.sameTerm(l.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&_++,i(t[a+o]).lang&&f.labeller.LanguagePreference&&(v+=1,i(t[a+o]).lang.indexOf(f.labeller.LanguagePreference)>=0&&y++);if(y>0&&v===_+1){for(let e=a;e<=a+_;e++)if(f.labeller.LanguagePreference&&i(t[e]).lang.indexOf(f.labeller.LanguagePreference)>=0){u.appendChild(p.outlineObjectTD(i(t[e]),g,void 0,l));break}a+=_;continue}u.appendChild(p.outlineObjectTD(i(l),g,void 0,l)),u.showNobj=function(r){let c=o-_,u=2*r<c?r:c,f=[];if(c!==1){m.setAttribute(`rowspan`,u===c?c:r+1);let _;u<c&&u===1&&m.setAttribute(`rowspan`,2);let v=0;for(_=1;_<o;_++)if(h.canon(i(t[a+_])).sameTerm(h.canon(i(t[a+_-1]))))s.log.info(`there are duplicates here: %s`,t[a+_-1]);else{v++,l=t[a+_],g=$.defaults[l.predicate.uri];let r=d.createElement(`tr`);r.style.colspan=`1`,r.appendChild(p.outlineObjectTD(i(t[a+_]),g,void 0,l)),r.AJAR_statement=l,r.AJAR_inverse=n,e.appendChild(r),v>=u&&(r.style.display=`none`,f.push(r))}u===c&&m.setAttribute(`rowspan`,v+1)}if(u<c){let t=d.createElement(`tr`),n=t.appendChild(d.createElement(`td`));if(n.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),n.setAttribute(`notSelectable`,`false`),c>r){let e=d.createElement(`a`);n.appendChild(e);let t=(function(e){return e(m,o,_,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,d)),e.appendChild(d.createTextNode(c-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,d)),t.setAttribute(`rowspan`,c+1));for(let e=0;e<f.length;e++){let t=f[e];t.style.display=n}}}),i=`none`,a=function(e){return t(i),i=i===`none`?``:`none`,e&&e.stopPropagation(),!1};a(),e.addEventListener(`click`,a,!1)}e.appendChild(t)}},u.showAllobj=function(){u.showNobj(o-_)},u.showNobj(10),a+=o-1}}this.appendPropertyTRs=M;let N={};globalThis.termWidget=N,N.construct=function(e){e||=document;let t=e.createElement(`TD`);return t.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),t.setAttribute(`class`,`iconTD`),t.setAttribute(`notSelectable`,`true`),t.style.width=`0px`,t},N.addIcon=function(e,t,n){let r=e.childNodes[1];if(!r)return;let i=r.style.width,a=s.utils.AJARImage(t.src,t.alt,t.tooltip,d);i=parseInt(i),i+=t.width,r.style.width=i+`px`,r.appendChild(a),n&&a.addEventListener(`click`,n)},N.removeIcon=function(e,t){let n=e.childNodes[1],r;if(!n)return;let i=n.style.width;i=parseInt(i),i-=t.width,n.style.width=i+`px`;for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e],a=i.src;try{r=d.location.href.split(`?`)[0]}catch{r=``}a===u.uri.join(t.src,r)&&n.removeChild(i)}},N.replaceIcon=function(e,t,n,r){N.removeIcon(e,t),N.addIcon(e,n,r)};function P(e,t){s.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!f.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};g.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),g.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),g.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function F(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function I(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,L),t.parentNode.parentNode.removeAttribute(`optional`)}function L(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,I),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function R(e,t){let r=n.outlineIcons.termWidgets.optOn,i=n.outlineIcons.termWidgets.optOff;for(let n=e;n.parentNode;n=n.parentNode)for(;;)if(n.getAttribute(`predTR`)){let e=n.getAttribute(`parentOfSelected`);e=e?parseInt(e):0,e===0&&t>0&&N.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?I:L),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),N.removeIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i));break}else if(n.previousSibling&&n.previousSibling.nodeName===`TR`)n=n.previousSibling;else break}this.statusBarClick=function(e){let t=s.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&d.getElementById(`UserURI`)&&(d.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)},this.showSource=function(){if(!(typeof sourceWidget>`u`)){for(let e in sourceWidget.sources)sourceWidget.sources[e].setAttribute(`class`,``);for(let e=0;e<m.length;e++){if(!m[e].parentNode)continue;let t=m[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return m};function z(e,t){if(e.nodeName!==`TD`)throw s.log.debug(`down`+e.nodeName),Error(`Expected TD in setSelected: `+e.nodeName+` : `+e.textContent);s.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,1),m.push(e);let t=s.utils.getTerm(e);p.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;c.store.updater.editable(t.uri,h)&&r.indexOf(`pred`)>=0&&N.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else s.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,-1),r.indexOf(`pred`)>=0&&N.removeIcon(e,n.outlineIcons.termWidgets.addTri),m=m.filter(function(t){return t===e}),s.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&p.showSource(),e.setAttribute(`class`,r)}function B(){let e=m.length;for(let t=e-1;t>=0;t--)z(m[t],!1);m=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return s.log.error(`can't get target for event `+e),!1;return t.nodeType===3&&(t=t.parentNode),t},this.walk=function(e,t){let n=t||m[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}B(),z(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}B(),z(r,!0);break;case`right`:if(B(),n.nextSibling||n.lastChild.tagName===`strong`)z(n.nextSibling,!0);else{let e=d.evaluate(`table/div/tr/td[2]`,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;z(e,!0)}break;case`left`:if(B(),n.previousSibling&&n.previousSibling.className===`undetermined`)return z(n.previousSibling,!0),!0;z(s.utils.ancestor(n.parentNode,`TD`),!0);break;case`moveTo`:B(),z(t,!0)}(e===`down`||e===`up`)&&(r.tabulatorSelect||this.walk(e))},this.OutlinerKeypressPanel=function(e){s.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&d.getElementById(`UserURI`)&&(d.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]?!0:(o(`right`,a),t(s.utils.getAbout(h,m[0])),!0)}let r,i;if(s.utils.getTarget(e).tagName===`TEXTAREA`||s.utils.getTarget(e).id===`UserURI`||m.length>1)return;if(m.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,p.focusTd),t(s.utils.getAbout(h,m[0])));return}let a=m[0];switch(g.removeCallback(`done`,`setSelectedAfterward`),g.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(s.utils.getTarget(e).tagName===`HTML`){let e=s.utils.getAbout(h,a);r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),e?f.GotoSubject(e,!0):i&&p.UserInput.Enter(a)}else this.UserInput.Keypress(e),this.walk(`down`),e.stopPropagation();return;case 38:this.walk(`up`),e.stopPropagation(),e.preventDefault();break;case 40:this.walk(`down`),e.stopPropagation(),e.preventDefault()}if(s.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=s.utils.ancestor(a.parentNode,`TD`);Z(a,s.utils.getAbout(h,e));break}case 39:{let e=s.utils.getAbout(h,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstChild.tagName!==`TABLE`&&(g.addCallback(`done`,n),g.addCallback(`fail`,n),X(a,e,{pane:l.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){p.UserInput.copyToClipboard(p.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){p.UserInput.pasteFromClipboard(p.clipboardAddress,a);break}break;default:s.utils.getTarget(e).tagName}}t(s.utils.getAbout(h,m[0]))},this.OutlinerMouseclickPanel=function(e){switch(p.UserInput._tabulatorMode){case 0:J(e);break;case 1:p.UserInput.Click(e)}};function V(e){let t=p.targetOf(e),n=t.parentNode,r=s.utils.getAbout(h,t),i=e.altKey?l.byName(`internal`):void 0;e.shiftKey?Q(n,r,i):e.altKey?X(n,r,{pane:l.byName(`internal`),immediate:!0}):X(n,r)}function H(e){let t=p.targetOf(e),n=s.utils.getAbout(h,t),r=e.altKey?l.byName(`internal`):void 0,i=t.parentNode.parentNode;Z(i,n,r)}function U(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function W(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function G(e){let t=p.targetOf(e).getAttribute(`uri`);g.fetch(u.uri.docpart(t))}function K(e){let t=p.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),k(n)}function q(e){if(p.UserInput._tabulatorMode)return p.UserInput.Click(e);let t=p.targetOf(e),n;for(n=s.utils.ancestor(t,`TD`);n&&n.getAttribute(`notSelectable`)!==`false`;n=s.utils.ancestor(n.parentNode,`TD`));if(!n)return;let r=F(n);if(s.log.debug(`Was node selected before: `+r),e.altKey)z(n,!F(n));else if(e.shiftKey)z(n,!0);else{if(B(),p.UserInput.clearInputAndSave(e),z(n,!0),e.detail===2){e.stopPropagation();return}let t;if(n.parentNode&&(t=n.parentNode.AJAR_statement),!t)return;let i=t.why,a=c.store.updater.editable(i.uri,h);r&&a&&p.UserInput.Click(e,m[0])}s.log.debug(`Was node selected after: `+F(n)+`, count=`+m.length),e.stopPropagation()}function J(e){s.log.info(`@TabulatorMousedown, dom.location is now `+d.location);let t=p.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(p.UserInput.clearMenu(),p.UserInput.lastModified&&p.UserInput.lastModified.parentNode.nextSibling&&p.UserInput.backOut(),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices&&t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_add_triple)&&p.UserInput.clearInputAndSave(e),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices)&&p.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){d.title=s.utils.label(e),d.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;s.log.info(`@outlineExpand, dom is now `+d.location),g.removeCallback(`done`,`expand`),g.removeCallback(`fail`,`expand`);let o=h.canon(t);function c(){if(o=h.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;if(s.log.info(`@@ REPAINTING `),!i)t=A(o,void 0,r,n);else{for(s.log.info(` ... p is `+e),t=e.firstChild;t.nextSibling&&(s.log.info(` ... checking node `+t),t.nodeName!==`table`);t=t.nextSibling);t=A(o,t,r,n)}i=!0,s.utils.ancestor(e,`TABLE`)&&s.utils.ancestor(e,`TABLE`).style.backgroundColor===`white`?t.style.backgroundColor=`#eee`:t.style.backgroundColor=`white`,s.utils.emptyNode(e).appendChild(t),p.focusTd=e,s.log.debug(`expand: Node for `+o+` expanded`);let a=h.each(o,s.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&s.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),g.lookUpThing(a[e],o)}function l(e){if(arguments[3])return!0;let t=h.canon(o);s.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=h.sym(u.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=h.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=u.uri.docpart(r[t]);n;n=h.HTTPRedirects[n])if(e===n)return!0;return!!h.anyStatementMatching(t,void 0,void 0,n)}()||(s.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),c(),!1)}n.solo&&Y(o),s.log.debug(`outlineExpand: dereferencing `+o);let f=d.createElement(`span`);e.appendChild(f),g.addCallback(`done`,l),g.addCallback(`fail`,l);let m=[];if(o.uri&&o.uri.split(`:`)[0]===`rdf`){c();return}for(let e=0;e<m.length;e++){let t;if(t===m[e](o)){c(),s.log.debug(`outline 1815`),t[1]&&_.removeChild(_.lastChild);return}}if(o.uri&&!a&&!s.widgets.isAudio(o)&&!s.widgets.isVideo(o)){let t=o.doc()&&o.doc().uri?o.doc().uri:``+o.doc(),r=function(e){let t=!!(o&&o.uri&&o.site&&o.site().uri===o.uri);return e===403?t?`This root resource is not accessible with your current permissions. Try logging in with an authorized account or opening a public profile document.`:`This resource is not accessible with your current permissions.`:t?`This root resource is not publicly readable. Try logging in or opening a profile document.`:`This resource is not publicly readable. Try logging in or opening a different public resource.`},i=function(e,t){let n=typeof e==`string`?e:String(e||``),r=t?.status||t?.response?.status;return r===401||r===403?r:n.includes(`status: 403`)||n.includes(`status 403`)?403:n.includes(`status: 401`)||n.includes(`status 401`)?401:null},a=function(n,a){if(e.querySelector&&t&&e.querySelector(`[data-outline-error-for="`+t+`"]`))return;let o=i(n,a),c=o?r(o):n,l=s.widgets.errorMessageBlock(d,c,`#fee`,a instanceof Error?a:void 0);t&&l.setAttribute(`data-outline-error-for`,t),e.appendChild(l)},l=!1,u=g.nowOrWhenFetched(o.doc(),void 0,function(e,t){e?(g.lookUpThing(o),c(),n.solo&&Y(o)):(l=!0,a(t,void 0))});u&&typeof u.catch==`function`&&u.catch(function(e){l||(l=!0,a(e,e))})}else c()}function Z(e,t){let n=s.utils.ancestor(e,`TR`);n=s.utils.ancestor(n.parentNode,`TR`);let r;n&&(r=n.AJAR_statement);let i;for(i=e.parentNode;i.tagName!==`TD`;i=i.parentNode)if(i===void 0){alert(`Not enclosed in TD!`);return}s.log.debug(`Collapsing subject `+t);let a;r&&(s.log.debug(`looking up pred `+r.predicate.uri+`in defaults`),a=$.defaults[r.predicate.uri]),s.log.debug(`view= `+a);let o;i.parentNode.parentNode.id===`outline`&&(o=i.parentNode),p.replaceTD(p.outlineObjectTD(t,a,o,r),i)}this.replaceTD=function(e,t){let n;F(t)&&(n=!0);for(let e=m.length-1;e>-1;e--)for(let n=m[e];n.parentNode;n=n.parentNode)n===t&&z(m[e],!1);t.parentNode.replaceChild(e,t),n&&z(e,!0)};function Q(e,t){let n=null;for(let t=e.parentNode;t;t=t.parentNode)s.log.debug(`level `+t.tagName),t.tagName===`TD`&&(n=t);s.utils.emptyNode(n).appendChild(A(t)),Y(t),n.setAttribute(`about`,t.toNT())}f.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&f.GotoFormURI(e)},this.GotoFormURI=function(e){te(d.getElementById(`UserURI`).value)};function te(e){let t=h.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=h.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o=!0){let c=b();o&&(!a||a===c)&&S(),a||=c,r&&(s.utils.emptyNode(a),a.style.width=`100%`);function l(){let t=d.createElement(`tr`);t.classList.add(`outlineRow1`),t.style.verticalAlign=`top`,a.appendChild(t);let n=p.outlineObjectTD(e,void 0,t);return t.appendChild(n),n}let u=l();if(r&&Y(e),t&&X(u,e,{pane:n,solo:r}),r&&d&&d.defaultView&&d.defaultView.history){let t=d.defaultView.history.state||{},r=n?{paneName:n.name}:{};n&&n.subject&&typeof n.subject.uri==`string`&&(r.paneUri=n.subject.uri);let i={...t,...r};try{let n=new URL(document.location.href),r=new URL(e.uri,document.location.href);n.origin===r.origin&&(document.location.href===e.uri?JSON.stringify(t)!==JSON.stringify(i)&&d.defaultView.history.replaceState(i,e.uri,e.uri):d.defaultView.history.pushState(i,e.uri,e.uri))}catch{}}return e};let $=t.propertyViews(d);function ne(t){let r;if(t.termType===`Literal`){if(r=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=s.ns.xsd(``).uri;t.datatype.uri.slice(0,e.length)===e&&r.classList.add(`objectValue--`+t.datatype.uri.slice(e.length))}}else if(t.termType===`NamedNode`||t.termType===`BlankNode`)if(r=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),p.appendAccessIcons(h,r,t),t.termType===`NamedNode`)if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=d.createElement(`a`);r.appendChild(d.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(s.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,d)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(d.createTextNode(s.utils.label(t)));let e=s.widgets.linkIcon(d,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),s.widgets.makeDraggable(r,t)}else r.appendChild(d.createTextNode(s.utils.label(t)));else if(t.termType===`Collection`){r=d.createElement(`table`),r.classList.add(`tableFullWidth`),r.setAttribute(`about`,t.toNT());for(let e=0;e<t.elements.length;e++){let n=t.elements[e],i=r.appendChild(d.createElement(`tr`)),a=i.appendChild(d.createElement(`td`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(p.outlineObjectTD(n))}}else t.termType===`Graph`?(r=l.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(s.log.error(`Object `+t+` has unknown term type: `+t.termType),r=d.createTextNode(`[unknownTermType:`+t.termType+`]`));return s.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){d.getElementById(`UserURI`).value=d.URL+`?uri=`+d.getElementById(`UserURI`).value},this.UserInput.setSelected=z,this.UserInput.deselectAll=B,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=d;
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.obj{vertical-align:top;border:none;margin:.2em;padding:0}.iconTD{vertical-align:top;border:none;width:0;margin:.2em;padding:0}.labelTD{width:100%}.file-explorer-header{flex-wrap:wrap;justify-content:flex-start;align-items:center;display:flex}.strongHeader{margin:0 .6rem 0 0;padding:.1rem .4rem;font-size:150%}.tableFullWidth{width:100%;background:var(--color-background,#f8f9fb)!important}.placeholderTable{width:100%}.tdFlex{border:1px solid var(--color-border,#444);vertical-align:top;background:var(--solid-ui-color-white,#fff);border-radius:5px;flex-direction:row;justify-content:space-between;display:flex;overflow:hidden}.paneDiv,.exceptionPane{width:100%;min-width:0;display:block}.objectValue--literal{white-space:pre-wrap}.objectValue--integer,.objectValue--decimal,.objectValue--double{text-align:right;display:block}.objectValueAccessIcon,.objectValueLinkIcon,.phoneIcon{vertical-align:middle;display:inline-block}.objectValueLinkIcon,.phoneIcon{width:12px;height:12px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;const t=require("./propertyViews.cjs.js"),n=require("./outlineIcons.cjs.js"),r=require("./userInput.cjs.js"),i=require("./queryByExample.cjs.js"),a=require("../utils/webIdUtils.cjs.js"),o=require("../utils/podUtils.cjs.js");require("../components/file-explorer-header/FileExplorerProvider.cjs.js");let s=require("solid-ui");s=e.__toESM(s);let c=require("solid-logic"),l=require("pane-registry");l=e.__toESM(l);let u=require("rdflib");u=e.__toESM(u);function d(e){let d=e.dom;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let f=this,p=this,m=[];this.selection=m,this.ancestor=s.utils.ancestor,this.sparql=u.UpdateManager,this.kb=c.store;let h=c.store,g=c.store.fetcher;d.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let _=this.outlineElement;this.init=function(){let e=b();e.outline=this},this.getLayoutMode=function(){let e=this.context?.environment?.layout;if(e===`mobile`||e===`desktop`)return e;if(typeof window<`u`&&window.matchMedia){let e=Math.round(Math.min(window.innerWidth,window.visualViewport?.width||window.innerWidth)),t=window.matchMedia(`(pointer: coarse)`).matches||navigator.maxTouchPoints>0;return e<=768||t&&e<=1024?`mobile`:`desktop`}return`desktop`},v.lastkbsize=0;function v(e){let t=[];for(let e=arguments.length-1;e>0;e--)t[e-1]=arguments[e];let n=new Date().getTime(),r=e.apply(e,t),i=new Date().getTime();return s.log.info(`BENCHMARK: kb delta: `+(h.statements.length-v.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),v.lastkbsize=h.statements.length,r}function y(e,t,r){let i=s.utils.AJARImage(n.outlineIcons.src.icon_remove_node,`remove`,void 0,d);return i.addEventListener(`click`,K),i.node=r,i.setAttribute(`about`,t.toNT()),i.style.marginLeft=`5px`,i.style.marginRight=`10px`,e.appendChild(i),i}this.appendAccessIcons=function(e,t,n){if(n.termType!==`NamedNode`)return;let r=e.uris(n);r.sort();let i=null;for(let e=0;e<r.length;e++)r[e]!==i&&(i=r[e],p.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=u.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=g.getState(r),a,o,c;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,c=G;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,c=U;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,c=W,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,c=U;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,c=U,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,c=U,o=`cannot fetch`;break;default:s.log.error(`?? state = `+i)}let l=s.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),d);return l.classList.add(`objectValueAccessIcon`),l.setAttribute(`uri`,t),l.addEventListener(`click`,c),P(l,r),e.appendChild(l),l},this.outlineObjectTD=function(e,t,n,r){let i=d.createElement(`td`);return i.classList.add(`obj`),i.setAttribute(`notSelectable`,`false`),e?((e.termType===`NamedNode`||e.termType===`BlankNode`||e.termType===`Literal`&&e.value.slice&&(e.value.slice(0,6)===`ftp://`||e.value.slice(0,8)===`https://`||e.value.slice(0,7)===`http://`))&&(i.setAttribute(`about`,e.toNT()),i.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-expand-trans.png`,`expand`,void 0,d)).addEventListener(`click`,V)),i.setAttribute(`class`,`obj`),h.whether(e,s.ns.rdf(`type`),s.ns.link(`Request`))&&(i.className=`undetermined`),t||=ne,i.appendChild(t(e)),n&&y(i,e,n),i.tabulatorSelect=function(){z(this,!0)},i.tabulatorDeselect=function(){z(this,!1)},i.addEventListener(`click`,q),i):(i.textContent=`No object available.`,i)},this.outlinePredicateTD=function(e,t,r,i){let a=d.createElement(`TD`);a.setAttribute(`about`,e.toNT()),a.setAttribute(`class`,i?`pred internal`:`pred`);let o;switch(e.termType){case`BlankNode`:a.className=`undetermined`;break;case`NamedNode`:o=s.utils.predicateLabelForXML(e,r);break;case`Collection`:o=s.utils.predicateLabelForXML(e.elements[0],r)}o=o?o.slice(0,1).toUpperCase()+o.slice(1):`...`;let c=d.createElement(`TD`);c.classList.add(`labelTD`),c.setAttribute(`notSelectable`,`true`),c.appendChild(d.createTextNode(o)),a.appendChild(c),c.style.width=`100%`,a.appendChild(N.construct(d));for(let e in n.outlineIcons.termWidgets){if(!t||!t.AJAR_statement)break;n.outlineIcons.termWidgets[e].filter&&n.outlineIcons.termWidgets[e].filter(t.AJAR_statement,`pred`,r)&&N.addIcon(a,n.outlineIcons.termWidgets[e])}return a.tabulatorSelect=function(){z(this,!0)},a.tabulatorDeselect=function(){z(this,!1)},a.addEventListener(`click`,q),a};function b(){return C(`OutlineView`,`Resource browser`)}function x(){return document.querySelector(`solid-panes-navbar`)}function S(){let e=x();e&&e.classList.remove(`navbar--hidden`)}function C(e){if(document.getElementById(`MainContent`)||document.body,e===`OutlineView`){let e=document.getElementById(`OutlineView`);if(e)return e;let t=document.getElementById(`MainContent`)||document.body;if(t){let e=document.createElement(`table`);return e.id=`OutlineView`,e.classList.add(`outline-view`),e.setAttribute(`aria-label`,`Resource browser`),t.appendChild(e),e}}}async function w(e,t){e.uri.endsWith(`/`)&&await o.loadContainerRepresentation(e);let n=t.session.paneRegistry,r=n.list.filter(n=>n.label(e,t)&&!n.global&&n.name!==`sharing`);if(r.length===0)return[n.byName(`internal`)];let i=await s.login.filterAvailablePanes(r);return i.length===0?[r[0]]:n.list.indexOf(r[0])<n.list.indexOf(i[0])?[r[0]].concat(i):i}function T(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function E(e){let t=d.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function D(t,n,r,i){if(!t||!r)return;let a;try{s.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=d.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=d.createElement(`pre`);a.appendChild(t),t.appendChild(d.createTextNode(s.utils.stackString(e)))}a.classList.add(`paneDiv`);let o=t.querySelector(`.paneDiv`);o?o.replaceWith(a):t.appendChild(a)}function O(e,t){let n=d.getElementById(`OutlineView`);if(!n)return;let r=e.toNT(),i=n.querySelector(`td.paneView[about="`+r+`"]`);if(!i)return;let a=i.querySelector(`file-explorer-provider`);if(a){if(!t){s.log.warn(`outline: Unable to open pane in place: pane is undefined.`);return}E(!!t.requireQueryButton),a.openSelectedPane?.(t),D(a,e,t,a.paneRenderOptions)}}async function ee(t,n,r){r||={};let i=d.createElement(`tr`);r.hover&&i.classList.add(`hoverControl`);let o=i.appendChild(d.createElement(`td`));o.classList.add(`paneView`,`tdFlex`),o.setAttribute(`notSelectable`,`true`),o.setAttribute(`about`,t.toNT()),o.setAttribute(`colspan`,`2`);let s=o.appendChild(d.createElement(`file-explorer-provider`));s.context=e,s.subjectUri=t.uri,s.onBack=()=>H({target:s});let c=r.hideList?[]:await w(t,e);return s.relevantPanes=c,s.pane=n||T(c,t),s.showHeader=!(t&&t.uri&&t.site&&t.site().uri===t.uri)&&!a.isWebIdUri(t),s.paneRenderOptions=r,s.soloPane=r.solo,s.openPane=(e,t)=>O(e,l.byName(t)),s.handleSharingClick=()=>O(t,l.byName(`sharing`)),s.pane&&(i.classList.add(`outlinePaneRow`),D(s,t,s.pane,r)),i}function k(e){let t=e.parentNode,n=t.parentNode,r=d.createElement(`table`);r.classList.add(`placeholderTable`),n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let A=this.propertyTable=function(e,t,n,r){return s.log.debug(`Property table for: `+e),e=h.canon(e),t?(s.log.info(`Re-expand: `+t),t):(t=d.createElement(`table`),t.classList.add(`tableFullWidth`),ee(e,n,r).then(e=>{t.appendChild(e)}),t)};function j(e,t,n){let r=e.createElement(`TR`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`);let i=p.outlinePredicateTD(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=j;function M(e,t,n,r){if(s.log.debug(`Property list length = `+t.length),t.length===0)return``;let i,a,o;n?(i=function(e){return e.subject},t=t.sort(s.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(s.utils.RDFComparePredicateObject));let c=t.length;for(a=0;a<c;a++){let l=t[a];if(r&&!r(l.predicate,n))continue;let u=j(d,l,n);e.appendChild(u);let m=u.firstChild,g=$.defaults[l.predicate.uri],_=0,v=0,y=0;for(o=0;o+a<c&&t[a+o].predicate.sameTerm(l.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&_++,i(t[a+o]).lang&&f.labeller.LanguagePreference&&(v+=1,i(t[a+o]).lang.indexOf(f.labeller.LanguagePreference)>=0&&y++);if(y>0&&v===_+1){for(let e=a;e<=a+_;e++)if(f.labeller.LanguagePreference&&i(t[e]).lang.indexOf(f.labeller.LanguagePreference)>=0){u.appendChild(p.outlineObjectTD(i(t[e]),g,void 0,l));break}a+=_;continue}u.appendChild(p.outlineObjectTD(i(l),g,void 0,l)),u.showNobj=function(r){let c=o-_,u=2*r<c?r:c,f=[];if(c!==1){m.setAttribute(`rowspan`,u===c?c:r+1);let _;u<c&&u===1&&m.setAttribute(`rowspan`,2);let v=0;for(_=1;_<o;_++)if(h.canon(i(t[a+_])).sameTerm(h.canon(i(t[a+_-1]))))s.log.info(`there are duplicates here: %s`,t[a+_-1]);else{v++,l=t[a+_],g=$.defaults[l.predicate.uri];let r=d.createElement(`tr`);r.style.colspan=`1`,r.appendChild(p.outlineObjectTD(i(t[a+_]),g,void 0,l)),r.AJAR_statement=l,r.AJAR_inverse=n,e.appendChild(r),v>=u&&(r.style.display=`none`,f.push(r))}u===c&&m.setAttribute(`rowspan`,v+1)}if(u<c){let t=d.createElement(`tr`),n=t.appendChild(d.createElement(`td`));if(n.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),n.setAttribute(`notSelectable`,`false`),c>r){let e=d.createElement(`a`);n.appendChild(e);let t=(function(e){return e(m,o,_,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,d)),e.appendChild(d.createTextNode(c-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,d)),t.setAttribute(`rowspan`,c+1));for(let e=0;e<f.length;e++){let t=f[e];t.style.display=n}}}),i=`none`,a=function(e){return t(i),i=i===`none`?``:`none`,e&&e.stopPropagation(),!1};a(),e.addEventListener(`click`,a,!1)}e.appendChild(t)}},u.showAllobj=function(){u.showNobj(o-_)},u.showNobj(10),a+=o-1}}this.appendPropertyTRs=M;let N={};globalThis.termWidget=N,N.construct=function(e){e||=document;let t=e.createElement(`TD`);return t.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),t.setAttribute(`class`,`iconTD`),t.setAttribute(`notSelectable`,`true`),t.style.width=`0px`,t},N.addIcon=function(e,t,n){let r=e.childNodes[1];if(!r)return;let i=r.style.width,a=s.utils.AJARImage(t.src,t.alt,t.tooltip,d);i=parseInt(i),i+=t.width,r.style.width=i+`px`,r.appendChild(a),n&&a.addEventListener(`click`,n)},N.removeIcon=function(e,t){let n=e.childNodes[1],r;if(!n)return;let i=n.style.width;i=parseInt(i),i-=t.width,n.style.width=i+`px`;for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e],a=i.src;try{r=d.location.href.split(`?`)[0]}catch{r=``}a===u.uri.join(t.src,r)&&n.removeChild(i)}},N.replaceIcon=function(e,t,n,r){N.removeIcon(e,t),N.addIcon(e,n,r)};function P(e,t){s.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!f.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};g.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),g.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),g.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function F(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function I(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,L),t.parentNode.parentNode.removeAttribute(`optional`)}function L(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,I),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function R(e,t){let r=n.outlineIcons.termWidgets.optOn,i=n.outlineIcons.termWidgets.optOff;for(let n=e;n.parentNode;n=n.parentNode)for(;;)if(n.getAttribute(`predTR`)){let e=n.getAttribute(`parentOfSelected`);e=e?parseInt(e):0,e===0&&t>0&&N.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?I:L),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),N.removeIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i));break}else if(n.previousSibling&&n.previousSibling.nodeName===`TR`)n=n.previousSibling;else break}this.statusBarClick=function(e){let t=s.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&d.getElementById(`UserURI`)&&(d.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)},this.showSource=function(){if(!(typeof sourceWidget>`u`)){for(let e in sourceWidget.sources)sourceWidget.sources[e].setAttribute(`class`,``);for(let e=0;e<m.length;e++){if(!m[e].parentNode)continue;let t=m[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return m};function z(e,t){if(e.nodeName!==`TD`)throw s.log.debug(`down`+e.nodeName),Error(`Expected TD in setSelected: `+e.nodeName+` : `+e.textContent);s.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,1),m.push(e);let t=s.utils.getTerm(e);p.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;c.store.updater.editable(t.uri,h)&&r.indexOf(`pred`)>=0&&N.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else s.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,-1),r.indexOf(`pred`)>=0&&N.removeIcon(e,n.outlineIcons.termWidgets.addTri),m=m.filter(function(t){return t===e}),s.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&p.showSource(),e.setAttribute(`class`,r)}function B(){let e=m.length;for(let t=e-1;t>=0;t--)z(m[t],!1);m=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return s.log.error(`can't get target for event `+e),!1;return t.nodeType===3&&(t=t.parentNode),t},this.walk=function(e,t){let n=t||m[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}B(),z(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}B(),z(r,!0);break;case`right`:if(B(),n.nextSibling||n.lastChild.tagName===`strong`)z(n.nextSibling,!0);else{let e=d.evaluate(`table/div/tr/td[2]`,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;z(e,!0)}break;case`left`:if(B(),n.previousSibling&&n.previousSibling.className===`undetermined`)return z(n.previousSibling,!0),!0;z(s.utils.ancestor(n.parentNode,`TD`),!0);break;case`moveTo`:B(),z(t,!0)}(e===`down`||e===`up`)&&(r.tabulatorSelect||this.walk(e))},this.OutlinerKeypressPanel=function(e){s.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&d.getElementById(`UserURI`)&&(d.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]?!0:(o(`right`,a),t(s.utils.getAbout(h,m[0])),!0)}let r,i;if(s.utils.getTarget(e).tagName===`TEXTAREA`||s.utils.getTarget(e).id===`UserURI`||m.length>1)return;if(m.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,p.focusTd),t(s.utils.getAbout(h,m[0])));return}let a=m[0];switch(g.removeCallback(`done`,`setSelectedAfterward`),g.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(s.utils.getTarget(e).tagName===`HTML`){let e=s.utils.getAbout(h,a);r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),e?f.GotoSubject(e,!0):i&&p.UserInput.Enter(a)}else this.UserInput.Keypress(e),this.walk(`down`),e.stopPropagation();return;case 38:this.walk(`up`),e.stopPropagation(),e.preventDefault();break;case 40:this.walk(`down`),e.stopPropagation(),e.preventDefault()}if(s.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=s.utils.ancestor(a.parentNode,`TD`);Z(a,s.utils.getAbout(h,e));break}case 39:{let e=s.utils.getAbout(h,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstChild.tagName!==`TABLE`&&(g.addCallback(`done`,n),g.addCallback(`fail`,n),X(a,e,{pane:l.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){p.UserInput.copyToClipboard(p.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){p.UserInput.pasteFromClipboard(p.clipboardAddress,a);break}break;default:s.utils.getTarget(e).tagName}}t(s.utils.getAbout(h,m[0]))},this.OutlinerMouseclickPanel=function(e){switch(p.UserInput._tabulatorMode){case 0:J(e);break;case 1:p.UserInput.Click(e)}};function V(e){let t=p.targetOf(e),n=t.parentNode,r=s.utils.getAbout(h,t),i=e.altKey?l.byName(`internal`):void 0;e.shiftKey?Q(n,r,i):e.altKey?X(n,r,{pane:l.byName(`internal`),immediate:!0}):X(n,r)}function H(e){let t=p.targetOf(e),n=s.utils.getAbout(h,t),r=e.altKey?l.byName(`internal`):void 0,i=t.parentNode.parentNode;Z(i,n,r)}function U(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function W(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function G(e){let t=p.targetOf(e).getAttribute(`uri`);g.fetch(u.uri.docpart(t))}function K(e){let t=p.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),k(n)}function q(e){if(p.UserInput._tabulatorMode)return p.UserInput.Click(e);let t=p.targetOf(e),n;for(n=s.utils.ancestor(t,`TD`);n&&n.getAttribute(`notSelectable`)!==`false`;n=s.utils.ancestor(n.parentNode,`TD`));if(!n)return;let r=F(n);if(s.log.debug(`Was node selected before: `+r),e.altKey)z(n,!F(n));else if(e.shiftKey)z(n,!0);else{if(B(),p.UserInput.clearInputAndSave(e),z(n,!0),e.detail===2){e.stopPropagation();return}let t;if(n.parentNode&&(t=n.parentNode.AJAR_statement),!t)return;let i=t.why,a=c.store.updater.editable(i.uri,h);r&&a&&p.UserInput.Click(e,m[0])}s.log.debug(`Was node selected after: `+F(n)+`, count=`+m.length),e.stopPropagation()}function J(e){s.log.info(`@TabulatorMousedown, dom.location is now `+d.location);let t=p.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(p.UserInput.clearMenu(),p.UserInput.lastModified&&p.UserInput.lastModified.parentNode.nextSibling&&p.UserInput.backOut(),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices&&t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_add_triple)&&p.UserInput.clearInputAndSave(e),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices)&&p.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){d.title=s.utils.label(e),d.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;s.log.info(`@outlineExpand, dom is now `+d.location),g.removeCallback(`done`,`expand`),g.removeCallback(`fail`,`expand`);let o=h.canon(t);function c(){if(o=h.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;if(s.log.info(`@@ REPAINTING `),!i)t=A(o,void 0,r,n);else{for(s.log.info(` ... p is `+e),t=e.firstChild;t.nextSibling&&(s.log.info(` ... checking node `+t),t.nodeName!==`table`);t=t.nextSibling);t=A(o,t,r,n)}i=!0,s.utils.ancestor(e,`TABLE`)&&s.utils.ancestor(e,`TABLE`).style.backgroundColor===`white`?t.style.backgroundColor=`#eee`:t.style.backgroundColor=`white`,s.utils.emptyNode(e).appendChild(t),p.focusTd=e,s.log.debug(`expand: Node for `+o+` expanded`);let a=h.each(o,s.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&s.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),g.lookUpThing(a[e],o)}function l(e){if(arguments[3])return!0;let t=h.canon(o);s.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=h.sym(u.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=h.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=u.uri.docpart(r[t]);n;n=h.HTTPRedirects[n])if(e===n)return!0;return!!h.anyStatementMatching(t,void 0,void 0,n)}()||(s.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),c(),!1)}n.solo&&Y(o),s.log.debug(`outlineExpand: dereferencing `+o);let f=d.createElement(`span`);e.appendChild(f),g.addCallback(`done`,l),g.addCallback(`fail`,l);let m=[];if(o.uri&&o.uri.split(`:`)[0]===`rdf`){c();return}for(let e=0;e<m.length;e++){let t;if(t===m[e](o)){c(),s.log.debug(`outline 1815`),t[1]&&_.removeChild(_.lastChild);return}}if(o.uri&&!a&&!s.widgets.isAudio(o)&&!s.widgets.isVideo(o)){let t=o.doc()&&o.doc().uri?o.doc().uri:``+o.doc(),r=function(e){let t=!!(o&&o.uri&&o.site&&o.site().uri===o.uri);return e===403?t?`This root resource is not accessible with your current permissions. Try logging in with an authorized account or opening a public profile document.`:`This resource is not accessible with your current permissions.`:t?`This root resource is not publicly readable. Try logging in or opening a profile document.`:`This resource is not publicly readable. Try logging in or opening a different public resource.`},i=function(e,t){let n=typeof e==`string`?e:String(e||``),r=t?.status||t?.response?.status;return r===401||r===403?r:n.includes(`status: 403`)||n.includes(`status 403`)?403:n.includes(`status: 401`)||n.includes(`status 401`)?401:null},a=function(n,a){if(e.querySelector&&t&&e.querySelector(`[data-outline-error-for="`+t+`"]`))return;let o=i(n,a),c=o?r(o):n,l=s.widgets.errorMessageBlock(d,c,`#fee`,a instanceof Error?a:void 0);t&&l.setAttribute(`data-outline-error-for`,t),e.appendChild(l)},l=!1,u=g.nowOrWhenFetched(o.doc(),void 0,function(e,t){e?(g.lookUpThing(o),c(),n.solo&&Y(o)):(l=!0,a(t,void 0))});u&&typeof u.catch==`function`&&u.catch(function(e){l||(l=!0,a(e,e))})}else c()}function Z(e,t){let n=s.utils.ancestor(e,`TR`);n=s.utils.ancestor(n.parentNode,`TR`);let r;n&&(r=n.AJAR_statement);let i;for(i=e.parentNode;i.tagName!==`TD`;i=i.parentNode)if(i===void 0){alert(`Not enclosed in TD!`);return}s.log.debug(`Collapsing subject `+t);let a;r&&(s.log.debug(`looking up pred `+r.predicate.uri+`in defaults`),a=$.defaults[r.predicate.uri]),s.log.debug(`view= `+a);let o;i.parentNode.parentNode.id===`outline`&&(o=i.parentNode),p.replaceTD(p.outlineObjectTD(t,a,o,r),i)}this.replaceTD=function(e,t){let n;F(t)&&(n=!0);for(let e=m.length-1;e>-1;e--)for(let n=m[e];n.parentNode;n=n.parentNode)n===t&&z(m[e],!1);t.parentNode.replaceChild(e,t),n&&z(e,!0)};function Q(e,t){let n=null;for(let t=e.parentNode;t;t=t.parentNode)s.log.debug(`level `+t.tagName),t.tagName===`TD`&&(n=t);s.utils.emptyNode(n).appendChild(A(t)),Y(t),n.setAttribute(`about`,t.toNT())}f.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&f.GotoFormURI(e)},this.GotoFormURI=function(e){te(d.getElementById(`UserURI`).value)};function te(e){let t=h.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=h.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o=!0){let c=b();o&&(!a||a===c)&&S(),a||=c,r&&(s.utils.emptyNode(a),a.style.width=`100%`);function l(){let t=d.createElement(`tr`);t.classList.add(`outlineRow1`),t.style.verticalAlign=`top`,a.appendChild(t);let n=p.outlineObjectTD(e,void 0,t);return t.appendChild(n),n}let u=l();if(r&&Y(e),t&&X(u,e,{pane:n,solo:r}),r&&d&&d.defaultView&&d.defaultView.history){let t=d.defaultView.history.state||{},r=n?{paneName:n.name}:{};n&&n.subject&&typeof n.subject.uri==`string`&&(r.paneUri=n.subject.uri);let i={...t,...r};try{let n=new URL(document.location.href),r=new URL(e.uri,document.location.href);n.origin===r.origin&&(document.location.href===e.uri?JSON.stringify(t)!==JSON.stringify(i)&&d.defaultView.history.replaceState(i,e.uri,e.uri):d.defaultView.history.pushState(i,e.uri,e.uri))}catch{}}return e};let $=t.propertyViews(d);function ne(t){let r;if(t.termType===`Literal`){if(r=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=s.ns.xsd(``).uri;t.datatype.uri.slice(0,e.length)===e&&r.classList.add(`objectValue--`+t.datatype.uri.slice(e.length))}}else if(t.termType===`NamedNode`||t.termType===`BlankNode`){if(r=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),p.appendAccessIcons(h,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=d.createElement(`a`);r.appendChild(d.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(s.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,d)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(d.createTextNode(s.utils.label(t)));let e=s.widgets.linkIcon(d,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),s.widgets.makeDraggable(r,t)}}else r.appendChild(d.createTextNode(s.utils.label(t)))}else if(t.termType===`Collection`){r=d.createElement(`table`),r.classList.add(`tableFullWidth`),r.setAttribute(`about`,t.toNT());for(let e=0;e<t.elements.length;e++){let n=t.elements[e],i=r.appendChild(d.createElement(`tr`)),a=i.appendChild(d.createElement(`td`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(p.outlineObjectTD(n))}}else t.termType===`Graph`?(r=l.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(s.log.error(`Object `+t+` has unknown term type: `+t.termType),r=d.createTextNode(`[unknownTermType:`+t.termType+`]`));return s.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){d.getElementById(`UserURI`).value=d.URL+`?uri=`+d.getElementById(`UserURI`).value},this.UserInput.setSelected=z,this.UserInput.deselectAll=B,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=d;
|
|
2
2
|
//# sourceMappingURL=manager2.cjs.js.map
|