contacts-pane 2.7.1-bcdf51c6 → 2.7.1-ca201736
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/contactLogic.js +1 -1
- package/dist/contactLogic.js.map +1 -1
- package/dist/groupMembershipControl.js +0 -1
- package/dist/groupMembershipControl.js.map +1 -1
- package/dist/individual.js +1 -1
- package/dist/individual.js.map +1 -1
- package/dist/mintNewAddressBook.js +1 -1
- package/dist/mintNewAddressBook.js.map +1 -1
- package/dist/mugshotGallery.js +1 -1
- package/dist/mugshotGallery.js.map +1 -1
- package/dist/webidControl.js +1 -1
- package/dist/webidControl.js.map +1 -1
- package/package.json +9 -10
package/dist/contactLogic.js
CHANGED
|
@@ -13,13 +13,13 @@ exports.saveNewContact = saveNewContact;
|
|
|
13
13
|
exports.saveNewGroup = saveNewGroup;
|
|
14
14
|
exports.updateMany = updateMany;
|
|
15
15
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
16
|
+
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
16
17
|
var _solidLogic = require("solid-logic");
|
|
17
18
|
var _webidControl = require("./webidControl");
|
|
18
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
20
|
// Logic for solid contacts
|
|
20
21
|
|
|
21
22
|
const ns = UI.ns;
|
|
22
|
-
const $rdf = UI.rdf;
|
|
23
23
|
const utils = UI.utils;
|
|
24
24
|
const kb = _solidLogic.store;
|
|
25
25
|
const updater = kb.updater;
|
package/dist/contactLogic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactLogic.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_webidControl","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","$rdf","rdf","utils","kb","store","updater","updateMany","deletions","insertions","docs","concat","map","st","why","uniqueDocs","forEach","doc","find","uniqueDoc","equals","push","updates","update","filter","sameTerm","Promise","all","saveNewContact","book","name","selectedGroups","klass","fetcher","load","nameEmailIndex","any","vcard","uuid","genUuid","person","sym","dir","uri","agenda","dct","Date","gu","g","gd","console","error","Error","sanitizeToAlpha","n2","replace","saveNewGroup","gix","gname","group","err","holds","insertTriples","triples","addPersonToGroup","thing","toBeFetched","types","findTypeURIs","alert","pname","already","message","confirm","ins","webIDs","getPersonas","webid","value","length","owl","unload","groupMembers","a","each","b","item","strings","Set","contact","isLocal","tree","local","startsWith","getSameAs","getDataModelIssues","groups","del","members","member","others","other"],"sources":["../src/contactLogic.js"],"sourcesContent":["// Logic for solid contacts\n\nimport * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { getPersonas } from './webidControl'\n\nconst ns = UI.ns\nconst $rdf = UI.rdf\nconst utils = UI.utils\nconst kb = store\nconst updater = kb.updater\n\n/** Perform updates on more than one document @@ Move to rdflib!\n*/\nexport async function updateMany (deletions, insertions = []) {\n const docs = deletions.concat(insertions).map(st => st.why)\n const uniqueDocs = []\n docs.forEach(doc => {\n if (!uniqueDocs.find(uniqueDoc => uniqueDoc.equals(doc))) uniqueDocs.push(doc)\n })\n const updates = uniqueDocs.map(doc =>\n kb.updater.update(deletions.filter(st => st.why.sameTerm(doc)),\n insertions.filter(st => st.why.sameTerm(doc))))\n return Promise.all(updates)\n}\n\n/** Add a new person to the web data\n*\n* adds them to the given groups as well.\n* @returns {NamedNode} the person\n*/\nexport async function saveNewContact (book, name, selectedGroups, klass) {\n await kb.fetcher.load(book.doc())\n const nameEmailIndex = kb.any(book, ns.vcard('nameEmailIndex'))\n\n const uuid = utils.genUuid()\n const person = kb.sym(\n book.dir().uri + 'Person/' + uuid + '/index.ttl#this'\n )\n const doc = person.doc()\n\n // Set of statements to different files\n const agenda = [\n // Patch the main index to add the person\n $rdf.st(person, ns.vcard('inAddressBook'), book, nameEmailIndex), // The people index\n $rdf.st(person, ns.vcard('fn'), name, nameEmailIndex),\n // The new person file\n $rdf.st(person, ns.vcard('fn'), name, doc),\n $rdf.st(person, ns.rdf('type'), klass, doc),\n\n $rdf.st(doc, ns.dct('created'), new Date(), doc) // Note when created - useful for triaging later\n // Note this is propert of the file -- not when the person was created!\n ]\n\n for (const gu in selectedGroups) {\n const g = kb.sym(gu)\n const gd = g.doc()\n agenda.push(\n $rdf.st(g, ns.vcard('hasMember'), person, gd),\n $rdf.st(person, ns.vcard('fn'), name, gd)\n )\n }\n\n try {\n await updater.updateMany([], agenda) // @@ in future, updater.updateMany\n } catch (e) {\n console.error('Error: can\\'t update ' + person + ' as new contact:' + e)\n throw new Error('Updating new contact: ' + e)\n }\n return person\n}\n\nexport function sanitizeToAlpha (name) { // https://mathiasbynens.be/notes/es6-unicode-regex\n const n2 = name.replace(/\\W/gu, '_') // Anything which is not a unicode word characeter\n return n2.replace(/_+/g, '_') // https://www.regular-expressions.info/shorthand.html\n}\n\n/** Write new group to web\n * Creates an empty new group file and adds it to the index\n * @returns group\n*/\nexport async function saveNewGroup (book, name) {\n await kb.fetcher.load(book.doc())\n const gix = kb.any(book, ns.vcard('groupIndex'))\n\n const gname = sanitizeToAlpha(name)\n const group = kb.sym(book.dir().uri + 'Group/' + gname + '.ttl#this')\n const doc = group.doc()\n // console.log(' New group will be: ' + group + '\\n')\n try {\n await kb.fetcher.load(gix)\n } catch (err) {\n throw new Error('Error loading group index!' + gix.uri + ': ' + err)\n }\n if (kb.holds(book, ns.vcard('includesGroup'), group, gix)) {\n return group // Already exists\n }\n const insertTriples = [\n $rdf.st(book, ns.vcard('includesGroup'), group, gix),\n $rdf.st(group, ns.rdf('type'), ns.vcard('Group'), gix),\n $rdf.st(group, ns.vcard('fn'), name, gix)\n ]\n try {\n await updater.update([], insertTriples)\n } catch (e) {\n throw new Error('Could not update group index ' + e) // fail\n }\n\n const triples = [\n $rdf.st(book, ns.vcard('includesGroup'), group, doc), // Pointer back to book\n $rdf.st(group, ns.rdf('type'), ns.vcard('Group'), doc),\n $rdf.st(group, ns.vcard('fn'), name, doc)\n ]\n try {\n await updater.update([], triples)\n } catch (err) {\n throw new Error('Could not update group file: ' + err) // fail\n }\n return group\n}\n\nexport async function addPersonToGroup (thing, group) {\n const toBeFetched = [thing.doc(), group.doc()]\n try {\n await kb.fetcher.load(toBeFetched)\n } catch (e) {\n throw new Error('addPersonToGroup: ' + e)\n }\n\n const types = kb.findTypeURIs(thing)\n // for (const ty in types) {\n // console.log(' drop object type includes: ' + ty) // @@ Allow email addresses and phone numbers to be dropped?\n // }\n if (!(ns.vcard('Individual').uri in types ||\n ns.vcard('Organization').uri in types)) {\n return alert(`Can't add ${thing} to a group: it has to be an individual or another group.`)\n }\n const pname = kb.any(thing, ns.vcard('fn'))\n const gname = kb.any(group, ns.vcard('fn'))\n if (!pname) { return alert('No vcard name known for ' + thing) }\n const already = kb.holds(thing, ns.vcard('fn'), null, group.doc())\n if (already) {\n return alert(\n 'ALREADY added ' + pname + ' to group ' + gname\n )\n }\n const message = 'Add ' + pname + ' to group ' + gname + '?'\n if (!confirm(message)) return\n const ins = [\n $rdf.st(thing, ns.vcard('fn'), pname, group.doc())\n ]\n // find person webIDs and insert in vcard:hasMember\n const webIDs = getPersonas(kb, thing).map(webid => webid.value)\n if (webIDs.length) {\n webIDs.forEach(webid => {\n ins.push($rdf.st(kb.sym(webid), ns.owl('sameAs'), thing, group.doc()))\n ins.push($rdf.st(group, ns.vcard('hasMember'), kb.sym(webid), group.doc()))\n })\n } else {\n ins.push($rdf.st(group, ns.vcard('hasMember'), thing, group.doc()))\n }\n try {\n await updater.update([], ins)\n // to allow refresh of card groupList\n kb.fetcher.unload(group.doc())\n await kb.fetcher.load(group.doc())\n } catch (e) {\n throw new Error(`Error adding ${pname} to group ${gname}:` + e)\n }\n return thing\n}\n\n/**\n * Find persons member of a group\n */\n\nexport function groupMembers (kb, group) {\n const a = kb.each(group, ns.vcard('hasMember'), null, group.doc())\n let b = []\n a.forEach(item => {\n /* const contacts = kb.each(item, ns.owl('sameAs'), null, group.doc())\n if (contacts.length) {\n if (!kb.any(contacts[0], ns.vard('fn'))) b = b.concat(item) // this is the old data model\n else b = b.concat(contacts)\n } else { b = b.concat(item) }\n b = b.concat(item) */\n\n // to keep compatibility with old data model\n // check if item is a contact, else it is a WebID and parse 'sameAs' for contacts\n b = kb.any(item, ns.vcard('fn'), null, group.doc()) ? b.concat(item) : b.concat(kb.each(item, ns.owl('sameAs'), null, group.doc()))\n })\n const strings = new Set(b.map(contact => contact.uri)) // remove dups\n b = [...strings].map(uri => kb.sym(uri))\n return b\n}\n\nexport function isLocal (group, item) {\n const tree = group.dir().dir().dir()\n const local = item.uri && item.uri.startsWith(tree.uri)\n // console.log(` isLocal ${local} for ${item.uri} in group ${group} tree ${tree.uri}`)\n return local\n}\n\nexport function getSameAs (kb, item, doc) {\n return kb.each(item, ns.owl('sameAs'), null, doc).concat(\n kb.each(null, ns.owl('sameAs'), item, doc))\n}\n\nexport async function getDataModelIssues (groups) {\n const del = []\n const ins = []\n groups.forEach(group => {\n const members = kb.each(group, ns.vcard('hasMember'), null, group.doc())\n members.forEach((member) => {\n const others = getSameAs(kb, member, group.doc())\n if (others.length && isLocal(group, member)) { // Problem: local ID used instead of webID\n for (const other of others) {\n if (!isLocal(group, other)) { // Let's use this one as the immediate member for CSS ACLs'\n // console.warn(`getDataModelIssues: Need to swap ${member} to ${other}`)\n del.push($rdf.st(group, ns.vcard('hasMember'), member, group.doc()))\n ins.push($rdf.st(group, ns.vcard('hasMember'), other, group.doc()))\n break\n }\n // console.log('getDataModelIssues: ??? expected id not to be local ' + other)\n } // other\n } // if\n }) // member\n }) // next group\n return { del, ins }\n} // getDataModelIssues\n\n// Ends\n"],"mappings":";;;;;;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAA4C,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAJ5C;;AAMA,MAAMkB,EAAE,GAAGxB,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AEF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"contactLogic.js","names":["UI","_interopRequireWildcard","require","$rdf","_solidLogic","_webidControl","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","utils","kb","store","updater","updateMany","deletions","insertions","docs","concat","map","st","why","uniqueDocs","forEach","doc","find","uniqueDoc","equals","push","updates","update","filter","sameTerm","Promise","all","saveNewContact","book","name","selectedGroups","klass","fetcher","load","nameEmailIndex","any","vcard","uuid","genUuid","person","sym","dir","uri","agenda","rdf","dct","Date","gu","g","gd","console","error","Error","sanitizeToAlpha","n2","replace","saveNewGroup","gix","gname","group","err","holds","insertTriples","triples","addPersonToGroup","thing","toBeFetched","types","findTypeURIs","alert","pname","already","message","confirm","ins","webIDs","getPersonas","webid","value","length","owl","unload","groupMembers","a","each","b","item","strings","Set","contact","isLocal","tree","local","startsWith","getSameAs","getDataModelIssues","groups","del","members","member","others","other"],"sources":["../src/contactLogic.js"],"sourcesContent":["// Logic for solid contacts\n\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport { store } from 'solid-logic'\nimport { getPersonas } from './webidControl'\n\nconst ns = UI.ns\nconst utils = UI.utils\nconst kb = store\nconst updater = kb.updater\n\n/** Perform updates on more than one document @@ Move to rdflib!\n*/\nexport async function updateMany (deletions, insertions = []) {\n const docs = deletions.concat(insertions).map(st => st.why)\n const uniqueDocs = []\n docs.forEach(doc => {\n if (!uniqueDocs.find(uniqueDoc => uniqueDoc.equals(doc))) uniqueDocs.push(doc)\n })\n const updates = uniqueDocs.map(doc =>\n kb.updater.update(deletions.filter(st => st.why.sameTerm(doc)),\n insertions.filter(st => st.why.sameTerm(doc))))\n return Promise.all(updates)\n}\n\n/** Add a new person to the web data\n*\n* adds them to the given groups as well.\n* @returns {NamedNode} the person\n*/\nexport async function saveNewContact (book, name, selectedGroups, klass) {\n await kb.fetcher.load(book.doc())\n const nameEmailIndex = kb.any(book, ns.vcard('nameEmailIndex'))\n\n const uuid = utils.genUuid()\n const person = kb.sym(\n book.dir().uri + 'Person/' + uuid + '/index.ttl#this'\n )\n const doc = person.doc()\n\n // Set of statements to different files\n const agenda = [\n // Patch the main index to add the person\n $rdf.st(person, ns.vcard('inAddressBook'), book, nameEmailIndex), // The people index\n $rdf.st(person, ns.vcard('fn'), name, nameEmailIndex),\n // The new person file\n $rdf.st(person, ns.vcard('fn'), name, doc),\n $rdf.st(person, ns.rdf('type'), klass, doc),\n\n $rdf.st(doc, ns.dct('created'), new Date(), doc) // Note when created - useful for triaging later\n // Note this is propert of the file -- not when the person was created!\n ]\n\n for (const gu in selectedGroups) {\n const g = kb.sym(gu)\n const gd = g.doc()\n agenda.push(\n $rdf.st(g, ns.vcard('hasMember'), person, gd),\n $rdf.st(person, ns.vcard('fn'), name, gd)\n )\n }\n\n try {\n await updater.updateMany([], agenda) // @@ in future, updater.updateMany\n } catch (e) {\n console.error('Error: can\\'t update ' + person + ' as new contact:' + e)\n throw new Error('Updating new contact: ' + e)\n }\n return person\n}\n\nexport function sanitizeToAlpha (name) { // https://mathiasbynens.be/notes/es6-unicode-regex\n const n2 = name.replace(/\\W/gu, '_') // Anything which is not a unicode word characeter\n return n2.replace(/_+/g, '_') // https://www.regular-expressions.info/shorthand.html\n}\n\n/** Write new group to web\n * Creates an empty new group file and adds it to the index\n * @returns group\n*/\nexport async function saveNewGroup (book, name) {\n await kb.fetcher.load(book.doc())\n const gix = kb.any(book, ns.vcard('groupIndex'))\n\n const gname = sanitizeToAlpha(name)\n const group = kb.sym(book.dir().uri + 'Group/' + gname + '.ttl#this')\n const doc = group.doc()\n // console.log(' New group will be: ' + group + '\\n')\n try {\n await kb.fetcher.load(gix)\n } catch (err) {\n throw new Error('Error loading group index!' + gix.uri + ': ' + err)\n }\n if (kb.holds(book, ns.vcard('includesGroup'), group, gix)) {\n return group // Already exists\n }\n const insertTriples = [\n $rdf.st(book, ns.vcard('includesGroup'), group, gix),\n $rdf.st(group, ns.rdf('type'), ns.vcard('Group'), gix),\n $rdf.st(group, ns.vcard('fn'), name, gix)\n ]\n try {\n await updater.update([], insertTriples)\n } catch (e) {\n throw new Error('Could not update group index ' + e) // fail\n }\n\n const triples = [\n $rdf.st(book, ns.vcard('includesGroup'), group, doc), // Pointer back to book\n $rdf.st(group, ns.rdf('type'), ns.vcard('Group'), doc),\n $rdf.st(group, ns.vcard('fn'), name, doc)\n ]\n try {\n await updater.update([], triples)\n } catch (err) {\n throw new Error('Could not update group file: ' + err) // fail\n }\n return group\n}\n\nexport async function addPersonToGroup (thing, group) {\n const toBeFetched = [thing.doc(), group.doc()]\n try {\n await kb.fetcher.load(toBeFetched)\n } catch (e) {\n throw new Error('addPersonToGroup: ' + e)\n }\n\n const types = kb.findTypeURIs(thing)\n // for (const ty in types) {\n // console.log(' drop object type includes: ' + ty) // @@ Allow email addresses and phone numbers to be dropped?\n // }\n if (!(ns.vcard('Individual').uri in types ||\n ns.vcard('Organization').uri in types)) {\n return alert(`Can't add ${thing} to a group: it has to be an individual or another group.`)\n }\n const pname = kb.any(thing, ns.vcard('fn'))\n const gname = kb.any(group, ns.vcard('fn'))\n if (!pname) { return alert('No vcard name known for ' + thing) }\n const already = kb.holds(thing, ns.vcard('fn'), null, group.doc())\n if (already) {\n return alert(\n 'ALREADY added ' + pname + ' to group ' + gname\n )\n }\n const message = 'Add ' + pname + ' to group ' + gname + '?'\n if (!confirm(message)) return\n const ins = [\n $rdf.st(thing, ns.vcard('fn'), pname, group.doc())\n ]\n // find person webIDs and insert in vcard:hasMember\n const webIDs = getPersonas(kb, thing).map(webid => webid.value)\n if (webIDs.length) {\n webIDs.forEach(webid => {\n ins.push($rdf.st(kb.sym(webid), ns.owl('sameAs'), thing, group.doc()))\n ins.push($rdf.st(group, ns.vcard('hasMember'), kb.sym(webid), group.doc()))\n })\n } else {\n ins.push($rdf.st(group, ns.vcard('hasMember'), thing, group.doc()))\n }\n try {\n await updater.update([], ins)\n // to allow refresh of card groupList\n kb.fetcher.unload(group.doc())\n await kb.fetcher.load(group.doc())\n } catch (e) {\n throw new Error(`Error adding ${pname} to group ${gname}:` + e)\n }\n return thing\n}\n\n/**\n * Find persons member of a group\n */\n\nexport function groupMembers (kb, group) {\n const a = kb.each(group, ns.vcard('hasMember'), null, group.doc())\n let b = []\n a.forEach(item => {\n /* const contacts = kb.each(item, ns.owl('sameAs'), null, group.doc())\n if (contacts.length) {\n if (!kb.any(contacts[0], ns.vard('fn'))) b = b.concat(item) // this is the old data model\n else b = b.concat(contacts)\n } else { b = b.concat(item) }\n b = b.concat(item) */\n\n // to keep compatibility with old data model\n // check if item is a contact, else it is a WebID and parse 'sameAs' for contacts\n b = kb.any(item, ns.vcard('fn'), null, group.doc()) ? b.concat(item) : b.concat(kb.each(item, ns.owl('sameAs'), null, group.doc()))\n })\n const strings = new Set(b.map(contact => contact.uri)) // remove dups\n b = [...strings].map(uri => kb.sym(uri))\n return b\n}\n\nexport function isLocal (group, item) {\n const tree = group.dir().dir().dir()\n const local = item.uri && item.uri.startsWith(tree.uri)\n // console.log(` isLocal ${local} for ${item.uri} in group ${group} tree ${tree.uri}`)\n return local\n}\n\nexport function getSameAs (kb, item, doc) {\n return kb.each(item, ns.owl('sameAs'), null, doc).concat(\n kb.each(null, ns.owl('sameAs'), item, doc))\n}\n\nexport async function getDataModelIssues (groups) {\n const del = []\n const ins = []\n groups.forEach(group => {\n const members = kb.each(group, ns.vcard('hasMember'), null, group.doc())\n members.forEach((member) => {\n const others = getSameAs(kb, member, group.doc())\n if (others.length && isLocal(group, member)) { // Problem: local ID used instead of webID\n for (const other of others) {\n if (!isLocal(group, other)) { // Let's use this one as the immediate member for CSS ACLs'\n // console.warn(`getDataModelIssues: Need to swap ${member} to ${other}`)\n del.push($rdf.st(group, ns.vcard('hasMember'), member, group.doc()))\n ins.push($rdf.st(group, ns.vcard('hasMember'), other, group.doc()))\n break\n }\n // console.log('getDataModelIssues: ??? expected id not to be local ' + other)\n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EF","ignoreList":[]}
|
|
@@ -10,7 +10,6 @@ var _solidLogic = require("solid-logic");
|
|
|
10
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
11
|
// Render a control to record the group memberships we have for this agent
|
|
12
12
|
|
|
13
|
-
// const $rdf = UI.rdf
|
|
14
13
|
const ns = UI.ns;
|
|
15
14
|
// const buttons = UI.buttonsn no
|
|
16
15
|
// const widgets = UI.widgets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupMembershipControl.js","names":["UI","_interopRequireWildcard","require","_solidLogic","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","utils","kb","store","groupMembership","person","groups","statementsMatching","owl","map","st","why","concat","each","vcard","strings","Set","group","uri","sym","renderGroupMemberships","context","removeFromGroup","thing","pname","any","gname","thingwebids","doc","webids","forEach","webid","thingOrWebid","length","alert","message","confirm","del","undefined","updater","update","ok","err","groupList","parentNode","appendChild","widgets","errorMessageBlock","dom","console","log","fetcher","unload","load","syncGroupList","newRowForGroup","options","deleteFunction","noun","tr","personTR","syncTableToArray","loadGroupsFromBook","book","groupIndex","gs","session","createElement","refresh"],"sources":["../src/groupMembershipControl.js"],"sourcesContent":["// Render a control to record the group memberships we have for this agent\nimport * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\n\
|
|
1
|
+
{"version":3,"file":"groupMembershipControl.js","names":["UI","_interopRequireWildcard","require","_solidLogic","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","utils","kb","store","groupMembership","person","groups","statementsMatching","owl","map","st","why","concat","each","vcard","strings","Set","group","uri","sym","renderGroupMemberships","context","removeFromGroup","thing","pname","any","gname","thingwebids","doc","webids","forEach","webid","thingOrWebid","length","alert","message","confirm","del","undefined","updater","update","ok","err","groupList","parentNode","appendChild","widgets","errorMessageBlock","dom","console","log","fetcher","unload","load","syncGroupList","newRowForGroup","options","deleteFunction","noun","tr","personTR","syncTableToArray","loadGroupsFromBook","book","groupIndex","gs","session","createElement","refresh"],"sources":["../src/groupMembershipControl.js"],"sourcesContent":["// Render a control to record the group memberships we have for this agent\nimport * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\n\nconst ns = UI.ns\n// const buttons = UI.buttonsn no\n// const widgets = UI.widgets\nconst utils = UI.utils\n// const style = UI.style\nconst kb = store\n\n// Groups the person is a member of\nexport function groupMembership (person) {\n let groups = kb.statementsMatching(null, ns.owl('sameAs'), person).map(st => st.why)\n .concat(kb.each(null, ns.vcard('hasMember'), person))\n const strings = new Set(groups.map(group => group.uri)) // remove dups\n groups = [...strings].map(uri => kb.sym(uri))\n return groups\n}\n\nexport async function renderGroupMemberships (person, context) {\n // Remove a person from a group\n async function removeFromGroup (thing, group) {\n const pname = kb.any(thing, ns.vcard('fn'))\n const gname = kb.any(group, ns.vcard('fn'))\n // find all WebIDs of thing\n const thingwebids = kb.each(null, ns.owl('sameAs'), thing, group.doc())\n // WebID can be deleted only if not used in another thing\n let webids = []\n thingwebids.forEach(webid => {\n if (kb.statementsMatching(webid, ns.owl('sameAs'), thing, group.doc())) webids = webids.concat(webid)\n })\n let thingOrWebid = thing\n if (webids.length > 0) thingOrWebid = webids[0]\n const groups = kb.each(null, ns.vcard('hasMember'), thingOrWebid) // in all groups a person has same structure\n if (groups.length < 2) {\n alert(\n 'Must be a member of at least one group. Add to another group first.'\n )\n return\n }\n const message = 'Remove ' + pname + ' from group ' + gname + '?'\n if (confirm(message)) {\n let del = kb\n .statementsMatching(person, undefined, undefined, group.doc())\n .concat(kb.statementsMatching(undefined, undefined, person, group.doc()))\n webids.forEach(webid => {\n if (kb.statementsMatching(webid, ns.owl('sameAs'), undefined, group.doc()).length < 2) {\n del = del.concat(kb.statementsMatching(undefined, undefined, webid, group.doc()))\n }\n })\n kb.updater.update(del, [], function (uri, ok, err) {\n if (!ok) {\n const message = 'Error removing member from group ' + group + ': ' + err\n groupList.parentNode.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'))\n }\n })\n console.log('Removed ' + pname + ' from group ' + gname)\n // to allow refresh of card groupList\n kb.fetcher.unload(group.doc())\n await kb.fetcher.load(group.doc())\n syncGroupList()\n }\n }\n\n function newRowForGroup (group) {\n const options = {\n deleteFunction: function () {\n removeFromGroup(person, group)\n },\n noun: 'membership'\n }\n const tr = UI.widgets.personTR(dom, null, group, options)\n return tr\n }\n\n // find all groups where person has membership\n function syncGroupList () {\n // person and/or WebIDs to be changed\n utils.syncTableToArray(groupList, groupMembership(person), newRowForGroup)\n }\n\n async function loadGroupsFromBook (book = null) {\n if (!book) {\n book = kb.any(undefined, ns.vcard('includesGroup'))\n if (!book) {\n // throw new Error('findBookFromGroups: Cant find address book which this group is part of')\n return // no book => no groups\n }\n }\n const groupIndex = kb.any(book, ns.vcard('groupIndex'))\n const gs = book ? kb.each(book, ns.vcard('includesGroup'), null, groupIndex) : []\n await kb.fetcher.load(gs)\n }\n\n const { dom } = context\n const kb = context.session.store\n const groupList = dom.createElement('table')\n\n // find book any group and load all groups\n await loadGroupsFromBook()\n\n groupList.refresh = syncGroupList\n syncGroupList()\n return groupList\n}\n"],"mappings":";;;;;;;AACA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAmC,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MA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AC,CAAC;MACnD,IAAI,CAACiD,IAAI,EAAE;QACT;QACA,OAAM,CAAE;MACV;IACF;IACA,MAAMC,UAAU,GAAG9D,EAAE,CAACuB,GAAG,CAACsC,IAAI,EAAE/D,EAAE,CAACc,KAAK,CAAC,YAAY,CAAC,CAAC;IACvD,MAAMmD,EAAE,GAAGF,IAAI,GAAG7D,EAAE,CAACW,IAAI,CAACkD,IAAI,EAAE/D,EAAE,CAACc,KAAK,CAAC,eAAe,CAAC,EAAE,IAAI,EAAEkD,UAAU,CAAC,GAAG,EAAE;IACjF,MAAM9D,EAAE,CAACiD,OAAO,CAACE,IAAI,CAACY,EAAE,CAAC;EAC3B;EAEA,MAAM;IAAEjB;EAAI,CAAC,GAAG3B,OAAO;EACvB,MAAMnB,EAAE,GAAGmB,OAAO,CAAC6C,OAAO,CAAC/D,KAAK;EAChC,MAAMwC,SAAS,GAAGK,GAAG,CAACmB,aAAa,CAAC,OAAO,CAAC;;EAE5C;EACA,MAAML,kBAAkB,CAAC,CAAC;EAE1BnB,SAAS,CAACyB,OAAO,GAAGd,aAAa;EACjCA,aAAa,CAAC,CAAC;EACf,OAAOX,SAAS;AAClB","ignoreList":[]}
|
package/dist/individual.js
CHANGED
|
@@ -10,12 +10,12 @@ var _solidLogic = require("solid-logic");
|
|
|
10
10
|
var _mugshotGallery = require("./mugshotGallery");
|
|
11
11
|
var _webidControl = require("./webidControl");
|
|
12
12
|
var _groupMembershipControl = require("./groupMembershipControl");
|
|
13
|
+
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
13
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
15
|
/* babel-plugin-inline-import './ontology/forms.ttl' */
|
|
15
16
|
const textOfForms = "# This turtle file defined the forms usied in the contacts management\n#\n# Indivduals and orgs are in one file as they both\n# share some forms (address etc) and also interact (roles)\n\n# Now hand-edited, was originally made using form editor.\n# Forms documentaion: https://solid.github.io/solid-ui/Documentation/forms-intro.html\n\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix dct: <http://purl.org/dc/terms/>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix owl: <http://www.w3.org/2002/07/owl#>.\n@prefix prov: <http://www.w3.org/ns/prov#>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix schema: <http://schema.org/>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n@prefix : <#>.\n\n# Ontology additions or interpretations needed for the form to work well\n\n# The ontology file doesn't make them disjoint. This makes the selector be a choice.\nvcard:TelephoneType owl:disjointUnionOf ( vcard:Cell vcard:Home vcard:Work) .\nvcard:Type owl:disjointUnionOf (vcard:Home vcard:Work) . # for email\n\n# Better field labels\nvcard:Cell ui:label \"mobile\"@en . # app will imake nitial caps if nec\nvcard:hasAddress ui:label \"address\"@en .\nvcard:bday ui:label \"born\"@en.\nvcard:hasEmail ui:label \"email\"@en .\nvcard:hasTelephone ui:label \"phone\"@en .\nvcard:note ui:label \"notes\"@en .\n\n\n\n# Ontology data to drive a top classifier\n\nfoaf:Agent owl:disjointUnionOf (\n vcard:Individual\n # @@ schema:robot @@ schem:SoftwareApplication, n0:Agent, n0:Person,\n prov:SoftwareAgent\n # vcard:Group a group of agents is not (currently) an agent itself.\n # You can't get a decision out of it so it can't own a bank account\n vcard:Organization\n).\n\n\n# Ontology data to drive the classifier\n\nsolid:InterestingOrganization owl:disjointUnionOf (\n# Airline - a Corpration\n# Consortium - a Corporation or a NGO\n schema:Corporation\n schema:EducationalOrganization\n schema:ResearchOrganization\n# FundingScheme - eh?\n schema:GovernmentOrganization\n# LibrarySystem\n# LocalBusiness - Corporation\n schema:MedicalOrganization\n schema:NGO\n # NewsMediaOrganization - a Corporation or a NGO\n schema:MusicGroup # e.g. a band\n schema:Project # like Solid\n schema:SportsOrganization # a Team\n ) .\n\n#########################################################\n# The forms themselves\n\nfoaf:Agent ui:creationForm :AgentForm .\n\n:AgentForm a ui:Form; schema:name \"Form for editing a agent\" ;\n ui:parts ( :AgentClassifier :AgentOptions ) .\n\n :AgentClassifier a ui:Classifier; ui:label \"What sort of agent?\"@en;\n ui:category foaf:Agent .\n\n:AgentOptions a ui:Options; ui:dependingon rdf:type;\n ui:case [ ui:for vcard:Individual; ui:use :form1 ],\n [ ui:for vcard:Organization; ui:use :orgDetailsForm ],\n [ ui:for prov:SoftwareAgent; ui:use :robotDetailsForm ] .\n\n# Robots\n\n:robotDetailsForm a ui:Form; ui:parts ( ) . # @@@@\n\n# Individual-specific form\n\nvcard:Individual\n ui:creationForm :form1 .\n\n# The addressComment, etc., fields with a comment before each type of field\n# were originally partly because the labels on the fields were clumsy like \"hasAddress\".\n# This is fixed by adding the ui:label to the properties above, so let's try\n# removing the little micro-headings\n\n# For org:\n:orgDetailsForm a ui:Form ; dct:title \"Contact details for an organozation\";\n ui:parts (\n :OrgClassifier\n\n :fullNameField\n :addresses\n :eMails\n :telephones\n :noteField ) .\n# For individual:\n:form1\n dct:title \"Contact Details for a person\" ;\n a ui:Form ;\n ui:part\n :fullNameField, :roleField, :orgNameField,\n # :addressesComment,\n :addresses,\n # :emailComment,\n :eMails,\n# :telephoneComment,\n :telephones,\n# :noteComment,\n :noteField ;\n ui:parts (\n :fullNameField :roleField :orgNameField\n # :addressesComment\n :addresses\n # :emailComment\n :eMails\n # :telephoneComment\n :telephones :birthdayField\n # :noteComment\n :noteField ) .\n\n :fullNameField\n a ui:SingleLineTextField ;\n ui:label \"Name\";\n ui:maxLength \"128\" ;\n ui:property vcard:fn ;\n ui:size \"40\" .\n\n :roleField\n a ui:SingleLineTextField ;\n ui:suppressEmptyUneditable true;\n ui:maxLength \"128\" ;\n ui:property vcard:role ;\n ui:size \"40\" .\n\n :orgNameField\n a ui:SingleLineTextField ;\n ui:suppressEmptyUneditable true;\n ui:maxLength \"128\" ;\n ui:property vcard:organization-name ;\n ui:size \"40\" .\n\n\n:addressesComment\n a ui:Comment ;\n ui:suppressIfUneditable true;\n ui:contents \"Address\" .\n\n\n:addresses\n dct:title \"Address details\" ;\n a ui:Multiple ;\n ui:part :oneAddress ;\n ui:property vcard:hasAddress .\n\n:oneAddress\n a ui:Group ;\n ui:parts ( :id1409437207443 :id1409437292400 :id1409437421996 :id1409437467649 :id1409437569420 ). # :id1409437646712\n\n:id1409437207443\n a ui:SingleLineTextField ;\n ui:maxLength \"128\" ;\n ui:property vcard:street-address ;\n ui:size \"40\" .\n\n:id1409437292400\n a ui:SingleLineTextField ;\n ui:maxLength \"128\" ;\n ui:property vcard:locality ;\n ui:size \"40\" .\n\n:id1409437421996\n a ui:SingleLineTextField ;\n ui:maxLength \"25\" ;\n ui:property vcard:postal-code ;\n ui:size \"25\" .\n\n:id1409437467649\n a ui:SingleLineTextField ;\n ui:maxLength \"128\" ;\n ui:property vcard:region ;\n ui:size \"40\" .\n\n:id1409437569420\n a ui:SingleLineTextField ;\n ui:maxLength \"128\" ;\n ui:property vcard:country-name ;\n ui:size \"40\" .\n\n:id1409437646712\n a ui:Classifier ;\n ui:from rdf:Class ;\n ui:property rdf:type .\n\n\n##############################\n\n:emailComment\n a ui:Comment ;\n ui:suppressIfUneditable true;\n\n ui:contents \"Email\" .\n\n\n:eMails\n a ui:Multiple ;\n ui:part :oneEMail ;\n ui:property vcard:hasEmail .\n\n:oneEMail\n a ui:Group ; # hint: side by side is good\n ui:part :emailValue, :emailType ;\n ui:parts ( :emailType :emailValue ).\n\n:emailValue\n a ui:EmailField ; ui:label \"email\";\n ui:property vcard:value ;\n ui:size \"50\" .\n\n:emailType\n a ui:Classifier ;\n ui:canMintNew \"0\" ;\n ui:category vcard:Type ;\n ui:from vcard:Type ;\n ui:property rdf:type .\n\n\n##############################\n\n:telephoneComment\n a ui:Comment ;\n ui:suppressIfUneditable true;\n ui:contents \"Phones\" .\n\n\n:telephones\n a ui:Multiple ;\n ui:part :onetelephone ;\n ui:property vcard:hasTelephone .\n\n:onetelephone\n a ui:Group ;\n ui:part :telephoneValue, :telephoneType ;\n ui:parts ( :telephoneType :telephoneValue ).\n\n:telephoneValue\n a ui:PhoneField ;\n ui:property vcard:value ;\n ui:size \"50\" .\n\n:telephoneType\n a ui:Classifier ;\n ui:canMintNew \"0\" ;\n ui:category vcard:TelephoneType ;\n ui:from vcard:Type ;\n ui:property rdf:type .\n\n##############################\n\n:birthdayField\n a ui:DateField;\n ui:label \"Born\";\n ui:suppressEmptyUneditable true;\n ui:property vcard:bday .\n\n##############################\n\n:noteComment\n a ui:Comment ;\n ui:suppressIfUneditable true;\n ui:contents \"General Notes\" .\n\n:noteField\n a ui:MultiLineTextField ;\n ui:suppressEmptyUneditable true;\n\n ui:property vcard:note .\n\n\n############ organization forms\n\n:OrganinizatioCreationForm a ui:Form; schema:name \"Form for editing contact details of an organization\" ;\n ui:parts ( :OrgClassifier :homePageURIField ) .\n\n\n:OrgClassifier a ui:Classifier; ui:label \"What sort of organization?\"@en;\n ui:category solid:InterestingOrganization .\n\n\n:instituteNameField\n a ui:SingleLineTextField ;\n ui:label \"Intitute Name\";\n ui:maxLength \"200\" ;\n ui:property schema:name ;\n ui:size \"80\" .\n\n :homePageURIField a ui:NamedNodeURIField;\n ui:property schema:url . # @@ ??\n\n :initituteTypeField a ui:Classifier;\n ui:label \"What sort of organization\";\n ui:category solid:InterestingOrganization .\n";
|
|
16
17
|
/* babel-plugin-inline-import './ontology/vcard.ttl' */
|
|
17
18
|
const VCARD_ONTOLOGY_TEXT = "@prefix : <http://www.w3.org/2006/vcard/ns#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n:Acquaintance a owl:Class ;\n rdfs:label \"Acquaintance\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Agent a owl:Class ;\n rdfs:label \"Agent\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:BBS a owl:Class ;\n rdfs:label \"BBS\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType ;\n owl:deprecated true .\n\n:Car a owl:Class ;\n rdfs:label \"Car\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType ;\n owl:deprecated true .\n\n:Cell a owl:Class ;\n rdfs:label \"Cell\"@en ;\n rdfs:comment \"Also called mobile telephone\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:Child a owl:Class ;\n rdfs:label \"Child\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Colleague a owl:Class ;\n rdfs:label \"Colleague\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Contact a owl:Class ;\n rdfs:label \"Contact\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Coresident a owl:Class ;\n rdfs:label \"Coresident\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Coworker a owl:Class ;\n rdfs:label \"Coworker\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Crush a owl:Class ;\n rdfs:label \"Crush\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Date a owl:Class ;\n rdfs:label \"Date\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Dom a owl:Class ;\n rdfs:label \"Dom\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Emergency a owl:Class ;\n rdfs:label \"Emergency\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Fax a owl:Class ;\n rdfs:label \"Fax\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:Female a owl:Class ;\n rdfs:label \"Female\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Gender .\n\n:Friend a owl:Class ;\n rdfs:label \"Friend\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Home a owl:Class ;\n rdfs:label \"Home\"@en ;\n rdfs:comment \"This implies that the property is related to an individual's personal life\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type .\n\n:ISDN a owl:Class ;\n rdfs:label \"ISDN\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Internet a owl:Class ;\n rdfs:label \"Internet\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Intl a owl:Class ;\n rdfs:label \"Intl\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Kin a owl:Class ;\n rdfs:label \"Kin\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Label a owl:Class ;\n rdfs:label \"Label\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Male a owl:Class ;\n rdfs:label \"Male\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Gender .\n\n:Me a owl:Class ;\n rdfs:label \"Me\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Met a owl:Class ;\n rdfs:label \"Met\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Modem a owl:Class ;\n rdfs:label \"Modem\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType ;\n owl:deprecated true .\n\n:Msg a owl:Class ;\n rdfs:label \"Msg\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType ;\n owl:deprecated true .\n\n:Muse a owl:Class ;\n rdfs:label \"Muse\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Neighbor a owl:Class ;\n rdfs:label \"Neighbor\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:None a owl:Class ;\n rdfs:label \"None\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Gender .\n\n:Other a owl:Class ;\n rdfs:label \"Other\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Gender .\n\n:PCS a owl:Class ;\n rdfs:label \"PCS\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType ;\n owl:deprecated true .\n\n:Pager a owl:Class ;\n rdfs:label \"Pager\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:Parcel a owl:Class ;\n rdfs:label \"Parcel\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Parent a owl:Class ;\n rdfs:label \"Parent\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Postal a owl:Class ;\n rdfs:label \"Postal\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Pref a owl:Class ;\n rdfs:label \"Pref\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:Sibling a owl:Class ;\n rdfs:label \"Sibling\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Spouse a owl:Class ;\n rdfs:label \"Spouse\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Sweetheart a owl:Class ;\n rdfs:label \"Sweetheart\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :RelatedType .\n\n:Tel a owl:Class ;\n rdfs:label \"Tel\"@en ;\n rdfs:comment \"This class is deprecated. Use the hasTelephone object property.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:Text a owl:Class ;\n rdfs:label \"Text\"@en ;\n rdfs:comment \"Also called sms telephone\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:TextPhone a owl:Class ;\n rdfs:label \"Text phone\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:Unknown a owl:Class ;\n rdfs:label \"Unknown\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Gender .\n\n:Video a owl:Class ;\n rdfs:label \"Video\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:Voice a owl:Class ;\n rdfs:label \"Voice\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :TelephoneType .\n\n:Work a owl:Class ;\n rdfs:label \"Work\"@en ;\n rdfs:comment \"This implies that the property is related to an individual's work place\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type .\n\n:X400 a owl:Class ;\n rdfs:label \"X400\"@en ;\n rdfs:comment \"This class is deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Type ;\n owl:deprecated true .\n\n:adr a owl:ObjectProperty ;\n rdfs:label \"address\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasAddress .\n\n:agent a owl:ObjectProperty ;\n rdfs:label \"agent\"@en ;\n rdfs:comment \"This object property has been deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:anniversary a owl:DatatypeProperty ;\n rdfs:label \"anniversary\"@en ;\n rdfs:comment \"The date of marriage, or equivalent, of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range [ a rdfs:Datatype ;\n owl:unionOf ( xsd:dateTime xsd:gYear ) ] .\n\n:bday a owl:DatatypeProperty ;\n rdfs:label \"birth date\"@en ;\n rdfs:comment \"To specify the birth date of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range [ a rdfs:Datatype ;\n owl:unionOf ( xsd:dateTime xsd:dateTimeStamp xsd:gYear ) ] .\n\n:category a owl:DatatypeProperty ;\n rdfs:label \"category\"@en ;\n rdfs:comment \"The category information about the object, also known as tags\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:class a owl:DatatypeProperty ;\n rdfs:label \"class\"@en ;\n rdfs:comment \"This data property has been deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:email a owl:ObjectProperty ;\n rdfs:label \"email\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasEmail .\n\n:extended-address a owl:DatatypeProperty ;\n rdfs:label \"extended address\"@en ;\n rdfs:comment \"This data property has been deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:geo a owl:ObjectProperty ;\n rdfs:label \"geo\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasGeo .\n\n:hasAdditionalName a owl:ObjectProperty ;\n rdfs:label \"has additional name\"@en ;\n rdfs:comment \"Used to support property parameters for the additional name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasCalendarBusy a owl:ObjectProperty ;\n rdfs:label \"has calendar busy\"@en ;\n rdfs:comment \"To specify the busy time associated with the object. (Was called FBURL in RFC6350)\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasCalendarLink a owl:ObjectProperty ;\n rdfs:label \"has calendar link\"@en ;\n rdfs:comment \"To specify the calendar associated with the object. (Was called CALURI in RFC6350)\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasCalendarRequest a owl:ObjectProperty ;\n rdfs:label \"has calendar request\"@en ;\n rdfs:comment \"To specify the calendar user address to which a scheduling request be sent for the object. (Was called CALADRURI in RFC6350)\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasCategory a owl:ObjectProperty ;\n rdfs:label \"has category\"@en ;\n rdfs:comment \"Used to support property parameters for the category data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasCountryName a owl:ObjectProperty ;\n rdfs:label \"has country name\"@en ;\n rdfs:comment \"Used to support property parameters for the country name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasFN a owl:ObjectProperty ;\n rdfs:label \"has formatted name\"@en ;\n rdfs:comment \"Used to support property parameters for the formatted name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasFamilyName a owl:ObjectProperty ;\n rdfs:label \"has family name\"@en ;\n rdfs:comment \"Used to support property parameters for the family name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasGender a owl:ObjectProperty ;\n rdfs:label \"has gender\"@en ;\n rdfs:comment \"To specify the sex or gender identity of the object. URIs are recommended to enable interoperable sex and gender codes to be used.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasGivenName a owl:ObjectProperty ;\n rdfs:label \"has given name\"@en ;\n rdfs:comment \"Used to support property parameters for the given name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasHonorificPrefix a owl:ObjectProperty ;\n rdfs:label \"has honorific prefix\"@en ;\n rdfs:comment \"Used to support property parameters for the honorific prefix data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasHonorificSuffix a owl:ObjectProperty ;\n rdfs:label \"has honorific suffix\"@en ;\n rdfs:comment \"Used to support property parameters for the honorific suffix data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasInstantMessage a owl:ObjectProperty ;\n rdfs:label \"has messaging\"@en ;\n rdfs:comment \"To specify the instant messaging and presence protocol communications with the object. (Was called IMPP in RFC6350)\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasLanguage a owl:ObjectProperty ;\n rdfs:label \"has language\"@en ;\n rdfs:comment \"Used to support property parameters for the language data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasLocality a owl:ObjectProperty ;\n rdfs:label \"has locality\"@en ;\n rdfs:comment \"Used to support property parameters for the locality data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasNickname a owl:ObjectProperty ;\n rdfs:label \"has nickname\"@en ;\n rdfs:comment \"Used to support property parameters for the nickname data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:seeAlso :nickname .\n\n:hasNote a owl:ObjectProperty ;\n rdfs:label \"has note\"@en ;\n rdfs:comment \"Used to support property parameters for the note data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasOrganizationName a owl:ObjectProperty ;\n rdfs:label \"has organization name\"@en ;\n rdfs:comment \"Used to support property parameters for the organization name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasOrganizationUnit a owl:ObjectProperty ;\n rdfs:label \"has organization unit name\"@en ;\n rdfs:comment \"Used to support property parameters for the organization unit name data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasPostalCode a owl:ObjectProperty ;\n rdfs:label \"has postal code\"@en ;\n rdfs:comment \"Used to support property parameters for the postal code data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasRegion a owl:ObjectProperty ;\n rdfs:label \"has region\"@en ;\n rdfs:comment \"Used to support property parameters for the region data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasRelated a owl:ObjectProperty ;\n rdfs:label \"has related\"@en ;\n rdfs:comment \"To specify a relationship between another entity and the entity represented by this object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasRole a owl:ObjectProperty ;\n rdfs:label \"has role\"@en ;\n rdfs:comment \"Used to support property parameters for the role data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasSource a owl:ObjectProperty ;\n rdfs:label \"has source\"@en ;\n rdfs:comment \"To identify the source of directory information of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasStreetAddress a owl:ObjectProperty ;\n rdfs:label \"has street address\"@en ;\n rdfs:comment \"Used to support property parameters for the street address data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasTitle a owl:ObjectProperty ;\n rdfs:label \"has title\"@en ;\n rdfs:comment \"Used to support property parameters for the title data property\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasUID a owl:ObjectProperty ;\n rdfs:label \"has uid\"@en ;\n rdfs:comment \"To specify a value that represents a globally unique identifier corresponding to the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasValue a owl:ObjectProperty ;\n rdfs:label \"has value\"@en ;\n rdfs:comment \"Used to indicate the resource value of an object property that requires property parameters\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:label a owl:DatatypeProperty ;\n rdfs:label \"label\"@en ;\n rdfs:comment \"This data property has been deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:language a owl:DatatypeProperty ;\n rdfs:label \"language\"@en ;\n rdfs:comment \"To specify the language that may be used for contacting the object. May also be used as a property parameter.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:latitude a owl:DatatypeProperty ;\n rdfs:label \"latitude\"@en ;\n rdfs:comment \"This data property has been deprecated. See hasGeo\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:longitude a owl:DatatypeProperty ;\n rdfs:label \"longitude\"@en ;\n rdfs:comment \"This data property has been deprecated. See hasGeo\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:mailer a owl:DatatypeProperty ;\n rdfs:label \"mailer\"@en ;\n rdfs:comment \"This data property has been deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:note a owl:DatatypeProperty ;\n rdfs:label \"note\"@en ;\n rdfs:comment \"A note associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:org a owl:ObjectProperty ;\n rdfs:label \"organization\"@en ;\n rdfs:comment \"This object property has been mapped. Use the organization-name data property.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :organization-name .\n\n:organization-unit a owl:DatatypeProperty ;\n rdfs:label \"organizational unit name\"@en ;\n rdfs:comment \"To specify the organizational unit name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string ;\n rdfs:subPropertyOf :organization-name .\n\n:post-office-box a owl:DatatypeProperty ;\n rdfs:label \"post office box\"@en ;\n rdfs:comment \"This data property has been deprecated\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:prodid a owl:DatatypeProperty ;\n rdfs:label \"product id\"@en ;\n rdfs:comment \"To specify the identifier for the product that created the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:rev a owl:DatatypeProperty ;\n rdfs:label \"revision\"@en ;\n rdfs:comment \"To specify revision information about the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:dateTime .\n\n:role a owl:DatatypeProperty ;\n rdfs:label \"role\"@en ;\n rdfs:comment \"To specify the function or part played in a particular situation by the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:sort-string a owl:DatatypeProperty ;\n rdfs:label \"sort as\"@en ;\n rdfs:comment \"To specify the string to be used for national-language-specific sorting. Used as a property parameter only.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:title a owl:DatatypeProperty ;\n rdfs:label \"title\"@en ;\n rdfs:comment \"To specify the position or job of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:tz a owl:DatatypeProperty ;\n rdfs:label \"time zone\"@en ;\n rdfs:comment \"To indicate time zone information that is specific to the object. May also be used as a property parameter.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:value a owl:DatatypeProperty ;\n rdfs:label \"value\"@en ;\n rdfs:comment \"Used to indicate the literal value of a data property that requires property parameters\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:Address a owl:Class ;\n rdfs:label \"Address\"@en ;\n rdfs:comment \"To specify the components of the delivery address for the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentClass [ a owl:Class ;\n owl:unionOf ( [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :country-name ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :country-name ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :locality ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :locality ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :postal-code ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :postal-code ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :region ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :region ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :street-address ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :street-address ] ) ] ) ] .\n\n:Email a owl:Class ;\n rdfs:label \"Email\"@en ;\n rdfs:comment \"To specify the electronic mail address for communication with the object the vCard represents. Use the hasEmail object property.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:deprecated true .\n\n:Group a owl:Class ;\n rdfs:label \"Group\"@en ;\n rdfs:comment \"Object representing a group of persons or entities. A group object will usually contain hasMember properties to specify the members of the group.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Kind ;\n owl:disjointWith :Individual,\n :Location,\n :Organization ;\n owl:equivalentClass [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :hasMember ;\n owl:someValuesFrom :Kind ] [ a owl:Restriction ;\n owl:minQualifiedCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onClass :Kind ;\n owl:onProperty :hasMember ] ) ] .\n\n:Individual a owl:Class ;\n rdfs:label \"Individual\"@en ;\n rdfs:comment \"An object representing a single person or entity\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Kind ;\n owl:disjointWith :Location,\n :Organization .\n\n:Name a owl:Class ;\n rdfs:label \"Name\"@en ;\n rdfs:comment \"To specify the components of the name of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentClass [ a owl:Class ;\n owl:unionOf ( [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :additional-name ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:minCardinality \"0\"^^xsd:nonNegativeInteger ;\n owl:onProperty :additional-name ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :family-name ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :family-name ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :given-name ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:maxCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onProperty :given-name ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :honorific-prefix ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:minCardinality \"0\"^^xsd:nonNegativeInteger ;\n owl:onProperty :honorific-prefix ] ) ] [ a owl:Class ;\n owl:intersectionOf ( [ a owl:Restriction ;\n owl:onProperty :honorific-suffix ;\n owl:someValuesFrom xsd:string ] [ a owl:Restriction ;\n owl:minCardinality \"0\"^^xsd:nonNegativeInteger ;\n owl:onProperty :honorific-suffix ] ) ] ) ] .\n\n:VCard a owl:Class ;\n rdfs:label \"VCard\"@en ;\n rdfs:comment \"The vCard class is equivalent to the new Kind class, which is the parent for the four explicit types of vCards (Individual, Organization, Location, Group)\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentClass :Kind .\n\n:fn a owl:DatatypeProperty ;\n rdfs:label \"formatted name\"@en ;\n rdfs:comment \"The formatted text corresponding to the name of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:hasAddress a owl:ObjectProperty ;\n rdfs:label \"has address\"@en ;\n rdfs:comment \"To specify the components of the delivery address for the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range :Address .\n\n:hasEmail a owl:ObjectProperty ;\n rdfs:label \"has email\"@en ;\n rdfs:comment \"To specify the electronic mail address for communication with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range :Email .\n\n:hasGeo a owl:ObjectProperty ;\n rdfs:label \"has geo\"@en ;\n rdfs:comment \"To specify information related to the global positioning of the object. May also be used as a property parameter.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:hasKey a owl:ObjectProperty ;\n rdfs:label \"has key\"@en ;\n rdfs:comment \"To specify a public key or authentication certificate associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :key .\n\n:hasLogo a owl:ObjectProperty ;\n rdfs:label \"has logo\"@en ;\n rdfs:comment \"To specify a graphic image of a logo associated with the object \"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :logo .\n\n:hasName a owl:ObjectProperty ;\n rdfs:label \"has name\"@en ;\n rdfs:comment \"To specify the components of the name of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range :Name ;\n owl:equivalentProperty :n .\n\n:hasPhoto a owl:ObjectProperty ;\n rdfs:label \"has photo\"@en ;\n rdfs:comment \"To specify an image or photograph information that annotates some aspect of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :photo .\n\n:hasSound a owl:ObjectProperty ;\n rdfs:label \"has sound\"@en ;\n rdfs:comment \"To specify a digital sound content information that annotates some aspect of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :sound .\n\n:hasTelephone a owl:ObjectProperty ;\n rdfs:label \"has telephone\"@en ;\n rdfs:comment \"To specify the telephone number for telephony communication with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :tel .\n\n:hasURL a owl:ObjectProperty ;\n rdfs:label \"has url\"@en ;\n rdfs:comment \"To specify a uniform resource locator associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :url .\n\n:key a owl:ObjectProperty ;\n rdfs:label \"key\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasKey .\n\n:logo a owl:ObjectProperty ;\n rdfs:label \"logo\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasLogo .\n\n:n a owl:ObjectProperty ;\n rdfs:label \"name\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasName .\n\n:nickname a owl:DatatypeProperty ;\n rdfs:label \"nickname\"@en ;\n rdfs:comment \"The nick name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:photo a owl:ObjectProperty ;\n rdfs:label \"photo\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasPhoto .\n\n:sound a owl:ObjectProperty ;\n rdfs:label \"sound\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasSound .\n\n:tel a owl:ObjectProperty ;\n rdfs:label \"telephone\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasTelephone .\n\n:url a owl:ObjectProperty ;\n rdfs:label \"url\"@en ;\n rdfs:comment \"This object property has been mapped\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentProperty :hasURL .\n\n:Location a owl:Class ;\n rdfs:label \"Location\"@en ;\n rdfs:comment \"An object representing a named geographical place\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Kind ;\n owl:disjointWith :Organization .\n\n:additional-name a owl:DatatypeProperty ;\n rdfs:label \"additional name\"@en ;\n rdfs:comment \"The additional name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:country-name a owl:DatatypeProperty ;\n rdfs:label \"country name\"@en ;\n rdfs:comment \"The country name associated with the address of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:family-name a owl:DatatypeProperty ;\n rdfs:label \"family name\"@en ;\n rdfs:comment \"The family name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:given-name a owl:DatatypeProperty ;\n rdfs:label \"given name\"@en ;\n rdfs:comment \"The given name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:hasMember a owl:ObjectProperty ;\n rdfs:label \"has member\"@en ;\n rdfs:comment \"To include a member in the group this object represents. (This property can only be used by Group individuals)\"@en ;\n rdfs:domain :Group ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range :Kind .\n\n:honorific-prefix a owl:DatatypeProperty ;\n rdfs:label \"honorific prefix\"@en ;\n rdfs:comment \"The honorific prefix of the name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:honorific-suffix a owl:DatatypeProperty ;\n rdfs:label \"honorific suffix\"@en ;\n rdfs:comment \"The honorific suffix of the name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:locality a owl:DatatypeProperty ;\n rdfs:label \"locality\"@en ;\n rdfs:comment \"The locality (e.g. city or town) associated with the address of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:organization-name a owl:DatatypeProperty ;\n rdfs:label \"organization name\"@en ;\n rdfs:comment \"To specify the organizational name associated with the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:postal-code a owl:DatatypeProperty ;\n rdfs:label \"postal code\"@en ;\n rdfs:comment \"The postal code associated with the address of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:region a owl:DatatypeProperty ;\n rdfs:label \"region\"@en ;\n rdfs:comment \"The region (e.g. state or province) associated with the address of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:street-address a owl:DatatypeProperty ;\n rdfs:label \"street address\"@en ;\n rdfs:comment \"The street address associated with the address of the object\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:range xsd:string .\n\n:Organization a owl:Class ;\n rdfs:label \"Organization\"@en ;\n rdfs:comment \"\"\"An object representing an organization. An organization is a single entity, and might represent a business or government, a department or division within a business or government, a club, an association, or the like.\n\"\"\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n rdfs:subClassOf :Kind .\n\n:Gender a owl:Class ;\n rdfs:label \"Gender\"@en ;\n rdfs:comment \"Used for gender codes. The URI of the gender code must be used as the value for Gender.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:Kind a owl:Class ;\n rdfs:label \"Kind\"@en ;\n rdfs:comment \"The parent class for all objects\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> ;\n owl:equivalentClass [ a owl:Restriction ;\n owl:minQualifiedCardinality \"1\"^^xsd:nonNegativeInteger ;\n owl:onDataRange xsd:string ;\n owl:onProperty :fn ],\n :VCard .\n\n:Type a owl:Class ;\n rdfs:label \"Type\"@en ;\n rdfs:comment \"Used for type codes. The URI of the type code must be used as the value for Type.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:TelephoneType a owl:Class ;\n rdfs:label \"Phone\"@en ;\n rdfs:comment \"Used for telephone type codes. The URI of the telephone type code must be used as the value for the Telephone Type.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n:RelatedType a owl:Class ;\n rdfs:label \"Relation Type\"@en ;\n rdfs:comment \"Used for relation type codes. The URI of the relation type code must be used as the value for the Relation Type.\"@en ;\n rdfs:isDefinedBy <http://www.w3.org/2006/vcard/ns> .\n\n<http://www.w3.org/2006/vcard/ns> a owl:Ontology ;\n rdfs:label \"Ontology for vCard\"@en ;\n rdfs:comment \"Ontology for vCard based on RFC6350\"@en ;\n owl:versionInfo \"Final\"@en .\n\n\n";
|
|
18
|
-
const $rdf = UI.rdf;
|
|
19
19
|
const ns = UI.ns;
|
|
20
20
|
const kb = _solidLogic.store;
|
|
21
21
|
const style = UI.style;
|
package/dist/individual.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"individual.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_mugshotGallery","_webidControl","_groupMembershipControl","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","textOfForms","VCARD_ONTOLOGY_TEXT","
|
|
1
|
+
{"version":3,"file":"individual.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_mugshotGallery","_webidControl","_groupMembershipControl","$rdf","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","textOfForms","VCARD_ONTOLOGY_TEXT","ns","kb","store","style","loadTurtleText","thing","text","doc","holds","undefined","parse","uri","renderIndividual","dom","div","subject","dataBrowserContext","complain","message","console","log","appendChild","widgets","errorMessageBlock","spacer","createElement","setAttribute","complainIfBad","ok","body","findTypeURIs","isOrganization","vcard","schema","editable","updater","individualForm","sym","orgDetailsForm","vcardOnt","fetcher","load","err","paneDivStyle","authn","checkUser","renderMugshotGallery","form","appendForm","renderGroupMemberships","attachmentList","modify","renderPublicIdControl","renderWebIdControl"],"sources":["../src/individual.js"],"sourcesContent":["import * as UI from 'solid-ui'\nimport { authn, store } from 'solid-logic'\nimport { renderMugshotGallery } from './mugshotGallery'\nimport { renderWebIdControl, renderPublicIdControl } from './webidControl'\nimport { renderGroupMemberships } from './groupMembershipControl'\nimport textOfForms from './ontology/forms.ttl'\nimport VCARD_ONTOLOGY_TEXT from './ontology/vcard.ttl'\nimport * as $rdf from 'rdflib'\n\nconst ns = UI.ns\nconst kb = store\nconst style = UI.style\n\nexport function loadTurtleText (kb, thing, text) {\n const doc = thing.doc()\n if (!kb.holds(undefined, undefined, undefined, doc)) {\n // If not loaded already\n $rdf.parse(text, kb, doc.uri, 'text/turtle') // Load directly\n }\n}\n\n// Render Individual card\n\nexport async function renderIndividual (dom, div, subject, dataBrowserContext) {\n // //////////////////// DRAG and Drop for mugshot image\n\n function complain (message) {\n console.log(message)\n div.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'))\n }\n\n function spacer () {\n div\n .appendChild(dom.createElement('div'))\n .setAttribute('style', 'height: 1em')\n }\n function complainIfBad (ok, body) {\n if (!ok) {\n complain('Error: ' + body)\n }\n }\n\n /// ///////////////////////////\n const t = kb.findTypeURIs(subject)\n const isOrganization = !!(t[ns.vcard('Organization').uri] || t[ns.schema('Organization').uri])\n const editable = kb.updater.editable(subject.doc().uri, kb)\n\n const individualForm = kb.sym(\n 'https://solid.github.io/solid-panes/contact/individualForm.ttl#form1'\n )\n loadTurtleText(kb, individualForm, textOfForms)\n\n const orgDetailsForm = kb.sym( // orgDetailsForm organizationForm\n 'https://solid.github.io/solid-panes/contact/individualForm.ttl#orgDetailsForm'\n )\n\n // Ontology metadata for this pane we bundle with the JS\n const vcardOnt = UI.ns.vcard('Type').doc()\n if (!kb.holds(undefined, undefined, undefined, vcardOnt)) {\n // If not loaded already\n $rdf.parse(VCARD_ONTOLOGY_TEXT, kb, vcardOnt.uri, 'text/turtle') // Load ontology directly\n }\n\n try {\n await kb.fetcher.load(subject.doc())\n } catch (err) {\n complain('Error: Failed to load contact card: ' + err)\n } // end of try catch on load\n\n div.style = style.paneDivStyle || 'padding: 0.5em 1.5em 1em 1.5em;'\n\n authn.checkUser() // kick off async operation @@@ use async version\n\n div.appendChild(renderMugshotGallery(dom, subject))\n\n const form = isOrganization ? orgDetailsForm : individualForm\n UI.widgets.appendForm(\n dom,\n div,\n {},\n subject,\n form,\n subject.doc(),\n complainIfBad\n )\n\n spacer()\n\n div.appendChild(await renderGroupMemberships(subject, dataBrowserContext))\n\n spacer()\n\n // Auto complete searches in a table\n // Prefer the fom below renderPublicIdControl\n /*\n if (isOrganization) {\n const publicDataTable = div.appendChild(dom.createElement('table'))\n async function publicDataSearchRow (name) {\n async function autoCompleteDone (object, _name) {\n right.innerHTML = ''\n right.appendchild(UI.widgets.personTR(dom, object))\n }\n const row = dom.createElement('tr')\n const left = row.appendChild(dom.createElement('td'))\n left.textContent = name\n const right = row.appendChild(dom.createElement('td'))\n right.appendChild(await renderAutoComplete(dom, subject, ns.owl('sameAs'), autoCompleteDone))\n return row\n }\n publicDataTable.appendChild(await publicDataSearchRow('dbpedia'))\n }\n*/\n // Allow to attach documents etc to the contact card\n\n UI.widgets.attachmentList(dom, subject, div, {\n modify: editable\n // promptIcon: UI.icons.iconBase + 'noun_681601.svg',\n // predicate: UI.ns.vcard('url') // @@@@@@@@@ ,--- no, the vcard ontology structure uses a bnode.\n })\n\n spacer()\n\n if (isOrganization) {\n div.appendChild(await renderPublicIdControl(subject, dataBrowserContext))\n } else {\n div.appendChild(await renderWebIdControl(subject, dataBrowserContext))\n }\n // div.appendChild(dom.createElement('hr'))\n} // renderIndividual\n"],"mappings":";;;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAJ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F,CAAC;EAEDH,MAAM,CAAC,CAAC;EAERV,GAAG,CAACO,WAAW,CAAC,MAAM,IAAA4B,8CAAsB,EAAClC,OAAO,EAAEC,kBAAkB,CAAC,CAAC;EAE1EQ,MAAM,CAAC,CAAC;;EAER;EACA;EACA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE;;EAEArD,EAAE,CAACmD,OAAO,CAAC4B,cAAc,CAACrC,GAAG,EAAEE,OAAO,EAAED,GAAG,EAAE;IAC3CqC,MAAM,EAAEjB;IACR;IACA;EACF,CAAC,CAAC;EAEFV,MAAM,CAAC,CAAC;EAER,IAAIO,cAAc,EAAE;IAClBjB,GAAG,CAACO,WAAW,CAAC,MAAM,IAAA+B,mCAAqB,EAACrC,OAAO,EAAEC,kBAAkB,CAAC,CAAC;EAC3E,CAAC,MAAM;IACLF,GAAG,CAACO,WAAW,CAAC,MAAM,IAAAgC,gCAAkB,EAACtC,OAAO,EAAEC,kBAAkB,CAAC,CAAC;EACxE;EACA;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.mintNewAddressBook = mintNewAddressBook;
|
|
7
7
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
8
8
|
var _solidLogic = require("solid-logic");
|
|
9
|
+
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
9
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
11
|
const {
|
|
11
12
|
setACLUserPublic
|
|
@@ -14,7 +15,6 @@ const {
|
|
|
14
15
|
// const toolsPane0 = require('./toolsPane')
|
|
15
16
|
// const toolsPane = toolsPane0.toolsPane
|
|
16
17
|
|
|
17
|
-
const $rdf = UI.rdf;
|
|
18
18
|
// const ns = UI.ns
|
|
19
19
|
// const utils = UI.utils
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintNewAddressBook.js","names":["UI","_interopRequireWildcard","require","_solidLogic","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","setACLUserPublic","solidLogicSingleton","acl","$rdf","rdf","mintNewAddressBook","dataBrowserContext","context","Promise","resolve","reject","login","ensureLoadedProfile","then","console","log","me","dom","div","kb","session","store","ns","newBase","newInstance","dir","uri","instanceClass","vcard","sameTerm","g","sym","doc","add","instanceName","fetcher","putBack","contentType","_xhr","catch","err","Error","appInstanceNoun","complain","message","appendChild","widgets","errorMessageBlock","bookContents","newAppInstance","toBeWritten","to","content","existing","aclOptions","defaultForNew","claimSuccess","p","createElement","setAttribute","innerHTML","newContext","assign","doNextTask","checkOKSetACL","ok","task","dest","length","shift","join","webOperation","data","saveMetadata"],"sources":["../src/mintNewAddressBook.js"],"sourcesContent":["import * as UI from 'solid-ui'\nimport { solidLogicSingleton } from 'solid-logic'\n\nconst { setACLUserPublic } = solidLogicSingleton.acl\n// const mime = require('mime-types')\n// const toolsPane0 = require('./toolsPane')\n// const toolsPane = toolsPane0.toolsPane\n\nconst $rdf = UI.rdf\n// const ns = UI.ns\n// const utils = UI.utils\n\n// Mint a new address book\n\nexport function mintNewAddressBook (dataBrowserContext, context) {\n return new Promise(function (resolve, reject) {\n UI.login.ensureLoadedProfile(context).then(\n context => {\n // 20180713\n console.log('Logged in as ' + context.me)\n const me = context.me\n\n const dom = context.dom\n const div = context.div\n const kb = dataBrowserContext.session.store\n const ns = UI.ns\n const newBase = context.newBase || context.newInstance.dir().uri\n const instanceClass = context.instanceClass || ns.vcard('AddressBook')\n\n if (instanceClass.sameTerm(ns.vcard('Group'))) {\n // Make a group not an address book\n const g =\n context.newInstance || kb.sym(context.newBase + 'index.ttl#this')\n const doc = g.doc()\n kb.add(g, ns.rdf('type'), ns.vcard('Group'), doc)\n kb.add(\n g,\n ns.vcard('fn'),\n context.instanceName || 'untitled group',\n doc\n ) // @@ write doc back\n kb.fetcher\n .putBack(doc, { contentType: 'text/turtle' })\n .then(function (_xhr) {\n resolve(context)\n })\n .catch(function (err) {\n reject(\n new Error('Error creating document for new group ' + err)\n )\n })\n return\n }\n const appInstanceNoun = 'address book'\n\n function complain (message) {\n div.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'))\n }\n\n let bookContents = `@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n @prefix ab: <http://www.w3.org/ns/pim/ab#>.\n @prefix dc: <http://purl.org/dc/elements/1.1/>.\n @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n\n <#this> a vcard:AddressBook;\n dc:title \"New address Book\";\n vcard:nameEmailIndex <people.ttl>;\n vcard:groupIndex <groups.ttl>.\n`\n\n bookContents +=\n '<#this> <http://www.w3.org/ns/auth/acl#owner> <' +\n me.uri +\n '>.\\n\\n'\n\n const newAppInstance = kb.sym(newBase + 'index.ttl#this')\n\n const toBeWritten = [\n {\n to: 'index.ttl',\n content: bookContents,\n contentType: 'text/turtle'\n },\n { to: 'groups.ttl', content: '', contentType: 'text/turtle' },\n { to: 'people.ttl', content: '', contentType: 'text/turtle' },\n { to: '', existing: true, aclOptions: { defaultForNew: true } }\n ]\n\n // @@ Ask user abut ACLs?\n\n //\n // @@ Add header to PUT If-None-Match: * to prevent overwrite\n //\n\n function claimSuccess (newAppInstance, appInstanceNoun) {\n // @@ delete or grey other stuff\n console.log(`New ${appInstanceNoun} created at ${newAppInstance}`)\n const p = div.appendChild(dom.createElement('p'))\n p.setAttribute('style', 'font-size: 140%;')\n p.innerHTML =\n 'Your <a href=\\'' +\n newAppInstance.uri +\n '\\'><b>new ' +\n appInstanceNoun +\n '</b></a> is ready. ' +\n '<br/><br/><a href=\\'' +\n newAppInstance.uri +\n '\\'>Go to new ' +\n appInstanceNoun +\n '</a>'\n const newContext = Object.assign(\n { newInstance: newAppInstance },\n context\n )\n resolve(newContext)\n }\n\n function doNextTask () {\n function checkOKSetACL (uri, ok) {\n if (!ok) {\n complain('Error writing new file ' + task.to)\n return reject(new Error('Error writing new file ' + task.to))\n }\n\n setACLUserPublic(dest, me, aclOptions)\n .then(() => doNextTask())\n .catch(err => {\n const message =\n 'Error setting access permissions for ' +\n task.to +\n ' : ' +\n err.message\n complain(message)\n return reject(new Error(message))\n })\n }\n\n if (toBeWritten.length === 0) {\n claimSuccess(newAppInstance, appInstanceNoun)\n } else {\n var task = toBeWritten.shift() /* eslint-disable-line no-var */\n console.log('Creating new file ' + task.to + ' in new instance ')\n var dest = $rdf.uri.join(task.to, newBase) /* eslint-disable-line no-var */\n var aclOptions = task.aclOptions || {} /* eslint-disable-line no-var */\n\n if ('content' in task) {\n kb.fetcher\n .webOperation('PUT', dest, {\n data: task.content,\n saveMetadata: true,\n contentType: task.contentType\n })\n .then(() => checkOKSetACL(dest, true))\n } else if ('existing' in task) {\n checkOKSetACL(dest, true)\n } else {\n reject(new Error('copy not expected buiding new app!!'))\n // const from = task.from || task.to // default source to be same as dest\n // UI.widgets.webCopy(base + from, dest, task.contentType, checkOKSetACL)\n }\n }\n }\n doNextTask()\n },\n err => {\n // log in then\n context.div.appendChild(UI.widgets.errorMessageBlock(err))\n }\n )\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAiD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OA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AC/BvD,OAAO,CAACC,GAAG,CAAC,oBAAoB,GAAGmD,IAAI,CAACf,EAAE,GAAG,mBAAmB,CAAC;UACjE,IAAIgB,IAAI,GAAGhE,IAAI,CAACuB,GAAG,CAAC4C,IAAI,CAACJ,IAAI,CAACf,EAAE,EAAE5B,OAAO,CAAC,EAAC;UAC3C,IAAI+B,UAAU,GAAGY,IAAI,CAACZ,UAAU,IAAI,CAAC,CAAC,EAAC;;UAEvC,IAAI,SAAS,IAAIY,IAAI,EAAE;YACrB/C,EAAE,CAACgB,OAAO,CACPoC,YAAY,CAAC,KAAK,EAAEJ,IAAI,EAAE;cACzBK,IAAI,EAAEN,IAAI,CAACd,OAAO;cAClBqB,YAAY,EAAE,IAAI;cAClBpC,WAAW,EAAE6B,IAAI,CAAC7B;YACpB,CAAC,CAAC,CACDxB,IAAI,CAAC,MAAMmD,aAAa,CAACG,IAAI,EAAE,IAAI,CAAC,CAAC;UAC1C,CAAC,MAAM,IAAI,UAAU,IAAID,IAAI,EAAE;YAC7BF,aAAa,CAACG,IAAI,EAAE,IAAI,CAAC;UAC3B,CAAC,MAAM;YACLzD,MAAM,CAAC,IAAI+B,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACxD;YACA;UACF;QACF;MACF;MACAsB,UAAU,CAAC,CAAC;IACd,CAAC,EACDvB,GAAG,IAAI;MACL;MACAjC,OAAO,CAACW,GAAG,CAAC2B,WAAW,CAACpE,EAAE,CAACqE,OAAO,CAACC,iBAAiB,CAACP,GAAG,CAAC,CAAC;IAC5D,CACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"mintNewAddressBook.js","names":["UI","_interopRequireWildcard","require","_solidLogic","$rdf","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","setACLUserPublic","solidLogicSingleton","acl","mintNewAddressBook","dataBrowserContext","context","Promise","resolve","reject","login","ensureLoadedProfile","then","console","log","me","dom","div","kb","session","store","ns","newBase","newInstance","dir","uri","instanceClass","vcard","sameTerm","g","sym","doc","add","rdf","instanceName","fetcher","putBack","contentType","_xhr","catch","err","Error","appInstanceNoun","complain","message","appendChild","widgets","errorMessageBlock","bookContents","newAppInstance","toBeWritten","to","content","existing","aclOptions","defaultForNew","claimSuccess","p","createElement","setAttribute","innerHTML","newContext","assign","doNextTask","checkOKSetACL","ok","task","dest","length","shift","join","webOperation","data","saveMetadata"],"sources":["../src/mintNewAddressBook.js"],"sourcesContent":["import * as UI from 'solid-ui'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as $rdf from 'rdflib'\n\nconst { setACLUserPublic } = solidLogicSingleton.acl\n// const mime = require('mime-types')\n// const toolsPane0 = require('./toolsPane')\n// const toolsPane = toolsPane0.toolsPane\n\n// const ns = UI.ns\n// const utils = UI.utils\n\n// Mint a new address book\n\nexport function mintNewAddressBook (dataBrowserContext, context) {\n return new Promise(function (resolve, reject) {\n UI.login.ensureLoadedProfile(context).then(\n context => {\n // 20180713\n console.log('Logged in as ' + context.me)\n const me = context.me\n\n const dom = context.dom\n const div = context.div\n const kb = dataBrowserContext.session.store\n const ns = UI.ns\n const newBase = context.newBase || context.newInstance.dir().uri\n const instanceClass = context.instanceClass || ns.vcard('AddressBook')\n\n if (instanceClass.sameTerm(ns.vcard('Group'))) {\n // Make a group not an address book\n const g =\n context.newInstance || kb.sym(context.newBase + 'index.ttl#this')\n const doc = g.doc()\n kb.add(g, ns.rdf('type'), ns.vcard('Group'), doc)\n kb.add(\n g,\n ns.vcard('fn'),\n context.instanceName || 'untitled group',\n doc\n ) // @@ write doc back\n kb.fetcher\n .putBack(doc, { contentType: 'text/turtle' })\n .then(function (_xhr) {\n resolve(context)\n })\n .catch(function (err) {\n reject(\n new Error('Error creating document for new group ' + err)\n )\n })\n return\n }\n const appInstanceNoun = 'address book'\n\n function complain (message) {\n div.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'))\n }\n\n let bookContents = `@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n @prefix ab: <http://www.w3.org/ns/pim/ab#>.\n @prefix dc: <http://purl.org/dc/elements/1.1/>.\n @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\n\n <#this> a vcard:AddressBook;\n dc:title \"New address Book\";\n vcard:nameEmailIndex <people.ttl>;\n vcard:groupIndex <groups.ttl>.\n`\n\n bookContents +=\n '<#this> <http://www.w3.org/ns/auth/acl#owner> <' +\n me.uri +\n '>.\\n\\n'\n\n const newAppInstance = kb.sym(newBase + 'index.ttl#this')\n\n const toBeWritten = [\n {\n to: 'index.ttl',\n content: bookContents,\n contentType: 'text/turtle'\n },\n { to: 'groups.ttl', content: '', contentType: 'text/turtle' },\n { to: 'people.ttl', content: '', contentType: 'text/turtle' },\n { to: '', existing: true, aclOptions: { defaultForNew: true } }\n ]\n\n // @@ Ask user abut ACLs?\n\n //\n // @@ Add header to PUT If-None-Match: * to prevent overwrite\n //\n\n function claimSuccess (newAppInstance, appInstanceNoun) {\n // @@ delete or grey other stuff\n console.log(`New ${appInstanceNoun} created at ${newAppInstance}`)\n const p = div.appendChild(dom.createElement('p'))\n p.setAttribute('style', 'font-size: 140%;')\n p.innerHTML =\n 'Your <a href=\\'' +\n newAppInstance.uri +\n '\\'><b>new ' +\n appInstanceNoun +\n '</b></a> is ready. ' +\n '<br/><br/><a href=\\'' +\n newAppInstance.uri +\n '\\'>Go to new ' +\n appInstanceNoun +\n '</a>'\n const newContext = Object.assign(\n { newInstance: newAppInstance },\n context\n )\n resolve(newContext)\n }\n\n function doNextTask () {\n function checkOKSetACL (uri, ok) {\n if (!ok) {\n complain('Error writing new file ' + task.to)\n return reject(new Error('Error writing new file ' + task.to))\n }\n\n setACLUserPublic(dest, me, aclOptions)\n .then(() => doNextTask())\n .catch(err => {\n const message =\n 'Error setting access permissions for ' +\n task.to +\n ' : ' +\n err.message\n complain(message)\n return reject(new Error(message))\n })\n }\n\n if (toBeWritten.length === 0) {\n claimSuccess(newAppInstance, appInstanceNoun)\n } else {\n var task = toBeWritten.shift() /* eslint-disable-line no-var */\n console.log('Creating new file ' + task.to + ' in new instance ')\n var dest = $rdf.uri.join(task.to, newBase) /* eslint-disable-line no-var */\n var aclOptions = task.aclOptions || {} /* eslint-disable-line no-var */\n\n if ('content' in task) {\n kb.fetcher\n .webOperation('PUT', dest, {\n data: task.content,\n saveMetadata: true,\n contentType: task.contentType\n })\n .then(() => checkOKSetACL(dest, true))\n } else if ('existing' in task) {\n checkOKSetACL(dest, true)\n } else {\n reject(new Error('copy not expected buiding new app!!'))\n // const from = task.from || task.to // default source to be same as dest\n // UI.widgets.webCopy(base + from, dest, task.contentType, checkOKSetACL)\n }\n }\n }\n doNextTask()\n },\n err => {\n // log in then\n context.div.appendChild(UI.widgets.errorMessageBlock(err))\n }\n )\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAH,uBAAA,CAAAC,OAAA;AAA8B,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,I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D,aAAa,CAACG,IAAI,EAAE,IAAI,CAAC,CAAC;UAC1C,CAAC,MAAM,IAAI,UAAU,IAAID,IAAI,EAAE;YAC7BF,aAAa,CAACG,IAAI,EAAE,IAAI,CAAC;UAC3B,CAAC,MAAM;YACL1D,MAAM,CAAC,IAAIgC,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACxD;YACA;UACF;QACF;MACF;MACAsB,UAAU,CAAC,CAAC;IACd,CAAC,EACDvB,GAAG,IAAI;MACL;MACAlC,OAAO,CAACW,GAAG,CAAC4B,WAAW,CAACpE,EAAE,CAACqE,OAAO,CAACC,iBAAiB,CAACP,GAAG,CAAC,CAAC;IAC5D,CACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/dist/mugshotGallery.js
CHANGED
|
@@ -7,9 +7,9 @@ exports.renderMugshotGallery = renderMugshotGallery;
|
|
|
7
7
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
8
8
|
var _solidLogic = require("solid-logic");
|
|
9
9
|
var _mimeTypes = _interopRequireDefault(require("mime-types"));
|
|
10
|
+
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
-
const $rdf = UI.rdf;
|
|
13
13
|
const ns = UI.ns;
|
|
14
14
|
const utils = UI.utils;
|
|
15
15
|
const kb = _solidLogic.store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mugshotGallery.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_mimeTypes","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","$rdf","rdf","ns","utils","kb","store","renderMugshotGallery","dom","subject","complain","message","console","log","galleryDiv","appendChild","widgets","errorMessageBlock","linkToPicture","pic","remove","link","st","vcard","doc","updater","update","err","msg","alert","handleDroppedThing","thing","fetcher","nowOrWhenFetched","ok","mess","types","findTypeURIs","ty","add","wf","uploadFileToContact","filename","contentType","data","extension","mime","lookup","prefix","predicate","isImage","startsWith","sym","dir","uri","holds","byteLength","webOperation","then","response","status","putBack","_response","mugshotDiv","refresh","handleURIsDroppedOnMugshot","uris","u","indexOf","slice","options","withCredentials","credentials","result","headers","pathEnd","split","arrayBuffer","droppedFileHandler","files","length","name","type","size","lastModifiedDate","toLocaleDateString","reader","FileReader","onload","theFile","target","encodeURIComponent","readAsArrayBuffer","elementForImage","image","img","createElement","setAttribute","makeDropTarget","_fetch","blob","myBlob","objectURL","URL","createObjectURL","makeDraggable","syncMugshots","images","each","sort","innerHTML","editable","placeholder","syncTableToArray","getImageDoc","imageDoc","Date","now","tookPicture","trashCan","button","icons","iconBase","droppedURIHandler","map","x","includes","confirm","renderImageTools","imageToolTable","row","left","middle","right","media","cameraButton","fileUploadButtonDiv","setImage"],"sources":["../src/mugshotGallery.js"],"sourcesContent":["import * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\nimport mime from 'mime-types'\n\nconst $rdf = UI.rdf\nconst ns = UI.ns\nconst utils = UI.utils\nconst kb = store\n\n/* Mugshot Gallery\n*\n* A widget for managing a set of images.\n* Make this a form field?\n*/\nexport function renderMugshotGallery (dom, subject) {\n function complain (message) {\n console.log(message)\n galleryDiv.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'))\n }\n\n async function linkToPicture (subject, pic, remove) {\n const link = [\n $rdf.st(subject, ns.vcard('hasPhoto'), pic, subject.doc())\n ]\n try {\n if (remove) {\n await kb.updater.update(link, [])\n } else {\n await kb.updater.update([], link)\n }\n } catch (err) {\n const msg = ' Write back image link FAIL ' + pic + ', Error: ' + err\n console.log(msg)\n alert(msg)\n }\n }\n\n function handleDroppedThing (thing) {\n kb.fetcher.nowOrWhenFetched(thing.doc(), function (ok, mess) {\n if (!ok) {\n console.log('Error looking up dropped thing ' + thing + ': ' + mess)\n } else {\n const types = kb.findTypeURIs(thing)\n for (const ty in types) {\n console.log(' drop object type includes: ' + ty) // @@ Allow email addresses and phone numbers to be dropped?\n }\n console.log('Default: assume web page ' + thing) // icon was: UI.icons.iconBase + 'noun_25830.svg'\n kb.add(subject, ns.wf('attachment'), thing, subject.doc())\n // @@ refresh UI\n }\n })\n }\n\n function uploadFileToContact (filename, contentType, data) {\n // const fileExtension = filename.split('.').pop() // .toLowerCase()\n const extension = mime.extension(contentType)\n if (contentType !== mime.lookup(filename)) {\n filename += '_.' + extension\n console.log('MIME TYPE MISMATCH -- adding extension: ' + filename)\n }\n let prefix, predicate\n const isImage = contentType.startsWith('image')\n if (isImage) {\n prefix = 'image_'\n predicate = ns.vcard('hasPhoto')\n } else {\n prefix = 'attachment_'\n predicate = ns.wf('attachment')\n }\n\n let n, pic\n for (n = 0; ; n++) {\n // Check filename is not used or invent new one\n pic = kb.sym(subject.dir().uri + filename)\n if (!kb.holds(subject, ns.vcard('hasPhoto'), pic)) {\n break\n }\n filename = prefix + n + '.' + extension\n }\n console.log(\n 'Putting ' +\n data.byteLength +\n ' bytes of ' +\n contentType +\n ' to ' +\n pic\n )\n kb.fetcher\n .webOperation('PUT', pic.uri, {\n data,\n contentType\n })\n .then(function (response) {\n if (!response.ok) {\n complain('Error uploading ' + pic + ':' + response.status)\n return\n }\n console.log(' Upload: put OK: ' + pic)\n kb.add(subject, predicate, pic, subject.doc())\n kb.fetcher\n .putBack(subject.doc(), { contentType: 'text/turtle' })\n .then(\n function (_response) {\n if (isImage) {\n mugshotDiv.refresh()\n }\n },\n function (err) {\n console.log(\n ' Write back image link FAIL ' + pic + ', Error: ' + err\n )\n }\n )\n })\n }\n\n // When a set of URIs are dropped on\n async function handleURIsDroppedOnMugshot (uris) {\n for (const u of uris) {\n let thing = $rdf.sym(u) // Attachment needs text label to disinguish I think not icon.\n console.log('Dropped on mugshot thing ' + thing) // icon was: UI.icons.iconBase + 'noun_25830.svg'\n if (u.startsWith('http') && u.indexOf('#') < 0) {\n // Plain document\n // Take a copy of a photo on the web:\n if (u.startsWith('http:')) { // because of browser mixed content stuff can't read http:\n thing = $rdf.sym('https:' + u.slice(5))\n }\n const options = { withCredentials: false, credentials: 'omit' }\n let result\n try {\n result = await kb.fetcher.webOperation('GET', thing.uri, options)\n } catch (err) {\n complain(\n `Gallery: fetch error trying to read picture ${thing} data: ${err}`\n )\n handleDroppedThing(thing)\n return\n }\n const contentType = result.headers.get('Content-Type')\n let pathEnd = thing.uri.split('/').slice(-1)[0] // last segment as putative filename\n pathEnd = pathEnd.split('?')[0] // chop off any query params\n const data = await result.arrayBuffer()\n if (!result.ok) {\n alert('Cant download, so will link image. ' + thing + ':' + result.status)\n handleDroppedThing(thing)\n return\n }\n uploadFileToContact(pathEnd, contentType, data)\n return\n } else {\n alert(\n 'Not a web document URI, cannot copy as picture: ' + thing\n )\n }\n handleDroppedThing(thing)\n }\n }\n\n // Drop an image file to set up the mugshot\n function droppedFileHandler (files) {\n for (let i = 0; i < files.length; i++) {\n const f = files[i]\n console.log(\n ' contacts: Filename: ' +\n f.name +\n ', type: ' +\n (f.type || 'n/a') +\n ' size: ' +\n f.size +\n ' bytes, last modified: ' +\n (f.lastModifiedDate\n ? f.lastModifiedDate.toLocaleDateString()\n : 'n/a')\n ) // See e.g. https://www.html5rocks.com/en/tutorials/file/dndfiles/\n\n // @@ Add: progress bar(s)\n const reader = new FileReader()\n reader.onload = (function (theFile) {\n return function (e) {\n const data = e.target.result\n console.log(' File read byteLength : ' + data.byteLength)\n const filename = encodeURIComponent(theFile.name)\n const contentType = theFile.type\n uploadFileToContact(filename, contentType, data)\n }\n })(f)\n reader.readAsArrayBuffer(f)\n }\n }\n\n function elementForImage (image) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 10em; border-radius: 1em; margin: 0.7em;'\n )\n UI.widgets.makeDropTarget(\n img,\n handleURIsDroppedOnMugshot,\n droppedFileHandler\n )\n if (image) {\n // img.setAttribute('src', image.uri) use token and works with NSS but not with CSS\n // we need to get image with authenticated fetch\n store.fetcher._fetch(image.uri)\n .then(function (response) {\n return response.blob()\n })\n .then(function (myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL)\n })\n UI.widgets.makeDraggable(img, image)\n }\n return img\n }\n\n function syncMugshots () {\n let images = kb.each(subject, ns.vcard('hasPhoto')) // Priviledge vcard ones\n images.sort() // arbitrary consistency\n images = images.slice(0, 5) // max number for the space\n if (images.length === 0) {\n mugshotDiv.innerHTML = '' // strictly, don't remove it if already there\n if (editable) {\n mugshotDiv.appendChild(placeholder) // A head image to drop pictures on\n } // otherwise leave gallery empty .. nothing to see here folks\n } else {\n utils.syncTableToArray(mugshotDiv, images, elementForImage)\n }\n }\n\n // Good URI for a Camera picture\n function getImageDoc () {\n const imageDoc = kb.sym(\n subject.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n // Store picture\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await linkToPicture(subject, imageDoc)\n syncMugshots()\n }\n }\n\n function trashCan () {\n const button = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_925021.svg',\n 'Drag here to delete'\n )\n async function droppedURIHandler (uris) {\n const images = kb\n .each(subject, ns.vcard('hasPhoto'))\n .map(x => x.uri)\n for (const uri of uris) {\n if (!images.includes(uri)) {\n alert('Only drop images in this contact onto this trash can.')\n return\n }\n if (confirm(`Permanently DELETE image ${uri} completely?`)) {\n console.log('Unlinking image file ' + uri)\n await linkToPicture(subject, kb.sym(uri), true)\n try {\n console.log('Deleting image file ' + uri)\n await kb.fetcher.webOperation('DELETE', uri)\n } catch (err) {\n alert('Unable to delete picture! ' + err)\n }\n }\n }\n syncMugshots()\n }\n UI.widgets.makeDropTarget(button, droppedURIHandler, null)\n return button\n }\n\n function renderImageTools () {\n const imageToolTable = dom.createElement('table')\n const row = imageToolTable.appendChild(dom.createElement('tr'))\n const left = row.appendChild(dom.createElement('td'))\n const middle = row.appendChild(dom.createElement('td'))\n const right = row.appendChild(dom.createElement('td'))\n\n left.appendChild(\n UI.media.cameraButton(dom, kb, getImageDoc, tookPicture)\n ) // 20190812\n try {\n middle.appendChild(\n UI.widgets.fileUploadButtonDiv(dom, droppedFileHandler)\n )\n } catch (e) {\n console.log('ignore fileUploadButtonDiv error for now', e)\n }\n right.appendChild(trashCan())\n return imageToolTable\n }\n\n // Body of renderMugshotGallery\n\n const editable = kb.updater.editable(subject.doc().uri, kb)\n const galleryDiv = dom.createElement('div')\n const mugshotDiv = galleryDiv.appendChild(dom.createElement('div'))\n const placeholder = elementForImage()\n UI.widgets.setImage(placeholder, subject) // Fallback icon or get from web\n syncMugshots()\n mugshotDiv.refresh = syncMugshots\n if (editable) {\n galleryDiv.appendChild(renderImageTools())\n }\n return galleryDiv\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6B,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAK,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAA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AACwG,QAAQ,CAAC,CAAC,CAAC;IAC7B,OAAOU,cAAc;EACvB;;EAEA;;EAEA,MAAMlB,QAAQ,GAAG1G,EAAE,CAACoB,OAAO,CAACsF,QAAQ,CAACtG,OAAO,CAACe,GAAG,CAAC,CAAC,CAAC8B,GAAG,EAAEjD,EAAE,CAAC;EAC3D,MAAMS,UAAU,GAAGN,GAAG,CAACwF,aAAa,CAAC,KAAK,CAAC;EAC3C,MAAMjC,UAAU,GAAGjD,UAAU,CAACC,WAAW,CAACP,GAAG,CAACwF,aAAa,CAAC,KAAK,CAAC,CAAC;EACnE,MAAMgB,WAAW,GAAGnB,eAAe,CAAC,CAAC;EACrCrH,EAAE,CAACwC,OAAO,CAACyH,QAAQ,CAACzB,WAAW,EAAEvG,OAAO,CAAC,EAAC;EAC1CiG,YAAY,CAAC,CAAC;EACd3C,UAAU,CAACC,OAAO,GAAG0C,YAAY;EACjC,IAAIK,QAAQ,EAAE;IACZjG,UAAU,CAACC,WAAW,CAACiH,gBAAgB,CAAC,CAAC,CAAC;EAC5C;EACA,OAAOlH,UAAU;AACnB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"mugshotGallery.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_mimeTypes","_interopRequireDefault","$rdf","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","utils","kb","store","renderMugshotGallery","dom","subject","complain","message","console","log","galleryDiv","appendChild","widgets","errorMessageBlock","linkToPicture","pic","remove","link","st","vcard","doc","updater","update","err","msg","alert","handleDroppedThing","thing","fetcher","nowOrWhenFetched","ok","mess","types","findTypeURIs","ty","add","wf","uploadFileToContact","filename","contentType","data","extension","mime","lookup","prefix","predicate","isImage","startsWith","sym","dir","uri","holds","byteLength","webOperation","then","response","status","putBack","_response","mugshotDiv","refresh","handleURIsDroppedOnMugshot","uris","u","indexOf","slice","options","withCredentials","credentials","result","headers","pathEnd","split","arrayBuffer","droppedFileHandler","files","length","name","type","size","lastModifiedDate","toLocaleDateString","reader","FileReader","onload","theFile","target","encodeURIComponent","readAsArrayBuffer","elementForImage","image","img","createElement","setAttribute","makeDropTarget","_fetch","blob","myBlob","objectURL","URL","createObjectURL","makeDraggable","syncMugshots","images","each","sort","innerHTML","editable","placeholder","syncTableToArray","getImageDoc","imageDoc","Date","now","tookPicture","trashCan","button","icons","iconBase","droppedURIHandler","map","x","includes","confirm","renderImageTools","imageToolTable","row","left","middle","right","media","cameraButton","fileUploadButtonDiv","setImage"],"sources":["../src/mugshotGallery.js"],"sourcesContent":["import * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\nimport mime from 'mime-types'\nimport * as $rdf from 'rdflib'\n\nconst ns = UI.ns\nconst utils = UI.utils\nconst kb = store\n\n/* Mugshot Gallery\n*\n* A widget for managing a set of images.\n* Make this a form field?\n*/\nexport function renderMugshotGallery (dom, subject) {\n function complain (message) {\n console.log(message)\n galleryDiv.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'))\n }\n\n async function linkToPicture (subject, pic, remove) {\n const link = [\n $rdf.st(subject, ns.vcard('hasPhoto'), pic, subject.doc())\n ]\n try {\n if (remove) {\n await kb.updater.update(link, [])\n } else {\n await kb.updater.update([], link)\n }\n } catch (err) {\n const msg = ' Write back image link FAIL ' + pic + ', Error: ' + err\n console.log(msg)\n alert(msg)\n }\n }\n\n function handleDroppedThing (thing) {\n kb.fetcher.nowOrWhenFetched(thing.doc(), function (ok, mess) {\n if (!ok) {\n console.log('Error looking up dropped thing ' + thing + ': ' + mess)\n } else {\n const types = kb.findTypeURIs(thing)\n for (const ty in types) {\n console.log(' drop object type includes: ' + ty) // @@ Allow email addresses and phone numbers to be dropped?\n }\n console.log('Default: assume web page ' + thing) // icon was: UI.icons.iconBase + 'noun_25830.svg'\n kb.add(subject, ns.wf('attachment'), thing, subject.doc())\n // @@ refresh UI\n }\n })\n }\n\n function uploadFileToContact (filename, contentType, data) {\n // const fileExtension = filename.split('.').pop() // .toLowerCase()\n const extension = mime.extension(contentType)\n if (contentType !== mime.lookup(filename)) {\n filename += '_.' + extension\n console.log('MIME TYPE MISMATCH -- adding extension: ' + filename)\n }\n let prefix, predicate\n const isImage = contentType.startsWith('image')\n if (isImage) {\n prefix = 'image_'\n predicate = ns.vcard('hasPhoto')\n } else {\n prefix = 'attachment_'\n predicate = ns.wf('attachment')\n }\n\n let n, pic\n for (n = 0; ; n++) {\n // Check filename is not used or invent new one\n pic = kb.sym(subject.dir().uri + filename)\n if (!kb.holds(subject, ns.vcard('hasPhoto'), pic)) {\n break\n }\n filename = prefix + n + '.' + extension\n }\n console.log(\n 'Putting ' +\n data.byteLength +\n ' bytes of ' +\n contentType +\n ' to ' +\n pic\n )\n kb.fetcher\n .webOperation('PUT', pic.uri, {\n data,\n contentType\n })\n .then(function (response) {\n if (!response.ok) {\n complain('Error uploading ' + pic + ':' + response.status)\n return\n }\n console.log(' Upload: put OK: ' + pic)\n kb.add(subject, predicate, pic, subject.doc())\n kb.fetcher\n .putBack(subject.doc(), { contentType: 'text/turtle' })\n .then(\n function (_response) {\n if (isImage) {\n mugshotDiv.refresh()\n }\n },\n function (err) {\n console.log(\n ' Write back image link FAIL ' + pic + ', Error: ' + err\n )\n }\n )\n })\n }\n\n // When a set of URIs are dropped on\n async function handleURIsDroppedOnMugshot (uris) {\n for (const u of uris) {\n let thing = $rdf.sym(u) // Attachment needs text label to disinguish I think not icon.\n console.log('Dropped on mugshot thing ' + thing) // icon was: UI.icons.iconBase + 'noun_25830.svg'\n if (u.startsWith('http') && u.indexOf('#') < 0) {\n // Plain document\n // Take a copy of a photo on the web:\n if (u.startsWith('http:')) { // because of browser mixed content stuff can't read http:\n thing = $rdf.sym('https:' + u.slice(5))\n }\n const options = { withCredentials: false, credentials: 'omit' }\n let result\n try {\n result = await kb.fetcher.webOperation('GET', thing.uri, options)\n } catch (err) {\n complain(\n `Gallery: fetch error trying to read picture ${thing} data: ${err}`\n )\n handleDroppedThing(thing)\n return\n }\n const contentType = result.headers.get('Content-Type')\n let pathEnd = thing.uri.split('/').slice(-1)[0] // last segment as putative filename\n pathEnd = pathEnd.split('?')[0] // chop off any query params\n const data = await result.arrayBuffer()\n if (!result.ok) {\n alert('Cant download, so will link image. ' + thing + ':' + result.status)\n handleDroppedThing(thing)\n return\n }\n uploadFileToContact(pathEnd, contentType, data)\n return\n } else {\n alert(\n 'Not a web document URI, cannot copy as picture: ' + thing\n )\n }\n handleDroppedThing(thing)\n }\n }\n\n // Drop an image file to set up the mugshot\n function droppedFileHandler (files) {\n for (let i = 0; i < files.length; i++) {\n const f = files[i]\n console.log(\n ' contacts: Filename: ' +\n f.name +\n ', type: ' +\n (f.type || 'n/a') +\n ' size: ' +\n f.size +\n ' bytes, last modified: ' +\n (f.lastModifiedDate\n ? f.lastModifiedDate.toLocaleDateString()\n : 'n/a')\n ) // See e.g. https://www.html5rocks.com/en/tutorials/file/dndfiles/\n\n // @@ Add: progress bar(s)\n const reader = new FileReader()\n reader.onload = (function (theFile) {\n return function (e) {\n const data = e.target.result\n console.log(' File read byteLength : ' + data.byteLength)\n const filename = encodeURIComponent(theFile.name)\n const contentType = theFile.type\n uploadFileToContact(filename, contentType, data)\n }\n })(f)\n reader.readAsArrayBuffer(f)\n }\n }\n\n function elementForImage (image) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 10em; border-radius: 1em; margin: 0.7em;'\n )\n UI.widgets.makeDropTarget(\n img,\n handleURIsDroppedOnMugshot,\n droppedFileHandler\n )\n if (image) {\n // img.setAttribute('src', image.uri) use token and works with NSS but not with CSS\n // we need to get image with authenticated fetch\n store.fetcher._fetch(image.uri)\n .then(function (response) {\n return response.blob()\n })\n .then(function (myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL)\n })\n UI.widgets.makeDraggable(img, image)\n }\n return img\n }\n\n function syncMugshots () {\n let images = kb.each(subject, ns.vcard('hasPhoto')) // Priviledge vcard ones\n images.sort() // arbitrary consistency\n images = images.slice(0, 5) // max number for the space\n if (images.length === 0) {\n mugshotDiv.innerHTML = '' // strictly, don't remove it if already there\n if (editable) {\n mugshotDiv.appendChild(placeholder) // A head image to drop pictures on\n } // otherwise leave gallery empty .. nothing to see here folks\n } else {\n utils.syncTableToArray(mugshotDiv, images, elementForImage)\n }\n }\n\n // Good URI for a Camera picture\n function getImageDoc () {\n const imageDoc = kb.sym(\n subject.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n // Store picture\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await linkToPicture(subject, imageDoc)\n syncMugshots()\n }\n }\n\n function trashCan () {\n const button = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_925021.svg',\n 'Drag here to delete'\n )\n async function droppedURIHandler (uris) {\n const images = kb\n .each(subject, ns.vcard('hasPhoto'))\n .map(x => x.uri)\n for (const uri of uris) {\n if (!images.includes(uri)) {\n alert('Only drop images in this contact onto this trash can.')\n return\n }\n if (confirm(`Permanently DELETE image ${uri} completely?`)) {\n console.log('Unlinking image file ' + uri)\n await linkToPicture(subject, kb.sym(uri), true)\n try {\n console.log('Deleting image file ' + uri)\n await kb.fetcher.webOperation('DELETE', uri)\n } catch (err) {\n alert('Unable to delete picture! ' + err)\n }\n }\n }\n syncMugshots()\n }\n UI.widgets.makeDropTarget(button, droppedURIHandler, null)\n return button\n }\n\n function renderImageTools () {\n const imageToolTable = dom.createElement('table')\n const row = imageToolTable.appendChild(dom.createElement('tr'))\n const left = row.appendChild(dom.createElement('td'))\n const middle = row.appendChild(dom.createElement('td'))\n const right = row.appendChild(dom.createElement('td'))\n\n left.appendChild(\n UI.media.cameraButton(dom, kb, getImageDoc, tookPicture)\n ) // 20190812\n try {\n middle.appendChild(\n UI.widgets.fileUploadButtonDiv(dom, droppedFileHandler)\n )\n } catch (e) {\n console.log('ignore fileUploadButtonDiv error for now', e)\n }\n right.appendChild(trashCan())\n return imageToolTable\n }\n\n // Body of renderMugshotGallery\n\n const editable = kb.updater.editable(subject.doc().uri, kb)\n const galleryDiv = dom.createElement('div')\n const mugshotDiv = galleryDiv.appendChild(dom.createElement('div'))\n const placeholder = elementForImage()\n UI.widgets.setImage(placeholder, subject) // Fallback icon or get from web\n syncMugshots()\n mugshotDiv.refresh = syncMugshots\n if (editable) {\n galleryDiv.appendChild(renderImageTools())\n }\n return galleryDiv\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,IAAA,GAAAL,uBAAA,CAAAC,OAAA;AAA8B,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAM,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA,gBAAAG,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAG,CAAA,OAAAK,CAAA,IAAAD,CAAA,GAAAS,MAAA,CAAA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jC,IAAIK,QAAQ,EAAE;IACZjG,UAAU,CAACC,WAAW,CAACiH,gBAAgB,CAAC,CAAC,CAAC;EAC5C;EACA,OAAOlH,UAAU;AACnB","ignoreList":[]}
|
package/dist/webidControl.js
CHANGED
|
@@ -17,6 +17,7 @@ var UI = _interopRequireWildcard(require("solid-ui"));
|
|
|
17
17
|
var _solidLogic = require("solid-logic");
|
|
18
18
|
var _contactLogic = require("./contactLogic");
|
|
19
19
|
var _autocompleteBar = require("./autocompleteBar");
|
|
20
|
+
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
20
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
22
|
// Render a control to record the webids we have for this agent
|
|
22
23
|
|
|
@@ -24,7 +25,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
24
25
|
|
|
25
26
|
// import { wikidataParameters, loadPublicDataThing, wikidataClasses } from './lib/publicData' // dbpediaParameters
|
|
26
27
|
|
|
27
|
-
const $rdf = UI.rdf;
|
|
28
28
|
const ns = UI.ns;
|
|
29
29
|
const widgets = UI.widgets;
|
|
30
30
|
const utils = UI.utils;
|
package/dist/webidControl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webidControl.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_contactLogic","_autocompleteBar","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","$rdf","rdf","ns","widgets","utils","kb","store","style","wikidataClasses","publicData","wikidataParameters","WEBID_NOUN","PUBLICID_NOUN","DOWN_ARROW","icons","iconBase","UP_ARROW","webidPanelBackgroundColor","addWebIDToContacts","person","webid","urlType","_url","URL","error","Error","console","log","vcardURLThing","bnode","insertables","st","vcard","doc","groups","each","deletables","forEach","group","concat","statementsMatching","push","sym","owl","updateMany","err","removeWebIDFromContacts","existing","filter","urlObject","holds","length","updater","update","removeFromGroups","insertInGroups","getSameAs","thing","found","Set","agenda","uri","size","Array","from","delete","add","node","next","schema","map","getPersonas","lits","vcardWebIDs","strings","lit","value","personas","sort","x","sameTerm","any","isOrganization","agent","renderNamedPane","dom","subject","paneName","dataBrowserContext","p","session","paneRegistry","byName","d","render","setAttribute","renderWebIdControl","options","longPrompt","idNoun","renderIdControl","renderPublicIdControl","orgClass","orgClassId","classId","dbLookup","class","queryParams","renderPersona","persona","profileOpenHandler","_event","profileIsVisible","main","visibility","openButton","children","src","renderNewRow","webidObject","Literal","deleteFunction","div","appendChild","errorMessageBlock","refreshWebIDTable","isWebId","delFunParam","editable","opts","draggable","title","split","image","faviconOrDefault","site","row","personTR","foaf","textConent","backgroundColor","padding","createElement","width","personaTable","nav","mainRow","mainCell","rhs","button","float","border","loadPublicDataThing","then","_resp","join","prompt","display","syncTableToArrayReOrdered","profileArea","addOneIdAndRefresh","h4","textContent","formHeadingStyle","color","highlightColor","commentStyle","table","manualURIEntry","renderAutocompleteControl"],"sources":["../src/webidControl.js"],"sourcesContent":["// Render a control to record the webids we have for this agent\n\nimport * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { updateMany } from './contactLogic'\n// import { renderAutoComplete } from './lib/autocompletePicker' // dbpediaParameters\nimport { renderAutocompleteControl } from './autocompleteBar'\n// import { wikidataParameters, loadPublicDataThing, wikidataClasses } from './lib/publicData' // dbpediaParameters\n\nconst $rdf = UI.rdf\nconst ns = UI.ns\nconst widgets = UI.widgets\nconst utils = UI.utils\nconst kb = store\nconst style = UI.style\n\nconst wikidataClasses = widgets.publicData.wikidataClasses // @@ move to solid-logic\nconst wikidataParameters = widgets.publicData.wikidataParameters // @@ move to solid-logic\n\nconst WEBID_NOUN = 'Solid ID'\nconst PUBLICID_NOUN = 'In public data'\nconst DOWN_ARROW = UI.icons.iconBase + 'noun_1369241.svg'\nconst UP_ARROW = UI.icons.iconBase + 'noun_1369237.svg'\nconst webidPanelBackgroundColor = '#ffe6ff'\n\n/// ///////////////////////// Logic\n\nexport async function addWebIDToContacts (person, webid, urlType, kb) {\n /*\n if (!webid.startsWith('https:')) { /// @@ well we will have other protcols like DID\n if (webid.startsWith('http://') {\n webid = 'https:' + webid.slice(5) // @@ No, data won't match in store. Add the 's' on fetch()\n } else {\n throw new Error('Does not look like a webid, must start with https: ' + webid)\n }\n }\n */\n\n // check this is a url\n try {\n // eslint-disable-next-line no-unused-vars\n const _url = new URL(webid)\n } catch (error) {\n throw new Error(`${WEBID_NOUN}: ${webid} is not a valid url.`)\n }\n\n // create a person's webID\n console.log(`Adding to ${person} a ${WEBID_NOUN}: ${webid}.`)\n const vcardURLThing = kb.bnode()\n const insertables = [\n $rdf.st(person, ns.vcard('url'), vcardURLThing, person.doc()),\n $rdf.st(vcardURLThing, ns.rdf('type'), urlType, person.doc()),\n $rdf.st(vcardURLThing, ns.vcard('value'), webid, person.doc())\n ]\n // insert WebID in groups\n // replace person with WebID in vcard:hasMember (WebID may already exist)\n // insert owl:sameAs\n const groups = kb.each(null, ns.vcard('hasMember'), person)\n let deletables = []\n groups.forEach(group => {\n deletables = deletables.concat(kb.statementsMatching(group, ns.vcard('hasMember'), person, group.doc()))\n insertables.push($rdf.st(group, ns.vcard('hasMember'), kb.sym(webid), group.doc())) // May exist; do we need to check?\n insertables.push($rdf.st(kb.sym(webid), ns.owl('sameAs'), person, group.doc()))\n })\n try {\n await updateMany(deletables, insertables)\n } catch (err) { throw new Error(`Could not create webId ${WEBID_NOUN}: ${webid}.`) }\n}\n\nexport async function removeWebIDFromContacts (person, webid, urlType, kb) {\n console.log(`Removing from ${person} their ${WEBID_NOUN}: ${webid}.`)\n\n // remove webID from card\n const existing = kb.each(person, ns.vcard('url'), null, person.doc())\n .filter(urlObject => kb.holds(urlObject, ns.rdf('type'), urlType, person.doc()))\n .filter(urlObject => kb.holds(urlObject, ns.vcard('value'), webid, person.doc()))\n if (!existing.length) {\n throw new Error(`Person ${person} does not have ${WEBID_NOUN} ${webid}.`)\n }\n const vcardURLThing = existing[0]\n const deletables = [\n $rdf.st(person, ns.vcard('url'), vcardURLThing, person.doc()),\n $rdf.st(vcardURLThing, ns.rdf('type'), urlType, person.doc()),\n $rdf.st(vcardURLThing, ns.vcard('value'), webid, person.doc())\n ]\n await kb.updater.update(deletables, [])\n\n // remove webIDs from groups\n const groups = kb.each(null, ns.vcard('hasMember'), kb.sym(webid))\n let removeFromGroups = []\n const insertInGroups = []\n groups.forEach(async group => {\n removeFromGroups = removeFromGroups.concat(kb.statementsMatching(kb.sym(webid), ns.owl('sameAs'), person, group.doc()))\n insertInGroups.push($rdf.st(group, ns.vcard('hasMember'), person, group.doc()))\n if (kb.statementsMatching(kb.sym(webid), ns.owl('sameAs'), null, group.doc()).length < 2) {\n removeFromGroups = removeFromGroups.concat(kb.statementsMatching(group, ns.vcard('hasMember'), kb.sym(webid), group.doc()))\n }\n })\n await updateMany(removeFromGroups, insertInGroups)\n}\n\n// Trace things the same as this - other IDs for same thing\n// returns as array of node\nexport function getSameAs (kb, thing, doc) { // Should this recurse?\n const found = new Set()\n const agenda = new Set([thing.uri])\n\n while (agenda.size) {\n const uri = Array.from(agenda)[0] // clumsy\n agenda.delete(uri)\n if (found.has(uri)) continue\n found.add(uri)\n const node = kb.sym(uri)\n kb.each(node, ns.owl('sameAs'), null, doc)\n .concat(kb.each(null, ns.owl('sameAs'), node, doc))\n .forEach(next => {\n console.log(' OWL sameAs found ' + next)\n agenda.add(next.uri)\n })\n kb.each(node, ns.schema('sameAs'), null, doc)\n .concat(kb.each(null, ns.schema('sameAs'), node, doc))\n .forEach(next => {\n console.log(' Schema sameAs found ' + next)\n agenda.add(next.uri)\n })\n }\n found.delete(thing.uri) // don't want the one we knew about\n return Array.from(found).map(uri => kb.sym(uri)) // return as array of nodes\n}\n\n// find person webIDs\nexport function getPersonas (kb, person) {\n const lits = vcardWebIDs(kb, person).concat(getSameAs(kb, person, person.doc()))\n const strings = new Set(lits.map(lit => lit.value)) // remove dups\n const personas = [...strings].map(uri => kb.sym(uri)) // The UI tables do better with Named Nodes than Literals\n personas.sort() // for repeatability\n personas.filter(x => !x.sameTerm(person))\n return personas\n}\n\nexport function vcardWebIDs (kb, person, urlType) {\n return kb.each(person, ns.vcard('url'), null, person.doc())\n .filter(urlObject => kb.holds(urlObject, ns.rdf('type'), urlType, person.doc()))\n .map(urlObject => kb.any(urlObject, ns.vcard('value'), null, person.doc()))\n .filter(x => !!x) // remove nulls\n}\n\nexport function isOrganization (agent) {\n const doc = agent.doc()\n return kb.holds(agent, ns.rdf('type'), ns.vcard('Organization'), doc) ||\n kb.holds(agent, ns.rdf('type'), ns.schema('Organization'), doc)\n}\n/// ////////////////////////////////////////////////////////////// UI\n\n// Utility function to render another different pane\n\nexport function renderNamedPane (dom, subject, paneName, dataBrowserContext) {\n const p = dataBrowserContext.session.paneRegistry.byName(paneName)\n const d = p.render(subject, dataBrowserContext) // @@@ change some bits of context!\n d.setAttribute(\n 'style',\n 'border: 0.1em solid #444; border-radius: 0.5em'\n )\n return d\n}\n\nexport async function renderWebIdControl (person, dataBrowserContext) {\n const options = {\n longPrompt: `If you know someone's ${WEBID_NOUN}, you can do more stuff with them.\n To record their ${WEBID_NOUN}, drag it onto the plus, or click the plus\n to enter it by hand.`,\n idNoun: WEBID_NOUN,\n urlType: ns.vcard('WebID')\n }\n return renderIdControl(person, dataBrowserContext, options)\n}\n\nexport async function renderPublicIdControl (person, dataBrowserContext) {\n let orgClass = kb.sym('http://www.wikidata.org/wiki/Q43229')\n let orgClassId = 'Organization'\n for (const classId in wikidataClasses) {\n if (kb.holds(person, ns.rdf('type'), ns.schema(classId), person.doc())) {\n orgClass = kb.sym(wikidataClasses[classId])\n orgClassId = classId\n console.log(` renderPublicIdControl bingo: ${classId} -> ${orgClass}`)\n }\n }\n const options = {\n longPrompt: `If you know the ${PUBLICID_NOUN} of this ${orgClassId}, you can do more stuff with it.\n To record its ${PUBLICID_NOUN}, drag it onto the plus, or click the magnifyinng glass\n to search for it in WikiData.`,\n idNoun: PUBLICID_NOUN,\n urlType: ns.vcard('PublicId'),\n dbLookup: true,\n class: orgClass, // Organization\n queryParams: wikidataParameters\n }\n return renderIdControl(person, dataBrowserContext, options)\n}\n\n// The main control rendered by this module\nexport async function renderIdControl (person, dataBrowserContext, options) {\n // IDs which are as WebId in VCARD data\n // like :me vcard:hasURL [ a vcard:WebId; vcard:value <https://...foo> ]\n //\n // Display the data about x specifically stored at x.doc()\n // in a fold-away thing\n //\n function renderPersona (dom, persona, kb) {\n function profileOpenHandler (_event) {\n profileIsVisible = !profileIsVisible\n main.style.visibility = profileIsVisible ? 'visible' : 'collapse'\n openButton.children[0].src = profileIsVisible ? UP_ARROW : DOWN_ARROW // @@ fragile\n }\n function renderNewRow (webidObject) {\n const webid = new $rdf.Literal(webidObject.uri)\n async function deleteFunction () {\n try {\n await removeWebIDFromContacts(person, webid, options.urlType, kb)\n } catch (err) {\n div.appendChild(widgets.errorMessageBlock(dom, `Error removing Id ${webid} from ${person}: ${err}`))\n }\n await refreshWebIDTable()\n }\n const isWebId = options.urlType.sameTerm(ns.vcard('WebID'))\n const delFunParam = options.editable ? deleteFunction : null\n const opts = { deleteFunction: delFunParam, draggable: true }\n if (isWebId) {\n opts.title = webidObject.uri.split('/')[2]\n opts.image = widgets.faviconOrDefault(dom, webidObject.site()) // just for domain\n }\n const row = widgets.personTR(dom, UI.ns.foaf('knows'), webidObject, opts)\n if (isWebId) {\n row.children[1].textConent = opts.title // @@ will be overwritten\n row.style.backgroundColor = webidPanelBackgroundColor\n }\n row.style.padding = '0.2em'\n return row\n }\n\n const div = dom.createElement('div')\n div.style.width = '100%'\n const personaTable = div.appendChild(dom.createElement('table'))\n personaTable.style.width = '100%'\n const nav = personaTable.appendChild(renderNewRow(persona))\n nav.style.width = '100%'\n const mainRow = personaTable.appendChild(dom.createElement('tr'))\n const mainCell = mainRow.appendChild(dom.createElement('td'))\n mainCell.setAttribute('colspan', 3)\n let main\n\n let profileIsVisible = true\n\n const rhs = nav.children[2]\n const openButton = rhs.appendChild(widgets.button(dom, DOWN_ARROW, 'View', profileOpenHandler))\n openButton.style.float = 'right'\n delete openButton.style.backgroundColor\n delete openButton.style.border\n const paneName = isOrganization(person) || isOrganization(persona) ? 'profile' : 'profile' // was default for org\n\n widgets.publicData.loadPublicDataThing(kb, person, persona).then(_resp => {\n // loadPublicDataThing(kb, person, persona).then(_resp => {\n try {\n main = renderNamedPane(dom, persona, paneName, dataBrowserContext)\n console.log('main: ', main)\n main.style.width = '100%'\n console.log('renderIdControl: main element: ', main)\n // main.style.visibility = 'collapse'\n mainCell.appendChild(main)\n } catch (err) {\n main = widgets.errorMessageBlock(dom, `Problem displaying persona ${persona}: ${err}`)\n mainCell.appendChild(main)\n }\n }, err => {\n main = widgets.errorMessageBlock(dom, `Error loading persona ${persona}: ${err}`)\n mainCell.appendChild(main)\n })\n return div\n } // renderPersona\n\n async function refreshWebIDTable () {\n const personas = getPersonas(kb, person)\n console.log('WebId personas: ' + person + ' -> ' + personas.map(p => p.uri).join(',\\n '))\n prompt.style.display = personas.length ? 'none' : ''\n utils.syncTableToArrayReOrdered(profileArea, personas, persona => renderPersona(dom, persona, kb))\n }\n async function addOneIdAndRefresh (person, webid) {\n try {\n await addWebIDToContacts(person, webid, options.urlType, kb)\n } catch (err) {\n div.appendChild(widgets.errorMessageBlock(dom, `Error adding Id ${webid} to ${person}: ${err}`))\n }\n await refreshWebIDTable()\n }\n\n const { dom } = dataBrowserContext\n options = options || {}\n options.editable = kb.updater.editable(person.doc().uri, kb)\n const div = dom.createElement('div')\n div.style = 'border-radius:0.3em; border: 0.1em solid #888;' // padding: 0.8em;\n\n if (getPersonas(kb, person).length === 0 && !options.editable) {\n div.style.display = 'none'\n return div // No point listing an empty list you can't change\n }\n\n const h4 = div.appendChild(dom.createElement('h4'))\n h4.textContent = options.idNoun\n h4.style = style.formHeadingStyle\n h4.style.color = style.highlightColor\n\n const prompt = div.appendChild(dom.createElement('p'))\n prompt.style = style.commentStyle\n prompt.textContent = options.longPrompt\n const table = div.appendChild(dom.createElement('table'))\n table.style.width = '100%'\n\n if (options.editable) { // test\n options.manualURIEntry = true // introduced in solid-ui 2.4.2\n options.queryParams = options.queryParams || wikidataParameters\n div.appendChild(await renderAutocompleteControl(dom, person, options, addOneIdAndRefresh))\n // div.appendChild(await widgets.renderAutocompleteControl(dom, person, options, addOneIdAndRefresh))\n }\n const profileArea = div.appendChild(dom.createElement('div'))\n await refreshWebIDTable()\n\n return div\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAA6D,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAA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,CAAC;EAC7D,MAAMjB,iBAAiB,CAAC,CAAC;EAEzB,OAAOH,GAAG;AACZ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"webidControl.js","names":["UI","_interopRequireWildcard","require","_solidLogic","_contactLogic","_autocompleteBar","$rdf","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ns","widgets","utils","kb","store","style","wikidataClasses","publicData","wikidataParameters","WEBID_NOUN","PUBLICID_NOUN","DOWN_ARROW","icons","iconBase","UP_ARROW","webidPanelBackgroundColor","addWebIDToContacts","person","webid","urlType","_url","URL","error","Error","console","log","vcardURLThing","bnode","insertables","st","vcard","doc","rdf","groups","each","deletables","forEach","group","concat","statementsMatching","push","sym","owl","updateMany","err","removeWebIDFromContacts","existing","filter","urlObject","holds","length","updater","update","removeFromGroups","insertInGroups","getSameAs","thing","found","Set","agenda","uri","size","Array","from","delete","add","node","next","schema","map","getPersonas","lits","vcardWebIDs","strings","lit","value","personas","sort","x","sameTerm","any","isOrganization","agent","renderNamedPane","dom","subject","paneName","dataBrowserContext","p","session","paneRegistry","byName","d","render","setAttribute","renderWebIdControl","options","longPrompt","idNoun","renderIdControl","renderPublicIdControl","orgClass","orgClassId","classId","dbLookup","class","queryParams","renderPersona","persona","profileOpenHandler","_event","profileIsVisible","main","visibility","openButton","children","src","renderNewRow","webidObject","Literal","deleteFunction","div","appendChild","errorMessageBlock","refreshWebIDTable","isWebId","delFunParam","editable","opts","draggable","title","split","image","faviconOrDefault","site","row","personTR","foaf","textConent","backgroundColor","padding","createElement","width","personaTable","nav","mainRow","mainCell","rhs","button","float","border","loadPublicDataThing","then","_resp","join","prompt","display","syncTableToArrayReOrdered","profileArea","addOneIdAndRefresh","h4","textContent","formHeadingStyle","color","highlightColor","commentStyle","table","manualURIEntry","renderAutocompleteControl"],"sources":["../src/webidControl.js"],"sourcesContent":["// Render a control to record the webids we have for this agent\n\nimport * as UI from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { updateMany } from './contactLogic'\n// import { renderAutoComplete } from './lib/autocompletePicker' // dbpediaParameters\nimport { renderAutocompleteControl } from './autocompleteBar'\n// import { wikidataParameters, loadPublicDataThing, wikidataClasses } from './lib/publicData' // dbpediaParameters\nimport * as $rdf from 'rdflib'\n\nconst ns = UI.ns\nconst widgets = UI.widgets\nconst utils = UI.utils\nconst kb = store\nconst style = UI.style\n\nconst wikidataClasses = widgets.publicData.wikidataClasses // @@ move to solid-logic\nconst wikidataParameters = widgets.publicData.wikidataParameters // @@ move to solid-logic\n\nconst WEBID_NOUN = 'Solid ID'\nconst PUBLICID_NOUN = 'In public data'\nconst DOWN_ARROW = UI.icons.iconBase + 'noun_1369241.svg'\nconst UP_ARROW = UI.icons.iconBase + 'noun_1369237.svg'\nconst webidPanelBackgroundColor = '#ffe6ff'\n\n/// ///////////////////////// Logic\n\nexport async function addWebIDToContacts (person, webid, urlType, kb) {\n /*\n if (!webid.startsWith('https:')) { /// @@ well we will have other protcols like DID\n if (webid.startsWith('http://') {\n webid = 'https:' + webid.slice(5) // @@ No, data won't match in store. Add the 's' on fetch()\n } else {\n throw new Error('Does not look like a webid, must start with https: ' + webid)\n }\n }\n */\n\n // check this is a url\n try {\n // eslint-disable-next-line no-unused-vars\n const _url = new URL(webid)\n } catch (error) {\n throw new Error(`${WEBID_NOUN}: ${webid} is not a valid url.`)\n }\n\n // create a person's webID\n console.log(`Adding to ${person} a ${WEBID_NOUN}: ${webid}.`)\n const vcardURLThing = kb.bnode()\n const insertables = [\n $rdf.st(person, ns.vcard('url'), vcardURLThing, person.doc()),\n $rdf.st(vcardURLThing, ns.rdf('type'), urlType, person.doc()),\n $rdf.st(vcardURLThing, ns.vcard('value'), webid, person.doc())\n ]\n // insert WebID in groups\n // replace person with WebID in vcard:hasMember (WebID may already exist)\n // insert owl:sameAs\n const groups = kb.each(null, ns.vcard('hasMember'), person)\n let deletables = []\n groups.forEach(group => {\n deletables = deletables.concat(kb.statementsMatching(group, ns.vcard('hasMember'), person, group.doc()))\n insertables.push($rdf.st(group, ns.vcard('hasMember'), kb.sym(webid), group.doc())) // May exist; do we need to check?\n insertables.push($rdf.st(kb.sym(webid), ns.owl('sameAs'), person, group.doc()))\n })\n try {\n await updateMany(deletables, insertables)\n } catch (err) { throw new Error(`Could not create webId ${WEBID_NOUN}: ${webid}.`) }\n}\n\nexport async function removeWebIDFromContacts (person, webid, urlType, kb) {\n console.log(`Removing from ${person} their ${WEBID_NOUN}: ${webid}.`)\n\n // remove webID from card\n const existing = kb.each(person, ns.vcard('url'), null, person.doc())\n .filter(urlObject => kb.holds(urlObject, ns.rdf('type'), urlType, person.doc()))\n .filter(urlObject => kb.holds(urlObject, ns.vcard('value'), webid, person.doc()))\n if (!existing.length) {\n throw new Error(`Person ${person} does not have ${WEBID_NOUN} ${webid}.`)\n }\n const vcardURLThing = existing[0]\n const deletables = [\n $rdf.st(person, ns.vcard('url'), vcardURLThing, person.doc()),\n $rdf.st(vcardURLThing, ns.rdf('type'), urlType, person.doc()),\n $rdf.st(vcardURLThing, ns.vcard('value'), webid, person.doc())\n ]\n await kb.updater.update(deletables, [])\n\n // remove webIDs from groups\n const groups = kb.each(null, ns.vcard('hasMember'), kb.sym(webid))\n let removeFromGroups = []\n const insertInGroups = []\n groups.forEach(async group => {\n removeFromGroups = removeFromGroups.concat(kb.statementsMatching(kb.sym(webid), ns.owl('sameAs'), person, group.doc()))\n insertInGroups.push($rdf.st(group, ns.vcard('hasMember'), person, group.doc()))\n if (kb.statementsMatching(kb.sym(webid), ns.owl('sameAs'), null, group.doc()).length < 2) {\n removeFromGroups = removeFromGroups.concat(kb.statementsMatching(group, ns.vcard('hasMember'), kb.sym(webid), group.doc()))\n }\n })\n await updateMany(removeFromGroups, insertInGroups)\n}\n\n// Trace things the same as this - other IDs for same thing\n// returns as array of node\nexport function getSameAs (kb, thing, doc) { // Should this recurse?\n const found = new Set()\n const agenda = new Set([thing.uri])\n\n while (agenda.size) {\n const uri = Array.from(agenda)[0] // clumsy\n agenda.delete(uri)\n if (found.has(uri)) continue\n found.add(uri)\n const node = kb.sym(uri)\n kb.each(node, ns.owl('sameAs'), null, doc)\n .concat(kb.each(null, ns.owl('sameAs'), node, doc))\n .forEach(next => {\n console.log(' OWL sameAs found ' + next)\n agenda.add(next.uri)\n })\n kb.each(node, ns.schema('sameAs'), null, doc)\n .concat(kb.each(null, ns.schema('sameAs'), node, doc))\n .forEach(next => {\n console.log(' Schema sameAs found ' + next)\n agenda.add(next.uri)\n })\n }\n found.delete(thing.uri) // don't want the one we knew about\n return Array.from(found).map(uri => kb.sym(uri)) // return as array of nodes\n}\n\n// find person webIDs\nexport function getPersonas (kb, person) {\n const lits = vcardWebIDs(kb, person).concat(getSameAs(kb, person, person.doc()))\n const strings = new Set(lits.map(lit => lit.value)) // remove dups\n const personas = [...strings].map(uri => kb.sym(uri)) // The UI tables do better with Named Nodes than Literals\n personas.sort() // for repeatability\n personas.filter(x => !x.sameTerm(person))\n return personas\n}\n\nexport function vcardWebIDs (kb, person, urlType) {\n return kb.each(person, ns.vcard('url'), null, person.doc())\n .filter(urlObject => kb.holds(urlObject, ns.rdf('type'), urlType, person.doc()))\n .map(urlObject => kb.any(urlObject, ns.vcard('value'), null, person.doc()))\n .filter(x => !!x) // remove nulls\n}\n\nexport function isOrganization (agent) {\n const doc = agent.doc()\n return kb.holds(agent, ns.rdf('type'), ns.vcard('Organization'), doc) ||\n kb.holds(agent, ns.rdf('type'), ns.schema('Organization'), doc)\n}\n/// ////////////////////////////////////////////////////////////// UI\n\n// Utility function to render another different pane\n\nexport function renderNamedPane (dom, subject, paneName, dataBrowserContext) {\n const p = dataBrowserContext.session.paneRegistry.byName(paneName)\n const d = p.render(subject, dataBrowserContext) // @@@ change some bits of context!\n d.setAttribute(\n 'style',\n 'border: 0.1em solid #444; border-radius: 0.5em'\n )\n return d\n}\n\nexport async function renderWebIdControl (person, dataBrowserContext) {\n const options = {\n longPrompt: `If you know someone's ${WEBID_NOUN}, you can do more stuff with them.\n To record their ${WEBID_NOUN}, drag it onto the plus, or click the plus\n to enter it by hand.`,\n idNoun: WEBID_NOUN,\n urlType: ns.vcard('WebID')\n }\n return renderIdControl(person, dataBrowserContext, options)\n}\n\nexport async function renderPublicIdControl (person, dataBrowserContext) {\n let orgClass = kb.sym('http://www.wikidata.org/wiki/Q43229')\n let orgClassId = 'Organization'\n for (const classId in wikidataClasses) {\n if (kb.holds(person, ns.rdf('type'), ns.schema(classId), person.doc())) {\n orgClass = kb.sym(wikidataClasses[classId])\n orgClassId = classId\n console.log(` renderPublicIdControl bingo: ${classId} -> ${orgClass}`)\n }\n }\n const options = {\n longPrompt: `If you know the ${PUBLICID_NOUN} of this ${orgClassId}, you can do more stuff with it.\n To record its ${PUBLICID_NOUN}, drag it onto the plus, or click the magnifyinng glass\n to search for it in WikiData.`,\n idNoun: PUBLICID_NOUN,\n urlType: ns.vcard('PublicId'),\n dbLookup: true,\n class: orgClass, // Organization\n queryParams: wikidataParameters\n }\n return renderIdControl(person, dataBrowserContext, options)\n}\n\n// The main control rendered by this module\nexport async function renderIdControl (person, dataBrowserContext, options) {\n // IDs which are as WebId in VCARD data\n // like :me vcard:hasURL [ a vcard:WebId; vcard:value <https://...foo> ]\n //\n // Display the data about x specifically stored at x.doc()\n // in a fold-away thing\n //\n function renderPersona (dom, persona, kb) {\n function profileOpenHandler (_event) {\n profileIsVisible = !profileIsVisible\n main.style.visibility = profileIsVisible ? 'visible' : 'collapse'\n openButton.children[0].src = profileIsVisible ? UP_ARROW : DOWN_ARROW // @@ fragile\n }\n function renderNewRow (webidObject) {\n const webid = new $rdf.Literal(webidObject.uri)\n async function deleteFunction () {\n try {\n await removeWebIDFromContacts(person, webid, options.urlType, kb)\n } catch (err) {\n div.appendChild(widgets.errorMessageBlock(dom, `Error removing Id ${webid} from ${person}: ${err}`))\n }\n await refreshWebIDTable()\n }\n const isWebId = options.urlType.sameTerm(ns.vcard('WebID'))\n const delFunParam = options.editable ? deleteFunction : null\n const opts = { deleteFunction: delFunParam, draggable: true }\n if (isWebId) {\n opts.title = webidObject.uri.split('/')[2]\n opts.image = widgets.faviconOrDefault(dom, webidObject.site()) // just for domain\n }\n const row = widgets.personTR(dom, UI.ns.foaf('knows'), webidObject, opts)\n if (isWebId) {\n row.children[1].textConent = opts.title // @@ will be overwritten\n row.style.backgroundColor = webidPanelBackgroundColor\n }\n row.style.padding = '0.2em'\n return row\n }\n\n const div = dom.createElement('div')\n div.style.width = '100%'\n const personaTable = div.appendChild(dom.createElement('table'))\n personaTable.style.width = '100%'\n const nav = personaTable.appendChild(renderNewRow(persona))\n nav.style.width = '100%'\n const mainRow = personaTable.appendChild(dom.createElement('tr'))\n const mainCell = mainRow.appendChild(dom.createElement('td'))\n mainCell.setAttribute('colspan', 3)\n let main\n\n let profileIsVisible = true\n\n const rhs = nav.children[2]\n const openButton = rhs.appendChild(widgets.button(dom, DOWN_ARROW, 'View', profileOpenHandler))\n openButton.style.float = 'right'\n delete openButton.style.backgroundColor\n delete openButton.style.border\n const paneName = isOrganization(person) || isOrganization(persona) ? 'profile' : 'profile' // was default for org\n\n widgets.publicData.loadPublicDataThing(kb, person, persona).then(_resp => {\n // loadPublicDataThing(kb, person, persona).then(_resp => {\n try {\n main = renderNamedPane(dom, persona, paneName, dataBrowserContext)\n console.log('main: ', main)\n main.style.width = '100%'\n console.log('renderIdControl: main element: ', main)\n // main.style.visibility = 'collapse'\n mainCell.appendChild(main)\n } catch (err) {\n main = widgets.errorMessageBlock(dom, `Problem displaying persona ${persona}: ${err}`)\n mainCell.appendChild(main)\n }\n }, err => {\n main = widgets.errorMessageBlock(dom, `Error loading persona ${persona}: ${err}`)\n mainCell.appendChild(main)\n })\n return div\n } // renderPersona\n\n async function refreshWebIDTable () {\n const personas = getPersonas(kb, person)\n console.log('WebId personas: ' + person + ' -> ' + personas.map(p => p.uri).join(',\\n '))\n prompt.style.display = personas.length ? 'none' : ''\n utils.syncTableToArrayReOrdered(profileArea, personas, persona => renderPersona(dom, persona, kb))\n }\n async function addOneIdAndRefresh (person, webid) {\n try {\n await addWebIDToContacts(person, webid, options.urlType, kb)\n } catch (err) {\n div.appendChild(widgets.errorMessageBlock(dom, `Error adding Id ${webid} to ${person}: ${err}`))\n }\n await refreshWebIDTable()\n }\n\n const { dom } = dataBrowserContext\n options = options || {}\n options.editable = kb.updater.editable(person.doc().uri, kb)\n const div = dom.createElement('div')\n div.style = 'border-radius:0.3em; border: 0.1em solid #888;' // padding: 0.8em;\n\n if (getPersonas(kb, person).length === 0 && !options.editable) {\n div.style.display = 'none'\n return div // No point listing an empty list you can't change\n }\n\n const h4 = div.appendChild(dom.createElement('h4'))\n h4.textContent = options.idNoun\n h4.style = style.formHeadingStyle\n h4.style.color = style.highlightColor\n\n const prompt = div.appendChild(dom.createElement('p'))\n prompt.style = style.commentStyle\n prompt.textContent = options.longPrompt\n const table = div.appendChild(dom.createElement('table'))\n table.style.width = '100%'\n\n if (options.editable) { // test\n options.manualURIEntry = true // introduced in solid-ui 2.4.2\n options.queryParams = options.queryParams || wikidataParameters\n div.appendChild(await renderAutocompleteControl(dom, person, options, addOneIdAndRefresh))\n // div.appendChild(await widgets.renderAutocompleteControl(dom, person, options, addOneIdAndRefresh))\n }\n const profileArea = div.appendChild(dom.createElement('div'))\n await refreshWebIDTable()\n\n return div\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,IAAA,GAAAL,uBAAA,CAAAC,OAAA;AAA8B,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,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,WAAW,IAAIlG,kBAAkB;IAC/DiH,GAAG,CAACC,WAAW,CAAC,MAAM,IAAA8C,0CAAyB,EAACpF,GAAG,EAAEnE,MAAM,EAAE+E,OAAO,EAAE+D,kBAAkB,CAAC,CAAC;IAC1F;EACF;EACA,MAAMD,WAAW,GAAGrC,GAAG,CAACC,WAAW,CAACtC,GAAG,CAACyD,aAAa,CAAC,KAAK,CAAC,CAAC;EAC7D,MAAMjB,iBAAiB,CAAC,CAAC;EAEzB,OAAOH,GAAG;AACZ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contacts-pane",
|
|
3
|
-
"version": "2.7.1-
|
|
3
|
+
"version": "2.7.1-ca201736",
|
|
4
4
|
"description": "Contacts Pane: Contacts manager for Address Book, Groups, and Individuals.",
|
|
5
5
|
"main": "dist/contactsPane.js",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"test": "jest --no-coverage",
|
|
22
22
|
"test-coverage": "jest --coverage",
|
|
23
23
|
"ignore:prepublishOnly": "npm run build && npm run lint && npm run test",
|
|
24
|
-
"preversion": "npm run lint && npm run test",
|
|
24
|
+
"preversion": "npm run lint && npm run typecheck && npm run test",
|
|
25
25
|
"ignore:postpublish": "git push origin main --follow-tags"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"mime-types": "^3.0.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"rdflib": "^2.
|
|
55
|
-
"solid-logic": "3.1.1-
|
|
56
|
-
"solid-ui": "2.6.1-
|
|
54
|
+
"rdflib": "^2.3.0",
|
|
55
|
+
"solid-logic": "3.1.1-bf9b34c",
|
|
56
|
+
"solid-ui": "2.6.1-c3ff185"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/cli": "^7.28.0",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"@babel/preset-typescript": "^7.27.1",
|
|
63
63
|
"@testing-library/jest-dom": "^6.6.4",
|
|
64
64
|
"@types/jest": "^30.0.0",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
66
65
|
"@typescript-eslint/parser": "^8.39.0",
|
|
67
66
|
"babel-jest": "^30.0.5",
|
|
68
67
|
"babel-loader": "^10.0.0",
|
|
@@ -71,14 +70,14 @@
|
|
|
71
70
|
"eslint": "^9.33.0",
|
|
72
71
|
"eslint-plugin-import": "^2.32.0",
|
|
73
72
|
"globals": "^16.3.0",
|
|
74
|
-
"jest": "^
|
|
73
|
+
"jest": "^29.7.0",
|
|
75
74
|
"jest-environment-jsdom": "^30.0.5",
|
|
76
75
|
"jest-fetch-mock": "^3.0.3",
|
|
77
76
|
"neostandard": "^0.12.2",
|
|
78
|
-
"pane-registry": "2.5.1-
|
|
77
|
+
"pane-registry": "^2.5.1-f5c2189",
|
|
79
78
|
"rdflib": "^2.3.0",
|
|
80
|
-
"solid-logic": "3.1.1-
|
|
81
|
-
"solid-ui": "2.6.1-
|
|
79
|
+
"solid-logic": "^3.1.1-bf9b34c",
|
|
80
|
+
"solid-ui": "^2.6.1-c3ff185",
|
|
82
81
|
"typescript": "^5.9.2",
|
|
83
82
|
"typescript-transpile-only": "^0.0.4"
|
|
84
83
|
}
|